@supr-design/flux-player 0.0.0-stage → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,59 @@
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.Flux={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.defineProperty,n=(e,t)=>()=>(e&&(t=e(e=0)),t),r=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},i=class{state;bus;constructor(e){this.bus=e,this.state=this.getDefaultState()}getDefaultState(){return{status:`idle`,currentTime:0,duration:NaN,paused:!0,ended:!1,buffering:!1,muted:!1,volume:1,playbackRate:1,buffered:[],selectedQuality:`auto`,availableQualities:[],selectedSubtitle:null,availableSubtitles:[],selectedAudioTrack:`default`,availableAudioTracks:[],engineType:`none`,readyState:0,error:null,isLive:!1,isDvr:!1,source:null}}get snapshot(){return{...this.state,buffered:this.state.buffered.map(e=>({...e})),availableQualities:this.state.availableQualities.map(e=>({...e})),availableSubtitles:this.state.availableSubtitles.map(e=>({...e})),availableAudioTracks:this.state.availableAudioTracks.map(e=>({...e})),source:this.state.source?{...this.state.source}:null}}reset(){let e=this.state.volume,t=this.state.muted;this.state=this.getDefaultState(),this.state.volume=e,this.state.muted=t,this.notify()}update(e){let t=!1;for(let n of Object.keys(e))this.state[n]!==e[n]&&(this.state[n]=e[n],t=!0,this.bus.emit(`state:${n}`,e[n]));t&&this.notify()}notify(){this.bus.emit(`state:change`,this.snapshot)}},o=class{listeners=new Map;on(e,t){return this.listeners.has(e)||this.listeners.set(e,[]),this.listeners.get(e).push(t),()=>this.off(e,t)}off(e,t){let n=this.listeners.get(e);if(!n)return;let r=n.indexOf(t);r>-1&&n.splice(r,1)}emit(e,...t){let n=this.listeners.get(e);if(n)for(let r of[...n])try{r(...t)}catch(t){console.error(`Error in event listener for ${e}:`,t)}}clear(){this.listeners.clear()}},c=class{engines=[];register(e){this.engines.find(t=>t.id===e.id)||this.engines.push(e)}getEngines(){return this.engines}findEngineForSource(e,t){if(e&&e!==`auto`)return this.engines.find(t=>t.canPlayType(e))||null;for(let e of this.engines)if(e.canPlaySource(t))return e;return null}},l=[{pattern:/application\/(vnd\.apple\.mpegurl|x-mpegurl)/i,type:`hls`},{pattern:/application\/dash\+xml/i,type:`dash`},{pattern:/video\/mp4/i,type:`mp4`},{pattern:/video\/webm/i,type:`webm`}];function u(e){if(!e)return`auto`;for(let t of l)if(t.pattern.test(e))return t.type;return`auto`}function d(e){try{let t=new URL(e);return`${t.pathname}${t.search}`.toLowerCase()}catch{return e.toLowerCase()}}function f(e,t){let n=u(t);if(n!==`auto`)return n;let r=d(e);return r.includes(`.m3u8`)?`hls`:r.includes(`.mpd`)?`dash`:r.includes(`.webm`)?`webm`:r.includes(`.mp4`)?`mp4`:/(format|type)=(m3u8|hls)/i.test(r)?`hls`:/(format|type)=(mpd|dash)/i.test(r)?`dash`:`auto`}function p(e,t,n){let r=e.parentElement;if(!r||n.aborted)return Promise.resolve(`cancelled`);let i=getComputedStyle(r).position===`static`,o=r.style.position;i&&(r.style.position=`relative`);let c=document.createElement(`div`);c.style.cssText=`position:absolute;inset:0;z-index:100;background:black;color:white`;let l=document.createElement(`video`);l.style.cssText=`width:100%;height:100%;object-fit:contain`,l.playsInline=!0,l.muted=e.muted,l.volume=e.volume,l.controls=!0,l.setAttribute(`aria-label`,`Advertisement`);let u=document.createElement(`span`);return u.textContent=`Advertisement`,u.style.cssText=`position:absolute;top:12px;left:12px;background:#151515;padding:4px 8px;font:13px sans-serif;pointer-events:none`,c.append(l,u),r.append(c),new Promise(e=>{let u=!1,d,f=t=>{u||(u=!0,clearTimeout(d),n.removeEventListener(`abort`,p),l.onended=l.onerror=l.onwaiting=l.onplaying=null,l.pause(),l.removeAttribute(`src`),l.load(),c.remove(),i&&(r.style.position=o),e(t))},p=()=>f(`cancelled`),m=()=>{clearTimeout(d),d=window.setTimeout(()=>f(`failed`),1e4)};l.onended=()=>f(`ended`),l.onerror=()=>f(`failed`),l.onwaiting=m,l.onplaying=()=>clearTimeout(d),n.addEventListener(`abort`,p,{once:!0}),m(),l.src=t,l.play().catch(()=>f(`failed`))})}var m=class{bus;state;registry;currentEngine=null;currentVideoElement=null;cleans=[];generation=0;adSource;pendingMidrolls=[];adController;adPlayback;cancelAd(){this.adController?.abort(),this.adPlayback=void 0,this.adController=void 0}pendingSeekTime=null;performance={startupMode:`balanced`,startupStrategy:`balanced`,startupBufferSeconds:1.2,manifestFastPath:!1};abr={startupProfile:`balanced`,upgradeAggression:`medium`,rebufferSafetyBias:`medium`};constructor(){this.bus=new o,this.state=new i(this.bus),this.registry=new c}attachVideo(e){this.currentVideoElement=e,this.currentEngine&&this.currentEngine.attach(e)}setPerformance(e){this.performance={startupMode:e?.startupMode??`balanced`,startupStrategy:e?.startupStrategy??`balanced`,startupBufferSeconds:e?.startupBufferSeconds??1.2,manifestFastPath:e?.manifestFastPath??!1},this.bus.emit(`performance:updated`,this.performance)}setAbr(e){this.abr={startupProfile:e?.startupProfile??`balanced`,upgradeAggression:e?.upgradeAggression??`medium`,rebufferSafetyBias:e?.rebufferSafetyBias??`medium`},this.bus.emit(`abr:updated`,this.abr)}getStartupReadiness(){return this.currentEngine?.getStartupReadiness?.()??null}async load(e){let t=++this.generation;this.cancelAd(),this.adSource=e.preroll?.src,this.pendingMidrolls=(e.midrolls||[]).filter(e=>Number.isFinite(e.at)&&e.at>0&&e.src).sort((e,t)=>e.at-t.at),this.bus.emit(`startup:mode`,{mode:this.performance.startupMode,startupBufferSeconds:this.performance.startupBufferSeconds});let n=f(e.src,e.mimeType),r=e.type&&e.type!==`auto`?e.type:n;this.state.update({currentTime:0,duration:NaN,readyState:0,error:null,paused:!0,ended:!1,buffering:!1,selectedQuality:`auto`,availableQualities:[],selectedSubtitle:null,availableSubtitles:[],selectedAudioTrack:`default`,availableAudioTracks:[],isLive:!1,isDvr:!1,status:`loading`,source:{src:e.src,adBreakTimes:[...this.adSource?[0]:[],...this.pendingMidrolls.map(e=>e.at)],requestedType:r,detectedType:n,mimeType:e.mimeType||null,title:e.title||null,poster:e.poster||null,thumbnailVtt:e.thumbnailVtt||null}});let i={...e};delete i.drm,this.bus.emit(`source_loading`,i);let o=r,c=this.registry.findEngineForSource(o,e.src);if(!c||e.drm&&c.id!==`dash`){let t={code:`NO_ENGINE`,message:e.drm?`Configured DRM requires DASH playback`:`No engine found for source`,engine:`core`,recoverable:!1};throw this.state.update({error:t,status:`error`}),this.bus.emit(`error`,t),Error(t.message)}if(this.currentEngine){if(await this.currentEngine.destroy(),t!==this.generation)return;this.unbindEngine()}this.currentEngine=c,this.currentEngine.setRuntimeConfig?.({performance:this.performance,abr:this.abr}),this.pendingSeekTime=null,this.currentVideoElement&&(e.muted!==void 0&&(this.currentVideoElement.muted=e.muted),this.currentEngine.attach(this.currentVideoElement)),this.bindEngine(this.currentEngine),this.state.update({engineType:c.id});try{if(await this.currentEngine.load(e),t!==this.generation)return;this.bus.emit(`source_loaded`,i);let n=this.getState();this.state.update({status:n.paused?`paused`:`playing`}),e.autoplay&&this.play().catch(e=>console.warn(`Autoplay failed`,e))}catch(e){if(t!==this.generation)return;let n={code:`LOAD_ERROR`,message:e?.message||`Unknown loading error`,engine:c.id,recoverable:!1};throw this.state.update({error:n,status:`error`,buffering:!1}),this.bus.emit(`error`,n),e}}bindEngine(e){this.cleans.forEach(e=>e()),this.cleans=[e.on(`play`,()=>{this.state.update({paused:!1,ended:!1,status:`playing`}),this.bus.emit(`play`)}),e.on(`playing`,()=>{this.state.update({paused:!1,readyState:4,buffering:!1,ended:!1,status:`playing`}),this.bus.emit(`playing`)}),e.on(`pause`,()=>{let e=this.getState();this.state.update({paused:!0,status:e.ended?`ended`:`paused`}),this.bus.emit(`pause`)}),e.on(`ended`,()=>{this.state.update({paused:!0,ended:!0,buffering:!1,status:`ended`}),this.bus.emit(`ended`)}),e.on(`seeked`,({currentTime:e})=>{this.state.update({currentTime:e,buffering:!1,status:this.getState().paused?`paused`:`playing`}),this.pendingSeekTime!==null&&(this.bus.emit(`seek_complete`,e),this.pendingSeekTime=null)}),e.on(`timeupdate`,({currentTime:t})=>{this.state.update({currentTime:t});let n=this.pendingMidrolls[0];n&&t>=n.at&&!this.currentVideoElement?.paused&&!this.adPlayback&&(this.pendingMidrolls.shift(),this.adSource=n.src,e.pause(),this.play().catch(t=>this.bus.emit(`error`,{code:`AD_RESUME_FAILED`,message:String(t),engine:e.id})))}),e.on(`durationchange`,({duration:e,isLive:t=e===1/0})=>{this.state.update({duration:e,isLive:t,isDvr:t&&!!this.currentVideoElement?.seekable.length})}),e.on(`volumechange`,({volume:e,muted:t})=>this.state.update({volume:e,muted:t})),e.on(`ratechange`,({playbackRate:e})=>this.state.update({playbackRate:e})),e.on(`progress`,({buffered:e})=>this.state.update({buffered:e})),e.on(`qualitychange`,({level:e})=>this.state.update({selectedQuality:e})),e.on(`trackschange`,({qualities:e,subtitles:t,audioTracks:n})=>{this.state.update({availableQualities:e,availableSubtitles:t,availableAudioTracks:n})}),e.on(`telemetry`,t=>{this.bus.emit(`telemetry`,{engine:e.id,...t||{}})}),e.on(`error`,({error:e})=>{if(e?.recoverable){this.state.update({error:null}),this.bus.emit(`error`,e);return}this.state.update({error:e,status:`error`,buffering:!1}),this.bus.emit(`error`,e)}),e.on(`ready`,()=>{this.state.update({readyState:4,buffering:!1,status:this.getState().paused?`ready`:`playing`}),this.bus.emit(`ready`)}),e.on(`waiting`,()=>{this.state.update({readyState:2,buffering:!0,status:`buffering`}),this.bus.emit(`waiting`)})]}unbindEngine(){this.cleans.forEach(e=>e()),this.cleans=[]}async play(){if(!this.currentEngine)throw Error(`No engine loaded`);if(this.bus.emit(`playback_requested`),this.adPlayback)return this.adPlayback;if(this.adSource&&this.currentVideoElement){let e=this.adSource;this.adSource=void 0,this.bus.emit(`ad:started`);let t=new AbortController;return this.adController=t,this.adPlayback=p(this.currentVideoElement,e,t.signal).then(async e=>{t.signal.aborted||(this.bus.emit(`ad:`+e),await this.playContent())}).finally(()=>{this.adController===t&&this.cancelAd()}),this.adPlayback}return this.playContent()}async playContent(){let e=this.generation;await this.currentEngine?.play(),e===this.generation&&(this.state.update({paused:!1,ended:!1,status:`playing`}),this.bus.emit(`playback_started`))}pause(){this.cancelAd(),this.currentEngine?.pause();let e=this.getState();this.state.update({paused:!0,status:e.ended?`ended`:`paused`})}async destroy(){++this.generation,this.cancelAd(),this.unbindEngine(),this.currentEngine&&=(await this.currentEngine.destroy(),null),this.bus.clear()}seek(e){this.pendingSeekTime=e,this.bus.emit(`seek_start`,e),this.currentEngine?.seek(e)}setVolume(e){this.currentEngine?.setVolume(e)}setMuted(e){this.currentEngine?.setMuted(e)}setPlaybackRate(e){this.currentEngine?.setPlaybackRate(e)}setQuality(e){this.currentEngine?.setQuality(e),this.state.update({selectedQuality:e})}setSubtitle(e){this.currentEngine?.setSubtitle(e),this.state.update({selectedSubtitle:e})}setAudioTrack(e){this.currentEngine?.setAudioTrack(e),this.state.update({selectedAudioTrack:e})}getState(){return this.state.snapshot}getStats(){return this.state.snapshot}on(e,t){return this.bus.on(e,t)}},h=class{id=`native`;isNative=!0;video=null;listeners=new Map;domListeners=[];canPlayType(e){return[`mp4`,`webm`,`ogg`].includes(e)}canPlaySource(e){let t=e.toLowerCase();return t.includes(`.mp4`)||t.includes(`.webm`)||t.includes(`.ogg`)}attach(e){this.video=e,this.bindDomEvents()}bindDomEvents(){if(!this.video)return;this.unbindDomEvents();let e=(e,t,n=()=>void 0)=>{let r=e=>{let r=n(e);this.emit(t,r)};this.video.addEventListener(e,r),this.domListeners.push({event:e,handler:r})};e(`play`,`play`),e(`pause`,`pause`),e(`playing`,`playing`),e(`ended`,`ended`),e(`waiting`,`waiting`),e(`seeked`,`seeked`,()=>({currentTime:this.video.currentTime})),e(`canplay`,`ready`),e(`timeupdate`,`timeupdate`,()=>({currentTime:this.video.currentTime})),e(`durationchange`,`durationchange`,()=>({duration:this.video.duration})),e(`volumechange`,`volumechange`,()=>({volume:this.video.volume,muted:this.video.muted})),e(`ratechange`,`ratechange`,()=>({playbackRate:this.video.playbackRate})),e(`progress`,`progress`,()=>{let e=[],t=this.video.buffered;for(let n=0;n<t.length;n++)e.push({start:t.start(n),end:t.end(n)});return{buffered:e}}),e(`error`,`error`,()=>{let e=this.video.error;return{error:{code:e?.code?.toString()||`UNKNOWN`,message:e?.message||`Media Error`,engine:this.id,recoverable:!1,originalError:e}}})}unbindDomEvents(){this.video&&(this.domListeners.forEach(({event:e,handler:t})=>{this.video.removeEventListener(e,t)}),this.domListeners=[])}async load(e){if(!this.video)throw Error(`Video element not attached`);this.video.poster=e.poster||``,this.video.src=e.src,this.video.load()}async play(){await this.video?.play()}pause(){this.video?.pause()}async destroy(){this.unbindDomEvents(),this.video&&(this.video.src=``,this.video.removeAttribute(`src`)),this.video=null,this.listeners.clear()}seek(e){this.video&&(this.video.currentTime=e)}setVolume(e){this.video&&(this.video.volume=e)}setMuted(e){this.video&&(this.video.muted=e)}setPlaybackRate(e){this.video&&(this.video.playbackRate=e)}setQuality(e){console.warn(`Quality switching not supported in native engine`)}setSubtitle(e){}setAudioTrack(e){}on(e,t){let n=e;return this.listeners.has(n)||this.listeners.set(n,[]),this.listeners.get(n).push(t),()=>this.off(e,t)}off(e,t){let n=e,r=this.listeners.get(n);if(!r)return;let i=r.indexOf(t);i>-1&&r.splice(i,1)}emit(e,t){let n=e,r=this.listeners.get(n);if(r)for(let e of[...r])e(t)}},g={play:`<svg viewBox="0 0 24 24"><path d="M8 5v14l11-7z"/></svg>`,replay:`<svg viewBox="0 0 24 24"><path d="M12 5V2L7 7l5 5V9c3.31 0 6 2.69 6 6a6 6 0 0 1-10.24 4.24l-1.42 1.42A8 8 0 1 0 20 15c0-4.42-3.58-8-8-8z"/></svg>`,pause:`<svg viewBox="0 0 24 24"><path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"/></svg>`,mute:`<svg viewBox="0 0 24 24"><path d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z"/></svg>`,volume:`<svg viewBox="0 0 24 24"><path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"/></svg>`,fullscreen:`<svg viewBox="0 0 24 24"><path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/></svg>`,fullscreenExit:`<svg viewBox="0 0 24 24"><path d="M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"/></svg>`,pip:`<svg viewBox="0 0 24 24"><path d="M19 7H5v10h14V7zm2-2v14H3V5h18zm-9 7h7v5h-7v-5z"/></svg>`,settings:`<svg viewBox="0 0 24 24"><path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.06-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.73,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.06,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.43-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.49-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"/></svg>`},_=class{player;target;handler;constructor(e,t){this.player=e,this.target=t,this.handler=this.handleKey.bind(this),this.target.addEventListener(`keydown`,this.handler),this.target.tabIndex=0}handleKey(e){let t=document.activeElement?.tagName.toLowerCase();if(e.defaultPrevented||t===`input`||t===`textarea`||t===`button`&&e.key===` `)return;let n=!1;switch(e.key){case` `:case`k`:case`K`:n=!0,this.togglePlay();break;case`ArrowLeft`:n=!0,this.seekRelative(-5);break;case`ArrowRight`:n=!0,this.seekRelative(5);break;case`m`:case`M`:n=!0,this.toggleMute();break;case`f`:case`F`:n=!0,this.toggleFullscreen();break;case`c`:case`C`:n=!0,this.toggleCaptions();break}n&&(e.preventDefault(),e.stopPropagation())}togglePlay(){this.player.getState().paused?this.player.play().catch(()=>{}):this.player.pause()}seekRelative(e){let t=this.player.getState();this.player.seek(Math.max(0,Math.min(t.duration||0,t.currentTime+e)))}toggleMute(){let e=this.player.getState();this.player.setMuted(!e.muted)}toggleFullscreen(){document.fullscreenElement?document.exitFullscreen().catch(()=>{}):this.target.requestFullscreen().catch(()=>{})}toggleCaptions(){this.player.getState().selectedSubtitle?this.player.setSubtitle(null):this.player.setSubtitle(`0`)}destroy(){this.target.removeEventListener(`keydown`,this.handler)}},v=class{static makeClickable(e,t){e.setAttribute(`role`,`button`),e.tabIndex=0,e.addEventListener(`click`,t),e.addEventListener(`keydown`,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())})}},y={colors:{background:`#09090b`,surface:`rgba(9, 9, 11, 0.7)`,surfaceElevated:`rgba(39, 39, 42, 0.8)`,overlayGradientEnd:`rgba(0, 0, 0, 0.7)`,overlayError:`rgba(0, 0, 0, 0.8)`,menuBackground:`rgba(15, 15, 15, 0.9)`,menuBorder:`rgba(255, 255, 255, 0.1)`,menuHover:`rgba(255, 255, 255, 0.1)`,menuActive:`rgba(59, 130, 246, 0.1)`,buffered:`rgba(255, 255, 255, 0.4)`,textPrimary:`#fafafa`,textSecondary:`#a1a1aa`,brandPrimary:`#3b82f6`,danger:`#ef4444`,focus:`rgba(59, 130, 246, 0.5)`},radius:{sm:`4px`,md:`8px`,lg:`12px`,pill:`9999px`},spacing:{xs:`4px`,sm:`8px`,md:`16px`,lg:`24px`},typography:{fontFamily:`"Inter", "Roboto", "Outfit", sans-serif`,fontSizeSm:`12px`,fontSizeMd:`14px`,fontSizeLg:`16px`,fontWeightMedium:`500`,fontWeightBold:`700`},control:{height:`40px`,iconSize:`24px`}},b={colors:{background:`#ffffff`,surface:`rgba(255, 255, 255, 0.8)`,surfaceElevated:`rgba(244, 244, 245, 0.9)`,overlayGradientEnd:`rgba(0, 0, 0, 0.35)`,overlayError:`rgba(255, 255, 255, 0.95)`,menuBackground:`rgba(255, 255, 255, 0.95)`,menuBorder:`rgba(9, 9, 11, 0.1)`,menuHover:`rgba(9, 9, 11, 0.06)`,menuActive:`rgba(37, 99, 235, 0.12)`,buffered:`rgba(9, 9, 11, 0.25)`,textPrimary:`#09090b`,textSecondary:`#71717a`,brandPrimary:`#2563eb`,danger:`#dc2626`,focus:`rgba(37, 99, 235, 0.4)`},radius:y.radius,spacing:y.spacing,typography:y.typography,control:y.control};function x(e,t){if(!t)return e;let n=JSON.parse(JSON.stringify(e));for(let e of Object.keys(t))typeof t[e]==`object`?n[e]={...n[e],...t[e]}:n[e]=t[e];return n}function S(e,t=`flux-player`){let n=``;for(let[r,i]of Object.entries(e))if(typeof i==`object`)for(let[e,o]of Object.entries(i))n+=`--${t}-${r}-${e}: ${o};\n`;return n}function C(e,t){let n=y;typeof t==`string`?t===`light`&&(n=b):n=x(t.base===`light`?b:y,t),S(n),e.setAttribute(`style`,e.getAttribute(`style`)||``);for(let[t,r]of Object.entries(n))if(typeof r==`object`)for(let[n,i]of Object.entries(r))e.style.setProperty(`--flux-player-${t}-${n}`,i)}var w=class{player;container;videoEl;wrapper;overlay;spinner;bigPlay;replayBtn;errorPanel;errorTextEl;extraButtons;playBtn;muteBtn;pipBtn;fullscreenBtn;timeDisplay;liveBadge;progressFill;bufferedFill;markerSignature=``;timeline;timelineThumbnailPreview;timelineThumbnailImage;volumeSlider;settingsBtn;settingsMenu;menuOpen=!1;uiPaused=!0;isDragging=!1;uiConfig;cleans=[];domCleans=[];idleTimeout;fullscreenChangeHandler=null;pipSupported=!1;controlElements=[];controlFocusIndex=0;menuItems=[];menuFocusIndex=0;thumbnailVttUrl=null;thumbnailCues=[];thumbnailFetchAbort=null;subtitleDisplay;subtitleTrackListeners=new Map;activeSourceToken=null;resetUiForSourceChange(e){let t=`${e.source?.src||``}|${this.resolveThumbnailVttUrl(e)||``}`;if(t!==this.activeSourceToken){this.activeSourceToken=t,this.thumbnailFetchAbort?.abort(),this.thumbnailFetchAbort=null,this.thumbnailVttUrl=null,this.thumbnailCues=[],this.hideTimelineThumbnail(),this.timelineThumbnailImage.removeAttribute(`src`),this.subtitleDisplay.innerHTML=``;for(let[e,t]of this.subtitleTrackListeners.entries())e.removeEventListener(`cuechange`,t);this.subtitleTrackListeners.clear();for(let e=0;e<this.videoEl.textTracks.length;e++)this.videoEl.textTracks[e].mode=`disabled`,this.bindSubtitleTrack(this.videoEl.textTracks[e])}}constructor(e,t,n={}){if(this.player=e,this.uiConfig=n,typeof t==`string`){let e=document.querySelector(t);if(!e)throw Error(`Target ${t} not found`);this.container=e}else this.container=t;this.videoEl=document.createElement(`video`),this.videoEl.className=`flux-player-video`,this.player.attachVideo(this.videoEl),this.render(),this.bindEvents(),this.updateState(this.player.getState())}render(){this.container.innerHTML=``,this.wrapper=document.createElement(`div`),this.wrapper.className=`flux-player-wrapper`,this.wrapper.appendChild(this.videoEl),this.spinner=document.createElement(`div`),this.spinner.className=`flux-player-spinner`,this.wrapper.appendChild(this.spinner),this.bigPlay=document.createElement(`div`),this.bigPlay.className=`flux-player-big-play`,this.bigPlay.innerHTML=g.play,this.wrapper.appendChild(this.bigPlay),v.makeClickable(this.bigPlay,()=>this.handlePrimaryAction()),this.replayBtn=document.createElement(`div`),this.replayBtn.className=`flux-player-replay flux-hidden`,this.replayBtn.innerHTML=g.replay,this.wrapper.appendChild(this.replayBtn),v.makeClickable(this.replayBtn,()=>this.replay()),this.errorPanel=document.createElement(`div`),this.errorPanel.className=`flux-player-error flux-hidden`,this.errorPanel.innerHTML=`<div class="flux-player-error-title">Playback Error</div>`,this.errorTextEl=document.createElement(`div`),this.errorTextEl.className=`flux-player-error-text`,this.errorPanel.appendChild(this.errorTextEl),this.wrapper.appendChild(this.errorPanel),this.overlay=document.createElement(`div`),this.overlay.className=`flux-player-overlay`;let e=document.createElement(`div`);e.className=`flux-player-controls`,this.timeline=document.createElement(`div`),this.timeline.className=`flux-player-timeline`,this.timeline.setAttribute(`role`,`slider`),this.timeline.setAttribute(`aria-label`,`Seek timeline`),this.timeline.tabIndex=-1,this.bufferedFill=document.createElement(`div`),this.bufferedFill.className=`flux-player-timeline-buffered`,this.progressFill=document.createElement(`div`),this.progressFill.className=`flux-player-timeline-progress`,this.timelineThumbnailPreview=document.createElement(`div`),this.timelineThumbnailPreview.className=`flux-player-thumbnail-preview flux-hidden`,this.timelineThumbnailImage=document.createElement(`img`),this.timelineThumbnailImage.className=`flux-player-thumbnail-image`,this.timelineThumbnailImage.alt=``,this.timelineThumbnailImage.setAttribute(`aria-hidden`,`true`),this.timelineThumbnailImage.onload=()=>{this.thumbnailVttUrl&&this.timelineThumbnailPreview.classList.remove(`flux-hidden`)},this.timelineThumbnailImage.onerror=()=>{this.hideTimelineThumbnail()},this.timelineThumbnailPreview.appendChild(this.timelineThumbnailImage),this.timeline.appendChild(this.bufferedFill),this.timeline.appendChild(this.progressFill),this.timeline.appendChild(this.timelineThumbnailPreview),e.appendChild(this.timeline);let t=document.createElement(`div`);t.className=`flux-player-toolbar`;let n=document.createElement(`div`);n.className=`flux-player-toolbar-group`,this.playBtn=this.createBtn(`play`,g.play,`Play`),this.muteBtn=this.createBtn(`mute`,g.mute,`Mute`),this.volumeSlider=document.createElement(`input`),this.volumeSlider.type=`range`,this.volumeSlider.min=`0`,this.volumeSlider.max=`1`,this.volumeSlider.step=`0.05`,this.volumeSlider.className=`flux-player-volume-slider`,this.volumeSlider.setAttribute(`role`,`slider`),this.volumeSlider.setAttribute(`aria-label`,`Volume`);let r=document.createElement(`div`);r.className=`flux-player-volume-container`,r.appendChild(this.muteBtn),r.appendChild(this.volumeSlider),this.timeDisplay=document.createElement(`div`),this.timeDisplay.className=`flux-player-time`,this.timeDisplay.innerText=`0:00 / 0:00`,this.timeDisplay.setAttribute(`aria-live`,`polite`),this.timeDisplay.setAttribute(`aria-atomic`,`true`),n.appendChild(this.playBtn),n.appendChild(r),n.appendChild(this.timeDisplay);let i=document.createElement(`div`);i.className=`flux-player-toolbar-group`,this.liveBadge=document.createElement(`div`),this.liveBadge.className=`flux-player-live-badge flux-hidden`,this.liveBadge.innerHTML=`<span></span>LIVE`,this.liveBadge.setAttribute(`aria-live`,`polite`),this.liveBadge.setAttribute(`aria-label`,`Live stream`),this.pipBtn=this.createBtn(`pip`,g.pip,`Picture in Picture`),this.fullscreenBtn=this.createBtn(`fullscreen`,g.fullscreen,`Fullscreen`),this.settingsBtn=this.createBtn(`settings`,g.settings,`Settings`),this.settingsBtn.setAttribute(`aria-haspopup`,`menu`),this.settingsBtn.setAttribute(`aria-expanded`,`false`),i.appendChild(this.liveBadge),this.extraButtons=document.createElement(`div`),this.extraButtons.className=`flux-player-toolbar-group`,i.appendChild(this.extraButtons),i.appendChild(this.pipBtn),i.appendChild(this.settingsBtn),i.appendChild(this.fullscreenBtn),t.appendChild(n),t.appendChild(i),e.appendChild(t),this.settingsMenu=document.createElement(`div`),this.settingsMenu.className=`flux-player-settings-menu flux-hidden`,this.settingsMenu.setAttribute(`role`,`menu`),this.settingsMenu.setAttribute(`aria-label`,`Player settings`),e.appendChild(this.settingsMenu),this.overlay.appendChild(e),this.subtitleDisplay=document.createElement(`div`),this.subtitleDisplay.className=`flux-player-subtitles flux-subs-raised`,this.wrapper.appendChild(this.subtitleDisplay),this.wrapper.appendChild(this.overlay),this.container.appendChild(this.wrapper),this.setToolbar(this.uiConfig.toolbar??{}),C(this.wrapper,`dark`)}setControlsIdle(e){e?(this.overlay.classList.add(`flux-idle`),this.subtitleDisplay.classList.remove(`flux-subs-raised`)):(this.overlay.classList.remove(`flux-idle`),this.subtitleDisplay.classList.add(`flux-subs-raised`))}createBtn(e,t,n){let r=document.createElement(`button`);return r.className=`flux-player-icon-btn flux-btn-${e}`,r.innerHTML=t,r.setAttribute(`aria-label`,n),r}formatTime(e){if(isNaN(e))return`0:00`;let t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n<10?`0`:``}${n}`}bindEvents(){this.cleans.push(this.player.on(`state:change`,e=>this.updateState(e)));let e=e=>{e&&e.stopPropagation(),this.handlePrimaryAction()};this.listen(this.playBtn,`click`,e),this.listen(this.bigPlay,`click`,e),this.listen(this.videoEl,`click`,e),this.listen(this.replayBtn,`click`,()=>this.replay()),this.listen(this.muteBtn,`click`,()=>{this.player.setMuted(!this.player.getState().muted)}),this.listen(this.volumeSlider,`input`,e=>{this.player.setVolume(parseFloat(e.target.value))}),this.updatePipAvailability(),this.setupControlRovingTabindex(),this.listen(this.pipBtn,`click`,async()=>{await this.togglePip()}),this.listen(this.videoEl,`enterpictureinpicture`,()=>{this.pipBtn.classList.add(`flux-active`),this.pipBtn.setAttribute(`aria-label`,`Exit Picture in Picture`)}),this.listen(this.videoEl,`leavepictureinpicture`,()=>{this.pipBtn.classList.remove(`flux-active`),this.pipBtn.setAttribute(`aria-label`,`Picture in Picture`)}),this.listen(this.fullscreenBtn,`click`,()=>{document.fullscreenElement?document.exitFullscreen().catch(()=>{}):this.wrapper.requestFullscreen().catch(()=>{})}),this.fullscreenChangeHandler=()=>{document.fullscreenElement?this.fullscreenBtn.innerHTML=g.fullscreenExit:this.fullscreenBtn.innerHTML=g.fullscreen},this.listen(document,`fullscreenchange`,this.fullscreenChangeHandler);let t=e=>{let t=this.getTimelineHoverData(e.clientX);if(!t)return;let{position:n,duration:r,targetTime:i}=t;this.progressFill.style.width=`${n*100}%`,this.timeDisplay.innerText=`${this.formatTime(i)} / ${this.formatTime(r)}`,this.renderTimelineThumbnail(e),(this.uiConfig.seekOnDrag&&e.type!==`mouseup`||e.type===`mouseup`||e.type===`click`)&&this.player.seek(i)},n=e=>{this.isDragging&&t(e)},r=e=>{this.isDragging&&(this.isDragging=!1,this.wrapper.classList.remove(`flux-dragging`),t(e),this.renderTimelineThumbnail(e),document.removeEventListener(`mousemove`,n),document.removeEventListener(`mouseup`,r))};this.listen(this.timeline,`mousedown`,e=>{let i=e;this.isDragging=!0,this.wrapper.classList.add(`flux-dragging`),t(i),this.listen(document,`mousemove`,n,!0),this.listen(document,`mouseup`,r,!0)}),this.listen(this.timeline,`click`,e=>{this.isDragging||t(e)}),this.listen(this.timeline,`mousemove`,e=>{this.renderTimelineThumbnail(e)}),this.listen(this.timeline,`mouseenter`,e=>{this.renderTimelineThumbnail(e)}),this.listen(this.timeline,`mouseleave`,()=>{this.hideTimelineThumbnail()}),this.listen(this.timeline,`keydown`,e=>{let t=e;if(t.key===`ArrowLeft`&&(t.preventDefault(),this.player.seek(Math.max(0,this.player.getState().currentTime-5))),t.key===`ArrowRight`){t.preventDefault();let e=this.player.getState().duration,n=Number.isFinite(e)?e:this.player.getState().currentTime+5;this.player.seek(Math.min(n,this.player.getState().currentTime+5))}}),this.listen(this.settingsBtn,`click`,e=>{e.stopPropagation(),this.toggleMenu()}),this.listen(this.wrapper,`click`,()=>{this.menuOpen&&this.toggleMenu(!1)}),this.listen(this.settingsMenu,`click`,e=>e.stopPropagation()),this.listen(this.settingsMenu,`keydown`,e=>this.handleSettingsKeyDown(e)),this.listen(this.wrapper,`keydown`,e=>this.handleControlBarKeyDown(e));let i=()=>{this.setControlsIdle(!1),clearTimeout(this.idleTimeout),!this.player.getState().paused&&!this.menuOpen&&(this.idleTimeout=setTimeout(()=>{this.setControlsIdle(!0)},3e3))};this.listen(this.wrapper,`mousemove`,i),this.listen(this.wrapper,`touchstart`,i);for(let e of Array.from(this.videoEl.textTracks))this.bindSubtitleTrack(e);let o=e=>this.bindSubtitleTrack(e.track);this.videoEl.textTracks.addEventListener?.(`addtrack`,o),this.domCleans.push(()=>this.videoEl.textTracks.removeEventListener?.(`addtrack`,o)),this.listen(this.wrapper,`mouseleave`,()=>{!this.player.getState().paused&&!this.menuOpen&&this.setControlsIdle(!0)})}setToolbar(e){let t=new Set(e.hidden),n={play:this.playBtn,volume:this.volumeSlider.parentElement,settings:this.settingsBtn,pip:this.pipBtn,fullscreen:this.fullscreenBtn};for(let e of Object.keys(n))n[e].classList.toggle(`flux-hidden`,t.has(e));t.has(`settings`)&&this.menuOpen&&this.toggleMenu(!1),this.extraButtons.replaceChildren(...(e.buttons??[]).map(({label:e,onClick:t})=>{let n=document.createElement(`button`);return n.type=`button`,n.className=`flux-player-icon-btn`,n.textContent=e,n.onclick=()=>t(this.player),n})),this.extraButtons.style.display=this.extraButtons.childElementCount?``:`none`,this.setupControlRovingTabindex()}setupControlRovingTabindex(){this.controlElements=[this.playBtn,this.muteBtn,this.volumeSlider,this.timeline,...Array.from(this.extraButtons.querySelectorAll(`button`)),this.settingsBtn,this.pipBtn,this.fullscreenBtn].filter(e=>!e.closest(`.flux-hidden`)&&!e.hasAttribute(`disabled`)),this.controlElements.forEach((e,t)=>{e.tabIndex=t===0?0:-1})}moveControlFocus(e){this.controlElements.length!==0&&(this.controlFocusIndex=(e+this.controlElements.length)%this.controlElements.length,this.controlElements.forEach((e,t)=>{e.tabIndex=t===this.controlFocusIndex?0:-1}),this.controlElements[this.controlFocusIndex].focus())}handleControlBarKeyDown(e){if(this.menuOpen)return;let t=this.controlElements.findIndex(e=>e===document.activeElement);if(t!==-1){if(e.key===`ArrowRight`){e.preventDefault(),this.moveControlFocus(t+1);return}if(e.key===`ArrowLeft`){e.preventDefault(),this.moveControlFocus(t-1);return}if(e.key===`Home`){e.preventDefault(),this.moveControlFocus(0);return}e.key===`End`&&(e.preventDefault(),this.moveControlFocus(this.controlElements.length-1))}}updateMenuA11yState(){this.menuItems=Array.from(this.settingsMenu.querySelectorAll(`.flux-player-menu-item`)),this.menuItems.forEach((e,t)=>{e.setAttribute(`role`,`menuitemradio`),e.setAttribute(`tabindex`,t===this.menuFocusIndex?`0`:`-1`),e.setAttribute(`aria-checked`,e.classList.contains(`flux-active`)?`true`:`false`)})}focusMenuItem(e){this.menuItems.length!==0&&(this.menuFocusIndex=(e+this.menuItems.length)%this.menuItems.length,this.menuItems.forEach((e,t)=>{e.tabIndex=t===this.menuFocusIndex?0:-1}),this.menuItems[this.menuFocusIndex].focus())}handleSettingsKeyDown(e){if(!(!this.menuOpen||this.menuItems.length===0)){if(e.key===`ArrowDown`){e.preventDefault(),this.focusMenuItem(this.menuFocusIndex+1);return}if(e.key===`ArrowUp`){e.preventDefault(),this.focusMenuItem(this.menuFocusIndex-1);return}if(e.key===`Home`){e.preventDefault(),this.focusMenuItem(0);return}if(e.key===`End`){e.preventDefault(),this.focusMenuItem(this.menuItems.length-1);return}if(e.key===`Tab`){e.preventDefault();let t=e.shiftKey?-1:1;this.focusMenuItem(this.menuFocusIndex+t);return}if(e.key===`Escape`){e.preventDefault(),this.toggleMenu(!1),this.settingsBtn.focus();return}(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.menuItems[this.menuFocusIndex]?.click())}}updatePipAvailability(){let e=document,t=this.videoEl,n=!!(e.pictureInPictureEnabled&&this.videoEl.requestPictureInPicture),r=!!t.webkitSupportsPresentationMode?.(`picture-in-picture`);this.pipSupported=n||r,this.pipSupported?(this.pipBtn.removeAttribute(`disabled`),this.pipBtn.removeAttribute(`aria-disabled`),this.pipBtn.removeAttribute(`title`),this.pipBtn.classList.remove(`flux-disabled`)):(this.pipBtn.setAttribute(`disabled`,`true`),this.pipBtn.setAttribute(`aria-disabled`,`true`),this.pipBtn.setAttribute(`title`,`Picture in Picture not supported in this browser`),this.pipBtn.classList.add(`flux-disabled`))}async togglePip(){if(!this.pipSupported)return;let e=document,t=this.videoEl;if(e.pictureInPictureEnabled&&this.videoEl.requestPictureInPicture){if(e.pictureInPictureElement===this.videoEl&&e.exitPictureInPicture){await e.exitPictureInPicture().catch(()=>{});return}await this.videoEl.requestPictureInPicture().catch(()=>{});return}if(t.webkitSupportsPresentationMode?.(`picture-in-picture`)&&t.webkitSetPresentationMode){let e=t.webkitPresentationMode===`picture-in-picture`?`inline`:`picture-in-picture`;try{t.webkitSetPresentationMode(e),this.pipBtn.classList.toggle(`flux-active`,e===`picture-in-picture`)}catch{}}}listen(e,t,n,r=!1){if(e.addEventListener(t,n),this.domCleans.push(()=>{e.removeEventListener(t,n)}),r){let e=this.domCleans[this.domCleans.length-1];this.domCleans[this.domCleans.length-1]=()=>{e()}}}getTimelineHoverData(e){let t=this.timeline.getBoundingClientRect();if(t.width<=0)return null;let n=(e-t.left)/t.width;n=Math.max(0,Math.min(1,n));let r=this.player.getState().duration||0;return{position:n,duration:r,targetTime:n*r}}resolveThumbnailVttUrl(e){let t=typeof this.uiConfig?.thumbnailVtt==`string`?this.uiConfig.thumbnailVtt.trim():``;if(t.length>0)return t;let n=e.source?.thumbnailVtt?.trim()||``;return n.length>0?n:null}async syncThumbnailTrack(e){let t=this.resolveThumbnailVttUrl(e);if(t!==this.thumbnailVttUrl&&(this.thumbnailVttUrl=t,this.thumbnailCues=[],this.hideTimelineThumbnail(),t)){this.thumbnailFetchAbort?.abort(),this.thumbnailFetchAbort=new AbortController;try{let e=await fetch(t,{signal:this.thumbnailFetchAbort.signal});if(!e.ok)throw Error(`Failed to fetch thumbnail VTT: ${e.status}`);let n=await e.text();this.thumbnailCues=this.parseThumbnailVtt(n,t)}catch(e){e.name!==`AbortError`&&console.warn(`[DefaultUI] Unable to load thumbnail VTT`,e),this.thumbnailCues=[]}}}parseThumbnailVtt(e,t){let n=e.split(/\r?\n/),r=[],i=0;for(;i<n.length;){let e=n[i].trim();if(!e||e.toUpperCase()===`WEBVTT`||e.startsWith(`NOTE`)){i+=1;continue}let o=e;if(!o.includes(`-->`)&&i+1<n.length&&(o=n[i+1].trim(),i+=1),!o.includes(`-->`)){i+=1;continue}let[c,l]=o.split(`-->`).map(e=>e.trim()),u=l.split(/\s+/)[0],d=this.parseVttTime(c),f=this.parseVttTime(u);if(!Number.isFinite(d)||!Number.isFinite(f)||f<=d){i+=1;continue}i+=1;let p=[];for(;i<n.length&&n[i].trim()!==``;)p.push(n[i].trim()),i+=1;let m=p.find(e=>this.isThumbnailPayload(e))||``,h=this.parseThumbnailCuePayload(m,t);for(h&&r.push({start:d,end:f,...h});i<n.length&&n[i].trim()===``;)i+=1}return r}parseVttTime(e){let t=e.split(`:`);if(t.length<2||t.length>3)return NaN;let n=Number(t[t.length-1]),r=Number(t[t.length-2]),i=t.length===3?Number(t[0]):0;return!Number.isFinite(i)||!Number.isFinite(r)||!Number.isFinite(n)?NaN:i*3600+r*60+n}parseThumbnailCuePayload(e,t){if(!e)return null;let[n,r=``]=e.split(`#`,2);if(!n)return null;let i=n;try{i=new URL(n,t).toString()}catch{i=n}let o=null,c=null,l=null,u=null,d=r.match(/xywh=(\d+),(\d+),(\d+),(\d+)/i);return d&&(o=Number(d[1]),c=Number(d[2]),l=Number(d[3]),u=Number(d[4])),{imageUrl:i,x:o,y:c,w:l,h:u}}isThumbnailPayload(e){let t=e.trim();return t?/^(https?:\/\/|\/|\.\/|\.\.\/|[^\s]+\.(jpg|jpeg|png|webp|avif|gif|svg))(#xywh=\d+,\d+,\d+,\d+)?(\?.*)?$/i.test(t):!1}findThumbnailCue(e){if(this.thumbnailCues.length===0)return null;for(let t of this.thumbnailCues)if(e>=t.start&&e<t.end)return t;let t=this.thumbnailCues[this.thumbnailCues.length-1];return e>=t.start?t:null}renderTimelineThumbnail(e){if(!this.thumbnailVttUrl||this.thumbnailCues.length===0){this.hideTimelineThumbnail();return}let t=this.player.getState();if(t.isLive||!Number.isFinite(t.duration)||t.duration<=0){this.hideTimelineThumbnail();return}let n=this.getTimelineHoverData(e.clientX);if(!n){this.hideTimelineThumbnail();return}let r=this.findThumbnailCue(n.targetTime);if(!r){this.hideTimelineThumbnail();return}let i=r.x!==null&&r.y!==null&&r.w!==null&&r.h!==null;this.timelineThumbnailImage.style.objectFit=i?`none`:`cover`,i?(this.timelineThumbnailImage.style.objectPosition=`-${r.x}px -${r.y}px`,this.timelineThumbnailImage.style.width=`${r.w}px`,this.timelineThumbnailImage.style.height=`${r.h}px`):(this.timelineThumbnailImage.style.objectPosition=`50% 50%`,this.timelineThumbnailImage.style.width=`160px`,this.timelineThumbnailImage.style.height=`90px`);let o=this.timeline.getBoundingClientRect(),c=this.timelineThumbnailPreview.offsetWidth||160,l=n.position*o.width,u=Math.max(c/2,Math.min(o.width-c/2,l));this.timelineThumbnailPreview.style.left=`${u}px`,this.timelineThumbnailImage.src===r.imageUrl?this.timelineThumbnailImage.complete&&this.timelineThumbnailImage.naturalWidth>0&&this.timelineThumbnailPreview.classList.remove(`flux-hidden`):(this.timelineThumbnailPreview.classList.add(`flux-hidden`),this.timelineThumbnailImage.src=r.imageUrl)}hideTimelineThumbnail(){this.timelineThumbnailPreview.classList.add(`flux-hidden`)}bindSubtitleTrack(e){if(this.subtitleTrackListeners.has(e))return;let t=()=>{e.mode===`showing`&&(e.mode=`hidden`),this.renderSubtitleCues()};e.addEventListener(`cuechange`,t),this.subtitleTrackListeners.set(e,t),this.domCleans.push(()=>{e.removeEventListener(`cuechange`,t),this.subtitleTrackListeners.delete(e)})}renderSubtitleCues(){let e=[];for(let t=0;t<this.videoEl.textTracks.length;t++){let n=this.videoEl.textTracks[t];if(!(n.mode===`disabled`||!n.activeCues))for(let t=0;t<n.activeCues.length;t++){let r=(n.activeCues[t].text??``).trim().replace(/<[^>]+>/g,``).trim();r&&e.push(r)}}if(e.length===0){this.subtitleDisplay.innerHTML=``;return}this.subtitleDisplay.innerHTML=e.map(e=>`<span class="flux-player-subtitle-text">${this.htmlEscape(e)}</span>`).join(`<br>`)}htmlEscape(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}handlePrimaryAction(){let e=this.player.getState();if(e.ended){this.replay();return}if(e.paused){this.player.play().catch(e=>{console.error(`[DefaultUI] Play failed:`,e)});return}this.player.pause()}replay(){this.player.seek(0),this.player.play().catch(e=>{console.error(`[DefaultUI] Replay failed:`,e)})}updateState(e){this.resetUiForSourceChange(e);let t=e.source?.adBreakTimes||[],n=t.join(`,`)+`/`+e.duration;if(n!==this.markerSignature){this.markerSignature=n,this.timeline.querySelectorAll(`.flux-ad-marker`).forEach(e=>e.remove());for(let n of t){if(!Number.isFinite(e.duration)||n>=e.duration)continue;let t=document.createElement(`span`);t.className=`flux-ad-marker`,t.title=n===0?`Pre-roll ad`:`Ad at `+this.formatTime(n),t.style.cssText=`position:absolute;top:-2px;height:8px;width:4px;border-radius:1px;background:#ffd45e;z-index:2`,t.style.left=100*n/e.duration+`%`,this.timeline.append(t)}}e.selectedSubtitle===null&&!e.availableSubtitles.some(e=>e.selected)&&this.subtitleDisplay.replaceChildren(),this.syncThumbnailTrack(e).catch(e=>{console.warn(`[DefaultUI] Thumbnail sync failed`,e)}),e.paused?this.uiPaused||(this.uiPaused=!0,this.playBtn.innerHTML=g.play,!e.error&&!e.ended&&this.bigPlay.classList.remove(`flux-hidden`),this.setControlsIdle(!1),clearTimeout(this.idleTimeout)):this.uiPaused&&(this.uiPaused=!1,this.playBtn.innerHTML=g.pause,this.bigPlay.classList.add(`flux-hidden`),this.replayBtn.classList.add(`flux-hidden`),this.setControlsIdle(!1),clearTimeout(this.idleTimeout),this.menuOpen||(this.idleTimeout=setTimeout(()=>{this.setControlsIdle(!0)},3e3))),e.buffering?this.spinner.classList.remove(`flux-hidden`):this.spinner.classList.add(`flux-hidden`),e.error?(this.errorPanel.classList.remove(`flux-hidden`),this.errorTextEl.innerText=e.error.message,this.spinner.classList.add(`flux-hidden`),this.bigPlay.classList.add(`flux-hidden`),this.replayBtn.classList.add(`flux-hidden`)):this.errorPanel.classList.add(`flux-hidden`),e.ended&&!e.error?(this.bigPlay.classList.add(`flux-hidden`),this.replayBtn.classList.remove(`flux-hidden`),this.setControlsIdle(!1),this.playBtn.innerHTML=g.replay):this.replayBtn.classList.add(`flux-hidden`),e.isLive?(this.liveBadge.classList.remove(`flux-hidden`),this.timeline.classList.add(`flux-disabled`),this.timeDisplay.classList.add(`flux-hidden`)):(this.liveBadge.classList.add(`flux-hidden`),this.timeline.classList.remove(`flux-disabled`),this.timeDisplay.classList.remove(`flux-hidden`));let r=e.duration||0;if(!this.isDragging&&(this.timeDisplay.innerText=`${this.formatTime(e.currentTime)} / ${this.formatTime(r)}`,this.timeDisplay.setAttribute(`aria-label`,e.isLive?`Live stream, current position ${this.formatTime(e.currentTime)}`:`Current time ${this.formatTime(e.currentTime)} of ${this.formatTime(r)}`),this.timeline.setAttribute(`aria-valuemin`,`0`),this.timeline.setAttribute(`aria-valuenow`,String(Math.round(e.currentTime))),this.timeline.setAttribute(`aria-valuemax`,String(Number.isFinite(r)?Math.round(r):0)),this.timeline.setAttribute(`aria-valuetext`,`${this.formatTime(e.currentTime)} of ${this.formatTime(r)}`),r>0))if(this.progressFill.style.width=`${e.currentTime/r*100}%`,e.buffered.length>0){let t=e.buffered[e.buffered.length-1];this.bufferedFill.style.width=`${t.end/r*100}%`}else this.bufferedFill.style.width=`0%`;e.muted||e.volume===0?(this.muteBtn.innerHTML=g.mute,this.volumeSlider.value=`0`):(this.muteBtn.innerHTML=g.volume,this.volumeSlider.value=String(e.volume))}toggleMenu(e){this.menuOpen=typeof e==`boolean`?e:!this.menuOpen,this.menuOpen?(this.renderMenu(),this.settingsMenu.classList.remove(`flux-hidden`),this.settingsBtn.setAttribute(`aria-expanded`,`true`),this.menuFocusIndex=0,this.updateMenuA11yState(),this.focusMenuItem(this.menuFocusIndex),clearTimeout(this.idleTimeout)):(this.settingsMenu.classList.add(`flux-hidden`),this.settingsBtn.setAttribute(`aria-expanded`,`false`),this.wrapper.dispatchEvent(new Event(`mousemove`)))}renderMenu(){let e=this.player.getState();this.settingsMenu.innerHTML=``;let t=e.selectedSubtitle??e.availableSubtitles.find(e=>e.selected)?.id??null;this.addMenuSection(`Quality`,e.availableQualities.map(t=>({id:String(t.id),label:t.label,active:e.selectedQuality===t.id,onClick:()=>this.player.setQuality(t.id)})).concat(e.availableQualities.length>0?[{id:`auto`,label:`Auto`,active:e.selectedQuality===`auto`,onClick:()=>this.player.setQuality(`auto`)}]:[])),this.addMenuSection(`Audio`,e.availableAudioTracks.map(e=>({id:e.id,label:e.label,active:e.selected,onClick:()=>this.player.setAudioTrack(e.id)}))),this.addMenuSection(`Captions`,e.availableSubtitles.map(e=>({id:e.id,label:e.label,active:t===e.id,onClick:()=>this.player.setSubtitle(e.id)})).concat(e.availableSubtitles.length>0?[{id:`off`,label:`Off`,active:t===null,onClick:()=>this.player.setSubtitle(null)}]:[]));let n=[.5,.75,1,1.25,1.5,2].map(t=>({id:String(t),label:t===1?`Normal (1x)`:`${t}x`,active:e.playbackRate===t,onClick:()=>this.player.setPlaybackRate(t)}));this.addMenuSection(`Speed`,n),this.updateMenuA11yState()}addMenuSection(e,t){let n=document.createElement(`div`);n.className=`flux-player-menu-section`;let r=document.createElement(`div`);if(r.className=`flux-player-menu-header`,r.innerText=e,n.appendChild(r),t.length===0){let e=document.createElement(`div`);e.className=`flux-player-menu-placeholder`,e.innerText=`Not available`,n.appendChild(e)}else t.forEach(e=>{let t=document.createElement(`div`);t.className=`flux-player-menu-item ${e.active?`flux-active`:``}`,t.innerText=e.label,t.setAttribute(`role`,`menuitemradio`),t.setAttribute(`aria-checked`,e.active?`true`:`false`),t.tabIndex=-1,t.addEventListener(`click`,()=>{e.onClick(),this.toggleMenu(!1)}),n.appendChild(t)});this.settingsMenu.appendChild(n)}destroy(){this.thumbnailFetchAbort?.abort(),this.cleans.forEach(e=>e()),this.domCleans.forEach(e=>e()),this.domCleans=[],clearTimeout(this.idleTimeout),this.container.innerHTML=``}},T=class{player;adapter;cleans=[];loadStartedAt=null;playbackStartedAt=null;rebufferStartedAt=null;totalRebufferMs=0;rebufferCount=0;sessionStartedAt=Date.now();manifestLoadedAt=null;firstFrameAt=null;trace=[];bitrateTimeline=[];constructor(e,t){this.player=e,this.adapter=t||((e,t)=>console.log(`[Analytics] ${e}`,t)),this.bind()}bind(){this.emit(`player.created`,`lifecycle`,{}),[`source_loading`,`source_loaded`,`playback_requested`,`playback_started`,`seek_start`,`seek_complete`,`error`].forEach(e=>{this.cleans.push(this.player.on(e,t=>{e===`source_loading`&&(this.loadStartedAt=Date.now(),this.playbackStartedAt=null,this.manifestLoadedAt=null,this.firstFrameAt=null,this.rebufferCount=0,this.totalRebufferMs=0),e===`source_loaded`&&(this.manifestLoadedAt=Date.now(),this.emit(`qoe.startup.manifest_loaded`,`qoe`,{manifestLoadMs:this.loadStartedAt?this.manifestLoadedAt-this.loadStartedAt:null})),e===`playback_started`&&this.playbackStartedAt===null&&(this.playbackStartedAt=Date.now(),this.firstFrameAt=this.playbackStartedAt,this.emit(`qoe.startup.first_frame`,`qoe`,{firstFrameMs:this.loadStartedAt?this.firstFrameAt-this.loadStartedAt:null,manifestLoadMs:this.loadStartedAt&&this.manifestLoadedAt?this.manifestLoadedAt-this.loadStartedAt:null,postManifestToFirstFrameMs:this.firstFrameAt&&this.manifestLoadedAt?this.firstFrameAt-this.manifestLoadedAt:null})),this.emit(this.normalizeEventName(e),this.categoryForEvent(e),this.withQoe(t))}))}),this.cleans.push(this.player.on(`state:paused`,e=>{e&&this.emit(`playback.pause`,`playback`,this.withQoe({currentTime:this.player.getState().currentTime}))})),this.cleans.push(this.player.on(`state:buffered`,e=>{this.player.getState().readyState===2&&this.rebufferStartedAt===null&&(this.rebufferStartedAt=Date.now(),this.rebufferCount+=1,this.emit(`playback.buffering_start`,`qoe`,this.withQoe({currentTime:this.player.getState().currentTime,rebufferCount:this.rebufferCount,sinceStartMs:Date.now()-this.sessionStartedAt})))})),this.cleans.push(this.player.on(`state:readyState`,e=>{if(e===4&&this.rebufferStartedAt!==null){let e=Date.now()-this.rebufferStartedAt;this.totalRebufferMs+=e,this.rebufferStartedAt=null,this.emit(`playback.buffering_end`,`qoe`,this.withQoe({currentTime:this.player.getState().currentTime,rebufferMs:e,rebufferCount:this.rebufferCount,totalRebufferMs:this.totalRebufferMs,sinceStartMs:Date.now()-this.sessionStartedAt}))}})),this.cleans.push(this.player.on(`state:selectedQuality`,e=>{let t=this.player.getState().availableQualities.find(e=>e.selected);this.bitrateTimeline.push({at:Date.now(),bitrate:t?.bitrate||null,quality:e}),this.emit(`track.quality_changed`,`track`,this.withQoe({quality:e}))})),this.cleans.push(this.player.on(`state:selectedSubtitle`,e=>this.emit(`track.subtitle_changed`,`track`,this.withQoe({subtitle:e})))),this.cleans.push(this.player.on(`state:selectedAudioTrack`,e=>this.emit(`track.audio_changed`,`track`,this.withQoe({audioTrack:e})))),this.cleans.push(this.player.on(`state:volume`,e=>this.emit(`playback.volume_changed`,`playback`,this.withQoe({volume:e})))),this.cleans.push(this.player.on(`state:muted`,e=>this.emit(`playback.muted_changed`,`playback`,this.withQoe({muted:e})))),this.cleans.push(this.player.on(`state:playbackRate`,e=>this.emit(`playback.rate_changed`,`playback`,this.withQoe({rate:e})))),this.cleans.push(this.player.on(`error`,e=>{let t=e?.error||e;this.emit(`error.classified`,`error`,{classification:this.classifyError(t),code:t?.code,message:t?.message})}))}getSessionTrace(){return this.trace.map(e=>({...e,payload:JSON.parse(JSON.stringify(e.payload??null))}))}normalizeEventName(e){return{source_loading:`source.loading`,source_loaded:`source.loaded`,playback_requested:`playback.requested`,playback_started:`playback.started`,seek_start:`playback.seek_start`,seek_complete:`playback.seek_complete`,error:`playback.error`}[e]||e}withQoe(e){let t=this.player.getState().availableQualities.find(e=>e.selected),n=this.player.getVideoPlaybackQuality?.()||void 0;return{...e,qoe:{startupTimeMs:this.loadStartedAt&&this.playbackStartedAt?this.playbackStartedAt-this.loadStartedAt:null,manifestLoadMs:this.loadStartedAt&&this.manifestLoadedAt?this.manifestLoadedAt-this.loadStartedAt:null,firstFrameMs:this.loadStartedAt&&this.firstFrameAt?this.firstFrameAt-this.loadStartedAt:null,rebufferCount:this.rebufferCount,totalRebufferMs:this.totalRebufferMs,bitrate:t?.bitrate||null,droppedFrames:n?.droppedVideoFrames??null,bitrateTimeline:this.bitrateTimeline.slice(-20)}}}emit(e,t,n){let r=Date.now(),i={at:r,sinceStartMs:r-this.sessionStartedAt,event:e,category:t,payload:n};this.trace.push(i),this.trace.length>500&&this.trace.shift(),this.adapter(e,n)}classifyError(e){let t=String(e?.code||``).toLowerCase(),n=String(e?.message||``).toLowerCase();return t.includes(`network`)||n.includes(`network`)||n.includes(`manifest`)||n.includes(`segment`)?`network`:t.includes(`media`)||n.includes(`decode`)||n.includes(`demux`)?`decode`:t.includes(`drm`)||n.includes(`drm`)||n.includes(`key system`)||n.includes(`license`)?`drm`:`unknown`}categoryForEvent(e){return e===`error`?`error`:e.startsWith(`seek`)||e.startsWith(`playback`)?`playback`:e.startsWith(`source`)?`lifecycle`:`qoe`}destroy(){this.cleans.forEach(e=>e())}},E=class{player;mountEl;panel=null;bodyEl=null;visible=!0;events=[];cleans=[];constructor(e,t){this.player=e,this.mountEl=t||document.body,this.inject(),this.bind()}inject(){this.panel=document.createElement(`div`),this.panel.className=`flux-devtools-overlay`,this.panel.style.position=this.mountEl===document.body?`fixed`:`absolute`,this.panel.style.top=`10px`,this.panel.style.right=`10px`,this.panel.style.backgroundColor=`rgba(0,0,0,0.85)`,this.panel.style.color=`#0f0`,this.panel.style.padding=`10px`,this.panel.style.fontFamily=`monospace`,this.panel.style.fontSize=`12px`,this.panel.style.zIndex=`9999`,this.panel.style.width=`320px`,this.panel.style.maxHeight=`280px`,this.panel.style.overflow=`auto`,this.panel.style.borderRadius=`8px`,this.panel.style.pointerEvents=`auto`,this.bodyEl=document.createElement(`pre`),this.bodyEl.style.margin=`0`,this.bodyEl.style.whiteSpace=`pre-wrap`,this.panel.appendChild(this.bodyEl),this.mountEl.appendChild(this.panel)}bind(){[`source_loading`,`source_loaded`,`playback_requested`,`playback_started`,`seek_start`,`seek_complete`,`error`,`state:change`].forEach(e=>{this.cleans.push(this.player.on(e,t=>{this.events.unshift({name:e,payload:t,ts:Date.now()}),this.events.length>25&&(this.events.length=25),this.render()}))}),this.render()}render(){if(!this.bodyEl||!this.visible)return;let e=this.player.getState(),t=this.events.slice(0,8).map(e=>`${new Date(e.ts).toLocaleTimeString()} ${e.name}`).join(`
2
+ `),n=[`Engine: ${e.engineType||`none`}`,`Status: ${e.status}`,`Time: ${e.currentTime.toFixed(2)} / ${Number.isFinite(e.duration)?e.duration.toFixed(2):`live`}`,`Buffered: ${e.buffered.map(e=>`[${e.start.toFixed(1)}-${e.end.toFixed(1)}]`).join(`, `)||`none`}`,`Quality: ${e.selectedQuality}`,`Subtitles: ${e.selectedSubtitle||`none`}`,`Audio: ${e.selectedAudioTrack}`,`Bitrate: ${e.availableQualities.find(e=>e.selected)?.bitrate||`n/a`}`,`Error: ${e.error?`${e.error.code} ${e.error.message}`:`none`}`,``,`Recent Events:`,t||`none`].join(`
3
+ `);this.bodyEl.innerText=n}setVisible(e){this.visible=e,this.panel&&(this.panel.style.display=e?`block`:`none`),e&&this.render()}isVisible(){return this.visible}destroy(){this.cleans.forEach(e=>e()),this.cleans=[],this.panel&&=(this.panel.remove(),null),this.bodyEl=null}},D=()=>Date.now(),O=class{startedAt=D();waitingStartedAt=null;startupStallStartedAt=null;awaitingFirstFrameAfterPlay=!1;seenTelemetry=new Set;startup=this.createStartup(this.startedAt);sessionTrace=[];createStartup(e){return{playerCreatedAt:e,sourceLoadRequestedAt:null,manifestRequestStartedAt:null,manifestReceivedAt:null,manifestParseStartedAt:null,manifestParseCompletedAt:null,firstSegmentRequestStartedAt:null,firstSegmentReceivedAt:null,firstAppendCompletedAt:null,playCalledAt:null,firstFrameAt:null,startupCompletedAt:null,startupDurationMs:null,sourceLoadToFirstFrameMs:null,playToFirstFrameMs:null,manifestToFirstFrameMs:null,totalRebufferCount:0,totalRebufferDurationMs:0,startupStallCount:0,startupStallMs:0,retryEvents:0,errorEvents:0,bitrateOverTime:[]}}resetForNewSource(){this.startedAt=D(),this.waitingStartedAt=null,this.startupStallStartedAt=null,this.awaitingFirstFrameAfterPlay=!1,this.seenTelemetry.clear(),this.startup=this.createStartup(this.startedAt),this.sessionTrace=[]}mark(e,t=D()){this.startup[e]===null&&(this.startup[e]=t)}onSourceLoadRequested(){this.mark(`sourceLoadRequestedAt`),this.pushTrace(`source_load_requested`,`lifecycle`,void 0)}onPlayCalled(){this.startup.playCalledAt===null&&(this.mark(`playCalledAt`),this.awaitingFirstFrameAfterPlay=!0,this.pushTrace(`play_called`,`playback`,void 0))}onFirstFrame(){this.awaitingFirstFrameAfterPlay&&this.startup.firstFrameAt===null&&(this.mark(`firstFrameAt`),this.startup.playCalledAt!==null&&this.startup.firstFrameAt!==null&&this.startup.startupCompletedAt===null&&this.finalizeStartup(this.startup.firstFrameAt))}finalizeStartup(e){if(this.startup.startupCompletedAt!==null)return;this.startup.startupCompletedAt=e;let t=this.startup.playCalledAt;if(t!==null){if(e<t)return;this.startup.startupDurationMs=e-t}else{let t=this.startup.sourceLoadRequestedAt??this.startedAt;if(e<t)return;this.startup.startupDurationMs=e-t}this.awaitingFirstFrameAfterPlay=!1,this.pushTrace(`startup_completed`,`lifecycle`,{startupDurationMs:this.startup.startupDurationMs})}onWaiting(){if(this.waitingStartedAt!==null||this.startupStallStartedAt!==null)return;let e=D();this.startup.firstFrameAt===null?(this.startupStallStartedAt=e,this.startup.startupStallCount+=1,this.pushTrace(`startup_stall_start`,`qoe`,{startupStallCount:this.startup.startupStallCount})):(this.waitingStartedAt=e,this.startup.totalRebufferCount+=1,this.pushTrace(`rebuffer_start`,`qoe`,{totalRebufferCount:this.startup.totalRebufferCount}))}onPlaying(){if(this.startupStallStartedAt!==null&&(this.startup.startupStallMs+=D()-this.startupStallStartedAt,this.startupStallStartedAt=null,this.pushTrace(`startup_stall_end`,`qoe`,{startupStallMs:this.startup.startupStallMs})),this.waitingStartedAt!==null){let e=D()-this.waitingStartedAt;this.startup.totalRebufferDurationMs+=e,this.waitingStartedAt=null,this.pushTrace(`rebuffer_end`,`qoe`,{totalRebufferDurationMs:this.startup.totalRebufferDurationMs})}}onTelemetry(e,t=D(),n){let r={manifest_request_started:`manifestRequestStartedAt`,manifest_received:`manifestReceivedAt`,manifest_parse_started:`manifestParseStartedAt`,manifest_parse_completed:`manifestParseCompletedAt`,first_segment_request_started:`firstSegmentRequestStartedAt`,first_segment_received:`firstSegmentReceivedAt`,first_append_completed:`firstAppendCompletedAt`}[e];r&&!this.seenTelemetry.has(e)&&(this.seenTelemetry.add(e),this.mark(r,t)),typeof n?.bitrate==`number`&&Number.isFinite(n.bitrate)&&this.startup.bitrateOverTime.push({at:t,bitrate:n.bitrate}),e.toLowerCase().includes(`retry`)&&(this.startup.retryEvents+=1),this.pushTrace(e,`lifecycle`,n)}onError(e){this.startup.errorEvents+=1,this.pushTrace(`error`,`error`,e)}getStartupMetrics(){let e=this.startup,t=(e,t)=>e!==null&&t!==null?e-t:null;return{...e,sourceLoadToFirstFrameMs:t(e.firstFrameAt,e.sourceLoadRequestedAt),playToFirstFrameMs:t(e.firstFrameAt,e.playCalledAt),manifestToFirstFrameMs:t(e.firstFrameAt,e.manifestReceivedAt),startupStallCount:e.startupStallCount,startupStallMs:e.startupStallMs,bitrateOverTime:[...e.bitrateOverTime]}}getSessionTrace(){return[...this.sessionTrace]}printStartupReport(){let e=this.getStartupMetrics(),t=e=>e===null?`n/a`:`${Math.round(e)}ms`,n=t=>t===null?null:t-e.playerCreatedAt;console.group(`[Flux] Startup Report`),console.table({startupDuration:t(e.startupDurationMs),manifestRequestToReceived:t(e.manifestRequestStartedAt&&e.manifestReceivedAt?e.manifestReceivedAt-e.manifestRequestStartedAt:null),parseDuration:t(e.manifestParseStartedAt&&e.manifestParseCompletedAt?e.manifestParseCompletedAt-e.manifestParseStartedAt:null),firstSegmentNetwork:t(e.firstSegmentRequestStartedAt&&e.firstSegmentReceivedAt?e.firstSegmentReceivedAt-e.firstSegmentRequestStartedAt:null),firstAppendToFrame:t(e.firstAppendCompletedAt&&e.firstFrameAt?e.firstFrameAt-e.firstAppendCompletedAt:null),rebufferCount:e.totalRebufferCount,rebufferDuration:t(e.totalRebufferDurationMs),retryEvents:e.retryEvents,errorEvents:e.errorEvents}),console.log(`Timeline (ms from player create):`,{sourceLoadRequested:n(e.sourceLoadRequestedAt),manifestRequestStarted:n(e.manifestRequestStartedAt),manifestReceived:n(e.manifestReceivedAt),manifestParseStarted:n(e.manifestParseStartedAt),manifestParseCompleted:n(e.manifestParseCompletedAt),firstSegmentRequestStarted:n(e.firstSegmentRequestStartedAt),firstSegmentReceived:n(e.firstSegmentReceivedAt),firstAppendCompleted:n(e.firstAppendCompletedAt),playCalled:n(e.playCalledAt),firstFrame:n(e.firstFrameAt),startupCompleted:n(e.startupCompletedAt)}),console.groupEnd()}pushTrace(e,t,n){let r=D();this.sessionTrace.push({at:r,sinceStartMs:r-this.startedAt,event:e,category:t,payload:n})}},k=r({AbrController:()=>as,AttrList:()=>Os,AudioStreamController:()=>Uc,AudioTrackController:()=>Gc,BasePlaylistController:()=>Wc,BaseSegment:()=>zo,BaseStreamController:()=>Ks,BufferController:()=>Xc,CMCDController:()=>Fl,CapLevelController:()=>Zc,ChunkMetadata:()=>Ss,ContentSteeringController:()=>Ll,Cues:()=>Nu,DateRange:()=>As,EMEController:()=>Rl,ErrorActionFlags:()=>cs,ErrorController:()=>ls,ErrorDetails:()=>Z,ErrorTypes:()=>wo,Events:()=>Q,FPSController:()=>Bl,FetchLoader:()=>Fu,Fragment:()=>Bo,Hls:()=>ed,HlsSkip:()=>es,HlsUrlParameters:()=>ts,KeySystemFormats:()=>Fs,KeySystems:()=>Ps,Level:()=>ns,LevelDetails:()=>Ms,LevelKey:()=>Rs,LoadStats:()=>Lo,M3U8Parser:()=>Ws,MetadataSchema:()=>tc,NetworkErrorAction:()=>ss,Part:()=>Vo,PlaylistLevelType:()=>Eo,SubtitleStreamController:()=>Zl,SubtitleTrackController:()=>Vl,TimelineController:()=>ju,XhrLoader:()=>Ru,default:()=>ed,fetchSupported:()=>$a,getMediaSource:()=>B,isMSESupported:()=>go,isSupported:()=>_o,requestMediaKeySystemAccess:()=>Is});function A(e,t,n){return(t=F(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j(){return j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},j.apply(null,arguments)}function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function N(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?M(Object(n),!0).forEach(function(t){A(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function P(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function F(e){var t=P(e,`string`);return typeof t==`symbol`?t:t+``}function I(){return j({},jo)}function L(e,t){let n=self.console[e];return n?n.bind(self.console,`${t?`[`+t+`] `:``}[${e}] >`):Ao}function R(e,t,n){return t[e]?t[e].bind(t):L(e,n)}function z(e,t,n){let r=I();if(typeof console==`object`&&e===!0||typeof e==`object`){let i=[`debug`,`log`,`info`,`warn`,`error`];i.forEach(t=>{r[t]=R(t,e,n)});try{r.log(`Debug logs enabled for "${t}" in hls.js version 1.6.15`)}catch{return I()}i.forEach(t=>{Mo[t]=R(t,e)})}else j(Mo,r);return r}function B(e=!0){if(!(typeof self>`u`))return(e||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function V(e){return typeof self<`u`&&e===self.ManagedMediaSource}function H(e,t){let n=Object.keys(e),r=Object.keys(t),i=n.length,o=r.length;return!i||!o||i===o&&!n.some(e=>r.indexOf(e)===-1)}function U(e,t=!1){if(typeof TextDecoder<`u`){let n=new TextDecoder(`utf-8`).decode(e);if(t){let e=n.indexOf(`\0`);return e===-1?n:n.substring(0,e)}return n.replace(/\0/g,``)}let n=e.length,r,i,o,c=``,l=0;for(;l<n;){if(r=e[l++],r===0&&t)return c;if(!(r===0||r===3))switch(r>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:c+=String.fromCharCode(r);break;case 12:case 13:i=e[l++],c+=String.fromCharCode((r&31)<<6|i&63);break;case 14:i=e[l++],o=e[l++],c+=String.fromCharCode((r&15)<<12|(i&63)<<6|(o&63)<<0);break}}return c}function W(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n].toString(16);r.length<2&&(r=`0`+r),t+=r}return t}function G(e){return Uint8Array.from(e.replace(/^0x/,``).replace(/([\da-fA-F]{2}) ?/g,`0x$1 `).replace(/ +$/,``).split(` `)).buffer}function K(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function ee(){return Fo?Po.exports:(Fo=1,(function(e,t){(function(t){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,i=/(?:\/|^)\.(?=\/)/g,o=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,c={buildAbsoluteURL:function(e,t,n){if(n||={},e=e.trim(),t=t.trim(),!t){if(!n.alwaysNormalize)return e;var i=c.parseURL(e);if(!i)throw Error(`Error trying to parse base URL.`);return i.path=c.normalizePath(i.path),c.buildURLFromParts(i)}var o=c.parseURL(t);if(!o)throw Error(`Error trying to parse relative URL.`);if(o.scheme)return n.alwaysNormalize?(o.path=c.normalizePath(o.path),c.buildURLFromParts(o)):t;var l=c.parseURL(e);if(!l)throw Error(`Error trying to parse base URL.`);if(!l.netLoc&&l.path&&l.path[0]!==`/`){var u=r.exec(l.path);l.netLoc=u[1],l.path=u[2]}l.netLoc&&!l.path&&(l.path=`/`);var d={scheme:l.scheme,netLoc:o.netLoc,path:null,params:o.params,query:o.query,fragment:o.fragment};if(!o.netLoc&&(d.netLoc=l.netLoc,o.path[0]!==`/`))if(!o.path)d.path=l.path,o.params||(d.params=l.params,o.query||(d.query=l.query));else{var f=l.path,p=f.substring(0,f.lastIndexOf(`/`)+1)+o.path;d.path=c.normalizePath(p)}return d.path===null&&(d.path=n.alwaysNormalize?c.normalizePath(o.path):o.path),c.buildURLFromParts(d)},parseURL:function(e){var t=n.exec(e);return t?{scheme:t[1]||``,netLoc:t[2]||``,path:t[3]||``,params:t[4]||``,query:t[5]||``,fragment:t[6]||``}:null},normalizePath:function(e){for(e=e.split(``).reverse().join(``).replace(i,``);e.length!==(e=e.replace(o,``)).length;);return e.split(``).reverse().join(``)},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};e.exports=c})()})(Po),Po.exports)}function q(e){return e.sn!==`initSegment`}function te(e,t){let n=Object.getPrototypeOf(e);if(n)return Object.getOwnPropertyDescriptor(n,t)||te(n,t)}function ne(e,t){let n=te(e,t);n&&(n.enumerable=!0,Object.defineProperty(e,t,n))}function re(e){return String.fromCharCode.apply(null,e)}function ie(e,t){let n=e[t]<<8|e[t+1];return n<0?65536+n:n}function J(e,t){let n=oe(e,t);return n<0?4294967296+n:n}function ae(e,t){let n=J(e,t);return n*=2**32,n+=J(e,t+4),n}function oe(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function se(e){let t=e.byteLength;for(let n=0;n<t;){let r=J(e,n);if(r>8&&e[n+4]===109&&e[n+5]===111&&e[n+6]===111&&e[n+7]===102)return!0;n=r>1?n+r:t}return!1}function ce(e,t){let n=[];if(!t.length)return n;let r=e.byteLength;for(let i=0;i<r;){let o=J(e,i),c=re(e.subarray(i+4,i+8)),l=o>1?i+o:r;if(c===t[0])if(t.length===1)n.push(e.subarray(i+8,l));else{let r=ce(e.subarray(i+8,l),t.slice(1));r.length&&Uo.apply(n,r)}i=l}return n}function le(e){let t=[],n=e[0],r=8,i=J(e,r);r+=4;let o=0,c=0;n===0?(o=J(e,r),c=J(e,r+4),r+=8):(o=ae(e,r),c=ae(e,r+8),r+=16),r+=2;let l=e.length+c,u=ie(e,r);r+=2;for(let n=0;n<u;n++){let n=r,o=J(e,n);n+=4;let c=o&2147483647;if((o&2147483648)>>>31==1)return No.warn(`SIDX has hierarchical references (not supported)`),null;let u=J(e,n);n+=4,t.push({referenceSize:c,subsegmentDuration:u,info:{duration:u/i,start:l,end:l+c-1}}),l+=c,n+=4,r=n}return{earliestPresentationTime:o,timescale:i,version:n,referencesCount:u,references:t}}function ue(e){let t=[],n=ce(e,[`moov`,`trak`]);for(let e=0;e<n.length;e++){let r=n[e],i=ce(r,[`tkhd`])[0];if(i){let e=i[0],n=J(i,e===0?12:20),o=ce(r,[`mdia`,`mdhd`])[0];if(o){e=o[0];let i=J(o,e===0?12:20),c=ce(r,[`mdia`,`hdlr`])[0];if(c){let e=re(c.subarray(8,12)),o={soun:Ro.AUDIO,vide:Ro.VIDEO}[e],l=ce(r,[`mdia`,`minf`,`stbl`,`stsd`])[0],u=de(l);o?(t[n]={timescale:i,type:o,stsd:u},t[o]=N({timescale:i,id:n},u)):t[n]={timescale:i,type:e,stsd:u}}}}}return ce(e,[`moov`,`mvex`,`trex`]).forEach(e=>{let n=t[J(e,4)];n&&(n.default={duration:J(e,12),flags:J(e,20)})}),t}function de(e){let t=e.subarray(8),n=t.subarray(86),r=re(t.subarray(4,8)),i=r,o,c=r===`enca`||r===`encv`;c&&ce(ce(t,[r])[0].subarray(r===`enca`?28:78),[`sinf`]).forEach(e=>{let t=ce(e,[`schm`])[0];if(t){let n=re(t.subarray(4,8));if(n===`cbcs`||n===`cenc`){let t=ce(e,[`frma`])[0];t&&(i=re(t))}}});let l=i;switch(i){case`avc1`:case`avc2`:case`avc3`:case`avc4`:{let e=ce(n,[`avcC`])[0];e&&e.length>3&&(i+=`.`+he(e[1])+he(e[2])+he(e[3]),o=fe(l===`avc1`?`dva1`:`dvav`,n));break}case`mp4a`:{let e=ce(t,[r])[0],n=ce(e.subarray(28),[`esds`])[0];if(n&&n.length>7){let e=4;if(n[e++]!==3)break;e=me(n,e),e+=2;let t=n[e++];if(t&128&&(e+=2),t&64&&(e+=n[e++]),n[e++]!==4)break;e=me(n,e);let r=n[e++];if(r===64)i+=`.`+he(r);else break;if(e+=12,n[e++]!==5)break;e=me(n,e);let o=n[e++],c=(o&248)>>3;c===31&&(c+=1+((o&7)<<3)+((n[e]&224)>>5)),i+=`.`+c}break}case`hvc1`:case`hev1`:{let e=ce(n,[`hvcC`])[0];if(e&&e.length>12){let t=e[1],n=[``,`A`,`B`,`C`][t>>6],r=t&31,o=J(e,2),c=(t&32)>>5?`H`:`L`,l=e[12],u=e.subarray(6,12);i+=`.`+n+r,i+=`.`+pe(o).toString(16).toUpperCase(),i+=`.`+c+l;let d=``;for(let e=u.length;e--;){let t=u[e];(t||d)&&(d=`.`+t.toString(16).toUpperCase()+d)}i+=d}o=fe(l==`hev1`?`dvhe`:`dvh1`,n);break}case`dvh1`:case`dvhe`:case`dvav`:case`dva1`:case`dav1`:i=fe(i,n)||i;break;case`vp09`:{let e=ce(n,[`vpcC`])[0];if(e&&e.length>6){let t=e[4],n=e[5],r=e[6]>>4&15;i+=`.`+ge(t)+`.`+ge(n)+`.`+ge(r)}break}case`av01`:{let e=ce(n,[`av1C`])[0];if(e&&e.length>2){let t=e[1]>>>5,r=e[1]&31,c=e[2]>>>7?`H`:`M`,l=(e[2]&64)>>6,u=(e[2]&32)>>5,d=t===2&&l?u?12:10:l?10:8,f=(e[2]&16)>>4,p=(e[2]&8)>>3,m=(e[2]&4)>>2,h=e[2]&3;i+=`.`+t+`.`+ge(r)+c+`.`+ge(d)+`.`+f+`.`+p+m+h+`.`+ge(1)+`.`+ge(1)+`.`+ge(1)+`.0`,o=fe(`dav1`,n)}break}}return{codec:i,encrypted:c,supplemental:o}}function fe(e,t){let n=ce(t,[`dvvC`]),r=n.length?n[0]:ce(t,[`dvcC`])[0];if(r){let t=r[2]>>1&127,n=r[2]<<5&32|r[3]>>3&31;return e+`.`+ge(t)+`.`+ge(n)}}function pe(e){let t=0;for(let n=0;n<32;n++)t|=(e>>n&1)<<31-n;return t>>>0}function me(e,t){let n=t+5;for(;e[t++]&128&&t<n;);return t}function he(e){return(`0`+e.toString(16).toUpperCase()).slice(-2)}function ge(e){return(e<10?`0`:``)+e}function _e(e,t){if(!e||!t)return;let n=t.keyId;n&&t.isCommonEncryption&&ye(e,(e,t)=>{let r=e.subarray(8,24);r.some(e=>e!==0)||(No.log(`[eme] Patching keyId in 'enc${t?`a`:`v`}>sinf>>tenc' box: ${W(r)} -> ${W(n)}`),e.set(n,8))})}function ve(e){let t=[];return ye(e,e=>t.push(e.subarray(8,24))),t}function ye(e,t){ce(e,[`moov`,`trak`]).forEach(e=>{let n=ce(e,[`mdia`,`minf`,`stbl`,`stsd`])[0];if(!n)return;let r=n.subarray(8),i=ce(r,[`enca`]),o=i.length>0;o||(i=ce(r,[`encv`])),i.forEach(e=>{ce(o?e.subarray(28):e.subarray(78),[`sinf`]).forEach(e=>{let n=be(e);n&&t(n,o)})})})}function be(e){let t=ce(e,[`schm`])[0];if(t){let n=re(t.subarray(4,8));if(n===`cbcs`||n===`cenc`){let t=ce(e,[`schi`,`tenc`])[0];if(t)return t}}}function xe(e,t,n){let r={},i=ce(e,[`moof`,`traf`]);for(let e=0;e<i.length;e++){let o=i[e],c=ce(o,[`tfhd`])[0],l=J(c,4),u=t[l];if(!u)continue;r[l]||(r[l]={start:NaN,duration:0,sampleCount:0,timescale:u.timescale,type:u.type});let d=r[l],f=ce(o,[`tfdt`])[0];if(f){let e=f[0],t=J(f,4);e===1&&(t===Ho?n.warn(`[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time`):(t*=Ho+1,t+=J(f,8))),X(t)&&(!X(d.start)||t<d.start)&&(d.start=t)}let p=u.default,m=J(c,0)|p?.flags,h=p?.duration||0;m&8&&(h=m&2?J(c,12):J(c,8));let g=ce(o,[`trun`]),_=d.start||0,v=0,y=h;for(let e=0;e<g.length;e++){let t=g[e],n=J(t,4),r=d.sampleCount;d.sampleCount+=n;let i=t[3]&1,o=t[3]&4,c=t[2]&1,l=t[2]&2,u=t[2]&4,f=t[2]&8,p=8,m=n;for(i&&(p+=4),o&&n&&(!(t[p+1]&1)&&d.keyFrameIndex===void 0&&(d.keyFrameIndex=r),p+=4,c?(y=J(t,p),p+=4):y=h,l&&(p+=4),f&&(p+=4),_+=y,v+=y,m--);m--;)c?(y=J(t,p),p+=4):y=h,l&&(p+=4),u&&(t[p+1]&1||d.keyFrameIndex===void 0&&(d.keyFrameIndex=d.sampleCount-(m+1),d.keyFrameStart=_),p+=4),f&&(p+=4),_+=y,v+=y;!v&&h&&(v+=h*n)}d.duration+=v}if(!Object.keys(r).some(e=>r[e].duration)){let t=1/0,n=0,i=ce(e,[`sidx`]);for(let e=0;e<i.length;e++){let r=le(i[e]);if(r!=null&&r.references){t=Math.min(t,r.earliestPresentationTime/r.timescale);let e=r.references.reduce((e,t)=>e+t.info.duration||0,0);n=Math.max(n,e+r.earliestPresentationTime/r.timescale)}}n&&X(n)&&Object.keys(r).forEach(e=>{r[e].duration||(r[e].duration=n*r[e].timescale-r[e].start)})}return r}function Se(e){let t={valid:null,remainder:null},n=ce(e,[`moof`]);if(n.length<2)return t.remainder=e,t;let r=n[n.length-1];return t.valid=e.slice(0,r.byteOffset-8),t.remainder=e.slice(r.byteOffset-8),t}function Ce(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function we(e,t){let n=[],r=t.samples,i=t.timescale,o=t.id,c=!1;return ce(r,[`moof`]).map(l=>{let u=l.byteOffset-8;ce(l,[`traf`]).map(l=>{let d=ce(l,[`tfdt`]).map(e=>{let t=e[0],n=J(e,4);return t===1&&(n*=2**32,n+=J(e,8)),n/i})[0];return d!==void 0&&(e=d),ce(l,[`tfhd`]).map(d=>{let f=J(d,4),p=J(d,0)&16777215,m=(p&1)!=0,h=(p&2)!=0,g=(p&8)!=0,_=0,v=(p&16)!=0,y=0,b=(p&32)!=0,x=8;f===o&&(m&&(x+=8),h&&(x+=4),g&&(_=J(d,x),x+=4),v&&(y=J(d,x),x+=4),b&&(x+=4),t.type===`video`&&(c=Te(t.codec)),ce(l,[`trun`]).map(o=>{let l=o[0],d=J(o,0)&16777215,f=(d&1)!=0,p=0,m=(d&4)!=0,h=(d&256)!=0,g=0,v=(d&512)!=0,b=0,x=(d&1024)!=0,S=(d&2048)!=0,C=0,w=J(o,4),T=8;f&&(p=J(o,T),T+=4),m&&(T+=4);let E=p+u;for(let u=0;u<w;u++){if(h?(g=J(o,T),T+=4):g=_,v?(b=J(o,T),T+=4):b=y,x&&(T+=4),S&&(C=l===0?J(o,T):oe(o,T),T+=4),t.type===Ro.VIDEO){let t=0;for(;t<b;){let o=J(r,E);E+=4,Ee(c,r[E])&&De(r.subarray(E,E+o),c?2:1,e+C/i,n),E+=o,t+=o+4}}e+=g/i}}))})})}),n}function Te(e){if(!e)return!1;let t=e.substring(0,4);return t===`hvc1`||t===`hev1`||t===`dvh1`||t===`dvhe`}function Ee(e,t){if(e){let e=t>>1&63;return e===39||e===40}else return(t&31)==6}function De(e,t,n,r){let i=Oe(e),o=0;o+=t;let c=0,l=0,u=0;for(;o<i.length;){c=0;do{if(o>=i.length)break;u=i[o++],c+=u}while(u===255);l=0;do{if(o>=i.length)break;u=i[o++],l+=u}while(u===255);let e=i.length-o,t=o;if(l<e)o+=l;else if(l>e){No.error(`Malformed SEI payload. ${l} is too small, only ${e} bytes left to parse.`);break}if(c===4){if(i[t++]===181){let e=ie(i,t);if(t+=2,e===49){let e=J(i,t);if(t+=4,e===1195456820){let e=i[t++];if(e===3){let o=i[t++],l=31&o,u=64&o,d=u?2+l*3:0,f=new Uint8Array(d);if(u){f[0]=o;for(let e=1;e<d;e++)f[e]=i[t++]}r.push({type:e,payloadType:c,pts:n,bytes:f})}}}}}else if(c===5&&l>16){let e=[];for(let n=0;n<16;n++){let r=i[t++].toString(16);e.push(r.length==1?`0`+r:r),(n===3||n===5||n===7||n===9)&&e.push(`-`)}let o=l-16,u=new Uint8Array(o);for(let e=0;e<o;e++)u[e]=i[t++];r.push({payloadType:c,pts:n,uuid:e.join(``),userData:U(u),userDataBytes:u})}}}function Oe(e){let t=e.byteLength,n=[],r=1;for(;r<t-2;)e[r]===0&&e[r+1]===0&&e[r+2]===3?(n.push(r+2),r+=2):r++;if(n.length===0)return e;let i=t-n.length,o=new Uint8Array(i),c=0;for(r=0;r<i;c++,r++)c===n[0]&&(c++,n.shift()),o[r]=e[c];return o}function ke(e){let t=e[0],n=``,r=``,i=0,o=0,c=0,l=0,u=0,d=0;if(t===0){for(;re(e.subarray(d,d+1))!==`\0`;)n+=re(e.subarray(d,d+1)),d+=1;for(n+=re(e.subarray(d,d+1)),d+=1;re(e.subarray(d,d+1))!==`\0`;)r+=re(e.subarray(d,d+1)),d+=1;r+=re(e.subarray(d,d+1)),d+=1,i=J(e,12),o=J(e,16),l=J(e,20),u=J(e,24),d=28}else if(t===1){d+=4,i=J(e,d),d+=4;let t=J(e,d);d+=4;let o=J(e,d);for(d+=4,c=2**32*t+o,So(c)||(c=2**53-1,No.warn(`Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box`)),l=J(e,d),d+=4,u=J(e,d),d+=4;re(e.subarray(d,d+1))!==`\0`;)n+=re(e.subarray(d,d+1)),d+=1;for(n+=re(e.subarray(d,d+1)),d+=1;re(e.subarray(d,d+1))!==`\0`;)r+=re(e.subarray(d,d+1)),d+=1;r+=re(e.subarray(d,d+1)),d+=1}let f=e.subarray(d,e.byteLength);return{schemeIdUri:n,value:r,timeScale:i,presentationTime:c,presentationTimeDelta:o,eventDuration:l,id:u,payload:f}}function Ae(e,...t){let n=t.length,r=8,i=n;for(;i--;)r+=t[i].byteLength;let o=new Uint8Array(r);for(o[0]=r>>24&255,o[1]=r>>16&255,o[2]=r>>8&255,o[3]=r&255,o.set(e,4),i=0,r=8;i<n;i++)o.set(t[i],r),r+=t[i].byteLength;return o}function je(e,t,n){if(e.byteLength!==16)throw RangeError(`Invalid system id`);let r,i;r=0,i=new Uint8Array;let o;r>0?(o=new Uint8Array(4),t.length>0&&new DataView(o.buffer).setUint32(0,t.length,!1)):o=new Uint8Array;let c=new Uint8Array(4);return n.byteLength>0&&new DataView(c.buffer).setUint32(0,n.byteLength,!1),Ae([112,115,115,104],new Uint8Array([r,0,0,0]),e,o,i,c,n)}function Me(e){let t=[];if(e instanceof ArrayBuffer){let n=e.byteLength,r=0;for(;r+32<n;){let n=Ne(new DataView(e,r));t.push(n),r+=n.size}}return t}function Ne(e){let t=e.getUint32(0),n=e.byteOffset,r=e.byteLength;if(r<t)return{offset:n,size:r};if(e.getUint32(4)!==1886614376)return{offset:n,size:t};let i=e.getUint32(8)>>>24;if(i!==0&&i!==1)return{offset:n,size:t};let o=e.buffer,c=W(new Uint8Array(o,n+12,16)),l=null,u=null,d=0;if(i===0)d=28;else{let i=e.getUint32(28);if(!i||r<32+i*16)return{offset:n,size:t};l=[];for(let e=0;e<i;e++)l.push(new Uint8Array(o,n+32+e*16,16));d=32+i*16}if(!d)return{offset:n,size:t};let f=e.getUint32(d);return t-32<f?{offset:n,size:t}:(u=new Uint8Array(o,n+d+4,f),{version:i,systemId:c,kids:l,data:u,offset:n,size:t})}function Pe(e,t){let n=Ko[t];return!!n&&!!n[e.slice(0,4)]}function Fe(e,t,n=!0){return!e.split(`,`).some(e=>!Ie(e,t,n))}function Ie(e,t,n=!0){return B(n)?.isTypeSupported(Le(e,t))??!1}function Le(e,t){return`${t}/mp4;codecs=${e}`}function Re(e){if(e){let t=e.substring(0,4);return Ko.video[t]}return 2}function ze(e){let t=Go();return e.split(`,`).reduce((e,n)=>{let r=t&&Te(n)?9:Ko.video[n];return r?(r*2+e)/(e?3:2):(Ko.audio[n]+e)/(e?2:1)},0)}function Be(e,t=!0){if(qo[e])return qo[e];let n={flac:[`flac`,`fLaC`,`FLAC`],opus:[`opus`,`Opus`],"mp4a.40.34":[`mp3`]}[e];for(let i=0;i<n.length;i++){var r;if(Ie(n[i],`audio`,t))return qo[e]=n[i],n[i];if(n[i]===`mp3`&&(r=B(t))!=null&&r.isTypeSupported(`audio/mpeg`))return``}return e}function Ve(e,t=!0){return e.replace(Jo,e=>Be(e.toLowerCase(),t))}function He(e,t){let n=[];if(e){let t=e.split(`,`);for(let e=0;e<t.length;e++)Pe(t[e],`video`)||n.push(t[e])}return t&&n.push(t),n.join(`,`)}function Ue(e,t){if(e&&(e.length>4||[`ac-3`,`ec-3`,`alac`,`fLaC`,`Opus`].indexOf(e)!==-1)&&(We(e,`audio`)||We(e,`video`)))return e;if(t){let n=t.split(`,`);if(n.length>1){if(e){for(let t=n.length;t--;)if(n[t].substring(0,4)===e.substring(0,4))return n[t]}return n[0]}}return t||e}function We(e,t){return Pe(e,t)&&Ie(e,t)}function Ge(e){let t=e.split(`,`);for(let e=0;e<t.length;e++){let n=t[e].split(`.`);n.length>2&&n[0]===`avc1`&&(t[e]=`avc1.${parseInt(n[1]).toString(16)}${(`000`+parseInt(n[2]).toString(16)).slice(-4)}`)}return t.join(`,`)}function Ke(e){if(e.startsWith(`av01.`)){let t=e.split(`.`),n=[`0`,`111`,`01`,`01`,`01`,`0`];for(let e=t.length;e>4&&e<10;e++)t[e]=n[e-4];return t.join(`.`)}return e}function qe(e){let t=B(e)||{isTypeSupported:()=>!1};return{mpeg:t.isTypeSupported(`audio/mpeg`),mp3:t.isTypeSupported(`audio/mp4; codecs="mp3"`),ac3:t.isTypeSupported(`audio/mp4; codecs="ac-3"`)}}function Je(e){return e.replace(/^.+codecs=["']?([^"']+).*$/,`$1`)}function Ye(e,t){return{supported:!1,configurations:t,decodingInfoResults:[Xo],error:e}}function Xe(e,t,n,r,i,o){let c=e.videoCodec,l=e.audioCodec?e.audioGroups:null,u=o?.audioCodec,d=o?.channels,f=d?parseInt(d):u?1/0:2,p=null;if(l!=null&&l.length)try{p=l.length===1&&l[0]?t.groups[l[0]].channels:l.reduce((e,n)=>{if(n){let r=t.groups[n];if(!r)throw Error(`Audio track group ${n} not found`);Object.keys(r.channels).forEach(t=>{e[t]=(e[t]||0)+r.channels[t]})}return e},{2:0})}catch{return!0}return c!==void 0&&(c.split(`,`).some(e=>Te(e))||e.width>1920&&e.height>1088||e.height>1920&&e.width>1088||e.frameRate>Math.max(r,30)||e.videoRange!==`SDR`&&e.videoRange!==n||e.bitrate>Math.max(i,8e6))||!!p&&X(f)&&Object.keys(p).some(e=>parseInt(e)>f)}function Y(e,t,n,r={}){let i=e.videoCodec;if(!i&&!e.audioCodec||!n)return Promise.resolve(Zo);let o=[],c=Ze(e),l=c.length,u=Qe(e,t,l>0),d=u.length;for(let e=l||1*d||1;e--;){let t={type:`media-source`};if(l&&(t.video=c[e%l]),d){t.audio=u[e%d];let n=t.audio.bitrate;t.video&&n&&(t.video.bitrate-=n)}o.push(t)}if(i){let e=navigator.userAgent;if(i.split(`,`).some(e=>Te(e))&&Go())return Promise.resolve(Ye(Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${e})`),o))}return Promise.all(o.map(e=>{let t=tt(e);return r[t]||(r[t]=n.decodingInfo(e))})).then(e=>({supported:!e.some(e=>!e.supported),configurations:o,decodingInfoResults:e})).catch(e=>({supported:!1,configurations:o,decodingInfoResults:[],error:e}))}function Ze(e){let t=e.videoCodec?.split(`,`),n=et(e),r=e.width||640,i=e.height||480,o=e.frameRate||30,c=e.videoRange.toLowerCase();return t?t.map(e=>{let t={contentType:Le(Ke(e),`video`),width:r,height:i,bitrate:n,framerate:o};return c!==`sdr`&&(t.transferFunction=c),t}):[]}function Qe(e,t,n){let r=e.audioCodec?.split(`,`),i=et(e);return r&&e.audioGroups?e.audioGroups.reduce((e,o)=>{let c=o?t.groups[o]?.tracks:null;return c?c.reduce((e,t)=>{if(t.groupId===o){let o=parseFloat(t.channels||``);r.forEach(t=>{let r={contentType:Le(t,`audio`),bitrate:n?$e(t,i):i};o&&(r.channels=``+o),e.push(r)})}return e},e):e},[]):[]}function $e(e,t){if(t<=1)return 1;let n=128e3;return e===`ec-3`?n=768e3:e===`ac-3`&&(n=64e4),Math.min(t/2,n)}function et(e){return Math.ceil(Math.max(e.bitrate*.9,e.averageBitrate)/1e3)*1e3||1}function tt(e){let t=``,{audio:n,video:r}=e;if(r){let e=Je(r.contentType);t+=`${e}_r${r.height}x${r.width}f${Math.ceil(r.framerate)}${r.transferFunction||`sd`}_${Math.ceil(r.bitrate/1e5)}`}if(n){let e=Je(n.contentType);t+=`${r?`_`:``}${e}_c${n.channels}`}return t}function nt(e){return Qo.indexOf(e)>-1}function rt(e){return!!e&&$o.indexOf(e)>-1}function it(e){let{canSkipUntil:t,canSkipDateRanges:n,age:r}=e,i=r<t/2;return t&&i?n?es.v2:es.Yes:es.No}function at(e,t){return!t||!e?!1:e.indexOf(t)!==-1}function ot(){if(typeof matchMedia==`function`){let e=matchMedia(`(dynamic-range: high)`),t=matchMedia(`bad query`);if(e.media!==t.media)return e.matches===!0}return!1}function st(e,t){let n=!1,r=[];if(e&&(n=e!==`SDR`,r=[e]),t){r=t.allowedVideoRanges||$o.slice(0);let e=r.join(``)!==`SDR`&&!t.videoCodec;n=t.preferHDR===void 0?e&&ot():t.preferHDR,n||(r=[`SDR`])}return{preferHDR:n,allowedVideoRanges:r}}function ct(e,t,n,r,i){let o=Object.keys(e),c=r?.channels,l=r?.audioCodec,u=i?.videoCodec,d=c&&parseInt(c)===2,f=!1,p=!1,m=1/0,h=1/0,g=1/0,_=1/0,v=0,y=[],{preferHDR:b,allowedVideoRanges:x}=st(t,i);for(let t=o.length;t--;){let n=e[o[t]];f||=n.channels[2]>0,m=Math.min(m,n.minHeight),h=Math.min(h,n.minFramerate),g=Math.min(g,n.minBitrate),x.filter(e=>n.videoRanges[e]>0).length>0&&(p=!0)}m=X(m)?m:0,h=X(h)?h:0;let S=Math.max(1080,m),C=Math.max(30,h);g=X(g)?g:n,n=Math.max(g,n),p||(t=void 0);let w=o.length>1;return{codecSet:o.reduce((t,r)=>{let i=e[r];if(r===t)return t;if(y=p?x.filter(e=>i.videoRanges[e]>0):[],w){if(i.minBitrate>n)return lt(r,`min bitrate of ${i.minBitrate} > current estimate of ${n}`),t;if(!i.hasDefaultAudio)return lt(r,`no renditions with default or auto-select sound found`),t;if(l&&r.indexOf(l.substring(0,4))%5!=0)return lt(r,`audio codec preference "${l}" not found`),t;if(c&&!d){if(!i.channels[c])return lt(r,`no renditions with ${c} channel sound found (channels options: ${Object.keys(i.channels)})`),t}else if((!l||d)&&f&&i.channels[2]===0)return lt(r,`no renditions with stereo sound found`),t;if(i.minHeight>S)return lt(r,`min resolution of ${i.minHeight} > maximum of ${S}`),t;if(i.minFramerate>C)return lt(r,`min framerate of ${i.minFramerate} > maximum of ${C}`),t;if(!y.some(e=>i.videoRanges[e]>0))return lt(r,`no variants with VIDEO-RANGE of ${is(y)} found`),t;if(u&&r.indexOf(u.substring(0,4))%5!=0)return lt(r,`video codec preference "${u}" not found`),t;if(i.maxScore<v)return lt(r,`max score of ${i.maxScore} < selected max of ${v}`),t}return t&&(ze(r)>=ze(t)||i.fragmentError>e[t].fragmentError)?t:(_=i.minIndex,v=i.maxScore,r)},void 0),videoRanges:y,preferHDR:b,minFramerate:h,minBitrate:g,minIndex:_}}function lt(e,t){No.log(`[abr] start candidates with "${e}" ignored because ${t}`)}function ut(e){return e.reduce((e,t)=>{let n=e.groups[t.groupId];n||=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1},n.tracks.push(t);let r=t.channels||`2`;return n.channels[r]=(n.channels[r]||0)+1,n.hasDefault=n.hasDefault||t.default,n.hasAutoSelect=n.hasAutoSelect||t.autoselect,n.hasDefault&&(e.hasDefaultAudio=!0),n.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function dt(e,t,n,r){return e.slice(n,r+1).reduce((e,n,r)=>{if(!n.codecSet)return e;let i=n.audioGroups,o=e[n.codecSet];o||(e[n.codecSet]=o={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:r,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!i,fragmentError:0}),o.minBitrate=Math.min(o.minBitrate,n.bitrate);let c=Math.min(n.height,n.width);return o.minHeight=Math.min(o.minHeight,c),o.minFramerate=Math.min(o.minFramerate,n.frameRate),o.minIndex=Math.min(o.minIndex,r),o.maxScore=Math.max(o.maxScore,n.score),o.fragmentError+=n.fragmentError,o.videoRanges[n.videoRange]=(o.videoRanges[n.videoRange]||0)+1,i&&i.forEach(e=>{if(!e)return;let n=t.groups[e];n&&(o.hasDefaultAudio=o.hasDefaultAudio||t.hasDefaultAudio?n.hasDefault:n.hasAutoSelect||!t.hasDefaultAudio&&!t.hasAutoSelectAudio,Object.keys(n.channels).forEach(e=>{o.channels[e]=(o.channels[e]||0)+n.channels[e]}))}),e},{})}function ft(e){if(!e)return e;let{lang:t,assocLang:n,characteristics:r,channels:i,audioCodec:o}=e;return{lang:t,assocLang:n,characteristics:r,channels:i,audioCodec:o}}function pt(e,t,n){if(`attrs`in e){let n=t.indexOf(e);if(n!==-1)return n}for(let r=0;r<t.length;r++){let i=t[r];if(mt(e,i,n))return r}return-1}function mt(e,t,n){let{groupId:r,name:i,lang:o,assocLang:c,default:l}=e,u=e.forced;return(r===void 0||t.groupId===r)&&(i===void 0||t.name===i)&&(o===void 0||ht(o,t.lang))&&(o===void 0||t.assocLang===c)&&(l===void 0||t.default===l)&&(u===void 0||t.forced===u)&&(!(`characteristics`in e)||gt(e.characteristics||``,t.characteristics))&&(n===void 0||n(e,t))}function ht(e,t=`--`){return e.length===t.length?e===t:e.startsWith(t)||t.startsWith(e)}function gt(e,t=``){let n=e.split(`,`),r=t.split(`,`);return n.length===r.length&&!n.some(e=>r.indexOf(e)===-1)}function _t(e,t){let{audioCodec:n,channels:r}=e;return(n===void 0||(t.audioCodec||``).substring(0,4)===n.substring(0,4))&&(r===void 0||r===(t.channels||`2`))}function vt(e,t,n,r,i){let o=t[r],c=t.reduce((e,t,n)=>{let r=t.uri;return(e[r]||(e[r]=[])).push(n),e},{})[o.uri];c.length>1&&(r=Math.max.apply(Math,c));let l=o.videoRange,u=o.frameRate,d=o.codecSet.substring(0,4),f=yt(t,r,t=>{if(t.videoRange!==l||t.frameRate!==u||t.codecSet.substring(0,4)!==d)return!1;let r=t.audioGroups;return pt(e,n.filter(e=>!r||r.indexOf(e.groupId)!==-1),i)>-1});return f>-1?f:yt(t,r,t=>{let r=t.audioGroups;return pt(e,n.filter(e=>!r||r.indexOf(e.groupId)!==-1),i)>-1})}function yt(e,t,n){for(let r=t;r>-1;r--)if(n(e[r]))return r;for(let r=t+1;r<e.length;r++)if(n(e[r]))return r;return-1}function bt(e,t){return!!e&&e!==t.loadLevelObj?.uri}function xt(e,t,n){if(t===null||!Array.isArray(e)||!e.length||!X(t)||t<(e[0].programDateTime||0)||t>=(e[e.length-1].endProgramDateTime||0))return null;for(let r=0;r<e.length;++r){let i=e[r];if(Tt(t,n,i))return i}return null}function St(e,t,n=0,r=0,i=.005){let o=null;if(e){o=t[1+e.sn-t[0].sn]||null;let r=e.endDTS-n;r>0&&r<15e-7&&(n+=15e-7),o&&e.level!==o.level&&o.end<=e.end&&(o=t[2+e.sn-t[0].sn]||null)}else n===0&&t[0].start===0&&(o=t[0]);if(o&&((!e||e.level===o.level)&&wt(n,r,o)===0||Ct(o,e,Math.min(i,r))))return o;let c=os.search(t,wt.bind(null,n,r));return c&&(c!==e||!o)?c:o}function Ct(e,t,n){if(t&&t.start===0&&t.level<e.level&&(t.endPTS||0)>0){let r=t.tagList.reduce((e,t)=>(t[0]===`INF`&&(e+=parseFloat(t[1])),e),n);return e.start<=r}return!1}function wt(e=0,t=0,n){if(n.start<=e&&n.start+n.duration>e)return 0;let r=Math.min(t,n.duration+(n.deltaPTS?n.deltaPTS:0));return n.start+n.duration-r<=e?1:n.start-r>e&&n.start?-1:0}function Tt(e,t,n){let r=Math.min(t,n.duration+(n.deltaPTS?n.deltaPTS:0))*1e3;return(n.endProgramDateTime||0)-r>e}function Et(e,t,n){if(e&&e.startCC<=t&&e.endCC>=t){let r=e.fragments,{fragmentHint:i}=e;i&&(r=r.concat(i));let o;return os.search(r,e=>e.cc<t?1:e.cc>t?-1:(o=e,e.end<=n?1:e.start>n?-1:0)),o||null}return null}function Dt(e){switch(e.details){case Z.FRAG_LOAD_TIMEOUT:case Z.KEY_LOAD_TIMEOUT:case Z.LEVEL_LOAD_TIMEOUT:case Z.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Ot(e){return e.details.startsWith(`key`)}function kt(e){return Ot(e)&&!!e.frag&&!e.frag.decryptdata}function At(e,t){let n=Dt(t);return e.default[`${n?`timeout`:`error`}Retry`]}function jt(e,t){let n=e.backoff===`linear`?1:2**t;return Math.min(n*e.retryDelayMs,e.maxRetryDelayMs)}function Mt(e){return N(N({},e),{errorRetry:null,timeoutRetry:null})}function Nt(e,t,n,r){if(!e)return!1;let i=r?.code,o=t<e.maxNumRetry&&(Pt(i)||!!n);return e.shouldRetry?e.shouldRetry(e,t,n,r,o):o}function Pt(e){return Ft(e)||!!e&&(e<400||e>499)}function Ft(e){return e===0&&navigator.onLine===!1}function It(e){let t={action:ss.DoNothing,flags:cs.None};return e&&(t.resolved=!0),t}function Lt(e){var t,n,r;return e.buffered&&!!(e.body.gap||(t=e.range.video)!=null&&t.partial||(n=e.range.audio)!=null&&n.partial||(r=e.range.audiovideo)!=null&&r.partial)}function Rt(e){return`${e.type}_${e.level}_${e.sn}`}function zt(e,t){return e.filter(e=>{let n=t(e);return n||e.clearElementaryStreamInfo(),n})}function Bt(e){let t=e.byteLength,n=t&&new DataView(e.buffer).getUint8(t-1);return n?e.slice(0,t-n):e}function Vt(e){switch(e){case fs.cbc:return`AES-CBC`;case fs.ctr:return`AES-CTR`;default:throw Error(`[FastAESKey] invalid aes mode ${e}`)}}function Ht(e,t=null){let n=t||e,r={frag:e,part:t,responseType:`arraybuffer`,url:n.url,headers:{},rangeStart:0,rangeEnd:0},i=n.byteRangeStartOffset,o=n.byteRangeEndOffset;if(X(i)&&X(o)){let t=i,n=o;if(e.sn===`initSegment`&&Wt(e.decryptdata?.method)){let e=o-i;e%16&&(n=o+(16-e%16)),i!==0&&(r.resetIV=!0,t=i-16)}r.rangeStart=t,r.rangeEnd=n}return r}function Ut(e,t){let n=Error(`GAP ${e.gap?`tag`:`attribute`} found`),r={type:wo.MEDIA_ERROR,details:Z.FRAG_GAP,fatal:!1,frag:e,error:n,networkDetails:null};return t&&(r.part=t),(t||e).stats.aborted=!0,new bs(r)}function Wt(e){return e===`AES-128`||e===`AES-256`}function Gt(){return{start:0,executeStart:0,executeEnd:0,end:0}}function Kt(e){return Ts.test(e)}function qt(e,t){if(e.variableList!==null||e.hasVariableRefs){let n=e.variableList;return t.replace(Ts,t=>{let r=t.substring(2,t.length-1),i=n?.[r];return i===void 0?(e.playlistParsingError||=Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${r}"`),t):i})}return t}function Jt(e,t,n){let r=e.variableList;r||(e.variableList=r={});let i,o;if(`QUERYPARAM`in t){i=t.QUERYPARAM;try{let e=new self.URL(n).searchParams;if(e.has(i))o=e.get(i);else throw Error(`"${i}" does not match any query parameter in URI: "${n}"`)}catch(t){e.playlistParsingError||=Error(`EXT-X-DEFINE QUERYPARAM: ${t.message}`)}}else i=t.NAME,o=t.VALUE;i in r?e.playlistParsingError||=Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${i}"`):r[i]=o||``}function Yt(e,t,n){let r=t.IMPORT;if(n&&r in n){let t=e.variableList;t||(e.variableList=t={}),t[r]=n[r]}else e.playlistParsingError||=Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${r}"`)}function Xt(e){return e!==`ID`&&e!==`CLASS`&&e!==`CUE`&&e!==`START-DATE`&&e!==`DURATION`&&e!==`END-DATE`&&e!==`END-ON-NEXT`}function Zt(e){return e===`SCTE35-OUT`||e===`SCTE35-IN`||e===`SCTE35-CMD`}function Qt(e,t){return e.length===t.length?!e.some((e,n)=>e!==t[n]):!1}function $t(e,t){return!e&&!t?!0:!e||!t?!1:Qt(e,t)}function en(e){return e===`AES-128`||e===`AES-256`||e===`AES-256-CTR`}function tn(e){switch(e){case`AES-128`:case`AES-256`:return fs.cbc;case`AES-256-CTR`:return fs.ctr;default:throw Error(`invalid full segment method ${e}`)}}function nn(e){return Uint8Array.from(atob(e),e=>e.charCodeAt(0))}function rn(e){return Uint8Array.from(unescape(encodeURIComponent(e)),e=>e.charCodeAt(0))}function an(e){let t=rn(e).subarray(0,16),n=new Uint8Array(16);return n.set(t,16-t.length),n}function on(e){let t=function(e,t,n){let r=e[t];e[t]=e[n],e[n]=r};t(e,0,3),t(e,1,2),t(e,4,5),t(e,6,7)}function sn(e){let t=e.split(`:`),n=null;if(t[0]===`data`&&t.length===2){let e=t[1].split(`;`),r=e[e.length-1].split(`,`);if(r.length===2){let t=r[0]===`base64`,i=r[1];t?(e.splice(-1,1),n=nn(i)):n=an(i)}}return n}function cn(e){switch(e){case Fs.FAIRPLAY:return Ps.FAIRPLAY;case Fs.PLAYREADY:return Ps.PLAYREADY;case Fs.WIDEVINE:return Ps.WIDEVINE;case Fs.CLEARKEY:return Ps.CLEARKEY}}function ln(e){switch(e){case Ps.FAIRPLAY:return Fs.FAIRPLAY;case Ps.PLAYREADY:return Fs.PLAYREADY;case Ps.WIDEVINE:return Fs.WIDEVINE;case Ps.CLEARKEY:return Fs.CLEARKEY}}function un(e){let{drmSystems:t,widevineLicenseUrl:n}=e,r=t?[Ps.FAIRPLAY,Ps.WIDEVINE,Ps.PLAYREADY,Ps.CLEARKEY].filter(e=>!!t[e]):[];return!r[Ps.WIDEVINE]&&n&&r.push(Ps.WIDEVINE),r}function dn(e,t,n,r){let i;switch(e){case Ps.FAIRPLAY:i=[`cenc`,`sinf`];break;case Ps.WIDEVINE:case Ps.PLAYREADY:i=[`cenc`];break;case Ps.CLEARKEY:i=[`cenc`,`keyids`];break;default:throw Error(`Unknown key-system: ${e}`)}return fn(i,t,n,r)}function fn(e,t,n,r){return[{initDataTypes:e,persistentState:r.persistentState||`optional`,distinctiveIdentifier:r.distinctiveIdentifier||`optional`,sessionTypes:r.sessionTypes||[r.sessionType||`temporary`],audioCapabilities:t.map(e=>({contentType:`audio/mp4; codecs=${e}`,robustness:r.audioRobustness||``,encryptionScheme:r.audioEncryptionScheme||null})),videoCapabilities:n.map(e=>({contentType:`video/mp4; codecs=${e}`,robustness:r.videoRobustness||``,encryptionScheme:r.videoEncryptionScheme||null}))}]}function pn(e){var t;return!!e&&(e.sessionType===`persistent-license`||!!((t=e.sessionTypes)!=null&&t.some(e=>e===`persistent-license`)))}function mn(e){let t=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),n=String.fromCharCode.apply(null,Array.from(t)),r=n.substring(n.indexOf(`<`),n.length),i=new DOMParser().parseFromString(r,`text/xml`).getElementsByTagName(`KID`)[0];if(i){let e=i.childNodes[0]?i.childNodes[0].nodeValue:i.getAttribute(`VALUE`);if(e){let t=nn(e).subarray(0,16);return on(t),t}}return null}function hn(e){let t=e?.[Fs.WIDEVINE];return t?t.keyId:null}function gn(e){let t=e?.[Fs.PLAYREADY];if(t){let e=sn(t.uri);if(e)return mn(e)}return null}function _n(e){let t=new Uint8Array(16);for(let n=12;n<16;n++)t[n]=e>>8*(15-n)&255;return t}function vn(e,t){let n=e.length;if(!n)if(t.hasProgramDateTime){let r=t.fragments[t.fragments.length-1];e.push(r),n++}else return;let r=e[n-1],i=t.live?1/0:t.totalduration,o=Object.keys(t.dateRanges);for(let c=o.length;c--;){let l=t.dateRanges[o[c]],u=l.startDate.getTime();l.tagAnchor=r.ref;for(let r=n;r--&&!(e[r]?.sn<t.startSN);){let n=yn(t,u,e,r,i);if(n!==-1){l.tagAnchor=t.fragments[n].ref;break}}}}function yn(e,t,n,r,i){let o=n[r];if(o){let c=o.programDateTime;if((t>=c||r===0)&&t<=c+((n[r+1]?.start||i)-o.start)*1e3){let i=n[r].sn-e.startSN;if(i<0)return-1;let o=e.fragments;if(o.length>n.length){let c=(n[r+1]||o[o.length-1]).sn-e.startSN;for(let e=c;e>i;e--){let n=o[e].programDateTime;if(t>=n&&t<n+o[e].duration*1e3)return e}}return i}}return-1}function bn(e,t,n){let r=new Os(e,n),i=r.METHOD??``,o=r.URI,c=r.hexadecimalInteger(`IV`),l=r.KEYFORMATVERSIONS,u=r.KEYFORMAT??`identity`;return o&&r.IV&&!c&&No.error(`Invalid IV: ${r.IV}`),new Rs(i,o?Ws.resolve(o,t):``,u,(l||`1`).split(`/`).map(Number).filter(Number.isFinite),c,r.KEYID)}function xn(e){let t=new Os(e).decimalFloatingPoint(`TIME-OFFSET`);return X(t)?t:null}function Sn(e,t){let n=(e||``).split(/[ ,]+/).filter(e=>e);[`video`,`audio`,`text`].forEach(e=>{let r=n.filter(t=>Pe(t,e));r.length&&(t[`${e}Codec`]=r.map(e=>e.split(`/`)[0]).join(`,`),n=n.filter(e=>r.indexOf(e)===-1))}),t.unknownCodecs=n}function Cn(e,t,n){let r=t[n];r&&(e[n]=r)}function wn(e,t){let n=e[t];for(let r=t;r--;){let t=e[r];if(!t)return;t.programDateTime=n.programDateTime-t.duration*1e3,n=t}}function Tn(e,t,n){e.rawProgramDateTime?n.push(e):t!=null&&t.programDateTime&&(e.programDateTime=t.endProgramDateTime)}function En(e,t,n,r){e.relurl=t.URI,t.BYTERANGE&&e.setByteRange(t.BYTERANGE),e.level=n,e.sn=`initSegment`,r&&(e.levelkeys=r),e.initSegment=null}function Dn(e,t,n){e.levelkeys=t;let{encryptedFragments:r}=n;(!r.length||r[r.length-1].levelkeys!==t)&&Object.keys(t).some(e=>t[e].isCommonEncryption)&&r.push(e)}function On(e,t,n){e.playlistParsingError=Error(`#EXT-X-${t} must not appear more than once (${n[0]})`)}function kn(e,t,n){e.playlistParsingError=Error(`#EXT-X-${t} must appear before the first Media Segment (${n[0]})`)}function An(e,t){let n=t.startPTS;if(X(n)){let r=0,i;t.sn>e.sn?(r=n-e.start,i=e):(r=e.start-n,i=t),i.duration!==r&&i.setDuration(r)}else t.sn>e.sn?e.cc===t.cc&&e.minEndPTS?t.setStart(e.start+(e.minEndPTS-e.start)):t.setStart(e.start+e.duration):t.setStart(Math.max(e.start-t.duration,0))}function jn(e,t,n,r,i,o,c){r-n<=0&&(c.warn(`Fragment should have a positive duration`,t),r=n+t.duration,o=i+t.duration);let l=n,u=r,d=t.startPTS,f=t.endPTS;if(X(d)){let p=Math.abs(d-n);e&&p>e.totalduration?c.warn(`media timestamps and playlist times differ by ${p}s for level ${t.level} ${e.url}`):X(t.deltaPTS)?t.deltaPTS=Math.max(p,t.deltaPTS):t.deltaPTS=p,l=Math.max(n,d),n=Math.min(n,d),i=t.startDTS===void 0?i:Math.min(i,t.startDTS),u=Math.min(r,f),r=Math.max(r,f),o=t.endDTS===void 0?o:Math.max(o,t.endDTS)}let p=n-t.start;t.start!==0&&t.setStart(n),t.setDuration(r-t.start),t.startPTS=n,t.maxStartPTS=l,t.startDTS=i,t.endPTS=r,t.minEndPTS=u,t.endDTS=o;let m=t.sn;if(!e||m<e.startSN||m>e.endSN)return 0;let h,g=m-e.startSN,_=e.fragments;for(_[g]=t,h=g;h>0;h--)An(_[h],_[h-1]);for(h=g;h<_.length-1;h++)An(_[h],_[h+1]);return e.fragmentHint&&An(_[_.length-1],e.fragmentHint),e.PTSKnown=e.alignedSliding=!0,p}function Mn(e,t,n){if(e===t)return;let r=null,i=e.fragments;for(let e=i.length-1;e>=0;e--){let t=i[e].initSegment;if(t){r=t;break}}e.fragmentHint&&delete e.fragmentHint.endPTS;let o;Fn(e,t,(e,n,i,c)=>{if((!t.startCC||t.skippedSegments)&&n.cc!==e.cc){let r=e.cc-n.cc;for(let e=i;e<c.length;e++)c[e].cc+=r;t.endCC=c[c.length-1].cc}X(e.startPTS)&&X(e.endPTS)&&(n.setStart(n.startPTS=e.startPTS),n.startDTS=e.startDTS,n.maxStartPTS=e.maxStartPTS,n.endPTS=e.endPTS,n.endDTS=e.endDTS,n.minEndPTS=e.minEndPTS,n.setDuration(e.endPTS-e.startPTS),n.duration&&(o=n),t.PTSKnown=t.alignedSliding=!0),e.hasStreams&&(n.elementaryStreams=e.elementaryStreams),n.loader=e.loader,e.hasStats&&(n.stats=e.stats),e.initSegment&&(n.initSegment=e.initSegment,r=e.initSegment)});let c=t.fragments,l=t.fragmentHint?c.concat(t.fragmentHint):c;if(r&&l.forEach(e=>{e&&(!e.initSegment||e.initSegment.relurl===r?.relurl)&&(e.initSegment=r)}),t.skippedSegments){if(t.deltaUpdateFailed=c.some(e=>!e),t.deltaUpdateFailed){n.warn(`[level-helper] Previous playlist missing segments skipped in delta playlist`);for(let e=t.skippedSegments;e--;)c.shift();t.startSN=c[0].sn}else{t.canSkipDateRanges&&(t.dateRanges=Nn(e.dateRanges,t,n));let r=e.fragments.filter(e=>e.rawProgramDateTime);if(e.hasProgramDateTime&&!t.hasProgramDateTime)for(let e=1;e<l.length;e++)l[e].programDateTime===null&&Tn(l[e],l[e-1],r);vn(r,t)}t.endCC=c[c.length-1].cc}t.startCC||=Bn(e,t.startSN-1)?.cc??c[0].cc,Pn(e.partList,t.partList,(e,t)=>{t.elementaryStreams=e.elementaryStreams,t.stats=e.stats}),o?jn(t,o,o.startPTS,o.endPTS,o.startDTS,o.endDTS,n):Ln(e,t),c.length&&(t.totalduration=t.edge-c[0].start),t.driftStartTime=e.driftStartTime,t.driftStart=e.driftStart;let u=t.advancedDateTime;if(t.advanced&&u){let e=t.edge;t.driftStart||=(t.driftStartTime=u,e),t.driftEndTime=u,t.driftEnd=e}else t.driftEndTime=e.driftEndTime,t.driftEnd=e.driftEnd,t.advancedDateTime=e.advancedDateTime;t.requestScheduled===-1&&(t.requestScheduled=e.requestScheduled)}function Nn(e,t,n){let{dateRanges:r,recentlyRemovedDateranges:i}=t,o=j({},e);i&&i.forEach(e=>{delete o[e]});let c=Object.keys(o).length;return c?(Object.keys(r).forEach(e=>{let t=o[e],i=new As(r[e].attr,t);i.isValid?(o[e]=i,t||(i.tagOrder+=c)):n.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${is(r[e].attr)}"`)}),o):r}function Pn(e,t,n){if(e&&t){let r=0;for(let i=0,o=e.length;i<=o;i++){let o=e[i],c=t[i+r];o&&c&&o.index===c.index&&o.fragment.sn===c.fragment.sn?n(o,c):r--}}}function Fn(e,t,n){let r=t.skippedSegments,i=Math.max(e.startSN,t.startSN)-t.startSN,o=+!!e.fragmentHint+(r?t.endSN:Math.min(e.endSN,t.endSN))-t.startSN,c=t.startSN-e.startSN,l=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,u=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments;for(let d=i;d<=o;d++){let i=u[c+d],o=l[d];if(r&&!o&&i&&(o=t.fragments[d]=i),i&&o){n(i,o,d,l);let r=i.relurl,c=o.relurl;if(r&&Wn(r,c)){t.playlistParsingError=In(`media sequence mismatch ${o.sn}:`,e,t,i,o);return}else if(i.cc!==o.cc){t.playlistParsingError=In(`discontinuity sequence mismatch (${i.cc}!=${o.cc})`,e,t,i,o);return}}}}function In(e,t,n,r,i){return Error(`${e} ${i.url}
4
+ Playlist starting @${t.startSN}
5
+ ${t.m3u8}
6
+
7
+ Playlist starting @${n.startSN}
8
+ ${n.m3u8}`)}function Ln(e,t,n=!0){let r=t.startSN+t.skippedSegments-e.startSN,i=e.fragments,o=r>=0,c=0;if(o&&r<i.length)c=i[r].start;else if(o&&t.startSN===e.endSN+1)c=e.fragmentEnd;else if(o&&n)c=e.fragmentStart+r*t.levelTargetDuration;else if(!t.skippedSegments&&t.fragmentStart===0)c=e.fragmentStart;else return;Rn(t,c)}function Rn(e,t){if(t){let n=e.fragments;for(let r=e.skippedSegments;r<n.length;r++)n[r].addStart(t);e.fragmentHint&&e.fragmentHint.addStart(t)}}function zn(e,t=1/0){let n=1e3*e.targetduration;if(e.updated){let r=e.fragments;if(r.length&&n*4>t){let e=r[r.length-1].duration*1e3;e<n&&(n=e)}}else n/=2;return Math.round(n)}function Bn(e,t,n){if(!e)return null;let r=e.fragments[t-e.startSN];return r||(r=e.fragmentHint,r&&r.sn===t)?r:t<e.startSN&&n&&n.sn===t?n:null}function Vn(e,t,n){return e?Hn(e.partList,t,n):null}function Hn(e,t,n){if(e)for(let r=e.length;r--;){let i=e[r];if(i.index===n&&i.fragment.sn===t)return i}return null}function Un(e){e.forEach((e,t)=>{var n;(n=e.details)==null||n.fragments.forEach(e=>{e.level=t,e.initSegment&&(e.initSegment.level=t)})})}function Wn(e,t){return e!==t&&t?Gn(e)!==Gn(t):!1}function Gn(e){return e.replace(/\?[^?]*$/,``)}function Kn(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n]?.cc===t)return e[n];return null}function qn(e,t){return!!(e&&t.startCC<e.endCC&&t.endCC>e.startCC)}function Jn(e,t){let n=e.start+t;e.startPTS=n,e.setStart(n),e.endPTS=n+e.duration}function Yn(e,t){let n=t.fragments;for(let t=0,r=n.length;t<r;t++)Jn(n[t],e);t.fragmentHint&&Jn(t.fragmentHint,e),t.alignedSliding=!0}function Xn(e,t){e&&(Zn(t,e),t.alignedSliding||Qn(t,e),!t.alignedSliding&&!t.skippedSegments&&Ln(e,t,!1))}function Zn(e,t){if(!qn(t,e))return;let n=Math.min(t.endCC,e.endCC),r=Kn(t.fragments,n),i=Kn(e.fragments,n);!r||!i||(No.log(`Aligning playlist at start of dicontinuity sequence ${n}`),Yn(r.start-i.start,e))}function Qn(e,t){if(!e.hasProgramDateTime||!t.hasProgramDateTime)return;let n=e.fragments,r=t.fragments;if(!n.length||!r.length)return;let i,o,c=Math.min(t.endCC,e.endCC);t.startCC<c&&e.startCC<c&&(i=Kn(r,c),o=Kn(n,c)),(!i||!o)&&(i=r[Math.floor(r.length/2)],o=Kn(n,i.cc)||n[Math.floor(n.length/2)]);let l=i.programDateTime,u=o.programDateTime;!l||!u||Yn((u-l)/1e3-(o.start-i.start),e)}function $n(e,t,n){er(e,t,n),e.addEventListener(t,n)}function er(e,t,n){e.removeEventListener(t,n)}function tr(e){return!!e.interstitialsController&&e.enableInterstitialPlayback!==!1}function nr(e,t){let n=new Uint8Array(t),r=0;for(let t=0;t<e.length;t++){let i=e[t];n.set(i,r),r+=i.length}return n}function rr(){return Ys?Js.exports:(Ys=1,(function(e){var t=Object.prototype.hasOwnProperty,n=`~`;function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,c){if(typeof r!=`function`)throw TypeError(`The listener must be a function`);var l=new i(r,o||e,c),u=n?n+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],l]:e._events[u].push(l):(e._events[u]=l,e._eventsCount++),e}function c(e,t){--e._eventsCount===0?e._events=new r:delete e._events[t]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var e=[],r,i;if(this._eventsCount===0)return e;for(i in r=this._events)t.call(r,i)&&e.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(r)):e},l.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,c=Array(o);i<o;i++)c[i]=r[i].fn;return c},l.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},l.prototype.emit=function(e,t,r,i,o,c){var l=n?n+e:e;if(!this._events[l])return!1;var u=this._events[l],d=arguments.length,f,p;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,i),!0;case 5:return u.fn.call(u.context,t,r,i,o),!0;case 6:return u.fn.call(u.context,t,r,i,o,c),!0}for(p=1,f=Array(d-1);p<d;p++)f[p-1]=arguments[p];u.fn.apply(u.context,f)}else{var m=u.length,h;for(p=0;p<m;p++)switch(u[p].once&&this.removeListener(e,u[p].fn,void 0,!0),d){case 1:u[p].fn.call(u[p].context);break;case 2:u[p].fn.call(u[p].context,t);break;case 3:u[p].fn.call(u[p].context,t,r);break;case 4:u[p].fn.call(u[p].context,t,r,i);break;default:if(!f)for(h=1,f=Array(d-1);h<d;h++)f[h-1]=arguments[h];u[p].fn.apply(u[p].context,f)}}return!0},l.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},l.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},l.prototype.removeListener=function(e,t,r,i){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return c(this,o),this;var l=this._events[o];if(l.fn)l.fn===t&&(!i||l.once)&&(!r||l.context===r)&&c(this,o);else{for(var u=0,d=[],f=l.length;u<f;u++)(l[u].fn!==t||i&&!l[u].once||r&&l[u].context!==r)&&d.push(l[u]);d.length?this._events[o]=d.length===1?d[0]:d:c(this,o)}return this},l.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&c(this,t)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l})(Js),Js.exports)}function ir(){return typeof __HLS_WORKER_BUNDLE__==`function`}function ar(){let e=Qs[Zs];if(e)return e.clientCount++,e;let t=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:`text/javascript`}),n=self.URL.createObjectURL(t),r={worker:new self.Worker(n),objectURL:n,clientCount:1};return Qs[Zs]=r,r}function or(e){let t=Qs[e];if(t)return t.clientCount++,t;let n=new self.URL(e,self.location.href).href,r={worker:new self.Worker(n),scriptURL:n,clientCount:1};return Qs[e]=r,r}function sr(e){let t=Qs[e||Zs];if(t&&t.clientCount--===1){let{worker:n,objectURL:r}=t;delete Qs[e||Zs],r&&self.URL.revokeObjectURL(r),n.terminate()}}function cr(e,t){return t+10<=e.length&&e[t]===51&&e[t+1]===68&&e[t+2]===73&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128}function lr(e,t){return t+10<=e.length&&e[t]===73&&e[t+1]===68&&e[t+2]===51&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128}function ur(e,t){let n=0;return n=(e[t]&127)<<21,n|=(e[t+1]&127)<<14,n|=(e[t+2]&127)<<7,n|=e[t+3]&127,n}function dr(e,t){let n=t,r=0;for(;lr(e,t);){r+=10;let n=ur(e,t+6);r+=n,cr(e,t+10)&&(r+=10),t+=r}if(r>0)return e.subarray(n,n+r)}function fr(e,t,n,r){let i=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],o=t[n+2],c=o>>2&15;if(c>12){let t=Error(`invalid ADTS sampling index:${c}`);e.emit(Q.ERROR,Q.ERROR,{type:wo.MEDIA_ERROR,details:Z.FRAG_PARSING_ERROR,fatal:!0,error:t,reason:t.message});return}let l=(o>>6&3)+1,u=t[n+3]>>6&3|(o&1)<<2,d=`mp4a.40.`+l,f=i[c],p=c;(l===5||l===29)&&(p-=3);let m=[l<<3|(p&14)>>1,(p&1)<<7|u<<3];return No.log(`manifest codec:${r}, parsed codec:${d}, channels:${u}, rate:${f} (ADTS object type:${l} sampling index:${c})`),{config:m,samplerate:f,channelCount:u,codec:d,parsedCodec:d,manifestCodec:r}}function pr(e,t){return e[t]===255&&(e[t+1]&246)==240}function mr(e,t){return e[t+1]&1?7:9}function hr(e,t){return(e[t+3]&3)<<11|e[t+4]<<3|(e[t+5]&224)>>>5}function gr(e,t){return t+5<e.length}function _r(e,t){return t+1<e.length&&pr(e,t)}function vr(e,t){return gr(e,t)&&pr(e,t)&&hr(e,t)<=e.length-t}function yr(e,t){if(_r(e,t)){let n=mr(e,t);if(t+n>=e.length)return!1;let r=hr(e,t);if(r<=n)return!1;let i=t+r;return i===e.length||_r(e,i)}return!1}function br(e,t,n,r,i){if(!e.samplerate){let o=fr(t,n,r,i);if(!o)return;j(e,o)}}function xr(e){return 1024*9e4/e}function Sr(e,t){let n=mr(e,t);if(t+n<=e.length){let r=hr(e,t)-n;if(r>0)return{headerLength:n,frameLength:r}}}function Cr(e,t,n,r,i){let o=r+i*xr(e.samplerate),c=Sr(t,n),l;if(c){let{frameLength:r,headerLength:i}=c,u=i+r,d=Math.max(0,n+u-t.length);d?(l=new Uint8Array(u-i),l.set(t.subarray(n+i,t.length),0)):l=t.subarray(n+i,n+u);let f={unit:l,pts:o};return d||e.samples.push(f),{sample:f,length:u,missing:d}}let u=t.length-n;return l=new Uint8Array(u),l.set(t.subarray(n,t.length),0),{sample:{unit:l,pts:o},length:u,missing:-1}}function wr(e,t){return lr(e,t)&&ur(e,t+6)+10<=e.length-t}function Tr(e){return e instanceof ArrayBuffer?e:e.byteOffset==0&&e.byteLength==e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer}function Er(e,t=0,n=1/0){return Dr(e,t,n,Uint8Array)}function Dr(e,t,n,r){let i=Or(e),o=1;`BYTES_PER_ELEMENT`in r&&(o=r.BYTES_PER_ELEMENT);let c=kr(e)?e.byteOffset:0,l=(c+e.byteLength)/o,u=(c+t)/o,d=Math.floor(Math.max(0,Math.min(u,l)));return new r(i,d,Math.floor(Math.min(d+Math.max(n,0),l))-d)}function Or(e){return e instanceof ArrayBuffer?e:e.buffer}function kr(e){return e&&e.buffer instanceof ArrayBuffer&&e.byteLength!==void 0&&e.byteOffset!==void 0}function Ar(e){let t={key:e.type,description:``,data:``,mimeType:null,pictureType:null};if(e.size<2)return;if(e.data[0]!==3){console.log(`Ignore frame with unrecognized character encoding`);return}let n=e.data.subarray(1).indexOf(0);if(n===-1)return;let r=U(Er(e.data,1,n)),i=e.data[2+n],o=e.data.subarray(3+n).indexOf(0);if(o===-1)return;let c=U(Er(e.data,3+n,o)),l;return l=r===`-->`?U(Er(e.data,4+n+o)):Tr(e.data.subarray(4+n+o)),t.mimeType=r,t.pictureType=i,t.description=c,t.data=l,t}function jr(e){if(e.size<2)return;let t=U(e.data,!0),n=new Uint8Array(e.data.subarray(t.length+1));return{key:e.type,info:t,data:n.buffer}}function Mr(e){if(e.size<2)return;if(e.type===`TXXX`){let t=1,n=U(e.data.subarray(t),!0);t+=n.length+1;let r=U(e.data.subarray(t));return{key:e.type,info:n,data:r}}let t=U(e.data.subarray(1));return{key:e.type,info:``,data:t}}function Nr(e){if(e.type===`WXXX`){if(e.size<2)return;let t=1,n=U(e.data.subarray(t),!0);t+=n.length+1;let r=U(e.data.subarray(t));return{key:e.type,info:n,data:r}}let t=U(e.data);return{key:e.type,info:``,data:t}}function Pr(e){return e.type===`PRIV`?jr(e):e.type[0]===`W`?Nr(e):e.type===`APIC`?Ar(e):Mr(e)}function Fr(e){let t=String.fromCharCode(e[0],e[1],e[2],e[3]),n=ur(e,4);return{type:t,size:n,data:e.subarray(10,10+n)}}function Ir(e){let t=0,n=[];for(;lr(e,t);){let r=ur(e,t+6);e[t+5]>>6&1&&(t+=$s),t+=$s;let i=t+r;for(;t+ec<i;){let r=Fr(e.subarray(t)),i=Pr(r);i&&n.push(i),t+=r.size+$s}cr(e,t)&&(t+=$s)}return n}function Lr(e){return e&&e.key===`PRIV`&&e.info===`com.apple.streaming.transportStreamTimestamp`}function Rr(e){if(e.data.byteLength===8){let t=new Uint8Array(e.data),n=t[3]&1,r=(t[4]<<23)+(t[5]<<15)+(t[6]<<7)+t[7];return r/=45,n&&(r+=47721858.84),Math.round(r)}}function zr(e){let t=Ir(e);for(let e=0;e<t.length;e++){let n=t[e];if(Lr(n))return Rr(n)}}function Br(e=``,t=9e4){return{type:e,id:-1,pid:-1,inputTimeScale:t,sequenceNumber:-1,samples:[],dropped:0}}function Vr(e,t,n,r,i){if(n+24>t.length)return;let o=Hr(t,n);if(o&&n+o.frameLength<=t.length){let c=r+i*(o.samplesPerFrame*9e4/o.sampleRate),l={unit:t.subarray(n,n+o.frameLength),pts:c,dts:c};return e.config=[],e.channelCount=o.channelCount,e.samplerate=o.sampleRate,e.samples.push(l),{sample:l,length:o.frameLength,missing:0}}}function Hr(e,t){let n=e[t+1]>>3&3,r=e[t+1]>>1&3,i=e[t+2]>>4&15,o=e[t+2]>>2&3;if(n!==1&&i!==0&&i!==15&&o!==3){let c=e[t+2]>>1&1,l=e[t+3]>>6,u=ac[(n===3?3-r:r===3?3:4)*14+i-1]*1e3,d=oc[(n===3?0:n===2?1:2)*3+o],f=l===3?1:2,p=sc[n][r],m=cc[r],h=p*8*m,g=Math.floor(p*u/d+c)*m;if(ic===null){let e=(navigator.userAgent||``).match(/Chrome\/(\d+)/i);ic=e?parseInt(e[1]):0}return ic&&ic<=87&&r===2&&u>=224e3&&l===0&&(e[t+3]=e[t+3]|128),{sampleRate:d,channelCount:f,frameLength:g,samplesPerFrame:h}}}function Ur(e,t){return e[t]===255&&(e[t+1]&224)==224&&(e[t+1]&6)!=0}function Wr(e,t){return t+1<e.length&&Ur(e,t)}function Gr(e,t){return Ur(e,t)&&4<=e.length-t}function Kr(e,t){if(t+1<e.length&&Ur(e,t)){let n=Hr(e,t),r=4;n!=null&&n.frameLength&&(r=n.frameLength);let i=t+r;return i===e.length||Wr(e,i)}return!1}function qr(e,t,n,r,i){if(n+8>t.length||t[n]!==11||t[n+1]!==119)return-1;let o=t[n+4]>>6;if(o>=3)return-1;let c=[48e3,44100,32e3][o],l=t[n+4]&63,u=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][l*3+o]*2;if(n+u>t.length)return-1;let d=t[n+6]>>5,f=0;d===2?f+=2:(d&1&&d!==1&&(f+=2),d&4&&(f+=2));let p=(t[n+6]<<8|t[n+7])>>12-f&1,m=[2,1,2,3,3,4,4,5][d]+p,h=t[n+5]>>3,g=t[n+5]&7,_=new Uint8Array([o<<6|h<<1|g>>2,(g&3)<<6|d<<3|p<<2|l>>4,l<<4&224]),v=r+i*(1536/c*9e4),y=t.subarray(n,n+u);return e.config=_,e.channelCount=m,e.samplerate=c,e.samples.push({unit:y,pts:v}),u}function Jr(e,t){return X(e.presentationTime)?e.presentationTime/e.timeScale:t+e.presentationTimeDelta/e.timeScale}function Yr(e,t){return((e[t+1]&31)<<8)+e[t+2]}function Xr(e,t){return(e[t+10]&31)<<8|e[t+11]}function Zr(e,t,n,r,i,o){let c={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:`avc`,segmentAudioCodec:`aac`},l=(e[t+1]&15)<<8|e[t+2],u=t+3+l-4,d=(e[t+10]&15)<<8|e[t+11];for(t+=12+d;t<u;){let l=Yr(e,t),u=(e[t+3]&15)<<8|e[t+4];switch(e[t]){case 207:if(!r){$r(`ADTS AAC`,o);break}case 15:c.audioPid===-1&&(c.audioPid=l);break;case 21:c.id3Pid===-1&&(c.id3Pid=l);break;case 219:if(!r){$r(`H.264`,o);break}case 27:c.videoPid===-1&&(c.videoPid=l);break;case 3:case 4:!n.mpeg&&!n.mp3?o.log(`MPEG audio found, not supported in this browser`):c.audioPid===-1&&(c.audioPid=l,c.segmentAudioCodec=`mp3`);break;case 193:if(!r){$r(`AC-3`,o);break}case 129:n.ac3?c.audioPid===-1&&(c.audioPid=l,c.segmentAudioCodec=`ac3`):o.log(`AC-3 audio found, not supported in this browser`);break;case 6:if(c.audioPid===-1&&u>0){let r=t+5,i=u;for(;i>2;){switch(e[r]){case 106:n.ac3===!0?(c.audioPid=l,c.segmentAudioCodec=`ac3`):o.log(`AC-3 audio found, not supported in this browser for now`);break}let t=e[r+1]+2;r+=t,i-=t}}break;case 194:case 135:return Qr(i,Error(`Unsupported EC-3 in M2TS found`),void 0,o),c;case 36:c.videoPid===-1&&(c.videoPid=l,c.segmentVideoCodec=`hevc`,o.log(`HEVC in M2TS found`));break}t+=u+5}return c}function Qr(e,t,n,r){r.warn(`parsing error: ${t.message}`),e.emit(Q.ERROR,Q.ERROR,{type:wo.MEDIA_ERROR,details:Z.FRAG_PARSING_ERROR,fatal:!1,levelRetry:n,error:t,reason:t.message})}function $r(e,t){t.log(`${e} with AES-128-CBC encryption found in unencrypted stream`)}function ei(e,t){let n=0,r,i,o,c,l,u=e.data;if(!e||e.size===0)return null;for(;u[0].length<19&&u.length>1;)u[0]=Ce(u[0],u[1]),u.splice(1,1);if(r=u[0],(r[0]<<16)+(r[1]<<8)+r[2]===1){if(i=(r[4]<<8)+r[5],i&&i>e.size-6)return null;let d=r[7];d&192&&(c=(r[9]&14)*536870912+(r[10]&255)*4194304+(r[11]&254)*16384+(r[12]&255)*128+(r[13]&254)/2,d&64?(l=(r[14]&14)*536870912+(r[15]&255)*4194304+(r[16]&254)*16384+(r[17]&255)*128+(r[18]&254)/2,c-l>60*9e4&&(t.warn(`${Math.round((c-l)/9e4)}s delta between PTS and DTS, align them`),c=l)):l=c),o=r[8];let f=o+9;if(e.size<=f)return null;e.size-=f;let p=new Uint8Array(e.size);for(let e=0,t=u.length;e<t;e++){r=u[e];let t=r.byteLength;if(f)if(f>t){f-=t;continue}else r=r.subarray(f),t-=f,f=0;p.set(r,n),n+=t}return i&&(i-=o+3),{data:p,pts:c,dts:l,len:i}}return null}function ti(e,t,n=1,r=!1){let i=e*t*n;return r?Math.round(i):i}function ni(e,t,n=1,r=!1){return ti(e,t,1/n,r)}function ri(e,t=!1){return ti(e,1e3,1/Tc,t)}function ii(e,t=1){return ti(e,Tc,1/t)}function ai(e){let{baseTime:t,timescale:n,trackId:r}=e;return`${t/n} (${t}/${n}) trackId: ${r}`}function oi(e,t,n,r){return{duration:t,size:n,cts:r,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:e?2:1,isNonSync:+!e}}}function si(e,t){let n;if(t===null)return e;for(n=t<e?-8589934592:8589934592;Math.abs(e-t)>4294967296;)e+=n;return e}function ci(e){for(let t=0;t<e.length;t++)if(e[t].key)return t;return-1}function li(e,t,n,r){let i=e.samples.length;if(!i)return;let o=e.inputTimeScale;for(let c=0;c<i;c++){let i=e.samples[c];i.pts=si(i.pts-n.baseTime*o/n.timescale,t*o)/o,i.dts=si(i.dts-r.baseTime*o/r.timescale,t*o)/o}let c=e.samples;return e.samples=[],{samples:c}}function ui(e,t,n){let r=e.samples.length;if(!r)return;let i=e.inputTimeScale;for(let o=0;o<r;o++){let r=e.samples[o];r.pts=si(r.pts-n.baseTime*i/n.timescale,t*i)/i}e.samples.sort((e,t)=>e.pts-t.pts);let o=e.samples;return e.samples=[],{samples:o}}function di(e,t,n=!1){return e?.start===void 0?t:(e.start+(n?e.duration:0))/e.timescale}function fi(e,t,n,r){if(e===null)return!0;let i=Math.max(r,1),o=t-e.baseTime/e.timescale;return Math.abs(o-n)>i}function pi(e,t,n){let r=e.codec;return r&&r.length>4?r:t===Ro.AUDIO?r===`ec-3`||r===`ac-3`||r===`alac`?r:r===`fLaC`||r===`Opus`?Ve(r,!1):(n.warn(`Unhandled audio codec "${r}" in mp4 MAP`),r||`mp4a`):(n.warn(`Unhandled video codec "${r}" in mp4 MAP`),r||`avc1`)}function mi(e,t){let n=null;return e.byteLength>0&&t?.key!=null&&t.iv!==null&&t.method!=null&&(n=t),n}function hi(e){return`then`in e&&e.then instanceof Function}function gi(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!_i(e[n].attrs,t[n].attrs))return!1;return!0}function _i(e,t,n){let r=e[`STABLE-RENDITION-ID`];return r&&!n?r===t[`STABLE-RENDITION-ID`]:!(n||[`LANGUAGE`,`NAME`,`CHARACTERISTICS`,`AUTOSELECT`,`DEFAULT`,`FORCED`,`ASSOC-LANGUAGE`]).some(n=>e[n]!==t[n])}function vi(e,t){return t.label.toLowerCase()===e.name.toLowerCase()&&(!t.language||t.language.toLowerCase()===(e.lang||``).toLowerCase())}function yi(e){let t=e.querySelectorAll(`source`);[].slice.call(t).forEach(t=>{e.removeChild(t)})}function bi(e,t){let n=self.document.createElement(`source`);n.type=`video/mp4`,n.src=t,e.appendChild(n)}function xi(e){return+(e===`audio`)}function Si(e){return Array.isArray(e)?JSON.stringify(e):e instanceof Map?`Map{}`:e instanceof Set?`Set{}`:typeof e==`object`?JSON.stringify(e):String(e)}function Ci(e,t,n,r){return Error(`failed to ${e} "${Si(t)}" as ${n}`,{cause:r})}function wi(e,t,n){return Ci(`serialize`,e,t,n)}function Ti(e){if(typeof e!=`boolean`)throw wi(e,il);return e?`?1`:`?0`}function Ei(e){return btoa(String.fromCharCode(...e))}function Di(e){if(ArrayBuffer.isView(e)===!1)throw wi(e,al);return`:${Ei(e)}:`}function Oi(e){return e<-999999999999999||999999999999999<e}function ki(e){if(Oi(e))throw wi(e,ol);return e.toString()}function Ai(e){return`@${ki(e.getTime()/1e3)}`}function ji(e,t){if(e<0)return-ji(-e,t);let n=10**t;if(Math.abs(e*n%1-.5)<2**-52){let t=Math.floor(e*n);return(t%2==0?t:t+1)/n}else return Math.round(e*n)/n}function Mi(e){let t=ji(e,3);if(Math.floor(Math.abs(t)).toString().length>12)throw wi(e,sl);let n=t.toString();return n.includes(`.`)?n:`${n}.0`}function Ni(e){if(ll.test(e))throw wi(e,cl);return`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function Pi(e){return e.description||e.toString().slice(7,-1)}function Fi(e){let t=Pi(e);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(t)===!1)throw wi(t,ul);return t}function Ii(e){switch(typeof e){case`number`:if(!X(e))throw wi(e,rl);return Number.isInteger(e)?ki(e):Mi(e);case`string`:return Ni(e);case`symbol`:return Fi(e);case`boolean`:return Ti(e);case`object`:if(e instanceof Date)return Ai(e);if(e instanceof Uint8Array)return Di(e);if(e instanceof nl)return Fi(e);default:throw wi(e,rl)}}function Li(e){if(/^[a-z*][a-z0-9\-_.*]*$/.test(e)===!1)throw wi(e,dl);return e}function Ri(e){return e==null?``:Object.entries(e).map(([e,t])=>t===!0?`;${Li(e)}`:`;${Li(e)}=${Ii(t)}`).join(``)}function zi(e){return e instanceof el?`${Ii(e.value)}${Ri(e.params)}`:Ii(e)}function Bi(e){return`(${e.value.map(zi).join(` `)})${Ri(e.params)}`}function Vi(e,t={whitespace:!0}){if(typeof e!=`object`||!e)throw wi(e,tl);let n=e instanceof Map?e.entries():Object.entries(e),r=t?.whitespace?` `:``;return Array.from(n).map(([e,t])=>{t instanceof el||(t=new el(t));let n=Li(e);return t.value===!0?n+=Ri(t.params):(n+=`=`,Array.isArray(t.value)?n+=Bi(t):n+=zi(t)),n}).join(`,${r}`)}function Hi(e,t){return Vi(e,t)}function Ui(e){return Object.keys(e).reduce((t,n)=>{var r;return(r=e[n])==null||r.forEach(e=>t[e]=n),t},{})}function Wi(e,t){let n={};if(!e)return n;let r=Object.keys(e),i=t?Ui(t):{};return r.reduce((t,n)=>{let r=gl[n]||i[n]||_l.REQUEST,o=t[r]??(t[r]={});return o[n]=e[n],t},n)}function Gi(e){return[`ot`,`sf`,`st`,`e`,`sta`].includes(e)}function Ki(e){return typeof e==`number`?X(e):e!=null&&e!==``&&e!==!1}function qi(e,t){let n=new URL(e),r=new URL(t);if(n.origin!==r.origin)return e;let i=n.pathname.split(`/`).slice(1),o=r.pathname.split(`/`).slice(1,-1);for(;i[0]===o[0];)i.shift(),o.shift();for(;o.length;)o.shift(),i.unshift(`..`);return i.join(`/`)+n.search+n.hash}function Ji(e){return Ol.test(e)}function Yi(e){return El.includes(e)||Dl.includes(e)||Ji(e)}function Xi(e){return El.includes(e)||kl.includes(e)||Ji(e)}function Zi(e){return El.includes(e)||kl.includes(e)||Al.includes(e)||Ji(e)}function Qi(e){return jl.includes(e)||Ji(e)}function $i(e,t={}){let n={};if(typeof e!=`object`||!e)return n;let r=t.version||e.v||1,i=t.reportingMode||wl,o=r===1?Qi:Ml[i],c=Object.keys(e).filter(o),l=t.filter;typeof l==`function`&&(c=c.filter(l));let u=i===Tl||i===vl;u&&!c.includes(`ts`)&&c.push(`ts`),r>1&&!c.includes(`v`)&&c.push(`v`);let d=j({},Cl,t.formatters),f={version:r,reportingMode:i,baseUrl:t.baseUrl};return c.sort().forEach(t=>{let i=e[t],o=d[t];if(typeof o==`function`&&(i=o(i,f)),t===`v`){if(r===1)return;i=r}t==`pr`&&i===1||(u&&t===`ts`&&!X(i)&&(i=Date.now()),Ki(i)&&(Gi(t)&&typeof i==`string`&&(i=new nl(i)),n[t]=i))}),n}function ea(e,t={}){let n={};if(!e)return n;let r=Wi($i(e,t),t?.customHeaderMap);return Object.entries(r).reduce((e,[t,n])=>{let r=Hi(n,{whitespace:!1});return r&&(e[t]=r),e},n)}function ta(e,t,n){return j(e,ea(t,n))}function na(e,t={}){return e?Hi($i(e,t),{whitespace:!1}):``}function ra(e,t={}){if(!e)return``;let n=na(e,t);return encodeURIComponent(n)}function ia(e,t={}){return e?`${Nl}=${ra(e,t)}`:``}function aa(e,t,n){let r=ia(t,n);return r?Pl.test(e)?e.replace(Pl,r):`${e}${e.includes(`?`)?`&`:`?`}${r}`:e}function oa(e,t,n,r){e&&Object.keys(t).forEach(i=>{let o=e.filter(e=>e.groupId===i).map(e=>{let o=j({},e);return o.details=void 0,o.attrs=new Os(o.attrs),o.url=o.attrs.URI=sa(e.url,e.attrs[`STABLE-RENDITION-ID`],`PER-RENDITION-URIS`,n),o.groupId=o.attrs[`GROUP-ID`]=t[i],o.attrs[`PATHWAY-ID`]=r,o});e.push(...o)})}function sa(e,t,n,r){let{HOST:i,PARAMS:o,[n]:c}=r,l;t&&(l=c?.[t],l&&(e=l));let u=new self.URL(e);return i&&!l&&(u.host=i),o&&Object.keys(o).sort().forEach(e=>{e&&u.searchParams.set(e,o[e])}),u.href}function ca(e){if(!e)throw Error(`Could not read keyId of undefined decryptdata`);if(e.keyId===null)throw Error(`keyId is null`);return W(e.keyId)}function la(e,t){if(e.keyId&&t.mediaKeysSession.keyStatuses.has(e.keyId))return t.mediaKeysSession.keyStatuses.get(e.keyId);if(e.matches(t.decryptdata))return t.keyStatus}function ua(e,t){let n=e===`output-restricted`,r=n?Z.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:Z.KEY_SYSTEM_STATUS_INTERNAL_ERROR;return new zl({type:wo.KEY_SYSTEM_ERROR,details:r,fatal:!1,decryptdata:t},n?`HDCP level output restricted`:`key status changed to "${e}"`)}function da(e,t){let n;try{n=new Event(`addtrack`)}catch{n=document.createEvent(`Event`),n.initEvent(`addtrack`,!1,!1)}n.track=e,t.dispatchEvent(n)}function fa(e,t){let n=e.mode;if(n===`disabled`&&(e.mode=`hidden`),e.cues&&!e.cues.getCueById(t.id))try{if(e.addCue(t),!e.cues.getCueById(t.id))throw Error(`addCue is failed for: ${t}`)}catch(n){No.debug(`[texttrack-utils]: ${n}`);try{let n=new self.TextTrackCue(t.startTime,t.endTime,t.text);n.id=t.id,e.addCue(n)}catch(e){No.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${e}`)}}n===`disabled`&&(e.mode=n)}function pa(e,t){let n=e.mode;if(n===`disabled`&&(e.mode=`hidden`),e.cues)for(let n=e.cues.length;n--;)t&&e.cues[n].removeEventListener(`enter`,t),e.removeCue(e.cues[n]);n===`disabled`&&(e.mode=n)}function ma(e,t,n,r){let i=e.mode;if(i===`disabled`&&(e.mode=`hidden`),e.cues&&e.cues.length>0){let i=ga(e.cues,t,n);for(let t=0;t<i.length;t++)(!r||r(i[t]))&&e.removeCue(i[t])}i===`disabled`&&(e.mode=i)}function ha(e,t){if(t<=e[0].startTime)return 0;let n=e.length-1;if(t>e[n].endTime)return-1;let r=0,i=n,o;for(;r<=i;)if(o=Math.floor((i+r)/2),t<e[o].startTime)i=o-1;else if(t>e[o].startTime&&r<n)r=o+1;else return o;return e[r].startTime-t<t-e[i].startTime?r:i}function ga(e,t,n){let r=[],i=ha(e,t);if(i>-1)for(let o=i,c=e.length;o<c;o++){let i=e[o];if(i.startTime>=t&&i.endTime<=n)r.push(i);else if(i.startTime>n)return r}return r}function _a(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];(r.kind===`subtitles`||r.kind===`captions`)&&r.label&&t.push(e[n])}return t}function va(){try{return crypto.randomUUID()}catch{try{let e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf(`/`)+1)}catch{let e=new Date().getTime();return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,t=>{let n=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(t==`x`?n:n&3|8).toString(16)})}}}function ya(e){let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return(t>>>0).toString()}function ba(e,t,n){return`${e.identifier}-${n+1}-${ya(t)}`}function xa(e,t){return e-t.start<t.duration/2&&!(Math.abs(e-(t.start+t.duration))<Hl)?t.start:t.start+t.duration}function Sa(e,t,n){let r=new self.URL(e,n);return r.protocol!==`data:`&&r.searchParams.set(`_HLS_primary_id`,t),r}function Ca(e,t){for(;(n=e.assetList[++t])!=null&&n.error;)var n;return t}function wa(e){return`["${e.identifier}" ${e.cue.pre?`<pre>`:e.cue.post?`<post>`:``}${e.timelineStart.toFixed(2)}-${e.resumeTime.toFixed(2)}]`}function Ta(e){let t=e.timelineStart,n=e.duration||0;return`["${e.identifier}" ${t.toFixed(2)}-${(t+n).toFixed(2)}]`}function Ea(e){return`[${e.event?`"`+e.event.identifier+`"`:`primary`}: ${e.start.toFixed(2)}-${e.end.toFixed(2)}]`}function Da(e){var t;e==null||(t=e.play())==null||t.catch(()=>{})}function Oa(e,t){return`[${e}] Advancing timeline position to ${t}`}function ka(e,t,n){n.a=e,n.b=t}function Aa(e,t,n){return n.a===e&&n.b===t}function ja(){return{a:null,b:null}}function Ma(e){function t(e,t,n,r){return(e|0)*3600+(t|0)*60+(n|0)+parseFloat(r||0)}let n=e.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return n?parseFloat(n[2])>59?t(n[2],n[3],0,n[4]):t(n[1],n[2],n[3],n[4]):null}function Na(e,t,n,r){let i=r?e.split(r):[e];for(let e in i){if(typeof i[e]!=`string`)continue;let r=i[e].split(n);if(r.length!==2)continue;let o=r[0],c=r[1];t(o,c)}}function Pa(e,t,n){let r=e;function i(){let t=Ma(e);if(t===null)throw Error(`Malformed timestamp: `+r);return e=e.replace(/^[^\sa-zA-Z-]+/,``),t}function o(e,t){let r=new vu;Na(e,function(e,t){let i;switch(e){case`region`:for(let i=n.length-1;i>=0;i--)if(n[i].id===t){r.set(e,n[i].region);break}break;case`vertical`:r.alt(e,t,[`rl`,`lr`]);break;case`line`:i=t.split(`,`),r.integer(e,i[0]),r.percent(e,i[0])&&r.set(`snapToLines`,!1),r.alt(e,i[0],[`auto`]),i.length===2&&r.alt(`lineAlign`,i[1],[`start`,bu,`end`]);break;case`position`:i=t.split(`,`),r.percent(e,i[0]),i.length===2&&r.alt(`positionAlign`,i[1],[`start`,bu,`end`,`line-left`,`line-right`,`auto`]);break;case`size`:r.percent(e,t);break;case`align`:r.alt(e,t,[`start`,bu,`end`,`left`,`right`]);break}},/:/,/\s/),t.region=r.get(`region`,null),t.vertical=r.get(`vertical`,``);let i=r.get(`line`,`auto`);i===`auto`&&yu.line===-1&&(i=-1),t.line=i,t.lineAlign=r.get(`lineAlign`,`start`),t.snapToLines=r.get(`snapToLines`,!0),t.size=r.get(`size`,100),t.align=r.get(`align`,bu);let o=r.get(`position`,`auto`);o===`auto`&&yu.position===50&&(o=t.align===`start`||t.align===`left`?0:t.align===`end`||t.align===`right`?100:50),t.position=o}function c(){e=e.replace(/^\s+/,``)}if(c(),t.startTime=i(),c(),e.slice(0,3)!==`-->`)throw Error(`Malformed time stamp (time stamps must be separated by '-->'): `+r);e=e.slice(3),c(),t.endTime=i(),c(),o(e,t)}function Fa(e){return e.replace(/<br(?: \/)?>/gi,`
9
+ `)}function Ia(e,t,n){return ya(e.toString())+ya(t.toString())+ya(n)}function La(e,t,n,r,i,o,c){let l=new xu,u=U(new Uint8Array(e)).trim().replace(Su,`
10
+ `).split(`
11
+ `),d=[],f=t?ii(t.baseTime,t.timescale):0,p=`00:00.000`,m=0,h=0,g,_=!0;l.oncue=function(e){let o=n[r],c=n.ccOffset,l=(m-f)/9e4;if(o!=null&&o.new&&(h===void 0?Tu(n,r,l):c=n.ccOffset=o.start),l){if(!t){g=Error(`Missing initPTS for VTT MPEGTS`);return}c=l-n.presentationOffset}let u=e.endTime-e.startTime,p=si((e.startTime+c-h)*9e4,i*9e4)/9e4;e.startTime=Math.max(p,0),e.endTime=Math.max(p+u,0);let _=e.text.trim();e.text=decodeURIComponent(encodeURIComponent(_)),e.id||=Ia(e.startTime,e.endTime,_),e.endTime>0&&d.push(e)},l.onparsingerror=function(e){g=e},l.onflush=function(){if(g){c(g);return}o(d)},u.forEach(e=>{if(_)if(Cu(e,`X-TIMESTAMP-MAP=`)){_=!1,e.slice(16).split(`,`).forEach(e=>{Cu(e,`LOCAL:`)?p=e.slice(6):Cu(e,`MPEGTS:`)&&(m=parseInt(e.slice(7)))});try{h=wu(p)/1e3}catch(e){g=e}return}else e===``&&(_=!1);l.parse(e+`
12
+ `)}),l.flush()}function Ra(e,t,n,r){let i=ce(new Uint8Array(e),[`mdat`]);if(i.length===0){r(Error(`Could not parse IMSC1 mdat`));return}let o=i.map(e=>U(e)),c=ni(t.baseTime,1,t.timescale);try{o.forEach(e=>n(za(e,c)))}catch(e){r(e)}}function za(e,t){let n=new DOMParser().parseFromString(e,`text/xml`).getElementsByTagName(`tt`)[0];if(!n)throw Error(`Invalid ttml`);let r={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},i=Object.keys(r).reduce((e,t)=>(e[t]=n.getAttribute(`ttp:${t}`)||r[t],e),{}),o=n.getAttribute(`xml:space`)!==`preserve`,c=Va(Ba(n,`styling`,`style`)),l=Va(Ba(n,`layout`,`region`)),u=Ba(n,`body`,`[begin]`);return[].map.call(u,e=>{let n=Ha(e,o);if(!n||!e.hasAttribute(`begin`))return null;let r=Ka(e.getAttribute(`begin`),i),u=Ka(e.getAttribute(`dur`),i),d=Ka(e.getAttribute(`end`),i);if(r===null)throw Ga(e);if(d===null){if(u===null)throw Ga(e);d=r+u}let f=new gu(r-t,d-t,n);f.id=Ia(f.startTime,f.endTime,f.text);let p=l[e.getAttribute(`region`)],m=c[e.getAttribute(`style`)],h=Ua(p,m,c),{textAlign:g}=h;if(g){let e=ku[g];e&&(f.lineAlign=e),f.align=g}return j(f,h),f}).filter(e=>e!==null)}function Ba(e,t,n){let r=e.getElementsByTagName(t)[0];return r?[].slice.call(r.querySelectorAll(n)):[]}function Va(e){return e.reduce((e,t)=>{let n=t.getAttribute(`xml:id`);return n&&(e[n]=t),e},{})}function Ha(e,t){return[].slice.call(e.childNodes).reduce((e,n,r)=>{var i;return n.nodeName===`br`&&r?e+`
13
+ `:(i=n.childNodes)!=null&&i.length?Ha(n,t):t?e+n.textContent.trim().replace(/\s+/g,` `):e+n.textContent},``)}function Ua(e,t,n){let r=`http://www.w3.org/ns/ttml#styling`,i=null,o=[`displayAlign`,`textAlign`,`color`,`backgroundColor`,`fontSize`,`fontFamily`],c=e!=null&&e.hasAttribute(`style`)?e.getAttribute(`style`):null;return c&&n.hasOwnProperty(c)&&(i=n[c]),o.reduce((n,o)=>{let c=Wa(t,r,o)||Wa(e,r,o)||Wa(i,r,o);return c&&(n[o]=c),n},{})}function Wa(e,t,n){return e&&e.hasAttributeNS(t,n)?e.getAttributeNS(t,n):null}function Ga(e){return Error(`Could not parse ttml timestamp ${e}`)}function Ka(e,t){if(!e)return null;let n=Ma(e);return n===null&&(Du.test(e)?n=qa(e,t):Ou.test(e)&&(n=Ja(e,t))),n}function qa(e,t){let n=Du.exec(e),r=(n[4]|0)+(n[5]|0)/t.subFrameRate;return(n[1]|0)*3600+(n[2]|0)*60+(n[3]|0)+r/t.frameRate}function Ja(e,t){let n=Ou.exec(e),r=Number(n[1]);switch(n[2]){case`h`:return r*3600;case`m`:return r*60;case`ms`:return r*1e3;case`f`:return r/t.frameRate;case`t`:return r/t.tickRate}return r}function Ya(e){return e.characteristics&&/transcribes-spoken-dialog/gi.test(e.characteristics)&&/describes-music-and-sound/gi.test(e.characteristics)?`captions`:`subtitles`}function Xa(e,t){return!!e&&e.kind===Ya(t)&&vi(t,e)}function Za(e,t,n,r){return Math.min(t,r)-Math.max(e,n)}function Qa(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}function $a(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}function eo(e,t){let n={method:`GET`,mode:`cors`,credentials:`same-origin`,signal:t,headers:new self.Headers(j({},e.headers))};return e.rangeEnd&&n.headers.set(`Range`,`bytes=`+e.rangeStart+`-`+String(e.rangeEnd-1)),n}function to(e){let t=Pu.exec(e);if(t)return parseInt(t[2])-parseInt(t[1])+1}function no(e){let t=e.get(`Content-Range`);if(t){let e=to(t);if(X(e))return e}let n=e.get(`Content-Length`);if(n)return parseInt(n)}function ro(e,t){return new self.Request(e.url,t)}function io(){return{cueHandler:Nu,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:`English`,captionsTextTrack1LanguageCode:`en`,captionsTextTrack2Label:`Spanish`,captionsTextTrack2LanguageCode:`es`,captionsTextTrack3Label:`Unknown CC`,captionsTextTrack3LanguageCode:``,captionsTextTrack4Label:`Unknown CC`,captionsTextTrack4LanguageCode:``,renderTextTracksNatively:!0}}function ao(e,t,n){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw Error(`Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration`);if(t.liveMaxLatencyDurationCount!==void 0&&(t.liveSyncDurationCount===void 0||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw Error(`Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"`);if(t.liveMaxLatencyDuration!==void 0&&(t.liveSyncDuration===void 0||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw Error(`Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"`);let r=oo(e),i=[`manifest`,`level`,`frag`],o=[`TimeOut`,`MaxRetry`,`RetryDelay`,`MaxRetryTimeout`];return i.forEach(e=>{let i=`${e===`level`?`playlist`:e}LoadPolicy`,c=t[i]===void 0,l=[];o.forEach(n=>{let o=`${e}Loading${n}`,u=t[o];if(u!==void 0&&c){l.push(o);let e=r[i].default;switch(t[i]={default:e},n){case`TimeOut`:e.maxLoadTimeMs=u,e.maxTimeToFirstByteMs=u;break;case`MaxRetry`:e.errorRetry.maxNumRetry=u,e.timeoutRetry.maxNumRetry=u;break;case`RetryDelay`:e.errorRetry.retryDelayMs=u,e.timeoutRetry.retryDelayMs=u;break;case`MaxRetryTimeout`:e.errorRetry.maxRetryDelayMs=u,e.timeoutRetry.maxRetryDelayMs=u;break}}}),l.length&&n.warn(`hls.js config: "${l.join(`", "`)}" setting(s) are deprecated, use "${i}": ${is(t[i])}`)}),N(N({},r),t)}function oo(e){return e&&typeof e==`object`?Array.isArray(e)?e.map(oo):Object.keys(e).reduce((t,n)=>(t[n]=oo(e[n]),t),{}):e}function so(e,t){let n=e.loader;n!==Fu&&n!==Ru?(t.log(`[config]: Custom loader detected, cannot enable progressive streaming`),e.progressive=!1):$a()&&(e.loader=Fu,e.progressive=!0,e.enableSoftwareAES=!0,t.log(`[config]: Progressive streaming enabled, using FetchLoader`))}function co(e,t){let n=lo(e.main);if(n&&n.start<=t)return n;let r=lo(e.audio);return r&&r.start<=t?r:null}function lo(e){if(!e)return null;switch(e.state){case $.IDLE:case $.STOPPED:case $.ENDED:case $.ERROR:return null}return e.frag}function uo(e,t){return t.getAppendedFrag(e,Eo.MAIN)||t.getPartialFragment(e)}function fo(){if(!(typeof self>`u`))return self.VTTCue||self.TextTrackCue}function po(e,t,n,r,i){let o=new e(t,n,``);try{o.value=r,i&&(o.type=i)}catch{o=new e(t,n,is(i?N({type:i},r):r))}return o}function mo(e){let t={};e.forEach(e=>{let n=e.groupId||``;e.id=t[n]=t[n]||0,t[n]++})}function ho(){return self.SourceBuffer||self.WebKitSourceBuffer}function go(){if(!B())return!1;let e=ho();return!e||e.prototype&&typeof e.prototype.appendBuffer==`function`&&typeof e.prototype.remove==`function`}function _o(){if(!go())return!1;let e=B();return typeof e?.isTypeSupported==`function`&&([`avc1.42E01E,mp4a.40.2`,`av01.0.01M.08`,`vp09.00.50.08`].some(t=>e.isTypeSupported(Le(t,`video`)))||[`mp4a.40.2`,`fLaC`].some(t=>e.isTypeSupported(Le(t,`audio`))))}function vo(){var e;let t=ho();return typeof(t==null||(e=t.prototype)==null?void 0:e.changeType)==`function`}function yo(e){if(e.keyFormat!==Fs.FAIRPLAY){let t=e.keyId;if(t)return W(t)}return e.uri}function bo(e){let{type:t}=e;switch(t){case To.AUDIO_TRACK:return Eo.AUDIO;case To.SUBTITLE_TRACK:return Eo.SUBTITLE;default:return Eo.MAIN}}function xo(e,t){let n=e.url;return(n===void 0||n.indexOf(`data:`)===0)&&(n=t.url),n}var X,So,Co,wo,Z,Q,To,Eo,Do,Oo,ko,Ao,jo,Mo,No,Po,Fo,Io,Lo,Ro,zo,Bo,Vo,Ho,Uo,Wo,Go,Ko,qo,Jo,Yo,Xo,Zo,Qo,$o,es,ts,ns,rs,is,as,os,ss,cs,ls,us,ds,fs,ps,ms,hs,gs,_s,vs,ys,bs,xs,Ss,Cs,ws,Ts,Es,Ds,Os,ks,As,js,Ms,Ns,Ps,Fs,Is,Ls,Rs,zs,Bs,Vs,Hs,Us,Ws,Gs,$,Ks,qs,Js,Ys,Xs,Zs,Qs,$s,ec,tc,nc,rc,ic,ac,oc,sc,cc,lc,uc,dc,fc,pc,mc,hc,gc,_c,vc,yc,bc,xc,Sc,Cc,wc,Tc,Ec,Dc,Oc,kc,Ac,jc,Mc,Nc,Pc,Fc,Ic,Lc,Rc,zc,Bc,Vc,Hc,Uc,Wc,Gc,Kc,qc,Jc,Yc,Xc,Zc,Qc,$c,el,tl,nl,rl,il,al,ol,sl,cl,ll,ul,dl,fl,pl,ml,hl,gl,_l,vl,yl,bl,xl,Sl,Cl,wl,Tl,El,Dl,Ol,kl,Al,jl,Ml,Nl,Pl,Fl,Il,Ll,Rl,zl,Bl,Vl,Hl,Ul,Wl,Gl,Kl,ql,Jl,Yl,Xl,Zl,Ql,$l,eu,tu,nu,ru,iu,au,ou,su,cu,lu,uu,du,fu,pu,mu,hu,gu,_u,vu,yu,bu,xu,Su,Cu,wu,Tu,Eu,Du,Ou,ku,Au,ju,Mu,Nu,Pu,Fu,Iu,Lu,Ru,zu,Bu,Vu,Hu,Uu,Wu,Gu,Ku,qu,Ju,Yu,Xu,Zu,Qu,$u,ed,td=n((()=>{X=Number.isFinite||function(e){return typeof e==`number`&&isFinite(e)},So=Number.isSafeInteger||function(e){return typeof e==`number`&&Math.abs(e)<=Co},Co=2**53-1||9007199254740991,wo=function(e){return e.NETWORK_ERROR=`networkError`,e.MEDIA_ERROR=`mediaError`,e.KEY_SYSTEM_ERROR=`keySystemError`,e.MUX_ERROR=`muxError`,e.OTHER_ERROR=`otherError`,e}({}),Z=function(e){return e.KEY_SYSTEM_NO_KEYS=`keySystemNoKeys`,e.KEY_SYSTEM_NO_ACCESS=`keySystemNoAccess`,e.KEY_SYSTEM_NO_SESSION=`keySystemNoSession`,e.KEY_SYSTEM_NO_CONFIGURED_LICENSE=`keySystemNoConfiguredLicense`,e.KEY_SYSTEM_LICENSE_REQUEST_FAILED=`keySystemLicenseRequestFailed`,e.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED=`keySystemServerCertificateRequestFailed`,e.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED=`keySystemServerCertificateUpdateFailed`,e.KEY_SYSTEM_SESSION_UPDATE_FAILED=`keySystemSessionUpdateFailed`,e.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED=`keySystemStatusOutputRestricted`,e.KEY_SYSTEM_STATUS_INTERNAL_ERROR=`keySystemStatusInternalError`,e.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR=`keySystemDestroyMediaKeysError`,e.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR=`keySystemDestroyCloseSessionError`,e.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR=`keySystemDestroyRemoveSessionError`,e.MANIFEST_LOAD_ERROR=`manifestLoadError`,e.MANIFEST_LOAD_TIMEOUT=`manifestLoadTimeOut`,e.MANIFEST_PARSING_ERROR=`manifestParsingError`,e.MANIFEST_INCOMPATIBLE_CODECS_ERROR=`manifestIncompatibleCodecsError`,e.LEVEL_EMPTY_ERROR=`levelEmptyError`,e.LEVEL_LOAD_ERROR=`levelLoadError`,e.LEVEL_LOAD_TIMEOUT=`levelLoadTimeOut`,e.LEVEL_PARSING_ERROR=`levelParsingError`,e.LEVEL_SWITCH_ERROR=`levelSwitchError`,e.AUDIO_TRACK_LOAD_ERROR=`audioTrackLoadError`,e.AUDIO_TRACK_LOAD_TIMEOUT=`audioTrackLoadTimeOut`,e.SUBTITLE_LOAD_ERROR=`subtitleTrackLoadError`,e.SUBTITLE_TRACK_LOAD_TIMEOUT=`subtitleTrackLoadTimeOut`,e.FRAG_LOAD_ERROR=`fragLoadError`,e.FRAG_LOAD_TIMEOUT=`fragLoadTimeOut`,e.FRAG_DECRYPT_ERROR=`fragDecryptError`,e.FRAG_PARSING_ERROR=`fragParsingError`,e.FRAG_GAP=`fragGap`,e.REMUX_ALLOC_ERROR=`remuxAllocError`,e.KEY_LOAD_ERROR=`keyLoadError`,e.KEY_LOAD_TIMEOUT=`keyLoadTimeOut`,e.BUFFER_ADD_CODEC_ERROR=`bufferAddCodecError`,e.BUFFER_INCOMPATIBLE_CODECS_ERROR=`bufferIncompatibleCodecsError`,e.BUFFER_APPEND_ERROR=`bufferAppendError`,e.BUFFER_APPENDING_ERROR=`bufferAppendingError`,e.BUFFER_STALLED_ERROR=`bufferStalledError`,e.BUFFER_FULL_ERROR=`bufferFullError`,e.BUFFER_SEEK_OVER_HOLE=`bufferSeekOverHole`,e.BUFFER_NUDGE_ON_STALL=`bufferNudgeOnStall`,e.ASSET_LIST_LOAD_ERROR=`assetListLoadError`,e.ASSET_LIST_LOAD_TIMEOUT=`assetListLoadTimeout`,e.ASSET_LIST_PARSING_ERROR=`assetListParsingError`,e.INTERSTITIAL_ASSET_ITEM_ERROR=`interstitialAssetItemError`,e.INTERNAL_EXCEPTION=`internalException`,e.INTERNAL_ABORTED=`aborted`,e.ATTACH_MEDIA_ERROR=`attachMediaError`,e.UNKNOWN=`unknown`,e}({}),Q=function(e){return e.MEDIA_ATTACHING=`hlsMediaAttaching`,e.MEDIA_ATTACHED=`hlsMediaAttached`,e.MEDIA_DETACHING=`hlsMediaDetaching`,e.MEDIA_DETACHED=`hlsMediaDetached`,e.MEDIA_ENDED=`hlsMediaEnded`,e.STALL_RESOLVED=`hlsStallResolved`,e.BUFFER_RESET=`hlsBufferReset`,e.BUFFER_CODECS=`hlsBufferCodecs`,e.BUFFER_CREATED=`hlsBufferCreated`,e.BUFFER_APPENDING=`hlsBufferAppending`,e.BUFFER_APPENDED=`hlsBufferAppended`,e.BUFFER_EOS=`hlsBufferEos`,e.BUFFERED_TO_END=`hlsBufferedToEnd`,e.BUFFER_FLUSHING=`hlsBufferFlushing`,e.BUFFER_FLUSHED=`hlsBufferFlushed`,e.MANIFEST_LOADING=`hlsManifestLoading`,e.MANIFEST_LOADED=`hlsManifestLoaded`,e.MANIFEST_PARSED=`hlsManifestParsed`,e.LEVEL_SWITCHING=`hlsLevelSwitching`,e.LEVEL_SWITCHED=`hlsLevelSwitched`,e.LEVEL_LOADING=`hlsLevelLoading`,e.LEVEL_LOADED=`hlsLevelLoaded`,e.LEVEL_UPDATED=`hlsLevelUpdated`,e.LEVEL_PTS_UPDATED=`hlsLevelPtsUpdated`,e.LEVELS_UPDATED=`hlsLevelsUpdated`,e.AUDIO_TRACKS_UPDATED=`hlsAudioTracksUpdated`,e.AUDIO_TRACK_SWITCHING=`hlsAudioTrackSwitching`,e.AUDIO_TRACK_SWITCHED=`hlsAudioTrackSwitched`,e.AUDIO_TRACK_LOADING=`hlsAudioTrackLoading`,e.AUDIO_TRACK_LOADED=`hlsAudioTrackLoaded`,e.AUDIO_TRACK_UPDATED=`hlsAudioTrackUpdated`,e.SUBTITLE_TRACKS_UPDATED=`hlsSubtitleTracksUpdated`,e.SUBTITLE_TRACKS_CLEARED=`hlsSubtitleTracksCleared`,e.SUBTITLE_TRACK_SWITCH=`hlsSubtitleTrackSwitch`,e.SUBTITLE_TRACK_LOADING=`hlsSubtitleTrackLoading`,e.SUBTITLE_TRACK_LOADED=`hlsSubtitleTrackLoaded`,e.SUBTITLE_TRACK_UPDATED=`hlsSubtitleTrackUpdated`,e.SUBTITLE_FRAG_PROCESSED=`hlsSubtitleFragProcessed`,e.CUES_PARSED=`hlsCuesParsed`,e.NON_NATIVE_TEXT_TRACKS_FOUND=`hlsNonNativeTextTracksFound`,e.INIT_PTS_FOUND=`hlsInitPtsFound`,e.FRAG_LOADING=`hlsFragLoading`,e.FRAG_LOAD_EMERGENCY_ABORTED=`hlsFragLoadEmergencyAborted`,e.FRAG_LOADED=`hlsFragLoaded`,e.FRAG_DECRYPTED=`hlsFragDecrypted`,e.FRAG_PARSING_INIT_SEGMENT=`hlsFragParsingInitSegment`,e.FRAG_PARSING_USERDATA=`hlsFragParsingUserdata`,e.FRAG_PARSING_METADATA=`hlsFragParsingMetadata`,e.FRAG_PARSED=`hlsFragParsed`,e.FRAG_BUFFERED=`hlsFragBuffered`,e.FRAG_CHANGED=`hlsFragChanged`,e.FPS_DROP=`hlsFpsDrop`,e.FPS_DROP_LEVEL_CAPPING=`hlsFpsDropLevelCapping`,e.MAX_AUTO_LEVEL_UPDATED=`hlsMaxAutoLevelUpdated`,e.ERROR=`hlsError`,e.DESTROYING=`hlsDestroying`,e.KEY_LOADING=`hlsKeyLoading`,e.KEY_LOADED=`hlsKeyLoaded`,e.LIVE_BACK_BUFFER_REACHED=`hlsLiveBackBufferReached`,e.BACK_BUFFER_REACHED=`hlsBackBufferReached`,e.STEERING_MANIFEST_LOADED=`hlsSteeringManifestLoaded`,e.ASSET_LIST_LOADING=`hlsAssetListLoading`,e.ASSET_LIST_LOADED=`hlsAssetListLoaded`,e.INTERSTITIALS_UPDATED=`hlsInterstitialsUpdated`,e.INTERSTITIALS_BUFFERED_TO_BOUNDARY=`hlsInterstitialsBufferedToBoundary`,e.INTERSTITIAL_ASSET_PLAYER_CREATED=`hlsInterstitialAssetPlayerCreated`,e.INTERSTITIAL_STARTED=`hlsInterstitialStarted`,e.INTERSTITIAL_ASSET_STARTED=`hlsInterstitialAssetStarted`,e.INTERSTITIAL_ASSET_ENDED=`hlsInterstitialAssetEnded`,e.INTERSTITIAL_ASSET_ERROR=`hlsInterstitialAssetError`,e.INTERSTITIAL_ENDED=`hlsInterstitialEnded`,e.INTERSTITIALS_PRIMARY_RESUMED=`hlsInterstitialsPrimaryResumed`,e.PLAYOUT_LIMIT_REACHED=`hlsPlayoutLimitReached`,e.EVENT_CUE_ENTER=`hlsEventCueEnter`,e}({}),To={MANIFEST:`manifest`,LEVEL:`level`,AUDIO_TRACK:`audioTrack`,SUBTITLE_TRACK:`subtitleTrack`},Eo={MAIN:`main`,AUDIO:`audio`,SUBTITLE:`subtitle`},Do=class{constructor(e,t=0,n=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=n}sample(e,t){let n=this.alpha_**+e;this.estimate_=t*(1-n)+n*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){let e=1-this.alpha_**+this.totalWeight_;if(e)return this.estimate_/e}return this.estimate_}},Oo=class{constructor(e,t,n,r=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=n,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Do(e),this.fast_=new Do(t),this.defaultTTFB_=r,this.ttfb_=new Do(e)}update(e,t){let{slow_:n,fast_:r,ttfb_:i}=this;n.halfLife!==e&&(this.slow_=new Do(e,n.getEstimate(),n.getTotalWeight())),r.halfLife!==t&&(this.fast_=new Do(t,r.getEstimate(),r.getTotalWeight())),i.halfLife!==e&&(this.ttfb_=new Do(e,i.getEstimate(),i.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);let n=8*t,r=e/1e3,i=n/r;this.fast_.sample(r,i),this.slow_.sample(r,i)}sampleTTFB(e){let t=e/1e3,n=Math.sqrt(2)*Math.exp(-(t**2)/2);this.ttfb_.sample(n,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}},ko=class{constructor(e,t){this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0;let n=`[${e}]:`;this.trace=Ao,this.debug=t.debug.bind(null,n),this.log=t.log.bind(null,n),this.warn=t.warn.bind(null,n),this.info=t.info.bind(null,n),this.error=t.error.bind(null,n)}},Ao=function(){},jo={trace:Ao,debug:Ao,log:Ao,warn:Ao,info:Ao,error:Ao},Mo=I(),No=Mo,Po={exports:{}},Io=ee(),Lo=class{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},Ro={AUDIO:`audio`,VIDEO:`video`,AUDIOVIDEO:`audiovideo`},zo=class{constructor(e){this._byteRange=null,this._url=null,this._stats=null,this._streams=null,this.base=void 0,this.relurl=void 0,typeof e==`string`&&(e={url:e}),this.base=e,ne(this,`stats`)}setByteRange(e,t){let n=e.split(`@`,2),r;r=n.length===1?t?.byteRangeEndOffset||0:parseInt(n[1]),this._byteRange=[r,parseInt(n[0])+r]}get baseurl(){return this.base.url}get byteRange(){return this._byteRange===null?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return this._streams===null&&(this._streams={[Ro.AUDIO]:null,[Ro.VIDEO]:null,[Ro.AUDIOVIDEO]:null}),this._streams}set elementaryStreams(e){this._streams=e}get hasStats(){return this._stats!==null}get hasStreams(){return this._streams!==null}get stats(){return this._stats===null&&(this._stats=new Lo),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Io.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||``}set url(e){this._url=e}clearElementaryStreamInfo(){let{elementaryStreams:e}=this;e[Ro.AUDIO]=null,e[Ro.VIDEO]=null,e[Ro.AUDIOVIDEO]=null}},Bo=class extends zo{constructor(e,t){super(t),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get byteLength(){if(this.hasStats){let e=this.stats.total;if(e)return e}if(this.byteRange.length){let e=this.byteRange[0],t=this.byteRange[1];if(X(e)&&X(t))return t-e}return null}get bitrate(){return this.byteLength?this.byteLength*8/this.duration:this._bitrate?this._bitrate:null}set bitrate(e){this._bitrate=e}get decryptdata(){var e;let{levelkeys:t}=this;if(!t||t.NONE)return null;if(t.identity)this._decryptdata||=t.identity.getDecryptData(this.sn);else if(!((e=this._decryptdata)!=null&&e.keyId)){let e=Object.keys(t);if(e.length===1){let n=this._decryptdata=t[e[0]]||null;n&&(this._decryptdata=n.getDecryptData(this.sn,t))}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;let e=X(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){var t;let e=Object.keys(this.levelkeys),n=e.length;if(n>1||n===1&&(t=this.levelkeys[e[0]])!=null&&t.encrypted)return!0}return!1}get programDateTime(){return this._programDateTime===null&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(e){if(!X(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return q(this)?(this._ref||={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime},this._ref):null}addStart(e){this.setStart(this.start+e)}setStart(e){this.start=e,this._ref&&(this._ref.start=e)}setDuration(e){this.duration=e,this._ref&&(this._ref.duration=e)}setKeyFormat(e){let t=this.levelkeys;if(t){var n;let r=t[e];r&&!((n=this._decryptdata)!=null&&n.keyId)&&(this._decryptdata=r.getDecryptData(this.sn,t))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,n,r,i,o=!1){let{elementaryStreams:c}=this,l=c[e];if(!l){c[e]={startPTS:t,endPTS:n,startDTS:r,endDTS:i,partial:o};return}l.startPTS=Math.min(l.startPTS,t),l.endPTS=Math.max(l.endPTS,n),l.startDTS=Math.min(l.startDTS,r),l.endDTS=Math.max(l.endDTS,i)}},Vo=class extends zo{constructor(e,t,n,r,i){super(n),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.duration=e.decimalFloatingPoint(`DURATION`),this.gap=e.bool(`GAP`),this.independent=e.bool(`INDEPENDENT`),this.relurl=e.enumeratedString(`URI`),this.fragment=t,this.index=r;let o=e.enumeratedString(`BYTERANGE`);o&&this.setByteRange(o,i),i&&(this.fragOffset=i.fragOffset+i.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){let{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}},Ho=2**32-1,Uo=[].push,Wo={video:1,audio:2,id3:3,text:4},Go=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),Ko={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,dav1:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}},qo={},Jo=/flac|opus|mp4a\.40\.34/i,Yo={supported:!0,powerEfficient:!0,smooth:!0},Xo={supported:!1,smooth:!1,powerEfficient:!1},Zo={supported:!0,configurations:[],decodingInfoResults:[Yo]},Qo=[`NONE`,`TYPE-0`,`TYPE-1`,null],$o=[`SDR`,`PQ`,`HLG`],es={No:``,Yes:`YES`,v2:`v2`},ts=class{constructor(e,t,n){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=n}addDirectives(e){let t=new self.URL(e);return this.msn!==void 0&&t.searchParams.set(`_HLS_msn`,this.msn.toString()),this.part!==void 0&&t.searchParams.set(`_HLS_part`,this.part.toString()),this.skip&&t.searchParams.set(`_HLS_skip`,this.skip),t.href}},ns=class{constructor(e){if(this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.supplemental=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.frameRate=e.attrs.optionalFloat(`FRAME-RATE`,0),this._avgBitrate=e.attrs.decimalInteger(`AVERAGE-BANDWIDTH`),this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.codecSet=[e.videoCodec,e.audioCodec].filter(e=>!!e).map(e=>e.substring(0,4)).join(`,`),`supplemental`in e){this.supplemental=e.supplemental;let t=e.supplemental?.videoCodec;t&&t!==e.videoCodec&&(this.codecSet+=`,${t.substring(0,4)}`)}this.addGroupId(`audio`,e.attrs.AUDIO),this.addGroupId(`text`,e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||``}get pathwayId(){return this.attrs[`PATHWAY-ID`]||`.`}get videoRange(){return this.attrs[`VIDEO-RANGE`]||`SDR`}get score(){return this.attrs.optionalFloat(`SCORE`,0)}get uri(){return this.url[0]||``}hasAudioGroup(e){return at(this._audioGroups,e)}hasSubtitleGroup(e){return at(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e===`audio`){let e=this._audioGroups;e||=this._audioGroups=[],e.indexOf(t)===-1&&e.push(t)}else if(e===`text`){let e=this._subtitleGroups;e||=this._subtitleGroups=[],e.indexOf(t)===-1&&e.push(t)}}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){return this.audioGroups?.[0]}get textGroupId(){return this.subtitleGroups?.[0]}addFallback(){}},rs=e=>{let t=new WeakSet;return(n,r)=>{if(e&&(r=e(n,r)),typeof r==`object`&&r){if(t.has(r))return;t.add(r)}return r}},is=(e,t)=>JSON.stringify(e,rs(t)),as=class extends ko{constructor(e){super(`abr`,e.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey=``,this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.supportedCache={},this.bwEstimator=void 0,this._abandonRulesCheck=e=>{let{fragCurrent:t,partCurrent:n,hls:r}=this,{autoLevelEnabled:i,media:o}=r;if(!t||!o)return;let c=performance.now(),l=n?n.stats:t.stats,u=n?n.duration:t.duration,d=c-l.loading.start,f=r.minAutoLevel,p=t.level,m=this._nextAutoLevel;if(l.aborted||l.loaded&&l.loaded===l.total||p<=f){this.clearTimer(),this._nextAutoLevel=-1;return}if(!i)return;let h=m>-1&&m!==p,g=!!e||h;if(!g&&(o.paused||!o.playbackRate||!o.readyState))return;let _=r.mainForwardBufferInfo;if(!g&&_===null)return;let v=this.bwEstimator.getEstimateTTFB(),y=Math.abs(o.playbackRate);if(d<=Math.max(v,1e3*(u/(y*2))))return;let b=_?_.len/y:0,x=l.loading.first?l.loading.first-l.loading.start:-1,S=l.loaded&&x>-1,C=this.getBwEstimate(),w=r.levels,T=w[p],E=Math.max(l.loaded,Math.round(u*(t.bitrate||T.averageBitrate)/8)),D=S?d-x:d;D<1&&S&&(D=Math.min(d,l.loaded*8/C));let O=S?l.loaded*1e3/D:0,k=v/1e3,A=O?(E-l.loaded)/O:E*8/C+k;if(A<=b)return;let j=O?O*8:C,M=(e?.details||this.hls.latestLevelDetails)?.live===!0,N=this.hls.config.abrBandWidthUpFactor,P=1/0,F;for(F=p-1;F>f;F--){let e=w[F].maxBitrate,t=!w[F].details||M;if(P=this.getTimeToLoadFrag(k,j,u*e,t),P<Math.min(b,u+k))break}if(P>=A||P>u*10)return;S?this.bwEstimator.sample(d-Math.min(v,x),l.loaded):this.bwEstimator.sampleTTFB(d);let I=w[F].maxBitrate;this.getBwEstimate()*N>I&&this.resetEstimator(I);let L=this.findBestLevel(I,f,F,0,b,1,1);L>-1&&(F=L),this.warn(`Fragment ${t.sn}${n?` part `+n.index:``} of level ${p} is loading too slowly;
14
+ Fragment duration: ${t.duration.toFixed(3)}
15
+ Time to underbuffer: ${b.toFixed(3)} s
16
+ Estimated load time for current fragment: ${A.toFixed(3)} s
17
+ Estimated load time for down switch fragment: ${P.toFixed(3)} s
18
+ TTFB estimate: ${x|0} ms
19
+ Current BW estimate: ${X(C)?C|0:`Unknown`} bps
20
+ New BW estimate: ${this.getBwEstimate()|0} bps
21
+ Switching to level ${F} @ ${I|0} bps`),r.nextLoadLevel=r.nextAutoLevel=F,this.clearTimer();let R=()=>{if(this.clearTimer(),this.fragCurrent===t&&this.hls.loadLevel===F&&F>0){let e=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${F>0?`and switching down`:``}
22
+ Fragment duration: ${t.duration.toFixed(3)} s
23
+ Time to underbuffer: ${e.toFixed(3)} s`),t.abortRequests(),this.fragCurrent=this.partCurrent=null,F>f){let t=this.findBestLevel(this.hls.levels[f].bitrate,f,F,0,e,1,1);t===-1&&(t=f),this.hls.nextLoadLevel=this.hls.nextAutoLevel=t,this.resetEstimator(this.hls.levels[t].bitrate)}}};h||A>P*2?R():this.timer=self.setInterval(R,P*1e3),r.trigger(Q.FRAG_LOAD_EMERGENCY_ABORTED,{frag:t,part:n,stats:l})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(this.log(`setting initial bwe to ${e}`),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){let e=this.hls.config;return new Oo(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){let{hls:e}=this;e.on(Q.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Q.FRAG_LOADING,this.onFragLoading,this),e.on(Q.FRAG_LOADED,this.onFragLoaded,this),e.on(Q.FRAG_BUFFERED,this.onFragBuffered,this),e.on(Q.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(Q.LEVEL_LOADED,this.onLevelLoaded,this),e.on(Q.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(Q.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(Q.ERROR,this.onError,this)}unregisterListeners(){let{hls:e}=this;e&&(e.off(Q.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Q.FRAG_LOADING,this.onFragLoading,this),e.off(Q.FRAG_LOADED,this.onFragLoaded,this),e.off(Q.FRAG_BUFFERED,this.onFragBuffered,this),e.off(Q.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(Q.LEVEL_LOADED,this.onLevelLoaded,this),e.off(Q.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(Q.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(Q.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=this.supportedCache=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.supportedCache={},this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=``}onFragLoading(e,t){let n=t.frag;this.ignoreFragment(n)||(n.bitrateTest||(this.fragCurrent=n,this.partCurrent=t.part??null),this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100))}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case Z.BUFFER_ADD_CODEC_ERROR:case Z.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case Z.FRAG_LOAD_TIMEOUT:{let e=t.frag,{fragCurrent:n,partCurrent:r}=this;if(e&&n&&e.sn===n.sn&&e.level===n.level){let t=performance.now(),n=r?r.stats:e.stats,i=t-n.loading.start,o=n.loading.first?n.loading.first-n.loading.start:-1;if(n.loaded&&o>-1){let e=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(i-Math.min(e,o),n.loaded)}else this.bwEstimator.sampleTTFB(i)}break}}}getTimeToLoadFrag(e,t,n,r){return e+n/t+(r?e+this.lastLevelLoadSec:0)}onLevelLoaded(e,t){let n=this.hls.config,{loading:r}=t.stats,i=r.end-r.first;X(i)&&(this.lastLevelLoadSec=i/1e3),t.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(t.levelInfo)}onFragLoaded(e,{frag:t,part:n}){let r=n?n.stats:t.stats;if(t.type===Eo.MAIN&&this.bwEstimator.sampleTTFB(r.loading.first-r.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){let e=n?n.duration:t.duration,i=this.hls.levels[t.level],o=(i.loaded?i.loaded.bytes:0)+r.loaded,c=(i.loaded?i.loaded.duration:0)+e;i.loaded={bytes:o,duration:c},i.realBitrate=Math.round(8*o/c)}if(t.bitrateTest){let e={stats:r,frag:t,part:n,id:t.type};this.onFragBuffered(Q.FRAG_BUFFERED,e),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){let{frag:n,part:r}=t,i=r!=null&&r.stats.loaded?r.stats:n.stats;if(i.aborted||this.ignoreFragment(n))return;let o=i.parsing.end-i.loading.start-Math.min(i.loading.first-i.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(o,i.loaded),i.bwEstimate=this.getBwEstimate(),n.bitrateTest?this.bitrateTestDelay=o/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==Eo.MAIN||e.sn===`initSegment`}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){let{maxAutoLevel:e,minAutoLevel:t}=this.hls,n=this.getBwEstimate(),r=this.hls.config.maxStarvationDelay,i=this.findBestLevel(n,t,e,0,r,1,1);if(i>-1)return i;let o=this.hls.firstLevel,c=Math.min(Math.max(o,t),e);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${o} clamped to ${c}`),c}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){let e=this.forcedAutoLevel,t=this.bwEstimator.canEstimate(),n=this.lastLoadedFragLevel>-1;if(e!==-1&&(!t||!n||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;let r=t&&n?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){let t=this.hls.levels;if(t.length>Math.max(e,r)&&t[e].loadError<=t[r].loadError)return e}return this._nextAutoLevel=r,this.nextAutoLevelKey=this.getAutoLevelKey(),r}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){let{fragCurrent:e,partCurrent:t,hls:n}=this;if(n.levels.length<=1)return n.loadLevel;let{maxAutoLevel:r,config:i,minAutoLevel:o}=n,c=t?t.duration:e?e.duration:0,l=this.getBwEstimate(),u=this.getStarvationDelay(),d=i.abrBandWidthFactor,f=i.abrBandWidthUpFactor;if(u){let e=this.findBestLevel(l,o,r,u,0,d,f);if(e>=0)return this.rebufferNotice=-1,e}let p=c?Math.min(c,i.maxStarvationDelay):i.maxStarvationDelay;if(!u){let e=this.bitrateTestDelay;e&&(p=(c?Math.min(c,i.maxLoadingDelay):i.maxLoadingDelay)-e,this.info(`bitrate test took ${Math.round(1e3*e)}ms, set first fragment max fetchDuration to ${Math.round(1e3*p)} ms`),d=f=1)}let m=this.findBestLevel(l,o,r,u,p,d,f);if(this.rebufferNotice!==m&&(this.rebufferNotice=m,this.info(`${u?`rebuffering expected`:`buffer is empty`}, optimal quality level ${m}`)),m>-1)return m;let h=n.levels[o],g=n.loadLevelObj;return g&&h?.bitrate<g.bitrate?o:n.loadLevel}getStarvationDelay(){let e=this.hls,t=e.media;if(!t)return 1/0;let n=t&&t.playbackRate!==0?Math.abs(t.playbackRate):1,r=e.mainForwardBufferInfo;return(r?r.len:0)/n}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,n,r,i,o,c){var l;let u=r+i,d=this.lastLoadedFragLevel,f=d===-1?this.hls.firstLevel:d,{fragCurrent:p,partCurrent:m}=this,{levels:h,allAudioTracks:g,loadLevel:_,config:v}=this.hls;if(h.length===1)return 0;let y=h[f],b=!!((l=this.hls.latestLevelDetails)!=null&&l.live),x=_===-1||d===-1,S,C=`SDR`,w=y?.frameRate||0,{audioPreference:T,videoPreference:E}=v,D=this.audioTracksByGroup||=ut(g),O=-1;if(x){if(this.firstSelection!==-1)return this.firstSelection;let r=ct(this.codecTiers||=dt(h,D,t,n),C,e,T,E),{codecSet:i,videoRanges:o,minFramerate:c,minBitrate:l,minIndex:u,preferHDR:d}=r;O=u,S=i,C=d?o[o.length-1]:o[0],w=c,e=Math.max(e,l),this.log(`picked start tier ${is(r)}`)}else S=y?.codecSet,C=y?.videoRange;let k=m?m.duration:p?p.duration:0,A=this.bwEstimator.getEstimateTTFB()/1e3,j=[];for(let l=n;l>=t;l--){var M;let t=h[l],p=l>f;if(!t)continue;if(v.useMediaCapabilities&&!t.supportedResult&&!t.supportedPromise){let n=navigator.mediaCapabilities;typeof n?.decodingInfo==`function`&&Xe(t,D,C,w,e,T)?(t.supportedPromise=Y(t,D,n,this.supportedCache),t.supportedPromise.then(e=>{if(!this.hls)return;t.supportedResult=e;let n=this.hls.levels,r=n.indexOf(t);e.error?this.warn(`MediaCapabilities decodingInfo error: "${e.error}" for level ${r} ${is(e)}`):e.supported?e.decodingInfoResults.some(e=>e.smooth===!1||e.powerEfficient===!1)&&this.log(`MediaCapabilities decodingInfo for level ${r} not smooth or powerEfficient: ${is(e)}`):(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${r} ${is(e)}`),r>-1&&n.length>1&&(this.log(`Removing unsupported level ${r}`),this.hls.removeLevel(r),this.hls.loadLevel===-1&&(this.hls.nextLoadLevel=0)))}).catch(e=>{this.warn(`Error handling MediaCapabilities decodingInfo: ${e}`)})):t.supportedResult=Zo}if((S&&t.codecSet!==S||C&&t.videoRange!==C||p&&w>t.frameRate||!p&&w>0&&w<t.frameRate||(M=t.supportedResult)!=null&&(M=M.decodingInfoResults)!=null&&M.some(e=>e.smooth===!1))&&(!x||l!==O)){j.push(l);continue}let g=t.details,y=(m?g?.partTarget:g?.averagetargetduration)||k,E;E=p?c*e:o*e;let N=k&&r>=k*2&&i===0?t.averageBitrate:t.maxBitrate,P=this.getTimeToLoadFrag(A,E,N*y,g===void 0);if(E>=N&&(l===d||t.loadError===0&&t.fragmentError===0)&&(P<=A||!X(P)||b&&!this.bitrateTestDelay||P<u)){let e=this.forcedAutoLevel;return l!==_&&(e===-1||e!==_)&&(j.length&&this.trace(`Skipped level(s) ${j.join(`,`)} of ${n} max with CODECS and VIDEO-RANGE:"${h[j[0]].codecs}" ${h[j[0]].videoRange}; not compatible with "${S}" ${C}`),this.info(`switch candidate:${f}->${l} adjustedbw(${Math.round(E)})-bitrate=${Math.round(E-N)} ttfb:${A.toFixed(1)} avgDuration:${y.toFixed(1)} maxFetchDuration:${u.toFixed(1)} fetchDuration:${P.toFixed(1)} firstSelection:${x} codecSet:${t.codecSet} videoRange:${t.videoRange} hls.loadLevel:${_}`)),x&&(this.firstSelection=l),l}}return-1}set nextAutoLevel(e){let t=this.deriveNextAutoLevel(e);this._nextAutoLevel!==t&&(this.nextAutoLevelKey=``,this._nextAutoLevel=t)}deriveNextAutoLevel(e){let{maxAutoLevel:t,minAutoLevel:n}=this.hls;return Math.min(Math.max(e,n),t)}},os={search:function(e,t){let n=0,r=e.length-1,i=null,o=null;for(;n<=r;){i=(n+r)/2|0,o=e[i];let c=t(o);if(c>0)n=i+1;else if(c<0)r=i-1;else return o}return null}},ss={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},cs={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,MoveAllAlternatesMatchingKey:4,SwitchToSDR:8},ls=class extends ko{constructor(e){super(`error-controller`,e.logger),this.hls=void 0,this.playlistError=0,this.hls=e,this.registerListeners()}registerListeners(){let e=this.hls;e.on(Q.ERROR,this.onError,this),e.on(Q.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Q.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){let e=this.hls;e&&(e.off(Q.ERROR,this.onError,this),e.off(Q.ERROR,this.onErrorOut,this),e.off(Q.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Q.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return e?.type===Eo.MAIN?e.level:this.getVariantIndex()}getVariantIndex(){var e;let t=this.hls,n=t.currentLevel;return(e=t.loadLevelObj)!=null&&e.details||n===-1?t.loadLevel:n}variantHasKey(e,t){if(e){var n;if((n=e.details)!=null&&n.hasKey(t))return!0;let r=e.audioGroups;if(r)return this.hls.allAudioTracks.filter(e=>r.indexOf(e.groupId)>=0).some(e=>e.details?.hasKey(t))}return!1}onManifestLoading(){this.playlistError=0}onLevelUpdated(){this.playlistError=0}onError(e,t){var n;if(t.fatal)return;let r=this.hls,i=t.context;switch(t.details){case Z.FRAG_LOAD_ERROR:case Z.FRAG_LOAD_TIMEOUT:case Z.KEY_LOAD_ERROR:case Z.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case Z.FRAG_PARSING_ERROR:if((n=t.frag)!=null&&n.gap){t.errorAction=It();return}case Z.FRAG_GAP:case Z.FRAG_DECRYPT_ERROR:t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=ss.SendAlternateToPenaltyBox;return;case Z.LEVEL_EMPTY_ERROR:case Z.LEVEL_PARSING_ERROR:{var o;let e=t.parent===Eo.MAIN?t.level:r.loadLevel;t.details===Z.LEVEL_EMPTY_ERROR&&(o=t.context)!=null&&(o=o.levelDetails)!=null&&o.live?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,e):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,e))}return;case Z.LEVEL_LOAD_ERROR:case Z.LEVEL_LOAD_TIMEOUT:typeof i?.level==`number`&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i.level));return;case Z.AUDIO_TRACK_LOAD_ERROR:case Z.AUDIO_TRACK_LOAD_TIMEOUT:case Z.SUBTITLE_LOAD_ERROR:case Z.SUBTITLE_TRACK_LOAD_TIMEOUT:if(i){let e=r.loadLevelObj;if(e&&(i.type===To.AUDIO_TRACK&&e.hasAudioGroup(i.groupId)||i.type===To.SUBTITLE_TRACK&&e.hasSubtitleGroup(i.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.loadLevel),t.errorAction.action=ss.SendAlternateToPenaltyBox,t.errorAction.flags=cs.MoveAllAlternatesMatchingHost;return}}return;case Z.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:t.errorAction={action:ss.SendAlternateToPenaltyBox,flags:cs.MoveAllAlternatesMatchingHDCP};return;case Z.KEY_SYSTEM_SESSION_UPDATE_FAILED:case Z.KEY_SYSTEM_STATUS_INTERNAL_ERROR:case Z.KEY_SYSTEM_NO_SESSION:t.errorAction={action:ss.SendAlternateToPenaltyBox,flags:cs.MoveAllAlternatesMatchingKey};return;case Z.BUFFER_ADD_CODEC_ERROR:case Z.REMUX_ALLOC_ERROR:case Z.BUFFER_APPEND_ERROR:t.errorAction||=this.getLevelSwitchAction(t,t.level??r.loadLevel);return;case Z.INTERNAL_EXCEPTION:case Z.BUFFER_APPENDING_ERROR:case Z.BUFFER_FULL_ERROR:case Z.LEVEL_SWITCH_ERROR:case Z.BUFFER_STALLED_ERROR:case Z.BUFFER_SEEK_OVER_HOLE:case Z.BUFFER_NUDGE_ON_STALL:t.errorAction=It();return}t.type===wo.KEY_SYSTEM_ERROR&&(t.levelRetry=!1,t.errorAction=It())}getPlaylistRetryOrSwitchAction(e,t){let n=this.hls,r=At(n.config.playlistLoadPolicy,e),i=this.playlistError++;if(Nt(r,i,Dt(e),e.response))return{action:ss.RetryRequest,flags:cs.None,retryConfig:r,retryCount:i};let o=this.getLevelSwitchAction(e,t);return r&&(o.retryConfig=r,o.retryCount=i),o}getFragRetryOrSwitchAction(e){let t=this.hls,n=this.getVariantLevelIndex(e.frag),r=t.levels[n],{fragLoadPolicy:i,keyLoadPolicy:o}=t.config,c=At(Ot(e)?o:i,e),l=t.levels.reduce((e,t)=>e+t.fragmentError,0);if(r&&(e.details!==Z.FRAG_GAP&&r.fragmentError++,!kt(e)&&Nt(c,l,Dt(e),e.response)))return{action:ss.RetryRequest,flags:cs.None,retryConfig:c,retryCount:l};let u=this.getLevelSwitchAction(e,n);return c&&(u.retryConfig=c,u.retryCount=l),u}getLevelSwitchAction(e,t){let n=this.hls;t??=n.loadLevel;let r=this.hls.levels[t];if(r){let t=e.details;r.loadError++,t===Z.BUFFER_APPEND_ERROR&&r.fragmentError++;let c=-1,{levels:l,loadLevel:u,minAutoLevel:d,maxAutoLevel:f}=n;!n.autoLevelEnabled&&!n.config.preserveManualLevelOnError&&(n.loadLevel=-1);let p=e.frag?.type,m=(p===Eo.AUDIO&&t===Z.FRAG_PARSING_ERROR||e.sourceBufferName===`audio`&&(t===Z.BUFFER_ADD_CODEC_ERROR||t===Z.BUFFER_APPEND_ERROR))&&l.some(({audioCodec:e})=>r.audioCodec!==e),h=e.sourceBufferName===`video`&&(t===Z.BUFFER_ADD_CODEC_ERROR||t===Z.BUFFER_APPEND_ERROR)&&l.some(({codecSet:e,audioCodec:t})=>r.codecSet!==e&&r.audioCodec===t),{type:g,groupId:_}=e.context??{};for(let n=l.length;n--;){let v=(n+u)%l.length;if(v!==u&&v>=d&&v<=f&&l[v].loadError===0){var i,o;let n=l[v];if(t===Z.FRAG_GAP&&p===Eo.MAIN&&e.frag){let t=l[v].details;if(t){let n=St(e.frag,t.fragments,e.frag.start);if(n!=null&&n.gap)continue}}else if(g===To.AUDIO_TRACK&&n.hasAudioGroup(_)||g===To.SUBTITLE_TRACK&&n.hasSubtitleGroup(_))continue;else if(p===Eo.AUDIO&&(i=r.audioGroups)!=null&&i.some(e=>n.hasAudioGroup(e))||p===Eo.SUBTITLE&&(o=r.subtitleGroups)!=null&&o.some(e=>n.hasSubtitleGroup(e))||m&&r.audioCodec===n.audioCodec||h&&r.codecSet===n.codecSet||!m&&r.codecSet!==n.codecSet)continue;c=v;break}}if(c>-1&&n.loadLevel!==c)return e.levelRetry=!0,this.playlistError=0,{action:ss.SendAlternateToPenaltyBox,flags:cs.None,nextAutoLevel:c}}return{action:ss.SendAlternateToPenaltyBox,flags:cs.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){switch(t.errorAction?.action){case ss.DoNothing:break;case ss.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==Z.FRAG_GAP?t.fatal=!0:/MediaSource readyState: ended/.test(t.error.message)&&(this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break;case ss.RetryRequest:break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){let t=this.hls,n=e.errorAction;if(!n)return;let{flags:r}=n,i=n.nextAutoLevel;switch(r){case cs.None:this.switchLevel(e,i);break;case cs.MoveAllAlternatesMatchingHDCP:{let r=this.getVariantLevelIndex(e.frag),i=t.levels[r]?.attrs[`HDCP-LEVEL`];if(n.hdcpLevel=i,i===`NONE`)this.warn(`HDCP policy resticted output with HDCP-LEVEL=NONE`);else if(i){t.maxHdcpLevel=Qo[Qo.indexOf(i)-1],n.resolved=!0,this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}}case cs.MoveAllAlternatesMatchingKey:{let t=e.decryptdata;if(t){let r=this.hls.levels,i=r.length;for(let n=i;n--;)this.variantHasKey(r[n],t)&&(this.log(`Banned key found in level ${n} (${r[n].bitrate}bps) or audio group "${r[n].audioGroups?.join(`,`)}" (${e.frag?.type} fragment) ${W(t.keyId||[])}`),r[n].fragmentError++,r[n].loadError++,this.log(`Removing level ${n} with key error (${e.error})`),this.hls.removeLevel(n));let o=e.frag;if(this.hls.levels.length<i)n.resolved=!0;else if(o&&o.type!==Eo.MAIN){let e=o.decryptdata;e&&!t.matches(e)&&(n.resolved=!0)}}break}}n.resolved||this.switchLevel(e,i)}switchLevel(e,t){if(t!==void 0&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel,e.details===Z.BUFFER_ADD_CODEC_ERROR&&e.mimeType&&e.sourceBufferName!==`audiovideo`)){let t=Je(e.mimeType),n=this.hls.levels;for(let r=n.length;r--;)n[r][`${e.sourceBufferName}Codec`]===t&&(this.log(`Removing level ${r} for ${e.details} ("${t}" not supported)`),this.hls.removeLevel(r))}}},us={NOT_LOADED:`NOT_LOADED`,APPENDING:`APPENDING`,PARTIAL:`PARTIAL`,OK:`OK`},ds=class{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){let{hls:e}=this;e&&(e.on(Q.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Q.BUFFER_APPENDED,this.onBufferAppended,this),e.on(Q.FRAG_BUFFERED,this.onFragBuffered,this),e.on(Q.FRAG_LOADED,this.onFragLoaded,this))}_unregisterListeners(){let{hls:e}=this;e&&(e.off(Q.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Q.BUFFER_APPENDED,this.onBufferAppended,this),e.off(Q.FRAG_BUFFERED,this.onFragBuffered,this),e.off(Q.FRAG_LOADED,this.onFragLoaded,this))}destroy(){this._unregisterListeners(),this.hls=this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){let n=this.activePartLists[t];if(n)for(let t=n.length;t--;){let r=n[t];if(!r)break;if(r.start<=e&&e<=r.end&&r.loaded)return r}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){return this.getFragAtPos(e,t,!0)}getFragAtPos(e,t,n){let{fragments:r}=this,i=Object.keys(r);for(let o=i.length;o--;){let c=r[i[o]];if(c?.body.type===t&&(!n||c.buffered)){let t=c.body;if(t.start<=e&&e<=t.end)return t}}return null}detectEvictedFragments(e,t,n,r,i){this.timeRanges&&(this.timeRanges[e]=t);let o=r?.fragment.sn||-1;Object.keys(this.fragments).forEach(r=>{let c=this.fragments[r];if(!c||o>=c.body.sn)return;if(!c.buffered&&(!c.loaded||i)){c.body.type===n&&this.removeFragment(c.body);return}let l=c.range[e];if(l){if(l.time.length===0){this.removeFragment(c.body);return}l.time.some(e=>{let n=!this.isTimeBuffered(e.startPTS,e.endPTS,t);return n&&this.removeFragment(c.body),n})}})}detectPartialFragments(e){let t=this.timeRanges;if(!t||e.frag.sn===`initSegment`)return;let n=e.frag,r=Rt(n),i=this.fragments[r];if(!i||i.buffered&&n.gap)return;let o=!n.relurl;Object.keys(t).forEach(r=>{let c=n.elementaryStreams[r];if(!c)return;let l=t[r],u=o||c.partial===!0;i.range[r]=this.getBufferedTimes(n,e.part,u,l)}),i.loaded=null,Object.keys(i.range).length?(this.bufferedEnd(i,n),Lt(i)||this.removeParts(n.sn-1,n.type)):this.removeFragment(i.body)}bufferedEnd(e,t){e.buffered=!0,(e.body.endList=t.endList||e.body.endList)&&(this.endListFragments[e.body.type]=e)}removeParts(e,t){let n=this.activePartLists[t];n&&(this.activePartLists[t]=zt(n,t=>t.fragment.sn>=e))}fragBuffered(e,t){let n=Rt(e),r=this.fragments[n];!r&&t&&(r=this.fragments[n]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),r&&(r.loaded=null,this.bufferedEnd(r,e))}getBufferedTimes(e,t,n,r){let i={time:[],partial:n},o=e.start,c=e.end,l=e.minEndPTS||c,u=e.maxStartPTS||o;for(let e=0;e<r.length;e++){let t=r.start(e)-this.bufferPadding,n=r.end(e)+this.bufferPadding;if(u>=t&&l<=n){i.time.push({startPTS:Math.max(o,r.start(e)),endPTS:Math.min(c,r.end(e))});break}else if(o<n&&c>t){let t=Math.max(o,r.start(e)),n=Math.min(c,r.end(e));n>t&&(i.partial=!0,i.time.push({startPTS:t,endPTS:n}))}else if(c<=t)break}return i}getPartialFragment(e){let t=null,n,r,i,o=0,{bufferPadding:c,fragments:l}=this;return Object.keys(l).forEach(u=>{let d=l[u];d&&Lt(d)&&(r=d.body.start-c,i=d.body.end+c,e>=r&&e<=i&&(n=Math.min(e-r,i-e),o<=n&&(t=d.body,o=n)))}),t}isEndListAppended(e){let t=this.endListFragments[e];return t!==void 0&&(t.buffered||Lt(t))}getState(e){let t=Rt(e),n=this.fragments[t];return n?n.buffered?Lt(n)?us.PARTIAL:us.OK:us.APPENDING:us.NOT_LOADED}isTimeBuffered(e,t,n){let r,i;for(let o=0;o<n.length;o++){if(r=n.start(o)-this.bufferPadding,i=n.end(o)+this.bufferPadding,e>=r&&t<=i)return!0;if(t<=r)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(e,t){if(t.frag.sn===`initSegment`||t.frag.bitrateTest)return;let n=t.frag,r=t.part?null:t,i=Rt(n);this.fragments[i]={body:n,appendedPTS:null,loaded:r,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){let{frag:n,part:r,timeRanges:i,type:o}=t;if(n.sn===`initSegment`)return;let c=n.type;if(r){let e=this.activePartLists[c];e||(this.activePartLists[c]=e=[]),e.push(r)}this.timeRanges=i;let l=i[o];this.detectEvictedFragments(o,l,c,r)}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){let t=Rt(e);return!!this.fragments[t]}hasFragments(e){let{fragments:t}=this,n=Object.keys(t);if(!e)return n.length>0;for(let r=n.length;r--;)if(t[n[r]]?.body.type===e)return!0;return!1}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,n,r,i){r&&!this.hasGaps||Object.keys(this.fragments).forEach(o=>{let c=this.fragments[o];if(!c)return;let l=c.body;l.type!==n||r&&!l.gap||l.start<t&&l.end>e&&(c.buffered||i)&&this.removeFragment(l)})}removeFragment(e){let t=Rt(e);e.clearElementaryStreamInfo();let n=this.activePartLists[e.type];if(n){let t=e.sn;this.activePartLists[e.type]=zt(n,e=>e.fragment.sn!==t)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){var e;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;let t=(e=this.hls)==null||(e=e.latestLevelDetails)==null?void 0:e.partList;t&&t.forEach(e=>e.clearElementaryStreamInfo())}},fs={cbc:0,ctr:1},ps=class{constructor(e,t,n){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=e,this.aesIV=t,this.aesMode=n}decrypt(e,t){switch(this.aesMode){case fs.cbc:return this.subtle.decrypt({name:`AES-CBC`,iv:this.aesIV},t,e);case fs.ctr:return this.subtle.decrypt({name:`AES-CTR`,counter:this.aesIV,length:64},t,e);default:throw Error(`[AESCrypto] invalid aes mode ${this.aesMode}`)}}},ms=class{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array,this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){let t=new DataView(e),n=new Uint32Array(4);for(let e=0;e<4;e++)n[e]=t.getUint32(e*4);return n}initTable(){let e=this.sBox,t=this.invSBox,n=this.subMix,r=n[0],i=n[1],o=n[2],c=n[3],l=this.invSubMix,u=l[0],d=l[1],f=l[2],p=l[3],m=new Uint32Array(256),h=0,g=0,_=0;for(_=0;_<256;_++)_<128?m[_]=_<<1:m[_]=_<<1^283;for(_=0;_<256;_++){let n=g^g<<1^g<<2^g<<3^g<<4;n=n>>>8^n&255^99,e[h]=n,t[n]=h;let l=m[h],_=m[l],v=m[_],y=m[n]*257^n*16843008;r[h]=y<<24|y>>>8,i[h]=y<<16|y>>>16,o[h]=y<<8|y>>>24,c[h]=y,y=v*16843009^_*65537^l*257^h*16843008,u[n]=y<<24|y>>>8,d[n]=y<<16|y>>>16,f[n]=y<<8|y>>>24,p[n]=y,h?(h=l^m[m[m[v^l]]],g^=m[m[g]]):h=g=1}}expandKey(e){let t=this.uint8ArrayToUint32Array_(e),n=!0,r=0;for(;r<t.length&&n;)n=t[r]===this.key[r],r++;if(n)return;this.key=t;let i=this.keySize=t.length;if(i!==4&&i!==6&&i!==8)throw Error(`Invalid aes key size=`+i);let o=this.ksRows=(i+6+1)*4,c,l,u=this.keySchedule=new Uint32Array(o),d=this.invKeySchedule=new Uint32Array(o),f=this.sBox,p=this.rcon,m=this.invSubMix,h=m[0],g=m[1],_=m[2],v=m[3],y,b;for(c=0;c<o;c++){if(c<i){y=u[c]=t[c];continue}b=y,c%i===0?(b=b<<8|b>>>24,b=f[b>>>24]<<24|f[b>>>16&255]<<16|f[b>>>8&255]<<8|f[b&255],b^=p[c/i|0]<<24):i>6&&c%i===4&&(b=f[b>>>24]<<24|f[b>>>16&255]<<16|f[b>>>8&255]<<8|f[b&255]),u[c]=y=(u[c-i]^b)>>>0}for(l=0;l<o;l++)c=o-l,b=l&3?u[c]:u[c-4],l<4||c<=4?d[l]=b:d[l]=h[f[b>>>24]]^g[f[b>>>16&255]]^_[f[b>>>8&255]]^v[f[b&255]],d[l]=d[l]>>>0}networkToHostOrderSwap(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24}decrypt(e,t,n){let r=this.keySize+6,i=this.invKeySchedule,o=this.invSBox,c=this.invSubMix,l=c[0],u=c[1],d=c[2],f=c[3],p=this.uint8ArrayToUint32Array_(n),m=p[0],h=p[1],g=p[2],_=p[3],v=new Int32Array(e),y=new Int32Array(v.length),b,x,S,C,w,T,E,D,O,k,A,j,M,N,P=this.networkToHostOrderSwap;for(;t<v.length;){for(O=P(v[t]),k=P(v[t+1]),A=P(v[t+2]),j=P(v[t+3]),w=O^i[0],T=j^i[1],E=A^i[2],D=k^i[3],M=4,N=1;N<r;N++)b=l[w>>>24]^u[T>>16&255]^d[E>>8&255]^f[D&255]^i[M],x=l[T>>>24]^u[E>>16&255]^d[D>>8&255]^f[w&255]^i[M+1],S=l[E>>>24]^u[D>>16&255]^d[w>>8&255]^f[T&255]^i[M+2],C=l[D>>>24]^u[w>>16&255]^d[T>>8&255]^f[E&255]^i[M+3],w=b,T=x,E=S,D=C,M+=4;b=o[w>>>24]<<24^o[T>>16&255]<<16^o[E>>8&255]<<8^o[D&255]^i[M],x=o[T>>>24]<<24^o[E>>16&255]<<16^o[D>>8&255]<<8^o[w&255]^i[M+1],S=o[E>>>24]<<24^o[D>>16&255]<<16^o[w>>8&255]<<8^o[T&255]^i[M+2],C=o[D>>>24]<<24^o[w>>16&255]<<16^o[T>>8&255]<<8^o[E&255]^i[M+3],y[t]=P(b^m),y[t+1]=P(C^h),y[t+2]=P(S^g),y[t+3]=P(x^_),m=O,h=k,g=A,_=j,t+=4}return y.buffer}},hs=class{constructor(e,t,n){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=e,this.key=t,this.aesMode=n}expandKey(){let e=Vt(this.aesMode);return this.subtle.importKey(`raw`,this.key,{name:e},!1,[`encrypt`,`decrypt`])}},gs=16,_s=class{constructor(e,{removePKCS7Padding:t=!0}={}){if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.enableSoftwareAES=void 0,this.enableSoftwareAES=e.enableSoftwareAES,this.removePKCS7Padding=t,t)try{let e=self.crypto;e&&(this.subtle=e.subtle||e.webkitSubtle)}catch{}this.useSoftware=!this.subtle}destroy(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}isSync(){return this.useSoftware}flush(){let{currentResult:e,remainderData:t}=this;if(!e||t)return this.reset(),null;let n=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?Bt(n):n}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&=null}decrypt(e,t,n,r){return this.useSoftware?new Promise((i,o)=>{let c=ArrayBuffer.isView(e)?e:new Uint8Array(e);this.softwareDecrypt(c,t,n,r);let l=this.flush();l?i(l.buffer):o(Error(`[softwareDecrypt] Failed to decrypt data`))}):this.webCryptoDecrypt(new Uint8Array(e),t,n,r)}softwareDecrypt(e,t,n,r){let{currentIV:i,currentResult:o,remainderData:c}=this;if(r!==fs.cbc||t.byteLength!==16)return No.warn(`SoftwareDecrypt: can only handle AES-128-CBC`),null;this.logOnce(`JS AES decrypt`),c&&(e=Ce(c,e),this.remainderData=null);let l=this.getValidChunk(e);if(!l.length)return null;i&&(n=i);let u=this.softwareDecrypter;u||=this.softwareDecrypter=new ms,u.expandKey(t);let d=o;return this.currentResult=u.decrypt(l.buffer,0,n),this.currentIV=l.slice(-16).buffer,d||null}webCryptoDecrypt(e,t,n,r){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,n,r));this.key=t,this.fastAesKey=new hs(this.subtle,t,r)}return this.fastAesKey.expandKey().then(t=>this.subtle?(this.logOnce(`WebCrypto AES decrypt`),new ps(this.subtle,new Uint8Array(n),r).decrypt(e.buffer,t)):Promise.reject(Error(`web crypto not initialized`))).catch(i=>(No.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${i.name}: ${i.message}`),this.onWebCryptoError(e,t,n,r)))}onWebCryptoError(e,t,n,r){let i=this.enableSoftwareAES;if(i){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,n,r);let i=this.flush();if(i)return i.buffer}throw Error(`WebCrypto`+(i?` and softwareDecrypt`:``)+`: failed to decrypt data`)}getValidChunk(e){let t=e,n=e.length-e.length%gs;return n!==e.length&&(t=e.slice(0,n),this.remainderData=e.slice(n)),t}logOnce(e){this.logEnabled&&=(No.log(`[decrypter]: ${e}`),!1)}},vs=2**17,ys=class{constructor(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}destroy(){this.loader&&=(this.loader.destroy(),null)}abort(){this.loader&&this.loader.abort()}load(e,t){let n=e.url;if(!n)return Promise.reject(new bs({type:wo.NETWORK_ERROR,details:Z.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:Error(`Fragment does not have a ${n?`part list`:`url`}`),networkDetails:null}));this.abort();let r=this.config,i=r.fLoader,o=r.loader;return new Promise((c,l)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(e=>e[0]===`GAP`)){l(Ut(e));return}else e.gap=!1;let u=this.loader=i?new i(r):new o(r),d=Ht(e);e.loader=u;let f=Mt(r.fragLoadPolicy.default),p={loadPolicy:f,timeout:f.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn===`initSegment`?1/0:vs};e.stats=u.stats;let m={onSuccess:(t,n,r,i)=>{this.resetLoader(e,u);let o=t.data;r.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(o.slice(0,16)),o=o.slice(16)),c({frag:e,part:null,payload:o,networkDetails:i})},onError:(t,r,i,o)=>{this.resetLoader(e,u),l(new bs({type:wo.NETWORK_ERROR,details:Z.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:N({url:n,data:void 0},t),error:Error(`HTTP Error ${t.code} ${t.text}`),networkDetails:i,stats:o}))},onAbort:(t,n,r)=>{this.resetLoader(e,u),l(new bs({type:wo.NETWORK_ERROR,details:Z.INTERNAL_ABORTED,fatal:!1,frag:e,error:Error(`Aborted`),networkDetails:r,stats:t}))},onTimeout:(t,n,r)=>{this.resetLoader(e,u),l(new bs({type:wo.NETWORK_ERROR,details:Z.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:Error(`Timeout after ${p.timeout}ms`),networkDetails:r,stats:t}))}};t&&(m.onProgress=(n,r,i,o)=>t({frag:e,part:null,payload:i,networkDetails:o})),u.load(d,p,m)})}loadPart(e,t,n){this.abort();let r=this.config,i=r.fLoader,o=r.loader;return new Promise((c,l)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){l(Ut(e,t));return}let u=this.loader=i?new i(r):new o(r),d=Ht(e,t);e.loader=u;let f=Mt(r.fragLoadPolicy.default),p={loadPolicy:f,timeout:f.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:vs};t.stats=u.stats,u.load(d,p,{onSuccess:(r,i,o,l)=>{this.resetLoader(e,u),this.updateStatsFromPart(e,t);let d={frag:e,part:t,payload:r.data,networkDetails:l};n(d),c(d)},onError:(n,r,i,o)=>{this.resetLoader(e,u),l(new bs({type:wo.NETWORK_ERROR,details:Z.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:N({url:d.url,data:void 0},n),error:Error(`HTTP Error ${n.code} ${n.text}`),networkDetails:i,stats:o}))},onAbort:(n,r,i)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,u),l(new bs({type:wo.NETWORK_ERROR,details:Z.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:Error(`Aborted`),networkDetails:i,stats:n}))},onTimeout:(n,r,i)=>{this.resetLoader(e,u),l(new bs({type:wo.NETWORK_ERROR,details:Z.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:Error(`Timeout after ${p.timeout}ms`),networkDetails:i,stats:n}))}})})}updateStatsFromPart(e,t){let n=e.stats,r=t.stats,i=r.total;if(n.loaded+=r.loaded,i){let r=Math.round(e.duration/t.duration),o=Math.min(Math.round(n.loaded/i),r),c=(r-o)*Math.round(n.loaded/o);n.total=n.loaded+c}else n.total=Math.max(n.loaded,n.total);let o=n.loading,c=r.loading;o.start?o.first+=c.first-c.start:(o.start=c.start,o.first=c.first),o.end=c.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}},bs=class extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}},xs=class extends ko{constructor(e,t){super(e,t),this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}},Ss=class{constructor(e,t,n,r=0,i=-1,o=!1){this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=Gt(),this.buffering={audio:Gt(),video:Gt(),audiovideo:Gt()},this.level=e,this.sn=t,this.id=n,this.size=r,this.part=i,this.partial=o}},Cs={length:0,start:()=>0,end:()=>0},ws=class e{static isBuffered(t,n){if(t){let r=e.getBuffered(t);for(let e=r.length;e--;)if(n>=r.start(e)&&n<=r.end(e))return!0}return!1}static bufferedRanges(t){if(t){let n=e.getBuffered(t);return e.timeRangesToArray(n)}return[]}static timeRangesToArray(e){let t=[];for(let n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}static bufferInfo(t,n,r){if(t){let i=e.bufferedRanges(t);if(i.length)return e.bufferedInfo(i,n,r)}return{len:0,start:n,end:n,bufferedIndex:-1}}static bufferedInfo(e,t,n){t=Math.max(0,t),e.length>1&&e.sort((e,t)=>e.start-t.start||t.end-e.end);let r=-1,i=[];if(n)for(let o=0;o<e.length;o++){t>=e[o].start&&t<=e[o].end&&(r=o);let c=i.length;if(c){let t=i[c-1].end;e[o].start-t<n?e[o].end>t&&(i[c-1].end=e[o].end):i.push(e[o])}else i.push(e[o])}else i=e;let o=0,c,l=t,u=t;for(let e=0;e<i.length;e++){let d=i[e].start,f=i[e].end;if(r===-1&&t>=d&&t<=f&&(r=e),t+n>=d&&t<f)l=d,u=f,o=u-t;else if(t+n<d){c=d;break}}return{len:o,start:l||0,end:u||0,nextStart:c,buffered:e,bufferedIndex:r}}static getBuffered(e){try{return e.buffered||Cs}catch(e){return No.log(`failed to get media.buffered`,e),Cs}}},Ts=/\{\$([a-zA-Z0-9-_]+)\}/g,Es=/^(\d+)x(\d+)$/,Ds=/(.+?)=(".*?"|.*?)(?:,|$)/g,Os=class e{constructor(t,n){typeof t==`string`&&(t=e.parseAttrList(t,n)),j(this,t)}get clientAttrs(){return Object.keys(this).filter(e=>e.substring(0,2)===`X-`)}decimalInteger(e){let t=parseInt(this[e],10);return t>2**53-1?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||`0x`).slice(2);t=(t.length&1?`0`:``)+t;let n=new Uint8Array(t.length/2);for(let e=0;e<t.length/2;e++)n[e]=parseInt(t.slice(e*2,e*2+2),16);return n}return null}hexadecimalIntegerAsNumber(e){let t=parseInt(this[e],16);return t>2**53-1?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){let n=this[e];return n?parseFloat(n):t}enumeratedString(e){return this[e]}enumeratedStringList(e,t){let n=this[e];return(n?n.split(/[ ,]+/):[]).reduce((e,t)=>(e[t.toLowerCase()]=!0,e),t)}bool(e){return this[e]===`YES`}decimalResolution(e){let t=Es.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e,t){let n,r={};for(Ds.lastIndex=0;(n=Ds.exec(e))!==null;){let i=n[1].trim(),o=n[2],c=o.indexOf(`"`)===0&&o.lastIndexOf(`"`)===o.length-1,l=!1;if(c)o=o.slice(1,-1);else switch(i){case`IV`:case`SCTE35-CMD`:case`SCTE35-IN`:case`SCTE35-OUT`:l=!0}if(t&&(c||l))o=qt(t,o);else if(!l&&!c)switch(i){case`CLOSED-CAPTIONS`:if(o===`NONE`)break;case`ALLOWED-CPC`:case`CLASS`:case`ASSOC-LANGUAGE`:case`AUDIO`:case`BYTERANGE`:case`CHANNELS`:case`CHARACTERISTICS`:case`CODECS`:case`DATA-ID`:case`END-DATE`:case`GROUP-ID`:case`ID`:case`IMPORT`:case`INSTREAM-ID`:case`KEYFORMAT`:case`KEYFORMATVERSIONS`:case`LANGUAGE`:case`NAME`:case`PATHWAY-ID`:case`QUERYPARAM`:case`RECENTLY-REMOVED-DATERANGES`:case`SERVER-URI`:case`STABLE-RENDITION-ID`:case`STABLE-VARIANT-ID`:case`START-DATE`:case`SUBTITLES`:case`SUPPLEMENTAL-CODECS`:case`URI`:case`VALUE`:case`VIDEO`:case`X-ASSET-LIST`:case`X-ASSET-URI`:No.warn(`${e}: attribute ${i} is missing quotes`)}r[i]=o}return r}},ks=`com.apple.hls.interstitial`,As=class{constructor(e,t,n=0){if(this.attr=void 0,this.tagAnchor=void 0,this.tagOrder=void 0,this._startDate=void 0,this._endDate=void 0,this._dateAtEnd=void 0,this._cue=void 0,this._badValueForSameId=void 0,this.tagAnchor=t?.tagAnchor||null,this.tagOrder=t?.tagOrder??n,t){let n=t.attr;for(let t in n)if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==n[t]){No.warn(`DATERANGE tag attribute: "${t}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=t;break}e=j(new Os({}),n,e)}if(this.attr=e,t?(this._startDate=t._startDate,this._cue=t._cue,this._endDate=t._endDate,this._dateAtEnd=t._dateAtEnd):this._startDate=new Date(e[`START-DATE`]),`END-DATE`in this.attr){let e=t?.endDate||new Date(this.attr[`END-DATE`]);X(e.getTime())&&(this._endDate=e)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get cue(){let e=this._cue;return e===void 0?this._cue=this.attr.enumeratedStringList(this.attr.CUE?`CUE`:`X-CUE`,{pre:!1,post:!1,once:!1}):e}get startTime(){let{tagAnchor:e}=this;return e===null||e.programDateTime===null?(No.warn(`Expected tagAnchor Fragment with PDT set for DateRange "${this.id}": ${e}`),NaN):e.start+(this.startDate.getTime()-e.programDateTime)/1e3}get startDate(){return this._startDate}get endDate(){let e=this._endDate||this._dateAtEnd;if(e)return e;let t=this.duration;return t===null?null:this._dateAtEnd=new Date(this._startDate.getTime()+t*1e3)}get duration(){if(`DURATION`in this.attr){let e=this.attr.decimalFloatingPoint(`DURATION`);if(X(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return`PLANNED-DURATION`in this.attr?this.attr.decimalFloatingPoint(`PLANNED-DURATION`):null}get endOnNext(){return this.attr.bool(`END-ON-NEXT`)}get isInterstitial(){return this.class===ks}get isValid(){return!!this.id&&!this._badValueForSameId&&X(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)&&(!this.attr.CUE||!this.cue.pre&&!this.cue.post||this.cue.pre!==this.cue.post)&&(!this.isInterstitial||`X-ASSET-URI`in this.attr||`X-ASSET-LIST`in this.attr)}},js=10,Ms=class{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.dateRangeTagCount=0,this.live=!0,this.requestScheduled=-1,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8=``,this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.appliedTimelineOffset=void 0,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e){this.advanced=!0,this.updated=!0;return}let t=this.lastPartSn-e.lastPartSn,n=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!n||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&n>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1}hasKey(e){return this.encryptedFragments.some(t=>{let n=t.decryptdata;return n||=(t.setKeyFormat(e.keyFormat),t.decryptdata),!!n&&e.matches(n)})}get hasProgramDateTime(){return this.fragments.length?X(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||js}get drift(){let e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){return this.fragments.length?this.fragments[this.fragments.length-1].end:0}get fragmentStart(){return this.fragments.length?this.fragments[0].start:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get maxPartIndex(){let e=this.partList;if(e){let t=this.lastPartIndex;if(t!==-1){for(let n=e.length;n--;)if(e[n].index>t)return e[n].index;return t}}return 0}get lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}get expired(){if(this.live&&this.age&&this.misses<3){let e=this.partEnd-this.fragmentStart;return this.age>Math.max(e,this.totalduration)+this.levelTargetDuration}return!1}},Ns=typeof self<`u`?self:void 0,Ps={CLEARKEY:`org.w3.clearkey`,FAIRPLAY:`com.apple.fps`,PLAYREADY:`com.microsoft.playready`,WIDEVINE:`com.widevine.alpha`},Fs={CLEARKEY:`org.w3.clearkey`,FAIRPLAY:`com.apple.streamingkeydelivery`,PLAYREADY:`com.microsoft.playready`,WIDEVINE:`urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed`},Is=function(e){return Ns!=null&&(e=Ns.navigator)!=null&&e.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}(),Ls={},Rs=class e{static clearKeyUriToKeyIdMap(){Ls={}}static setKeyIdForUri(e,t){Ls[e]=t}static addKeyIdForUri(e){let t=Object.keys(Ls).length%(2**53-1),n=new Uint8Array(16);return new DataView(n.buffer,12,4).setUint32(0,t),Ls[e]=n,n}constructor(e,t,n,r=[1],i=null,o){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=n,this.keyFormatVersions=r,this.iv=i,this.encrypted=e?e!==`NONE`:!1,this.isCommonEncryption=this.encrypted&&!en(e),o!=null&&o.startsWith(`0x`)&&(this.keyId=new Uint8Array(G(o)))}matches(e){return e.uri===this.uri&&e.method===this.method&&e.encrypted===this.encrypted&&e.keyFormat===this.keyFormat&&Qt(e.keyFormatVersions,this.keyFormatVersions)&&$t(e.iv,this.iv)&&$t(e.keyId,this.keyId)}isSupported(){if(this.method){if(en(this.method)||this.method===`NONE`)return!0;if(this.keyFormat===`identity`)return this.method===`SAMPLE-AES`;switch(this.keyFormat){case Fs.FAIRPLAY:case Fs.WIDEVINE:case Fs.PLAYREADY:case Fs.CLEARKEY:return[`SAMPLE-AES`,`SAMPLE-AES-CENC`,`SAMPLE-AES-CTR`].indexOf(this.method)!==-1}}return!1}getDecryptData(t,n){if(!this.encrypted||!this.uri)return null;if(en(this.method)){let n=this.iv;return n||=(typeof t!=`number`&&(No.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),t=0),_n(t)),new e(this.method,this.uri,`identity`,this.keyFormatVersions,n)}if(this.keyId){let t=Ls[this.uri];if(t&&!Qt(this.keyId,t)&&e.setKeyIdForUri(this.uri,this.keyId),this.pssh)return this}let r=sn(this.uri);if(r)switch(this.keyFormat){case Fs.WIDEVINE:if(this.pssh=r,!this.keyId){let e=Me(r.buffer);if(e.length){var i;let t=e[0];this.keyId=(i=t.kids)!=null&&i.length?t.kids[0]:null}}this.keyId||=gn(n);break;case Fs.PLAYREADY:this.pssh=je(new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]),null,r),this.keyId=mn(r);break;default:{let e=r.subarray(0,16);if(e.length!==16){let t=new Uint8Array(16);t.set(e,16-e.length),e=t}this.keyId=e;break}}if(!this.keyId||this.keyId.byteLength!==16){let t;t=hn(n),t||(t=gn(n),t||=Ls[this.uri]),t&&(this.keyId=t,e.setKeyIdForUri(this.uri,t))}return this}},zs=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,Bs=/#EXT-X-MEDIA:(.*)/g,Vs=/^#EXT(?:INF|-X-TARGETDURATION):/m,Hs=new RegExp([`#EXTINF:\\s*(\\d*(?:\\.\\d+)?)(?:,(.*)\\s+)?`,`(?!#) *(\\S[^\\r\\n]*)`,`#.*`].join(`|`),`g`),Us=new RegExp([`#EXT-X-(PROGRAM-DATE-TIME|BYTERANGE|DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)`,`#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\\d+)`,`#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)`,`(#)([^:]*):(.*)`,`(#)(.*)(?:.*)\\r?\\n?`].join(`|`)),Ws=class e{static findGroup(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(r.id===t)return r}}static resolve(e,t){return Io.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return Vs.test(e)}static parseMasterPlaylist(t,n){let r={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:Kt(t)},i=[];if(zs.lastIndex=0,!t.startsWith(`#EXTM3U`))return r.playlistParsingError=Error(`no EXTM3U delimiter`),r;let o;for(;(o=zs.exec(t))!=null;)if(o[1]){var c;let t=new Os(o[1],r),l=qt(r,o[2]),u={attrs:t,bitrate:t.decimalInteger(`BANDWIDTH`)||t.decimalInteger(`AVERAGE-BANDWIDTH`),name:t.NAME,url:e.resolve(l,n)},d=t.decimalResolution(`RESOLUTION`);d&&(u.width=d.width,u.height=d.height),Sn(t.CODECS,u);let f=t[`SUPPLEMENTAL-CODECS`];f&&(u.supplemental={},Sn(f,u.supplemental)),(c=u.unknownCodecs)!=null&&c.length||i.push(u),r.levels.push(u)}else if(o[3]){let t=o[3],i=o[4];switch(t){case`SESSION-DATA`:{let e=new Os(i,r),t=e[`DATA-ID`];t&&(r.sessionData===null&&(r.sessionData={}),r.sessionData[t]=e);break}case`SESSION-KEY`:{let e=bn(i,n,r);e.encrypted&&e.isSupported()?(r.sessionKeys===null&&(r.sessionKeys=[]),r.sessionKeys.push(e)):No.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${i}"`);break}case`DEFINE`:Jt(r,new Os(i,r),n);break;case`CONTENT-STEERING`:{let t=new Os(i,r);r.contentSteering={uri:e.resolve(t[`SERVER-URI`],n),pathwayId:t[`PATHWAY-ID`]||`.`};break}case`START`:r.startTimeOffset=xn(i);break}}return r.levels=i.length>0&&i.length<r.levels.length?i:r.levels,r.levels.length===0&&(r.playlistParsingError=Error(`no levels found in manifest`)),r}static parseMasterPlaylistMedia(t,n,r){let i,o={},c=r.levels,l={AUDIO:c.map(e=>({id:e.attrs.AUDIO,audioCodec:e.audioCodec})),SUBTITLES:c.map(e=>({id:e.attrs.SUBTITLES,textCodec:e.textCodec})),"CLOSED-CAPTIONS":[]},u=0;for(Bs.lastIndex=0;(i=Bs.exec(t))!==null;){let t=new Os(i[1],r),c=t.TYPE;if(c){let r=l[c],i=o[c]||[];o[c]=i;let d=t.LANGUAGE,f=t[`ASSOC-LANGUAGE`],p=t.CHANNELS,m=t.CHARACTERISTICS,h=t[`INSTREAM-ID`],g={attrs:t,bitrate:0,id:u++,groupId:t[`GROUP-ID`]||``,name:t.NAME||d||``,type:c,default:t.bool(`DEFAULT`),autoselect:t.bool(`AUTOSELECT`),forced:t.bool(`FORCED`),lang:d,url:t.URI?e.resolve(t.URI,n):``};if(f&&(g.assocLang=f),p&&(g.channels=p),m&&(g.characteristics=m),h&&(g.instreamId=h),r!=null&&r.length){let t=e.findGroup(r,g.groupId)||r[0];Cn(g,t,`audioCodec`),Cn(g,t,`textCodec`)}i.push(g)}}return o}static parseLevelPlaylist(e,t,n,r,i,o){let c={url:t},l=new Ms(t),u=l.fragments,d=[],f=null,p=0,m=0,h=0,g=0,_=0,v=null,y=new Bo(r,c),b,x,S,C=-1,w=!1,T=null,E;if(Hs.lastIndex=0,l.m3u8=e,l.hasVariableRefs=Kt(e),Hs.exec(e)?.[0]!==`#EXTM3U`)return l.playlistParsingError=Error(`Missing format identifier #EXTM3U`),l;for(;(b=Hs.exec(e))!==null;){w&&(w=!1,y=new Bo(r,c),y.playlistOffset=h,y.setStart(h),y.sn=p,y.cc=g,_&&(y.bitrate=_),y.level=n,f&&(y.initSegment=f,f.rawProgramDateTime&&(y.rawProgramDateTime=f.rawProgramDateTime,f.rawProgramDateTime=null),T&&=(y.setByteRange(T),null)));let e=b[1];if(e){y.duration=parseFloat(e);let t=(` `+b[2]).slice(1);y.title=t||null,y.tagList.push(t?[`INF`,e,t]:[`INF`,e])}else if(b[3]){if(X(y.duration)){y.playlistOffset=h,y.setStart(h),S&&Dn(y,S,l),y.sn=p,y.level=n,y.cc=g,u.push(y);let e=(` `+b[3]).slice(1);y.relurl=qt(l,e),Tn(y,v,d),v=y,h+=y.duration,p++,m=0,w=!0}}else{if(b=b[0].match(Us),!b){No.warn(`No matches on slow regex match for level playlist!`);continue}for(x=1;x<b.length&&b[x]===void 0;x++);let e=(` `+b[x]).slice(1),i=(` `+b[x+1]).slice(1),d=b[x+2]?(` `+b[x+2]).slice(1):null;switch(e){case`BYTERANGE`:v?y.setByteRange(i,v):y.setByteRange(i);break;case`PROGRAM-DATE-TIME`:y.rawProgramDateTime=i,y.tagList.push([`PROGRAM-DATE-TIME`,i]),C===-1&&(C=u.length);break;case`PLAYLIST-TYPE`:l.type&&On(l,e,b),l.type=i.toUpperCase();break;case`MEDIA-SEQUENCE`:l.startSN===0?u.length>0&&kn(l,e,b):On(l,e,b),p=l.startSN=parseInt(i);break;case`SKIP`:{l.skippedSegments&&On(l,e,b);let t=new Os(i,l),n=t.decimalInteger(`SKIPPED-SEGMENTS`);if(X(n)){l.skippedSegments+=n;for(let e=n;e--;)u.push(null);p+=n}let r=t.enumeratedString(`RECENTLY-REMOVED-DATERANGES`);r&&(l.recentlyRemovedDateranges=(l.recentlyRemovedDateranges||[]).concat(r.split(` `)));break}case`TARGETDURATION`:l.targetduration!==0&&On(l,e,b),l.targetduration=Math.max(parseInt(i),1);break;case`VERSION`:l.version!==null&&On(l,e,b),l.version=parseInt(i);break;case`INDEPENDENT-SEGMENTS`:break;case`ENDLIST`:l.live||On(l,e,b),l.live=!1;break;case`#`:(i||d)&&y.tagList.push(d?[i,d]:[i]);break;case`DISCONTINUITY`:g++,y.tagList.push([`DIS`]);break;case`GAP`:y.gap=!0,y.tagList.push([e]);break;case`BITRATE`:y.tagList.push([e,i]),_=parseInt(i)*1e3,X(_)?y.bitrate=_:_=0;break;case`DATERANGE`:{let e=new Os(i,l),t=new As(e,l.dateRanges[e.ID],l.dateRangeTagCount);l.dateRangeTagCount++,t.isValid||l.skippedSegments?l.dateRanges[t.id]=t:No.warn(`Ignoring invalid DATERANGE tag: "${i}"`),y.tagList.push([`EXT-X-DATERANGE`,i]);break}case`DEFINE`:{let e=new Os(i,l);`IMPORT`in e?Yt(l,e,o):Jt(l,e,t)}break;case`DISCONTINUITY-SEQUENCE`:l.startCC===0?u.length>0&&kn(l,e,b):On(l,e,b),l.startCC=g=parseInt(i);break;case`KEY`:{let e=bn(i,t,l);if(e.isSupported()){if(e.method===`NONE`){S=void 0;break}S||={};let t=S[e.keyFormat];t!=null&&t.matches(e)||(t&&(S=j({},S)),S[e.keyFormat]=e)}else No.warn(`[Keys] Ignoring unsupported EXT-X-KEY tag: "${i}"`);break}case`START`:l.startTimeOffset=xn(i);break;case`MAP`:{let e=new Os(i,l);if(y.duration){let t=new Bo(r,c);En(t,e,n,S),f=t,y.initSegment=f,f.rawProgramDateTime&&!y.rawProgramDateTime&&(y.rawProgramDateTime=f.rawProgramDateTime)}else{let t=y.byteRangeEndOffset;if(t){let e=y.byteRangeStartOffset;T=`${t-e}@${e}`}else T=null;En(y,e,n,S),f=y,w=!0}f.cc=g;break}case`SERVER-CONTROL`:E&&On(l,e,b),E=new Os(i),l.canBlockReload=E.bool(`CAN-BLOCK-RELOAD`),l.canSkipUntil=E.optionalFloat(`CAN-SKIP-UNTIL`,0),l.canSkipDateRanges=l.canSkipUntil>0&&E.bool(`CAN-SKIP-DATERANGES`),l.partHoldBack=E.optionalFloat(`PART-HOLD-BACK`,0),l.holdBack=E.optionalFloat(`HOLD-BACK`,0);break;case`PART-INF`:l.partTarget&&On(l,e,b),l.partTarget=new Os(i).decimalFloatingPoint(`PART-TARGET`);break;case`PART`:{let e=l.partList;e||=l.partList=[];let t=m>0?e[e.length-1]:void 0,n=m++,r=new Vo(new Os(i,l),y,c,n,t);e.push(r),y.duration+=r.duration;break}case`PRELOAD-HINT`:l.preloadHint=new Os(i,l);break;case`RENDITION-REPORT`:{let e=new Os(i,l);l.renditionReports=l.renditionReports||[],l.renditionReports.push(e);break}default:No.warn(`line parsed but not handled: ${b}`);break}}}v&&!v.relurl?(u.pop(),h-=v.duration,l.partList&&(l.fragmentHint=v)):l.partList&&(Tn(y,v,d),y.cc=g,l.fragmentHint=y,S&&Dn(y,S,l)),l.targetduration||(l.playlistParsingError=Error(`Missing Target Duration`));let D=u.length,O=u[0],k=u[D-1];if(h+=l.skippedSegments*l.targetduration,h>0&&D&&k){l.averagetargetduration=h/D;let e=k.sn;l.endSN=e===`initSegment`?0:e,l.live||(k.endList=!0),C>0&&(wn(u,C),O&&d.unshift(O))}return l.fragmentHint&&(h+=l.fragmentHint.duration),l.totalduration=h,d.length&&l.dateRangeTagCount&&O&&vn(d,l),l.endCC=g,l}},Gs={toString:function(e){let t=``,n=e.length;for(let r=0;r<n;r++)t+=`[${e.start(r).toFixed(3)}-${e.end(r).toFixed(3)}]`;return t}},$={STOPPED:`STOPPED`,IDLE:`IDLE`,KEY_LOADING:`KEY_LOADING`,FRAG_LOADING:`FRAG_LOADING`,FRAG_LOADING_WAITING_RETRY:`FRAG_LOADING_WAITING_RETRY`,WAITING_TRACK:`WAITING_TRACK`,PARSING:`PARSING`,PARSED:`PARSED`,ENDED:`ENDED`,ERROR:`ERROR`,WAITING_INIT_PTS:`WAITING_INIT_PTS`,WAITING_LEVEL:`WAITING_LEVEL`},Ks=class extends xs{constructor(e,t,n,r,i){super(r,e.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=$.STOPPED,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.buffering=!0,this.loadingParts=!1,this.loopSn=void 0,this.onMediaSeeking=()=>{let{config:e,fragCurrent:t,media:n,mediaBuffer:r,state:i}=this,o=n?n.currentTime:0,c=ws.bufferInfo(r||n,o,e.maxBufferHole),l=!c.len;if(this.log(`Media seeking to ${X(o)?o.toFixed(3):o}, state: ${i}, ${l?`out of`:`in`} buffer`),this.state===$.ENDED)this.resetLoadingState();else if(t){let n=e.maxFragLookUpTolerance,r=t.start-n,i=t.start+t.duration+n;if(l||i<c.start||r>c.end){let e=o>i;(o<r||e)&&(e&&t.loader&&(this.log(`Cancelling fragment load for seek (sn: ${t.sn})`),t.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(n&&(this.fragmentTracker.removeFragmentsInRange(o,1/0,this.playlistType,!0),o>this.lastCurrentTime&&(this.lastCurrentTime=o),!this.loadingParts)){let e=Math.max(c.end,o),t=this.shouldLoadParts(this.getLevelDetails(),e);t&&(this.log(`LL-Part loading ON after seeking to ${o.toFixed(2)} with buffer @${e.toFixed(2)}`),this.loadingParts=t)}this.hls.hasEnoughToStart||(this.log(`Setting ${l?`startPosition`:`nextLoadPosition`} to ${o} for seek without enough to start`),this.nextLoadPosition=o,l&&(this.startPosition=o)),l&&this.state===$.IDLE&&this.tickImmediate()},this.onMediaEnded=()=>{this.log(`setting startPosition to 0 because media ended`),this.startPosition=this.lastCurrentTime=0},this.playlistType=i,this.hls=e,this.fragmentLoader=new ys(e.config),this.keyLoader=n,this.fragmentTracker=t,this.config=e.config,this.decrypter=new _s(e.config)}registerListeners(){let{hls:e}=this;e.on(Q.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Q.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Q.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Q.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(Q.ERROR,this.onError,this)}unregisterListeners(){let{hls:e}=this;e.off(Q.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Q.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Q.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Q.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(Q.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){if(this.state===$.STOPPED)return;this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);let e=this.fragCurrent;e!=null&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=$.STOPPED}get startPositionValue(){let{nextLoadPosition:e,startPosition:t}=this;return t===-1&&e?e:t}get bufferingEnabled(){return this.buffering}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}get inFlightFrag(){return{frag:this.fragCurrent,state:this.state}}_streamEnded(e,t){if(t.live||!this.media)return!1;let n=e.end||0,r=this.config.timelineOffset||0;if(n<=r)return!1;let i=e.buffered;this.config.maxBufferHole&&i&&i.length>1&&(e=ws.bufferedInfo(i,e.start,0));let o=e.nextStart;if(o&&o>r&&o<t.edge||this.media.currentTime<e.start)return!1;let c=t.partList;if(c!=null&&c.length){let e=c[c.length-1];return ws.isBuffered(this.media,e.start+e.duration/2)}let l=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(l)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null)return this.levelLastLoaded.details}get timelineOffset(){let e=this.config.timelineOffset;return e?this.getLevelDetails()?.appliedTimelineOffset||e:0}onMediaAttached(e,t){let n=this.media=this.mediaBuffer=t.media;$n(n,`seeking`,this.onMediaSeeking),$n(n,`ended`,this.onMediaEnded);let r=this.config;this.levels&&r.autoStartLoad&&this.state===$.STOPPED&&this.startLoad(r.startPosition)}onMediaDetaching(e,t){let n=!!t.transferMedia,r=this.media;if(r!==null){if(r.ended&&(this.log(`MSE detaching and video ended, reset startPosition`),this.startPosition=this.lastCurrentTime=0),er(r,`seeking`,this.onMediaSeeking),er(r,`ended`,this.onMediaEnded),this.keyLoader&&!n&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,n){this.resetLoadingState(),this.resetTransmuxer();return}this.loadingParts=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}}onManifestLoading(){this.initPTS=[],this.levels=this.levelLastLoaded=this.fragCurrent=null,this.lastCurrentTime=this.startPosition=0,this.startFragRequested=!1}onError(e,t){}onManifestLoaded(e,t){this.startTimeOffset=t.startTimeOffset}onHandlerDestroying(){this.stopLoad(),this.transmuxer&&=(this.transmuxer.destroy(),null),super.onHandlerDestroying(),this.hls=this.onMediaSeeking=this.onMediaEnded=null}onHandlerDestroyed(){this.state=$.STOPPED,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,super.onHandlerDestroyed()}loadFragment(e,t,n){this.startFragRequested=!0,this._loadFragForPlayback(e,t,n)}_loadFragForPlayback(e,t,n){this._doFragLoad(e,t,n,e=>{let t=e.frag;if(this.fragContextChanged(t)){this.warn(`${t.type} sn: ${t.sn}${e.part?` part: `+e.part.index:``} of ${this.fragInfo(t,!1,e.part)}) was dropped during download.`),this.fragmentTracker.removeFragment(t);return}t.stats.chunkCount++,this._handleFragmentLoadProgress(e)}).then(e=>{if(!e)return;let t=this.state,n=e.frag;if(this.fragContextChanged(n)){(t===$.FRAG_LOADING||!this.fragCurrent&&t===$.PARSING)&&(this.fragmentTracker.removeFragment(n),this.state=$.IDLE);return}`payload`in e&&(this.log(`Loaded ${n.type} sn: ${n.sn} of ${this.playlistLabel()} ${n.level}`),this.hls.trigger(Q.FRAG_LOADED,e)),this._handleFragmentLoadComplete(e)}).catch(t=>{this.state===$.STOPPED||this.state===$.ERROR||(this.warn(`Frag error: ${t?.message||t}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){let{fragmentTracker:t}=this;if(t.getState(e)===us.APPENDING){let n=e.type,r=this.getFwdBufferInfo(this.mediaBuffer,n),i=Math.max(e.duration,r?r.len:this.config.maxBufferLength),o=this.backtrackFragment;((o?e.sn-o.sn:0)===1||this.reduceMaxBufferLength(i,e.duration))&&t.removeFragment(e)}else this.mediaBuffer?.buffered.length===0?t.removeAllFragments():t.hasParts(e.type)&&(t.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),t.getState(e)===us.PARTIAL&&t.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){let t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}waitForLive(e){let t=e.details;return t?.live&&t.type!==`EVENT`&&(this.levelLastLoaded!==e||t.expired)}flushMainBuffer(e,t,n=null){if(!(e-t))return;let r={startOffset:e,endOffset:t,type:n};this.hls.trigger(Q.BUFFER_FLUSHING,r)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(e=>{let t=e?.frag;if(!t||this.fragContextChanged(t)||!this.levels)throw Error(`init load aborted`);return e}).then(e=>{let{hls:t}=this,{frag:n,payload:r}=e,i=n.decryptdata;if(r&&r.byteLength>0&&i!=null&&i.key&&i.iv&&en(i.method)){let o=self.performance.now();return this.decrypter.decrypt(new Uint8Array(r),i.key.buffer,i.iv.buffer,tn(i.method)).catch(e=>{throw t.trigger(Q.ERROR,{type:wo.MEDIA_ERROR,details:Z.FRAG_DECRYPT_ERROR,fatal:!1,error:e,reason:e.message,frag:n}),e}).then(r=>{let i=self.performance.now();return t.trigger(Q.FRAG_DECRYPTED,{frag:n,payload:r,stats:{tstart:o,tdecrypt:i}}),e.payload=r,this.completeInitSegmentLoad(e)})}return this.completeInitSegmentLoad(e)}).catch(t=>{this.state===$.STOPPED||this.state===$.ERROR||(this.warn(t),this.resetFragmentLoading(e))})}completeInitSegmentLoad(e){let{levels:t}=this;if(!t)throw Error(`init load aborted, missing levels`);let n=e.frag.stats;this.state!==$.STOPPED&&(this.state=$.IDLE),e.frag.data=new Uint8Array(e.payload),n.parsing.start=n.buffering.start=self.performance.now(),n.parsing.end=n.buffering.end=self.performance.now(),this.tick()}unhandledEncryptionError(e,t){var n,r;let i=e.tracks;if(i&&!t.encrypted&&((n=i.audio)!=null&&n.encrypted||(r=i.video)!=null&&r.encrypted)&&(!this.config.emeEnabled||!this.keyLoader.emeController)){let e=this.media,n=Error(`Encrypted track with no key in ${this.fragInfo(t)} (media ${e?`attached mediaKeys: `+e.mediaKeys:`detached`})`);return this.warn(n.message),!e||e.mediaKeys?!1:(this.hls.trigger(Q.ERROR,{type:wo.KEY_SYSTEM_ERROR,details:Z.KEY_SYSTEM_NO_KEYS,fatal:!1,error:n,frag:t}),this.resetTransmuxer(),!0)}return!1}fragContextChanged(e){let{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){let n=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?` part: `+t.index:``} of ${this.fragInfo(e,!1,t)} > buffer:${n?Gs.toString(ws.getBuffered(n)):`(detached)`})`),q(e)){if(e.type!==Eo.SUBTITLE){let t=e.elementaryStreams;if(!Object.keys(t).some(e=>!!t[e])){this.state=$.IDLE;return}}let t=this.levels?.[e.level];t!=null&&t.fragmentError&&(this.log(`Resetting level fragment error count of ${t.fragmentError} on frag buffered`),t.fragmentError=0)}this.state=$.IDLE}_handleFragmentLoadComplete(e){let{transmuxer:t}=this;if(!t)return;let{frag:n,part:r,partsLoaded:i}=e,o=!i||i.length===0||i.some(e=>!e),c=new Ss(n.level,n.sn,n.stats.chunkCount+1,0,r?r.index:-1,!o);t.flush(c)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,n=null,r){var i;this.fragCurrent=e;let o=t.details;if(!this.levels||!o)throw Error(`frag load aborted, missing level${o?``:` detail`}s`);let c=null;if(e.encrypted&&!((i=e.decryptdata)!=null&&i.key)){if(this.log(`Loading key for ${e.sn} of [${o.startSN}-${o.endSN}], ${this.playlistLabel()} ${e.level}`),this.state=$.KEY_LOADING,this.fragCurrent=e,c=this.keyLoader.load(e).then(e=>{if(!this.fragContextChanged(e.frag))return this.hls.trigger(Q.KEY_LOADED,e),this.state===$.KEY_LOADING&&(this.state=$.IDLE),e}),this.hls.trigger(Q.KEY_LOADING,{frag:e}),this.fragCurrent===null)return this.log(`context changed in KEY_LOADING`),Promise.resolve(null)}else e.encrypted||(c=this.keyLoader.loadClear(e,o.encryptedFragments,this.startFragRequested),c&&this.log(`[eme] blocking frag load until media-keys acquired`));let l=this.fragPrevious;if(q(e)&&(!l||e.sn!==l.sn)){let n=this.shouldLoadParts(t.details,e.end);n!==this.loadingParts&&(this.log(`LL-Part loading ${n?`ON`:`OFF`} loading sn ${l?.sn}->${e.sn}`),this.loadingParts=n)}if(n=Math.max(e.start,n||0),this.loadingParts&&q(e)){let i=o.partList;if(i&&r){n>o.fragmentEnd&&o.fragmentHint&&(e=o.fragmentHint);let l=this.getNextPart(i,e,n);if(l>-1){let u=i[l];e=this.fragCurrent=u.fragment,this.log(`Loading ${e.type} sn: ${e.sn} part: ${u.index} (${l}/${i.length-1}) of ${this.fragInfo(e,!1,u)}) cc: ${e.cc} [${o.startSN}-${o.endSN}], target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=u.start+u.duration,this.state=$.FRAG_LOADING;let d;return d=c?c.then(n=>!n||this.fragContextChanged(n.frag)?null:this.doFragPartsLoad(e,u,t,r)).catch(e=>this.handleFragLoadError(e)):this.doFragPartsLoad(e,u,t,r).catch(e=>this.handleFragLoadError(e)),this.hls.trigger(Q.FRAG_LOADING,{frag:e,part:u,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(Error(`frag load aborted, context changed in FRAG_LOADING parts`)):d}else if(!e.url||this.loadedEndOfParts(i,n))return Promise.resolve(null)}}if(q(e)&&this.loadingParts)this.log(`LL-Part loading OFF after next part miss @${n.toFixed(2)} Check buffer at sn: ${e.sn} loaded parts: ${o.partList?.filter(e=>e.loaded).map(e=>`[${e.start}-${e.end}]`)}`),this.loadingParts=!1;else if(!e.url)return Promise.resolve(null);this.log(`Loading ${e.type} sn: ${e.sn} of ${this.fragInfo(e,!1)}) cc: ${e.cc} ${`[`+o.startSN+`-`+o.endSN+`]`}, target: ${parseFloat(n.toFixed(3))}`),X(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=$.FRAG_LOADING;let u=this.config.progressive&&e.type!==Eo.SUBTITLE,d;return d=u&&c?c.then(t=>!t||this.fragContextChanged(t.frag)?null:this.fragmentLoader.load(e,r)).catch(e=>this.handleFragLoadError(e)):Promise.all([this.fragmentLoader.load(e,u?r:void 0),c]).then(([e])=>(!u&&r&&r(e),e)).catch(e=>this.handleFragLoadError(e)),this.hls.trigger(Q.FRAG_LOADING,{frag:e,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(Error(`frag load aborted, context changed in FRAG_LOADING`)):d}doFragPartsLoad(e,t,n,r){return new Promise((i,o)=>{let c=[],l=n.details?.partList,u=t=>{this.fragmentLoader.loadPart(e,t,r).then(r=>{c[t.index]=r;let o=r.part;this.hls.trigger(Q.FRAG_LOADED,r);let d=Vn(n.details,e.sn,t.index+1)||Hn(l,e.sn,t.index+1);if(d)u(d);else return i({frag:e,part:o,partsLoaded:c})}).catch(o)};u(t)})}handleFragLoadError(e){if(`data`in e){let t=e.data;t.frag&&t.details===Z.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):t.frag&&t.type===wo.KEY_SYSTEM_ERROR?(t.frag.abortRequests(),this.resetStartWhenNotLoaded(),this.resetFragmentLoading(t.frag)):this.hls.trigger(Q.ERROR,t)}else this.hls.trigger(Q.ERROR,{type:wo.OTHER_ERROR,details:Z.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){let t=this.getCurrentContext(e);if(!t||this.state!==$.PARSING){!this.fragCurrent&&this.state!==$.STOPPED&&this.state!==$.ERROR&&(this.state=$.IDLE);return}let{frag:n,part:r,level:i}=t,o=self.performance.now();n.stats.parsing.end=o,r&&(r.stats.parsing.end=o);let c=this.getLevelDetails(),l=c&&n.sn>c.endSN||this.shouldLoadParts(c,n.end);l!==this.loadingParts&&(this.log(`LL-Part loading ${l?`ON`:`OFF`} after parsing segment ending @${n.end.toFixed(2)}`),this.loadingParts=l),this.updateLevelTiming(n,r,i,e.partial)}shouldLoadParts(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(e.partList){let n=e.partList[0];if(n.fragment.type===Eo.SUBTITLE)return!1;if(t>=n.end+(e.fragmentHint?.duration||0)&&(this.hls.hasEnoughToStart?this.media?.currentTime||this.lastCurrentTime:this.getLoadPosition())>n.start-n.fragment.duration)return!0}}return!1}getCurrentContext(e){let{levels:t,fragCurrent:n}=this,{level:r,sn:i,part:o}=e;if(!(t!=null&&t[r]))return this.warn(`Levels object was unset while buffering fragment ${i} of ${this.playlistLabel()} ${r}. The current chunk will not be buffered.`),null;let c=t[r],l=c.details,u=o>-1?Vn(l,i,o):null,d=u?u.fragment:Bn(l,i,n);return d?(n&&n!==d&&(d.stats=n.stats),{frag:d,part:u,level:c}):null}bufferFragmentData(e,t,n,r,i){if(this.state!==$.PARSING)return;let{data1:o,data2:c}=e,l=o;if(c&&(l=Ce(o,c)),!l.length)return;let u=this.initPTS[t.cc],d=u?-u.baseTime/u.timescale:void 0,f={type:e.type,frag:t,part:n,chunkMeta:r,offset:d,parent:t.type,data:l};if(this.hls.trigger(Q.BUFFER_APPENDING,f),e.dropped&&e.independent&&!n){if(i)return;this.flushBufferGap(t)}}flushBufferGap(e){let t=this.media;if(!t)return;if(!ws.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}let n=t.currentTime,r=ws.bufferInfo(t,n,0),i=e.duration,o=Math.min(this.config.maxFragLookUpTolerance*2,i*.25),c=Math.max(Math.min(e.start-o,r.end-o),n+o);e.start-c>o&&this.flushMainBuffer(c,e.start)}getFwdBufferInfo(e,t){var n;let r=this.getLoadPosition();if(!X(r))return null;let i=this.lastCurrentTime>r||(n=this.media)!=null&&n.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(e,r,t,i)}getFwdBufferInfoAtPos(e,t,n,r){let i=ws.bufferInfo(e,t,r);if(i.len===0&&i.nextStart!==void 0){let o=this.fragmentTracker.getBufferedFrag(t,n);if(o&&(i.nextStart<=o.end||o.gap)){let n=Math.max(Math.min(i.nextStart,o.end)-t,r);return ws.bufferInfo(e,t,n)}}return i}getMaxBufferLength(e){let{config:t}=this,n;return n=e?Math.max(8*t.maxBufferSize/e,t.maxBufferLength):t.maxBufferLength,Math.min(n,t.maxMaxBufferLength)}reduceMaxBufferLength(e,t){let n=this.config,r=Math.max(Math.min(e-t,n.maxBufferLength),t),i=Math.max(e-t*3,n.maxMaxBufferLength/2,r);return i>=r?(n.maxMaxBufferLength=i,this.warn(`Reduce max buffer length to ${i}s`),!0):!1}getAppendedFrag(e,t=Eo.MAIN){let n=this.fragmentTracker?this.fragmentTracker.getAppendedFrag(e,t):null;return n&&`fragment`in n?n.fragment:n}getNextFragment(e,t){let n=t.fragments,r=n.length;if(!r)return null;let{config:i}=this,o=n[0].start,c=i.lowLatencyMode&&!!t.partList,l=null;if(t.live){let n=i.initialLiveManifestSize;if(r<n)return this.warn(`Not enough fragments to start playback (have: ${r}, need: ${n})`),null;if(!t.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||e<o){c&&!this.loadingParts&&(this.log(`LL-Part loading ON for initial live fragment`),this.loadingParts=!0),l=this.getInitialLiveFragment(t);let n=this.hls.startPosition,r=this.hls.liveSyncPosition,i=l?(n!==-1&&n>=o?n:r)||l.start:e;this.log(`Setting startPosition to ${i} to match start frag at live edge. mainStart: ${n} liveSyncPosition: ${r} frag.start: ${l?.start}`),this.startPosition=this.nextLoadPosition=i}}else e<=o&&(l=n[0]);if(!l){let n=this.loadingParts?t.partEnd:t.fragmentEnd;l=this.getFragmentAtPosition(e,n,t)}let u=this.filterReplacedPrimary(l,t);if(!u&&l){let e=l.sn-t.startSN;u=this.filterReplacedPrimary(n[e+1]||null,t)}return this.mapToInitFragWhenRequired(u)}isLoopLoading(e,t){let n=this.fragmentTracker.getState(e);return(n===us.OK||n===us.PARTIAL&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,n,r,i){let o=null;if(e.gap&&(o=this.getNextFragment(this.nextLoadPosition,t),o&&!o.gap&&n.nextStart)){let e=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,r,0);if(e!==null&&n.len+e.len>=i){let e=o.sn;return this.loopSn!==e&&(this.log(`buffer full after gaps in "${r}" playlist starting at sn: ${e}`),this.loopSn=e),null}}return this.loopSn=void 0,o}get primaryPrefetch(){if(tr(this.config)){var e;if(!((e=this.hls.interstitialsManager)==null||(e=e.playingItem)==null)&&e.event)return!0}return!1}filterReplacedPrimary(e,t){if(!e)return e;if(tr(this.config)&&e.type!==Eo.SUBTITLE){let n=this.hls.interstitialsManager,r=n?.bufferingItem;if(r){let n=r.event;if(n){if(n.appendInPlace||Math.abs(e.start-r.start)>1||r.start===0)return null}else if(e.end<=r.start&&t?.live===!1||e.start>r.end&&r.nextEvent&&(r.nextEvent.appendInPlace||e.start-r.end>1))return null}let i=n?.playerQueue;if(i)for(let t=i.length;t--;){let n=i[t].interstitial;if(n.appendInPlace&&e.start>=n.startTime&&e.end<=n.resumeTime)return null}}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!e.initSegment.data&&!this.bitrateTest?e.initSegment:e}getNextPart(e,t,n){let r=-1,i=!1,o=!0;for(let c=0,l=e.length;c<l;c++){let l=e[c];if(o&&=!l.independent,r>-1&&n<l.start)break;let u=l.loaded;u?r=-1:(i||(l.independent||o)&&l.fragment===t)&&(l.fragment!==t&&this.warn(`Need buffer at ${n} but next unloaded part starts at ${l.start}`),r=c),i=u}return r}loadedEndOfParts(e,t){let n;for(let r=e.length;r--;){if(n=e[r],!n.loaded)return!1;if(t>n.start)return!0}return!1}getInitialLiveFragment(e){let t=e.fragments,n=this.fragPrevious,r=null;if(n){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${n.programDateTime}`),r=xt(t,n.endProgramDateTime,this.config.maxFragLookUpTolerance)),!r){let i=n.sn+1;if(i>=e.startSN&&i<=e.endSN){let o=t[i-e.startSN];n.cc===o.cc&&(r=o,this.log(`Live playlist, switching playlist, load frag with next SN: ${r.sn}`))}r||(r=Et(e,n.cc,n.end),r&&this.log(`Live playlist, switching playlist, load frag with same CC: ${r.sn}`))}}else{let t=this.hls.liveSyncPosition;t!==null&&(r=this.getFragmentAtPosition(t,this.bitrateTest?e.fragmentEnd:e.edge,e))}return r}getFragmentAtPosition(e,t,n){let{config:r}=this,{fragPrevious:i}=this,{fragments:o,endSN:c}=n,{fragmentHint:l}=n,{maxFragLookUpTolerance:u}=r,d=n.partList,f=!!(this.loadingParts&&d!=null&&d.length&&l);f&&!this.bitrateTest&&d[d.length-1].fragment.sn===l.sn&&(o=o.concat(l),c=l.sn);let p;if(e<t){var m;let n=e<this.lastCurrentTime||e>t-u||(m=this.media)!=null&&m.paused||!this.startFragRequested?0:u;p=St(i,o,e,n)}else p=o[o.length-1];if(p){let e=p.sn-n.startSN,t=this.fragmentTracker.getState(p);if((t===us.OK||t===us.PARTIAL&&p.gap)&&(i=p),i&&p.sn===i.sn&&(!f||d[0].fragment.sn>p.sn||!n.live)&&p.level===i.level){let t=o[e+1];p=p.sn<c&&this.fragmentTracker.getState(t)!==us.OK?t:null}}return p}alignPlaylists(e,t,n){let r=e.fragments.length;if(!r)return this.warn(`No fragments in live playlist`),0;let i=e.fragmentStart,o=!t,c=e.alignedSliding&&X(i);if(o||!c&&!i){Xn(n,e);let i=e.fragmentStart;return this.log(`Live playlist sliding: ${i.toFixed(2)} start-sn: ${t?t.startSN:`na`}->${e.startSN} fragments: ${r}`),i}return i}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let n=this.startPosition;n<t&&(n=-1);let r=this.timelineOffset;if(n===-1){let i=this.startTimeOffset!==null,o=i?this.startTimeOffset:e.startTimeOffset;o!==null&&X(o)?(n=t+o,o<0&&(n+=e.edge),n=Math.min(Math.max(t,n),t+e.totalduration),this.log(`Setting startPosition to ${n} for start time offset ${o} found in ${i?`multivariant`:`media`} playlist`),this.startPosition=n):e.live?(n=this.hls.liveSyncPosition||t,this.log(`Setting startPosition to -1 to start at live edge ${n}`),this.startPosition=-1):(this.log(`setting startPosition to 0 by default`),this.startPosition=n=0),this.lastCurrentTime=n+r}this.nextLoadPosition=n+r}getLoadPosition(){var e;let{media:t}=this,n=0;return(e=this.hls)!=null&&e.hasEnoughToStart&&t?n=t.currentTime:this.nextLoadPosition>=0&&(n=this.nextLoadPosition),n}handleFragLoadAborted(e,t){this.transmuxer&&e.type===this.playlistType&&q(e)&&e.stats.aborted&&(this.log(`Fragment ${e.sn}${t?` part `+t.index:``} of ${this.playlistLabel()} ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){(!this.fragCurrent||!this.fragContextChanged(e)&&this.state!==$.FRAG_LOADING_WAITING_RETRY)&&(this.state=$.IDLE)}onFragmentOrKeyLoadError(e,t){if(t.chunkMeta&&!t.frag){let e=this.getCurrentContext(t.chunkMeta);e&&(t.frag=e.frag)}let n=t.frag;if(!n||n.type!==e||!this.levels)return;if(this.fragContextChanged(n)){this.warn(`Frag load error must match current frag to retry ${n.url} > ${this.fragCurrent?.url}`);return}let r=t.details===Z.FRAG_GAP;r&&this.fragmentTracker.fragBuffered(n,!0);let i=t.errorAction;if(!i){this.state=$.ERROR;return}let{action:o,flags:c,retryCount:l=0,retryConfig:u}=i,d=!!u,f=d&&o===ss.RetryRequest,p=d&&!i.resolved&&c===cs.MoveAllAlternatesMatchingHost,m=this.hls.latestLevelDetails?.live;if(!f&&p&&q(n)&&!n.endList&&m&&!kt(t))this.resetFragmentErrors(e),this.treatAsGap(n),i.resolved=!0;else if((f||p)&&l<u.maxNumRetry){let r=Ft(t.response?.code),o=jt(u,l);if(this.resetStartWhenNotLoaded(),this.retryDate=self.performance.now()+o,this.state=$.FRAG_LOADING_WAITING_RETRY,i.resolved=!0,r){this.log(`Waiting for connection (offline)`),this.retryDate=1/0,t.reason=`offline`;return}this.warn(`Fragment ${n.sn} of ${e} ${n.level} errored with ${t.details}, retrying loading ${l+1}/${u.maxNumRetry} in ${o}ms`)}else if(u)if(this.resetFragmentErrors(e),l<u.maxNumRetry)!r&&o!==ss.RemoveAlternatePermanently&&(i.resolved=!0);else{this.warn(`${t.details} reached or exceeded max retry (${l})`);return}else o===ss.SendAlternateToPenaltyBox?this.state=$.WAITING_LEVEL:this.state=$.ERROR;this.tickImmediate()}checkRetryDate(){let e=self.performance.now(),t=this.retryDate,n=t===1/0;(!t||e>=t||n&&!Ft(0))&&(n&&this.log(`Connection restored (online)`),this.resetStartWhenNotLoaded(),this.state=$.IDLE)}reduceLengthAndFlushBuffer(e){if(this.state===$.PARSING||this.state===$.PARSED){let t=e.frag,n=e.parent,r=this.getFwdBufferInfo(this.mediaBuffer,n),i=r&&r.len>.5;i&&this.reduceMaxBufferLength(r.len,t?.duration||10);let o=!i;return o&&this.warn(`Buffer full error while media.currentTime (${this.getLoadPosition()}) is not buffered, flush ${n} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),o}return!1}resetFragmentErrors(e){e===Eo.AUDIO&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==$.STOPPED&&(this.state=$.IDLE)}afterBufferFlushed(e,t,n){if(!e)return;let r=ws.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,r,n),this.state===$.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log(`Reset loading state`),this.fragCurrent=null,this.fragPrevious=null,this.state!==$.STOPPED&&(this.state=$.IDLE)}resetStartWhenNotLoaded(){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;let e=this.levelLastLoaded,t=e?e.details:null;t!=null&&t.live?(this.log(`resetting startPosition for live start`),this.startPosition=-1,this.setStartPosition(t,t.fragmentStart),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.log(`Loading context changed while buffering sn ${e.sn} of ${this.playlistLabel()} ${e.level===-1?`<removed>`:e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,n,r){let i=n.details;if(!i){this.warn(`level.details undefined`);return}if(!Object.keys(e.elementaryStreams).reduce((t,o)=>{let c=e.elementaryStreams[o];if(c){let l=c.endPTS-c.startPTS;if(l<=0)return this.warn(`Could not parse fragment ${e.sn} ${o} duration reliably (${l})`),t||!1;let u=r?0:jn(i,e,c.startPTS,c.endPTS,c.startDTS,c.endDTS,this);return this.hls.trigger(Q.LEVEL_PTS_UPDATED,{details:i,level:n,drift:u,type:o,frag:e,start:c.startPTS,end:c.endPTS}),!0}return t},!1)){let t=this.transmuxer?.error===null;if((n.fragmentError===0||t&&(n.fragmentError<2||e.endList))&&this.treatAsGap(e,n),t){let t=Error(`Found no media in fragment ${e.sn} of ${this.playlistLabel()} ${e.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(t.message),this.hls.trigger(Q.ERROR,{type:wo.MEDIA_ERROR,details:Z.FRAG_PARSING_ERROR,fatal:!1,error:t,frag:e,reason:`Found no media in msn ${e.sn} of ${this.playlistLabel()} "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=$.PARSED,this.log(`Parsed ${e.type} sn: ${e.sn}${t?` part: `+t.index:``} of ${this.fragInfo(e,!1,t)})`),this.hls.trigger(Q.FRAG_PARSED,{frag:e,part:t})}playlistLabel(){return this.playlistType===Eo.MAIN?`level`:`track`}fragInfo(e,t=!0,n){return`${this.playlistLabel()} ${e.level} (${n?`part`:`frag`}:[${((t&&!n?e.startPTS:(n||e).start)??NaN).toFixed(3)}-${((t&&!n?e.endPTS:(n||e).end)??NaN).toFixed(3)}]${n&&e.type===`main`?`INDEPENDENT=`+(n.independent?`YES`:`NO`):``}`}treatAsGap(e,t){t&&t.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)}resetTransmuxer(){var e;(e=this.transmuxer)==null||e.reset()}recoverWorkerError(e){e.event===`demuxerWorker`&&(this.fragmentTracker.removeAllFragments(),this.transmuxer&&=(this.transmuxer.destroy(),null),this.resetStartWhenNotLoaded(),this.resetLoadingState())}set state(e){let t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}},qs=class{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){let{chunks:e,dataLength:t}=this,n;if(e.length)n=e.length===1?e[0]:nr(e,t);else return new Uint8Array;return this.reset(),n}reset(){this.chunks.length=0,this.dataLength=0}},Js={exports:{}},Xs=K(rr()),Zs=`1.6.15`,Qs={},$s=10,ec=10,tc=function(e){return e.audioId3=`org.id3`,e.dateRange=`com.apple.quicktime.HLS`,e.emsg=`https://aomedia.org/emsg/ID3`,e.misbklv=`urn:misb:KLV:bin:1910.1`,e}({}),nc=class{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(e,t,n,r){this._id3Track={type:`id3`,id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,t){return!1}appendFrame(e,t,n){}demux(e,t){this.cachedData&&=(e=Ce(this.cachedData,e),null);let n=dr(e,0),r=n?n.length:0,i,o=this._audioTrack,c=this._id3Track,l=n?zr(n):void 0,u=e.length;for((this.basePTS===null||this.frameIndex===0&&X(l))&&(this.basePTS=rc(l,t,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),n&&n.length>0&&c.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:tc.audioId3,duration:1/0});r<u;){if(this.canParse(e,r)){let t=this.appendFrame(o,e,r);t?(this.frameIndex++,this.lastPTS=t.sample.pts,r+=t.length,i=r):r=u}else wr(e,r)?(n=dr(e,r),c.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:tc.audioId3,duration:1/0}),r+=n.length,i=r):r++;if(r===u&&i!==u){let t=e.slice(i);this.cachedData?this.cachedData=Ce(this.cachedData,t):this.cachedData=t}}return{audioTrack:o,videoTrack:Br(),id3Track:c,textTrack:Br()}}demuxSampleAes(e,t,n){return Promise.reject(Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(e){let t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),{audioTrack:this._audioTrack,videoTrack:Br(),id3Track:this._id3Track,textTrack:Br()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}},rc=(e,t,n)=>{if(X(e))return e*90;let r=n?n.baseTime*9e4/n.timescale:0;return t*9e4+r},ic=null,ac=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],oc=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],sc=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],cc=[0,1,1,4],lc=class extends nc{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,n,r){super.resetInitSegment(e,t,n,r),this._audioTrack={container:`audio/adts`,type:`audio`,id:2,pid:-1,sequenceNumber:0,segmentCodec:`aac`,samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}static probe(e,t){if(!e)return!1;let n=dr(e,0)?.length||0;if(Kr(e,n))return!1;for(let r=e.length;n<r;n++)if(yr(e,n))return t.log(`ADTS sync word found !`),!0;return!1}canParse(e,t){return vr(e,t)}appendFrame(e,t,n){br(e,this.observer,t,n,e.manifestCodec);let r=Cr(e,t,n,this.basePTS,this.frameIndex);if(r&&r.missing===0)return r}},uc=(e,t)=>{let n=0,r=5;t+=r;let i=new Uint32Array(1),o=new Uint32Array(1),c=new Uint8Array(1);for(;r>0;){c[0]=e[t];let l=Math.min(r,8),u=8-l;o[0]=4278190080>>>24+u<<u,i[0]=(c[0]&o[0])>>u,n=n?n<<l|i[0]:i[0],t+=1,r-=l}return n},dc=class extends nc{constructor(e){super(),this.observer=void 0,this.observer=e}resetInitSegment(e,t,n,r){super.resetInitSegment(e,t,n,r),this._audioTrack={container:`audio/ac-3`,type:`audio`,id:2,pid:-1,sequenceNumber:0,segmentCodec:`ac3`,samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}canParse(e,t){return t+64<e.length}appendFrame(e,t,n){let r=qr(e,t,n,this.basePTS,this.frameIndex);if(r!==-1)return{sample:e.samples[e.samples.length-1],length:r,missing:0}}static probe(e){if(!e)return!1;let t=dr(e,0);if(!t)return!1;let n=t.length;return e[n]===11&&e[n+1]===119&&zr(t)!==void 0&&uc(e,n)<16}},fc=class extends nc{resetInitSegment(e,t,n,r){super.resetInitSegment(e,t,n,r),this._audioTrack={container:`audio/mpeg`,type:`audio`,id:2,pid:-1,sequenceNumber:0,segmentCodec:`mp3`,samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;let t=dr(e,0),n=t?.length||0;if(t&&e[n]===11&&e[n+1]===119&&zr(t)!==void 0&&uc(e,n)<=16)return!1;for(let t=e.length;n<t;n++)if(Kr(e,n))return No.log(`MPEG Audio sync word found !`),!0;return!1}canParse(e,t){return Gr(e,t)}appendFrame(e,t,n){if(this.basePTS!==null)return Vr(e,t,n,this.basePTS,this.frameIndex)}},pc=/\/emsg[-/]ID3/i,mc=class{constructor(e,t){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=t}resetTimeStamp(){}resetInitSegment(e,t,n,r){let i=this.videoTrack=Br(`video`,1),o=this.audioTrack=Br(`audio`,1),c=this.txtTrack=Br(`text`,1);if(this.id3Track=Br(`id3`,1),this.timeOffset=0,!(e!=null&&e.byteLength))return;let l=ue(e);if(l.video){let{id:e,timescale:t,codec:n,supplemental:r}=l.video;i.id=e,i.timescale=c.timescale=t,i.codec=n,i.supplemental=r}if(l.audio){let{id:e,timescale:t,codec:n}=l.audio;o.id=e,o.timescale=t,o.codec=n}c.id=Wo.text,i.sampleDuration=0,i.duration=o.duration=r}resetContiguity(){this.remainderData=null}static probe(e){return se(e)}demux(e,t){this.timeOffset=t;let n=e,r=this.videoTrack,i=this.txtTrack;if(this.config.progressive){this.remainderData&&(n=Ce(this.remainderData,e));let t=Se(n);this.remainderData=t.remainder,r.samples=t.valid||new Uint8Array}else r.samples=n;let o=this.extractID3Track(r,t);return i.samples=we(t,r),{videoTrack:r,audioTrack:this.audioTrack,id3Track:o,textTrack:this.txtTrack}}flush(){let e=this.timeOffset,t=this.videoTrack,n=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;let r=this.extractID3Track(t,this.timeOffset);return n.samples=we(e,t),{videoTrack:t,audioTrack:Br(),id3Track:r,textTrack:Br()}}extractID3Track(e,t){let n=this.id3Track;if(e.samples.length){let r=ce(e.samples,[`emsg`]);r&&r.forEach(e=>{let r=ke(e);if(pc.test(r.schemeIdUri)){let e=Jr(r,t),i=r.eventDuration===4294967295?1/0:r.eventDuration/r.timeScale;i<=.001&&(i=1/0);let o=r.payload;n.samples.push({data:o,len:o.byteLength,dts:e,pts:e,type:tc.emsg,duration:i})}else if(this.config.enableEmsgKLVMetadata&&r.schemeIdUri.startsWith(`urn:misb:KLV:bin:1910.1`)){let e=Jr(r,t);n.samples.push({data:r.payload,len:r.payload.byteLength,dts:e,pts:e,type:tc.misbklv,duration:1/0})}})}return n}demuxSampleAes(e,t,n){return Promise.reject(Error(`The MP4 demuxer does not support SAMPLE-AES decryption`))}destroy(){this.config=null,this.remainderData=null,this.videoTrack=this.audioTrack=this.id3Track=this.txtTrack=void 0}},hc=class{constructor(e,t,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new _s(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,fs.cbc)}decryptAacSample(e,t,n){let r=e[t].unit;if(r.length<=16)return;let i=r.subarray(16,r.length-r.length%16),o=i.buffer.slice(i.byteOffset,i.byteOffset+i.length);this.decryptBuffer(o).then(i=>{let o=new Uint8Array(i);r.set(o,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,n)}).catch(n)}decryptAacSamples(e,t,n){for(;;t++){if(t>=e.length){n();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,n),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){let t=Math.floor((e.length-48)/160)*16+16,n=new Int8Array(t),r=0;for(let t=32;t<e.length-16;t+=160,r+=16)n.set(e.subarray(t,t+16),r);return n}getAvcDecryptedUnit(e,t){let n=new Uint8Array(t),r=0;for(let t=32;t<e.length-16;t+=160,r+=16)e.set(n.subarray(r,r+16),t);return e}decryptAvcSample(e,t,n,r,i){let o=Oe(i.data),c=this.getAvcEncryptedData(o);this.decryptBuffer(c.buffer).then(c=>{i.data=this.getAvcDecryptedUnit(o,c),this.decrypter.isSync()||this.decryptAvcSamples(e,t,n+1,r)}).catch(r)}decryptAvcSamples(e,t,n,r){if(e instanceof Uint8Array)throw Error(`Cannot decrypt samples of type Uint8Array`);for(;;t++,n=0){if(t>=e.length){r();return}let i=e[t].units;for(;!(n>=i.length);n++){let o=i[n];if(!(o.data.length<=48||o.type!==1&&o.type!==5)&&(this.decryptAvcSample(e,t,n,r,o),!this.decrypter.isSync()))return}}}},gc=class{constructor(){this.VideoSample=null}createVideoSample(e,t,n){return{key:e,frame:!1,pts:t,dts:n,units:[],length:0}}getLastNalUnit(e){var t;let n=this.VideoSample,r;if((!n||n.units.length===0)&&(n=e[e.length-1]),(t=n)!=null&&t.units){let e=n.units;r=e[e.length-1]}return r}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){let n=t.samples,r=n.length;if(r){let t=n[r-1];e.pts=t.pts,e.dts=t.dts}else{t.dropped++;return}}t.samples.push(e)}}parseNALu(e,t,n){let r=t.byteLength,i=e.naluState||0,o=i,c=[],l=0,u,d,f,p=-1,m=0;for(i===-1&&(p=0,m=this.getNALuType(t,0),i=0,l=1);l<r;){if(u=t[l++],!i){i=+!u;continue}if(i===1){i=u?0:2;continue}if(!u)i=3;else if(u===1){if(d=l-i-1,p>=0){let e={data:t.subarray(p,d),type:m};c.push(e)}else{let n=this.getLastNalUnit(e.samples);n&&(o&&l<=4-o&&n.state&&(n.data=n.data.subarray(0,n.data.byteLength-o)),d>0&&(n.data=Ce(n.data,t.subarray(0,d)),n.state=0))}l<r?(f=this.getNALuType(t,l),p=l,m=f,i=0):i=-1}else i=0}if(p>=0&&i>=0){let e={data:t.subarray(p,r),type:m,state:i};c.push(e)}if(c.length===0){let n=this.getLastNalUnit(e.samples);n&&(n.data=Ce(n.data,t))}return e.naluState=i,c}},_c=class{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){let e=this.data,t=this.bytesAvailable,n=e.byteLength-t,r=new Uint8Array(4),i=Math.min(4,t);if(i===0)throw Error(`no bytes available`);r.set(e.subarray(n,n+i)),this.word=new DataView(r.buffer).getUint32(0),this.bitsAvailable=i*8,this.bytesAvailable-=i}skipBits(e){let t;e=Math.min(e,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e),n=this.word>>>32-t;if(e>32&&No.error(`Cannot read more than 32 bits at a time`),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else if(this.bytesAvailable>0)this.loadWord();else throw Error(`no bits available`);return t=e-t,t>0&&this.bitsAvailable?n<<t|this.readBits(t):n}skipLZ(){let e;for(e=0;e<this.bitsAvailable;++e)if(this.word&2147483648>>>e)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){let e=this.skipLZ();return this.readBits(e+1)-1}readEG(){let e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}},vc=class extends gc{parsePES(e,t,n,r){let i=this.parseNALu(e,n.data,r),o=this.VideoSample,c,l=!1;n.data=null,o&&i.length&&!e.audFound&&(this.pushAccessUnit(o,e),o=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),i.forEach(r=>{var i,u;switch(r.type){case 1:{let t=!1;c=!0;let i=r.data;if(l&&i.length>4){let e=this.readSliceType(i);(e===2||e===4||e===7||e===9)&&(t=!0)}if(t){var d;(d=o)!=null&&d.frame&&!o.key&&(this.pushAccessUnit(o,e),o=this.VideoSample=null)}o||=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts),o.frame=!0,o.key=t;break}case 5:c=!0,(i=o)!=null&&i.frame&&!o.key&&(this.pushAccessUnit(o,e),o=this.VideoSample=null),o||=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts),o.key=!0,o.frame=!0;break;case 6:c=!0,De(r.data,1,n.pts,t.samples);break;case 7:{c=!0,l=!0;let t=r.data,n=this.readSPS(t);if(!e.sps||e.width!==n.width||e.height!==n.height||e.pixelRatio?.[0]!==n.pixelRatio[0]||e.pixelRatio?.[1]!==n.pixelRatio[1]){e.width=n.width,e.height=n.height,e.pixelRatio=n.pixelRatio,e.sps=[t];let r=t.subarray(1,4),i=`avc1.`;for(let e=0;e<3;e++){let t=r[e].toString(16);t.length<2&&(t=`0`+t),i+=t}e.codec=i}break}case 8:c=!0,e.pps=[r.data];break;case 9:c=!0,e.audFound=!0,(u=o)!=null&&u.frame&&(this.pushAccessUnit(o,e),o=null),o||=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts);break;case 12:c=!0;break;default:c=!1;break}o&&c&&o.units.push(r)}),r&&o&&(this.pushAccessUnit(o,e),this.VideoSample=null)}getNALuType(e,t){return e[t]&31}readSliceType(e){let t=new _c(e);return t.readUByte(),t.readUEG(),t.readUEG()}skipScalingList(e,t){let n=8,r=8,i;for(let o=0;o<e;o++)r!==0&&(i=t.readEG(),r=(n+i+256)%256),n=r===0?n:r}readSPS(e){let t=new _c(e),n=0,r=0,i=0,o=0,c,l,u,d=t.readUByte.bind(t),f=t.readBits.bind(t),p=t.readUEG.bind(t),m=t.readBoolean.bind(t),h=t.skipBits.bind(t),g=t.skipEG.bind(t),_=t.skipUEG.bind(t),v=this.skipScalingList.bind(this);d();let y=d();if(f(5),h(3),d(),_(),y===100||y===110||y===122||y===244||y===44||y===83||y===86||y===118||y===128){let e=p();if(e===3&&h(1),_(),_(),h(1),m())for(l=e===3?12:8,u=0;u<l;u++)m()&&v(u<6?16:64,t)}_();let b=p();if(b===0)p();else if(b===1)for(h(1),g(),g(),c=p(),u=0;u<c;u++)g();_(),h(1);let x=p(),S=p(),C=f(1);C===0&&h(1),h(1),m()&&(n=p(),r=p(),i=p(),o=p());let w=[1,1];if(m()&&m())switch(d()){case 1:w=[1,1];break;case 2:w=[12,11];break;case 3:w=[10,11];break;case 4:w=[16,11];break;case 5:w=[40,33];break;case 6:w=[24,11];break;case 7:w=[20,11];break;case 8:w=[32,11];break;case 9:w=[80,33];break;case 10:w=[18,11];break;case 11:w=[15,11];break;case 12:w=[64,33];break;case 13:w=[160,99];break;case 14:w=[4,3];break;case 15:w=[3,2];break;case 16:w=[2,1];break;case 255:w=[d()<<8|d(),d()<<8|d()];break}return{width:Math.ceil((x+1)*16-n*2-r*2),height:(2-C)*(S+1)*16-(C?2:4)*(i+o),pixelRatio:w}}},yc=class extends gc{constructor(...e){super(...e),this.initVPS=null}parsePES(e,t,n,r){let i=this.parseNALu(e,n.data,r),o=this.VideoSample,c,l=!1;n.data=null,o&&i.length&&!e.audFound&&(this.pushAccessUnit(o,e),o=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),i.forEach(r=>{var i,u;switch(r.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:o||=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts),o.frame=!0,c=!0;break;case 16:case 17:case 18:case 21:if(c=!0,l){var d;(d=o)!=null&&d.frame&&!o.key&&(this.pushAccessUnit(o,e),o=this.VideoSample=null)}o||=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts),o.key=!0,o.frame=!0;break;case 19:case 20:c=!0,(i=o)!=null&&i.frame&&!o.key&&(this.pushAccessUnit(o,e),o=this.VideoSample=null),o||=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts),o.key=!0,o.frame=!0;break;case 39:c=!0,De(r.data,2,n.pts,t.samples);break;case 32:c=!0,e.vps||(typeof e.params!=`object`&&(e.params={}),e.params=j(e.params,this.readVPS(r.data)),this.initVPS=r.data),e.vps=[r.data];break;case 33:if(c=!0,l=!0,e.vps!==void 0&&e.vps[0]!==this.initVPS&&e.sps!==void 0&&!this.matchSPS(e.sps[0],r.data)&&(this.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){let t=this.readSPS(r.data);e.width=t.width,e.height=t.height,e.pixelRatio=t.pixelRatio,e.codec=t.codecString,e.sps=[],typeof e.params!=`object`&&(e.params={});for(let n in t.params)e.params[n]=t.params[n]}this.pushParameterSet(e.sps,r.data,e.vps),o||=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts),o.key=!0;break;case 34:if(c=!0,typeof e.params==`object`){if(!e.pps){e.pps=[];let t=this.readPPS(r.data);for(let n in t)e.params[n]=t[n]}this.pushParameterSet(e.pps,r.data,e.vps)}break;case 35:c=!0,e.audFound=!0,(u=o)!=null&&u.frame&&(this.pushAccessUnit(o,e),o=null),o||=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts);break;default:c=!1;break}o&&c&&o.units.push(r)}),r&&o&&(this.pushAccessUnit(o,e),this.VideoSample=null)}pushParameterSet(e,t,n){(n&&n[0]===this.initVPS||!n&&!e.length)&&e.push(t)}getNALuType(e,t){return(e[t]&126)>>>1}ebsp2rbsp(e){let t=new Uint8Array(e.byteLength),n=0;for(let r=0;r<e.byteLength;r++)r>=2&&e[r]===3&&e[r-1]===0&&e[r-2]===0||(t[n]=e[r],n++);return new Uint8Array(t.buffer,0,n)}pushAccessUnit(e,t){super.pushAccessUnit(e,t),this.initVPS&&=null}readVPS(e){let t=new _c(e);t.readUByte(),t.readUByte(),t.readBits(4),t.skipBits(2),t.readBits(6);let n=t.readBits(3),r=t.readBoolean();return{numTemporalLayers:n+1,temporalIdNested:r}}readSPS(e){let t=new _c(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.readBits(4);let n=t.readBits(3);t.readBoolean();let r=t.readBits(2),i=t.readBoolean(),o=t.readBits(5),c=t.readUByte(),l=t.readUByte(),u=t.readUByte(),d=t.readUByte(),f=t.readUByte(),p=t.readUByte(),m=t.readUByte(),h=t.readUByte(),g=t.readUByte(),_=t.readUByte(),v=t.readUByte(),y=[],b=[];for(let e=0;e<n;e++)y.push(t.readBoolean()),b.push(t.readBoolean());if(n>0)for(let e=n;e<8;e++)t.readBits(2);for(let e=0;e<n;e++)y[e]&&(t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte()),b[e]&&t.readUByte();t.readUEG();let x=t.readUEG();x==3&&t.skipBits(1);let S=t.readUEG(),C=t.readUEG(),w=t.readBoolean(),T=0,E=0,D=0,O=0;w&&(T+=t.readUEG(),E+=t.readUEG(),D+=t.readUEG(),O+=t.readUEG());let k=t.readUEG(),A=t.readUEG(),j=t.readUEG(),M=t.readBoolean();for(let e=M?0:n;e<=n;e++)t.skipUEG(),t.skipUEG(),t.skipUEG();if(t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.readBoolean()&&t.readBoolean())for(let e=0;e<4;e++)for(let n=0;n<(e===3?2:6);n++)if(!t.readBoolean())t.readUEG();else{let n=Math.min(64,1<<4+(e<<1));e>1&&t.readEG();for(let e=0;e<n;e++)t.readEG()}t.readBoolean(),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.skipUEG(),t.skipUEG(),t.readBoolean());let N=t.readUEG(),P=0;for(let e=0;e<N;e++){let n=!1;if(e!==0&&(n=t.readBoolean()),n){e===N&&t.readUEG(),t.readBoolean(),t.readUEG();let n=0;for(let e=0;e<=P;e++){let e=t.readBoolean(),r=!1;e||(r=t.readBoolean()),(e||r)&&n++}P=n}else{let e=t.readUEG(),n=t.readUEG();P=e+n;for(let n=0;n<e;n++)t.readUEG(),t.readBoolean();for(let e=0;e<n;e++)t.readUEG(),t.readBoolean()}}if(t.readBoolean()){let e=t.readUEG();for(let n=0;n<e;n++){for(let e=0;e<j+4;e++)t.readBits(1);t.readBits(1)}}let F=0,I=1,L=1,R=!0,z=1,B=0;t.readBoolean(),t.readBoolean();let V=!1;if(t.readBoolean()){if(t.readBoolean()){let e=t.readUByte();e>0&&e<16?(I=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][e-1],L=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][e-1]):e===255&&(I=t.readBits(16),L=t.readBits(16))}if(t.readBoolean()&&t.readBoolean(),t.readBoolean()&&(t.readBits(3),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.readUByte(),t.readUByte())),t.readBoolean()&&(t.readUEG(),t.readUEG()),t.readBoolean(),t.readBoolean(),t.readBoolean(),V=t.readBoolean(),V&&(t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG()),t.readBoolean()&&(z=t.readBits(32),B=t.readBits(32),t.readBoolean()&&t.readUEG(),t.readBoolean())){let e=t.readBoolean(),r=t.readBoolean(),i=!1;(e||r)&&(i=t.readBoolean(),i&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),i&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5));for(let o=0;o<=n;o++){R=t.readBoolean();let n=R||t.readBoolean(),o=!1;n?t.readEG():o=t.readBoolean();let c=o?1:t.readUEG()+1;if(e)for(let e=0;e<c;e++)t.readUEG(),t.readUEG(),i&&(t.readUEG(),t.readUEG()),t.skipBits(1);if(r)for(let e=0;e<c;e++)t.readUEG(),t.readUEG(),i&&(t.readUEG(),t.readUEG()),t.skipBits(1)}}t.readBoolean()&&(t.readBoolean(),t.readBoolean(),t.readBoolean(),F=t.readUEG())}let H=S,U=C;if(w){let e=1,t=1;x===1?e=t=2:x==2&&(e=2),H=S-e*E-e*T,U=C-t*O-t*D}let W=r?[`A`,`B`,`C`][r]:``,G=c<<24|l<<16|u<<8|d,K=0;for(let e=0;e<32;e++)K=(K|(G>>e&1)<<31-e)>>>0;let ee=K.toString(16);return o===1&&ee===`2`&&(ee=`6`),{codecString:`hvc1.${W}${o}.${ee}.${i?`H`:`L`}${v}.B0`,params:{general_tier_flag:i,general_profile_idc:o,general_profile_space:r,general_profile_compatibility_flags:[c,l,u,d],general_constraint_indicator_flags:[f,p,m,h,g,_],general_level_idc:v,bit_depth:k+8,bit_depth_luma_minus8:k,bit_depth_chroma_minus8:A,min_spatial_segmentation_idc:F,chroma_format_idc:x,frame_rate:{fixed:R,fps:B/z}},width:H,height:U,pixelRatio:[I,L]}}readPPS(e){let t=new _c(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.skipUEG(),t.skipUEG(),t.skipBits(2),t.skipBits(3),t.skipBits(2),t.skipUEG(),t.skipUEG(),t.skipEG(),t.skipBits(2),t.readBoolean()&&t.skipUEG(),t.skipEG(),t.skipEG(),t.skipBits(4);let n=t.readBoolean(),r=t.readBoolean(),i=1;return r&&n?i=0:r?i=3:n&&(i=2),{parallelismType:i}}matchSPS(e,t){return String.fromCharCode.apply(null,e).substr(3)===String.fromCharCode.apply(null,t).substr(3)}},bc=188,xc=class e{constructor(e,t,n,r){this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.logger=r,this.videoParser=null}static probe(t,n){let r=e.syncOffset(t);return r>0&&n.warn(`MPEG2-TS detected but first sync word found @ offset ${r}`),r!==-1}static syncOffset(e){let t=e.length,n=Math.min(bc*5,t-bc)+1,r=0;for(;r<n;){let i=!1,o=-1,c=0;for(let l=r;l<t;l+=bc)if(e[l]===71&&(t-l===bc||e[l+bc]===71)){if(c++,o===-1&&(o=l,o!==0&&(n=Math.min(o+bc*99,e.length-bc)+1)),i||=Yr(e,l)===0,i&&c>1&&(o===0&&c>2||l+bc>n))return o}else if(c)return-1;else break;r++}return-1}static createTrack(e,t){return{container:e===`video`||e===`audio`?`video/mp2t`:void 0,type:e,id:Wo[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e===`audio`?t:void 0}}resetInitSegment(t,n,r,i){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=e.createTrack(`video`),this._videoTrack.duration=i,this._audioTrack=e.createTrack(`audio`,i),this._id3Track=e.createTrack(`id3`),this._txtTrack=e.createTrack(`text`),this._audioTrack.segmentCodec=`aac`,this.videoParser=null,this.aacOverFlow=null,this.remainderData=null,this.audioCodec=n,this.videoCodec=r}resetTimeStamp(){}resetContiguity(){let{_audioTrack:e,_videoTrack:t,_id3Track:n}=this;e&&(e.pesData=null),t&&(t.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(t,n,r=!1,i=!1){r||(this.sampleAes=null);let o,c=this._videoTrack,l=this._audioTrack,u=this._id3Track,d=this._txtTrack,f=c.pid,p=c.pesData,m=l.pid,h=u.pid,g=l.pesData,_=u.pesData,v=null,y=this.pmtParsed,b=this._pmtId,x=t.length;if(this.remainderData&&=(t=Ce(this.remainderData,t),x=t.length,null),x<bc&&!i)return this.remainderData=t,{audioTrack:l,videoTrack:c,id3Track:u,textTrack:d};let S=Math.max(0,e.syncOffset(t));x-=(x-S)%bc,x<t.byteLength&&!i&&(this.remainderData=new Uint8Array(t.buffer,x,t.buffer.byteLength-x));let C=0;for(let e=S;e<x;e+=bc)if(t[e]===71){let n=!!(t[e+1]&64),i=Yr(t,e),x=(t[e+3]&48)>>4,C;if(x>1){if(C=e+5+t[e+4],C===e+bc)continue}else C=e+4;switch(i){case f:n&&(p&&(o=ei(p,this.logger))&&(this.readyVideoParser(c.segmentCodec),this.videoParser!==null&&this.videoParser.parsePES(c,d,o,!1)),p={data:[],size:0}),p&&(p.data.push(t.subarray(C,e+bc)),p.size+=e+bc-C);break;case m:if(n){if(g&&(o=ei(g,this.logger)))switch(l.segmentCodec){case`aac`:this.parseAACPES(l,o);break;case`mp3`:this.parseMPEGPES(l,o);break;case`ac3`:this.parseAC3PES(l,o);break}g={data:[],size:0}}g&&(g.data.push(t.subarray(C,e+bc)),g.size+=e+bc-C);break;case h:n&&(_&&(o=ei(_,this.logger))&&this.parseID3PES(u,o),_={data:[],size:0}),_&&(_.data.push(t.subarray(C,e+bc)),_.size+=e+bc-C);break;case 0:n&&(C+=t[C]+1),b=this._pmtId=Xr(t,C);break;case b:{n&&(C+=t[C]+1);let i=Zr(t,C,this.typeSupported,r,this.observer,this.logger);f=i.videoPid,f>0&&(c.pid=f,c.segmentCodec=i.segmentVideoCodec),m=i.audioPid,m>0&&(l.pid=m,l.segmentCodec=i.segmentAudioCodec),h=i.id3Pid,h>0&&(u.pid=h),v!==null&&!y&&(this.logger.warn(`MPEG-TS PMT found at ${e} after unknown PID '${v}'. Backtracking to sync byte @${S} to parse all TS packets.`),v=null,e=S-188),y=this.pmtParsed=!0;break}case 17:case 8191:break;default:v=i;break}}else C++;C>0&&Qr(this.observer,Error(`Found ${C} TS packet/s that do not start with 0x47`),void 0,this.logger),c.pesData=p,l.pesData=g,u.pesData=_;let w={audioTrack:l,videoTrack:c,id3Track:u,textTrack:d};return i&&this.extractRemainingSamples(w),w}flush(){let{remainderData:e}=this;this.remainderData=null;let t;return t=e?this.demux(e,-1,!1,!0):{videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){let{audioTrack:t,videoTrack:n,id3Track:r,textTrack:i}=e,o=n.pesData,c=t.pesData,l=r.pesData,u;if(o&&(u=ei(o,this.logger))?(this.readyVideoParser(n.segmentCodec),this.videoParser!==null&&(this.videoParser.parsePES(n,i,u,!0),n.pesData=null)):n.pesData=o,c&&(u=ei(c,this.logger))){switch(t.segmentCodec){case`aac`:this.parseAACPES(t,u);break;case`mp3`:this.parseMPEGPES(t,u);break;case`ac3`:this.parseAC3PES(t,u);break}t.pesData=null}else c!=null&&c.size&&this.logger.log(`last AAC PES packet truncated,might overlap between fragments`),t.pesData=c;l&&(u=ei(l,this.logger))?(this.parseID3PES(r,u),r.pesData=null):r.pesData=l}demuxSampleAes(e,t,n){let r=this.demux(e,n,!0,!this.config.progressive),i=this.sampleAes=new hc(this.observer,this.config,t);return this.decrypt(r,i)}readyVideoParser(e){this.videoParser===null&&(e===`avc`?this.videoParser=new vc:e===`hevc`&&(this.videoParser=new yc))}decrypt(e,t){return new Promise(n=>{let{audioTrack:r,videoTrack:i}=e;r.samples&&r.segmentCodec===`aac`?t.decryptAacSamples(r.samples,0,()=>{i.samples?t.decryptAvcSamples(i.samples,0,0,()=>{n(e)}):n(e)}):i.samples&&t.decryptAvcSamples(i.samples,0,0,()=>{n(e)})})}destroy(){this.observer&&this.observer.removeAllListeners(),this.config=this.logger=this.observer=null,this.aacOverFlow=this.videoParser=this.remainderData=this.sampleAes=null,this._videoTrack=this._audioTrack=this._id3Track=this._txtTrack=void 0}parseAACPES(e,t){let n=0,r=this.aacOverFlow,i=t.data;if(r){this.aacOverFlow=null;let t=r.missing,o=r.sample.unit.byteLength;if(t===-1)i=Ce(r.sample.unit,i);else{let c=o-t;r.sample.unit.set(i.subarray(0,t),c),e.samples.push(r.sample),n=r.missing}}let o,c;for(o=n,c=i.length;o<c-1&&!_r(i,o);o++);if(o!==n){let e,t=o<c-1;if(e=t?`AAC PES did not start with ADTS header,offset:${o}`:`No ADTS header found in AAC PES`,Qr(this.observer,Error(e),t,this.logger),!t)return}br(e,this.observer,i,o,this.audioCodec);let l;if(t.pts!==void 0)l=t.pts;else if(r){let t=xr(e.samplerate);l=r.sample.pts+t}else{this.logger.warn(`[tsdemuxer]: AAC PES unknown PTS`);return}let u=0,d;for(;o<c;)if(d=Cr(e,i,o,l,u),o+=d.length,d.missing){this.aacOverFlow=d;break}else for(u++;o<c-1&&!_r(i,o);o++);}parseMPEGPES(e,t){let n=t.data,r=n.length,i=0,o=0,c=t.pts;if(c===void 0){this.logger.warn(`[tsdemuxer]: MPEG PES unknown PTS`);return}for(;o<r;)if(Wr(n,o)){let t=Vr(e,n,o,c,i);if(t)o+=t.length,i++;else break}else o++}parseAC3PES(e,t){{let n=t.data,r=t.pts;if(r===void 0){this.logger.warn(`[tsdemuxer]: AC3 PES unknown PTS`);return}let i=n.length,o=0,c=0,l;for(;c<i&&(l=qr(e,n,c,r,o++))>0;)c+=l}}parseID3PES(e,t){if(t.pts===void 0){this.logger.warn(`[tsdemuxer]: ID3 PES unknown PTS`);return}let n=j({},t,{type:this._videoTrack?tc.emsg:tc.audioId3,duration:1/0});e.samples.push(n)}},Sc=class{static getSilentFrame(e,t){switch(e){case`mp4a.40.2`:if(t===1)return new Uint8Array([0,200,0,128,35,128]);if(t===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(t===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(t===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(t===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(t===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(t===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(t===2||t===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}}},Cc=2**32-1,wc=class e{static init(){e.types={avc1:[],avcC:[],hvc1:[],hvcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],dac3:[],"ac-3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};let t;for(t in e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);e.HDLR_TYPES={video:new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),audio:new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0])};let n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]);e.STTS=e.STSC=e.STCO=new Uint8Array([0,0,0,0,0,0,0,0]),e.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),e.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),e.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),e.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);let r=new Uint8Array([105,115,111,109]),i=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);e.FTYP=e.box(e.types.ftyp,r,o,r,i),e.DINF=e.box(e.types.dinf,e.box(e.types.dref,n))}static box(e,...t){let n=8,r=t.length,i=r;for(;r--;)n+=t[r].byteLength;let o=new Uint8Array(n);for(o[0]=n>>24&255,o[1]=n>>16&255,o[2]=n>>8&255,o[3]=n&255,o.set(e,4),r=0,n=8;r<i;r++)o.set(t[r],n),n+=t[r].byteLength;return o}static hdlr(t){return e.box(e.types.hdlr,e.HDLR_TYPES[t])}static mdat(t){return e.box(e.types.mdat,t)}static mdhd(t,n){n*=t;let r=Math.floor(n/(Cc+1)),i=Math.floor(n%(Cc+1));return e.box(e.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,r>>24,r>>16&255,r>>8&255,r&255,i>>24,i>>16&255,i>>8&255,i&255,85,196,0,0]))}static mdia(t){return e.box(e.types.mdia,e.mdhd(t.timescale||0,t.duration||0),e.hdlr(t.type),e.minf(t))}static mfhd(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255]))}static minf(t){return t.type===`audio`?e.box(e.types.minf,e.box(e.types.smhd,e.SMHD),e.DINF,e.stbl(t)):e.box(e.types.minf,e.box(e.types.vmhd,e.VMHD),e.DINF,e.stbl(t))}static moof(t,n,r){return e.box(e.types.moof,e.mfhd(t),e.traf(r,n))}static moov(t){let n=t.length,r=[];for(;n--;)r[n]=e.trak(t[n]);return e.box.apply(null,[e.types.moov,e.mvhd(t[0].timescale||0,t[0].duration||0)].concat(r,e.mvex(t)))}static mvex(t){let n=t.length,r=[];for(;n--;)r[n]=e.trex(t[n]);return e.box.apply(null,[e.types.mvex,...r])}static mvhd(t,n){n*=t;let r=Math.floor(n/(Cc+1)),i=Math.floor(n%(Cc+1)),o=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,r>>24,r>>16&255,r>>8&255,r&255,i>>24,i>>16&255,i>>8&255,i&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return e.box(e.types.mvhd,o)}static sdtp(t){let n=t.samples||[],r=new Uint8Array(4+n.length),i,o;for(i=0;i<n.length;i++)o=n[i].flags,r[i+4]=o.dependsOn<<4|o.isDependedOn<<2|o.hasRedundancy;return e.box(e.types.sdtp,r)}static stbl(t){return e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.STTS),e.box(e.types.stsc,e.STSC),e.box(e.types.stsz,e.STSZ),e.box(e.types.stco,e.STCO))}static avc1(t){let n=[],r=[],i,o,c;for(i=0;i<t.sps.length;i++)o=t.sps[i],c=o.byteLength,n.push(c>>>8&255),n.push(c&255),n=n.concat(Array.prototype.slice.call(o));for(i=0;i<t.pps.length;i++)o=t.pps[i],c=o.byteLength,r.push(c>>>8&255),r.push(c&255),r=r.concat(Array.prototype.slice.call(o));let l=e.box(e.types.avcC,new Uint8Array([1,n[3],n[4],n[5],255,224|t.sps.length].concat(n,[t.pps.length],r))),u=t.width,d=t.height,f=t.pixelRatio[0],p=t.pixelRatio[1];return e.box(e.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,u>>8&255,u&255,d>>8&255,d&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),l,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),e.box(e.types.pasp,new Uint8Array([f>>24,f>>16&255,f>>8&255,f&255,p>>24,p>>16&255,p>>8&255,p&255])))}static esds(e){let t=e.config;return new Uint8Array([0,0,0,0,3,25,0,1,0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,0,5,2,...t,6,1,2])}static audioStsd(e){let t=e.samplerate||0;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount||0,0,16,0,0,0,0,t>>8&255,t&255,0,0])}static mp4a(t){return e.box(e.types.mp4a,e.audioStsd(t),e.box(e.types.esds,e.esds(t)))}static mp3(t){return e.box(e.types[`.mp3`],e.audioStsd(t))}static ac3(t){return e.box(e.types[`ac-3`],e.audioStsd(t),e.box(e.types.dac3,t.config))}static stsd(t){let{segmentCodec:n}=t;if(t.type===`audio`){if(n===`aac`)return e.box(e.types.stsd,e.STSD,e.mp4a(t));if(n===`ac3`&&t.config)return e.box(e.types.stsd,e.STSD,e.ac3(t));if(n===`mp3`&&t.codec===`mp3`)return e.box(e.types.stsd,e.STSD,e.mp3(t))}else if(t.pps&&t.sps){if(n===`avc`)return e.box(e.types.stsd,e.STSD,e.avc1(t));if(n===`hevc`&&t.vps)return e.box(e.types.stsd,e.STSD,e.hvc1(t))}else throw Error(`video track missing pps or sps`);throw Error(`unsupported ${t.type} segment codec (${n}/${t.codec})`)}static tkhd(t){let n=t.id,r=(t.duration||0)*(t.timescale||0),i=t.width||0,o=t.height||0,c=Math.floor(r/(Cc+1)),l=Math.floor(r%(Cc+1));return e.box(e.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,n>>24&255,n>>16&255,n>>8&255,n&255,0,0,0,0,c>>24,c>>16&255,c>>8&255,c&255,l>>24,l>>16&255,l>>8&255,l&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,i&255,0,0,o>>8&255,o&255,0,0]))}static traf(t,n){let r=e.sdtp(t),i=t.id,o=Math.floor(n/(Cc+1)),c=Math.floor(n%(Cc+1));return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255])),e.box(e.types.tfdt,new Uint8Array([1,0,0,0,o>>24,o>>16&255,o>>8&255,o&255,c>>24,c>>16&255,c>>8&255,c&255])),e.trun(t,r.length+16+20+8+16+8+8),r)}static trak(t){return t.duration=t.duration||4294967295,e.box(e.types.trak,e.tkhd(t),e.mdia(t))}static trex(t){let n=t.id;return e.box(e.types.trex,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(t,n){let r=t.samples||[],i=r.length,o=12+16*i,c=new Uint8Array(o),l,u,d,f,p,m;for(n+=8+o,c.set([+(t.type===`video`),0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,i&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255],0),l=0;l<i;l++)u=r[l],d=u.duration,f=u.size,p=u.flags,m=u.cts,c.set([d>>>24&255,d>>>16&255,d>>>8&255,d&255,f>>>24&255,f>>>16&255,f>>>8&255,f&255,p.isLeading<<2|p.dependsOn,p.isDependedOn<<6|p.hasRedundancy<<4|p.paddingValue<<1|p.isNonSync,p.degradPrio&61440,p.degradPrio&15,m>>>24&255,m>>>16&255,m>>>8&255,m&255],12+16*l);return e.box(e.types.trun,c)}static initSegment(t){e.types||e.init();let n=e.moov(t);return Ce(e.FTYP,n)}static hvc1(t){let n=t.params,r=[t.vps,t.sps,t.pps],i=new Uint8Array([1,n.general_profile_space<<6|(n.general_tier_flag?32:0)|n.general_profile_idc,n.general_profile_compatibility_flags[0],n.general_profile_compatibility_flags[1],n.general_profile_compatibility_flags[2],n.general_profile_compatibility_flags[3],n.general_constraint_indicator_flags[0],n.general_constraint_indicator_flags[1],n.general_constraint_indicator_flags[2],n.general_constraint_indicator_flags[3],n.general_constraint_indicator_flags[4],n.general_constraint_indicator_flags[5],n.general_level_idc,240|n.min_spatial_segmentation_idc>>8,255&n.min_spatial_segmentation_idc,252|n.parallelismType,252|n.chroma_format_idc,248|n.bit_depth_luma_minus8,248|n.bit_depth_chroma_minus8,0,parseInt(n.frame_rate.fps),3|n.temporal_id_nested<<2|n.num_temporal_layers<<3|(n.frame_rate.fixed?64:0),r.length]),o=i.length;for(let e=0;e<r.length;e+=1){o+=3;for(let t=0;t<r[e].length;t+=1)o+=2+r[e][t].length}let c=new Uint8Array(o);c.set(i,0),o=i.length;let l=r.length-1;for(let e=0;e<r.length;e+=1){c.set(new Uint8Array([32+e|(e===l?128:0),0,r[e].length]),o),o+=3;for(let t=0;t<r[e].length;t+=1)c.set(new Uint8Array([r[e][t].length>>8,r[e][t].length&255]),o),o+=2,c.set(r[e][t],o),o+=r[e][t].length}let u=e.box(e.types.hvcC,c),d=t.width,f=t.height,p=t.pixelRatio[0],m=t.pixelRatio[1];return e.box(e.types.hvc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,d>>8&255,d&255,f>>8&255,f&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),u,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),e.box(e.types.pasp,new Uint8Array([p>>24,p>>16&255,p>>8&255,p&255,m>>24,m>>16&255,m>>8&255,m&255])))}},wc.types=void 0,wc.HDLR_TYPES=void 0,wc.STTS=void 0,wc.STSC=void 0,wc.STCO=void 0,wc.STSZ=void 0,wc.VMHD=void 0,wc.SMHD=void 0,wc.STSD=void 0,wc.FTYP=void 0,wc.DINF=void 0,Tc=9e4,Ec=10*1e3,Dc=1024,Oc=1152,kc=1536,Ac=null,jc=null,Mc=class extends ko{constructor(e,t,n,r){if(super(`mp4-remuxer`,r),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextVideoTs=null,this.nextAudioTs=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.ISGenerated=!1,Ac===null){let e=(navigator.userAgent||``).match(/Chrome\/(\d+)/i);Ac=e?parseInt(e[1]):0}if(jc===null){let e=navigator.userAgent.match(/Safari\/(\d+)/i);jc=e?parseInt(e[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){let t=this._initPTS;(!t||!e||e.trackId!==t.trackId||e.baseTime!==t.baseTime||e.timescale!==t.timescale)&&this.log(`Reset initPTS: ${t&&ai(t)} > ${e&&ai(e)}`),this._initPTS=this._initDTS=e}resetNextTimestamp(){this.log(`reset next timestamp`),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.log(`ISGenerated flag reset`),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1,n=e[0].pts,r=e.reduce((e,r)=>{let i=r.pts,o=i-e;return o<-4294967296&&(t=!0,i=si(i,n),o=i-e),o>0?e:i},n);return t&&this.debug(`PTS rollover detected`),r}remux(e,t,n,r,i,o,c,l){let u,d,f,p,m,h,g=i,_=i,v=e.pid>-1,y=t.pid>-1,b=t.samples.length,x=e.samples.length>0,S=c&&b>0||b>1;if((!v||x)&&(!y||S)||this.ISGenerated||c){if(this.ISGenerated){let e=this.videoTrackConfig;(e&&(t.width!==e.width||t.height!==e.height||t.pixelRatio?.[0]!==e.pixelRatio?.[0]||t.pixelRatio?.[1]!==e.pixelRatio?.[1])||!e&&S||this.nextAudioTs===null&&x)&&this.resetInitSegment()}this.ISGenerated||(f=this.generateIS(e,t,i,o));let n=this.isVideoContiguous,r=-1,c;if(S&&(r=ci(t.samples),!n&&this.config.forceKeyFrameOnDiscontinuity))if(h=!0,r>0){this.warn(`Dropped ${r} out of ${b} video samples due to a missing keyframe`);let e=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(r),t.dropped+=r,_+=(t.samples[0].pts-e)/t.inputTimeScale,c=_}else r===-1&&(this.warn(`No keyframe found out of ${b} video samples`),h=!1);if(this.ISGenerated){if(x&&S){let n=this.getVideoStartPts(t.samples),r=(si(e.samples[0].pts,n)-n)/t.inputTimeScale;g+=Math.max(0,r),_+=Math.max(0,-r)}if(x){if(e.samplerate||(this.warn(`regenerate InitSegment as audio detected`),f=this.generateIS(e,t,i,o)),d=this.remuxAudio(e,g,this.isAudioContiguous,o,y||S||l===Eo.AUDIO?_:void 0),S){let r=d?d.endPTS-d.startPTS:0;t.inputTimeScale||(this.warn(`regenerate InitSegment as video detected`),f=this.generateIS(e,t,i,o)),u=this.remuxVideo(t,_,n,r)}}else S&&(u=this.remuxVideo(t,_,n,0));u&&(u.firstKeyFrame=r,u.independent=r!==-1,u.firstKeyFramePTS=c)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(m=li(n,i,this._initPTS,this._initDTS)),r.samples.length&&(p=ui(r,i,this._initPTS))),{audio:d,video:u,initSegment:f,independent:h,text:p,id3:m}}computeInitPts(e,t,n,r){let i=Math.round(n*t),o=si(e,i);if(o<i+t)for(this.log(`Adjusting PTS for rollover in timeline near ${(i-o)/t} ${r}`);o<i+t;)o+=8589934592;return o-i}generateIS(e,t,n,r){let i=e.samples,o=t.samples,c=this.typeSupported,l={},u=this._initPTS,d=!u||r,f=`audio/mp4`,p,m,h,g=-1;if(d&&(p=m=1/0),e.config&&i.length){switch(e.timescale=e.samplerate,e.segmentCodec){case`mp3`:c.mpeg?(f=`audio/mpeg`,e.codec=``):c.mp3&&(e.codec=`mp3`);break;case`ac3`:e.codec=`ac-3`;break}l.audio={id:`audio`,container:f,codec:e.codec,initSegment:e.segmentCodec===`mp3`&&c.mpeg?new Uint8Array:wc.initSegment([e]),metadata:{channelCount:e.channelCount}},d&&(g=e.id,h=e.inputTimeScale,!u||h!==u.timescale?p=m=this.computeInitPts(i[0].pts,h,n,`audio`):d=!1)}if(t.sps&&t.pps&&o.length){if(t.timescale=t.inputTimeScale,l.video={id:`main`,container:`video/mp4`,codec:t.codec,initSegment:wc.initSegment([t]),metadata:{width:t.width,height:t.height}},d)if(g=t.id,h=t.inputTimeScale,!u||h!==u.timescale){let e=this.getVideoStartPts(o),t=si(o[0].dts,e),r=this.computeInitPts(t,h,n,`video`),i=this.computeInitPts(e,h,n,`video`);m=Math.min(m,r),p=Math.min(p,i)}else d=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(l).length)return this.ISGenerated=!0,d?(u&&this.warn(`Timestamps at playlist time: ${r?``:`~`}${n} ${p/h} != initPTS: ${u.baseTime/u.timescale} (${u.baseTime}/${u.timescale}) trackId: ${u.trackId}`),this.log(`Found initPTS at playlist time: ${n} offset: ${p/h} (${p}/${h}) trackId: ${g}`),this._initPTS={baseTime:p,timescale:h,trackId:g},this._initDTS={baseTime:m,timescale:h,trackId:g}):p=h=void 0,{tracks:l,initPTS:p,timescale:h,trackId:g}}remuxVideo(e,t,n,r){let i=e.inputTimeScale,o=e.samples,c=[],l=o.length,u=this._initPTS,d=u.baseTime*i/u.timescale,f=this.nextVideoTs,p=8,m=this.videoSampleDuration,h,g,_=1/0,v=-1/0,y=!1;if(!n||f===null){let e=d+t*i,r=o[0].pts-si(o[0].dts,o[0].pts);Ac&&f!==null&&Math.abs(e-r-(f+d))<15e3?n=!0:f=e-r-d}let b=f+d;for(let e=0;e<l;e++){let t=o[e];t.pts=si(t.pts,b),t.dts=si(t.dts,b),t.dts<o[e>0?e-1:e].dts&&(y=!0)}y&&o.sort(function(e,t){let n=e.dts-t.dts,r=e.pts-t.pts;return n||r}),h=o[0].dts,g=o[o.length-1].dts;let x=g-h,S=x?Math.round(x/(l-1)):m||e.inputTimeScale/30;if(n){let n=h-b,r=n>S,i=n<-1;if((r||i)&&(r?this.warn(`${(e.segmentCodec||``).toUpperCase()}: ${ri(n,!0)} ms (${n}dts) hole between fragments detected at ${t.toFixed(3)}`):this.warn(`${(e.segmentCodec||``).toUpperCase()}: ${ri(-n,!0)} ms (${n}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!i||b>=o[0].pts||Ac)){h=b;let e=o[0].pts-n;if(r)o[0].dts=h,o[0].pts=e;else{let t=!0;for(let r=0;r<o.length&&!(o[r].dts>e&&t);r++){let e=o[r].pts;if(o[r].dts-=n,o[r].pts-=n,r<o.length-1){let n=o[r+1].pts;t=n<=o[r].pts==n<=e}}}this.log(`Video: Initial PTS/DTS adjusted: ${ri(e,!0)}/${ri(h,!0)}, delta: ${ri(n,!0)} ms`)}}h=Math.max(0,h);let C=0,w=0,T=h;for(let e=0;e<l;e++){let t=o[e],n=t.units,r=n.length,i=0;for(let e=0;e<r;e++)i+=n[e].data.length;w+=i,C+=r,t.length=i,t.dts<T?(t.dts=T,T+=S/4|0||1):T=t.dts,_=Math.min(t.pts,_),v=Math.max(t.pts,v)}g=o[l-1].dts;let E=w+4*C+8,D;try{D=new Uint8Array(E)}catch(e){this.observer.emit(Q.ERROR,Q.ERROR,{type:wo.MUX_ERROR,details:Z.REMUX_ALLOC_ERROR,fatal:!1,error:e,bytes:E,reason:`fail allocating video mdat ${E}`});return}let O=new DataView(D.buffer);O.setUint32(0,E),D.set(wc.types.mdat,4);let k=!1,A=1/0,M=1/0,N=-1/0,P=-1/0;for(let e=0;e<l;e++){let t=o[e],n=t.units,u=0;for(let e=0,t=n.length;e<t;e++){let t=n[e],r=t.data,i=t.data.byteLength;O.setUint32(p,i),p+=4,D.set(r,p),p+=i,u+=4+i}let f;if(e<l-1)m=o[e+1].dts-t.dts,f=o[e+1].pts-t.pts;else{let n=this.config,c=e>0?t.dts-o[e-1].dts:S;if(f=e>0?t.pts-o[e-1].pts:S,n.stretchShortVideoTrack&&this.nextAudioTs!==null){let e=Math.floor(n.maxBufferHole*i),o=(r?_+r*i:this.nextAudioTs+d)-t.pts;o>e?(m=o-c,m<0?m=c:k=!0,this.log(`It is approximately ${o/90} ms to the next segment; using duration ${m/90} ms for the last video frame.`)):m=c}else m=c}let h=Math.round(t.pts-t.dts);A=Math.min(A,m),N=Math.max(N,m),M=Math.min(M,f),P=Math.max(P,f),c.push(oi(t.key,m,u,h))}if(c.length){if(Ac){if(Ac<70){let e=c[0].flags;e.dependsOn=2,e.isNonSync=0}}else if(jc&&P-M<N-A&&S/N<.025&&c[0].cts===0){this.warn(`Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.`);let e=h;for(let t=0,n=c.length;t<n;t++){let r=e+c[t].duration,i=e+c[t].cts;if(t<n-1){let e=r+c[t+1].cts;c[t].duration=e-i}else c[t].duration=t?c[t-1].duration:S;c[t].cts=0,e=r}}}m=k||!m?S:m,this.nextVideoTs=f=g+m-d,this.videoSampleDuration=m,this.isVideoContiguous=!0;let F={data1:wc.moof(e.sequenceNumber++,h,j(e,{samples:c})),data2:D,startPTS:(_-d)/i,endPTS:(v+m-d)/i,startDTS:(h-d)/i,endDTS:f/i,type:`video`,hasAudio:!1,hasVideo:!0,nb:c.length,dropped:e.dropped};return e.samples=[],e.dropped=0,F}getSamplesPerFrame(e){switch(e.segmentCodec){case`mp3`:return Oc;case`ac3`:return kc;default:return Dc}}remuxAudio(e,t,n,r,i){let o=e.inputTimeScale,c=o/(e.samplerate?e.samplerate:o),l=this.getSamplesPerFrame(e),u=l*c,d=this._initPTS,f=e.segmentCodec===`mp3`&&this.typeSupported.mpeg,p=[],m=i!==void 0,h=e.samples,g=f?0:8,_=this.nextAudioTs||-1,v=d.baseTime*o/d.timescale,y=v+t*o;if(this.isAudioContiguous=n||=h.length&&_>0&&(r&&Math.abs(y-(_+v))<9e3||Math.abs(si(h[0].pts,y)-(_+v))<20*u),h.forEach(function(e){e.pts=si(e.pts,y)}),!n||_<0){let e=h.length;if(h=h.filter(e=>e.pts>=0),e!==h.length&&this.warn(`Removed ${h.length-e} of ${e} samples (initPTS ${v} / ${o})`),!h.length)return;_=i===0?0:r&&!m?Math.max(0,y-v):h[0].pts-v}if(e.segmentCodec===`aac`){let t=this.config.maxAudioFramesDrift;for(let n=0,r=_+v;n<h.length;n++){let i=h[n],c=i.pts,l=c-r,d=Math.abs(1e3*l/o);if(l<=-t*u&&m)n===0&&(this.warn(`Audio frame @ ${(c/o).toFixed(3)}s overlaps marker by ${Math.round(1e3*l/o)} ms.`),this.nextAudioTs=_=c-v,r=c);else if(l>=t*u&&d<Ec&&m){let t=Math.round(l/u);for(r=c-t*u;r<0&&t&&u;)t--,r+=u;n===0&&(this.nextAudioTs=_=r-v),this.warn(`Injecting ${t} audio frames @ ${((r-v)/o).toFixed(3)}s due to ${Math.round(1e3*l/o)} ms gap.`);for(let o=0;o<t;o++){let t=Sc.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);t||=(this.log(`Unable to get silent frame for given audio codec; duplicating last frame instead.`),i.unit.subarray()),h.splice(n,0,{unit:t,pts:r}),r+=u,n++}}i.pts=r,r+=u}}let b=null,x=null,S,C=0,w=h.length;for(;w--;)C+=h[w].unit.byteLength;for(let t=0,r=h.length;t<r;t++){let r=h[t],i=r.unit,o=r.pts;if(x!==null){let e=p[t-1];e.duration=Math.round((o-x)/c)}else if(n&&e.segmentCodec===`aac`&&(o=_+v),b=o,C>0){C+=g;try{S=new Uint8Array(C)}catch(e){this.observer.emit(Q.ERROR,Q.ERROR,{type:wo.MUX_ERROR,details:Z.REMUX_ALLOC_ERROR,fatal:!1,error:e,bytes:C,reason:`fail allocating audio mdat ${C}`});return}f||(new DataView(S.buffer).setUint32(0,C),S.set(wc.types.mdat,4))}else return;S.set(i,g);let u=i.byteLength;g+=u,p.push(oi(!0,l,u,0)),x=o}let T=p.length;if(!T)return;let E=p[p.length-1];_=x-v,this.nextAudioTs=_+c*E.duration;let D=f?new Uint8Array:wc.moof(e.sequenceNumber++,b/c,j({},e,{samples:p}));e.samples=[];let O=(b-v)/o,k=this.nextAudioTs/o,A={data1:D,data2:S,startPTS:O,endPTS:k,startDTS:O,endDTS:k,type:`audio`,hasAudio:!0,hasVideo:!1,nb:T};return this.isAudioContiguous=!0,A}},Nc=class extends ko{constructor(e,t,n,r){super(`passthrough-remuxer`,r),this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null,this.isVideoContiguous=!1}destroy(){}resetTimeStamp(e){this.lastEndTime=null;let t=this.initPTS;t&&e&&t.baseTime===e.baseTime&&t.timescale===e.timescale||(this.initPTS=e)}resetNextTimestamp(){this.isVideoContiguous=!1,this.lastEndTime=null}resetInitSegment(e,t,n,r){this.audioCodec=t,this.videoCodec=n,this.generateInitSegment(e,r),this.emitInitSegment=!0}generateInitSegment(e,t){let{audioCodec:n,videoCodec:r}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}let{audio:i,video:o}=this.initData=ue(e);if(t)_e(e,t);else{let e=i||o;e!=null&&e.encrypted&&this.warn(`Init segment with encrypted track with has no key ("${e.codec}")!`)}i&&(n=pi(i,Ro.AUDIO,this)),o&&(r=pi(o,Ro.VIDEO,this));let c={};i&&o?c.audiovideo={container:`video/mp4`,codec:n+`,`+r,supplemental:o.supplemental,encrypted:o.encrypted,initSegment:e,id:`main`}:i?c.audio={container:`audio/mp4`,codec:n,encrypted:i.encrypted,initSegment:e,id:`audio`}:o?c.video={container:`video/mp4`,codec:r,supplemental:o.supplemental,encrypted:o.encrypted,initSegment:e,id:`main`}:this.warn(`initSegment does not contain moov or trak boxes.`),this.initTracks=c}remux(e,t,n,r,i,o){var c,l;let{initPTS:u,lastEndTime:d}=this,f={audio:void 0,video:void 0,text:r,id3:n,initSegment:void 0};X(d)||(d=this.lastEndTime=i||0);let p=t.samples;if(!p.length)return f;let m={initPTS:void 0,timescale:void 0,trackId:void 0},h=this.initData;if((c=h)!=null&&c.length||(this.generateInitSegment(p),h=this.initData),!((l=h)!=null&&l.length))return this.warn(`Failed to generate initSegment.`),f;this.emitInitSegment&&=(m.tracks=this.initTracks,!1);let g=xe(p,h,this),_=h.audio?g[h.audio.id]:null,v=h.video?g[h.video.id]:null,y=di(v,1/0),b=di(_,1/0),x=di(v,0,!0),S=di(_,0,!0),C=i,w=0,T=_&&(!v||!u&&b<y||u&&u.trackId===h.audio.id),E=T?_:v;if(E){let e=E.timescale,t=E.start-i*e,n=T?h.audio.id:h.video.id;C=E.start/e,w=T?S-b:x-y,(o||!u)&&(fi(u,C,i,w)||e!==u.timescale)&&(u&&this.warn(`Timestamps at playlist time: ${o?``:`~`}${i} ${t/e} != initPTS: ${u.baseTime/u.timescale} (${u.baseTime}/${u.timescale}) trackId: ${u.trackId}`),this.log(`Found initPTS at playlist time: ${i} offset: ${C-i} (${t}/${e}) trackId: ${n}`),u=null,m.initPTS=t,m.timescale=e,m.trackId=n)}else this.warn(`No audio or video samples found for initPTS at playlist time: ${i}`);u?(m.initPTS=u.baseTime,m.timescale=u.timescale,m.trackId=u.trackId):((!m.timescale||m.trackId===void 0||m.initPTS===void 0)&&(this.warn(`Could not set initPTS`),m.initPTS=C,m.timescale=1,m.trackId=-1),this.initPTS=u={baseTime:m.initPTS,timescale:m.timescale,trackId:m.trackId});let D=C-u.baseTime/u.timescale,O=D+w;w>0?this.lastEndTime=O:(this.warn(`Duration parsed from mp4 should be greater than zero`),this.resetNextTimestamp());let k=!!h.audio,A=!!h.video,j=``;k&&(j+=`audio`),A&&(j+=`video`);let M=(h.audio?h.audio.encrypted:!1)||(h.video?h.video.encrypted:!1),N={data1:p,startPTS:D,startDTS:D,endPTS:O,endDTS:O,type:j,hasAudio:k,hasVideo:A,nb:1,dropped:0,encrypted:M};f.audio=k&&!A?N:void 0,f.video=A?N:void 0;let P=v?.sampleCount;if(P){let e=v.keyFrameIndex,t=e!==-1;N.nb=P,N.dropped=e===0||this.isVideoContiguous?0:t?e:P,N.independent=t,N.firstKeyFrame=e,t&&v.keyFrameStart&&(N.firstKeyFramePTS=(v.keyFrameStart-u.baseTime)/u.timescale),this.isVideoContiguous||(f.independent=t),this.isVideoContiguous||=t,N.dropped&&this.warn(`fmp4 does not start with IDR: firstIDR ${e}/${P} dropped: ${N.dropped} start: ${N.firstKeyFramePTS||`NA`}`)}return f.initSegment=m,f.id3=li(n,i,u,u),r.samples.length&&(f.text=ui(r,i,u)),f}};try{Pc=self.performance.now.bind(self.performance)}catch{Pc=Date.now}Fc=[{demux:mc,remux:Nc},{demux:xc,remux:Mc},{demux:lc,remux:Mc},{demux:fc,remux:Mc}],Fc.splice(2,0,{demux:dc,remux:Mc}),Ic=class{constructor(e,t,n,r,i,o){this.asyncResult=!1,this.logger=void 0,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=n,this.id=i,this.logger=o}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,n,r){let i=n.transmuxing;i.executeStart=Pc();let o=new Uint8Array(e),{currentTransmuxState:c,transmuxConfig:l}=this;r&&(this.currentTransmuxState=r);let{contiguous:u,discontinuity:d,trackSwitch:f,accurateTimeOffset:p,timeOffset:m,initSegmentChange:h}=r||c,{audioCodec:g,videoCodec:_,defaultInitPts:v,duration:y,initSegmentData:b}=l,x=mi(o,t);if(x&&en(x.method)){let e=this.getDecrypter(),t=tn(x.method);if(e.isSync()){let r=e.softwareDecrypt(o,x.key.buffer,x.iv.buffer,t);if(n.part>-1){let t=e.flush();r=t&&t.buffer}if(!r)return i.executeEnd=Pc(),Lc(n);o=new Uint8Array(r)}else return this.asyncResult=!0,this.decryptionPromise=e.webCryptoDecrypt(o,x.key.buffer,x.iv.buffer,t).then(e=>{let t=this.push(e,null,n);return this.decryptionPromise=null,t}),this.decryptionPromise}let S=this.needsProbing(d,f);if(S){let e=this.configureTransmuxer(o);if(e)return this.logger.warn(`[transmuxer] ${e.message}`),this.observer.emit(Q.ERROR,Q.ERROR,{type:wo.MEDIA_ERROR,details:Z.FRAG_PARSING_ERROR,fatal:!1,error:e,reason:e.message}),i.executeEnd=Pc(),Lc(n)}(d||f||h||S)&&this.resetInitSegment(b,g,_,y,t),(d||h||S)&&this.resetInitialTimestamp(v),u||this.resetContiguity();let C=this.transmux(o,x,m,p,n);this.asyncResult=hi(C);let w=this.currentTransmuxState;return w.contiguous=!0,w.discontinuity=!1,w.trackSwitch=!1,i.executeEnd=Pc(),C}flush(e){let t=e.transmuxing;t.executeStart=Pc();let{decrypter:n,currentTransmuxState:r,decryptionPromise:i}=this;if(i)return this.asyncResult=!0,i.then(()=>this.flush(e));let o=[],{timeOffset:c}=r;if(n){let t=n.flush();t&&o.push(this.push(t.buffer,null,e))}let{demuxer:l,remuxer:u}=this;if(!l||!u){t.executeEnd=Pc();let n=[Lc(e)];return this.asyncResult?Promise.resolve(n):n}let d=l.flush(c);return hi(d)?(this.asyncResult=!0,d.then(t=>(this.flushRemux(o,t,e),o))):(this.flushRemux(o,d,e),this.asyncResult?Promise.resolve(o):o)}flushRemux(e,t,n){let{audioTrack:r,videoTrack:i,id3Track:o,textTrack:c}=t,{accurateTimeOffset:l,timeOffset:u}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${n.sn}${n.part>-1?` part: `+n.part:``} of ${this.id===Eo.MAIN?`level`:`track`} ${n.level}`);let d=this.remuxer.remux(r,i,o,c,u,l,!0,this.id);e.push({remuxResult:d,chunkMeta:n}),n.transmuxing.executeEnd=Pc()}resetInitialTimestamp(e){let{demuxer:t,remuxer:n}=this;!t||!n||(t.resetTimeStamp(e),n.resetTimeStamp(e))}resetContiguity(){let{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,n,r,i){let{demuxer:o,remuxer:c}=this;!o||!c||(o.resetInitSegment(e,t,n,r),c.resetInitSegment(e,t,n,i))}destroy(){this.demuxer&&=(this.demuxer.destroy(),void 0),this.remuxer&&=(this.remuxer.destroy(),void 0)}transmux(e,t,n,r,i){let o;return o=t&&t.method===`SAMPLE-AES`?this.transmuxSampleAes(e,t,n,r,i):this.transmuxUnencrypted(e,n,r,i),o}transmuxUnencrypted(e,t,n,r){let{audioTrack:i,videoTrack:o,id3Track:c,textTrack:l}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(i,o,c,l,t,n,!1,this.id),chunkMeta:r}}transmuxSampleAes(e,t,n,r,i){return this.demuxer.demuxSampleAes(e,t,n).then(e=>({remuxResult:this.remuxer.remux(e.audioTrack,e.videoTrack,e.id3Track,e.textTrack,n,r,!1,this.id),chunkMeta:i}))}configureTransmuxer(e){let{config:t,observer:n,typeSupported:r}=this,i;for(let t=0,n=Fc.length;t<n;t++){var o;if((o=Fc[t].demux)!=null&&o.probe(e,this.logger)){i=Fc[t];break}}if(!i)return Error(`Failed to find demuxer by probing fragment data`);let c=this.demuxer,l=this.remuxer,u=i.remux,d=i.demux;(!l||!(l instanceof u))&&(this.remuxer=new u(n,t,r,this.logger)),(!c||!(c instanceof d))&&(this.demuxer=new d(n,t,r,this.logger),this.probe=d.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||=this.decrypter=new _s(this.config),e}},Lc=e=>({remuxResult:{},chunkMeta:e}),Rc=class{constructor(e,t,n,r,i){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=n,this.duration=r,this.defaultInitPts=i||null}},zc=class{constructor(e,t,n,r,i,o){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=n,this.trackSwitch=r,this.timeOffset=i,this.initSegmentChange=o}},Bc=0,Vc=class{constructor(e,t,n,r){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=Bc++,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.onWorkerMessage=e=>{let t=e.data,n=this.hls;if(!(!n||!(t!=null&&t.event)||t.instanceNo!==this.instanceNo))switch(t.event){case`init`:{let e=this.workerContext?.objectURL;e&&self.URL.revokeObjectURL(e);break}case`transmuxComplete`:this.handleTransmuxComplete(t.data);break;case`flush`:this.onFlush(t.data);break;case`workerLog`:n.logger[t.data.logType]&&n.logger[t.data.logType](t.data.message);break;default:t.data=t.data||{},t.data.frag=this.frag,t.data.part=this.part,t.data.id=this.id,n.trigger(t.event,t.data);break}},this.onWorkerError=e=>{if(!this.hls)return;let t=Error(`${e.message} (${e.filename}:${e.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(Q.ERROR,{type:wo.OTHER_ERROR,details:Z.INTERNAL_EXCEPTION,fatal:!1,event:`demuxerWorker`,error:t})};let i=e.config;this.hls=e,this.id=t,this.useWorker=!!i.enableWorker,this.onTransmuxComplete=n,this.onFlush=r;let o=(e,t)=>{t||={},t.frag=this.frag||void 0,e===Q.ERROR&&(t=t,t.parent=this.id,t.part=this.part,this.error=t.error),this.hls.trigger(e,t)};this.observer=new Xs,this.observer.on(Q.FRAG_DECRYPTED,o),this.observer.on(Q.ERROR,o);let c=qe(i.preferManagedMediaSource);if(this.useWorker&&typeof Worker<`u`){let n=this.hls.logger;if(i.workerPath||ir()){try{i.workerPath?(n.log(`loading Web Worker ${i.workerPath} for "${t}"`),this.workerContext=or(i.workerPath)):(n.log(`injecting Web Worker for "${t}"`),this.workerContext=ar());let{worker:e}=this.workerContext;e.addEventListener(`message`,this.onWorkerMessage),e.addEventListener(`error`,this.onWorkerError),e.postMessage({instanceNo:this.instanceNo,cmd:`init`,typeSupported:c,id:t,config:is(i)})}catch(r){n.warn(`Error setting up "${t}" Web Worker, fallback to inline`,r),this.terminateWorker(),this.error=null,this.transmuxer=new Ic(this.observer,c,i,``,t,e.logger)}return}}this.transmuxer=new Ic(this.observer,c,i,``,t,e.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){let e=this.instanceNo;this.instanceNo=Bc++;let t=this.hls.config,n=qe(t.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:`reset`,resetNo:e,typeSupported:n,id:this.id,config:is(t)})}}terminateWorker(){if(this.workerContext){let{worker:e}=this.workerContext;this.workerContext=null,e.removeEventListener(`message`,this.onWorkerMessage),e.removeEventListener(`error`,this.onWorkerError),sr(this.hls.config.workerPath)}}destroy(){if(this.workerContext)this.terminateWorker(),this.onWorkerMessage=this.onWorkerError=null;else{let e=this.transmuxer;e&&(e.destroy(),this.transmuxer=null)}let e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.part=null,this.observer=null,this.hls=null}push(e,t,n,r,i,o,c,l,u,d){u.transmuxing.start=self.performance.now();let{instanceNo:f,transmuxer:p}=this,m=o?o.start:i.start,h=i.decryptdata,g=this.frag,_=!(g&&i.cc===g.cc),v=!(g&&u.level===g.level),y=g?u.sn-g.sn:-1,b=this.part?u.part-this.part.index:-1,x=y===0&&u.id>1&&u.id===g?.stats.chunkCount,S=!v&&(y===1||y===0&&(b===1||x&&b<=0)),C=self.performance.now();(v||y||i.stats.parsing.start===0)&&(i.stats.parsing.start=C),o&&(b||!S)&&(o.stats.parsing.start=C);let w=!(g&&i.initSegment?.url===g.initSegment?.url),T=new zc(_,S,l,v,m,w);if(!S||_||w){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${i.type} sn: ${u.sn}${u.part>-1?` part: `+u.part:``} ${this.id===Eo.MAIN?`level`:`track`}: ${u.level} id: ${u.id}
24
+ discontinuity: ${_}
25
+ trackSwitch: ${v}
26
+ contiguous: ${S}
27
+ accurateTimeOffset: ${l}
28
+ timeOffset: ${m}
29
+ initSegmentChange: ${w}`);let e=new Rc(n,r,t,c,d);this.configureTransmuxer(e)}if(this.frag=i,this.part=o,this.workerContext)this.workerContext.worker.postMessage({instanceNo:f,cmd:`demux`,data:e,decryptdata:h,chunkMeta:u,state:T},e instanceof ArrayBuffer?[e]:[]);else if(p){let t=p.push(e,h,u,T);hi(t)?t.then(e=>{this.handleTransmuxComplete(e)}).catch(e=>{this.transmuxerError(e,u,`transmuxer-interface push error`)}):this.handleTransmuxComplete(t)}}flush(e){e.transmuxing.start=self.performance.now();let{instanceNo:t,transmuxer:n}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:t,cmd:`flush`,chunkMeta:e});else if(n){let t=n.flush(e);hi(t)?t.then(t=>{this.handleFlushResult(t,e)}).catch(t=>{this.transmuxerError(t,e,`transmuxer-interface flush error`)}):this.handleFlushResult(t,e)}}transmuxerError(e,t,n){this.hls&&(this.error=e,this.hls.trigger(Q.ERROR,{type:wo.MEDIA_ERROR,details:Z.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,part:this.part||void 0,fatal:!1,error:e,err:e,reason:n}))}handleFlushResult(e,t){e.forEach(e=>{this.handleTransmuxComplete(e)}),this.onFlush(t)}configureTransmuxer(e){let{instanceNo:t,transmuxer:n}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:t,cmd:`configure`,config:e}):n&&n.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}},Hc=100,Uc=class extends Ks{constructor(e,t,n){super(e,t,n,`audio-stream-controller`,Eo.AUDIO),this.mainAnchor=null,this.mainFragLoading=null,this.audioOnly=!1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.resetItem()}resetItem(){this.mainDetails=this.mainAnchor=this.mainFragLoading=this.bufferedTrack=this.switchingTrack=this.waitingData=this.cachedTrackLoadedData=null}registerListeners(){super.registerListeners();let{hls:e}=this;e.on(Q.LEVEL_LOADED,this.onLevelLoaded,this),e.on(Q.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(Q.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(Q.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(Q.BUFFER_RESET,this.onBufferReset,this),e.on(Q.BUFFER_CREATED,this.onBufferCreated,this),e.on(Q.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(Q.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(Q.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(Q.FRAG_LOADING,this.onFragLoading,this),e.on(Q.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){let{hls:e}=this;e&&(super.unregisterListeners(),e.off(Q.LEVEL_LOADED,this.onLevelLoaded,this),e.off(Q.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(Q.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(Q.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(Q.BUFFER_RESET,this.onBufferReset,this),e.off(Q.BUFFER_CREATED,this.onBufferCreated,this),e.off(Q.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(Q.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(Q.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(Q.FRAG_LOADING,this.onFragLoading,this),e.off(Q.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(e,{frag:t,id:n,initPTS:r,timescale:i,trackId:o}){if(n===Eo.MAIN){let e=t.cc,n=this.fragCurrent;if(this.initPTS[e]={baseTime:r,timescale:i,trackId:o},this.log(`InitPTS for cc: ${e} found from main: ${r/i} (${r}/${i}) trackId: ${o}`),this.mainAnchor=t,this.state===$.WAITING_INIT_PTS){let n=this.waitingData;(!n&&!this.loadingParts||n&&n.frag.cc!==e)&&this.syncWithAnchor(t,n?.frag)}else !this.hls.hasEnoughToStart&&n&&n.cc!==e?(n.abortRequests(),this.syncWithAnchor(t,n)):this.state===$.IDLE&&this.tick()}}getLoadPosition(){return!this.startFragRequested&&this.nextLoadPosition>=0?this.nextLoadPosition:super.getLoadPosition()}syncWithAnchor(e,t){let n=this.mainFragLoading?.frag||null;if(t&&n?.cc===t.cc)return;let r=(n||e).cc,i=Et(this.getLevelDetails(),r,this.getLoadPosition());i&&(this.log(`Syncing with main frag at ${i.start} cc ${i.cc}`),this.startFragRequested=!1,this.nextLoadPosition=i.start,this.resetLoadingState(),this.state===$.IDLE&&this.doTickIdle())}startLoad(e,t){if(!this.levels){this.startPosition=e,this.state=$.STOPPED;return}let n=this.lastCurrentTime;this.stopLoad(),this.setInterval(Hc),n>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n,this.state=$.IDLE):this.state=$.WAITING_TRACK,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}doTick(){switch(this.state){case $.IDLE:this.doTickIdle();break;case $.WAITING_TRACK:{let{levels:e,trackId:t}=this,n=e?.[t],r=n?.details;if(r&&!this.waitForLive(n)){if(this.waitForCdnTuneIn(r))break;this.state=$.WAITING_INIT_PTS}break}case $.FRAG_LOADING_WAITING_RETRY:this.checkRetryDate();break;case $.WAITING_INIT_PTS:{let e=this.waitingData;if(e){let{frag:t,part:n,cache:r,complete:i}=e,o=this.mainAnchor;if(this.initPTS[t.cc]!==void 0){this.waitingData=null,this.state=$.FRAG_LOADING;let e={frag:t,part:n,payload:r.flush().buffer,networkDetails:null};this._handleFragmentLoadProgress(e),i&&super._handleFragmentLoadComplete(e)}else o&&o.cc!==e.frag.cc&&this.syncWithAnchor(o,e.frag)}else this.state=$.IDLE}}this.onTickEnd()}resetLoadingState(){let e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null),super.resetLoadingState()}onTickEnd(){let{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){let{hls:e,levels:t,media:n,trackId:r}=this,i=e.config;if(!this.buffering||!n&&!this.primaryPrefetch&&(this.startFragRequested||!i.startFragPrefetch)||!(t!=null&&t[r]))return;let o=t[r],c=o.details;if(!c||this.waitForLive(o)||this.waitForCdnTuneIn(c)){this.state=$.WAITING_TRACK,this.startFragRequested=!1;return}let l=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&l&&(this.bufferFlushed=!1,this.afterBufferFlushed(l,Ro.AUDIO,Eo.AUDIO));let u=this.getFwdBufferInfo(l,Eo.AUDIO);if(u===null)return;if(!this.switchingTrack&&this._streamEnded(u,c)){e.trigger(Q.BUFFER_EOS,{type:`audio`}),this.state=$.ENDED;return}let d=u.len,f=e.maxBufferLength,p=c.fragments,m=p[0].start,h=this.getLoadPosition(),g=this.flushing?h:u.end;if(this.switchingTrack&&n){let e=h;c.PTSKnown&&e<m&&(u.end>m||u.nextStart)&&(this.log(`Alt audio track ahead of main track, seek to start of alt audio track`),n.currentTime=m+.05)}if(d>=f&&!this.switchingTrack&&g<p[p.length-1].start)return;let _=this.getNextFragment(g,c);if(_&&this.isLoopLoading(_,g)&&(_=this.getNextFragmentLoopLoading(_,c,u,Eo.MAIN,f)),!_){this.bufferFlushed=!0;return}let v=this.mainFragLoading?.frag||null;if(!this.audioOnly&&this.startFragRequested&&v&&q(_)&&!_.endList&&(!c.live||!this.loadingParts&&g<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(v)===us.OK&&(this.mainFragLoading=v=null),v&&q(v))){if(_.start>v.end){let e=this.fragmentTracker.getFragAtPos(g,Eo.MAIN);e&&e.end>v.end&&(v=e,this.mainFragLoading={frag:e,targetBufferTime:null})}if(_.start>v.end)return}this.loadFragment(_,o,g)}onMediaDetaching(e,t){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(e,t)}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(e=>new ns(e))}onAudioTrackSwitching(e,t){let n=!!t.url;this.trackId=t.id;let{fragCurrent:r}=this;r&&(r.abortRequests(),this.removeUnbufferedFrags(r.start)),this.resetLoadingState(),n?(this.switchingTrack=t,this.flushAudioIfNeeded(t),this.state!==$.STOPPED&&(this.setInterval(Hc),this.state=$.IDLE,this.tick())):(this.resetTransmuxer(),this.switchingTrack=null,this.bufferedTrack=t,this.clearInterval())}onManifestLoading(){super.onManifestLoading(),this.bufferFlushed=this.flushing=this.audioOnly=!1,this.resetItem(),this.trackId=-1}onLevelLoaded(e,t){this.mainDetails=t.details;let n=this.cachedTrackLoadedData;n&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(Q.AUDIO_TRACK_LOADED,n))}onAudioTrackLoaded(e,t){var n;let{levels:r}=this,{details:i,id:o,groupId:c,track:l}=t;if(!r){this.warn(`Audio tracks reset while loading track ${o} "${l.name}" of "${c}"`);return}let u=this.mainDetails;if(!u||i.endCC>u.endCC||u.expired){this.cachedTrackLoadedData=t,this.state!==$.STOPPED&&(this.state=$.WAITING_TRACK);return}this.cachedTrackLoadedData=null,this.log(`Audio track ${o} "${l.name}" of "${c}" loaded [${i.startSN},${i.endSN}]${i.lastPartSn?`[part-${i.lastPartSn}-${i.lastPartIndex}]`:``},duration:${i.totalduration}`);let d=r[o],f=0;if(i.live||(n=d.details)!=null&&n.live){if(this.checkLiveUpdate(i),i.deltaUpdateFailed)return;d.details&&(f=this.alignPlaylists(i,d.details,this.levelLastLoaded?.details)),i.alignedSliding||(Zn(i,u),i.alignedSliding||Qn(i,u),f=i.fragmentStart)}d.details=i,this.levelLastLoaded=d,this.startFragRequested||this.setStartPosition(u,f),this.hls.trigger(Q.AUDIO_TRACK_UPDATED,{details:i,id:o,groupId:t.groupId}),this.state===$.WAITING_TRACK&&!this.waitForCdnTuneIn(i)&&(this.state=$.IDLE),this.tick()}_handleFragmentLoadProgress(e){let t=e.frag,{part:n,payload:r}=e,{config:i,trackId:o,levels:c}=this;if(!c){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${t.sn} of level ${t.level} will not be buffered`);return}let l=c[o];if(!l){this.warn(`Audio track is undefined on fragment load progress`);return}let u=l.details;if(!u){this.warn(`Audio track details undefined on fragment load progress`),this.removeUnbufferedFrags(t.start);return}let d=i.defaultAudioCodec||l.audioCodec||`mp4a.40.2`,f=this.transmuxer;f||=this.transmuxer=new Vc(this.hls,Eo.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this));let p=this.initPTS[t.cc],m=t.initSegment?.data;if(p!==void 0){let e=n?n.index:-1,i=e!==-1,o=new Ss(t.level,t.sn,t.stats.chunkCount,r.byteLength,e,i);f.push(r,m,d,``,t,n,u.totalduration,!1,o,p)}else{this.log(`Unknown video PTS for cc ${t.cc}, waiting for video PTS before demuxing audio frag ${t.sn} of [${u.startSN} ,${u.endSN}],track ${o}`);let{cache:e}=this.waitingData=this.waitingData||{frag:t,part:n,cache:new qs,complete:!1};e.push(new Uint8Array(r)),this.state!==$.STOPPED&&(this.state=$.WAITING_INIT_PTS)}}_handleFragmentLoadComplete(e){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=null}onBufferCreated(e,t){this.bufferFlushed=this.flushing=!1;let n=t.tracks.audio;n&&(this.mediaBuffer=n.buffer||null)}onFragLoading(e,t){!this.audioOnly&&t.frag.type===Eo.MAIN&&q(t.frag)&&(this.mainFragLoading=t,this.state===$.IDLE&&this.tick())}onFragBuffered(e,t){let{frag:n,part:r}=t;if(n.type!==Eo.AUDIO){!this.audioOnly&&n.type===Eo.MAIN&&!n.elementaryStreams.video&&!n.elementaryStreams.audiovideo&&(this.audioOnly=!0,this.mainFragLoading=null);return}if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${r?` p: `+r.index:``} of level ${n.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:`false`}`);return}if(q(n)){this.fragPrevious=n;let e=this.switchingTrack;e&&(this.bufferedTrack=e,this.switchingTrack=null,this.hls.trigger(Q.AUDIO_TRACK_SWITCHED,N({},e)))}this.fragBufferedComplete(n,r),this.media&&this.tick()}onError(e,t){if(t.fatal){this.state=$.ERROR;return}switch(t.details){case Z.FRAG_GAP:case Z.FRAG_PARSING_ERROR:case Z.FRAG_DECRYPT_ERROR:case Z.FRAG_LOAD_ERROR:case Z.FRAG_LOAD_TIMEOUT:case Z.KEY_LOAD_ERROR:case Z.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Eo.AUDIO,t);break;case Z.AUDIO_TRACK_LOAD_ERROR:case Z.AUDIO_TRACK_LOAD_TIMEOUT:case Z.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===$.WAITING_TRACK&&t.context?.type===To.AUDIO_TRACK&&(this.state=$.IDLE);break;case Z.BUFFER_ADD_CODEC_ERROR:case Z.BUFFER_APPEND_ERROR:if(t.parent!==`audio`)return;this.reduceLengthAndFlushBuffer(t)||this.resetLoadingState();break;case Z.BUFFER_FULL_ERROR:if(t.parent!==`audio`)return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,1/0,`audio`));break;case Z.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==Ro.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==Ro.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===$.ENDED&&(this.state=$.IDLE);let e=this.mediaBuffer||this.media;e&&(this.afterBufferFlushed(e,t,Eo.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;let n=`audio`,{hls:r}=this,{remuxResult:i,chunkMeta:o}=e,c=this.getCurrentContext(o);if(!c){this.resetWhenMissingContext(o);return}let{frag:l,part:u,level:d}=c,{details:f}=d,{audio:p,text:m,id3:h,initSegment:g}=i;if(this.fragContextChanged(l)||!f){this.fragmentTracker.removeFragment(l);return}if(this.state=$.PARSING,this.switchingTrack&&p&&this.completeAudioSwitch(this.switchingTrack),g!=null&&g.tracks){let e=l.initSegment||l;if(this.unhandledEncryptionError(g,l))return;this._bufferInitSegment(d,g.tracks,e,o),r.trigger(Q.FRAG_PARSING_INIT_SEGMENT,{frag:e,id:n,tracks:g.tracks})}if(p){let{startPTS:e,endPTS:t,startDTS:n,endDTS:r}=p;u&&(u.elementaryStreams[Ro.AUDIO]={startPTS:e,endPTS:t,startDTS:n,endDTS:r}),l.setElementaryStreamInfo(Ro.AUDIO,e,t,n,r),this.bufferFragmentData(p,l,u,o)}if(h!=null&&(t=h.samples)!=null&&t.length){let e=j({id:n,frag:l,details:f},h);r.trigger(Q.FRAG_PARSING_METADATA,e)}if(m){let e=j({id:n,frag:l,details:f},m);r.trigger(Q.FRAG_PARSING_USERDATA,e)}}_bufferInitSegment(e,t,n,r){if(this.state!==$.PARSING||(t.video&&delete t.video,t.audiovideo&&delete t.audiovideo,!t.audio))return;let i=t.audio;i.id=Eo.AUDIO;let o=e.audioCodec;this.log(`Init audio buffer, container:${i.container}, codecs[level/parsed]=[${o}/${i.codec}]`),o&&o.split(`,`).length===1&&(i.levelCodec=o),this.hls.trigger(Q.BUFFER_CODECS,t);let c=i.initSegment;if(c!=null&&c.byteLength){let e={type:`audio`,frag:n,part:null,chunkMeta:r,parent:n.type,data:c};this.hls.trigger(Q.BUFFER_APPENDING,e)}this.tickImmediate()}loadFragment(e,t,n){let r=this.fragmentTracker.getState(e);if(this.switchingTrack||r===us.NOT_LOADED||r===us.PARTIAL){var i;if(!q(e))this._loadInitSegment(e,t);else if((i=t.details)!=null&&i.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=$.WAITING_INIT_PTS;let n=this.mainDetails;n&&n.fragmentStart!==t.details.fragmentStart&&Qn(t.details,n)}else super.loadFragment(e,t,n)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){if(this.media&&this.bufferedTrack){let{name:t,lang:n,assocLang:r,characteristics:i,audioCodec:o,channels:c}=this.bufferedTrack;mt({name:t,lang:n,assocLang:r,characteristics:i,audioCodec:o,channels:c},e,_t)||(bt(e.url,this.hls)?(this.log(`Switching audio track : flushing all audio`),super.flushMainBuffer(0,1/0,`audio`),this.bufferedTrack=null):this.bufferedTrack=e)}}completeAudioSwitch(e){let{hls:t}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(Q.AUDIO_TRACK_SWITCHED,N({},e))}},Wc=class extends ko{constructor(e,t){super(t,e.logger),this.hls=void 0,this.canLoad=!1,this.timer=-1,this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){this.timer!==-1&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t,n){let r=t?.renditionReports;if(r){let i=-1;for(let n=0;n<r.length;n++){let o=r[n],c;try{c=new self.URL(o.URI,t.url).href}catch(e){this.warn(`Could not construct new URL for Rendition Report: ${e}`),c=o.URI||``}if(c===e){i=n;break}else c===e.substring(0,c.length)&&(i=n)}if(i!==-1){let e=r[i],o=parseInt(e[`LAST-MSN`])||t.lastPartSn,c=parseInt(e[`LAST-PART`])||t.lastPartIndex;if(this.hls.config.lowLatencyMode){let e=Math.min(t.age-t.partTarget,t.targetduration);c>=0&&e>t.partTarget&&(c+=1)}let l=n&&it(n);return new ts(o,c>=0?c:void 0,l)}}}loadPlaylist(e){this.clearTimer()}loadingPlaylist(e,t){this.clearTimer()}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}getUrlWithDirectives(e,t){if(t)try{return t.addDirectives(e)}catch(e){this.warn(`Could not construct new URL with HLS Delivery Directives: ${e}`)}return e}playlistLoaded(e,t,n){let{details:r,stats:i}=t,o=self.performance.now(),c=i.loading.first?Math.max(0,o-i.loading.first):0;r.advancedDateTime=Date.now()-c;let l=this.hls.config.timelineOffset;if(l!==r.appliedTimelineOffset){let e=Math.max(l||0,0);r.appliedTimelineOffset=e,r.fragments.forEach(t=>{t.setStart(t.playlistOffset+e)})}if(r.live||n!=null&&n.live){let l=`levelInfo`in t?t.levelInfo:t.track;if(r.reloaded(n),n&&r.fragments.length>0){Mn(n,r,this);let e=r.playlistParsingError;if(e){this.warn(e);let n=this.hls;if(!n.config.ignorePlaylistParsingErrors){let{networkDetails:o}=t;n.trigger(Q.ERROR,{type:wo.NETWORK_ERROR,details:Z.LEVEL_PARSING_ERROR,fatal:!1,url:r.url,error:e,reason:e.message,level:t.level||void 0,parent:r.fragments[0]?.type,networkDetails:o,stats:i});return}r.playlistParsingError=null}}r.requestScheduled===-1&&(r.requestScheduled=i.loading.start);let u=this.hls.mainForwardBufferInfo,d=u?u.end-u.len:0,f=zn(r,(r.edge-d)*1e3);if(r.requestScheduled+f<o?r.requestScheduled=o:r.requestScheduled+=f,this.log(`live playlist ${e} ${r.advanced?`REFRESHED `+r.lastPartSn+`-`+r.lastPartIndex:r.updated?`UPDATED`:`MISSED`}`),!this.canLoad||!r.live)return;let p,m,h;if(r.canBlockReload&&r.endSN&&r.advanced){let e=this.hls.config.lowLatencyMode,i=r.lastPartSn,c=r.endSN,u=r.lastPartIndex,d=u!==-1,f=i===c;d?f?(m=c+1,h=e?0:u):(m=i,h=e?u+1:r.maxPartIndex):m=c+1;let g=r.age,_=g+r.ageHeader,v=Math.min(_-r.partTarget,r.targetduration*1.5);if(v>0){if(_>r.targetduration*3)this.log(`Playlist last advanced ${g.toFixed(2)}s ago. Omitting segment and part directives.`),m=void 0,h=void 0;else if(n!=null&&n.tuneInGoal&&_-r.partTarget>n.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${n.tuneInGoal} to: ${v} with playlist age: ${r.age}`),v=0;else{let e=Math.floor(v/r.targetduration);if(m+=e,h!==void 0){let e=Math.round(v%r.targetduration/r.partTarget);h+=e}this.log(`CDN Tune-in age: ${r.ageHeader}s last advanced ${g.toFixed(2)}s goal: ${v} skip sn ${e} to part ${h}`)}r.tuneInGoal=v}if(p=this.getDeliveryDirectives(r,t.deliveryDirectives,m,h),e||!f){r.requestScheduled=o,this.loadingPlaylist(l,p);return}}else (r.canBlockReload||r.canSkipUntil)&&(p=this.getDeliveryDirectives(r,t.deliveryDirectives,m,h));p&&m!==void 0&&r.canBlockReload&&(r.requestScheduled=i.loading.first+Math.max(f-c*2,f/2)),this.scheduleLoading(l,p,r)}else this.clearTimer()}scheduleLoading(e,t,n){let r=n||e.details;if(!r){this.loadingPlaylist(e,t);return}let i=self.performance.now(),o=r.requestScheduled;if(i>=o){this.loadingPlaylist(e,t);return}let c=o-i;this.log(`reload live playlist ${e.name||e.bitrate+`bps`} in ${Math.round(c)} ms`),this.clearTimer(),this.timer=self.setTimeout(()=>this.loadingPlaylist(e,t),c)}getDeliveryDirectives(e,t,n,r){let i=it(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(n=t.msn,r=t.part,i=es.No),new ts(n,r,i)}checkRetry(e){let t=e.details,n=Dt(e),r=e.errorAction,{action:i,retryCount:o=0,retryConfig:c}=r||{},l=!!r&&!!c&&(i===ss.RetryRequest||!r.resolved&&i===ss.SendAlternateToPenaltyBox);if(l){var u;if(o>=c.maxNumRetry)return!1;if(n&&(u=e.context)!=null&&u.deliveryDirectives)this.warn(`Retrying playlist loading ${o+1}/${c.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{let e=jt(c,o);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),e),this.warn(`Retrying playlist loading ${o+1}/${c.maxNumRetry} after "${t}" in ${e}ms`)}e.levelRetry=!0,r.resolved=!0}return l}},Gc=class extends Wc{constructor(e){super(e,`audio-track-controller`),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){let{hls:e}=this;e.on(Q.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Q.MANIFEST_PARSED,this.onManifestParsed,this),e.on(Q.LEVEL_LOADING,this.onLevelLoading,this),e.on(Q.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(Q.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(Q.ERROR,this.onError,this)}unregisterListeners(){let{hls:e}=this;e.off(Q.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Q.MANIFEST_PARSED,this.onManifestParsed,this),e.off(Q.LEVEL_LOADING,this.onLevelLoading,this),e.off(Q.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(Q.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(Q.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){let{id:n,groupId:r,details:i}=t,o=this.tracksInGroup[n];if(!o||o.groupId!==r){this.warn(`Audio track with id:${n} and group:${r} not found in active group ${o?.groupId}`);return}let c=o.details;o.details=t.details,this.log(`Audio track ${n} "${o.name}" lang:${o.lang} group:${r} loaded [${i.startSN}-${i.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,c)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){let t=this.hls.levels[e];if(!t)return;let n=t.audioGroups||null,r=this.groupIds,i=this.currentTrack;if(!n||r?.length!==n?.length||n!=null&&n.some(e=>r?.indexOf(e)===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;let e=this.tracks.filter(e=>!n||n.indexOf(e.groupId)!==-1);if(e.length)this.selectDefaultTrack&&!e.some(e=>e.default)&&(this.selectDefaultTrack=!1),e.forEach((e,t)=>{e.id=t});else if(!i&&!this.tracksInGroup.length)return;this.tracksInGroup=e;let t=this.hls.config.audioPreference;if(!i&&t){let n=pt(t,e,_t);if(n>-1)i=e[n];else{let e=pt(t,this.tracks);i=this.tracks[e]}}let r=this.findTrackId(i);r===-1&&i&&(r=this.findTrackId(null));let o={audioTracks:e};this.log(`Updating audio tracks, ${e.length} track(s) found in group(s): ${n?.join(`,`)}`),this.hls.trigger(Q.AUDIO_TRACKS_UPDATED,o);let c=this.trackId;if(r!==-1&&c===-1)this.setAudioTrack(r);else if(e.length&&c===-1){let t=Error(`No audio track selected for current audio group-ID(s): ${this.groupIds?.join(`,`)} track count: ${e.length}`);this.warn(t.message),this.hls.trigger(Q.ERROR,{type:wo.MEDIA_ERROR,details:Z.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:t})}}}onError(e,t){t.fatal||!t.context||t.context.type===To.AUDIO_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&this.checkRetry(t)}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){let t=this.hls;if(t.config.audioPreference=e,e){let n=this.allAudioTracks;if(this.selectDefaultTrack=!1,n.length){let r=this.currentTrack;if(r&&mt(e,r,_t))return r;let i=pt(e,this.tracksInGroup,_t);if(i>-1){let e=this.tracksInGroup[i];return this.setAudioTrack(i),e}else if(r){let r=t.loadLevel;r===-1&&(r=t.firstAutoLevel);let i=vt(e,t.levels,n,r,_t);if(i===-1)return null;t.nextLoadLevel=i}if(e.channels||e.audioCodec){let t=pt(e,n);if(t>-1)return n[t]}}}return null}setAudioTrack(e){let t=this.tracksInGroup;if(e<0||e>=t.length){this.warn(`Invalid audio track id: ${e}`);return}this.selectDefaultTrack=!1;let n=this.currentTrack,r=t[e],i=r.details&&!r.details.live;if(e===this.trackId&&r===n&&i||(this.log(`Switching to audio-track ${e} "${r.name}" lang:${r.lang} group:${r.groupId} channels:${r.channels}`),this.trackId=e,this.currentTrack=r,this.hls.trigger(Q.AUDIO_TRACK_SWITCHING,N({},r)),i))return;let o=this.switchParams(r.url,n?.details,r.details);this.loadPlaylist(o)}findTrackId(e){let t=this.tracksInGroup;for(let n=0;n<t.length;n++){let r=t[n];if(!(this.selectDefaultTrack&&!r.default)&&(!e||mt(e,r,_t)))return n}if(e){let{name:n,lang:r,assocLang:i,characteristics:o,audioCodec:c,channels:l}=e;for(let e=0;e<t.length;e++){let u=t[e];if(mt({name:n,lang:r,assocLang:i,characteristics:o,audioCodec:c,channels:l},u,_t))return e}for(let n=0;n<t.length;n++){let r=t[n];if(_i(e.attrs,r.attrs,[`LANGUAGE`,`ASSOC-LANGUAGE`,`CHARACTERISTICS`]))return n}for(let n=0;n<t.length;n++){let r=t[n];if(_i(e.attrs,r.attrs,[`LANGUAGE`]))return n}}return-1}loadPlaylist(e){super.loadPlaylist();let t=this.currentTrack;this.shouldLoadPlaylist(t)&&bt(t.url,this.hls)&&this.scheduleLoading(t,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);let n=e.id,r=e.groupId,i=this.getUrlWithDirectives(e.url,t),o=e.details,c=o?.age;this.log(`Loading audio-track ${n} "${e.name}" lang:${e.lang} group:${r}${t?.msn===void 0?``:` at sn `+t.msn+` part `+t.part}${c&&o.live?` age `+c.toFixed(1)+(o.type&&` `+o.type||``):``} ${i}`),this.hls.trigger(Q.AUDIO_TRACK_LOADING,{url:i,id:n,groupId:r,deliveryDirectives:t||null,track:e})}},Kc=class{constructor(e){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=e}destroy(){this.tracks=this.queues=null}append(e,t,n){if(this.queues===null||this.tracks===null)return;let r=this.queues[t];r.push(e),r.length===1&&!n&&this.executeNext(t)}appendBlocker(e){return new Promise(t=>{let n={label:`async-blocker`,execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(n,e)})}prependBlocker(e){return new Promise(t=>{if(this.queues){let n={label:`async-blocker-prepend`,execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[e].unshift(n)}})}removeBlockers(){this.queues!==null&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach(e=>{let t=e[0]?.label;(t===`async-blocker`||t===`async-blocker-prepend`)&&(e[0].execute(),e.splice(0,1))})}unblockAudio(e){this.queues!==null&&this.queues.audio[0]===e&&this.shiftAndExecuteNext(`audio`)}executeNext(e){if(this.queues===null||this.tracks===null)return;let t=this.queues[e];if(t.length){let n=t[0];try{n.execute()}catch(t){if(n.onError(t),this.queues===null||this.tracks===null)return;let r=this.tracks[e]?.buffer;r!=null&&r.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues!==null&&(this.queues[e].shift(),this.executeNext(e))}current(e){return this.queues?.[e][0]||null}toString(){let{queues:e,tracks:t}=this;return e===null||t===null?`<destroyed>`:`
30
+ ${this.list(`video`)}
31
+ ${this.list(`audio`)}
32
+ ${this.list(`audiovideo`)}}`}list(e){var t,n;return(t=this.queues)!=null&&t[e]||(n=this.tracks)!=null&&n[e]?`${e}: (${this.listSbInfo(e)}) ${this.listOps(e)}`:``}listSbInfo(e){let t=this.tracks?.[e],n=t?.buffer;return n?`SourceBuffer${n.updating?` updating`:``}${t.ended?` ended`:``}${t.ending?` ending`:``}`:`none`}listOps(e){return this.queues?.[e].map(e=>e.label).join(`, `)||``}},qc=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,Jc=`HlsJsTrackRemovedError`,Yc=class extends Error{constructor(e){super(e),this.name=Jc}},Xc=class extends ko{constructor(e,t){super(`buffer-controller`,e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.details=null,this._objectUrl=null,this.operationQueue=null,this.bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.blockedAudioAppend=null,this.lastVideoAppendEnd=0,this.appendSource=void 0,this.transferData=void 0,this.overrides=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.sourceBuffers=[[null,null],[null,null]],this._onEndStreaming=e=>{this.hls&&this.mediaSource?.readyState===`open`&&this.hls.pauseBuffering()},this._onStartStreaming=e=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=e=>{let{media:t,mediaSource:n}=this;e&&this.log(`Media source opened`),!(!t||!n)&&(n.removeEventListener(`sourceopen`,this._onMediaSourceOpen),t.removeEventListener(`emptied`,this._onMediaEmptied),this.updateDuration(),this.hls.trigger(Q.MEDIA_ATTACHED,{media:t,mediaSource:n}),this.mediaSource!==null&&this.checkPendingTracks())},this._onMediaSourceClose=()=>{this.log(`Media source closed`)},this._onMediaSourceEnded=()=>{this.log(`Media source ended`)},this._onMediaEmptied=()=>{let{mediaSrc:e,_objectUrl:t}=this;e!==t&&this.error(`Media element src was set while attaching MediaSource (${t} > ${e})`)},this.hls=e,this.fragmentTracker=t,this.appendSource=V(B(e.config.preferManagedMediaSource)),this.initTracks(),this.registerListeners()}hasSourceTypes(){return Object.keys(this.tracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.transferData=this.overrides=void 0,this.operationQueue&&=(this.operationQueue.destroy(),null),this.hls=this.fragmentTracker=null,this._onMediaSourceOpen=this._onMediaSourceClose=null,this._onMediaSourceEnded=null,this._onStartStreaming=this._onEndStreaming=null}registerListeners(){let{hls:e}=this;e.on(Q.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(Q.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Q.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Q.MANIFEST_PARSED,this.onManifestParsed,this),e.on(Q.BUFFER_RESET,this.onBufferReset,this),e.on(Q.BUFFER_APPENDING,this.onBufferAppending,this),e.on(Q.BUFFER_CODECS,this.onBufferCodecs,this),e.on(Q.BUFFER_EOS,this.onBufferEos,this),e.on(Q.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(Q.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(Q.FRAG_PARSED,this.onFragParsed,this),e.on(Q.FRAG_CHANGED,this.onFragChanged,this),e.on(Q.ERROR,this.onError,this)}unregisterListeners(){let{hls:e}=this;e.off(Q.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(Q.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Q.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Q.MANIFEST_PARSED,this.onManifestParsed,this),e.off(Q.BUFFER_RESET,this.onBufferReset,this),e.off(Q.BUFFER_APPENDING,this.onBufferAppending,this),e.off(Q.BUFFER_CODECS,this.onBufferCodecs,this),e.off(Q.BUFFER_EOS,this.onBufferEos,this),e.off(Q.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(Q.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(Q.FRAG_PARSED,this.onFragParsed,this),e.off(Q.FRAG_CHANGED,this.onFragChanged,this),e.off(Q.ERROR,this.onError,this)}transferMedia(){let{media:e,mediaSource:t}=this;if(!e)return null;let n={};if(this.operationQueue){let e=this.isUpdating();e||this.operationQueue.removeBlockers();let t=this.isQueued();(e||t)&&this.warn(`Transfering MediaSource with${t?` operations in queue`:``}${e?` updating SourceBuffer(s)`:``} ${this.operationQueue}`),this.operationQueue.destroy()}let r=this.transferData;return!this.sourceBufferCount&&r&&r.mediaSource===t?j(n,r.tracks):this.sourceBuffers.forEach(e=>{let[t]=e;t&&(n[t]=j({},this.tracks[t]),this.removeBuffer(t)),e[0]=e[1]=null}),{media:e,mediaSource:t,tracks:n}}initTracks(){this.sourceBuffers=[[null,null],[null,null]],this.tracks={},this.resetQueue(),this.resetAppendErrors(),this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.lastVideoAppendEnd=0}onManifestLoading(){this.bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){var n;let r=2;(t.audio&&!t.video||!t.altAudio)&&(r=1),this.bufferCodecEventsTotal=r,this.log(`${r} bufferCodec event(s) expected.`),(n=this.transferData)!=null&&n.mediaSource&&this.sourceBufferCount&&r&&this.bufferCreated()}onMediaAttaching(e,t){let n=this.media=t.media;this.transferData=this.overrides=void 0;let r=B(this.appendSource);if(r){let e=!!t.mediaSource;(e||t.overrides)&&(this.transferData=t,this.overrides=t.overrides);let i=this.mediaSource=t.mediaSource||new r;if(this.assignMediaSource(i),e)this._objectUrl=n.src,this.attachTransferred();else{let e=this._objectUrl=self.URL.createObjectURL(i);if(this.appendSource)try{n.removeAttribute(`src`);let t=self.ManagedMediaSource;n.disableRemotePlayback=n.disableRemotePlayback||t&&i instanceof t,yi(n),bi(n,e),n.load()}catch{n.src=e}else n.src=e}n.addEventListener(`emptied`,this._onMediaEmptied)}}assignMediaSource(e){this.log(`${this.transferData?.mediaSource===e?`transferred`:`created`} media source: ${e.constructor?.name}`),e.addEventListener(`sourceopen`,this._onMediaSourceOpen),e.addEventListener(`sourceended`,this._onMediaSourceEnded),e.addEventListener(`sourceclose`,this._onMediaSourceClose),this.appendSource&&(e.addEventListener(`startstreaming`,this._onStartStreaming),e.addEventListener(`endstreaming`,this._onEndStreaming))}attachTransferred(){let e=this.media,t=this.transferData;if(!t||!e)return;let n=this.tracks,r=t.tracks,i=r?Object.keys(r):null,o=i?i.length:0,c=()=>{Promise.resolve().then(()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()})};if(r&&i&&o){if(!this.tracksReady){this.hls.config.startFragPrefetch=!0,this.log(`attachTransferred: waiting for SourceBuffer track info`);return}if(this.log(`attachTransferred: (bufferCodecEventsTotal ${this.bufferCodecEventsTotal})
33
+ required tracks: ${is(n,(e,t)=>e===`initSegment`?void 0:t)};
34
+ transfer tracks: ${is(r,(e,t)=>e===`initSegment`?void 0:t)}}`),!H(r,n)){t.mediaSource=null,t.tracks=void 0;let i=e.currentTime,o=this.details,c=Math.max(i,o?.fragments[0].start||0);if(c-i>1){this.log(`attachTransferred: waiting for playback to reach new tracks start time ${i} -> ${c}`);return}this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(r)}"->"${Object.keys(n)}") start time: ${c} currentTime: ${i}`),this.onMediaDetaching(Q.MEDIA_DETACHING,{}),this.onMediaAttaching(Q.MEDIA_ATTACHING,t),e.currentTime=c;return}this.transferData=void 0,i.forEach(e=>{let t=e,n=r[t];if(n){let e=n.buffer;if(e){let r=this.fragmentTracker,i=n.id;if(r.hasFragments(i)||r.hasParts(i)){let n=ws.getBuffered(e);r.detectEvictedFragments(t,n,i,null,!0)}let o=xi(t),c=[t,e];this.sourceBuffers[o]=c,e.updating&&this.operationQueue&&this.operationQueue.prependBlocker(t),this.trackSourceBuffer(t,n)}}}),c(),this.bufferCreated()}else this.log(`attachTransferred: MediaSource w/o SourceBuffers`),c()}get mediaSourceOpenOrEnded(){let e=this.mediaSource?.readyState;return e===`open`||e===`ended`}onMediaDetaching(e,t){let n=!!t.transferMedia;this.transferData=this.overrides=void 0;let{media:r,mediaSource:i,_objectUrl:o}=this;if(i){if(this.log(`media source ${n?`transferring`:`detaching`}`),n)this.sourceBuffers.forEach(([e])=>{e&&this.removeBuffer(e)}),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){let e=i.readyState===`open`;try{let t=i.sourceBuffers;for(let n=t.length;n--;)e&&t[n].abort(),i.removeSourceBuffer(t[n]);e&&i.endOfStream()}catch(e){this.warn(`onMediaDetaching: ${e.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}i.removeEventListener(`sourceopen`,this._onMediaSourceOpen),i.removeEventListener(`sourceended`,this._onMediaSourceEnded),i.removeEventListener(`sourceclose`,this._onMediaSourceClose),this.appendSource&&(i.removeEventListener(`startstreaming`,this._onStartStreaming),i.removeEventListener(`endstreaming`,this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}r&&(r.removeEventListener(`emptied`,this._onMediaEmptied),n||(o&&self.URL.revokeObjectURL(o),this.mediaSrc===o?(r.removeAttribute(`src`),this.appendSource&&yi(r),r.load()):this.warn(`media|source.src was changed by a third party - skip cleanup`)),this.media=null),this.hls.trigger(Q.MEDIA_DETACHED,t)}onBufferReset(){this.sourceBuffers.forEach(([e])=>{e&&this.resetBuffer(e)}),this.initTracks()}resetBuffer(e){let t=this.tracks[e]?.buffer;if(this.removeBuffer(e),t)try{var n;(n=this.mediaSource)!=null&&n.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(t)}catch(t){this.warn(`onBufferReset ${e}`,t)}delete this.tracks[e]}removeBuffer(e){this.removeBufferListeners(e),this.sourceBuffers[xi(e)]=[null,null];let t=this.tracks[e];t&&(t.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new Kc(this.tracks)}onBufferCodecs(e,t){let n=this.tracks,r=Object.keys(t);this.log(`BUFFER_CODECS: "${r}" (current SB count ${this.sourceBufferCount})`);let i=`audiovideo`in t&&(n.audio||n.video)||n.audiovideo&&(`audio`in t||`video`in t),o=!i&&this.sourceBufferCount&&this.media&&r.some(e=>!n[e]);if(i||o){this.warn(`Unsupported transition between "${Object.keys(n)}" and "${r}" SourceBuffers`);return}r.forEach(e=>{var r;let{id:i,codec:o,levelCodec:c,container:l,metadata:u,supplemental:d}=t[e],f=n[e],p=(r=this.transferData)==null||(r=r.tracks)==null?void 0:r[e],m=p!=null&&p.buffer?p:f,h=m?.pendingCodec||m?.codec,g=m?.levelCodec;f||=n[e]={buffer:void 0,listeners:[],codec:o,supplemental:d,container:l,levelCodec:c,metadata:u,id:i};let _=Ue(h,g),v=_?.replace(qc,`$1`),y=Ue(o,c),b=y?.replace(qc,`$1`);y&&_&&v!==b&&(e.slice(0,5)===`audio`&&(y=Ve(y,this.appendSource)),this.log(`switching codec ${h} to ${y}`),y!==(f.pendingCodec||f.codec)&&(f.pendingCodec=y),f.container=l,this.appendChangeType(e,l,y))}),(this.tracksReady||this.sourceBufferCount)&&(t.tracks=this.sourceBufferTracks),!this.sourceBufferCount&&(this.bufferCodecEventsTotal>1&&!this.tracks.video&&!t.video&&t.audio?.id===`main`&&(this.log(`Main audio-only`),this.bufferCodecEventsTotal=1),this.mediaSourceOpenOrEnded&&this.checkPendingTracks())}get sourceBufferTracks(){return Object.keys(this.tracks).reduce((e,t)=>{let n=this.tracks[t];return e[t]={id:n.id,container:n.container,codec:n.codec,levelCodec:n.levelCodec},e},{})}appendChangeType(e,t,n){let r=`${t};codecs=${n}`,i={label:`change-type=${r}`,execute:()=>{let i=this.tracks[e];if(i){let o=i.buffer;o!=null&&o.changeType&&(this.log(`changing ${e} sourceBuffer type to ${r}`),o.changeType(r),i.codec=n,i.container=t)}this.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:t=>{this.warn(`Failed to change ${e} SourceBuffer type`,t)}};this.append(i,e,this.isPending(this.tracks[e]))}blockAudio(e){let t=e.start,n=t+e.duration*.05;if(this.fragmentTracker.getAppendedFrag(t,Eo.MAIN)?.gap===!0)return;let r={label:`block-audio`,execute:()=>{let e=this.tracks.video;(this.lastVideoAppendEnd>n||e!=null&&e.buffer&&ws.isBuffered(e.buffer,n)||this.fragmentTracker.getAppendedFrag(n,Eo.MAIN)?.gap===!0)&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext(`audio`))},onStart:()=>{},onComplete:()=>{},onError:e=>{this.warn(`Error executing block-audio operation`,e)}};this.blockedAudioAppend={op:r,frag:e},this.append(r,`audio`,!0)}unblockAudio(){let{blockedAudioAppend:e,operationQueue:t}=this;e&&t&&(this.blockedAudioAppend=null,t.unblockAudio(e.op))}onBufferAppending(e,t){let{tracks:n}=this,{data:r,type:i,parent:o,frag:c,part:l,chunkMeta:u,offset:d}=t,f=u.buffering[i],{sn:p,cc:m}=c,h=self.performance.now();f.start=h;let g=c.stats.buffering,_=l?l.stats.buffering:null;g.start===0&&(g.start=h),_&&_.start===0&&(_.start=h);let v=n.audio,y=!1;i===`audio`&&v?.container===`audio/mpeg`&&(y=!this.lastMpegAudioChunk||u.id===1||this.lastMpegAudioChunk.sn!==u.sn,this.lastMpegAudioChunk=u);let b=n.video,x=b?.buffer;if(x&&p!==`initSegment`){let e=l||c,t=this.blockedAudioAppend;if(i===`audio`&&o!==`main`&&!this.blockedAudioAppend&&!(b.ending||b.ended)){let t=e.start+e.duration*.05,n=x.buffered,r=this.currentOp(`video`);(!n.length&&!r||!r&&!ws.isBuffered(x,t)&&this.lastVideoAppendEnd<t)&&this.blockAudio(e)}else if(i===`video`){let n=e.end;if(t){let e=t.frag.start;(n>e||n<this.lastVideoAppendEnd||ws.isBuffered(x,e))&&this.unblockAudio()}this.lastVideoAppendEnd=n}}let S=(l||c).start,C={label:`append-${i}`,execute:()=>{f.executeStart=self.performance.now();let e=this.tracks[i]?.buffer;e&&(y?this.updateTimestampOffset(e,S,.1,i,p,m):d!==void 0&&X(d)&&this.updateTimestampOffset(e,d,1e-6,i,p,m)),this.appendExecutor(r,i)},onStart:()=>{},onComplete:()=>{let e=self.performance.now();f.executeEnd=f.end=e,g.first===0&&(g.first=e),_&&_.first===0&&(_.first=e);let t={};this.sourceBuffers.forEach(([e,n])=>{e&&(t[e]=ws.getBuffered(n))}),this.appendErrors[i]=0,i===`audio`||i===`video`?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(Q.BUFFER_APPENDED,{type:i,frag:c,part:l,chunkMeta:u,parent:c.type,timeRanges:t})},onError:e=>{let t={type:wo.MEDIA_ERROR,parent:c.type,details:Z.BUFFER_APPEND_ERROR,sourceBufferName:i,frag:c,part:l,chunkMeta:u,error:e,err:e,fatal:!1},n=this.media?.error;if(e.code===DOMException.QUOTA_EXCEEDED_ERR||e.name==`QuotaExceededError`||`quota`in e)t.details=Z.BUFFER_FULL_ERROR;else if(e.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!n)t.errorAction=It(!0);else if(e.name===Jc&&this.sourceBufferCount===0)t.errorAction=It(!0);else{let e=++this.appendErrors[i];this.warn(`Failed ${e}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${i}" sourceBuffer (${n||`no media error`})`),(e>=this.hls.config.appendErrorMaxRetry||n)&&(t.fatal=!0)}this.hls.trigger(Q.ERROR,t)}};this.log(`queuing "${i}" append sn: ${p}${l?` p: `+l.index:``} of ${c.type===Eo.MAIN?`level`:`track`} ${c.level} cc: ${m}`),this.append(C,i,this.isPending(this.tracks[i]))}getFlushOp(e,t,n){return this.log(`queuing "${e}" remove ${t}-${n}`),{label:`remove`,execute:()=>{this.removeExecutor(e,t,n)},onStart:()=>{},onComplete:()=>{this.hls.trigger(Q.BUFFER_FLUSHED,{type:e})},onError:r=>{this.warn(`Failed to remove ${t}-${n} from "${e}" SourceBuffer`,r)}}}onBufferFlushing(e,t){let{type:n,startOffset:r,endOffset:i}=t;n?this.append(this.getFlushOp(n,r,i),n):this.sourceBuffers.forEach(([e])=>{e&&this.append(this.getFlushOp(e,r,i),e)})}onFragParsed(e,t){let{frag:n,part:r}=t,i=[],o=r?r.elementaryStreams:n.elementaryStreams;o[Ro.AUDIOVIDEO]?i.push(`audiovideo`):(o[Ro.AUDIO]&&i.push(`audio`),o[Ro.VIDEO]&&i.push(`video`)),i.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${n.type} level: ${n.level} sn: ${n.sn}`),this.blockBuffers(()=>{let e=self.performance.now();n.stats.buffering.end=e,r&&(r.stats.buffering.end=e);let t=r?r.stats:n.stats;this.hls.trigger(Q.FRAG_BUFFERED,{frag:n,part:r,stats:t,id:n.type})},i).catch(e=>{this.warn(`Fragment buffered callback ${e}`),this.stepOperationQueue(this.sourceBufferTypes)})}onFragChanged(e,t){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some(([e])=>{if(e){let t=this.tracks[e];if(t)return!t.ended||t.ending}return!1})}onBufferEos(e,t){this.sourceBuffers.forEach(([e])=>{if(e){let n=this.tracks[e];(!t.type||t.type===e)&&(n.ending=!0,n.ended||(n.ended=!0,this.log(`${e} buffer reached EOS`)))}});let n=this.overrides?.endOfStream!==!1;this.sourceBufferCount>0&&!this.sourceBuffers.some(([e])=>{var t;return e&&!((t=this.tracks[e])!=null&&t.ended)})?n?(this.log(`Queueing EOS`),this.blockUntilOpen(()=>{this.tracksEnded();let{mediaSource:e}=this;if(!e||e.readyState!==`open`){e&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${e.readyState}`);return}this.log(`Calling mediaSource.endOfStream()`),e.endOfStream(),this.hls.trigger(Q.BUFFERED_TO_END,void 0)})):(this.tracksEnded(),this.hls.trigger(Q.BUFFERED_TO_END,void 0)):t.type===`video`&&this.unblockAudio()}tracksEnded(){this.sourceBuffers.forEach(([e])=>{if(e!==null){let t=this.tracks[e];t&&(t.ending=!1)}})}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.updateDuration())}updateDuration(){this.blockUntilOpen(()=>{let e=this.getDurationAndRange();e&&this.updateMediaSource(e)})}onError(e,t){if(t.details===Z.BUFFER_APPEND_ERROR&&t.frag){let e=t.errorAction?.nextAutoLevel;X(e)&&e!==t.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){let{hls:e,details:t,media:n}=this;if(!n||t===null||!this.sourceBufferCount)return;let r=e.config,i=n.currentTime,o=t.levelTargetDuration,c=t.live&&r.liveBackBufferLength!==null?r.liveBackBufferLength:r.backBufferLength;if(X(c)&&c>=0){let e=Math.max(c,o),t=Math.floor(i/o)*o-e;this.flushBackBuffer(i,o,t)}let l=r.frontBufferFlushThreshold;if(X(l)&&l>0){let e=Math.max(r.maxBufferLength,l),t=Math.max(e,o),n=Math.floor(i/o)*o+t;this.flushFrontBuffer(i,o,n)}}flushBackBuffer(e,t,n){this.sourceBuffers.forEach(([e,t])=>{if(t){let i=ws.getBuffered(t);if(i.length>0&&n>i.start(0)){var r;this.hls.trigger(Q.BACK_BUFFER_REACHED,{bufferEnd:n});let t=this.tracks[e];if((r=this.details)!=null&&r.live)this.hls.trigger(Q.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(t!=null&&t.ended){this.log(`Cannot flush ${e} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(Q.BUFFER_FLUSHING,{startOffset:0,endOffset:n,type:e})}}})}flushFrontBuffer(e,t,n){this.sourceBuffers.forEach(([t,r])=>{if(r){let i=ws.getBuffered(r),o=i.length;if(o<2)return;let c=i.start(o-1),l=i.end(o-1);if(n>c||e>=c&&e<=l)return;this.hls.trigger(Q.BUFFER_FLUSHING,{startOffset:c,endOffset:1/0,type:t})}})}getDurationAndRange(){let{details:e,mediaSource:t}=this;if(!e||!this.media||t?.readyState!==`open`)return null;let n=e.edge;if(e.live&&this.hls.config.liveDurationInfinity){if(e.fragments.length&&t.setLiveSeekableRange){let t=Math.max(0,e.fragmentStart);return{duration:1/0,start:t,end:Math.max(t,n)}}return{duration:1/0}}let r=this.overrides?.duration;if(r)return X(r)?{duration:r}:null;let i=this.media.duration;return n>(X(t.duration)?t.duration:0)&&n>i||!X(i)?{duration:n}:null}updateMediaSource({duration:e,start:t,end:n}){let r=this.mediaSource;!this.media||!r||r.readyState!==`open`||(r.duration!==e&&(X(e)&&this.log(`Updating MediaSource duration to ${e.toFixed(3)}`),r.duration=e),t!==void 0&&n!==void 0&&(this.log(`MediaSource duration is set to ${r.duration}. Setting seekable range to ${t}-${n}.`),r.setLiveSeekableRange(t,n)))}get tracksReady(){let e=this.pendingTrackCount;return e>0&&(e>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){let{bufferCodecEventsTotal:e,pendingTrackCount:t,tracks:n}=this;if(this.log(`checkPendingTracks (pending: ${t} codec events expected: ${e}) ${is(n)}`),this.tracksReady){let e=this.transferData?.tracks;e&&Object.keys(e).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){let e={};this.sourceBuffers.forEach(([t,n])=>{if(t){let r=this.tracks[t];e[t]={buffer:n,container:r.container,codec:r.codec,supplemental:r.supplemental,levelCodec:r.levelCodec,id:r.id,metadata:r.metadata}}}),this.hls.trigger(Q.BUFFER_CREATED,{tracks:e}),this.log(`SourceBuffers created. Running queue: ${this.operationQueue}`),this.sourceBuffers.forEach(([e])=>{this.executeNext(e)})}else{let e=Error(`could not create source buffer for media codec(s)`);this.hls.trigger(Q.ERROR,{type:wo.MEDIA_ERROR,details:Z.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}createSourceBuffers(){let{tracks:e,sourceBuffers:t,mediaSource:n}=this;if(!n)throw Error(`createSourceBuffers called when mediaSource was null`);for(let i in e){let o=i,c=e[o];if(this.isPending(c)){let e=this.getTrackCodec(c,o),i=`${c.container};codecs=${e}`;c.codec=e,this.log(`creating sourceBuffer(${i})${this.currentOp(o)?` Queued`:``} ${is(c)}`);try{let e=n.addSourceBuffer(i),r=xi(o);t[r]=[o,e],c.buffer=e}catch(e){var r;this.error(`error while trying to add sourceBuffer: ${e.message}`),this.shiftAndExecuteNext(o),(r=this.operationQueue)==null||r.removeBlockers(),delete this.tracks[o],this.hls.trigger(Q.ERROR,{type:wo.MEDIA_ERROR,details:Z.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:e,sourceBufferName:o,mimeType:i,parent:c.id});return}this.trackSourceBuffer(o,c)}}this.bufferCreated()}getTrackCodec(e,t){let n=e.supplemental,r=e.codec;n&&(t===`video`||t===`audiovideo`)&&Fe(n,`video`)&&(r=He(r,n));let i=Ue(r,e.levelCodec);return i?t.slice(0,5)===`audio`?Ve(i,this.appendSource):i:``}trackSourceBuffer(e,t){let n=t.buffer;if(!n)return;let r=this.getTrackCodec(t,e);this.tracks[e]={buffer:n,codec:r,container:t.container,levelCodec:t.levelCodec,supplemental:t.supplemental,metadata:t.metadata,id:t.id,listeners:[]},this.removeBufferListeners(e),this.addBufferListener(e,`updatestart`,this.onSBUpdateStart),this.addBufferListener(e,`updateend`,this.onSBUpdateEnd),this.addBufferListener(e,`error`,this.onSBUpdateError),this.appendSource&&this.addBufferListener(e,`bufferedchange`,(e,t)=>{let n=t.removedRanges;n!=null&&n.length&&this.hls.trigger(Q.BUFFER_FLUSHED,{type:e})})}get mediaSrc(){var e,t;return(((e=this.media)==null||(t=e.querySelector)==null?void 0:t.call(e,`source`))||this.media)?.src}onSBUpdateStart(e){let t=this.currentOp(e);t&&t.onStart()}onSBUpdateEnd(e){if(this.mediaSource?.readyState===`closed`){this.resetBuffer(e);return}let t=this.currentOp(e);t&&(t.onComplete(),this.shiftAndExecuteNext(e))}onSBUpdateError(e,t){let n=Error(`${e} SourceBuffer error. MediaSource readyState: ${this.mediaSource?.readyState}`);this.error(`${n}`,t),this.hls.trigger(Q.ERROR,{type:wo.MEDIA_ERROR,details:Z.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:n,fatal:!1});let r=this.currentOp(e);r&&r.onError(n)}updateTimestampOffset(e,t,n,r,i,o){let c=t-e.timestampOffset;Math.abs(c)>=n&&(this.log(`Updating ${r} SourceBuffer timestampOffset to ${t} (sn: ${i} cc: ${o})`),e.timestampOffset=t)}removeExecutor(e,t,n){let{media:r,mediaSource:i}=this,o=this.tracks[e],c=o?.buffer;if(!r||!i||!c){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),this.shiftAndExecuteNext(e);return}let l=X(r.duration)?r.duration:1/0,u=X(i.duration)?i.duration:1/0,d=Math.max(0,t),f=Math.min(n,l,u);f>d&&(!o.ending||o.ended)?(o.ended=!1,this.log(`Removing [${d},${f}] from the ${e} SourceBuffer`),c.remove(d,f)):this.shiftAndExecuteNext(e)}appendExecutor(e,t){let n=this.tracks[t],r=n?.buffer;if(!r)throw new Yc(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);n.ending=!1,n.ended=!1,r.appendBuffer(e)}blockUntilOpen(e){if(this.isUpdating()||this.isQueued())this.blockBuffers(e).catch(e=>{this.warn(`SourceBuffer blocked callback ${e}`),this.stepOperationQueue(this.sourceBufferTypes)});else try{e()}catch(e){this.warn(`Callback run without blocking ${this.operationQueue} ${e}`)}}isUpdating(){return this.sourceBuffers.some(([e,t])=>e&&t.updating)}isQueued(){return this.sourceBuffers.some(([e])=>e&&!!this.currentOp(e))}isPending(e){return!!e&&!e.buffer}blockBuffers(e,t=this.sourceBufferTypes){if(!t.length)return this.log(`Blocking operation requested, but no SourceBuffers exist`),Promise.resolve().then(e);let{operationQueue:n}=this,r=t.map(e=>this.appendBlocker(e));return t.length>1&&this.blockedAudioAppend&&this.unblockAudio(),Promise.all(r).then(t=>{n===this.operationQueue&&(e(),this.stepOperationQueue(this.sourceBufferTypes))})}stepOperationQueue(e){e.forEach(e=>{let t=this.tracks[e]?.buffer;!t||t.updating||this.shiftAndExecuteNext(e)})}append(e,t,n){this.operationQueue&&this.operationQueue.append(e,t,n)}appendBlocker(e){if(this.operationQueue)return this.operationQueue.appendBlocker(e)}currentOp(e){return this.operationQueue?this.operationQueue.current(e):null}executeNext(e){e&&this.operationQueue&&this.operationQueue.executeNext(e)}shiftAndExecuteNext(e){this.operationQueue&&this.operationQueue.shiftAndExecuteNext(e)}get pendingTrackCount(){return Object.keys(this.tracks).reduce((e,t)=>e+ +!!this.isPending(this.tracks[t]),0)}get sourceBufferCount(){return this.sourceBuffers.reduce((e,[t])=>e+ +!!t,0)}get sourceBufferTypes(){return this.sourceBuffers.map(([e])=>e).filter(e=>!!e)}addBufferListener(e,t,n){let r=this.tracks[e];if(!r)return;let i=r.buffer;if(!i)return;let o=n.bind(this,e);r.listeners.push({event:t,listener:o}),i.addEventListener(t,o)}removeBufferListeners(e){let t=this.tracks[e];if(!t)return;let n=t.buffer;n&&(t.listeners.forEach(e=>{n.removeEventListener(e.event,e.listener)}),t.listeners.length=0)}},Zc=class e{constructor(e){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=e,this.autoLevelCapping=1/0,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(e){this.streamController=e}destroy(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){let{hls:e}=this;e.on(Q.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(Q.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(Q.MANIFEST_PARSED,this.onManifestParsed,this),e.on(Q.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(Q.BUFFER_CODECS,this.onBufferCodecs,this),e.on(Q.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){let{hls:e}=this;e.off(Q.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(Q.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(Q.MANIFEST_PARSED,this.onManifestParsed,this),e.off(Q.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(Q.BUFFER_CODECS,this.onBufferCodecs,this),e.off(Q.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){let n=this.hls.levels[t.droppedLevel];this.isLevelAllowed(n)&&this.restrictedLevels.push({bitrate:n.bitrate,height:n.height,width:n.width})}onMediaAttaching(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(e,t){let n=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,n.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onLevelsUpdated(e,t){this.timer&&X(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onMediaDetaching(){this.stopCapping(),this.media=null}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0){this.clientRect=null;return}let e=this.hls.levels;if(e.length){let t=this.hls,n=this.getMaxLevel(e.length-1);n!==this.autoLevelCapping&&t.logger.log(`Setting autoLevelCapping to ${n}: ${e[n].height}p@${e[n].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=n,t.autoLevelEnabled&&t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(t){let n=this.hls.levels;if(!n.length)return-1;let r=n.filter((e,n)=>this.isLevelAllowed(e)&&n<=t);return this.clientRect=null,e.getMaxLevelByMediaSize(r,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=1/0,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=1/0,this.timer&&=(self.clearInterval(this.timer),void 0)}getDimensions(){if(this.clientRect)return this.clientRect;let e=this.media,t={width:0,height:0};if(e){let n=e.getBoundingClientRect();t.width=n.width,t.height=n.height,!t.width&&!t.height&&(t.width=n.right-n.left||e.width||0,t.height=n.bottom-n.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch{}return Math.min(e,this.hls.config.maxDevicePixelRatio)}isLevelAllowed(e){return!this.restrictedLevels.some(t=>e.bitrate===t.bitrate&&e.width===t.width&&e.height===t.height)}static getMaxLevelByMediaSize(e,t,n){if(!(e!=null&&e.length))return-1;let r=(e,t)=>t?e.width!==t.width||e.height!==t.height:!0,i=e.length-1,o=Math.max(t,n);for(let t=0;t<e.length;t+=1){let n=e[t];if((n.width>=o||n.height>=o)&&r(n,e[t+1])){i=t;break}}return i}},Qc={MANIFEST:`m`,AUDIO:`a`,VIDEO:`v`,MUXED:`av`,INIT:`i`,CAPTION:`c`,TIMED_TEXT:`tt`,KEY:`k`,OTHER:`o`},$c={HLS:`h`},el=class e{constructor(t,n){Array.isArray(t)&&(t=t.map(t=>t instanceof e?t:new e(t))),this.value=t,this.params=n}},tl=`Dict`,nl=class{constructor(e){this.description=e}},rl=`Bare Item`,il=`Boolean`,al=`Byte Sequence`,ol=`Integer`,sl=`Decimal`,cl=`String`,ll=/[\x00-\x1f\x7f]+/,ul=`Token`,dl=`Key`,fl=`CMCD-Object`,pl=`CMCD-Request`,ml=`CMCD-Session`,hl=`CMCD-Status`,gl={br:fl,ab:fl,d:fl,ot:fl,tb:fl,tpb:fl,lb:fl,tab:fl,lab:fl,url:fl,pb:pl,bl:pl,tbl:pl,dl:pl,ltc:pl,mtp:pl,nor:pl,nrr:pl,rc:pl,sn:pl,sta:pl,su:pl,ttfb:pl,ttfbb:pl,ttlb:pl,cmsdd:pl,cmsds:pl,smrt:pl,df:pl,cs:pl,ts:pl,cid:ml,pr:ml,sf:ml,sid:ml,st:ml,v:ml,msd:ml,bs:hl,bsd:hl,cdn:hl,rtp:hl,bg:hl,pt:hl,ec:hl,e:hl},_l={REQUEST:pl},vl=`event`,yl=e=>Math.round(e),bl=(e,t)=>Array.isArray(e)?e.map(e=>bl(e,t)):e instanceof el&&typeof e.value==`string`?new el(bl(e.value,t),e.params):(t.baseUrl&&(e=qi(e,t.baseUrl)),t.version===1?encodeURIComponent(e):e),xl=e=>yl(e/100)*100,Sl=(e,t)=>{let n=e;return t.version>=2&&(e instanceof el&&typeof e.value==`string`?n=new el([e]):typeof e==`string`&&(n=[e])),bl(n,t)},Cl={br:yl,d:yl,bl:xl,dl:xl,mtp:xl,nor:Sl,rtp:xl,tb:yl},wl=`request`,Tl=`response`,El=`ab.bg.bl.br.bs.bsd.cdn.cid.cs.df.ec.lab.lb.ltc.msd.mtp.pb.pr.pt.sf.sid.sn.st.sta.tab.tb.tbl.tpb.ts.v`.split(`.`),Dl=[`e`],Ol=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/,kl=[`d`,`dl`,`nor`,`ot`,`rtp`,`su`],Al=[`cmsdd`,`cmsds`,`rc`,`smrt`,`ttfb`,`ttfbb`,`ttlb`,`url`],jl=[`bl`,`br`,`bs`,`cid`,`d`,`dl`,`mtp`,`nor`,`nrr`,`ot`,`pr`,`rtp`,`sf`,`sid`,`st`,`su`,`tb`,`v`],Ml={[Tl]:Zi,[vl]:Yi,[wl]:Xi},Nl=`CMCD`,Pl=/CMCD=[^&#]+/,Fl=class{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||=!0,this.buffering=!1},this.applyPlaylistData=e=>{try{this.apply(e,{ot:Qc.MANIFEST,su:!this.initialized})}catch(e){this.hls.logger.warn(`Could not generate manifest CMCD data.`,e)}},this.applyFragmentData=e=>{try{let{frag:t,part:n}=e,r=this.hls.levels[t.level],i=this.getObjectType(t),o={d:(n||t).duration*1e3,ot:i};(i===Qc.VIDEO||i===Qc.AUDIO||i==Qc.MUXED)&&(o.br=r.bitrate/1e3,o.tb=this.getTopBandwidth(i)/1e3,o.bl=this.getBufferLength(i));let c=n?this.getNextPart(n):this.getNextFrag(t);c!=null&&c.url&&c.url!==t.url&&(o.nor=c.url),this.apply(e,o)}catch(e){this.hls.logger.warn(`Could not generate segment CMCD data.`,e)}},this.hls=e;let t=this.config=e.config,{cmcd:n}=t;n!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||e.sessionId,this.cid=n.contentId,this.useHeaders=n.useHeaders===!0,this.includeKeys=n.includeKeys,this.registerListeners())}registerListeners(){let e=this.hls;e.on(Q.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Q.MEDIA_DETACHED,this.onMediaDetached,this),e.on(Q.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){let e=this.hls;e.off(Q.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Q.MEDIA_DETACHED,this.onMediaDetached,this),e.off(Q.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=this.media=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener(`waiting`,this.onWaiting),this.media.addEventListener(`playing`,this.onPlaying)}onMediaDetached(){this.media&&=(this.media.removeEventListener(`waiting`,this.onWaiting),this.media.removeEventListener(`playing`,this.onPlaying),null)}onBufferCreated(e,t){this.audioBuffer=t.tracks.audio?.buffer,this.videoBuffer=t.tracks.video?.buffer}createData(){return{v:1,sf:$c.HLS,sid:this.sid,cid:this.cid,pr:this.media?.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){j(t,this.createData());let n=t.ot===Qc.INIT||t.ot===Qc.VIDEO||t.ot===Qc.MUXED;this.starved&&n&&(t.bs=!0,t.su=!0,this.starved=!1),t.su??=this.buffering;let{includeKeys:r}=this;r&&(t=Object.keys(t).reduce((e,n)=>(r.includes(n)&&(e[n]=t[n]),e),{}));let i={baseUrl:e.url};this.useHeaders?(e.headers||={},ta(e.headers,t,i)):e.url=aa(e.url,t,i)}getNextFrag(e){let t=this.hls.levels[e.level]?.details;if(t){let n=e.sn-t.startSN;return t.fragments[n+1]}}getNextPart(e){var t;let{index:n,fragment:r}=e,i=(t=this.hls.levels[r.level])==null||(t=t.details)==null?void 0:t.partList;if(i){let{sn:e}=r;for(let t=i.length-1;t>=0;t--){let r=i[t];if(r.index===n&&r.fragment.sn===e)return i[t+1]}}}getObjectType(e){let{type:t}=e;if(t===`subtitle`)return Qc.TIMED_TEXT;if(e.sn===`initSegment`)return Qc.INIT;if(t===`audio`)return Qc.AUDIO;if(t===`main`)return this.hls.audioTracks.length?Qc.VIDEO:Qc.MUXED}getTopBandwidth(e){let t=0,n,r=this.hls;if(e===Qc.AUDIO)n=r.audioTracks;else{let e=r.maxAutoLevel,t=e>-1?e+1:r.levels.length;n=r.levels.slice(0,t)}return n.forEach(e=>{e.bitrate>t&&(t=e.bitrate)}),t>0?t:NaN}getBufferLength(e){let t=this.media,n=e===Qc.AUDIO?this.audioBuffer:this.videoBuffer;return!n||!t?NaN:ws.bufferInfo(n,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){let{pLoader:e}=this.config,t=this.applyPlaylistData,n=e||this.config.loader;return class{constructor(e){this.loader=void 0,this.loader=new n(e)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(e,n,r){t(e),this.loader.load(e,n,r)}}}createFragmentLoader(){let{fLoader:e}=this.config,t=this.applyFragmentData,n=e||this.config.loader;return class{constructor(e){this.loader=void 0,this.loader=new n(e)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(e,n,r){t(e),this.loader.load(e,n,r)}}}},Il=3e5,Ll=class extends ko{constructor(e){super(`content-steering`,e.logger),this.hls=void 0,this.loader=null,this.uri=null,this.pathwayId=`.`,this._pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.registerListeners()}registerListeners(){let e=this.hls;e.on(Q.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Q.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(Q.MANIFEST_PARSED,this.onManifestParsed,this),e.on(Q.ERROR,this.onError,this)}unregisterListeners(){let e=this.hls;e&&(e.off(Q.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Q.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(Q.MANIFEST_PARSED,this.onManifestParsed,this),e.off(Q.ERROR,this.onError,this))}pathways(){return(this.levels||[]).reduce((e,t)=>(e.indexOf(t.pathwayId)===-1&&e.push(t.pathwayId),e),[])}get pathwayPriority(){return this._pathwayPriority}set pathwayPriority(e){this.updatePathwayPriority(e)}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){let e=this.timeToLoad*1e3-(performance.now()-this.updated);if(e>0){this.scheduleRefresh(this.uri,e);return}}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&=(this.loader.destroy(),null),this.clearTimeout()}clearTimeout(){this.reloadTimer!==-1&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){let t=this.levels;t&&(this.levels=t.filter(t=>t!==e))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=`.`,this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){let{contentSteering:n}=t;n!==null&&(this.pathwayId=n.pathwayId,this.uri=n.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){let{errorAction:n}=t;if(n?.action===ss.SendAlternateToPenaltyBox&&n.flags===cs.MoveAllAlternatesMatchingHost){let e=this.levels,r=this._pathwayPriority,i=this.pathwayId;if(t.context){let{groupId:n,pathwayId:r,type:o}=t.context;n&&e?i=this.getPathwayForGroupId(n,o,i):r&&(i=r)}i in this.penalizedPathways||(this.penalizedPathways[i]=performance.now()),!r&&e&&(r=this.pathways()),r&&r.length>1&&(this.updatePathwayPriority(r),n.resolved=this.pathwayId!==i),t.details===Z.BUFFER_APPEND_ERROR&&!t.fatal?n.resolved=!0:n.resolved||this.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${i} levels: ${e&&e.length} priorities: ${is(r)} penalized: ${is(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){let n=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${n}"`),t=this.getLevelsForPathway(n),this.pathwayId=n}return t.length!==e.length&&this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t}getLevelsForPathway(e){return this.levels===null?[]:this.levels.filter(t=>e===t.pathwayId)}updatePathwayPriority(e){this._pathwayPriority=e;let t,n=this.penalizedPathways,r=performance.now();Object.keys(n).forEach(e=>{r-n[e]>Il&&delete n[e]});for(let r=0;r<e.length;r++){let i=e[r];if(i in n)continue;if(i===this.pathwayId)return;let o=this.hls.nextLoadLevel,c=this.hls.levels[o];if(t=this.getLevelsForPathway(i),t.length>0){this.log(`Setting Pathway to "${i}"`),this.pathwayId=i,Un(t),this.hls.trigger(Q.LEVELS_UPDATED,{levels:t});let e=this.hls.levels[o];c&&e&&this.levels&&(e.attrs[`STABLE-VARIANT-ID`]!==c.attrs[`STABLE-VARIANT-ID`]&&e.bitrate!==c.bitrate&&this.log(`Unstable Pathways change from bitrate ${c.bitrate} to ${e.bitrate}`),this.hls.nextLoadLevel=o);break}}}getPathwayForGroupId(e,t,n){let r=this.getLevelsForPathway(n).concat(this.levels||[]);for(let n=0;n<r.length;n++)if(t===To.AUDIO_TRACK&&r[n].hasAudioGroup(e)||t===To.SUBTITLE_TRACK&&r[n].hasSubtitleGroup(e))return r[n].pathwayId;return n}clonePathways(e){let t=this.levels;if(!t)return;let n={},r={};e.forEach(e=>{let{ID:i,"BASE-ID":o,"URI-REPLACEMENT":c}=e;if(t.some(e=>e.pathwayId===i))return;let l=this.getLevelsForPathway(o).map(e=>{let t=new Os(e.attrs);t[`PATHWAY-ID`]=i;let o=t.AUDIO&&`${t.AUDIO}_clone_${i}`,l=t.SUBTITLES&&`${t.SUBTITLES}_clone_${i}`;o&&(n[t.AUDIO]=o,t.AUDIO=o),l&&(r[t.SUBTITLES]=l,t.SUBTITLES=l);let u=sa(e.uri,t[`STABLE-VARIANT-ID`],`PER-VARIANT-URIS`,c),d=new ns({attrs:t,audioCodec:e.audioCodec,bitrate:e.bitrate,height:e.height,name:e.name,url:u,videoCodec:e.videoCodec,width:e.width});if(e.audioGroups)for(let t=1;t<e.audioGroups.length;t++)d.addGroupId(`audio`,`${e.audioGroups[t]}_clone_${i}`);if(e.subtitleGroups)for(let t=1;t<e.subtitleGroups.length;t++)d.addGroupId(`text`,`${e.subtitleGroups[t]}_clone_${i}`);return d});t.push(...l),oa(this.audioTracks,n,c,i),oa(this.subtitleTracks,r,c,i)})}loadSteeringManifest(e){let t=this.hls.config,n=t.loader;this.loader&&this.loader.destroy(),this.loader=new n(t);let r;try{r=new self.URL(e)}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(r.protocol!==`data:`){let e=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;r.searchParams.set(`_HLS_pathway`,this.pathwayId),r.searchParams.set(`_HLS_throughput`,``+e)}let i={responseType:`json`,url:r.href},o=t.steeringManifestLoadPolicy.default,c=o.errorRetry||o.timeoutRetry||{},l={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:c.maxNumRetry||0,retryDelay:c.retryDelayMs||0,maxRetryDelay:c.maxRetryDelayMs||0};this.log(`Requesting steering manifest: ${r}`),this.loader.load(i,l,{onSuccess:(e,t,n,i)=>{this.log(`Loaded steering manifest: "${r}"`);let o=e.data;if(o?.VERSION!==1){this.log(`Steering VERSION ${o.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=o.TTL;let{"RELOAD-URI":c,"PATHWAY-CLONES":l,"PATHWAY-PRIORITY":u}=o;if(c)try{this.uri=new self.URL(c,r).href}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${c}`);return}this.scheduleRefresh(this.uri||n.url),l&&this.clonePathways(l);let d={steeringManifest:o,url:r.toString()};this.hls.trigger(Q.STEERING_MANIFEST_LOADED,d),u&&this.updatePathwayPriority(u)},onError:(e,t,n,r)=>{if(this.log(`Error loading steering manifest: ${e.code} ${e.text} (${t.url})`),this.stopLoad(),e.code===410){this.enabled=!1,this.log(`Steering manifest ${t.url} no longer available`);return}let i=this.timeToLoad*1e3;if(e.code===429){let e=this.loader;if(typeof e?.getResponseHeader==`function`){let t=e.getResponseHeader(`Retry-After`);t&&(i=parseFloat(t)*1e3)}this.log(`Steering manifest ${t.url} rate limited`);return}this.scheduleRefresh(this.uri||t.url,i)},onTimeout:(e,t,n)=>{this.log(`Timeout loading steering manifest (${t.url})`),this.scheduleRefresh(this.uri||t.url)}})}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{let t=this.hls?.media;if(t&&!t.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}},Rl=class e extends ko{constructor(t){super(`eme`,t.logger),this.hls=void 0,this.config=void 0,this.media=null,this.mediaResolved=void 0,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.mediaKeys=null,this.setMediaKeysQueue=e.CDMCleanupPromise?[e.CDMCleanupPromise]:[],this.bannedKeyIds={},this.onMediaEncrypted=e=>{let{initDataType:t,initData:n}=e,r=`"${e.type}" event: init data type: "${t}"`;if(this.debug(r),n!==null){if(!this.keyFormatPromise){let e=Object.keys(this.keySystemAccessPromises);e.length||(e=un(this.config));let t=e.map(ln).filter(e=>!!e);this.keyFormatPromise=this.getKeyFormatPromise(t)}this.keyFormatPromise.then(i=>{let o=cn(i);if(t!==`sinf`||o!==Ps.FAIRPLAY){this.log(`Ignoring "${e.type}" event with init data type: "${t}" for selected key-system ${o}`);return}let c;try{let e=re(new Uint8Array(n)),t=be(nn(JSON.parse(e).sinf));if(!t)throw Error(`'schm' box missing or not cbcs/cenc with schi > tenc`);c=new Uint8Array(t.subarray(8,24))}catch(e){this.warn(`${r} Failed to parse sinf: ${e}`);return}let l=W(c),{keyIdToKeySessionPromise:u,mediaKeySessions:d}=this,f=u[l];for(let e=0;e<d.length;e++){let r=d[e],i=r.decryptdata;if(!i.keyId)continue;let o=W(i.keyId);if(Qt(c,i.keyId)||i.uri.replace(/-/g,``).indexOf(l)!==-1){if(f=u[o],!f)continue;if(i.pssh)break;delete u[o],i.pssh=new Uint8Array(n),i.keyId=c,f=u[l]=f.then(()=>this.generateRequestWithPreferredKeySession(r,t,n,`encrypted-event-key-match`)),f.catch(e=>this.handleError(e));break}}f||this.handleError(Error(`Key ID ${l} not encountered in playlist. Key-system sessions ${d.length}.`))}).catch(e=>this.handleError(e))}},this.onWaitingForKey=e=>{this.log(`"${e.type}" event`)},this.hls=t,this.config=t.config,this.registerListeners()}destroy(){this.onDestroying(),this.onMediaDetached();let e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){this.hls.on(Q.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(Q.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(Q.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(Q.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.on(Q.DESTROYING,this.onDestroying,this)}unregisterListeners(){this.hls.off(Q.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(Q.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(Q.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(Q.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.off(Q.DESTROYING,this.onDestroying,this)}getLicenseServerUrl(e){let{drmSystems:t,widevineLicenseUrl:n}=this.config,r=t?.[e];if(r)return r.licenseUrl;if(e===Ps.WIDEVINE&&n)return n}getLicenseServerUrlOrThrow(e){let t=this.getLicenseServerUrl(e);if(t===void 0)throw Error(`no license server URL configured for key-system "${e}"`);return t}getServerCertificateUrl(e){let{drmSystems:t}=this.config,n=t?.[e];if(n)return n.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){let t=this.hls.levels,n=(e,t,n)=>!!e&&n.indexOf(e)===t,r=t.map(e=>e.audioCodec).filter(n),i=t.map(e=>e.videoCodec).filter(n);return r.length+i.length===0&&i.push(`avc1.42e01e`),new Promise((t,n)=>{let o=e=>{let c=e.shift();this.getMediaKeysPromise(c,r,i).then(e=>t({keySystem:c,mediaKeys:e})).catch(t=>{e.length?o(e):t instanceof zl?n(t):n(new zl({type:wo.KEY_SYSTEM_ERROR,details:Z.KEY_SYSTEM_NO_ACCESS,error:t,fatal:!0},t.message))})};o(e)})}requestMediaKeySystemAccess(e,t){let{requestMediaKeySystemAccessFunc:n}=this.config;if(typeof n!=`function`){let e=`Configured requestMediaKeySystemAccess is not a function ${n}`;return Is===null&&self.location.protocol===`http:`&&(e=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(Error(e))}return n(e,t)}getMediaKeysPromise(e,t,n){let r=dn(e,t,n,this.config.drmSystemOptions||{}),i=this.keySystemAccessPromises[e],o=i?.keySystemAccess;if(!o){this.log(`Requesting encrypted media "${e}" key-system access with config: ${is(r)}`),o=this.requestMediaKeySystemAccess(e,r);let t=i=this.keySystemAccessPromises[e]={keySystemAccess:o};return o.catch(t=>{this.log(`Failed to obtain access to key-system "${e}": ${t}`)}),o.then(n=>{this.log(`Access for key-system "${n.keySystem}" obtained`);let r=this.fetchServerCertificate(e);this.log(`Create media-keys for "${e}"`);let i=t.mediaKeys=n.createMediaKeys().then(n=>(this.log(`Media-keys created for "${e}"`),t.hasMediaKeys=!0,r.then(t=>t?this.setMediaKeysServerCertificate(n,e,t):n)));return i.catch(t=>{this.error(`Failed to create media-keys for "${e}"}: ${t}`)}),i})}return o.then(()=>i.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:n}){this.log(`Creating key-system session "${t}" keyId: ${W(e.keyId||[])} keyUri: ${e.uri}`);let r={decryptdata:e,keySystem:t,mediaKeys:n,mediaKeysSession:n.createSession(),keyStatus:`status-pending`};return this.mediaKeySessions.push(r),r}renewKeySession(e){let t=e.decryptdata;if(t.pssh){let n=this.createMediaKeySessionContext(e),r=ca(t);this.keyIdToKeySessionPromise[r]=this.generateRequestWithPreferredKeySession(n,`cenc`,t.pssh.buffer,`expired`)}else this.warn(`Could not renew expired session. Missing pssh initData.`);this.removeSession(e)}updateKeySession(e,t){let n=e.mediaKeysSession;return this.log(`Updating key-session "${n.sessionId}" for keyId ${W(e.decryptdata.keyId||[])}
35
+ } (data length: ${t.byteLength})`),n.update(t)}getSelectedKeySystemFormats(){return Object.keys(this.keySystemAccessPromises).map(e=>({keySystem:e,hasMediaKeys:this.keySystemAccessPromises[e].hasMediaKeys})).filter(({hasMediaKeys:e})=>!!e).map(({keySystem:e})=>ln(e)).filter(e=>!!e)}getKeySystemAccess(e){return this.getKeySystemSelectionPromise(e).then(({keySystem:e,mediaKeys:t})=>this.attemptSetMediaKeys(e,t))}selectKeySystem(e){return new Promise((t,n)=>{this.getKeySystemSelectionPromise(e).then(({keySystem:e})=>{let r=ln(e);r?t(r):n(Error(`Unable to find format for key-system "${e}"`))}).catch(n)})}selectKeySystemFormat(e){let t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||=(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(`, `)}`),this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){let t=un(this.config),n=e.map(cn).filter(e=>!!e&&t.indexOf(e)!==-1);return this.selectKeySystem(n)}getKeyStatus(e){let{mediaKeySessions:t}=this;for(let n=0;n<t.length;n++){let r=la(e,t[n]);if(r)return r}}loadKey(e){let t=e.keyInfo.decryptdata,n=ca(t),r=this.bannedKeyIds[n];if(r||this.getKeyStatus(t)===`internal-error`){let n=ua(r||`internal-error`,t);return this.handleError(n,e.frag),Promise.reject(n)}let i=`(keyId: ${n} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${i}`);let o=this.keyIdToKeySessionPromise[n];if(!o){let r=this.getKeySystemForKeyPromise(t).then(({keySystem:n,mediaKeys:r})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${i}`),this.attemptSetMediaKeys(n,r).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:n,mediaKeys:r,decryptdata:t}))))).then(e=>{let n=t.pssh?t.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(e,`cenc`,n,`playlist-key`)});return r.catch(t=>this.handleError(t,e.frag)),this.keyIdToKeySessionPromise[n]=r,r}return o.catch(n=>{if(n instanceof zl){let r=N({},n.data);this.getKeyStatus(t)===`internal-error`&&(r.decryptdata=t);let i=new zl(r,n.message);this.handleError(i,e.frag)}}),o}throwIfDestroyed(e=`Invalid state`){if(!this.hls)throw Error(`invalid state`)}handleError(e,t){if(this.hls)if(e instanceof zl){t&&(e.data.frag=t);let n=e.data.decryptdata;this.error(`${e.message}${n?` (${W(n.keyId||[])})`:``}`),this.hls.trigger(Q.ERROR,e.data)}else this.error(e.message),this.hls.trigger(Q.ERROR,{type:wo.KEY_SYSTEM_ERROR,details:Z.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0})}getKeySystemForKeyPromise(e){let t=ca(e),n=this.keyIdToKeySessionPromise[t];if(!n){let t=cn(e.keyFormat),n=t?[t]:un(this.config);return this.attemptKeySystemAccess(n)}return n}getKeySystemSelectionPromise(e){if(e.length||(e=un(this.config)),e.length===0)throw new zl({type:wo.KEY_SYSTEM_ERROR,details:Z.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${is({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,t){if(this.mediaResolved=void 0,this.mediaKeys===t)return Promise.resolve();let n=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);let r=Promise.all(n).then(()=>this.media?this.media.setMediaKeys(t):new Promise((e,n)=>{this.mediaResolved=()=>{if(this.mediaResolved=void 0,!this.media)return n(Error(`Attempted to set mediaKeys without media element attached`));this.mediaKeys=t,this.media.setMediaKeys(t).then(e).catch(n)}}));return this.mediaKeys=t,this.setMediaKeysQueue.push(r),r.then(()=>{this.log(`Media-keys set for "${e}"`),n.push(r),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(e=>n.indexOf(e)===-1)})}generateRequestWithPreferredKeySession(e,t,n,r){var i;let o=(i=this.config.drmSystems)==null||(i=i[e.keySystem])==null?void 0:i.generateRequest;if(o)try{let r=o.call(this.hls,t,n,e);if(!r)throw Error(`Invalid response from configured generateRequest filter`);t=r.initDataType,n=r.initData?r.initData:null,e.decryptdata.pssh=n?new Uint8Array(n):null}catch(e){if(this.warn(e.message),this.hls&&this.hls.config.debug)throw e}if(n===null)return this.log(`Skipping key-session request for "${r}" (no initData)`),Promise.resolve(e);let c=ca(e.decryptdata),l=e.decryptdata.uri;this.log(`Generating key-session request for "${r}" keyId: ${c} URI: ${l} (init data type: ${t} length: ${n.byteLength})`);let u=new Xs,d=e._onmessage=t=>{let n=e.mediaKeysSession;if(!n){u.emit(`error`,Error(`invalid state`));return}let{messageType:r,message:i}=t;this.log(`"${r}" message event for session "${n.sessionId}" message size: ${i.byteLength}`),r===`license-request`||r===`license-renewal`?this.renewLicense(e,i).catch(e=>{u.eventNames().length?u.emit(`error`,e):this.handleError(e)}):r===`license-release`?e.keySystem===Ps.FAIRPLAY&&this.updateKeySession(e,rn(`acknowledged`)).then(()=>this.removeSession(e)).catch(e=>this.handleError(e)):this.warn(`unhandled media key message type "${r}"`)},f=(e,t)=>{t.keyStatus=e;let n;e.startsWith(`usable`)?u.emit(`resolved`):e===`internal-error`||e===`output-restricted`||e===`output-downscaled`?n=ua(e,t.decryptdata):e===`expired`?n=Error(`key expired (keyId: ${c})`):e===`released`?n=Error(`key released`):e===`status-pending`||this.warn(`unhandled key status change "${e}" (keyId: ${c})`),n&&(u.eventNames().length?u.emit(`error`,n):this.handleError(n))},p=e._onkeystatuseschange=t=>{if(!e.mediaKeysSession){u.emit(`error`,Error(`invalid state`));return}let n=this.getKeyStatuses(e);if(!Object.keys(n).some(e=>n[e]!==`status-pending`))return;if(n[c]===`expired`){this.log(`Expired key ${is(n)} in key-session "${e.mediaKeysSession.sessionId}"`),this.renewKeySession(e);return}let r=n[c];if(r)f(r,e);else{var i;let t=1e3;e.keyStatusTimeouts||={},(i=e.keyStatusTimeouts)[c]||(i[c]=self.setTimeout(()=>{if(!e.mediaKeysSession||!this.mediaKeys)return;let n=this.getKeyStatus(e.decryptdata);if(n&&n!==`status-pending`)return this.log(`No status for keyId ${c} in key-session "${e.mediaKeysSession.sessionId}". Using session key-status ${n} from other session.`),f(n,e);this.log(`key status for ${c} in key-session "${e.mediaKeysSession.sessionId}" timed out after ${t}ms`),r=`internal-error`,f(r,e)},t)),this.log(`No status for keyId ${c} (${is(n)}).`)}};$n(e.mediaKeysSession,`message`,d),$n(e.mediaKeysSession,`keystatuseschange`,p);let m=new Promise((e,t)=>{u.on(`error`,t),u.on(`resolved`,e)});return e.mediaKeysSession.generateRequest(t,n).then(()=>{this.log(`Request generated for key-session "${e.mediaKeysSession.sessionId}" keyId: ${c} URI: ${l}`)}).catch(t=>{throw new zl({type:wo.KEY_SYSTEM_ERROR,details:Z.KEY_SYSTEM_NO_SESSION,error:t,decryptdata:e.decryptdata,fatal:!1},`Error generating key-session request: ${t}`)}).then(()=>m).catch(t=>(u.removeAllListeners(),this.removeSession(e).then(()=>{throw t}))).then(()=>(u.removeAllListeners(),e))}getKeyStatuses(e){let t={};return e.mediaKeysSession.keyStatuses.forEach((n,r)=>{if(typeof r==`string`&&typeof n==`object`){let e=r;r=n,n=e}let i=`buffer`in r?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):new Uint8Array(r);if(e.keySystem===Ps.PLAYREADY&&i.length===16){let e=W(i);t[e]=n,on(i)}let o=W(i);n===`internal-error`&&(this.bannedKeyIds[o]=n),this.log(`key status change "${n}" for keyStatuses keyId: ${o} key-session "${e.mediaKeysSession.sessionId}"`),t[o]=n}),t}fetchServerCertificate(e){let t=this.config,n=t.loader,r=new n(t),i=this.getServerCertificateUrl(e);return i?(this.log(`Fetching server certificate for "${e}"`),new Promise((n,o)=>{let c={responseType:`arraybuffer`,url:i},l=t.certLoadPolicy.default,u={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0};r.load(c,u,{onSuccess:(e,t,r,i)=>{n(e.data)},onError:(t,n,r,l)=>{o(new zl({type:wo.KEY_SYSTEM_ERROR,details:Z.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:r,response:N({url:c.url,data:void 0},t)},`"${e}" certificate request failed (${i}). Status: ${t.code} (${t.text})`))},onTimeout:(t,n,r)=>{o(new zl({type:wo.KEY_SYSTEM_ERROR,details:Z.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:r,response:{url:c.url,data:void 0}},`"${e}" certificate request timed out (${i})`))},onAbort:(e,t,n)=>{o(Error(`aborted`))}})})):Promise.resolve()}setMediaKeysServerCertificate(e,t,n){return new Promise((r,i)=>{e.setServerCertificate(n).then(i=>{this.log(`setServerCertificate ${i?`success`:`not supported by CDM`} (${n.byteLength}) on "${t}"`),r(e)}).catch(e=>{i(new zl({type:wo.KEY_SYSTEM_ERROR,details:Z.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:e,fatal:!0},e.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(t=>this.updateKeySession(e,new Uint8Array(t)).catch(t=>{throw new zl({type:wo.KEY_SYSTEM_ERROR,details:Z.KEY_SYSTEM_SESSION_UPDATE_FAILED,decryptdata:e.decryptdata,error:t,fatal:!1},t.message)}))}unpackPlayReadyKeyMessage(e,t){let n=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!n.includes(`PlayReadyKeyMessage`))return e.setRequestHeader(`Content-Type`,`text/xml; charset=utf-8`),t;let r=new DOMParser().parseFromString(n,`application/xml`),i=r.querySelectorAll(`HttpHeader`);if(i.length>0){let t;for(let n=0,r=i.length;n<r;n++){t=i[n];let r=t.querySelector(`name`)?.textContent,o=t.querySelector(`value`)?.textContent;r&&o&&e.setRequestHeader(r,o)}}let o=r.querySelector(`Challenge`)?.textContent;if(!o)throw Error(`Cannot find <Challenge> in key message`);return rn(atob(o))}setupLicenseXHR(e,t,n,r){let i=this.config.licenseXhrSetup;return i?Promise.resolve().then(()=>{if(!n.decryptdata)throw Error(`Key removed`);return i.call(this.hls,e,t,n,r)}).catch(o=>{if(!n.decryptdata)throw o;return e.open(`POST`,t,!0),i.call(this.hls,e,t,n,r)}).then(n=>(e.readyState||e.open(`POST`,t,!0),{xhr:e,licenseChallenge:n||r})):(e.open(`POST`,t,!0),Promise.resolve({xhr:e,licenseChallenge:r}))}requestLicense(e,t){let n=this.config.keyLoadPolicy.default;return new Promise((r,i)=>{let o=this.getLicenseServerUrlOrThrow(e.keySystem);this.log(`Sending license request to URL: ${o}`);let c=new XMLHttpRequest;c.responseType=`arraybuffer`,c.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return i(Error(`invalid state`));if(c.readyState===4)if(c.status===200){this._requestLicenseFailureCount=0;let t=c.response;this.log(`License received ${t instanceof ArrayBuffer?t.byteLength:t}`);let n=this.config.licenseResponseCallback;if(n)try{t=n.call(this.hls,c,o,e)}catch(e){this.error(e)}r(t)}else{let l=n.errorRetry,u=l?l.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>u||c.status>=400&&c.status<500)i(new zl({type:wo.KEY_SYSTEM_ERROR,details:Z.KEY_SYSTEM_LICENSE_REQUEST_FAILED,decryptdata:e.decryptdata,fatal:!0,networkDetails:c,response:{url:o,data:void 0,code:c.status,text:c.statusText}},`License Request XHR failed (${o}). Status: ${c.status} (${c.statusText})`));else{let n=u-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${n} attempts left`),this.requestLicense(e,t).then(r,i)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=c,this.setupLicenseXHR(c,o,e,t).then(({xhr:t,licenseChallenge:n})=>{e.keySystem==Ps.PLAYREADY&&(n=this.unpackPlayReadyKeyMessage(t,n)),t.send(n)}).catch(i)})}onDestroying(){this.unregisterListeners(),this._clear()}onMediaAttached(e,t){if(!this.config.emeEnabled)return;let n=t.media;this.media=n,$n(n,`encrypted`,this.onMediaEncrypted),$n(n,`waitingforkey`,this.onWaitingForKey);let r=this.mediaResolved;r?r():this.mediaKeys=n.mediaKeys}onMediaDetached(){let e=this.media;e&&(er(e,`encrypted`,this.onMediaEncrypted),er(e,`waitingforkey`,this.onWaitingForKey),this.media=null,this.mediaKeys=null)}_clear(){var t;this._requestLicenseFailureCount=0,this.keyIdToKeySessionPromise={},this.bannedKeyIds={};let n=this.mediaResolved;if(n&&n(),!this.mediaKeys&&!this.mediaKeySessions.length)return;let r=this.media,i=this.mediaKeySessions.slice();this.mediaKeySessions=[],this.mediaKeys=null,Rs.clearKeyUriToKeyIdMap();let o=i.length;e.CDMCleanupPromise=Promise.all(i.map(e=>this.removeSession(e)).concat((r==null||(t=r.setMediaKeys(null))==null?void 0:t.catch(e=>{this.log(`Could not clear media keys: ${e}`),this.hls&&this.hls.trigger(Q.ERROR,{type:wo.OTHER_ERROR,details:Z.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:Error(`Could not clear media keys: ${e}`)})}))||Promise.resolve())).catch(e=>{this.log(`Could not close sessions and clear media keys: ${e}`),this.hls&&this.hls.trigger(Q.ERROR,{type:wo.OTHER_ERROR,details:Z.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:Error(`Could not close sessions and clear media keys: ${e}`)})}).then(()=>{o&&this.log(`finished closing key sessions and clearing media keys`)})}onManifestLoading(){this._clear()}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){let e=t.reduce((e,t)=>(e.indexOf(t.keyFormat)===-1&&e.push(t.keyFormat),e),[]);this.log(`Selecting key-system from session-keys ${e.join(`, `)}`),this.keyFormatPromise=this.getKeyFormatPromise(e)}}removeSession(e){let{mediaKeysSession:t,licenseXhr:n,decryptdata:r}=e;if(t){this.log(`Remove licenses and keys and close session "${t.sessionId}" keyId: ${W(r?.keyId||[])}`),e._onmessage&&=(t.removeEventListener(`message`,e._onmessage),void 0),e._onkeystatuseschange&&=(t.removeEventListener(`keystatuseschange`,e._onkeystatuseschange),void 0),n&&n.readyState!==XMLHttpRequest.DONE&&n.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;let i=this.mediaKeySessions.indexOf(e);i>-1&&this.mediaKeySessions.splice(i,1);let{keyStatusTimeouts:o}=e;o&&Object.keys(o).forEach(e=>self.clearTimeout(o[e]));let{drmSystemOptions:c}=this.config;return(pn(c)?new Promise((e,n)=>{self.setTimeout(()=>n(Error(`MediaKeySession.remove() timeout`)),8e3),t.remove().then(e).catch(n)}):Promise.resolve()).catch(e=>{this.log(`Could not remove session: ${e}`),this.hls&&this.hls.trigger(Q.ERROR,{type:wo.OTHER_ERROR,details:Z.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:Error(`Could not remove session: ${e}`)})}).then(()=>t.close()).catch(e=>{this.log(`Could not close session: ${e}`),this.hls&&this.hls.trigger(Q.ERROR,{type:wo.OTHER_ERROR,details:Z.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:Error(`Could not close session: ${e}`)})})}return Promise.resolve()}},Rl.CDMCleanupPromise=void 0,zl=class extends Error{constructor(e,t){super(t),this.data=void 0,e.error||=Error(t),this.data=e,e.err=e.error}},Bl=class{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(Q.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(Q.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(Q.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(Q.MEDIA_DETACHING,this.onMediaDetaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){let n=this.hls.config;if(n.capLevelOnFPSDrop){let e=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=e,e&&typeof e.getVideoPlaybackQuality==`function`&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),n.fpsDroppedMonitoringPeriod)}}onMediaDetaching(){this.media=null}checkFPS(e,t,n){let r=performance.now();if(t){if(this.lastTime){let e=r-this.lastTime,i=n-this.lastDroppedFrames,o=t-this.lastDecodedFrames,c=1e3*i/e,l=this.hls;if(l.trigger(Q.FPS_DROP,{currentDropped:i,currentDecoded:o,totalDroppedFrames:n}),c>0&&i>l.config.fpsDroppedMonitoringThreshold*o){let e=l.currentLevel;l.logger.warn(`drop FPS ratio greater than max allowed value for currentLevel: `+e),e>0&&(l.autoLevelCapping===-1||l.autoLevelCapping>=e)&&(--e,l.trigger(Q.FPS_DROP_LEVEL_CAPPING,{level:e,droppedLevel:l.currentLevel}),l.autoLevelCapping=e,this.streamController.nextLevelSwitch())}}this.lastTime=r,this.lastDroppedFrames=n,this.lastDecodedFrames=t}}checkFPSInterval(){let e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){let t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}},Vl=class extends Wc{constructor(e){super(e,`subtitle-track-controller`),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let e=null,t=_a(this.media.textTracks);for(let n=0;n<t.length;n++)if(t[n].mode===`hidden`)e=t[n];else if(t[n].mode===`showing`){e=t[n];break}let n=this.findTrackForTextTrack(e);this.subtitleTrack!==n&&this.setSubtitleTrack(n)},this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,this.onTextTracksChanged=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes()}registerListeners(){let{hls:e}=this;e.on(Q.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Q.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Q.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Q.MANIFEST_PARSED,this.onManifestParsed,this),e.on(Q.LEVEL_LOADING,this.onLevelLoading,this),e.on(Q.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(Q.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(Q.ERROR,this.onError,this)}unregisterListeners(){let{hls:e}=this;e.off(Q.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Q.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Q.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Q.MANIFEST_PARSED,this.onManifestParsed,this),e.off(Q.LEVEL_LOADING,this.onLevelLoading,this),e.off(Q.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(Q.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(Q.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&`onchange`in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener(`change`,this.asyncPollTrackChange))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,e)}onMediaDetaching(e,t){let n=this.media;if(!n)return;let r=!!t.transferMedia;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||n.textTracks.removeEventListener(`change`,this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,!r&&_a(n.textTracks).forEach(e=>{pa(e)})}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){let{id:n,groupId:r,details:i}=t,o=this.tracksInGroup[n];if(!o||o.groupId!==r){this.warn(`Subtitle track with id:${n} and group:${r} not found in active group ${o?.groupId}`);return}let c=o.details;o.details=t.details,this.log(`Subtitle track ${n} "${o.name}" lang:${o.lang} group:${r} loaded [${i.startSN}-${i.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,c)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){let t=this.hls.levels[e];if(!t)return;let n=t.subtitleGroups||null,r=this.groupIds,i=this.currentTrack;if(!n||r?.length!==n?.length||n!=null&&n.some(e=>r?.indexOf(e)===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;let e=this.tracks.filter(e=>!n||n.indexOf(e.groupId)!==-1);if(e.length)this.selectDefaultTrack&&!e.some(e=>e.default)&&(this.selectDefaultTrack=!1),e.forEach((e,t)=>{e.id=t});else if(!i&&!this.tracksInGroup.length)return;this.tracksInGroup=e;let t=this.hls.config.subtitlePreference;if(!i&&t){this.selectDefaultTrack=!1;let n=pt(t,e);if(n>-1)i=e[n];else{let e=pt(t,this.tracks);i=this.tracks[e]}}let r=this.findTrackId(i);r===-1&&i&&(r=this.findTrackId(null));let o={subtitleTracks:e};this.log(`Updating subtitle tracks, ${e.length} track(s) found in "${n?.join(`,`)}" group-id`),this.hls.trigger(Q.SUBTITLE_TRACKS_UPDATED,o),r!==-1&&this.trackId===-1&&this.setSubtitleTrack(r)}}findTrackId(e){let t=this.tracksInGroup,n=this.selectDefaultTrack;for(let r=0;r<t.length;r++){let i=t[r];if(!(n&&!i.default||!n&&!e)&&(!e||mt(i,e)))return r}if(e){for(let n=0;n<t.length;n++){let r=t[n];if(_i(e.attrs,r.attrs,[`LANGUAGE`,`ASSOC-LANGUAGE`,`CHARACTERISTICS`]))return n}for(let n=0;n<t.length;n++){let r=t[n];if(_i(e.attrs,r.attrs,[`LANGUAGE`]))return n}}return-1}findTrackForTextTrack(e){if(e){let t=this.tracksInGroup;for(let n=0;n<t.length;n++){let r=t[n];if(vi(r,e))return n}}return-1}onError(e,t){t.fatal||!t.context||t.context.type===To.SUBTITLE_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&this.checkRetry(t)}get allSubtitleTracks(){return this.tracks}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(e){this.selectDefaultTrack=!1,this.setSubtitleTrack(e)}setSubtitleOption(e){if(this.hls.config.subtitlePreference=e,e){if(e.id===-1)return this.setSubtitleTrack(-1),null;let t=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,t.length){let n=this.currentTrack;if(n&&mt(e,n))return n;let r=pt(e,this.tracksInGroup);if(r>-1){let e=this.tracksInGroup[r];return this.setSubtitleTrack(r),e}else if(n)return null;else{let n=pt(e,t);if(n>-1)return t[n]}}}return null}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);let n=e.id,r=e.groupId,i=this.getUrlWithDirectives(e.url,t),o=e.details,c=o?.age;this.log(`Loading subtitle ${n} "${e.name}" lang:${e.lang} group:${r}${t?.msn===void 0?``:` at sn `+t.msn+` part `+t.part}${c&&o.live?` age `+c.toFixed(1)+(o.type&&` `+o.type||``):``} ${i}`),this.hls.trigger(Q.SUBTITLE_TRACK_LOADING,{url:i,id:n,groupId:r,deliveryDirectives:t||null,track:e})}toggleTrackModes(){let{media:e}=this;if(!e)return;let t=_a(e.textTracks),n=this.currentTrack,r;if(n&&(r=t.filter(e=>vi(n,e))[0],r||this.warn(`Unable to find subtitle TextTrack with name "${n.name}" and language "${n.lang}"`)),[].slice.call(t).forEach(e=>{e.mode!==`disabled`&&e!==r&&(e.mode=`disabled`)}),r){let e=this.subtitleDisplay?`showing`:`hidden`;r.mode!==e&&(r.mode=e)}}setSubtitleTrack(e){let t=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=t.length||!X(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.selectDefaultTrack=!1;let n=this.currentTrack,r=t[e]||null;if(this.trackId=e,this.currentTrack=r,this.toggleTrackModes(),!r){this.hls.trigger(Q.SUBTITLE_TRACK_SWITCH,{id:e});return}let i=!!r.details&&!r.details.live;if(e===this.trackId&&r===n&&i)return;this.log(`Switching to subtitle-track ${e}`+(r?` "${r.name}" lang:${r.lang} group:${r.groupId}`:``));let{id:o,groupId:c=``,name:l,type:u,url:d}=r;this.hls.trigger(Q.SUBTITLE_TRACK_SWITCH,{id:o,groupId:c,name:l,type:u,url:d});let f=this.switchParams(r.url,n?.details,r.details);this.loadPlaylist(f)}},Hl=.025,Ul=function(e){return e[e.Point=0]=`Point`,e[e.Range=1]=`Range`,e}({}),Wl=class{constructor(e,t){this.base=void 0,this._duration=null,this._timelineStart=null,this.appendInPlaceDisabled=void 0,this.appendInPlaceStarted=void 0,this.dateRange=void 0,this.hasPlayed=!1,this.cumulativeDuration=0,this.resumeOffset=NaN,this.playoutLimit=NaN,this.restrictions={skip:!1,jump:!1},this.snapOptions={out:!1,in:!1},this.assetList=[],this.assetListLoader=void 0,this.assetListResponse=null,this.resumeAnchor=void 0,this.error=void 0,this.resetOnResume=void 0,this.base=t,this.dateRange=e,this.setDateRange(e)}setDateRange(e){this.dateRange=e,this.resumeOffset=e.attr.optionalFloat(`X-RESUME-OFFSET`,this.resumeOffset),this.playoutLimit=e.attr.optionalFloat(`X-PLAYOUT-LIMIT`,this.playoutLimit),this.restrictions=e.attr.enumeratedStringList(`X-RESTRICT`,this.restrictions),this.snapOptions=e.attr.enumeratedStringList(`X-SNAP`,this.snapOptions)}reset(){var e;this.appendInPlaceStarted=!1,(e=this.assetListLoader)==null||e.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)}isAssetPastPlayoutLimit(e){if(e>0&&e>=this.assetList.length)return!0;let t=this.playoutLimit;return e<=0||isNaN(t)?!1:t===0?!0:(this.assetList[e]?.startOffset||0)>t}findAssetIndex(e){return this.assetList.indexOf(e)}get identifier(){return this.dateRange.id}get startDate(){return this.dateRange.startDate}get startTime(){let e=this.dateRange.startTime;if(this.snapOptions.out){let t=this.dateRange.tagAnchor;if(t)return xa(e,t)}return e}get startOffset(){return this.cue.pre?0:this.startTime}get startIsAligned(){if(this.startTime===0||this.snapOptions.out)return!0;let e=this.dateRange.tagAnchor;if(e){let t=this.dateRange.startTime;return t-xa(t,e)<.1}return!1}get resumptionOffset(){let e=this.resumeOffset,t=X(e)?e:this.duration;return this.cumulativeDuration+t}get resumeTime(){let e=this.startOffset+this.resumptionOffset;if(this.snapOptions.in){let t=this.resumeAnchor;if(t)return xa(e,t)}return e}get appendInPlace(){return this.appendInPlaceStarted?!0:this.appendInPlaceDisabled?!1:!!(!this.cue.once&&!this.cue.pre&&this.startIsAligned&&(isNaN(this.playoutLimit)&&isNaN(this.resumeOffset)||this.resumeOffset&&this.duration&&Math.abs(this.resumeOffset-this.duration)<Hl))}set appendInPlace(e){if(this.appendInPlaceStarted){this.resetOnResume=!e;return}this.appendInPlaceDisabled=!e}get timelineStart(){return this._timelineStart===null?this.startTime:this._timelineStart}set timelineStart(e){this._timelineStart=e}get duration(){let e=this.playoutLimit,t;return t=this._duration===null?this.dateRange.duration?this.dateRange.duration:this.dateRange.plannedDuration||0:this._duration,!isNaN(e)&&e<t&&(t=e),t}set duration(e){this._duration=e}get cue(){return this.dateRange.cue}get timelineOccupancy(){return this.dateRange.attr[`X-TIMELINE-OCCUPIES`]===`RANGE`?Ul.Range:Ul.Point}get supplementsPrimary(){return this.dateRange.attr[`X-TIMELINE-STYLE`]===`PRIMARY`}get contentMayVary(){return this.dateRange.attr[`X-CONTENT-MAY-VARY`]!==`NO`}get assetUrl(){return this.dateRange.attr[`X-ASSET-URI`]}get assetListUrl(){return this.dateRange.attr[`X-ASSET-LIST`]}get baseUrl(){return this.base.url}get assetListLoaded(){return this.assetList.length>0||this.assetListResponse!==null}toString(){return wa(this)}},Gl=class{constructor(e,t,n,r){this.hls=void 0,this.interstitial=void 0,this.assetItem=void 0,this.tracks=null,this.hasDetails=!1,this.mediaAttached=null,this._currentTime=void 0,this._bufferedEosTime=void 0,this.checkPlayout=()=>{this.reachedPlayout(this.currentTime)&&this.hls&&this.hls.trigger(Q.PLAYOUT_LIMIT_REACHED,{})};let i=this.hls=new e(t);this.interstitial=n,this.assetItem=r;let o=()=>{this.hasDetails=!0};i.once(Q.LEVEL_LOADED,o),i.once(Q.AUDIO_TRACK_LOADED,o),i.once(Q.SUBTITLE_TRACK_LOADED,o),i.on(Q.MEDIA_ATTACHING,(e,{media:t})=>{this.removeMediaListeners(),this.mediaAttached=t,this.interstitial.playoutLimit&&(t.addEventListener(`timeupdate`,this.checkPlayout),this.appendInPlace&&i.on(Q.BUFFER_APPENDED,()=>{let e=this.bufferedEnd;this.reachedPlayout(e)&&(this._bufferedEosTime=e,i.trigger(Q.BUFFERED_TO_END,void 0))}))})}get appendInPlace(){return this.interstitial.appendInPlace}loadSource(){let e=this.hls;if(e)if(e.url)e.levels.length&&!e.started&&e.startLoad(-1,!0);else{let t=this.assetItem.uri;try{t=Sa(t,e.config.primarySessionId||``).href}catch{}e.loadSource(t)}}bufferedInPlaceToEnd(e){var t;if(!this.appendInPlace)return!1;if((t=this.hls)!=null&&t.bufferedToEnd)return!0;if(!e)return!1;let n=Math.min(this._bufferedEosTime||1/0,this.duration),r=this.timelineOffset,i=ws.bufferInfo(e,r,0);return this.getAssetTime(i.end)>=n-.02}reachedPlayout(e){let t=this.interstitial.playoutLimit;return this.startOffset+e>=t}get destroyed(){var e;return!((e=this.hls)!=null&&e.userConfig)}get assetId(){return this.assetItem.identifier}get interstitialId(){return this.assetItem.parentIdentifier}get media(){return this.hls?.media||null}get bufferedEnd(){let e=this.media||this.mediaAttached;if(!e)return this._bufferedEosTime?this._bufferedEosTime:this.currentTime;let t=ws.bufferInfo(e,e.currentTime,.001);return this.getAssetTime(t.end)}get currentTime(){let e=this.media||this.mediaAttached;return e?this.getAssetTime(e.currentTime):this._currentTime||0}get duration(){let e=this.assetItem.duration;if(!e)return 0;let t=this.interstitial.playoutLimit;if(t){let n=t-this.startOffset;if(n>0&&n<e)return n}return e}get remaining(){let e=this.duration;return e?Math.max(0,e-this.currentTime):0}get startOffset(){return this.assetItem.startOffset}get timelineOffset(){return this.hls?.config.timelineOffset||0}set timelineOffset(e){let t=this.timelineOffset;if(e!==t){let n=e-t;if(Math.abs(n)>1/9e4&&this.hls){if(this.hasDetails)throw Error(`Cannot set timelineOffset after playlists are loaded`);this.hls.config.timelineOffset=e}}}getAssetTime(e){let t=this.timelineOffset,n=this.duration;return Math.min(Math.max(0,e-t),n)}removeMediaListeners(){let e=this.mediaAttached;e&&(this._currentTime=e.currentTime,this.bufferSnapShot(),e.removeEventListener(`timeupdate`,this.checkPlayout))}bufferSnapShot(){if(this.mediaAttached){var e;(e=this.hls)!=null&&e.bufferedToEnd&&(this._bufferedEosTime=this.bufferedEnd)}}destroy(){this.removeMediaListeners(),this.hls&&this.hls.destroy(),this.hls=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(e){var t;this.loadSource(),(t=this.hls)==null||t.attachMedia(e)}detachMedia(){var e;this.removeMediaListeners(),this.mediaAttached=null,(e=this.hls)==null||e.detachMedia()}resumeBuffering(){var e;(e=this.hls)==null||e.resumeBuffering()}pauseBuffering(){var e;(e=this.hls)==null||e.pauseBuffering()}transferMedia(){return this.bufferSnapShot(),this.hls?.transferMedia()||null}resetDetails(){let e=this.hls;if(e&&this.hasDetails){e.stopLoad();let t=e=>delete e.details;e.levels.forEach(t),e.allAudioTracks.forEach(t),e.allSubtitleTracks.forEach(t),this.hasDetails=!1}}on(e,t,n){var r;(r=this.hls)==null||r.on(e,t)}once(e,t,n){var r;(r=this.hls)==null||r.once(e,t)}off(e,t,n){var r;(r=this.hls)==null||r.off(e,t)}toString(){return`HlsAssetPlayer: ${Ta(this.assetItem)} ${this.hls?.sessionId} ${this.appendInPlace?`append-in-place`:``}`}},Kl=.033,ql=class extends ko{constructor(e,t){super(`interstitials-sched`,t),this.onScheduleUpdate=void 0,this.eventMap={},this.events=null,this.items=null,this.durations={primary:0,playout:0,integrated:0},this.onScheduleUpdate=e}destroy(){this.reset(),this.onScheduleUpdate=null}reset(){this.eventMap={},this.setDurations(0,0,0),this.events&&this.events.forEach(e=>e.reset()),this.events=this.items=null}resetErrorsInRange(e,t){return this.events?this.events.reduce((n,r)=>e<=r.startOffset&&t>r.startOffset?(delete r.error,n+1):n,0):0}get duration(){let e=this.items;return e?e[e.length-1].end:0}get length(){return this.items?this.items.length:0}getEvent(e){return e&&this.eventMap[e]||null}hasEvent(e){return e in this.eventMap}findItemIndex(e,t){if(e.event)return this.findEventIndex(e.event.identifier);let n=-1;e.nextEvent?n=this.findEventIndex(e.nextEvent.identifier)-1:e.previousEvent&&(n=this.findEventIndex(e.previousEvent.identifier)+1);let r=this.items;if(r)for(r[n]||(t===void 0&&(t=e.start),n=this.findItemIndexAtTime(t));n>=0&&(i=r[n])!=null&&i.event;){var i;n--}return n}findItemIndexAtTime(e,t){let n=this.items;if(n)for(let r=0;r<n.length;r++){let i=n[r];if(t&&t!==`primary`&&(i=i[t]),e===i.start||e>i.start&&e<i.end)return r}return-1}findJumpRestrictedIndex(e,t){let n=this.items;if(n)for(let r=e;r<=t&&n[r];r++){let e=n[r].event;if(e!=null&&e.restrictions.jump&&!e.appendInPlace)return r}return-1}findEventIndex(e){let t=this.items;if(t){for(let n=t.length;n--;)if(t[n].event?.identifier===e)return n}return-1}findAssetIndex(e,t){let n=e.assetList,r=n.length;if(r>1)for(let e=0;e<r;e++){let i=n[e];if(!i.error){let n=i.timelineStart;if(t===n||t>n&&(t<n+(i.duration||0)||e===r-1))return e}}return 0}get assetIdAtEnd(){var e;let t=(e=this.items)==null||(e=e[this.length-1])==null?void 0:e.event;if(t){let e=t.assetList,n=e[e.length-1];if(n)return n.identifier}return null}parseInterstitialDateRanges(e,t){let n=e.main.details,{dateRanges:r}=n,i=this.events,o=this.parseDateRanges(r,{url:n.url},t),c=Object.keys(r),l=i?i.filter(e=>!c.includes(e.identifier)):[];o.length&&o.sort((e,t)=>{let n=e.cue.pre,r=e.cue.post,i=t.cue.pre,o=t.cue.post;if(n&&!i)return-1;if(i&&!n||r&&!o)return 1;if(o&&!r)return-1;if(!n&&!i&&!r&&!o){let n=e.startTime,r=t.startTime;if(n!==r)return n-r}return e.dateRange.tagOrder-t.dateRange.tagOrder}),this.events=o,l.forEach(e=>{this.removeEvent(e)}),this.updateSchedule(e,l)}updateSchedule(e,t=[],n=!1){let r=this.events||[];if(r.length||t.length||this.length<2){let i=this.items,o=this.parseSchedule(r,e);(n||t.length||i?.length!==o.length||o.some((e,t)=>Math.abs(e.playout.start-i[t].playout.start)>.005||Math.abs(e.playout.end-i[t].playout.end)>.005))&&(this.items=o,this.onScheduleUpdate(t,i))}}parseDateRanges(e,t,n){let r=[],i=Object.keys(e);for(let o=0;o<i.length;o++){let c=i[o],l=e[c];if(l.isInterstitial){let e=this.eventMap[c];e?e.setDateRange(l):(e=new Wl(l,t),this.eventMap[c]=e,n===!1&&(e.appendInPlace=n)),r.push(e)}}return r}parseSchedule(e,t){let n=[],r=t.main.details,i=r.live?1/0:r.edge,o=0;if(e=e.filter(e=>!e.error&&!(e.cue.once&&e.hasPlayed)),e.length){this.resolveOffsets(e,t);let r=0,c=0;if(e.forEach((t,l)=>{let u=t.cue.pre,d=t.cue.post,f=e[l-1]||null,p=t.appendInPlace,m=d?i:t.startOffset,h=t.duration,g=t.timelineOccupancy===Ul.Range?h:0,_=t.resumptionOffset,v=f?.startTime===m,y=m+t.cumulativeDuration,b=p?y+h:m+_;if(u||!d&&m<=0){let e=c;c+=g,t.timelineStart=y;let r=o;o+=h,n.push({event:t,start:y,end:b,playout:{start:r,end:o},integrated:{start:e,end:c}})}else if(m<=i){if(!v){let i=m-r;if(i>Kl){let u=r,d=c;c+=i;let f=o;o+=i;let p={previousEvent:e[l-1]||null,nextEvent:t,start:u,end:u+i,playout:{start:f,end:o},integrated:{start:d,end:c}};n.push(p)}else i>0&&f&&(f.cumulativeDuration+=i,n[n.length-1].end=m)}d&&(b=y),t.timelineStart=y;let i=c;c+=g;let u=o;o+=h,n.push({event:t,start:y,end:b,playout:{start:u,end:o},integrated:{start:i,end:c}})}else return;let x=t.resumeTime;r=d||x>i?i:x}),r<i){let e=r,t=c,l=i-r;c+=l;let u=o;o+=l,n.push({previousEvent:n[n.length-1]?.event||null,nextEvent:null,start:r,end:e+l,playout:{start:u,end:o},integrated:{start:t,end:c}})}this.setDurations(i,o,c)}else n.push({previousEvent:null,nextEvent:null,start:0,end:i,playout:{start:0,end:i},integrated:{start:0,end:i}}),this.setDurations(i,i,i);return n}setDurations(e,t,n){this.durations={primary:e,playout:t,integrated:n}}resolveOffsets(e,t){let n=t.main.details,r=n.live?1/0:n.edge,i=0,o=-1;e.forEach((c,l)=>{let u=c.cue.pre,d=c.cue.post,f=u?0:d?r:c.startTime;this.updateAssetDurations(c),o===f?c.cumulativeDuration=i:(i=0,o=f),!d&&c.snapOptions.in&&(c.resumeAnchor=St(null,n.fragments,c.startOffset+c.resumptionOffset,0,0)||void 0),c.appendInPlace&&!c.appendInPlaceStarted&&(this.primaryCanResumeInPlaceAt(c,t)||(c.appendInPlace=!1)),!c.appendInPlace&&l+1<e.length&&e[l+1].startTime-e[l].resumeTime<Kl&&(e[l+1].appendInPlace=!1,e[l+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${c}`));let p=X(c.resumeOffset)?c.resumeOffset:c.duration;i+=p})}primaryCanResumeInPlaceAt(e,t){let n=e.resumeTime,r=e.startTime+e.resumptionOffset;return Math.abs(n-r)>Hl?(this.log(`"${e.identifier}" resumption ${n} not aligned with estimated timeline end ${r}`),!1):!Object.keys(t).some(r=>{let i=t[r].details,o=i.edge;if(n>=o)return this.log(`"${e.identifier}" resumption ${n} past ${r} playlist end ${o}`),!1;let c=St(null,i.fragments,n);if(!c)return this.log(`"${e.identifier}" resumption ${n} does not align with any fragments in ${r} playlist (${i.fragStart}-${i.fragmentEnd})`),!0;let l=r===`audio`?.175:0;return Math.abs(c.start-n)<Hl+l||Math.abs(c.end-n)<Hl+l?!1:(this.log(`"${e.identifier}" resumption ${n} not aligned with ${r} fragment bounds (${c.start}-${c.end} sn: ${c.sn} cc: ${c.cc})`),!0)})}updateAssetDurations(e){if(!e.assetListLoaded)return;let t=e.timelineStart,n=0,r=!1,i=!1;for(let o=0;o<e.assetList.length;o++){let c=e.assetList[o],l=t+n;c.startOffset=n,c.timelineStart=l,r||=c.duration===null,i||=!!c.error;let u=c.error?0:c.duration||0;n+=u}r&&!i?e.duration=Math.max(n,e.duration):e.duration=n}removeEvent(e){e.reset(),delete this.eventMap[e.identifier]}},Jl=class{constructor(e){this.hls=void 0,this.hls=e}destroy(){this.hls=null}loadAssetList(e,t){let n=e.assetListUrl,r;try{r=Sa(n,this.hls.sessionId,e.baseUrl)}catch(t){let r=this.assignAssetListError(e,Z.ASSET_LIST_LOAD_ERROR,t,n);this.hls.trigger(Q.ERROR,r);return}t&&r.protocol!==`data:`&&r.searchParams.set(`_HLS_start_offset`,``+t);let i=this.hls.config,o=i.loader,c=new o(i),l={responseType:`json`,url:r.href},u=i.interstitialAssetListLoadPolicy.default,d={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0};return c.load(l,d,{onSuccess:(t,n,r,i)=>{let o=t.data,c=o?.ASSETS;if(!Array.isArray(c)){let t=this.assignAssetListError(e,Z.ASSET_LIST_PARSING_ERROR,Error(`Invalid interstitial asset list`),r.url,n,i);this.hls.trigger(Q.ERROR,t);return}e.assetListResponse=o,this.hls.trigger(Q.ASSET_LIST_LOADED,{event:e,assetListResponse:o,networkDetails:i})},onError:(t,n,r,i)=>{let o=this.assignAssetListError(e,Z.ASSET_LIST_LOAD_ERROR,Error(`Error loading X-ASSET-LIST: HTTP status ${t.code} ${t.text} (${n.url})`),n.url,i,r);this.hls.trigger(Q.ERROR,o)},onTimeout:(t,n,r)=>{let i=this.assignAssetListError(e,Z.ASSET_LIST_LOAD_TIMEOUT,Error(`Timeout loading X-ASSET-LIST (${n.url})`),n.url,t,r);this.hls.trigger(Q.ERROR,i)}}),this.hls.trigger(Q.ASSET_LIST_LOADING,{event:e}),c}assignAssetListError(e,t,n,r,i,o){return e.error=n,{type:wo.NETWORK_ERROR,details:t,fatal:!1,interstitial:e,url:r,error:n,networkDetails:o,stats:i}}},Yl=class extends ko{constructor(e,t){super(`interstitials`,e.logger),this.HlsPlayerClass=void 0,this.hls=void 0,this.assetListLoader=void 0,this.mediaSelection=null,this.altSelection=null,this.media=null,this.detachedData=null,this.requiredTracks=null,this.manager=null,this.playerQueue=[],this.bufferedPos=-1,this.timelinePos=-1,this.schedule=void 0,this.playingItem=null,this.bufferingItem=null,this.waitingItem=null,this.endedItem=null,this.playingAsset=null,this.endedAsset=null,this.bufferingAsset=null,this.shouldPlay=!1,this.onPlay=()=>{this.shouldPlay=!0},this.onPause=()=>{this.shouldPlay=!1},this.onSeeking=()=>{let e=this.currentTime;if(e===void 0||this.playbackDisabled||!this.schedule)return;let t=e-this.timelinePos;if(Math.abs(t)<1/7056e5)return;let n=t<=-.01;this.timelinePos=e,this.bufferedPos=e;let r=this.playingItem;if(!r){this.checkBuffer();return}if(n&&this.schedule.resetErrorsInRange(e,e-t)&&this.updateSchedule(!0),this.checkBuffer(),n&&e<r.start||e>=r.end){var i;let t=this.findItemIndex(r),o=this.schedule.findItemIndexAtTime(e);if(o===-1&&(o=t+(n?-1:1),this.log(`seeked ${n?`back `:``}to position not covered by schedule ${e} (resolving from ${t} to ${o})`)),!this.isInterstitial(r)&&(i=this.media)!=null&&i.paused&&(this.shouldPlay=!1),!n&&o>t){let e=this.schedule.findJumpRestrictedIndex(t+1,o);if(e>t){this.setSchedulePosition(e);return}}this.setSchedulePosition(o);return}let o=this.playingAsset;if(!o){if(this.playingLastItem&&this.isInterstitial(r)){let t=r.event.assetList[0];t&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(e,t))}return}let c=o.timelineStart,l=o.duration||0;if(n&&e<c||e>=c+l){var u;(u=r.event)!=null&&u.appendInPlace&&(this.clearAssetPlayers(r.event,r),this.flushFrontBuffer(e)),this.setScheduleToAssetAtTime(e,o)}},this.onTimeupdate=()=>{let e=this.currentTime;if(e===void 0||this.playbackDisabled)return;if(e>this.timelinePos)this.timelinePos=e,e>this.bufferedPos&&this.checkBuffer();else return;let t=this.playingItem;if(!t||this.playingLastItem)return;if(e>=t.end){this.timelinePos=t.end;let e=this.findItemIndex(t);this.setSchedulePosition(e+1)}let n=this.playingAsset;n&&e>=n.timelineStart+(n.duration||0)&&this.setScheduleToAssetAtTime(e,n)},this.onScheduleUpdate=(e,t)=>{let n=this.schedule;if(!n)return;let r=this.playingItem,i=n.events||[],o=n.items||[],c=n.durations,l=e.map(e=>e.identifier),u=!!(i.length||l.length);(u||t)&&this.log(`INTERSTITIALS_UPDATED (${i.length}): ${i}
36
+ Schedule: ${o.map(e=>Ea(e))} pos: ${this.timelinePos}`),l.length&&this.log(`Removed events ${l}`);let d=null,f=null;r&&(d=this.updateItem(r,this.timelinePos),this.itemsMatch(r,d)?this.playingItem=d:this.waitingItem=this.endedItem=null),this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);let p=this.bufferingItem;if(p&&(f=this.updateItem(p,this.bufferedPos),this.itemsMatch(p,f)?this.bufferingItem=f:p.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(p.event,null))),e.forEach(e=>{e.assetList.forEach(e=>{this.clearAssetPlayer(e.identifier,null)})}),this.playerQueue.forEach(e=>{if(e.interstitial.appendInPlace){let t=e.assetItem.timelineStart,n=e.timelineOffset-t;if(n)try{e.timelineOffset=t}catch(r){Math.abs(n)>Hl&&this.warn(`${r} ("${e.assetId}" ${e.timelineOffset}->${t})`)}}}),u||t){if(this.hls.trigger(Q.INTERSTITIALS_UPDATED,{events:i.slice(0),schedule:o.slice(0),durations:c,removedIds:l}),this.isInterstitial(r)&&l.includes(r.event.identifier)){this.warn(`Interstitial "${r.event.identifier}" removed while playing`),this.primaryFallback(r.event);return}r&&this.trimInPlace(d,r),p&&f!==d&&this.trimInPlace(f,p),this.checkBuffer()}},this.hls=e,this.HlsPlayerClass=t,this.assetListLoader=new Jl(e),this.schedule=new ql(this.onScheduleUpdate,e.logger),this.registerListeners()}registerListeners(){let e=this.hls;e&&(e.on(Q.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(Q.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Q.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Q.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Q.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(Q.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(Q.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.on(Q.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(Q.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.on(Q.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.on(Q.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.on(Q.BUFFER_APPENDED,this.onBufferAppended,this),e.on(Q.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(Q.BUFFERED_TO_END,this.onBufferedToEnd,this),e.on(Q.MEDIA_ENDED,this.onMediaEnded,this),e.on(Q.ERROR,this.onError,this),e.on(Q.DESTROYING,this.onDestroying,this))}unregisterListeners(){let e=this.hls;e&&(e.off(Q.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(Q.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Q.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Q.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Q.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(Q.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(Q.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.off(Q.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(Q.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.off(Q.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.off(Q.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.off(Q.BUFFER_CODECS,this.onBufferCodecs,this),e.off(Q.BUFFER_APPENDED,this.onBufferAppended,this),e.off(Q.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(Q.BUFFERED_TO_END,this.onBufferedToEnd,this),e.off(Q.MEDIA_ENDED,this.onMediaEnded,this),e.off(Q.ERROR,this.onError,this),e.off(Q.DESTROYING,this.onDestroying,this))}startLoad(){this.resumeBuffering()}stopLoad(){this.pauseBuffering()}resumeBuffering(){var e;(e=this.getBufferingPlayer())==null||e.resumeBuffering()}pauseBuffering(){var e;(e=this.getBufferingPlayer())==null||e.pauseBuffering()}destroy(){this.unregisterListeners(),this.stopLoad(),this.assetListLoader&&this.assetListLoader.destroy(),this.emptyPlayerQueue(),this.clearScheduleState(),this.schedule&&this.schedule.destroy(),this.media=this.detachedData=this.mediaSelection=this.requiredTracks=this.altSelection=this.schedule=this.manager=null,this.hls=this.HlsPlayerClass=this.log=null,this.assetListLoader=null,this.onPlay=this.onPause=this.onSeeking=this.onTimeupdate=null,this.onScheduleUpdate=null}onDestroying(){let e=this.primaryMedia||this.media;e&&this.removeMediaListeners(e)}removeMediaListeners(e){er(e,`play`,this.onPlay),er(e,`pause`,this.onPause),er(e,`seeking`,this.onSeeking),er(e,`timeupdate`,this.onTimeupdate)}onMediaAttaching(e,t){let n=this.media=t.media;$n(n,`seeking`,this.onSeeking),$n(n,`timeupdate`,this.onTimeupdate),$n(n,`play`,this.onPlay),$n(n,`pause`,this.onPause)}onMediaAttached(e,t){let n=this.effectivePlayingItem,r=this.detachedData;if(this.detachedData=null,n===null)this.checkStart();else if(!r){this.clearScheduleState();let e=this.findItemIndex(n);this.setSchedulePosition(e)}}clearScheduleState(){this.log(`clear schedule state`),this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(e,t){let n=!!t.transferMedia,r=this.media;if(this.media=null,!n&&(r&&this.removeMediaListeners(r),this.detachedData)){let e=this.getBufferingPlayer();e&&(this.log(`Removing schedule state for detachedData and ${e}`),this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,e.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.hls)return null;if(this.manager)return this.manager;let e=this,t=()=>e.bufferingItem||e.waitingItem,n=t=>t&&e.getAssetPlayer(t.identifier),r=(t,r,i,c,l)=>{if(t){let u=t[r].start,d=t.event;if(d){if(r===`playout`||d.timelineOccupancy!==Ul.Point){let e=n(i);e?.interstitial===d&&(u+=e.assetItem.startOffset+e[l])}}else{let n=c===`bufferedPos`?o():e[c];u+=n-t.start}return u}return 0},i=(t,n)=>{var r;if(t!==0&&n!==`primary`&&(r=e.schedule)!=null&&r.length){let r=e.schedule.findItemIndexAtTime(t),i=e.schedule.items?.[r];if(i)return t+(i[n].start-i.start)}return t},o=()=>{let t=e.bufferedPos;return t===Number.MAX_VALUE?c(`primary`):Math.max(t,0)},c=t=>{var n;return(n=e.primaryDetails)!=null&&n.live?e.primaryDetails.edge:e.schedule?.durations[t]||0},l=(t,i)=>{var o;let c=e.effectivePlayingItem;if(c!=null&&(o=c.event)!=null&&o.restrictions.skip||!e.schedule)return;e.log(`seek to ${t} "${i}"`);let l=e.effectivePlayingItem,u=e.schedule.findItemIndexAtTime(t,i),d=e.schedule.items?.[u],f=e.getBufferingPlayer(),p=f?.interstitial?.appendInPlace,m=l&&e.itemsMatch(l,d);if(l&&(p||m)){let o=n(e.playingAsset),c=o?.media||e.primaryMedia;if(c){let n=i===`primary`?c.currentTime:r(l,i,e.playingAsset,`timelinePos`,`currentTime`),u=t-n,d=(p?n:c.currentTime)+u;if(d>=0&&(!o||p||d<=o.duration)){c.currentTime=d;return}}}if(d){let n=t;if(i!==`primary`){let e=t-d[i].start;n=d.start+e}let r=!e.isInterstitial(d);if((!e.isInterstitial(l)||l.event.appendInPlace)&&(r||d.event.appendInPlace)){let t=e.media||(p?f?.media:null);t&&(t.currentTime=n)}else if(l){let o=e.findItemIndex(l);if(u>o){let t=e.schedule.findJumpRestrictedIndex(o+1,u);if(t>o){e.setSchedulePosition(t);return}}let c=0;if(r)e.timelinePos=n,e.checkBuffer();else{let e=d.event.assetList,n=t-(d[i]||d).start;for(let t=e.length;t--;){let r=e[t];if(r.duration&&n>=r.startOffset&&n<r.startOffset+r.duration){c=t;break}}}e.setSchedulePosition(u,c)}}},u=()=>{let n=e.effectivePlayingItem;if(e.isInterstitial(n))return n;let r=t();return e.isInterstitial(r)?r:null},d={get bufferedEnd(){let n=t(),i=e.bufferingItem;return i&&i===n&&(r(i,`playout`,e.bufferingAsset,`bufferedPos`,`bufferedEnd`)-i.playout.start||e.bufferingAsset?.startOffset)||0},get currentTime(){let t=u(),n=e.effectivePlayingItem;return n&&n===t?r(n,`playout`,e.effectivePlayingAsset,`timelinePos`,`currentTime`)-n.playout.start:0},set currentTime(t){let n=u(),r=e.effectivePlayingItem;r&&r===n&&l(t+r.playout.start,`playout`)},get duration(){let e=u();return e?e.playout.end-e.playout.start:0},get assetPlayers(){let t=u()?.event.assetList;return t?t.map(t=>e.getAssetPlayer(t.identifier)):[]},get playingIndex(){let t=u()?.event;return t&&e.effectivePlayingAsset?t.findAssetIndex(e.effectivePlayingAsset):-1},get scheduleItem(){return u()}};return this.manager={get events(){var t;return((t=e.schedule)==null||(t=t.events)==null?void 0:t.slice(0))||[]},get schedule(){var t;return((t=e.schedule)==null||(t=t.items)==null?void 0:t.slice(0))||[]},get interstitialPlayer(){return u()?d:null},get playerQueue(){return e.playerQueue.slice(0)},get bufferingAsset(){return e.bufferingAsset},get bufferingItem(){return t()},get bufferingIndex(){let n=t();return e.findItemIndex(n)},get playingAsset(){return e.effectivePlayingAsset},get playingItem(){return e.effectivePlayingItem},get playingIndex(){let t=e.effectivePlayingItem;return e.findItemIndex(t)},primary:{get bufferedEnd(){return o()},get currentTime(){let t=e.timelinePos;return t>0?t:0},set currentTime(e){l(e,`primary`)},get duration(){return c(`primary`)},get seekableStart(){return e.primaryDetails?.fragmentStart||0}},integrated:{get bufferedEnd(){return r(t(),`integrated`,e.bufferingAsset,`bufferedPos`,`bufferedEnd`)},get currentTime(){return r(e.effectivePlayingItem,`integrated`,e.effectivePlayingAsset,`timelinePos`,`currentTime`)},set currentTime(e){l(e,`integrated`)},get duration(){return c(`integrated`)},get seekableStart(){return i(e.primaryDetails?.fragmentStart||0,`integrated`)}},skip:()=>{let t=e.effectivePlayingItem,n=t?.event;if(n&&!n.restrictions.skip){let r=e.findItemIndex(t);n.appendInPlace?l(t.playout.start+t.event.duration+.001,`playout`):e.advanceAfterAssetEnded(n,r,1/0)}}}}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){let e=this.playingItem,t=this.schedule?.items;return!this.playbackStarted||!e||!t?!1:this.findItemIndex(e)===t.length-1}get playbackStarted(){return this.effectivePlayingItem!==null}get currentTime(){var e;if(this.mediaSelection===null)return;let t=this.waitingItem||this.playingItem;if(this.isInterstitial(t)&&!t.event.appendInPlace)return;let n=this.media;!n&&(e=this.bufferingItem)!=null&&(e=e.event)!=null&&e.appendInPlace&&(n=this.primaryMedia);let r=n?.currentTime;if(!(r===void 0||!X(r)))return r}get primaryMedia(){return this.media||this.detachedData?.media||null}isInterstitial(e){return!!(e!=null&&e.event)}retreiveMediaSource(e,t){let n=this.getAssetPlayer(e);n&&this.transferMediaFromPlayer(n,t)}transferMediaFromPlayer(e,t){let n=e.interstitial.appendInPlace,r=e.media;if(n&&r===this.primaryMedia){if(this.bufferingAsset=null,(!t||this.isInterstitial(t)&&!t.event.appendInPlace)&&t&&r){this.detachedData={media:r};return}let n=e.transferMedia();this.log(`transfer MediaSource from ${e} ${is(n)}`),this.detachedData=n}else t&&r&&(this.shouldPlay||=!r.paused)}transferMediaTo(e,t){if(e.media===t)return;let n=null,r=this.hls,i=e!==r,o=i&&e.interstitial.appendInPlace,c=this.detachedData?.mediaSource,l;if(r.media)o&&(n=r.transferMedia(),this.detachedData=n),l=`Primary`;else if(c){let e=this.getBufferingPlayer();e?(n=e.transferMedia(),l=`${e}`):l=`detached MediaSource`}else l=`detached media`;if(!n){if(c)n=this.detachedData,this.log(`using detachedData: MediaSource ${is(n)}`);else if(!this.detachedData||r.media===t){let e=this.playerQueue;e.length>1&&e.forEach(e=>{if(i&&e.interstitial.appendInPlace!==o){let t=e.interstitial;this.clearInterstitial(e.interstitial,null),t.appendInPlace=!1,t.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${t}`)}}),this.hls.detachMedia(),this.detachedData={media:t}}}let u=n&&`mediaSource`in n&&n.mediaSource?.readyState!==`closed`,d=u&&n?n:t;this.log(`${u?`transfering MediaSource`:`attaching media`} to ${i?e:`Primary`} from ${l} (media.currentTime: ${t.currentTime})`);let f=this.schedule;if(d===n&&f){let t=i&&e.assetId===f.assetIdAtEnd;d.overrides={duration:f.duration,endOfStream:!i||t,cueRemoval:!i}}e.attachMedia(d)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){let e=this.schedule,t=e?.events;if(!t||this.playbackDisabled||!this.media)return;this.bufferedPos===-1&&(this.bufferedPos=0);let n=this.timelinePos,r=this.effectivePlayingItem;if(n===-1){let n=this.hls.startPosition;if(this.log(Oa(`checkStart`,n)),this.timelinePos=n,t.length&&t[0].cue.pre){let n=e.findEventIndex(t[0].identifier);this.setSchedulePosition(n)}else if(n>=0||!this.primaryLive){let t=this.timelinePos=n>0?n:0,r=e.findItemIndexAtTime(t);this.setSchedulePosition(r)}}else if(r&&!this.playingItem){let t=e.findItemIndex(r);this.setSchedulePosition(t)}}advanceAssetBuffering(e,t){let n=e.event,r=Ca(n,n.findAssetIndex(t));if(!n.isAssetPastPlayoutLimit(r))this.bufferedToEvent(e,r);else if(this.schedule){let t=this.schedule.items?.[this.findItemIndex(e)+1];t&&this.bufferedToItem(t)}}advanceAfterAssetEnded(e,t,n){let r=Ca(e,n);if(!e.isAssetPastPlayoutLimit(r)){if(e.appendInPlace){let t=e.assetList[r];t&&this.advanceInPlace(t.timelineStart)}this.setSchedulePosition(t,r)}else if(this.schedule){let n=this.schedule.items;if(n){let r=t+1;if(r>=n.length){this.setSchedulePosition(-1);return}let i=e.resumeTime;this.timelinePos<i&&(this.log(Oa(`advanceAfterAssetEnded`,i)),this.timelinePos=i,e.appendInPlace&&this.advanceInPlace(i),this.checkBuffer(this.bufferedPos<i)),this.setSchedulePosition(r)}}}setScheduleToAssetAtTime(e,t){let n=this.schedule;if(!n)return;let r=t.parentIdentifier,i=n.getEvent(r);if(i){let t=n.findEventIndex(r),o=n.findAssetIndex(i,e);this.advanceAfterAssetEnded(i,t,o-1)}}setSchedulePosition(e,t){let n=this.schedule?.items;if(!n||this.playbackDisabled)return;let r=e>=0?n[e]:null;this.log(`setSchedulePosition ${e}, ${t} (${r&&Ea(r)}) pos: ${this.timelinePos}`);let i=this.waitingItem||this.playingItem,o=this.playingLastItem;if(this.isInterstitial(i)){let l=i.event,u=this.playingAsset,d=u?.identifier,f=d?this.getAssetPlayer(d):null;if(f&&d&&(!this.eventItemsMatch(i,r)||t!==void 0&&d!==l.assetList[t].identifier)){var c;let t=l.findAssetIndex(u);if(this.log(`INTERSTITIAL_ASSET_ENDED ${t+1}/${l.assetList.length} ${Ta(u)}`),this.endedAsset=u,this.playingAsset=null,this.hls.trigger(Q.INTERSTITIAL_ASSET_ENDED,{asset:u,assetListIndex:t,event:l,schedule:n.slice(0),scheduleIndex:e,player:f}),i!==this.playingItem){this.itemsMatch(i,this.playingItem)&&!this.playingAsset&&this.advanceAfterAssetEnded(l,this.findItemIndex(this.playingItem),t);return}this.retreiveMediaSource(d,r),f.media&&!((c=this.detachedData)!=null&&c.mediaSource)&&f.detachMedia()}if(!this.eventItemsMatch(i,r)&&(this.endedItem=i,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${l} ${Ea(i)}`),l.hasPlayed=!0,this.hls.trigger(Q.INTERSTITIAL_ENDED,{event:l,schedule:n.slice(0),scheduleIndex:e}),l.cue.once)){this.updateSchedule();let e=this.schedule?.items;if(r&&e){let n=this.findItemIndex(r);this.advanceSchedule(n,e,t,i,o)}return}}this.advanceSchedule(e,n,t,i,o)}advanceSchedule(e,t,n,r,i){let o=this.schedule;if(!o)return;let c=t[e]||null,l=this.primaryMedia,u=this.playerQueue;if(u.length&&u.forEach(t=>{let n=t.interstitial,r=o.findEventIndex(n.identifier);(r<e||r>e+1)&&this.clearInterstitial(n,c)}),this.isInterstitial(c)){this.timelinePos=Math.min(Math.max(this.timelinePos,c.start),c.end);let i=c.event;if(n===void 0){n=o.findAssetIndex(i,this.timelinePos);let t=Ca(i,n-1);if(i.isAssetPastPlayoutLimit(t)||i.appendInPlace&&this.timelinePos===c.end){this.advanceAfterAssetEnded(i,e,n);return}n=t}let u=this.waitingItem;this.assetsBuffered(c,l)||this.setBufferingItem(c);let d=this.preloadAssets(i,n);if(this.eventItemsMatch(c,u||r)||(this.waitingItem=c,this.log(`INTERSTITIAL_STARTED ${Ea(c)} ${i.appendInPlace?`append in place`:``}`),this.hls.trigger(Q.INTERSTITIAL_STARTED,{event:i,schedule:t.slice(0),scheduleIndex:e})),!i.assetListLoaded){this.log(`Waiting for ASSET-LIST to complete loading ${i}`);return}if(i.assetListLoader&&=(i.assetListLoader.destroy(),void 0),!l){this.log(`Waiting for attachMedia to start Interstitial ${i}`);return}this.waitingItem=this.endedItem=null,this.playingItem=c;let f=i.assetList[n];if(!f){this.advanceAfterAssetEnded(i,e,n||0);return}if(d||=this.getAssetPlayer(f.identifier),d===null||d.destroyed){let e=i.assetList.length;this.warn(`asset ${n+1}/${e} player destroyed ${i}`),d=this.createAssetPlayer(i,f,n),d.loadSource()}if(!this.eventItemsMatch(c,this.bufferingItem)&&i.appendInPlace&&this.isAssetBuffered(f))return;this.startAssetPlayer(d,n,t,e,l),this.shouldPlay&&Da(d.media)}else c?(this.resumePrimary(c,e,r),this.shouldPlay&&Da(this.hls.media)):i&&this.isInterstitial(r)&&(this.endedItem=null,this.playingItem=r,r.event.appendInPlace||this.attachPrimary(o.durations.primary,null))}get playbackDisabled(){return this.hls.config.enableInterstitialPlayback===!1}get primaryDetails(){return this.mediaSelection?.main.details}get primaryLive(){var e;return!!((e=this.primaryDetails)!=null&&e.live)}resumePrimary(e,t,n){var r;if(this.playingItem=e,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(e),this.log(`resuming ${Ea(e)}`),!((r=this.detachedData)!=null&&r.mediaSource)){let n=this.timelinePos;(n<e.start||n>=e.end)&&(n=this.getPrimaryResumption(e,t),this.log(Oa(`resumePrimary`,n)),this.timelinePos=n),this.attachPrimary(n,e)}if(!n)return;let i=this.schedule?.items;i&&(this.log(`INTERSTITIALS_PRIMARY_RESUMED ${Ea(e)}`),this.hls.trigger(Q.INTERSTITIALS_PRIMARY_RESUMED,{schedule:i.slice(0),scheduleIndex:t}),this.checkBuffer())}getPrimaryResumption(e,t){let n=e.start;if(this.primaryLive){let e=this.primaryDetails;if(t===0)return this.hls.startPosition;if(e&&(n<e.fragmentStart||n>e.edge))return this.hls.liveSyncPosition||-1}return n}isAssetBuffered(e){let t=this.getAssetPlayer(e.identifier);return t!=null&&t.hls?t.hls.bufferedToEnd:ws.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=e.timelineStart+(e.duration||0)}attachPrimary(e,t,n){t?this.setBufferingItem(t):this.bufferingItem=this.playingItem,this.bufferingAsset=null;let r=this.primaryMedia;if(!r)return;let i=this.hls;i.media?this.checkBuffer():(this.transferMediaTo(i,r),n&&this.startLoadingPrimaryAt(e,n)),n||(this.log(Oa(`attachPrimary`,e)),this.timelinePos=e,this.startLoadingPrimaryAt(e,n))}startLoadingPrimaryAt(e,t){let n=this.hls;!n.loadingEnabled||!n.media||Math.abs((n.mainForwardBufferInfo?.start||n.media.currentTime)-e)>.5?n.startLoad(e,t):n.bufferingEnabled||n.resumeBuffering()}onManifestLoading(){var e;this.stopLoad(),(e=this.schedule)==null||e.reset(),this.emptyPlayerQueue(),this.clearScheduleState(),this.shouldPlay=!1,this.bufferedPos=this.timelinePos=-1,this.mediaSelection=this.altSelection=this.manager=this.requiredTracks=null,this.hls.off(Q.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(Q.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(e,t){if(t.level===-1||!this.schedule)return;let n=this.hls.levels[t.level];if(!n.details)return;let r=N(N({},this.mediaSelection||this.altSelection),{},{main:n});this.mediaSelection=r,this.schedule.parseInterstitialDateRanges(r,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(e,t){let n=this.hls.audioTracks[t.id],r=this.mediaSelection;if(!r){this.altSelection=N(N({},this.altSelection),{},{audio:n});return}this.mediaSelection=N(N({},r),{},{audio:n})}onSubtitleTrackUpdated(e,t){let n=this.hls.subtitleTracks[t.id],r=this.mediaSelection;if(!r){this.altSelection=N(N({},this.altSelection),{},{subtitles:n});return}this.mediaSelection=N(N({},r),{},{subtitles:n})}onAudioTrackSwitching(e,t){let n=ft(t);this.playerQueue.forEach(({hls:e})=>e&&(e.setAudioOption(t)||e.setAudioOption(n)))}onSubtitleTrackSwitch(e,t){let n=ft(t);this.playerQueue.forEach(({hls:e})=>e&&(e.setSubtitleOption(t)||t.id!==-1&&e.setSubtitleOption(n)))}onBufferCodecs(e,t){let n=t.tracks;n&&(this.requiredTracks=n)}onBufferAppended(e,t){this.checkBuffer()}onBufferFlushed(e,t){let n=this.playingItem;n&&!this.itemsMatch(n,this.bufferingItem)&&!this.isInterstitial(n)&&(this.bufferedPos=this.timelinePos,this.checkBuffer())}onBufferedToEnd(e){if(!this.schedule)return;let t=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&t){for(let e=0;e<t.length;e++){let n=t[e];if(n.cue.post){let e=this.schedule.findEventIndex(n.identifier),t=this.schedule.items?.[e];this.isInterstitial(t)&&this.eventItemsMatch(t,this.bufferingItem)&&this.bufferedToItem(t,0);break}}this.bufferedPos=Number.MAX_VALUE}}onMediaEnded(e){let t=this.playingItem;if(!this.playingLastItem&&t){let e=this.findItemIndex(t);this.setSchedulePosition(e+1)}else this.shouldPlay=!1}updateItem(e,t){let n=this.schedule?.items;return e&&n&&n[this.findItemIndex(e,t)]||null}trimInPlace(e,t){if(this.isInterstitial(e)&&e.event.appendInPlace&&t.end-e.end>.25){e.event.assetList.forEach((t,n)=>{e.event.isAssetPastPlayoutLimit(n)&&this.clearAssetPlayer(t.identifier,null)});let n=e.end+.25,r=ws.bufferInfo(this.primaryMedia,n,0);(r.end>n||(r.nextStart||0)>n)&&(this.log(`trim buffered interstitial ${Ea(e)} (was ${Ea(t)})`),this.attachPrimary(n,null,!0),this.flushFrontBuffer(n))}}itemsMatch(e,t){return!!t&&(e===t||e.event&&t.event&&this.eventItemsMatch(e,t)||!e.event&&!t.event&&this.findItemIndex(e)===this.findItemIndex(t))}eventItemsMatch(e,t){return!!t&&(e===t||e.event.identifier===t.event?.identifier)}findItemIndex(e,t){return e&&this.schedule?this.schedule.findItemIndex(e,t):-1}updateSchedule(e=!1){var t;let n=this.mediaSelection;n&&((t=this.schedule)==null||t.updateSchedule(n,[],e))}checkBuffer(e){let t=this.schedule?.items;if(!t)return;let n=ws.bufferInfo(this.primaryMedia,this.timelinePos,0);e&&(this.bufferedPos=this.timelinePos),e||=n.len<1,this.updateBufferedPos(n.end,t,e)}updateBufferedPos(e,t,n){let r=this.schedule,i=this.bufferingItem;if(this.bufferedPos>e||!r)return;if(t.length===1&&this.itemsMatch(t[0],i)){this.bufferedPos=e;return}let o=this.playingItem,c=this.findItemIndex(o),l=r.findItemIndexAtTime(e);if(this.bufferedPos<e){var u;let n=this.findItemIndex(i),r=Math.min(n+1,t.length-1),o=t[r];if((l===-1&&i&&e>=i.end||(u=o.event)!=null&&u.appendInPlace&&e+.01>=o.start)&&(l=r),this.isInterstitial(i)){let e=i.event;if(r-c>1&&e.appendInPlace===!1||e.assetList.length===0&&e.assetListLoader)return}if(this.bufferedPos=e,l>n&&l>c)this.bufferedToItem(o);else{let t=this.primaryDetails;this.primaryLive&&t&&e>t.edge-t.targetduration&&o.start<t.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(o)&&this.preloadAssets(o.event,0)}}else n&&o&&!this.itemsMatch(o,i)&&(l===c?this.bufferedToItem(o):l===c+1&&this.bufferedToItem(t[l]))}assetsBuffered(e,t){return e.event.assetList.length===0?!1:!e.event.assetList.some(e=>{let n=this.getAssetPlayer(e.identifier);return!(n!=null&&n.bufferedInPlaceToEnd(t))})}setBufferingItem(e){let t=this.bufferingItem,n=this.schedule;if(!this.itemsMatch(e,t)&&n){let{items:r,events:i}=n;if(!r||!i)return t;let o=this.isInterstitial(e),c=this.getBufferingPlayer();this.bufferingItem=e,this.bufferedPos=Math.max(e.start,Math.min(e.end,this.timelinePos));let l=c?c.remaining:t?t.end-this.timelinePos:0;if(this.log(`INTERSTITIALS_BUFFERED_TO_BOUNDARY ${Ea(e)}`+(t?` (${l.toFixed(2)} remaining)`:``)),!this.playbackDisabled)if(o){let t=n.findAssetIndex(e.event,this.bufferedPos);e.event.assetList.forEach((e,n)=>{let r=this.getAssetPlayer(e.identifier);r&&(n===t&&r.loadSource(),r.resumeBuffering())})}else this.hls.resumeBuffering(),this.playerQueue.forEach(e=>e.pauseBuffering());this.hls.trigger(Q.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:i.slice(0),schedule:r.slice(0),bufferingIndex:this.findItemIndex(e),playingIndex:this.findItemIndex(this.playingItem)})}else this.bufferingItem!==e&&(this.bufferingItem=e);return t}bufferedToItem(e,t=0){let n=this.setBufferingItem(e);if(!this.playbackDisabled){if(this.isInterstitial(e))this.bufferedToEvent(e,t);else if(n!==null){this.bufferingAsset=null;let t=this.detachedData;t&&t.mediaSource?this.attachPrimary(e.start,e,!0):this.preloadPrimary(e)}}}preloadPrimary(e){let t=this.findItemIndex(e),n=this.getPrimaryResumption(e,t);this.startLoadingPrimaryAt(n)}bufferedToEvent(e,t){let n=e.event,r=n.assetList.length===0&&!n.assetListLoader,i=n.cue.once;if(r||!i){let e=this.preloadAssets(n,t);if(e!=null&&e.interstitial.appendInPlace){let t=this.primaryMedia;t&&this.bufferAssetPlayer(e,t)}}}preloadAssets(e,t){let n=e.assetUrl,r=e.assetList.length,i=r===0&&!e.assetListLoader,o=e.cue.once;if(i){let i=e.timelineStart;if(e.appendInPlace){var c;let t=this.playingItem;!this.isInterstitial(t)&&(t==null||(c=t.nextEvent)==null?void 0:c.identifier)===e.identifier&&this.flushFrontBuffer(i+.25)}let o,l=0;if(!this.playingItem&&this.primaryLive&&(l=this.hls.startPosition,l===-1&&(l=this.hls.liveSyncPosition||0)),l&&!(e.cue.pre||e.cue.post)){let e=l-i;e>0&&(o=Math.round(e*1e3)/1e3)}if(this.log(`Load interstitial asset ${t+1}/${n?1:r} ${e}${o?` live-start: ${l} start-offset: ${o}`:``}`),n)return this.createAsset(e,0,0,i,e.duration,n);let u=this.assetListLoader.loadAssetList(e,o);u&&(e.assetListLoader=u)}else if(!o&&r){for(let n=t;n<r;n++){let t=e.assetList[n],r=this.getAssetPlayerQueueIndex(t.identifier);(r===-1||this.playerQueue[r].destroyed)&&!t.error&&this.createAssetPlayer(e,t,n)}let n=e.assetList[t];if(n){let e=this.getAssetPlayer(n.identifier);return e&&e.loadSource(),e}}return null}flushFrontBuffer(e){let t=this.requiredTracks;t&&(this.log(`Removing front buffer starting at ${e}`),Object.keys(t).forEach(t=>{this.hls.trigger(Q.BUFFER_FLUSHING,{startOffset:e,endOffset:1/0,type:t})}))}getAssetPlayerQueueIndex(e){let t=this.playerQueue;for(let n=0;n<t.length;n++)if(e===t[n].assetId)return n;return-1}getAssetPlayer(e){let t=this.getAssetPlayerQueueIndex(e);return this.playerQueue[t]||null}getBufferingPlayer(){let{playerQueue:e,primaryMedia:t}=this;if(t){for(let n=0;n<e.length;n++)if(e[n].media===t)return e[n]}return null}createAsset(e,t,n,r,i,o){let c={parentIdentifier:e.identifier,identifier:ba(e,o,t),duration:i,startOffset:n,timelineStart:r,uri:o};return this.createAssetPlayer(e,c,t)}createAssetPlayer(e,t,n){let r=this.hls,i=r.userConfig,o=i.videoPreference,c=r.loadLevelObj||r.levels[r.currentLevel];(o||c)&&(o=j({},o),c.videoCodec&&(o.videoCodec=c.videoCodec),c.videoRange&&(o.allowedVideoRanges=[c.videoRange]));let l=r.audioTracks[r.audioTrack],u=r.subtitleTracks[r.subtitleTrack],d=0;if(this.primaryLive||e.appendInPlace){let e=this.timelinePos-t.timelineStart;if(e>1){let n=t.duration;n&&e<n&&(d=e)}}let f=t.identifier,p=N(N({},i),{},{maxMaxBufferLength:Math.min(180,r.config.maxMaxBufferLength),autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:r.sessionId,assetPlayerId:f,abrEwmaDefaultEstimate:r.bandwidthEstimate,interstitialsController:void 0,startPosition:d,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:o,audioPreference:l||i.audioPreference,subtitlePreference:u||i.subtitlePreference});e.appendInPlace&&(e.appendInPlaceStarted=!0,t.timelineStart&&(p.timelineOffset=t.timelineStart));let m=p.cmcd;m!=null&&m.sessionId&&m.contentId&&(p.cmcd=j({},m,{contentId:ya(t.uri)})),this.getAssetPlayer(f)&&this.warn(`Duplicate date range identifier ${e} and asset ${f}`);let h=new Gl(this.HlsPlayerClass,p,e,t);this.playerQueue.push(h),e.assetList[n]=t;let g=!0,_=r=>{if(r.live){let t=Error(`Interstitials MUST be VOD assets ${e}`),r={fatal:!0,type:wo.OTHER_ERROR,details:Z.INTERSTITIAL_ASSET_ITEM_ERROR,error:t},i=this.schedule?.findEventIndex(e.identifier)||-1;this.handleAssetItemError(r,e,i,n,t.message);return}let i=r.edge-r.fragmentStart,o=t.duration;(g||o===null||i>o)&&(g=!1,this.log(`Interstitial asset "${f}" duration change ${o} > ${i}`),t.duration=i,this.updateSchedule())};h.on(Q.LEVEL_UPDATED,(e,{details:t})=>_(t)),h.on(Q.LEVEL_PTS_UPDATED,(e,{details:t})=>_(t)),h.on(Q.EVENT_CUE_ENTER,()=>this.onInterstitialCueEnter());let v=(e,t)=>{let n=this.getAssetPlayer(f);if(n&&t.tracks){n.off(Q.BUFFER_CODECS,v),n.tracks=t.tracks;let e=this.primaryMedia;this.bufferingAsset===n.assetItem&&e&&!n.media&&this.bufferAssetPlayer(n,e)}};h.on(Q.BUFFER_CODECS,v),h.on(Q.BUFFERED_TO_END,()=>{let n=this.getAssetPlayer(f);if(this.log(`buffered to end of asset ${n}`),!n||!this.schedule)return;let r=this.schedule.findEventIndex(e.identifier),i=this.schedule.items?.[r];this.isInterstitial(i)&&this.advanceAssetBuffering(i,t)});let y=t=>()=>{if(!this.getAssetPlayer(f)||!this.schedule)return;this.shouldPlay=!0;let n=this.schedule.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,n,t)};return h.once(Q.MEDIA_ENDED,y(n)),h.once(Q.PLAYOUT_LIMIT_REACHED,y(1/0)),h.on(Q.ERROR,(t,r)=>{if(!this.schedule)return;let i=this.getAssetPlayer(f);if(r.details===Z.BUFFER_STALLED_ERROR){if(i!=null&&i.appendInPlace){this.handleInPlaceStall(e);return}this.onTimeupdate(),this.checkBuffer(!0);return}this.handleAssetItemError(r,e,this.schedule.findEventIndex(e.identifier),n,`Asset player error ${r.error} ${e}`)}),h.on(Q.DESTROYING,()=>{if(!this.getAssetPlayer(f)||!this.schedule)return;let t=Error(`Asset player destroyed unexpectedly ${f}`),r={fatal:!0,type:wo.OTHER_ERROR,details:Z.INTERSTITIAL_ASSET_ITEM_ERROR,error:t};this.handleAssetItemError(r,e,this.schedule.findEventIndex(e.identifier),n,t.message)}),this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${Ta(t)}`),this.hls.trigger(Q.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t,assetListIndex:n,event:e,player:h}),h}clearInterstitial(e,t){this.clearAssetPlayers(e,t),e.reset()}clearAssetPlayers(e,t){e.assetList.forEach(e=>{this.clearAssetPlayer(e.identifier,t)})}resetAssetPlayer(e){let t=this.getAssetPlayerQueueIndex(e);if(t!==-1){this.log(`reset asset player "${e}" after error`);let n=this.playerQueue[t];this.transferMediaFromPlayer(n,null),n.resetDetails()}}clearAssetPlayer(e,t){let n=this.getAssetPlayerQueueIndex(e);if(n!==-1){let e=this.playerQueue[n];this.log(`clear ${e} toSegment: ${t&&Ea(t)}`),this.transferMediaFromPlayer(e,t),this.playerQueue.splice(n,1),e.destroy()}}emptyPlayerQueue(){let e;for(;e=this.playerQueue.pop();)e.destroy();this.playerQueue=[]}startAssetPlayer(e,t,n,r,i){let{interstitial:o,assetItem:c,assetId:l}=e,u=o.assetList.length,d=this.playingAsset;this.endedAsset=null,this.playingAsset=c,(!d||d.identifier!==l)&&(d&&(this.clearAssetPlayer(d.identifier,n[r]),delete d.error),this.log(`INTERSTITIAL_ASSET_STARTED ${t+1}/${u} ${Ta(c)}`),this.hls.trigger(Q.INTERSTITIAL_ASSET_STARTED,{asset:c,assetListIndex:t,event:o,schedule:n.slice(0),scheduleIndex:r,player:e})),this.bufferAssetPlayer(e,i)}bufferAssetPlayer(e,t){if(!this.schedule)return;let{interstitial:n,assetItem:r}=e,i=this.schedule.findEventIndex(n.identifier),o=this.schedule.items?.[i];if(!o)return;e.loadSource(),this.setBufferingItem(o),this.bufferingAsset=r;let c=this.getBufferingPlayer();if(c===e)return;let l=n.appendInPlace;if(l&&c?.interstitial.appendInPlace===!1)return;let u=c?.tracks||this.detachedData?.tracks||this.requiredTracks;if(l&&r!==this.playingAsset){if(!e.tracks){this.log(`Waiting for track info before buffering ${e}`);return}if(u&&!H(u,e.tracks)){let t=Error(`Asset ${Ta(r)} SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(u)}')`),o={fatal:!0,type:wo.OTHER_ERROR,details:Z.INTERSTITIAL_ASSET_ITEM_ERROR,error:t},c=n.findAssetIndex(r);this.handleAssetItemError(o,n,i,c,t.message);return}}this.transferMediaTo(e,t)}handleInPlaceStall(e){let t=this.schedule,n=this.primaryMedia;if(!t||!n)return;let r=n.currentTime,i=t.findAssetIndex(e,r),o=e.assetList[i];if(o){let c=this.getAssetPlayer(o.identifier);if(c){let l=c.currentTime||r-o.timelineStart,u=c.duration-l;if(this.warn(`Stalled at ${l} of ${l+u} in ${c} ${e} (media.currentTime: ${r})`),l&&(u/n.playbackRate<.5||c.bufferedInPlaceToEnd(n))&&c.hls){let n=t.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,n,i)}}}}advanceInPlace(e){let t=this.primaryMedia;t&&t.currentTime<e&&(t.currentTime=e)}handleAssetItemError(e,t,n,r,i){if(e.details===Z.BUFFER_STALLED_ERROR)return;let o=t.assetList[r]||null;if(this.warn(`INTERSTITIAL_ASSET_ERROR ${o&&Ta(o)} ${e.error}`),!this.schedule)return;let c=o?.identifier||``,l=this.getAssetPlayerQueueIndex(c),u=this.playerQueue[l]||null,d=this.schedule.items,f=j({},e,{fatal:!1,errorAction:It(!0),asset:o,assetListIndex:r,event:t,schedule:d,scheduleIndex:n,player:u});if(this.hls.trigger(Q.INTERSTITIAL_ASSET_ERROR,f),!e.fatal)return;let p=this.playingAsset,m=this.bufferingAsset,h=Error(i);if(o&&(this.clearAssetPlayer(c,null),o.error=h),!t.assetList.some(e=>!e.error))t.error=h;else for(let e=r;e<t.assetList.length;e++)this.resetAssetPlayer(t.assetList[e].identifier);this.updateSchedule(!0),t.error?this.primaryFallback(t):p&&p.identifier===c?this.advanceAfterAssetEnded(t,n,r):m&&m.identifier===c&&this.isInterstitial(this.bufferingItem)&&this.advanceAssetBuffering(this.bufferingItem,m)}primaryFallback(e){let t=e.timelineStart,n=this.effectivePlayingItem,r=this.timelinePos;if(n){this.log(`Fallback to primary from event "${e.identifier}" start: ${t} pos: ${r} playing: ${Ea(n)} error: ${e.error}`),r===-1&&(r=this.hls.startPosition);let i=this.updateItem(n,r);this.itemsMatch(n,i)&&this.clearInterstitial(e,null),e.appendInPlace&&(this.attachPrimary(t,null),this.flushFrontBuffer(t))}else if(r===-1){this.checkStart();return}if(!this.schedule)return;let i=this.schedule.findItemIndexAtTime(r);this.setSchedulePosition(i)}onAssetListLoaded(e,t){var n;let r=t.event,i=r.identifier,o=t.assetListResponse.ASSETS;if(!((n=this.schedule)!=null&&n.hasEvent(i)))return;let c=r.timelineStart,l=r.duration,u=0;o.forEach((e,t)=>{let n=parseFloat(e.DURATION);this.createAsset(r,t,u,c+u,n,e.URI),u+=n}),r.duration=u,this.log(`Loaded asset-list with duration: ${u} (was: ${l}) ${r}`);let d=this.waitingItem?.event.identifier===i;this.updateSchedule();let f=this.bufferingItem?.event;if(d){let e=this.schedule.findEventIndex(i),t=this.schedule.items?.[e];if(t){if(!this.playingItem&&this.timelinePos>t.end&&this.schedule.findItemIndexAtTime(this.timelinePos)!==e){r.error=Error(`Interstitial ${o.length?`no longer within playback range`:`asset-list is empty`} ${this.timelinePos} ${r}`),this.log(r.error.message),this.updateSchedule(!0),this.primaryFallback(r);return}this.setBufferingItem(t)}this.setSchedulePosition(e)}else if(f?.identifier===i){let e=r.assetList[0];if(e){let t=this.getAssetPlayer(e.identifier);if(f.appendInPlace){let e=this.primaryMedia;t&&e&&this.bufferAssetPlayer(t,e)}else t&&t.loadSource()}}}onError(e,t){if(this.schedule)switch(t.details){case Z.ASSET_LIST_PARSING_ERROR:case Z.ASSET_LIST_LOAD_ERROR:case Z.ASSET_LIST_LOAD_TIMEOUT:{let e=t.interstitial;e&&(this.updateSchedule(!0),this.primaryFallback(e));break}case Z.BUFFER_STALLED_ERROR:{let e=this.endedItem||this.waitingItem||this.playingItem;if(this.isInterstitial(e)&&e.event.appendInPlace){this.handleInPlaceStall(e.event);return}this.log(`Primary player stall @${this.timelinePos} bufferedPos: ${this.bufferedPos}`),this.onTimeupdate(),this.checkBuffer(!0);break}}}},Xl=500,Zl=class extends Ks{constructor(e,t,n){super(e,t,n,`subtitle-stream-controller`,Eo.SUBTITLE),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}registerListeners(){super.registerListeners();let{hls:e}=this;e.on(Q.LEVEL_LOADED,this.onLevelLoaded,this),e.on(Q.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(Q.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(Q.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(Q.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(Q.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();let{hls:e}=this;e.off(Q.LEVEL_LOADED,this.onLevelLoaded,this),e.off(Q.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(Q.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(Q.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(Q.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(Q.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(e,t){this.stopLoad(),this.state=$.IDLE,this.setInterval(Xl),this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}onManifestLoading(){super.onManifestLoading(),this.mainDetails=null}onMediaDetaching(e,t){this.tracksBuffered=[],super.onMediaDetaching(e,t)}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){let{frag:n,success:r}=t;if(this.fragContextChanged(n)||(q(n)&&(this.fragPrevious=n),this.state=$.IDLE),!r)return;let i=this.tracksBuffered[this.currentTrackId];if(!i)return;let o,c=n.start;for(let e=0;e<i.length;e++)if(c>=i[e].start&&c<=i[e].end){o=i[e];break}let l=n.start+n.duration;o?o.end=l:(o={start:c,end:l},i.push(o)),this.fragmentTracker.fragBuffered(n),this.fragBufferedComplete(n,null),this.media&&this.tick()}onBufferFlushing(e,t){let{startOffset:n,endOffset:r}=t;if(n===0&&r!==1/0){let e=r-1;if(e<=0)return;t.endOffsetSubtitles=Math.max(0,e),this.tracksBuffered.forEach(t=>{for(let n=0;n<t.length;){if(t[n].end<=e){t.shift();continue}else if(t[n].start<e)t[n].start=e;else break;n++}}),this.fragmentTracker.removeFragmentsInRange(n,e,Eo.SUBTITLE)}}onError(e,t){let n=t.frag;n?.type===Eo.SUBTITLE&&(t.details===Z.FRAG_GAP&&this.fragmentTracker.fragBuffered(n,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==$.STOPPED&&(this.state=$.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(this.levels&&gi(this.levels,t)){this.levels=t.map(e=>new ns(e));return}this.tracksBuffered=[],this.levels=t.map(e=>{let t=new ns(e);return this.tracksBuffered[t.id]=[],t}),this.fragmentTracker.removeFragmentsInRange(0,1/0,Eo.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,t){var n;if(this.currentTrackId=t.id,!((n=this.levels)!=null&&n.length)||this.currentTrackId===-1){this.clearInterval();return}let r=this.levels[this.currentTrackId];r!=null&&r.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,r&&this.state!==$.STOPPED&&this.setInterval(Xl)}onSubtitleTrackLoaded(e,t){var n;let{currentTrackId:r,levels:i}=this,{details:o,id:c}=t;if(!i){this.warn(`Subtitle tracks were reset while loading level ${c}`);return}let l=i[c];if(c>=i.length||!l)return;this.log(`Subtitle track ${c} loaded [${o.startSN},${o.endSN}]${o.lastPartSn?`[part-${o.lastPartSn}-${o.lastPartIndex}]`:``},duration:${o.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let u=0;if(o.live||(n=l.details)!=null&&n.live){if(o.deltaUpdateFailed)return;let e=this.mainDetails;if(!e){this.startFragRequested=!1;return}let t=e.fragments[0];l.details?(u=this.alignPlaylists(o,l.details,this.levelLastLoaded?.details),u===0&&t&&(u=t.start,Rn(o,u))):o.hasProgramDateTime&&e.hasProgramDateTime?(Qn(o,e),u=o.fragmentStart):t&&(u=t.start,Rn(o,u)),e&&!this.startFragRequested&&this.setStartPosition(e,u)}l.details=o,this.levelLastLoaded=l,c===r&&(this.hls.trigger(Q.SUBTITLE_TRACK_UPDATED,{details:o,id:c,groupId:t.groupId}),this.tick(),o.live&&!this.fragCurrent&&this.media&&this.state===$.IDLE&&(St(null,o.fragments,this.media.currentTime,0)||(this.warn(`Subtitle playlist not aligned with playback`),l.details=void 0)))}_handleFragmentLoadComplete(e){let{frag:t,payload:n}=e,r=t.decryptdata,i=this.hls;if(!this.fragContextChanged(t)&&n&&n.byteLength>0&&r!=null&&r.key&&r.iv&&en(r.method)){let e=performance.now();this.decrypter.decrypt(new Uint8Array(n),r.key.buffer,r.iv.buffer,tn(r.method)).catch(e=>{throw i.trigger(Q.ERROR,{type:wo.MEDIA_ERROR,details:Z.FRAG_DECRYPT_ERROR,fatal:!1,error:e,reason:e.message,frag:t}),e}).then(n=>{let r=performance.now();i.trigger(Q.FRAG_DECRYPTED,{frag:t,payload:n,stats:{tstart:e,tdecrypt:r}})}).catch(e=>{this.warn(`${e.name}: ${e.message}`),this.state=$.IDLE})}}doTick(){if(!this.media){this.state=$.IDLE;return}if(this.state===$.IDLE){let{currentTrackId:e,levels:t}=this,n=t?.[e];if(!n||!t.length||!n.details||this.waitForLive(n))return;let{config:r}=this,i=this.getLoadPosition(),{end:o,len:c}=ws.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],i,r.maxBufferHole),l=n.details;if(c>this.hls.maxBufferLength+l.levelTargetDuration)return;let u=l.fragments,d=u.length,f=l.edge,p=null,m=this.fragPrevious;if(o<f){let e=r.maxFragLookUpTolerance,t=o>f-e?0:e;p=St(m,u,Math.max(u[0].start,o),t),!p&&m&&m.start<u[0].start&&(p=u[0])}else p=u[d-1];if(p=this.filterReplacedPrimary(p,n.details),!p)return;let h=u[p.sn-l.startSN-1];if(h&&h.cc===p.cc&&this.fragmentTracker.getState(h)===us.NOT_LOADED&&(p=h),this.fragmentTracker.getState(p)===us.NOT_LOADED){let e=this.mapToInitFragWhenRequired(p);e&&this.loadFragment(e,n,o)}}}loadFragment(e,t,n){q(e)?super.loadFragment(e,t,n):this._loadInitSegment(e,t)}get mediaBufferTimeRanges(){return new Ql(this.tracksBuffered[this.currentTrackId]||[])}},Ql=class{constructor(e){this.buffered=void 0;let t=(t,n,r)=>{if(n>>>=0,n>r-1)throw new DOMException(`Failed to execute '${t}' on 'TimeRanges': The index provided (${n}) is greater than the maximum bound (${r})`);return e[n][t]};this.buffered={get length(){return e.length},end(n){return t(`end`,n,e.length)},start(n){return t(`start`,n,e.length)}}}},$l={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},eu=e=>String.fromCharCode($l[e]||e),tu=15,nu=100,ru={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},iu={17:2,18:4,21:6,22:8,23:10,19:13,20:15},au={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},ou={25:2,26:4,29:6,30:8,31:10,27:13,28:15},su=[`white`,`green`,`blue`,`cyan`,`red`,`yellow`,`magenta`,`black`,`transparent`],cu=class{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){let n=typeof t==`function`?t():t;No.log(`${this.time} [${e}] ${n}`)}}},lu=function(e){let t=[];for(let n=0;n<e.length;n++)t.push(e[n].toString(16));return t},uu=class{constructor(){this.foreground=`white`,this.underline=!1,this.italics=!1,this.background=`black`,this.flash=!1}reset(){this.foreground=`white`,this.underline=!1,this.italics=!1,this.background=`black`,this.flash=!1}setStyles(e){let t=[`foreground`,`underline`,`italics`,`background`,`flash`];for(let n=0;n<t.length;n++){let r=t[n];e.hasOwnProperty(r)&&(this[r]=e[r])}}isDefault(){return this.foreground===`white`&&!this.underline&&!this.italics&&this.background===`black`&&!this.flash}equals(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}copy(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}toString(){return`color=`+this.foreground+`, underline=`+this.underline+`, italics=`+this.italics+`, background=`+this.background+`, flash=`+this.flash}},du=class{constructor(){this.uchar=` `,this.penState=new uu}reset(){this.uchar=` `,this.penState.reset()}setChar(e,t){this.uchar=e,this.penState.copy(t)}setPenState(e){this.penState.copy(e)}equals(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)}copy(e){this.uchar=e.uchar,this.penState.copy(e.penState)}isEmpty(){return this.uchar===` `&&this.penState.isDefault()}},fu=class{constructor(e){this.chars=[],this.pos=0,this.currPenState=new uu,this.cueStartTime=null,this.logger=void 0;for(let e=0;e<nu;e++)this.chars.push(new du);this.logger=e}equals(e){for(let t=0;t<nu;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<nu;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<nu;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e}setCursor(e){this.pos!==e&&(this.pos=e),this.pos<0?(this.logger.log(3,`Negative cursor position `+this.pos),this.pos=0):this.pos>nu&&(this.logger.log(3,`Too large cursor position `+this.pos),this.pos=nu)}moveCursor(e){let t=this.pos+e;if(e>1)for(let e=this.pos+1;e<t+1;e++)this.chars[e].setPenState(this.currPenState);this.setCursor(t)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(` `,this.currPenState)}insertChar(e){e>=144&&this.backSpace();let t=eu(e);if(this.pos>=nu){this.logger.log(0,()=>`Cannot insert `+e.toString(16)+` (`+t+`) at position `+this.pos+`. Skipping it!`);return}this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)}clearFromPos(e){let t;for(t=e;t<nu;t++)this.chars[t].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){let e=[],t=!0;for(let n=0;n<nu;n++){let r=this.chars[n].uchar;r!==` `&&(t=!1),e.push(r)}return t?``:e.join(``)}setPenStyles(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}},pu=class{constructor(e){this.rows=[],this.currRow=tu-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<tu;t++)this.rows.push(new fu(e));this.logger=e}reset(){for(let e=0;e<tu;e++)this.rows[e].clear();this.currRow=tu-1}equals(e){let t=!0;for(let n=0;n<tu;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t}copy(e){for(let t=0;t<tu;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<tu;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(e){this.rows[this.currRow].insertChar(e)}setPen(e){this.rows[this.currRow].setPenStyles(e)}moveCursor(e){this.rows[this.currRow].moveCursor(e)}setCursor(e){this.logger.log(2,`setCursor: `+e),this.rows[this.currRow].setCursor(e)}setPAC(e){this.logger.log(2,()=>`pacData = `+is(e));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let e=0;e<tu;e++)this.rows[e].clear();let e=this.currRow+1-this.nrRollUpRows,n=this.lastOutputScreen;if(n){let r=n.rows[e].cueStartTime,i=this.logger.time;if(r!==null&&i!==null&&r<i)for(let r=0;r<this.nrRollUpRows;r++)this.rows[t-this.nrRollUpRows+r+1].copy(n.rows[e+r])}}this.currRow=t;let n=this.rows[this.currRow];if(e.indent!==null){let t=e.indent,r=Math.max(t-1,0);n.setCursor(e.indent),e.color=n.chars[r].penState.foreground}let r={foreground:e.color,underline:e.underline,italics:e.italics,background:`black`,flash:!1};this.setPen(r)}setBkgData(e){this.logger.log(2,()=>`bkgData = `+is(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,`roll_up but nrRollUpRows not set yet`);return}this.logger.log(1,()=>this.getDisplayText());let e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,`Rolling up`)}getDisplayText(e){e||=!1;let t=[],n=``,r=-1;for(let n=0;n<tu;n++){let i=this.rows[n].getTextString();i&&(r=n+1,e?t.push(`Row `+r+`: '`+i+`'`):t.push(i.trim()))}return t.length>0&&(n=e?`[`+t.join(` | `)+`]`:t.join(`
37
+ `)),n}getTextAndFormat(){return this.rows}},mu=class{constructor(e,t,n){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new pu(n),this.nonDisplayedMemory=new pu(n),this.lastOutputScreen=new pu(n),this.currRollUpRow=this.displayedMemory.rows[tu-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=n}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[tu-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,()=>`MODE=`+e),this.mode===`MODE_POP-ON`?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!==`MODE_ROLL-UP`&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}insertChars(e){for(let t=0;t<e.length;t++)this.writeScreen.insertChar(e[t]);let t=this.writeScreen===this.displayedMemory?`DISP`:`NON_DISP`;this.logger.log(2,()=>t+`: `+this.writeScreen.getDisplayText(!0)),(this.mode===`MODE_PAINT-ON`||this.mode===`MODE_ROLL-UP`)&&(this.logger.log(1,()=>`DISPLAYED: `+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,`RCL - Resume Caption Loading`),this.setMode(`MODE_POP-ON`)}ccBS(){this.logger.log(2,`BS - BackSpace`),this.mode!==`MODE_TEXT`&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,`DER- Delete to End of Row`),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,`RU(`+e+`) - Roll Up`),this.writeScreen=this.displayedMemory,this.setMode(`MODE_ROLL-UP`),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,`FON - Flash On`),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,`RDC - Resume Direct Captioning`),this.setMode(`MODE_PAINT-ON`)}ccTR(){this.logger.log(2,`TR`),this.setMode(`MODE_TEXT`)}ccRTD(){this.logger.log(2,`RTD`),this.setMode(`MODE_TEXT`)}ccEDM(){this.logger.log(2,`EDM - Erase Displayed Memory`),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,`CR - Carriage Return`),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,`ENM - Erase Non-displayed Memory`),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,`EOC - End Of Caption`),this.mode===`MODE_POP-ON`){let e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>`DISP: `+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,`TO(`+e+`) - Tab Offset`),this.writeScreen.moveCursor(e)}ccMIDROW(e){let t={flash:!1};t.underline=e%2==1,t.italics=e>=46,t.italics?t.foreground=`white`:t.foreground=[`white`,`green`,`blue`,`cyan`,`red`,`yellow`,`magenta`][Math.floor(e/2)-16],this.logger.log(2,`MIDROW: `+is(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){let t=this.logger.time;t!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=t:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t),this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}},hu=class{constructor(e,t,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory=ja(),this.logger=void 0;let r=this.logger=new cu;this.channels=[null,new mu(e,t,r),new mu(e+1,n,r)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let e=0;e<t.length;e+=2){let n=t[e]&127,r=t[e+1]&127,i=!1,o=null;if(n===0&&r===0)continue;this.logger.log(3,()=>`[`+lu([t[e],t[e+1]])+`] -> (`+lu([n,r])+`)`);let c=this.cmdHistory;if(n>=16&&n<=31){if(Aa(n,r,c)){ka(null,null,c),this.logger.log(3,()=>`Repeated command (`+lu([n,r])+`) is dropped`);continue}ka(n,r,this.cmdHistory),i=this.parseCmd(n,r),i||=this.parseMidrow(n,r),i||=this.parsePAC(n,r),i||=this.parseBackgroundAttributes(n,r)}else ka(null,null,c);if(!i&&(o=this.parseChars(n,r),o)){let e=this.currentChannel;e&&e>0?this.channels[e].insertChars(o):this.logger.log(2,`No channel found yet. TEXT-MODE?`)}!i&&!o&&this.logger.log(2,()=>`Couldn't parse cleaned data `+lu([n,r])+` orig: `+lu([t[e],t[e+1]]))}}parseCmd(e,t){if(!((e===20||e===28||e===21||e===29)&&t>=32&&t<=47||(e===23||e===31)&&t>=33&&t<=35))return!1;let n=e===20||e===21||e===23?1:2,r=this.channels[n];return e===20||e===21||e===28||e===29?t===32?r.ccRCL():t===33?r.ccBS():t===34?r.ccAOF():t===35?r.ccAON():t===36?r.ccDER():t===37?r.ccRU(2):t===38?r.ccRU(3):t===39?r.ccRU(4):t===40?r.ccFON():t===41?r.ccRDC():t===42?r.ccTR():t===43?r.ccRTD():t===44?r.ccEDM():t===45?r.ccCR():t===46?r.ccENM():t===47&&r.ccEOC():r.ccTO(t-32),this.currentChannel=n,!0}parseMidrow(e,t){let n=0;if((e===17||e===25)&&t>=32&&t<=47){if(n=e===17?1:2,n!==this.currentChannel)return this.logger.log(0,`Mismatch channel in midrow parsing`),!1;let r=this.channels[n];return r?(r.ccMIDROW(t),this.logger.log(3,()=>`MIDROW (`+lu([e,t])+`)`),!0):!1}return!1}parsePAC(e,t){let n;if(!((e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127||(e===16||e===24)&&t>=64&&t<=95))return!1;let r=e<=23?1:2;n=t>=64&&t<=95?r===1?ru[e]:au[e]:r===1?iu[e]:ou[e];let i=this.channels[r];return i?(i.setPAC(this.interpretPAC(n,t)),this.currentChannel=r,!0):!1}interpretPAC(e,t){let n,r={color:null,italics:!1,indent:null,underline:!1,row:e};return n=t>95?t-96:t-64,r.underline=(n&1)==1,n<=13?r.color=[`white`,`green`,`blue`,`cyan`,`red`,`yellow`,`magenta`,`white`][Math.floor(n/2)]:n<=15?(r.italics=!0,r.color=`white`):r.indent=Math.floor((n-16)/2)*4,r}parseChars(e,t){let n,r=null,i=null;if(e>=25?(n=2,i=e-8):(n=1,i=e),i>=17&&i<=19){let e;e=i===17?t+80:i===18?t+112:t+144,this.logger.log(2,()=>`Special char '`+eu(e)+`' in channel `+n),r=[e]}else e>=32&&e<=127&&(r=t===0?[e]:[e,t]);return r&&this.logger.log(3,()=>`Char codes = `+lu(r).join(`,`)),r}parseBackgroundAttributes(e,t){if(!((e===16||e===24)&&t>=32&&t<=47||(e===23||e===31)&&t>=45&&t<=47))return!1;let n,r={};e===16||e===24?(n=Math.floor((t-32)/2),r.background=su[n],t%2==1&&(r.background+=`_semi`)):t===45?r.background=`transparent`:(r.foreground=`black`,t===47&&(r.underline=!0));let i=e<=23?1:2;return this.channels[i].setBkgData(r),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){let t=this.channels[e];t&&t.reset()}ka(null,null,this.cmdHistory)}cueSplitAtTime(e){for(let t=0;t<this.channels.length;t++){let n=this.channels[t];n&&n.cueSplitAtTime(e)}}},gu=(function(){if(Ns!=null&&Ns.VTTCue)return self.VTTCue;let e=[``,`lr`,`rl`],t=[`start`,`middle`,`end`,`left`,`right`];function n(e,t){if(typeof t!=`string`||!Array.isArray(e))return!1;let n=t.toLowerCase();return~e.indexOf(n)?n:!1}function r(t){return n(e,t)}function i(e){return n(t,e)}function o(e,...t){let n=1;for(;n<arguments.length;n++){let t=arguments[n];for(let n in t)e[n]=t[n]}return e}function c(e,t,n){let c=this,l={enumerable:!0};c.hasBeenReset=!1;let u=``,d=!1,f=e,p=t,m=n,h=null,g=``,_=!0,v=`auto`,y=`start`,b=50,x=`middle`,S=50,C=`middle`;Object.defineProperty(c,`id`,o({},l,{get:function(){return u},set:function(e){u=``+e}})),Object.defineProperty(c,`pauseOnExit`,o({},l,{get:function(){return d},set:function(e){d=!!e}})),Object.defineProperty(c,`startTime`,o({},l,{get:function(){return f},set:function(e){if(typeof e!=`number`)throw TypeError(`Start time must be set to a number.`);f=e,this.hasBeenReset=!0}})),Object.defineProperty(c,`endTime`,o({},l,{get:function(){return p},set:function(e){if(typeof e!=`number`)throw TypeError(`End time must be set to a number.`);p=e,this.hasBeenReset=!0}})),Object.defineProperty(c,`text`,o({},l,{get:function(){return m},set:function(e){m=``+e,this.hasBeenReset=!0}})),Object.defineProperty(c,`region`,o({},l,{get:function(){return h},set:function(e){h=e,this.hasBeenReset=!0}})),Object.defineProperty(c,`vertical`,o({},l,{get:function(){return g},set:function(e){let t=r(e);if(t===!1)throw SyntaxError(`An invalid or illegal string was specified.`);g=t,this.hasBeenReset=!0}})),Object.defineProperty(c,`snapToLines`,o({},l,{get:function(){return _},set:function(e){_=!!e,this.hasBeenReset=!0}})),Object.defineProperty(c,`line`,o({},l,{get:function(){return v},set:function(e){if(typeof e!=`number`&&e!==`auto`)throw SyntaxError(`An invalid number or illegal string was specified.`);v=e,this.hasBeenReset=!0}})),Object.defineProperty(c,`lineAlign`,o({},l,{get:function(){return y},set:function(e){let t=i(e);if(!t)throw SyntaxError(`An invalid or illegal string was specified.`);y=t,this.hasBeenReset=!0}})),Object.defineProperty(c,`position`,o({},l,{get:function(){return b},set:function(e){if(e<0||e>100)throw Error(`Position must be between 0 and 100.`);b=e,this.hasBeenReset=!0}})),Object.defineProperty(c,`positionAlign`,o({},l,{get:function(){return x},set:function(e){let t=i(e);if(!t)throw SyntaxError(`An invalid or illegal string was specified.`);x=t,this.hasBeenReset=!0}})),Object.defineProperty(c,`size`,o({},l,{get:function(){return S},set:function(e){if(e<0||e>100)throw Error(`Size must be between 0 and 100.`);S=e,this.hasBeenReset=!0}})),Object.defineProperty(c,`align`,o({},l,{get:function(){return C},set:function(e){let t=i(e);if(!t)throw SyntaxError(`An invalid or illegal string was specified.`);C=t,this.hasBeenReset=!0}})),c.displayState=void 0}return c.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},c})(),_u=class{decode(e,t){if(!e)return``;if(typeof e!=`string`)throw Error(`Error - expected string data.`);return decodeURIComponent(encodeURIComponent(e))}},vu=class{constructor(){this.values=Object.create(null)}set(e,t){!this.get(e)&&t!==``&&(this.values[e]=t)}get(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,n){for(let r=0;r<n.length;++r)if(t===n[r]){this.set(e,t);break}}integer(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))}percent(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){let n=parseFloat(t);if(n>=0&&n<=100)return this.set(e,n),!0}return!1}},yu=new gu(0,0,``),bu=yu.align===`middle`?`middle`:`center`,xu=class{constructor(){this.state=`INITIAL`,this.buffer=``,this.decoder=new _u,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){let t=this;e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));function n(){let e=t.buffer,n=0;for(e=Fa(e);n<e.length&&e[n]!==`\r`&&e[n]!==`
38
+ `;)++n;let r=e.slice(0,n);return e[n]===`\r`&&++n,e[n]===`
39
+ `&&++n,t.buffer=e.slice(n),r}function r(e){Na(e,function(e,t){},/:/)}try{let e=``;if(t.state===`INITIAL`){if(!/\r\n|\n/.test(t.buffer))return this;e=n();let r=e.match(/^()?WEBVTT([ \t].*)?$/);if(!(r!=null&&r[0]))throw Error(`Malformed WebVTT signature.`);t.state=`HEADER`}let i=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(i?i=!1:e=n(),t.state){case`HEADER`:/:/.test(e)?r(e):e||(t.state=`ID`);continue;case`NOTE`:e||(t.state=`ID`);continue;case`ID`:if(/^NOTE($|[ \t])/.test(e)){t.state=`NOTE`;break}if(!e)continue;if(t.cue=new gu(0,0,``),t.state=`CUE`,e.indexOf(`-->`)===-1){t.cue.id=e;continue}case`CUE`:if(!t.cue){t.state=`BADCUE`;continue}try{Pa(e,t.cue,t.regionList)}catch{t.cue=null,t.state=`BADCUE`;continue}t.state=`CUETEXT`;continue;case`CUETEXT`:{let n=e.indexOf(`-->`)!==-1;if(!e||n&&(i=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state=`ID`;continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=`
40
+ `),t.cue.text+=e}continue;case`BADCUE`:e||(t.state=`ID`)}}}catch{t.state===`CUETEXT`&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state===`INITIAL`?`BADWEBVTT`:`BADCUE`}return this}flush(){let e=this;try{if((e.cue||e.state===`HEADER`)&&(e.buffer+=`
41
+
42
+ `,e.parse()),e.state===`INITIAL`||e.state===`BADWEBVTT`)throw Error(`Malformed WebVTT signature.`)}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}},Su=/\r\n|\n\r|\n|\r/g,Cu=function(e,t,n=0){return e.slice(n,n+t.length)===t},wu=function(e){let t=parseInt(e.slice(-3)),n=parseInt(e.slice(-6,-4)),r=parseInt(e.slice(-9,-7)),i=e.length>9?parseInt(e.substring(0,e.indexOf(`:`))):0;if(!X(t)||!X(n)||!X(r)||!X(i))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*n,t+=60*1e3*r,t+=3600*1e3*i,t},Tu=function(e,t,n){let r=e[t],i=e[r.prevCC];if(!i||!i.new&&r.new){e.ccOffset=e.presentationOffset=r.start,r.new=!1;return}for(;(o=i)!=null&&o.new;){var o;e.ccOffset+=r.start-i.start,r.new=!1,r=i,i=e[r.prevCC]}e.presentationOffset=n},Eu=`stpp.ttml.im1t`,Du=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Ou=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,ku={left:`start`,center:`center`,right:`end`,start:`start`,end:`end`},Au=class{constructor(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}dispatchCue(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,t,n){(this.startTime===null||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}},ju=class{constructor(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Qa(),this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},e.on(Q.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(Q.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Q.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Q.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(Q.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(Q.FRAG_LOADING,this.onFragLoading,this),e.on(Q.FRAG_LOADED,this.onFragLoaded,this),e.on(Q.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(Q.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(Q.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(Q.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(Q.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){let{hls:e}=this;e.off(Q.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(Q.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Q.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Q.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(Q.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(Q.FRAG_LOADING,this.onFragLoading,this),e.off(Q.FRAG_LOADED,this.onFragLoaded,this),e.off(Q.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(Q.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(Q.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(Q.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(Q.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){let e=new Au(this,`textTrack1`),t=new Au(this,`textTrack2`),n=new Au(this,`textTrack3`),r=new Au(this,`textTrack4`);this.cea608Parser1=new hu(1,e,t),this.cea608Parser2=new hu(3,n,r)}addCues(e,t,n,r,i){let o=!1;for(let e=i.length;e--;){let r=i[e],c=Za(r[0],r[1],t,n);if(c>=0&&(r[0]=Math.min(r[0],t),r[1]=Math.max(r[1],n),o=!0,c/(n-t)>.5))return}if(o||i.push([t,n]),this.config.renderTextTracksNatively){let i=this.captionsTracks[e];this.Cues.newCue(i,t,n,r)}else{let i=this.Cues.newCue(null,t,n,r);this.hls.trigger(Q.CUES_PARSED,{type:`captions`,cues:i,track:e})}}onInitPtsFound(e,{frag:t,id:n,initPTS:r,timescale:i,trackId:o}){let{unparsedVttFrags:c}=this;n===Eo.MAIN&&(this.initPTS[t.cc]={baseTime:r,timescale:i,trackId:o}),c.length&&(this.unparsedVttFrags=[],c.forEach(e=>{this.initPTS[e.frag.cc]?this.onFragLoaded(Q.FRAG_LOADED,e):this.hls.trigger(Q.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e.frag,error:Error(`Subtitle discontinuity domain does not match main`)})}))}getExistingTrack(e,t){let{media:n}=this;if(n)for(let r=0;r<n.textTracks.length;r++){let i=n.textTracks[r];if(Xa(i,{name:e,lang:t,characteristics:`transcribes-spoken-dialog,describes-music-and-sound`}))return i}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;let{captionsProperties:t,captionsTracks:n,media:r}=this,{label:i,languageCode:o}=t[e],c=this.getExistingTrack(i,o);if(c)n[e]=c,pa(n[e]),da(n[e],r);else{let t=this.createTextTrack(`captions`,i,o);t&&(t[e]=!0,n[e]=t)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;let t=this.captionsProperties[e];if(!t)return;let n={_id:e,label:t.label,kind:`captions`,default:t.media?!!t.media.default:!1,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=n,this.hls.trigger(Q.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[n]})}createTextTrack(e,t,n){let r=this.media;if(r)return r.addTextTrack(e,t,n)}onMediaAttaching(e,t){this.media=t.media,t.mediaSource||this._cleanTracks()}onMediaDetaching(e,t){let n=!!t.transferMedia;if(this.media=null,n)return;let{captionsTracks:r}=this;Object.keys(r).forEach(e=>{pa(r[e]),delete r[e]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Qa(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){let{media:e}=this;if(!e)return;let t=e.textTracks;if(t)for(let e=0;e<t.length;e++)pa(t[e])}onSubtitleTracksUpdated(e,t){let n=t.subtitleTracks||[],r=n.some(e=>e.textCodec===Eu);if(this.config.enableWebVTT||r&&this.config.enableIMSC1){if(gi(this.tracks,n)){this.tracks=n;return}if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){let e=this.media,t=e?_a(e.textTracks):null;if(this.tracks.forEach((e,n)=>{let r;if(t){let n=null;for(let r=0;r<t.length;r++)if(t[r]&&Xa(t[r],e)){n=t[r],t[r]=null;break}n&&(r=n)}if(r)pa(r);else{let t=Ya(e);r=this.createTextTrack(t,e.name,e.lang),r&&(r.mode=`disabled`)}r&&this.textTracks.push(r)}),t!=null&&t.length){let e=t.filter(e=>e!==null).map(e=>e.label);e.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${e.join(`, `)}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){let e=this.tracks.map(e=>({label:e.name,kind:e.type.toLowerCase(),default:e.default,subtitleTrack:e}));this.hls.trigger(Q.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:e})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(e=>{let t=/(?:CC|SERVICE)([1-4])/.exec(e.instreamId);if(!t)return;let n=`textTrack${t[1]}`,r=this.captionsProperties[n];r&&(r.label=e.name,e.lang&&(r.languageCode=e.lang),r.media=e)})}closedCaptionsForLevel(e){return this.hls.levels[e.level]?.attrs[`CLOSED-CAPTIONS`]}onFragLoading(e,t){if(this.enabled&&t.frag.type===Eo.MAIN){let{cea608Parser1:e,cea608Parser2:n,lastSn:r}=this,{cc:i,sn:o}=t.frag,c=t.part?.index??-1;e&&n&&(o!==r+1||o===r&&c!==this.lastPartIndex+1||i!==this.lastCc)&&(e.reset(),n.reset()),this.lastCc=i,this.lastSn=o,this.lastPartIndex=c}}onFragLoaded(e,t){let{frag:n,payload:r}=t;if(n.type===Eo.SUBTITLE)if(r.byteLength){let e=n.decryptdata,i=`stats`in t;if(e==null||!e.encrypted||i){let e=this.tracks[n.level],i=this.vttCCs;i[n.cc]||(i[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),e&&e.textCodec===Eu?this._parseIMSC1(n,r):this._parseVTTs(t)}}else this.hls.trigger(Q.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:Error(`Empty subtitle payload`)})}_parseIMSC1(e,t){let n=this.hls;Ra(t,this.initPTS[e.cc],t=>{this._appendCues(t,e.level),n.trigger(Q.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},t=>{n.logger.log(`Failed to parse IMSC1: ${t}`),n.trigger(Q.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:t})})}_parseVTTs(e){var t;let{frag:n,payload:r}=e,{initPTS:i,unparsedVttFrags:o}=this,c=i.length-1;if(!i[n.cc]&&c===-1){o.push(e);return}let l=this.hls;La((t=n.initSegment)!=null&&t.data?Ce(n.initSegment.data,new Uint8Array(r)).buffer:r,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,e=>{this._appendCues(e,n.level),l.trigger(Q.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},t=>{let i=t.message===`Missing initPTS for VTT MPEGTS`;i?o.push(e):this._fallbackToIMSC1(n,r),l.logger.log(`Failed to parse VTT cue: ${t}`),!(i&&c>n.cc)&&l.trigger(Q.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:t})})}_fallbackToIMSC1(e,t){let n=this.tracks[e.level];n.textCodec||Ra(t,this.initPTS[e.cc],()=>{n.textCodec=Eu,this._parseIMSC1(e,t)},()=>{n.textCodec=`wvtt`})}_appendCues(e,t){let n=this.hls;if(this.config.renderTextTracksNatively){let n=this.textTracks[t];if(!n||n.mode===`disabled`)return;e.forEach(e=>fa(n,e))}else{let r=this.tracks[t];if(!r)return;let i=r.default?`default`:`subtitles`+t;n.trigger(Q.CUES_PARSED,{type:`subtitles`,cues:e,track:i})}}onFragDecrypted(e,t){let{frag:n}=t;n.type===Eo.SUBTITLE&&this.onFragLoaded(Q.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){if(!this.enabled||!this.config.enableCEA708Captions)return;let{frag:n,samples:r}=t;if(!(n.type===Eo.MAIN&&this.closedCaptionsForLevel(n)===`NONE`))for(let e=0;e<r.length;e++){let t=r[e].bytes;if(t){this.cea608Parser1||this.initCea608Parsers();let n=this.extractCea608Data(t);this.cea608Parser1.addData(r[e].pts,n[0]),this.cea608Parser2.addData(r[e].pts,n[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:n,endOffsetSubtitles:r,type:i}){let{media:o}=this;if(!(!o||o.currentTime<n)){if(!i||i===`video`){let{captionsTracks:e}=this;Object.keys(e).forEach(r=>ma(e[r],t,n))}if(this.config.renderTextTracksNatively&&t===0&&r!==void 0){let{textTracks:e}=this;Object.keys(e).forEach(n=>ma(e[n],t,r))}}}extractCea608Data(e){let t=[[],[]],n=e[0]&31,r=2;for(let i=0;i<n;i++){let n=e[r++],i=127&e[r++],o=127&e[r++];if(!(i===0&&o===0)&&4&n){let e=3&n;(e===0||e===1)&&(t[e].push(i),t[e].push(o))}}return t}},Mu=/\s/,Nu={newCue(e,t,n,r){let i=[],o,c,l,u,d,f=self.VTTCue||self.TextTrackCue;for(let m=0;m<r.rows.length;m++)if(o=r.rows[m],l=!0,u=0,d=``,!o.isEmpty()){var p;for(let e=0;e<o.chars.length;e++)Mu.test(o.chars[e].uchar)&&l?u++:(d+=o.chars[e].uchar,l=!1);o.cueStartTime=t,t===n&&(n+=1e-4),u>=16?u--:u++;let r=Fa(d.trim()),h=Ia(t,n,r);e!=null&&(p=e.cues)!=null&&p.getCueById(h)||(c=new f(t,n,r),c.id=h,c.line=m+1,c.align=`left`,c.position=10+Math.min(80,Math.floor(u*8/32)*10),i.push(c))}return e&&i.length&&(i.sort((e,t)=>e.line===`auto`||t.line===`auto`?0:e.line>8&&t.line>8?t.line-e.line:e.line-t.line),i.forEach(t=>fa(e,t))),i}},Pu=/(\d+)-(\d+)\/(\d+)/,Fu=class{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||ro,this.controller=new self.AbortController,this.stats=new Lo}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,n){let r=this.stats;if(r.loading.start)throw Error(`Loader can only be used once.`);r.loading.start=self.performance.now();let i=eo(e,this.controller.signal),o=e.responseType===`arraybuffer`,c=o?`byteLength`:`length`,{maxTimeToFirstByteMs:l,maxLoadTimeMs:u}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,i),self.clearTimeout(this.requestTimeout),t.timeout=l&&X(l)?l:u,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(r,e,this.response))},t.timeout),(hi(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(n=>{this.response=this.loader=n;let i=Math.max(self.performance.now(),r.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=u,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(r,e,this.response))},u-(i-r.loading.start)),!n.ok){let{status:e,statusText:t}=n;throw new Iu(t||`fetch, bad network response`,e,n)}r.loading.first=i,r.total=no(n.headers)||r.total;let c=this.callbacks?.onProgress;return c&&X(t.highWaterMark)?this.loadProgressively(n,r,e,t.highWaterMark,c):o?n.arrayBuffer():e.responseType===`json`?n.json():n.text()}).then(n=>{var i;let o=this.response;if(!o)throw Error(`loader destroyed`);self.clearTimeout(this.requestTimeout),r.loading.end=Math.max(self.performance.now(),r.loading.first);let l=n[c];l&&(r.loaded=r.total=l);let u={url:o.url,data:n,code:o.status},d=this.callbacks?.onProgress;d&&!X(t.highWaterMark)&&d(r,e,n,o),(i=this.callbacks)==null||i.onSuccess(u,r,e,o)}).catch(t=>{var n;if(self.clearTimeout(this.requestTimeout),r.aborted)return;let i=t&&t.code||0,o=t?t.message:null;(n=this.callbacks)==null||n.onError({code:i,text:o},e,t?t.details:null,r)})}getCacheAge(){let e=null;if(this.response){let t=this.response.headers.get(`age`);e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,n,r=0,i){let o=new qs,c=e.body.getReader(),l=()=>c.read().then(c=>{if(c.done)return o.dataLength&&i(t,n,o.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));let u=c.value,d=u.length;return t.loaded+=d,d<r||o.dataLength?(o.push(u),o.dataLength>=r&&i(t,n,o.flush().buffer,e)):i(t,n,u.buffer,e),l()}).catch(()=>Promise.reject());return l()}},Iu=class extends Error{constructor(e,t,n){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=n}},Lu=/^age:\s*[\d.]+\s*$/im,Ru=class{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new Lo,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){let e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,n){if(this.stats.loading.start)throw Error(`Loader can only be used once.`);this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=n,this.loadInternal()}loadInternal(){let{config:e,context:t}=this;if(!e||!t)return;let n=this.loader=new self.XMLHttpRequest,r=this.stats;r.loading.first=0,r.loaded=0,r.aborted=!1;let i=this.xhrSetup;i?Promise.resolve().then(()=>{if(!(this.loader!==n||this.stats.aborted))return i(n,t.url)}).catch(e=>{if(!(this.loader!==n||this.stats.aborted))return n.open(`GET`,t.url,!0),i(n,t.url)}).then(()=>{this.loader!==n||this.stats.aborted||this.openAndSendXhr(n,t,e)}).catch(e=>{var i;(i=this.callbacks)==null||i.onError({code:n.status,text:e.message},t,n,r)}):this.openAndSendXhr(n,t,e)}openAndSendXhr(e,t,n){e.readyState||e.open(`GET`,t.url,!0);let r=t.headers,{maxTimeToFirstByteMs:i,maxLoadTimeMs:o}=n.loadPolicy;if(r)for(let t in r)e.setRequestHeader(t,r[t]);t.rangeEnd&&e.setRequestHeader(`Range`,`bytes=`+t.rangeStart+`-`+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),n.timeout=i&&X(i)?i:o,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout),e.send()}readystatechange(){let{context:e,loader:t,stats:n}=this;if(!e||!t)return;let r=t.readyState,i=this.config;if(!n.aborted&&r>=2&&(n.loading.first===0&&(n.loading.first=Math.max(self.performance.now(),n.loading.start),i.timeout!==i.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),i.timeout=i.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.loadPolicy.maxLoadTimeMs-(n.loading.first-n.loading.start)))),r===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;let r=t.status,l=t.responseType===`text`?t.responseText:null;if(r>=200&&r<300){let i=l??t.response;if(i!=null){var o;n.loading.end=Math.max(self.performance.now(),n.loading.first),n.loaded=n.total=t.responseType===`arraybuffer`?i.byteLength:i.length,n.bwEstimate=n.total*8e3/(n.loading.end-n.loading.first);let c=this.callbacks?.onProgress;c&&c(n,e,i,t);let l={url:t.responseURL,data:i,code:r};(o=this.callbacks)==null||o.onSuccess(l,n,e,t);return}}let u=i.loadPolicy.errorRetry,d=n.retry;if(Nt(u,d,!1,{url:e.url,data:void 0,code:r}))this.retry(u);else{var c;No.error(`${r} while loading ${e.url}`),(c=this.callbacks)==null||c.onError({code:r,text:t.statusText},e,t,n)}}}loadtimeout(){if(!this.config)return;let e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(Nt(e,t,!0))this.retry(e);else{No.warn(`timeout while loading ${this.context?.url}`);let e=this.callbacks;e&&(this.abortInternal(),e.onTimeout(this.stats,this.context,this.loader))}}retry(e){let{context:t,stats:n}=this;this.retryDelay=jt(e,n.retry),n.retry++,No.warn(`${status?`HTTP Status `+status:`Timeout`} while loading ${t?.url}, retrying ${n.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){let t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&Lu.test(this.loader.getAllResponseHeaders())){let t=this.loader.getResponseHeader(`age`);e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&RegExp(`^${e}:\\s*[\\d.]+\\s*$`,`im`).test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}},zu=N(N({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:1/0,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,startOnSegmentBoundary:!1,maxBufferSize:60*1e3*1e3,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncMode:`edge`,liveSyncDurationCount:3,liveSyncOnStallIncrease:1,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,ignorePlaylistParsingErrors:!1,loader:Ru,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:as,bufferController:Xc,capLevelController:Zc,errorController:ls,fpsController:Bl,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:Is,requireKeySystemAccessOnStart:!1,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,preserveManualLevelOnError:!1,certLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null}},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:`linear`},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:`linear`}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},interstitialAssetListLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:3e4,timeoutRetry:{maxNumRetry:0,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:0,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},io()),{},{subtitleStreamController:Zl,subtitleTrackController:Vl,timelineController:ju,audioStreamController:Uc,audioTrackController:Gc,emeController:Rl,cmcdController:Fl,contentSteeringController:Ll,interstitialsController:Yl}),Bu=2,Vu=.1,Hu=.05,Uu=100,Wu=class extends xs{constructor(e,t){super(`gap-controller`,e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var e;(e=this.media)!=null&&e.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{this.hls&&(this.ended=this.media?.currentTime||1,this.hls.trigger(Q.MEDIA_ENDED,{stalled:!1}))},this.hls=e,this.fragmentTracker=t,this.registerListeners()}registerListeners(){let{hls:e}=this;e&&(e.on(Q.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Q.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Q.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){let{hls:e}=this;e&&(e.off(Q.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Q.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Q.BUFFER_APPENDED,this.onBufferAppended,this))}destroy(){super.destroy(),this.unregisterListeners(),this.media=this.hls=this.fragmentTracker=null,this.mediaSource=void 0}onMediaAttached(e,t){this.setInterval(Uu),this.mediaSource=t.mediaSource;let n=this.media=t.media;$n(n,`playing`,this.onMediaPlaying),$n(n,`waiting`,this.onMediaWaiting),$n(n,`ended`,this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();let{media:n}=this;n&&(er(n,`playing`,this.onMediaPlaying),er(n,`waiting`,this.onMediaWaiting),er(n,`ended`,this.onMediaEnded),this.media=null),this.mediaSource=void 0}onBufferAppended(e,t){this.buffered=t.timeRanges}get hasBuffered(){return Object.keys(this.buffered).length>0}tick(){var e;if(!((e=this.media)!=null&&e.readyState)||!this.hasBuffered)return;let t=this.media.currentTime;this.poll(t,this.lastCurrentTime),this.lastCurrentTime=t}poll(e,t){let n=this.hls?.config;if(!n)return;let r=this.media;if(!r)return;let{seeking:i}=r,o=this.seeking&&!i,c=!this.seeking&&i,l=r.paused&&!i||r.ended||r.playbackRate===0;if(this.seeking=i,e!==t){t&&(this.ended=0),this.moved=!0,i||(this.nudgeRetry=0,n.nudgeOnVideoHole&&!l&&e>t&&this.nudgeOnVideoHole(e,t)),this.waiting===0&&this.stallResolved(e);return}if(c||o){o&&this.stallResolved(e);return}if(l){this.nudgeRetry=0,this.stallResolved(e),!this.ended&&r.ended&&this.hls&&(this.ended=e||1,this.hls.trigger(Q.MEDIA_ENDED,{stalled:!1}));return}if(!ws.getBuffered(r).length){this.nudgeRetry=0;return}let u=ws.bufferInfo(r,e,0),d=u.nextStart||0,f=this.fragmentTracker;if(i&&f&&this.hls){let t=co(this.hls.inFlightFragments,e),n=u.len>Bu,r=!d||t||d-e>Bu&&!f.getPartialFragment(e);if(n||r)return;this.moved=!1}let p=this.hls?.latestLevelDetails;if(!this.moved&&this.stalled!==null&&f){if(!(u.len>0)&&!d)return;let t=Math.max(d,u.start||0)-e,n=p!=null&&p.live?p.targetduration*2:Bu,i=uo(e,f);if(t>0&&(t<=n||i)){r.paused||this._trySkipBufferHole(i);return}}let m=n.detectStallWithCurrentTimeMs,h=self.performance.now(),g=this.waiting,_=this.stalled;if(_===null)if(g>0&&h-g<m)_=this.stalled=g;else{this.stalled=h;return}let v=h-_;if(!i&&(v>=m||g)&&this.hls){if(this.mediaSource?.readyState===`ended`&&!(p!=null&&p.live)&&Math.abs(e-(p?.edge||0))<1){if(this.ended)return;this.ended=e||1,this.hls.trigger(Q.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(u),!this.media||!this.hls)return}let y=ws.bufferInfo(r,e,n.maxBufferHole);this._tryFixBufferStall(y,v,e)}stallResolved(e){let t=this.stalled;if(t&&this.hls&&(this.stalled=null,this.stallReported)){let n=self.performance.now()-t;this.log(`playback not stuck anymore @${e}, after ${Math.round(n)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(Q.STALL_RESOLVED,{})}}nudgeOnVideoHole(e,t){var n;let r=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&(n=this.buffered.audio)!=null&&n.length&&r&&r.length>1&&e>r.end(0)){let n=ws.bufferedInfo(ws.timeRangesToArray(this.buffered.audio),e,0);if(n.len>1&&t>=n.start){let n=ws.timeRangesToArray(r),i=ws.bufferedInfo(n,t,0).bufferedIndex;if(i>-1&&i<n.length-1){let t=ws.bufferedInfo(n,e,0).bufferedIndex,r=n[i].end,o=n[i+1].start;if((t===-1||t>i)&&o-r<1&&e-r<2){let n=Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${r} -> ${o} buffered index: ${t}`);this.warn(n.message),this.media.currentTime+=1e-6;let i=uo(e,this.fragmentTracker);i&&`fragment`in i?i=i.fragment:i||=void 0;let c=ws.bufferInfo(this.media,e,0);this.hls.trigger(Q.ERROR,{type:wo.MEDIA_ERROR,details:Z.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:n,reason:n.message,frag:i,buffer:c.len,bufferInfo:c})}}}}}_tryFixBufferStall(e,t,n){let{fragmentTracker:r,media:i}=this,o=this.hls?.config;if(!i||!r||!o)return;let c=this.hls?.latestLevelDetails,l=uo(n,r);if((l||c!=null&&c.live&&n<c.fragmentStart)&&(this._trySkipBufferHole(l)||!this.media))return;let u=e.buffered,d=this.adjacentTraversal(e,n);(u&&u.length>1&&e.len>o.maxBufferHole||e.nextStart&&(e.nextStart-n<o.maxBufferHole||d))&&(t>o.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn(`Trying to nudge playhead over buffer-hole`),this._tryNudgeBuffer(e))}adjacentTraversal(e,t){let n=this.fragmentTracker,r=e.nextStart;if(n&&r){let e=n.getFragAtPos(t,Eo.MAIN),i=n.getFragAtPos(r,Eo.MAIN);if(e&&i)return i.sn-e.sn<2}return!1}_reportStall(e){let{hls:t,media:n,stallReported:r,stalled:i}=this;if(!r&&i!==null&&n&&t){this.stallReported=!0;let r=Error(`Playback stalling at @${n.currentTime} due to low buffer (${is(e)})`);this.warn(r.message),t.trigger(Q.ERROR,{type:wo.MEDIA_ERROR,details:Z.BUFFER_STALLED_ERROR,fatal:!1,error:r,buffer:e.len,bufferInfo:e,stalled:{start:i}})}}_trySkipBufferHole(e){let{fragmentTracker:t,media:n}=this,r=this.hls?.config;if(!n||!t||!r)return 0;let i=n.currentTime,o=ws.bufferInfo(n,i,0),c=i<o.start?o.start:o.nextStart;if(c&&this.hls){let u=o.len<=r.maxBufferHole,d=o.len>0&&o.len<1&&n.readyState<3,f=c-i;if(f>0&&(u||d)){if(f>r.maxBufferHole){let n=!1;if(i===0){let e=t.getAppendedFrag(0,Eo.MAIN);e&&c<e.end&&(n=!0)}if(!n&&e){var l;if(!((l=this.hls.loadLevelObj)!=null&&l.details)||co(this.hls.inFlightFragments,c))return 0;let n=!1,r=e.end;for(;r<c;){let e=uo(r,t);if(e)r+=e.duration;else{n=!0;break}}if(n)return 0}}let u=Math.max(c+Hu,i+Vu);if(this.warn(`skipping hole, adjusting currentTime from ${i} to ${u}`),this.moved=!0,n.currentTime=u,!(e!=null&&e.gap)){let t=Error(`fragment loaded with buffer holes, seeking from ${i} to ${u}`),n={type:wo.MEDIA_ERROR,details:Z.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:t,reason:t.message,buffer:o.len,bufferInfo:o};e&&(`fragment`in e?n.part=e:n.frag=e),this.hls.trigger(Q.ERROR,n)}return u}}return 0}_tryNudgeBuffer(e){let{hls:t,media:n,nudgeRetry:r}=this,i=t?.config;if(!n||!i)return 0;let o=n.currentTime;if(this.nudgeRetry++,r<i.nudgeMaxRetry){let c=o+(r+1)*i.nudgeOffset,l=Error(`Nudging 'currentTime' from ${o} to ${c}`);this.warn(l.message),n.currentTime=c,t.trigger(Q.ERROR,{type:wo.MEDIA_ERROR,details:Z.BUFFER_NUDGE_ON_STALL,error:l,fatal:!1,buffer:e.len,bufferInfo:e})}else{let n=Error(`Playhead still not moving while enough data buffered @${o} after ${i.nudgeMaxRetry} nudges`);this.error(n.message),t.trigger(Q.ERROR,{type:wo.MEDIA_ERROR,details:Z.BUFFER_STALLED_ERROR,error:n,fatal:!0,buffer:e.len,bufferInfo:e})}}},Gu=.25,Ku=(()=>{let e=fo();try{e&&new e(0,1/0,``)}catch{return Number.MAX_VALUE}return 1/0})(),qu=class{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.assetCue=void 0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(Q.EVENT_CUE_ENTER,{})},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){let{hls:e}=this;e&&(e.on(Q.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(Q.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Q.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Q.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Q.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(Q.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(Q.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(Q.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}_unregisterListeners(){let{hls:e}=this;e&&(e.off(Q.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(Q.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Q.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Q.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Q.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(Q.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(Q.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(Q.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}onMediaAttaching(e,t){this.media=t.media,t.overrides?.cueRemoval===!1&&(this.removeCues=!1)}onMediaAttached(){let e=this.hls?.latestLevelDetails;e&&this.updateDateRangeCues(e)}onMediaDetaching(e,t){this.media=null,!t.transferMedia&&(this.id3Track&&=(this.removeCues&&pa(this.id3Track,this.onEventCueEnter),null),this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){let t=this.getID3Track(e.textTracks);return t.mode=`hidden`,t}getID3Track(e){if(this.media){for(let t=0;t<e.length;t++){let n=e[t];if(n.kind===`metadata`&&n.label===`id3`)return da(n,this.media),n}return this.media.addTextTrack(`metadata`,`id3`)}}onFragParsingMetadata(e,t){if(!this.media||!this.hls)return;let{enableEmsgMetadataCues:n,enableID3MetadataCues:r}=this.hls.config;if(!n&&!r)return;let{samples:i}=t;this.id3Track||=this.createTrack(this.media);let o=fo();if(o)for(let e=0;e<i.length;e++){let t=i[e].type;if(t===tc.emsg&&!n||!r)continue;let c=Ir(i[e].data),l=i[e].pts,u=l+i[e].duration;u>Ku&&(u=Ku),u-l<=0&&(u=l+Gu);for(let e=0;e<c.length;e++){let n=c[e];if(!Lr(n)){this.updateId3CueEnds(l,t);let e=po(o,l,u,n,t);e&&this.id3Track.addCue(e)}}}}updateId3CueEnds(e,t){let n=this.id3Track?.cues;if(n)for(let r=n.length;r--;){let i=n[r];i.type===t&&i.startTime<e&&i.endTime===Ku&&(i.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:n,type:r}){let{id3Track:i,hls:o}=this;if(!o)return;let{config:{enableEmsgMetadataCues:c,enableID3MetadataCues:l}}=o;if(i&&(c||l)){let e;e=r===`audio`?e=>e.type===tc.audioId3&&l:r===`video`?e=>e.type===tc.emsg&&c:e=>e.type===tc.audioId3&&l||e.type===tc.emsg&&c,ma(i,t,n,e)}}onLevelUpdated(e,{details:t}){this.updateDateRangeCues(t,!0)}onLevelPtsUpdated(e,t){Math.abs(t.drift)>.01&&this.updateDateRangeCues(t.details)}updateDateRangeCues(e,t){if(!this.hls||!this.media)return;let{assetPlayerId:n,timelineOffset:r,enableDateRangeMetadataCues:i,interstitialsController:o}=this.hls.config;if(!i)return;let c=fo();if(n&&r&&!o){let{fragmentStart:t,fragmentEnd:r}=e,i=this.assetCue;i?(i.startTime=t,i.endTime=r):c&&(i=this.assetCue=po(c,t,r,{assetPlayerId:this.hls.config.assetPlayerId},`hlsjs.interstitial.asset`),i&&(i.id=n,this.id3Track||=this.createTrack(this.media),this.id3Track.addCue(i),i.addEventListener(`enter`,this.onEventCueEnter)))}if(!e.hasProgramDateTime)return;let{id3Track:l}=this,{dateRanges:u}=e,d=Object.keys(u),f=this.dateRangeCuesAppended;if(l&&t){var p;if((p=l.cues)!=null&&p.length){let e=Object.keys(f).filter(e=>!d.includes(e));for(let t=e.length;t--;){let n=e[t],r=f[n]?.cues;delete f[n],r&&Object.keys(r).forEach(e=>{let t=r[e];if(t){t.removeEventListener(`enter`,this.onEventCueEnter);try{l.removeCue(t)}catch{}}})}}else f=this.dateRangeCuesAppended={}}let m=e.fragments[e.fragments.length-1];if(!(d.length===0||!X(m?.programDateTime))){this.id3Track||=this.createTrack(this.media);for(let e=0;e<d.length;e++){let t=d[e],n=u[t],r=n.startTime,i=f[t],l=i?.cues||{},p=i?.durationKnown||!1,m=Ku,{duration:h,endDate:g}=n;if(g&&h!==null)m=r+h,p=!0;else if(n.endOnNext&&!p){let e=d.reduce((e,t)=>{if(t!==n.id){let r=u[t];if(r.class===n.class&&r.startDate>n.startDate&&(!e||n.startDate<e.startDate))return r}return e},null);e&&(m=e.startTime,p=!0)}let _=Object.keys(n.attr);for(let e=0;e<_.length;e++){let u=_[e];if(!Xt(u))continue;let d=l[u];if(d)p&&!(i!=null&&i.durationKnown)?d.endTime=m:Math.abs(d.startTime-r)>.01&&(d.startTime=r,d.endTime=m);else if(c){let e=n.attr[u];Zt(u)&&(e=G(e));let i=po(c,r,m,{key:u,data:e},tc.dateRange);i&&(i.id=t,this.id3Track.addCue(i),l[u]=i,o&&(u===`X-ASSET-LIST`||u===`X-ASSET-URL`)&&i.addEventListener(`enter`,this.onEventCueEnter))}}f[t]={cues:l,dateRange:n,durationKnown:p}}}}},Ju=class{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.currentTime=0,this.stallCount=0,this._latency=null,this._targetLatencyUpdated=!1,this.onTimeupdate=()=>{let{media:e}=this,t=this.levelDetails;if(!e||!t)return;this.currentTime=e.currentTime;let n=this.computeLatency();if(n===null)return;this._latency=n;let{lowLatencyMode:r,maxLiveSyncPlaybackRate:i}=this.config;if(!r||i===1||!t.live)return;let o=this.targetLatency;if(o===null)return;let c=n-o;if(c<Math.min(this.maxLatency,o+t.targetduration)&&c>.05&&this.forwardBufferLength>1){let t=Math.min(2,Math.max(1,i)),n=Math.round(2/(1+Math.exp(-.75*c-this.edgeStalled))*20)/20,r=Math.min(t,Math.max(1,n));this.changeMediaPlaybackRate(e,r)}else e.playbackRate!==1&&e.playbackRate!==0&&this.changeMediaPlaybackRate(e,1)},this.hls=e,this.config=e.config,this.registerListeners()}get levelDetails(){return this.hls?.latestLevelDetails||null}get latency(){return this._latency||0}get maxLatency(){let{config:e}=this;if(e.liveMaxLatencyDuration!==void 0)return e.liveMaxLatencyDuration;let t=this.levelDetails;return t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){let e=this.levelDetails;if(e===null||this.hls===null)return null;let{holdBack:t,partHoldBack:n,targetduration:r}=e,{liveSyncDuration:i,liveSyncDurationCount:o,lowLatencyMode:c}=this.config,l=this.hls.userConfig,u=c&&n||t;(this._targetLatencyUpdated||l.liveSyncDuration||l.liveSyncDurationCount||u===0)&&(u=i===void 0?o*r:i);let d=r;return u+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,d)}set targetLatency(e){this.stallCount=0,this.config.liveSyncDuration=e,this._targetLatencyUpdated=!0}get liveSyncPosition(){let e=this.estimateLiveEdge(),t=this.targetLatency;if(e===null||t===null)return null;let n=this.levelDetails;if(n===null)return null;let r=n.edge,i=e-t-this.edgeStalled,o=r-n.totalduration,c=r-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(o,i),c)}get drift(){let e=this.levelDetails;return e===null?1:e.drift}get edgeStalled(){let e=this.levelDetails;if(e===null)return 0;let t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){let{media:e}=this,t=this.levelDetails;if(!e||!t)return 0;let n=e.buffered.length;return(n?e.buffered.end(n-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){let{hls:e}=this;e&&(e.on(Q.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Q.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Q.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Q.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(Q.ERROR,this.onError,this))}unregisterListeners(){let{hls:e}=this;e&&(e.off(Q.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Q.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Q.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Q.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(Q.ERROR,this.onError,this))}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener(`timeupdate`,this.onTimeupdate)}onMediaDetaching(){this.media&&=(this.media.removeEventListener(`timeupdate`,this.onTimeupdate),null)}onManifestLoading(){this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){t.advanced&&this.onTimeupdate(),!t.live&&this.media&&this.media.removeEventListener(`timeupdate`,this.onTimeupdate)}onError(e,t){var n;t.details===Z.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&(n=this.levelDetails)!=null&&n.live&&this.hls.logger.warn(`[latency-controller]: Stall detected, adjusting target latency`))}changeMediaPlaybackRate(e,t){var n;e.playbackRate!==t&&((n=this.hls)==null||n.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${this.targetLatency?.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${e.playbackRate} to ${t}`),e.playbackRate=t)}estimateLiveEdge(){let e=this.levelDetails;return e===null?null:e.edge+e.age}computeLatency(){let e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}},Yu=class extends Wc{constructor(e,t){super(e,`level-controller`),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){let{hls:e}=this;e.on(Q.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Q.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(Q.LEVEL_LOADED,this.onLevelLoaded,this),e.on(Q.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(Q.FRAG_BUFFERED,this.onFragBuffered,this),e.on(Q.ERROR,this.onError,this)}_unregisterListeners(){let{hls:e}=this;e.off(Q.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Q.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(Q.LEVEL_LOADED,this.onLevelLoaded,this),e.off(Q.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(Q.FRAG_BUFFERED,this.onFragBuffered,this),e.off(Q.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(e=>{e.loadError=0,e.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){let n=this.hls.config.preferManagedMediaSource,r=[],i={},o={},c=!1,l=!1,u=!1;t.levels.forEach(e=>{let t=e.attrs,{audioCodec:d,videoCodec:f}=e;d&&(e.audioCodec=d=Ve(d,n)||void 0),f&&=e.videoCodec=Ge(f);let{width:p,height:m,unknownCodecs:h}=e,g=h?.length||0;if(c||=!!(p&&m),l||=!!f,u||=!!d,g||d&&!this.isAudioSupported(d)||f&&!this.isVideoSupported(f)){this.log(`Some or all CODECS not supported "${t.CODECS}"`);return}let{CODECS:_,"FRAME-RATE":v,"HDCP-LEVEL":y,"PATHWAY-ID":b,RESOLUTION:x,"VIDEO-RANGE":S}=t,C=`${`${b||`.`}-`}${e.bitrate}-${x}-${v}-${_}-${S}-${y}`;if(!i[C]){let t=this.createLevel(e);i[C]=t,o[C]=1,r.push(t)}else if(i[C].uri!==e.url&&!e.attrs[`PATHWAY-ID`]){let t=o[C]+=1;e.attrs[`PATHWAY-ID`]=Array(t+1).join(`.`);let n=this.createLevel(e);i[C]=n,r.push(n)}else i[C].addGroupId(`audio`,t.AUDIO),i[C].addGroupId(`text`,t.SUBTITLES)}),this.filterAndSortMediaOptions(r,t,c,l,u)}createLevel(e){let t=new ns(e),n=e.supplemental;if(n!=null&&n.videoCodec&&!this.isVideoSupported(n.videoCodec)){let e=Error(`SUPPLEMENTAL-CODECS not supported "${n.videoCodec}"`);this.log(e.message),t.supportedResult=Ye(e,[])}return t}isAudioSupported(e){return Fe(e,`audio`,this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return Fe(e,`video`,this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,n,r,i){let o=[],c=[],l=e,u=t.stats?.parsing||{};if((n||r)&&i&&(l=l.filter(({videoCodec:e,videoRange:t,width:n,height:r})=>(!!e||!!(n&&r))&&rt(t))),l.length===0){Promise.resolve().then(()=>{if(this.hls){let e=`no level with compatible codecs found in manifest`,n=e;t.levels.length&&(n=`one or more CODECS in variant not supported: ${is(t.levels.map(e=>e.attrs.CODECS).filter((e,t,n)=>n.indexOf(e)===t))}`,this.warn(n),e+=` (${n})`);let r=Error(e);this.hls.trigger(Q.ERROR,{type:wo.MEDIA_ERROR,details:Z.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:r,reason:n})}}),u.end=performance.now();return}t.audioTracks&&(o=t.audioTracks.filter(e=>!e.audioCodec||this.isAudioSupported(e.audioCodec)),mo(o)),t.subtitles&&(c=t.subtitles,mo(c));let d=l.slice(0);l.sort((e,t)=>{if(e.attrs[`HDCP-LEVEL`]!==t.attrs[`HDCP-LEVEL`])return(e.attrs[`HDCP-LEVEL`]||``)>(t.attrs[`HDCP-LEVEL`]||``)?1:-1;if(n&&e.height!==t.height)return e.height-t.height;if(e.frameRate!==t.frameRate)return e.frameRate-t.frameRate;if(e.videoRange!==t.videoRange)return $o.indexOf(e.videoRange)-$o.indexOf(t.videoRange);if(e.videoCodec!==t.videoCodec){let n=Re(e.videoCodec),r=Re(t.videoCodec);if(n!==r)return r-n}if(e.uri===t.uri&&e.codecSet!==t.codecSet){let n=ze(e.codecSet),r=ze(t.codecSet);if(n!==r)return r-n}return e.averageBitrate===t.averageBitrate?0:e.averageBitrate-t.averageBitrate});let f=d[0];if(this.steering&&(l=this.steering.filterParsedLevels(l),l.length!==d.length)){for(let e=0;e<d.length;e++)if(d[e].pathwayId===l[0].pathwayId){f=d[e];break}}this._levels=l;for(let e=0;e<l.length;e++)if(l[e]===f){this._firstLevel=e;let t=f.bitrate,n=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${l.length} level(s) found, first bitrate: ${t}`),this.hls.userConfig?.abrEwmaDefaultEstimate===void 0){let e=Math.min(t,this.hls.config.abrEwmaDefaultEstimateMax);e>n&&n===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=e)}break}let p=i&&!r,m=this.hls.config,h=!!(m.audioStreamController&&m.audioTrackController),g={levels:l,audioTracks:o,subtitleTracks:c,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:i,video:r,altAudio:h&&!p&&o.some(e=>!!e.url)};u.end=performance.now(),this.hls.trigger(Q.MANIFEST_PARSED,g)}get levels(){return this._levels.length===0?null:this._levels}get loadLevelObj(){return this.currentLevel}get level(){return this.currentLevelIndex}set level(e){let t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){let n=Error(`invalid level idx`),r=e<0;if(this.hls.trigger(Q.ERROR,{type:wo.OTHER_ERROR,details:Z.LEVEL_SWITCH_ERROR,level:e,fatal:r,error:n,reason:n.message}),r)return;e=Math.min(e,t.length-1)}let n=this.currentLevelIndex,r=this.currentLevel,i=r?r.attrs[`PATHWAY-ID`]:void 0,o=t[e],c=o.attrs[`PATHWAY-ID`];if(this.currentLevelIndex=e,this.currentLevel=o,n===e&&r&&i===c)return;this.log(`Switching to level ${e} (${o.height?o.height+`p `:``}${o.videoRange?o.videoRange+` `:``}${o.codecSet?o.codecSet+` `:``}@${o.bitrate})${c?` with Pathway `+c:``} from level ${n}${i?` with Pathway `+i:``}`);let l={level:e,attrs:o.attrs,details:o.details,bitrate:o.bitrate,averageBitrate:o.averageBitrate,maxBitrate:o.maxBitrate,realBitrate:o.realBitrate,width:o.width,height:o.height,codecSet:o.codecSet,audioCodec:o.audioCodec,videoCodec:o.videoCodec,audioGroups:o.audioGroups,subtitleGroups:o.subtitleGroups,loaded:o.loaded,loadError:o.loadError,fragmentError:o.fragmentError,name:o.name,id:o.id,uri:o.uri,url:o.url,urlId:0,audioGroupIds:o.audioGroupIds,textGroupIds:o.textGroupIds};this.hls.trigger(Q.LEVEL_SWITCHING,l);let u=o.details;if(!u||u.live){let e=this.switchParams(o.uri,r?.details,u);this.loadPlaylist(e)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){let e=this.hls.config.startLevel;return e===void 0?this.hls.firstAutoLevel:e}return this._startLevel}set startLevel(e){this._startLevel=e}get pathways(){return this.steering?this.steering.pathways():[]}get pathwayPriority(){return this.steering?this.steering.pathwayPriority:null}set pathwayPriority(e){if(this.steering){let t=this.steering.pathways(),n=e.filter(e=>t.indexOf(e)!==-1);if(e.length<1){this.warn(`pathwayPriority ${e} should contain at least one pathway from list: ${t}`);return}this.steering.pathwayPriority=n}}onError(e,t){t.fatal||!t.context||t.context.type===To.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===Eo.MAIN){let e=t.elementaryStreams;if(!Object.keys(e).some(t=>!!e[t]))return;let n=this._levels[t.level];n!=null&&n.loadError&&(this.log(`Resetting level error count of ${n.loadError} on frag buffered`),n.loadError=0)}}onLevelLoaded(e,t){var n;let{level:r,details:i}=t,o=t.levelInfo;if(!o){var c;this.warn(`Invalid level index ${r}`),(c=t.deliveryDirectives)!=null&&c.skip&&(i.deltaUpdateFailed=!0);return}if(o===this.currentLevel||t.withoutMultiVariant){o.fragmentError===0&&(o.loadError=0);let e=o.details;e===t.details&&e.advanced&&(e=void 0),this.playlistLoaded(r,t,e)}else (n=t.deliveryDirectives)!=null&&n.skip&&(i.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);let n=this.getUrlWithDirectives(e.uri,t),r=this.currentLevelIndex,i=e.attrs[`PATHWAY-ID`],o=e.details,c=o?.age;this.log(`Loading level index ${r}${t?.msn===void 0?``:` at sn `+t.msn+` part `+t.part}${i?` Pathway `+i:``}${c&&o.live?` age `+c.toFixed(1)+(o.type&&` `+o.type||``):``} ${n}`),this.hls.trigger(Q.LEVEL_LOADING,{url:n,level:r,levelInfo:e,pathwayId:e.attrs[`PATHWAY-ID`],id:0,deliveryDirectives:t||null})}get nextLoadLevel(){return this.manualLevelIndex===-1?this.hls.nextAutoLevel:this.manualLevelIndex}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;if(this._levels.length===1)return;let n=this._levels.filter((t,n)=>n===e?(this.steering&&this.steering.removeLevel(t),t===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,t.details&&t.details.fragments.forEach(e=>e.level=-1)),!1):!0);Un(n),this._levels=n,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);let r=n.length-1;this._firstLevel=Math.min(this._firstLevel,r),this._startLevel&&=Math.min(this._startLevel,r),this.hls.trigger(Q.LEVELS_UPDATED,{levels:n})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){let{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:n}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(Q.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}},Xu=100,Zu=class extends Ks{constructor(e,t,n){super(e,t,n,`stream-controller`,Eo.MAIN),this.audioCodecSwap=!1,this.level=-1,this._forceStartLoad=!1,this._hasEnoughToStart=!1,this.altAudio=0,this.audioOnly=!1,this.fragPlaying=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this.onMediaPlaying=()=>{this.tick()},this.onMediaSeeked=()=>{let e=this.media,t=e?e.currentTime:null;if(t===null||!X(t)||(this.log(`Media seeked to ${t.toFixed(3)}`),!this.getBufferedFrag(t)))return;let n=this.getFwdBufferInfoAtPos(e,t,Eo.MAIN,0);if(n===null||n.len===0){this.warn(`Main forward buffer length at ${t} on "seeked" event ${n?n.len:`empty`})`);return}this.tick()},this.registerListeners()}registerListeners(){super.registerListeners();let{hls:e}=this;e.on(Q.MANIFEST_PARSED,this.onManifestParsed,this),e.on(Q.LEVEL_LOADING,this.onLevelLoading,this),e.on(Q.LEVEL_LOADED,this.onLevelLoaded,this),e.on(Q.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(Q.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(Q.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(Q.BUFFER_CREATED,this.onBufferCreated,this),e.on(Q.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(Q.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(Q.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();let{hls:e}=this;e.off(Q.MANIFEST_PARSED,this.onManifestParsed,this),e.off(Q.LEVEL_LOADED,this.onLevelLoaded,this),e.off(Q.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(Q.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(Q.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(Q.BUFFER_CREATED,this.onBufferCreated,this),e.off(Q.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(Q.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(Q.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(e,t){if(this.levels){let{lastCurrentTime:n,hls:r}=this;if(this.stopLoad(),this.setInterval(Xu),this.level=-1,!this.startFragRequested){let e=r.startLevel;e===-1&&(r.config.testBandwidth&&this.levels.length>1?(e=0,this.bitrateTest=!0):e=r.firstAutoLevel),r.nextLoadLevel=e,this.level=r.loadLevel,this._hasEnoughToStart=!!t}n>0&&e===-1&&!t&&(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n),this.state=$.IDLE,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=$.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case $.WAITING_LEVEL:{let{levels:e,level:t}=this,n=e?.[t],r=n?.details;if(r&&(!r.live||this.levelLastLoaded===n&&!this.waitForLive(n))){if(this.waitForCdnTuneIn(r))break;this.state=$.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=$.IDLE;break}break}case $.FRAG_LOADING_WAITING_RETRY:this.checkRetryDate();break}this.state===$.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){var e;super.onTickEnd(),(e=this.media)!=null&&e.readyState&&this.media.seeking===!1&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()}doTickIdle(){let{hls:e,levelLastLoaded:t,levels:n,media:r}=this;if(t===null||!r&&!this.primaryPrefetch&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;let i=this.buffering?e.nextLoadLevel:e.loadLevel;if(!(n!=null&&n[i]))return;let o=n[i],c=this.getMainFwdBufferInfo();if(c===null)return;let l=this.getLevelDetails();if(l&&this._streamEnded(c,l)){let e={};this.altAudio===2&&(e.type=`video`),this.hls.trigger(Q.BUFFER_EOS,e),this.state=$.ENDED;return}if(!this.buffering)return;e.loadLevel!==i&&e.manualLevel===-1&&this.log(`Adapting to level ${i} from level ${this.level}`),this.level=e.nextLoadLevel=i;let u=o.details;if(!u||this.state===$.WAITING_LEVEL||this.waitForLive(o)){this.level=i,this.state=$.WAITING_LEVEL,this.startFragRequested=!1;return}let d=c.len,f=this.getMaxBufferLength(o.maxBitrate);if(d>=f)return;this.backtrackFragment&&this.backtrackFragment.start>c.end&&(this.backtrackFragment=null);let p=this.backtrackFragment?this.backtrackFragment.start:c.end,m=this.getNextFragment(p,u);if(this.couldBacktrack&&!this.fragPrevious&&m&&q(m)&&this.fragmentTracker.getState(m)!==us.OK){let e=(this.backtrackFragment??m).sn-u.startSN,t=u.fragments[e-1];t&&m.cc===t.cc&&(m=t,this.fragmentTracker.removeFragment(t))}else this.backtrackFragment&&c.len&&(this.backtrackFragment=null);if(m&&this.isLoopLoading(m,p)){if(!m.gap){let e=this.audioOnly&&!this.altAudio?Ro.AUDIO:Ro.VIDEO,t=(e===Ro.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;t&&this.afterBufferFlushed(t,e,Eo.MAIN)}m=this.getNextFragmentLoopLoading(m,u,c,Eo.MAIN,f)}m&&(m.initSegment&&!m.initSegment.data&&!this.bitrateTest&&(m=m.initSegment),this.loadFragment(m,o,p))}loadFragment(e,t,n){let r=this.fragmentTracker.getState(e);r===us.NOT_LOADED||r===us.PARTIAL?q(e)?this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):super.loadFragment(e,t,n):this._loadInitSegment(e,t):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,Eo.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,1/0)}nextLevelSwitch(){let{levels:e,media:t}=this;if(t!=null&&t.readyState){let n,r=this.getAppendedFrag(t.currentTime);r&&r.start>1&&this.flushMainBuffer(0,r.start-1);let i=this.getLevelDetails();if(i!=null&&i.live){let e=this.getMainFwdBufferInfo();if(!e||e.len<i.targetduration*2)return}if(!t.paused&&e){let t=e[this.hls.nextLoadLevel],r=this.fragLastKbps;n=r&&this.fragCurrent?this.fragCurrent.duration*t.maxBitrate/(1e3*r)+1:0}else n=0;let o=this.getBufferedFrag(t.currentTime+n);if(o){let e=this.followingBufferedFrag(o);if(e){this.abortCurrentFrag();let t=e.maxStartPTS?e.maxStartPTS:e.start,n=e.duration,r=Math.max(o.end,t+Math.min(Math.max(n-this.config.maxFragLookUpTolerance,n*(this.couldBacktrack?.5:.125)),n*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(r,1/0)}}}}abortCurrentFrag(){let e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case $.KEY_LOADING:case $.FRAG_LOADING:case $.FRAG_LOADING_WAITING_RETRY:case $.PARSING:case $.PARSED:this.state=$.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio===2?`video`:null)}onMediaAttached(e,t){super.onMediaAttached(e,t);let n=t.media;$n(n,`playing`,this.onMediaPlaying),$n(n,`seeked`,this.onMediaSeeked)}onMediaDetaching(e,t){let{media:n}=this;n&&(er(n,`playing`,this.onMediaPlaying),er(n,`seeked`,this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,super.onMediaDetaching(e,t),!t.transferMedia&&(this._hasEnoughToStart=!1)}onManifestLoading(){super.onManifestLoading(),this.log(`Trigger BUFFER_RESET`),this.hls.trigger(Q.BUFFER_RESET,void 0),this.couldBacktrack=!1,this.fragLastKbps=0,this.fragPlaying=this.backtrackFragment=null,this.altAudio=0,this.audioOnly=!1}onManifestParsed(e,t){let n=!1,r=!1;for(let e=0;e<t.levels.length;e++){let i=t.levels[e].audioCodec;i&&(n||=i.indexOf(`mp4a.40.2`)!==-1,r||=i.indexOf(`mp4a.40.5`)!==-1)}this.audioCodecSwitch=n&&r&&!vo(),this.audioCodecSwitch&&this.log(`Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC`),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){let{levels:n}=this;if(!n||this.state!==$.IDLE)return;let r=t.levelInfo;(!r.details||r.details.live&&(this.levelLastLoaded!==r||r.details.expired)||this.waitForCdnTuneIn(r.details))&&(this.state=$.WAITING_LEVEL)}onLevelLoaded(e,t){var n;let{levels:r,startFragRequested:i}=this,o=t.level,c=t.details,l=c.totalduration;if(!r){this.warn(`Levels were reset while loading level ${o}`);return}this.log(`Level ${o} loaded [${c.startSN},${c.endSN}]${c.lastPartSn?`[part-${c.lastPartSn}-${c.lastPartIndex}]`:``}, cc [${c.startCC}, ${c.endCC}] duration:${l}`);let u=t.levelInfo,d=this.fragCurrent;d&&(this.state===$.FRAG_LOADING||this.state===$.FRAG_LOADING_WAITING_RETRY)&&d.level!==t.level&&d.loader&&this.abortCurrentFrag();let f=0;if(c.live||(n=u.details)!=null&&n.live){if(this.checkLiveUpdate(c),c.deltaUpdateFailed)return;f=this.alignPlaylists(c,u.details,this.levelLastLoaded?.details)}if(u.details=c,this.levelLastLoaded=u,i||this.setStartPosition(c,f),this.hls.trigger(Q.LEVEL_UPDATED,{details:c,level:o}),this.state===$.WAITING_LEVEL){if(this.waitForCdnTuneIn(c))return;this.state=$.IDLE}i&&c.live&&this.synchronizeToLiveEdge(c),this.tick()}synchronizeToLiveEdge(e){let{config:t,media:n}=this;if(!n)return;let r=this.hls.liveSyncPosition,i=this.getLoadPosition(),o=e.fragmentStart,c=e.edge,l=i>=o-t.maxFragLookUpTolerance&&i<=c;if(r!==null&&n.duration>r&&(i<r||!l)){let o=t.liveMaxLatencyDuration===void 0?t.liveMaxLatencyDurationCount*e.targetduration:t.liveMaxLatencyDuration;if((!l&&n.readyState<4||i<c-o)&&(this._hasEnoughToStart||(this.nextLoadPosition=r),n.readyState))if(this.warn(`Playback: ${i.toFixed(3)} is located too far from the end of live sliding playlist: ${c}, reset currentTime to : ${r.toFixed(3)}`),this.config.liveSyncMode===`buffered`){var u;let e=ws.bufferInfo(n,r,0);if(!((u=e.buffered)!=null&&u.length)){n.currentTime=r;return}if(e.start<=i){n.currentTime=r;return}let{nextStart:t}=ws.bufferedInfo(e.buffered,i,0);t&&(n.currentTime=t)}else n.currentTime=r}}_handleFragmentLoadProgress(e){let t=e.frag,{part:n,payload:r}=e,{levels:i}=this;if(!i){this.warn(`Levels were reset while fragment load was in progress. Fragment ${t.sn} of level ${t.level} will not be buffered`);return}let o=i[t.level];if(!o){this.warn(`Level ${t.level} not found on progress`);return}let c=o.details;if(!c){this.warn(`Dropping fragment ${t.sn} of level ${t.level} after level details were reset`),this.fragmentTracker.removeFragment(t);return}let l=o.videoCodec,u=c.PTSKnown||!c.live,d=t.initSegment?.data,f=this._getAudioCodec(o),p=this.transmuxer=this.transmuxer||new Vc(this.hls,Eo.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),m=n?n.index:-1,h=m!==-1,g=new Ss(t.level,t.sn,t.stats.chunkCount,r.byteLength,m,h),_=this.initPTS[t.cc];p.push(r,d,f,l,t,n,c.totalduration,u,g,_)}onAudioTrackSwitching(e,t){let n=this.hls,r=this.altAudio!==0;if(bt(t.url,n))this.altAudio=1;else{if(this.mediaBuffer!==this.media){this.log(`Switching on main audio, use media.buffered to schedule main fragment loading`),this.mediaBuffer=this.media;let e=this.fragCurrent;e&&(this.log(`Switching to main audio track, cancel main fragment load`),e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();if(r){this.altAudio=0,this.fragmentTracker.removeAllFragments(),n.once(Q.BUFFER_FLUSHED,()=>{this.hls&&this.hls.trigger(Q.AUDIO_TRACK_SWITCHED,t)}),n.trigger(Q.BUFFER_FLUSHING,{startOffset:0,endOffset:1/0,type:null});return}n.trigger(Q.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){let n=bt(t.url,this.hls);if(n){let e=this.videoBuffer;e&&this.mediaBuffer!==e&&(this.log(`Switching on alternate audio, use video.buffered to schedule main fragment loading`),this.mediaBuffer=e)}this.altAudio=n?2:0,this.tick()}onBufferCreated(e,t){let n=t.tracks,r,i,o=!1;for(let e in n){let t=n[e];if(t.id===`main`){if(i=e,r=t,e===`video`){let t=n[e];t&&(this.videoBuffer=t.buffer)}}else o=!0}o&&r?(this.log(`Alternate track found, use ${i}.buffered to schedule main fragment loading`),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){let{frag:n,part:r}=t,i=n.type===Eo.MAIN;if(i){if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${r?` p: `+r.index:``} of level ${n.level} finished buffering, but was aborted. state: ${this.state}`),this.state===$.PARSED&&(this.state=$.IDLE);return}let e=r?r.stats:n.stats;this.fragLastKbps=Math.round(8*e.total/(e.buffering.end-e.loading.first)),q(n)&&(this.fragPrevious=n),this.fragBufferedComplete(n,r)}let o=this.media;o&&(!this._hasEnoughToStart&&ws.getBuffered(o).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),i&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,t){if(t.fatal){this.state=$.ERROR;return}switch(t.details){case Z.FRAG_GAP:case Z.FRAG_PARSING_ERROR:case Z.FRAG_DECRYPT_ERROR:case Z.FRAG_LOAD_ERROR:case Z.FRAG_LOAD_TIMEOUT:case Z.KEY_LOAD_ERROR:case Z.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Eo.MAIN,t);break;case Z.LEVEL_LOAD_ERROR:case Z.LEVEL_LOAD_TIMEOUT:case Z.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===$.WAITING_LEVEL&&t.context?.type===To.LEVEL&&(this.state=$.IDLE);break;case Z.BUFFER_ADD_CODEC_ERROR:case Z.BUFFER_APPEND_ERROR:if(t.parent!==`main`)return;this.reduceLengthAndFlushBuffer(t)&&this.resetLoadingState();break;case Z.BUFFER_FULL_ERROR:if(t.parent!==`main`)return;this.reduceLengthAndFlushBuffer(t)&&(!this.config.interstitialsController&&this.config.assetPlayerId?this._hasEnoughToStart=!0:this.flushMainBuffer(0,1/0));break;case Z.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onFragLoadEmergencyAborted(){this.state=$.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==Ro.AUDIO||!this.altAudio){let e=(t===Ro.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;e&&(this.afterBufferFlushed(e,t,Eo.MAIN),this.tick())}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level,this.level===-1&&this.resetWhenMissingContext(this.fragCurrent)),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){let{media:e}=this;if(!e)return;let t=e.currentTime,n=this.startPosition;if(n>=0&&t<n){if(e.seeking){this.log(`could not seek to ${n}, already seeking at ${t}`);return}let r=this.timelineOffset;r&&n&&(n+=r);let i=this.getLevelDetails(),o=ws.getBuffered(e),c=o.length?o.start(0):0,l=c-n,u=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||l>0&&(l<u||this.loadingParts&&l<2*(i?.partTarget||0)))&&(this.log(`adjusting start position by ${l} to match buffer start`),n+=l,this.startPosition=n),t<n&&(this.log(`seek to target start position ${n} from current time ${t} buffer start ${c}`),e.currentTime=n)}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log(`Swapping audio codec`),t=t.indexOf(`mp4a.40.5`)===-1?`mp4a.40.5`:`mp4a.40.2`),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then(e=>{let{hls:n}=this,r=e?.frag;if(!r||this.fragContextChanged(r))return;t.fragmentError=0,this.state=$.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;let i=r.stats;i.parsing.start=i.parsing.end=i.buffering.start=i.buffering.end=self.performance.now(),n.trigger(Q.FRAG_LOADED,e),r.bitrateTest=!1}).catch(t=>{this.state===$.STOPPED||this.state===$.ERROR||(this.warn(t),this.resetFragmentLoading(e))})}_handleTransmuxComplete(e){let t=this.playlistType,{hls:n}=this,{remuxResult:r,chunkMeta:i}=e,o=this.getCurrentContext(i);if(!o){this.resetWhenMissingContext(i);return}let{frag:c,part:l,level:u}=o,{video:d,text:f,id3:p,initSegment:m}=r,{details:h}=u,g=this.altAudio?void 0:r.audio;if(this.fragContextChanged(c)){this.fragmentTracker.removeFragment(c);return}if(this.state=$.PARSING,m){let e=m.tracks;if(e){let r=c.initSegment||c;if(this.unhandledEncryptionError(m,c))return;this._bufferInitSegment(u,e,r,i),n.trigger(Q.FRAG_PARSING_INIT_SEGMENT,{frag:r,id:t,tracks:e})}let r=m.initPTS,o=m.timescale,l=this.initPTS[c.cc];if(X(r)&&(!l||l.baseTime!==r||l.timescale!==o)){let e=m.trackId;this.initPTS[c.cc]={baseTime:r,timescale:o,trackId:e},n.trigger(Q.INIT_PTS_FOUND,{frag:c,id:t,initPTS:r,timescale:o,trackId:e})}}if(d&&h){g&&d.type===`audiovideo`&&this.logMuxedErr(c);let e=h.fragments[c.sn-1-h.startSN],t=c.sn===h.startSN,n=!e||c.cc>e.cc;if(r.independent!==!1){let{startPTS:e,endPTS:r,startDTS:o,endDTS:u}=d;if(l)l.elementaryStreams[d.type]={startPTS:e,endPTS:r,startDTS:o,endDTS:u};else if(d.firstKeyFrame&&d.independent&&i.id===1&&!n&&(this.couldBacktrack=!0),d.dropped&&d.independent){let i=this.getMainFwdBufferInfo(),o=(i?i.end:this.getLoadPosition())+this.config.maxBufferHole,l=d.firstKeyFramePTS?d.firstKeyFramePTS:e;if(!t&&o<l-this.config.maxBufferHole&&!n){this.backtrack(c);return}else n&&(c.gap=!0);c.setElementaryStreamInfo(d.type,c.start,r,c.start,u,!0)}else t&&e-(h.appliedTimelineOffset||0)>Bu&&(c.gap=!0);c.setElementaryStreamInfo(d.type,e,r,o,u),this.backtrackFragment&&=c,this.bufferFragmentData(d,c,l,i,t||n)}else if(t||n)c.gap=!0;else{this.backtrack(c);return}}if(g){let{startPTS:e,endPTS:t,startDTS:n,endDTS:r}=g;l&&(l.elementaryStreams[Ro.AUDIO]={startPTS:e,endPTS:t,startDTS:n,endDTS:r}),c.setElementaryStreamInfo(Ro.AUDIO,e,t,n,r),this.bufferFragmentData(g,c,l,i)}if(h&&p!=null&&p.samples.length){let e={id:t,frag:c,details:h,samples:p.samples};n.trigger(Q.FRAG_PARSING_METADATA,e)}if(h&&f){let e={id:t,frag:c,details:h,samples:f.samples};n.trigger(Q.FRAG_PARSING_USERDATA,e)}}logMuxedErr(e){this.warn(`${q(e)?`Media`:`Init`} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,n,r){if(this.state!==$.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&(delete t.audio,t.audiovideo&&this.logMuxedErr(n));let{audio:i,video:o,audiovideo:c}=t;if(i){let n=e.audioCodec,r=Ue(i.codec,n);r===`mp4a`&&(r=`mp4a.40.5`);let o=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){r&&=r.indexOf(`mp4a.40.5`)===-1?`mp4a.40.5`:`mp4a.40.2`;let e=i.metadata;e&&`channelCount`in e&&(e.channelCount||1)!==1&&o.indexOf(`firefox`)===-1&&(r=`mp4a.40.5`)}r&&r.indexOf(`mp4a.40.5`)!==-1&&o.indexOf(`android`)!==-1&&i.container!==`audio/mpeg`&&(r=`mp4a.40.2`,this.log(`Android: force audio codec to ${r}`)),n&&n!==r&&this.log(`Swapping manifest audio codec "${n}" for "${r}"`),i.levelCodec=r,i.id=Eo.MAIN,this.log(`Init audio buffer, container:${i.container}, codecs[selected/level/parsed]=[${r||``}/${n||``}/${i.codec}]`),delete t.audiovideo}if(o){o.levelCodec=e.videoCodec,o.id=Eo.MAIN;let n=o.codec;if(n?.length===4)switch(n){case`hvc1`:case`hev1`:o.codec=`hvc1.1.6.L120.90`;break;case`av01`:o.codec=`av01.0.04M.08`;break;case`avc1`:o.codec=`avc1.42e01e`;break}this.log(`Init video buffer, container:${o.container}, codecs[level/parsed]=[${e.videoCodec||``}/${n}]${o.codec===n?``:` parsed-corrected=`+o.codec}${o.supplemental?` supplemental=`+o.supplemental:``}`),delete t.audiovideo}c&&(this.log(`Init audiovideo buffer, container:${c.container}, codecs[level/parsed]=[${e.codecs}/${c.codec}]`),delete t.video,delete t.audio);let l=Object.keys(t);if(l.length){if(this.hls.trigger(Q.BUFFER_CODECS,t),!this.hls)return;l.forEach(e=>{let i=t[e].initSegment;i!=null&&i.byteLength&&this.hls.trigger(Q.BUFFER_APPENDING,{type:e,data:i,frag:n,part:null,chunkMeta:r,parent:n.type})})}this.tickImmediate()}getMainFwdBufferInfo(){let e=this.mediaBuffer&&this.altAudio===2?this.mediaBuffer:this.media;return this.getFwdBufferInfo(e,Eo.MAIN)}get maxBufferLength(){let{levels:e,level:t}=this,n=e?.[t];return n?this.getMaxBufferLength(n.maxBitrate):this.config.maxBufferLength}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=$.IDLE}checkFragmentChanged(){let e=this.media,t=null;if(e&&e.readyState>1&&e.seeking===!1){let n=e.currentTime;if(ws.isBuffered(e,n)?t=this.getAppendedFrag(n):ws.isBuffered(e,n+.1)&&(t=this.getAppendedFrag(n+.1)),t){this.backtrackFragment=null;let e=this.fragPlaying,n=t.level;(!e||t.sn!==e.sn||e.level!==n)&&(this.fragPlaying=t,this.hls.trigger(Q.FRAG_CHANGED,{frag:t}),(!e||e.level!==n)&&this.hls.trigger(Q.LEVEL_SWITCHED,{level:n}))}}}get nextLevel(){let e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){if(this.fragPlaying)return this.fragPlaying;let e=this.media?.currentTime||this.lastCurrentTime;return X(e)?this.getAppendedFrag(e):null}get currentProgramDateTime(){let e=this.media?.currentTime||this.lastCurrentTime;if(X(e)){let t=this.getLevelDetails(),n=this.currentFrag||(t?St(null,t.fragments,e):null);if(n){let t=n.programDateTime;if(t!==null){let r=t+(e-n.start)*1e3;return new Date(r)}}}return null}get currentLevel(){let e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){let e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}},Qu=class extends ko{constructor(e,t){super(`key-loader`,t),this.config=void 0,this.keyIdToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(let t in this.keyIdToKeyInfo){let n=this.keyIdToKeyInfo[t].loader;if(n){if(e&&e!==n.context?.frag.type)return;n.abort()}}}detach(){for(let e in this.keyIdToKeyInfo){let t=this.keyIdToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyIdToKeyInfo[e]}}destroy(){this.detach();for(let e in this.keyIdToKeyInfo){let t=this.keyIdToKeyInfo[e].loader;t&&t.destroy()}this.keyIdToKeyInfo={}}createKeyLoadError(e,t=Z.KEY_LOAD_ERROR,n,r,i){return new bs({type:wo.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:i,error:n,networkDetails:r})}loadClear(e,t,n){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length){if(t.length)for(let r=0,i=t.length;r<i;r++){let o=t[r];if(e.cc<=o.cc&&(!q(e)||!q(o)||e.sn<o.sn)||!n&&r==i-1)return this.emeController.selectKeySystemFormat(o).then(e=>{if(!this.emeController)return;o.setKeyFormat(e);let t=cn(e);if(t)return this.emeController.getKeySystemAccess([t])})}if(this.config.requireKeySystemAccessOnStart){let e=un(this.config);if(e.length)return this.emeController.getKeySystemAccess(e)}}return null}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var n,r;t&&e.setKeyFormat(t);let i=e.decryptdata;if(!i){let n=Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:`Missing decryption data on fragment in onKeyLoading (emeEnabled with controller: ${this.emeController&&this.config.emeEnabled})`);return Promise.reject(this.createKeyLoadError(e,Z.KEY_LOAD_ERROR,n))}let o=i.uri;if(!o)return Promise.reject(this.createKeyLoadError(e,Z.KEY_LOAD_ERROR,Error(`Invalid key URI: "${o}"`)));let c=yo(i),l=this.keyIdToKeyInfo[c];if((n=l)!=null&&n.decryptdata.key)return i.key=l.decryptdata.key,Promise.resolve({frag:e,keyInfo:l});if(this.emeController&&(r=l)!=null&&r.keyLoadPromise)switch(this.emeController.getKeyStatus(l.decryptdata)){case`usable`:case`usable-in-future`:return l.keyLoadPromise.then(t=>{let{keyInfo:n}=t;return i.key=n.decryptdata.key,{frag:e,keyInfo:n}})}switch(this.log(`${this.keyIdToKeyInfo[c]?`Rel`:`L`}oading${i.keyId?` keyId: `+W(i.keyId):``} URI: ${i.uri} from ${e.type} ${e.level}`),l=this.keyIdToKeyInfo[c]={decryptdata:i,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},i.method){case`SAMPLE-AES`:case`SAMPLE-AES-CENC`:case`SAMPLE-AES-CTR`:return i.keyFormat===`identity`?this.loadKeyHTTP(l,e):this.loadKeyEME(l,e);case`AES-128`:case`AES-256`:case`AES-256-CTR`:return this.loadKeyHTTP(l,e);default:return Promise.reject(this.createKeyLoadError(e,Z.KEY_LOAD_ERROR,Error(`Key supplied with unsupported METHOD: "${i.method}"`)))}}loadKeyEME(e,t){let n={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){var r;if(!e.decryptdata.keyId&&(r=t.initSegment)!=null&&r.data){let n=ve(t.initSegment.data);if(n.length){let t=n[0];t.some(e=>e!==0)?(this.log(`Using keyId found in init segment ${W(t)}`),Rs.setKeyIdForUri(e.decryptdata.uri,t)):(t=Rs.addKeyIdForUri(e.decryptdata.uri),this.log(`Generating keyId to patch media ${W(t)}`)),e.decryptdata.keyId=t}}return!e.decryptdata.keyId&&!q(t)?Promise.resolve(n):(e.keyLoadPromise=this.emeController.loadKey(n).then(t=>(e.mediaKeySessionContext=t,n))).catch(n=>{throw e.keyLoadPromise=null,`data`in n&&(n.data.frag=t),n})}return Promise.resolve(n)}loadKeyHTTP(e,t){let n=this.config,r=n.loader,i=new r(n);return t.keyLoader=e.loader=i,e.keyLoadPromise=new Promise((r,o)=>{let c={keyInfo:e,frag:t,responseType:`arraybuffer`,url:e.decryptdata.uri},l=n.keyLoadPolicy.default,u={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0};i.load(c,u,{onSuccess:(e,t,n,i)=>{let{frag:c,keyInfo:l}=n,u=yo(l.decryptdata);if(!c.decryptdata||l!==this.keyIdToKeyInfo[u])return o(this.createKeyLoadError(c,Z.KEY_LOAD_ERROR,Error(`after key load, decryptdata unset or changed`),i));l.decryptdata.key=c.decryptdata.key=new Uint8Array(e.data),c.keyLoader=null,l.loader=null,r({frag:c,keyInfo:l})},onError:(e,n,r,i)=>{this.resetLoader(n),o(this.createKeyLoadError(t,Z.KEY_LOAD_ERROR,Error(`HTTP Error ${e.code} loading key ${e.text}`),r,N({url:c.url,data:void 0},e)))},onTimeout:(e,n,r)=>{this.resetLoader(n),o(this.createKeyLoadError(t,Z.KEY_LOAD_TIMEOUT,Error(`key loading timed out`),r))},onAbort:(e,n,r)=>{this.resetLoader(n),o(this.createKeyLoadError(t,Z.INTERNAL_ABORTED,Error(`key loading aborted`),r))}})})}resetLoader(e){let{frag:t,keyInfo:n,url:r}=e,i=n.loader;t.keyLoader===i&&(t.keyLoader=null,n.loader=null);let o=yo(n.decryptdata)||r;delete this.keyIdToKeyInfo[o],i&&i.destroy()}},$u=class{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.onManifestLoaded=this.checkAutostartLoad,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){let{hls:e}=this;e.on(Q.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Q.LEVEL_LOADING,this.onLevelLoading,this),e.on(Q.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(Q.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(Q.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){let{hls:e}=this;e.off(Q.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Q.LEVEL_LOADING,this.onLevelLoading,this),e.off(Q.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(Q.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(Q.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(e){let t=this.hls.config,n=t.pLoader,r=t.loader,i=new(n||r)(t);return this.loaders[e.type]=i,i}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(let e in this.loaders){let t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){let{url:n}=t;this.variableList=null,this.load({id:null,level:0,responseType:`text`,type:To.MANIFEST,url:n,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){let{id:n,level:r,pathwayId:i,url:o,deliveryDirectives:c,levelInfo:l}=t;this.load({id:n,level:r,pathwayId:i,responseType:`text`,type:To.LEVEL,url:o,deliveryDirectives:c,levelOrTrack:l})}onAudioTrackLoading(e,t){let{id:n,groupId:r,url:i,deliveryDirectives:o,track:c}=t;this.load({id:n,groupId:r,level:null,responseType:`text`,type:To.AUDIO_TRACK,url:i,deliveryDirectives:o,levelOrTrack:c})}onSubtitleTrackLoading(e,t){let{id:n,groupId:r,url:i,deliveryDirectives:o,track:c}=t;this.load({id:n,groupId:r,level:null,responseType:`text`,type:To.SUBTITLE_TRACK,url:i,deliveryDirectives:o,levelOrTrack:c})}onLevelsUpdated(e,t){let n=this.loaders[To.LEVEL];if(n){let e=n.context;e&&!t.levels.some(t=>t===e.levelOrTrack)&&(n.abort(),delete this.loaders[To.LEVEL])}}load(e){let t=this.hls.config,n=this.getInternalLoader(e);if(n){let t=this.hls.logger,r=n.context;if(r&&r.levelOrTrack===e.levelOrTrack&&(r.url===e.url||r.deliveryDirectives&&!e.deliveryDirectives)){r.url===e.url?t.log(`[playlist-loader]: ignore ${e.url} ongoing request`):t.log(`[playlist-loader]: ignore ${e.url} in favor of ${r.url}`);return}t.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),n.abort()}let r;if(r=e.type===To.MANIFEST?t.manifestLoadPolicy.default:j({},t.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),n=this.createInternalLoader(e),X(e.deliveryDirectives?.part)){let t;if(e.type===To.LEVEL&&e.level!==null?t=this.hls.levels[e.level].details:e.type===To.AUDIO_TRACK&&e.id!==null?t=this.hls.audioTracks[e.id].details:e.type===To.SUBTITLE_TRACK&&e.id!==null&&(t=this.hls.subtitleTracks[e.id].details),t){let e=t.partTarget,n=t.targetduration;if(e&&n){let t=Math.max(e*3,n*.8)*1e3;r=j({},r,{maxTimeToFirstByteMs:Math.min(t,r.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(t,r.maxTimeToFirstByteMs)})}}}let i=r.errorRetry||r.timeoutRetry||{},o={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:i.maxNumRetry||0,retryDelay:i.retryDelayMs||0,maxRetryDelay:i.maxRetryDelayMs||0};n.load(e,o,{onSuccess:(e,t,n,r)=>{let i=this.getInternalLoader(n);this.resetInternalLoader(n.type);let o=e.data;t.parsing.start=performance.now(),Ws.isMediaPlaylist(o)||n.type!==To.MANIFEST?this.handleTrackOrLevelPlaylist(e,t,n,r||null,i):this.handleMasterPlaylist(e,t,n,r)},onError:(e,t,n,r)=>{this.handleNetworkError(t,n,!1,e,r)},onTimeout:(e,t,n)=>{this.handleNetworkError(t,n,!0,void 0,e)}})}checkAutostartLoad(){if(!this.hls)return;let{config:{autoStartLoad:e,startPosition:t},forceStartLoad:n}=this.hls;(e||n)&&(this.hls.logger.log(`${e?`auto`:`force`} startLoad with configured startPosition ${t}`),this.hls.startLoad(t))}handleMasterPlaylist(e,t,n,r){let i=this.hls,o=e.data,c=xo(e,n),l=Ws.parseMasterPlaylist(o,c);if(l.playlistParsingError){t.parsing.end=performance.now(),this.handleManifestParsingError(e,n,l.playlistParsingError,r,t);return}let{contentSteering:u,levels:d,sessionData:f,sessionKeys:p,startTimeOffset:m,variableList:h}=l;this.variableList=h,d.forEach(e=>{let{unknownCodecs:t}=e;if(t){let{preferManagedMediaSource:n}=this.hls.config,{audioCodec:r,videoCodec:i}=e;for(let o=t.length;o--;){let c=t[o];Fe(c,`audio`,n)?(e.audioCodec=r=r?`${r},${c}`:c,Ko.audio[r.substring(0,4)]=2,t.splice(o,1)):Fe(c,`video`,n)&&(e.videoCodec=i=i?`${i},${c}`:c,Ko.video[i.substring(0,4)]=2,t.splice(o,1))}}});let{AUDIO:g=[],SUBTITLES:_,"CLOSED-CAPTIONS":v}=Ws.parseMasterPlaylistMedia(o,c,l);g.length&&!g.some(e=>!e.url)&&d[0].audioCodec&&!d[0].attrs.AUDIO&&(this.hls.logger.log(`[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one`),g.unshift({type:`main`,name:`main`,groupId:`main`,default:!1,autoselect:!1,forced:!1,id:-1,attrs:new Os({}),bitrate:0,url:``})),i.trigger(Q.MANIFEST_LOADED,{levels:d,audioTracks:g,subtitles:_,captions:v,contentSteering:u,url:c,stats:t,networkDetails:r,sessionData:f,sessionKeys:p,startTimeOffset:m,variableList:h})}handleTrackOrLevelPlaylist(e,t,n,r,i){let o=this.hls,{id:c,level:l,type:u}=n,d=xo(e,n),f=X(l)?l:X(c)?c:0,p=bo(n),m=Ws.parseLevelPlaylist(e.data,d,f,p,0,this.variableList);if(u===To.MANIFEST){let e={attrs:new Os({}),bitrate:0,details:m,name:``,url:d};m.requestScheduled=t.loading.start+zn(m,0),o.trigger(Q.MANIFEST_LOADED,{levels:[e],audioTracks:[],url:d,stats:t,networkDetails:r,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),n.levelDetails=m,this.handlePlaylistLoaded(m,e,t,n,r,i)}handleManifestParsingError(e,t,n,r,i){this.hls.trigger(Q.ERROR,{type:wo.NETWORK_ERROR,details:Z.MANIFEST_PARSING_ERROR,fatal:t.type===To.MANIFEST,url:e.url,err:n,error:n,reason:n.message,response:e,context:t,networkDetails:r,stats:i})}handleNetworkError(e,t,n=!1,r,i){let o=`A network ${n?`timeout`:`error`+(r?` (status `+r.code+`)`:``)} occurred while loading ${e.type}`;e.type===To.LEVEL?o+=`: ${e.level} id: ${e.id}`:(e.type===To.AUDIO_TRACK||e.type===To.SUBTITLE_TRACK)&&(o+=` id: ${e.id} group-id: "${e.groupId}"`);let c=Error(o);this.hls.logger.warn(`[playlist-loader]: ${o}`);let l=Z.UNKNOWN,u=!1,d=this.getInternalLoader(e);switch(e.type){case To.MANIFEST:l=n?Z.MANIFEST_LOAD_TIMEOUT:Z.MANIFEST_LOAD_ERROR,u=!0;break;case To.LEVEL:l=n?Z.LEVEL_LOAD_TIMEOUT:Z.LEVEL_LOAD_ERROR,u=!1;break;case To.AUDIO_TRACK:l=n?Z.AUDIO_TRACK_LOAD_TIMEOUT:Z.AUDIO_TRACK_LOAD_ERROR,u=!1;break;case To.SUBTITLE_TRACK:l=n?Z.SUBTITLE_TRACK_LOAD_TIMEOUT:Z.SUBTITLE_LOAD_ERROR,u=!1;break}d&&this.resetInternalLoader(e.type);let f={type:wo.NETWORK_ERROR,details:l,fatal:u,url:e.url,loader:d,context:e,error:c,networkDetails:t,stats:i};r&&(f.response=N({url:t?.url||e.url,data:void 0},r)),this.hls.trigger(Q.ERROR,f)}handlePlaylistLoaded(e,t,n,r,i,o){let c=this.hls,{type:l,level:u,levelOrTrack:d,id:f,groupId:p,deliveryDirectives:m}=r,h=xo(t,r),g=bo(r),_=typeof r.level==`number`&&g===Eo.MAIN?u:void 0,v=e.playlistParsingError;if(v){if(this.hls.logger.warn(`${v} ${e.url}`),!c.config.ignorePlaylistParsingErrors){c.trigger(Q.ERROR,{type:wo.NETWORK_ERROR,details:Z.LEVEL_PARSING_ERROR,fatal:!1,url:h,error:v,reason:v.message,response:t,context:r,level:_,parent:g,networkDetails:i,stats:n});return}e.playlistParsingError=null}if(!e.fragments.length){let o=e.playlistParsingError=Error(`No Segments found in Playlist`);c.trigger(Q.ERROR,{type:wo.NETWORK_ERROR,details:Z.LEVEL_EMPTY_ERROR,fatal:!1,url:h,error:o,reason:o.message,response:t,context:r,level:_,parent:g,networkDetails:i,stats:n});return}switch(e.live&&o&&(o.getCacheAge&&(e.ageHeader=o.getCacheAge()||0),(!o.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),l){case To.MANIFEST:case To.LEVEL:if(_){if(!d)_=0;else if(d!==c.levels[_]){let e=c.levels.indexOf(d);e>-1&&(_=e)}}c.trigger(Q.LEVEL_LOADED,{details:e,levelInfo:d||c.levels[0],level:_||0,id:f||0,stats:n,networkDetails:i,deliveryDirectives:m,withoutMultiVariant:l===To.MANIFEST});break;case To.AUDIO_TRACK:c.trigger(Q.AUDIO_TRACK_LOADED,{details:e,track:d,id:f||0,groupId:p||``,stats:n,networkDetails:i,deliveryDirectives:m});break;case To.SUBTITLE_TRACK:c.trigger(Q.SUBTITLE_TRACK_LOADED,{details:e,track:d,id:f||0,groupId:p||``,stats:n,networkDetails:i,deliveryDirectives:m});break}}},ed=class e{static get version(){return Zs}static isMSESupported(){return go()}static isSupported(){return _o()}static getMediaSource(){return B()}static get Events(){return Q}static get MetadataSchema(){return tc}static get ErrorTypes(){return wo}static get ErrorDetails(){return Z}static get DefaultConfig(){return e.defaultConfig?e.defaultConfig:zu}static set DefaultConfig(t){e.defaultConfig=t}constructor(t={}){this.config=void 0,this.userConfig=void 0,this.logger=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new Xs,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioStreamController=void 0,this.subtititleStreamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.interstitialsController=void 0,this.gapController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this._url=null,this._sessionId=void 0,this.triggeringException=void 0,this.started=!1;let n=this.logger=z(t.debug||!1,`Hls instance`,t.assetPlayerId),r=this.config=ao(e.DefaultConfig,t,n);this.userConfig=t,r.progressive&&so(r,n);let{abrController:i,bufferController:o,capLevelController:c,errorController:l,fpsController:u}=r,d=new l(this),f=this.abrController=new i(this),p=new ds(this),m=r.interstitialsController,h=m?this.interstitialsController=new m(this,e):null,g=this.bufferController=new o(this,p),_=this.capLevelController=new c(this),v=new u(this),y=new $u(this),b=r.contentSteeringController,x=b?new b(this):null,S=this.levelController=new Yu(this,x),C=new qu(this),w=new Qu(this.config,this.logger),T=this.streamController=new Zu(this,p,w),E=this.gapController=new Wu(this,p);_.setStreamController(T),v.setStreamController(T);let D=[y,S,T];h&&D.splice(1,0,h),x&&D.splice(1,0,x),this.networkControllers=D;let O=[f,g,E,_,v,C,p];this.audioTrackController=this.createController(r.audioTrackController,D);let k=r.audioStreamController;k&&D.push(this.audioStreamController=new k(this,p,w)),this.subtitleTrackController=this.createController(r.subtitleTrackController,D);let A=r.subtitleStreamController;A&&D.push(this.subtititleStreamController=new A(this,p,w)),this.createController(r.timelineController,O),w.emeController=this.emeController=this.createController(r.emeController,O),this.cmcdController=this.createController(r.cmcdController,O),this.latencyController=this.createController(Ju,O),this.coreComponents=O,D.push(d);let j=d.onErrorOut;typeof j==`function`&&this.on(Q.ERROR,j,d),this.on(Q.MANIFEST_LOADED,y.onManifestLoaded,y)}createController(e,t){if(e){let n=new e(this);return t&&t.push(n),n}return null}on(e,t,n=this){this._emitter.on(e,t,n)}once(e,t,n=this){this._emitter.once(e,t,n)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,n=this,r){this._emitter.off(e,t,n,r)}listeners(e){return this._emitter.listeners(e)}emit(e,t,n){return this._emitter.emit(e,t,n)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(t){if(this.logger.error(`An internal error happened while handling event `+e+`. Error message: "`+t.message+`". Here is a stacktrace:`,t),!this.triggeringException){this.triggeringException=!0;let n=e===Q.ERROR;this.trigger(Q.ERROR,{type:wo.OTHER_ERROR,details:Z.INTERNAL_EXCEPTION,fatal:n,event:e,error:t}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){this.logger.log(`destroy`),this.trigger(Q.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this._url=null,this.networkControllers.forEach(e=>e.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(e=>e.destroy()),this.coreComponents.length=0;let e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){if(!e||`media`in e&&!e.media){let t=Error(`attachMedia failed: invalid argument (${e})`);this.trigger(Q.ERROR,{type:wo.OTHER_ERROR,details:Z.ATTACH_MEDIA_ERROR,fatal:!0,error:t});return}this.logger.log(`attachMedia`),this._media&&(this.logger.warn(`media must be detached before attaching`),this.detachMedia());let t=`media`in e,n=t?e.media:e,r=t?e:{media:n};this._media=n,this.trigger(Q.MEDIA_ATTACHING,r)}detachMedia(){this.logger.log(`detachMedia`),this.trigger(Q.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;let e=this.bufferController.transferMedia();return this.trigger(Q.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();let t=this.media,n=this._url,r=this._url=Io.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${r}`),t&&n&&(n!==r||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(Q.MANIFEST_LOADING,{url:e})}get url(){return this._url}get hasEnoughToStart(){return this.streamController.hasEnoughToStart}get startPosition(){return this.streamController.startPositionValue}startLoad(e=-1,t){this.logger.log(`startLoad(${e+(t?`, <skip seek to start>`:``)})`),this.started=!0,this.resumeBuffering();for(let n=0;n<this.networkControllers.length&&(this.networkControllers[n].startLoad(e,t),!(!this.started||!this.networkControllers));n++);}stopLoad(){this.logger.log(`stopLoad`),this.started=!1;for(let e=0;e<this.networkControllers.length&&(this.networkControllers[e].stopLoad(),!(this.started||!this.networkControllers));e++);}get loadingEnabled(){return this.started}get bufferingEnabled(){return this.streamController.bufferingEnabled}resumeBuffering(){this.bufferingEnabled||(this.logger.log(`resume buffering`),this.networkControllers.forEach(e=>{e.resumeBuffering&&e.resumeBuffering()}))}pauseBuffering(){this.bufferingEnabled&&(this.logger.log(`pause buffering`),this.networkControllers.forEach(e=>{e.pauseBuffering&&e.pauseBuffering()}))}get inFlightFragments(){let e={[Eo.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[Eo.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[Eo.SUBTITLE]=this.subtititleStreamController.inFlightFrag),e}swapAudioCodec(){this.logger.log(`swapAudioCodec`),this.streamController.swapAudioCodec()}recoverMediaError(){this.logger.log(`recoverMediaError`);let e=this._media,t=e?.currentTime;this.detachMedia(),e&&(this.attachMedia(e),t&&this.startLoad(t))}removeLevel(e){this.levelController.removeLevel(e)}get sessionId(){let e=this._sessionId;return e||=this._sessionId=va(),e}get levels(){return this.levelController.levels||[]}get latestLevelDetails(){return this.streamController.getLevelDetails()||null}get loadLevelObj(){return this.levelController.loadLevelObj}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){this.logger.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){this.logger.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){this.logger.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){this.logger.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){let e=this.levelController.startLevel;return e===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){this.logger.log(`set startLevel:${e}`),e!==-1&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){let t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){let{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get abrEwmaDefaultEstimate(){let{bwEstimator:e}=this.abrController;return e?e.defaultEstimate:NaN}get ttfbEstimate(){let{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(this.logger.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){nt(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){let{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;let n=e.length;for(let r=0;r<n;r++)if(e[r].maxBitrate>=t)return r;return 0}get maxAutoLevel(){let{levels:e,autoLevelCapping:t,maxHdcpLevel:n}=this,r;if(r=t===-1&&e!=null&&e.length?e.length-1:t,n)for(let t=r;t--;){let r=e[t].attrs[`HDCP-LEVEL`];if(r&&r<=n)return t}return r}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(e){return this.audioTrackController?.setAudioOption(e)||null}setSubtitleOption(e){return this.subtitleTrackController?.setSubtitleOption(e)||null}get allAudioTracks(){let e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){let e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){let e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){let t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){let e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){let e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){let e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){let t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){let e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){let t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}set targetLatency(e){this.latencyController.targetLatency=e}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}get pathways(){return this.levelController.pathways}get pathwayPriority(){return this.levelController.pathwayPriority}set pathwayPriority(e){this.levelController.pathwayPriority=e}get bufferedToEnd(){var e;return!!((e=this.bufferController)!=null&&e.bufferedToEnd)}get interstitialsManager(){return this.interstitialsController?.interstitialsManager||null}getMediaDecodingInfo(e,t=this.allAudioTracks){return Y(e,ut(t),navigator.mediaCapabilities)}},ed.defaultConfig=void 0})),nd,rd,id=n((()=>{nd=null,rd=class{id=`hls`;isNative=!1;video=null;hls=null;HlsCtor=null;loadVersion=0;cancelPendingLoad;lastSource=null;networkRetryCount=0;mediaRetryCount=0;maxNetworkRetries=3;maxMediaRetries=2;startupAutoLevelReleaseTimer=null;startupAutoLevelCapAppliedAt=null;startupAutoLevelCap=-1;appendQueueDepth=0;appendWaitStartedAt=null;appendBackpressureCount=0;runtimeConfig={performance:{startupMode:`balanced`,startupBufferSeconds:1.2,manifestFastPath:!1},abr:{startupProfile:`balanced`,upgradeAggression:`medium`,rebufferSafetyBias:`medium`}};lastRebufferDowngradeAt=0;listeners=new Map;domListeners=[];setRuntimeConfig(e){this.runtimeConfig={performance:{startupMode:e.performance?.startupMode??this.runtimeConfig.performance.startupMode,startupBufferSeconds:e.performance?.startupBufferSeconds??this.runtimeConfig.performance.startupBufferSeconds,manifestFastPath:e.performance?.manifestFastPath??this.runtimeConfig.performance.manifestFastPath},abr:{startupProfile:e.abr?.startupProfile??this.runtimeConfig.abr.startupProfile,upgradeAggression:e.abr?.upgradeAggression??this.runtimeConfig.abr.upgradeAggression,rebufferSafetyBias:e.abr?.rebufferSafetyBias??this.runtimeConfig.abr.rebufferSafetyBias}}}canPlayType(e){return e===`hls`&&typeof window<`u`&&`MediaSource`in window}canPlaySource(e){return e.toLowerCase().includes(`.m3u8`)&&typeof window<`u`&&`MediaSource`in window}async preload(){await this.ensureCtor()}async ensureCtor(){return this.HlsCtor||=(await Promise.resolve().then(()=>(td(),k))).default,this.HlsCtor}attach(e){this.video=e,this.bindDomEvents(),this.hls&&this.hls.attachMedia(e)}getStartupReadiness(){let e=this.getMediaSource(),t=this.getSourceBuffers(),n=t.length>0?t.some(e=>!!e.updating):null;return{mediaSourceReadyState:e?.readyState??null,sourceBuffersUpdating:n,bufferAheadSeconds:this.getBufferedAheadSeconds(),videoReadyState:this.video?.readyState??null,appendQueueDepth:this.appendQueueDepth,appendWaitActive:this.appendWaitStartedAt!==null,appendBackpressureCount:this.appendBackpressureCount,appendQueueBlocked:this.appendWaitStartedAt!==null,appendCollisions:this.appendBackpressureCount}}bindDomEvents(){if(!this.video)return;this.unbindDomEvents();let e=(e,t,n=()=>void 0)=>{let r=r=>{let i=n(r);e===`waiting`&&this.rebufferAwareDowngrade(),this.emit(t,i)};this.video.addEventListener(e,r),this.domListeners.push({event:e,handler:r})};e(`play`,`play`),e(`pause`,`pause`),e(`playing`,`playing`),e(`ended`,`ended`),e(`waiting`,`waiting`),e(`seeked`,`seeked`,()=>({currentTime:this.video.currentTime})),e(`canplay`,`ready`),e(`timeupdate`,`timeupdate`,()=>({currentTime:this.video.currentTime})),e(`durationchange`,`durationchange`,()=>({duration:this.video.duration})),e(`volumechange`,`volumechange`,()=>({volume:this.video.volume,muted:this.video.muted})),e(`ratechange`,`ratechange`,()=>({playbackRate:this.video.playbackRate})),e(`progress`,`progress`,()=>{let e=[],t=this.video.buffered;for(let n=0;n<t.length;n++)e.push({start:t.start(n),end:t.end(n)});return{buffered:e}})}unbindDomEvents(){this.video&&(this.domListeners.forEach(({event:e,handler:t})=>{this.video.removeEventListener(e,t)}),this.domListeners=[])}async load(e){if(!this.video)throw Error(`Video element not attached`);this.video.poster=e.poster||``;let t=++this.loadVersion;this.lastSource=e,this.networkRetryCount=0,this.mediaRetryCount=0;let n=await this.ensureCtor();if(t===this.loadVersion){if(!n?.isSupported?.())throw Error(`HLS is not supported in this runtime`);return this.hls&&this.hls.destroy(),new Promise((t,r)=>{this.cancelPendingLoad=()=>r(new DOMException(`Load superseded`,`AbortError`)),this.clearStartupUpswitchDelay(),this.resetAppendQueueState();let i=!1,o=!1,c=!1,l=this.runtimeConfig.abr.startupProfile,u=this.runtimeConfig.abr.upgradeAggression,d=this.runtimeConfig.abr.rebufferSafetyBias,f=this.runtimeConfig.performance.startupMode,p=this.runtimeConfig.performance.manifestFastPath||f===`fast-first-frame`,m=d===`high`?{abrBandWidthFactor:.7,abrBandWidthUpFactor:.5}:d===`low`?{abrBandWidthFactor:.92,abrBandWidthUpFactor:.88}:{abrBandWidthFactor:.82,abrBandWidthUpFactor:.7},h=u===`high`?{abrEwmaFastLive:2,abrEwmaSlowLive:6,abrEwmaFastVoD:2,abrEwmaSlowVoD:8}:u===`low`?{abrEwmaFastLive:5,abrEwmaSlowLive:12,abrEwmaFastVoD:5,abrEwmaSlowVoD:14}:{abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:10},g=l===`fast`||f===`fast-first-frame`?0:l===`quality`?-1:1;this.startupAutoLevelCap=g>=0?g:0,this.hls=new n({enableWorker:!0,lowLatencyMode:f===`fast-first-frame`,startLevel:g,maxBufferLength:p?8:16,maxMaxBufferLength:p?12:30,renderTextTracksNatively:!0,startFragPrefetch:p,progressive:!1,appendErrorMaxRetry:p?8:3,...nd===null?{}:{abrEwmaDefaultEstimate:nd},...m,...h}),this.emit(`telemetry`,{name:`manifest_request_started`,at:Date.now()}),this.emit(`telemetry`,{name:`manifest_parse_started`,at:Date.now()}),this.hls.loadSource(e.src),this.hls.attachMedia(this.video),(f===`fast-first-frame`||l===`fast`)&&(this.hls.autoLevelCapping=this.startupAutoLevelCap),this.hls.on(n.Events.MANIFEST_LOADED,()=>{this.emit(`telemetry`,{name:`manifest_received`,at:Date.now()})}),this.hls.on(n.Events.BUFFER_CREATED,(e,t)=>{this.emit(`telemetry`,{name:`append_queue_created`,at:Date.now(),data:{tracks:Object.keys(t?.tracks||{}),sourceBuffers:this.getSourceBuffers().length}})}),this.hls.on(n.Events.BUFFER_APPENDING,(e,t)=>{let n=this.getSourceBuffers().some(e=>e.updating);(n||this.appendQueueDepth>0)&&(this.appendBackpressureCount+=1,this.appendWaitStartedAt===null&&(this.appendWaitStartedAt=Date.now()),this.emit(`telemetry`,{name:`append_queue_backpressure`,at:Date.now(),data:{queueDepth:this.appendQueueDepth,updating:n,backpressureCount:this.appendBackpressureCount,parent:t?.parent,type:t?.type}})),this.appendQueueDepth+=1,this.emit(`telemetry`,{name:`append_queue_enqueue`,at:Date.now(),data:{queueDepth:this.appendQueueDepth,updating:n,parent:t?.parent,type:t?.type}})}),this.hls.on(n.Events.BUFFER_APPENDED,(e,t)=>{this.appendQueueDepth=Math.max(0,this.appendQueueDepth-1);let n={queueDepth:this.appendQueueDepth,parent:t?.parent,type:t?.type,pending:t?.pending};this.appendQueueDepth===0&&this.appendWaitStartedAt!==null?(n.waitedMs=Date.now()-this.appendWaitStartedAt,n.backpressureCount=this.appendBackpressureCount,this.appendWaitStartedAt=null,this.emit(`telemetry`,{name:`append_queue_wait_cleared`,at:Date.now(),data:n})):this.emit(`telemetry`,{name:`append_queue_appended`,at:Date.now(),data:n}),this.maybeReleaseStartupQualityCap(`append_backpressure_cleared`)}),this.hls.on(n.Events.MANIFEST_PARSED,()=>{this.emit(`telemetry`,{name:`manifest_parse_completed`,at:Date.now()});let e=this.hls?.bandwidthEstimate;typeof e==`number`&&e>0&&(nd=e),p?queueMicrotask(()=>this.syncTracks()):this.syncTracks(),this.cancelPendingLoad=void 0,t()}),this.hls.on(n.Events.FRAG_LOADING,()=>{i||(i=!0,this.emit(`telemetry`,{name:`first_segment_request_started`,at:Date.now()}))}),this.hls.on(n.Events.FRAG_LOADED,()=>{o||(o=!0,this.emit(`telemetry`,{name:`first_segment_received`,at:Date.now()}),this.maybeReleaseStartupQualityCap(`strong_throughput_frag_loaded`))}),this.hls.on(n.Events.FRAG_BUFFERED,()=>{c||(c=!0,d===`high`&&this.hls&&(this.hls.config.maxBufferLength=30,this.hls.config.maxMaxBufferLength=60),this.emit(`telemetry`,{name:`first_append_completed`,at:Date.now()}),this.maybeReleaseStartupQualityCap(`first_append_buffered`))}),this.hls.on(n.Events.LEVEL_SWITCHED,(e,t)=>{this.emit(`qualitychange`,{level:this.hls?.autoLevelEnabled?`auto`:t.level}),this.syncTracks()}),this.hls.on(n.Events.SUBTITLE_TRACK_SWITCH,()=>this.syncTracks()),this.hls.on(n.Events.AUDIO_TRACK_SWITCHED,()=>this.syncTracks()),this.hls.on(n.Events.ERROR,(e,t)=>{if(String(t?.details||``)===`bufferAppendError`&&this.emit(`telemetry`,{name:`append_queue_error`,at:Date.now(),data:{queueDepth:this.appendQueueDepth,updating:this.getSourceBuffers().some(e=>e.updating),backpressureCount:this.appendBackpressureCount,sourceBufferName:t?.sourceBufferName,errorName:t?.error?.name||t?.err?.name||null}}),t.fatal){let e=String(t.details||``).toLowerCase(),i=/^(manifest|level|frag|audioTrack|subtitleTrack)load(error|timeout)$/i.test(e);if(t.type===n.ErrorTypes.NETWORK_ERROR&&i&&![401,403].includes(t.response?.code)&&this.networkRetryCount<this.maxNetworkRetries){this.networkRetryCount+=1,e.includes(`manifest`)&&this.lastSource?this.hls.loadSource(this.lastSource.src):this.hls.startLoad(this.video?.currentTime??-1),this.emit(`error`,{error:{code:`HLS_${String(t.type)}_RETRY`,message:`Retrying network request (${this.networkRetryCount}/${this.maxNetworkRetries})`,engine:this.id,recoverable:!0,originalError:t}});return}if(t.type===n.ErrorTypes.MEDIA_ERROR&&this.mediaRetryCount<this.maxMediaRetries){this.mediaRetryCount+=1;let e=typeof this.hls.currentLevel==`number`?this.hls.currentLevel:-1;e>0&&(this.hls.nextLevel=e-1),this.hls.recoverMediaError(),this.emit(`error`,{error:{code:`HLS_${String(t.type)}_RETRY`,message:`Attempting media recovery (${this.mediaRetryCount}/${this.maxMediaRetries})`,engine:this.id,recoverable:!0,originalError:t}});return}this.hls.destroy(),r(Error(`HLS Error: ${t.details}`)),this.emit(`error`,{error:{code:`HLS_${String(t.type)}`,message:t.details,engine:this.id,recoverable:!1,originalError:t}})}else this.emit(`error`,{error:{code:`HLS_${String(t.type)}`,message:t.details,engine:this.id,recoverable:!0,originalError:t}})})})}}syncTracks(){if(!this.hls)return;let e=this.hls.levels.map((e,t)=>({id:t,label:e.name||`${e.height}p`,bitrate:e.bitrate,width:e.width,height:e.height,selected:this.hls.currentLevel===t})),t=this.hls.subtitleTracks.map((e,t)=>({id:String(t),label:e.name||e.lang||`Track ${t}`,language:e.lang,selected:this.hls.subtitleTrack===t})),n=this.hls.audioTracks.map((e,t)=>({id:String(t),label:e.name||e.lang||`Audio ${t}`,language:e.lang,selected:this.hls.audioTrack===t}));this.emit(`trackschange`,{qualities:e,subtitles:t,audioTracks:n})}rebufferAwareDowngrade(){if(!this.hls)return;let e=Date.now();if(e-this.lastRebufferDowngradeAt<2e3||!this.video||this.video.currentTime<.5)return;let t=this.runtimeConfig.abr.rebufferSafetyBias,n=typeof this.hls.currentLevel==`number`?this.hls.currentLevel:-1;if(!(n>0))return;let r=Math.max(0,n-(t===`high`?2:1));this.hls.nextLevel=r,this.lastRebufferDowngradeAt=e,this.emit(`telemetry`,{name:`abr_rebuffer_downgrade`,at:e,data:{from:n,to:r,bias:t}})}async play(){this.armStartupUpswitchDelay(),await this.video?.play()}pause(){this.video?.pause()}async destroy(){++this.loadVersion,this.cancelPendingLoad?.(),this.cancelPendingLoad=void 0,this.unbindDomEvents(),this.clearStartupUpswitchDelay(),this.resetAppendQueueState(),this.hls&&=(this.hls.destroy(),null),this.video&&(this.video.src=``,this.video.removeAttribute(`src`)),this.video=null,this.listeners.clear()}seek(e){this.video&&(this.video.currentTime=e)}setVolume(e){this.video&&(this.video.volume=e)}setMuted(e){this.video&&(this.video.muted=e)}setPlaybackRate(e){this.video&&(this.video.playbackRate=e)}setQuality(e){this.hls&&(e===`auto`?this.hls.currentLevel=-1:this.hls.currentLevel=Number(e),this.emit(`qualitychange`,{level:e}))}setSubtitle(e){this.hls&&(e===null?(this.hls.subtitleTrack=-1,this.hls.subtitleDisplay=!1):(this.hls.subtitleTrack=Number(e),this.hls.subtitleDisplay=!1))}setAudioTrack(e){this.hls&&(this.hls.audioTrack=Number(e))}on(e,t){let n=e;return this.listeners.has(n)||this.listeners.set(n,[]),this.listeners.get(n).push(t),()=>this.off(e,t)}off(e,t){let n=e,r=this.listeners.get(n);if(!r)return;let i=r.indexOf(t);i>-1&&r.splice(i,1)}emit(e,t){let n=e,r=this.listeners.get(n);if(r)for(let e of[...r])e(t)}getBufferedAheadSeconds(){if(!this.video)return null;let e=this.video.currentTime,t=this.video.buffered;for(let n=0;n<t.length;n+=1){let r=t.start(n),i=t.end(n);if(e>=r-.25&&e<=i+.05)return Math.max(0,i-e)}return 0}getMediaSource(){let e=this.hls?.mediaSource;if(e?.sourceBuffers)return e;let t=this.hls?.bufferController?.mediaSource;return t?.sourceBuffers?t:null}getSourceBuffers(){let e=this.getMediaSource();if(e?.sourceBuffers)return Array.from(e.sourceBuffers);let t=this.hls?.bufferController?.sourceBuffer;return t&&typeof t==`object`?Object.values(t).filter(Boolean):[]}clearStartupUpswitchDelay(){this.startupAutoLevelReleaseTimer!==null&&(window.clearTimeout(this.startupAutoLevelReleaseTimer),this.startupAutoLevelReleaseTimer=null),this.startupAutoLevelCapAppliedAt=null}resetAppendQueueState(){this.appendQueueDepth=0,this.appendWaitStartedAt=null,this.appendBackpressureCount=0}releaseStartupQualityCap(e){if(!this.hls||this.hls.autoLevelCapping===-1)return;let t=Date.now(),n=this.startupAutoLevelCapAppliedAt===null?null:t-this.startupAutoLevelCapAppliedAt;this.clearStartupUpswitchDelay(),this.hls.autoLevelCapping=-1,this.emit(`telemetry`,{name:`startup_quality_cap_released`,at:t,data:{reason:e,heldMs:n}})}maybeReleaseStartupQualityCap(e){if(!this.hls||this.hls.autoLevelCapping===-1||(this.startupAutoLevelCapAppliedAt===null?0:Date.now()-this.startupAutoLevelCapAppliedAt)<1200)return;let t=this.hls.bandwidthEstimate;if(typeof t!=`number`||!Number.isFinite(t)||t<=0)return;let n=typeof this.hls.currentLevel==`number`&&this.hls.currentLevel>=0?this.hls.currentLevel:this.startupAutoLevelCap,r=this.hls.levels?.[n]?.bitrate,i=this.getBufferedAheadSeconds()??0;(typeof r==`number`&&t>=r*2.5||t>=6e6)&&i>=1.2&&this.releaseStartupQualityCap(e)}armStartupUpswitchDelay(){if(!this.hls)return;let e=this.runtimeConfig.abr.startupProfile;this.runtimeConfig.performance.startupMode!==`fast-first-frame`&&e!==`fast`||(this.clearStartupUpswitchDelay(),this.hls.autoLevelCapping=this.startupAutoLevelCap,this.startupAutoLevelCapAppliedAt=Date.now(),this.emit(`telemetry`,{name:`startup_quality_cap_applied`,at:this.startupAutoLevelCapAppliedAt,data:{levelCap:this.startupAutoLevelCap}}),this.startupAutoLevelReleaseTimer=window.setTimeout(()=>{this.releaseStartupQualityCap(`timeout`)},8e3))}}})),ad=r({HlsEngine:()=>rd}),od=n((()=>{id()})),sd=r({Constants:()=>wd,Debug:()=>Td,ExternalSubtitle:()=>Ed,MediaPlayer:()=>Dd,MediaPlayerFactory:()=>Od,MetricsReporting:()=>kd,Protection:()=>Ad,default:()=>jd,supportsMediaSource:()=>Md});function cd(e){var t=ud[e];if(t!==void 0)return t.exports;var n=ud[e]={exports:{}};return ld[e].call(n.exports,n,n.exports,cd),n.exports}var ld,ud,dd,fd,pd,md,hd,gd,_d,vd,yd,bd,xd,Sd,Cd,wd,Td,Ed,Dd,Od,kd,Ad,jd,Md,Nd=n((()=>{ld={7267:function(e,t){t.byteLength=function(e){var t=l(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,o=l(e),c=o[0],u=o[1],d=new i(function(e,t,n){return 3*(t+n)/4-n}(0,c,u)),f=0,p=u>0?c-4:c;for(n=0;n<p;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],d[f++]=t>>16&255,d[f++]=t>>8&255,d[f++]=255&t;return u===2&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,d[f++]=255&t),u===1&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,d[f++]=t>>8&255,d[f++]=255&t),d},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],c=16383,l=0,d=r-i;l<d;l+=c)o.push(u(e,l,l+c>d?d:l+c));return i===1?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+`==`)):i===2&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+`=`)),o.join(``)};for(var n=[],r=[],i=typeof Uint8Array<`u`?Uint8Array:Array,o=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,c=0;c<64;++c)n[c]=o[c],r[o.charCodeAt(c)]=c;function l(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);return n===-1&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,r){for(var i,o,c=[],l=t;l<r;l+=3)i=(e[l]<<16&16711680)+(e[l+1]<<8&65280)+(255&e[l+2]),c.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return c.join(``)}r[45]=62,r[95]=63},44:function(e,t,n){var r=n(7267),i=n(7986),o=typeof Symbol==`function`&&typeof Symbol.for==`function`?Symbol.for(`nodejs.util.inspect.custom`):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;var c=2147483647;function l(e){if(e>c)throw RangeError(`The value "`+e+`" is invalid for option "size"`);var t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,n){if(typeof e==`number`){if(typeof t==`string`)throw TypeError(`The "string" argument must be of type string. Received type number`);return p(e)}return d(e,t,n)}function d(e,t,n){if(typeof e==`string`)return function(e,t){if(typeof t==`string`&&t!==``||(t=`utf8`),!u.isEncoding(t))throw TypeError(`Unknown encoding: `+t);var n=0|_(e,t),r=l(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(U(e,Uint8Array)){var t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return m(e)}(e);if(e==null)throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e);if(U(e,ArrayBuffer)||e&&U(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<`u`&&(U(e,SharedArrayBuffer)||e&&U(e.buffer,SharedArrayBuffer)))return h(e,t,n);if(typeof e==`number`)throw TypeError(`The "value" argument must not be of type number. Received type number`);var r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return u.from(r,t,n);var i=function(e){if(u.isBuffer(e)){var t=0|g(e.length),n=l(t);return n.length===0||e.copy(n,0,0,t),n}return e.length===void 0?e.type===`Buffer`&&Array.isArray(e.data)?m(e.data):void 0:typeof e.length!=`number`||W(e.length)?l(0):m(e)}(e);if(i)return i;if(typeof Symbol<`u`&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]==`function`)return u.from(e[Symbol.toPrimitive](`string`),t,n);throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e)}function f(e){if(typeof e!=`number`)throw TypeError(`"size" argument must be of type number`);if(e<0)throw RangeError(`The value "`+e+`" is invalid for option "size"`)}function p(e){return f(e),l(e<0?0:0|g(e))}function m(e){for(var t=e.length<0?0:0|g(e.length),n=l(t),r=0;r<t;r+=1)n[r]=255&e[r];return n}function h(e,t,n){if(t<0||e.byteLength<t)throw RangeError(`"offset" is outside of buffer bounds`);if(e.byteLength<t+(n||0))throw RangeError(`"length" is outside of buffer bounds`);var r;return r=t===void 0&&n===void 0?new Uint8Array(e):n===void 0?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,u.prototype),r}function g(e){if(e>=c)throw RangeError(`Attempt to allocate Buffer larger than maximum size: 0x`+c.toString(16)+` bytes`);return 0|e}function _(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||U(e,ArrayBuffer))return e.byteLength;if(typeof e!=`string`)throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type `+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&n===0)return 0;for(var i=!1;;)switch(t){case`ascii`:case`latin1`:case`binary`:return n;case`utf8`:case`utf-8`:return B(e).length;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return 2*n;case`hex`:return n>>>1;case`base64`:return V(e).length;default:if(i)return r?-1:B(e).length;t=(``+t).toLowerCase(),i=!0}}function v(e,t,n){var r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0)<=(t>>>=0))return``;for(e||=`utf8`;;)switch(e){case`hex`:return M(this,t,n);case`utf8`:case`utf-8`:return O(this,t,n);case`ascii`:return A(this,t,n);case`latin1`:case`binary`:return j(this,t,n);case`base64`:return D(this,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return N(this,t,n);default:if(r)throw TypeError(`Unknown encoding: `+e);e=(e+``).toLowerCase(),r=!0}}function y(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,i){if(e.length===0)return-1;if(typeof n==`string`?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),W(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if(typeof t==`string`&&(t=u.from(t,r)),u.isBuffer(t))return t.length===0?-1:x(e,t,n,r,i);if(typeof t==`number`)return t&=255,typeof Uint8Array.prototype.indexOf==`function`?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):x(e,[t],n,r,i);throw TypeError(`val must be string, number or Buffer`)}function x(e,t,n,r,i){var o,c=1,l=e.length,u=t.length;if(r!==void 0&&((r=String(r).toLowerCase())===`ucs2`||r===`ucs-2`||r===`utf16le`||r===`utf-16le`)){if(e.length<2||t.length<2)return-1;c=2,l/=2,u/=2,n/=2}function d(e,t){return c===1?e[t]:e.readUInt16BE(t*c)}if(i){var f=-1;for(o=n;o<l;o++)if(d(e,o)===d(t,f===-1?0:o-f)){if(f===-1&&(f=o),o-f+1===u)return f*c}else f!==-1&&(o-=o-f),f=-1}else for(n+u>l&&(n=l-u),o=n;o>=0;o--){for(var p=!0,m=0;m<u;m++)if(d(e,o+m)!==d(t,m)){p=!1;break}if(p)return o}return-1}function S(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;r>o/2&&(r=o/2);for(var c=0;c<r;++c){var l=parseInt(t.substr(2*c,2),16);if(W(l))return c;e[n+c]=l}return c}function C(e,t,n,r){return H(B(t,e.length-n),e,n,r)}function w(e,t,n,r){return H(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function T(e,t,n,r){return H(V(t),e,n,r)}function E(e,t,n,r){return H(function(e,t){for(var n,r,i,o=[],c=0;c<e.length&&!((t-=2)<0);++c)r=(n=e.charCodeAt(c))>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function D(e,t,n){return t===0&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function O(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,c,l,u,d=e[i],f=null,p=d>239?4:d>223?3:d>191?2:1;if(i+p<=n)switch(p){case 1:d<128&&(f=d);break;case 2:(192&(o=e[i+1]))==128&&(u=(31&d)<<6|63&o)>127&&(f=u);break;case 3:o=e[i+1],c=e[i+2],(192&o)==128&&(192&c)==128&&(u=(15&d)<<12|(63&o)<<6|63&c)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=e[i+1],c=e[i+2],l=e[i+3],(192&o)==128&&(192&c)==128&&(192&l)==128&&(u=(15&d)<<18|(63&o)<<12|(63&c)<<6|63&l)>65535&&u<1114112&&(f=u)}f===null?(f=65533,p=1):f>65535&&(f-=65536,r.push(f>>>10&1023|55296),f=56320|1023&f),r.push(f),i+=p}return function(e){var t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);for(var n=``,r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=k));return n}(r)}t.kMaxLength=c,u.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}(),u.TYPED_ARRAY_SUPPORT||typeof console>`u`||typeof console.error!=`function`||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,`parent`,{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,`offset`,{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,n){return d(e,t,n)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,n){return function(e,t,n){return f(e),e<=0||t===void 0?l(e):typeof n==`string`?l(e).fill(t,n):l(e).fill(t)}(e,t,n)},u.allocUnsafe=function(e){return p(e)},u.allocUnsafeSlow=function(e){return p(e)},u.isBuffer=function(e){return e!=null&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(U(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),U(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw TypeError(`The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array`);if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:+(r<n)},u.isEncoding=function(e){switch(String(e).toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`latin1`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw TypeError(`"list" argument must be an Array of Buffers`);if(e.length===0)return u.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=u.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(U(o,Uint8Array))i+o.length>r.length?u.from(o).copy(r,i):Uint8Array.prototype.set.call(r,o,i);else{if(!u.isBuffer(o))throw TypeError(`"list" argument must be an Array of Buffers`);o.copy(r,i)}i+=o.length}return r},u.byteLength=_,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(var t=0;t<e;t+=2)y(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(var t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(var t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},u.prototype.toString=function(){var e=this.length;return e===0?``:arguments.length===0?O(this,0,e):v.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw TypeError(`Argument must be a Buffer`);return this===e||u.compare(this,e)===0},u.prototype.inspect=function(){var e=``,n=t.INSPECT_MAX_BYTES;return e=this.toString(`hex`,0,n).replace(/(.{2})/g,`$1 `).trim(),this.length>n&&(e+=` ... `),`<Buffer `+e+`>`},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,n,r,i){if(U(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw TypeError(`The "target" argument must be one of type Buffer or Uint8Array. Received type `+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError(`out of range index`);if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),c=(n>>>=0)-(t>>>=0),l=Math.min(o,c),d=this.slice(r,i),f=e.slice(t,n),p=0;p<l;++p)if(d[p]!==f[p]){o=d[p],c=f[p];break}return o<c?-1:+(c<o)},u.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},u.prototype.indexOf=function(e,t,n){return b(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return b(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(t===void 0)r=`utf8`,n=this.length,t=0;else if(n===void 0&&typeof t==`string`)r=t,n=this.length,t=0;else{if(!isFinite(t))throw Error(`Buffer.write(string, encoding, offset[, length]) is no longer supported`);t>>>=0,isFinite(n)?(n>>>=0,r===void 0&&(r=`utf8`)):(r=n,n=void 0)}var i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError(`Attempt to write outside buffer bounds`);r||=`utf8`;for(var o=!1;;)switch(r){case`hex`:return S(this,e,t,n);case`utf8`:case`utf-8`:return C(this,e,t,n);case`ascii`:case`latin1`:case`binary`:return w(this,e,t,n);case`base64`:return T(this,e,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return E(this,e,t,n);default:if(o)throw TypeError(`Unknown encoding: `+r);r=(``+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function A(e,t,n){var r=``;n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function j(e,t,n){var r=``;n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function M(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i=``,o=t;o<n;++o)i+=G[e[o]];return i}function N(e,t,n){for(var r=e.slice(t,n),i=``,o=0;o<r.length-1;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function P(e,t,n){if(e%1!=0||e<0)throw RangeError(`offset is not uint`);if(e+t>n)throw RangeError(`Trying to access beyond buffer length`)}function F(e,t,n,r,i,o){if(!u.isBuffer(e))throw TypeError(`"buffer" argument must be a Buffer instance`);if(t>i||t<o)throw RangeError(`"value" argument is out of bounds`);if(n+r>e.length)throw RangeError(`Index out of range`)}function I(e,t,n,r,i,o){if(n+r>e.length||n<0)throw RangeError(`Index out of range`)}function L(e,t,n,r,o){return t=+t,n>>>=0,o||I(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function R(e,t,n,r,o){return t=+t,n>>>=0,o||I(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=t===void 0?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);var r=this.subarray(e,t);return Object.setPrototypeOf(r,u.prototype),r},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=2**(8*t)),r},u.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=2**(8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||P(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){e>>>=0,t||P(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return e>>>=0,t||P(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||P(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||P(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||P(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||F(this,e,t,n,2**(8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||F(this,e,t,n,2**(8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=2**(8*n-1);F(this,e,t,n,i-1,-i)}var o=0,c=1,l=0;for(this[t]=255&e;++o<n&&(c*=256);)e<0&&l===0&&this[t+o-1]!==0&&(l=1),this[t+o]=(e/c|0)-l&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=2**(8*n-1);F(this,e,t,n,i-1,-i)}var o=n-1,c=1,l=0;for(this[t+o]=255&e;--o>=0&&(c*=256);)e<0&&l===0&&this[t+o+1]!==0&&(l=1),this[t+o]=(e/c|0)-l&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeFloatLE=function(e,t,n){return L(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return L(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return R(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return R(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(!u.isBuffer(e))throw TypeError(`argument should be a Buffer`);if(n||=0,r||r===0||(r=this.length),t>=e.length&&(t=e.length),t||=0,r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(t<0)throw RangeError(`targetStart out of bounds`);if(n<0||n>=this.length)throw RangeError(`Index out of range`);if(r<0)throw RangeError(`sourceEnd out of bounds`);r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i=r-n;return this===e&&typeof Uint8Array.prototype.copyWithin==`function`?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},u.prototype.fill=function(e,t,n,r){if(typeof e==`string`){if(typeof t==`string`?(r=t,t=0,n=this.length):typeof n==`string`&&(r=n,n=this.length),r!==void 0&&typeof r!=`string`)throw TypeError(`encoding must be a string`);if(typeof r==`string`&&!u.isEncoding(r))throw TypeError(`Unknown encoding: `+r);if(e.length===1){var i=e.charCodeAt(0);(r===`utf8`&&i<128||r===`latin1`)&&(e=i)}}else typeof e==`number`?e&=255:typeof e==`boolean`&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError(`Out of range index`);if(n<=t)return this;var o;if(t>>>=0,n=n===void 0?this.length:n>>>0,e||=0,typeof e==`number`)for(o=t;o<n;++o)this[o]=e;else{var c=u.isBuffer(e)?e:u.from(e,r),l=c.length;if(l===0)throw TypeError(`The value "`+e+`" is invalid for argument "value"`);for(o=0;o<n-t;++o)this[o+t]=c[o%l]}return this};var z=/[^+/0-9A-Za-z-_]/g;function B(e,t){var n;t||=1/0;for(var r=e.length,i=null,o=[],c=0;c<r;++c){if((n=e.charCodeAt(c))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(c+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if(--t<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw Error(`Invalid code point`);if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function V(e){return r.toByteArray(function(e){if((e=(e=e.split(`=`)[0]).trim().replace(z,``)).length<2)return``;for(;e.length%4!=0;)e+=`=`;return e}(e))}function H(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function U(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function W(e){return e!=e}var G=function(){for(var e=`0123456789abcdef`,t=Array(256),n=0;n<16;++n)for(var r=16*n,i=0;i<16;++i)t[r+i]=e[n]+e[i];return t}()},6877:function(e,t){var n={parseBuffer:function(e){return new r(e).parse()},addBoxProcessor:function(e,t){typeof e==`string`&&typeof t==`function`&&(i.prototype._boxProcessors[e]=t)},createFile:function(){return new r},createBox:function(e,t,n){var r=i.create(e);return t&&t.append(r,n),r},createFullBox:function(e,t,r){var i=n.createBox(e,t,r);return i.version=0,i.flags=0,i},Utils:{}};n.Utils.dataViewToString=function(e,t){var n=t||`utf-8`;if(typeof TextDecoder<`u`)return new TextDecoder(n).decode(e);var r=[],i=0;if(n===`utf-8`)for(;i<e.byteLength;){var o=e.getUint8(i++);o<128||(o<224?(o=(31&o)<<6,o|=63&e.getUint8(i++)):o<240?(o=(15&o)<<12,o|=(63&e.getUint8(i++))<<6,o|=63&e.getUint8(i++)):(o=(7&o)<<18,o|=(63&e.getUint8(i++))<<12,o|=(63&e.getUint8(i++))<<6,o|=63&e.getUint8(i++))),r.push(String.fromCharCode(o))}else for(;i<e.byteLength;)r.push(String.fromCharCode(e.getUint8(i++)));return r.join(``)},n.Utils.utf8ToByteArray=function(e){var t,n;if(typeof TextEncoder<`u`)t=new TextEncoder().encode(e);else for(t=[],n=0;n<e.length;++n){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?(t.push(192|r>>6),t.push(128|63&r)):r<65536?(t.push(224|r>>12),t.push(128|63&r>>6),t.push(128|63&r)):(t.push(240|r>>18),t.push(128|63&r>>12),t.push(128|63&r>>6),t.push(128|63&r))}return t},n.Utils.appendBox=function(e,t,n){if(t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,n!==-1)if(n!=null){var r,i=-1;if(typeof n==`number`)i=n;else{if(typeof n==`string`)r=n;else{if(typeof n!=`object`||!n.type)return void e.boxes.push(t);r=n.type}for(var o=0;o<e.boxes.length;o++)if(r===e.boxes[o].type){i=o+1;break}}e.boxes.splice(i,0,t)}else e.boxes.push(t)},t.parseBuffer=n.parseBuffer,t.addBoxProcessor=n.addBoxProcessor,t.createFile=n.createFile,t.createBox=n.createBox,t.createFullBox=n.createFullBox,t.Utils=n.Utils,n.Cursor=function(e){this.offset=e===void 0?0:e};var r=function(e){this._cursor=new n.Cursor,this.boxes=[],e&&(this._raw=new DataView(e))};r.prototype.fetch=function(e){var t=this.fetchAll(e,!0);return t.length?t[0]:null},r.prototype.fetchAll=function(e,t){var n=[];return r._sweep.call(this,e,n,t),n},r.prototype.parse=function(){for(this._cursor.offset=0,this.boxes=[];this._cursor.offset<this._raw.byteLength;){var e=i.parse(this);if(e.type===void 0)break;this.boxes.push(e)}return this},r._sweep=function(e,t,n){for(var i in this.type&&this.type==e&&t.push(this),this.boxes){if(t.length&&n)return;r._sweep.call(this.boxes[i],e,t,n)}},r.prototype.write=function(){var e,t=0;for(e=0;e<this.boxes.length;e++)t+=this.boxes[e].getLength(!1);var n=new Uint8Array(t);for(this._rawo=new DataView(n.buffer),this.bytes=n,this._cursor.offset=0,e=0;e<this.boxes.length;e++)this.boxes[e].write();return n.buffer},r.prototype.append=function(e,t){n.Utils.appendBox(this,e,t)};var i=function(){this._cursor=new n.Cursor};i.parse=function(e){var t=new i;return t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,t._parseBox(),e._cursor.offset=t._raw.byteOffset+t._raw.byteLength,t},i.create=function(e){var t=new i;return t.type=e,t.boxes=[],t},i.prototype._boxContainers=[`dinf`,`edts`,`mdia`,`meco`,`mfra`,`minf`,`moof`,`moov`,`mvex`,`stbl`,`strk`,`traf`,`trak`,`tref`,`udta`,`vttc`,`sinf`,`schi`,`encv`,`enca`,`meta`,`grpl`,`prsl`],i.prototype._boxProcessors={},i.prototype._procField=function(e,t,n){this._parsing?this[e]=this._readField(t,n):this._writeField(t,n,this[e])},i.prototype._procFieldArray=function(e,t,n,r){var i;if(this._parsing)for(this[e]=[],i=0;i<t;i++)this[e][i]=this._readField(n,r);else for(i=0;i<this[e].length;i++)this._writeField(n,r,this[e][i])},i.prototype._procFullBox=function(){this._procField(`version`,`uint`,8),this._procField(`flags`,`uint`,24)},i.prototype._procEntries=function(e,t,n){var r;if(this._parsing)for(this[e]=[],r=0;r<t;r++)this[e].push({}),n.call(this,this[e][r]);else for(r=0;r<t;r++)n.call(this,this[e][r])},i.prototype._procSubEntries=function(e,t,n,r){var i;if(this._parsing)for(e[t]=[],i=0;i<n;i++)e[t].push({}),r.call(this,e[t][i]);else for(i=0;i<n;i++)r.call(this,e[t][i])},i.prototype._procEntryField=function(e,t,n,r){this._parsing?e[t]=this._readField(n,r):this._writeField(n,r,e[t])},i.prototype._procSubBoxes=function(e,t){var n;if(this._parsing)for(this[e]=[],n=0;n<t;n++)this[e].push(i.parse(this));else for(n=0;n<t;n++)this._rawo?this[e][n].write():this.size+=this[e][n].getLength()},i.prototype._readField=function(e,t){switch(e){case`uint`:return this._readUint(t);case`int`:return this._readInt(t);case`template`:return this._readTemplate(t);case`string`:return t===-1?this._readTerminatedString():this._readString(t);case`data`:return this._readData(t);case`utf8`:return this._readUTF8String();case`utf8string`:return this._readUTF8TerminatedString();default:return-1}},i.prototype._readInt=function(e){var t=null,n=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:t=this._raw.getInt8(n);break;case 16:t=this._raw.getInt16(n);break;case 32:t=this._raw.getInt32(n);break;case 64:var r=this._raw.getInt32(n),i=this._raw.getInt32(n+4);t=r*2**32+i}return this._cursor.offset+=e>>3,t},i.prototype._readUint=function(e){var t,n,r=null,i=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:r=this._raw.getUint8(i);break;case 16:r=this._raw.getUint16(i);break;case 24:r=((t=this._raw.getUint16(i))<<8)+(n=this._raw.getUint8(i+2));break;case 32:r=this._raw.getUint32(i);break;case 64:t=this._raw.getUint32(i),n=this._raw.getUint32(i+4),r=t*2**32+n}return this._cursor.offset+=e>>3,r},i.prototype._readString=function(e){for(var t=``,n=0;n<e;n++){var r=this._readUint(8);t+=String.fromCharCode(r)}return t},i.prototype._readTemplate=function(e){return this._readUint(e/2)+this._readUint(e/2)/2**(e/2)},i.prototype._readTerminatedString=function(){for(var e=``;this._cursor.offset-this._offset<this._raw.byteLength;){var t=this._readUint(8);if(t===0)break;e+=String.fromCharCode(t)}return e},i.prototype._readData=function(e){var t=e>0?e:this._raw.byteLength-(this._cursor.offset-this._offset);if(t>0){var n=new Uint8Array(this._raw.buffer,this._cursor.offset,t);return this._cursor.offset+=t,n}return null},i.prototype._readUTF8String=function(){var e=this._raw.byteLength-(this._cursor.offset-this._offset),t=null;return e>0&&(t=new DataView(this._raw.buffer,this._cursor.offset,e),this._cursor.offset+=e),t&&n.Utils.dataViewToString(t)},i.prototype._readUTF8TerminatedString=function(){var e=this._raw.byteLength-(this._cursor.offset-this._offset),t=null;if(e>0){var r;for(t=new DataView(this._raw.buffer,this._cursor.offset,e),r=0;r<e&&t.getUint8(r)!==0;r++);t=new DataView(this._raw.buffer,this._cursor.offset,r),this._cursor.offset+=Math.min(r+1,e)}return t&&n.Utils.dataViewToString(t)},i.prototype._parseBox=function(){if(this._parsing=!0,this._cursor.offset=this._offset,this._offset+8>this._raw.buffer.byteLength)this._root._incomplete=!0;else{switch(this._procField(`size`,`uint`,32),this._procField(`type`,`string`,4),this.size===1&&this._procField(`largesize`,`uint`,64),this.type===`uuid`&&this._procFieldArray(`usertype`,16,`uint`,8),this.size){case 0:this._raw=new DataView(this._raw.buffer,this._offset);break;case 1:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.largesize);break;default:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.size)}this._incomplete||(this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),this._boxContainers.indexOf(this.type)===-1?this._data=this._readData():this._parseContainerBox())}},i.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},i.prototype._parseContainerBox=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(i.parse(this))},i.prototype.append=function(e,t){n.Utils.appendBox(this,e,t)},i.prototype.getLength=function(){if(this._parsing=!1,this._rawo=null,this.size=0,this._procField(`size`,`uint`,32),this._procField(`type`,`string`,4),this.size===1&&this._procField(`largesize`,`uint`,64),this.type===`uuid`&&this._procFieldArray(`usertype`,16,`uint`,8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),this._boxContainers.indexOf(this.type)!==-1)for(var e=0;e<this.boxes.length;e++)this.size+=this.boxes[e].getLength();return this._data&&this._writeData(this._data),this.size},i.prototype.write=function(){switch(this._parsing=!1,this._cursor.offset=this._parent._cursor.offset,this.size){case 0:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.parent._rawo.byteLength-this._cursor.offset);break;case 1:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.largesize);break;default:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.size)}if(this._procField(`size`,`uint`,32),this._procField(`type`,`string`,4),this.size===1&&this._procField(`largesize`,`uint`,64),this.type===`uuid`&&this._procFieldArray(`usertype`,16,`uint`,8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),this._boxContainers.indexOf(this.type)!==-1)for(var e=0;e<this.boxes.length;e++)this.boxes[e].write();return this._data&&this._writeData(this._data),this._parent._cursor.offset+=this.size,this.size},i.prototype._writeInt=function(e,t){if(this._rawo){var n=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setInt8(n,t);break;case 16:this._rawo.setInt16(n,t);break;case 32:this._rawo.setInt32(n,t);break;case 64:var r=Math.floor(t/2**32),i=t-r*2**32;this._rawo.setUint32(n,r),this._rawo.setUint32(n+4,i)}this._cursor.offset+=e>>3}else this.size+=e>>3},i.prototype._writeUint=function(e,t){if(this._rawo){var n,r,i=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setUint8(i,t);break;case 16:this._rawo.setUint16(i,t);break;case 24:n=(16776960&t)>>8,r=255&t,this._rawo.setUint16(i,n),this._rawo.setUint8(i+2,r);break;case 32:this._rawo.setUint32(i,t);break;case 64:r=t-(n=Math.floor(t/2**32))*2**32,this._rawo.setUint32(i,n),this._rawo.setUint32(i+4,r)}this._cursor.offset+=e>>3}else this.size+=e>>3},i.prototype._writeString=function(e,t){for(var n=0;n<e;n++)this._writeUint(8,t.charCodeAt(n))},i.prototype._writeTerminatedString=function(e){if(e.length!==0){for(var t=0;t<e.length;t++)this._writeUint(8,e.charCodeAt(t));this._writeUint(8,0)}},i.prototype._writeTemplate=function(e,t){var n=Math.floor(t),r=(t-n)*2**(e/2);this._writeUint(e/2,n),this._writeUint(e/2,r)},i.prototype._writeData=function(e){if(e)if(this._rawo){if(e instanceof Array){for(var t=this._cursor.offset-this._rawo.byteOffset,n=0;n<e.length;n++)this._rawo.setInt8(t+n,e[n]);this._cursor.offset+=e.length}e instanceof Uint8Array&&(this._root.bytes.set(e,this._cursor.offset),this._cursor.offset+=e.length)}else this.size+=e.length},i.prototype._writeUTF8String=function(e){var t=n.Utils.utf8ToByteArray(e);if(this._rawo)for(var r=new DataView(this._rawo.buffer,this._cursor.offset,t.length),i=0;i<t.length;i++)r.setUint8(i,t[i]);else this.size+=t.length},i.prototype._writeField=function(e,t,n){switch(e){case`uint`:this._writeUint(t,n);break;case`int`:this._writeInt(t,n);break;case`template`:this._writeTemplate(t,n);break;case`string`:t==-1?this._writeTerminatedString(n):this._writeString(t,n);break;case`data`:this._writeData(n);break;case`utf8`:this._writeUTF8String(n)}},i.prototype._boxProcessors.ardi=function(){this._procFullBox(),this._procField(`audio_rendering_indication`,`uint`,8)},i.prototype._boxProcessors.avc1=i.prototype._boxProcessors.avc2=i.prototype._boxProcessors.avc3=i.prototype._boxProcessors.avc4=i.prototype._boxProcessors.hvc1=i.prototype._boxProcessors.hev1=i.prototype._boxProcessors.encv=function(){this._procFieldArray(`reserved1`,6,`uint`,8),this._procField(`data_reference_index`,`uint`,16),this._procField(`pre_defined1`,`uint`,16),this._procField(`reserved2`,`uint`,16),this._procFieldArray(`pre_defined2`,3,`uint`,32),this._procField(`width`,`uint`,16),this._procField(`height`,`uint`,16),this._procField(`horizresolution`,`template`,32),this._procField(`vertresolution`,`template`,32),this._procField(`reserved3`,`uint`,32),this._procField(`frame_count`,`uint`,16),this._procFieldArray(`compressorname`,32,`uint`,8),this._procField(`depth`,`uint`,16),this._procField(`pre_defined3`,`int`,16),this._procField(`config`,`data`,-1)},i.prototype._boxProcessors.ctts=function(){this._procFullBox(),this._procField(`entry_count`,`uint`,32),this._procEntries(`entries`,this.entry_count,(function(e){this._procEntryField(e,`sample_count`,`uint`,32),this._procEntryField(e,`sample_offset`,this.version===1?`int`:`uint`,32)}))},i.prototype._boxProcessors.dref=function(){this._procFullBox(),this._procField(`entry_count`,`uint`,32),this._procSubBoxes(`entries`,this.entry_count)},i.prototype._boxProcessors.elng=function(){this._procFullBox(),this._procField(`extended_language`,`utf8string`)},i.prototype._boxProcessors.elst=function(){this._procFullBox(),this._procField(`entry_count`,`uint`,32),this._procEntries(`entries`,this.entry_count,(function(e){this._procEntryField(e,`segment_duration`,`uint`,this.version===1?64:32),this._procEntryField(e,`media_time`,`int`,this.version===1?64:32),this._procEntryField(e,`media_rate_integer`,`int`,16),this._procEntryField(e,`media_rate_fraction`,`int`,16)}))},i.prototype._boxProcessors.emsg=function(){this._procFullBox(),this.version==1?(this._procField(`timescale`,`uint`,32),this._procField(`presentation_time`,`uint`,64),this._procField(`event_duration`,`uint`,32),this._procField(`id`,`uint`,32),this._procField(`scheme_id_uri`,`string`,-1),this._procField(`value`,`string`,-1)):(this._procField(`scheme_id_uri`,`string`,-1),this._procField(`value`,`string`,-1),this._procField(`timescale`,`uint`,32),this._procField(`presentation_time_delta`,`uint`,32),this._procField(`event_duration`,`uint`,32),this._procField(`id`,`uint`,32)),this._procField(`message_data`,`data`,-1)},i.prototype._boxProcessors.free=i.prototype._boxProcessors.skip=function(){this._procField(`data`,`data`,-1)},i.prototype._boxProcessors.frma=function(){this._procField(`data_format`,`uint`,32)},i.prototype._boxProcessors.ftyp=i.prototype._boxProcessors.styp=function(){this._procField(`major_brand`,`string`,4),this._procField(`minor_version`,`uint`,32);var e=-1;this._parsing&&(e=(this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset))/4),this._procFieldArray(`compatible_brands`,e,`string`,4)},i.prototype._boxProcessors.hdlr=function(){this._procFullBox(),this._procField(`pre_defined`,`uint`,32),this._procField(`handler_type`,`string`,4),this._procFieldArray(`reserved`,3,`uint`,32),this._procField(`name`,`string`,-1)},i.prototype._boxProcessors.imda=function(){this._procField(`imda_identifier`,`uint`,32),this._procField(`data`,`data`,-1)},i.prototype._boxProcessors.kind=function(){this._procFullBox(),this._procField(`schemeURI`,`utf8string`),this._procField(`value`,`utf8string`)},i.prototype._boxProcessors.labl=function(){this._procFullBox(),this.is_group_label=!!(1&this.flags),this._procField(`label_id`,`uint`,16),this._procField(`language`,`utf8string`),this._procField(`label`,`utf8string`)},i.prototype._boxProcessors.mdat=function(){this._procField(`data`,`data`,-1)},i.prototype._boxProcessors.mdhd=function(){this._procFullBox(),this._procField(`creation_time`,`uint`,this.version==1?64:32),this._procField(`modification_time`,`uint`,this.version==1?64:32),this._procField(`timescale`,`uint`,32),this._procField(`duration`,`uint`,this.version==1?64:32),this._parsing||typeof this.language!=`string`||(this.language=this.language.charCodeAt(0)-96<<10|this.language.charCodeAt(1)-96<<5|this.language.charCodeAt(2)-96),this._procField(`language`,`uint`,16),this._parsing&&(this.language=String.fromCharCode(96+(this.language>>10&31),96+(this.language>>5&31),96+(31&this.language))),this._procField(`pre_defined`,`uint`,16)},i.prototype._boxProcessors.mehd=function(){this._procFullBox(),this._procField(`fragment_duration`,`uint`,this.version==1?64:32)},i.prototype._boxProcessors.meta=function(){this._procFullBox()},i.prototype._boxProcessors.mfhd=function(){this._procFullBox(),this._procField(`sequence_number`,`uint`,32)},i.prototype._boxProcessors.mfro=function(){this._procFullBox(),this._procField(`mfra_size`,`uint`,32)},i.prototype._boxProcessors.mp4a=i.prototype._boxProcessors.enca=function(){this._procFieldArray(`reserved1`,6,`uint`,8),this._procField(`data_reference_index`,`uint`,16),this._procFieldArray(`reserved2`,2,`uint`,32),this._procField(`channelcount`,`uint`,16),this._procField(`samplesize`,`uint`,16),this._procField(`pre_defined`,`uint`,16),this._procField(`reserved3`,`uint`,16),this._procField(`samplerate`,`template`,32),this._procField(`esds`,`data`,-1)},i.prototype._boxProcessors.mvhd=function(){this._procFullBox(),this._procField(`creation_time`,`uint`,this.version==1?64:32),this._procField(`modification_time`,`uint`,this.version==1?64:32),this._procField(`timescale`,`uint`,32),this._procField(`duration`,`uint`,this.version==1?64:32),this._procField(`rate`,`template`,32),this._procField(`volume`,`template`,16),this._procField(`reserved1`,`uint`,16),this._procFieldArray(`reserved2`,2,`uint`,32),this._procFieldArray(`matrix`,9,`template`,32),this._procFieldArray(`pre_defined`,6,`uint`,32),this._procField(`next_track_ID`,`uint`,32)},i.prototype._boxProcessors.payl=function(){this._procField(`cue_text`,`utf8`)},i.prototype._boxProcessors.prft=function(){this._procFullBox(),this._procField(`reference_track_ID`,`uint`,32),this._procField(`ntp_timestamp_sec`,`uint`,32),this._procField(`ntp_timestamp_frac`,`uint`,32),this._procField(`media_time`,`uint`,this.version==1?64:32)},i.prototype._boxProcessors.prsl=function(){this._procFullBox(),this._procField(`group_id`,`uint`,32),this._procField(`num_entities_in_group`,`uint`,32),this._procEntries(`entities`,this.num_entities_in_group,(function(e){this._procEntryField(e,`entity_id`,`uint`,32)})),4096&this.flags&&this._procField(`preselection_tag`,`utf8string`),8192&this.flags&&this._procField(`selection_priority`,`uint`,8),16384&this.flags&&this._procField(`interleaving_tag`,`utf8string`)},i.prototype._boxProcessors.pssh=function(){this._procFullBox(),this._procFieldArray(`SystemID`,16,`uint`,8),this._procField(`DataSize`,`uint`,32),this._procFieldArray(`Data`,this.DataSize,`uint`,8)},i.prototype._boxProcessors.schm=function(){this._procFullBox(),this._procField(`scheme_type`,`uint`,32),this._procField(`scheme_version`,`uint`,32),1&this.flags&&this._procField(`scheme_uri`,`string`,-1)},i.prototype._boxProcessors.sdtp=function(){this._procFullBox();var e=-1;this._parsing&&(e=this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset)),this._procFieldArray(`sample_dependency_table`,e,`uint`,8)},i.prototype._boxProcessors.sidx=function(){this._procFullBox(),this._procField(`reference_ID`,`uint`,32),this._procField(`timescale`,`uint`,32),this._procField(`earliest_presentation_time`,`uint`,this.version==1?64:32),this._procField(`first_offset`,`uint`,this.version==1?64:32),this._procField(`reserved`,`uint`,16),this._procField(`reference_count`,`uint`,16),this._procEntries(`references`,this.reference_count,(function(e){this._parsing||(e.reference=(1&e.reference_type)<<31,e.reference|=2147483647&e.referenced_size,e.sap=(1&e.starts_with_SAP)<<31,e.sap|=(3&e.SAP_type)<<28,e.sap|=268435455&e.SAP_delta_time),this._procEntryField(e,`reference`,`uint`,32),this._procEntryField(e,`subsegment_duration`,`uint`,32),this._procEntryField(e,`sap`,`uint`,32),this._parsing&&(e.reference_type=e.reference>>31&1,e.referenced_size=2147483647&e.reference,e.starts_with_SAP=e.sap>>31&1,e.SAP_type=e.sap>>28&7,e.SAP_delta_time=268435455&e.sap)}))},i.prototype._boxProcessors.smhd=function(){this._procFullBox(),this._procField(`balance`,`uint`,16),this._procField(`reserved`,`uint`,16)},i.prototype._boxProcessors.ssix=function(){this._procFullBox(),this._procField(`subsegment_count`,`uint`,32),this._procEntries(`subsegments`,this.subsegment_count,(function(e){this._procEntryField(e,`ranges_count`,`uint`,32),this._procSubEntries(e,`ranges`,e.ranges_count,(function(e){this._procEntryField(e,`level`,`uint`,8),this._procEntryField(e,`range_size`,`uint`,24)}))}))},i.prototype._boxProcessors.stsd=function(){this._procFullBox(),this._procField(`entry_count`,`uint`,32),this._procSubBoxes(`entries`,this.entry_count)},i.prototype._boxProcessors.sttg=function(){this._procField(`settings`,`utf8`)},i.prototype._boxProcessors.stts=function(){this._procFullBox(),this._procField(`entry_count`,`uint`,32),this._procEntries(`entries`,this.entry_count,(function(e){this._procEntryField(e,`sample_count`,`uint`,32),this._procEntryField(e,`sample_delta`,`uint`,32)}))},i.prototype._boxProcessors.subs=function(){this._procFullBox(),this._procField(`entry_count`,`uint`,32),this._procEntries(`entries`,this.entry_count,(function(e){this._procEntryField(e,`sample_delta`,`uint`,32),this._procEntryField(e,`subsample_count`,`uint`,16),this._procSubEntries(e,`subsamples`,e.subsample_count,(function(e){this._procEntryField(e,`subsample_size`,`uint`,this.version===1?32:16),this._procEntryField(e,`subsample_priority`,`uint`,8),this._procEntryField(e,`discardable`,`uint`,8),this._procEntryField(e,`codec_specific_parameters`,`uint`,32)}))}))},i.prototype._boxProcessors.tenc=function(){this._procFullBox(),this._procField(`default_IsEncrypted`,`uint`,24),this._procField(`default_IV_size`,`uint`,8),this._procFieldArray(`default_KID`,16,`uint`,8)},i.prototype._boxProcessors.tfdt=function(){this._procFullBox(),this._procField(`baseMediaDecodeTime`,`uint`,this.version==1?64:32)},i.prototype._boxProcessors.tfhd=function(){this._procFullBox(),this._procField(`track_ID`,`uint`,32),1&this.flags&&this._procField(`base_data_offset`,`uint`,64),2&this.flags&&this._procField(`sample_description_offset`,`uint`,32),8&this.flags&&this._procField(`default_sample_duration`,`uint`,32),16&this.flags&&this._procField(`default_sample_size`,`uint`,32),32&this.flags&&this._procField(`default_sample_flags`,`uint`,32)},i.prototype._boxProcessors.tfra=function(){this._procFullBox(),this._procField(`track_ID`,`uint`,32),this._parsing||(this.reserved=0,this.reserved|=(48&this.length_size_of_traf_num)<<4,this.reserved|=(12&this.length_size_of_trun_num)<<2,this.reserved|=3&this.length_size_of_sample_num),this._procField(`reserved`,`uint`,32),this._parsing&&(this.length_size_of_traf_num=(48&this.reserved)>>4,this.length_size_of_trun_num=(12&this.reserved)>>2,this.length_size_of_sample_num=3&this.reserved),this._procField(`number_of_entry`,`uint`,32),this._procEntries(`entries`,this.number_of_entry,(function(e){this._procEntryField(e,`time`,`uint`,this.version===1?64:32),this._procEntryField(e,`moof_offset`,`uint`,this.version===1?64:32),this._procEntryField(e,`traf_number`,`uint`,8*(this.length_size_of_traf_num+1)),this._procEntryField(e,`trun_number`,`uint`,8*(this.length_size_of_trun_num+1)),this._procEntryField(e,`sample_number`,`uint`,8*(this.length_size_of_sample_num+1))}))},i.prototype._boxProcessors.tkhd=function(){this._procFullBox(),this._procField(`creation_time`,`uint`,this.version==1?64:32),this._procField(`modification_time`,`uint`,this.version==1?64:32),this._procField(`track_ID`,`uint`,32),this._procField(`reserved1`,`uint`,32),this._procField(`duration`,`uint`,this.version==1?64:32),this._procFieldArray(`reserved2`,2,`uint`,32),this._procField(`layer`,`uint`,16),this._procField(`alternate_group`,`uint`,16),this._procField(`volume`,`template`,16),this._procField(`reserved3`,`uint`,16),this._procFieldArray(`matrix`,9,`template`,32),this._procField(`width`,`template`,32),this._procField(`height`,`template`,32)},i.prototype._boxProcessors.trex=function(){this._procFullBox(),this._procField(`track_ID`,`uint`,32),this._procField(`default_sample_description_index`,`uint`,32),this._procField(`default_sample_duration`,`uint`,32),this._procField(`default_sample_size`,`uint`,32),this._procField(`default_sample_flags`,`uint`,32)},i.prototype._boxProcessors.trun=function(){this._procFullBox(),this._procField(`sample_count`,`uint`,32),1&this.flags&&this._procField(`data_offset`,`int`,32),4&this.flags&&this._procField(`first_sample_flags`,`uint`,32),this._procEntries(`samples`,this.sample_count,(function(e){256&this.flags&&this._procEntryField(e,`sample_duration`,`uint`,32),512&this.flags&&this._procEntryField(e,`sample_size`,`uint`,32),1024&this.flags&&this._procEntryField(e,`sample_flags`,`uint`,32),2048&this.flags&&this._procEntryField(e,`sample_composition_time_offset`,this.version===1?`int`:`uint`,32)}))},i.prototype._boxProcessors[`url `]=i.prototype._boxProcessors[`urn `]=function(){this._procFullBox(),this.type===`urn `&&this._procField(`name`,`string`,-1),this._procField(`location`,`string`,-1)},i.prototype._boxProcessors.vlab=function(){this._procField(`source_label`,`utf8`)},i.prototype._boxProcessors.vmhd=function(){this._procFullBox(),this._procField(`graphicsmode`,`uint`,16),this._procFieldArray(`opcolor`,3,`uint`,16)},i.prototype._boxProcessors.vttC=function(){this._procField(`config`,`utf8`)},i.prototype._boxProcessors.vtte=function(){}},9826:function(e){var t,n=typeof Reflect==`object`?Reflect:null,r=n&&typeof n.apply==`function`?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&typeof n.ownKeys==`function`?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,o),r(n)}function o(){typeof e.removeListener==`function`&&e.removeListener(`error`,i),n([].slice.call(arguments))}_(e,t,o,{once:!0}),t!==`error`&&function(e,t){typeof e.on==`function`&&_(e,`error`,t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var c=10;function l(e){if(typeof e!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof e)}function u(e){return e._maxListeners===void 0?o.defaultMaxListeners:e._maxListeners}function d(e,t,n,r){var i,o,c,d;if(l(n),(o=e._events)===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit(`newListener`,t,n.listener?n.listener:n),o=e._events),c=o[t]),c===void 0)c=o[t]=n,++e._eventsCount;else if(typeof c==`function`?c=o[t]=r?[n,c]:[c,n]:r?c.unshift(n):c.push(n),(i=u(e))>0&&c.length>i&&!c.warned){c.warned=!0;var f=Error(`Possible EventEmitter memory leak detected. `+c.length+` `+String(t)+` listeners added. Use emitter.setMaxListeners() to increase limit`);f.name=`MaxListenersExceededWarning`,f.emitter=e,f.type=t,f.count=c.length,d=f,console&&console.warn&&console.warn(d)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}function m(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i==`function`?n?[i.listener||i]:[i]:n?function(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):g(i,i.length)}function h(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n==`function`)return 1;if(n!==void 0)return n.length}return 0}function g(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function _(e,t,n,r){if(typeof e.on==`function`)r.once?e.once(t,n):e.on(t,n);else{if(typeof e.addEventListener!=`function`)throw TypeError(`The "emitter" argument must be of type EventEmitter. Received type `+typeof e);e.addEventListener(t,(function i(o){r.once&&e.removeEventListener(t,i),n(o)}))}}Object.defineProperty(o,`defaultMaxListeners`,{enumerable:!0,get:function(){return c},set:function(e){if(typeof e!=`number`||e<0||i(e))throw RangeError(`The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received `+e+`.`);c=e}}),o.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if(typeof e!=`number`||e<0||i(e))throw RangeError(`The value of "n" is out of range. It must be a non-negative number. Received `+e+`.`);return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e===`error`,o=this._events;if(o!==void 0)i&&=o.error===void 0;else if(!i)return!1;if(i){var c;if(t.length>0&&(c=t[0]),c instanceof Error)throw c;var l=Error(`Unhandled error.`+(c?` (`+c.message+`)`:``));throw l.context=c,l}var u=o[e];if(u===void 0)return!1;if(typeof u==`function`)r(u,this,t);else{var d=u.length,f=g(u,d);for(n=0;n<d;++n)r(f[n],this,t)}return!0},o.prototype.addListener=function(e,t){return d(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return d(this,e,t,!0)},o.prototype.once=function(e,t){return l(t),this.on(e,p(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,p(this,e,t)),this},o.prototype.removeListener=function(e,t){var n,r,i,o,c;if(l(t),(r=this._events)===void 0||(n=r[e])===void 0)return this;if(n===t||n.listener===t)--this._eventsCount==0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit(`removeListener`,e,n.listener||t));else if(typeof n!=`function`){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){c=n[o].listener,i=o;break}if(i<0)return this;i===0?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit(`removeListener`,e,c||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,n,r;if((n=this._events)===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var i,o=Object.keys(n);for(r=0;r<o.length;++r)(i=o[r])!==`removeListener`&&this.removeAllListeners(i);return this.removeAllListeners(`removeListener`),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(t=n[e])==`function`)this.removeListener(e,t);else if(t!==void 0)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return m(this,e,!0)},o.prototype.rawListeners=function(e){return m(this,e,!1)},o.listenerCount=function(e,t){return typeof e.listenerCount==`function`?e.listenerCount(t):h.call(e,t)},o.prototype.listenerCount=h,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},7316:function(e){e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;i--!=0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;i--!=0;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!=0;){var c=o[i];if(!e(t[c],n[c]))return!1}return!0}return t!=t&&n!=n}},7986:function(e,t){t.read=function(e,t,n,r,i){var o,c,l=8*i-r-1,u=(1<<l)-1,d=u>>1,f=-7,p=n?i-1:0,m=n?-1:1,h=e[t+p];for(p+=m,o=h&(1<<-f)-1,h>>=-f,f+=l;f>0;o=256*o+e[t+p],p+=m,f-=8);for(c=o&(1<<-f)-1,o>>=-f,f+=r;f>0;c=256*c+e[t+p],p+=m,f-=8);if(o===0)o=1-d;else{if(o===u)return c?NaN:1/0*(h?-1:1);c+=2**r,o-=d}return(h?-1:1)*c*2**(o-r)},t.write=function(e,t,n,r,i,o){var c,l,u,d=8*o-i-1,f=(1<<d)-1,p=f>>1,m=i===23?2**-24-2**-77:0,h=r?0:o-1,g=r?1:-1,_=+(t<0||t===0&&1/t<0);for(t=Math.abs(t),isNaN(t)||t===1/0?(l=+!!isNaN(t),c=f):(c=Math.floor(Math.log(t)/Math.LN2),t*(u=2**-c)<1&&(c--,u*=2),(t+=c+p>=1?m/u:m*2**(1-p))*u>=2&&(c++,u/=2),c+p>=f?(l=0,c=f):c+p>=1?(l=(t*u-1)*2**i,c+=p):(l=t*2**(p-1)*2**i,c=0));i>=8;e[n+h]=255&l,h+=g,l/=256,i-=8);for(c=c<<i|l,d+=i;d>0;e[n+h]=255&c,h+=g,c/=256,d-=8);e[n+h-g]|=128*_}},5474:function(e,t,n){(function(e){e.parser=function(e,t){return new i(e,t)},e.SAXParser=i,e.SAXStream=c,e.createStream=function(e,t){return new c(e,t)},e.MAX_BUFFER_LENGTH=65536;var t,r=[`comment`,`sgmlDecl`,`textNode`,`tagName`,`doctype`,`procInstName`,`procInstBody`,`entity`,`attribName`,`attribValue`,`cdata`,`script`];function i(t,n){if(!(this instanceof i))return new i(t,n);var o=this;(function(e){for(var t=0,n=r.length;t<n;t++)e[r[t]]=``})(o),o.q=o.c=``,o.bufferCheckPosition=e.MAX_BUFFER_LENGTH,o.opt=n||{},o.opt.lowercase=o.opt.lowercase||o.opt.lowercasetags,o.looseCase=o.opt.lowercase?`toLowerCase`:`toUpperCase`,o.tags=[],o.closed=o.closedRoot=o.sawRoot=!1,o.tag=o.error=null,o.strict=!!t,o.noscript=!(!t&&!o.opt.noscript),o.state=k.BEGIN,o.strictEntities=o.opt.strictEntities,o.ENTITIES=o.strictEntities?Object.create(e.XML_ENTITIES):Object.create(e.ENTITIES),o.attribList=[],o.opt.xmlns&&(o.ns=Object.create(v)),o.trackPosition=!1!==o.opt.position,o.trackPosition&&(o.position=o.line=o.column=0),j(o,`onready`)}e.EVENTS=[`text`,`processinginstruction`,`sgmldeclaration`,`doctype`,`comment`,`opentagstart`,`attribute`,`opentag`,`closetag`,`opencdata`,`cdata`,`closecdata`,`error`,`end`,`ready`,`script`,`opennamespace`,`closenamespace`],Object.create||(Object.create=function(e){function t(){}return t.prototype=e,new t}),Object.keys||(Object.keys=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}),i.prototype={end:function(){I(this)},write:function(t){var n=this;if(this.error)throw this.error;if(n.closed)return F(n,`Cannot write after close. Assign an onready handler.`);if(t===null)return I(n);typeof t==`object`&&(t=t.toString());for(var i=0,o=``;o=G(t,i++),n.c=o,o;)switch(n.trackPosition&&(n.position++,o===`
43
+ `?(n.line++,n.column=0):n.column++),n.state){case k.BEGIN:if(n.state=k.BEGIN_WHITESPACE,o===``)continue;W(n,o);continue;case k.BEGIN_WHITESPACE:W(n,o);continue;case k.TEXT:if(n.sawRoot&&!n.closedRoot){for(var c=i-1;o&&o!==`<`&&o!==`&`;)(o=G(t,i++))&&n.trackPosition&&(n.position++,o===`
44
+ `?(n.line++,n.column=0):n.column++);n.textNode+=t.substring(c,i-1)}o!==`<`||n.sawRoot&&n.closedRoot&&!n.strict?(!T(l,o)||n.sawRoot&&!n.closedRoot||L(n,`Text data outside of root node.`),o===`&`?n.state=k.TEXT_ENTITY:n.textNode+=o):(n.state=k.OPEN_WAKA,n.startTagPosition=n.position);continue;case k.SCRIPT:o===`<`?n.state=k.SCRIPT_ENDING:n.script+=o;continue;case k.SCRIPT_ENDING:o===`/`?n.state=k.CLOSE_TAG:(n.script+=`<`+o,n.state=k.SCRIPT);continue;case k.OPEN_WAKA:if(o===`!`)n.state=k.SGML_DECL,n.sgmlDecl=``;else if(!w(l,o))if(w(y,o))n.state=k.OPEN_TAG,n.tagName=o;else if(o===`/`)n.state=k.CLOSE_TAG,n.tagName=``;else if(o===`?`)n.state=k.PROC_INST,n.procInstName=n.procInstBody=``;else{if(L(n,`Unencoded <`),n.startTagPosition+1<n.position){var u=n.position-n.startTagPosition;o=Array(u).join(` `)+o}n.textNode+=`<`+o,n.state=k.TEXT}continue;case k.SGML_DECL:(n.sgmlDecl+o).toUpperCase()===m?(M(n,`onopencdata`),n.state=k.CDATA,n.sgmlDecl=``,n.cdata=``):n.sgmlDecl+o===`--`?(n.state=k.COMMENT,n.comment=``,n.sgmlDecl=``):(n.sgmlDecl+o).toUpperCase()===h?(n.state=k.DOCTYPE,(n.doctype||n.sawRoot)&&L(n,`Inappropriately located doctype declaration`),n.doctype=``,n.sgmlDecl=``):o===`>`?(M(n,`onsgmldeclaration`,n.sgmlDecl),n.sgmlDecl=``,n.state=k.TEXT):(w(f,o)&&(n.state=k.SGML_DECL_QUOTED),n.sgmlDecl+=o);continue;case k.SGML_DECL_QUOTED:o===n.q&&(n.state=k.SGML_DECL,n.q=``),n.sgmlDecl+=o;continue;case k.DOCTYPE:o===`>`?(n.state=k.TEXT,M(n,`ondoctype`,n.doctype),n.doctype=!0):(n.doctype+=o,o===`[`?n.state=k.DOCTYPE_DTD:w(f,o)&&(n.state=k.DOCTYPE_QUOTED,n.q=o));continue;case k.DOCTYPE_QUOTED:n.doctype+=o,o===n.q&&(n.q=``,n.state=k.DOCTYPE);continue;case k.DOCTYPE_DTD:n.doctype+=o,o===`]`?n.state=k.DOCTYPE:w(f,o)&&(n.state=k.DOCTYPE_DTD_QUOTED,n.q=o);continue;case k.DOCTYPE_DTD_QUOTED:n.doctype+=o,o===n.q&&(n.state=k.DOCTYPE_DTD,n.q=``);continue;case k.COMMENT:o===`-`?n.state=k.COMMENT_ENDING:n.comment+=o;continue;case k.COMMENT_ENDING:o===`-`?(n.state=k.COMMENT_ENDED,n.comment=P(n.opt,n.comment),n.comment&&M(n,`oncomment`,n.comment),n.comment=``):(n.comment+=`-`+o,n.state=k.COMMENT);continue;case k.COMMENT_ENDED:o===`>`?n.state=k.TEXT:(L(n,`Malformed comment`),n.comment+=`--`+o,n.state=k.COMMENT);continue;case k.CDATA:o===`]`?n.state=k.CDATA_ENDING:n.cdata+=o;continue;case k.CDATA_ENDING:o===`]`?n.state=k.CDATA_ENDING_2:(n.cdata+=`]`+o,n.state=k.CDATA);continue;case k.CDATA_ENDING_2:o===`>`?(n.cdata&&M(n,`oncdata`,n.cdata),M(n,`onclosecdata`),n.cdata=``,n.state=k.TEXT):o===`]`?n.cdata+=`]`:(n.cdata+=`]]`+o,n.state=k.CDATA);continue;case k.PROC_INST:o===`?`?n.state=k.PROC_INST_ENDING:w(l,o)?n.state=k.PROC_INST_BODY:n.procInstName+=o;continue;case k.PROC_INST_BODY:if(!n.procInstBody&&w(l,o))continue;o===`?`?n.state=k.PROC_INST_ENDING:n.procInstBody+=o;continue;case k.PROC_INST_ENDING:o===`>`?(M(n,`onprocessinginstruction`,{name:n.procInstName,body:n.procInstBody}),n.procInstName=n.procInstBody=``,n.state=k.TEXT):(n.procInstBody+=`?`+o,n.state=k.PROC_INST_BODY);continue;case k.OPEN_TAG:w(b,o)?n.tagName+=o:(R(n),o===`>`?V(n):o===`/`?n.state=k.OPEN_TAG_SLASH:(T(l,o)&&L(n,`Invalid character in tag name`),n.state=k.ATTRIB));continue;case k.OPEN_TAG_SLASH:o===`>`?(V(n,!0),H(n)):(L(n,`Forward-slash in opening tag not followed by >`),n.state=k.ATTRIB);continue;case k.ATTRIB:if(w(l,o))continue;o===`>`?V(n):o===`/`?n.state=k.OPEN_TAG_SLASH:w(y,o)?(n.attribName=o,n.attribValue=``,n.state=k.ATTRIB_NAME):L(n,`Invalid attribute name`);continue;case k.ATTRIB_NAME:o===`=`?n.state=k.ATTRIB_VALUE:o===`>`?(L(n,`Attribute without value`),n.attribValue=n.attribName,B(n),V(n)):w(l,o)?n.state=k.ATTRIB_NAME_SAW_WHITE:w(b,o)?n.attribName+=o:L(n,`Invalid attribute name`);continue;case k.ATTRIB_NAME_SAW_WHITE:if(o===`=`)n.state=k.ATTRIB_VALUE;else{if(w(l,o))continue;L(n,`Attribute without value`),n.tag.attributes[n.attribName]=``,n.attribValue=``,M(n,`onattribute`,{name:n.attribName,value:``}),n.attribName=``,o===`>`?V(n):w(y,o)?(n.attribName=o,n.state=k.ATTRIB_NAME):(L(n,`Invalid attribute name`),n.state=k.ATTRIB)}continue;case k.ATTRIB_VALUE:if(w(l,o))continue;w(f,o)?(n.q=o,n.state=k.ATTRIB_VALUE_QUOTED):(L(n,`Unquoted attribute value`),n.state=k.ATTRIB_VALUE_UNQUOTED,n.attribValue=o);continue;case k.ATTRIB_VALUE_QUOTED:if(o!==n.q){o===`&`?n.state=k.ATTRIB_VALUE_ENTITY_Q:n.attribValue+=o;continue}B(n),n.q=``,n.state=k.ATTRIB_VALUE_CLOSED;continue;case k.ATTRIB_VALUE_CLOSED:w(l,o)?n.state=k.ATTRIB:o===`>`?V(n):o===`/`?n.state=k.OPEN_TAG_SLASH:w(y,o)?(L(n,`No whitespace between attributes`),n.attribName=o,n.attribValue=``,n.state=k.ATTRIB_NAME):L(n,`Invalid attribute name`);continue;case k.ATTRIB_VALUE_UNQUOTED:if(T(p,o)){o===`&`?n.state=k.ATTRIB_VALUE_ENTITY_U:n.attribValue+=o;continue}B(n),o===`>`?V(n):n.state=k.ATTRIB;continue;case k.CLOSE_TAG:if(n.tagName)o===`>`?H(n):w(b,o)?n.tagName+=o:n.script?(n.script+=`</`+n.tagName,n.tagName=``,n.state=k.SCRIPT):(T(l,o)&&L(n,`Invalid tagname in closing tag`),n.state=k.CLOSE_TAG_SAW_WHITE);else{if(w(l,o))continue;T(y,o)?n.script?(n.script+=`</`+o,n.state=k.SCRIPT):L(n,`Invalid tagname in closing tag.`):n.tagName=o}continue;case k.CLOSE_TAG_SAW_WHITE:if(w(l,o))continue;o===`>`?H(n):L(n,`Invalid characters in closing tag`);continue;case k.TEXT_ENTITY:case k.ATTRIB_VALUE_ENTITY_Q:case k.ATTRIB_VALUE_ENTITY_U:var d,g;switch(n.state){case k.TEXT_ENTITY:d=k.TEXT,g=`textNode`;break;case k.ATTRIB_VALUE_ENTITY_Q:d=k.ATTRIB_VALUE_QUOTED,g=`attribValue`;break;case k.ATTRIB_VALUE_ENTITY_U:d=k.ATTRIB_VALUE_UNQUOTED,g=`attribValue`}o===`;`?(n[g]+=U(n),n.entity=``,n.state=d):w(n.entity.length?S:x,o)?n.entity+=o:(L(n,`Invalid character in entity name`),n[g]+=`&`+n.entity+o,n.entity=``,n.state=d);continue;default:throw Error(n,`Unknown state: `+n.state)}return n.position>=n.bufferCheckPosition&&function(t){for(var n=Math.max(e.MAX_BUFFER_LENGTH,10),i=0,o=0,c=r.length;o<c;o++){var l=t[r[o]].length;if(l>n)switch(r[o]){case`textNode`:N(t);break;case`cdata`:M(t,`oncdata`,t.cdata),t.cdata=``;break;case`script`:M(t,`onscript`,t.script),t.script=``;break;default:F(t,`Max buffer length exceeded: `+r[o])}i=Math.max(i,l)}t.bufferCheckPosition=e.MAX_BUFFER_LENGTH-i+t.position}(n),n},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var e;N(e=this),e.cdata!==``&&(M(e,`oncdata`,e.cdata),e.cdata=``),e.script!==``&&(M(e,`onscript`,e.script),e.script=``)}};try{t=n(3515).Stream}catch{t=function(){}}var o=e.EVENTS.filter((function(e){return e!==`error`&&e!==`end`}));function c(e,n){if(!(this instanceof c))return new c(e,n);t.apply(this),this._parser=new i(e,n),this.writable=!0,this.readable=!0;var r=this;this._parser.onend=function(){r.emit(`end`)},this._parser.onerror=function(e){r.emit(`error`,e),r._parser.error=null},this._decoder=null,o.forEach((function(e){Object.defineProperty(r,`on`+e,{get:function(){return r._parser[`on`+e]},set:function(t){if(!t)return r.removeAllListeners(e),r._parser[`on`+e]=t,t;r.on(e,t)},enumerable:!0,configurable:!1})}))}c.prototype=Object.create(t.prototype,{constructor:{value:c}}),c.prototype.write=function(e){if(typeof Buffer==`function`&&typeof Buffer.isBuffer==`function`&&Buffer.isBuffer(e)){if(!this._decoder){var t=n(748).StringDecoder;this._decoder=new t(`utf8`)}e=this._decoder.write(e)}return this._parser.write(e.toString()),this.emit(`data`,e),!0},c.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},c.prototype.on=function(e,n){var r=this;return r._parser[`on`+e]||o.indexOf(e)===-1||(r._parser[`on`+e]=function(){var t=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),r.emit.apply(r,t)}),t.prototype.on.call(r,e,n)};var l=`\r
45
+ `,u=`0124356789`,d=`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`,f=`'"`,p=l+`>`,m=`[CDATA[`,h=`DOCTYPE`,g=`http://www.w3.org/XML/1998/namespace`,_=`http://www.w3.org/2000/xmlns/`,v={xml:g,xmlns:_};l=C(l),u=C(u),d=C(d);var y=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,b=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/,x=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,S=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;function C(e){return e.split(``).reduce((function(e,t){return e[t]=!0,e}),{})}function w(e,t){return function(e){return Object.prototype.toString.call(e)===`[object RegExp]`}(e)?!!t.match(e):e[t]}function T(e,t){return!w(e,t)}f=C(f),p=C(p);var E,D,O,k=0;for(var A in e.STATE={BEGIN:k++,BEGIN_WHITESPACE:k++,TEXT:k++,TEXT_ENTITY:k++,OPEN_WAKA:k++,SGML_DECL:k++,SGML_DECL_QUOTED:k++,DOCTYPE:k++,DOCTYPE_QUOTED:k++,DOCTYPE_DTD:k++,DOCTYPE_DTD_QUOTED:k++,COMMENT_STARTING:k++,COMMENT:k++,COMMENT_ENDING:k++,COMMENT_ENDED:k++,CDATA:k++,CDATA_ENDING:k++,CDATA_ENDING_2:k++,PROC_INST:k++,PROC_INST_BODY:k++,PROC_INST_ENDING:k++,OPEN_TAG:k++,OPEN_TAG_SLASH:k++,ATTRIB:k++,ATTRIB_NAME:k++,ATTRIB_NAME_SAW_WHITE:k++,ATTRIB_VALUE:k++,ATTRIB_VALUE_QUOTED:k++,ATTRIB_VALUE_CLOSED:k++,ATTRIB_VALUE_UNQUOTED:k++,ATTRIB_VALUE_ENTITY_Q:k++,ATTRIB_VALUE_ENTITY_U:k++,CLOSE_TAG:k++,CLOSE_TAG_SAW_WHITE:k++,SCRIPT:k++,SCRIPT_ENDING:k++},e.XML_ENTITIES={amp:`&`,gt:`>`,lt:`<`,quot:`"`,apos:`'`},e.ENTITIES={amp:`&`,gt:`>`,lt:`<`,quot:`"`,apos:`'`,AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(e.ENTITIES).forEach((function(t){var n=e.ENTITIES[t],r=typeof n==`number`?String.fromCharCode(n):n;e.ENTITIES[t]=r})),e.STATE)e.STATE[e.STATE[A]]=A;function j(e,t,n){e[t]&&e[t](n)}function M(e,t,n){e.textNode&&N(e),j(e,t,n)}function N(e){e.textNode=P(e.opt,e.textNode),e.textNode&&j(e,`ontext`,e.textNode),e.textNode=``}function P(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g,` `)),t}function F(e,t){return N(e),e.trackPosition&&(t+=`
46
+ Line: `+e.line+`
47
+ Column: `+e.column+`
48
+ Char: `+e.c),t=Error(t),e.error=t,j(e,`onerror`,t),e}function I(e){return e.sawRoot&&!e.closedRoot&&L(e,`Unclosed root tag`),e.state!==k.BEGIN&&e.state!==k.BEGIN_WHITESPACE&&e.state!==k.TEXT&&F(e,`Unexpected end`),N(e),e.c=``,e.closed=!0,j(e,`onend`),i.call(e,e.strict,e.opt),e}function L(e,t){if(typeof e!=`object`||!(e instanceof i))throw Error(`bad call to strictFail`);e.strict&&F(e,t)}function R(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,n=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(n.ns=t.ns),e.attribList.length=0,M(e,`onopentagstart`,n)}function z(e,t){var n=e.indexOf(`:`)<0?[``,e]:e.split(`:`),r=n[0],i=n[1];return t&&e===`xmlns`&&(r=`xmlns`,i=``),{prefix:r,local:i}}function B(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),e.attribList.indexOf(e.attribName)!==-1||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue=``;else{if(e.opt.xmlns){var t=z(e.attribName,!0),n=t.prefix,r=t.local;if(n===`xmlns`)if(r===`xml`&&e.attribValue!==g)L(e,`xml: prefix must be bound to `+g+`
49
+ Actual: `+e.attribValue);else if(r===`xmlns`&&e.attribValue!==_)L(e,`xmlns: prefix must be bound to `+_+`
50
+ Actual: `+e.attribValue);else{var i=e.tag,o=e.tags[e.tags.length-1]||e;i.ns===o.ns&&(i.ns=Object.create(o.ns)),i.ns[r]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,M(e,`onattribute`,{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=``}}function V(e,t){if(e.opt.xmlns){var n=e.tag,r=z(e.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||``,n.prefix&&!n.uri&&(L(e,`Unbound namespace prefix: `+JSON.stringify(e.tagName)),n.uri=r.prefix);var i=e.tags[e.tags.length-1]||e;n.ns&&i.ns!==n.ns&&Object.keys(n.ns).forEach((function(t){M(e,`onopennamespace`,{prefix:t,uri:n.ns[t]})}));for(var o=0,c=e.attribList.length;o<c;o++){var l=e.attribList[o],u=l[0],d=l[1],f=z(u,!0),p=f.prefix,m=f.local,h=p===``?``:n.ns[p]||``,g={name:u,value:d,prefix:p,local:m,uri:h};p&&p!==`xmlns`&&!h&&(L(e,`Unbound namespace prefix: `+JSON.stringify(p)),g.uri=p),e.tag.attributes[u]=g,M(e,`onattribute`,g)}e.attribList.length=0}e.tag.isSelfClosing=!!t,e.sawRoot=!0,e.tags.push(e.tag),M(e,`onopentag`,e.tag),t||(e.noscript||e.tagName.toLowerCase()!==`script`?e.state=k.TEXT:e.state=k.SCRIPT,e.tag=null,e.tagName=``),e.attribName=e.attribValue=``,e.attribList.length=0}function H(e){if(!e.tagName)return L(e,`Weird empty close tag.`),e.textNode+=`</>`,void(e.state=k.TEXT);if(e.script){if(e.tagName!==`script`)return e.script+=`</`+e.tagName+`>`,e.tagName=``,void(e.state=k.SCRIPT);M(e,`onscript`,e.script),e.script=``}var t=e.tags.length,n=e.tagName;e.strict||(n=n[e.looseCase]());for(var r=n;t--&&e.tags[t].name!==r;)L(e,`Unexpected close tag`);if(t<0)return L(e,`Unmatched closing tag: `+e.tagName),e.textNode+=`</`+e.tagName+`>`,void(e.state=k.TEXT);e.tagName=n;for(var i=e.tags.length;i-- >t;){var o=e.tag=e.tags.pop();e.tagName=e.tag.name,M(e,`onclosetag`,e.tagName);var c={};for(var l in o.ns)c[l]=o.ns[l];var u=e.tags[e.tags.length-1]||e;e.opt.xmlns&&o.ns!==u.ns&&Object.keys(o.ns).forEach((function(t){var n=o.ns[t];M(e,`onclosenamespace`,{prefix:t,uri:n})}))}t===0&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName=``,e.attribList.length=0,e.state=k.TEXT}function U(e){var t,n=e.entity,r=n.toLowerCase(),i=``;return e.ENTITIES[n]?e.ENTITIES[n]:e.ENTITIES[r]?e.ENTITIES[r]:((n=r).charAt(0)===`#`&&(n.charAt(1)===`x`?(n=n.slice(2),i=(t=parseInt(n,16)).toString(16)):(n=n.slice(1),i=(t=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,``),i.toLowerCase()===n?String.fromCodePoint(t):(L(e,`Invalid character entity`),`&`+e.entity+`;`))}function W(e,t){t===`<`?(e.state=k.OPEN_WAKA,e.startTagPosition=e.position):T(l,t)&&(L(e,`Non-whitespace before first tag.`),e.textNode=t,e.state=k.TEXT)}function G(e,t){var n=``;return t<e.length&&(n=e.charAt(t)),n}k=e.STATE,String.fromCodePoint||(E=String.fromCharCode,D=Math.floor,O=function(){var e,t,n=[],r=-1,i=arguments.length;if(!i)return``;for(var o=``;++r<i;){var c=Number(arguments[r]);if(!isFinite(c)||c<0||c>1114111||D(c)!==c)throw RangeError(`Invalid code point: `+c);c<=65535?n.push(c):(e=55296+((c-=65536)>>10),t=c%1024+56320,n.push(e,t)),(r+1===i||n.length>16384)&&(o+=E.apply(null,n),n.length=0)}return o},Object.defineProperty?Object.defineProperty(String,`fromCodePoint`,{value:O,configurable:!0,writable:!0}):String.fromCodePoint=O)})(t)},6739:function(e,t,n){(function(e,t,n,r,i){function o(e){if(`contents`in e)for(var t=(`styleAttrs`in e)?e.styleAttrs[r.byName.ruby.qname]:null,n=e.kind===`span`&&(t===`container`||t===`textContainer`||t===`baseContainer`),i=e.contents.length-1;i>=0;i--)!n||`styleAttrs`in e.contents[i]&&r.byName.ruby.qname in e.contents[i].styleAttrs?o(e.contents[i]):delete e.contents[i]}function c(e,t,n,r){var i=r&&r.timeContainer===`seq`,o=0;r&&(o=i&&n?n.end:r.begin),t.begin=t.explicit_begin?t.explicit_begin+o:o;var l=t.begin,u=null;if(`sets`in t)for(var d=0;d<t.sets.length;d++)c(e,t.sets[d],u,t),l=t.timeContainer===`seq`?t.sets[d].end:Math.max(l,t.sets[d].end),u=t.sets[d];if(`contents`in t){if(`contents`in t)for(var f=0;f<t.contents.length;f++)c(e,t.contents[f],u,t),l=t.timeContainer===`seq`?t.contents[f].end:Math.max(l,t.contents[f].end),u=t.contents[f]}else l=i?t.begin:1/0;t.explicit_end!==null&&t.explicit_dur!==null?t.end=Math.min(t.begin+t.explicit_dur,o+t.explicit_end):t.explicit_end===null&&t.explicit_dur!==null?t.end=t.begin+t.explicit_dur:t.explicit_end!==null&&t.explicit_dur===null?t.end=o+t.explicit_end:t.end=l,delete t.explicit_begin,delete t.explicit_dur,delete t.explicit_end,e._registerEvent(t)}function l(e){this.node=e}function u(){this.events=[],this.head=new d,this.body=null}function d(){this.styling=new f,this.layout=new h}function f(){this.styles={},this.initials={}}function p(){this.id=null,this.styleAttrs=null,this.styleRefs=null}function m(){this.styleAttrs=null}function h(){this.regions={}}function g(e,t){_.call(this,`image`),this.src=e,this.type=t}function _(e){this.kind=e}function v(e){this.id=e}function y(e){this.regionID=e}function b(e){this.styleAttrs=e}function x(e){this.sets=e}function S(e){this.contents=e}function C(e,t,n){this.explicit_begin=e,this.explicit_end=t,this.explicit_dur=n}function w(){_.call(this,`body`)}function T(){_.call(this,`div`)}function E(){_.call(this,`p`)}function D(){_.call(this,`span`)}function O(){_.call(this,`span`)}function k(){_.call(this,`br`)}function A(){}function j(){}function M(e){return e&&`xml:id`in e.attributes&&e.attributes[`xml:id`].value||null}function N(e){return e&&`style`in e.attributes?e.attributes.style.value.split(` `):[]}function P(e,t){var n={};if(e!==null)for(var i in e.attributes){var o=e.attributes[i].uri+` `+e.attributes[i].local,c=r.byQName[o];if(c!==void 0){var l=c.parse(e.attributes[i].value);l===null?V(t,`Cannot parse styling attribute `+o+` --> `+e.attributes[i].value):(n[o]=l,c===r.byName.zIndex&&B(t,`zIndex attribute present but not used by IMSC1 since regions do not overlap`))}}return n}function F(e,t,n){for(var r in e.attributes)if(e.attributes[r].uri===t&&e.attributes[r].local===n)return e.attributes[r].value;return null}function I(e,t,n){var r,i=null;return(r=/^(\d+(?:\.\d+)?)f$/.exec(n))===null?(r=/^(\d+(?:\.\d+)?)t$/.exec(n))===null?(r=/^(\d+(?:\.\d+)?)ms$/.exec(n))===null?(r=/^(\d+(?:\.\d+)?)s$/.exec(n))===null?(r=/^(\d+(?:\.\d+)?)h$/.exec(n))===null?(r=/^(\d+(?:\.\d+)?)m$/.exec(n))===null?(r=/^(\d{2,}):(\d\d):(\d\d(?:\.\d+)?)$/.exec(n))===null?(r=/^(\d{2,}):(\d\d):(\d\d)\:(\d{2,})$/.exec(n))!==null&&t!==null&&(i=3600*parseInt(r[1])+60*parseInt(r[2])+parseInt(r[3])+(r[4]===null?0:parseInt(r[4])/t)):i=3600*parseInt(r[1])+60*parseInt(r[2])+parseFloat(r[3]):i=60*parseFloat(r[1]):i=3600*parseFloat(r[1]):i=parseFloat(r[1]):i=parseFloat(r[1])/1e3:e!==null&&(i=parseFloat(r[1])/e):t!==null&&(i=parseFloat(r[1])/t),i}function L(e,t,n){for(;t.styleRefs.length>0;){var r=t.styleRefs.pop();r in e.styles?(L(e,e.styles[r],n),z(e.styles[r].styleAttrs,t.styleAttrs)):V(n,`Non-existant style id referenced`)}}function R(e,t,n,r){for(var i=t.length-1;i>=0;i--){var o=t[i];o in e.styles?z(e.styles[o].styleAttrs,n):V(r,`Non-existant style id referenced`)}}function z(e,t){for(var n in e)e.hasOwnProperty(n)&&(n in t||(t[n]=e[n]))}function B(e,t){if(e&&e.warn&&e.warn(t))throw t}function V(e,t){if(e&&e.error&&e.error(t))throw t}function H(e,t){throw e&&e.fatal&&e.fatal(t),t}function U(e,t){for(var n,r=0,i=e.length-1;r<=i;){var o=e[n=Math.floor((r+i)/2)];if(o<t)r=n+1;else{if(!(o>t))return{found:!0,index:n};i=n-1}}return{found:!1,index:r}}e.fromXML=function(e,i,_){var v=t.parser(!0,{xmlns:!0}),y=[],b=[],x=[],S=0,C=null;v.onclosetag=function(e){if(y[0]instanceof A)C.head!==null&&C.head.styling!==null&&R(C.head.styling,y[0].styleRefs,y[0].styleAttrs,i),delete y[0].styleRefs;else if(y[0]instanceof f)for(var t in y[0].styles)y[0].styles.hasOwnProperty(t)&&L(y[0],y[0].styles[t],i);else if(y[0]instanceof E||y[0]instanceof D){if(y[0].contents.length>1){var r,o=[y[0].contents[0]];for(r=1;r<y[0].contents.length;r++)y[0].contents[r]instanceof O&&o[o.length-1]instanceof O?o[o.length-1].text+=y[0].contents[r].text:o.push(y[0].contents[r]);y[0].contents=o}y[0]instanceof D&&y[0].contents.length===1&&y[0].contents[0]instanceof O&&(y[0].text=y[0].contents[0].text,delete y[0].contents)}else y[0]instanceof l&&(y[0].node.uri===n.ns_tt&&y[0].node.local===`metadata`?S--:S>0&&_&&`onCloseTag`in _&&_.onCloseTag());x.shift(),b.shift(),y.shift()},v.ontext=function(e){if(y[0]!==void 0)if(y[0]instanceof D||y[0]instanceof E){if(y[0]instanceof D){var t=y[0].styleAttrs[r.byName.ruby.qname];if(t===`container`||t===`textContainer`||t===`baseContainer`)return}var n=new O;n.initFromText(C,y[0],e,b[0],x[0],i),y[0].contents.push(n)}else y[0]instanceof l&&S>0&&_&&`onText`in _&&_.onText(e)},v.onopentag=function(e){var t=e.attributes[`xml:space`];t?x.unshift(t.value):x.length===0?x.unshift(`default`):x.unshift(x[0]);var o=e.attributes[`xml:lang`];if(o?b.unshift(o.value):b.length===0?b.unshift(``):b.unshift(b[0]),e.uri===n.ns_tt)if(e.local===`tt`)C!==null&&H(i,`Two <tt> elements at (`+this.line+`,`+this.column+`)`),(C=new u).initFromNode(e,b[0],i),y.unshift(C);else if(e.local===`head`)y[0]instanceof u||H(i,`Parent of <head> element is not <tt> at (`+this.line+`,`+this.column+`)`),y.unshift(C.head);else if(e.local===`styling`)y[0]instanceof d||H(i,`Parent of <styling> element is not <head> at (`+this.line+`,`+this.column+`)`),y.unshift(C.head.styling);else if(e.local===`style`){var c;y[0]instanceof f?((c=new p).initFromNode(e,i),c.id?C.head.styling.styles[c.id]=c:V(i,`<style> element missing @id attribute`),y.unshift(c)):y[0]instanceof A?((c=new p).initFromNode(e,i),z(c.styleAttrs,y[0].styleAttrs),y.unshift(c)):H(i,`Parent of <style> element is not <styling> or <region> at (`+this.line+`,`+this.column+`)`)}else if(e.local===`initial`){var v;if(y[0]instanceof f){for(var O in(v=new m).initFromNode(e,i),v.styleAttrs)v.styleAttrs.hasOwnProperty(O)&&(C.head.styling.initials[O]=v.styleAttrs[O]);y.unshift(v)}else H(i,`Parent of <initial> element is not <styling> at (`+this.line+`,`+this.column+`)`)}else if(e.local===`layout`)y[0]instanceof d||H(i,`Parent of <layout> element is not <head> at `+this.line+`,`+this.column+`)`),y.unshift(C.head.layout);else if(e.local===`region`){y[0]instanceof h||H(i,`Parent of <region> element is not <layout> at `+this.line+`,`+this.column+`)`);var M=new A;M.initFromNode(C,e,b[0],i),!M.id||M.id in C.head.layout.regions?V(i,`Ignoring <region> with duplicate or missing @id at `+this.line+`,`+this.column+`)`):C.head.layout.regions[M.id]=M,y.unshift(M)}else if(e.local===`body`){y[0]instanceof u||H(i,`Parent of <body> element is not <tt> at `+this.line+`,`+this.column+`)`),C.body!==null&&H(i,`Second <body> element at `+this.line+`,`+this.column+`)`);var N=new w;N.initFromNode(C,e,b[0],i),C.body=N,y.unshift(N)}else if(e.local===`div`){y[0]instanceof T||y[0]instanceof w||H(i,`Parent of <div> element is not <body> or <div> at `+this.line+`,`+this.column+`)`);var P=new T;P.initFromNode(C,y[0],e,b[0],i);var F=P.styleAttrs[r.byName.backgroundImage.qname];F&&(P.contents.push(new g(F)),delete P.styleAttrs[r.byName.backgroundImage.qname]),y[0].contents.push(P),y.unshift(P)}else if(e.local===`image`){y[0]instanceof T||H(i,`Parent of <image> element is not <div> at `+this.line+`,`+this.column+`)`);var I=new g;I.initFromNode(C,y[0],e,b[0],i),y[0].contents.push(I),y.unshift(I)}else if(e.local===`p`){y[0]instanceof T||H(i,`Parent of <p> element is not <div> at `+this.line+`,`+this.column+`)`);var L=new E;L.initFromNode(C,y[0],e,b[0],i),y[0].contents.push(L),y.unshift(L)}else if(e.local===`span`){y[0]instanceof D||y[0]instanceof E||H(i,`Parent of <span> element is not <span> or <p> at `+this.line+`,`+this.column+`)`);var R=new D;R.initFromNode(C,y[0],e,b[0],x[0],i),y[0].contents.push(R),y.unshift(R)}else if(e.local===`br`){y[0]instanceof D||y[0]instanceof E||H(i,`Parent of <br> element is not <span> or <p> at `+this.line+`,`+this.column+`)`);var B=new k;B.initFromNode(C,y[0],e,b[0],i),y[0].contents.push(B),y.unshift(B)}else if(e.local===`set`){y[0]instanceof D||y[0]instanceof E||y[0]instanceof T||y[0]instanceof w||y[0]instanceof A||y[0]instanceof k||H(i,`Parent of <set> element is not a content element or a region at `+this.line+`,`+this.column+`)`);var U=new j;U.initFromNode(C,y[0],e,i),y[0].sets.push(U),y.unshift(U)}else y.unshift(new l(e));else y.unshift(new l(e));if(y[0]instanceof l){if(e.uri===n.ns_tt&&e.local===`metadata`)S++;else if(S>0&&_&&`onOpenTag`in _){var W=[];for(var G in e.attributes)W[e.attributes[G].uri+` `+e.attributes[G].local]={uri:e.attributes[G].uri,local:e.attributes[G].local,value:e.attributes[G].value};_.onOpenTag(e.uri,e.local,W)}}},v.write(e).close(),delete C.head.styling.styles;var M=!1;for(var N in C.head.layout.regions)if(C.head.layout.regions.hasOwnProperty(N)){M=!0;break}if(!M){var P=A.prototype.createDefaultRegion(C.lang);C.head.layout.regions[P.id]=P}for(var F in C.head.layout.regions)C.head.layout.regions.hasOwnProperty(F)&&c(C,C.head.layout.regions[F],null,null);return C.body&&c(C,C.body,null,null),C.body&&o(C.body),C},u.prototype.initFromNode=function(e,t,r){var o=function(e,t){var r=F(e,n.ns_ttp,`cellResolution`),i=15,o=32;if(r!==null){var c=/(\d+) (\d+)/.exec(r);c===null?B(t,`Malformed cellResolution value (using initial value instead)`):(o=parseInt(c[1]),i=parseInt(c[2]))}return{w:o,h:i}}(e,r);this.cellLength={h:new i.ComputedLength(0,1/o.h),w:new i.ComputedLength(1/o.w,0)};var c=function(e,t){var r,i=F(e,n.ns_ttp,`frameRate`),o=30;i!==null&&((r=/(\d+)/.exec(i))===null?B(t,`Malformed frame rate attribute (using initial value instead)`):o=parseInt(r[1]));var c=F(e,n.ns_ttp,`frameRateMultiplier`),l=1;c!==null&&((r=/(\d+) (\d+)/.exec(c))===null?B(t,`Malformed frame rate multiplier attribute (using initial value instead)`):l=parseInt(r[1])/parseInt(r[2]));var u=l*o,d=1,f=F(e,n.ns_ttp,`tickRate`);return f===null?i!==null&&(d=u):(r=/(\d+)/.exec(f))===null?B(t,`Malformed tick rate attribute (using initial value instead)`):d=parseInt(r[1]),{effectiveFrameRate:u,tickRate:d}}(e,r);this.effectiveFrameRate=c.effectiveFrameRate,this.tickRate=c.tickRate,this.aspectRatio=function(e,t){var r=F(e,n.ns_ittp,`aspectRatio`);r===null&&(r=F(e,n.ns_ttp,`displayAspectRatio`));var i=null;if(r!==null){var o=/(\d+)\s+(\d+)/.exec(r);if(o!==null){var c=parseInt(o[1]),l=parseInt(o[2]);c!==0&&l!==0?i=c/l:V(t,`Illegal aspectRatio values (ignoring)`)}else V(t,`Malformed aspectRatio attribute (ignoring)`)}return i}(e,r);var l=F(e,n.ns_ttp,`timeBase`);l!==null&&l!==`media`&&H(r,`Unsupported time base`);var u=function(e,t){var r=F(e,n.ns_tts,`extent`);if(r===null)return null;var o=r.split(` `);if(o.length!==2)return B(t,`Malformed extent (ignoring)`),null;var c=i.parseLength(o[0]),l=i.parseLength(o[1]);return l&&c?{h:l,w:c}:(B(t,`Malformed extent values (ignoring)`),null)}(e,r);u===null?this.pxLength={h:null,w:null}:(u.h.unit===`px`&&u.w.unit===`px`||H(r,`Extent on TT must be in px or absent`),this.pxLength={h:new i.ComputedLength(0,1/u.h.value),w:new i.ComputedLength(1/u.w.value,0)}),this.dimensions={h:new i.ComputedLength(0,1),w:new i.ComputedLength(1,0)},this.lang=t},u.prototype._registerEvent=function(e){if(!(e.end<=e.begin)){var t=U(this.events,e.begin);if(t.found||this.events.splice(t.index,0,e.begin),e.end!==1/0){var n=U(this.events,e.end);n.found||this.events.splice(n.index,0,e.end)}}},u.prototype.getMediaTimeRange=function(){return[this.events[0],this.events[this.events.length-1]]},u.prototype.getMediaTimeEvents=function(){return this.events},p.prototype.initFromNode=function(e,t){this.id=M(e),this.styleAttrs=P(e,t),this.styleRefs=N(e)},m.prototype.initFromNode=function(e,t){for(var r in this.styleAttrs={},e.attributes)if(e.attributes[r].uri===n.ns_itts||e.attributes[r].uri===n.ns_ebutts||e.attributes[r].uri===n.ns_tts){var i=e.attributes[r].uri+` `+e.attributes[r].local;this.styleAttrs[i]=e.attributes[r].value}},g.prototype.initFromNode=function(e,t,n,r,i){this.src=`src`in n.attributes?n.attributes.src.value:null,this.src||V(i,`Invalid image@src attribute`),this.type=`type`in n.attributes?n.attributes.type.value:null,this.type||V(i,`Invalid image@type attribute`),b.prototype.initFromNode.call(this,e,t,n,i),C.prototype.initFromNode.call(this,e,t,n,i),x.prototype.initFromNode.call(this,e,t,n,i),y.prototype.initFromNode.call(this,e,t,n,i),this.lang=r},v.prototype.initFromNode=function(e,t,n,r){this.id=M(n)},y.prototype.initFromNode=function(e,t,n,r){this.regionID=function(e){return e&&`region`in e.attributes?e.attributes.region.value:``}(n)},b.prototype.initFromNode=function(e,t,n,r){this.styleAttrs=P(n,r),e.head!==null&&e.head.styling!==null&&R(e.head.styling,N(n),this.styleAttrs,r)},x.prototype.initFromNode=function(e,t,n,r){this.sets=[]},S.prototype.initFromNode=function(e,t,n,r){this.contents=[]},C.prototype.initFromNode=function(e,t,n,r){var i=function(e,t,n,r){var i=null;n&&`begin`in n.attributes&&(i=I(e.tickRate,e.effectiveFrameRate,n.attributes.begin.value))===null&&B(r,`Malformed begin value `+n.attributes.begin.value+` (using 0)`);var o=null;n&&`dur`in n.attributes&&(o=I(e.tickRate,e.effectiveFrameRate,n.attributes.dur.value))===null&&B(r,`Malformed dur value `+n.attributes.dur.value+` (ignoring)`);var c=null;return n&&`end`in n.attributes&&(c=I(e.tickRate,e.effectiveFrameRate,n.attributes.end.value))===null&&B(r,`Malformed end value (ignoring)`),{explicit_begin:i,explicit_end:c,explicit_dur:o}}(e,0,n,r);this.explicit_begin=i.explicit_begin,this.explicit_end=i.explicit_end,this.explicit_dur=i.explicit_dur,this.timeContainer=function(e,t){var n=e&&`timeContainer`in e.attributes?e.attributes.timeContainer.value:null;return n&&n!==`par`?n===`seq`?`seq`:(V(t,`Illegal value of timeContainer (assuming 'par')`),`par`):`par`}(n,r)},w.prototype.initFromNode=function(e,t,n,r){b.prototype.initFromNode.call(this,e,null,t,r),C.prototype.initFromNode.call(this,e,null,t,r),x.prototype.initFromNode.call(this,e,null,t,r),y.prototype.initFromNode.call(this,e,null,t,r),S.prototype.initFromNode.call(this,e,null,t,r),this.lang=n},T.prototype.initFromNode=function(e,t,n,r,i){b.prototype.initFromNode.call(this,e,t,n,i),C.prototype.initFromNode.call(this,e,t,n,i),x.prototype.initFromNode.call(this,e,t,n,i),y.prototype.initFromNode.call(this,e,t,n,i),S.prototype.initFromNode.call(this,e,t,n,i),this.lang=r},E.prototype.initFromNode=function(e,t,n,r,i){b.prototype.initFromNode.call(this,e,t,n,i),C.prototype.initFromNode.call(this,e,t,n,i),x.prototype.initFromNode.call(this,e,t,n,i),y.prototype.initFromNode.call(this,e,t,n,i),S.prototype.initFromNode.call(this,e,t,n,i),this.lang=r},D.prototype.initFromNode=function(e,t,n,r,i,o){b.prototype.initFromNode.call(this,e,t,n,o),C.prototype.initFromNode.call(this,e,t,n,o),x.prototype.initFromNode.call(this,e,t,n,o),y.prototype.initFromNode.call(this,e,t,n,o),S.prototype.initFromNode.call(this,e,t,n,o),this.space=i,this.lang=r},O.prototype.initFromText=function(e,t,n,r,i,o){C.prototype.initFromNode.call(this,e,t,null,o),this.text=n,this.space=i,this.lang=r},k.prototype.initFromNode=function(e,t,n,r,i){y.prototype.initFromNode.call(this,e,t,n,i),C.prototype.initFromNode.call(this,e,t,n,i),this.lang=r},A.prototype.createDefaultRegion=function(e){var t=new A;return v.call(t,``),b.call(t,{}),x.call(t,[]),C.call(t,0,1/0,null),this.lang=e,t},A.prototype.initFromNode=function(e,t,n,r){v.prototype.initFromNode.call(this,e,null,t,r),C.prototype.initFromNode.call(this,e,null,t,r),x.prototype.initFromNode.call(this,e,null,t,r),this.styleAttrs=P(t,r),this.styleRefs=N(t),this.lang=n},j.prototype.initFromNode=function(e,t,n,r){C.prototype.initFromNode.call(this,e,t,n,r);var i=P(n,r);for(var o in this.qname=null,this.value=null,i)if(i.hasOwnProperty(o)){if(this.qname){V(r,`More than one style specified on set`);break}this.qname=o,this.value=i[o]}}})(t,typeof sax>`u`?n(5474):sax,typeof imscNames>`u`?n(977):imscNames,typeof imscStyles>`u`?n(1219):imscStyles,typeof imscUtils>`u`?n(6404):imscUtils)},1612:function(e,t,n){var r=/firefox/i.test(navigator.userAgent);(function(e,t,n){function i(e,t,p,h){var g;if(p.kind===`region`)(g=document.createElement(`div`)).style.position=`absolute`;else if(p.kind===`body`)g=document.createElement(`div`);else if(p.kind===`div`)g=document.createElement(`div`);else if(p.kind===`image`){if(g=document.createElement(`img`),e.imgResolver!==null&&p.src!==null){var y=e.imgResolver(p.src,g);y&&(g.src=y),g.height=e.regionH,g.width=e.regionW}}else if(p.kind===`p`)g=document.createElement(`p`);else if(p.kind===`span`)if(p.styleAttrs[n.byName.ruby.qname]===`container`)g=document.createElement(`ruby`),e.ruby=!0;else if(p.styleAttrs[n.byName.ruby.qname]===`base`)g=document.createElement(`span`);else if(p.styleAttrs[n.byName.ruby.qname]===`text`)g=document.createElement(`rt`);else if(p.styleAttrs[n.byName.ruby.qname]===`baseContainer`)g=document.createElement(`rbc`);else if(p.styleAttrs[n.byName.ruby.qname]===`textContainer`)g=document.createElement(`rtc`);else{if(p.styleAttrs[n.byName.ruby.qname]===`delimiter`)return;g=document.createElement(`span`)}else p.kind===`br`&&(g=document.createElement(`br`));if(g){if(p.lang&&(p.kind!==`region`&&p.lang===h.lang||(g.lang=p.lang)),t.appendChild(g),g.style.margin=`0`,p.kind===`region`){var S=p.styleAttrs[n.byName.writingMode.qname];S===`lrtb`||S===`lr`?(e.ipd=`lr`,e.bpd=`tb`):S===`rltb`||S===`rl`?(e.ipd=`rl`,e.bpd=`tb`):S===`tblr`?(e.ipd=`tb`,e.bpd=`lr`):S!==`tbrl`&&S!==`tb`||(e.ipd=`tb`,e.bpd=`rl`)}else p.kind===`p`&&e.bpd===`tb`&&(e.ipd=p.styleAttrs[n.byName.direction.qname]===`ltr`?`lr`:`rl`);for(var C=0;C<m.length;C++){var w=m[C],T=p.styleAttrs[w.qname];T!==void 0&&w.map!==null&&w.map(e,g,p,T)}var E=g,D=p.styleAttrs[n.byName.linePadding.qname];if(D&&!D.isZero()){var O=D.toUsedLength(e.w,e.h);if(O>0){var k=Math.ceil(O)+`px`;e.bpd===`tb`?(E.style.paddingLeft=k,E.style.paddingRight=k):(E.style.paddingTop=k,E.style.paddingBottom=k),e.lp=D}}var A=p.styleAttrs[n.byName.multiRowAlign.qname];if(A&&A!==`auto`){var j=document.createElement(`span`);j.style.display=`inline-block`,j.style.textAlign=A,g.appendChild(j),E=j,e.mra=A}var M=p.styleAttrs[n.byName.rubyReserve.qname];if(M&&M[0]!==`none`&&(e.rubyReserve=M),p.styleAttrs[n.byName.fillLineGap.qname]&&(e.flg=!0),p.kind===`span`&&p.text){var N=p.styleAttrs[n.byName.textEmphasis.qname];if(N&&N.style!==`none`&&(e.textEmphasis=!0),n.byName.textCombine.qname in p.styleAttrs&&p.styleAttrs[n.byName.textCombine.qname]===`all`)g.textContent=p.text,g._isd_element=p,N&&f(e,g,0,N);else for(var P=``,F=0;F<p.text.length;F++){P+=p.text.charAt(F);var I=p.text.charCodeAt(F);if(I<55296||I>56319||F===p.text.length-1){var L=document.createElement(`span`);L.textContent=P,N&&f(e,L,0,N),g.appendChild(L),P=``,L._isd_element=p}}}if(`contents`in p)for(var R=0;R<p.contents.length;R++)i(e,E,p.contents[R],p);var z=[];if(p.kind===`p`&&(d(e,E,z,null),e.rubyReserve&&=(function(e,t){for(var n=0;n<e.length;n++){var r,i,o=document.createElement(`ruby`),c=document.createElement(`span`);c.textContent=`​`,o.appendChild(c);var l,u=t.rubyReserve[1].toUsedLength(t.w,t.h)+`px`;t.rubyReserve[0]===`both`||t.rubyReserve[0]===`outside`&&e.length==1?((r=document.createElement(`rtc`)).style[v]=_?`after`:`under`,r.textContent=`​`,r.style.fontSize=u,(i=document.createElement(`rtc`)).style[v]=_?`before`:`over`,i.textContent=`​`,i.style.fontSize=u,o.appendChild(r),o.appendChild(i)):((r=document.createElement(`rtc`)).textContent=`​`,r.style.fontSize=u,l=t.rubyReserve[0]===`after`||t.rubyReserve[0]===`outside`&&n>0?_?`after`:t.bpd===`tb`||t.bpd===`rl`?`under`:`over`:_?`before`:t.bpd===`tb`||t.bpd===`rl`?`over`:`under`,r.style[v]=l,o.appendChild(r));for(var d=null,f=0;f<e[n].rbc.length;f++)if(e[n].rbc[f].localName===`ruby`){d=e[n].rbc[f];for(var p=0;p<d.style.length;p++)o.style.setProperty(d.style.item(p),d.style.getPropertyValue(d.style.item(p)));break}(d||=e[n].elements[0].node).parentElement.insertBefore(o,d)}}(z,e),null),(e.ruby||e.rubyReserve)&&(function(e,t){for(var n=0;n<e.length;n++)for(var r=0;r<e[n].rbc.length;r++){var i;e[n].rbc[r].style[v]||(i=_?n===0?`before`:`after`:t.bpd===`tb`||t.bpd===`rl`?n===0?`over`:`under`:n===0?`under`:`over`,e[n].rbc[r].style[v]=i)}}(z,e),e.ruby=null),e.textEmphasis&&=(function(e,t){for(var n=0;n<e.length;n++)for(var r=0;r<e[n].te.length;r++){var i;e[n].te[r].style[b]&&e[n].te[r].style[b]!==`none`||(i=t.bpd===`tb`?n===0?`left over`:`left under`:t.bpd===`rl`?n===0?`right under`:`left under`:n===0?`left under`:`right under`,e[n].te[r].style[b]=i)}}(z,e),null),e.mra&&=(function(e){for(var t=0;t<e.length-1;t++){var n=e[t].elements.length;if(n!==0&&!1===e[t].br){var r=document.createElement(`br`),i=e[t].elements[n-1].node;i.parentElement.insertBefore(r,i.nextSibling)}}}(z),null),e.lp&&=(function(e,t,n){if(e!==null)for(var i=0;i<e.length;i++){var o=e[i].elements.length,c=Math.ceil(t)+`px`,l=`-`+Math.ceil(t)+`px`;if(o!==0){var u=e[i].elements[e[i].start_elem],d=e[i].elements[e[i].end_elem];if(u===d){var f=u.node.getBoundingClientRect();if(f.width==0||f.height==0)continue}n.ipd===`lr`?(u.node.style.marginLeft=l,u.node.style.paddingLeft=c):n.ipd===`rl`?(u.node.style.paddingRight=c,u.node.style.marginRight=l):n.ipd===`tb`&&(u.node.style.paddingTop=c,u.node.style.marginTop=l),n.ipd===`lr`?(r||(d.node.style.marginRight=l),d.node.style.paddingRight=c):n.ipd===`rl`?(d.node.style.paddingLeft=c,r||(d.node.style.marginLeft=l)):n.ipd===`tb`&&(d.node.style.paddingBottom=c,d.node.style.marginBottom=l)}}}(z,e.lp.toUsedLength(e.w,e.h),e),null),function(e,t){for(var n=0;n<e.length;n++)for(var r=e[n],i=1;i<r.elements.length;){var l=r.elements[i-1],u=r.elements[i];c(l.node,u.node,t)?r.elements.splice(i,1):i++}for(var d,f,p=[],m=0;m<e.length;m++)for(var h=0;h<e[m].elements.length;h++)(f=o(d=e[m].elements[h].node,p,!1))&&(d.style.backgroundColor=f);for(var g=0;g<p.length;g++)p[g].style.backgroundColor=``}(z,e),e.flg)){var B=u(E.getBoundingClientRect(),e);(function(e,t,n,r){for(var i=Math.sign(n-t),o=0;o<=e.length;o++){var c,l,u,d;if(c=o===0?Math.round(t):o===e.length?Math.round(n):Math.round((e[o-1].after+e[o].before)/2),o>0&&e[o-1])for(u=0;u<e[o-1].elements.length;u++)l=i*(c-(d=e[o-1].elements[u]).after)+`px`,r.bpd===`lr`?d.node.style.paddingRight=l:r.bpd===`rl`?d.node.style.paddingLeft=l:r.bpd===`tb`&&(d.node.style.paddingBottom=l);if(o<e.length)for(u=0;u<e[o].elements.length;u++)l=i*((d=e[o].elements[u]).before-c)+`px`,r.bpd===`lr`?d.node.style.paddingLeft=l:r.bpd===`rl`?d.node.style.paddingRight=l:r.bpd===`tb`&&(d.node.style.paddingTop=l)}})(z,B.before,B.after,e),e.flg=null}if(p.kind===`region`&&e.bpd===`tb`&&e.enableRollUp&&p.contents.length>0&&p.styleAttrs[n.byName.displayAlign.qname]===`after`){d(e,E,z,null);var V=new l(p.id===``?`_`:p.id,z);if(e.currentISDState[V.id]=V,e.previousISDState&&V.id in e.previousISDState&&e.previousISDState[V.id].plist.length>0&&V.plist.length>1&&V.plist[V.plist.length-2].text===e.previousISDState[V.id].plist[e.previousISDState[V.id].plist.length-1].text){var H=g.firstElementChild,U=V.plist[V.plist.length-1].after-V.plist[V.plist.length-1].before;H.style.bottom=`-`+U+`px`,H.style.transition=`transform 0.4s`,H.style.position=`relative`,H.style.transform=`translateY(-`+U+`px)`}}}else x(e.errorHandler,`Error processing ISD element kind: `+p.kind)}function o(e,t,n){return e.style.backgroundColor?(n&&!t.includes(e)&&t.push(e),e.style.backgroundColor):e.parentElement.nodeName===`SPAN`||e.parentElement.nodeName===`RUBY`||e.parentElement.nodeName===`RBC`||e.parentElement.nodeName===`RTC`||e.parentElement.nodeName===`RT`?o(e.parentElement,t,!0):void 0}function c(e,t,n){if(e.tagName===`SPAN`&&t.tagName===`SPAN`&&e._isd_element===t._isd_element){if(!e._isd_element)return x(n.errorHandler,`Internal error: HTML span is not linked to a source element; cannot merge spans.`),!1;e.textContent+=t.textContent;for(var r=0;r<t.style.length;r++){var i=t.style[r];(i.indexOf(`border`)>=0||i.indexOf(`padding`)>=0||i.indexOf(`margin`)>=0)&&(e.style[i]=t.style[i])}return t.parentElement.removeChild(t),!0}return!1}function l(e,t){this.id=e,this.plist=t}function u(e,t){var n={before:null,after:null,start:null,end:null};return t.bpd===`tb`?(n.before=e.top,n.after=e.bottom,t.ipd===`lr`?(n.start=e.left,n.end=e.right):(n.start=e.right,n.end=e.left)):t.bpd===`lr`?(n.before=e.left,n.after=e.right,n.start=e.top,n.end=e.bottom):t.bpd===`rl`&&(n.before=e.right,n.after=e.left,n.start=e.top,n.end=e.bottom),n}function d(e,t,n,r){if(t.localName!==`rt`&&t.localName!==`rtc`){var i,o,c,l,f=t.style.backgroundColor||r;if(t.childElementCount===0)if(t.localName===`span`||t.localName===`rb`){var p=u(t.getBoundingClientRect(),e);if(n.length!==0&&(i=p.before,o=p.after,c=n[n.length-1].before,o<(l=n[n.length-1].after)&&i>c||l<=o&&c>=i)){var m=Math.sign(p.after-p.before),h=Math.sign(p.end-p.start);m*(p.before-n[n.length-1].before)<0&&(n[n.length-1].before=p.before),m*(p.after-n[n.length-1].after)>0&&(n[n.length-1].after=p.after),h*(p.start-n[n.length-1].start)<0&&(n[n.length-1].start=p.start,n[n.length-1].start_elem=n[n.length-1].elements.length),h*(p.end-n[n.length-1].end)>0&&(n[n.length-1].end=p.end,n[n.length-1].end_elem=n[n.length-1].elements.length)}else n.push({before:p.before,after:p.after,start:p.start,end:p.end,start_elem:0,end_elem:0,elements:[],rbc:[],te:[],text:``,br:!1});n[n.length-1].text+=t.textContent,n[n.length-1].elements.push({node:t,bgcolor:f,before:p.before,after:p.after})}else t.localName===`br`&&n.length!==0&&(n[n.length-1].br=!0);else for(var g=t.firstChild;g;)g.nodeType===Node.ELEMENT_NODE&&(d(e,g,n,f),g.localName===`ruby`||g.localName===`rtc`?n.length>0&&n[n.length-1].rbc.push(g):g.localName===`span`&&g.style[y]&&g.style[y]!==`none`&&n.length>0&&n[n.length-1].te.push(g)),g=g.nextSibling}}function f(e,t,n,r){var i;r.style!==`none`&&(r.style===`auto`?t.style[y]=`filled`:t.style[y]=r.style+` `+r.symbol,(r.position===`before`||r.position===`after`)&&(i=e.bpd===`tb`?r.position===`before`?`left over`:`left under`:e.bpd===`rl`?r.position===`before`?`right under`:`left under`:r.position===`before`?`left under`:`right under`,t.style[b]=i))}function p(e,t){this.qname=e,this.map=t}e.render=function(e,t,n,r,o,c,l,u,d){var f=r||t.clientHeight,p=o||t.clientWidth;if(e.aspectRatio!==null){var m=f*e.aspectRatio;m>p?f=Math.round(p/e.aspectRatio):p=m}var h=document.createElement(`div`);h.style.position=`relative`,h.style.width=p+`px`,h.style.height=f+`px`,h.style.margin=`auto`,h.style.top=0,h.style.bottom=0,h.style.left=0,h.style.right=0,h.style.zIndex=0;var g={h:f,w:p,regionH:null,regionW:null,imgResolver:n,displayForcedOnlyMode:c||!1,isd:e,errorHandler:l,previousISDState:u,enableRollUp:d||!1,currentISDState:{},flg:null,lp:null,mra:null,ipd:null,bpd:null,ruby:null,textEmphasis:null,rubyReserve:null};if(t.appendChild(h),`contents`in e)for(var _=0;_<e.contents.length;_++)i(g,h,e.contents[_],e);return g.currentISDState};for(var m=[new p(`http://www.w3.org/ns/ttml#styling backgroundColor`,(function(e,t,n,r){r[3]!==0&&(t.style.backgroundColor=`rgba(`+r[0].toString()+`,`+r[1].toString()+`,`+r[2].toString()+`,`+(r[3]/255).toString()+`)`)})),new p(`http://www.w3.org/ns/ttml#styling color`,(function(e,t,n,r){t.style.color=`rgba(`+r[0].toString()+`,`+r[1].toString()+`,`+r[2].toString()+`,`+(r[3]/255).toString()+`)`})),new p(`http://www.w3.org/ns/ttml#styling direction`,(function(e,t,n,r){t.style.direction=r})),new p(`http://www.w3.org/ns/ttml#styling display`,(function(e,t,n,r){})),new p(`http://www.w3.org/ns/ttml#styling displayAlign`,(function(e,t,n,r){t.style.display=`flex`,t.style.flexDirection=`column`,r===`before`?t.style.justifyContent=`flex-start`:r===`center`?t.style.justifyContent=`center`:r===`after`&&(t.style.justifyContent=`flex-end`)})),new p(`http://www.w3.org/ns/ttml#styling extent`,(function(e,t,n,r){e.regionH=r.h.toUsedLength(e.w,e.h),e.regionW=r.w.toUsedLength(e.w,e.h);var i=0,o=0,c=n.styleAttrs[`http://www.w3.org/ns/ttml#styling padding`];c&&(i=c[0].toUsedLength(e.w,e.h)+c[2].toUsedLength(e.w,e.h),o=c[1].toUsedLength(e.w,e.h)+c[3].toUsedLength(e.w,e.h)),t.style.height=e.regionH-i+`px`,t.style.width=e.regionW-o+`px`})),new p(`http://www.w3.org/ns/ttml#styling fontFamily`,(function(e,t,n,r){for(var i=[],o=0;o<r.length;o++)r[o]=r[o].trim(),r[o]===`monospaceSerif`?(i.push(`Courier New`),i.push(`"Liberation Mono"`),i.push(`Courier`),i.push(`monospace`)):r[o]===`proportionalSansSerif`?(i.push(`Arial`),i.push(`Helvetica`),i.push(`"Liberation Sans"`),i.push(`sans-serif`)):r[o]===`monospace`?i.push(`monospace`):r[o]===`sansSerif`?i.push(`sans-serif`):r[o]===`serif`?i.push(`serif`):r[o]===`monospaceSansSerif`?(i.push(`Consolas`),i.push(`monospace`)):r[o]===`proportionalSerif`?i.push(`serif`):i.push(r[o]);if(i.length>0){for(var c=[i[0]],l=1;l<i.length;l++)c.indexOf(i[l])==-1&&c.push(i[l]);i=c}t.style.fontFamily=i.join(`,`)})),new p(`http://www.w3.org/ns/ttml#styling shear`,(function(e,t,n,r){if(r!==0){var i=-.9*r;e.bpd===`tb`?t.style.transform=`skewX(`+i+`deg)`:t.style.transform=`skewY(`+i+`deg)`}})),new p(`http://www.w3.org/ns/ttml#styling fontSize`,(function(e,t,n,r){t.style.fontSize=r.toUsedLength(e.w,e.h)+`px`})),new p(`http://www.w3.org/ns/ttml#styling fontStyle`,(function(e,t,n,r){t.style.fontStyle=r})),new p(`http://www.w3.org/ns/ttml#styling fontWeight`,(function(e,t,n,r){t.style.fontWeight=r})),new p(`http://www.w3.org/ns/ttml#styling lineHeight`,(function(e,t,n,r){t.style.lineHeight=r===`normal`?`normal`:r.toUsedLength(e.w,e.h)+`px`})),new p(`http://www.w3.org/ns/ttml#styling opacity`,(function(e,t,n,r){t.style.opacity=r})),new p(`http://www.w3.org/ns/ttml#styling origin`,(function(e,t,n,r){t.style.top=r.h.toUsedLength(e.w,e.h)+`px`,t.style.left=r.w.toUsedLength(e.w,e.h)+`px`})),new p(`http://www.w3.org/ns/ttml#styling overflow`,(function(e,t,n,r){t.style.overflow=r})),new p(`http://www.w3.org/ns/ttml#styling padding`,(function(e,t,n,r){var i=[];i[0]=r[0].toUsedLength(e.w,e.h)+`px`,i[1]=r[3].toUsedLength(e.w,e.h)+`px`,i[2]=r[2].toUsedLength(e.w,e.h)+`px`,i[3]=r[1].toUsedLength(e.w,e.h)+`px`,t.style.padding=i.join(` `)})),new p(`http://www.w3.org/ns/ttml#styling position`,(function(e,t,n,r){t.style.top=r.h.toUsedLength(e.w,e.h)+`px`,t.style.left=r.w.toUsedLength(e.w,e.h)+`px`})),new p(`http://www.w3.org/ns/ttml#styling rubyAlign`,(function(e,t,n,r){t.style.rubyAlign=r===`spaceAround`?`space-around`:`center`})),new p(`http://www.w3.org/ns/ttml#styling rubyPosition`,(function(e,t,n,r){var i;r!==`before`&&r!==`after`||(i=_?r:e.bpd===`tb`||e.bpd===`rl`?r===`before`?`over`:`under`:r===`before`?`under`:`over`,t.parentElement.style[v]=i)})),new p(`http://www.w3.org/ns/ttml#styling showBackground`,null),new p(`http://www.w3.org/ns/ttml#styling textAlign`,(function(e,t,n,r){var i=r===`start`?e.ipd===`rl`?`right`:`left`:r===`end`?e.ipd===`rl`?`left`:`right`:r;t.style.textAlign=i})),new p(`http://www.w3.org/ns/ttml#styling textDecoration`,(function(e,t,n,r){t.style.textDecoration=r.join(` `).replace(`lineThrough`,`line-through`)})),new p(`http://www.w3.org/ns/ttml#styling textOutline`,(function(e,t,n,r){})),new p(`http://www.w3.org/ns/ttml#styling textShadow`,(function(e,t,r,i){var o=r.styleAttrs[n.byName.textOutline.qname];if(i===`none`&&o===`none`)t.style.textShadow=``;else{var c=[];if(o!==`none`){var l=`rgba(`+o.color[0].toString()+`,`+o.color[1].toString()+`,`+o.color[2].toString()+`,`+(o.color[3]/255).toString()+`)`;c.push(`1px 1px 1px `+l),c.push(`-1px 1px 1px `+l),c.push(`1px -1px 1px `+l),c.push(`-1px -1px 1px `+l)}if(i!==`none`)for(var u=0;u<i.length;u++)c.push(i[u].x_off.toUsedLength(e.w,e.h)+`px `+i[u].y_off.toUsedLength(e.w,e.h)+`px `+i[u].b_radius.toUsedLength(e.w,e.h)+`px rgba(`+i[u].color[0].toString()+`,`+i[u].color[1].toString()+`,`+i[u].color[2].toString()+`,`+(i[u].color[3]/255).toString()+`)`);t.style.textShadow=c.join(`,`)}})),new p(`http://www.w3.org/ns/ttml#styling textCombine`,(function(e,t,n,r){t.style.textCombineUpright=r})),new p(`http://www.w3.org/ns/ttml#styling textEmphasis`,(function(e,t,n,r){})),new p(`http://www.w3.org/ns/ttml#styling unicodeBidi`,(function(e,t,n,r){var i=r===`bidiOverride`?`bidi-override`:r;t.style.unicodeBidi=i})),new p(`http://www.w3.org/ns/ttml#styling visibility`,(function(e,t,n,r){t.style.visibility=r})),new p(`http://www.w3.org/ns/ttml#styling wrapOption`,(function(e,t,n,r){r===`wrap`?n.space===`preserve`?t.style.whiteSpace=`pre-wrap`:t.style.whiteSpace=`normal`:n.space===`preserve`?t.style.whiteSpace=`pre`:t.style.whiteSpace=`noWrap`})),new p(`http://www.w3.org/ns/ttml#styling writingMode`,(function(e,t,n,r){r===`lrtb`||r===`lr`||r===`rltb`||r===`rl`?t.style.writingMode=`horizontal-tb`:r===`tblr`?t.style.writingMode=`vertical-lr`:r!==`tbrl`&&r!==`tb`||(t.style.writingMode=`vertical-rl`)})),new p(`http://www.w3.org/ns/ttml#styling zIndex`,(function(e,t,n,r){t.style.zIndex=r})),new p(`http://www.w3.org/ns/ttml/profile/imsc1#styling forcedDisplay`,(function(e,t,n,r){e.displayForcedOnlyMode&&!1===r&&(t.style.visibility=`hidden`)}))],h={},g=0;g<m.length;g++)h[m[g].qname]=m[g];var _=`webkitRubyPosition`in window.getComputedStyle(document.documentElement),v=_?`webkitRubyPosition`:`rubyPosition`,y=`webkitTextEmphasisStyle`in window.getComputedStyle(document.documentElement)?`webkitTextEmphasisStyle`:`textEmphasisStyle`,b=`webkitTextEmphasisPosition`in window.getComputedStyle(document.documentElement)?`webkitTextEmphasisPosition`:`textEmphasisPosition`;function x(e,t){if(e&&e.error&&e.error(t))throw t}})(t,typeof imscNames>`u`?n(977):imscNames,typeof imscStyles>`u`?n(1219):imscStyles,typeof imscUtils>`u`?n(6404):imscUtils)},8905:function(e,t,n){(function(e,t,n,r){e.generateISD=function(e,t,r){var i,c=new u(e),l={},d={},f=e.head.styling.initials[n.byName.showBackground.qname],p=e.head.styling.initials[n.byName.backgroundColor.qname];for(var m in e.head.layout.regions)if(e.head.layout.regions.hasOwnProperty(m)){var h=e.head.layout.regions[m],g=h.styleAttrs[n.byName.showBackground.qname]||f,_=h.styleAttrs[n.byName.backgroundColor.qname]||p;d[h.id]=(g===`always`||g===void 0)&&_!==void 0&&!(t<h.begin||t>=h.end)}for(var v in e.body&&e.body.regionID&&(d[e.body.regionID]=!0),i=e.body===null?null:function e(t,n){if(n.contents){var r={};for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i]);return r.contents=[],n.contents.filter((function(e){return!(t<e.begin||t>=e.end)})).forEach((function(n){var i=e(t,n);i.regionID&&(d[i.regionID]=!0),i!==null&&r.contents.push(i)})),r}return n}(t,e.body),d[``]!==void 0&&(d[``]=!0),d)if(d[v]){var y=o(e,t,e.head.layout.regions[v],i,null,``,e.head.layout.regions[v],r,l);y!==null&&c.contents.push(y.element)}return c};var i=[n.byName.color.qname,n.byName.textCombine.qname,n.byName.textDecoration.qname,n.byName.textEmphasis.qname,n.byName.textOutline.qname,n.byName.textShadow.qname];function o(e,t,u,p,m,h,g,_,v){if(t<g.begin||t>=g.end)return null;var y=`regionID`in g&&g.regionID!==``?g.regionID:h;if(m!==null&&y!==u.id&&(!(`contents`in g)||`contents`in g&&g.contents.length===0||y!==``))return null;var b=new d(g);if(`sets`in g)for(var x=0;x<g.sets.length;x++)t<g.sets[x].begin||t>=g.sets[x].end||(b.styleAttrs[g.sets[x].qname]=g.sets[x].value);var S={};for(var C in b.styleAttrs)if(b.styleAttrs.hasOwnProperty(C)&&(S[C]=!0,b.kind===`region`&&C===n.byName.writingMode.qname&&!(n.byName.direction.qname in b.styleAttrs))){var w=b.styleAttrs[C];w===`lrtb`||w===`lr`?b.styleAttrs[n.byName.direction.qname]=`ltr`:w!==`rltb`&&w!==`rl`||(b.styleAttrs[n.byName.direction.qname]=`rtl`)}if(m!==null)for(var T=0;T<n.all.length;T++){var E=n.all[T];if(E.qname===n.byName.textDecoration.qname){var D=m.styleAttrs[E.qname],O=b.styleAttrs[E.qname],k=[];O===void 0?k=D:O.indexOf(`none`)===-1?((O.indexOf(`noUnderline`)===-1&&D.indexOf(`underline`)!==-1||O.indexOf(`underline`)!==-1)&&k.push(`underline`),(O.indexOf(`noLineThrough`)===-1&&D.indexOf(`lineThrough`)!==-1||O.indexOf(`lineThrough`)!==-1)&&k.push(`lineThrough`),(O.indexOf(`noOverline`)===-1&&D.indexOf(`overline`)!==-1||O.indexOf(`overline`)!==-1)&&k.push(`overline`)):k.push(`none`),b.styleAttrs[E.qname]=k}else if(E.qname!==n.byName.fontSize.qname||E.qname in b.styleAttrs||b.kind!==`span`||b.styleAttrs[n.byName.ruby.qname]!==`textContainer`)if(E.qname!==n.byName.fontSize.qname||E.qname in b.styleAttrs||b.kind!==`span`||b.styleAttrs[n.byName.ruby.qname]!==`text`)E.inherit&&E.qname in m.styleAttrs&&!(E.qname in b.styleAttrs)&&(b.styleAttrs[E.qname]=m.styleAttrs[E.qname]);else{var A=m.styleAttrs[n.byName.fontSize.qname];m.styleAttrs[n.byName.ruby.qname]===`textContainer`?b.styleAttrs[E.qname]=A:b.styleAttrs[E.qname]=new r.ComputedLength(.5*A.rw,.5*A.rh)}else{var j=m.styleAttrs[n.byName.fontSize.qname];b.styleAttrs[E.qname]=new r.ComputedLength(.5*j.rw,.5*j.rh)}}for(var M=0;M<n.all.length;M++){var N=n.all[M];if(!(N.qname in b.styleAttrs)&&!(N.qname===n.byName.position.qname&&n.byName.origin.qname in b.styleAttrs||N.qname===n.byName.origin.qname&&n.byName.position.qname in b.styleAttrs)){var P=e.head.styling.initials[N.qname]||N.initial;if(P!==null&&(b.kind===`region`||!1===N.inherit&&P!==null)){var F=N.parse(P);F===null?f(_,`Invalid initial value for '`+N.qname+`' on element '`+b.kind):(b.styleAttrs[N.qname]=F,S[N.qname]=!0)}}}for(var I=0;I<n.all.length;I++){var L=n.all[I];if(L.qname in S&&L.compute!==null){var R=L.compute(e,m,b,b.styleAttrs[L.qname],v);R===null?(b.styleAttrs[L.qname]=L.compute(e,m,b,L.parse(L.initial),v),f(_,`Style '`+L.qname+`' on element '`+b.kind+`' cannot be computed`)):b.styleAttrs[L.qname]=R}}if(b.styleAttrs[n.byName.display.qname]===`none`)return null;var z=null;m===null?z=p===null?[]:[p]:`contents`in g&&(z=g.contents);for(var B=0;z!==null&&B<z.length;B++){var V=o(e,t,u,p,b,y,z[B],_,v);V!==null&&b.contents.push(V.element)}for(var H in b.styleAttrs)if(b.styleAttrs.hasOwnProperty(H)){var U=!1;if(b.kind===`span`){var W=b.styleAttrs[n.byName.ruby.qname];(U=(W===`container`||W===`textContainer`||W===`baseContainer`)&&i.indexOf(H)!==-1)||(U=W!==`container`&&H===n.byName.rubyAlign.qname),U||=!(W===`textContainer`||W===`text`)&&H===n.byName.rubyPosition.qname}if(!U){var G=n.byQName[H];`applies`in G&&(U=G.applies.indexOf(b.kind)===-1)}U&&delete b.styleAttrs[H]}var K=b.styleAttrs[n.byName.ruby.qname];if(b.kind===`p`||b.kind===`span`&&(K===`textContainer`||K===`text`)){var ee=[];c(b,ee),function(e){for(var t,n=0;n<e.length;)if((t=e[n]).kind!==`br`&&t.space!==`preserve`){var r=t.text.replace(/[\t\r\n ]+/g,` `);/^[ ]/.test(r)&&(n===0||(i=e[n-1]).kind===`br`||/[\r\n\t ]$/.test(i.text))&&(r=r.substring(1)),t.text=r,r.length===0?e.splice(n,1):n++}else n++;var i,o;for(n=0;n<e.length;n++)(t=e[n]).kind!==`br`&&t.space!==`preserve`?/[ ]$/.test(t.text)&&(n===e.length-1||(o=e[n+1]).kind===`br`||o.space===`preserve`&&/^[\r\n]/.test(o.text))&&(t.text=t.text.slice(0,-1)):n++}(ee),l(b)}return b.kind===`div`&&n.byName.backgroundImage.qname in b.styleAttrs||b.kind===`br`||b.kind===`image`||`contents`in b&&b.contents.length>0||b.kind===`span`&&b.text!==null||b.kind===`region`&&b.styleAttrs[n.byName.showBackground.qname]===`always`?{region_id:y,element:b}:null}function c(e,t){if(`contents`in e)for(var r=0;r<e.contents.length;r++){var i=e.contents[r],o=i.styleAttrs[n.byName.ruby.qname];(i.kind!==`span`||o!==`textContainer`&&o!==`text`)&&(`contents`in i?c(i,t):(i.kind===`span`&&i.text.length!==0||i.kind===`br`)&&t.push(i))}}function l(e){if(e.kind===`br`)return!1;if(`text`in e)return e.text.length===0;if(`contents`in e){for(var t=e.contents.length;t--;)l(e.contents[t])&&e.contents.splice(t,1);return e.contents.length===0}}function u(e){this.contents=[],this.aspectRatio=e.aspectRatio,this.lang=e.lang}function d(e){for(var t in this.kind=e.kind||`region`,this.lang=e.lang,e.id&&(this.id=e.id),this.styleAttrs={},e.styleAttrs)e.styleAttrs.hasOwnProperty(t)&&(this.styleAttrs[t]=e.styleAttrs[t]);`src`in e&&(this.src=e.src),`type`in e&&(this.type=e.type),`text`in e?this.text=e.text:(this.kind===`region`||`contents`in e)&&(this.contents=[]),`space`in e&&(this.space=e.space)}function f(e,t){if(e&&e.error&&e.error(t))throw t}})(t,typeof imscNames>`u`?n(977):imscNames,typeof imscStyles>`u`?n(1219):imscStyles,typeof imscUtils>`u`?n(6404):imscUtils)},7640:function(e,t,n){t.generateISD=n(8905).generateISD,t.fromXML=n(6739).fromXML,t.renderHTML=n(1612).render},977:function(e,t){(function(e){e.ns_tt=`http://www.w3.org/ns/ttml`,e.ns_tts=`http://www.w3.org/ns/ttml#styling`,e.ns_ttp=`http://www.w3.org/ns/ttml#parameter`,e.ns_xml=`http://www.w3.org/XML/1998/namespace`,e.ns_itts=`http://www.w3.org/ns/ttml/profile/imsc1#styling`,e.ns_ittp=`http://www.w3.org/ns/ttml/profile/imsc1#parameter`,e.ns_smpte=`http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt`,e.ns_ebutts=`urn:ebu:tt:style`})(t)},1219:function(e,t,n){(function(e,t,n){function r(e,t,n,r,i,o,c,l){this.name=t,this.ns=e,this.qname=e+` `+t,this.inherit=i,this.animatable=o,this.initial=n,this.applies=r,this.parse=c,this.compute=l}for(var i in e.all=[new r(t.ns_tts,`backgroundColor`,`transparent`,[`body`,`div`,`p`,`region`,`span`],!1,!0,n.parseColor,null),new r(t.ns_tts,`color`,`white`,[`span`],!0,!0,n.parseColor,null),new r(t.ns_tts,`direction`,`ltr`,[`p`,`span`],!0,!0,(function(e){return e}),null),new r(t.ns_tts,`display`,`auto`,[`body`,`div`,`p`,`region`,`span`],!1,!0,(function(e){return e}),null),new r(t.ns_tts,`displayAlign`,`before`,[`region`],!1,!0,(function(e){return e}),null),new r(t.ns_tts,`extent`,`auto`,[`tt`,`region`],!1,!0,(function(e){if(e===`auto`)return e;var t=e.split(` `);if(t.length!==2)return null;var r=n.parseLength(t[0]),i=n.parseLength(t[1]);return i&&r?{h:i,w:r}:null}),(function(e,t,r,i,o){var c,l;if(i===`auto`)c=new n.ComputedLength(0,1);else if((c=n.toComputedLength(i.h.value,i.h.unit,null,e.dimensions.h,null,e.pxLength.h))===null)return null;if(i===`auto`)l=new n.ComputedLength(1,0);else if((l=n.toComputedLength(i.w.value,i.w.unit,null,e.dimensions.w,null,e.pxLength.w))===null)return null;return{h:c,w:l}})),new r(t.ns_tts,`fontFamily`,`default`,[`span`,`p`],!0,!0,(function(e){for(var t=e.split(`,`),n=[],r=0;r<t.length;r++)t[r]=t[r].trim(),t[r].charAt(0)!==`'`&&t[r].charAt(0)!==`"`&&t[r]===`default`?n.push(`monospaceSerif`):n.push(t[r]);return n}),null),new r(t.ns_tts,`shear`,`0%`,[`p`],!0,!0,n.parseLength,(function(e,t,n,r){return r.unit===`%`?Math.abs(r.value)>100?100*Math.sign(r.value):r.value:null})),new r(t.ns_tts,`fontSize`,`1c`,[`span`,`p`],!0,!0,n.parseLength,(function(t,r,i,o,c){return n.toComputedLength(o.value,o.unit,r===null?t.cellLength.h:r.styleAttrs[e.byName.fontSize.qname],r===null?t.cellLength.h:r.styleAttrs[e.byName.fontSize.qname],t.cellLength.h,t.pxLength.h)})),new r(t.ns_tts,`fontStyle`,`normal`,[`span`,`p`],!0,!0,(function(e){return e}),null),new r(t.ns_tts,`fontWeight`,`normal`,[`span`,`p`],!0,!0,(function(e){return e}),null),new r(t.ns_tts,`lineHeight`,`normal`,[`p`],!0,!0,(function(e){return e===`normal`?e:n.parseLength(e)}),(function(t,r,i,o,c){var l;if(o===`normal`)l=o;else if((l=n.toComputedLength(o.value,o.unit,i.styleAttrs[e.byName.fontSize.qname],i.styleAttrs[e.byName.fontSize.qname],t.cellLength.h,t.pxLength.h))===null)return null;return l})),new r(t.ns_tts,`opacity`,1,[`region`],!1,!0,parseFloat,null),new r(t.ns_tts,`origin`,`auto`,[`region`],!1,!0,(function(e){if(e===`auto`)return e;var t=e.split(` `);if(t.length!==2)return null;var r=n.parseLength(t[0]),i=n.parseLength(t[1]);return i&&r?{h:i,w:r}:null}),(function(e,t,r,i,o){var c,l;if(i===`auto`)c=new n.ComputedLength(0,0);else if((c=n.toComputedLength(i.h.value,i.h.unit,null,e.dimensions.h,null,e.pxLength.h))===null)return null;if(i===`auto`)l=new n.ComputedLength(0,0);else if((l=n.toComputedLength(i.w.value,i.w.unit,null,e.dimensions.w,null,e.pxLength.w))===null)return null;return{h:c,w:l}})),new r(t.ns_tts,`overflow`,`hidden`,[`region`],!1,!0,(function(e){return e}),null),new r(t.ns_tts,`padding`,`0px`,[`region`],!1,!0,(function(e){var t=e.split(` `);if(t.length>4)return null;for(var r=[],i=0;i<t.length;i++){var o=n.parseLength(t[i]);if(!o)return null;r.push(o)}return r}),(function(t,r,i,o,c){var l;if(o.length===1)l=[o[0],o[0],o[0],o[0]];else if(o.length===2)l=[o[0],o[1],o[0],o[1]];else if(o.length===3)l=[o[0],o[1],o[2],o[1]];else{if(o.length!==4)return null;l=[o[0],o[1],o[2],o[3]]}var u=i.styleAttrs[e.byName.writingMode.qname];if(u===`lrtb`||u===`lr`)l=[l[0],l[3],l[2],l[1]];else if(u===`rltb`||u===`rl`)l=[l[0],l[1],l[2],l[3]];else if(u===`tblr`)l=[l[3],l[0],l[1],l[2]];else{if(u!==`tbrl`&&u!==`tb`)return null;l=[l[3],l[2],l[1],l[0]]}for(var d=[],f=0;f<l.length;f++)if(l[f].value===0)d[f]=new n.ComputedLength(0,0);else if(d[f]=n.toComputedLength(l[f].value,l[f].unit,i.styleAttrs[e.byName.fontSize.qname],f===0||f===2?i.styleAttrs[e.byName.extent.qname].h:i.styleAttrs[e.byName.extent.qname].w,f===0||f===2?t.cellLength.h:t.cellLength.w,f===0||f===2?t.pxLength.h:t.pxLength.w),d[f]===null)return null;return d})),new r(t.ns_tts,`position`,`top left`,[`region`],!1,!0,(function(e){return n.parsePosition(e)}),(function(t,r,i,o){var c,l;return(c=n.toComputedLength(o.v.offset.value,o.v.offset.unit,null,new n.ComputedLength(-i.styleAttrs[e.byName.extent.qname].h.rw,t.dimensions.h.rh-i.styleAttrs[e.byName.extent.qname].h.rh),null,t.pxLength.h))===null?null:(o.v.edge===`bottom`&&(c=new n.ComputedLength(-c.rw-i.styleAttrs[e.byName.extent.qname].h.rw,t.dimensions.h.rh-c.rh-i.styleAttrs[e.byName.extent.qname].h.rh)),l=n.toComputedLength(o.h.offset.value,o.h.offset.unit,null,new n.ComputedLength(t.dimensions.w.rw-i.styleAttrs[e.byName.extent.qname].w.rw,-i.styleAttrs[e.byName.extent.qname].w.rh),null,t.pxLength.w),c===null?null:(o.h.edge===`right`&&(l=new n.ComputedLength(t.dimensions.w.rw-l.rw-i.styleAttrs[e.byName.extent.qname].w.rw,-l.rh-i.styleAttrs[e.byName.extent.qname].w.rh)),{h:c,w:l}))})),new r(t.ns_tts,`ruby`,`none`,[`span`],!1,!0,(function(e){return e}),null),new r(t.ns_tts,`rubyAlign`,`center`,[`span`],!0,!0,(function(e){return e!==`center`&&e!==`spaceAround`?null:e}),null),new r(t.ns_tts,`rubyPosition`,`outside`,[`span`],!0,!0,(function(e){return e}),null),new r(t.ns_tts,`rubyReserve`,`none`,[`p`],!0,!0,(function(e){var t=e.split(` `),r=[null,null];if(t.length===0||t.length>2||t[0]!==`none`&&t[0]!==`both`&&t[0]!==`after`&&t[0]!==`before`&&t[0]!==`outside`)return null;if(r[0]=t[0],t.length===2&&t[0]!==`none`){var i=n.parseLength(t[1]);if(!i)return null;r[1]=i}return r}),(function(t,r,i,o,c){if(o[0]===`none`)return o;var l;return(l=o[1]===null?new n.ComputedLength(.5*i.styleAttrs[e.byName.fontSize.qname].rw,.5*i.styleAttrs[e.byName.fontSize.qname].rh):n.toComputedLength(o[1].value,o[1].unit,i.styleAttrs[e.byName.fontSize.qname],i.styleAttrs[e.byName.fontSize.qname],t.cellLength.h,t.pxLength.h))===null?null:[o[0],l]})),new r(t.ns_tts,`showBackground`,`always`,[`region`],!1,!0,(function(e){return e}),null),new r(t.ns_tts,`textAlign`,`start`,[`p`],!0,!0,(function(e){return e}),(function(e,t,n,r,i){return r===`left`?`start`:r===`right`?`end`:r})),new r(t.ns_tts,`textCombine`,`none`,[`span`],!0,!0,(function(e){return e===`none`||e===`all`?e:null}),null),new r(t.ns_tts,`textDecoration`,`none`,[`span`],!0,!0,(function(e){return e.split(` `)}),null),new r(t.ns_tts,`textEmphasis`,`none`,[`span`],!0,!0,(function(e){for(var t=e.split(` `),r={style:null,symbol:null,color:null,position:null},i=0;i<t.length;i++)if(t[i]===`none`||t[i]===`auto`)r.style=t[i];else if(t[i]===`filled`||t[i]===`open`)r.style=t[i];else if(t[i]===`circle`||t[i]===`dot`||t[i]===`sesame`)r.symbol=t[i];else if(t[i]===`current`)r.color=t[i];else if(t[i]===`outside`||t[i]===`before`||t[i]===`after`)r.position=t[i];else if(r.color=n.parseColor(t[i]),r.color===null)return null;return r.style==null&&r.symbol==null?r.style=`auto`:(r.symbol=r.symbol||`circle`,r.style=r.style||`filled`),r.position=r.position||`outside`,r.color=r.color||`current`,r}),null),new r(t.ns_tts,`textOutline`,`none`,[`span`],!0,!0,(function(e){if(e===`none`)return e;var t={},r=e.split(` `);if(r.length===0||r.length>2)return null;var i=n.parseColor(r[0]);if(t.color=i,i!==null&&r.shift(),r.length!==1)return null;var o=n.parseLength(r[0]);return o?(t.thickness=o,t):null}),(function(t,r,i,o,c){if(o===`none`)return o;var l={};return o.color===null?l.color=i.styleAttrs[e.byName.color.qname]:l.color=o.color,l.thickness=n.toComputedLength(o.thickness.value,o.thickness.unit,i.styleAttrs[e.byName.fontSize.qname],i.styleAttrs[e.byName.fontSize.qname],t.cellLength.h,t.pxLength.h),l.thickness===null?null:l})),new r(t.ns_tts,`textShadow`,`none`,[`span`],!0,!0,n.parseTextShadow,(function(t,r,i,o){if(o===`none`)return o;for(var c=[],l=0;l<o.length;l++){var u={};if(u.x_off=n.toComputedLength(o[l][0].value,o[l][0].unit,null,i.styleAttrs[e.byName.fontSize.qname],null,t.pxLength.w),u.x_off===null||(u.y_off=n.toComputedLength(o[l][1].value,o[l][1].unit,null,i.styleAttrs[e.byName.fontSize.qname],null,t.pxLength.h),u.y_off===null))return null;if(o[l][2]===null)u.b_radius=0;else if(u.b_radius=n.toComputedLength(o[l][2].value,o[l][2].unit,null,i.styleAttrs[e.byName.fontSize.qname],null,t.pxLength.h),u.b_radius===null)return null;o[l][3]===null?u.color=i.styleAttrs[e.byName.color.qname]:u.color=o[l][3],c.push(u)}return c})),new r(t.ns_tts,`unicodeBidi`,`normal`,[`span`,`p`],!1,!0,(function(e){return e}),null),new r(t.ns_tts,`visibility`,`visible`,[`body`,`div`,`p`,`region`,`span`],!0,!0,(function(e){return e}),null),new r(t.ns_tts,`wrapOption`,`wrap`,[`span`],!0,!0,(function(e){return e}),null),new r(t.ns_tts,`writingMode`,`lrtb`,[`region`],!1,!0,(function(e){return e}),null),new r(t.ns_tts,`zIndex`,`auto`,[`region`],!1,!0,(function(e){var t;return e===`auto`?t=e:(t=parseInt(e),isNaN(t)&&(t=null)),t}),null),new r(t.ns_ebutts,`linePadding`,`0c`,[`p`],!0,!1,n.parseLength,(function(e,t,r,i,o){return n.toComputedLength(i.value,i.unit,null,null,e.cellLength.w,null)})),new r(t.ns_ebutts,`multiRowAlign`,`auto`,[`p`],!0,!1,(function(e){return e}),null),new r(t.ns_smpte,`backgroundImage`,null,[`div`],!1,!1,(function(e){return e}),null),new r(t.ns_itts,`forcedDisplay`,`false`,[`body`,`div`,`p`,`region`,`span`],!0,!0,(function(e){return e===`true`}),null),new r(t.ns_itts,`fillLineGap`,`false`,[`p`],!0,!0,(function(e){return e===`true`}),null)],e.byQName={},e.all)e.byQName[e.all[i].qname]=e.all[i];for(var o in e.byName={},e.all)e.byName[e.all[o].name]=e.all[o]})(t,typeof imscNames>`u`?n(977):imscNames,typeof imscUtils>`u`?n(6404):imscUtils)},6404:function(e,t){(function(e){var t=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?/,n=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,r=/rgba\(\s*(\d+),\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,i={transparent:[0,0,0,0],black:[0,0,0,255],silver:[192,192,192,255],gray:[128,128,128,255],white:[255,255,255,255],maroon:[128,0,0,255],red:[255,0,0,255],purple:[128,0,128,255],fuchsia:[255,0,255,255],magenta:[255,0,255,255],green:[0,128,0,255],lime:[0,255,0,255],olive:[128,128,0,255],yellow:[255,255,0,255],navy:[0,0,128,255],blue:[0,0,255,255],teal:[0,128,128,255],aqua:[0,255,255,255],cyan:[0,255,255,255]};e.parseColor=function(e){var o,c=null,l=i[e.toLowerCase()];return l===void 0?(o=t.exec(e))===null?(o=n.exec(e))===null?(o=r.exec(e))!==null&&(c=[parseInt(o[1]),parseInt(o[2]),parseInt(o[3]),parseInt(o[4])]):c=[parseInt(o[1]),parseInt(o[2]),parseInt(o[3]),255]:c=[parseInt(o[1],16),parseInt(o[2],16),parseInt(o[3],16),o[4]===void 0?255:parseInt(o[4],16)]:c=l,c};var o=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%|rh|rw)$/;e.parseLength=function(e){var t,n=null;return(t=o.exec(e))!==null&&(n={value:parseFloat(t[1]),unit:t[2]}),n},e.parseTextShadow=function(t){for(var n=t.match(/([^\(,\)]|\([^\)]+\))+/g),r=[],i=0;i<n.length;i++){var o=n[i].split(` `);if(o.length===1&&o[0]===`none`)return`none`;if(o.length>1&&o.length<5){var c=[null,null,null,null],l=e.parseLength(o.shift());if(l===null||(c[0]=l,(l=e.parseLength(o.shift()))===null))return null;if(c[1]=l,o.length===0){r.push(c);continue}if((l=e.parseLength(o[0]))!==null&&(c[2]=l,o.shift()),o.length===0){r.push(c);continue}var u=e.parseColor(o[0]);if(u===null)return null;c[3]=u,r.push(c)}}return r},e.parsePosition=function(t){var n=t.split(` `),r=function(e){return e===`center`||e===`left`||e===`top`||e===`bottom`||e===`right`};if(n.length>4)return null;for(var i=0;i<n.length;i++)if(!r(n[i])){var o=e.parseLength(n[i]);if(o===null)return null;n[i]=o}for(var c={h:{edge:`left`,offset:{value:50,unit:`%`}},v:{edge:`top`,offset:{value:50,unit:`%`}}},l=0;l<n.length;){var u=n[l++];if(r(u)){var d={value:0,unit:`%`};n.length!==2&&l<n.length&&!r(n[l])&&(d=n[l++]),u===`right`?(c.h.edge=u,c.h.offset=d):u===`bottom`?(c.v.edge=u,c.v.offset=d):u===`left`?c.h.offset=d:u===`top`&&(c.v.offset=d)}else{if(n.length!==1&&n.length!==2)return null;l===1?c.h.offset=u:c.v.offset=u}}return c},e.ComputedLength=function(e,t){this.rw=e,this.rh=t},e.ComputedLength.prototype.toUsedLength=function(e,t){return e*this.rw+t*this.rh},e.ComputedLength.prototype.isZero=function(){return this.rw===0&&this.rh===0},e.toComputedLength=function(t,n,r,i,o,c){return n===`%`&&i?new e.ComputedLength(i.rw*t/100,i.rh*t/100):n===`em`&&r?new e.ComputedLength(r.rw*t,r.rh*t):n===`c`&&o?new e.ComputedLength(t*o.rw,t*o.rh):n===`px`&&c?new e.ComputedLength(t*c.rw,t*c.rh):n===`rh`?new e.ComputedLength(0,t/100):n===`rw`?new e.ComputedLength(t/100,0):null}})(t)},7523:function(e){typeof Object.create==`function`?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},3282:function(e){function t(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}function n(e,t){for(var n,r=``,i=0,o=-1,c=0,l=0;l<=e.length;++l){if(l<e.length)n=e.charCodeAt(l);else{if(n===47)break;n=47}if(n===47){if(!(o===l-1||c===1))if(o!==l-1&&c===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var u=r.lastIndexOf(`/`);if(u!==r.length-1){u===-1?(r=``,i=0):i=(r=r.slice(0,u)).length-1-r.lastIndexOf(`/`),o=l,c=0;continue}}else if(r.length===2||r.length===1){r=``,i=0,o=l,c=0;continue}}t&&(r.length>0?r+=`/..`:r=`..`,i=2)}else r.length>0?r+=`/`+e.slice(o+1,l):r=e.slice(o+1,l),i=l-o-1;o=l,c=0}else n===46&&c!==-1?++c:c=-1}return r}var r={resolve:function(){for(var e,r=``,i=!1,o=arguments.length-1;o>=-1&&!i;o--){var c;o>=0?c=arguments[o]:(e===void 0&&(e=process.cwd()),c=e),t(c),c.length!==0&&(r=c+`/`+r,i=c.charCodeAt(0)===47)}return r=n(r,!i),i?r.length>0?`/`+r:`/`:r.length>0?r:`.`},normalize:function(e){if(t(e),e.length===0)return`.`;var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return(e=n(e,!r)).length!==0||r||(e=`.`),e.length>0&&i&&(e+=`/`),r?`/`+e:e},isAbsolute:function(e){return t(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return`.`;for(var e,n=0;n<arguments.length;++n){var i=arguments[n];t(i),i.length>0&&(e===void 0?e=i:e+=`/`+i)}return e===void 0?`.`:r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n||(e=r.resolve(e))===(n=r.resolve(n)))return``;for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var o=e.length,c=o-i,l=1;l<n.length&&n.charCodeAt(l)===47;++l);for(var u=n.length-l,d=c<u?c:u,f=-1,p=0;p<=d;++p){if(p===d){if(u>d){if(n.charCodeAt(l+p)===47)return n.slice(l+p+1);if(p===0)return n.slice(l+p)}else c>d&&(e.charCodeAt(i+p)===47?f=p:p===0&&(f=0));break}var m=e.charCodeAt(i+p);if(m!==n.charCodeAt(l+p))break;m===47&&(f=p)}var h=``;for(p=i+f+1;p<=o;++p)p!==o&&e.charCodeAt(p)!==47||(h.length===0?h+=`..`:h+=`/..`);return h.length>0?h+n.slice(l+f):(l+=f,n.charCodeAt(l)===47&&++l,n.slice(l))},_makeLong:function(e){return e},dirname:function(e){if(t(e),e.length===0)return`.`;for(var n=e.charCodeAt(0),r=n===47,i=-1,o=!0,c=e.length-1;c>=1;--c)if((n=e.charCodeAt(c))===47){if(!o){i=c;break}}else o=!1;return i===-1?r?`/`:`.`:r&&i===1?`//`:e.slice(0,i)},basename:function(e,n){if(n!==void 0&&typeof n!=`string`)throw TypeError(`"ext" argument must be a string`);t(e);var r,i=0,o=-1,c=!0;if(n!==void 0&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return``;var l=n.length-1,u=-1;for(r=e.length-1;r>=0;--r){var d=e.charCodeAt(r);if(d===47){if(!c){i=r+1;break}}else u===-1&&(c=!1,u=r+1),l>=0&&(d===n.charCodeAt(l)?--l==-1&&(o=r):(l=-1,o=u))}return i===o?o=u:o===-1&&(o=e.length),e.slice(i,o)}for(r=e.length-1;r>=0;--r)if(e.charCodeAt(r)===47){if(!c){i=r+1;break}}else o===-1&&(c=!1,o=r+1);return o===-1?``:e.slice(i,o)},extname:function(e){t(e);for(var n=-1,r=0,i=-1,o=!0,c=0,l=e.length-1;l>=0;--l){var u=e.charCodeAt(l);if(u!==47)i===-1&&(o=!1,i=l+1),u===46?n===-1?n=l:c!==1&&(c=1):n!==-1&&(c=-1);else if(!o){r=l+1;break}}return n===-1||i===-1||c===0||c===1&&n===i-1&&n===r+1?``:e.slice(n,i)},format:function(e){if(typeof e!=`object`||!e)throw TypeError(`The "pathObject" argument must be of type Object. Received type `+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||``)+(t.ext||``);return n?n===t.root?n+r:n+`/`+r:r}(0,e)},parse:function(e){t(e);var n={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return n;var r,i=e.charCodeAt(0),o=i===47;o?(n.root=`/`,r=1):r=0;for(var c=-1,l=0,u=-1,d=!0,f=e.length-1,p=0;f>=r;--f)if((i=e.charCodeAt(f))!==47)u===-1&&(d=!1,u=f+1),i===46?c===-1?c=f:p!==1&&(p=1):c!==-1&&(p=-1);else if(!d){l=f+1;break}return c===-1||u===-1||p===0||p===1&&c===u-1&&c===l+1?u!==-1&&(n.base=n.name=l===0&&o?e.slice(1,u):e.slice(l,u)):(l===0&&o?(n.name=e.slice(1,c),n.base=e.slice(1,u)):(n.name=e.slice(l,c),n.base=e.slice(l,u)),n.ext=e.slice(c,u)),l>0?n.dir=e.slice(0,l-1):o&&(n.dir=`/`),n},sep:`/`,delimiter:`:`,win32:null,posix:null};r.posix=r,e.exports=r},3515:function(e,t,n){e.exports=i;var r=n(9826).EventEmitter;function i(){r.call(this)}n(7523)(i,r),i.Readable=n(2762),i.Writable=n(3726),i.Duplex=n(884),i.Transform=n(6756),i.PassThrough=n(1390),i.finished=n(2896),i.pipeline=n(8460),i.Stream=i,i.prototype.pipe=function(e,t){var n=this;function i(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function o(){n.readable&&n.resume&&n.resume()}n.on(`data`,i),e.on(`drain`,o),e._isStdio||t&&!1===t.end||(n.on(`end`,l),n.on(`close`,u));var c=!1;function l(){c||(c=!0,e.end())}function u(){c||(c=!0,typeof e.destroy==`function`&&e.destroy())}function d(e){if(f(),r.listenerCount(this,`error`)===0)throw e}function f(){n.removeListener(`data`,i),e.removeListener(`drain`,o),n.removeListener(`end`,l),n.removeListener(`close`,u),n.removeListener(`error`,d),e.removeListener(`error`,d),n.removeListener(`end`,f),n.removeListener(`close`,f),e.removeListener(`close`,f)}return n.on(`error`,d),e.on(`error`,d),n.on(`end`,f),n.on(`close`,f),e.on(`close`,f),e.emit(`pipe`,n),e}},1602:function(e){var t={};function n(e,n,r){r||=Error;var i=function(e){var t,r;function i(t,r,i){return e.call(this,function(e,t,r){return typeof n==`string`?n:n(e,t,r)}(t,r,i))||this}return r=e,(t=i).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,i}(r);i.prototype.name=r.name,i.prototype.code=e,t[e]=i}function r(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map((function(e){return String(e)})),n>2?`one of ${t} ${e.slice(0,n-1).join(`, `)}, or `+e[n-1]:n===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}return`of ${t} ${String(e)}`}n(`ERR_INVALID_OPT_VALUE`,(function(e,t){return`The value "`+t+`" is invalid for option "`+e+`"`}),TypeError),n(`ERR_INVALID_ARG_TYPE`,(function(e,t,n){var i,o,c,l,u;return typeof t==`string`&&(o=`not `,t.substr(0,4)===o)?(i=`must not be`,t=t.replace(/^not /,``)):i=`must be`,c=function(e,t,n){return(n===void 0||n>e.length)&&(n=e.length),e.substring(n-9,n)===t}(e,` argument`)?`The ${e} ${i} ${r(t,`type`)}`:`The "${e}" ${typeof u!=`number`&&(u=0),u+1>(l=e).length||l.indexOf(`.`,u)===-1?`argument`:`property`} ${i} ${r(t,`type`)}`,c+`. Received type ${typeof n}`}),TypeError),n(`ERR_STREAM_PUSH_AFTER_EOF`,`stream.push() after EOF`),n(`ERR_METHOD_NOT_IMPLEMENTED`,(function(e){return`The `+e+` method is not implemented`})),n(`ERR_STREAM_PREMATURE_CLOSE`,`Premature close`),n(`ERR_STREAM_DESTROYED`,(function(e){return`Cannot call `+e+` after a stream was destroyed`})),n(`ERR_MULTIPLE_CALLBACK`,`Callback called multiple times`),n(`ERR_STREAM_CANNOT_PIPE`,`Cannot pipe, not readable`),n(`ERR_STREAM_WRITE_AFTER_END`,`write after end`),n(`ERR_STREAM_NULL_VALUES`,`May not write null values to stream`,TypeError),n(`ERR_UNKNOWN_ENCODING`,(function(e){return`Unknown encoding: `+e}),TypeError),n(`ERR_STREAM_UNSHIFT_AFTER_END_EVENT`,`stream.unshift() after end event`),e.exports.codes=t},884:function(e,t,n){var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=d;var i=n(2762),o=n(3726);n(7523)(d,i);for(var c=r(o.prototype),l=0;l<c.length;l++){var u=c[l];d.prototype[u]||(d.prototype[u]=o.prototype[u])}function d(e){if(!(this instanceof d))return new d(e);i.call(this,e),o.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once(`end`,f)))}function f(){this._writableState.ended||process.nextTick(p,this)}function p(e){e.end()}Object.defineProperty(d.prototype,`writableHighWaterMark`,{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(d.prototype,`writableBuffer`,{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(d.prototype,`writableLength`,{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(d.prototype,`destroyed`,{enumerable:!1,get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},1390:function(e,t,n){e.exports=i;var r=n(6756);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}n(7523)(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},2762:function(e,t,n){var r;e.exports=E,E.ReadableState=T,n(9826).EventEmitter;var i,o=function(e,t){return e.listeners(t).length},c=n(2611),l=n(44).Buffer,u=(n.g===void 0?typeof window<`u`?window:typeof self<`u`?self:{}:n.g).Uint8Array||function(){},d=n(7199);i=d&&d.debuglog?d.debuglog(`stream`):function(){};var f,p,m,h=n(3791),g=n(2410),_=n(1749).getHighWaterMark,v=n(1602).codes,y=v.ERR_INVALID_ARG_TYPE,b=v.ERR_STREAM_PUSH_AFTER_EOF,x=v.ERR_METHOD_NOT_IMPLEMENTED,S=v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(7523)(E,c);var C=g.errorOrDestroy,w=[`error`,`close`,`destroy`,`pause`,`resume`];function T(e,t,i){r||=n(884),e||={},typeof i!=`boolean`&&(i=t instanceof r),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=_(this,e,`readableHighWaterMark`,i),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||`utf8`,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||=n(748).StringDecoder,this.decoder=new f(e.encoding),this.encoding=e.encoding)}function E(e){if(r||=n(884),!(this instanceof E))return new E(e);var t=this instanceof r;this._readableState=new T(e,this,t),this.readable=!0,e&&(typeof e.read==`function`&&(this._read=e.read),typeof e.destroy==`function`&&(this._destroy=e.destroy)),c.call(this)}function D(e,t,n,r,o){i(`readableAddChunk`,t);var c,d=e._readableState;if(t===null)d.reading=!1,function(e,t){if(i(`onEofChunk`),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?j(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,M(e)))}}(e,d);else if(o||(c=function(e,t){var n,r;return r=t,l.isBuffer(r)||r instanceof u||typeof t==`string`||t===void 0||e.objectMode||(n=new y(`chunk`,[`string`,`Buffer`,`Uint8Array`],t)),n}(d,t)),c)C(e,c);else if(d.objectMode||t&&t.length>0)if(typeof t==`string`||d.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),r)d.endEmitted?C(e,new S):O(e,d,t,!0);else if(d.ended)C(e,new b);else{if(d.destroyed)return!1;d.reading=!1,d.decoder&&!n?(t=d.decoder.write(t),d.objectMode||t.length!==0?O(e,d,t,!1):N(e,d)):O(e,d,t,!1)}else r||(d.reading=!1,N(e,d));return!d.ended&&(d.length<d.highWaterMark||d.length===0)}function O(e,t,n,r){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit(`data`,n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&j(e)),N(e,t)}Object.defineProperty(E.prototype,`destroyed`,{enumerable:!1,get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),E.prototype.destroy=g.destroy,E.prototype._undestroy=g.undestroy,E.prototype._destroy=function(e,t){t(e)},E.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:typeof e==`string`&&((t||=r.defaultEncoding)!==r.encoding&&(e=l.from(e,t),t=``),n=!0),D(this,e,t,!1,n)},E.prototype.unshift=function(e){return D(this,e,null,!0,!1)},E.prototype.isPaused=function(){return!1===this._readableState.flowing},E.prototype.setEncoding=function(e){f||=n(748).StringDecoder;var t=new f(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i=``;r!==null;)i+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),i!==``&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var k=1073741824;function A(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e==e?(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=k?e=k:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0)):t.flowing&&t.length?t.buffer.head.data.length:t.length}function j(e){var t=e._readableState;i(`emitReadable`,t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(i(`emitReadable`,t.flowing),t.emittedReadable=!0,process.nextTick(M,e))}function M(e){var t=e._readableState;i(`emitReadable_`,t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit(`readable`),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,R(e)}function N(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(P,e,t))}function P(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var n=t.length;if(i(`maybeReadMore read 0`),e.read(0),n===t.length)break}t.readingMore=!1}function F(e){var t=e._readableState;t.readableListening=e.listenerCount(`readable`)>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount(`data`)>0&&e.resume()}function I(e){i(`readable nexttick read 0`),e.read(0)}function L(e,t){i(`resume`,t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit(`resume`),R(e),t.flowing&&!t.reading&&e.read(0)}function R(e){var t=e._readableState;for(i(`flow`,t.flowing);t.flowing&&e.read()!==null;);}function z(e,t){return t.length===0?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(``):t.buffer.length===1?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function B(e){var t=e._readableState;i(`endReadable`,t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(V,t,e))}function V(e,t){if(i(`endReadableNT`,e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit(`end`),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function H(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}E.prototype.read=function(e){i(`read`,e),e=parseInt(e,10);var t=this._readableState,n=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark===0?t.length>0:t.length>=t.highWaterMark)||t.ended))return i(`read: emitReadable`,t.length,t.ended),t.length===0&&t.ended?B(this):j(this),null;if((e=A(e,t))===0&&t.ended)return t.length===0&&B(this),null;var r,o=t.needReadable;return i(`need readable`,o),(t.length===0||t.length-e<t.highWaterMark)&&i(`length less than watermark`,o=!0),t.ended||t.reading?i(`reading or ended`,o=!1):o&&(i(`do read`),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=A(n,t))),(r=e>0?z(e,t):null)===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&B(this)),r!==null&&this.emit(`data`,r),r},E.prototype._read=function(e){C(this,new x(`_read()`))},E.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,i(`pipe count=%d opts=%j`,r.pipesCount,t);var c=t&&!1===t.end||e===process.stdout||e===process.stderr?g:l;function l(){i(`onend`),e.end()}r.endEmitted?process.nextTick(c):n.once(`end`,c),e.on(`unpipe`,(function t(o,c){i(`onunpipe`),o===n&&c&&!1===c.hasUnpiped&&(c.hasUnpiped=!0,i(`cleanup`),e.removeListener(`close`,m),e.removeListener(`finish`,h),e.removeListener(`drain`,u),e.removeListener(`error`,p),e.removeListener(`unpipe`,t),n.removeListener(`end`,l),n.removeListener(`end`,g),n.removeListener(`data`,f),d=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}));var u=function(e){return function(){var t=e._readableState;i(`pipeOnDrain`,t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&o(e,`data`)&&(t.flowing=!0,R(e))}}(n);e.on(`drain`,u);var d=!1;function f(t){i(`ondata`);var o=e.write(t);i(`dest.write`,o),!1===o&&((r.pipesCount===1&&r.pipes===e||r.pipesCount>1&&H(r.pipes,e)!==-1)&&!d&&(i(`false write response, pause`,r.awaitDrain),r.awaitDrain++),n.pause())}function p(t){i(`onerror`,t),g(),e.removeListener(`error`,p),o(e,`error`)===0&&C(e,t)}function m(){e.removeListener(`finish`,h),g()}function h(){i(`onfinish`),e.removeListener(`close`,m),g()}function g(){i(`unpipe`),n.unpipe(e)}return n.on(`data`,f),function(e,t,n){if(typeof e.prependListener==`function`)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,`error`,p),e.once(`close`,m),e.once(`finish`,h),e.emit(`pipe`,n),r.flowing||(i(`pipe resume`),n.resume()),e},E.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes||(e||=t.pipes,t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit(`unpipe`,this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)r[o].emit(`unpipe`,this,{hasUnpiped:!1});return this}var c=H(t.pipes,e);return c===-1||(t.pipes.splice(c,1),--t.pipesCount,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit(`unpipe`,this,n)),this},E.prototype.on=function(e,t){var n=c.prototype.on.call(this,e,t),r=this._readableState;return e===`data`?(r.readableListening=this.listenerCount(`readable`)>0,!1!==r.flowing&&this.resume()):e===`readable`&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,i(`on readable`,r.length,r.reading),r.length?j(this):r.reading||process.nextTick(I,this))),n},E.prototype.addListener=E.prototype.on,E.prototype.removeListener=function(e,t){var n=c.prototype.removeListener.call(this,e,t);return e===`readable`&&process.nextTick(F,this),n},E.prototype.removeAllListeners=function(e){var t=c.prototype.removeAllListeners.apply(this,arguments);return e!==`readable`&&e!==void 0||process.nextTick(F,this),t},E.prototype.resume=function(){var e=this._readableState;return e.flowing||(i(`resume`),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(L,e,t))}(this,e)),e.paused=!1,this},E.prototype.pause=function(){return i(`call pause flowing=%j`,this._readableState.flowing),!1!==this._readableState.flowing&&(i(`pause`),this._readableState.flowing=!1,this.emit(`pause`)),this._readableState.paused=!0,this},E.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var o in e.on(`end`,(function(){if(i(`wrapped end`),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on(`data`,(function(o){i(`wrapped data`),n.decoder&&(o=n.decoder.write(o)),n.objectMode&&o==null||(n.objectMode||o&&o.length)&&(t.push(o)||(r=!0,e.pause()))})),e)this[o]===void 0&&typeof e[o]==`function`&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var c=0;c<w.length;c++)e.on(w[c],this.emit.bind(this,w[c]));return this._read=function(t){i(`wrapped _read`,t),r&&(r=!1,e.resume())},this},typeof Symbol==`function`&&(E.prototype[Symbol.asyncIterator]=function(){return p===void 0&&(p=n(5857)),p(this)}),Object.defineProperty(E.prototype,`readableHighWaterMark`,{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(E.prototype,`readableBuffer`,{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(E.prototype,`readableFlowing`,{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),E._fromList=z,Object.defineProperty(E.prototype,`readableLength`,{enumerable:!1,get:function(){return this._readableState.length}}),typeof Symbol==`function`&&(E.from=function(e,t){return m===void 0&&(m=n(3411)),m(E,e,t)})},6756:function(e,t,n){e.exports=f;var r=n(1602).codes,i=r.ERR_METHOD_NOT_IMPLEMENTED,o=r.ERR_MULTIPLE_CALLBACK,c=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,l=r.ERR_TRANSFORM_WITH_LENGTH_0,u=n(884);function d(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(r===null)return this.emit(`error`,new o);n.writechunk=null,n.writecb=null,t!=null&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function f(e){if(!(this instanceof f))return new f(e);u.call(this,e),this._transformState={afterTransform:d.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform==`function`&&(this._transform=e.transform),typeof e.flush==`function`&&(this._flush=e.flush)),this.on(`prefinish`,p)}function p(){var e=this;typeof this._flush!=`function`||this._readableState.destroyed?m(this,null,null):this._flush((function(t,n){m(e,t,n)}))}function m(e,t,n){if(t)return e.emit(`error`,t);if(n!=null&&e.push(n),e._writableState.length)throw new l;if(e._transformState.transforming)throw new c;return e.push(null)}n(7523)(f,u),f.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},f.prototype._transform=function(e,t,n){n(new i(`_transform()`))},f.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},f.prototype._read=function(e){var t=this._transformState;t.writechunk===null||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},f.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},3726:function(e,t,n){function r(e){var t=this;this.next=null,this.entry=null,this.finish=function(){(function(e,t){var n=e.entry;for(e.entry=null;n;){var r=n.callback;t.pendingcb--,r(void 0),n=n.next}t.corkedRequestsFree.next=e})(t,e)}}var i;e.exports=E,E.WritableState=T;var o,c={deprecate:n(9e3)},l=n(2611),u=n(44).Buffer,d=(n.g===void 0?typeof window<`u`?window:typeof self<`u`?self:{}:n.g).Uint8Array||function(){},f=n(2410),p=n(1749).getHighWaterMark,m=n(1602).codes,h=m.ERR_INVALID_ARG_TYPE,g=m.ERR_METHOD_NOT_IMPLEMENTED,_=m.ERR_MULTIPLE_CALLBACK,v=m.ERR_STREAM_CANNOT_PIPE,y=m.ERR_STREAM_DESTROYED,b=m.ERR_STREAM_NULL_VALUES,x=m.ERR_STREAM_WRITE_AFTER_END,S=m.ERR_UNKNOWN_ENCODING,C=f.errorOrDestroy;function w(){}function T(e,t,o){i||=n(884),e||={},typeof o!=`boolean`&&(o=t instanceof i),this.objectMode=!!e.objectMode,o&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=p(this,e,`writableHighWaterMark`,o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=!1!==e.decodeStrings,this.defaultEncoding=e.defaultEncoding||`utf8`,this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){(function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(typeof i!=`function`)throw new _;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)(function(e,t,n,r,i){--t.pendingcb,n?(process.nextTick(i,r),process.nextTick(M,e,t),e._writableState.errorEmitted=!0,C(e,r)):(i(r),e._writableState.errorEmitted=!0,C(e,r),M(e,t))})(e,n,r,t,i);else{var o=A(n)||e.destroyed;o||n.corked||n.bufferProcessing||!n.bufferedRequest||k(e,n),r?process.nextTick(O,e,n,o,i):O(e,n,o,i)}})(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function E(e){var t=this instanceof(i||=n(884));if(!t&&!o.call(E,this))return new E(e);this._writableState=new T(e,this,t),this.writable=!0,e&&(typeof e.write==`function`&&(this._write=e.write),typeof e.writev==`function`&&(this._writev=e.writev),typeof e.destroy==`function`&&(this._destroy=e.destroy),typeof e.final==`function`&&(this._final=e.final)),l.call(this)}function D(e,t,n,r,i,o,c){t.writelen=r,t.writecb=c,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new y(`write`)):n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function O(e,t,n,r){n||function(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit(`drain`))}(e,t),t.pendingcb--,r(),M(e,t)}function k(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var i=t.bufferedRequestCount,o=Array(i),c=t.corkedRequestsFree;c.entry=n;for(var l=0,u=!0;n;)o[l]=n,n.isBuf||(u=!1),n=n.next,l+=1;o.allBuffers=u,D(e,t,!0,t.length,o,``,c.finish),t.pendingcb++,t.lastBufferedRequest=null,c.next?(t.corkedRequestsFree=c.next,c.next=null):t.corkedRequestsFree=new r(t),t.bufferedRequestCount=0}else{for(;n;){var d=n.chunk,f=n.encoding,p=n.callback;if(D(e,t,!1,t.objectMode?1:d.length,d,f,p),n=n.next,t.bufferedRequestCount--,t.writing)break}n===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function A(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function j(e,t){e._final((function(n){t.pendingcb--,n&&C(e,n),t.prefinished=!0,e.emit(`prefinish`),M(e,t)}))}function M(e,t){var n=A(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||(typeof e._final!=`function`||t.destroyed?(t.prefinished=!0,e.emit(`prefinish`)):(t.pendingcb++,t.finalCalled=!0,process.nextTick(j,e,t)))}(e,t),t.pendingcb===0&&(t.finished=!0,e.emit(`finish`),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}n(7523)(E,l),T.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(T.prototype,`buffer`,{get:c.deprecate((function(){return this.getBuffer()}),`_writableState.buffer is deprecated. Use _writableState.getBuffer instead.`,`DEP0003`)})}catch{}}(),typeof Symbol==`function`&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==`function`?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(E,Symbol.hasInstance,{value:function(e){return!!o.call(this,e)||this===E&&e&&e._writableState instanceof T}})):o=function(e){return e instanceof this},E.prototype.pipe=function(){C(this,new v)},E.prototype.write=function(e,t,n){var r,i=this._writableState,o=!1,c=!i.objectMode&&(r=e,u.isBuffer(r)||r instanceof d);return c&&!u.isBuffer(e)&&(e=function(e){return u.from(e)}(e)),typeof t==`function`&&(n=t,t=null),c?t=`buffer`:t||=i.defaultEncoding,typeof n!=`function`&&(n=w),i.ending?function(e,t){var n=new x;C(e,n),process.nextTick(t,n)}(this,n):(c||function(e,t,n,r){var i;return n===null?i=new b:typeof n==`string`||t.objectMode||(i=new h(`chunk`,[`string`,`Buffer`],n)),!i||(C(e,i),process.nextTick(r,i),!1)}(this,i,e,n))&&(i.pendingcb++,o=function(e,t,n,r,i,o){if(!n){var c=function(e,t,n){return e.objectMode||!1===e.decodeStrings||typeof t!=`string`||(t=u.from(t,n)),t}(t,r,i);r!==c&&(n=!0,i=`buffer`,r=c)}var l=t.objectMode?1:r.length;t.length+=l;var d=t.length<t.highWaterMark;if(d||(t.needDrain=!0),t.writing||t.corked){var f=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:o,next:null},f?f.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else D(e,t,!1,l,r,i,o);return d}(this,i,c,e,t,n)),o},E.prototype.cork=function(){this._writableState.corked++},E.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||k(this,e))},E.prototype.setDefaultEncoding=function(e){if(typeof e==`string`&&(e=e.toLowerCase()),!([`hex`,`utf8`,`utf-8`,`ascii`,`binary`,`base64`,`ucs2`,`ucs-2`,`utf16le`,`utf-16le`,`raw`].indexOf((e+``).toLowerCase())>-1))throw new S(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(E.prototype,`writableBuffer`,{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(E.prototype,`writableHighWaterMark`,{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),E.prototype._write=function(e,t,n){n(new g(`_write()`))},E.prototype._writev=null,E.prototype.end=function(e,t,n){var r=this._writableState;return typeof e==`function`?(n=e,e=null,t=null):typeof t==`function`&&(n=t,t=null),e!=null&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,n){t.ending=!0,M(e,t),n&&(t.finished?process.nextTick(n):e.once(`finish`,n)),t.ended=!0,e.writable=!1}(this,r,n),this},Object.defineProperty(E.prototype,`writableLength`,{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(E.prototype,`destroyed`,{enumerable:!1,get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),E.prototype.destroy=f.destroy,E.prototype._undestroy=f.undestroy,E.prototype._destroy=function(e,t){t(e)}},5857:function(e,t,n){var r;function i(e,t,n){return(t=function(e){var t=function(e){if(typeof e!=`object`||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,`string`);if(typeof n!=`object`)return n;throw TypeError(`@@toPrimitive must return a primitive value.`)}return String(e)}(e);return typeof t==`symbol`?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(2896),c=Symbol(`lastResolve`),l=Symbol(`lastReject`),u=Symbol(`error`),d=Symbol(`ended`),f=Symbol(`lastPromise`),p=Symbol(`handlePromise`),m=Symbol(`stream`);function h(e,t){return{value:e,done:t}}function g(e){var t=e[c];if(t!==null){var n=e[m].read();n!==null&&(e[f]=null,e[c]=null,e[l]=null,t(h(n,!1)))}}function _(e){process.nextTick(g,e)}var v=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((i(r={get stream(){return this[m]},next:function(){var e=this,t=this[u];if(t!==null)return Promise.reject(t);if(this[d])return Promise.resolve(h(void 0,!0));if(this[m].destroyed)return new Promise((function(t,n){process.nextTick((function(){e[u]?n(e[u]):t(h(void 0,!0))}))}));var n,r=this[f];if(r)n=new Promise(function(e,t){return function(n,r){e.then((function(){t[d]?n(h(void 0,!0)):t[p](n,r)}),r)}}(r,this));else{var i=this[m].read();if(i!==null)return Promise.resolve(h(i,!1));n=new Promise(this[p])}return this[f]=n,n}},Symbol.asyncIterator,(function(){return this})),i(r,`return`,(function(){var e=this;return new Promise((function(t,n){e[m].destroy(null,(function(e){e?n(e):t(h(void 0,!0))}))}))})),r),v);e.exports=function(e){var t,n=Object.create(y,(i(t={},m,{value:e,writable:!0}),i(t,c,{value:null,writable:!0}),i(t,l,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,d,{value:e._readableState.endEmitted,writable:!0}),i(t,p,{value:function(e,t){var r=n[m].read();r?(n[f]=null,n[c]=null,n[l]=null,e(h(r,!1))):(n[c]=e,n[l]=t)},writable:!0}),t));return n[f]=null,o(e,(function(e){if(e&&e.code!==`ERR_STREAM_PREMATURE_CLOSE`){var t=n[l];t!==null&&(n[f]=null,n[c]=null,n[l]=null,t(e)),n[u]=e;return}var r=n[c];r!==null&&(n[f]=null,n[c]=null,n[l]=null,r(h(void 0,!0))),n[d]=!0})),e.on(`readable`,_.bind(null,n)),n}},3791:function(e,t,n){function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(e,t,n){return(t=l(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,l(r.key),r)}}function l(e){var t=function(e){if(typeof e!=`object`||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,`string`);if(typeof n!=`object`)return n;throw TypeError(`@@toPrimitive must return a primitive value.`)}return String(e)}(e);return typeof t==`symbol`?t:String(t)}var u=n(44).Buffer,d=n(3779).inspect,f=d&&d.custom||`inspect`;e.exports=function(){function e(){(function(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)})(this,e),this.head=null,this.tail=null,this.length=0}var t,n;return t=e,(n=[{key:`push`,value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:`unshift`,value:function(e){var t={data:e,next:this.head};this.length===0&&(this.tail=t),this.head=t,++this.length}},{key:`shift`,value:function(){if(this.length!==0){var e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:`clear`,value:function(){this.head=this.tail=null,this.length=0}},{key:`join`,value:function(e){if(this.length===0)return``;for(var t=this.head,n=``+t.data;t=t.next;)n+=e+t.data;return n}},{key:`concat`,value:function(e){if(this.length===0)return u.alloc(0);for(var t,n,r,i=u.allocUnsafe(e>>>0),o=this.head,c=0;o;)t=o.data,n=i,r=c,u.prototype.copy.call(t,n,r),c+=o.data.length,o=o.next;return i}},{key:`consume`,value:function(e,t){var n;return e<this.head.data.length?(n=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):n=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),n}},{key:`first`,value:function(){return this.head.data}},{key:`_getString`,value:function(e){var t=this.head,n=1,r=t.data;for(e-=r.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?r+=i:r+=i.slice(0,e),(e-=o)==0){o===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++n}return this.length-=n,r}},{key:`_getBuffer`,value:function(e){var t=u.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),(e-=o)==0){o===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(o));break}++r}return this.length-=r,t}},{key:f,value:function(e,t){return d(this,i(i({},t),{},{depth:0,customInspect:!1}))}}])&&c(t.prototype,n),Object.defineProperty(t,`prototype`,{writable:!1}),e}()},2410:function(e){function t(e,t){r(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit(`close`)}function r(e,t){e.emit(`error`,t)}e.exports={destroy:function(e,i){var o=this,c=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return c||l?(i?i(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(r,this,e)):process.nextTick(r,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!i&&e?o._writableState?o._writableState.errorEmitted?process.nextTick(n,o):(o._writableState.errorEmitted=!0,process.nextTick(t,o,e)):process.nextTick(t,o,e):i?(process.nextTick(n,o),i(e)):process.nextTick(n,o)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit(`error`,t)}}},2896:function(e,t,n){var r=n(1602).codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,n,o){if(typeof n==`function`)return e(t,null,n);n||={},o=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];e.apply(this,r)}}}(o||i);var c=n.readable||!1!==n.readable&&t.readable,l=n.writable||!1!==n.writable&&t.writable,u=function(){t.writable||f()},d=t._writableState&&t._writableState.finished,f=function(){l=!1,d=!0,c||o.call(t)},p=t._readableState&&t._readableState.endEmitted,m=function(){c=!1,p=!0,l||o.call(t)},h=function(e){o.call(t,e)},g=function(){var e;return c&&!p?(t._readableState&&t._readableState.ended||(e=new r),o.call(t,e)):l&&!d?(t._writableState&&t._writableState.ended||(e=new r),o.call(t,e)):void 0},_=function(){t.req.on(`finish`,f)};return function(e){return e.setHeader&&typeof e.abort==`function`}(t)?(t.on(`complete`,f),t.on(`abort`,g),t.req?_():t.on(`request`,_)):l&&!t._writableState&&(t.on(`end`,u),t.on(`close`,u)),t.on(`end`,m),t.on(`finish`,f),!1!==n.error&&t.on(`error`,h),t.on(`close`,g),function(){t.removeListener(`complete`,f),t.removeListener(`abort`,g),t.removeListener(`request`,_),t.req&&t.req.removeListener(`finish`,f),t.removeListener(`end`,u),t.removeListener(`close`,u),t.removeListener(`finish`,f),t.removeListener(`end`,m),t.removeListener(`error`,h),t.removeListener(`close`,g)}}},3411:function(e){e.exports=function(){throw Error(`Readable.from is not available in the browser`)}},8460:function(e,t,n){var r,i=n(1602).codes,o=i.ERR_MISSING_ARGS,c=i.ERR_STREAM_DESTROYED;function l(e){if(e)throw e}function u(e){e()}function d(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];var f,p=function(e){return e.length&&typeof e[e.length-1]==`function`?e.pop():l}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o(`streams`);var m=t.map((function(e,i){var o=i<t.length-1;return function(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var l=!1;e.on(`close`,(function(){l=!0})),r===void 0&&(r=n(2896)),r(e,{readable:t,writable:i},(function(e){if(e)return o(e);l=!0,o()}));var u=!1;return function(t){if(!l&&!u)return u=!0,function(e){return e.setHeader&&typeof e.abort==`function`}(e)?e.abort():typeof e.destroy==`function`?e.destroy():void o(t||new c(`pipe`))}}(e,o,i>0,(function(e){f||=e,e&&m.forEach(u),o||(m.forEach(u),p(f))}))}));return t.reduce(d)}},1749:function(e,t,n){var r=n(1602).codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,n,i){var o=function(e,t,n){return e.highWaterMark==null?t?e[n]:null:e.highWaterMark}(t,i,n);if(o!=null){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new r(i?n:`highWaterMark`,o);return Math.floor(o)}return e.objectMode?16:16384}}},2611:function(e,t,n){e.exports=n(9826).EventEmitter},748:function(e,t,n){var r=n(4598).Buffer,i=r.isEncoding||function(e){switch((e=``+e)&&e.toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:case`raw`:return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return`utf8`;for(var t;;)switch(e){case`utf8`:case`utf-8`:return`utf8`;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return`utf16le`;case`latin1`:case`binary`:return`latin1`;case`base64`:case`ascii`:case`hex`:return e;default:if(t)return;e=(``+e).toLowerCase(),t=!0}}(e);if(typeof t!=`string`&&(r.isEncoding===i||!i(e)))throw Error(`Unknown encoding: `+e);return t||e}(e),this.encoding){case`utf16le`:this.text=u,this.end=d,t=4;break;case`utf8`:this.fillLast=l,t=4;break;case`base64`:this.text=f,this.end=p,t=3;break;default:this.write=m,this.end=h;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function c(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function l(e){var t=this.lastTotal-this.lastNeed,n=function(e,t){if((192&t[0])!=128)return e.lastNeed=0,`�`;if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,`�`;if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,`�`}}(this,e);return n===void 0?this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length)):n}function u(e,t){if((e.length-t)%2==0){var n=e.toString(`utf16le`,t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString(`utf16le`,t,e.length-1)}function d(e){var t=e&&e.length?this.write(e):``;if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString(`utf16le`,0,n)}return t}function f(e,t){var n=(e.length-t)%3;return n===0?e.toString(`base64`,t):(this.lastNeed=3-n,this.lastTotal=3,n===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString(`base64`,t,e.length-n))}function p(e){var t=e&&e.length?this.write(e):``;return this.lastNeed?t+this.lastChar.toString(`base64`,0,3-this.lastNeed):t}function m(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):``}t.StringDecoder=o,o.prototype.write=function(e){if(e.length===0)return``;var t,n;if(this.lastNeed){if((t=this.fillLast(e))===void 0)return``;n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||``},o.prototype.end=function(e){var t=e&&e.length?this.write(e):``;return this.lastNeed?t+`�`:t},o.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=c(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n||i===-2?0:(i=c(t[r]))>=0?(i>0&&(e.lastNeed=i-2),i):--r<n||i===-2?0:(i=c(t[r]))>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString(`utf8`,t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString(`utf8`,t,r)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},4598:function(e,t,n){var r=n(44),i=r.Buffer;function o(e,t){for(var n in e)t[n]=e[n]}function c(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=c),o(i,c),c.from=function(e,t,n){if(typeof e==`number`)throw TypeError(`Argument must not be a number`);return i(e,t,n)},c.alloc=function(e,t,n){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);var r=i(e);return t===void 0?r.fill(0):typeof n==`string`?r.fill(t,n):r.fill(t),r},c.allocUnsafe=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return i(e)},c.allocUnsafeSlow=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return r.SlowBuffer(e)}},8571:function(e,t,n){var r;(function(i,o){var c=`function`,l=`undefined`,u=`object`,d=`string`,f=`major`,p=`model`,m=`name`,h=`type`,g=`vendor`,_=`version`,v=`architecture`,y=`console`,b=`mobile`,x=`tablet`,S=`smarttv`,C=`wearable`,w=`embedded`,T=`Amazon`,E=`Apple`,D=`ASUS`,O=`BlackBerry`,k=`Browser`,A=`Chrome`,j=`Firefox`,M=`Google`,N=`Huawei`,P=`LG`,F=`Microsoft`,I=`Motorola`,L=`Opera`,R=`Samsung`,z=`Sharp`,B=`Sony`,V=`Xiaomi`,H=`Zebra`,U=`Facebook`,W=`Chromium OS`,G=`Mac OS`,K=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},ee=function(e,t){return typeof e===d&&q(t).indexOf(q(e))!==-1},q=function(e){return e.toLowerCase()},te=function(e,t){if(typeof e===d)return e=e.replace(/^\s\s*/,``),typeof t===l?e:e.substring(0,500)},ne=function(e,t){for(var n,r,i,l,d,f,p=0;p<t.length&&!d;){var m=t[p],h=t[p+1];for(n=r=0;n<m.length&&!d&&m[n];)if(d=m[n++].exec(e))for(i=0;i<h.length;i++)f=d[++r],typeof(l=h[i])===u&&l.length>0?l.length===2?typeof l[1]==c?this[l[0]]=l[1].call(this,f):this[l[0]]=l[1]:l.length===3?typeof l[1]!==c||l[1].exec&&l[1].test?this[l[0]]=f?f.replace(l[1],l[2]):o:this[l[0]]=f?l[1].call(this,f,l[2]):o:l.length===4&&(this[l[0]]=f?l[3].call(this,f.replace(l[1],l[2])):o):this[l]=f||o;p+=2}},re=function(e,t){for(var n in t)if(typeof t[n]===u&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(ee(t[n][r],e))return n===`?`?o:n}else if(ee(t[n],e))return n===`?`?o:n;return e},ie={ME:`4.90`,"NT 3.11":`NT3.51`,"NT 4.0":`NT4.0`,2e3:`NT 5.0`,XP:[`NT 5.1`,`NT 5.2`],Vista:`NT 6.0`,7:`NT 6.1`,8:`NT 6.2`,8.1:`NT 6.3`,10:[`NT 6.4`,`NT 10.0`],RT:`ARM`},J={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[_,[m,`Chrome`]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[_,[m,`Edge`]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[m,_],[/opios[\/ ]+([\w\.]+)/i],[_,[m,L+` Mini`]],[/\bop(?:rg)?x\/([\w\.]+)/i],[_,[m,L+` GX`]],[/\bopr\/([\w\.]+)/i],[_,[m,L]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[_,[m,`Baidu`]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[m,_],[/\bddg\/([\w\.]+)/i],[_,[m,`DuckDuckGo`]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[_,[m,`UC`+k]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[_,[m,`WeChat`]],[/konqueror\/([\w\.]+)/i],[_,[m,`Konqueror`]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[_,[m,`IE`]],[/ya(?:search)?browser\/([\w\.]+)/i],[_,[m,`Yandex`]],[/slbrowser\/([\w\.]+)/i],[_,[m,`Smart Lenovo `+k]],[/(avast|avg)\/([\w\.]+)/i],[[m,/(.+)/,`$1 Secure `+k],_],[/\bfocus\/([\w\.]+)/i],[_,[m,j+` Focus`]],[/\bopt\/([\w\.]+)/i],[_,[m,L+` Touch`]],[/coc_coc\w+\/([\w\.]+)/i],[_,[m,`Coc Coc`]],[/dolfin\/([\w\.]+)/i],[_,[m,`Dolphin`]],[/coast\/([\w\.]+)/i],[_,[m,L+` Coast`]],[/miuibrowser\/([\w\.]+)/i],[_,[m,`MIUI `+k]],[/fxios\/([-\w\.]+)/i],[_,[m,j]],[/\bqihu|(qi?ho?o?|360)browser/i],[[m,`360 `+k]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[m,/(.+)/,`$1 `+k],_],[/samsungbrowser\/([\w\.]+)/i],[_,[m,R+` Internet`]],[/(comodo_dragon)\/([\w\.]+)/i],[[m,/_/g,` `],_],[/metasr[\/ ]?([\d\.]+)/i],[_,[m,`Sogou Explorer`]],[/(sogou)mo\w+\/([\d\.]+)/i],[[m,`Sogou Mobile`],_],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[m,_],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[m],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[m,U],_],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[m,_],[/\bgsa\/([\w\.]+) .*safari\//i],[_,[m,`GSA`]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[_,[m,`TikTok`]],[/headlesschrome(?:\/([\w\.]+)| )/i],[_,[m,A+` Headless`]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[m,A+` WebView`],_],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[_,[m,`Android `+k]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[m,_],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[_,[m,`Mobile Safari`]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[_,m],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[m,[_,re,{"1.0":`/8`,1.2:`/1`,1.3:`/3`,"2.0":`/412`,"2.0.2":`/416`,"2.0.3":`/417`,"2.0.4":`/419`,"?":`/`}]],[/(webkit|khtml)\/([\w\.]+)/i],[m,_],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[m,`Netscape`],_],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[_,[m,j+` Reality`]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[m,_],[/(cobalt)\/([\w\.]+)/i],[m,[_,/master.|lts./,``]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[v,`amd64`]],[/(ia32(?=;))/i],[[v,q]],[/((?:i[346]|x)86)[;\)]/i],[[v,`ia32`]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[v,`arm64`]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[v,`armhf`]],[/windows (ce|mobile); ppc;/i],[[v,`arm`]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[v,/ower/,``,q]],[/(sun4\w)[;\)]/i],[[v,`sparc`]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[v,q]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[p,[g,R],[h,x]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[p,[g,R],[h,b]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[p,[g,E],[h,b]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[p,[g,E],[h,x]],[/(macintosh);/i],[p,[g,E]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[p,[g,z],[h,b]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[p,[g,N],[h,x]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[p,[g,N],[h,b]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[p,/_/g,` `],[g,V],[h,b]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[p,/_/g,` `],[g,V],[h,x]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[p,[g,`OPPO`],[h,b]],[/\b(opd2\d{3}a?) bui/i],[p,[g,`OPPO`],[h,x]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[p,[g,`Vivo`],[h,b]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[p,[g,`Realme`],[h,b]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[p,[g,I],[h,b]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[p,[g,I],[h,x]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[p,[g,P],[h,x]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[p,[g,P],[h,b]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[p,[g,`Lenovo`],[h,x]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[p,/_/g,` `],[g,`Nokia`],[h,b]],[/(pixel c)\b/i],[p,[g,M],[h,x]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[p,[g,M],[h,b]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[p,[g,B],[h,b]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[p,`Xperia Tablet`],[g,B],[h,x]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[p,[g,`OnePlus`],[h,b]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[p,[g,T],[h,x]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[p,/(.+)/g,`Fire Phone $1`],[g,T],[h,b]],[/(playbook);[-\w\),; ]+(rim)/i],[p,g,[h,x]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[p,[g,O],[h,b]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[p,[g,D],[h,x]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[p,[g,D],[h,b]],[/(nexus 9)/i],[p,[g,`HTC`],[h,x]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[g,[p,/_/g,` `],[h,b]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[p,[g,`Acer`],[h,x]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[p,[g,`Meizu`],[h,b]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[p,[g,`Ulefone`],[h,b]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[g,p,[h,b]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[g,p,[h,x]],[/(surface duo)/i],[p,[g,F],[h,x]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[p,[g,`Fairphone`],[h,b]],[/(u304aa)/i],[p,[g,`AT&T`],[h,b]],[/\bsie-(\w*)/i],[p,[g,`Siemens`],[h,b]],[/\b(rct\w+) b/i],[p,[g,`RCA`],[h,x]],[/\b(venue[\d ]{2,7}) b/i],[p,[g,`Dell`],[h,x]],[/\b(q(?:mv|ta)\w+) b/i],[p,[g,`Verizon`],[h,x]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[p,[g,`Barnes & Noble`],[h,x]],[/\b(tm\d{3}\w+) b/i],[p,[g,`NuVision`],[h,x]],[/\b(k88) b/i],[p,[g,`ZTE`],[h,x]],[/\b(nx\d{3}j) b/i],[p,[g,`ZTE`],[h,b]],[/\b(gen\d{3}) b.+49h/i],[p,[g,`Swiss`],[h,b]],[/\b(zur\d{3}) b/i],[p,[g,`Swiss`],[h,x]],[/\b((zeki)?tb.*\b) b/i],[p,[g,`Zeki`],[h,x]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[g,`Dragon Touch`],p,[h,x]],[/\b(ns-?\w{0,9}) b/i],[p,[g,`Insignia`],[h,x]],[/\b((nxa|next)-?\w{0,9}) b/i],[p,[g,`NextBook`],[h,x]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[g,`Voice`],p,[h,b]],[/\b(lvtel\-)?(v1[12]) b/i],[[g,`LvTel`],p,[h,b]],[/\b(ph-1) /i],[p,[g,`Essential`],[h,b]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[p,[g,`Envizen`],[h,x]],[/\b(trio[-\w\. ]+) b/i],[p,[g,`MachSpeed`],[h,x]],[/\btu_(1491) b/i],[p,[g,`Rotor`],[h,x]],[/(shield[\w ]+) b/i],[p,[g,`Nvidia`],[h,x]],[/(sprint) (\w+)/i],[g,p,[h,b]],[/(kin\.[onetw]{3})/i],[[p,/\./g,` `],[g,F],[h,b]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[p,[g,H],[h,x]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[p,[g,H],[h,b]],[/smart-tv.+(samsung)/i],[g,[h,S]],[/hbbtv.+maple;(\d+)/i],[[p,/^/,`SmartTV`],[g,R],[h,S]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[g,P],[h,S]],[/(apple) ?tv/i],[g,[p,E+` TV`],[h,S]],[/crkey/i],[[p,A+`cast`],[g,M],[h,S]],[/droid.+aft(\w+)( bui|\))/i],[p,[g,T],[h,S]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[p,[g,z],[h,S]],[/(bravia[\w ]+)( bui|\))/i],[p,[g,B],[h,S]],[/(mitv-\w{5}) bui/i],[p,[g,V],[h,S]],[/Hbbtv.*(technisat) (.*);/i],[g,p,[h,S]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[g,te],[p,te],[h,S]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[h,S]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[g,p,[h,y]],[/droid.+; (shield) bui/i],[p,[g,`Nvidia`],[h,y]],[/(playstation [345portablevi]+)/i],[p,[g,B],[h,y]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[p,[g,F],[h,y]],[/((pebble))app/i],[g,p,[h,C]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[p,[g,E],[h,C]],[/droid.+; (glass) \d/i],[p,[g,M],[h,C]],[/droid.+; (wt63?0{2,3})\)/i],[p,[g,H],[h,C]],[/(quest( \d| pro)?)/i],[p,[g,U],[h,C]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[g,[h,w]],[/(aeobc)\b/i],[p,[g,T],[h,w]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[p,[h,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[p,[h,x]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[h,x]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[h,b]],[/(android[-\w\. ]{0,9});.+buil/i],[p,[g,`Generic`]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[_,[m,`EdgeHTML`]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[_,[m,`Blink`]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[m,_],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[_,m]],os:[[/microsoft (windows) (vista|xp)/i],[m,_],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[m,[_,re,ie]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[_,re,ie],[m,`Windows`]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[_,/_/g,`.`],[m,`iOS`]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[m,G],[_,/_/g,`.`]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[_,m],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[m,_],[/\(bb(10);/i],[_,[m,O]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[_,[m,`Symbian`]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[_,[m,j+` OS`]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[_,[m,`webOS`]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[_,[m,`watchOS`]],[/crkey\/([\d\.]+)/i],[_,[m,A+`cast`]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[m,W],_],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[m,_],[/(sunos) ?([\w\.\d]*)/i],[[m,`Solaris`],_],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[m,_]]},ae=function(e,t){if(typeof e===u&&(t=e,e=o),!(this instanceof ae))return new ae(e,t).getResult();var n=typeof i!==l&&i.navigator?i.navigator:o,r=e||(n&&n.userAgent?n.userAgent:``),y=n&&n.userAgentData?n.userAgentData:o,S=t?function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n}(J,t):J,C=n&&n.userAgent==r;return this.getBrowser=function(){var e,t={};return t[m]=o,t[_]=o,ne.call(t,r,S.browser),t[f]=typeof(e=t[_])===d?e.replace(/[^\d\.]/g,``).split(`.`)[0]:o,C&&n&&n.brave&&typeof n.brave.isBrave==c&&(t[m]=`Brave`),t},this.getCPU=function(){var e={};return e[v]=o,ne.call(e,r,S.cpu),e},this.getDevice=function(){var e={};return e[g]=o,e[p]=o,e[h]=o,ne.call(e,r,S.device),C&&!e[h]&&y&&y.mobile&&(e[h]=b),C&&e[p]==`Macintosh`&&n&&typeof n.standalone!==l&&n.maxTouchPoints&&n.maxTouchPoints>2&&(e[p]=`iPad`,e[h]=x),e},this.getEngine=function(){var e={};return e[m]=o,e[_]=o,ne.call(e,r,S.engine),e},this.getOS=function(){var e={};return e[m]=o,e[_]=o,ne.call(e,r,S.os),C&&!e[m]&&y&&y.platform&&y.platform!=`Unknown`&&(e[m]=y.platform.replace(/chrome os/i,W).replace(/macos/i,G)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(e){return r=typeof e===d&&e.length>500?te(e,500):e,this},this.setUA(r),this};ae.VERSION=`1.0.38`,ae.BROWSER=K([m,_,f]),ae.CPU=K([v]),ae.DEVICE=K([p,g,h,y,b,S,x,C,w]),ae.ENGINE=ae.OS=K([m,_]),typeof t===l?n.amdO?(r=function(){return ae}.call(t,n,t,e))===o||(e.exports=r):typeof i!==l&&(i.UAParser=ae):(e.exports&&(t=e.exports=ae),t.UAParser=ae);var oe=typeof i!==l&&(i.jQuery||i.Zepto);if(oe&&!oe.ua){var se=new ae;oe.ua=se.getResult(),oe.ua.get=function(){return se.getUA()},oe.ua.set=function(e){se.setUA(e);var t=se.getResult();for(var n in t)oe.ua[n]=t[n]}}})(typeof window==`object`?window:this)},9e3:function(e,t,n){function r(e){try{if(!n.g.localStorage)return!1}catch{return!1}var t=n.g.localStorage[e];return t!=null&&String(t).toLowerCase()===`true`}e.exports=function(e,t){if(r(`noDeprecation`))return e;var n=!1;return function(){if(!n){if(r(`throwDeprecation`))throw Error(t);r(`traceDeprecation`)?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}},3779:function(){},7199:function(){},5393:function(e,t,n){n.r(t),n.d(t,{Debug:function(){return o.default},FactoryMaker:function(){return i.default},MediaPlayer:function(){return r.default}});var r=n(8200),i=n(138),o=n(649),c=n(8986),l=typeof window<`u`&&window||global,u=l.dashjs;u||=l.dashjs={},u.MediaPlayer=r.default,u.FactoryMaker=i.default,u.Debug=o.default,u.Version=(0,c.getVersionString)(),t.default=u},649:function(e,t,n){n.r(t);var r=n(8850),i=n(3621),o=n(138);function c(e){e||={};let t=this.context,n=(0,r.default)(t).getInstance(),o=e.settings,c=[],l,u,d,f;function p(e){return e&&e.bind?e.bind(window.console):window.console.log.bind(window.console)}function m(...e){y(1,this,...e)}function h(...e){y(2,this,...e)}function g(...e){y(3,this,...e)}function _(...e){y(4,this,...e)}function v(...e){y(5,this,...e)}function y(e,t,...r){let l=``,p=null;u&&(p=new Date().getTime(),l+=`[`+(p-f)+`]`),d&&t&&t.getClassName&&(l+=`[`+t.getClassName()+`]`,t.getType&&(l+=`[`+t.getType()+`]`)),l.length>0&&(l+=` `),Array.apply(null,r).forEach((function(e){l+=e+` `})),c[e]&&o&&o.get().debug.logLevel>=e&&c[e](l),o&&o.get().debug.dispatchEvent&&n.trigger(i.default.LOG,{message:l,level:e})}return l={getLogger:function(e){return{fatal:m.bind(e),error:h.bind(e),warn:g.bind(e),info:_.bind(e),debug:v.bind(e)}},setLogTimestampVisible:function(e){u=e},setCalleeNameVisible:function(e){d=e}},u=!0,d=!0,f=new Date().getTime(),typeof window<`u`&&window.console&&(c[1]=p(window.console.error),c[2]=p(window.console.error),c[3]=p(window.console.warn),c[4]=p(window.console.info),c[5]=p(window.console.debug)),l}c.__dashjs_factory_name=`Debug`;let l=o.default.getSingletonFactory(c);l.LOG_LEVEL_NONE=0,l.LOG_LEVEL_FATAL=1,l.LOG_LEVEL_ERROR=2,l.LOG_LEVEL_WARNING=3,l.LOG_LEVEL_INFO=4,l.LOG_LEVEL_DEBUG=5,o.default.updateSingletonFactory(c.__dashjs_factory_name,l),t.default=l},8850:function(e,t,n){n.r(t);var r=n(138),i=n(1191);function o(){let e={};function t(t,n,i,o={},c=!1){if(!t)throw Error(`event type cannot be null or undefined`);if(!n||typeof n!=`function`)throw Error(`listener must be a function: `+n);let l=o.priority||0;if(r(t,n,i)>=0)return;e[t]=e[t]||[];let u={callback:n,scope:i,priority:l,executeOnlyOnce:c};i&&i.getStreamId&&(u.streamId=i.getStreamId()),i&&i.getType&&(u.mediaType=i.getType()),o&&o.mode&&(u.mode=o.mode),e[t].some(((n,r)=>{if(n&&l>n.priority)return e[t].splice(r,0,u),!0}))||e[t].push(u)}function n(t,n,i){if(!t||!n||!e[t])return;let o=r(t,n,i);o<0||(e[t][o]=null)}function r(t,n,r){let i=-1;return e[t]&&e[t].some(((e,t)=>{if(e&&e.callback===n&&(!r||r===e.scope))return i=t,!0})),i}return{on:function(e,n,r,i={}){t(e,n,r,i)},once:function(e,n,r,i={}){t(e,n,r,i,!0)},off:n,trigger:function(t,r={},o={}){if(!t||!e[t])return;if((r||={}).hasOwnProperty(`type`))throw Error(`'type' is a reserved word for event dispatching`);r.type=t,o.streamId&&(r.streamId=o.streamId),o.mediaType&&(r.mediaType=o.mediaType);let c=[];e[t].filter((e=>!(!e||o.streamId&&e.streamId&&e.streamId!==o.streamId||o.mediaType&&e.mediaType&&e.mediaType!==o.mediaType||o.mode&&e.mode&&e.mode!==o.mode||!e.mode&&o.mode&&o.mode===i.default.EVENT_MODE_ON_RECEIVE))).forEach((e=>{e&&e.callback.call(e.scope,r),e.executeOnlyOnce&&c.push(e)})),c.forEach((e=>{n(t,e.callback,e.scope)}))},reset:function(){e={}}}}o.__dashjs_factory_name=`EventBus`;let c=r.default.getSingletonFactory(o);c.EVENT_PRIORITY_LOW=0,c.EVENT_PRIORITY_HIGH=5e3,r.default.updateSingletonFactory(o.__dashjs_factory_name,c),t.default=c},138:function(e,t,n){n.r(t),t.default=function(){let e,t=[],n={},r={};function i(e,n){for(let r in t){let i=t[r];if(i.context===e&&i.name===n)return i.instance}return null}function o(e,t){return t[e]}function c(e,t,n){e in n&&(n[e]=t)}function l(t,n,r){let i,o=t.__dashjs_factory_name,c=n[o];if(c){let o=c.instance;if(!c.override)return o.apply({context:n,factory:e},r);i=t.apply({context:n},r),o=o.apply({context:n,factory:e,parent:i},r);for(let e in o)i.hasOwnProperty(e)&&(i[e]=o[e])}else i=t.apply({context:n},r);return i.getClassName=function(){return o},i}return e={deleteSingletonInstances:function(e){t=t.filter((t=>t.context!==e))},extend:function(e,t,n,r){!r[e]&&t&&(r[e]={instance:t,override:n})},getClassFactory:function(e){let t=o(e.__dashjs_factory_name,r);return t||(t=function(t){return t===void 0&&(t={}),{create:function(){return l(e,t,arguments)}}},r[e.__dashjs_factory_name]=t),t},getClassFactoryByName:function(e){return o(e,r)},getSingletonFactory:function(e){let r=o(e.__dashjs_factory_name,n);return r||(r=function(n){let r;return n===void 0&&(n={}),{getInstance:function(){return r||=i(n,e.__dashjs_factory_name),r||(r=l(e,n,arguments),t.push({name:e.__dashjs_factory_name,context:n,instance:r})),r}}},n[e.__dashjs_factory_name]=r),r},getSingletonFactoryByName:function(e){return o(e,n)},getSingletonInstance:i,setSingletonInstance:function(e,n,r){for(let i in t){let o=t[i];if(o.context===e&&o.name===n)return void(t[i].instance=r)}t.push({name:n,context:e,instance:r})},updateClassFactory:function(e,t){c(e,t,r)},updateSingletonFactory:function(e,t){c(e,t,n)}},e}()},8261:function(e,t,n){n.r(t);var r=n(138),i=n(7263),o=n(649),c=n(5212),l=n(7568),u=n(8850),d=n(3621),f=n(4246);function p(){let e,t=this.context,n=(0,u.default)(t).getInstance(),r={"streaming.delay.liveDelay":d.default.SETTING_UPDATED_LIVE_DELAY,"streaming.delay.liveDelayFragmentCount":d.default.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT,"streaming.liveCatchup.enabled":d.default.SETTING_UPDATED_CATCHUP_ENABLED,"streaming.liveCatchup.playbackRate.min":d.default.SETTING_UPDATED_PLAYBACK_RATE_MIN,"streaming.liveCatchup.playbackRate.max":d.default.SETTING_UPDATED_PLAYBACK_RATE_MAX,"streaming.abr.rules.throughputRule.active":d.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.bolaRule.active":d.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.insufficientBufferRule.active":d.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.switchHistoryRule.active":d.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.droppedFramesRule.active":d.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.abandonRequestsRule.active":d.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.l2ARule.active":d.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.rules.loLPRule.active":d.default.SETTING_UPDATED_ABR_ACTIVE_RULES,"streaming.abr.maxBitrate.video":d.default.SETTING_UPDATED_MAX_BITRATE,"streaming.abr.maxBitrate.audio":d.default.SETTING_UPDATED_MAX_BITRATE,"streaming.abr.minBitrate.video":d.default.SETTING_UPDATED_MIN_BITRATE,"streaming.abr.minBitrate.audio":d.default.SETTING_UPDATED_MIN_BITRATE},p={debug:{logLevel:o.default.LOG_LEVEL_WARNING,dispatchEvent:!1},streaming:{abandonLoadTimeout:1e4,wallclockTimeUpdateInterval:100,manifestUpdateRetryInterval:100,liveUpdateTimeThresholdInMilliseconds:0,cacheInitSegments:!1,applyServiceDescription:!0,applyProducerReferenceTime:!0,applyContentSteering:!0,enableManifestDurationMismatchFix:!0,parseInbandPrft:!1,enableManifestTimescaleMismatchFix:!1,capabilities:{filterUnsupportedEssentialProperties:!0,supportedEssentialProperties:[{schemeIdUri:c.default.FONT_DOWNLOAD_DVB_SCHEME},{schemeIdUri:c.default.COLOUR_PRIMARIES_SCHEME_ID_URI,value:/1|5|6|7/},{schemeIdUri:c.default.URL_QUERY_INFO_SCHEME},{schemeIdUri:c.default.EXT_URL_QUERY_INFO_SCHEME},{schemeIdUri:c.default.MATRIX_COEFFICIENTS_SCHEME_ID_URI,value:/0|1|5|6/},{schemeIdUri:c.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI,value:/1|6|13|14|15/},{schemeIdUri:c.default.SEGMENT_SEQUENCE_REPRESENTATION_SCHEME_ID_URI},...c.default.THUMBNAILS_SCHEME_ID_URIS.map((e=>({schemeIdUri:e})))],useMediaCapabilitiesApi:!0,filterVideoColorimetryEssentialProperties:!1,filterHDRMetadataFormatEssentialProperties:!1,filterAudioChannelConfiguration:!1},events:{eventControllerRefreshDelay:100,deleteEventMessageDataTimeout:1e4},timeShiftBuffer:{calcFromSegmentTimeline:!1,fallbackToSegmentTimeline:!0},metrics:{maxListDepth:100},delay:{liveDelayFragmentCount:NaN,liveDelay:NaN,useSuggestedPresentationDelay:!0},protection:{keepProtectionMediaKeys:!1,keepProtectionMediaKeysMaximumOpenSessions:-1,ignoreEmeEncryptedEvent:!1,detectPlayreadyMessageFormat:!0,ignoreKeyStatuses:!1},buffer:{enableSeekDecorrelationFix:!1,fastSwitchEnabled:null,flushBufferAtTrackSwitch:!1,reuseExistingSourceBuffers:!0,bufferPruningInterval:10,bufferToKeep:20,bufferTimeAtTopQuality:30,bufferTimeAtTopQualityLongForm:60,initialBufferLevel:NaN,bufferTimeDefault:18,longFormContentDurationThreshold:600,stallThreshold:.3,lowLatencyStallThreshold:.3,useAppendWindow:!0,setStallState:!0,avoidCurrentTimeRangePruning:!1,useChangeType:!0,mediaSourceDurationInfinity:!0,resetSourceBuffersForTrackSwitch:!1,syntheticStallEvents:{enabled:!1,ignoreReadyState:!1}},gaps:{jumpGaps:!0,jumpLargeGaps:!0,smallGapLimit:1.5,threshold:.3,enableSeekFix:!0,enableStallFix:!1,stallSeek:.1,seekOffset:0},utcSynchronization:{enabled:!0,useManifestDateHeaderTimeSource:!0,backgroundAttempts:2,timeBetweenSyncAttempts:30,maximumTimeBetweenSyncAttempts:600,minimumTimeBetweenSyncAttempts:2,timeBetweenSyncAttemptsAdjustmentFactor:2,maximumAllowedDrift:100,enableBackgroundSyncAfterSegmentDownloadError:!0,defaultTimingSource:{scheme:`urn:mpeg:dash:utc:http-xsdate:2014`,value:`https://time.akamai.com/?iso&ms`},artificialTimeOffsetToApply:0},scheduling:{defaultTimeout:500,lowLatencyTimeout:0,scheduleWhilePaused:!0},text:{defaultEnabled:!0,dispatchForManualRendering:!1,extendSegmentedCues:!0,imsc:{displayForcedOnlyMode:!1,enableRollUp:!0},webvtt:{customRenderingEnabled:!1}},liveCatchup:{maxDrift:NaN,playbackRate:{min:NaN,max:NaN},playbackBufferMin:.5,enabled:null,mode:c.default.LIVE_CATCHUP_MODE_DEFAULT},lastBitrateCachingInfo:{enabled:!0,ttl:36e4},lastMediaSettingsCachingInfo:{enabled:!0,ttl:36e4},saveLastMediaSettingsForCurrentStreamingSession:!0,cacheLoadThresholds:{video:10,audio:5},trackSwitchMode:{audio:c.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE,video:c.default.TRACK_SWITCH_MODE_NEVER_REPLACE},includePreselectionsInMediainfoArray:!0,includePreselectionsForInitialTrackSelection:!1,ignoreSelectionPriority:!1,prioritizeRoleMain:!0,assumeDefaultRoleAsMain:!0,selectionModeForInitialTrack:c.default.TRACK_SELECTION_MODE_LOWEST_STARTUP_DELAY,fragmentRequestTimeout:2e4,fragmentRequestProgressTimeout:-1,manifestRequestTimeout:1e4,retryIntervals:{[l.HTTPRequest.MPD_TYPE]:500,[l.HTTPRequest.XLINK_EXPANSION_TYPE]:500,[l.HTTPRequest.MEDIA_SEGMENT_TYPE]:1e3,[l.HTTPRequest.INIT_SEGMENT_TYPE]:1e3,[l.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE]:1e3,[l.HTTPRequest.INDEX_SEGMENT_TYPE]:1e3,[l.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE]:1e3,[l.HTTPRequest.LICENSE]:1e3,[l.HTTPRequest.OTHER_TYPE]:1e3,lowLatencyReductionFactor:10},retryAttempts:{[l.HTTPRequest.MPD_TYPE]:3,[l.HTTPRequest.XLINK_EXPANSION_TYPE]:1,[l.HTTPRequest.MEDIA_SEGMENT_TYPE]:3,[l.HTTPRequest.INIT_SEGMENT_TYPE]:3,[l.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE]:3,[l.HTTPRequest.INDEX_SEGMENT_TYPE]:3,[l.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE]:3,[l.HTTPRequest.LICENSE]:3,[l.HTTPRequest.OTHER_TYPE]:3,lowLatencyMultiplyFactor:5},abr:{limitBitrateByPortal:!1,usePixelRatioInLimitBitrateByPortal:!1,enableSupplementalPropertyAdaptationSetSwitching:!0,rules:{throughputRule:{active:!0,priority:f.default.PRIORITY.DEFAULT},bolaRule:{active:!0,priority:f.default.PRIORITY.DEFAULT},insufficientBufferRule:{active:!0,priority:f.default.PRIORITY.DEFAULT,parameters:{throughputSafetyFactor:.7,segmentIgnoreCount:2}},switchHistoryRule:{active:!0,priority:f.default.PRIORITY.DEFAULT,parameters:{sampleSize:8,switchPercentageThreshold:.075}},droppedFramesRule:{active:!1,priority:f.default.PRIORITY.DEFAULT,parameters:{minimumSampleSize:375,droppedFramesPercentageThreshold:.15}},abandonRequestsRule:{active:!0,priority:f.default.PRIORITY.DEFAULT,parameters:{abandonDurationMultiplier:1.8,minSegmentDownloadTimeThresholdInMs:500,minThroughputSamplesThreshold:6}},l2ARule:{active:!1,priority:f.default.PRIORITY.DEFAULT},loLPRule:{active:!1,priority:f.default.PRIORITY.DEFAULT}},throughput:{averageCalculationMode:c.default.THROUGHPUT_CALCULATION_MODES.EWMA,lowLatencyDownloadTimeCalculationMode:c.default.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.MOOF_PARSING,useResourceTimingApi:!0,useNetworkInformationApi:{xhr:!1,fetch:!1},useDeadTimeLatency:!0,bandwidthSafetyFactor:.9,sampleSettings:{live:3,vod:4,enableSampleSizeAdjustment:!0,decreaseScale:.7,increaseScale:1.3,maxMeasurementsToKeep:20,averageLatencySampleAmount:4},ewma:{throughputSlowHalfLifeSeconds:8,throughputFastHalfLifeSeconds:3,latencySlowHalfLifeCount:2,latencyFastHalfLifeCount:1,weightDownloadTimeMultiplicationFactor:.0015}},maxBitrate:{audio:-1,video:-1},minBitrate:{audio:-1,video:-1},initialBitrate:{audio:-1,video:-1},autoSwitchBitrate:{audio:!0,video:!0}},cmcd:{applyParametersFromMpd:!0,enabled:!1,sid:null,cid:null,rtp:null,rtpSafetyFactor:5,mode:c.default.CMCD_MODE_QUERY,enabledKeys:c.default.CMCD_AVAILABLE_KEYS,includeInRequests:[`segment`,`mpd`],version:1},cmsd:{enabled:!1,abr:{applyMb:!1,etpWeightRatio:0}},enhancement:{enabled:!1,codecs:[`lvc1`]},defaultSchemeIdUri:{viewpoint:``,audioChannelConfiguration:`urn:mpeg:mpegB:cicp:ChannelConfiguration`,role:`urn:mpeg:dash:role:2011`,accessibility:`urn:mpeg:dash:role:2011`}},errors:{recoverAttempts:{mediaErrorDecode:5}}},m=i.default.clone(p);function h(e,t,o){for(let c in e)e.hasOwnProperty(c)&&(t.hasOwnProperty(c)?typeof e[c]!=`object`||e[c]instanceof RegExp||e[c]instanceof Array||e[c]===null?(t[c]=i.default.clone(e[c]),r[o+c]&&n.trigger(r[o+c])):h(e[c],t[c],o.slice()+c+`.`):console.error(`Settings parameter `+o+c+` is not supported`))}return e={get:function(){return m},update:function(e){typeof e==`object`&&h(e,m,``)},reset:function(){m=i.default.clone(p)}},e}p.__dashjs_factory_name=`Settings`,t.default=r.default.getSingletonFactory(p)},7263:function(e,t,n){n.r(t);var r=n(3282),i=n(8571),o=n(5212);class c{static mixin(e,t,n){let r,i={};if(e)for(let o in t)t.hasOwnProperty(o)&&(r=t[o],o in e&&(e[o]===r||o in i&&i[o]===r)||(typeof e[o]==`object`&&e[o]!==null?e[o]=c.mixin(e[o],r,n):e[o]=n(r)));return e}static clone(e){if(!e||typeof e!=`object`)return e;if(e instanceof RegExp)return new RegExp(e);let t;if(e instanceof Array){t=[];for(let n=0,r=e.length;n<r;++n)n in e&&t.push(c.clone(e[n]))}else t={};return c.mixin(t,e,c.clone)}static addAdditionalQueryParameterToUrl(e,t){try{if(!t||t.length===0)return e;let n=e;return t.forEach((({key:e,value:t})=>{let r=n.includes(`?`)?`&`:`?`;n+=`${r}${encodeURIComponent(e)}=${encodeURIComponent(t)}`})),n}catch{return e}}static removeQueryParameterFromUrl(e,t){if(!e||!t)return e;let n=new URL(e),r=new URLSearchParams(n.search);if(!r||r.size===0||!r.has(t))return e;r.delete(t);let i=Array.from(r.entries()).map((([e,t])=>`${e}=${t}`)).join(`&`),o=`${n.origin}${n.pathname}`;return i?`${o}?${i}`:o}static parseHttpHeaders(e){let t={};if(!e)return t;let n=e.trim().split(`\r
51
+ `);for(let e=0,r=n.length;e<r;e++){let r=n[e],i=r.indexOf(`: `);i>0&&(t[r.substring(0,i)]=r.substring(i+2))}return t}static parseQueryParams(e){let t=[],n=new URLSearchParams(e);for(let[e,r]of n.entries())t.push({key:decodeURIComponent(e),value:decodeURIComponent(r)});return t}static generateUuid(){let e=new Date().getTime();return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,(function(t){let n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),(t==`x`?n:3&n|8).toString(16)}))}static generateHashCode(e){let t=0;if(e.length===0)return t;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t}static getRelativeUrl(e,t){try{let n=new URL(e),i=new URL(t);if(n.protocol=i.protocol,n.origin!==i.origin)return t;let o=r.relative(n.pathname.substr(0,n.pathname.lastIndexOf(`/`)),i.pathname.substr(0,i.pathname.lastIndexOf(`/`))),c=+(o.length===0);return o+=i.pathname.substr(i.pathname.lastIndexOf(`/`)+c,i.pathname.length-1),i.pathname.length<o.length?i.pathname:o}catch{return t}}static getHostFromUrl(e){try{return new URL(e).host}catch{return null}}static parseUserAgent(e=null){try{let t=e===null&&typeof navigator<`u`?navigator.userAgent.toLowerCase():``;return(0,i.UAParser)(t)}catch{return{}}}static stringHasProtocol(e){return/(http(s?)):\/\//i.test(e)}static bufferSourceToDataView(e){return c.toDataView(e,DataView)}static bufferSourceToInt8(e){return c.toDataView(e,Uint8Array)}static uint8ArrayToString(e){return new TextDecoder(`utf-8`).decode(e)}static bufferSourceToHex(e){let t=c.bufferSourceToInt8(e),n=``;for(let e of t)e=e.toString(16),e.length===1&&(e=`0`+e),n+=e;return n}static toDataView(e,t){let n=c.getArrayBuffer(e),r=1;`BYTES_PER_ELEMENT`in DataView&&(r=DataView.BYTES_PER_ELEMENT);let i=((e.byteOffset||0)+e.byteLength)/r,o=(e.byteOffset||0)/r,l=Math.floor(Math.max(0,Math.min(o,i)));return new t(n,l,Math.floor(Math.min(l+1/0,i))-l)}static getArrayBuffer(e){return e instanceof ArrayBuffer?e:e.buffer}static getCodecFamily(e){let{base:t,profile:n}=c._getCodecParts(e);switch(t){case`mp4a`:switch(n){case`69`:case`6b`:case`40.34`:return o.default.CODEC_FAMILIES.MP3;case`66`:case`67`:case`68`:case`40.2`:case`40.02`:case`40.5`:case`40.05`:case`40.29`:case`40.42`:return o.default.CODEC_FAMILIES.AAC;case`a5`:return o.default.CODEC_FAMILIES.AC3;case`e6`:return o.default.CODEC_FAMILIES.EC3;case`b2`:return o.default.CODEC_FAMILIES.DTSX;case`a9`:return o.default.CODEC_FAMILIES.DTSC}break;case`avc1`:case`avc3`:return o.default.CODEC_FAMILIES.AVC;case`hvc1`:case`hvc3`:return o.default.CODEC_FAMILIES.HEVC;default:return t}return t}static _getCodecParts(e){let[t,...n]=e.split(`.`);return{base:t,profile:n.join(`.`)}}}t.default=c},8986:function(e,t,n){n.r(t),n.d(t,{getVersionString:function(){return r}});function r(){return`5.1.1`}},8748:function(e,t,n){n.r(t),t.default=class{extend(e,t){if(!e)return;let n=!!t&&t.override,r=!!t&&t.publicOnly;for(let t in e)!e.hasOwnProperty(t)||this[t]&&!n||r&&e[t].indexOf(`public_`)===-1||(this[t]=e[t])}}},5734:function(e,t,n){n.r(t);var r=n(7252);class i extends r.default{constructor(){super(),this.ATTEMPT_BACKGROUND_SYNC=`attemptBackgroundSync`,this.BUFFERING_COMPLETED=`bufferingCompleted`,this.BUFFER_CLEARED=`bufferCleared`,this.BUFFER_REPLACEMENT_STARTED=`bufferReplacementStarted`,this.BYTES_APPENDED_END_FRAGMENT=`bytesAppendedEndFragment`,this.CHECK_FOR_EXISTENCE_COMPLETED=`checkForExistenceCompleted`,this.CMSD_STATIC_HEADER=`cmsdStaticHeader`,this.CURRENT_TRACK_CHANGED=`currentTrackChanged`,this.DATA_UPDATE_COMPLETED=`dataUpdateCompleted`,this.INBAND_EVENTS=`inbandEvents`,this.INITIAL_STREAM_SWITCH=`initialStreamSwitch`,this.INIT_FRAGMENT_LOADED=`initFragmentLoaded`,this.INIT_FRAGMENT_NEEDED=`initFragmentNeeded`,this.INTERNAL_MANIFEST_LOADED=`internalManifestLoaded`,this.LOADING_ABANDONED=`loadingAborted`,this.LOADING_COMPLETED=`loadingCompleted`,this.LOADING_DATA_PROGRESS=`loadingDataProgress`,this.LOADING_PROGRESS=`loadingProgress`,this.MANIFEST_UPDATED=`manifestUpdated`,this.MEDIAINFO_UPDATED=`mediaInfoUpdated`,this.MEDIA_FRAGMENT_LOADED=`mediaFragmentLoaded`,this.MEDIA_FRAGMENT_NEEDED=`mediaFragmentNeeded`,this.ORIGINAL_MANIFEST_LOADED=`originalManifestLoaded`,this.QUOTA_EXCEEDED=`quotaExceeded`,this.SEEK_TARGET=`seekTarget`,this.SEGMENT_LOCATION_BLACKLIST_ADD=`segmentLocationBlacklistAdd`,this.SEGMENT_LOCATION_BLACKLIST_CHANGED=`segmentLocationBlacklistChanged`,this.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD=`serviceLocationBlacklistAdd`,this.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED=`serviceLocationBlacklistChanged`,this.SERVICE_LOCATION_LOCATION_BLACKLIST_ADD=`serviceLocationLocationBlacklistAdd`,this.SERVICE_LOCATION_LOCATION_BLACKLIST_CHANGED=`serviceLocationLocationBlacklistChanged`,this.SETTING_UPDATED_ABR_ACTIVE_RULES=`settingUpdatedAbrActiveRules`,this.SETTING_UPDATED_CATCHUP_ENABLED=`settingUpdatedCatchupEnabled`,this.SETTING_UPDATED_LIVE_DELAY=`settingUpdatedLiveDelay`,this.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT=`settingUpdatedLiveDelayFragmentCount`,this.SETTING_UPDATED_MAX_BITRATE=`settingUpdatedMaxBitrate`,this.SETTING_UPDATED_MIN_BITRATE=`settingUpdatedMinBitrate`,this.SETTING_UPDATED_PLAYBACK_RATE_MAX=`settingUpdatedPlaybackRateMax`,this.SETTING_UPDATED_PLAYBACK_RATE_MIN=`settingUpdatedPlaybackRateMin`,this.SET_FRAGMENTED_TEXT_AFTER_DISABLED=`setFragmentedTextAfterDisabled`,this.SET_NON_FRAGMENTED_TEXT=`setNonFragmentedText`,this.SOURCE_BUFFER_ERROR=`sourceBufferError`,this.STREAMS_COMPOSED=`streamsComposed`,this.STREAM_BUFFERING_COMPLETED=`streamBufferingCompleted`,this.STREAM_REQUESTING_COMPLETED=`streamRequestingCompleted`,this.TEXT_TRACKS_QUEUE_INITIALIZED=`textTracksQueueInitialized`,this.TIME_SYNCHRONIZATION_COMPLETED=`timeSynchronizationComplete`,this.UPDATE_TIME_SYNC_OFFSET=`updateTimeSyncOffset`,this.URL_RESOLUTION_FAILED=`urlResolutionFailed`,this.VIDEO_CHUNK_RECEIVED=`videoChunkReceived`,this.VIDEO_ELEMENT_RESIZED=`videoElementResized`,this.WALLCLOCK_TIME_UPDATED=`wallclockTimeUpdated`,this.XLINK_ELEMENT_LOADED=`xlinkElementLoaded`,this.XLINK_READY=`xlinkReady`}}t.default=i},3621:function(e,t,n){n.r(t);var r=n(5734);class i extends r.default{}t.default=new i},7252:function(e,t,n){n.r(t),t.default=class{extend(e,t){if(!e)return;let n=!!t&&t.override,r=!!t&&t.publicOnly;for(let t in e)!e.hasOwnProperty(t)||this[t]&&!n||r&&e[t].indexOf(`public_`)===-1||(this[t]=e[t])}}},8854:function(e,t,n){n.r(t),t.default={ACCESSIBILITY:`Accessibility`,ADAPTATION_SET:`AdaptationSet`,ADAPTATION_SETS:`adaptationSets`,ADAPTATION_SET_SWITCHING_SCHEME_ID_URI:`urn:mpeg:dash:adaptation-set-switching:2016`,ADD:`add`,ASSET_IDENTIFIER:`AssetIdentifier`,AUDIO_CHANNEL_CONFIGURATION:`AudioChannelConfiguration`,AUDIO_SAMPLING_RATE:`audioSamplingRate`,AVAILABILITY_END_TIME:`availabilityEndTime`,AVAILABILITY_START_TIME:`availabilityStartTime`,AVAILABILITY_TIME_COMPLETE:`availabilityTimeComplete`,AVAILABILITY_TIME_OFFSET:`availabilityTimeOffset`,BANDWITH:`bandwidth`,BASE_URL:`BaseURL`,BITSTREAM_SWITCHING:`BitstreamSwitching`,BITSTREAM_SWITCHING_MINUS:`bitstreamSwitching`,BYTE_RANGE:`byteRange`,CAPTION:`caption`,CENC_DEFAULT_KID:`cenc:default_KID`,CLIENT_DATA_REPORTING:`ClientDataReporting`,CLIENT_REQUIREMENT:`clientRequirement`,CMCD_PARAMETERS:`CMCDParameters`,CODECS:`codecs`,CODEC_PRIVATE_DATA:`codecPrivateData`,CODING_DEPENDENCY:`codingDependency`,CONTENT_COMPONENT:`ContentComponent`,CONTENT_PROTECTION:`ContentProtection`,CONTENT_STEERING:`ContentSteering`,CONTENT_STEERING_RESPONSE:{VERSION:`VERSION`,TTL:`TTL`,RELOAD_URI:`RELOAD-URI`,PATHWAY_PRIORITY:`PATHWAY-PRIORITY`,PATHWAY_CLONES:`PATHWAY-CLONES`,BASE_ID:`BASE-ID`,ID:`ID`,URI_REPLACEMENT:`URI-REPLACEMENT`,HOST:`HOST`,PARAMS:`PARAMS`},CONTENT_TYPE:`contentType`,DEFAULT_SERVICE_LOCATION:`defaultServiceLocation`,DEPENDENCY_ID:`dependencyId`,DURATION:`duration`,DVB_PRIORITY:`dvb:priority`,DVB_WEIGHT:`dvb:weight`,DVB_URL:`dvb:url`,DVB_MIMETYPE:`dvb:mimeType`,DVB_FONTFAMILY:`dvb:fontFamily`,DYNAMIC:`dynamic`,END_NUMBER:`endNumber`,ESSENTIAL_PROPERTY:`EssentialProperty`,EVENT:`Event`,EVENT_STREAM:`EventStream`,FORCED_SUBTITLE:`forced-subtitle`,FRAMERATE:`frameRate`,FRAME_PACKING:`FramePacking`,GROUP_LABEL:`GroupLabel`,HEIGHT:`height`,ID:`id`,INBAND:`inband`,INBAND_EVENT_STREAM:`InbandEventStream`,INDEX:`index`,INDEX_RANGE:`indexRange`,INITIALIZATION:`Initialization`,INITIALIZATION_MINUS:`initialization`,LA_URL:`Laurl`,LA_URL_LOWER_CASE:`laurl`,LABEL:`Label`,LANG:`lang`,LOCATION:`Location`,MAIN:`main`,MAXIMUM_SAP_PERIOD:`maximumSAPPeriod`,MAX_PLAYOUT_RATE:`maxPlayoutRate`,MAX_SEGMENT_DURATION:`maxSegmentDuration`,MAX_SUBSEGMENT_DURATION:`maxSubsegmentDuration`,MEDIA:`media`,MEDIA_PRESENTATION_DURATION:`mediaPresentationDuration`,MEDIA_RANGE:`mediaRange`,MEDIA_STREAM_STRUCTURE_ID:`mediaStreamStructureId`,METRICS:`Metrics`,METRICS_MINUS:`metrics`,MIME_TYPE:`mimeType`,MINIMUM_UPDATE_PERIOD:`minimumUpdatePeriod`,MIN_BUFFER_TIME:`minBufferTime`,MP4_PROTECTION_SCHEME:`urn:mpeg:dash:mp4protection:2011`,MPD:`MPD`,MPD_TYPE:`mpd`,MPD_PATCH_TYPE:`mpdpatch`,ORDER:`order`,ORIGINAL_MPD_ID:`mpdId`,ORIGINAL_PUBLISH_TIME:`originalPublishTime`,PATCH_LOCATION:`PatchLocation`,PERIOD:`Period`,PRESELECTION:`Preselection`,PRESELECTION_COMPONENTS:`preselectionComponents`,PRESENTATION_TIME:`presentationTime`,PRESENTATION_TIME_OFFSET:`presentationTimeOffset`,PRO:`pro`,PRODUCER_REFERENCE_TIME:`ProducerReferenceTime`,PRODUCER_REFERENCE_TIME_TYPE:{ENCODER:`encoder`,CAPTURED:`captured`,APPLICATION:`application`},PROFILES:`profiles`,PSSH:`pssh`,PUBLISH_TIME:`publishTime`,QUALITY_RANKING:`qualityRanking`,QUERY_BEFORE_START:`queryBeforeStart`,QUERY_PART:`$querypart$`,RANGE:`range`,RATING:`Rating`,REF:`ref`,REF_ID:`refId`,REMOVE:`remove`,REPLACE:`replace`,REPORTING:`Reporting`,REPRESENTATION:`Representation`,REPRESENTATION_INDEX:`RepresentationIndex`,ROBUSTNESS:`robustness`,ROLE:`Role`,S:`S`,SAR:`sar`,SCAN_TYPE:`scanType`,SEGMENT_ALIGNMENT:`segmentAlignment`,SEGMENT_BASE:`SegmentBase`,SEGMENT_LIST:`SegmentList`,SEGMENT_PROFILES:`segmentProfiles`,SEGMENT_SEQUENCE_PROPERTIES:`SegmentSequenceProperties`,SEGMENT_TEMPLATE:`SegmentTemplate`,SEGMENT_TIMELINE:`SegmentTimeline`,SEGMENT_TYPE:`segment`,SEGMENT_URL:`SegmentURL`,SERVICE_DESCRIPTION:`ServiceDescription`,SERVICE_DESCRIPTION_LATENCY:`Latency`,SERVICE_DESCRIPTION_OPERATING_BANDWIDTH:`OperatingBandwidth`,SERVICE_DESCRIPTION_OPERATING_QUALITY:`OperatingQuality`,SERVICE_DESCRIPTION_PLAYBACK_RATE:`PlaybackRate`,SERVICE_DESCRIPTION_SCOPE:`Scope`,SERVICE_LOCATION:`serviceLocation`,SERVICE_LOCATIONS:`serviceLocations`,SOURCE_URL:`sourceURL`,START:`start`,START_NUMBER:`startNumber`,START_WITH_SAP:`startWithSAP`,STATIC:`static`,STEERING_TYPE:`steering`,SUBSET:`Subset`,SUBTITLE:`subtitle`,SUB_REPRESENTATION:`SubRepresentation`,SUB_SEGMENT_ALIGNMENT:`subsegmentAlignment`,SUGGESTED_PRESENTATION_DELAY:`suggestedPresentationDelay`,SUPPLEMENTAL_PROPERTY:`SupplementalProperty`,SUPPLEMENTAL_CODECS:`scte214:supplementalCodecs`,TAG:`tag`,TIMESCALE:`timescale`,TIMESHIFT_BUFFER_DEPTH:`timeShiftBufferDepth`,TTL:`ttl`,TYPE:`type`,UTC_TIMING:`UTCTiming`,VALUE:`value`,VIEWPOINT:`Viewpoint`,WALL_CLOCK_TIME:`wallClockTime`,WIDTH:`width`}},5717:function(e,t,n){n.r(t),t.default=class{constructor(){this.schemeIdUri=``,this.value=``}}},8200:function(t,n,r){r.r(n),r.d(n,{default:function(){return gc}});var i=r(138),o=r(4246),c={TCP_CONNECTION:`TcpList`,HTTP_REQUEST:`HttpList`,TRACK_SWITCH:`RepSwitchList`,BUFFER_LEVEL:`BufferLevel`,BUFFER_LOADED:`bufferLoaded`,ABANDON_LOAD:`abandonload`,ALLOW_LOAD:`allowload`,BUFFER_EMPTY:`bufferStalled`,BUFFER_STATE:`BufferState`,DVR_INFO:`DVRInfo`,DROPPED_FRAMES:`DroppedFrames`,SCHEDULING_INFO:`SchedulingInfo`,REQUESTS_QUEUE:`RequestsQueue`,MANIFEST_UPDATE:`ManifestUpdate`,MANIFEST_UPDATE_STREAM_INFO:`ManifestUpdatePeriodInfo`,MANIFEST_UPDATE_TRACK_INFO:`ManifestUpdateRepresentationInfo`,PLAY_LIST:`PlayList`,DVB_ERRORS:`DVBErrors`,HTTP_REQUEST_DVB_REPORTING_TYPE:`DVBReporting`},l=r(649),u=r(8261);function d(e){e||={};let t=this.context,n=e.dashMetrics,r,i,d;return r={getSwitchRequest:function(e){try{let r=(0,o.default)(t).create();r.rule=this.getClassName();let l=e.getMediaInfo(),u=e.getMediaType(),d=n.getCurrentBufferState(u),f=e.getScheduleController(),p=e.getAbrController(),m=e.getStreamInfo(),h=m?m.id:null,g=m&&m.manifestInfo?m.manifestInfo.isDynamic:null,_=e.getThroughputController(),v=_.getSafeAverageThroughput(u),y=_.getAverageLatency(u);return isNaN(v)||!d||p.getAbandonmentStateFor(h,u)===c.ALLOW_LOAD&&(d.state===c.BUFFER_LOADED||g)&&(r.representation=p.getOptimalRepresentationForBitrate(l,v,!0),r.priority=i.get().streaming.abr.rules.throughputRule.priority,r.reason={throughput:v,latency:y,message:`[ThroughputRule]: Switching to Representation with bitrate ${r.representation?r.representation.bitrateInKbit:`n/a`} kbit/s. Throughput: ${v}`},f.setTimeToLoadDelay(0)),r}catch(e){return d.error(e),(0,o.default)(t).create()}},reset:function(){}},d=(0,l.default)(t).getInstance().getLogger(r),i=(0,u.default)(t).getInstance(),r}d.__dashjs_factory_name=`ThroughputRule`;var f=i.default.getClassFactory(d),p=r(8850),m=r(3621),h=r(5212),g=r(1191);function _(e){e||={};let t=this.context,n=(0,p.default)(t).getInstance(),r=e.dashMetrics,i=(0,u.default)(t).getInstance(),d,f,_;function v(){let e=i.get().streaming.abr.rules.insufficientBufferRule.parameters.segmentIgnoreCount;_={},_[h.default.VIDEO]={ignoreCount:e},_[h.default.AUDIO]={ignoreCount:e},_[h.default.ENHANCEMENT]={ignoreCount:e}}function y(){v()}function b(e){isNaN(e.startTime)||e.mediaType!==h.default.AUDIO&&e.mediaType!==h.default.VIDEO||_[e.mediaType].ignoreCount>0&&_[e.mediaType].ignoreCount--}return d={getSwitchRequest:function(e){let n=(0,o.default)(t).create();if(n.rule=this.getClassName(),!e||!e.hasOwnProperty(`getMediaType`))return n;let l=e.getMediaType(),u=r.getCurrentBufferState(l),d=e.getRepresentation().fragmentDuration;if(!function(e,t,n){return!e.getLowLatencyModeEnabled()&&_[t].ignoreCount<=0&&n}(e.getScheduleController().getPlaybackController(),l,d))return n;let p=e.getMediaInfo(),m=e.getAbrController();if(u&&u.state===c.BUFFER_EMPTY)f.debug(`[`+l+`] Switch to index 0; buffer is empty.`),n.representation=m.getOptimalRepresentationForBitrate(p,0,!0),n.reason={message:`[InsufficientBufferRule]: Switching to lowest Representation because buffer is empty`};else{let t=e.getThroughputController(),o=r.getCurrentBufferLevel(l),c=t.getAverageThroughput(l,null,NaN)*i.get().streaming.abr.rules.insufficientBufferRule.parameters.throughputSafetyFactor*o/d;if(isNaN(c)||c<=0)return n;n.representation=m.getOptimalRepresentationForBitrate(p,c,!0),n.priority=i.get().streaming.abr.rules.insufficientBufferRule.priority,n.reason={message:`[InsufficientBufferRule]: Limiting maximum bitrate to avoid a buffer underrun.`,bitrate:c}}return n},reset:function(){v(),n.off(g.default.PLAYBACK_SEEKING,y,d),n.off(m.default.BYTES_APPENDED_END_FRAGMENT,b,d)}},f=(0,l.default)(t).getInstance().getLogger(d),v(),n.on(g.default.PLAYBACK_SEEKING,y,d),n.on(m.default.BYTES_APPENDED_END_FRAGMENT,b,d),d}_.__dashjs_factory_name=`InsufficientBufferRule`;var v=i.default.getClassFactory(_);function y(e){let t=(e||={}).mediaPlayerModel,n=e.dashMetrics,r=this.context,i=(0,u.default)(r).getInstance(),c,d,f;function p(){f={}}return c={shouldAbandon:function(e){let c=(0,o.default)(r).create();c.rule=this.getClassName();try{if(!e)return c;let r=e.getCurrentRequest();if(!isNaN(r.index)){if(r.firstByteDate===null||f.hasOwnProperty(r.index))return c;let o=t.getBufferTimeDefault(),l=e.getMediaType();if(n.getCurrentBufferLevel(l)>o)return c;let u=Date.now()-r.firstByteDate.getTime();if(r.traces.length>=i.get().streaming.abr.rules.abandonRequestsRule.parameters.minThroughputSamplesThreshold&&u>i.get().streaming.abr.rules.abandonRequestsRule.parameters.minSegmentDownloadTimeThresholdInMs&&r.bytesLoaded<r.bytesTotal)return function(e,t,n){let r=e.getMediaInfo(),o=e.getMediaType(),c=t.traces.reduce(((e,t)=>e+t.b[0]),0)-t.traces[0].b[0],l=Math.max(t.traces.reduce(((e,t)=>e+t.d),0)-t.traces[0].d,1),u=Math.round(8*c/l),d=Number(8*t.bytesTotal/u/1e3).toFixed(2),p=e.getRepresentation(),m=e.getAbrController();if(d<t.duration*i.get().streaming.abr.rules.abandonRequestsRule.parameters.abandonDurationMultiplier||m.isPlayingAtLowestQuality(p))return n;if(!f.hasOwnProperty(t.index)){let c=e.getAbrController(),l=t.bytesTotal-t.bytesLoaded,d=c.getOptimalRepresentationForBitrate(r,u,!0),p=t.representation;l>t.bytesTotal*d.bitrateInKbit/p.bitrateInKbit&&(n.representation=d,n.priority=i.get().streaming.abr.rules.abandonRequestsRule.priority,n.reason={throughputInKbit:u,message:`[AbandonRequestRule][${o} is asking to abandon and switch to quality to ${d.absoluteIndex}. The measured bandwidth was ${u} kbit/s`},f[t.index]=!0)}return n}(e,r,c)}return c}catch(e){return d.error(e),c}},reset:p},d=(0,l.default)(r).getInstance().getLogger(c),p(),c}y.__dashjs_factory_name=`AbandonRequestsRule`;var b=i.default.getClassFactory(y);function x(){let e=this.context,t=(0,u.default)(e).getInstance(),n;return n={getSwitchRequest:function(n){let r=(0,o.default)(e).create();if(r.rule=this.getClassName(),!n||!n.hasOwnProperty(`getDroppedFramesHistory`))return r;let i=n.getDroppedFramesHistory();if(!i)return r;let c=n.getStreamInfo().id,l=n.getMediaInfo(),u=n.getAbrController(),d=i.getFrameHistory(c);if(!d||Object.keys(d).length===0)return r;let f=0,p=0,m=u.getPossibleVoRepresentationsFilteredBySettings(l,!0),h=null;for(let e=1;e<m.length;e++){let n=m[e];if(n&&d[n.id]&&(f=d[n.id].droppedVideoFrames,p=d[n.id].totalVideoFrames,p>t.get().streaming.abr.rules.droppedFramesRule.parameters.minimumSampleSize&&f/p>t.get().streaming.abr.rules.droppedFramesRule.parameters.droppedFramesPercentageThreshold)){h=m[e-1];break}}return h&&(r.representation=h,r.priority=t.get().streaming.abr.rules.droppedFramesRule.priority,r.reason={droppedFrames:f,message:`[DroppedFramesRule]: Switching to index ${h.absoluteIndex}. Dropped Frames: ${f}, Total Frames: ${p}`}),r}},n}x.__dashjs_factory_name=`DroppedFramesRule`;var S=i.default.getClassFactory(x);function C(){let e=this.context,t=(0,u.default)(e).getInstance(),n;return n={getSwitchRequest:function(n){let r=(0,o.default)(e).create();if(r.rule=this.getClassName(),!n)return r;let i=n.getStreamInfo().id,c=n.getMediaType(),l=n?n.getSwitchRequestHistory():null,u=l?l.getSwitchRequests(i,c):{},d=n.getAbrController(),f=n.getMediaInfo(),p=d.getPossibleVoRepresentationsFilteredBySettings(f,!0),m=0,h=0;for(let e=0;e<p.length;e++){let n=p[e];if(n&&u[n.id]&&(m+=u[n.id].drops,h+=u[n.id].noDrops,m+h>=t.get().streaming.abr.rules.switchHistoryRule.parameters.sampleSize&&m/h>t.get().streaming.abr.rules.switchHistoryRule.parameters.switchPercentageThreshold)){r.representation=e>0&&u[n.id].drops>0?p[e-1]:n,r.priority=t.get().streaming.abr.rules.switchHistoryRule.priority,r.reason={drops:m,noDrops:h,message:`[SwitchHistoryRule]: Switch to index: ${r.representation.absoluteIndex} samples: ${m+h} drops: ${m}`};break}}return r}},n}C.__dashjs_factory_name=`SwitchHistoryRule`;var w=i.default.getClassFactory(C),T=r(7568);let E=`BOLA_STATE_ONE_BITRATE`,D=`BOLA_STATE_STARTUP`,O=`BOLA_STATE_STEADY`;function k(e){e||={};let t=this.context,n=e.dashMetrics,r=e.mediaPlayerModel,i=(0,p.default)(t).getInstance(),d=xe(t).getInstance(),f,_,v,y;function b(e){let t=e.mediaType,n=e.streamId,r=t===h.default.AUDIO?[h.default.AUDIO]:y[n];for(let e in r)y[n]&&y[n].hasOwnProperty(e)&&y[n][e].state===O&&(y[n][e].placeholderBuffer=0)}function x(e){let t=e.streamId;for(let e in y[t])if(y[t].hasOwnProperty(e)){let n=y[t][e];n.state!==E&&(n.state=D,S(n))}}function S(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN}function C(e){try{if(e&&e.metric===c.HTTP_REQUEST&&e.value&&e.value.type===T.HTTPRequest.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){let t=y[e.value._streamId]&&y[e.value._streamId][e.mediaType]?y[e.value._streamId][e.mediaType]:null;t&&t.state!==E&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),w(t,e.mediaType))}}catch(e){_.error(e)}}function w(e,t){if(!isNaN(e.lastSegmentStart)&&!isNaN(e.lastSegmentRequestTimeMs)&&!isNaN(e.placeholderBuffer)){if(e.placeholderBuffer*=.99,!isNaN(e.lastSegmentFinishTimeMs)){let r=n.getCurrentBufferLevel(t)+.001*(e.lastSegmentFinishTimeMs-e.lastSegmentRequestTimeMs),i=M(e,e.currentRepresentation),o=Math.max(0,i-r);e.placeholderBuffer=Math.min(o,e.placeholderBuffer)}e.lastSegmentWasReplacement&&!isNaN(e.lastSegmentDurationS)&&(e.placeholderBuffer+=e.lastSegmentDurationS),e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN}}function k(e){if(e&&y[e.streamId]&&y[e.streamId][e.mediaType]){let t=y[e.streamId][e.mediaType];t&&t.state!==E&&(t.currentRepresentation=e.newRepresentation)}}function A(e,t,n){let r=n.reduce(((e,t,r)=>t>n[e]?r:e),0);if(r===0)return null;let i=Math.max(e,10+2*t.length),o=(n[r]-1)/(i/10-1);return{gp:o,Vp:10/o}}function j(e,t){let i=r.getBufferTimeDefault();if(e.bufferTimeDefault!==i){let r=A(i,e.representations,e.utilities);if(r.Vp!==e.Vp||r.gp!==e.gp){let o=n.getCurrentBufferLevel(t),c=o+e.placeholderBuffer;c-=10,c*=r.Vp/e.Vp,c+=10,e.bufferTimeDefault=i,e.Vp=r.Vp,e.gp=r.gp,e.placeholderBuffer=Math.max(0,c-o)}}}function M(e,t){return e.Vp*(e.utilities[t.absoluteIndex]+e.gp)}function N(e){if(e&&e.chunk&&e.chunk.representation.mediaInfo&&y[e.streamId]){let t=y[e.streamId][e.chunk.representation.mediaInfo.type];if(t&&t.state!==E){let n=e.chunk.start;isNaN(t.mostAdvancedSegmentStart)||n>t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=n,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=n,t.lastSegmentDurationS=e.chunk.duration,t.currentRepresentation=e.chunk.representation,w(t,e.chunk.representation.mediaInfo.type)}}}function P(){R()}function F(){v.get().streaming.abr.limitBitrateByPortal&&R()}function I(e,t){let n=t.absoluteIndex,r=t.bandwidth,i=e.utilities[n],o=0;for(let t=n-1;t>=0;--t)if(e.utilities[t]<e.utilities[n]){let n=e.representations[t].bandwidth,c=e.utilities[t],l=e.Vp*(e.gp+(r*c-n*i)/(r-n));o=Math.max(o,l)}return o}function L(e){if(e&&y[e.streamId]){let t=y[e.streamId][e.mediaType];if(t&&t.state!==E){let r=n.getCurrentBufferLevel(e.mediaType),i;i=t.currentRepresentation.absoluteIndex>0?I(t,t.currentRepresentation):10;let o=Math.max(0,i-r);t.placeholderBuffer=Math.min(t.placeholderBuffer,o)}}}function R(){y={}}return f={getSwitchRequest:function(e){try{let i=(0,o.default)(t).create();e.getScheduleController().setTimeToLoadDelay(0),i.rule=this.getClassName(),i.reason=i.reason||{};let c=function(e){let t=e.getMediaType(),n=e.getStreamInfo().id;y[n]||(y={},y[n]={});let i=y[n][t];return i?i.state!==E&&j(i,t):(i=function(e){let t={},n=e.getMediaInfo(),i=d.getPossibleVoRepresentationsFilteredBySettings(n,!0),o=i.map((e=>e.bandwidth)).map((e=>Math.log(e)));o=o.map((e=>e-o[0]+1));let c=r.getBufferTimeDefault(),l=A(c,i,o);return l?(t.state=D,t.representations=i,t.utilities=o,t.bufferTimeDefault=c,t.Vp=l.Vp,t.gp=l.gp,t.currentRepresentation=null,S(t)):t.state=E,t}(e),y[n][t]=i),i}(e);switch(i.reason.state=c.state,c.state){case E:break;case D:(function(e,t,r){let i=t.getMediaType(),o=t.getThroughputController().getSafeAverageThroughput(i);if(isNaN(o))return;let c=t.getMediaInfo(),l=d.getOptimalRepresentationForBitrate(c,o,!0),u=n.getCurrentBufferLevel(i);e.representation=l,e.reason.throughput=o,r.placeholderBuffer=Math.max(0,I(r,l)-u),r.currentRepresentation=l,!isNaN(r.lastSegmentDurationS)&&u>=r.lastSegmentDurationS&&(r.state=O)})(i,e,c);break;case O:(function(e,t,r){let i=t.getMediaType(),o=t.getThroughputController(),c=t.getMediaInfo(),l=o.getSafeAverageThroughput(i),u=t.getScheduleController();(function(e,t){let n=Date.now();if(isNaN(e.lastSegmentFinishTimeMs)){if(!isNaN(e.lastCallTimeMs)){let t=.001*(n-e.lastCallTimeMs);e.placeholderBuffer+=Math.max(0,t)}}else{let t=.001*(n-e.lastSegmentFinishTimeMs);e.placeholderBuffer+=Math.max(0,t)}e.lastCallTimeMs=n,e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN,j(e,t)})(r,i);let f=n.getCurrentBufferLevel(i),p=function(e,t){let n=e.representations.length,r=NaN,i=NaN;for(let o=0;o<n;++o){let n=(e.Vp*(e.utilities[o]-1+e.gp)-t)/e.representations[o].bandwidth;(isNaN(i)||n>=i)&&(i=n,r=o)}return e.representations[r]}(r,f+r.placeholderBuffer),m=d.getOptimalRepresentationForBitrate(c,l,!0);p.absoluteIndex>r.currentRepresentation.absoluteIndex&&p.absoluteIndex>m.absoluteIndex&&(p=m.absoluteIndex>r.currentRepresentation.absoluteIndex?m:r.currentRepresentation);let h=Math.max(0,f+r.placeholderBuffer-M(r,p));h<=r.placeholderBuffer?(r.placeholderBuffer-=h,h=0):(h-=r.placeholderBuffer,r.placeholderBuffer=0,d.isPlayingAtTopQuality(p)?h=0:u.setTimeToLoadDelay(1e3*h)),e.representation=p,e.reason.throughput=l,e.reason.bufferLevel=f,e.reason.placeholderBuffer=r.placeholderBuffer,e.reason.delay=h,r.currentRepresentation=p})(i,e,c);break;default:(function(e,t,n){_.debug(`BOLA ABR rule invoked in bad state.`);let r=t.getMediaInfo(),i=t.getMediaType(),o=t.getThroughputController().getSafeAverageThroughput(i);e.representation=d.getOptimalRepresentationForBitrate(r,o,!0),e.reason.state=n.state,e.reason.throughput=o,n.state=D,S(n)})(i,e,c)}return i.priority=v.get().streaming.abr.rules.bolaRule.priority,i}catch(e){return _.error(e),(0,o.default)(t).create()}},handleNewMediaInfo:function(e){e&&e.streamInfo&&e.type&&y[e.streamInfo.id]&&y[e.streamInfo.id][e.type]&&delete y[e.streamInfo.id][e.type]},reset:function(){R(),i.off(g.default.BUFFER_EMPTY,b,f),i.off(g.default.PLAYBACK_SEEKING,x,f),i.off(g.default.METRIC_ADDED,C,f),i.off(g.default.QUALITY_CHANGE_REQUESTED,k,f),i.off(g.default.FRAGMENT_LOADING_ABANDONED,L,f),i.off(m.default.MEDIA_FRAGMENT_LOADED,N,f),i.off(m.default.SETTING_UPDATED_MAX_BITRATE,P,f),i.off(m.default.SETTING_UPDATED_MIN_BITRATE,P,f),i.off(m.default.VIDEO_ELEMENT_RESIZED,F,f)}},_=(0,l.default)(t).getInstance().getLogger(f),v=(0,u.default)(t).getInstance(),R(),i.on(g.default.BUFFER_EMPTY,b,f),i.on(g.default.PLAYBACK_SEEKING,x,f),i.on(g.default.METRIC_ADDED,C,f),i.on(g.default.QUALITY_CHANGE_REQUESTED,k,f),i.on(g.default.FRAGMENT_LOADING_ABANDONED,L,f),i.on(m.default.MEDIA_FRAGMENT_LOADED,N,f),i.on(m.default.SETTING_UPDATED_MAX_BITRATE,P,f),i.on(m.default.SETTING_UPDATED_MIN_BITRATE,P,f),i.on(m.default.VIDEO_ELEMENT_RESIZED,F,f),f}k.__dashjs_factory_name=`BolaRule`;var A=i.default.getClassFactory(k);let j=`L2A_STATE_ONE_BITRATE`,M=`L2A_STATE_STARTUP`,N=`L2A_STATE_STEADY`,P=4**.99;function F(e){e||={};let t=this.context,n=e.dashMetrics,r=(0,p.default)(t).getInstance(),i=(0,u.default)(t).getInstance(),d,f,g,_;function v(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN,e.lastSegmentUrl=``}function y(){for(let e in f)if(f.hasOwnProperty(e)){let t=f[e];t.state!==j&&(t.state=M,v(t))}}function b(e){if(e&&e.chunk&&e.chunk.representation&&e.chunk.representation.mediaInfo){let t=f[e.chunk.representation.mediaInfo.type],n=g[e.chunk.representation.mediaInfo.type];if(t&&t.state!==j){let r=e.chunk.start;isNaN(t.mostAdvancedSegmentStart)||r>t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=r,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=r,t.lastSegmentDurationS=e.chunk.duration,t.currentRepresentation=e.chunk.representation,S(t,n)}}}function x(e){if(e&&e.metric===c.HTTP_REQUEST&&e.value&&e.value.type===T.HTTPRequest.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){let t=f[e.mediaType],n=g[e.mediaType];t&&t.state!==j&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),S(t,n))}}function S(e,t){isNaN(e.lastSegmentStart)||isNaN(e.lastSegmentRequestTimeMs)||(t.segment_request_start_s=.001*e.lastSegmentRequestTimeMs,t.segment_download_finish_s=.001*e.lastSegmentFinishTimeMs,e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN)}function C(e,t){if(e.length!==t.length)return-1;let n=0;for(let r=0;r<e.length;r++)n+=e[r]*t[r];return n}function w(){f={},g={}}return d={getSwitchRequest:function(e){try{let r=(0,o.default)(t).create();r.rule=this.getClassName();let c=e.getMediaType(),l=e.getScheduleController();if(r.reason=r.reason||{},c===h.default.AUDIO)return r;l.setTimeToLoadDelay(0);let u=function(e){let t=e.getMediaType(),n=f[t];return n||(n=function(e){let t={},n=e.getMediaInfo();return t.state=M,t.currentRepresentation=null,function(e){e&&e.type&&(g[e.type]={},g[e.type].w=[],g[e.type].prev_w=[],g[e.type].Q=0,g[e.type].segment_request_start_s=0,g[e.type].segment_download_finish_s=0,g[e.type].B_target=1.5)}(n),v(t),t}(e),f[t]=n),n}(e);if(!g[c])return r;switch(r.reason.state=u.state,u.state){case j:break;case M:(function(e,t,r){let i=e.getMediaInfo(),o=e.getMediaType(),c=e.getThroughputController().getSafeAverageThroughput(o);if(isNaN(c))return t;let l=e.getAbrController(),u=l.getOptimalRepresentationForBitrate(i,c,!0),d=n.getCurrentBufferLevel(o,!0),f=g[o],p=l.getPossibleVoRepresentationsFilteredBySettings(i,!0);if(t.representation=u,t.reason.throughput=c,r.currentRepresentation=u,!isNaN(r.lastSegmentDurationS)&&d>=f.B_target){r.state=N,f.Q=P;for(let e=0;e<p.length;++e)p[e].id===r.currentRepresentation.id?f.prev_w[e]=1:f.prev_w[e]=0}})(e,r,u);break;case N:(function(e,t,r){let i=[],o=e.getThroughputController(),c=e.getMediaType(),l=o.getAverageThroughput(c,h.default.THROUGHPUT_CALCULATION_MODES.ARITHMETIC_MEAN,1),u=n.getCurrentHttpRequest(c),d=null,f=g[c];if(l<1&&(l=1),u.url===r.lastSegmentUrl||u.type===T.HTTPRequest.INIT_SEGMENT_TYPE)d=r.currentRepresentation;else{let t=r.lastSegmentDurationS,n=1,o=e.getAbrController(),c=e.getMediaInfo(),p=o.getPossibleVoRepresentationsFilteredBySettings(c,!0),m=e.getVideoModel().getPlaybackRate(),h=Math.max(4**1,P*2);for(let e=0;e<p.length;++e){let r=p[e];m*r.bitrateInKbit>l&&(n=-1),f.w[e]=f.prev_w[e]+n*(t/(2*h))*((f.Q+P)*(m*r.bitrateInKbit/l))}f.w=function(e){let t=e.length,n=!1,r=[];for(let n=0;n<t;++n)r[n]=e[n];let i=e.sort((function(e,t){return t-e})),o=0,c=0,l=[];for(let e=0;e<t-1;++e)if(o+=i[e],c=(o-1)/(e+1),c>=i[e+1]){n=!0;break}n||(c=(o+i[t-1]-1)/t);for(let e=0;e<t;++e)l[e]=Math.max(r[e]-c,0);return l}(f.w);for(let e=0;e<p.length;++e)i[e]=f.w[e]-f.prev_w[e],f.prev_w[e]=f.w[e];let g=p.map((e=>e.bandwidth));f.Q=Math.max(0,f.Q-t+t*m*((C(g,f.prev_w)+C(g,i))/l));let _=[];for(let e=0;e<g.length;++e)_[e]=Math.abs(g[e]-C(f.w,g));let v=_.indexOf(Math.min(..._));d=o.getRepresentationByAbsoluteIndex(v,c,!0),d.absoluteIndex>r.currentRepresentation.absoluteIndex&&g[r.currentRepresentation.absoluteIndex+1]<=l&&(d=o.getRepresentationByAbsoluteIndex(r.currentRepresentation.absoluteIndex+1,c,!0)),d.bitrateInKbit>=l&&(f.Q=2*Math.max(P,f.Q)),r.lastSegmentUrl=u.url}t.representation=d,r.currentRepresentation=t.representation})(e,r,u);break;default:(function(e,t,n){let r=e.getAbrController(),i=e.getMediaInfo(),o=e.getMediaType(),c=e.getThroughputController().getSafeAverageThroughput(o);t.representation=r.getOptimalRepresentationForBitrate(i,c,!0),t.reason.throughput=c,n.state=M,v(n)})(e,r,u)}return r.priority=i.get().streaming.abr.rules.l2ARule.priority,r}catch(e){return _.error(e),(0,o.default)(t).create()}},reset:function(){w(),r.off(m.default.PLAYBACK_SEEKING,y,d),r.off(m.default.MEDIA_FRAGMENT_LOADED,b,d),r.off(m.default.METRIC_ADDED,x,d)}},_=(0,l.default)(t).getInstance().getLogger(d),w(),r.on(m.default.PLAYBACK_SEEKING,y,d),r.on(m.default.MEDIA_FRAGMENT_LOADED,b,d),r.on(m.default.METRIC_ADDED,x,d),d}F.__dashjs_factory_name=`L2ARule`;var I=i.default.getClassFactory(F);function L(){let e=this.context,t,n,r,i,o,c,u,d,f;function p(){r=null,i=1,o=100,c=0,u=null,d=null,f=`dynamic_weight_selection`}function m(){let e=0;if(r)for(let t=0;t<r.length;t++){let n=r[t];n.state.throughput>e&&(e=n.state.throughput)}return e}function h(e,t,n){let r=e.map(((e,r)=>n[r]*(e-t[r])**2)).reduce(((e,t)=>e+t));return(r<0?-1:1)*Math.sqrt(Math.abs(r))}function g(e,t){return h([e.state.throughput,e.state.latency,e.state.rebuffer,e.state.switch],[t.state.throughput,t.state.latency,t.state.rebuffer,t.state.switch],[1,1,1,1])}function _(e,t){for(let n=0;n<r.length;n++){let i=r[n],o=g(i,e);v(i,t,Math.exp(-1*o**2/(2*.1**2)))}}function v(e,t,n){let r=e.state,i=[.01,.01,.01,.01];r.throughput+=(t[0]-r.throughput)*i[0]*n,r.latency+=(t[1]-r.latency)*i[1]*n,r.rebuffer+=(t[2]-r.rebuffer)*i[2]*n,r.switch+=(t[3]-r.switch)*i[3]*n}return t={getNextQuality:function(e,t,l,p,g,v,y,b){let x=p,S=l;(function(e,t){if(!r){r=[];let n=t.getPossibleVoRepresentationsFilteredBySettings(e,!0),o=n.map((e=>e.bandwidth));c=Math.min(...o),i=function(e){let t=e.map((e=>e**2)).reduce(((e,t)=>e+t));return Math.sqrt(t)}(o),n.forEach((e=>{let t={representation:e,state:{throughput:e.bandwidth/i,latency:0,rebuffer:0,switch:0}};r.push(t)})),d=function(e){let t=[],n=function(e){let t=[];for(let n=0;n<e;n++){let e=[Math.random()*m(),Math.random(),Math.random(),Math.random()];t.push(e)}return t}(e.length**2);t.push(n[0]);let r=[1,1,1,1];for(let i=1;i<e.length;i++){let e=null,i=null;for(let o=0;o<n.length;o++){let c=n[o],l=null;for(let e=0;e<t.length;e++){let n=h(c,t[e],r);(l===null||n<l)&&(l=n)}(i===null||l>i)&&(e=c,i=l)}t.push(e)}let i=null,o=null;for(let e=0;e<t.length;e++){let n=0;for(let i=0;i<t.length;i++)e!==i&&(n+=h(t[e],t[i],r));(i===null||n>i)&&(i=n,o=e)}let c=[];for(c.push(t[o]),t.splice(o,1);t.length>0;){let e=null,n=null;for(let i=0;i<t.length;i++){let o=h(c[0],t[i],r);(e===null||o<e)&&(e=o,n=i)}c.push(t[n]),t.splice(n,1)}return c}(r)}})(t,e);let C=l/i;C>1&&(C=m()),p/=o;let w=r.find((e=>e.representation.id===y.id)),T=w.representation.bandwidth*b.getSegmentDuration()/S,E=Math.max(0,T-g);if(g-T<b.getMinBuffer())return n.debug(`Buffer is low for bitrate= ${w.representation.bandwidth} downloadTime=${T} currentBuffer=${g} rebuffer=${E}`),function(e,t){let n=0,i=e;if(r)for(let o=0;o<r.length;o++){let c=r[o];c.representation.bandwidth<e.representation.bandwidth&&c.representation.bandwidth>n&&t>c.representation.bandwidth&&(n=c.representation.bandwidth,i=c)}return i}(w,S).representation;switch(f){case`manual_weight_selection`:u=[.4,.4,.4,.4];break;case`random_weight_selection`:u=function(e){let t=[],n=Math.sqrt(2/e);for(let e=0;e<4;e++)t.push(Math.random()*n);return u=t,u}(r.length);break;default:(function(e,t,n,i,o,c){u||=d[d.length-1];let l=e.findWeightVector(r,t,n,i,o,c);l!==null&&l!==-1&&(u=l)})(b,x,g,E,S,v)}let D=null,O=null,k=null;for(let e=0;e<r.length;e++){let t=r[e],i=t.state,o=[i.throughput,i.latency,i.rebuffer,i.switch],d=u.slice(),f=b.getNextBufferWithBitrate(t.representation.bandwidth,g,S),p=f<b.getMinBuffer();p&&n.debug(`Buffer is low for bitrate=${t.representation.bandwidth} downloadTime=${T} currentBuffer=${g} nextBuffer=${f}`),(t.representation.bandwidth>l-1e4||p)&&t.representation.bandwidth!==c&&(d[0]=100);let m=h(o,[C,0,0,0],d);(D===null||m<D)&&(D=m,O=t.representation,k=t)}let A=Math.abs(w.representation.bandwidth-k.representation.bandwidth)/i;return _(w,[C,p,E,A]),_(k,[C,0,0,A]),O},reset:function(){p()}},n=(0,l.default)(e).getInstance().getLogger(t),p(),t}L.__dashjs_factory_name=`LearningAbrController`;var R=i.default.getClassFactory(L),z=class{constructor(){this.type=null,this.lastBitrate=null,this.weights={},this.weights.bitrateReward=null,this.weights.bitrateSwitchPenalty=null,this.weights.rebufferPenalty=null,this.weights.latencyPenalty=null,this.weights.playbackSpeedPenalty=null,this.bitrateWSum=0,this.bitrateSwitchWSum=0,this.rebufferWSum=0,this.latencyWSum=0,this.playbackSpeedWSum=0,this.totalQoe=0}};function B(){let e,t,n,r,i;function o(){t=null,n=null,r=null,i=null}function c(e,t,n,r){let i=new z;return i.type=e,i.weights.bitrateReward=t||1,i.weights.bitrateSwitchPenalty=1,i.weights.rebufferPenalty=n||1e3,i.weights.latencyPenalty=[],i.weights.latencyPenalty.push({threshold:1.1,penalty:.05*r}),i.weights.latencyPenalty.push({threshold:1e8,penalty:.1*n}),i.weights.playbackSpeedPenalty=r||200,i}function l(e,t,n,r,i){i.bitrateWSum+=i.weights.bitrateReward*e,i.lastBitrate&&(i.bitrateSwitchWSum+=i.weights.bitrateSwitchPenalty*Math.abs(e-i.lastBitrate)),i.lastBitrate=e,i.rebufferWSum+=i.weights.rebufferPenalty*t;for(let e=0;e<i.weights.latencyPenalty.length;e++){let t=i.weights.latencyPenalty[e];if(n<=t.threshold){i.latencyWSum+=t.penalty*n;break}}i.playbackSpeedWSum+=i.weights.playbackSpeedPenalty*Math.abs(1-r),i.totalQoe=i.bitrateWSum-i.bitrateSwitchWSum-i.rebufferWSum-i.latencyWSum-i.playbackSpeedWSum}return e={setupPerSegmentQoe:function(e,o,l){t=c(`segment`,e,o,l),n=e,r=o,i=l},logSegmentMetrics:function(e,n,r,i){t&&l(e,n,r,i,t)},getPerSegmentQoe:function(){return t},calculateSingleUseQoe:function(e,t,o,u){let d=null;return n&&r&&i&&(d=c(`segment`,n,r,i)),d?(l(e,t,o,u,d),d.totalQoe):0},reset:function(){o()}},o(),e}B.__dashjs_factory_name=`LoLpQoeEvaluator`;var V=i.default.getClassFactory(B);function H(e){let t,n,r,i,o=e.targetLatency,c=e.bufferMin,l=e.segmentDuration,u=e.qoeEvaluator;function d(){return l}function f(e,t){let n=d(),r;return r=t>n?e-n:e+n-t,r}return t={getMinBuffer:function(){return c},getSegmentDuration:d,getNextBufferWithBitrate:function(e,t,n){return f(t,e*l/n)},getNextBuffer:f,findWeightVector:function(e,t,n,d,p,m){let h=null,g=null,_=null,v=Math.abs(t-i);return e.forEach((e=>{r.forEach((r=>{r[0];let i,d=r[1],y=r[2],b=(r[3],e.representation.bandwidth*l/p),x=f(n,b);i=y===0?10:1/y;let S=i*Math.max(1e-5,b-x);i=d===0?10:1/d;let C=i*e.state.latency,w=u.calculateSingleUseQoe(e.representation.bandwidth,S,C,m);(h===null||w>h)&&function(e,t,n){return!(e>o+n)&&t>=c}(t,x,v)&&(h=w,g=r,_=e.representation.bandwidth)}))})),g===null&&_===null&&(g=-1),i=t,g}},n=[.2,.4,.6,.8,1],r=function(e){let t=e.map((function(e){return[e]})),n=function(t,r,i){if(i===r)return t;let o=t.length;for(let n=0;n<o;n++){let n=t.shift();for(let r=0;r<e.length;r++)t.push(n.concat(e[r]))}return n(t,r,i+1)};return n(t,4,1)}(n),i=0,t}H.__dashjs_factory_name=`LoLpWeightSelector`;var U=i.default.getClassFactory(H);function W(e){let t,n,r,i,d,f=(e||={}).dashMetrics,p=this.context;return r={getSwitchRequest:function(e){try{let r=(0,o.default)(p).create();r.rule=this.getClassName();let l=e.getMediaInfo().type,u=e.getAbrController(),m=e.getStreamInfo(),g=e.getRepresentation(),_=e.getMediaInfo(),v=f.getCurrentBufferState(l),y=e.getScheduleController(),b=f.getCurrentBufferLevel(l,!0),x=y.getPlaybackController(),S=x.getCurrentLiveLatency();if(l===h.default.AUDIO)return r;S||=0;let C=x.getPlaybackRate(),w=e.getThroughputController().getSafeAverageThroughput(l);if(t.debug(`Throughput ${Math.round(w)} kbps`),isNaN(w)||!v||u.getAbandonmentStateFor(m.id,l)===c.ABANDON_LOAD)return r;let T=u.getPossibleVoRepresentationsFilteredBySettings(_,!0).map((e=>e.bandwidth)),E=e.getRepresentation().fragmentDuration,D=Math.min(...T)/1e3,O=Math.max(...T)/1e3,k=g.bandwidth/1e3,A=f.getCurrentHttpRequest(l,!0),j=(A.tresponse.getTime()-A.trequest.getTime())/1e3,M=j>E?j-E:0;d.setupPerSegmentQoe(E,O,D),d.logSegmentMetrics(k,M,S,C);let N=U(p).create({targetLatency:1.5,bufferMin:.3,segmentDuration:E,qoeEvaluator:d});return r.representation=i.getNextQuality(u,_,1e3*w,S,b,C,g,N),r.reason={throughput:w,latency:S},r.priority=n.get().streaming.abr.rules.loLPRule.priority,y.setTimeToLoadDelay(0),r}catch(e){throw e}},reset:function(){i.reset(),d.reset()}},t=(0,l.default)(p).getInstance().getLogger(r),i=R(p).create(),d=V(p).create(),n=(0,u.default)(p).getInstance(),r}W.__dashjs_factory_name=`LoLPRule`;var G=i.default.getClassFactory(W);function K(e){e||={};let t=this.context,n=e.mediaPlayerModel,r=e.customParametersModel,i=e.dashMetrics,c=e.settings,l=(0,p.default)(t).getInstance(),u,d,g,_;function y(){Object.values(h.default.QUALITY_SWITCH_RULES).forEach((e=>{d=x(e,d)})),Object.values(h.default.ABANDON_FRAGMENT_RULES).forEach((e=>{g=x(e,g)})),r.getAbrCustomRules().forEach((function(e){e.type===h.default.RULES_TYPES.QUALITY_SWITCH_RULES&&d.push(e.rule(t).create()),e.type===h.default.RULES_TYPES.ABANDON_FRAGMENT_RULES&&g.push(e.rule(t).create())})),d.length===0&&(d.push(A(t).create({dashMetrics:i,mediaPlayerModel:n,settings:c})),d.push(f(t).create({dashMetrics:i})))}function x(e,r){let o=e.charAt(0).toLowerCase()+e.slice(1);return c.get().streaming.abr.rules[o].active&&!function(e,t){return e.filter((e=>e.getClassName()===t)).length>0}(r,e)?(r.push(function(e){switch(e){case h.default.QUALITY_SWITCH_RULES.BOLA_RULE:return A(t).create({dashMetrics:i,mediaPlayerModel:n,settings:c});case h.default.QUALITY_SWITCH_RULES.THROUGHPUT_RULE:return f(t).create({dashMetrics:i});case h.default.QUALITY_SWITCH_RULES.INSUFFICIENT_BUFFER_RULE:return v(t).create({dashMetrics:i,settings:c});case h.default.QUALITY_SWITCH_RULES.SWITCH_HISTORY_RULE:return w(t).create();case h.default.QUALITY_SWITCH_RULES.DROPPED_FRAMES_RULE:return S(t).create();case h.default.QUALITY_SWITCH_RULES.LEARN_TO_ADAPT_RULE:return I(t).create({dashMetrics:i,settings:c});case h.default.QUALITY_SWITCH_RULES.LOL_PLUS_RULE:return G(t).create({dashMetrics:i});case h.default.ABANDON_FRAGMENT_RULES.ABANDON_REQUEST_RULE:return b(t).create({dashMetrics:i,mediaPlayerModel:n,settings:c})}}(e)),r):c.get().streaming.abr.rules[o].active?r:function(e,t){return e.filter((e=>e.getClassName()!==t))}(r,e)}function C(e){return e.filter((e=>e.representation!==o.default.NO_CHANGE))}function T(e){let t={},n,r,i,c=null;if(e.length!==0){for(t[o.default.PRIORITY.STRONG]=null,t[o.default.PRIORITY.WEAK]=null,t[o.default.PRIORITY.DEFAULT]=null,n=0,r=e.length;n<r;n+=1)i=e[n],i.representation!==o.default.NO_CHANGE&&(t[i.priority]===null||t[i.priority].representation!==o.default.NO_CHANGE&&i.representation.bitrateInKbit<t[i.priority].representation.bitrateInKbit)&&(t[i.priority]=i);return t[o.default.PRIORITY.WEAK]&&t[o.default.PRIORITY.WEAK].representation!==o.default.NO_CHANGE&&(c=t[o.default.PRIORITY.WEAK]),t[o.default.PRIORITY.DEFAULT]&&t[o.default.PRIORITY.DEFAULT].representation!==o.default.NO_CHANGE&&(c=t[o.default.PRIORITY.DEFAULT]),t[o.default.PRIORITY.STRONG]&&t[o.default.PRIORITY.STRONG].representation!==o.default.NO_CHANGE&&(c=t[o.default.PRIORITY.STRONG]),c}}function E(){y()}return u={clearDataForStream:function(e){[d,g].forEach((t=>{t&&t.length&&t.forEach((t=>t.clearDataForStream&&typeof t.clearDataForStream==`function`&&t.clearDataForStream(e)))}))},getAbandonFragmentRules:function(){return g},getBestPossibleSwitchRequest:function(e){return e&&T(C(d.filter((t=>{let n=t.getClassName();if(n!==h.default.QUALITY_SWITCH_RULES.BOLA_RULE&&n!==h.default.QUALITY_SWITCH_RULES.THROUGHPUT_RULE)return!0;let r=e.getMediaType();return _[r]&&n===h.default.QUALITY_SWITCH_RULES.BOLA_RULE||!_[r]&&n===h.default.QUALITY_SWITCH_RULES.THROUGHPUT_RULE})).map((t=>t.getSwitchRequest(e)))))||(0,o.default)(t).create()},getBolaState:function(e){return _[e]},getMinSwitchRequest:T,getQualitySwitchRules:function(){return d},handleNewMediaInfo:function(e){d.forEach((t=>t.handleNewMediaInfo&&t.handleNewMediaInfo(e))),g.forEach((t=>t.handleNewMediaInfo&&t.handleNewMediaInfo(e)))},initialize:function(){d=[],g=[],_={},y(),l.on(m.default.SETTING_UPDATED_ABR_ACTIVE_RULES,E,u)},reset:function(){[d,g].forEach((e=>{e&&e.length&&e.forEach((e=>e.reset&&e.reset()))})),d=[],g=[],_={},l.off(m.default.SETTING_UPDATED_ABR_ACTIVE_RULES,E,u)},setBolaState:function(e,t){_[e]=t},shouldAbandonFragment:function(e){if(!e)return(0,o.default)(t).create();let n=T(C(g.map((t=>t.shouldAbandon(e)))));return n&&n.reason&&(n.reason.forceAbandon=!0),n||(0,o.default)(t).create()}},u}K.__dashjs_factory_name=`ABRRulesCollection`;let ee=i.default.getClassFactory(K);i.default.updateSingletonFactory(K.__dashjs_factory_name,ee);var q=ee;class te{constructor(e){this.action=te.ACTION_DOWNLOAD,this.availabilityEndTime=null,this.availabilityStartTime=null,this.bandwidth=NaN,this.bytesLoaded=NaN,this.bytesTotal=NaN,this.delayLoadingTime=NaN,this.duration=NaN,this.endDate=null,this.firstByteDate=null,this.index=NaN,this.isPartialSegmentRequest=!1,this.mediaStartTime=NaN,this.mediaType=null,this.presentationStartTime=NaN,this.range=null,this.representation=null,this.responseType=`arraybuffer`,this.retryAttempts=0,this.serviceLocation=null,this.startDate=null,this.startTime=NaN,this.timescale=NaN,this.type=null,this.url=e||null,this.wallStartTime=null}isInitializationRequest(){return this.type&&this.type===T.HTTPRequest.INIT_SEGMENT_TYPE}setInfo(e){this.type=e&&e.init?T.HTTPRequest.INIT_SEGMENT_TYPE:T.HTTPRequest.MEDIA_SEGMENT_TYPE,this.url=e&&e.url?e.url:null,this.range=e&&e.range?e.range.start+`-`+e.range.end:null,this.mediaType=e&&e.mediaType?e.mediaType:null,this.representation=e&&e.representation?e.representation:null}}te.ACTION_DOWNLOAD=`download`,te.ACTION_COMPLETE=`complete`;var ne=te;let re=`loading`,ie=`executed`,J=`failed`;function ae(e){let t=(e||={}).eventBus,n=e.events,r=e.dashMetrics,i=e.fragmentLoader,o=e.debug,c=e.streamInfo,l=e.type,u,d,f,p;function m(e){return!!e&&function(t){let n=!1;return t.some((t=>{if(r=e,i=t,!isNaN(r.index)&&r.startTime===i.startTime&&r.adaptationIndex===i.adaptationIndex&&r.type===i.type||function(e,t){return e.representation.id===t.representation.id}(e,t)||function(e,t){return e.action===ne.ACTION_COMPLETE&&e.action===t.action}(e,t))return n=!0,n;var r,i})),n}(f)}function h(e){return isNaN(e.duration)?.25:Math.min(e.duration/8,.5)}function g(e){f=f.filter((t=>{let n=h(t);return isNaN(t.startTime)||e!==void 0&&t.startTime>=e-n}))}function _(e,t){t<=e+.5||(f=f.filter((n=>{let r=h(n);return isNaN(n.startTime)||n.startTime>=t-r||isNaN(n.duration)||n.startTime+n.duration<=e+r})))}function v(e,t,n){for(let r=e.length-1;r>=0;r--){let i=e[r],o=i.startTime,c=o+i.duration;if(n=isNaN(n)?h(i):n,!isNaN(o)&&!isNaN(c)&&t+n>=o&&t-n<c||isNaN(o)&&isNaN(t))return i}return null}function y(e,t){r.addSchedulingInfo(e,t),r.addRequestsQueue(e.mediaType,p,f)}function b(e){e.sender===i&&(p.splice(p.indexOf(e.request),1),e.response&&!e.error&&f.push(e.request),y(e.request,e.error?J:ie),t.trigger(n.FRAGMENT_LOADING_COMPLETED,{request:e.request,response:e.response,error:e.error,sender:this},{streamId:c.id,mediaType:l}))}function x(e){e.sender===i&&t.trigger(n.FRAGMENT_LOADING_PROGRESS,{request:e.request,response:e.response,error:e.error,sender:this},{streamId:c.id,mediaType:l})}function S(e){e.sender===i&&t.trigger(n.FRAGMENT_LOADING_ABANDONED,{request:e.request},{streamId:c.id,mediaType:l})}function C(){f=[],p=[],i&&i.resetInitialSettings()}return u={abortRequests:function(){d.debug(`abort requests`),i.abort(),p=[]},executeRequest:function(e){e.action===ne.ACTION_DOWNLOAD?(y(e,re),p.push(e),function(e){t.trigger(n.FRAGMENT_LOADING_STARTED,{request:e},{streamId:c.id,mediaType:l}),i.load(e)}(e)):d.warn(`Unknown request action.`)},getRequests:function(e){let t=e?e.state instanceof Array?e.state:[e.state]:[],n=[];return t.forEach((t=>{let r=function(e){let t;switch(e){case re:t=p;break;case ie:t=f;break;default:t=[]}return t}(t);n=n.concat(function(e,t){return t.hasOwnProperty(`time`)?[v(e,t.time,t.threshold)]:e.filter((e=>{for(let n in t)if(n!==`state`&&t.hasOwnProperty(n)&&e[n]!=t[n])return!1;return!0}))}(r,e))})),n},getStreamId:function(){return c.id},getType:function(){return l},isFragmentLoaded:m,isFragmentLoadedOrPending:function(e){let t,n=!1,r=0;if(n=m(e),!n)for(r=0;r<p.length;r++)t=p[r],e.url===t.url&&e.startTime===t.startTime&&(n=!0);return n},removeExecutedRequestsAfterTime:function(e){f=f.filter((t=>isNaN(t.startTime)||e!==void 0&&t.startTime<e))},removeExecutedRequestsBeforeTime:g,reset:function(){t.off(n.LOADING_COMPLETED,b,this),t.off(n.LOADING_DATA_PROGRESS,x,this),t.off(n.LOADING_ABANDONED,S,this),i&&i.reset(),C()},resetInitialSettings:C,syncExecutedRequestsWithBufferedRange:function(e,t){if(!e||e.length===0)return void g();let n=0;for(let t=0,r=e.length;t<r;t++)_(n,e.start(t)),n=e.end(t);t>0&&_(n,t)}},d=o.getLogger(u),C(),t.on(n.LOADING_COMPLETED,b,u),t.on(n.LOADING_DATA_PROGRESS,x,u),t.on(n.LOADING_ABANDONED,S,u),u}ae.__dashjs_factory_name=`FragmentModel`;let oe=i.default.getClassFactory(ae);oe.FRAGMENT_MODEL_LOADING=re,oe.FRAGMENT_MODEL_EXECUTED=ie,oe.FRAGMENT_MODEL_CANCELED=`canceled`,oe.FRAGMENT_MODEL_FAILED=J,i.default.updateClassFactory(ae.__dashjs_factory_name,oe);var se=oe;function ce(e){let t,n=(e||={}).abrController,r=e.throughputController,i=e.switchRequestHistory,o=e.droppedFramesHistory,c=e.currentRequest,l=e.streamProcessor?e.streamProcessor.getScheduleController():null,u=e.streamProcessor?e.streamProcessor.getRepresentation():null,d=e.videoModel?e.videoModel:null;function f(){return u?u.mediaInfo:null}return t={getAbrController:function(){return n},getCurrentRequest:function(){return c},getDroppedFramesHistory:function(){return o},getMediaInfo:f,getMediaType:function(){let e=f();return e?e.type:null},getRepresentation:function(){return u},getScheduleController:function(){return l},getStreamInfo:function(){let e=f();return e?e.streamInfo:null},getSwitchRequestHistory:function(){return i},getThroughputController:function(){return r},getVideoModel:function(){return d}},t}ce.__dashjs_factory_name=`RulesContext`;var le=i.default.getClassFactory(ce);function ue(){let e={},t={},n=this.context,r=(0,u.default)(n).getInstance();return{clearForStream:function(n){delete e[n],delete t[n]},getSwitchRequests:function(t,n){return t!=null&&n!=null&&e[t]&&e[t][n]?e[t][n]:{}},push:function(n){let i=n.currentRepresentation,o=n.newRepresentation;if(i.mediaInfo.streamInfo.id!==o.mediaInfo.streamInfo.id||o.mediaInfo.id!==i.mediaInfo.id)return;let c=i.mediaInfo.streamInfo.id;e[c]||function(n){e[n]={},t[n]={}}(c);let l=i.mediaInfo.type;e[c][l]||function(n,r){e[n][r]={},t[n][r]=[]}(c,l);let u=n.currentRepresentation.id;e[c][l][u]||function(t,n,r){e[t][n][r]={noDrops:0,drops:0,dropSize:0}}(c,l,u);let d=n.newRepresentation.absoluteIndex-n.currentRepresentation.absoluteIndex,f=+(d<0),p=f?-d:0,m=+!f;e[c][l][n.currentRepresentation.id].drops+=f,e[c][l][n.currentRepresentation.id].dropSize+=p,e[c][l][n.currentRepresentation.id].noDrops+=m,t[c][l].push({id:n.currentRepresentation.id,noDrop:m,drop:f,dropSize:p});let h=function(e,n){return t[e][n].length>r.get().streaming.abr.rules.switchHistoryRule.parameters.sampleSize?t[e][n].shift():null}(c,l);h&&function(t,n,r){e[t][n][r.id].drops-=r.drop,e[t][n][r.id].dropSize-=r.dropSize,e[t][n][r.id].noDrops-=r.noDrop}(c,l,h)},reset:function(){e={},t={}}}}ue.__dashjs_factory_name=`SwitchRequestHistory`;var de=i.default.getClassFactory(ue);function fe(){let e={},t={},n={};return{clearForStream:function(r){delete e[r],delete t[r],delete n[r]},getFrameHistory:function(t){return e[t]},push:function(r,i,o){if(!i)return;e[r]||function(r){e[r]=[],t[r]=0,n[r]=0}(r);let c=o&&o.droppedVideoFrames?o.droppedVideoFrames:0,l=o&&o.totalVideoFrames?o.totalVideoFrames:0,u=c-t[r];t[r]=c;let d=l-n[r];n[r]=l;let f=e[r];f[i]?(f[i].droppedVideoFrames+=u,f[i].totalVideoFrames+=d):f[i]={droppedVideoFrames:u,totalVideoFrames:d}},reset:function(){e={},t={},n={}}}}fe.__dashjs_factory_name=`DroppedFramesHistory`;var pe=i.default.getClassFactory(fe);function me(){let e=this.context,t=(0,l.default)(e).getInstance(),n=(0,p.default)(e).getInstance(),r,i,u,d,f,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M;function N(){r={},k={},E=new Map,S&&S.reset(),A&&A.reset(),v=void 0,S=void 0,A=void 0,clearTimeout(i),i=null}function P(e,t=!0){let n=F(e,t);return n=function(e){try{return function(e){try{if(!D.get().streaming.cmsd.enabled||!D.get().streaming.cmsd.abr.applyMb)return e;let t=e.filter((e=>{let t=e.mediaInfo.type,n=_.getMaxBitrate(t);if(t!==h.default.VIDEO||n<0)return!0;let r=e.mediaInfo.streamInfo.id;return n-=k[r][h.default.AUDIO].getRepresentation().bitrateInKbit||0,e.bitrateInKbit<=n}));return t.length>0?t:e}catch(t){return w.error(t),e}}(e=function(e){try{if(!D.get().streaming.abr.limitBitrateByPortal)return e;let{elementWidth:t}=M.getVideoElementSize(),n=e.filter((e=>e.mediaInfo.type!==h.default.VIDEO||e.width<=t));return n.length>0?n:e}catch(t){return w.error(t),e}}(e=function(e){try{let t=e.filter((e=>{let t=e.mediaInfo.type,n=e.bitrateInKbit,r=T.getAbrBitrateParameter(`maxBitrate`,t),i=T.getAbrBitrateParameter(`minBitrate`,t);return!(r>-1&&n>r||i>-1&&n<i)}));return t.length>0?t:e}catch(t){return w.error(t),e}}(e)))}catch(t){return w.error(t),e}}(n),n}function F(e,t){let n=[];return e?(function(e){try{let t=[];if(e&&t.push(e),!D.get().streaming.abr.enableSupplementalPropertyAdaptationSetSwitching||!e.adaptationSetSwitchingCompatibleIds||e.adaptationSetSwitchingCompatibleIds.length===0)return t;let n=k[e.streamInfo.id][e.type].getAllMediaInfos().filter((t=>e.adaptationSetSwitchingCompatibleIds.includes(t.id)));return t.concat(n)}catch{return[e]}}(e).forEach((e=>{let t=d.getVoRepresentations(e);t&&t.length>0&&(n=n.concat(t))})),n=function(e){return e.forEach((t=>{if(t.dependentRepresentation&&t.dependentRepresentation.mediaInfo===null){let n=t.dependentRepresentation.id,r=e.find((e=>e.id===n));r&&(t.dependentRepresentation=r)}})),e}(n),n=function(e){return e=function(e){let t=null;return e.filter((e=>(t||=e.mediaInfo,!isNaN(e.qualityRanking)&&d.areMediaInfosEqual(t,e.mediaInfo)))).length===e.length}(e)?function(e){return e.sort(((e,t)=>t.qualityRanking-e.qualityRanking)),e}(e):function(e){return e.sort(((e,t)=>d.areMediaInfosEqual(e.mediaInfo,t.mediaInfo)?isNaN(e.pixelsPerSecond)||isNaN(t.pixelsPerSecond)||e.pixelsPerSecond===t.pixelsPerSecond?e.bandwidth-t.bandwidth:e.pixelsPerSecond-t.pixelsPerSecond:isNaN(e.pixelsPerSecond)||isNaN(t.pixelsPerSecond)||e.pixelsPerSecond===t.pixelsPerSecond?isNaN(e.bitsPerPixel)||isNaN(t.bitsPerPixel)?e.bandwidth-t.bandwidth:t.bitsPerPixel-e.bitsPerPixel:e.pixelsPerSecond-t.pixelsPerSecond)),e}(e)}(n),n.forEach(((e,t)=>{e.absoluteIndex=t})),n=n.filter((n=>{let r=!!t||d.areMediaInfosEqual(n.mediaInfo,e),i=!n||!n.mediaInfo||f.areKeyIdsUsable(n.mediaInfo);return r&&i})),n):n}function I(e){let t=e.request.mediaType,n=e.streamId;if(!(t&&n&&k[n]&&D.get().streaming.abr.autoSwitchBitrate[t]))return;let l=k[n][t];if(!l)return;var d;if(!(!((d=l.getLastSegment())&&d.isPartialSegment&&!isNaN(d.totalNumberOfPartialSegments)&&!isNaN(d.replacementSubNumber))||d.replacementSubNumber===0))return;let f=R(l,e.request),p=u.shouldAbandonFragment(f);p&&p.representation!==o.default.NO_CHANGE&&function(e,t,n,o,l){if(o.getFragmentModel().getRequests({state:se.FRAGMENT_MODEL_LOADING,index:e.request.index})[0]){let e=function(e,t){return r[e]&&r[e][t]?r[e][t]:null}(t,n);e&&(e.state=c.ABANDON_LOAD),A.reset(),W(n,O.getActiveStreamInfo(),l.representation,l.reason),clearTimeout(i),i=setTimeout((()=>{e&&(r[t][n].state=c.ALLOW_LOAD),i=null}),D.get().streaming.abandonLoadTimeout)}}(e,n,t,l,p)}function L(){D.get().streaming.abr.limitBitrateByPortal&&Object.keys(k).forEach((e=>{Object.keys(k[e]).forEach((t=>{V(t,e)}))}))}function R(t,n){return le(e).create({abrController:C,adapter:d,currentRequest:n,droppedFramesHistory:S,streamProcessor:t,switchRequestHistory:A,throughputController:j,videoModel:M})}function z(e){e.mediaType===h.default.VIDEO&&(U(e.streamId),v=e.newRepresentation.id)}function B(e){!ee()||e.metric!==c.BUFFER_LEVEL||e.mediaType!==h.default.AUDIO&&e.mediaType!==h.default.VIDEO||function(e,t){try{let n=T.getBufferTimeDefault(),r=n,i=.5*n,o=u.getBolaState(e),c=t>=(o?i:r);u.setBolaState(e,c),c!==o&&(c?w.info(`[`+e+`] switching from throughput to buffer occupancy ABR rule (buffer: `+t.toFixed(3)+`).`):w.info(`[`+e+`] switching from buffer occupancy to throughput ABR rule (buffer: `+t.toFixed(3)+`).`))}catch(e){w.error(e)}}(e.mediaType,.001*e.value.level)}function V(e,t){try{if(!(e&&k&&k[t]&&k[t][e]))return!1;U(t);let n=k[t][e],i=n.getLastSegment(),o=n.getRepresentationController()?.getCurrentCompositeRepresentation(),l=H(i,o);if(!D.get().streaming.abr.autoSwitchBitrate[e]||!l)return!1;let d=R(n),f=u.getBestPossibleSwitchRequest(d);if(!f||!f.representation)return!1;let p=f.representation;return function(e,t){A.push({currentRepresentation:e,newRepresentation:t})}(o,p),p.id!==o.id&&(r[t][e].state===c.ALLOW_LOAD||p.absoluteIndex<o.absoluteIndex)&&(K(e,o,p,f.reason),!0)}catch(e){return w.error(e),!1}}function H(e,t){return!(e&&e.isPartialSegment&&!isNaN(e.totalNumberOfPartialSegments)&&!isNaN(e.replacementSubNumber))||e.replacementSubNumber===e.totalNumberOfPartialSegments-1||function(e,t){if(!t||!t.segmentSequenceProperties||t.segmentSequenceProperties.length<=0||t&&t.mediaInfo&&t.mediaInfo.adaptationSetSwitchingCompatibleIds&&t.mediaInfo.adaptationSetSwitchingCompatibleIds.length>0)return!1;let n=t.segmentSequenceProperties.filter((e=>!isNaN(e.sapType)&&e.sapType<=1));if(n.length===0)return!1;let r=(e.replacementSubNumber+1)%e.totalNumberOfPartialSegments;return n.some((e=>r%e.cadence==0))}(e,t)}function U(e){if(S){let t=M.getPlaybackQuality();t&&S.push(e,v,t)}}function W(e,t,n,r={}){if(!(t&&t.id&&e&&k&&k[t.id]&&k[t.id][e]&&n))return!1;let i=k[t.id][e].getRepresentationController()?.getCurrentCompositeRepresentation();return(!i||n.id!==i.id)&&K(e,i,n,r)}function G(e,t){return`${e}-${t}`}function K(e,t,r,i){let o=r.mediaInfo.streamInfo.id;if(!e||!k[o]||!k[o][e])return!1;let c=k[o][e].getStreamInfo(),l=b.getCurrentBufferLevel(e),u=t!==null&&!d.areMediaInfosEqual(t.mediaInfo,r.mediaInfo),f=t?t.bitrateInKbit:0;return w.info(`[AbrController]: Switching quality in period ${o} for media type ${e}. Switch from bitrate ${f} to bitrate ${r.bitrateInKbit}. Current buffer level: ${l}. Reason:`+(i?JSON.stringify(i):`/`)),n.trigger(g.default.QUALITY_CHANGE_REQUESTED,{isAdaptationSetSwitch:u,mediaType:e,newRepresentation:r,oldRepresentation:t,reason:i,streamInfo:c},{streamId:c.id,mediaType:e}),function(e){let t=j.getAverageThroughput(e);isNaN(t)||x.setSavedBitrateSettings(e,t)}(e),!0}function ee(){return D.get().streaming.abr.rules.bolaRule.active&&D.get().streaming.abr.rules.throughputRule.active}return C={canPerformQualitySwitch:H,checkPlaybackQuality:V,clearDataForStream:function(e){S&&S.clearForStream(e),k[e]&&delete k[e],A&&A.clearForStream(e),r[e]&&delete r[e],u.clearDataForStream(e)},getAbandonmentStateFor:function(e,t){return r[e]&&r[e][t]?r[e][t].state:null},getInitialBitrateFor:function(e){if(e===h.default.TEXT)return NaN;let t=T.getAbrBitrateParameter(`initialBitrate`,e);if(t>0)return t;let n=NaN;if(x&&x.hasOwnProperty(`getSavedBitrateSettings`)&&(n=x.getSavedBitrateSettings(e)),!isNaN(n))return n;let r=j.getAverageThroughput(e);return!isNaN(r)&&r>0?r:e===h.default.VIDEO?1e3:100},getOptimalRepresentationForBitrate:function(e,t,n=!0){let r=P(e,n);if(!r||r.length===0)return null;let i=r.reduce(((e,t)=>e.bandwidth<t.bandwidth?e:t));if(t<=0)return i;let o=r.filter((e=>e.bitrateInKbit<=t));return o&&o.length!==0?o.reduce(((e,t)=>t.absoluteIndex>e.absoluteIndex?t:e)):i},getPossibleVoRepresentations:function(e,t=!0){return F(e,t)},getPossibleVoRepresentationsFilteredBySettings:P,getRepresentationByAbsoluteIndex:function(e,t,n=!0){return isNaN(e)||e<0?null:P(t,n).find((t=>t.absoluteIndex===e))},handleNewMediaInfo:function(e){u.handleNewMediaInfo(e)},handlePendingManualQualitySwitch:function(e,t){try{let n=G(e,t),r=null;if(E.has(n)&&(r=E.get(n)),!r)return!1;let i=k[e][t];if(!H(i.getLastSegment(),i.getRepresentation()))return!1;let{type:o,streamInfo:c,representation:l,reason:u}=r;return E.delete(n),W(o,c,l,u),!0}catch(e){w.error(`Can not handle pending manual quality switch: ${e}`)}},initialize:function(){S=pe(e).create(),A=de(e).create(),u=q(e).create({dashMetrics:b,customParametersModel:y,mediaPlayerModel:T,settings:D}),u.initialize(),n.on(g.default.QUALITY_CHANGE_RENDERED,z,C),n.on(g.default.METRIC_ADDED,B,C),n.on(m.default.LOADING_PROGRESS,I,C),n.on(m.default.VIDEO_ELEMENT_RESIZED,L,C)},isPlayingAtLowestQuality:function(e){return P(e.mediaInfo,!0)[0].id===e.id},isPlayingAtTopQuality:function(e){if(!e)return!0;let t=P(e.mediaInfo,!0);return t[t.length-1].id===e.id},manuallySetPlaybackQuality:function(e,t,n,r={}){let i=k[t.id][e];if(H(i.getLastSegment(),i.getRepresentation()))return W(e,t,n,r);(function(e,t,n,r){try{w.debug(`[AbrController] Queuing manual quality switch for stream ${t.id} and type ${e} to representation ${n.id}`);let i=G(t.id,e);E.set(i,{type:e,streamInfo:t,representation:n,reason:r})}catch(e){w.error(`Can not queue manual quality switch: ${e}`)}})(e,t,n,r)},registerStreamType:function(e,t){let n=t.getStreamInfo().id;k[n]||(k[n]={}),k[n][e]=t,r[n]||(r[n]={}),r[n][e]={},r[n][e].state=c.ALLOW_LOAD,u.getBolaState(e)===void 0&&u.setBolaState(e,D.get().streaming.abr.rules.bolaRule.active&&!ee())},reset:function(){N(),n.off(g.default.QUALITY_CHANGE_RENDERED,z,C),n.off(g.default.METRIC_ADDED,B,C),n.off(m.default.LOADING_PROGRESS,I,C),n.off(m.default.VIDEO_ELEMENT_RESIZED,L,C),u&&u.reset()},setConfig:function(e){e&&(e.streamController&&(O=e.streamController),e.throughputController&&(j=e.throughputController),e.domStorage&&(x=e.domStorage),e.mediaPlayerModel&&(T=e.mediaPlayerModel),e.customParametersModel&&(y=e.customParametersModel),e.cmsdModel&&(_=e.cmsdModel),e.dashMetrics&&(b=e.dashMetrics),e.adapter&&(d=e.adapter),e.videoModel&&(M=e.videoModel),e.settings&&(D=e.settings),e.capabilities&&(f=e.capabilities))},setPlaybackQuality:W,unRegisterStreamType:function(e,t){try{k[e]&&k[e][t]&&delete k[e][t],r[e]&&r[e][t]&&delete r[e][t]}catch{}}},w=t.getLogger(C),N(),C}me.__dashjs_factory_name=`AbrController`;let he=i.default.getSingletonFactory(me);i.default.updateSingletonFactory(me.__dashjs_factory_name,he);var ge,_e,ve,ye,be,xe=he,Se=function(e){for(var t=[],n=0;n<e.length;++n){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?(t.push(192|r>>6),t.push(128|63&r)):r<65536?(t.push(224|r>>12),t.push(128|63&r>>6),t.push(128|63&r)):(t.push(240|r>>18),t.push(128|63&r>>12),t.push(128|63&r>>6),t.push(128|63&r))}return t},Ce=function(e){for(var t=[],n=0;n<e.length;){var r=e[n++];r<128||(r<224?(r=(31&r)<<6,r|=63&e[n++]):r<240?(r=(15&r)<<12,r|=(63&e[n++])<<6,r|=63&e[n++]):(r=(7&r)<<18,r|=(63&e[n++])<<12,r|=(63&e[n++])<<6,r|=63&e[n++])),t.push(String.fromCharCode(r))}return t.join(``)},we={};ge=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,_e=function(e){for(var t=0,n=[],r=0|e.length/3;0<r--;){var i=(e[t]<<16)+(e[t+1]<<8)+e[t+2];t+=3,n.push(ge.charAt(63&i>>18)),n.push(ge.charAt(63&i>>12)),n.push(ge.charAt(63&i>>6)),n.push(ge.charAt(63&i))}return e.length-t==2?(i=(e[t]<<16)+(e[t+1]<<8),n.push(ge.charAt(63&i>>18)),n.push(ge.charAt(63&i>>12)),n.push(ge.charAt(63&i>>6)),n.push(`=`)):e.length-t==1&&(i=e[t]<<16,n.push(ge.charAt(63&i>>18)),n.push(ge.charAt(63&i>>12)),n.push(`==`)),n.join(``)},ve=function(){for(var e=[],t=0;t<64;++t)e[ge.charCodeAt(t)]=t;return e[61]=0,e}(),ye=function(e){for(var t=0,n=[],r=0|e.length/4;0<r--;){var i=(ve[e.charCodeAt(t)]<<18)+(ve[e.charCodeAt(t+1)]<<12)+(ve[e.charCodeAt(t+2)]<<6)+ve[e.charCodeAt(t+3)];n.push(255&i>>16),n.push(255&i>>8),n.push(255&i),t+=4}return n&&(e.charAt(t-2)==`=`?(n.pop(),n.pop()):e.charAt(t-1)==`=`&&n.pop()),n},be={encode:function(e){for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t},decode:function(e){for(var t=0;t<s.length;++t)a[t]=String.fromCharCode(a[t]);return a.join(``)}},we.decodeArray=function(e){var t=ye(e);return new Uint8Array(t)},we.encodeASCII=function(e){var t=be.encode(e);return _e(t)},we.decodeASCII=function(e){var t=ye(e);return be.decode(t)},we.encode=function(e){var t=Se(e);return _e(t)},we.decode=function(e){return Ce(ye(e))},e!==void 0&&(e.decode=we.decode,e.decodeArray=we.decodeArray,e.encode=we.encode,e.encodeASCII=we.encodeASCII);var Te=we,Ee=r(7393);let De=NaN;class Oe{constructor(e,t){this.data={baseUrls:e||null,selectedIdx:t||De},this.children=[]}}function ke(){let e,t,n,r,i=this.context,o=(0,Ee.default)(i).getInstance();function c(e,t,n){let r=l(n);e[t]?o.areEqual(r,e[t].data.baseUrls)||(e[t].data.baseUrls=r,e[t].data.selectedIdx=De):e[t]=new Oe(r)}function l(e){let t=n.getBaseURLsFromElement(e),i=r.getSynthesizedBaseUrlElements(t);return i&&i.length>0&&i.forEach((e=>{let n=t.findIndex((t=>t.serviceLocation===e.serviceLocation));n===-1?t.push(e):t[n]=e})),t}function u(e,n){let r=n||t;e(r.data),r.children&&r.children.forEach((t=>u(e,t)))}function d(){t=new Oe}return e={reset:d,update:function(e){(function(e){(function(){if(!n||!n.hasOwnProperty(`getBaseURLsFromElement`)||!n.hasOwnProperty(`getRepresentationSortFunction`))throw Error(`setConfig function has to be called previously`)})();let r=l(e);o.areEqual(r,t.data.baseUrls)||(t.data.baseUrls=r,t.data.selectedIdx=De),e&&e.Period&&e.Period.forEach(((e,r)=>{c(t.children,r,e),e.AdaptationSet&&e.AdaptationSet.forEach(((e,i)=>{c(t.children[r].children,i,e),e.Representation&&e.Representation.sort(n.getRepresentationSortFunction()).forEach(((e,n)=>{c(t.children[r].children[i].children,n,e)}))}))}))})(e)},getForPath:function(e){let n=t,r=[n.data];return e&&e.forEach((e=>{n=n.children[e],n&&r.push(n.data)})),r.filter((e=>e.baseUrls.length))},invalidateSelectedIndexes:function(e){u((t=>{isNaN(t.selectedIdx)||e===t.baseUrls[t.selectedIdx].serviceLocation&&(t.selectedIdx=De)}))},setConfig:function(e){e.adapter&&(n=e.adapter),e.contentSteeringController&&(r=e.contentSteeringController)},getBaseUrls:function(e){return l(e)}},d(),e}ke.__dashjs_factory_name=`BaseURLTreeModel`;var Ae=i.default.getClassFactory(ke),je=r(8748);class Me extends je.default{constructor(){super(),this.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE=10,this.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE=11,this.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE=12,this.SEGMENT_BASE_LOADER_ERROR_CODE=15,this.TIME_SYNC_FAILED_ERROR_CODE=16,this.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE=17,this.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE=18,this.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE=19,this.APPEND_ERROR_CODE=20,this.REMOVE_ERROR_CODE=21,this.DATA_UPDATE_FAILED_ERROR_CODE=22,this.CAPABILITY_MEDIASOURCE_ERROR_CODE=23,this.CAPABILITY_MEDIAKEYS_ERROR_CODE=24,this.DOWNLOAD_ERROR_ID_MANIFEST_CODE=25,this.DOWNLOAD_ERROR_ID_SIDX_CODE=26,this.DOWNLOAD_ERROR_ID_CONTENT_CODE=27,this.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE=28,this.DOWNLOAD_ERROR_ID_XLINK_CODE=29,this.MANIFEST_ERROR_ID_PARSE_CODE=31,this.MANIFEST_ERROR_ID_NOSTREAMS_CODE=32,this.TIMED_TEXT_ERROR_ID_PARSE_CODE=33,this.MANIFEST_ERROR_ID_MULTIPLEXED_CODE=34,this.MEDIASOURCE_TYPE_UNSUPPORTED_CODE=35,this.NO_SUPPORTED_KEY_IDS=36,this.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE=`parsing failed for `,this.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE=`Failed loading manifest: `,this.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE=`Failed loading Xlink element: `,this.SEGMENTS_UPDATE_FAILED_ERROR_MESSAGE=`Segments update failed`,this.SEGMENTS_UNAVAILABLE_ERROR_MESSAGE=`no segments are available yet`,this.SEGMENT_BASE_LOADER_ERROR_MESSAGE=`error loading segment ranges from sidx`,this.TIME_SYNC_FAILED_ERROR_MESSAGE=`Failed to synchronize client and server time`,this.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE=`request is null`,this.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE=`Failed to resolve a valid URL`,this.APPEND_ERROR_MESSAGE=`chunk is not defined`,this.REMOVE_ERROR_MESSAGE=`Removing data from the SourceBuffer`,this.DATA_UPDATE_FAILED_ERROR_MESSAGE=`Data update failed`,this.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE=`mediasource is not supported`,this.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE=`mediakeys is not supported`,this.TIMED_TEXT_ERROR_MESSAGE_PARSE=`parsing error :`,this.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE=`Error creating source buffer of type : `,this.NO_SUPPORTED_KEY_IDS_MESSAGE=`All possible Adaptation Sets have an invalid key status`}}var Ne=new Me;function Pe(e){let t;e||={};let n=[],r=(0,p.default)(this.context).getInstance(),i=e.updateEventName,o=e.addBlacklistEventName;function c(e){n.indexOf(e)===-1&&(n.push(e),r.trigger(i,{entry:e}))}function l(e){c(e.entry)}return t={add:c,remove:function(e){let t=n.indexOf(e);t!==-1&&n.splice(t,1)},contains:function(e){return!!(n.length&&e&&e.length)&&n.indexOf(e)!==-1},reset:function(){o&&r.off(o,l,t),n=[]}},o&&r.on(o,l,t),t}Pe.__dashjs_factory_name=`BlackListController`;var Fe=i.default.getClassFactory(Pe);function Ie(e){let t,n=(e||={}).blacklistController;return t={select:function(e){return e&&function(e){let t,n,r=0,i=[],o=0;if(n=e.sort((function(e,t){let n=e.dvbPriority-t.dvbPriority;return isNaN(n)?0:n})).filter((function(e,t,n){return!t||n[0].dvbPriority&&e.dvbPriority&&n[0].dvbPriority===e.dvbPriority})),n.length)return n.length>1&&(n.forEach((e=>{r+=e.dvbWeight,i.push(r)})),t=Math.floor(Math.random()*(r-1)),i.every(((e,n)=>(o=n,!(t<e))))),n[o]}(function(e){let t=[];return e.filter((function(e){return!n.contains(e.serviceLocation)||(e.dvbPriority&&t.push(e.dvbPriority),!1)})).filter((function(e){return!t.length||!e.dvbPriority||t.indexOf(e.dvbPriority)===-1}))}(e))}},t}Ie.__dashjs_factory_name=`DVBSelector`;var Le=i.default.getClassFactory(Ie);function Re(e){let t,n=(e||={}).blacklistController;return t={select:function(e){let t,r=0;return e&&e.some(((e,t)=>(r=t,!n.contains(e.serviceLocation))))&&(t=e[r]),t}},t}Re.__dashjs_factory_name=`BasicSelector`;var ze=i.default.getClassFactory(Re),Be=r(1944),Ve=r(656),He=r(7263);function Ue(){let e,t;function n(){t&&=(t.onloadend=t.onerror=t.onprogress=t.onload=null,t.abort(),null)}return e={load:function(e,r){if(t=null,t=new XMLHttpRequest,t.open(e.method,e.url,!0),e.responseType&&(t.responseType=e.responseType),e.headers)for(let n in e.headers){let r=e.headers[n];r&&t.setRequestHeader(n,r)}return t.withCredentials=e.credentials===`include`,t.timeout=e.timeout,t.onload=function(){r.url=this.responseURL,r.status=this.status,r.statusText=this.statusText,r.headers=He.default.parseHttpHeaders(this.getAllResponseHeaders()),r.data=this.response},e.customData&&(t.onloadend=e.customData.onloadend,t.onprogress=e.customData.onprogress,t.onabort=e.customData.onabort,t.ontimeout=e.customData.ontimeout),t.send(),e.customData.abort=n.bind(this),!0},abort:n,getXhr:function(){return t},reset:function(){n(),e=null},resetInitialSettings:function(){n()}},e}Ue.__dashjs_factory_name=`XHRLoader`;var We=i.default.getClassFactory(Ue);function Ge(){let e=this.context,t=(0,u.default)(e).getInstance(),n,r,i;function o(e,t,n){e.customData.reader.read().then(n).catch((function(){c(e)}))}function c(e){e.customData.onloadend&&e.customData.onloadend()}function d(){return typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now()}function f(){if(this.customData.abortController)this.customData.abortController.abort();else if(this.customData.reader)try{this.customData.reader.cancel(),this.onabort()}catch{}}function p(e,t){try{if((e=e.filter((n=>n.bytes>t/4/e.length))).length>1){let t=0,n=(e[e.length-1].timestamp-e[0].timestamp)/e.length;return e.forEach(((r,i)=>{let o=e[i+1];if(o){let e=o.timestamp-r.timestamp;t+=e<n?e:0}})),t}return null}catch{return null}}function m(e,t){return 8*e/t}return i=(0,l.default)(e).getInstance().getLogger(n),n={abort:f,calculateDownloadedTime:p,load:function(e,n){let l=function(e,t,n){return new Request(e.url,{method:e.method,headers:t,credentials:e.credentials,signal:n?n.signal:void 0})}(e,function(e){let t=new Headers;if(e.headers)for(let n in e.headers){let r=e.headers[n];r&&t.append(n,r)}return t}(e),function(e){let t;return typeof window.AbortController==`function`&&(t=new AbortController,e.customData.abortController=t,t.signal.onabort=e.customData.onabort),e.customData.abort=f.bind(e),t}(e));fetch(l).then((c=>{(function(e,n,c){(function(e,t){e.status=t.status,e.statusText=t.statusText,e.url=t.url;let n={};for(let e of t.headers.keys())n[e]=t.headers.get(e);e.headers=n})(c,e),e.ok||n.customData.onloadend();let l=0,u=!1,f=new Uint8Array,g=0;n.customData.reader=e.body.getReader();let _=[],v=[],y=[],b=!0,x=t.get().streaming.abr.throughput.lowLatencyDownloadTimeCalculationMode,S=({value:e,done:t})=>{t?function(){if(f){let e=function(){let e=null;return x===h.default.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.MOOF_PARSING?e=function(){let e=function(e,t){try{let n,r;if(n=e.slice(0,-1),r=t.slice(0,-1),n.length!==r.length&&i.warn(`[FetchLoader] Moof and Mdat data arrays have different lengths. Moof: ${n.length}, Mdat: ${r.length}`),n.length<=1)return null;let o=[],c=0,l=0;for(let e=0;e<n.length;e++)if(n[e]&&r[e]){let t=r[e].timestamp-n[e].timestamp;if(t>1){let n=m(r[e].bytes,t);o.push(n),l=0}else{l===0&&(l=n[e].timestamp,c=0);let t=r[e].timestamp-l;if(t>1){c+=r[e].bytes;let n=m(c,t);o.push(n),l=0}else c+=r[e].bytes}}return o.length>0?o.reduce(((e,t)=>e+t),0)/o.length:null}catch{return null}}(v,y);return e?8*l/e:null}():x===h.default.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.DOWNLOADED_DATA&&(e=p(_,l)),e}();n.customData.onprogress({loaded:l,total:l,lengthComputable:!0,time:e}),c.data=f.buffer}n.customData.onloadend()}():(e&&e.length>0&&function(e){f=function(e,t){if(e.length===0)return t;let n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}(f,e),l+=e.length,_.push({timestamp:d(),bytes:e.length}),x===h.default.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.MOOF_PARSING&&b&&r.findLastTopIsoBoxCompleted([`moof`],f,g).found&&(b=!1,v.push({timestamp:d()}));let t=r.findLastTopIsoBoxCompleted([`moov`,`mdat`],f,g);t.found?function(e){let t=function(e){let t;return e===f.length?(t=f,f=new Uint8Array):(t=new Uint8Array(f.subarray(0,e)),f=f.subarray(e)),t}(e.startOffsetOfLastFoundTargetBox+e.sizeOfLastFoundTargetBox);x!==h.default.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.MOOF_PARSING||b||(b=!0,y.push({timestamp:d(),bytes:t.length})),n.customData.onprogress({data:t.buffer,lengthComputable:!1,noTrace:!0}),g=0}(t):function(e){g=e.startOffsetOfLastCompletedBox+e.sizeOfLastCompletedBox,u||=(n.customData.onprogress({lengthComputable:!1,noTrace:!0}),!0)}(t)}(e),o(n,0,S))};o(n,0,S)})(c,e,n)})).catch((()=>{c(e)}))},reset:function(){},setConfig:function(e){r=e.boxParser}},n}Ge.__dashjs_factory_name=`FetchLoader`;var Ke=i.default.getClassFactory(Ge),qe=r(913),Je=class{constructor(){this.period=null,this.index=-1,this.id=null,this.type=null}};class Ye{constructor(e,t,n,r){this.url=e||``,this.serviceLocation=t||e||``,this.dvbPriority=n||1,this.dvbWeight=r||1,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0,this.queryParams={}}}Ye.DEFAULT_DVB_PRIORITY=1,Ye.DEFAULT_DVB_WEIGHT=1;var Xe=Ye,Y=r(8854),Ze=class{constructor(){this.schemeIdUri=null,this.value=null,this.id=null}init(e){e&&(this.schemeIdUri=e.schemeIdUri?e.schemeIdUri:null,this.value=e.value!==null&&e.value!==void 0?e.value.toString():null,this.id=e.id?e.id:null,e[Y.default.DVB_URL]&&(this.dvbUrl=e[Y.default.DVB_URL]),e[Y.default.DVB_MIMETYPE]&&(this.dvbMimeType=e[Y.default.DVB_MIMETYPE]),e[Y.default.DVB_FONTFAMILY]&&(this.dvbFontFamily=e[Y.default.DVB_FONTFAMILY]))}inArray(e){return!!e&&e.some((e=>this.schemeIdUri===e.schemeIdUri&&(this.value?this.value.toString().match(e.value):``.match(e.value))))}},Qe=class extends Ze{constructor(){super(),this.version=null,this.sessionID=null,this.contentID=null,this.mode=null,this.keys=null,this.includeInRequests=null}init(e){super.init(e),e&&(this.version=e.version,this.sessionID=e.sessionID,this.contentID=e.contentID,this.mode=e.mode??`query`,this.keys=e.keys?e.keys.split(` `):null,this.includeInRequests=e.includeInRequests?e.includeInRequests.split(` `):[`segment`],this.schemeIdUri=e.schemeIdUri)}},$e=class{constructor(){this.adaptationSets=null,this.adaptationSetsArray=[],this.cmcdParameters=null,this.serviceLocations=null,this.serviceLocationsArray=[]}},et=class extends Ze{constructor(){super(),this.ref=null,this.refId=null,this.robustness=null,this.keyId=null,this.cencDefaultKid=null,this.pssh=null,this.pro=null,this.laUrl=null}init(e){super.init(e),e&&(this.ref=e.hasOwnProperty(Y.default.REF)?e[Y.default.REF]:null,this.refId=e.hasOwnProperty(Y.default.REF_ID)?e[Y.default.REF_ID]:null,this.robustness=e.hasOwnProperty(Y.default.ROBUSTNESS)?e[Y.default.ROBUSTNESS]:null,this.cencDefaultKid=e.hasOwnProperty(Y.default.CENC_DEFAULT_KID)?e[Y.default.CENC_DEFAULT_KID]:null,this.pssh=e.hasOwnProperty(Y.default.PSSH)?e[Y.default.PSSH]:null,this.pro=e.hasOwnProperty(Y.default.PRO)?e[Y.default.PRO]:null,this.laUrl=e.hasOwnProperty(Y.default.LA_URL)?e[Y.default.LA_URL]:e.hasOwnProperty(Y.default.LA_URL_LOWER_CASE)?e[Y.default.LA_URL_LOWER_CASE]:null)}mergeAttributesFromReference(e){[`schemeIdUri`,`value`,`id`,`robustness`,`cencDefaultKid`,`pro`,`pssh`,`laUrl`].forEach((t=>{this[t]===null&&(this[t]=e[t])}))}},tt=class{constructor(){this.defaultServiceLocation=null,this.defaultServiceLocationArray=[],this.queryBeforeStart=!1,this.serverUrl=null,this.clientRequirement=!0}},nt=class{constructor(){this.type=``,this.duration=NaN,this.presentationTime=NaN,this.id=NaN,this.messageData=``,this.eventStream=null,this.presentationTimeDelta=NaN,this.parsedMessageData=null}},rt=class{constructor(){this.adaptionSet=null,this.representation=null,this.period=null,this.timescale=1,this.value=``,this.schemeIdUri=``,this.presentationTimeOffset=0}},it=class{constructor(){this.availabilityEndTime=1/0,this.availabilityStartTime=null,this.manifest=null,this.maxSegmentDuration=1/0,this.mediaPresentationDuration=NaN,this.minimumUpdatePeriod=NaN,this.publishTime=null,this.suggestedPresentationDelay=0,this.timeShiftBufferDepth=1/0}},at=class{constructor(e,t){this.url=e||``,this.serviceLocation=t||null,this.queryParams={}}},ot=class{constructor(e,t,n){this.url=e||``,this.serviceLocation=t||null,this.ttl=n||NaN,this.queryParams={}}};class st{constructor(){this.id=null,this.index=-1,this.duration=NaN,this.start=NaN,this.mpd=null,this.nextPeriodId=null,this.isEncrypted=!1}}st.DEFAULT_ID=`defaultId`;var ct=st,lt=class{constructor(){this.period=null,this.index=-1,this.id=1,this.type=null,this.tag=null,this.order=`undefined`,this.preselectionComponents=[]}},ut=class{constructor(){this.id=null,this.inband=!1,this.type=`encoder`,this.applicationScheme=null,this.wallClockTime=null,this.presentationTime=NaN,this.UTCTiming=null}},dt=class{constructor(){this.absoluteIndex=NaN,this.adaptation=null,this.availabilityTimeComplete=!0,this.availabilityTimeOffset=0,this.bandwidth=NaN,this.bitrateInKbit=NaN,this.bitsPerPixel=NaN,this.codecFamily=null,this.codecPrivateData=null,this.codecs=null,this.dependencyId=null,this.dependentRepresentation=null,this.endNumber=null,this.essentialProperties=[],this.fragmentDuration=null,this.frameRate=null,this.height=NaN,this.id=null,this.indexRange=null,this.initialization=null,this.maxPlayoutRate=NaN,this.mediaFinishedInformation={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN},this.mediaInfo=null,this.mimeType=null,this.mseTimeOffset=NaN,this.pixelsPerSecond=NaN,this.presentationTimeOffset=0,this.qualityRanking=NaN,this.range=null,this.scanType=null,this.segments=null,this.segmentDuration=NaN,this.segmentInfoType=null,this.segmentSequenceProperties=[],this.supplementalProperties=[],this.startNumber=1,this.timescale=1,this.width=NaN}hasInitialization(){return this.initialization!==null||this.range!==null}hasSegments(){return this.segmentInfoType!==Y.default.BASE_URL&&this.segmentInfoType!==Y.default.SEGMENT_BASE&&!this.indexRange}};function ft(){let e,t=/^[a-z][a-z0-9+\-_.]*:/i,n=/^https?:\/\//i,r=/^https:\/\//i,i=/^([a-z][a-z0-9+\-_.]*:\/\/[^\/]+)\/?/i,o=(e,t)=>{try{return new window.URL(e,t).toString()}catch{return e}},c=(e,t)=>{let n=l;if(!t||!f(e))return e;p(e)&&(n=u),m(e)&&(n=d);let r=n(t),i=r.charAt(r.length-1)!==`/`&&e.charAt(0)!==`/`?`/`:``;return[r,e].join(i)};function l(e){let t=e.indexOf(`/`),n=e.lastIndexOf(`/`);return t===-1?``:n===t+1?e:(e.indexOf(`?`)!==-1&&(e=e.substring(0,e.indexOf(`?`))),e.substring(0,n+1))}function u(e){let t=e.match(i);return t?t[1]:``}function d(e){let n=e.match(t);return n?n[0]:``}function f(e){return!t.test(e)}function p(e){return f(e)&&e.charAt(0)===`/`}function m(e){return e.indexOf(`//`)===0}return function(){try{new window.URL(`x`,`http://y`),e=o}catch{}finally{e||=c}}(),{parseBaseUrl:l,parseOrigin:u,parseScheme:d,isRelative:f,isPathAbsolute:p,isSchemeRelative:m,isHTTPURL:function(e){return n.test(e)},isHTTPS:function(e){return r.test(e)},removeHostname:function(e){return/^(?:\w+\:\/\/)?([^\/]+)(.*)$/.exec(e)[2].substring(1)},resolve:function(t,n){return e(t,n)}}}ft.__dashjs_factory_name=`DefaultURLUtils`;var pt=i.default.getSingletonFactory(ft);function mt(){let e,t,n=[],r=this.context;function i(e,r,i){let o=function(e){let r;for(r=0;r<n.length;r++)if(n[r].regex.test(e))return n[r].utils;return t}(i||r);return o&&typeof o[e]==`function`?o[e](r,i):t[e](r,i)}return t=pt(r).getInstance(),e={registerUrlRegex:function(e,t){n.push({regex:e,utils:t})},parseBaseUrl:function(e){return i(`parseBaseUrl`,e)},parseOrigin:function(e){return i(`parseOrigin`,e)},parseScheme:function(e){return i(`parseScheme`,e)},isRelative:function(e){return i(`isRelative`,e)},isPathAbsolute:function(e){return i(`isPathAbsolute`,e)},isSchemeRelative:function(e){return i(`isSchemeRelative`,e)},isHTTPURL:function(e){return i(`isHTTPURL`,e)},isHTTPS:function(e){return i(`isHTTPS`,e)},removeHostname:function(e){return i(`removeHostname`,e)},resolve:function(e,t){return i(`resolve`,e,t)}},e}mt.__dashjs_factory_name=`URLUtils`;var ht=i.default.getSingletonFactory(mt),gt=r(5717),_t=class{constructor(){this.cadence=1,this.sapType=0,this.event=!0,this.alignment=null}init(e){e&&(this.cadence=e.cadence===void 0||isNaN(e.cadence)?1:e.cadence,this.sapType=e.sapType===void 0||isNaN(e.sapType)?0:e.sapType,this.event=e.event===void 0||e.event,this.alignment=e.alignment===void 0?null:e.alignment)}};function vt(){let e,t,n,r,i=this.context,o=ht(i).getInstance(),c=Number.isInteger||function(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e};function u(e,t){if(!e)throw Error(`adaptation is not defined`);if(!t)throw Error(`type is not defined`);if(e.Representation&&e.Representation.length){let n=T(e.Representation[0]);if(n&&n.some((e=>h.default.THUMBNAILS_SCHEME_ID_URIS.indexOf(e.schemeIdUri)>=0)))return t===h.default.IMAGE}if(e.ContentComponent&&e.ContentComponent.length>0){if(e.ContentComponent.length>1)return t===h.default.MUXED;if(e.ContentComponent[0].contentType===t)return!0}let n=t===h.default.TEXT?RegExp(`(ttml|vtt|wvtt|stpp)`):new RegExp(t);if(e.Representation&&e.Representation.length){let t=e.Representation[0].codecs;if(n.test(t))return!0}if(e.hasOwnProperty(Y.default.MIME_TYPE))return n.test(e.mimeType);if(e.Representation){let t;for(let r=0;r<e.Representation.length;r++)if(t=e.Representation[r],t.hasOwnProperty(Y.default.MIME_TYPE))return n.test(t.mimeType)}return!1}function d(e){if(!e)throw Error(`adaptation is not defined`);if(e.hasOwnProperty(Y.default.SEGMENT_TEMPLATE)||e.hasOwnProperty(Y.default.SEGMENT_TIMELINE)||e.hasOwnProperty(Y.default.SEGMENT_LIST)||e.hasOwnProperty(Y.default.SEGMENT_BASE))return!0;if(e.Representation&&e.Representation.length>0){let t=e.Representation[0];if(t.hasOwnProperty(Y.default.SEGMENT_TEMPLATE)||t.hasOwnProperty(Y.default.SEGMENT_TIMELINE)||t.hasOwnProperty(Y.default.SEGMENT_LIST)||t.hasOwnProperty(Y.default.SEGMENT_BASE))return!0}return!1}function f(e){return u(e,h.default.TEXT)}function p(e){return e&&e.Representation&&e.Representation.sort(((e,t)=>e.bandwidth-t.bandwidth)),e}function m(e,t){return e&&e.Period&&c(t)&&e.Period[t]?e.Period[t].AdaptationSet:[]}function g(e){return e&&e.Period?e.Period:[]}function _(e,t,n){let r=null;if(e&&e.Representation&&e.Representation.length>0){let i=c(t)&&t>=0&&t<e.Representation.length?e.Representation[t]:e.Representation[0];i&&(r=i.mimeType+`;codecs="`+i.codecs+`"`,n&&i.width!==void 0&&(r+=`;width="`+i.width+`";height="`+i.height+`"`))}return r&&=r.replace(/\sprofiles=[^;]*/g,``),r}function v(e){let t=y(e);return t&&t.length>0}function y(e){let t=[];if(!e)return t;let n=b(e);return t=t.concat(n),e.hasOwnProperty(Y.default.ADAPTATION_SET)&&e[Y.default.ADAPTATION_SET].length>0&&e[Y.default.ADAPTATION_SET].forEach((e=>{let n=b(e);t=t.concat(n)})),t}function b(e){return e&&e.hasOwnProperty(Y.default.CONTENT_PROTECTION)&&e.ContentProtection.length!==0?e[Y.default.CONTENT_PROTECTION].map((e=>{let t=new et;return t.init(e),t})):[]}function x(e){let t=!1;return e&&e.hasOwnProperty(`type`)&&(t=e.type===Y.default.DYNAMIC),t}function S(e){if(!e)return null;let t=e[Y.default.FRAMERATE];if(!t)return null;if(typeof t==`string`&&t.includes(`/`)){let[e,n]=t.split(`/`).map((e=>parseInt(e,10)));if(!isNaN(e)&&!isNaN(n)&&n!==0)return e/n}return parseInt(t)}function C(e,t){return t&&t.hasOwnProperty(e)&&t[e].length?t[e].map((e=>{let t=new Ze;return t.init(e),t})):[]}function w(e,t){if(!t)return[];let n=function(e,t){if(!t||!t.length)return[];let n=t[0][e]||[];return n.length===0?[]:t.length===1?n:n.filter((n=>t.slice(1).every((t=>t.hasOwnProperty(e)&&t[e].some((e=>e.schemeIdUri===n.schemeIdUri&&e.value===n.value))))))}(e,t[Y.default.REPRESENTATION]);return t.hasOwnProperty(e)&&t[e].length&&n.push(...t[e]),n.map((e=>{let t=new Ze;return t.init(e),t}))}function T(e){return C(Y.default.ESSENTIAL_PROPERTY,e)}function E(e){return C(Y.default.SUPPLEMENTAL_PROPERTY,e)}function D(e){return e&&e.hasOwnProperty(Y.default.SEGMENT_SEQUENCE_PROPERTIES)&&e[Y.default.SEGMENT_SEQUENCE_PROPERTIES].length?e[Y.default.SEGMENT_SEQUENCE_PROPERTIES].map((e=>{let t=new _t(e);return t.init(e),t})):[]}function O(e,t,n,r,i,o){let c=new dt;(function(e,t,n,r,i){if(e.index=i,e.adaptation=n,e.mediaInfo=r,t.hasOwnProperty(Y.default.ID)&&(e.id=t.id),t.hasOwnProperty(Y.default.CODECS)&&(e.codecs=t.codecs,e.codecFamily=He.default.getCodecFamily(e.codecs)),t.hasOwnProperty(Y.default.DEPENDENCY_ID)){let n=t[Y.default.DEPENDENCY_ID].toString().split(` `)[0];e.dependencyId=n,e.dependentRepresentation=new dt,e.dependentRepresentation.id=n}t.hasOwnProperty(Y.default.MIME_TYPE)&&(e.mimeType=t[Y.default.MIME_TYPE]),t.hasOwnProperty(Y.default.CODEC_PRIVATE_DATA)&&(e.codecPrivateData=t.codecPrivateData),t.hasOwnProperty(Y.default.BANDWITH)&&(e.bandwidth=t.bandwidth,e.bitrateInKbit=t.bandwidth/1e3),t.hasOwnProperty(Y.default.WIDTH)&&(e.width=t.width),t.hasOwnProperty(Y.default.HEIGHT)&&(e.height=t.height),t.hasOwnProperty(Y.default.SCAN_TYPE)&&(e.scanType=t.scanType),t.hasOwnProperty(Y.default.FRAMERATE)&&(e.frameRate=S(t)),t.hasOwnProperty(Y.default.QUALITY_RANKING)&&(e.qualityRanking=t[Y.default.QUALITY_RANKING]),t.hasOwnProperty(Y.default.MAX_PLAYOUT_RATE)&&(e.maxPlayoutRate=t.maxPlayoutRate),e.essentialProperties=T(t),e.supplementalProperties=E(t),e.segmentSequenceProperties=D(t),e.path=[n.period.index,n.index,i]})(c,t,n,e,o);let{segmentInfo:l,segmentInfoType:u}=function(e){let t,n;return e.hasOwnProperty(Y.default.SEGMENT_BASE)?(t=e.SegmentBase,n=Y.default.SEGMENT_BASE):e.hasOwnProperty(Y.default.SEGMENT_LIST)?(t=e.SegmentList,n=t.hasOwnProperty(Y.default.SEGMENT_TIMELINE)?Y.default.SEGMENT_TIMELINE:Y.default.SEGMENT_LIST):e.hasOwnProperty(Y.default.SEGMENT_TEMPLATE)?(t=e.SegmentTemplate,n=t.hasOwnProperty(Y.default.SEGMENT_TIMELINE)?Y.default.SEGMENT_TIMELINE:Y.default.SEGMENT_TEMPLATE):n=Y.default.BASE_URL,{segmentInfo:t,segmentInfoType:n}}(t);return c.segmentInfoType=u,function(e,t,n,r,i,o){if(e){if(e.hasOwnProperty(Y.default.INITIALIZATION_MINUS)&&(n.initialization=e.initialization.split(`$Bandwidth$`).join(i.bandwidth).split(`$RepresentationID$`).join(i.id)),e.hasOwnProperty(Y.default.INITIALIZATION)){let t=e.Initialization;t.hasOwnProperty(Y.default.SOURCE_URL)&&(n.initialization=t.sourceURL),t.hasOwnProperty(Y.default.RANGE)&&(n.range=t.range)}else f(r)&&d(r)&&r.mimeType&&r.mimeType.indexOf(`application/mp4`)===-1&&(n.range=0);e.hasOwnProperty(Y.default.TIMESCALE)&&(n.timescale=e.timescale),e.hasOwnProperty(Y.default.DURATION)?n.segmentDuration=e.duration/n.timescale:t===Y.default.SEGMENT_TIMELINE&&(n.segmentDuration=function(e){if(!e||!e.S)return NaN;let t=e.S[0],n=e.S[1];return t.hasOwnProperty(`d`)?t.d:n.t-t.t}(e.SegmentTimeline)/n.timescale),e.hasOwnProperty(Y.default.MEDIA)&&(n.media=e.media),e.hasOwnProperty(Y.default.START_NUMBER)&&(n.startNumber=parseInt(e.startNumber)),e.hasOwnProperty(Y.default.INDEX_RANGE)&&(n.indexRange=e.indexRange),e.hasOwnProperty(Y.default.PRESENTATION_TIME_OFFSET)&&(n.presentationTimeOffset=e.presentationTimeOffset/n.timescale),e.hasOwnProperty(Y.default.AVAILABILITY_TIME_OFFSET)?n.availabilityTimeOffset=e.availabilityTimeOffset:o&&o.availabilityTimeOffset!==void 0&&(n.availabilityTimeOffset=o.availabilityTimeOffset),e.hasOwnProperty(Y.default.AVAILABILITY_TIME_COMPLETE)?n.availabilityTimeComplete=e.availabilityTimeComplete!==`false`:o&&o.availabilityTimeComplete!==void 0&&(n.availabilityTimeComplete=o.availabilityTimeComplete),e.hasOwnProperty(Y.default.END_NUMBER)&&(n.endNumber=e[Y.default.END_NUMBER]),n.mseTimeOffset=function(e){let t=e.presentationTimeOffset;return e.adaptation.period.start-t}(n)}}(l,u,c,r,t,i),function(e){isNaN(e.width)||isNaN(e.height)||isNaN(e.frameRate)||(e.pixelsPerSecond=Math.max(1,e.width*e.height*e.frameRate),isNaN(e.bandwidth)||(e.bitsPerPixel=e.bandwidth/e.pixelsPerSecond))}(c),c}function k(e){return u(e,h.default.MUXED)?h.default.MUXED:u(e,h.default.AUDIO)?h.default.AUDIO:function(e){return u(e,h.default.VIDEO)}(e)?h.default.VIDEO:f(e)?h.default.TEXT:function(e){return u(e,h.default.IMAGE)}(e)?h.default.IMAGE:(t.warn(`Unknown Preselection stream type`),null)}function A(e,t){if(e&&e.hasOwnProperty(Y.default.PRESELECTION_COMPONENTS)&&Array.isArray(t))return String(e.preselectionComponents).split(` `).map((e=>t.find((t=>t.id===e))))}function j(e,t){if(!e||!e.hasOwnProperty(Y.default.PRESELECTION_COMPONENTS)||!Array.isArray(t))return;let n=String(e.preselectionComponents).split(` `);return t.find((e=>e.id===n[0]))}function M(e,t){if(!e)throw Error(`Period cannot be null or undefined`);let n=ct.DEFAULT_ID+`_`+t;return e.hasOwnProperty(Y.default.ID)&&e.id.toString().length>0&&e.id!==`__proto__`&&(n=e.id.toString()),n}function N(e,t,n){let r=[],i;if(!e)return r;for(i=0;i<e.length;i++){let o=new rt;if(o.timescale=1,o.representation=t,!e[i].hasOwnProperty(h.default.SCHEME_ID_URI))throw Error(`Invalid EventStream. SchemeIdUri has to be set`);o.schemeIdUri=e[i].schemeIdUri,e[i].hasOwnProperty(Y.default.TIMESCALE)&&(o.timescale=e[i].timescale),e[i].hasOwnProperty(Y.default.VALUE)&&(o.value=e[i].value),r.push(o),o.period=n}return r}function P(e){let t=[],n=e.BaseURL||[e.baseUri],r=!1;return n.some((n=>{if(n){let i=new Xe,c=n.__text||n;return o.isRelative(c)&&(r=!0,e.baseUri&&(c=o.resolve(c,e.baseUri))),i.url=c,n.hasOwnProperty(Y.default.SERVICE_LOCATION)&&n.serviceLocation.length?i.serviceLocation=n.serviceLocation:i.serviceLocation=c,n.hasOwnProperty(Y.default.DVB_PRIORITY)&&(i.dvbPriority=n[Y.default.DVB_PRIORITY]),n.hasOwnProperty(Y.default.DVB_WEIGHT)&&(i.dvbWeight=n[Y.default.DVB_WEIGHT]),n.hasOwnProperty(Y.default.AVAILABILITY_TIME_OFFSET)&&(i.availabilityTimeOffset=n[Y.default.AVAILABILITY_TIME_OFFSET]),n.hasOwnProperty(Y.default.AVAILABILITY_TIME_COMPLETE)&&(i.availabilityTimeComplete=n[Y.default.AVAILABILITY_TIME_COMPLETE]!==`false`),t.push(i),r}})),t}function F(e){let t=new tt;return t.serverUrl=e.__text,e.hasOwnProperty(Y.default.DEFAULT_SERVICE_LOCATION)&&(t.defaultServiceLocation=e[Y.default.DEFAULT_SERVICE_LOCATION],t.defaultServiceLocationArray=t.defaultServiceLocation.split(` `)),e.hasOwnProperty(Y.default.QUERY_BEFORE_START)&&(t.queryBeforeStart=e[Y.default.QUERY_BEFORE_START].toLowerCase()===`true`),e.hasOwnProperty(Y.default.CLIENT_REQUIREMENT)&&(t.clientRequirement=e[Y.default.CLIENT_REQUIREMENT].toLowerCase()!==`false`),t}function I(e){let t=new $e;return e.hasOwnProperty(Y.default.CMCD_PARAMETERS)&&e[Y.default.CMCD_PARAMETERS].schemeIdUri===h.default.CTA_5004_2023_SCHEME&&(t.cmcdParameters=new Qe,t.cmcdParameters.init(e[Y.default.CMCD_PARAMETERS])),e.hasOwnProperty(Y.default.SERVICE_LOCATIONS)&&e[Y.default.SERVICE_LOCATIONS]!==``&&(t.serviceLocations=e[Y.default.SERVICE_LOCATIONS],t.serviceLocationsArray=t.serviceLocations.toString().split(` `)),e.hasOwnProperty(Y.default.ADAPTATION_SETS)&&e[Y.default.ADAPTATION_SETS]!==``&&(t.adaptationSets=e[Y.default.ADAPTATION_SETS],t.adaptationSetsArray=t.adaptationSets.toString().split(` `)),t}return e={getAccessibilityForAdaptation:function(e){return e&&e.hasOwnProperty(Y.default.ACCESSIBILITY)&&e[Y.default.ACCESSIBILITY].length?e[Y.default.ACCESSIBILITY].map((e=>{let t=new Ze;return t.init(e),t})):[]},getAdaptationForId:function(e,t,n){let r=m(t,n),i,o;for(i=0,o=r.length;i<o;i++)if(r[i].hasOwnProperty(Y.default.ID)&&r[i].id===e)return r[i];return null},getAdaptationForIndex:function(e,t,n){let r=m(t,n);return r.length>0&&c(e)?r[e]:null},getAdaptationsForPeriod:function(e){let t=e&&c(e.index)?e.mpd.manifest.Period[e.index]:null,n=[],r,i,o;if(t&&t.AdaptationSet)for(o=0;o<t.AdaptationSet.length;o++)i=t.AdaptationSet[o],r=new Je,i.hasOwnProperty(Y.default.ID)&&(r.id=i.id),r.index=o,r.period=e,r.type=k(i),n.push(r);return n},getAdaptationsForType:function(e,t,n){let r=m(e,t),i,o,c=[];for(i=0,o=r.length;i<o;i++)u(r[i],n)&&c.push(p(r[i]));return c},getAudioChannelConfigurationForAdaptation:function(e){return e&&e.hasOwnProperty(Y.default.AUDIO_CHANNEL_CONFIGURATION)&&e[Y.default.AUDIO_CHANNEL_CONFIGURATION].length?e[Y.default.AUDIO_CHANNEL_CONFIGURATION].map((e=>{let t=new Ze;return t.init(e),t})):[]},getAudioChannelConfigurationForRepresentation:function(e){return e&&e.hasOwnProperty(Y.default.AUDIO_CHANNEL_CONFIGURATION)&&e[Y.default.AUDIO_CHANNEL_CONFIGURATION].length?e[Y.default.AUDIO_CHANNEL_CONFIGURATION].map((e=>{let t=new Ze;return t.init(e),t})):[]},getAvailabilityStartTime:function(e){return e&&e.hasOwnProperty(Y.default.AVAILABILITY_START_TIME)&&e.availabilityStartTime!==null?e.availabilityStartTime.getTime():null},getBandwidth:function(e){return e&&e.bandwidth?e.bandwidth:NaN},getBaseURLsFromElement:P,getBitrateListForAdaptation:function(e){let t=p(e);return(t&&t.Representation?t.Representation:[]).map((e=>({bandwidth:e.bandwidth,width:e.width||0,height:e.height||0,scanType:e.scanType||null,id:e.id||null})))},getCodec:_,getCodecForPreselection:function(e,n,r){let i=null;if(e&&n){let o=_(j(e,n),0,r);if(e.hasOwnProperty(Y.default.CODECS)){let n=e.codecs;i=o.replace(/(codecs=")[^"]*(")/,`$1${n}$2`),t.info(`Preselection has own codecs-attribute: replacing in MainAdaptationSet (was: `+o+`), new Preselection codec is: `+i)}else i=o}return i},getCombinedEssentialPropertiesForAdaptationSet:function(e){return w(Y.default.ESSENTIAL_PROPERTY,e)},getCombinedSupplementalPropertiesForAdaptationSet:function(e){return w(Y.default.SUPPLEMENTAL_PROPERTY,e)},getContentProtectionByAdaptation:function(e){return b(e)},getContentProtectionByManifest:function(e){let t=[];if(!e)return t;let n=b(e);return t=t.concat(n),e.hasOwnProperty(Y.default.PERIOD)&&e[Y.default.PERIOD].length>0&&e[Y.default.PERIOD].forEach((e=>{let n=y(e);t=t.concat(n)})),t},getContentProtectionByPeriod:y,getContentSteering:function(e){if(e&&e.hasOwnProperty(Y.default.CONTENT_STEERING))return F(e[Y.default.CONTENT_STEERING][0])},getDuration:function(e){let t;return t=e&&e.hasOwnProperty(Y.default.MEDIA_PRESENTATION_DURATION)?e.mediaPresentationDuration:e&&e.type===`dynamic`?1/0:2**53-1||Number.MAX_VALUE,t},getEssentialProperties:T,getEventStreamForAdaptationSet:function(e,t,n){let r,i,o;return e&&e.Period&&t&&t.period&&c(t.period.index)&&(i=e.Period[t.period.index],i&&i.AdaptationSet&&c(t.index)&&(o=i.AdaptationSet[t.index],o&&(r=o.InbandEventStream))),N(r,null,n)},getEventStreamForRepresentation:function(e,t,n){let r,i,o,l;return e&&e.Period&&t&&t.adaptation&&t.adaptation.period&&c(t.adaptation.period.index)&&(i=e.Period[t.adaptation.period.index],i&&i.AdaptationSet&&c(t.adaptation.index)&&(o=i.AdaptationSet[t.adaptation.index],o&&o.Representation&&c(t.index)&&(l=o.Representation[t.index],l&&(r=l.InbandEventStream)))),N(r,t,n)},getEventsForPeriod:function(e){let t=e&&e.mpd&&e.mpd.manifest?e.mpd.manifest:null,n=t?t.Period:null,i=n&&e&&c(e.index)?n[e.index].EventStream:null,o=[],l,u;if(i)for(l=0;l<i.length;l++){let t=new rt;if(t.period=e,t.timescale=1,!i[l].hasOwnProperty(h.default.SCHEME_ID_URI))throw Error(`Invalid EventStream. SchemeIdUri has to be set`);for(t.schemeIdUri=i[l][h.default.SCHEME_ID_URI],i[l].hasOwnProperty(Y.default.TIMESCALE)&&(t.timescale=i[l][Y.default.TIMESCALE]),i[l].hasOwnProperty(Y.default.VALUE)&&(t.value=i[l][Y.default.VALUE]),i[l].hasOwnProperty(Y.default.PRESENTATION_TIME_OFFSET)&&(t.presentationTimeOffset=i[l][Y.default.PRESENTATION_TIME_OFFSET]),u=0;i[l].Event&&u<i[l].Event.length;u++){let n=i[l].Event[u],c=new nt;c.presentationTime=0,c.eventStream=t,n.hasOwnProperty(Y.default.PRESENTATION_TIME)&&(c.presentationTime=n.presentationTime);let d=t.presentationTimeOffset?t.presentationTimeOffset/t.timescale:0;c.calculatedPresentationTime=c.presentationTime/t.timescale+e.start-d,n.hasOwnProperty(Y.default.DURATION)&&(c.duration=n.duration/t.timescale),n.hasOwnProperty(Y.default.ID)?c.id=parseInt(n.id):c.id=null,n.Signal&&n.Signal.Binary&&n.Signal.Binary.__text?c.messageData=r.decodeArray(n.Signal.Binary.__text.toString()):c.messageData=n.messageData||n.__cdata||n.__text,o.push(c)}}return o},getFramerate:S,getId:function(e){return e&&e[Y.default.ID]||null},getIndexForAdaptation:function(e,t,n){if(!e)return-1;let r=m(t,n);for(let t=0;t<r.length;t++)if((0,Ee.default)(i).getInstance().areEqual(r[t],e))return t;return-1},getIsDynamic:x,getIsFragmented:d,getIsText:f,getIsTypeOf:u,getLabelsForAdaptation:function(e){if(!e||!e.Label)return[];let t=[];for(let n=0;n<e.Label.length;n++)t.push({lang:e.Label[n].lang,text:e.Label[n].__text||e.Label[n]});return t},getLanguageForAdaptation:function(e){let t=``;return e&&e.hasOwnProperty(Y.default.LANG)&&(t=e.lang),t},getLocation:function(e){return e&&e.hasOwnProperty(Y.default.LOCATION)?e[Y.default.LOCATION].map((e=>new at(e.__text||e,e.hasOwnProperty(Y.default.SERVICE_LOCATION)?e[Y.default.SERVICE_LOCATION]:null))):[]},getMainAdaptationSetForPreselection:j,getCommonRepresentationForPreselection:function(e,t){if(!e||!Array.isArray(t))return;let n=j(e,t);return n?n.Representation[0]:void 0},getManifestUpdatePeriod:function(e,t=0){let n=NaN;return e&&e.hasOwnProperty(Y.default.MINIMUM_UPDATE_PERIOD)&&(n=e.minimumUpdatePeriod),isNaN(n)?n:Math.max(n-t,1)},getMimeType:function(e){return e&&e.Representation&&e.Representation.length>0?e.Representation[0].mimeType:null},getMpd:function(e){let t=new it;return e&&(t.manifest=e,e.hasOwnProperty(Y.default.AVAILABILITY_START_TIME)?t.availabilityStartTime=new Date(e.availabilityStartTime.getTime()):e.loadedTime&&(t.availabilityStartTime=new Date(e.loadedTime.getTime())),e.hasOwnProperty(Y.default.AVAILABILITY_END_TIME)&&(t.availabilityEndTime=new Date(e.availabilityEndTime.getTime())),e.hasOwnProperty(Y.default.MINIMUM_UPDATE_PERIOD)&&(t.minimumUpdatePeriod=e.minimumUpdatePeriod),e.hasOwnProperty(Y.default.MEDIA_PRESENTATION_DURATION)&&(t.mediaPresentationDuration=e.mediaPresentationDuration),e.hasOwnProperty(Y.default.SUGGESTED_PRESENTATION_DELAY)&&(t.suggestedPresentationDelay=e.suggestedPresentationDelay),e.hasOwnProperty(Y.default.TIMESHIFT_BUFFER_DEPTH)&&(t.timeShiftBufferDepth=e.timeShiftBufferDepth),e.hasOwnProperty(Y.default.MAX_SEGMENT_DURATION)&&(t.maxSegmentDuration=e.maxSegmentDuration),e.hasOwnProperty(Y.default.PUBLISH_TIME)&&(t.publishTime=new Date(e.publishTime))),t},getPatchLocation:function(e){return e&&e.hasOwnProperty(Y.default.PATCH_LOCATION)?e[Y.default.PATCH_LOCATION].map((e=>new ot(e.__text||e,e.hasOwnProperty(Y.default.SERVICE_LOCATION)?e[Y.default.SERVICE_LOCATION]:null,e.hasOwnProperty(Y.default.TTL)?1e3*parseFloat(e[Y.default.TTL]):NaN))):[]},getPreselectionIsTypeOf:function(e,t,n){if(!e)throw Error(`preselection is not defined`);if(!t)throw Error(`adaptations is not defined`);if(!n)throw Error(`type is not defined`);let r=j(e,t);return!!r&&u(r,n)},getPreselectionsForPeriod:function(e){let n=e&&c(e.index)?e.mpd.manifest.Period[e.index]:null,r=[],i,o,l;if(n&&n.Preselection)for(l=0;l<n.Preselection.length;l++){o=n.Preselection[l],i=new lt;let c=A(o,n.AdaptationSet);c.every((e=>!!e))&&c.length===1?(o.hasOwnProperty(Y.default.ID)&&(i.id=o.id),i.index=l,i.period=e,o.hasOwnProperty(Y.default.TAG)&&(i.tag=o.tag),o.hasOwnProperty(Y.default.PRESELECTION_COMPONENTS)?i.preselectionComponents=c:t.warn(`Preselection (index: `+i.index+`) missing component(s)`),o.hasOwnProperty(Y.default.ORDER)&&(i.order=o.order),i.type=k(c[0]),r.push(i)):t.warn(`Preselection removed because we don't support multi-representation preselections or not all components available.`)}return r},getProducerReferenceTimesForAdaptation:function(e){let t=e&&e.hasOwnProperty(Y.default.PRODUCER_REFERENCE_TIME)?e[Y.default.PRODUCER_REFERENCE_TIME]:[];(e&&e.hasOwnProperty(Y.default.REPRESENTATION)?e[Y.default.REPRESENTATION]:[]).forEach((e=>{e.hasOwnProperty(Y.default.PRODUCER_REFERENCE_TIME)&&t.push(...e[Y.default.PRODUCER_REFERENCE_TIME])}));let n=[];return t.forEach((e=>{let t=new ut;e.hasOwnProperty(Y.default.ID)&&(t[Y.default.ID]=parseInt(e[Y.default.ID]),e.hasOwnProperty(Y.default.WALL_CLOCK_TIME)&&(t[Y.default.WALL_CLOCK_TIME]=e[Y.default.WALL_CLOCK_TIME],e.hasOwnProperty(Y.default.PRESENTATION_TIME)&&(t[Y.default.PRESENTATION_TIME]=e[Y.default.PRESENTATION_TIME],e.hasOwnProperty(Y.default.INBAND)&&(t[Y.default.INBAND]=e[Y.default.INBAND]!==`false`),e.hasOwnProperty(Y.default.TYPE)&&(t[Y.default.TYPE]=e[Y.default.TYPE]),n.push(t))))})),n},getPublishTime:function(e){return e&&e.hasOwnProperty(Y.default.PUBLISH_TIME)?new Date(e[Y.default.PUBLISH_TIME]):null},getRealPeriodForIndex:function(e,t){let n=g(t);return n.length>0&&c(e)?n[e]:null},getRealPeriods:g,getRegularPeriods:function(e){let r=!!e&&x(e.manifest),i=[],o,c,l=null,u=null,d=null,f=null;for(c=0,o=e&&e.manifest&&e.manifest.Period?e.manifest.Period.length:0;c<o;c++)u=e.manifest.Period[c],u.hasOwnProperty(Y.default.START)?(f=new ct,f.start=u.start):l!==null&&l.hasOwnProperty(Y.default.DURATION)&&d!==null?(f=new ct,f.start=parseFloat((d.start+d.duration).toFixed(5))):c!==0||r||(f=new ct,f.start=0),d!==null&&isNaN(d.duration)&&(f===null?t.warn(`First period duration could not be calculated because lack of start and duration period properties. This will cause timing issues during playback`):d.duration=parseFloat((f.start-d.start).toFixed(5))),f!==null&&(f.id=M(u,c),f.index=c,f.mpd=e,f.isEncrypted=v(u),u.hasOwnProperty(Y.default.DURATION)&&(f.duration=u.duration),d&&(d.nextPeriodId=f.id),i.push(f),l=u,d=f),u=null,f=null;return i.length===0||d!==null&&isNaN(d.duration)&&(d.duration=parseFloat((function(e){(function(){if(!n||!n.hasOwnProperty(`error`))throw Error(h.default.MISSING_CONFIG_ERROR)})();let t=x(e.mpd.manifest),r;return e.mpd.manifest.mediaPresentationDuration?r=e.mpd.manifest.mediaPresentationDuration:e.duration?r=e.duration:t?r=1/0:n.error(new Be.default(Ne.MANIFEST_ERROR_ID_PARSE_CODE,`Must have @mediaPresentationDuration on MPD or an explicit @duration on the last period.`,e)),r}(d)-d.start).toFixed(5))),i},getRepresentationCount:function(e){return e&&e.Representation?e.Representation.length:0},getRepresentationFor:function(e,t){return t&&t.Representation&&t.Representation.length>0&&c(e)?t.Representation[e]:null},getRepresentationSortFunction:function(){return(e,t)=>e.bandwidth-t.bandwidth},getRepresentationsForAdaptation:function(e,t){let n=[],r=function(e){if(e&&e.period&&c(e.period.index)){let t=e.period.mpd.manifest.Period[e.period.index];if(t&&t.AdaptationSet&&c(e.index))return p(t.AdaptationSet[e.index])}}(e),i;if(r&&r.Representation){if(e&&e.period&&c(e.period.index)){let t=P(e.period.mpd.manifest);t&&(i=t[0])}for(let o=0,c=r.Representation.length;o<c;++o){let c=O(t,r.Representation[o],e,r,i,o);n.push(c)}}return n},getRolesForAdaptation:function(e){return e&&e.hasOwnProperty(Y.default.ROLE)&&e[Y.default.ROLE].length?e[Y.default.ROLE].map((e=>{e.schemeIdUri===h.default.DASH_ROLE_SCHEME_ID&&e.value===`Main`&&(e.value=Y.default.MAIN);let t=new Ze;return t.init(e),t})):[]},getSegmentAlignment:function(e){return!(!e||!e.hasOwnProperty(Y.default.SEGMENT_ALIGNMENT))&&e[Y.default.SEGMENT_ALIGNMENT]===`true`},getSegmentSequencePropertiesForAdaptationSet:function(e){let t=[];return e?(t.push(...D(e)),e.Representation&&e.Representation.length&&e.Representation.forEach((e=>{t.push(...D(e))})),t):t},getSelectionPriority:function(e){try{let t=e&&e.selectionPriority!==void 0?parseInt(e.selectionPriority):1;return isNaN(t)?1:t}catch{return 1}},getServiceDescriptions:function(e){let t=[];if(e&&e.hasOwnProperty(Y.default.SERVICE_DESCRIPTION))for(let n of e.ServiceDescription){let e=null,r=null,i=null,o=null,c=null,l=null,u=null,d=null;for(let t in n)if(n.hasOwnProperty(t))if(t===Y.default.ID)e=n[t];else if(t===Y.default.SERVICE_DESCRIPTION_SCOPE)r=n[t].schemeIdUri;else if(t===Y.default.SERVICE_DESCRIPTION_LATENCY)i={target:parseInt(n[t].target),max:parseInt(n[t].max),min:parseInt(n[t].min),referenceId:parseInt(n[t].referenceId)};else if(t===Y.default.SERVICE_DESCRIPTION_PLAYBACK_RATE)o={max:parseFloat(n[t].max),min:parseFloat(n[t].min)};else if(t===Y.default.SERVICE_DESCRIPTION_OPERATING_QUALITY)c={mediaType:n[t].mediaType,max:parseInt(n[t].max),min:parseInt(n[t].min),target:parseInt(n[t].target),type:n[t].type,maxQualityDifference:parseInt(n[t].maxQualityDifference)};else if(t===Y.default.SERVICE_DESCRIPTION_OPERATING_BANDWIDTH)l={mediaType:n[t].mediaType,max:parseInt(n[t].max),min:parseInt(n[t].min),target:parseInt(n[t].target)};else if(t===Y.default.CONTENT_STEERING){let e=n[t];e=Array.isArray(e)?e.at(e.length-1):e,u=F(e)}else t===Y.default.CLIENT_DATA_REPORTING&&(d=I(n[t]));t.push({id:e,schemeIdUri:r,latency:i,playbackRate:o,operatingQuality:c,operatingBandwidth:l,contentSteering:u,clientDataReporting:d})}return t},getSubSegmentAlignment:function(e){return!(!e||!e.hasOwnProperty(Y.default.SUB_SEGMENT_ALIGNMENT))&&e[Y.default.SUB_SEGMENT_ALIGNMENT]===`true`},getSuggestedPresentationDelay:function(e){return e&&e.hasOwnProperty(Y.default.SUGGESTED_PRESENTATION_DELAY)?e.suggestedPresentationDelay:null},getSupplementalProperties:E,getUTCTimingSources:function(e){let t=x(e),n=!!e&&e.hasOwnProperty(Y.default.AVAILABILITY_START_TIME),r=e?e.UTCTiming:null,i=[];return(t||n)&&r&&r.forEach((function(e){let t=new gt.default;e.hasOwnProperty(h.default.SCHEME_ID_URI)&&(t.schemeIdUri=e.schemeIdUri,e.hasOwnProperty(Y.default.VALUE)&&(t.value=e.value.toString(),i.push(t)))})),i},getViewpointForAdaptation:function(e){return e&&e.hasOwnProperty(Y.default.VIEWPOINT)&&e[Y.default.VIEWPOINT].length?e[Y.default.VIEWPOINT].map((e=>{let t=new Ze;return t.init(e),t})):[]},hasProfile:function(e,t){let n=!1;return e&&e.profiles&&e.profiles.length>0&&(n=e.profiles.indexOf(t)!==-1),n},isPeriodEncrypted:v,setConfig:function(e){e&&(e.errHandler&&(n=e.errHandler),e.BASE64&&(r=e.BASE64))}},t=(0,l.default)(i).getInstance().getLogger(e),e}vt.__dashjs_factory_name=`DashManifestModel`;var yt=i.default.getSingletonFactory(vt);let bt=`utf-16be`,xt=`utf-16le`,St=`utf-8`;function Ct(e,t){if(e<0)return-Ct(-e,t);let n=10**t;if(Math.abs(e*n%1-.5)<2**-52){let t=Math.floor(e*n);return(t%2==0?t:t+1)/n}return Math.round(e*n)/n}let wt=/&(?:amp|lt|gt|quot|apos|nbsp|lrm|rlm|#[xX]?[0-9a-fA-F]+);/g;function Tt(e){return e.indexOf(`&`)===-1?e:e.replace(wt,(e=>{switch(e){case`&amp;`:return`&`;case`&lt;`:return`<`;case`&gt;`:return`>`;case`&quot;`:return`"`;case`&apos;`:return`'`;case`&nbsp;`:return`\xA0`;case`&lrm;`:return`‎`;case`&rlm;`:return`‏`;default:if(e[1]===`#`){let t=e[2]===`x`||e[2]===`X`?parseInt(e.slice(3),16):parseInt(e.slice(2),10);return String.fromCodePoint(t)}return e}}))}var Et=class e{constructor(t,n){Array.isArray(t)&&(t=t.map((t=>t instanceof e?t:new e(t)))),this.value=t,this.params=n}};let Dt=`Dict`;function Ot(e,t){return{value:e,src:t}}function kt(e,t,n,r){return Error(`failed to ${e} "${i=t,Array.isArray(i)?JSON.stringify(i):i instanceof Map?`Map{}`:i instanceof Set?`Set{}`:typeof i==`object`?JSON.stringify(i):String(i)}" as ${n}`,{cause:r});var i}function At(e,t,n){return kt(`parse`,e,t,n)}let jt=`Inner List`,Mt=`Bare Item`,Nt=`Boolean`,Pt=`Byte Sequence`,Ft=`Date`,It=`Decimal`,Lt=`Integer`,Rt=`${Lt} or ${It}`;function zt(e){return e<-999999999999999||999999999999999<e}function Bt(e){let t,n=1,r=``,i=At(e,Rt);if(e[0]===`-`&&(n=-1,e=e.substring(1)),e.length<=0)throw i;let o=/^(\d+)?/g,c=o.exec(e);if(c[0].length===0)throw i;if(r+=c[1],(e=e.substring(o.lastIndex))[0]===`.`){if(r.length>12)throw i;let o=/^(\.\d+)?/g,c=o.exec(e);if(e=e.substring(o.lastIndex),c[0].length===0||c[1].length>4||(r+=c[1],r.length>16))throw i;t=parseFloat(r)*n}else{if(r.length>15)throw i;if(t=parseInt(r)*n,zt(t))throw At(r,Rt)}return Ot(t,e)}let Vt=`String`,Ht=/[\x00-\x1f\x7f]+/;var Ut=class{constructor(e){this.description=e}};let Wt=`Token`;function Gt(e,t){let n=e[0];if(n===`"`)return function(e){let t=``,n=0;if(e[n]!==`"`)throw At(e,Vt);for(n++;e.length>n;){if(e[n]===`\\`){if(e.length<=n+1||(n++,e[n]!==`"`&&e[n]!==`\\`))throw At(e,Vt);t+=e[n]}else{if(e[n]===`"`)return Ot(t,e.substring(++n));if(Ht.test(e[n]))throw At(e,Vt);t+=e[n]}n++}throw At(e,Vt)}(e);if(/^[-0-9]/.test(n))return Bt(e);if(n===`?`)return function(e){let t=0;if(e[t]!==`?`)throw At(e,Nt);if(t++,e[t]===`1`)return Ot(!0,e.substring(++t));if(e[t]===`0`)return Ot(!1,e.substring(++t));throw At(e,Nt)}(e);if(n===`:`)return function(e){if(e[0]!==`:`||!1===(e=e.substring(1)).includes(`:`))throw At(e,Pt);let t=/(^.*?)(:)/g,n=t.exec(e)[1];return e=e.substring(t.lastIndex),Ot(new Uint8Array([...atob(n)].map((e=>e.charCodeAt(0)))),e)}(e);if(/^[a-zA-Z*]/.test(n))return function(e,t){if(!1===/^[a-zA-Z*]$/.test(e[0]))throw At(e,Wt);let n=/^([!#$%&'*+\-.^_`|~\w:/]+)/g,r=n.exec(e)[1];return e=e.substring(n.lastIndex),Ot(!1===t?.useSymbol?new Ut(r):Symbol.for(r),e)}(e,t);if(n===`@`)return function(e){let t=0;if(e[t]!==`@`)throw At(e,Ft);t++;let n=Bt(e.substring(t));if(!1===Number.isInteger(n.value))throw At(e,Ft);return Ot(new Date(1e3*n.value),n.src)}(e);throw At(e,Mt)}function Kt(e){let t=0;if(!1===/^[a-z*]$/.test(e[t]))throw At(e,`Key`);let n=``;for(;e.length>t;){if(!1===/^[a-z0-9_\-.*]$/.test(e[t]))return Ot(n,e.substring(t));n+=e[t],t++}return Ot(n,e.substring(t))}function qt(e,t){let n;for(;e.length>0&&e[0]===`;`;){let r=Kt(e=e.substring(1).trim()),i=r.value,o=!0;if((e=r.src)[0]===`=`){let n=Gt(e=e.substring(1),t);o=n.value,e=n.src}n??={},n[i]=o}return Ot(n,e)}function Jt(e,t){let n=Gt(e,t),r=qt(e=n.src,t);return e=r.src,Ot(new Et(n.value,r.value),e)}function Yt(e,t){return e[0]===`(`?function(e,t){if(e[0]!==`(`)throw At(e,jt);e=e.substring(1);let n=[];for(;e.length>0;){if((e=e.trim())[0]===`)`){let r=qt(e=e.substring(1),t);return Ot(new Et(n,r.value),r.src)}let r=Jt(e,t);if(n.push(r.value),(e=r.src)[0]!==` `&&e[0]!==`)`)throw At(e,jt)}throw At(e,jt)}(e,t):Jt(e,t)}let Xt=`List`;function Zt(e,t,n){return kt(`serialize`,e,t,n)}function Qt(e){if(zt(e))throw Zt(e,Lt);return e.toString()}function $t(e){let t=Ct(e,3);if(Math.floor(Math.abs(t)).toString().length>12)throw Zt(e,It);let n=t.toString();return n.includes(`.`)?n:`${n}.0`}function en(e){return e.description||e.toString().slice(7,-1)}function tn(e){let t=en(e);if(!1===/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(t))throw Zt(t,Wt);return t}function nn(e){switch(typeof e){case`number`:if(!Number.isFinite(e))throw Zt(e,Mt);return Number.isInteger(e)?Qt(e):$t(e);case`string`:return function(e){if(Ht.test(e))throw Zt(e,Vt);return`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}(e);case`symbol`:return tn(e);case`boolean`:return function(e){if(typeof e!=`boolean`)throw Zt(e,Nt);return e?`?1`:`?0`}(e);case`object`:if(e instanceof Date)return function(e){return`@${Qt(e.getTime()/1e3)}`}(e);if(e instanceof Uint8Array)return function(e){if(!1===ArrayBuffer.isView(e))throw Zt(e,Pt);return`:${t=e,btoa(String.fromCharCode(...t))}:`;var t}(e);if(e instanceof Ut)return tn(e);default:throw Zt(e,Mt)}}function rn(e){if(!1===/^[a-z*][a-z0-9\-_.*]*$/.test(e))throw Zt(e,`Key`);return e}function an(e){return e==null?``:Object.entries(e).map((([e,t])=>!0===t?`;${rn(e)}`:`;${rn(e)}=${nn(t)}`)).join(``)}function on(e){return e instanceof Et?`${nn(e.value)}${an(e.params)}`:nn(e)}function sn(e,t){return function(e,t={whitespace:!0}){if(typeof e!=`object`||!e)throw Zt(e,Dt);let n=e instanceof Map?e.entries():Object.entries(e),r=t?.whitespace?` `:``;return Array.from(n).map((([e,t])=>{t instanceof Et==0&&(t=new Et(t));let n=rn(e);return!0===t.value?n+=an(t.params):(n+=`=`,Array.isArray(t.value)?n+=function(e){return`(${e.value.map(on).join(` `)})${an(e.params)}`}(t):n+=on(t)),n})).join(`,${r}`)}(e,t)}let cn={MANIFEST:`m`,AUDIO:`a`,VIDEO:`v`,MUXED:`av`,INIT:`i`,CAPTION:`c`,TIMED_TEXT:`tt`,KEY:`k`,OTHER:`o`},ln=`CMCD-Object`,un=`CMCD-Request`,dn=`CMCD-Session`,fn=`CMCD-Status`,pn={br:ln,ab:ln,d:ln,ot:ln,tb:ln,tpb:ln,lb:ln,tab:ln,lab:ln,url:ln,pb:un,bl:un,tbl:un,dl:un,ltc:un,mtp:un,nor:un,nrr:un,rc:un,sn:un,sta:un,su:un,ttfb:un,ttfbb:un,ttlb:un,cmsdd:un,cmsds:un,smrt:un,df:un,cs:un,ts:un,cid:dn,pr:dn,sf:dn,sid:dn,st:dn,v:dn,msd:dn,bs:fn,bsd:fn,cdn:fn,rtp:fn,bg:fn,pt:fn,ec:fn,e:fn},mn={OBJECT:ln,REQUEST:un,SESSION:dn,STATUS:fn},hn=`event`,gn=e=>Math.round(e),_n=(e,t)=>Array.isArray(e)?e.map((e=>_n(e,t))):e instanceof Et&&typeof e.value==`string`?new Et(_n(e.value,t),e.params):(t.baseUrl&&(e=function(e,t){let n=new URL(e),r=new URL(t);if(n.origin!==r.origin)return e;let i=n.pathname.split(`/`).slice(1),o=r.pathname.split(`/`).slice(1,-1),c=Math.min(i.length,o.length);for(let e=0;e<c&&i[e]===o[e];e++)i.shift(),o.shift();for(;o.length;)o.shift(),i.unshift(`..`);return i.join(`/`)+n.search+n.hash}(e,t.baseUrl)),t.version===1?encodeURIComponent(e):e),vn=e=>100*gn(e/100),yn={br:gn,d:gn,bl:vn,dl:vn,mtp:vn,nor:(e,t)=>{let n=e;return t.version>=2&&(e instanceof Et&&typeof e.value==`string`?n=new Et([e]):typeof e==`string`&&(n=[e])),_n(n,t)},rtp:vn,tb:gn},bn=`request`,xn=`ab.bg.bl.br.bs.bsd.cdn.cid.cs.df.ec.lab.lb.ltc.msd.mtp.pb.pr.pt.sf.sid.sn.st.sta.tab.tb.tbl.tpb.ts.v`.split(`.`),Sn=[`e`],Cn=[`cmsdd`,`cmsds`,`rc`,`smrt`,`ttfb`,`ttfbb`,`ttlb`,`url`],wn=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/;function Tn(e){return wn.test(e)}let En=[`d`,`dl`,`nor`,`ot`,`rtp`,`su`],Dn=[`bl`,`br`,`bs`,`cid`,`d`,`dl`,`mtp`,`nor`,`nrr`,`ot`,`pr`,`rtp`,`sf`,`sid`,`st`,`su`,`tb`,`v`];function On(e){return Dn.includes(e)||Tn(e)}let kn={[hn]:function(e){return xn.includes(e)||Sn.includes(e)||Cn.includes(e)||Tn(e)},[bn]:function(e){return xn.includes(e)||En.includes(e)||Tn(e)}};function An(e,t={}){let n={};if(typeof e!=`object`||!e)return n;let r=t.version||e.v||1,i=t.reportingMode||bn,o=r===1?On:kn[i],c=Object.keys(e).filter(o);e.e&&e.e!==`rr`&&(c=c.filter((e=>!function(e){return Cn.includes(e)}(e))));let l=t.filter;typeof l==`function`&&(c=c.filter(l));let u=i===hn;u&&!c.includes(`ts`)&&c.push(`ts`),r>1&&!c.includes(`v`)&&c.push(`v`);let d=Object.assign({},yn,t.formatters),f={version:r,reportingMode:i,baseUrl:t.baseUrl};return c.sort().forEach((t=>{let i=e[t],o=d[t];if(typeof o==`function`&&(i=o(i,f)),t===`v`){if(r===1)return;i=r}t==`pr`&&i===1||(u&&t===`ts`&&!Number.isFinite(i)&&(i=Date.now()),function(e){return typeof e==`number`?Number.isFinite(e):e!=null&&e!==``&&!1!==e}(i)&&(function(e){return[`ot`,`sf`,`st`,`e`,`sta`].includes(e)}(t)&&typeof i==`string`&&(i=new Ut(i)),n[t]=i))})),n}function jn(e,t={}){let n={};if(!e)return n;let r=function(e,t){let n={};if(!e)return n;let r=Object.keys(e),i=t?(o=t,Object.keys(o).reduce(((e,t)=>(o[t]?.forEach((n=>e[n]=t)),e)),{})):{};var o;return r.reduce(((t,n)=>{let r=pn[n]||i[n]||mn.REQUEST;return(t[r]??={})[n]=e[n],t}),n)}(An(e,t),t?.customHeaderMap);return Object.entries(r).reduce(((e,[t,n])=>{let r=sn(n,{whitespace:!1});return r&&(e[t]=r),e}),n)}let Mn=new Set([...Dn,...xn,...En,...Cn,...Sn]),Nn=(Array.from(Mn),cn),Pn={DASH:`d`,HLS:`h`,SMOOTH:`s`,OTHER:`o`},Fn={VOD:`v`,LIVE:`l`},In=`segment`;function Ln(){let e,t,n,r,i,o,c,d,f,m,_,v,y,b,x,S,C=this.context,w=(0,p.default)(C).getInstance(),E=(0,u.default)(C).getInstance(),D=(0,l.default)(C).getInstance();function O(){r={pr:1,nor:null,st:null,sf:null,sid:`${He.default.generateUuid()}`,cid:null},y={},v={},b={},_=void 0,x=void 0,S=!1,M()}function k(){M()}function A(){x||=Date.now()}function j(){x&&!r.msd&&(r.msd=Date.now()-x)}function M(){if(!c)return;let e=c.getStreamController();if(!e||typeof e.getActiveStream!=`function`)return;let t=e.getActiveStream();t&&(m=t.getStreamProcessors())}function N(e){try{let t=F(),n=t.version?t.keys:E.get().streaming.cmcd.enabledKeys;return Object.keys(e).filter((e=>n.includes(e))).reduce(((t,n)=>(t[n]=e[n],t)),{})}catch{return e}}function P(){let e=F();return function(e){if(Object.keys(e).length){if(parseInt(e.version)!==1)return n.error(`version parameter must be defined in 1.`),!1;if(!e.keys)return n.error(`keys parameter must be defined.`),!1}let t=e.version,r=E.get().streaming.cmcd&&E.get().streaming.cmcd.enabled;return t||r}(e)&&function(e){let t=E.get().streaming.cmcd.includeInRequests;e.version&&(t=e.includeInRequests??[In]);let r=h.default.CMCD_AVAILABLE_REQUESTS,i=t.filter((e=>!r.includes(e)));return i.length===t.length?(n.error(`None of the request types are supported.`),!1):(i.map((e=>{n.warn(`request type ${e} is not supported.`)})),!0)}(e)&&function(e){let t=h.default.CMCD_AVAILABLE_KEYS,r=h.default.CMCD_V2_AVAILABLE_KEYS,i=e.version?e.keys:E.get().streaming.cmcd.enabledKeys,o=E.get().streaming.cmcd.version,c=i.filter((e=>!(t.includes(e)||o===2&&r.includes(e))));return c.length===i.length&&i.length>0?(n.error(`None of the keys are implemented for CMCD version ${o}.`),!1):(c.map((e=>{n.warn(`key parameter ${e} is not implemented for CMCD version ${o}.`)})),!0)}(e)}function F(){let e={};if(d){let t=d.getServiceDescriptionSettings();E.get().streaming.cmcd.applyParametersFromMpd&&t.clientDataReporting&&t.clientDataReporting.cmcdParameters&&(e=t.clientDataReporting.cmcdParameters)}return e}function I(e){try{if(e.type,(t=e.mediaType)!==h.default.VIDEO&&t!==h.default.AUDIO||_&&_!=h.default.AUDIO||(_=t),function(e){let t=F(),n=E.get().streaming.cmcd.includeInRequests;t.version&&(n=t.includeInRequests?t.includeInRequests:[In]);let r={[T.HTTPRequest.INIT_SEGMENT_TYPE]:`segment`,[T.HTTPRequest.MEDIA_SEGMENT_TYPE]:`segment`,[T.HTTPRequest.XLINK_EXPANSION_TYPE]:`xlink`,[T.HTTPRequest.MPD_TYPE]:`mpd`,[T.HTTPRequest.CONTENT_STEERING_TYPE]:`steering`,[T.HTTPRequest.OTHER_TYPE]:`other`};return n.some((t=>r[e]===t))}(e.type)){if(e.type===T.HTTPRequest.MPD_TYPE)return function(){let e=z();return e.ot=Nn.MANIFEST,e}();if(e.type===T.HTTPRequest.MEDIA_SEGMENT_TYPE)return R(e.mediaType),L(e,e.mediaType);if(e.type===T.HTTPRequest.INIT_SEGMENT_TYPE)return function(){let e=z();return e.ot=Nn.INIT,e.su=!0,e}();if(e.type===T.HTTPRequest.OTHER_TYPE||e.type===T.HTTPRequest.XLINK_EXPANSION_TYPE)return function(){let e=z();return e.ot=Nn.OTHER,e}();if(e.type===T.HTTPRequest.LICENSE)return function(){let e=z();return e.ot=Nn.KEY,e}();if(e.type===T.HTTPRequest.CONTENT_STEERING_TYPE)return function(e){let t=_?L(e,_):z();return t.ot=Nn.OTHER,t}(e)}return null}catch{return null}var t}function L(e,t){R(t);let n=z(),l=function(e){try{return parseInt(e.bandwidth/1e3)}catch{return null}}(e),u=function(e){try{return isNaN(e.duration)?NaN:Math.round(1e3*e.duration)}catch{return null}}(e),d=function(e){try{return 100*parseInt(f.getSafeAverageThroughput(e)/100)}catch{return null}}(t),p=function(e){try{let t=r.pr,n=o.getCurrentBufferLevel(e);return isNaN(t)||isNaN(n)?null:100*parseInt(n/t*10)}catch{return null}}(t),g=B(t),_=function(e){try{let t=i.getPossibleVoRepresentationsFilteredBySettings(e).map((e=>e.bitrateInKbit));return Math.max(...t)}catch{return null}}(e.representation?.mediaInfo),x=r.pr,S=function(e){if(m&&m.length!==0){for(let t of m)if(t.getType()===e)return t.probeNextRequest()}}(t),C;t===h.default.VIDEO&&(C=Nn.VIDEO),t===h.default.AUDIO&&(C=Nn.AUDIO),e.mediaType===h.default.ENHANCEMENT&&(C=Nn.OTHER),t===h.default.TEXT&&(C=e.representation.mediaInfo.mimeType===`application/mp4`?Nn.TIMED_TEXT:Nn.CAPTION);let w=E.get().streaming.cmcd.rtp;return w||=function(e){try{let t=c.getPlaybackRate();t||=1;let{bandwidth:n,mediaType:r,representation:i,duration:o}=e;if(!i.mediaInfo)return NaN;let l=B(r);l===0&&(l=500);let u=n*o/1e3/(l/t/1e3),d=E.get().streaming.cmcd.rtpSafetyFactor&&!isNaN(E.get().streaming.cmcd.rtpSafetyFactor)?E.get().streaming.cmcd.rtpSafetyFactor:5;return 100*(parseInt(u*d/100)+1)}catch{return NaN}}(e),isNaN(w)||(n.rtp=w),S&&(e.url===S.url?S.range&&(n.nrr=S.range):n.nor=encodeURIComponent(He.default.getRelativeUrl(e.url,S.url))),l&&(n.br=l),C&&(n.ot=C),isNaN(u)||(n.d=u),isNaN(d)||(n.mtp=d),isNaN(p)||(n.dl=p),isNaN(g)||(n.bl=g),isNaN(_)||(n.tb=_),isNaN(x)||x===1||(n.pr=x),y[t]&&(n.bs=!0,y[t]=!1),!v[t]&&b[t]||(n.su=!0,v[t]=!1,b[t]=!0),n}function R(e){b.hasOwnProperty(e)||(b[e]=!1),v.hasOwnProperty(e)||(v[e]=!1),y.hasOwnProperty(e)||(y[e]=!1)}function z(){let e=F(),t={},n=E.get().streaming.cmcd.cid?E.get().streaming.cmcd.cid:r.cid;if(n=e.contentID?e.contentID:n,t.v=E.get().streaming.cmcd.version??1,t.sid=E.get().streaming.cmcd.sid?E.get().streaming.cmcd.sid:r.sid,t.sid=e.sessionID?e.sessionID:t.sid,t.sid=`${t.sid}`,n&&(t.cid=`${n}`),isNaN(r.pr)||r.pr===1||r.pr===null||(t.pr=r.pr),r.st&&(t.st=r.st),r.sf&&(t.sf=r.sf),t.v===2){let e=1e3*c.getCurrentLiveLatency();isNaN(e)||(t.ltc=e);let n=r.msd;S||isNaN(n)||(t.msd=n,S=!0)}return t}function B(e){try{let t=o.getCurrentBufferLevel(e);return isNaN(t)?null:100*parseInt(10*t)}catch{return null}}function V(e){try{r.pr=e.playbackRate}catch{}}function H(t){try{let n=e.getIsDynamic(t.data)?Fn.LIVE:Fn.VOD,i=t.protocol&&t.protocol===`MSS`?Pn.SMOOTH:Pn.DASH;r.st=`${n}`,r.sf=`${i}`}catch{}}function U(e){try{e.state&&e.mediaType&&e.state===g.default.BUFFER_EMPTY&&(y[e.mediaType]||(y[e.mediaType]=!0),v[e.mediaType]||(v[e.mediaType]=!0))}catch{}}function W(){for(let e in y)y.hasOwnProperty(e)&&(y[e]=!0);for(let e in v)v.hasOwnProperty(e)&&(v[e]=!0)}return t={getCmcdData:I,getQueryParameter:function(e){try{if(P()){let t=I(e),n=function(e,t={}){return e?sn(An(e,t),{whitespace:!1}):``}(N(t));return w.trigger(qe.default.CMCD_DATA_GENERATED,{url:e.url,mediaType:e.mediaType,cmcdData:t,cmcdString:n}),{key:`CMCD`,value:n}}return null}catch{return null}},getHeaderParameters:function(e){try{if(P()){let t=I(e),n=jn(N(t),E.get().streaming.cmcd.version===1?{}:{customHeaderMap:{[mn.REQUEST]:[`ltc`],[mn.SESSION]:[`msd`]}});return w.trigger(qe.default.CMCD_DATA_GENERATED,{url:e.url,mediaType:e.mediaType,cmcdData:t,headers:n}),n}return null}catch{return null}},getCmcdParametersFromManifest:F,setConfig:function(e){e&&(e.abrController&&(i=e.abrController),e.dashMetrics&&(o=e.dashMetrics),e.throughputController&&(f=e.throughputController),e.playbackController&&(c=e.playbackController),e.serviceDescriptionController&&(d=e.serviceDescriptionController))},reset:function(){w.off(g.default.PLAYBACK_RATE_CHANGED,V,this),w.off(g.default.MANIFEST_LOADED,H,this),w.off(g.default.BUFFER_LEVEL_STATE_CHANGED,U,t),w.off(g.default.PLAYBACK_SEEKED,W,t),w.off(g.default.PLAYBACK_STARTED,A,t),w.off(g.default.PLAYBACK_PLAYING,j,t),O()},initialize:function(e){w.on(g.default.PLAYBACK_RATE_CHANGED,V,t),w.on(g.default.MANIFEST_LOADED,H,t),w.on(g.default.BUFFER_LEVEL_STATE_CHANGED,U,t),w.on(g.default.PLAYBACK_SEEKED,W,t),w.on(g.default.PERIOD_SWITCH_COMPLETED,k,t),e?w.on(g.default.MANIFEST_LOADING_STARTED,A,t):w.on(g.default.PLAYBACK_STARTED,A,t),w.on(g.default.PLAYBACK_PLAYING,j,t)},isCmcdEnabled:P},e=yt(C).getInstance(),n=D.getLogger(t),O(),t}Ln.__dashjs_factory_name=`CmcdModel`;var Rn=i.default.getSingletonFactory(Ln);let zn=`CMSD-Dynamic`,Bn=cn,Vn=[`mb`,`st`,`sf`,`v`],Hn=`stream`,Un={video:Bn.VIDEO,audio:Bn.AUDIO,text:Bn.TIMED_TEXT,stream:Hn};function Wn(){let e=this.context,t=(0,p.default)(e).getInstance(),n,r,i,o;function c(){i={},o={}}function u(e){e&&Object.keys(e).forEach((t=>{Vn.includes(t)||delete e[t]}))}function d(e){try{return(t=e)?Object.entries(function(e,t){try{let{src:n,value:r}=function(e,t){let n={};for(;e.length>0;){let r,i=Kt(e),o=i.value;if((e=i.src)[0]===`=`){let n=Yt(e.substring(1),t);r=n.value,e=n.src}else{let n=qt(e,t);r=new Et(!0,n.value),e=n.src}if(n[o]=r,(e=e.trim()).length===0)return Ot(n,e);if(e[0]!==`,`||(e=e.substring(1).trim()).length===0||e[0]===`,`)throw At(e,Dt)}return Ot(n,e)}(e.trim(),t);if(n!==``)throw At(n,Dt);return r}catch(t){throw At(e,Dt,t)}}(t)).reduce(((e,[t,n])=>{let{value:r}=n;return e[t]=typeof r==`symbol`?en(r):r,e}),{}):{}}catch(e){r.error(`Failed to parse CMSD-Static response header value:`,e)}var t}function f(e){try{let n=(t=e)?function(e,t){try{let{src:n,value:r}=function(e,t){let n=[];for(;e.length>0;){let r=Yt(e,t);if(n.push(r.value),(e=r.src.trim()).length===0)return Ot(n,e);if(e[0]!==`,`||(e=e.substring(1).trim()).length===0||e[0]===`,`)throw At(e,Xt)}return Ot(n,e)}(e.trim(),t);if(n!==``)throw At(n,Xt);return r}catch(t){throw At(e,Xt,t)}}(t):[];return n[n.length-1]?.params||{}}catch(e){return r.error(`Failed to parse CMSD-Dynamic response header value:`,e),{}}var t}function h(e){return Un[e]||Bn.OTHER}function g(e,t,n){let r=e===`CMSD-Static`?i:o,c=r[t]||{},l=r[Hn]||{};return c[n]||l[n]}return n={setConfig:function(){},initialize:function(){},reset:function(){c()},parseResponseHeaders:function(e,n){let r=null,c=null;for(let n in e){let i=e[n];switch(n){case`cmsd-static`:r=d(i),t.trigger(m.default.CMSD_STATIC_HEADER,r);break;case`cmsd-dynamic`:c||=f(i)}}let l=Hn;return r&&r.ot?l=r.ot:n&&(l=h(n)),u(i[l]),u(o[l]),r&&(i[l]=Object.assign(i[l]||{},r)),c&&(o[l]=Object.assign(o[l]||{},c)),{static:r,dynamic:c}},getMaxBitrate:function(e){return g(zn,h(e),`mb`)||-1},getEstimatedThroughput:function(e){return g(zn,h(e),`etp`)||null},getResponseDelay:function(e){return g(zn,h(e),`rd`)||null},getRoundTripTime:function(e){return g(zn,h(e),`rtt`)||null}},r=(0,l.default)(e).getInstance().getLogger(n),c(),n}Wn.__dashjs_factory_name=`CmsdModel`;var Gn=i.default.getSingletonFactory(Wn),Kn=r(1926);function qn(){let e,t;function n(){t={}}return e={reset:function(){n()},processResponseHeaders:function(e){if(!(e&&e.headers&&e.request&&e.request.url))return;let n=e.headers[h.default.COMMON_ACCESS_TOKEN_HEADER];if(n){let r=He.default.getHostFromUrl(e.request.url);r&&(t[r]=n)}},getCommonAccessTokenForUrl:function(e){if(!e)return null;let n=He.default.getHostFromUrl(e);return n?t[n]?t[n]:null:void 0}},n(),e}qn.__dashjs_factory_name=`CommonAccessTokenController`;var Jn=i.default.getSingletonFactory(qn);function Yn(){let e,t;return e={setConfig:function(e){e&&e.serviceDescriptionController&&(t=e.serviceDescriptionController)},isAdaptationsIncluded:function(e){let{adaptationSetsArray:n}=t?.getServiceDescriptionSettings()?.clientDataReporting??{};return!n||n?.length===0||n.includes(e)},isServiceLocationIncluded:function(e,n){if(e===T.HTTPRequest.CONTENT_STEERING_TYPE)return!0;let{serviceLocationsArray:r}=t?.getServiceDescriptionSettings()?.clientDataReporting??{};return!r||r?.length===0||r.includes(n)}},e}Yn.__dashjs_factory_name=`ClientDataReportingController`;var Xn=i.default.getSingletonFactory(Yn);function Zn(){let e,t,n,r=this.context;function i(e,t,n,r,i){let o=function(e,t){let n=[];return n=t===Y.default.PERIOD?e[Y.default.SUPPLEMENTAL_PROPERTY]||[]:[...e[Y.default.ESSENTIAL_PROPERTY]||[],...e[Y.default.SUPPLEMENTAL_PROPERTY]||[]],n.find((e=>e.schemeIdUri===h.default.URL_QUERY_INFO_SCHEME&&e.UrlQueryInfo||e.schemeIdUri===h.default.EXT_URL_QUERY_INFO_SCHEME&&e.ExtUrlQueryInfo))}(t,i);(function(e,t,n,r){n.initialQueryString=``;let i=``,o=e?.ExtUrlQueryInfo||e?.UrlQueryInfo;i=o&&o.queryString?t&&t.length>0?t+`&`+o.queryString:o.queryString:t,o?.useMPDUrlQuery===`true`&&r&&(i=i?i+`&`+r:r),n.initialQueryString=i})(o,r.initialQueryString,e,n),function(e,t,n){if(!e)return void(t.finalQueryString=n);t.finalQueryString=(e?.ExtUrlQueryInfo?.queryTemplate||e?.UrlQueryInfo?.queryTemplate||``)===Y.default.QUERY_PART?t?.initialQueryString:``}(o,e,r.finalQueryString),e.sameOriginOnly=o?.ExtUrlQueryInfo?.sameOriginOnly,e.queryParams=He.default.parseQueryParams(e?.finalQueryString),e.includeInRequests=function(e,t){return e?e.ExtUrlQueryInfo?.includeInRequests?e.ExtUrlQueryInfo.includeInRequests.split(` `):[Y.default.SEGMENT_TYPE]:t}(o,r.includeInRequests)}return t=(0,l.default)(r).getInstance().getLogger(e),e={getFinalQueryString:function(e){try{if(!n)return null;if(e.type===T.HTTPRequest.MEDIA_SEGMENT_TYPE||e.type===T.HTTPRequest.INIT_SEGMENT_TYPE){let t=e.representation;if(!t)return null;let r=t.adaptation,i=r.period,o=n.period[i.index].adaptation[r.index].representation[t.index],c=new URL(e.url),l=!o.sameOriginOnly||n.origin===c.origin;if(o.includeInRequests.includes(Y.default.SEGMENT_TYPE)&&l)return o.queryParams}else if(e.type===T.HTTPRequest.MPD_TYPE){if([Y.default.MPD_TYPE,Y.default.MPD_PATCH_TYPE].some((e=>n.includeInRequests.includes(e))))return n.queryParams}else if(e.type===T.HTTPRequest.CONTENT_STEERING_TYPE&&n.includeInRequests.includes(Y.default.STEERING_TYPE))return n.queryParams}catch(e){return t.error(e),null}},createFinalQueryStrings:function(e){n={origin:new URL(e.url).origin,period:[]};let t=e.url.split(`?`)[1];i(n,e,t,{initialQueryString:``,includeInRequests:[]},Y.default.MPD),e.Period.forEach((e=>{let r={adaptation:[]};i(r,e,t,n,Y.default.PERIOD),e.AdaptationSet.forEach((e=>{let n={representation:[]};i(n,e,t,r,Y.default.ADAPTATION_SET),e.Representation.forEach((e=>{let r={};i(r,e,t,n,Y.default.REPRESENTATION),n.representation.push(r)})),r.adaptation.push(n)})),n.period.push(r)}))}},e}Zn.__dashjs_factory_name=`ExtUrlQueryInfoController`;var Qn=i.default.getSingletonFactory(Zn),$n=class{constructor(e){this.url=e.url,this.method=e.method,this.responseType=e.responseType===void 0?null:e.responseType,this.headers=e.headers===void 0?{}:e.headers,this.credentials=e.credentials===void 0?null:e.credentials,this.mode=e.mode===void 0?null:e.mode,this.timeout=e.timeout===void 0?0:e.timeout,this.cmcd=e.cmcd===void 0?null:e.cmcd,this.customData=e.customData===void 0?null:e.customData}},er=class{constructor(e){this.request=e.request,this.url=e.url===void 0?null:e.url,this.redirected=e.redirected!==void 0&&e.redirected,this.status=e.status===void 0?null:e.status,this.statusText=e.statusText===void 0?``:e.statusText,this.type=e.type===void 0?``:e.type,this.headers=e.headers===void 0?{}:e.headers,this.data=e.data===void 0?null:e.data,this.resourceTiming=e.resourceTiming===void 0?null:e.resourceTiming}};function tr(e){e||={};let t=this.context,n=e.errHandler,r=e.dashMetrics,i=e.mediaPlayerModel,o=e.boxParser,c=e.errors,d=e.requestTimeout||0,f=(0,p.default)(t).getInstance(),g=(0,u.default)(t).getInstance(),_,v,y,b,x,S,C,w,E,D,O,k,A,j;function M(e,c){let l=function(){N()},u=function(t){let n=new Date;B&&(B=!1,(!t.lengthComputable||t.lengthComputable&&t.total!==t.loaded)&&(R.firstByteDate=n,K.resourceTiming.responseStart=n.getTime())),t.lengthComputable&&(R.bytesLoaded=K.length=t.loaded,R.bytesTotal=K.resourceTiming.encodedBodySize=t.total,K.length=t.total,K.resourceTiming.encodedBodySize=t.loaded),t.noTrace||(z.push({s:H,d:t.time?t.time:n.getTime()-H.getTime(),b:[t.loaded?t.loaded-U:0],t:t.throughput}),R.traces=z,H=n,U=t.loaded),W&&=(clearTimeout(W),null),g.get().streaming.fragmentRequestProgressTimeout>0&&(W=setTimeout((function(){j.warn(`Abort request `+G.url+` due to progress timeout`),q.abort(G),l()}),g.get().streaming.fragmentRequestProgressTimeout)),e.progress&&t&&e.progress(t)},p=function(){N(!0)},_=function(e){let t;if(e.lengthComputable){let n=e.loaded/e.total*100;t=`Request timeout: loaded: `+e.loaded+`, out of: `+e.total+` : `+n.toFixed(3)+`% Completed`}else t=`Request timeout: non-computable download size`;j.warn(t)},N=function(t=!1){v.indexOf(G)!==-1&&v.splice(v.indexOf(G),1),W&&=(clearTimeout(W),null),O.processResponseHeaders(K),P(),F(),function(e){let t=D.getResponseInterceptors();return t?t.reduce(((e,t)=>e.then((e=>t(e)))),Promise.resolve(e)):Promise.resolve(e)}(K).then((n=>{if(K=n,function(e,t,n){let i=e.customData.request,o=g.get().streaming.cmsd&&g.get().streaming.cmsd.enabled?C.parseResponseHeaders(t.headers,i.mediaType):null;r.addHttpRequest(i,t.url,t.status,t.headers,n,o)}(G,K,z),t)e.abort&&e.abort(R);else if(R.type===T.HTTPRequest.MPD_TYPE&&(r.addManifestUpdate(R),f.trigger(m.default.MANIFEST_LOADING_FINISHED,{requestObject:R})),K.status>=200&&K.status<=299&&K.data)e.success&&e.success(K.data,K.statusText,K.url),e.complete&&e.complete(R,K.statusText);else{try{K.status===404&&g.get().streaming.utcSynchronization.enableBackgroundSyncAfterSegmentDownloadError&&R.type===T.HTTPRequest.MEDIA_SEGMENT_TYPE&&i.getRetryAttemptsForType(T.HTTPRequest.MEDIA_SEGMENT_TYPE)===c&&f.trigger(m.default.ATTEMPT_BACKGROUND_SYNC)}catch{}L()}}))},P=function(){R.startDate=V,R.endDate=new Date,R.firstByteDate=R.firstByteDate||V},F=function(){K.resourceTiming.responseEnd=Date.now(),function(e,t){if(!g.get().streaming.abr.throughput.useResourceTimingApi||typeof performance>`u`||e.range)return;let n=performance.getEntriesByType?.(`resource`);if(n===void 0||n.length<=0)return;let r=0,i=null;for(;r<n.length;){if(n[r].name===e.url){i=n[r];break}r+=1}(function(e){return e&&!isNaN(e.responseStart)&&e.responseStart>0&&!isNaN(e.responseEnd)&&e.responseEnd>0&&!isNaN(e.transferSize)&&e.transferSize>0})(i)&&(e.customData.request.resourceTimingValues=i,t.resourceTiming.startTime=i.startTime,t.resourceTiming.encodedBodySize=i.encodedBodySize,t.resourceTiming.responseStart=i.startTime,t.resourceTiming.responseEnd=i.responseEnd,t.resourceTiming.duration=i.duration)}(G,K)},I=function(e,t,n){return new Promise((r=>{(function(e){let t=D.getRequestInterceptors();return t?t.reduce(((e,t)=>e.then((e=>t(e)))),Promise.resolve(e)):Promise.resolve(e)})(t).then((i=>{(t=i).customData.onloadend=l,t.customData.onprogress=u,t.customData.onabort=p,t.customData.ontimeout=_,n.resourceTiming.startTime=Date.now(),e.load(t,n),r()}))}))},L=function(){if(c>0){c--,e&&e.request&&(e.request.retryAttempts+=1);let t={config:e};b.push(t),t.timeout=setTimeout((function(){b.indexOf(t)!==-1&&(b.splice(b.indexOf(t),1),M(e,c))}),i.getRetryIntervalsForType(R.type))}else{if(R.type===T.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE)return;n.error(new Be.default(x[R.type],R.url+` is not available`,{request:R,response:K})),e.error&&e.error(R,`error`,K.statusText,K),e.complete&&e.complete(R,K.statusText)}},R=e.request,z=[],B,V,H,U,W,G,K;if(R.bytesLoaded=NaN,R.bytesTotal=NaN,R.firstByteDate=null,R.traces=[],B=!0,V=new Date,H=V,U=0,W=null,!r||!n)throw Error(`config object is not correct or missing`);let ee=function(e){let n,i;return!e.isPartialSegmentRequest&&e.hasOwnProperty(`availabilityTimeComplete`)&&!1===e.availabilityTimeComplete&&window.fetch&&e.responseType===`arraybuffer`&&e.type===T.HTTPRequest.MEDIA_SEGMENT_TYPE?(E||(E=Ke(t).create(),E.setConfig({dashMetrics:r,boxParser:o})),n=E,i=h.default.FILE_LOADER_TYPES.FETCH):(w||=We(t).create(),n=w,i=h.default.FILE_LOADER_TYPES.XHR),{loader:n,fileLoaderType:i}}(R),q=ee.loader;var te;R.fileLoaderType=ee.fileLoaderType,R.headers={},function(e){let t=e?.serviceLocation,n=e?.mediaInfo?.id?.toString();if(k.isServiceLocationIncluded(e.type,t)&&k.isAdaptationsIncluded(n)&&S.isCmcdEnabled()){let t=S.getCmcdParametersFromManifest(),n=t.mode?t.mode:g.get().streaming.cmcd.mode;if(n===h.default.CMCD_MODE_QUERY){e.url=He.default.removeQueryParameterFromUrl(e.url,h.default.CMCD_QUERY_KEY);let t=function(e){try{let t=[],n=S.getQueryParameter(e);return n&&t.push(n),t}catch{return[]}}(e);e.url=He.default.addAdditionalQueryParameterToUrl(e.url,t)}else n===h.default.CMCD_MODE_HEADER&&(e.headers=Object.assign(e.headers,S.getHeaderParameters(e)))}}(te=R),te.retryAttempts===0&&function(e){let t=A.getFinalQueryString(e);t&&(e.url=He.default.addAdditionalQueryParameterToUrl(e.url,t))}(te),function(e){if(e.queryParams){let t=Object.keys(e.queryParams).map((t=>({key:t,value:e.queryParams[t]})));e.url=He.default.addAdditionalQueryParameterToUrl(e.url,t)}}(te),function(e){let t=O.getCommonAccessTokenForUrl(e.url);t&&(e.headers[h.default.COMMON_ACCESS_TOKEN_HEADER]=t)}(te),R.range&&(R.headers.Range=`bytes=`+R.range);let ne=D.getXHRWithCredentialsForType(R.type);G=new $n({url:R.url,method:T.HTTPRequest.GET,responseType:R.responseType,headers:R.headers,credentials:ne?`include`:`omit`,timeout:d,cmcd:S.getCmcdData(R),customData:{request:R}}),K=new er({request:G,resourceTiming:{startTime:Date.now(),encodedBodySize:0},status:0});let re=new Date().getTime();if(isNaN(R.delayLoadingTime)||re>=R.delayLoadingTime)return v.push(G),I(q,G,K);{let e={httpRequest:G,httpResponse:K};return y.push(e),e.delayTimeout=setTimeout((function(){if(y.indexOf(e)!==-1){y.splice(y.indexOf(e),1);try{V=new Date,H=V,v.push(e.httpRequest),I(q,e.httpRequest,e.httpResponse)}catch{e.httpRequest.onloadend()}}}),R.delayLoadingTime-re),Promise.resolve()}}return _={abort:function(){b.forEach((e=>{clearTimeout(e.timeout),e.config.request&&e.config.abort&&e.config.abort(e.config.request)})),b=[],y.forEach((e=>clearTimeout(e.delayTimeout))),y=[],v.forEach((e=>{let t=e.customData;t&&(t.request&&t.request.type===T.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE||(t.onloadend=t.onprogress=void 0,t.abort&&t.abort()))})),v=[]},load:function(e){return e.request?M(e,i.getRetryAttemptsForType(e.request.type)):(e.error&&e.error(e.request,`error`),Promise.resolve())},reset:function(){v=[],y=[],b=[],w&&w.reset(),E&&E.reset(),w=null,E=null},resetInitialSettings:function(){w&&w.resetInitialSettings()},setConfig:function(e){e&&(e.commonAccessTokenController&&(O=e.commonAccessTokenController),e.extUrlQueryInfoController&&(A=e.extUrlQueryInfoController))}},j=(0,l.default)(t).getInstance().getLogger(_),v=[],y=[],b=[],S=Rn(t).getInstance(),k=Xn(t).getInstance(),C=Gn(t).getInstance(),D=(0,Kn.default)(t).getInstance(),O=Jn(t).getInstance(),A=Qn(t).getInstance(),x={[T.HTTPRequest.MPD_TYPE]:c.DOWNLOAD_ERROR_ID_MANIFEST_CODE,[T.HTTPRequest.XLINK_EXPANSION_TYPE]:c.DOWNLOAD_ERROR_ID_XLINK_CODE,[T.HTTPRequest.INIT_SEGMENT_TYPE]:c.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE,[T.HTTPRequest.MEDIA_SEGMENT_TYPE]:c.DOWNLOAD_ERROR_ID_CONTENT_CODE,[T.HTTPRequest.INDEX_SEGMENT_TYPE]:c.DOWNLOAD_ERROR_ID_CONTENT_CODE,[T.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE]:c.DOWNLOAD_ERROR_ID_CONTENT_CODE,[T.HTTPRequest.OTHER_TYPE]:c.DOWNLOAD_ERROR_ID_CONTENT_CODE},_}tr.__dashjs_factory_name=`HTTPLoader`;var nr=i.default.getClassFactory(tr);function rr(){let e,t;function n(){t={}}function r(){n()}return r(),e={getLoader:function(e){for(var n in t)if(t.hasOwnProperty(n)&&e.startsWith(n))return t[n];return nr},registerLoader:function(e,n){t[e]=n},unregisterLoader:function(e){t[e]&&delete t[e]},unregisterAllLoader:n,reset:r},e}rr.__dashjs_factory_name=`SchemeLoaderFactory`;var ir=i.default.getSingletonFactory(rr);function ar(e){e||={};let t=this.context,n,r,i;return r=ir(t).getInstance(),n={abort:function(){i&&i.abort()},load:function(n){i||=r.getLoader(n&&n.request?n.request.url:null)(t).create({errHandler:e.errHandler,mediaPlayerModel:e.mediaPlayerModel,dashMetrics:e.dashMetrics,boxParser:e.boxParser?e.boxParser:null,constants:e.constants?e.constants:null,dashConstants:e.dashConstants?e.dashConstants:null,urlUtils:e.urlUtils?e.urlUtils:null,requestTimeout:isNaN(e.requestTimeout)?0:e.requestTimeout,errors:e.errors}),i.load(n)},reset:function(){r&&=(r.reset(),null),i&&typeof i.reset==`function`&&i.reset(),i=null},resetInitialSettings:function(){i&&typeof i.resetInitialSettings==`function`&&i.resetInitialSettings()}},n}ar.__dashjs_factory_name=`URLLoader`;var or=i.default.getClassFactory(ar),sr=class{constructor(e){this.url=e||null,this.type=T.HTTPRequest.CONTENT_STEERING_TYPE,this.responseType=`json`}},cr=class{constructor(){this.version=null,this.ttl=300,this.reloadUri=null,this.pathwayPriority=[],this.pathwayClones=[]}};function lr(){let e=this.context,t=ht(e).getInstance(),n,r,i,o,c,u,d,f,p,m,h,_,v,y,b,x;function S(e){T(e,`baseUrl`)}function C(e){T(e,`location`)}function w(e){var t,n;e&&e.throughputValues&&e.throughputValues.serviceLocation&&(t=e.throughputValues.serviceLocation,n=e.throughputValues,y[t]||(y[t]=[]),y[t].push(n),y[t].length>4&&y[t].shift())}function T(e,t){if(e&&e.request&&e.request.serviceLocation){let n=e.request.serviceLocation;_[t].all.indexOf(n)===-1&&_[t].all.push(n),_[t].current=n}}function E(){let e=f.getValue(),t=n.getContentSteering(e);return t||=h.getServiceDescriptionSettings().contentSteering,!t&&r&&(t=r),r=t,t}function D(){return new Promise((e=>{try{let n=E();if(!n||!n.serverUrl)return void e();let o=function(e){let n=e.serverUrl;i&&i.reloadUri&&(n=t.isRelative(i.reloadUri)?t.resolve(i.reloadUri,e.serverUrl):i.reloadUri);let r=[],o=_.baseUrl.all.concat(_.location.all);if(o.length>0){let e=o.map((e=>({serviceLocation:e,throughput:function(e){if(!e||!y[e]||y[e].length===0)return-1;let t=v.getArithmeticMean(y[e],y[e].length,!0);return parseInt(1e3*t)}(e)}))),t=``,n=``;e.forEach(((e,r)=>{r!==0&&(t+=`,`,n+=`,`),t+=e.serviceLocation,n+=e.throughput>-1?e.throughput:``})),r.push({key:`_DASH_pathway`,value:`"${t}"`}),r.push({key:`_DASH_throughput`,value:n})}return n=He.default.addAdditionalQueryParameterToUrl(n,r),n}(n),c=new sr(o);b.load({request:c,success:t=>{(function(e){e&&e[Y.default.CONTENT_STEERING_RESPONSE.VERSION]&&parseInt(e[Y.default.CONTENT_STEERING_RESPONSE.VERSION])===1&&(i=new cr,i.version=e[Y.default.CONTENT_STEERING_RESPONSE.VERSION],e[Y.default.CONTENT_STEERING_RESPONSE.TTL]&&!isNaN(e[Y.default.CONTENT_STEERING_RESPONSE.TTL])&&(i.ttl=e[Y.default.CONTENT_STEERING_RESPONSE.TTL]),e[Y.default.CONTENT_STEERING_RESPONSE.RELOAD_URI]&&(i.reloadUri=e[Y.default.CONTENT_STEERING_RESPONSE.RELOAD_URI]),e[Y.default.CONTENT_STEERING_RESPONSE.PATHWAY_PRIORITY]&&(i.pathwayPriority=e[Y.default.CONTENT_STEERING_RESPONSE.PATHWAY_PRIORITY]),e[Y.default.CONTENT_STEERING_RESPONSE.PATHWAY_CLONES]&&(i.pathwayClones=e[Y.default.CONTENT_STEERING_RESPONSE.PATHWAY_CLONES],i.pathwayClones=i.pathwayClones.filter((e=>function(e){return e[Y.default.CONTENT_STEERING_RESPONSE.BASE_ID]&&e[Y.default.CONTENT_STEERING_RESPONSE.ID]&&e[Y.default.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT]&&e[Y.default.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT][Y.default.CONTENT_STEERING_RESPONSE.HOST]}(e)))),A())})(t),u.trigger(g.default.CONTENT_STEERING_REQUEST_COMPLETED,{currentSteeringResponseData:i,url:o}),e()},error:(t,n,o,c)=>{(function(e,t){try{switch(d.warn(`Error fetching data from content steering server`,e),t.status){case 404:case 410:r=null;break;case 429:let e=t&&t.getResponseHeader?t.getResponseHeader(`retry-after`):null;e!==null&&(i||={},i.ttl=parseInt(e)),A();break;default:A()}}catch(e){d.error(e)}})(t,c),e(t)},complete:()=>{_.baseUrl.all=O(_.baseUrl),_.location.all=O(_.location)}})}catch(t){e(t)}}))}function O(e){return e.all&&e.all.length!==0&&e.current?e.all.filter((t=>t===e.current)):[]}function k(e){try{let t=[];return e&&e.length!==0&&i&&i.pathwayClones&&i.pathwayClones.length!==0&&i.pathwayClones.forEach((n=>{let r=e.filter((e=>n[Y.default.CONTENT_STEERING_RESPONSE.BASE_ID]===e.serviceLocation)),i=null;if(r&&r.length>0&&(i=r[0]),i){let e=new URL(i.url),r=n[Y.default.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT][Y.default.CONTENT_STEERING_RESPONSE.HOST];r=He.default.stringHasProtocol(r)?r:`${e.protocol}//${r}`;let o={synthesizedUrl:`${r}${e.pathname}`,serviceLocation:n[Y.default.CONTENT_STEERING_RESPONSE.ID],queryParams:n[Y.default.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT][Y.default.CONTENT_STEERING_RESPONSE.PARAMS],reference:i};t.push(o)}})),t}catch(e){return d.error(e),[]}}function A(){i&&i.ttl&&!isNaN(i.ttl)&&(m&&clearTimeout(m),m=setTimeout((()=>{D()}),1e3*i.ttl))}function j(){m&&clearTimeout(m),m=null}function M(){i=null,r=null,y={},_={baseUrl:{current:null,all:[]},location:{current:null,all:[]}},j()}return x={reset:function(){M(),u.off(g.default.FRAGMENT_LOADING_STARTED,S,x),u.off(g.default.MANIFEST_LOADING_STARTED,C,x),u.off(g.default.THROUGHPUT_MEASUREMENT_STORED,w,x)},setConfig:function(e){e&&(e.adapter&&(n=e.adapter),e.errHandler&&(c=e.errHandler),e.dashMetrics&&(o=e.dashMetrics),e.mediaPlayerModel&&(p=e.mediaPlayerModel),e.manifestModel&&(f=e.manifestModel),e.serviceDescriptionController&&(h=e.serviceDescriptionController),e.throughputController&&(v=e.throughputController),e.eventBus&&(u=e.eventBus))},loadSteeringData:D,getCurrentSteeringResponseData:function(){return i},shouldQueryBeforeStart:function(){let e=E();return!!e&&e.queryBeforeStart},getSteeringDataFromManifest:E,stopSteeringRequestTimer:j,getSynthesizedBaseUrlElements:function(e){try{return k(e).map((e=>{let t=new Xe(e.synthesizedUrl,e.serviceLocation);return t.queryParams=e.queryParams,t.dvbPriority=e.reference.dvbPriority,t.dvbWeight=e.reference.dvbWeight,t.availabilityTimeOffset=e.reference.availabilityTimeOffset,t.availabilityTimeComplete=e.reference.availabilityTimeComplete,t}))}catch(e){return d.error(e),[]}},getSynthesizedLocationElements:function(e){try{return k(e).map((e=>{let t=new at(e.synthesizedUrl,e.serviceLocation);return t.queryParams=e.queryParams,t}))}catch(e){return d.error(e),[]}},initialize:function(){b=or(e).create({errHandler:c,dashMetrics:o,mediaPlayerModel:p,errors:Ne}),u.on(g.default.FRAGMENT_LOADING_STARTED,S,x),u.on(g.default.MANIFEST_LOADING_STARTED,C,x),u.on(g.default.THROUGHPUT_MEASUREMENT_STORED,w,x)}},d=(0,l.default)(e).getInstance().getLogger(x),M(),x}lr.__dashjs_factory_name=`ContentSteeringController`;var ur=i.default.getSingletonFactory(lr);function dr(){let e=this.context,t=(0,p.default)(e).getInstance(),n,r,i,o=[];function c(e=[],t=[]){let n=0,r=NaN;for(;n<e.length;){let o=e[n],c=t.findIndex((e=>e.serviceLocation&&e.serviceLocation===o));if(c!==-1&&!i.contains(t[c].serviceLocation)){r=c;break}n+=1}return r}function l(e){let t=r.getCurrentSteeringResponseData();if(!t)return;let n=e.entry,c=setTimeout((()=>{i.remove(n),o.splice(o.indexOf(c,1))}),1e3*t.ttl);o.push(c)}return n={selectBaseUrlIndex:function(e){let t=NaN;if(isNaN(e.selectedIdx)){let n=r.getSteeringDataFromManifest();n&&n.defaultServiceLocationArray.length>0&&(t=c(n.defaultServiceLocationArray,e.baseUrls))}let n=r.getCurrentSteeringResponseData();return e.baseUrls&&e.baseUrls.length&&n&&n.pathwayPriority&&n.pathwayPriority.length&&(t=c(n.pathwayPriority,e.baseUrls)),t},setConfig:function(e){e.blacklistController&&(i=e.blacklistController),e.contentSteeringController&&(r=e.contentSteeringController),t.on(e.addBlacklistEventName,l,n)},reset:function(){o.forEach((e=>clearTimeout(e))),o=[]}},r=ur(e).getInstance(),n}dr.__dashjs_factory_name=`ContentSteeringSelector`;var fr=i.default.getClassFactory(dr);function pr(){let e=this.context,t=(0,p.default)(e).getInstance(),n=(0,u.default)(e).getInstance(),r,i,o,c,l,d;function f(){l.reset(),i.reset()}return r={chooseSelector:function(e){(0,Ve.checkParameterType)(e,`boolean`),d=e?c:o},select:function(e){if(!e)return;if(n.get().streaming.applyContentSteering){let t=l.selectBaseUrlIndex(e);isNaN(t)||t===-1||(e.selectedIdx=t)}if(!isNaN(e.selectedIdx))return e.baseUrls[e.selectedIdx];let r=d.select(e.baseUrls);return r?(e.selectedIdx=e.baseUrls.indexOf(r),r):(t.trigger(m.default.URL_RESOLUTION_FAILED,{error:new Be.default(Ne.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE,Ne.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE)}),void(d===o&&f()))},reset:f,setConfig:function(e){e.selector&&(d=e.selector),e.contentSteeringSelector&&(l=e.contentSteeringSelector)}},i=Fe(e).create({updateEventName:m.default.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,addBlacklistEventName:m.default.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD}),o=ze(e).create({blacklistController:i}),c=Le(e).create({blacklistController:i}),l=fr(e).create(),l.setConfig({blacklistController:i,addBlacklistEventName:m.default.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD}),d=o,r}pr.__dashjs_factory_name=`BaseURLSelector`;var mr=i.default.getClassFactory(pr);function hr(){let e,t,n=this.context,r=(0,p.default)(n).getInstance(),i=ht(n).getInstance(),o,c,l;function u(e){o.update(e),c.chooseSelector(t.getIsDVB(e)),r.trigger(g.default.BASE_URLS_UPDATED,{baseUrls:d(e)})}function d(e){return o.getBaseUrls(e)}return e={reset:function(){o.reset(),c.reset()},initialize:function(e){o.setConfig({adapter:t,contentSteeringController:l}),u(e)},resolve:function(e){let t=o.getForPath(e).reduce(((e,t)=>{let n=c.select(t);return n?(i.isRelative(n.url)?e.url=i.resolve(n.url,e.url):(e.url=n.url,e.serviceLocation=n.serviceLocation),e.availabilityTimeOffset=n.availabilityTimeOffset,e.availabilityTimeComplete=n.availabilityTimeComplete,e.queryParams=n.queryParams,e):new Xe}),new Xe);if(!i.isRelative(t.url))return t},setConfig:function(e){e.baseURLTreeModel&&(o=e.baseURLTreeModel),e.baseURLSelector&&(c=e.baseURLSelector),e.adapter&&(t=e.adapter),e.contentSteeringController&&(l=e.contentSteeringController)},getBaseUrls:d,update:u},o=Ae(n).create(),c=mr(n).create(),r.on(m.default.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,(function(e){o.invalidateSelectedIndexes(e.entry)}),e),e}hr.__dashjs_factory_name=`BaseURLController`;var gr=i.default.getClassFactory(hr);class _r{constructor(e){if(this.offset=e._offset,this.type=e.type,this.size=e.size,this.boxes=[],e.boxes)for(let t=0;t<e.boxes.length;t++)this.boxes.push(new _r(e.boxes[t]));switch(this.isComplete=!0,e.type){case`sidx`:if(this.timescale=e.timescale,this.earliest_presentation_time=e.earliest_presentation_time,this.first_offset=e.first_offset,this.references=e.references,e.references){this.references=[];for(let t=0;t<e.references.length;t++){let n={reference_type:e.references[t].reference_type,referenced_size:e.references[t].referenced_size,subsegment_duration:e.references[t].subsegment_duration};this.references.push(n)}}break;case`emsg`:this.id=e.id,this.version=+(e.version===1),this.value=e.value,this.timescale=e.timescale,this.scheme_id_uri=e.scheme_id_uri,this.presentation_time_delta=e.version===1?e.presentation_time:e.presentation_time_delta,this.event_duration=e.event_duration,this.message_data=e.message_data;break;case`mdhd`:this.timescale=e.timescale;break;case`mfhd`:this.sequence_number=e.sequence_number;break;case`subs`:this.entry_count=e.entry_count,this.entries=e.entries;break;case`tfhd`:this.base_data_offset=e.base_data_offset,this.sample_description_index=e.sample_description_index,this.default_sample_duration=e.default_sample_duration,this.default_sample_size=e.default_sample_size,this.default_sample_flags=e.default_sample_flags,this.flags=e.flags;break;case`tfdt`:this.version=e.version,this.baseMediaDecodeTime=e.baseMediaDecodeTime,this.flags=e.flags;break;case`trun`:if(this.sample_count=e.sample_count,this.first_sample_flags=e.first_sample_flags,this.data_offset=e.data_offset,this.flags=e.flags,this.samples=e.samples,e.samples){this.samples=[];for(let t=0,n=e.samples.length;t<n;t++){let n={sample_size:e.samples[t].sample_size,sample_duration:e.samples[t].sample_duration,sample_composition_time_offset:e.samples[t].sample_composition_time_offset};this.samples.push(n)}}break;case`prft`:this.version=e.version,this.reference_track_ID=e.reference_track_ID,this.ntp_timestamp_sec=e.ntp_timestamp_sec,this.ntp_timestamp_frac=e.ntp_timestamp_frac,this.media_time=e.media_time,this.flags=e.flags}}getChildBox(e){for(let t=0;t<this.boxes.length;t++)if(this.boxes[t].type===e)return this.boxes[t]}getChildBoxes(e){let t=[];for(let n=0;n<this.boxes.length;n++)this.boxes[n].type===e&&t.push(this.boxes[n]);return t}}var vr=_r;function yr(){let e,t;function n(e){let n=[];if(!e||!t||typeof t.fetchAll!=`function`)return n;let i,o=t.fetchAll(e);for(let e=0,t=o.length;e<t;e++)i=r(o[e]),i&&n.push(i);return n}function r(e){if(!e)return null;let t=new vr(e);return e.hasOwnProperty(`_incomplete`)&&(t.isComplete=!e._incomplete),t}return e={getBox:function(e){return e&&t&&t.boxes&&t.boxes.length!==0&&typeof t.fetch==`function`?r(t.fetch(e)):null},getBoxes:n,setData:function(e){t=e},getLastBox:function(){if(!t||!t.boxes||!t.boxes.length)return null;let e=n(t.boxes[t.boxes.length-1].type);return e.length>0?e[e.length-1]:null}},e}yr.__dashjs_factory_name=`IsoFile`;var br=i.default.getClassFactory(yr),xr=r(6877),Sr=class{constructor({found:e,sizeOfLastCompletedBox:t,sizeOfLastFoundTargetBox:n,startOffsetOfLastCompletedBox:r,startOffsetOfLastFoundTargetBox:i,typeOfLastCompletedBox:o,typeOfLastTargetBox:c}){this.found=e!==void 0&&e,this.sizeOfLastCompletedBox=t===void 0?0:t,this.sizeOfLastFoundTargetBox=n===void 0?0:n,this.startOffsetOfLastCompletedBox=r===void 0?0:r,this.startOffsetOfLastFoundTargetBox=i===void 0?0:i,this.typeOfLastCompletedBox=o===void 0?null:o,this.typeOfLastTargetBox=c===void 0?null:c}};function Cr(){let e,t,n=this.context;function r(e){if(!e)return null;e.fileStart===void 0&&(e.fileStart=0);let t=xr.parseBuffer(e),r=br(n).create();return r.setData(t),r}function i(e,t){return e[t+3]>>>0|e[t+2]<<8>>>0|e[t+1]<<16>>>0|e[t]<<24>>>0}function o(e,t){return String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t])}return t={findInitRange:function(t){let n,i,o=null,c=r(t);if(!c)return o;let l=c.getBox(`ftyp`),u=c.getBox(`moov`);return e.debug(`Searching for initialization.`),u&&u.isComplete&&(n=l?l.offset:u.offset,i=u.offset+u.size-1,o=n+`-`+i,e.debug(`Found the initialization. Range: `+o)),o},findLastTopIsoBoxCompleted:function(e,t,n){if(n===void 0&&(n=0),!t||n+8>=t.byteLength)return new Sr({found:!1});let r=t instanceof ArrayBuffer?new Uint8Array(t):t,c,l=0,u=0,d=null;for(;n<r.byteLength;){let t=i(r,n),f=o(r,n+4);if(t===0)break;n+t<=r.byteLength&&(e.indexOf(f)>=0?c=new Sr({found:!0,startOffsetOfLastFoundTargetBox:n,sizeOfLastFoundTargetBox:t,typeOfLastTargetBox:f}):(l=n,u=t,d=f)),n+=t}return c||new Sr({found:!1,startOffsetOfLastCompletedBox:l,sizeOfLastCompletedBox:u,typeOfLastCompletedBox:d})},getMediaTimescaleFromMoov:function(e){let t=r(e),n=t?t.getBox(`mdhd`):void 0;return n?n.timescale:NaN},getSamplesInfo:function(e){if(!e||e.byteLength===0)return{sampleList:[],lastSequenceNumber:NaN,totalDuration:NaN,numSequences:NaN};let t,n,i,o,c,l,u,d,f,p,m,h,g,_,v,y,b,x=r(e),S=x.getBoxes(`moof`),C=x.getBoxes(`mfhd`);y=x.getBoxes(`moof`).length,v=C[C.length-1].sequence_number,i=0,l=[];let w=-1,T=-1;for(m=0;m<S.length;m++){let e=S[m],r=e.getChildBoxes(`traf`);for(f=0;f<r.length;f++){let m=r[f],v=m.getChildBox(`tfhd`),y=m.getChildBox(`tfdt`);c=y.baseMediaDecodeTime;let x=m.getChildBoxes(`trun`),S=m.getChildBoxes(`subs`);for(p=0;p<x.length;p++){let r=x[p];for(i=r.sample_count,_=(v.base_data_offset||0)+(r.data_offset||0),d=0;d<i;d++){u=r.samples[d],t=u.sample_duration===void 0?v.default_sample_duration:u.sample_duration,o=u.sample_size===void 0?v.default_sample_size:u.sample_size,n=u.sample_composition_time_offset===void 0?0:u.sample_composition_time_offset;let i={dts:c,cts:c+n,duration:t,offset:e.offset+_,size:o,subSizes:[o]};if(S)for(h=0;h<S.length;h++){let e=S[h];if(w<e.entry_count-1&&d>T&&(w++,T+=e.entries[w].sample_delta),d==T){i.subSizes=[];let t=e.entries[w];for(g=0;g<t.subsample_count;g++)i.subSizes.push(t.subsamples[g].subsample_size)}}l.push(i),_+=o,c+=t}}b=c-y.baseMediaDecodeTime}}return{sampleList:l,lastSequenceNumber:v,totalDuration:b,numSequences:y}},parse:r},e=(0,l.default)(n).getInstance().getLogger(t),t}Cr.__dashjs_factory_name=`BoxParser`;var wr=i.default.getSingletonFactory(Cr),Tr=r(559);let Er={0:void 0,1:{channels:1,lfe:0},2:{channels:2,lfe:0},3:{channels:3,lfe:0},4:{channels:4,lfe:0},5:{channels:5,lfe:0},6:{channels:5,lfe:1},7:{channels:7,lfe:1},8:{channels:2,lfe:0},9:{channels:3,lfe:0},10:{channels:4,lfe:0},11:{channels:6,lfe:1},12:{channels:7,lfe:1},13:{channels:22,lfe:2},14:{channels:7,lfe:1},15:{channels:10,lfe:2},16:{channels:9,lfe:1},17:{channels:11,lfe:1},18:{channels:13,lfe:1},19:{channels:11,lfe:1},20:{channels:13,lfe:1}};function Dr(e){return e==0?0:e.toString(2).match(/1/g).length}function Or(e,t){let n,r=parseInt(`0x`+e,16),i=r&t[0],o=r&t[1];return n=Dr(i)+2*Dr(o),n}var kr=function(e,t=!1){let n;if(!e||!e.schemeIdUri||!e.value)return;let r=e.schemeIdUri,i=e.value;return r===`urn:mpeg:dash:23003:3:audio_channel_configuration:2011`||r===`urn:mpeg:mpegB:cicp:ChannelConfiguration`?n=Er[i]&&Er[i].channels+(t?Er[i].lfe:0):r===`tag:dolby.com,2014:dash:audio_channel_configuration:2011`?n=function(e,t){if(e.length===4)return Or(e,[63880+(t?6:0),1648])}(i,t):r===`tag:dolby.com,2015:dash:audio_channel_configuration:2015`?n=function(e,t){if(e.length===6)return e===`800000`?24:Or(e,[56834+(t?4160:0),205245])}(i,t):r===`tag:dts.com,2014:dash:audio_channel_configuration:2012`?n=parseInt(i):r===`tag:dts.com,2018:uhd:audio_channel_configuration`&&(n=function(e,t){if(!(e.length>8))return Or(e,[4294901727+(t?65568:0),0])}(i,t)),n};function Ar(){let e=this.context,t=(0,p.default)(e).getInstance(),n,r,i,o,c,u,d;function f(e,t,n,r=void 0){let o=_(e,t,n,r);return i.isCodecSupportedBasedOnTestedConfigurations(o,e)}function g(e,t,n,r,i,o=void 0){let c=_(e,t,n,o),l=JSON.stringify(c);r.has(l)||(r.add(l),i.push(c))}function _(e,t,n,i){let c=null;switch(e){case h.default.VIDEO:c=function(e,t,n){let i={codec:t,width:e&&e.width||null,height:e&&e.height||null,framerate:r.getFramerate(e)||null,bitrate:e&&e.bandwidth||null,isSupported:!0};if(e.tagName===Y.default.PRESELECTION&&n&&(i.width||=n.width||null,i.height||=n.height||null,i.bitrate||=n.bandwidth||null,i.framerate||=r.getFramerate(n)||null),o.get().streaming.capabilities.filterVideoColorimetryEssentialProperties&&(Object.assign(i,y(e)),e.tagName===Y.default.PRESELECTION&&n)){let e=y(n),t=e.isSupported;delete e.isSupported,i.isSupported=i.isSupported&&t,v(i,e)}let c=i.isSupported;if(o.get().streaming.capabilities.filterHDRMetadataFormatEssentialProperties&&(Object.assign(i,b(e)),e.tagName===Y.default.PRESELECTION&&n)){let e=b(n),t=e.isSupported;delete e.isSupported,i.isSupported=i.isSupported&&t,v(i,e)}let l=i.isSupported;return c&&l||(i.isSupported=!1),i}(t,n,i);break;case h.default.AUDIO:c=function(e,t,n){let r={codec:t,samplerate:e&&e.audioSamplingRate||null,bitrate:e&&e.bandwidth||null,isSupported:!0};return e.tagName===Y.default.PRESELECTION&&n&&(r.samplerate||=n.audioSamplingRate||null,r.bitrate||=n.bandwidth||null),o.get().streaming.capabilities.filterAudioChannelConfiguration&&Object.assign(r,function(e,t){let n=e[Y.default.AUDIO_CHANNEL_CONFIGURATION]||[],r=null;n.length==0&&t&&(n=t[Y.default.AUDIO_CHANNEL_CONFIGURATION]||[]);let i=n.map((e=>kr(e,!0)));return i.every((e=>e==i[0]))&&(r=i[0]),{channels:r}}(e,n)),r}(t,n,i);break;default:return c}return i&&(c=x(i,c)),x(t,c)}function v(e,t){for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&!(n in e)&&(e[n]=t[n]);return e}function y(e){let t={colorGamut:null,transferFunction:null,isSupported:!0};for(let n of e.EssentialProperty||[])n.schemeIdUri===h.default.COLOUR_PRIMARIES_SCHEME_ID_URI&&[`1`,`5`,`6`,`7`].includes(n.value.toString())?t.colorGamut=h.default.MEDIA_CAPABILITIES_API.COLORGAMUT.SRGB:n.schemeIdUri===h.default.COLOUR_PRIMARIES_SCHEME_ID_URI&&[`11`,`12`].includes(n.value.toString())?t.colorGamut=h.default.MEDIA_CAPABILITIES_API.COLORGAMUT.P3:n.schemeIdUri===h.default.COLOUR_PRIMARIES_SCHEME_ID_URI&&[`9`].includes(n.value.toString())?t.colorGamut=h.default.MEDIA_CAPABILITIES_API.COLORGAMUT.REC2020:n.schemeIdUri===h.default.COLOUR_PRIMARIES_SCHEME_ID_URI&&[`2`].includes(n.value.toString())?t.colorGamut=null:n.schemeIdUri===h.default.COLOUR_PRIMARIES_SCHEME_ID_URI&&(t.isSupported=!1),n.schemeIdUri===h.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&[`1`,`6`,`13`,`14`,`15`].includes(n.value.toString())?t.transferFunction=h.default.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.SRGB:n.schemeIdUri===h.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&[`16`].includes(n.value.toString())?t.transferFunction=h.default.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.PQ:n.schemeIdUri===h.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&[`18`].includes(n.value.toString())?t.transferFunction=h.default.MEDIA_CAPABILITIES_API.TRANSFERFUNCTION.HLG:n.schemeIdUri===h.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&[`2`].includes(n.value.toString())?t.transferFunction=null:n.schemeIdUri===h.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI&&(t.isSupported=!1);return t}function b(e){let t={isSupported:!0,hdrMetadataType:null};for(let n of e.EssentialProperty||[])n.schemeIdUri===h.default.HDR_METADATA_FORMAT_SCHEME_ID_URI&&n.value===h.default.HDR_METADATA_FORMAT_VALUES.ST2094_10?t.hdrMetadataType=h.default.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SMPTE_ST_2094_10:n.schemeIdUri===h.default.HDR_METADATA_FORMAT_SCHEME_ID_URI&&n.value===h.default.HDR_METADATA_FORMAT_VALUES.SL_HDR2?t.hdrMetadataType=h.default.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SLHDR2:n.schemeIdUri===h.default.HDR_METADATA_FORMAT_SCHEME_ID_URI&&n.value===h.default.HDR_METADATA_FORMAT_VALUES.ST2094_40?t.hdrMetadataType=h.default.MEDIA_CAPABILITIES_API.HDR_METADATATYPE.SMPTE_ST_2094_40:n.schemeIdUri===h.default.HDR_METADATA_FORMAT_SCHEME_ID_URI&&(t.isSupported=!1);return t}function x(e,t){return u&&e&&e[Y.default.CONTENT_PROTECTION]&&e[Y.default.CONTENT_PROTECTION].length>0&&(t.keySystemsMetadata=u.getSupportedKeySystemMetadataFromContentProtection(e[Y.default.CONTENT_PROTECTION])),t}function S(e){if(!e||e.length===0)return!0;let t=0;for(;t<e.length;){if(!i.supportsEssentialProperty(e[t]))return d.debug(`[Stream] EssentialProperty not supported: `+e[t].schemeIdUri),!1;t+=1}return!0}return n={setConfig:function(e){e&&(e.adapter&&(r=e.adapter),e.capabilities&&(i=e.capabilities),e.settings&&(o=e.settings),e.protectionController&&(u=e.protectionController),e.customParametersModel&&(c=e.customParametersModel))},filterUnsupportedFeatures:function(e){return new Promise((n=>{let l=[h.default.VIDEO,h.default.AUDIO],u=[];l.forEach((t=>{(function(e,t){if(!e||!e.Period||e.Period.length===0)return[];let n=new Set,i=[];return e.Period.forEach((e=>{e.AdaptationSet.forEach((e=>{r.getIsTypeOf(e,t)&&e.Representation.forEach(((o,c)=>{g(t,o,r.getCodec(e,c,!1),n,i);let l=r.getSupplementalCodecs(o);l.length>0&&g(t,o,l[0],n,i)}))})),e.Preselection&&e.Preselection.length&&e.Preselection.forEach((o=>{r.getPreselectionIsTypeOf(o,e.AdaptationSet,t)&&g(t,o,r.getCodecForPreselection(o,e.AdaptationSet),n,i,r.getCommonRepresentationForPreselection(o,e.AdaptationSet))}))})),i})(e,t).forEach((e=>{u.push(i.runCodecSupportCheck(e,t))}))})),Promise.allSettled(u).then((()=>(l.forEach((n=>{(function(e,n){n&&n.Period&&n.Period.length!==0&&n.Period.forEach((n=>{(function(e,n){e&&e.AdaptationSet&&e.AdaptationSet.length!==0&&(e.AdaptationSet=e.AdaptationSet.filter((e=>{r.getIsTypeOf(e,n)&&function(e,t){e.Representation&&e.Representation.length!==0&&(e.Representation=e.Representation.filter(((n,i)=>{let o=r.getCodec(e,i,!1),c=f(t,n,o),l=function(e,t){let n=!1,i=r.getSupplementalCodecs(e);return i.length>0&&(i.length>1&&d.warn(`[CapabilitiesFilter] Multiple supplemental codecs not supported; using the first in list`),n=f(t,e,i[0])),n}(n,t);return l&&(d.debug(`[CapabilitiesFilter] Codec supported. Upgrading codecs string of Representation with ID ${n.id}`),n.codecs=n[Y.default.SUPPLEMENTAL_CODECS]),c||l||d.warn(`[CapabilitiesFilter] Codec ${o} not supported. Removing Representation with ID ${n.id}`),c||l})))}(e,n);let i=e.Representation&&e.Representation.length>0;return i||(t.trigger(m.default.ADAPTATION_SET_REMOVED_NO_CAPABILITIES,{adaptationSet:e}),d.warn(`[CapabilitiesFilter] AdaptationSet with ID ${e.id?e.id:`undefined`} and codec ${e.codecs?e.codecs:`undefined`} has been removed because of no supported Representation`)),i})))})(n,e),function(e,t){e&&e.Preselection&&e.Preselection.length!==0&&(e.Preselection=e.Preselection.filter((n=>{if(r.getPreselectionIsTypeOf(n,e.AdaptationSet,t)){let i=r.getCodecForPreselection(n,e.AdaptationSet),o=!0;return i&&(o=f(t,n,i,r.getCommonRepresentationForPreselection(n,e.AdaptationSet))),o||d.warn(`[CapabilitiesFilter] Preselection@codecs ${i} not supported. Removing Preselection with ID ${n.id}`),o}return!0})))}(n,e)}))})(n,e)})),o.get().streaming.capabilities.filterUnsupportedEssentialProperties&&function(e){e&&e.Period&&e.Period.length!==0&&e.Period.forEach((e=>{e.AdaptationSet=e.AdaptationSet.filter((e=>!e.Representation||e.Representation.length===0||!!S(r.getEssentialProperties(e))&&(e.Representation=e.Representation.filter((e=>S(r.getEssentialProperties(e)))),e.Representation&&e.Representation.length>0))),e.Preselection&&e.Preselection.length&&(e.Preselection=e.Preselection.filter((e=>!!S(r.getEssentialProperties(e))||(d.warn(`[CapabilitiesFilter] removed Preselection (id: ${e.id}) with unsupported EssentialProperty`),!1))))}))}(e),function(e){e&&e.Period&&e.Period.length!==0&&e.Period.forEach((e=>{e.Preselection&&=e.Preselection.filter((e=>{let t=String(e.preselectionComponents).split(` `).length;return t!==1&&d.warn(`Multi-Representation Preselection (id: ${e.id}) removed as not supported.`),t===1}))}))}(e),function(e){e&&e.Period&&e.Period.length!==0&&e.Period.forEach((e=>{e.Preselection&&=e.Preselection.filter((t=>{let n=String(t.preselectionComponents).split(` `),r=e.AdaptationSet.map((e=>e.id));return n.every((e=>r.includes(e)))}))}))}(e),function(e){if(!e||!e.Period||e.Period.length===0)return Promise.resolve();let t=[];return e.Period.forEach((e=>{t.push(function(e){return new Promise((t=>{if(!e||!e.AdaptationSet||e.AdaptationSet.length===0)return void t();let n=[];e.AdaptationSet.forEach((e=>{n.push(function(e){return new Promise((t=>{if(!e.Representation||e.Representation.length===0)return void t();let n=[];e.Representation.forEach((e=>{n.push(function(e){let t=[],n=c.getCustomCapabilitiesFilters();return n&&n.length!==0?n.forEach((n=>{t.push(new Promise((t=>t(n(e)))))})):t.push(Promise.resolve(!0)),Promise.all(t)}(e))})),Promise.all(n).then((n=>{e.Representation=e.Representation.filter(((e,t)=>{let r=n[t].every((e=>e));return r||d.debug(`[Stream] Representation `+e.id+` has been removed because of unsupported CustomFilter`),r})),t()})).catch((e=>{d.warn(`[Stream] at least one promise rejected in CustomFilter with error: `,e),t()}))}))}(e))})),Promise.all(n).then((()=>{e.AdaptationSet=e.AdaptationSet.filter((e=>e.Representation&&e.Representation.length>0)),t()})).catch((()=>{t()}))}))}(e))})),Promise.all(t)}(e)))).then((()=>{n()})).catch((e=>{d.error(e),n()}))}))}},d=(0,l.default)(e).getInstance().getLogger(n),n}Ar.__dashjs_factory_name=`CapabilitiesFilter`;var jr=i.default.getSingletonFactory(Ar);function Mr(){let e=this.context,t=(0,p.default)(e).getInstance(),n,r,i,o,u,d,f,_,v,y;function b(){r=!1;let e=He.default.parseUserAgent();i=e&&e.browser&&e.browser.name&&e.browser.name.toLowerCase()===`safari`}function x(){r=!1}function S(e){if(e.streamId!==d.getActiveStreamInfo().id||!v)return;let t=f.getLiveDelay();f.getBufferLevel()>t/2&&(v=!1)}function C(e){e.streamId===d.getActiveStreamInfo().id&&(v=e.state===c.BUFFER_EMPTY)}function w(){_.getCatchupModeEnabled()||o.setPlaybackRate(1)}function T(){f.getIsDynamic()&&_.getCatchupModeEnabled()&&(_.getCatchupPlaybackRates().max>0||_.getCatchupPlaybackRates().min<0)&&!f.isPaused()&&!f.isSeeking()&&function(){try{return!f.getTime()>0||r?!1:D()===h.default.LIVE_CATCHUP_MODE_LOLP?function(e,t){try{return Math.abs(E())>0||e<t}catch{return!1}}(f.getBufferLevel(),u.get().streaming.liveCatchup.playbackBufferMin):function(){try{return Math.abs(E())>0}catch{return!1}}()}catch{return!1}}()&&function(){if(!r&&o){let e,t=o.getPlaybackRate(),n=_.getCatchupPlaybackRates(),c=f.getBufferLevel(),l=E(),d=_.getCatchupMaxDrift();if(!isNaN(d)&&d>0&&l>d)y.info(`[CatchupController]: Low Latency catchup mechanism. Latency too high, doing a seek to live point`),r=!0,f.seekToCurrentLive(!0,!1);else{let r=f.getCurrentLiveLatency(),l=f.getLiveDelay();e=D()===h.default.LIVE_CATCHUP_MODE_LOLP?function(e,t,n,r,i){let o;if(i<r){let t=Math.abs(e.min),n=5*(i-r);o=1-t+2*t/(1+Math.E**+-n),y.debug(`[LoL+ playback control_buffer-based] bufferLevel: `+i+`, newRate: `+o)}else{if(Math.abs(t-n)<=.02*n)o=1;else{let r=t-n,i=r<0?Math.abs(e.min):e.max,c=5*r;o=1-i+2*i/(1+Math.E**+-c)}y.debug(`[LoL+ playback control_latency-based] latency: `+t+`, newRate: `+o)}return o}(n,r,l,u.get().streaming.liveCatchup.playbackBufferMin,c):function(e,t,n,r){if(v)return 1;let i=t-n,o=i<0?Math.abs(e.min):e.max,c=5*i,l=1-o+2*o/(1+Math.E**+-c);return f.getPlaybackStalled()&&r<=n/2&&i>0&&(l=1),l}(n,r,l,c);let d=i?.25:.02/(.5/n.max);(e&&Math.abs(t-e)>=d||e==1)&&(y.debug(`[CatchupController]: Setting playback rate to ${e}`),o.setPlaybackRate(e))}}}()}function E(){return f.getCurrentLiveLatency()-f.getLiveDelay()}function D(){let e=u.get().streaming.liveCatchup.playbackBufferMin;return u.get().streaming.liveCatchup.mode!==h.default.LIVE_CATCHUP_MODE_LOLP||e===null||isNaN(e)?h.default.LIVE_CATCHUP_MODE_DEFAULT:h.default.LIVE_CATCHUP_MODE_LOLP}function O(){_.getCatchupPlaybackRates(!0)}return n={reset:function(){t.off(g.default.BUFFER_LEVEL_UPDATED,S,n),t.off(g.default.BUFFER_LEVEL_STATE_CHANGED,C,n),t.off(g.default.PLAYBACK_PROGRESS,T,n),t.off(g.default.PLAYBACK_TIME_UPDATED,T,n),t.off(g.default.PLAYBACK_SEEKED,x,n),t.off(m.default.SETTING_UPDATED_CATCHUP_ENABLED,w,n),t.off(m.default.SETTING_UPDATED_PLAYBACK_RATE_MIN,O,n),t.off(m.default.SETTING_UPDATED_PLAYBACK_RATE_MAX,O,n),t.off(g.default.STREAM_INITIALIZED,O,n),b(),o.setPlaybackRate(1,!0)},setConfig:function(e){e&&(e.settings&&(u=e.settings),e.videoModel&&(o=e.videoModel),e.streamController&&(d=e.streamController),e.playbackController&&(f=e.playbackController),e.mediaPlayerModel&&(_=e.mediaPlayerModel))},initialize:function(){t.on(g.default.BUFFER_LEVEL_UPDATED,S,n),t.on(g.default.BUFFER_LEVEL_STATE_CHANGED,C,n),t.on(g.default.PLAYBACK_PROGRESS,T,n),t.on(g.default.PLAYBACK_TIME_UPDATED,T,n),t.on(g.default.PLAYBACK_SEEKED,x,n),t.on(m.default.SETTING_UPDATED_CATCHUP_ENABLED,w,n),t.on(m.default.SETTING_UPDATED_PLAYBACK_RATE_MIN,O,n),t.on(m.default.SETTING_UPDATED_PLAYBACK_RATE_MAX,O,n),t.on(g.default.STREAM_INITIALIZED,O,n),O()}},y=(0,l.default)(e).getInstance().getLogger(n),b(),n}Mr.__dashjs_factory_name=`CatchupController`;var Nr=i.default.getSingletonFactory(Mr);let Pr=[{oldKey:`dashjs_vbitrate`,newKey:`dashjs_video_bitrate`},{oldKey:`dashjs_abitrate`,newKey:`dashjs_audio_bitrate`},{oldKey:`dashjs_vsettings`,newKey:`dashjs_video_settings`},{oldKey:`dashjs_asettings`,newKey:`dashjs_audio_settings`}],Fr=`dashjs_?_bitrate`,Ir=`dashjs_?_settings`,Lr=`localStorage`,Rr=`lastBitrate`,zr=`lastMediaSettings`;function Br(e){e||={};let t=this.context,n=e.settings,r,i,o;function c(e){if(o!==void 0)return o;let t;o=!1;try{typeof window<`u`&&(t=window[e])}catch(e){return i.warn(`DOMStorage access denied: `+e.message),o}if(!t||e!==Lr&&e!==`sessionStorage`)return o;try{t.setItem(`1`,`1`),t.removeItem(`1`),o=!0}catch(e){i.warn(`DOMStorage is supported, but cannot be used: `+e.message)}return o}function u(){let e=6e5;return Math.round(new Date().getTime()/e)*e}function d(e,t){return c(e)&&n.get().streaming[t+`CachingInfo`].enabled}function f(){if(!n)throw Error(h.default.MISSING_CONFIG_ERROR)}return r={getSavedBitrateSettings:function(e){if(f(),!n.get().streaming.lastBitrateCachingInfo.enabled)return NaN;let t=NaN;if(d(Lr,Rr)){let r=Fr.replace(/\?/,e);try{let o=JSON.parse(localStorage.getItem(r))||{},c=new Date().getTime()-parseInt(o.timestamp,10)>=n.get().streaming.lastBitrateCachingInfo.ttl||!1,l=parseFloat(o.bitrate);isNaN(l)||c?c&&localStorage.removeItem(r):(t=l,i.debug(`Last saved bitrate for `+e+` was `+l))}catch{return null}}return t},setSavedBitrateSettings:function(e,t){if(d(Lr,Rr)&&t){let n=Fr.replace(/\?/,e);try{localStorage.setItem(n,JSON.stringify({bitrate:t.toFixed(3),timestamp:u()}))}catch(e){i.error(e.message)}}},getSavedMediaSettings:function(e){if(f(),!n.get().streaming.lastMediaSettingsCachingInfo.enabled)return null;let t=null;if(d(Lr,zr)){let r=Ir.replace(/\?/,e);try{let e=JSON.parse(localStorage.getItem(r))||{},i=new Date().getTime()-parseInt(e.timestamp,10)>=n.get().streaming.lastMediaSettingsCachingInfo.ttl||!1;t=e.settings,i&&(localStorage.removeItem(r),t=null)}catch{return null}}return t},setSavedMediaSettings:function(e,t){if(d(Lr,zr)){let n=Ir.replace(/\?/,e);try{localStorage.setItem(n,JSON.stringify({settings:t,timestamp:u()}))}catch(e){i.error(e.message)}}}},i=(0,l.default)(t).getInstance().getLogger(r),c(Lr)&&Pr.forEach((e=>{let t=localStorage.getItem(e.oldKey);if(t){localStorage.removeItem(e.oldKey);try{localStorage.setItem(e.newKey,t)}catch(e){i.error(e.message)}}})),r}Br.__dashjs_factory_name=`DOMStorage`;var Vr=i.default.getSingletonFactory(Br),Hr=class{constructor(){this.accessibility=null,this.adaptationSetSwitchingCompatibleIds=[],this.audioChannelConfiguration=null,this.bitrateList=null,this.codec=null,this.contentProtection=null,this.essentialProperties=[],this.id=null,this.index=null,this.isEmbedded=null,this.isFragmented=null,this.isPreselection=!1,this.isText=!1,this.labels=null,this.lang=null,this.mimeType=null,this.normalizedKeyIds=new Set,this.representationCount=0,this.roles=null,this.segmentAlignment=!1,this.segmentSequenceProperties=[],this.selectionPriority=1,this.streamInfo=null,this.subSegmentAlignment=!1,this.supplementalProperties=[],this.type=null,this.viewpoint=null}},Ur=class{constructor(){this.id=null,this.index=null,this.start=NaN,this.duration=NaN,this.manifestInfo=null,this.isLast=!0,this.isEncrypted=!1}},Wr=class{constructor(){this.availableFrom=null,this.duration=NaN,this.dvrWindowSize=NaN,this.isDynamic=!1,this.loadedTime=null,this.maxFragmentDuration=null,this.minBufferTime=NaN,this.protocol=null,this.serviceDescriptions=[]}},Gr=class{constructor(e){this.valid=e[0]==`/`,this.path=e.split(`/`).filter((e=>e.length!==0)).map((e=>{let t={name:e},n=e.indexOf(`[`);if(n!=-1){t.name=e.substring(0,n);let r=e.substring(n+1,e.length-1);this.valid=this.valid&&r.indexOf(`[`)==-1;let i=r.indexOf(`=`);i==-1?t.position=parseInt(r,10)-1:(t.attribute={name:r.substring(1,i),value:r.substring(i+1)},[`'`,`"`].indexOf(t.attribute.value[0])!=-1&&(t.attribute.value=t.attribute.value.substring(1,t.attribute.value.length-1)))}return t}))}isValid(){return this.valid}findsElement(){return!this.findsAttribute()}findsAttribute(){return this.path[this.path.length-1].name.startsWith(`@`)}findsTextReplace(){return this.path[this.path.length-1].name===`text()`}getMpdTarget(e,t){let n=null,r=e,i=1,o=`MPD`;for(;i<this.path.length&&r!==null;){n=r;let e=this.path[i];if(o=e.name,i!==this.path.length-1||!o.startsWith(`@`)&&o!==`text()`){let t=n[o]||[];if(t.length===0&&n[o]&&t.push(n[o]),e.position)r=t[e.position]||null;else if(e.attribute){let n=e.attribute;r=t.filter((e=>e[n.name]==n.value))[0]||null}else r=Array.isArray(t)?t[0]:t}i++}return r===null?null:o.startsWith(`@`)?{name:o.substring(1),leaf:r,target:r}:o===`text()`?{name:`__text`,leaf:r,target:r}:{name:o,leaf:r,target:t?n:r}}},Kr=class{constructor(e,t,n){this.action=e,this.xpath=t,this.value=n,this.position=null}getMpdTarget(e){let t=this.action===`remove`||this.action===`replace`||this.position===`before`||this.position===`after`;return this.xpath.getMpdTarget(e,t)}};function qr(){let e,t,n=this.context;return e={getIsPatch:function(e){return e&&e.hasOwnProperty(Y.default.ORIGINAL_MPD_ID)||!1},getMpdId:function(e){return e&&e[Y.default.ORIGINAL_MPD_ID]||null},getOriginalPublishTime:function(e){return e&&e.hasOwnProperty(Y.default.ORIGINAL_PUBLISH_TIME)?new Date(e[Y.default.ORIGINAL_PUBLISH_TIME]):null},getPatchOperations:function(e){return e?(e.__children||[]).map((e=>{let n=e.tagName;if(n!==`add`&&n!==`remove`&&n!==`replace`)return t.warn(`Ignoring node of invalid action: ${n}`),null;let r=e.sel;if(n===`add`&&e.type){if(!e.type.startsWith(`@`))return t.warn(`Ignoring add action for prefixed namespace declaration: ${e.type}=${e.__text}`),null;r=`${r}/${e.type}`}let i=new Gr(r);if(!i.isValid())return t.warn(`Ignoring action with invalid selector: ${n} - ${r}`),null;let o=null;i.findsAttribute()||i.findsTextReplace()?o=e.__text||``:n!==`remove`&&(o=e.__children.reduce(((e,t)=>{let n=t.tagName;return n!==`#text`&&(e[n]=e[n]||[],e[n].push(t)),e}),{}));let c=new Kr(n,i,o);return n===`add`&&(c.position=e.pos),c})).filter((e=>!!e)):[]},getPublishTime:function(e){return e&&e.hasOwnProperty(Y.default.PUBLISH_TIME)?new Date(e[Y.default.PUBLISH_TIME]):null}},t=(0,l.default)(n).getInstance().getLogger(e),e}qr.__dashjs_factory_name=`PatchManifestModel`;var Jr=i.default.getSingletonFactory(qr);function Yr(e={}){let t=[];if(e.irregular)return e.irregular;if(e.regular)return e.regular;if(e.language){t=t.concat(e.language,e.extendedLanguageSubtags||[],e.script||[],e.region||[],e.variants||[]);let n=e.extensions||[],r=-1;for(;++r<n.length;){let e=n[r];e.singleton&&e.extensions&&e.extensions.length>0&&t.push(e.singleton,...e.extensions)}}return e.privateuse&&e.privateuse.length>0&&t.push(`x`,...e.privateuse),t.join(`-`)}function Xr(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function Zr(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function Qr(e){return Xr(e)||Zr(e)}let $r=[`art-lojban`,`cel-gaulish`,`no-bok`,`no-nyn`,`zh-guoyu`,`zh-hakka`,`zh-min`,`zh-min-nan`,`zh-xiang`],ei={"en-gb-oed":`en-GB-oxendict`,"i-ami":`ami`,"i-bnn":`bnn`,"i-default":null,"i-enochian":null,"i-hak":`hak`,"i-klingon":`tlh`,"i-lux":`lb`,"i-mingo":null,"i-navajo":`nv`,"i-pwn":`pwn`,"i-tao":`tao`,"i-tay":`tay`,"i-tsu":`tsu`,"sgn-be-fr":`sfb`,"sgn-be-nl":`vgt`,"sgn-ch-de":`sgg`,"art-lojban":`jbo`,"cel-gaulish":null,"no-bok":`nb`,"no-nyn":`nn`,"zh-guoyu":`cmn`,"zh-hakka":`hak`,"zh-min":null,"zh-min-nan":`nan`,"zh-xiang":`hsn`},ti={}.hasOwnProperty;function ni(e,t={}){let n={language:null,extendedLanguageSubtags:[],script:null,region:null,variants:[],extensions:[],privateuse:[],irregular:null,regular:null},r=String(e),i=r.toLowerCase(),o=0;if(e==null)throw Error("Expected string, got `"+e+"`");if(ti.call(ei,i)){let e=ei[i];return t.normalize!==void 0&&t.normalize!==null&&!t.normalize||typeof e!=`string`?(n[$r.includes(i)?`regular`:`irregular`]=r,n):ni(e)}for(;Xr(i.charCodeAt(o))&&o<9;)o++;if(o>1&&o<9){if(n.language=r.slice(0,o),o<4){let e=0;for(;i.charCodeAt(o)===45&&Xr(i.charCodeAt(o+1))&&Xr(i.charCodeAt(o+2))&&Xr(i.charCodeAt(o+3))&&!Xr(i.charCodeAt(o+4));){if(e>2)return c(o,3,`Too many extended language subtags, expected at most 3 subtags`);n.extendedLanguageSubtags.push(r.slice(o+1,o+4)),o+=4,e++}}for(i.charCodeAt(o)===45&&Xr(i.charCodeAt(o+1))&&Xr(i.charCodeAt(o+2))&&Xr(i.charCodeAt(o+3))&&Xr(i.charCodeAt(o+4))&&!Xr(i.charCodeAt(o+5))&&(n.script=r.slice(o+1,o+5),o+=5),i.charCodeAt(o)===45&&(Xr(i.charCodeAt(o+1))&&Xr(i.charCodeAt(o+2))&&!Xr(i.charCodeAt(o+3))?(n.region=r.slice(o+1,o+3),o+=3):Zr(i.charCodeAt(o+1))&&Zr(i.charCodeAt(o+2))&&Zr(i.charCodeAt(o+3))&&!Zr(i.charCodeAt(o+4))&&(n.region=r.slice(o+1,o+4),o+=4));i.charCodeAt(o)===45;){let e=o+1,t=e;for(;Qr(i.charCodeAt(t));){if(t-e>7)return c(t,1,`Too long variant, expected at most 8 characters`);t++}if(!(t-e>4||t-e>3&&Zr(i.charCodeAt(e))))break;n.variants.push(r.slice(e,t)),o=t}for(;i.charCodeAt(o)===45&&i.charCodeAt(o+1)!==120&&Qr(i.charCodeAt(o+1))&&i.charCodeAt(o+2)===45&&Qr(i.charCodeAt(o+3));){let e=o+2,t=0;for(;i.charCodeAt(e)===45&&Qr(i.charCodeAt(e+1))&&Qr(i.charCodeAt(e+2));){let n=e+1;for(e=n+2,t++;Qr(i.charCodeAt(e));){if(e-n>7)return c(e,2,`Too long extension, expected at most 8 characters`);e++}}if(!t)return c(e,4,`Empty extension, extensions must have at least 2 characters of content`);n.extensions.push({singleton:r.charAt(o+1),extensions:r.slice(o+3,e).split(`-`)}),o=e}}else o=0;if(o===0&&i.charCodeAt(o)===120||i.charCodeAt(o)===45&&i.charCodeAt(o+1)===120){o=o?o+2:1;let e=o;for(;i.charCodeAt(e)===45&&Qr(i.charCodeAt(e+1));){let t=o+1;for(e=t;Qr(i.charCodeAt(e));){if(e-t>7)return c(e,5,`Too long private-use area, expected at most 8 characters`);e++}n.privateuse.push(r.slice(o+1,e)),o=e}}return o===r.length?n:c(o,6,`Found superfluous content after tag`);function c(e,r,i){return t.warning&&t.warning(i,r,e),t.forgiving?n:{language:null,extendedLanguageSubtags:[],script:null,region:null,variants:[],extensions:[],privateuse:[],irregular:null,regular:null}}}function ri(e,t){return function(n,r){let i=ai(n,`tag`),o=ai(r??`*`,`range`),c=[],l=-1;for(;++l<o.length;){let n=o[l].toLowerCase();if(!t&&n===`*`)continue;let r=-1,u=[];for(;++r<i.length;)if(e(i[r].toLowerCase(),n)){if(!t)return i[r];c.push(i[r])}else u.push(i[r]);i=u}return t?c:void 0}}let ii=ri((function(e,t){let n=e.split(`-`),r=t.split(`-`),i=0,o=0;if(r[o]!==`*`&&n[i]!==r[o])return!1;for(i++,o++;o<r.length;)if(r[o]!==`*`){if(!n[i])return!1;if(n[i]!==r[o]){if(n[i].length===1)return!1;i++}else i++,o++}else o++;return!0}),!0);function ai(e,t){let n=e&&typeof e==`string`?[e]:e;if(!n||typeof n!=`object`||!(`length`in n))throw Error(`Invalid `+t+" `"+n+"`, expected non-empty string");return n}let oi=[{from:`in`,to:`id`},{from:`iw`,to:`he`},{from:`ji`,to:`yi`},{from:`jw`,to:`jv`},{from:`mo`,to:`ro`},{from:`scc`,to:`sr`},{from:`scr`,to:`hr`},{from:`aam`,to:`aas`},{from:`adp`,to:`dz`},{from:`aue`,to:`ktz`},{from:`ayx`,to:`nun`},{from:`bgm`,to:`bcg`},{from:`bjd`,to:`drl`},{from:`ccq`,to:`rki`},{from:`cjr`,to:`mom`},{from:`cka`,to:`cmr`},{from:`cmk`,to:`xch`},{from:`coy`,to:`pij`},{from:`cqu`,to:`quh`},{from:`drh`,to:`mn`},{from:`drw`,to:`fa-af`},{from:`gav`,to:`dev`},{from:`gfx`,to:`vaj`},{from:`ggn`,to:`gvr`},{from:`gti`,to:`nyc`},{from:`guv`,to:`duz`},{from:`hrr`,to:`jal`},{from:`ibi`,to:`opa`},{from:`ilw`,to:`gal`},{from:`jeg`,to:`oyb`},{from:`kgc`,to:`tdf`},{from:`kgh`,to:`kml`},{from:`koj`,to:`kwv`},{from:`krm`,to:`bmf`},{from:`ktr`,to:`dtp`},{from:`kvs`,to:`gdj`},{from:`kwq`,to:`yam`},{from:`kxe`,to:`tvd`},{from:`kzj`,to:`dtp`},{from:`kzt`,to:`dtp`},{from:`lii`,to:`raq`},{from:`lmm`,to:`rmx`},{from:`meg`,to:`cir`},{from:`mst`,to:`mry`},{from:`mwj`,to:`vaj`},{from:`myt`,to:`mry`},{from:`nad`,to:`xny`},{from:`ncp`,to:`kdz`},{from:`nnx`,to:`ngv`},{from:`nts`,to:`pij`},{from:`oun`,to:`vaj`},{from:`pcr`,to:`adx`},{from:`pmc`,to:`huw`},{from:`pmu`,to:`phr`},{from:`ppa`,to:`bfy`},{from:`ppr`,to:`lcq`},{from:`pry`,to:`prt`},{from:`puz`,to:`pub`},{from:`sca`,to:`hle`},{from:`skk`,to:`oyb`},{from:`tdu`,to:`dtp`},{from:`thc`,to:`tpo`},{from:`thx`,to:`oyb`},{from:`tie`,to:`ras`},{from:`tkk`,to:`twm`},{from:`tlw`,to:`weo`},{from:`tmp`,to:`tyj`},{from:`tne`,to:`kak`},{from:`tnf`,to:`fa-af`},{from:`tsf`,to:`taj`},{from:`uok`,to:`ema`},{from:`xba`,to:`cax`},{from:`xia`,to:`acn`},{from:`xkh`,to:`waw`},{from:`xsj`,to:`suj`},{from:`ybd`,to:`rki`},{from:`yma`,to:`lrr`},{from:`ymt`,to:`mtm`},{from:`yos`,to:`zom`},{from:`yuu`,to:`yug`},{from:`asd`,to:`snz`},{from:`dit`,to:`dif`},{from:`llo`,to:`ngt`},{from:`myd`,to:`aog`},{from:`nns`,to:`nbr`},{from:`agp`,to:`apf`},{from:`ais`,to:`ami`},{from:`ajt`,to:`aeb`},{from:`baz`,to:`nvo`},{from:`bhk`,to:`fbl`},{from:`bic`,to:`bir`},{from:`bjq`,to:`bzc`},{from:`bkb`,to:`ebk`},{from:`blg`,to:`iba`},{from:`btb`,to:`beb`},{from:`daf`,to:`dnj`},{from:`dap`,to:`njz`},{from:`djl`,to:`dze`},{from:`dkl`,to:`aqd`},{from:`drr`,to:`kzk`},{from:`dud`,to:`uth`},{from:`duj`,to:`dwu`},{from:`dwl`,to:`dbt`},{from:`elp`,to:`amq`},{from:`gbc`,to:`wny`},{from:`ggo`,to:`esg`},{from:`ggr`,to:`gtu`},{from:`gio`,to:`aou`},{from:`gli`,to:`kzk`},{from:`ill`,to:`ilm`},{from:`izi`,to:`eza`},{from:`jar`,to:`jgk`},{from:`kdv`,to:`zkd`},{from:`kgd`,to:`ncq`},{from:`kpp`,to:`jkm`},{from:`kxl`,to:`kru`},{from:`kzh`,to:`dgl`},{from:`lak`,to:`ksp`},{from:`leg`,to:`enl`},{from:`mgx`,to:`jbk`},{from:`mnt`,to:`wnn`},{from:`mof`,to:`xnt`},{from:`mwd`,to:`dmw`},{from:`nbf`,to:`nru`},{from:`nbx`,to:`ekc`},{from:`nln`,to:`azd`},{from:`nlr`,to:`nrk`},{from:`noo`,to:`dtd`},{from:`nxu`,to:`bpp`},{from:`pat`,to:`kxr`},{from:`rmr`,to:`emx`},{from:`sap`,to:`aqt`},{from:`sgl`,to:`isk`},{from:`smd`,to:`kmb`},{from:`snb`,to:`iba`},{from:`sul`,to:`sgd`},{from:`sum`,to:`ulw`},{from:`tgg`,to:`bjp`},{from:`thw`,to:`ola`},{from:`tid`,to:`itd`},{from:`unp`,to:`wro`},{from:`wgw`,to:`wgb`},{from:`wit`,to:`nol`},{from:`wiw`,to:`nwo`},{from:`xrq`,to:`dmw`},{from:`yen`,to:`ynq`},{from:`yiy`,to:`yrm`},{from:`zir`,to:`scv`},{from:`sgn-br`,to:`bzs`},{from:`sgn-co`,to:`csn`},{from:`sgn-de`,to:`gsg`},{from:`sgn-dk`,to:`dsl`},{from:`sgn-fr`,to:`fsl`},{from:`sgn-gb`,to:`bfi`},{from:`sgn-gr`,to:`gss`},{from:`sgn-ie`,to:`isg`},{from:`sgn-it`,to:`ise`},{from:`sgn-jp`,to:`jsl`},{from:`sgn-mx`,to:`mfs`},{from:`sgn-ni`,to:`ncs`},{from:`sgn-nl`,to:`dse`},{from:`sgn-no`,to:`nsi`},{from:`sgn-pt`,to:`psr`},{from:`sgn-se`,to:`swl`},{from:`sgn-us`,to:`ase`},{from:`sgn-za`,to:`sfs`},{from:`sgn-es`,to:`ssp`},{from:`zh-cmn`,to:`zh`},{from:`zh-cmn-hans`,to:`zh-hans`},{from:`zh-cmn-hant`,to:`zh-hant`},{from:`zh-gan`,to:`gan`},{from:`zh-wuu`,to:`wuu`},{from:`zh-yue`,to:`yue`},{from:`no-bokmal`,to:`nb`},{from:`no-nynorsk`,to:`nn`},{from:`aa-saaho`,to:`ssy`},{from:`sh`,to:`sr-latn`},{from:`cnr`,to:`sr-me`},{from:`tl`,to:`fil`},{from:`aju`,to:`jrb`},{from:`als`,to:`sq`},{from:`arb`,to:`ar`},{from:`ayr`,to:`ay`},{from:`azj`,to:`az`},{from:`bcc`,to:`bal`},{from:`bcl`,to:`bik`},{from:`bxk`,to:`luy`},{from:`bxr`,to:`bua`},{from:`cld`,to:`syr`},{from:`cmn`,to:`zh`},{from:`cwd`,to:`cr`},{from:`dgo`,to:`doi`},{from:`dhd`,to:`mwr`},{from:`dik`,to:`din`},{from:`diq`,to:`zza`},{from:`lbk`,to:`bnc`},{from:`ekk`,to:`et`},{from:`emk`,to:`man`},{from:`esk`,to:`ik`},{from:`fat`,to:`ak`},{from:`fuc`,to:`ff`},{from:`gaz`,to:`om`},{from:`gbo`,to:`grb`},{from:`gno`,to:`gon`},{from:`gug`,to:`gn`},{from:`gya`,to:`gba`},{from:`hdn`,to:`hai`},{from:`hea`,to:`hmn`},{from:`ike`,to:`iu`},{from:`kmr`,to:`ku`},{from:`knc`,to:`kr`},{from:`kng`,to:`kg`},{from:`knn`,to:`kok`},{from:`kpv`,to:`kv`},{from:`lvs`,to:`lv`},{from:`mhr`,to:`chm`},{from:`mup`,to:`raj`},{from:`khk`,to:`mn`},{from:`npi`,to:`ne`},{from:`ojg`,to:`oj`},{from:`ory`,to:`or`},{from:`pbu`,to:`ps`},{from:`pes`,to:`fa`},{from:`plt`,to:`mg`},{from:`pnb`,to:`lah`},{from:`quz`,to:`qu`},{from:`rmy`,to:`rom`},{from:`spy`,to:`kln`},{from:`src`,to:`sc`},{from:`swh`,to:`sw`},{from:`ttq`,to:`tmh`},{from:`tw`,to:`ak`},{from:`umu`,to:`del`},{from:`uzn`,to:`uz`},{from:`xpe`,to:`kpe`},{from:`xsl`,to:`den`},{from:`ydd`,to:`yi`},{from:`zai`,to:`zap`},{from:`zsm`,to:`ms`},{from:`zyb`,to:`za`},{from:`him`,to:`srx`},{from:`mnk`,to:`man`},{from:`bh`,to:`bho`},{from:`prs`,to:`fa-af`},{from:`swc`,to:`sw-cd`},{from:`aar`,to:`aa`},{from:`abk`,to:`ab`},{from:`ave`,to:`ae`},{from:`afr`,to:`af`},{from:`aka`,to:`ak`},{from:`amh`,to:`am`},{from:`arg`,to:`an`},{from:`ara`,to:`ar`},{from:`asm`,to:`as`},{from:`ava`,to:`av`},{from:`aym`,to:`ay`},{from:`aze`,to:`az`},{from:`bak`,to:`ba`},{from:`bel`,to:`be`},{from:`bul`,to:`bg`},{from:`bih`,to:`bho`},{from:`bis`,to:`bi`},{from:`bam`,to:`bm`},{from:`ben`,to:`bn`},{from:`bod`,to:`bo`},{from:`bre`,to:`br`},{from:`bos`,to:`bs`},{from:`cat`,to:`ca`},{from:`che`,to:`ce`},{from:`cha`,to:`ch`},{from:`cos`,to:`co`},{from:`cre`,to:`cr`},{from:`ces`,to:`cs`},{from:`chu`,to:`cu`},{from:`chv`,to:`cv`},{from:`cym`,to:`cy`},{from:`dan`,to:`da`},{from:`deu`,to:`de`},{from:`div`,to:`dv`},{from:`dzo`,to:`dz`},{from:`ewe`,to:`ee`},{from:`ell`,to:`el`},{from:`eng`,to:`en`},{from:`epo`,to:`eo`},{from:`spa`,to:`es`},{from:`est`,to:`et`},{from:`eus`,to:`eu`},{from:`fas`,to:`fa`},{from:`ful`,to:`ff`},{from:`fin`,to:`fi`},{from:`fij`,to:`fj`},{from:`fao`,to:`fo`},{from:`fra`,to:`fr`},{from:`fry`,to:`fy`},{from:`gle`,to:`ga`},{from:`gla`,to:`gd`},{from:`glg`,to:`gl`},{from:`grn`,to:`gn`},{from:`guj`,to:`gu`},{from:`glv`,to:`gv`},{from:`hau`,to:`ha`},{from:`heb`,to:`he`},{from:`hin`,to:`hi`},{from:`hmo`,to:`ho`},{from:`hrv`,to:`hr`},{from:`hat`,to:`ht`},{from:`hun`,to:`hu`},{from:`hye`,to:`hy`},{from:`her`,to:`hz`},{from:`ina`,to:`ia`},{from:`ind`,to:`id`},{from:`ile`,to:`ie`},{from:`ibo`,to:`ig`},{from:`iii`,to:`ii`},{from:`ipk`,to:`ik`},{from:`ido`,to:`io`},{from:`isl`,to:`is`},{from:`ita`,to:`it`},{from:`iku`,to:`iu`},{from:`jpn`,to:`ja`},{from:`jav`,to:`jv`},{from:`kat`,to:`ka`},{from:`kon`,to:`kg`},{from:`kik`,to:`ki`},{from:`kua`,to:`kj`},{from:`kaz`,to:`kk`},{from:`kal`,to:`kl`},{from:`khm`,to:`km`},{from:`kan`,to:`kn`},{from:`kor`,to:`ko`},{from:`kau`,to:`kr`},{from:`kas`,to:`ks`},{from:`kur`,to:`ku`},{from:`kom`,to:`kv`},{from:`cor`,to:`kw`},{from:`kir`,to:`ky`},{from:`lat`,to:`la`},{from:`ltz`,to:`lb`},{from:`lug`,to:`lg`},{from:`lim`,to:`li`},{from:`lin`,to:`ln`},{from:`lao`,to:`lo`},{from:`lit`,to:`lt`},{from:`lub`,to:`lu`},{from:`lav`,to:`lv`},{from:`mlg`,to:`mg`},{from:`mah`,to:`mh`},{from:`mri`,to:`mi`},{from:`mkd`,to:`mk`},{from:`mal`,to:`ml`},{from:`mon`,to:`mn`},{from:`mol`,to:`ro`},{from:`mar`,to:`mr`},{from:`msa`,to:`ms`},{from:`mlt`,to:`mt`},{from:`mya`,to:`my`},{from:`nau`,to:`na`},{from:`nob`,to:`nb`},{from:`nde`,to:`nd`},{from:`nep`,to:`ne`},{from:`ndo`,to:`ng`},{from:`nld`,to:`nl`},{from:`nno`,to:`nn`},{from:`nor`,to:`no`},{from:`nbl`,to:`nr`},{from:`nav`,to:`nv`},{from:`nya`,to:`ny`},{from:`oci`,to:`oc`},{from:`oji`,to:`oj`},{from:`orm`,to:`om`},{from:`ori`,to:`or`},{from:`oss`,to:`os`},{from:`pan`,to:`pa`},{from:`pli`,to:`pi`},{from:`pol`,to:`pl`},{from:`pus`,to:`ps`},{from:`por`,to:`pt`},{from:`que`,to:`qu`},{from:`roh`,to:`rm`},{from:`run`,to:`rn`},{from:`ron`,to:`ro`},{from:`rus`,to:`ru`},{from:`kin`,to:`rw`},{from:`san`,to:`sa`},{from:`srd`,to:`sc`},{from:`snd`,to:`sd`},{from:`sme`,to:`se`},{from:`sag`,to:`sg`},{from:`hbs`,to:`sr-latn`},{from:`sin`,to:`si`},{from:`slk`,to:`sk`},{from:`slv`,to:`sl`},{from:`smo`,to:`sm`},{from:`sna`,to:`sn`},{from:`som`,to:`so`},{from:`sqi`,to:`sq`},{from:`srp`,to:`sr`},{from:`ssw`,to:`ss`},{from:`sot`,to:`st`},{from:`sun`,to:`su`},{from:`swe`,to:`sv`},{from:`swa`,to:`sw`},{from:`tam`,to:`ta`},{from:`tel`,to:`te`},{from:`tgk`,to:`tg`},{from:`tha`,to:`th`},{from:`tir`,to:`ti`},{from:`tuk`,to:`tk`},{from:`tgl`,to:`fil`},{from:`tsn`,to:`tn`},{from:`ton`,to:`to`},{from:`tur`,to:`tr`},{from:`tso`,to:`ts`},{from:`tat`,to:`tt`},{from:`twi`,to:`ak`},{from:`tah`,to:`ty`},{from:`uig`,to:`ug`},{from:`ukr`,to:`uk`},{from:`urd`,to:`ur`},{from:`uzb`,to:`uz`},{from:`ven`,to:`ve`},{from:`vie`,to:`vi`},{from:`vol`,to:`vo`},{from:`wln`,to:`wa`},{from:`wol`,to:`wo`},{from:`xho`,to:`xh`},{from:`yid`,to:`yi`},{from:`yor`,to:`yo`},{from:`zha`,to:`za`},{from:`zho`,to:`zh`},{from:`zul`,to:`zu`},{from:`alb`,to:`sq`},{from:`arm`,to:`hy`},{from:`baq`,to:`eu`},{from:`bur`,to:`my`},{from:`chi`,to:`zh`},{from:`cze`,to:`cs`},{from:`dut`,to:`nl`},{from:`fre`,to:`fr`},{from:`geo`,to:`ka`},{from:`ger`,to:`de`},{from:`gre`,to:`el`},{from:`ice`,to:`is`},{from:`mac`,to:`mk`},{from:`mao`,to:`mi`},{from:`may`,to:`ms`},{from:`per`,to:`fa`},{from:`rum`,to:`ro`},{from:`slo`,to:`sk`},{from:`tib`,to:`bo`},{from:`wel`,to:`cy`},{from:`und-aaland`,to:`und-ax`},{from:`hy-arevmda`,to:`hyw`},{from:`und-arevmda`,to:`und`},{from:`und-arevela`,to:`und`},{from:`und-lojban`,to:`und`},{from:`und-saaho`,to:`und`},{from:`und-bokmal`,to:`und`},{from:`und-nynorsk`,to:`und`},{from:`und-hakka`,to:`und`},{from:`und-xiang`,to:`und`},{from:`und-hepburn-heploc`,to:`und-alalc97`}],si=[{from:{field:`script`,value:`qaai`},to:{field:`script`,value:`zinh`}},{from:{field:`region`,value:`bu`},to:{field:`region`,value:`mm`}},{from:{field:`region`,value:`ct`},to:{field:`region`,value:`ki`}},{from:{field:`region`,value:`dd`},to:{field:`region`,value:`de`}},{from:{field:`region`,value:`dy`},to:{field:`region`,value:`bj`}},{from:{field:`region`,value:`fx`},to:{field:`region`,value:`fr`}},{from:{field:`region`,value:`hv`},to:{field:`region`,value:`bf`}},{from:{field:`region`,value:`jt`},to:{field:`region`,value:`um`}},{from:{field:`region`,value:`mi`},to:{field:`region`,value:`um`}},{from:{field:`region`,value:`nh`},to:{field:`region`,value:`vu`}},{from:{field:`region`,value:`nq`},to:{field:`region`,value:`aq`}},{from:{field:`region`,value:`pu`},to:{field:`region`,value:`um`}},{from:{field:`region`,value:`pz`},to:{field:`region`,value:`pa`}},{from:{field:`region`,value:`qu`},to:{field:`region`,value:`eu`}},{from:{field:`region`,value:`rh`},to:{field:`region`,value:`zw`}},{from:{field:`region`,value:`tp`},to:{field:`region`,value:`tl`}},{from:{field:`region`,value:`uk`},to:{field:`region`,value:`gb`}},{from:{field:`region`,value:`vd`},to:{field:`region`,value:`vn`}},{from:{field:`region`,value:`wk`},to:{field:`region`,value:`um`}},{from:{field:`region`,value:`yd`},to:{field:`region`,value:`ye`}},{from:{field:`region`,value:`zr`},to:{field:`region`,value:`cd`}},{from:{field:`region`,value:`230`},to:{field:`region`,value:`et`}},{from:{field:`region`,value:`280`},to:{field:`region`,value:`de`}},{from:{field:`region`,value:`736`},to:{field:`region`,value:`sd`}},{from:{field:`region`,value:`886`},to:{field:`region`,value:`ye`}},{from:{field:`region`,value:`958`},to:{field:`region`,value:`aa`}},{from:{field:`region`,value:`020`},to:{field:`region`,value:`ad`}},{from:{field:`region`,value:`784`},to:{field:`region`,value:`ae`}},{from:{field:`region`,value:`004`},to:{field:`region`,value:`af`}},{from:{field:`region`,value:`028`},to:{field:`region`,value:`ag`}},{from:{field:`region`,value:`660`},to:{field:`region`,value:`ai`}},{from:{field:`region`,value:`008`},to:{field:`region`,value:`al`}},{from:{field:`region`,value:`051`},to:{field:`region`,value:`am`}},{from:{field:`region`,value:`024`},to:{field:`region`,value:`ao`}},{from:{field:`region`,value:`010`},to:{field:`region`,value:`aq`}},{from:{field:`region`,value:`032`},to:{field:`region`,value:`ar`}},{from:{field:`region`,value:`016`},to:{field:`region`,value:`as`}},{from:{field:`region`,value:`040`},to:{field:`region`,value:`at`}},{from:{field:`region`,value:`036`},to:{field:`region`,value:`au`}},{from:{field:`region`,value:`533`},to:{field:`region`,value:`aw`}},{from:{field:`region`,value:`248`},to:{field:`region`,value:`ax`}},{from:{field:`region`,value:`031`},to:{field:`region`,value:`az`}},{from:{field:`region`,value:`070`},to:{field:`region`,value:`ba`}},{from:{field:`region`,value:`052`},to:{field:`region`,value:`bb`}},{from:{field:`region`,value:`050`},to:{field:`region`,value:`bd`}},{from:{field:`region`,value:`056`},to:{field:`region`,value:`be`}},{from:{field:`region`,value:`854`},to:{field:`region`,value:`bf`}},{from:{field:`region`,value:`100`},to:{field:`region`,value:`bg`}},{from:{field:`region`,value:`048`},to:{field:`region`,value:`bh`}},{from:{field:`region`,value:`108`},to:{field:`region`,value:`bi`}},{from:{field:`region`,value:`204`},to:{field:`region`,value:`bj`}},{from:{field:`region`,value:`652`},to:{field:`region`,value:`bl`}},{from:{field:`region`,value:`060`},to:{field:`region`,value:`bm`}},{from:{field:`region`,value:`096`},to:{field:`region`,value:`bn`}},{from:{field:`region`,value:`068`},to:{field:`region`,value:`bo`}},{from:{field:`region`,value:`535`},to:{field:`region`,value:`bq`}},{from:{field:`region`,value:`076`},to:{field:`region`,value:`br`}},{from:{field:`region`,value:`044`},to:{field:`region`,value:`bs`}},{from:{field:`region`,value:`064`},to:{field:`region`,value:`bt`}},{from:{field:`region`,value:`104`},to:{field:`region`,value:`mm`}},{from:{field:`region`,value:`074`},to:{field:`region`,value:`bv`}},{from:{field:`region`,value:`072`},to:{field:`region`,value:`bw`}},{from:{field:`region`,value:`112`},to:{field:`region`,value:`by`}},{from:{field:`region`,value:`084`},to:{field:`region`,value:`bz`}},{from:{field:`region`,value:`124`},to:{field:`region`,value:`ca`}},{from:{field:`region`,value:`166`},to:{field:`region`,value:`cc`}},{from:{field:`region`,value:`180`},to:{field:`region`,value:`cd`}},{from:{field:`region`,value:`140`},to:{field:`region`,value:`cf`}},{from:{field:`region`,value:`178`},to:{field:`region`,value:`cg`}},{from:{field:`region`,value:`756`},to:{field:`region`,value:`ch`}},{from:{field:`region`,value:`384`},to:{field:`region`,value:`ci`}},{from:{field:`region`,value:`184`},to:{field:`region`,value:`ck`}},{from:{field:`region`,value:`152`},to:{field:`region`,value:`cl`}},{from:{field:`region`,value:`120`},to:{field:`region`,value:`cm`}},{from:{field:`region`,value:`156`},to:{field:`region`,value:`cn`}},{from:{field:`region`,value:`170`},to:{field:`region`,value:`co`}},{from:{field:`region`,value:`188`},to:{field:`region`,value:`cr`}},{from:{field:`region`,value:`192`},to:{field:`region`,value:`cu`}},{from:{field:`region`,value:`132`},to:{field:`region`,value:`cv`}},{from:{field:`region`,value:`531`},to:{field:`region`,value:`cw`}},{from:{field:`region`,value:`162`},to:{field:`region`,value:`cx`}},{from:{field:`region`,value:`196`},to:{field:`region`,value:`cy`}},{from:{field:`region`,value:`203`},to:{field:`region`,value:`cz`}},{from:{field:`region`,value:`278`},to:{field:`region`,value:`de`}},{from:{field:`region`,value:`276`},to:{field:`region`,value:`de`}},{from:{field:`region`,value:`262`},to:{field:`region`,value:`dj`}},{from:{field:`region`,value:`208`},to:{field:`region`,value:`dk`}},{from:{field:`region`,value:`212`},to:{field:`region`,value:`dm`}},{from:{field:`region`,value:`214`},to:{field:`region`,value:`do`}},{from:{field:`region`,value:`012`},to:{field:`region`,value:`dz`}},{from:{field:`region`,value:`218`},to:{field:`region`,value:`ec`}},{from:{field:`region`,value:`233`},to:{field:`region`,value:`ee`}},{from:{field:`region`,value:`818`},to:{field:`region`,value:`eg`}},{from:{field:`region`,value:`732`},to:{field:`region`,value:`eh`}},{from:{field:`region`,value:`232`},to:{field:`region`,value:`er`}},{from:{field:`region`,value:`724`},to:{field:`region`,value:`es`}},{from:{field:`region`,value:`231`},to:{field:`region`,value:`et`}},{from:{field:`region`,value:`246`},to:{field:`region`,value:`fi`}},{from:{field:`region`,value:`242`},to:{field:`region`,value:`fj`}},{from:{field:`region`,value:`238`},to:{field:`region`,value:`fk`}},{from:{field:`region`,value:`583`},to:{field:`region`,value:`fm`}},{from:{field:`region`,value:`234`},to:{field:`region`,value:`fo`}},{from:{field:`region`,value:`250`},to:{field:`region`,value:`fr`}},{from:{field:`region`,value:`249`},to:{field:`region`,value:`fr`}},{from:{field:`region`,value:`266`},to:{field:`region`,value:`ga`}},{from:{field:`region`,value:`826`},to:{field:`region`,value:`gb`}},{from:{field:`region`,value:`308`},to:{field:`region`,value:`gd`}},{from:{field:`region`,value:`268`},to:{field:`region`,value:`ge`}},{from:{field:`region`,value:`254`},to:{field:`region`,value:`gf`}},{from:{field:`region`,value:`831`},to:{field:`region`,value:`gg`}},{from:{field:`region`,value:`288`},to:{field:`region`,value:`gh`}},{from:{field:`region`,value:`292`},to:{field:`region`,value:`gi`}},{from:{field:`region`,value:`304`},to:{field:`region`,value:`gl`}},{from:{field:`region`,value:`270`},to:{field:`region`,value:`gm`}},{from:{field:`region`,value:`324`},to:{field:`region`,value:`gn`}},{from:{field:`region`,value:`312`},to:{field:`region`,value:`gp`}},{from:{field:`region`,value:`226`},to:{field:`region`,value:`gq`}},{from:{field:`region`,value:`300`},to:{field:`region`,value:`gr`}},{from:{field:`region`,value:`239`},to:{field:`region`,value:`gs`}},{from:{field:`region`,value:`320`},to:{field:`region`,value:`gt`}},{from:{field:`region`,value:`316`},to:{field:`region`,value:`gu`}},{from:{field:`region`,value:`624`},to:{field:`region`,value:`gw`}},{from:{field:`region`,value:`328`},to:{field:`region`,value:`gy`}},{from:{field:`region`,value:`344`},to:{field:`region`,value:`hk`}},{from:{field:`region`,value:`334`},to:{field:`region`,value:`hm`}},{from:{field:`region`,value:`340`},to:{field:`region`,value:`hn`}},{from:{field:`region`,value:`191`},to:{field:`region`,value:`hr`}},{from:{field:`region`,value:`332`},to:{field:`region`,value:`ht`}},{from:{field:`region`,value:`348`},to:{field:`region`,value:`hu`}},{from:{field:`region`,value:`360`},to:{field:`region`,value:`id`}},{from:{field:`region`,value:`372`},to:{field:`region`,value:`ie`}},{from:{field:`region`,value:`376`},to:{field:`region`,value:`il`}},{from:{field:`region`,value:`833`},to:{field:`region`,value:`im`}},{from:{field:`region`,value:`356`},to:{field:`region`,value:`in`}},{from:{field:`region`,value:`086`},to:{field:`region`,value:`io`}},{from:{field:`region`,value:`368`},to:{field:`region`,value:`iq`}},{from:{field:`region`,value:`364`},to:{field:`region`,value:`ir`}},{from:{field:`region`,value:`352`},to:{field:`region`,value:`is`}},{from:{field:`region`,value:`380`},to:{field:`region`,value:`it`}},{from:{field:`region`,value:`832`},to:{field:`region`,value:`je`}},{from:{field:`region`,value:`388`},to:{field:`region`,value:`jm`}},{from:{field:`region`,value:`400`},to:{field:`region`,value:`jo`}},{from:{field:`region`,value:`392`},to:{field:`region`,value:`jp`}},{from:{field:`region`,value:`404`},to:{field:`region`,value:`ke`}},{from:{field:`region`,value:`417`},to:{field:`region`,value:`kg`}},{from:{field:`region`,value:`116`},to:{field:`region`,value:`kh`}},{from:{field:`region`,value:`296`},to:{field:`region`,value:`ki`}},{from:{field:`region`,value:`174`},to:{field:`region`,value:`km`}},{from:{field:`region`,value:`659`},to:{field:`region`,value:`kn`}},{from:{field:`region`,value:`408`},to:{field:`region`,value:`kp`}},{from:{field:`region`,value:`410`},to:{field:`region`,value:`kr`}},{from:{field:`region`,value:`414`},to:{field:`region`,value:`kw`}},{from:{field:`region`,value:`136`},to:{field:`region`,value:`ky`}},{from:{field:`region`,value:`398`},to:{field:`region`,value:`kz`}},{from:{field:`region`,value:`418`},to:{field:`region`,value:`la`}},{from:{field:`region`,value:`422`},to:{field:`region`,value:`lb`}},{from:{field:`region`,value:`662`},to:{field:`region`,value:`lc`}},{from:{field:`region`,value:`438`},to:{field:`region`,value:`li`}},{from:{field:`region`,value:`144`},to:{field:`region`,value:`lk`}},{from:{field:`region`,value:`430`},to:{field:`region`,value:`lr`}},{from:{field:`region`,value:`426`},to:{field:`region`,value:`ls`}},{from:{field:`region`,value:`440`},to:{field:`region`,value:`lt`}},{from:{field:`region`,value:`442`},to:{field:`region`,value:`lu`}},{from:{field:`region`,value:`428`},to:{field:`region`,value:`lv`}},{from:{field:`region`,value:`434`},to:{field:`region`,value:`ly`}},{from:{field:`region`,value:`504`},to:{field:`region`,value:`ma`}},{from:{field:`region`,value:`492`},to:{field:`region`,value:`mc`}},{from:{field:`region`,value:`498`},to:{field:`region`,value:`md`}},{from:{field:`region`,value:`499`},to:{field:`region`,value:`me`}},{from:{field:`region`,value:`663`},to:{field:`region`,value:`mf`}},{from:{field:`region`,value:`450`},to:{field:`region`,value:`mg`}},{from:{field:`region`,value:`584`},to:{field:`region`,value:`mh`}},{from:{field:`region`,value:`807`},to:{field:`region`,value:`mk`}},{from:{field:`region`,value:`466`},to:{field:`region`,value:`ml`}},{from:{field:`region`,value:`496`},to:{field:`region`,value:`mn`}},{from:{field:`region`,value:`446`},to:{field:`region`,value:`mo`}},{from:{field:`region`,value:`580`},to:{field:`region`,value:`mp`}},{from:{field:`region`,value:`474`},to:{field:`region`,value:`mq`}},{from:{field:`region`,value:`478`},to:{field:`region`,value:`mr`}},{from:{field:`region`,value:`500`},to:{field:`region`,value:`ms`}},{from:{field:`region`,value:`470`},to:{field:`region`,value:`mt`}},{from:{field:`region`,value:`480`},to:{field:`region`,value:`mu`}},{from:{field:`region`,value:`462`},to:{field:`region`,value:`mv`}},{from:{field:`region`,value:`454`},to:{field:`region`,value:`mw`}},{from:{field:`region`,value:`484`},to:{field:`region`,value:`mx`}},{from:{field:`region`,value:`458`},to:{field:`region`,value:`my`}},{from:{field:`region`,value:`508`},to:{field:`region`,value:`mz`}},{from:{field:`region`,value:`516`},to:{field:`region`,value:`na`}},{from:{field:`region`,value:`540`},to:{field:`region`,value:`nc`}},{from:{field:`region`,value:`562`},to:{field:`region`,value:`ne`}},{from:{field:`region`,value:`574`},to:{field:`region`,value:`nf`}},{from:{field:`region`,value:`566`},to:{field:`region`,value:`ng`}},{from:{field:`region`,value:`558`},to:{field:`region`,value:`ni`}},{from:{field:`region`,value:`528`},to:{field:`region`,value:`nl`}},{from:{field:`region`,value:`578`},to:{field:`region`,value:`no`}},{from:{field:`region`,value:`524`},to:{field:`region`,value:`np`}},{from:{field:`region`,value:`520`},to:{field:`region`,value:`nr`}},{from:{field:`region`,value:`570`},to:{field:`region`,value:`nu`}},{from:{field:`region`,value:`554`},to:{field:`region`,value:`nz`}},{from:{field:`region`,value:`512`},to:{field:`region`,value:`om`}},{from:{field:`region`,value:`591`},to:{field:`region`,value:`pa`}},{from:{field:`region`,value:`604`},to:{field:`region`,value:`pe`}},{from:{field:`region`,value:`258`},to:{field:`region`,value:`pf`}},{from:{field:`region`,value:`598`},to:{field:`region`,value:`pg`}},{from:{field:`region`,value:`608`},to:{field:`region`,value:`ph`}},{from:{field:`region`,value:`586`},to:{field:`region`,value:`pk`}},{from:{field:`region`,value:`616`},to:{field:`region`,value:`pl`}},{from:{field:`region`,value:`666`},to:{field:`region`,value:`pm`}},{from:{field:`region`,value:`612`},to:{field:`region`,value:`pn`}},{from:{field:`region`,value:`630`},to:{field:`region`,value:`pr`}},{from:{field:`region`,value:`275`},to:{field:`region`,value:`ps`}},{from:{field:`region`,value:`620`},to:{field:`region`,value:`pt`}},{from:{field:`region`,value:`585`},to:{field:`region`,value:`pw`}},{from:{field:`region`,value:`600`},to:{field:`region`,value:`py`}},{from:{field:`region`,value:`634`},to:{field:`region`,value:`qa`}},{from:{field:`region`,value:`959`},to:{field:`region`,value:`qm`}},{from:{field:`region`,value:`960`},to:{field:`region`,value:`qn`}},{from:{field:`region`,value:`962`},to:{field:`region`,value:`qp`}},{from:{field:`region`,value:`963`},to:{field:`region`,value:`qq`}},{from:{field:`region`,value:`964`},to:{field:`region`,value:`qr`}},{from:{field:`region`,value:`965`},to:{field:`region`,value:`qs`}},{from:{field:`region`,value:`966`},to:{field:`region`,value:`qt`}},{from:{field:`region`,value:`967`},to:{field:`region`,value:`eu`}},{from:{field:`region`,value:`968`},to:{field:`region`,value:`qv`}},{from:{field:`region`,value:`969`},to:{field:`region`,value:`qw`}},{from:{field:`region`,value:`970`},to:{field:`region`,value:`qx`}},{from:{field:`region`,value:`971`},to:{field:`region`,value:`qy`}},{from:{field:`region`,value:`972`},to:{field:`region`,value:`qz`}},{from:{field:`region`,value:`638`},to:{field:`region`,value:`re`}},{from:{field:`region`,value:`642`},to:{field:`region`,value:`ro`}},{from:{field:`region`,value:`688`},to:{field:`region`,value:`rs`}},{from:{field:`region`,value:`643`},to:{field:`region`,value:`ru`}},{from:{field:`region`,value:`646`},to:{field:`region`,value:`rw`}},{from:{field:`region`,value:`682`},to:{field:`region`,value:`sa`}},{from:{field:`region`,value:`090`},to:{field:`region`,value:`sb`}},{from:{field:`region`,value:`690`},to:{field:`region`,value:`sc`}},{from:{field:`region`,value:`729`},to:{field:`region`,value:`sd`}},{from:{field:`region`,value:`752`},to:{field:`region`,value:`se`}},{from:{field:`region`,value:`702`},to:{field:`region`,value:`sg`}},{from:{field:`region`,value:`654`},to:{field:`region`,value:`sh`}},{from:{field:`region`,value:`705`},to:{field:`region`,value:`si`}},{from:{field:`region`,value:`744`},to:{field:`region`,value:`sj`}},{from:{field:`region`,value:`703`},to:{field:`region`,value:`sk`}},{from:{field:`region`,value:`694`},to:{field:`region`,value:`sl`}},{from:{field:`region`,value:`674`},to:{field:`region`,value:`sm`}},{from:{field:`region`,value:`686`},to:{field:`region`,value:`sn`}},{from:{field:`region`,value:`706`},to:{field:`region`,value:`so`}},{from:{field:`region`,value:`740`},to:{field:`region`,value:`sr`}},{from:{field:`region`,value:`728`},to:{field:`region`,value:`ss`}},{from:{field:`region`,value:`678`},to:{field:`region`,value:`st`}},{from:{field:`region`,value:`222`},to:{field:`region`,value:`sv`}},{from:{field:`region`,value:`534`},to:{field:`region`,value:`sx`}},{from:{field:`region`,value:`760`},to:{field:`region`,value:`sy`}},{from:{field:`region`,value:`748`},to:{field:`region`,value:`sz`}},{from:{field:`region`,value:`796`},to:{field:`region`,value:`tc`}},{from:{field:`region`,value:`148`},to:{field:`region`,value:`td`}},{from:{field:`region`,value:`260`},to:{field:`region`,value:`tf`}},{from:{field:`region`,value:`768`},to:{field:`region`,value:`tg`}},{from:{field:`region`,value:`764`},to:{field:`region`,value:`th`}},{from:{field:`region`,value:`762`},to:{field:`region`,value:`tj`}},{from:{field:`region`,value:`772`},to:{field:`region`,value:`tk`}},{from:{field:`region`,value:`626`},to:{field:`region`,value:`tl`}},{from:{field:`region`,value:`795`},to:{field:`region`,value:`tm`}},{from:{field:`region`,value:`788`},to:{field:`region`,value:`tn`}},{from:{field:`region`,value:`776`},to:{field:`region`,value:`to`}},{from:{field:`region`,value:`792`},to:{field:`region`,value:`tr`}},{from:{field:`region`,value:`780`},to:{field:`region`,value:`tt`}},{from:{field:`region`,value:`798`},to:{field:`region`,value:`tv`}},{from:{field:`region`,value:`158`},to:{field:`region`,value:`tw`}},{from:{field:`region`,value:`834`},to:{field:`region`,value:`tz`}},{from:{field:`region`,value:`804`},to:{field:`region`,value:`ua`}},{from:{field:`region`,value:`800`},to:{field:`region`,value:`ug`}},{from:{field:`region`,value:`581`},to:{field:`region`,value:`um`}},{from:{field:`region`,value:`840`},to:{field:`region`,value:`us`}},{from:{field:`region`,value:`858`},to:{field:`region`,value:`uy`}},{from:{field:`region`,value:`860`},to:{field:`region`,value:`uz`}},{from:{field:`region`,value:`336`},to:{field:`region`,value:`va`}},{from:{field:`region`,value:`670`},to:{field:`region`,value:`vc`}},{from:{field:`region`,value:`862`},to:{field:`region`,value:`ve`}},{from:{field:`region`,value:`092`},to:{field:`region`,value:`vg`}},{from:{field:`region`,value:`850`},to:{field:`region`,value:`vi`}},{from:{field:`region`,value:`704`},to:{field:`region`,value:`vn`}},{from:{field:`region`,value:`548`},to:{field:`region`,value:`vu`}},{from:{field:`region`,value:`876`},to:{field:`region`,value:`wf`}},{from:{field:`region`,value:`882`},to:{field:`region`,value:`ws`}},{from:{field:`region`,value:`973`},to:{field:`region`,value:`xa`}},{from:{field:`region`,value:`974`},to:{field:`region`,value:`xb`}},{from:{field:`region`,value:`975`},to:{field:`region`,value:`xc`}},{from:{field:`region`,value:`976`},to:{field:`region`,value:`xd`}},{from:{field:`region`,value:`977`},to:{field:`region`,value:`xe`}},{from:{field:`region`,value:`978`},to:{field:`region`,value:`xf`}},{from:{field:`region`,value:`979`},to:{field:`region`,value:`xg`}},{from:{field:`region`,value:`980`},to:{field:`region`,value:`xh`}},{from:{field:`region`,value:`981`},to:{field:`region`,value:`xi`}},{from:{field:`region`,value:`982`},to:{field:`region`,value:`xj`}},{from:{field:`region`,value:`983`},to:{field:`region`,value:`xk`}},{from:{field:`region`,value:`984`},to:{field:`region`,value:`xl`}},{from:{field:`region`,value:`985`},to:{field:`region`,value:`xm`}},{from:{field:`region`,value:`986`},to:{field:`region`,value:`xn`}},{from:{field:`region`,value:`987`},to:{field:`region`,value:`xo`}},{from:{field:`region`,value:`988`},to:{field:`region`,value:`xp`}},{from:{field:`region`,value:`989`},to:{field:`region`,value:`xq`}},{from:{field:`region`,value:`990`},to:{field:`region`,value:`xr`}},{from:{field:`region`,value:`991`},to:{field:`region`,value:`xs`}},{from:{field:`region`,value:`992`},to:{field:`region`,value:`xt`}},{from:{field:`region`,value:`993`},to:{field:`region`,value:`xu`}},{from:{field:`region`,value:`994`},to:{field:`region`,value:`xv`}},{from:{field:`region`,value:`995`},to:{field:`region`,value:`xw`}},{from:{field:`region`,value:`996`},to:{field:`region`,value:`xx`}},{from:{field:`region`,value:`997`},to:{field:`region`,value:`xy`}},{from:{field:`region`,value:`998`},to:{field:`region`,value:`xz`}},{from:{field:`region`,value:`720`},to:{field:`region`,value:`ye`}},{from:{field:`region`,value:`887`},to:{field:`region`,value:`ye`}},{from:{field:`region`,value:`175`},to:{field:`region`,value:`yt`}},{from:{field:`region`,value:`710`},to:{field:`region`,value:`za`}},{from:{field:`region`,value:`894`},to:{field:`region`,value:`zm`}},{from:{field:`region`,value:`716`},to:{field:`region`,value:`zw`}},{from:{field:`region`,value:`999`},to:{field:`region`,value:`zz`}},{from:{field:`variants`,value:`polytoni`},to:{field:`variants`,value:`polyton`}},{from:{field:`variants`,value:`heploc`},to:{field:`variants`,value:`alalc97`}}],ci={region:{172:[`ru`,`am`,`az`,`by`,`ge`,`kg`,`kz`,`md`,`tj`,`tm`,`ua`,`uz`],200:[`cz`,`sk`],530:[`cw`,`sx`,`bq`],532:[`cw`,`sx`,`bq`],536:[`sa`,`iq`],582:[`fm`,`mh`,`mp`,`pw`],810:[`ru`,`am`,`az`,`by`,`ee`,`ge`,`kz`,`kg`,`lv`,`lt`,`md`,`tj`,`tm`,`ua`,`uz`],830:[`je`,`gg`],890:[`rs`,`me`,`si`,`hr`,`mk`,`ba`],891:[`rs`,`me`],an:[`cw`,`sx`,`bq`],cs:[`rs`,`me`],fq:[`aq`,`tf`],nt:[`sa`,`iq`],pc:[`fm`,`mh`,`mp`,`pw`],su:[`ru`,`am`,`az`,`by`,`ee`,`ge`,`kz`,`kg`,`lv`,`lt`,`md`,`tj`,`tm`,`ua`,`uz`],yu:[`rs`,`me`],"062":[`034`,`143`],ant:[`cw`,`sx`,`bq`],scg:[`rs`,`me`],ntz:[`sa`,`iq`],sun:[`ru`,`am`,`az`,`by`,`ee`,`ge`,`kz`,`kg`,`lv`,`lt`,`md`,`tj`,`tm`,`ua`,`uz`],yug:[`rs`,`me`]}},li={aa:`aa-latn-et`,aaa:`aaa-latn-ng`,aab:`aab-latn-ng`,aac:`aac-latn-pg`,aad:`aad-latn-pg`,aae:`aae-latn-it`,"aae-grek":`aae-grek-it`,aaf:`aaf-mlym-in`,"aaf-arab":`aaf-arab-in`,aag:`aag-latn-pg`,aah:`aah-latn-pg`,aai:`aai-latn-zz`,aak:`aak-latn-zz`,aal:`aal-latn-cm`,aan:`aan-latn-br`,aao:`aao-arab-dz`,aap:`aap-latn-br`,aaq:`aaq-latn-us`,aas:`aas-latn-tz`,aat:`aat-grek-gr`,aau:`aau-latn-zz`,aaw:`aaw-latn-pg`,aax:`aax-latn-id`,aaz:`aaz-latn-id`,ab:`ab-cyrl-ge`,aba:`aba-latn-ci`,abb:`abb-latn-cm`,abc:`abc-latn-ph`,abd:`abd-latn-ph`,abe:`abe-latn-ca`,abf:`abf-latn-my`,abg:`abg-latn-pg`,abh:`abh-arab-tj`,abi:`abi-latn-zz`,abl:`abl-rjng-id`,"abl-latn":`abl-latn-id`,abm:`abm-latn-ng`,abn:`abn-latn-ng`,abo:`abo-latn-ng`,abp:`abp-latn-ph`,abq:`abq-cyrl-zz`,abr:`abr-latn-gh`,abs:`abs-latn-id`,abt:`abt-latn-zz`,abu:`abu-latn-ci`,abv:`abv-arab-bh`,abw:`abw-latn-pg`,abx:`abx-latn-ph`,aby:`aby-latn-zz`,abz:`abz-latn-id`,aca:`aca-latn-co`,acb:`acb-latn-ng`,acd:`acd-latn-zz`,ace:`ace-latn-id`,acf:`acf-latn-lc`,ach:`ach-latn-ug`,acm:`acm-arab-iq`,acn:`acn-latn-cn`,acp:`acp-latn-ng`,acq:`acq-arab-ye`,acr:`acr-latn-gt`,acs:`acs-latn-br`,act:`act-latn-nl`,acu:`acu-latn-ec`,acv:`acv-latn-us`,acw:`acw-arab-sa`,acx:`acx-arab-om`,acy:`acy-latn-cy`,"acy-arab":`acy-arab-cy`,"acy-grek":`acy-grek-cy`,acz:`acz-latn-sd`,ada:`ada-latn-gh`,adb:`adb-latn-tl`,add:`add-latn-cm`,ade:`ade-latn-zz`,adf:`adf-arab-om`,adg:`adg-latn-au`,adh:`adh-latn-ug`,adi:`adi-latn-in`,"adi-tibt":`adi-tibt-cn`,adj:`adj-latn-zz`,adl:`adl-latn-in`,adn:`adn-latn-id`,ado:`ado-latn-pg`,adp:`adp-tibt-bt`,adq:`adq-latn-gh`,adr:`adr-latn-id`,adt:`adt-latn-au`,adu:`adu-latn-ng`,adw:`adw-latn-br`,adx:`adx-tibt-cn`,ady:`ady-cyrl-ru`,adz:`adz-latn-zz`,ae:`ae-avst-ir`,aea:`aea-latn-au`,aeb:`aeb-arab-tn`,aec:`aec-arab-eg`,aee:`aee-arab-af`,aek:`aek-latn-nc`,ael:`ael-latn-cm`,aem:`aem-latn-vn`,aeq:`aeq-arab-pk`,aer:`aer-latn-au`,aeu:`aeu-latn-cn`,aew:`aew-latn-pg`,aey:`aey-latn-zz`,aez:`aez-latn-pg`,af:`af-latn-za`,afb:`afb-arab-kw`,afd:`afd-latn-pg`,afe:`afe-latn-ng`,afh:`afh-latn-gh`,afi:`afi-latn-pg`,afk:`afk-latn-pg`,afn:`afn-latn-ng`,afo:`afo-latn-ng`,afp:`afp-latn-pg`,afs:`afs-latn-mx`,afu:`afu-latn-gh`,afz:`afz-latn-id`,aga:`aga-latn-pe`,agb:`agb-latn-ng`,agc:`agc-latn-zz`,agd:`agd-latn-zz`,age:`age-latn-pg`,agf:`agf-latn-id`,agg:`agg-latn-zz`,agh:`agh-latn-cd`,agi:`agi-deva-in`,agj:`agj-ethi-et`,"agj-arab":`agj-arab-et`,agk:`agk-latn-ph`,agl:`agl-latn-pg`,agm:`agm-latn-zz`,agn:`agn-latn-ph`,ago:`ago-latn-zz`,agq:`agq-latn-cm`,agr:`agr-latn-pe`,ags:`ags-latn-cm`,agt:`agt-latn-ph`,agu:`agu-latn-gt`,agv:`agv-latn-ph`,agw:`agw-latn-sb`,agx:`agx-cyrl-ru`,agy:`agy-latn-ph`,agz:`agz-latn-ph`,aha:`aha-latn-zz`,ahb:`ahb-latn-vu`,ahg:`ahg-ethi-et`,ahh:`ahh-latn-id`,ahi:`ahi-latn-ci`,ahk:`ahk-latn-mm`,"ahk-mymr":`ahk-mymr-mm`,"ahk-th":`ahk-latn-th`,"ahk-thai":`ahk-thai-th`,ahl:`ahl-latn-zz`,ahm:`ahm-latn-ci`,ahn:`ahn-latn-ng`,aho:`aho-ahom-in`,ahp:`ahp-latn-ci`,ahr:`ahr-deva-in`,ahs:`ahs-latn-ng`,aht:`aht-latn-us`,aia:`aia-latn-sb`,aib:`aib-arab-cn`,aic:`aic-latn-pg`,aid:`aid-latn-au`,aie:`aie-latn-pg`,aif:`aif-latn-pg`,aig:`aig-latn-ag`,aij:`aij-hebr-il`,aik:`aik-latn-ng`,ail:`ail-latn-pg`,aim:`aim-latn-in`,ain:`ain-kana-jp`,"ain-latn":`ain-latn-jp`,aio:`aio-mymr-in`,aip:`aip-latn-id`,aiq:`aiq-arab-af`,air:`air-latn-id`,ait:`ait-latn-br`,aiw:`aiw-latn-et`,"aiw-arab":`aiw-arab-et`,"aiw-ethi":`aiw-ethi-et`,aix:`aix-latn-pg`,aiy:`aiy-latn-cf`,aja:`aja-latn-ss`,ajg:`ajg-latn-zz`,aji:`aji-latn-nc`,ajn:`ajn-latn-au`,ajp:`ajp-arab-jo`,ajt:`ajt-arab-tn`,ajw:`ajw-latn-ng`,ajz:`ajz-latn-in`,ak:`ak-latn-gh`,akb:`akb-latn-id`,"akb-batk":`akb-batk-id`,akc:`akc-latn-id`,akd:`akd-latn-ng`,ake:`ake-latn-gy`,akf:`akf-latn-ng`,akg:`akg-latn-id`,akh:`akh-latn-pg`,aki:`aki-latn-pg`,akk:`akk-xsux-iq`,akl:`akl-latn-ph`,ako:`ako-latn-sr`,akp:`akp-latn-gh`,akq:`akq-latn-pg`,akr:`akr-latn-vu`,aks:`aks-latn-tg`,akt:`akt-latn-pg`,aku:`aku-latn-cm`,akv:`akv-cyrl-ru`,akw:`akw-latn-cg`,akz:`akz-latn-us`,ala:`ala-latn-zz`,alc:`alc-latn-cl`,ald:`ald-latn-ci`,ale:`ale-latn-us`,alf:`alf-latn-ng`,alh:`alh-latn-au`,ali:`ali-latn-zz`,alj:`alj-latn-ph`,alk:`alk-laoo-la`,all:`all-mlym-in`,alm:`alm-latn-vu`,aln:`aln-latn-xk`,alo:`alo-latn-id`,alp:`alp-latn-id`,alq:`alq-latn-ca`,alr:`alr-cyrl-ru`,alt:`alt-cyrl-ru`,alu:`alu-latn-sb`,alw:`alw-ethi-et`,alx:`alx-latn-pg`,aly:`aly-latn-au`,alz:`alz-latn-cd`,am:`am-ethi-et`,ama:`ama-latn-br`,amb:`amb-latn-ng`,amc:`amc-latn-pe`,ame:`ame-latn-pe`,amf:`amf-latn-et`,"amf-ethi":`amf-ethi-et`,amg:`amg-latn-au`,ami:`ami-latn-tw`,amj:`amj-latn-td`,amk:`amk-latn-id`,amm:`amm-latn-zz`,amn:`amn-latn-zz`,amo:`amo-latn-ng`,amp:`amp-latn-zz`,amq:`amq-latn-id`,amr:`amr-latn-pe`,ams:`ams-jpan-jp`,amt:`amt-latn-pg`,amu:`amu-latn-mx`,amv:`amv-latn-id`,amw:`amw-syrc-sy`,"amw-arab":`amw-arab-sy`,"amw-armi":`amw-armi-sy`,"amw-latn":`amw-latn-sy`,amx:`amx-latn-au`,amy:`amy-latn-au`,amz:`amz-latn-au`,an:`an-latn-es`,ana:`ana-latn-co`,anb:`anb-latn-pe`,anc:`anc-latn-zz`,and:`and-latn-id`,ane:`ane-latn-nc`,anf:`anf-latn-gh`,ang:`ang-latn-gb`,anh:`anh-latn-pg`,ani:`ani-cyrl-ru`,anj:`anj-latn-pg`,ank:`ank-latn-zz`,anl:`anl-latn-mm`,anm:`anm-latn-in`,ann:`ann-latn-ng`,ano:`ano-latn-co`,anp:`anp-deva-in`,anr:`anr-deva-in`,ans:`ans-latn-co`,ant:`ant-latn-au`,anu:`anu-ethi-et`,"anu-arab":`anu-arab-ss`,"anu-latn":`anu-latn-ss`,anv:`anv-latn-cm`,anw:`anw-latn-ng`,anx:`anx-latn-pg`,any:`any-latn-zz`,anz:`anz-latn-pg`,aoa:`aoa-latn-st`,aob:`aob-latn-pg`,aoc:`aoc-latn-ve`,aod:`aod-latn-pg`,aoe:`aoe-latn-pg`,aof:`aof-latn-pg`,aog:`aog-latn-pg`,aoi:`aoi-latn-au`,aoj:`aoj-latn-zz`,aok:`aok-latn-nc`,aol:`aol-latn-id`,aom:`aom-latn-zz`,aon:`aon-latn-pg`,aor:`aor-latn-vu`,aos:`aos-latn-id`,aot:`aot-beng-bd`,"aot-latn":`aot-latn-in`,aox:`aox-latn-gy`,aoz:`aoz-latn-id`,apb:`apb-latn-sb`,apc:`apc-arab-sy`,apd:`apd-arab-tg`,ape:`ape-latn-zz`,apf:`apf-latn-ph`,apg:`apg-latn-id`,aph:`aph-deva-np`,api:`api-latn-br`,apj:`apj-latn-us`,apk:`apk-latn-us`,apl:`apl-latn-us`,apm:`apm-latn-us`,apn:`apn-latn-br`,apo:`apo-latn-pg`,app:`app-latn-vu`,apr:`apr-latn-zz`,aps:`aps-latn-zz`,apt:`apt-latn-in`,apu:`apu-latn-br`,apv:`apv-latn-br`,apw:`apw-latn-us`,apx:`apx-latn-id`,apy:`apy-latn-br`,apz:`apz-latn-zz`,aqc:`aqc-cyrl-ru`,aqd:`aqd-latn-ml`,aqg:`aqg-latn-ng`,aqk:`aqk-latn-ng`,aqm:`aqm-latn-id`,aqn:`aqn-latn-ph`,aqr:`aqr-latn-nc`,aqt:`aqt-latn-py`,aqz:`aqz-latn-br`,ar:`ar-arab-eg`,arc:`arc-armi-ir`,"arc-nbat":`arc-nbat-jo`,"arc-palm":`arc-palm-sy`,ard:`ard-latn-au`,are:`are-latn-au`,arh:`arh-latn-zz`,ari:`ari-latn-us`,arj:`arj-latn-br`,ark:`ark-latn-br`,arl:`arl-latn-pe`,arn:`arn-latn-cl`,aro:`aro-latn-bo`,arp:`arp-latn-us`,arq:`arq-arab-dz`,arr:`arr-latn-br`,ars:`ars-arab-sa`,aru:`aru-latn-br`,arw:`arw-latn-sr`,arx:`arx-latn-br`,ary:`ary-arab-ma`,arz:`arz-arab-eg`,as:`as-beng-in`,asa:`asa-latn-tz`,asb:`asb-latn-ca`,asc:`asc-latn-id`,ase:`ase-sgnw-us`,asg:`asg-latn-zz`,ash:`ash-latn-pe`,asi:`asi-latn-id`,asj:`asj-latn-cm`,ask:`ask-arab-af`,asl:`asl-latn-id`,asn:`asn-latn-br`,aso:`aso-latn-zz`,ass:`ass-latn-cm`,ast:`ast-latn-es`,asu:`asu-latn-br`,asv:`asv-latn-cd`,asx:`asx-latn-pg`,asy:`asy-latn-id`,asz:`asz-latn-id`,ata:`ata-latn-zz`,atb:`atb-latn-cn`,"atb-lisu":`atb-lisu-cn`,atc:`atc-latn-pe`,atd:`atd-latn-ph`,ate:`ate-latn-pg`,atg:`atg-latn-zz`,ati:`ati-latn-ci`,atj:`atj-latn-ca`,atk:`atk-latn-ph`,atl:`atl-latn-ph`,atm:`atm-latn-ph`,atn:`atn-arab-ir`,ato:`ato-latn-cm`,atp:`atp-latn-ph`,atq:`atq-latn-id`,atr:`atr-latn-br`,ats:`ats-latn-us`,att:`att-latn-ph`,atu:`atu-latn-ss`,atv:`atv-cyrl-ru`,atw:`atw-latn-us`,atx:`atx-latn-br`,aty:`aty-latn-vu`,atz:`atz-latn-ph`,aua:`aua-latn-sb`,auc:`auc-latn-ec`,aud:`aud-latn-sb`,aug:`aug-latn-bj`,auh:`auh-latn-zm`,aui:`aui-latn-pg`,auj:`auj-arab-ly`,"auj-latn":`auj-latn-ly`,"auj-tfng":`auj-tfng-ly`,auk:`auk-latn-pg`,aul:`aul-latn-vu`,aum:`aum-latn-ng`,aun:`aun-latn-pg`,auo:`auo-latn-ng`,aup:`aup-latn-pg`,auq:`auq-latn-id`,aur:`aur-latn-pg`,aut:`aut-latn-pf`,auu:`auu-latn-id`,auw:`auw-latn-id`,auy:`auy-latn-zz`,auz:`auz-arab-uz`,av:`av-cyrl-ru`,avb:`avb-latn-pg`,avd:`avd-arab-ir`,avi:`avi-latn-ci`,avk:`avk-latn-001`,avl:`avl-arab-zz`,avm:`avm-latn-au`,avn:`avn-latn-zz`,avo:`avo-latn-br`,avs:`avs-latn-pe`,avt:`avt-latn-zz`,avu:`avu-latn-zz`,avv:`avv-latn-br`,awa:`awa-deva-in`,awb:`awb-latn-zz`,awc:`awc-latn-ng`,awe:`awe-latn-br`,awg:`awg-latn-au`,awh:`awh-latn-id`,awi:`awi-latn-pg`,awk:`awk-latn-au`,awm:`awm-latn-pg`,awn:`awn-ethi-et`,awo:`awo-latn-zz`,awr:`awr-latn-id`,aws:`aws-latn-id`,awt:`awt-latn-br`,awu:`awu-latn-id`,awv:`awv-latn-id`,aww:`aww-latn-pg`,awx:`awx-latn-zz`,awy:`awy-latn-id`,axb:`axb-latn-ar`,axe:`axe-latn-au`,axg:`axg-latn-br`,axk:`axk-latn-cf`,axl:`axl-latn-au`,axm:`axm-armn-am`,axx:`axx-latn-nc`,ay:`ay-latn-bo`,aya:`aya-latn-pg`,ayb:`ayb-latn-zz`,ayc:`ayc-latn-pe`,ayd:`ayd-latn-au`,aye:`aye-latn-ng`,ayg:`ayg-latn-tg`,ayh:`ayh-arab-ye`,ayi:`ayi-latn-ng`,ayk:`ayk-latn-ng`,ayl:`ayl-arab-ly`,ayn:`ayn-arab-ye`,ayo:`ayo-latn-py`,ayp:`ayp-arab-iq`,ayq:`ayq-latn-pg`,ays:`ays-latn-ph`,ayt:`ayt-latn-ph`,ayu:`ayu-latn-ng`,ayz:`ayz-latn-id`,az:`az-latn-az`,"az-arab":`az-arab-ir`,"az-iq":`az-arab-iq`,"az-ir":`az-arab-ir`,"az-ru":`az-cyrl-ru`,azb:`azb-arab-ir`,"azb-cyrl":`azb-cyrl-az`,"azb-latn":`azb-latn-az`,azd:`azd-latn-mx`,azg:`azg-latn-mx`,azm:`azm-latn-mx`,azn:`azn-latn-mx`,azo:`azo-latn-cm`,azt:`azt-latn-ph`,azz:`azz-latn-mx`,ba:`ba-cyrl-ru`,baa:`baa-latn-sb`,bab:`bab-latn-gw`,bac:`bac-latn-id`,bae:`bae-latn-ve`,baf:`baf-latn-cm`,bag:`bag-latn-cm`,bah:`bah-latn-bs`,baj:`baj-latn-id`,bal:`bal-arab-pk`,ban:`ban-latn-id`,bao:`bao-latn-co`,bap:`bap-deva-np`,bar:`bar-latn-at`,bas:`bas-latn-cm`,bau:`bau-latn-ng`,bav:`bav-latn-zz`,baw:`baw-latn-cm`,bax:`bax-bamu-cm`,bay:`bay-latn-id`,bba:`bba-latn-zz`,bbb:`bbb-latn-zz`,bbc:`bbc-latn-id`,bbd:`bbd-latn-zz`,bbe:`bbe-latn-cd`,bbf:`bbf-latn-pg`,bbg:`bbg-latn-ga`,bbi:`bbi-latn-cm`,bbj:`bbj-latn-cm`,bbk:`bbk-latn-cm`,bbl:`bbl-geor-ge`,bbm:`bbm-latn-cd`,bbn:`bbn-latn-pg`,bbo:`bbo-latn-bf`,bbp:`bbp-latn-zz`,bbq:`bbq-latn-cm`,bbr:`bbr-latn-zz`,bbs:`bbs-latn-ng`,bbt:`bbt-latn-ng`,bbu:`bbu-latn-ng`,bbv:`bbv-latn-pg`,bbw:`bbw-latn-cm`,bbx:`bbx-latn-cm`,bby:`bby-latn-cm`,bca:`bca-latn-cn`,"bca-hani":`bca-hani-cn`,bcb:`bcb-latn-sn`,bcd:`bcd-latn-id`,bce:`bce-latn-cm`,bcf:`bcf-latn-zz`,bcg:`bcg-latn-gn`,bch:`bch-latn-zz`,bci:`bci-latn-ci`,bcj:`bcj-latn-au`,bck:`bck-latn-au`,bcm:`bcm-latn-zz`,bcn:`bcn-latn-zz`,bco:`bco-latn-zz`,bcp:`bcp-latn-cd`,bcq:`bcq-ethi-zz`,bcr:`bcr-latn-ca`,bcs:`bcs-latn-ng`,bct:`bct-latn-cd`,bcu:`bcu-latn-zz`,bcv:`bcv-latn-ng`,bcw:`bcw-latn-cm`,bcy:`bcy-latn-ng`,bcz:`bcz-latn-sn`,bda:`bda-latn-sn`,bdb:`bdb-latn-id`,bdc:`bdc-latn-co`,bdd:`bdd-latn-zz`,bde:`bde-latn-ng`,bdf:`bdf-latn-pg`,bdg:`bdg-latn-my`,bdh:`bdh-latn-ss`,bdi:`bdi-latn-sd`,bdj:`bdj-latn-ss`,bdk:`bdk-latn-az`,bdl:`bdl-latn-id`,bdm:`bdm-latn-td`,bdn:`bdn-latn-cm`,bdo:`bdo-latn-td`,bdp:`bdp-latn-tz`,bdq:`bdq-latn-vn`,bdr:`bdr-latn-my`,bds:`bds-latn-tz`,bdt:`bdt-latn-cf`,bdu:`bdu-latn-cm`,bdv:`bdv-orya-in`,bdw:`bdw-latn-id`,bdx:`bdx-latn-id`,bdy:`bdy-latn-au`,bdz:`bdz-arab-pk`,be:`be-cyrl-by`,bea:`bea-latn-ca`,"bea-cans":`bea-cans-ca`,beb:`beb-latn-cm`,bec:`bec-latn-cm`,bed:`bed-latn-id`,bee:`bee-deva-in`,bef:`bef-latn-zz`,beh:`beh-latn-zz`,bei:`bei-latn-id`,bej:`bej-arab-sd`,bek:`bek-latn-pg`,bem:`bem-latn-zm`,beo:`beo-latn-pg`,bep:`bep-latn-id`,beq:`beq-latn-cg`,bes:`bes-latn-td`,bet:`bet-latn-zz`,beu:`beu-latn-id`,bev:`bev-latn-ci`,bew:`bew-latn-id`,bex:`bex-latn-zz`,bey:`bey-latn-pg`,bez:`bez-latn-tz`,bfa:`bfa-latn-ss`,"bfa-arab":`bfa-arab-ss`,bfb:`bfb-deva-in`,bfc:`bfc-latn-cn`,bfd:`bfd-latn-cm`,bfe:`bfe-latn-id`,bff:`bff-latn-cf`,bfg:`bfg-latn-id`,bfh:`bfh-latn-pg`,bfj:`bfj-latn-cm`,bfl:`bfl-latn-cf`,bfm:`bfm-latn-cm`,bfn:`bfn-latn-tl`,bfo:`bfo-latn-bf`,bfp:`bfp-latn-cm`,bfq:`bfq-taml-in`,bfs:`bfs-latn-cn`,"bfs-hani":`bfs-hani-cn`,bft:`bft-arab-pk`,bfu:`bfu-tibt-in`,"bfu-takr":`bfu-takr-in`,bfw:`bfw-orya-in`,bfx:`bfx-latn-ph`,bfy:`bfy-deva-in`,bfz:`bfz-deva-in`,bg:`bg-cyrl-bg`,bga:`bga-latn-ng`,bgb:`bgb-latn-id`,bgc:`bgc-deva-in`,bgd:`bgd-deva-in`,bgf:`bgf-latn-cm`,bgg:`bgg-latn-in`,bgi:`bgi-latn-ph`,bgj:`bgj-latn-cm`,bgn:`bgn-arab-pk`,bgo:`bgo-latn-gn`,bgp:`bgp-arab-pk`,bgq:`bgq-deva-in`,bgr:`bgr-latn-in`,bgs:`bgs-latn-ph`,bgt:`bgt-latn-sb`,bgu:`bgu-latn-ng`,bgv:`bgv-latn-id`,bgw:`bgw-deva-in`,bgx:`bgx-grek-tr`,bgy:`bgy-latn-id`,bgz:`bgz-latn-id`,bha:`bha-deva-in`,bhb:`bhb-deva-in`,bhc:`bhc-latn-id`,bhd:`bhd-deva-in`,"bhd-arab":`bhd-arab-in`,"bhd-takr":`bhd-takr-in`,bhe:`bhe-arab-pk`,bhf:`bhf-latn-pg`,bhg:`bhg-latn-zz`,bhh:`bhh-cyrl-il`,"bhh-hebr":`bhh-hebr-il`,"bhh-latn":`bhh-latn-il`,bhi:`bhi-deva-in`,bhj:`bhj-deva-np`,bhl:`bhl-latn-zz`,bhm:`bhm-arab-om`,bhn:`bhn-syrc-ge`,bho:`bho-deva-in`,bhp:`bhp-latn-id`,bhq:`bhq-latn-id`,bhr:`bhr-latn-mg`,bhs:`bhs-latn-cm`,bht:`bht-takr-in`,"bht-deva":`bht-deva-in`,"bht-latn":`bht-latn-in`,bhu:`bhu-deva-in`,bhv:`bhv-latn-id`,bhw:`bhw-latn-id`,bhy:`bhy-latn-zz`,bhz:`bhz-latn-id`,bi:`bi-latn-vu`,bia:`bia-latn-au`,bib:`bib-latn-zz`,bid:`bid-latn-td`,bie:`bie-latn-pg`,bif:`bif-latn-gw`,big:`big-latn-zz`,bik:`bik-latn-ph`,bil:`bil-latn-ng`,bim:`bim-latn-zz`,bin:`bin-latn-ng`,bio:`bio-latn-zz`,bip:`bip-latn-cd`,biq:`biq-latn-zz`,bir:`bir-latn-pg`,bit:`bit-latn-pg`,biu:`biu-latn-in`,biv:`biv-latn-gh`,biw:`biw-latn-cm`,biy:`biy-deva-in`,biz:`biz-latn-cd`,bja:`bja-latn-cd`,bjb:`bjb-latn-au`,bjc:`bjc-latn-pg`,bjf:`bjf-syrc-il`,bjg:`bjg-latn-gw`,bjh:`bjh-latn-zz`,bji:`bji-ethi-zz`,bjj:`bjj-deva-in`,bjk:`bjk-latn-pg`,bjl:`bjl-latn-pg`,bjm:`bjm-arab-iq`,bjn:`bjn-latn-id`,bjo:`bjo-latn-zz`,bjp:`bjp-latn-pg`,bjr:`bjr-latn-zz`,bjs:`bjs-latn-bb`,bjt:`bjt-latn-sn`,bju:`bju-latn-cm`,bjv:`bjv-latn-td`,bjw:`bjw-latn-ci`,bjx:`bjx-latn-ph`,bjy:`bjy-latn-au`,bjz:`bjz-latn-zz`,bka:`bka-latn-ng`,bkc:`bkc-latn-zz`,bkd:`bkd-latn-ph`,bkf:`bkf-latn-cd`,bkg:`bkg-latn-cf`,bkh:`bkh-latn-cm`,bki:`bki-latn-vu`,bkj:`bkj-latn-cf`,bkl:`bkl-latn-id`,bkm:`bkm-latn-cm`,bkn:`bkn-latn-id`,bko:`bko-latn-cm`,bkp:`bkp-latn-cd`,bkq:`bkq-latn-zz`,bkr:`bkr-latn-id`,bks:`bks-latn-ph`,bkt:`bkt-latn-cd`,bku:`bku-latn-ph`,bkv:`bkv-latn-zz`,bkw:`bkw-latn-cg`,bkx:`bkx-latn-tl`,bky:`bky-latn-ng`,bkz:`bkz-latn-id`,bla:`bla-latn-ca`,blb:`blb-latn-sb`,blc:`blc-latn-ca`,bld:`bld-latn-id`,ble:`ble-latn-gw`,blf:`blf-latn-id`,blg:`blg-latn-my`,blh:`blh-latn-lr`,bli:`bli-latn-cd`,blj:`blj-latn-id`,blk:`blk-mymr-mm`,blm:`blm-latn-ss`,bln:`bln-latn-ph`,blo:`blo-latn-bj`,blp:`blp-latn-sb`,blq:`blq-latn-pg`,blr:`blr-latn-cn`,"blr-tale":`blr-tale-cn`,"blr-thai":`blr-thai-th`,bls:`bls-latn-id`,blt:`blt-tavt-vn`,blv:`blv-latn-ao`,blw:`blw-latn-ph`,blx:`blx-latn-ph`,bly:`bly-latn-bj`,blz:`blz-latn-id`,bm:`bm-latn-ml`,bma:`bma-latn-ng`,bmb:`bmb-latn-cd`,bmc:`bmc-latn-pg`,bmd:`bmd-latn-gn`,bme:`bme-latn-cf`,bmf:`bmf-latn-sl`,bmg:`bmg-latn-cd`,bmh:`bmh-latn-zz`,bmi:`bmi-latn-td`,bmj:`bmj-deva-np`,bmk:`bmk-latn-zz`,bml:`bml-latn-cd`,bmm:`bmm-latn-mg`,bmn:`bmn-latn-pg`,bmo:`bmo-latn-cm`,bmp:`bmp-latn-pg`,bmq:`bmq-latn-ml`,bmr:`bmr-latn-co`,bms:`bms-latn-ne`,bmu:`bmu-latn-zz`,bmv:`bmv-latn-cm`,bmw:`bmw-latn-cg`,bmx:`bmx-latn-pg`,bmz:`bmz-latn-pg`,bn:`bn-beng-bd`,bna:`bna-latn-id`,bnb:`bnb-latn-my`,bnc:`bnc-latn-ph`,bnd:`bnd-latn-id`,bne:`bne-latn-id`,bnf:`bnf-latn-id`,bng:`bng-latn-zz`,bni:`bni-latn-cd`,bnj:`bnj-latn-ph`,bnk:`bnk-latn-vu`,bnm:`bnm-latn-zz`,bnn:`bnn-latn-tw`,bno:`bno-latn-ph`,bnp:`bnp-latn-zz`,bnq:`bnq-latn-id`,bnr:`bnr-latn-vu`,bns:`bns-deva-in`,bnu:`bnu-latn-id`,bnv:`bnv-latn-id`,bnw:`bnw-latn-pg`,bnx:`bnx-latn-cd`,bny:`bny-latn-my`,bnz:`bnz-latn-cm`,bo:`bo-tibt-cn`,boa:`boa-latn-pe`,bob:`bob-latn-ke`,boe:`boe-latn-cm`,bof:`bof-latn-bf`,boh:`boh-latn-cd`,boj:`boj-latn-zz`,bok:`bok-latn-cg`,bol:`bol-latn-ng`,bom:`bom-latn-zz`,bon:`bon-latn-zz`,boo:`boo-latn-ml`,bop:`bop-latn-pg`,boq:`boq-latn-pg`,bor:`bor-latn-br`,bot:`bot-latn-ss`,bou:`bou-latn-tz`,bov:`bov-latn-gh`,bow:`bow-latn-pg`,box:`box-latn-bf`,boy:`boy-latn-cf`,boz:`boz-latn-ml`,"boz-arab":`boz-arab-ml`,bpa:`bpa-latn-vu`,bpc:`bpc-latn-cm`,bpd:`bpd-latn-cf`,bpe:`bpe-latn-pg`,bpg:`bpg-latn-id`,bph:`bph-cyrl-ru`,bpi:`bpi-latn-pg`,bpj:`bpj-latn-cd`,bpk:`bpk-latn-nc`,bpl:`bpl-latn-au`,bpm:`bpm-latn-pg`,bpo:`bpo-latn-id`,bpp:`bpp-latn-id`,bpq:`bpq-latn-id`,bpr:`bpr-latn-ph`,bps:`bps-latn-ph`,bpt:`bpt-latn-au`,bpu:`bpu-latn-pg`,bpv:`bpv-latn-id`,bpw:`bpw-latn-pg`,bpx:`bpx-deva-in`,bpy:`bpy-beng-in`,bpz:`bpz-latn-id`,bqa:`bqa-latn-bj`,bqb:`bqb-latn-id`,bqc:`bqc-latn-zz`,bqd:`bqd-latn-cm`,bqf:`bqf-latn-gn`,"bqf-arab":`bqf-arab-gn`,bqg:`bqg-latn-tg`,bqi:`bqi-arab-ir`,bqj:`bqj-latn-sn`,bqk:`bqk-latn-cf`,bql:`bql-latn-pg`,bqm:`bqm-latn-cm`,bqo:`bqo-latn-cm`,bqp:`bqp-latn-zz`,bqq:`bqq-latn-id`,bqr:`bqr-latn-id`,bqs:`bqs-latn-pg`,bqt:`bqt-latn-cm`,bqu:`bqu-latn-cd`,bqv:`bqv-latn-ci`,bqw:`bqw-latn-ng`,bqx:`bqx-latn-ng`,bqz:`bqz-latn-cm`,br:`br-latn-fr`,bra:`bra-deva-in`,brb:`brb-khmr-kh`,"brb-laoo":`brb-laoo-la`,"brb-latn":`brb-latn-vn`,brc:`brc-latn-gy`,brd:`brd-deva-np`,brf:`brf-latn-cd`,brg:`brg-latn-bo`,brh:`brh-arab-pk`,bri:`bri-latn-cm`,brj:`brj-latn-vu`,brk:`brk-arab-sd`,brl:`brl-latn-bw`,brm:`brm-latn-cd`,brn:`brn-latn-cr`,brp:`brp-latn-id`,brq:`brq-latn-pg`,brr:`brr-latn-sb`,brs:`brs-latn-id`,brt:`brt-latn-ng`,bru:`bru-latn-vn`,"bru-laoo":`bru-laoo-la`,"bru-thai":`bru-thai-la`,brv:`brv-laoo-la`,brx:`brx-deva-in`,bry:`bry-latn-pg`,brz:`brz-latn-zz`,bs:`bs-latn-ba`,bsa:`bsa-latn-id`,bsb:`bsb-latn-bn`,bsc:`bsc-latn-sn`,bse:`bse-latn-cm`,bsf:`bsf-latn-ng`,bsh:`bsh-arab-af`,bsi:`bsi-latn-cm`,bsj:`bsj-latn-zz`,bsk:`bsk-arab-pk`,"bsk-latn":`bsk-latn-pk`,bsl:`bsl-latn-ng`,bsm:`bsm-latn-id`,bsn:`bsn-latn-co`,bso:`bso-latn-td`,bsp:`bsp-latn-gn`,bsq:`bsq-bass-lr`,bsr:`bsr-latn-ng`,bss:`bss-latn-cm`,bst:`bst-ethi-zz`,bsu:`bsu-latn-id`,bsv:`bsv-latn-gn`,"bsv-arab":`bsv-arab-gn`,bsw:`bsw-latn-et`,"bsw-ethi":`bsw-ethi-et`,bsx:`bsx-latn-ng`,bsy:`bsy-latn-my`,bta:`bta-latn-ng`,btc:`btc-latn-cm`,btd:`btd-batk-id`,bte:`bte-latn-ng`,btf:`btf-latn-td`,btg:`btg-latn-ci`,bth:`bth-latn-my`,bti:`bti-latn-id`,btj:`btj-latn-id`,btm:`btm-batk-id`,btn:`btn-latn-ph`,bto:`bto-latn-ph`,btp:`btp-latn-pg`,btq:`btq-latn-my`,btr:`btr-latn-vu`,bts:`bts-latn-id`,"bts-batk":`bts-batk-id`,btt:`btt-latn-zz`,btu:`btu-latn-ng`,btv:`btv-deva-pk`,btw:`btw-latn-ph`,btx:`btx-latn-id`,"btx-batk":`btx-batk-id`,bty:`bty-latn-id`,btz:`btz-latn-id`,bua:`bua-cyrl-ru`,bub:`bub-latn-td`,buc:`buc-latn-yt`,bud:`bud-latn-zz`,bue:`bue-latn-ca`,buf:`buf-latn-cd`,bug:`bug-latn-id`,buh:`buh-latn-cn`,bui:`bui-latn-cg`,buj:`buj-latn-ng`,buk:`buk-latn-zz`,bum:`bum-latn-cm`,bun:`bun-latn-sl`,buo:`buo-latn-zz`,bup:`bup-latn-id`,buq:`buq-latn-pg`,bus:`bus-latn-zz`,but:`but-latn-pg`,buu:`buu-latn-zz`,buv:`buv-latn-pg`,buw:`buw-latn-ga`,bux:`bux-latn-ng`,buy:`buy-latn-sl`,buz:`buz-latn-ng`,bva:`bva-latn-td`,bvb:`bvb-latn-gq`,bvc:`bvc-latn-sb`,bvd:`bvd-latn-sb`,bve:`bve-latn-id`,bvf:`bvf-latn-td`,bvg:`bvg-latn-cm`,bvh:`bvh-latn-ng`,bvi:`bvi-latn-ss`,bvj:`bvj-latn-ng`,bvk:`bvk-latn-id`,bvm:`bvm-latn-cm`,bvn:`bvn-latn-pg`,bvo:`bvo-latn-td`,bvq:`bvq-latn-cf`,bvr:`bvr-latn-au`,bvt:`bvt-latn-id`,bvu:`bvu-latn-id`,bvv:`bvv-latn-ve`,bvw:`bvw-latn-ng`,bvx:`bvx-latn-cg`,bvy:`bvy-latn-ph`,bvz:`bvz-latn-id`,bwa:`bwa-latn-nc`,bwb:`bwb-latn-fj`,bwc:`bwc-latn-zm`,bwd:`bwd-latn-zz`,bwe:`bwe-mymr-mm`,"bwe-latn":`bwe-latn-mm`,bwf:`bwf-latn-pg`,bwg:`bwg-latn-mz`,bwh:`bwh-latn-cm`,bwi:`bwi-latn-ve`,bwj:`bwj-latn-bf`,bwk:`bwk-latn-pg`,bwl:`bwl-latn-cd`,bwm:`bwm-latn-pg`,bwo:`bwo-latn-et`,"bwo-ethi":`bwo-ethi-et`,bwp:`bwp-latn-id`,bwq:`bwq-latn-bf`,bwr:`bwr-latn-zz`,bws:`bws-latn-cd`,bwt:`bwt-latn-cm`,bwu:`bwu-latn-gh`,bww:`bww-latn-cd`,bwx:`bwx-latn-cn`,bwy:`bwy-latn-bf`,bwz:`bwz-latn-cg`,bxa:`bxa-latn-sb`,bxb:`bxb-latn-ss`,bxc:`bxc-latn-gq`,bxf:`bxf-latn-pg`,bxg:`bxg-latn-cd`,bxh:`bxh-latn-zz`,bxi:`bxi-latn-au`,bxj:`bxj-latn-au`,bxl:`bxl-latn-bf`,bxm:`bxm-cyrl-mn`,"bxm-latn":`bxm-latn-mn`,"bxm-mong":`bxm-mong-mn`,bxn:`bxn-latn-au`,bxo:`bxo-latn-ng`,bxp:`bxp-latn-cm`,bxq:`bxq-latn-ng`,bxs:`bxs-latn-cm`,bxu:`bxu-mong-cn`,"bxu-cyrl":`bxu-cyrl-cn`,"bxu-latn":`bxu-latn-cn`,bxv:`bxv-latn-td`,bxw:`bxw-latn-ml`,bxz:`bxz-latn-pg`,bya:`bya-latn-ph`,byb:`byb-latn-cm`,byc:`byc-latn-ng`,byd:`byd-latn-id`,bye:`bye-latn-zz`,byf:`byf-latn-ng`,byh:`byh-deva-np`,byi:`byi-latn-cd`,byj:`byj-latn-ng`,byk:`byk-latn-cn`,byl:`byl-latn-id`,bym:`bym-latn-au`,byn:`byn-ethi-er`,byp:`byp-latn-ng`,byr:`byr-latn-zz`,bys:`bys-latn-zz`,byv:`byv-latn-cm`,byw:`byw-deva-np`,byx:`byx-latn-zz`,byz:`byz-latn-pg`,bza:`bza-latn-zz`,bzb:`bzb-latn-id`,bzc:`bzc-latn-mg`,bzd:`bzd-latn-cr`,bze:`bze-latn-ml`,bzf:`bzf-latn-zz`,bzh:`bzh-latn-zz`,bzi:`bzi-thai-th`,bzj:`bzj-latn-bz`,bzk:`bzk-latn-ni`,bzl:`bzl-latn-id`,bzm:`bzm-latn-cd`,bzn:`bzn-latn-id`,bzo:`bzo-latn-cd`,bzp:`bzp-latn-id`,bzq:`bzq-latn-id`,bzr:`bzr-latn-au`,bzt:`bzt-latn-001`,bzu:`bzu-latn-id`,bzv:`bzv-latn-cm`,bzw:`bzw-latn-zz`,bzx:`bzx-latn-ml`,bzy:`bzy-latn-ng`,bzz:`bzz-latn-ng`,ca:`ca-latn-es`,caa:`caa-latn-gt`,cab:`cab-latn-hn`,cac:`cac-latn-gt`,cad:`cad-latn-us`,cae:`cae-latn-sn`,caf:`caf-latn-ca`,"caf-cans":`caf-cans-ca`,cag:`cag-latn-py`,cah:`cah-latn-pe`,caj:`caj-latn-ar`,cak:`cak-latn-gt`,cal:`cal-latn-mp`,cam:`cam-latn-nc`,can:`can-latn-zz`,cao:`cao-latn-bo`,cap:`cap-latn-bo`,caq:`caq-latn-in`,car:`car-latn-ve`,cas:`cas-latn-bo`,cav:`cav-latn-bo`,caw:`caw-latn-bo`,cax:`cax-latn-bo`,cay:`cay-latn-ca`,caz:`caz-latn-bo`,cbb:`cbb-latn-co`,cbc:`cbc-latn-co`,cbd:`cbd-latn-co`,cbg:`cbg-latn-co`,cbi:`cbi-latn-ec`,cbj:`cbj-latn-zz`,cbk:`cbk-latn-ph`,"cbk-brai":`cbk-brai-ph`,cbl:`cbl-latn-mm`,cbn:`cbn-thai-th`,cbo:`cbo-latn-ng`,cbq:`cbq-latn-ng`,cbr:`cbr-latn-pe`,cbs:`cbs-latn-pe`,cbt:`cbt-latn-pe`,cbu:`cbu-latn-pe`,cbv:`cbv-latn-co`,cbw:`cbw-latn-ph`,cby:`cby-latn-co`,ccc:`ccc-latn-pe`,ccd:`ccd-latn-br`,cce:`cce-latn-mz`,ccg:`ccg-latn-ng`,cch:`cch-latn-ng`,ccj:`ccj-latn-gw`,ccl:`ccl-latn-tz`,ccm:`ccm-latn-my`,cco:`cco-latn-mx`,ccp:`ccp-cakm-bd`,ccr:`ccr-latn-sv`,cde:`cde-telu-in`,cdf:`cdf-latn-in`,"cdf-beng":`cdf-beng-in`,cdh:`cdh-deva-in`,"cdh-takr":`cdh-takr-in`,cdi:`cdi-gujr-in`,cdj:`cdj-deva-in`,cdm:`cdm-deva-np`,"cdm-latn":`cdm-latn-np`,cdo:`cdo-hans-cn`,"cdo-hant":`cdo-hant-cn`,"cdo-latn":`cdo-latn-cn`,cdr:`cdr-latn-ng`,cdz:`cdz-beng-in`,ce:`ce-cyrl-ru`,cea:`cea-latn-us`,ceb:`ceb-latn-ph`,ceg:`ceg-latn-py`,cek:`cek-latn-mm`,cen:`cen-latn-ng`,cet:`cet-latn-ng`,cey:`cey-latn-mm`,cfa:`cfa-latn-zz`,cfd:`cfd-latn-ng`,cfg:`cfg-latn-ng`,cfm:`cfm-latn-mm`,"cfm-beng":`cfm-beng-in`,cga:`cga-latn-pg`,cgc:`cgc-latn-ph`,cgg:`cgg-latn-ug`,cgk:`cgk-tibt-bt`,ch:`ch-latn-gu`,chb:`chb-latn-co`,chd:`chd-latn-mx`,chf:`chf-latn-mx`,chg:`chg-arab-tm`,chh:`chh-latn-us`,chj:`chj-latn-mx`,chk:`chk-latn-fm`,chl:`chl-latn-us`,chm:`chm-cyrl-ru`,chn:`chn-latn-us`,"chn-dupl":`chn-dupl-us`,cho:`cho-latn-us`,chp:`chp-latn-ca`,chq:`chq-latn-mx`,chr:`chr-cher-us`,cht:`cht-latn-pe`,chw:`chw-latn-mz`,chx:`chx-deva-np`,chy:`chy-latn-us`,chz:`chz-latn-mx`,cia:`cia-latn-id`,"cia-arab":`cia-arab-id`,"cia-hang":`cia-hang-id`,cib:`cib-latn-bj`,cic:`cic-latn-us`,cie:`cie-latn-ng`,cih:`cih-deva-in`,cim:`cim-latn-it`,cin:`cin-latn-br`,cip:`cip-latn-mx`,cir:`cir-latn-nc`,ciw:`ciw-latn-us`,"ciw-cans":`ciw-cans-us`,ciy:`ciy-latn-ve`,cja:`cja-arab-kh`,cje:`cje-latn-vn`,cjh:`cjh-latn-us`,cji:`cji-cyrl-ru`,cjk:`cjk-latn-ao`,cjm:`cjm-cham-vn`,cjn:`cjn-latn-pg`,cjo:`cjo-latn-pe`,cjp:`cjp-latn-cr`,cjs:`cjs-latn-ru`,"cjs-cyrl":`cjs-cyrl-ru`,cjv:`cjv-latn-zz`,cjy:`cjy-hans-cn`,"cjy-hant":`cjy-hant-cn`,ckb:`ckb-arab-iq`,ckl:`ckl-latn-zz`,ckm:`ckm-latn-hr`,"ckm-glag":`ckm-glag-hr`,ckn:`ckn-latn-mm`,cko:`cko-latn-zz`,ckq:`ckq-latn-td`,ckr:`ckr-latn-pg`,cks:`cks-latn-nc`,ckt:`ckt-cyrl-ru`,cku:`cku-latn-us`,ckv:`ckv-latn-tw`,ckx:`ckx-latn-cm`,cky:`cky-latn-zz`,ckz:`ckz-latn-gt`,cla:`cla-latn-zz`,clc:`clc-latn-ca`,cle:`cle-latn-mx`,clh:`clh-arab-pk`,cli:`cli-latn-gh`,clj:`clj-latn-mm`,clk:`clk-latn-in`,"clk-tibt":`clk-tibt-cn`,cll:`cll-latn-gh`,clm:`clm-latn-us`,clo:`clo-latn-mx`,clt:`clt-latn-mm`,clu:`clu-latn-ph`,clw:`clw-cyrl-ru`,cly:`cly-latn-mx`,cma:`cma-latn-vn`,cme:`cme-latn-zz`,cmg:`cmg-soyo-mn`,cmi:`cmi-latn-co`,cml:`cml-latn-id`,cmo:`cmo-latn-vn`,"cmo-kh":`cmo-latn-kh`,"cmo-khmr":`cmo-khmr-kh`,cmr:`cmr-latn-mm`,cms:`cms-latn-it`,cmt:`cmt-latn-za`,cna:`cna-tibt-in`,cnb:`cnb-latn-mm`,cnc:`cnc-latn-vn`,cng:`cng-latn-cn`,cnh:`cnh-latn-mm`,cni:`cni-latn-pe`,cnk:`cnk-latn-mm`,cnl:`cnl-latn-mx`,cnp:`cnp-hans-cn`,"cnp-hant":`cnp-hant-cn`,cnq:`cnq-latn-cm`,cns:`cns-latn-id`,cnt:`cnt-latn-mx`,cnw:`cnw-latn-mm`,cnx:`cnx-latn-gb`,co:`co-latn-fr`,coa:`coa-latn-au`,cob:`cob-latn-mx`,coc:`coc-latn-mx`,cod:`cod-latn-pe`,coe:`coe-latn-co`,cof:`cof-latn-ec`,cog:`cog-thai-th`,coh:`coh-latn-ke`,coj:`coj-latn-mx`,cok:`cok-latn-mx`,col:`col-latn-us`,com:`com-latn-us`,coo:`coo-latn-ca`,cop:`cop-copt-eg`,coq:`coq-latn-us`,cot:`cot-latn-pe`,cou:`cou-latn-sn`,cox:`cox-latn-pe`,coz:`coz-latn-mx`,cpa:`cpa-latn-mx`,cpb:`cpb-latn-pe`,cpc:`cpc-latn-pe`,cpg:`cpg-grek-gr`,cpi:`cpi-latn-nr`,cpn:`cpn-latn-gh`,cpo:`cpo-latn-bf`,cps:`cps-latn-ph`,cpu:`cpu-latn-pe`,cpx:`cpx-latn-cn`,cpy:`cpy-latn-pe`,cqd:`cqd-latn-cn`,cr:`cr-cans-ca`,crb:`crb-latn-vc`,crc:`crc-latn-vu`,crd:`crd-latn-us`,crf:`crf-latn-co`,crg:`crg-latn-ca`,crh:`crh-cyrl-ua`,cri:`cri-latn-st`,crj:`crj-cans-ca`,"crj-latn":`crj-latn-ca`,crk:`crk-cans-ca`,crl:`crl-cans-ca`,crm:`crm-cans-ca`,crn:`crn-latn-mx`,cro:`cro-latn-us`,crq:`crq-latn-ar`,crs:`crs-latn-sc`,crt:`crt-latn-ar`,crv:`crv-latn-in`,crw:`crw-latn-vn`,crx:`crx-latn-ca`,"crx-cans":`crx-cans-ca`,cry:`cry-latn-ng`,crz:`crz-latn-us`,cs:`cs-latn-cz`,csa:`csa-latn-mx`,csb:`csb-latn-pl`,csh:`csh-mymr-mm`,"csh-latn":`csh-latn-mm`,csj:`csj-latn-mm`,csk:`csk-latn-sn`,csm:`csm-latn-us`,cso:`cso-latn-mx`,csp:`csp-hans-cn`,"csp-hant":`csp-hant-cn`,css:`css-latn-us`,cst:`cst-latn-us`,csv:`csv-latn-mm`,csw:`csw-cans-ca`,csy:`csy-latn-mm`,csz:`csz-latn-us`,cta:`cta-latn-mx`,ctc:`ctc-latn-us`,ctd:`ctd-pauc-mm`,cte:`cte-latn-mx`,ctg:`ctg-beng-bd`,"ctg-arab":`ctg-arab-bd`,"ctg-latn":`ctg-latn-bd`,cth:`cth-latn-mm`,ctl:`ctl-latn-mx`,ctm:`ctm-latn-us`,ctn:`ctn-deva-np`,cto:`cto-latn-co`,ctp:`ctp-latn-mx`,cts:`cts-latn-ph`,ctt:`ctt-taml-in`,ctu:`ctu-latn-mx`,ctz:`ctz-latn-mx`,cu:`cu-cyrl-ru`,"cu-glag":`cu-glag-bg`,cua:`cua-latn-vn`,cub:`cub-latn-co`,cuc:`cuc-latn-mx`,cuh:`cuh-latn-ke`,cui:`cui-latn-co`,cuj:`cuj-latn-pe`,cuk:`cuk-latn-pa`,cul:`cul-latn-br`,cuo:`cuo-latn-ve`,cup:`cup-latn-us`,cut:`cut-latn-mx`,cuu:`cuu-lana-cn`,cuv:`cuv-latn-cm`,cux:`cux-latn-mx`,cv:`cv-cyrl-ru`,cvg:`cvg-latn-in`,"cvg-tibt":`cvg-tibt-in`,cvn:`cvn-latn-mx`,cwa:`cwa-latn-tz`,cwb:`cwb-latn-mz`,cwe:`cwe-latn-tz`,cwg:`cwg-latn-my`,cwt:`cwt-latn-sn`,cy:`cy-latn-gb`,cya:`cya-latn-mx`,cyb:`cyb-latn-bo`,cyo:`cyo-latn-ph`,czh:`czh-hans-cn`,"czh-hant":`czh-hant-cn`,czk:`czk-hebr-cz`,czn:`czn-latn-mx`,czt:`czt-latn-mm`,da:`da-latn-dk`,daa:`daa-latn-td`,dac:`dac-latn-pg`,dad:`dad-latn-zz`,dae:`dae-latn-cm`,daf:`daf-latn-ci`,dag:`dag-latn-zz`,dah:`dah-latn-zz`,dai:`dai-latn-td`,daj:`daj-latn-sd`,dak:`dak-latn-us`,dal:`dal-latn-ke`,dam:`dam-latn-ng`,dao:`dao-latn-mm`,daq:`daq-deva-in`,dar:`dar-cyrl-ru`,das:`das-latn-ci`,dau:`dau-latn-td`,dav:`dav-latn-ke`,daw:`daw-latn-ph`,dax:`dax-latn-au`,daz:`daz-latn-id`,dba:`dba-latn-ml`,dbb:`dbb-latn-ng`,dbd:`dbd-latn-zz`,dbe:`dbe-latn-id`,dbf:`dbf-latn-id`,dbg:`dbg-latn-ml`,dbi:`dbi-latn-ng`,dbj:`dbj-latn-my`,"dbj-arab":`dbj-arab-my`,dbl:`dbl-latn-au`,dbm:`dbm-latn-ng`,dbn:`dbn-latn-id`,dbo:`dbo-latn-ng`,dbp:`dbp-latn-ng`,dbq:`dbq-latn-zz`,dbt:`dbt-latn-ml`,dbu:`dbu-latn-ml`,dbv:`dbv-latn-ng`,dbw:`dbw-latn-ml`,dby:`dby-latn-pg`,dcc:`dcc-arab-in`,dcr:`dcr-latn-vi`,dda:`dda-latn-au`,ddd:`ddd-latn-ss`,dde:`dde-latn-cg`,ddg:`ddg-latn-tl`,ddi:`ddi-latn-pg`,ddj:`ddj-latn-au`,ddn:`ddn-latn-zz`,ddo:`ddo-cyrl-ru`,ddr:`ddr-latn-au`,dds:`dds-latn-ml`,ddw:`ddw-latn-id`,de:`de-latn-de`,dec:`dec-latn-sd`,ded:`ded-latn-zz`,dee:`dee-latn-lr`,def:`def-arab-ir`,deg:`deg-latn-ng`,deh:`deh-arab-pk`,dei:`dei-latn-id`,dek:`dek-latn-cm`,del:`del-latn-us`,dem:`dem-latn-id`,den:`den-latn-ca`,deq:`deq-latn-cf`,der:`der-beng-in`,"der-latn":`der-latn-in`,des:`des-latn-br`,dev:`dev-latn-pg`,dez:`dez-latn-cd`,dga:`dga-latn-zz`,dgb:`dgb-latn-ml`,dgc:`dgc-latn-ph`,dgd:`dgd-latn-bf`,dge:`dge-latn-pg`,dgg:`dgg-latn-pg`,dgh:`dgh-latn-zz`,dgi:`dgi-latn-zz`,dgk:`dgk-latn-cf`,dgl:`dgl-arab-zz`,dgn:`dgn-latn-au`,dgr:`dgr-latn-ca`,dgs:`dgs-latn-bf`,dgt:`dgt-latn-au`,dgw:`dgw-latn-au`,dgx:`dgx-latn-pg`,dgz:`dgz-latn-zz`,dhg:`dhg-latn-au`,dhi:`dhi-deva-np`,dhl:`dhl-latn-au`,dhm:`dhm-latn-ao`,dhn:`dhn-gujr-in`,dho:`dho-deva-in`,dhr:`dhr-latn-au`,dhs:`dhs-latn-tz`,dhu:`dhu-latn-au`,dhv:`dhv-latn-nc`,dhw:`dhw-deva-np`,dhx:`dhx-latn-au`,dia:`dia-latn-zz`,dib:`dib-latn-ss`,dic:`dic-latn-ci`,did:`did-latn-ss`,dif:`dif-latn-au`,dig:`dig-latn-ke`,dih:`dih-latn-mx`,dii:`dii-latn-cm`,dij:`dij-latn-id`,dil:`dil-latn-sd`,din:`din-latn-ss`,"din-arab":`din-arab-ss`,dio:`dio-latn-ng`,dip:`dip-latn-ss`,dir:`dir-latn-ng`,dis:`dis-latn-in`,"dis-beng":`dis-beng-in`,diu:`diu-latn-na`,diw:`diw-latn-ss`,dix:`dix-latn-vu`,diy:`diy-latn-id`,diz:`diz-latn-cd`,dja:`dja-latn-au`,djb:`djb-latn-au`,djc:`djc-latn-td`,djd:`djd-latn-au`,dje:`dje-latn-ne`,djf:`djf-latn-au`,dji:`dji-latn-au`,djj:`djj-latn-au`,djk:`djk-latn-sr`,djm:`djm-latn-ml`,djn:`djn-latn-au`,djo:`djo-latn-id`,djr:`djr-latn-au`,dju:`dju-latn-pg`,djw:`djw-latn-au`,dka:`dka-tibt-bt`,dkg:`dkg-latn-ng`,dkk:`dkk-latn-id`,dkr:`dkr-latn-my`,dks:`dks-latn-ss`,dkx:`dkx-latn-cm`,dlg:`dlg-cyrl-ru`,dlm:`dlm-latn-hr`,dln:`dln-latn-in`,dma:`dma-latn-ga`,dmb:`dmb-latn-ml`,dmc:`dmc-latn-pg`,dmd:`dmd-latn-au`,dme:`dme-latn-cm`,dmf:`dmf-medf-ng`,dmg:`dmg-latn-my`,dmk:`dmk-arab-pk`,dml:`dml-arab-pk`,dmm:`dmm-latn-cm`,dmo:`dmo-latn-cm`,dmr:`dmr-latn-id`,dms:`dms-latn-id`,dmu:`dmu-latn-id`,dmv:`dmv-latn-my`,dmw:`dmw-latn-au`,dmx:`dmx-latn-mz`,dmy:`dmy-latn-id`,dna:`dna-latn-id`,dnd:`dnd-latn-pg`,dne:`dne-latn-tz`,dng:`dng-cyrl-kg`,"dng-arab":`dng-arab-kg`,dni:`dni-latn-id`,dnj:`dnj-latn-ci`,dnk:`dnk-latn-id`,dnn:`dnn-latn-bf`,dno:`dno-latn-cd`,dnr:`dnr-latn-pg`,dnt:`dnt-latn-id`,dnu:`dnu-mymr-mm`,dnv:`dnv-mymr-mm`,dnw:`dnw-latn-id`,dny:`dny-latn-br`,doa:`doa-latn-pg`,dob:`dob-latn-zz`,doc:`doc-latn-cn`,doe:`doe-latn-tz`,dof:`dof-latn-pg`,doh:`doh-latn-ng`,doi:`doi-deva-in`,dok:`dok-latn-id`,dol:`dol-latn-pg`,don:`don-latn-pg`,doo:`doo-latn-cd`,dop:`dop-latn-zz`,dor:`dor-latn-sb`,dos:`dos-latn-bf`,dot:`dot-latn-ng`,dov:`dov-latn-zw`,dow:`dow-latn-zz`,dox:`dox-ethi-et`,doy:`doy-latn-gh`,dpp:`dpp-latn-my`,drc:`drc-latn-pt`,dre:`dre-tibt-np`,drg:`drg-latn-my`,drh:`drh-mong-cn`,dri:`dri-latn-zz`,drl:`drl-latn-au`,drn:`drn-latn-id`,dro:`dro-latn-my`,drq:`drq-deva-np`,drs:`drs-ethi-zz`,drt:`drt-latn-nl`,dru:`dru-latn-tw`,dry:`dry-deva-np`,dsb:`dsb-latn-de`,dsh:`dsh-latn-ke`,dsi:`dsi-latn-td`,dsn:`dsn-latn-id`,dso:`dso-orya-in`,dsq:`dsq-latn-ml`,"dsq-arab":`dsq-arab-ml`,dta:`dta-latn-cn`,"dta-cyrl":`dta-cyrl-cn`,"dta-hans":`dta-hans-cn`,dtb:`dtb-latn-my`,dtd:`dtd-latn-ca`,dth:`dth-latn-au`,dti:`dti-latn-ml`,dtk:`dtk-latn-ml`,dtm:`dtm-latn-ml`,dto:`dto-latn-ml`,dtp:`dtp-latn-my`,dtr:`dtr-latn-my`,dts:`dts-latn-zz`,dtt:`dtt-latn-ml`,dtu:`dtu-latn-ml`,dty:`dty-deva-np`,dua:`dua-latn-cm`,dub:`dub-gujr-in`,duc:`duc-latn-zz`,dud:`dud-latn-zz`,due:`due-latn-ph`,duf:`duf-latn-nc`,dug:`dug-latn-zz`,duh:`duh-deva-in`,"duh-gujr":`duh-gujr-in`,dui:`dui-latn-pg`,duk:`duk-latn-pg`,dul:`dul-latn-ph`,dum:`dum-latn-nl`,dun:`dun-latn-id`,duo:`duo-latn-ph`,dup:`dup-latn-id`,duq:`duq-latn-id`,dur:`dur-latn-cm`,dus:`dus-deva-np`,duu:`duu-latn-cn`,duv:`duv-latn-id`,duw:`duw-latn-id`,dux:`dux-latn-ml`,duy:`duy-latn-ph`,duz:`duz-latn-cm`,dv:`dv-thaa-mv`,dva:`dva-latn-zz`,dwa:`dwa-latn-ng`,dwk:`dwk-orya-in`,dwr:`dwr-latn-et`,"dwr-ethi":`dwr-ethi-et`,dws:`dws-latn-001`,dwu:`dwu-latn-au`,dww:`dww-latn-zz`,dwy:`dwy-latn-au`,dwz:`dwz-deva-np`,dya:`dya-latn-bf`,dyb:`dyb-latn-au`,dyd:`dyd-latn-au`,dyg:`dyg-latn-ph`,dyi:`dyi-latn-ci`,dym:`dym-latn-ml`,dyn:`dyn-latn-au`,dyo:`dyo-latn-sn`,dyu:`dyu-latn-bf`,dyy:`dyy-latn-au`,dz:`dz-tibt-bt`,dza:`dza-latn-ng`,dze:`dze-latn-au`,dzg:`dzg-latn-zz`,dzl:`dzl-tibt-bt`,dzn:`dzn-latn-cd`,eaa:`eaa-latn-au`,ebc:`ebc-latn-id`,ebg:`ebg-latn-ng`,ebk:`ebk-latn-ph`,ebo:`ebo-latn-cg`,ebr:`ebr-latn-ci`,ebu:`ebu-latn-ke`,ecr:`ecr-grek-gr`,ecy:`ecy-cprt-cy`,ee:`ee-latn-gh`,efa:`efa-latn-ng`,efe:`efe-latn-cd`,efi:`efi-latn-ng`,ega:`ega-latn-ci`,egl:`egl-latn-it`,egm:`egm-latn-tz`,ego:`ego-latn-ng`,egy:`egy-egyp-eg`,ehu:`ehu-latn-ng`,eip:`eip-latn-id`,eit:`eit-latn-pg`,eiv:`eiv-latn-pg`,eja:`eja-latn-gw`,eka:`eka-latn-zz`,eke:`eke-latn-ng`,ekg:`ekg-latn-id`,eki:`eki-latn-ng`,ekl:`ekl-latn-bd`,ekm:`ekm-latn-cm`,eko:`eko-latn-mz`,"eko-arab":`eko-arab-mz`,ekp:`ekp-latn-ng`,ekr:`ekr-latn-ng`,eky:`eky-kali-mm`,el:`el-grek-gr`,ele:`ele-latn-pg`,elk:`elk-latn-pg`,elm:`elm-latn-ng`,elo:`elo-latn-ke`,elu:`elu-latn-pg`,ema:`ema-latn-zz`,emb:`emb-latn-id`,eme:`eme-latn-gf`,emg:`emg-deva-np`,emi:`emi-latn-zz`,emm:`emm-latn-mx`,emn:`emn-latn-cm`,emp:`emp-latn-pa`,ems:`ems-latn-us`,"ems-cyrl":`ems-cyrl-us`,emu:`emu-deva-in`,emw:`emw-latn-id`,emx:`emx-latn-fr`,emz:`emz-latn-cm`,en:`en-latn-us`,"en-shaw":`en-shaw-gb`,ena:`ena-latn-pg`,enb:`enb-latn-ke`,enc:`enc-latn-vn`,end:`end-latn-id`,enf:`enf-cyrl-ru`,enh:`enh-cyrl-ru`,enl:`enl-latn-py`,enm:`enm-latn-gb`,enn:`enn-latn-zz`,eno:`eno-latn-id`,enq:`enq-latn-zz`,enr:`enr-latn-id`,env:`env-latn-ng`,enw:`enw-latn-ng`,enx:`enx-latn-py`,eo:`eo-latn-001`,eot:`eot-latn-ci`,epi:`epi-latn-ng`,era:`era-taml-in`,erg:`erg-latn-vu`,erh:`erh-latn-ng`,eri:`eri-latn-zz`,erk:`erk-latn-vu`,err:`err-latn-au`,ert:`ert-latn-id`,erw:`erw-latn-id`,es:`es-latn-es`,ese:`ese-latn-bo`,esg:`esg-gonm-in`,esh:`esh-arab-ir`,esi:`esi-latn-us`,esm:`esm-latn-ci`,ess:`ess-latn-us`,"ess-cyrl":`ess-cyrl-us`,esu:`esu-latn-us`,esy:`esy-latn-ph`,et:`et-latn-ee`,etb:`etb-latn-ng`,etn:`etn-latn-vu`,eto:`eto-latn-cm`,etr:`etr-latn-zz`,ets:`ets-latn-ng`,ett:`ett-ital-it`,etu:`etu-latn-zz`,etx:`etx-latn-zz`,etz:`etz-latn-id`,eu:`eu-latn-es`,eve:`eve-cyrl-ru`,evh:`evh-latn-ng`,evn:`evn-cyrl-ru`,"evn-latn":`evn-latn-cn`,"evn-mong":`evn-mong-cn`,ewo:`ewo-latn-cm`,ext:`ext-latn-es`,eya:`eya-latn-us`,eyo:`eyo-latn-ke`,eza:`eza-latn-zz`,eze:`eze-latn-ng`,fa:`fa-arab-ir`,faa:`faa-latn-zz`,fab:`fab-latn-zz`,fad:`fad-latn-pg`,faf:`faf-latn-sb`,fag:`fag-latn-zz`,fah:`fah-latn-ng`,fai:`fai-latn-zz`,faj:`faj-latn-pg`,fak:`fak-latn-cm`,fal:`fal-latn-cm`,fam:`fam-latn-ng`,fan:`fan-latn-gq`,fap:`fap-latn-sn`,far:`far-latn-sb`,fau:`fau-latn-id`,fax:`fax-latn-es`,fay:`fay-arab-ir`,faz:`faz-arab-ir`,fbl:`fbl-latn-ph`,fer:`fer-latn-ss`,ff:`ff-latn-sn`,"ff-adlm":`ff-adlm-gn`,ffi:`ffi-latn-zz`,ffm:`ffm-latn-ml`,fgr:`fgr-latn-td`,fi:`fi-latn-fi`,fia:`fia-arab-sd`,fie:`fie-latn-ng`,fif:`fif-latn-sa`,fil:`fil-latn-ph`,fip:`fip-latn-tz`,fir:`fir-latn-ng`,fit:`fit-latn-se`,fiw:`fiw-latn-pg`,fj:`fj-latn-fj`,fkk:`fkk-latn-ng`,fkv:`fkv-latn-no`,fla:`fla-latn-us`,flh:`flh-latn-id`,fli:`fli-latn-ng`,fll:`fll-latn-cm`,fln:`fln-latn-au`,flr:`flr-latn-zz`,fly:`fly-latn-za`,fmp:`fmp-latn-zz`,fmu:`fmu-deva-in`,fnb:`fnb-latn-vu`,fng:`fng-latn-za`,fni:`fni-latn-td`,fo:`fo-latn-fo`,fod:`fod-latn-zz`,foi:`foi-latn-pg`,fom:`fom-latn-cd`,fon:`fon-latn-bj`,for:`for-latn-zz`,fos:`fos-latn-tw`,fpe:`fpe-latn-zz`,fqs:`fqs-latn-zz`,fr:`fr-latn-fr`,frc:`frc-latn-us`,frd:`frd-latn-id`,frk:`frk-latn-de`,frm:`frm-latn-fr`,fro:`fro-latn-fr`,frp:`frp-latn-fr`,frq:`frq-latn-pg`,frr:`frr-latn-de`,frs:`frs-latn-de`,frt:`frt-latn-vu`,fub:`fub-arab-cm`,fud:`fud-latn-wf`,fue:`fue-latn-zz`,fuf:`fuf-latn-gn`,fuh:`fuh-latn-zz`,fui:`fui-latn-td`,fum:`fum-latn-ng`,fun:`fun-latn-br`,fuq:`fuq-latn-ne`,fur:`fur-latn-it`,fut:`fut-latn-vu`,fuu:`fuu-latn-cd`,fuv:`fuv-latn-ng`,fuy:`fuy-latn-zz`,fvr:`fvr-latn-sd`,fwa:`fwa-latn-nc`,fwe:`fwe-latn-na`,fy:`fy-latn-nl`,ga:`ga-latn-ie`,gaa:`gaa-latn-gh`,gab:`gab-latn-td`,gac:`gac-latn-in`,"gac-deva":`gac-deva-in`,gad:`gad-latn-ph`,gae:`gae-latn-ve`,gaf:`gaf-latn-zz`,gag:`gag-latn-md`,gah:`gah-latn-zz`,gai:`gai-latn-pg`,gaj:`gaj-latn-zz`,gak:`gak-latn-id`,gal:`gal-latn-tl`,gam:`gam-latn-zz`,gan:`gan-hans-cn`,gao:`gao-latn-pg`,gap:`gap-latn-pg`,gaq:`gaq-orya-in`,gar:`gar-latn-pg`,gas:`gas-gujr-in`,gat:`gat-latn-pg`,gau:`gau-telu-in`,gaw:`gaw-latn-zz`,gax:`gax-latn-et`,"gax-ethi":`gax-ethi-et`,gay:`gay-latn-id`,gba:`gba-latn-zz`,gbb:`gbb-latn-au`,gbd:`gbd-latn-au`,gbe:`gbe-latn-pg`,gbf:`gbf-latn-zz`,gbg:`gbg-latn-cf`,gbh:`gbh-latn-bj`,gbi:`gbi-latn-id`,gbj:`gbj-orya-in`,gbk:`gbk-deva-in`,"gbk-takr":`gbk-takr-in`,gbl:`gbl-gujr-in`,"gbl-deva":`gbl-deva-in`,gbm:`gbm-deva-in`,gbn:`gbn-latn-ss`,gbp:`gbp-latn-cf`,gbq:`gbq-latn-cf`,gbr:`gbr-latn-ng`,gbs:`gbs-latn-bj`,gbu:`gbu-latn-au`,gbv:`gbv-latn-cf`,gbw:`gbw-latn-au`,gbx:`gbx-latn-bj`,gby:`gby-latn-zz`,gbz:`gbz-arab-ir`,gcc:`gcc-latn-pg`,gcd:`gcd-latn-au`,gcf:`gcf-latn-gp`,gcl:`gcl-latn-gd`,gcn:`gcn-latn-pg`,gcr:`gcr-latn-gf`,gct:`gct-latn-ve`,gd:`gd-latn-gb`,gdb:`gdb-orya-in`,"gdb-telu":`gdb-telu-in`,gdc:`gdc-latn-au`,gdd:`gdd-latn-pg`,gde:`gde-latn-zz`,gdf:`gdf-latn-ng`,gdg:`gdg-latn-ph`,gdh:`gdh-latn-au`,gdi:`gdi-latn-cf`,gdj:`gdj-latn-au`,gdk:`gdk-latn-td`,gdl:`gdl-latn-et`,"gdl-ethi":`gdl-ethi-et`,gdm:`gdm-latn-td`,gdn:`gdn-latn-zz`,gdo:`gdo-cyrl-ru`,gdq:`gdq-latn-ye`,gdr:`gdr-latn-zz`,gdt:`gdt-latn-au`,gdu:`gdu-latn-ng`,gdx:`gdx-deva-in`,gea:`gea-latn-ng`,geb:`geb-latn-zz`,gec:`gec-latn-lr`,ged:`ged-latn-ng`,gef:`gef-latn-id`,geg:`geg-latn-ng`,geh:`geh-latn-ca`,gei:`gei-latn-id`,gej:`gej-latn-zz`,gek:`gek-latn-ng`,gel:`gel-latn-zz`,geq:`geq-latn-cf`,ges:`ges-latn-id`,gev:`gev-latn-ga`,gew:`gew-latn-ng`,gex:`gex-latn-so`,gey:`gey-latn-cd`,gez:`gez-ethi-et`,gfk:`gfk-latn-zz`,gga:`gga-latn-sb`,ggb:`ggb-latn-lr`,ggd:`ggd-latn-au`,gge:`gge-latn-au`,ggg:`ggg-arab-pk`,ggk:`ggk-latn-au`,ggl:`ggl-latn-pg`,ggn:`ggn-deva-np`,ggt:`ggt-latn-pg`,ggu:`ggu-latn-ci`,ggw:`ggw-latn-pg`,gha:`gha-arab-ly`,"gha-latn":`gha-latn-ly`,"gha-tfng":`gha-tfng-ly`,ghc:`ghc-latn-gb`,ghe:`ghe-deva-np`,ghk:`ghk-latn-mm`,ghn:`ghn-latn-sb`,ghr:`ghr-arab-pk`,ghs:`ghs-latn-zz`,ght:`ght-tibt-np`,gia:`gia-latn-au`,gib:`gib-latn-ng`,gic:`gic-latn-za`,gid:`gid-latn-cm`,gie:`gie-latn-ci`,gig:`gig-arab-pk`,gih:`gih-latn-au`,gil:`gil-latn-ki`,gim:`gim-latn-zz`,gin:`gin-cyrl-ru`,gip:`gip-latn-pg`,giq:`giq-latn-vn`,gir:`gir-latn-vn`,gis:`gis-latn-cm`,git:`git-latn-ca`,gix:`gix-latn-cd`,giy:`giy-latn-au`,giz:`giz-latn-cm`,gjk:`gjk-arab-pk`,gjm:`gjm-latn-au`,gjn:`gjn-latn-zz`,gjr:`gjr-latn-au`,gju:`gju-arab-pk`,gka:`gka-latn-pg`,gkd:`gkd-latn-pg`,gke:`gke-latn-cm`,gkn:`gkn-latn-zz`,gko:`gko-latn-au`,gkp:`gkp-latn-zz`,gku:`gku-latn-za`,gl:`gl-latn-es`,glb:`glb-latn-ng`,glc:`glc-latn-td`,gld:`gld-cyrl-ru`,glh:`glh-arab-af`,glj:`glj-latn-td`,glk:`glk-arab-ir`,gll:`gll-latn-au`,glo:`glo-latn-ng`,glr:`glr-latn-lr`,glu:`glu-latn-td`,glw:`glw-latn-ng`,gma:`gma-latn-au`,gmb:`gmb-latn-sb`,gmd:`gmd-latn-ng`,gmg:`gmg-latn-pg`,gmh:`gmh-latn-de`,gmm:`gmm-latn-zz`,gmn:`gmn-latn-cm`,gmr:`gmr-latn-au`,gmu:`gmu-latn-pg`,gmv:`gmv-ethi-zz`,gmx:`gmx-latn-tz`,gmy:`gmy-linb-gr`,gmz:`gmz-latn-ng`,gn:`gn-latn-py`,gna:`gna-latn-bf`,gnb:`gnb-latn-in`,gnc:`gnc-latn-es`,gnd:`gnd-latn-zz`,gne:`gne-latn-ng`,gng:`gng-latn-zz`,gnh:`gnh-latn-ng`,gni:`gni-latn-au`,gnj:`gnj-latn-ci`,gnk:`gnk-latn-bw`,gnl:`gnl-latn-au`,gnm:`gnm-latn-pg`,gnn:`gnn-latn-au`,gnq:`gnq-latn-my`,gnr:`gnr-latn-au`,gnt:`gnt-latn-pg`,gnu:`gnu-latn-pg`,gnw:`gnw-latn-bo`,gnz:`gnz-latn-cf`,goa:`goa-latn-ci`,gob:`gob-latn-co`,goc:`goc-latn-pg`,god:`god-latn-zz`,goe:`goe-tibt-bt`,gof:`gof-ethi-zz`,gog:`gog-latn-tz`,goh:`goh-latn-de`,goi:`goi-latn-zz`,gok:`gok-deva-in`,gol:`gol-latn-lr`,gom:`gom-deva-in`,gon:`gon-telu-in`,goo:`goo-latn-fj`,gop:`gop-latn-id`,goq:`goq-latn-id`,gor:`gor-latn-id`,gos:`gos-latn-nl`,got:`got-goth-ua`,gou:`gou-latn-cm`,gov:`gov-latn-ci`,gow:`gow-latn-tz`,gox:`gox-latn-cd`,goy:`goy-latn-td`,gpa:`gpa-latn-ng`,gpe:`gpe-latn-gh`,gpn:`gpn-latn-pg`,gqa:`gqa-latn-ng`,gqn:`gqn-latn-br`,gqr:`gqr-latn-td`,gra:`gra-deva-in`,"gra-gujr":`gra-gujr-in`,grb:`grb-latn-zz`,grc:`grc-cprt-cy`,"grc-linb":`grc-linb-gr`,grd:`grd-latn-ng`,grg:`grg-latn-pg`,grh:`grh-latn-ng`,gri:`gri-latn-sb`,grj:`grj-latn-lr`,grm:`grm-latn-my`,grq:`grq-latn-pg`,grs:`grs-latn-id`,grt:`grt-beng-in`,gru:`gru-ethi-et`,"gru-latn":`gru-latn-et`,grv:`grv-latn-lr`,grw:`grw-latn-zz`,grx:`grx-latn-pg`,gry:`gry-latn-lr`,grz:`grz-latn-pg`,gsl:`gsl-latn-sn`,gsn:`gsn-latn-pg`,gso:`gso-latn-cf`,gsp:`gsp-latn-pg`,gsw:`gsw-latn-ch`,gta:`gta-latn-br`,gtu:`gtu-latn-au`,gu:`gu-gujr-in`,gua:`gua-latn-ng`,gub:`gub-latn-br`,guc:`guc-latn-co`,gud:`gud-latn-zz`,gue:`gue-latn-au`,guf:`guf-latn-au`,guh:`guh-latn-co`,gui:`gui-latn-bo`,guk:`guk-latn-et`,"guk-ethi":`guk-ethi-et`,gul:`gul-latn-us`,gum:`gum-latn-co`,gun:`gun-latn-br`,guo:`guo-latn-co`,gup:`gup-latn-au`,guq:`guq-latn-py`,gur:`gur-latn-gh`,gut:`gut-latn-cr`,guu:`guu-latn-ve`,guw:`guw-latn-zz`,gux:`gux-latn-zz`,guz:`guz-latn-ke`,gv:`gv-latn-im`,gva:`gva-latn-py`,gvc:`gvc-latn-br`,gve:`gve-latn-pg`,gvf:`gvf-latn-zz`,gvj:`gvj-latn-br`,gvl:`gvl-latn-td`,gvm:`gvm-latn-ng`,gvn:`gvn-latn-au`,gvo:`gvo-latn-br`,gvp:`gvp-latn-br`,gvr:`gvr-deva-np`,gvs:`gvs-latn-zz`,gvy:`gvy-latn-au`,gwa:`gwa-latn-ci`,gwb:`gwb-latn-ng`,gwc:`gwc-arab-zz`,gwd:`gwd-latn-et`,gwe:`gwe-latn-tz`,gwf:`gwf-arab-pk`,gwg:`gwg-latn-ng`,gwi:`gwi-latn-ca`,gwj:`gwj-latn-bw`,gwm:`gwm-latn-au`,gwn:`gwn-latn-ng`,gwr:`gwr-latn-ug`,gwt:`gwt-arab-zz`,gwu:`gwu-latn-au`,gww:`gww-latn-au`,gwx:`gwx-latn-gh`,gxx:`gxx-latn-ci`,gyb:`gyb-latn-pg`,gyd:`gyd-latn-au`,gye:`gye-latn-ng`,gyf:`gyf-latn-au`,gyg:`gyg-latn-cf`,gyi:`gyi-latn-zz`,gyl:`gyl-latn-et`,"gyl-ethi":`gyl-ethi-et`,gym:`gym-latn-pa`,gyn:`gyn-latn-gy`,gyo:`gyo-deva-np`,gyr:`gyr-latn-bo`,gyy:`gyy-latn-au`,gyz:`gyz-latn-ng`,gza:`gza-latn-sd`,gzi:`gzi-arab-ir`,gzn:`gzn-latn-id`,ha:`ha-latn-ng`,"ha-cm":`ha-arab-cm`,"ha-sd":`ha-arab-sd`,haa:`haa-latn-us`,hac:`hac-arab-ir`,had:`had-latn-id`,hae:`hae-latn-et`,hag:`hag-latn-zz`,hah:`hah-latn-pg`,hai:`hai-latn-ca`,haj:`haj-latn-in`,"haj-beng":`haj-beng-in`,hak:`hak-hans-cn`,hal:`hal-latn-vn`,ham:`ham-latn-zz`,han:`han-latn-tz`,hao:`hao-latn-pg`,hap:`hap-latn-id`,haq:`haq-latn-tz`,har:`har-ethi-et`,"har-arab":`har-arab-et`,"har-latn":`har-latn-et`,has:`has-latn-ca`,hav:`hav-latn-cd`,haw:`haw-latn-us`,hax:`hax-latn-ca`,hay:`hay-latn-tz`,haz:`haz-arab-af`,hba:`hba-latn-cd`,hbb:`hbb-latn-zz`,hbn:`hbn-latn-sd`,hbo:`hbo-hebr-il`,hbu:`hbu-latn-tl`,hch:`hch-latn-mx`,hdy:`hdy-ethi-zz`,he:`he-hebr-il`,hed:`hed-latn-td`,heg:`heg-latn-id`,heh:`heh-latn-tz`,hei:`hei-latn-ca`,hem:`hem-latn-cd`,hgm:`hgm-latn-na`,hgw:`hgw-latn-pg`,hhi:`hhi-latn-pg`,hhr:`hhr-latn-sn`,hhy:`hhy-latn-zz`,hi:`hi-deva-in`,"hi-latn":`hi-latn-in`,hia:`hia-latn-zz`,hib:`hib-latn-pe`,hid:`hid-latn-us`,hif:`hif-latn-fj`,hig:`hig-latn-zz`,hih:`hih-latn-zz`,hii:`hii-takr-in`,"hii-deva":`hii-deva-in`,hij:`hij-latn-cm`,hik:`hik-latn-id`,hil:`hil-latn-ph`,hio:`hio-latn-bw`,hir:`hir-latn-br`,hit:`hit-xsux-tr`,hiw:`hiw-latn-vu`,hix:`hix-latn-br`,hji:`hji-latn-id`,hka:`hka-latn-tz`,hke:`hke-latn-cd`,hkh:`hkh-arab-in`,"hkh-deva":`hkh-deva-in`,"hkh-latn":`hkh-latn-in`,hkk:`hkk-latn-pg`,hla:`hla-latn-zz`,hlb:`hlb-deva-in`,hld:`hld-latn-vn`,hlt:`hlt-latn-mm`,hlu:`hlu-hluw-tr`,hma:`hma-latn-cn`,hmb:`hmb-latn-ml`,hmd:`hmd-plrd-cn`,hmf:`hmf-latn-vn`,hmj:`hmj-bopo-cn`,hmm:`hmm-latn-cn`,hmn:`hmn-latn-cn`,"hmn-bopo":`hmn-bopo-cn`,"hmn-hmng":`hmn-hmng-cn`,hmp:`hmp-latn-cn`,hmq:`hmq-bopo-cn`,hmr:`hmr-latn-in`,hms:`hms-latn-cn`,hmt:`hmt-latn-zz`,hmu:`hmu-latn-id`,hmv:`hmv-latn-vn`,hmw:`hmw-latn-cn`,hmy:`hmy-latn-cn`,hmz:`hmz-latn-cn`,"hmz-plrd":`hmz-plrd-cn`,hna:`hna-latn-cm`,hnd:`hnd-arab-pk`,hne:`hne-deva-in`,hng:`hng-latn-ao`,hnh:`hnh-latn-bw`,hni:`hni-latn-cn`,hnj:`hnj-hmnp-us`,"hnj-au":`hnj-laoo-au`,"hnj-cn":`hnj-laoo-cn`,"hnj-fr":`hnj-laoo-fr`,"hnj-gf":`hnj-laoo-gf`,"hnj-la":`hnj-laoo-la`,"hnj-laoo":`hnj-laoo-la`,"hnj-mm":`hnj-laoo-mm`,"hnj-sr":`hnj-laoo-sr`,"hnj-th":`hnj-laoo-th`,"hnj-us":`hnj-hmnp-us`,"hnj-vn":`hnj-laoo-vn`,hnn:`hnn-latn-ph`,hno:`hno-arab-pk`,hns:`hns-latn-sr`,ho:`ho-latn-pg`,hoa:`hoa-latn-sb`,hob:`hob-latn-pg`,hoc:`hoc-deva-in`,hod:`hod-latn-ng`,hoe:`hoe-latn-ng`,hoh:`hoh-arab-om`,hoi:`hoi-latn-us`,hoj:`hoj-deva-in`,hol:`hol-latn-ao`,hom:`hom-latn-ss`,hoo:`hoo-latn-cd`,hop:`hop-latn-us`,hor:`hor-latn-td`,hot:`hot-latn-zz`,hov:`hov-latn-id`,how:`how-hani-cn`,hoy:`hoy-deva-in`,hpo:`hpo-mymr-mm`,hr:`hr-latn-hr`,hra:`hra-latn-in`,hrc:`hrc-latn-pg`,hre:`hre-latn-vn`,hrk:`hrk-latn-id`,hrm:`hrm-latn-cn`,"hrm-hmng":`hrm-hmng-cn`,hro:`hro-latn-vn`,hrp:`hrp-latn-au`,hrt:`hrt-syrc-tr`,hru:`hru-latn-in`,hrw:`hrw-latn-pg`,hrx:`hrx-latn-br`,hrz:`hrz-arab-ir`,hsb:`hsb-latn-de`,hsn:`hsn-hans-cn`,hss:`hss-arab-om`,ht:`ht-latn-ht`,hti:`hti-latn-id`,hto:`hto-latn-co`,hts:`hts-latn-tz`,htu:`htu-latn-id`,htx:`htx-xsux-tr`,hu:`hu-latn-hu`,hub:`hub-latn-pe`,huc:`huc-latn-bw`,hud:`hud-latn-id`,hue:`hue-latn-mx`,huf:`huf-latn-pg`,hug:`hug-latn-pe`,huh:`huh-latn-cl`,hui:`hui-latn-zz`,huk:`huk-latn-id`,hul:`hul-latn-pg`,hum:`hum-latn-cd`,hup:`hup-latn-us`,hur:`hur-latn-ca`,hus:`hus-latn-mx`,hut:`hut-deva-np`,"hut-tibt":`hut-tibt-np`,huu:`huu-latn-pe`,huv:`huv-latn-mx`,huw:`huw-latn-id`,hux:`hux-latn-pe`,huy:`huy-hebr-il`,huz:`huz-cyrl-ru`,hvc:`hvc-latn-ht`,hve:`hve-latn-mx`,hvk:`hvk-latn-nc`,hvn:`hvn-latn-id`,hvv:`hvv-latn-mx`,hwa:`hwa-latn-ci`,hwc:`hwc-latn-us`,hwo:`hwo-latn-ng`,hy:`hy-armn-am`,hya:`hya-latn-cm`,hyw:`hyw-armn-am`,hz:`hz-latn-na`,ia:`ia-latn-001`,iai:`iai-latn-nc`,ian:`ian-latn-zz`,iar:`iar-latn-zz`,iba:`iba-latn-my`,ibb:`ibb-latn-ng`,ibd:`ibd-latn-au`,ibe:`ibe-latn-ng`,ibg:`ibg-latn-ph`,ibh:`ibh-latn-vn`,ibl:`ibl-latn-ph`,ibm:`ibm-latn-ng`,ibn:`ibn-latn-ng`,ibr:`ibr-latn-ng`,ibu:`ibu-latn-id`,iby:`iby-latn-zz`,ica:`ica-latn-zz`,ich:`ich-latn-zz`,icr:`icr-latn-co`,id:`id-latn-id`,ida:`ida-latn-ke`,idb:`idb-latn-in`,idc:`idc-latn-ng`,idd:`idd-latn-zz`,ide:`ide-latn-ng`,idi:`idi-latn-zz`,idr:`idr-latn-ss`,ids:`ids-latn-ng`,idt:`idt-latn-tl`,idu:`idu-latn-zz`,ie:`ie-latn-001`,ifa:`ifa-latn-ph`,ifb:`ifb-latn-ph`,ife:`ife-latn-tg`,iff:`iff-latn-vu`,ifk:`ifk-latn-ph`,ifm:`ifm-latn-cg`,ifu:`ifu-latn-ph`,ify:`ify-latn-ph`,ig:`ig-latn-ng`,igb:`igb-latn-zz`,ige:`ige-latn-zz`,igg:`igg-latn-pg`,igl:`igl-latn-ng`,igm:`igm-latn-pg`,ign:`ign-latn-bo`,igo:`igo-latn-pg`,igs:`igs-latn-001`,"igs-grek":`igs-grek-001`,igw:`igw-latn-ng`,ihb:`ihb-latn-id`,ihi:`ihi-latn-ng`,ihp:`ihp-latn-id`,ihw:`ihw-latn-au`,ii:`ii-yiii-cn`,iin:`iin-latn-au`,ijc:`ijc-latn-ng`,ije:`ije-latn-ng`,ijj:`ijj-latn-zz`,ijn:`ijn-latn-ng`,ijs:`ijs-latn-ng`,ik:`ik-latn-us`,iki:`iki-latn-ng`,ikk:`ikk-latn-zz`,ikl:`ikl-latn-ng`,iko:`iko-latn-ng`,ikp:`ikp-latn-ng`,ikr:`ikr-latn-au`,ikt:`ikt-latn-ca`,"ikt-cans":`ikt-cans-ca`,ikv:`ikv-latn-ng`,ikw:`ikw-latn-zz`,ikx:`ikx-latn-zz`,ikz:`ikz-latn-tz`,ila:`ila-latn-id`,ilb:`ilb-latn-zm`,ilg:`ilg-latn-au`,ili:`ili-latn-cn`,"ili-arab":`ili-arab-cn`,"ili-cyrl":`ili-cyrl-kz`,ilk:`ilk-latn-ph`,ilm:`ilm-latn-my`,ilo:`ilo-latn-ph`,ilp:`ilp-latn-ph`,ilu:`ilu-latn-id`,ilv:`ilv-latn-ng`,imi:`imi-latn-pg`,iml:`iml-latn-us`,imn:`imn-latn-pg`,imo:`imo-latn-zz`,imr:`imr-latn-id`,ims:`ims-latn-it`,imt:`imt-latn-ss`,imy:`imy-lyci-tr`,in:`in-latn-id`,inb:`inb-latn-co`,ing:`ing-latn-us`,inh:`inh-cyrl-ru`,inj:`inj-latn-co`,inn:`inn-latn-ph`,ino:`ino-latn-pg`,inp:`inp-latn-pe`,int:`int-mymr-mm`,io:`io-latn-001`,ior:`ior-ethi-et`,iou:`iou-latn-zz`,iow:`iow-latn-us`,ipi:`ipi-latn-pg`,ipo:`ipo-latn-pg`,iqu:`iqu-latn-pe`,iqw:`iqw-latn-ng`,ire:`ire-latn-id`,irh:`irh-latn-id`,iri:`iri-latn-zz`,irk:`irk-latn-tz`,irn:`irn-latn-br`,iru:`iru-taml-in`,"iru-mlym":`iru-mlym-in`,irx:`irx-latn-id`,iry:`iry-latn-ph`,is:`is-latn-is`,isa:`isa-latn-pg`,isc:`isc-latn-pe`,isd:`isd-latn-ph`,ish:`ish-latn-ng`,isi:`isi-latn-ng`,isk:`isk-arab-af`,"isk-cyrl":`isk-cyrl-tj`,ism:`ism-latn-id`,isn:`isn-latn-tz`,iso:`iso-latn-ng`,ist:`ist-latn-hr`,isu:`isu-latn-cm`,it:`it-latn-it`,itb:`itb-latn-ph`,itd:`itd-latn-id`,ite:`ite-latn-bo`,iti:`iti-latn-ph`,itk:`itk-hebr-it`,itl:`itl-cyrl-ru`,itm:`itm-latn-ng`,ito:`ito-latn-bo`,itr:`itr-latn-pg`,its:`its-latn-ng`,itt:`itt-latn-ph`,itv:`itv-latn-ph`,itw:`itw-latn-ng`,itx:`itx-latn-id`,ity:`ity-latn-ph`,itz:`itz-latn-gt`,iu:`iu-cans-ca`,ium:`ium-latn-cn`,"ium-hani":`ium-hani-cn`,"ium-laoo":`ium-laoo-la`,"ium-thai":`ium-thai-th`,ivb:`ivb-latn-ph`,ivv:`ivv-latn-ph`,iw:`iw-hebr-il`,iwk:`iwk-latn-ph`,iwm:`iwm-latn-zz`,iwo:`iwo-latn-id`,iws:`iws-latn-zz`,ixc:`ixc-latn-mx`,ixl:`ixl-latn-gt`,iya:`iya-latn-ng`,iyo:`iyo-latn-cm`,iyx:`iyx-latn-cg`,izh:`izh-latn-ru`,izi:`izi-latn-zz`,izr:`izr-latn-ng`,izz:`izz-latn-ng`,ja:`ja-jpan-jp`,jaa:`jaa-latn-br`,jab:`jab-latn-zz`,jac:`jac-latn-gt`,jad:`jad-arab-gn`,jae:`jae-latn-pg`,jaf:`jaf-latn-ng`,jah:`jah-latn-my`,jaj:`jaj-latn-sb`,jak:`jak-latn-my`,jal:`jal-latn-id`,jam:`jam-latn-jm`,jan:`jan-latn-au`,jao:`jao-latn-au`,jaq:`jaq-latn-id`,jar:`jar-latn-zz`,jas:`jas-latn-nc`,jat:`jat-arab-af`,jau:`jau-latn-id`,jax:`jax-latn-id`,jay:`jay-latn-au`,jaz:`jaz-latn-nc`,jbe:`jbe-hebr-il`,jbi:`jbi-latn-au`,jbj:`jbj-latn-id`,jbk:`jbk-latn-pg`,jbm:`jbm-latn-ng`,jbn:`jbn-arab-ly`,jbo:`jbo-latn-001`,jbr:`jbr-latn-id`,jbt:`jbt-latn-br`,jbu:`jbu-latn-zz`,jbw:`jbw-latn-au`,jct:`jct-cyrl-ua`,"jct-latn":`jct-latn-ua`,jda:`jda-tibt-in`,jdg:`jdg-arab-pk`,jdt:`jdt-cyrl-ru`,"jdt-hebr":`jdt-hebr-ru`,"jdt-latn":`jdt-latn-az`,jeb:`jeb-latn-pe`,jee:`jee-deva-np`,jeh:`jeh-latn-vn`,"jeh-laoo":`jeh-laoo-la`,jei:`jei-latn-id`,jek:`jek-latn-ci`,jel:`jel-latn-id`,jen:`jen-latn-zz`,jer:`jer-latn-ng`,jet:`jet-latn-pg`,jeu:`jeu-latn-td`,jgb:`jgb-latn-cd`,jge:`jge-geor-ge`,"jge-hebr":`jge-hebr-il`,jgk:`jgk-latn-zz`,jgo:`jgo-latn-cm`,jhi:`jhi-latn-my`,ji:`ji-hebr-ua`,jia:`jia-latn-cm`,jib:`jib-latn-zz`,jic:`jic-latn-hn`,jid:`jid-latn-ng`,jie:`jie-latn-ng`,jig:`jig-latn-au`,jil:`jil-latn-pg`,jim:`jim-latn-cm`,jit:`jit-latn-tz`,jiu:`jiu-latn-cn`,jiv:`jiv-latn-ec`,jiy:`jiy-latn-cn`,jje:`jje-hang-kr`,jjr:`jjr-latn-ng`,jka:`jka-latn-id`,jkm:`jkm-mymr-mm`,"jkm-brai":`jkm-brai-mm`,"jkm-latn":`jkm-latn-mm`,jko:`jko-latn-pg`,jku:`jku-latn-ng`,jle:`jle-latn-sd`,jma:`jma-latn-pg`,jmb:`jmb-latn-ng`,jmc:`jmc-latn-tz`,jmd:`jmd-latn-id`,jmi:`jmi-latn-ng`,jml:`jml-deva-np`,jmn:`jmn-latn-mm`,jmr:`jmr-latn-gh`,jms:`jms-latn-ng`,jmw:`jmw-latn-pg`,jmx:`jmx-latn-mx`,jna:`jna-takr-in`,jnd:`jnd-arab-pk`,jng:`jng-latn-au`,jni:`jni-latn-ng`,jnj:`jnj-latn-et`,"jnj-ethi":`jnj-ethi-et`,jnl:`jnl-deva-in`,jns:`jns-deva-in`,"jns-latn":`jns-latn-in`,"jns-takr":`jns-takr-in`,job:`job-latn-cd`,jod:`jod-latn-ci`,jog:`jog-arab-pk`,jor:`jor-latn-bo`,jow:`jow-latn-ml`,jpa:`jpa-hebr-ps`,jpr:`jpr-hebr-il`,jqr:`jqr-latn-pe`,jra:`jra-latn-zz`,jrr:`jrr-latn-ng`,jrt:`jrt-latn-ng`,jru:`jru-latn-ve`,jua:`jua-latn-br`,jub:`jub-latn-ng`,jud:`jud-latn-ci`,juh:`juh-latn-ng`,jui:`jui-latn-au`,juk:`juk-latn-ng`,jul:`jul-deva-np`,jum:`jum-latn-sd`,jun:`jun-orya-in`,juo:`juo-latn-ng`,jup:`jup-latn-br`,jur:`jur-latn-br`,jut:`jut-latn-dk`,juu:`juu-latn-ng`,juw:`juw-latn-ng`,juy:`juy-orya-in`,jv:`jv-latn-id`,jvd:`jvd-latn-id`,jvn:`jvn-latn-sr`,jw:`jw-latn-id`,jwi:`jwi-latn-gh`,jya:`jya-tibt-cn`,jye:`jye-hebr-il`,jyy:`jyy-latn-td`,ka:`ka-geor-ge`,kaa:`kaa-cyrl-uz`,kab:`kab-latn-dz`,kac:`kac-latn-mm`,kad:`kad-latn-zz`,kag:`kag-latn-my`,kah:`kah-latn-cf`,kai:`kai-latn-zz`,kaj:`kaj-latn-ng`,kak:`kak-latn-ph`,kam:`kam-latn-ke`,kao:`kao-latn-ml`,kap:`kap-cyrl-ru`,kaq:`kaq-latn-pe`,kav:`kav-latn-br`,kaw:`kaw-kawi-id`,kax:`kax-latn-id`,kay:`kay-latn-br`,kba:`kba-latn-au`,kbb:`kbb-latn-br`,kbc:`kbc-latn-br`,kbd:`kbd-cyrl-ru`,kbe:`kbe-latn-au`,kbh:`kbh-latn-co`,kbi:`kbi-latn-id`,kbj:`kbj-latn-cd`,kbk:`kbk-latn-pg`,kbl:`kbl-latn-td`,kbm:`kbm-latn-zz`,kbn:`kbn-latn-cf`,kbo:`kbo-latn-ss`,kbp:`kbp-latn-zz`,kbq:`kbq-latn-zz`,kbr:`kbr-latn-et`,"kbr-ethi":`kbr-ethi-et`,kbs:`kbs-latn-ga`,kbt:`kbt-latn-pg`,kbu:`kbu-arab-pk`,kbv:`kbv-latn-id`,kbw:`kbw-latn-pg`,kbx:`kbx-latn-zz`,kby:`kby-arab-ne`,kbz:`kbz-latn-ng`,kca:`kca-cyrl-ru`,kcb:`kcb-latn-pg`,kcc:`kcc-latn-ng`,kcd:`kcd-latn-id`,kce:`kce-latn-ng`,kcf:`kcf-latn-ng`,kcg:`kcg-latn-ng`,kch:`kch-latn-ng`,kci:`kci-latn-ng`,kcj:`kcj-latn-gw`,kck:`kck-latn-zw`,kcl:`kcl-latn-zz`,kcm:`kcm-latn-cf`,kcn:`kcn-latn-ug`,kco:`kco-latn-pg`,kcp:`kcp-latn-sd`,kcq:`kcq-latn-ng`,kcs:`kcs-latn-ng`,kct:`kct-latn-zz`,kcu:`kcu-latn-tz`,kcv:`kcv-latn-cd`,kcw:`kcw-latn-cd`,kcz:`kcz-latn-tz`,kda:`kda-latn-au`,kdc:`kdc-latn-tz`,kdd:`kdd-latn-au`,kde:`kde-latn-tz`,kdf:`kdf-latn-pg`,kdg:`kdg-latn-cd`,kdh:`kdh-latn-tg`,kdi:`kdi-latn-ug`,kdj:`kdj-latn-ug`,kdk:`kdk-latn-nc`,kdl:`kdl-latn-zz`,kdm:`kdm-latn-ng`,kdn:`kdn-latn-zw`,kdp:`kdp-latn-ng`,kdq:`kdq-beng-in`,kdr:`kdr-latn-lt`,"kdr-cyrl":`kdr-cyrl-ua`,kdt:`kdt-thai-th`,kdw:`kdw-latn-id`,kdx:`kdx-latn-ng`,kdy:`kdy-latn-id`,kdz:`kdz-latn-cm`,kea:`kea-latn-cv`,keb:`keb-latn-ga`,kec:`kec-latn-sd`,ked:`ked-latn-tz`,kee:`kee-latn-us`,kef:`kef-latn-tg`,keg:`keg-latn-sd`,keh:`keh-latn-pg`,kei:`kei-latn-id`,kek:`kek-latn-gt`,kel:`kel-latn-cd`,kem:`kem-latn-tl`,ken:`ken-latn-cm`,keo:`keo-latn-ug`,ker:`ker-latn-td`,kes:`kes-latn-ng`,ket:`ket-cyrl-ru`,keu:`keu-latn-tg`,kew:`kew-latn-pg`,kex:`kex-deva-in`,"kex-gujr":`kex-gujr-in`,key:`key-telu-in`,kez:`kez-latn-zz`,kfa:`kfa-knda-in`,kfb:`kfb-deva-in`,kfc:`kfc-telu-in`,kfd:`kfd-knda-in`,kfe:`kfe-taml-in`,kff:`kff-latn-in`,"kff-deva":`kff-deva-in`,"kff-orya":`kff-orya-in`,"kff-telu":`kff-telu-in`,kfh:`kfh-mlym-in`,kfi:`kfi-taml-in`,"kfi-knda":`kfi-knda-in`,kfk:`kfk-deva-in`,"kfk-takr":`kfk-takr-in`,kfl:`kfl-latn-cm`,kfm:`kfm-arab-ir`,kfn:`kfn-latn-cm`,kfo:`kfo-latn-ci`,kfp:`kfp-deva-in`,kfq:`kfq-deva-in`,kfr:`kfr-deva-in`,kfs:`kfs-deva-in`,kfv:`kfv-latn-in`,kfw:`kfw-latn-in`,kfx:`kfx-deva-in`,"kfx-takr":`kfx-takr-in`,kfy:`kfy-deva-in`,kfz:`kfz-latn-bf`,kg:`kg-latn-cd`,kga:`kga-latn-ci`,kgb:`kgb-latn-id`,kge:`kge-latn-id`,kgf:`kgf-latn-zz`,kgj:`kgj-deva-np`,kgk:`kgk-latn-br`,kgl:`kgl-latn-au`,kgm:`kgm-latn-br`,kgo:`kgo-latn-sd`,kgp:`kgp-latn-br`,kgq:`kgq-latn-id`,kgr:`kgr-latn-id`,kgs:`kgs-latn-au`,kgt:`kgt-latn-ng`,kgu:`kgu-latn-pg`,kgv:`kgv-latn-id`,kgw:`kgw-latn-id`,kgx:`kgx-latn-id`,kgy:`kgy-deva-np`,kha:`kha-latn-in`,khb:`khb-talu-cn`,khc:`khc-latn-id`,khd:`khd-latn-id`,khe:`khe-latn-id`,khf:`khf-thai-la`,khg:`khg-tibt-cn`,khh:`khh-latn-id`,khj:`khj-latn-ng`,khl:`khl-latn-pg`,khn:`khn-deva-in`,khp:`khp-latn-id`,khq:`khq-latn-ml`,khr:`khr-latn-in`,"khr-deva":`khr-deva-in`,khs:`khs-latn-zz`,kht:`kht-mymr-in`,khu:`khu-latn-ao`,khv:`khv-cyrl-ru`,khw:`khw-arab-pk`,khx:`khx-latn-cd`,khy:`khy-latn-cd`,khz:`khz-latn-zz`,ki:`ki-latn-ke`,kia:`kia-latn-td`,kib:`kib-latn-sd`,kic:`kic-latn-us`,kid:`kid-latn-cm`,kie:`kie-latn-td`,kif:`kif-deva-np`,kig:`kig-latn-id`,kih:`kih-latn-pg`,kij:`kij-latn-zz`,kil:`kil-latn-ng`,kim:`kim-cyrl-ru`,kio:`kio-latn-us`,kip:`kip-deva-np`,kiq:`kiq-latn-id`,kis:`kis-latn-pg`,kit:`kit-latn-pg`,kiu:`kiu-latn-tr`,kiv:`kiv-latn-tz`,kiw:`kiw-latn-zz`,kix:`kix-latn-in`,kiy:`kiy-latn-id`,kiz:`kiz-latn-tz`,kj:`kj-latn-na`,kja:`kja-latn-id`,kjb:`kjb-latn-gt`,kjc:`kjc-latn-id`,kjd:`kjd-latn-zz`,kje:`kje-latn-id`,kjg:`kjg-laoo-la`,kjh:`kjh-cyrl-ru`,kji:`kji-latn-sb`,kjj:`kjj-latn-az`,kjk:`kjk-latn-id`,kjl:`kjl-deva-np`,kjm:`kjm-latn-vn`,kjn:`kjn-latn-au`,kjo:`kjo-deva-in`,kjp:`kjp-mymr-mm`,"kjp-thai":`kjp-thai-th`,kjq:`kjq-latn-us`,kjr:`kjr-latn-id`,kjs:`kjs-latn-zz`,kjt:`kjt-thai-th`,kju:`kju-latn-us`,kjx:`kjx-latn-pg`,kjy:`kjy-latn-zz`,kk:`kk-cyrl-kz`,"kk-af":`kk-arab-af`,"kk-arab":`kk-arab-cn`,"kk-cn":`kk-arab-cn`,"kk-ir":`kk-arab-ir`,"kk-mn":`kk-arab-mn`,kka:`kka-latn-ng`,kkb:`kkb-latn-id`,kkc:`kkc-latn-zz`,kkd:`kkd-latn-ng`,kke:`kke-latn-gn`,"kke-arab":`kke-arab-gn`,kkf:`kkf-tibt-in`,kkg:`kkg-latn-ph`,kkh:`kkh-lana-mm`,kki:`kki-latn-tz`,kkj:`kkj-latn-cm`,kkk:`kkk-latn-sb`,kkl:`kkl-latn-id`,kkm:`kkm-latn-ng`,kko:`kko-latn-sd`,kkp:`kkp-latn-au`,kkq:`kkq-latn-cd`,kkr:`kkr-latn-ng`,kks:`kks-latn-ng`,kkt:`kkt-deva-np`,kku:`kku-latn-ng`,kkv:`kkv-latn-id`,kkw:`kkw-latn-cg`,kkx:`kkx-latn-id`,kky:`kky-latn-au`,kkz:`kkz-latn-ca`,kl:`kl-latn-gl`,kla:`kla-latn-us`,klb:`klb-latn-mx`,klc:`klc-latn-cm`,kld:`kld-latn-au`,kle:`kle-deva-np`,klf:`klf-latn-td`,klg:`klg-latn-ph`,klh:`klh-latn-pg`,kli:`kli-latn-id`,klj:`klj-arab-ir`,klk:`klk-latn-ng`,kll:`kll-latn-ph`,klm:`klm-latn-pg`,kln:`kln-latn-ke`,klo:`klo-latn-ng`,klp:`klp-latn-pg`,klq:`klq-latn-zz`,klr:`klr-deva-np`,kls:`kls-latn-pk`,"kls-arab":`kls-arab-pk`,klt:`klt-latn-zz`,klu:`klu-latn-lr`,klv:`klv-latn-vu`,klw:`klw-latn-id`,klx:`klx-latn-zz`,kly:`kly-latn-id`,klz:`klz-latn-id`,km:`km-khmr-kh`,kma:`kma-latn-gh`,kmb:`kmb-latn-ao`,kmc:`kmc-latn-cn`,"kmc-hani":`kmc-hani-cn`,kmd:`kmd-latn-ph`,kme:`kme-latn-cm`,kmf:`kmf-latn-pg`,kmg:`kmg-latn-pg`,kmh:`kmh-latn-zz`,kmi:`kmi-latn-ng`,kmj:`kmj-deva-in`,kmk:`kmk-latn-ph`,kml:`kml-latn-ph`,kmm:`kmm-latn-in`,kmn:`kmn-latn-pg`,kmo:`kmo-latn-zz`,kmp:`kmp-latn-cm`,kmq:`kmq-latn-et`,kms:`kms-latn-zz`,kmt:`kmt-latn-id`,kmu:`kmu-latn-zz`,kmv:`kmv-latn-br`,kmw:`kmw-latn-zz`,kmx:`kmx-latn-pg`,kmy:`kmy-latn-ng`,kmz:`kmz-arab-ir`,kn:`kn-knda-in`,kna:`kna-latn-ng`,knb:`knb-latn-ph`,knd:`knd-latn-id`,kne:`kne-latn-ph`,knf:`knf-latn-gw`,kni:`kni-latn-ng`,knj:`knj-latn-gt`,knk:`knk-latn-sl`,"knk-arab":`knk-arab-sl`,knl:`knl-latn-id`,knm:`knm-latn-br`,kno:`kno-latn-sl`,knp:`knp-latn-zz`,knq:`knq-latn-my`,knr:`knr-latn-pg`,kns:`kns-latn-my`,"kns-thai":`kns-thai-th`,knt:`knt-latn-br`,knu:`knu-latn-gn`,knv:`knv-latn-pg`,knw:`knw-latn-na`,knx:`knx-latn-id`,kny:`kny-latn-cd`,knz:`knz-latn-bf`,ko:`ko-kore-kr`,koa:`koa-latn-pg`,koc:`koc-latn-ng`,kod:`kod-latn-id`,koe:`koe-latn-ss`,kof:`kof-latn-ng`,kog:`kog-latn-co`,koh:`koh-latn-cg`,koi:`koi-cyrl-ru`,kok:`kok-deva-in`,kol:`kol-latn-zz`,koo:`koo-latn-ug`,kop:`kop-latn-pg`,koq:`koq-latn-ga`,kos:`kos-latn-fm`,kot:`kot-latn-cm`,kou:`kou-latn-td`,kov:`kov-latn-ng`,kow:`kow-latn-ng`,koy:`koy-latn-us`,koz:`koz-latn-zz`,kpa:`kpa-latn-ng`,kpc:`kpc-latn-co`,kpd:`kpd-latn-id`,kpe:`kpe-latn-lr`,kpf:`kpf-latn-zz`,kpg:`kpg-latn-fm`,kph:`kph-latn-gh`,kpi:`kpi-latn-id`,kpj:`kpj-latn-br`,kpk:`kpk-latn-ng`,kpl:`kpl-latn-cd`,kpm:`kpm-latn-vn`,kpn:`kpn-latn-br`,kpo:`kpo-latn-zz`,kpq:`kpq-latn-id`,kpr:`kpr-latn-zz`,kps:`kps-latn-id`,kpt:`kpt-cyrl-ru`,kpu:`kpu-latn-id`,kpw:`kpw-latn-pg`,kpx:`kpx-latn-zz`,kpy:`kpy-cyrl-ru`,kpz:`kpz-latn-ug`,kqa:`kqa-latn-pg`,kqb:`kqb-latn-zz`,kqc:`kqc-latn-pg`,kqd:`kqd-syrc-iq`,kqe:`kqe-latn-ph`,kqf:`kqf-latn-zz`,kqg:`kqg-latn-bf`,kqh:`kqh-latn-tz`,kqi:`kqi-latn-pg`,kqj:`kqj-latn-pg`,kqk:`kqk-latn-bj`,kql:`kql-latn-pg`,kqm:`kqm-latn-ci`,kqn:`kqn-latn-zm`,kqo:`kqo-latn-lr`,kqp:`kqp-latn-td`,kqq:`kqq-latn-br`,kqr:`kqr-latn-my`,kqs:`kqs-latn-zz`,kqt:`kqt-latn-my`,kqu:`kqu-latn-za`,kqv:`kqv-latn-id`,kqw:`kqw-latn-pg`,kqx:`kqx-latn-cm`,kqy:`kqy-ethi-zz`,kqz:`kqz-latn-za`,kr:`kr-latn-zz`,kra:`kra-deva-np`,krb:`krb-latn-us`,krc:`krc-cyrl-ru`,krd:`krd-latn-tl`,kre:`kre-latn-br`,krf:`krf-latn-vu`,krh:`krh-latn-ng`,kri:`kri-latn-sl`,krj:`krj-latn-ph`,krk:`krk-cyrl-ru`,krl:`krl-latn-ru`,krn:`krn-latn-lr`,krp:`krp-latn-ng`,krr:`krr-khmr-kh`,krs:`krs-latn-zz`,krt:`krt-latn-ne`,kru:`kru-deva-in`,krv:`krv-khmr-kh`,krw:`krw-latn-lr`,krx:`krx-latn-sn`,kry:`kry-latn-az`,krz:`krz-latn-id`,ks:`ks-arab-in`,ksa:`ksa-latn-ng`,ksb:`ksb-latn-tz`,ksc:`ksc-latn-ph`,ksd:`ksd-latn-zz`,kse:`kse-latn-pg`,ksf:`ksf-latn-cm`,ksg:`ksg-latn-sb`,ksh:`ksh-latn-de`,ksi:`ksi-latn-pg`,ksj:`ksj-latn-zz`,ksk:`ksk-latn-us`,ksl:`ksl-latn-pg`,ksm:`ksm-latn-ng`,ksn:`ksn-latn-ph`,kso:`kso-latn-ng`,ksp:`ksp-latn-cf`,ksq:`ksq-latn-ng`,ksr:`ksr-latn-zz`,kss:`kss-latn-lr`,kst:`kst-latn-bf`,ksu:`ksu-mymr-in`,ksv:`ksv-latn-cd`,ksw:`ksw-mymr-mm`,"ksw-latn":`ksw-latn-mm`,ksx:`ksx-latn-id`,ksz:`ksz-deva-in`,kta:`kta-latn-vn`,ktb:`ktb-ethi-zz`,ktc:`ktc-latn-ng`,ktd:`ktd-latn-au`,ktf:`ktf-latn-cd`,ktg:`ktg-latn-au`,kth:`kth-latn-td`,kti:`kti-latn-id`,ktj:`ktj-latn-ci`,ktk:`ktk-latn-pg`,ktl:`ktl-arab-ir`,ktm:`ktm-latn-zz`,ktn:`ktn-latn-br`,kto:`kto-latn-zz`,ktp:`ktp-plrd-cn`,ktq:`ktq-latn-ph`,ktr:`ktr-latn-my`,kts:`kts-latn-id`,ktt:`ktt-latn-id`,ktu:`ktu-latn-cd`,ktv:`ktv-latn-vn`,ktw:`ktw-latn-us`,ktx:`ktx-latn-br`,kty:`kty-latn-cd`,ktz:`ktz-latn-na`,ku:`ku-latn-tr`,"ku-arab":`ku-arab-iq`,"ku-lb":`ku-arab-lb`,"ku-yezi":`ku-yezi-ge`,kub:`kub-latn-zz`,kuc:`kuc-latn-id`,kud:`kud-latn-zz`,kue:`kue-latn-zz`,kuf:`kuf-laoo-la`,kug:`kug-latn-ng`,kuh:`kuh-latn-ng`,kui:`kui-latn-br`,kuj:`kuj-latn-zz`,kuk:`kuk-latn-id`,kul:`kul-latn-ng`,kum:`kum-cyrl-ru`,kun:`kun-latn-zz`,kuo:`kuo-latn-pg`,kup:`kup-latn-zz`,kuq:`kuq-latn-br`,kus:`kus-latn-zz`,kut:`kut-latn-ca`,kuu:`kuu-latn-us`,kuv:`kuv-latn-id`,kuw:`kuw-latn-cf`,kux:`kux-latn-au`,kuy:`kuy-latn-au`,kuz:`kuz-latn-cl`,kv:`kv-cyrl-ru`,kva:`kva-cyrl-ru`,kvb:`kvb-latn-id`,kvc:`kvc-latn-pg`,kvd:`kvd-latn-id`,kve:`kve-latn-my`,kvf:`kvf-latn-td`,kvg:`kvg-latn-zz`,kvh:`kvh-latn-id`,kvi:`kvi-latn-td`,kvj:`kvj-latn-cm`,kvl:`kvl-latn-mm`,kvm:`kvm-latn-cm`,kvn:`kvn-latn-co`,kvo:`kvo-latn-id`,kvp:`kvp-latn-id`,kvq:`kvq-mymr-mm`,"kvq-latn":`kvq-latn-mm`,kvr:`kvr-latn-id`,kvt:`kvt-mymr-mm`,kvv:`kvv-latn-id`,kvw:`kvw-latn-id`,kvx:`kvx-arab-pk`,kvy:`kvy-kali-mm`,kvz:`kvz-latn-id`,kw:`kw-latn-gb`,kwa:`kwa-latn-br`,kwb:`kwb-latn-ng`,kwc:`kwc-latn-cg`,kwd:`kwd-latn-sb`,kwe:`kwe-latn-id`,kwf:`kwf-latn-sb`,kwg:`kwg-latn-td`,kwh:`kwh-latn-id`,kwi:`kwi-latn-co`,kwj:`kwj-latn-zz`,kwk:`kwk-latn-ca`,kwl:`kwl-latn-ng`,kwm:`kwm-latn-na`,kwn:`kwn-latn-na`,kwo:`kwo-latn-zz`,kwp:`kwp-latn-ci`,kwq:`kwq-latn-zz`,kwr:`kwr-latn-id`,kws:`kws-latn-cd`,kwt:`kwt-latn-id`,kwu:`kwu-latn-cm`,kwv:`kwv-latn-td`,kww:`kww-latn-sr`,kwy:`kwy-latn-cd`,kwz:`kwz-latn-ao`,kxa:`kxa-latn-zz`,kxb:`kxb-latn-ci`,kxc:`kxc-ethi-zz`,kxd:`kxd-latn-bn`,"kxd-arab":`kxd-arab-bn`,kxe:`kxe-latn-zz`,kxf:`kxf-mymr-mm`,"kxf-latn":`kxf-latn-mm`,kxi:`kxi-latn-my`,kxj:`kxj-latn-td`,kxk:`kxk-mymr-mm`,kxl:`kxl-deva-in`,kxm:`kxm-thai-th`,kxn:`kxn-latn-my`,kxo:`kxo-latn-br`,kxp:`kxp-arab-pk`,kxq:`kxq-latn-id`,kxr:`kxr-latn-pg`,kxt:`kxt-latn-pg`,kxv:`kxv-orya-in`,"kxv-latn":`kxv-latn-in`,"kxv-telu":`kxv-telu-in`,kxw:`kxw-latn-zz`,kxx:`kxx-latn-cg`,kxy:`kxy-latn-vn`,kxz:`kxz-latn-zz`,ky:`ky-cyrl-kg`,"ky-arab":`ky-arab-cn`,"ky-cn":`ky-arab-cn`,"ky-latn":`ky-latn-tr`,"ky-tr":`ky-latn-tr`,kya:`kya-latn-tz`,kyb:`kyb-latn-ph`,kyc:`kyc-latn-pg`,kyd:`kyd-latn-id`,kye:`kye-latn-zz`,kyf:`kyf-latn-ci`,kyg:`kyg-latn-pg`,kyh:`kyh-latn-us`,kyi:`kyi-latn-my`,kyj:`kyj-latn-ph`,kyk:`kyk-latn-ph`,kyl:`kyl-latn-us`,kym:`kym-latn-cf`,kyn:`kyn-latn-ph`,kyo:`kyo-latn-id`,kyq:`kyq-latn-td`,kyr:`kyr-latn-br`,kys:`kys-latn-my`,kyt:`kyt-latn-id`,kyu:`kyu-kali-mm`,"kyu-latn":`kyu-latn-mm`,"kyu-mymr":`kyu-mymr-mm`,kyv:`kyv-deva-np`,kyw:`kyw-deva-in`,"kyw-beng":`kyw-beng-in`,"kyw-orya":`kyw-orya-in`,kyx:`kyx-latn-zz`,kyy:`kyy-latn-pg`,kyz:`kyz-latn-br`,kza:`kza-latn-bf`,kzb:`kzb-latn-id`,kzc:`kzc-latn-ci`,kzd:`kzd-latn-id`,kze:`kze-latn-pg`,kzf:`kzf-latn-id`,kzh:`kzh-arab-zz`,kzi:`kzi-latn-my`,kzj:`kzj-latn-my`,kzk:`kzk-latn-sb`,kzl:`kzl-latn-id`,kzm:`kzm-latn-id`,kzn:`kzn-latn-mw`,kzo:`kzo-latn-ga`,kzp:`kzp-latn-id`,kzr:`kzr-latn-zz`,kzs:`kzs-latn-my`,kzt:`kzt-latn-my`,kzu:`kzu-latn-id`,kzv:`kzv-latn-id`,kzw:`kzw-latn-br`,kzx:`kzx-latn-id`,kzy:`kzy-latn-cd`,kzz:`kzz-latn-id`,la:`la-latn-va`,laa:`laa-latn-ph`,lab:`lab-lina-gr`,lac:`lac-latn-mx`,lad:`lad-hebr-il`,lae:`lae-deva-in`,"lae-tibt":`lae-tibt-in`,lag:`lag-latn-tz`,lah:`lah-arab-pk`,lai:`lai-latn-mw`,laj:`laj-latn-ug`,lal:`lal-latn-cd`,lam:`lam-latn-zm`,lan:`lan-latn-ng`,lap:`lap-latn-td`,laq:`laq-latn-vn`,lar:`lar-latn-gh`,las:`las-latn-zz`,lau:`lau-latn-id`,law:`law-latn-id`,lax:`lax-latn-in`,"lax-beng":`lax-beng-in`,laz:`laz-latn-pg`,lb:`lb-latn-lu`,lbb:`lbb-latn-pg`,lbc:`lbc-lisu-cn`,lbe:`lbe-cyrl-ru`,lbf:`lbf-deva-in`,"lbf-tibt":`lbf-tibt-cn`,lbi:`lbi-latn-cm`,lbj:`lbj-tibt-in`,"lbj-arab":`lbj-arab-in`,lbl:`lbl-latn-ph`,lbm:`lbm-deva-in`,lbn:`lbn-latn-la`,"lbn-laoo":`lbn-laoo-la`,lbo:`lbo-laoo-la`,"lbo-latn":`lbo-latn-us`,lbq:`lbq-latn-pg`,lbr:`lbr-deva-np`,lbt:`lbt-latn-vn`,lbu:`lbu-latn-zz`,lbv:`lbv-latn-pg`,lbw:`lbw-latn-id`,lbx:`lbx-latn-id`,lby:`lby-latn-au`,lbz:`lbz-latn-au`,lcc:`lcc-latn-id`,lcd:`lcd-latn-id`,lce:`lce-latn-id`,lcf:`lcf-latn-id`,lch:`lch-latn-ao`,lcl:`lcl-latn-id`,lcm:`lcm-latn-zz`,lcp:`lcp-thai-cn`,lcq:`lcq-latn-id`,lcs:`lcs-latn-id`,lda:`lda-latn-ci`,ldb:`ldb-latn-zz`,ldd:`ldd-latn-ng`,ldg:`ldg-latn-ng`,ldh:`ldh-latn-ng`,ldi:`ldi-latn-cg`,ldj:`ldj-latn-ng`,ldk:`ldk-latn-ng`,ldl:`ldl-latn-ng`,ldm:`ldm-latn-gn`,ldn:`ldn-latn-001`,ldo:`ldo-latn-ng`,ldp:`ldp-latn-ng`,ldq:`ldq-latn-ng`,lea:`lea-latn-cd`,leb:`leb-latn-zm`,lec:`lec-latn-bo`,led:`led-latn-zz`,lee:`lee-latn-zz`,lef:`lef-latn-gh`,leh:`leh-latn-zm`,lei:`lei-latn-pg`,lej:`lej-latn-cd`,lek:`lek-latn-pg`,lel:`lel-latn-cd`,lem:`lem-latn-zz`,len:`len-latn-hn`,leo:`leo-latn-cm`,lep:`lep-lepc-in`,leq:`leq-latn-zz`,ler:`ler-latn-pg`,les:`les-latn-cd`,let:`let-latn-pg`,leu:`leu-latn-zz`,lev:`lev-latn-id`,lew:`lew-latn-id`,lex:`lex-latn-id`,ley:`ley-latn-id`,lez:`lez-cyrl-ru`,lfa:`lfa-latn-cm`,lfn:`lfn-latn-001`,"lfn-cyrl":`lfn-cyrl-001`,lg:`lg-latn-ug`,lga:`lga-latn-sb`,lgb:`lgb-latn-sb`,lgg:`lgg-latn-zz`,lgh:`lgh-latn-vn`,lgi:`lgi-latn-id`,lgk:`lgk-latn-vu`,lgl:`lgl-latn-sb`,lgm:`lgm-latn-cd`,lgn:`lgn-latn-et`,lgo:`lgo-latn-ss`,lgq:`lgq-latn-gh`,lgr:`lgr-latn-sb`,lgt:`lgt-latn-pg`,lgu:`lgu-latn-sb`,lgz:`lgz-latn-cd`,lha:`lha-latn-vn`,lhh:`lhh-latn-id`,lhi:`lhi-latn-cn`,lhm:`lhm-deva-np`,lhn:`lhn-latn-my`,lhs:`lhs-syrc-sy`,lht:`lht-latn-vu`,lhu:`lhu-latn-cn`,li:`li-latn-nl`,lia:`lia-latn-zz`,lib:`lib-latn-pg`,lic:`lic-latn-cn`,lid:`lid-latn-zz`,lie:`lie-latn-cd`,lif:`lif-deva-np`,"lif-limb":`lif-limb-in`,lig:`lig-latn-zz`,lih:`lih-latn-zz`,lij:`lij-latn-it`,lik:`lik-latn-cd`,lil:`lil-latn-ca`,lio:`lio-latn-id`,lip:`lip-latn-gh`,liq:`liq-latn-et`,lir:`lir-latn-lr`,lis:`lis-lisu-cn`,liu:`liu-latn-sd`,liv:`liv-latn-lv`,liw:`liw-latn-id`,lix:`lix-latn-id`,liy:`liy-latn-cf`,liz:`liz-latn-cd`,lja:`lja-latn-au`,lje:`lje-latn-id`,lji:`lji-latn-id`,ljl:`ljl-latn-id`,ljp:`ljp-latn-id`,ljw:`ljw-latn-au`,ljx:`ljx-latn-au`,lka:`lka-latn-tl`,lkb:`lkb-latn-ke`,lkc:`lkc-latn-vn`,lkd:`lkd-latn-br`,lke:`lke-latn-ug`,lkh:`lkh-tibt-bt`,lki:`lki-arab-ir`,lkj:`lkj-latn-my`,lkl:`lkl-latn-pg`,lkm:`lkm-latn-au`,lkn:`lkn-latn-vu`,lko:`lko-latn-ke`,lkr:`lkr-latn-ss`,lks:`lks-latn-ke`,lkt:`lkt-latn-us`,lku:`lku-latn-au`,lky:`lky-latn-ss`,lla:`lla-latn-ng`,llb:`llb-latn-mz`,llc:`llc-latn-gn`,lld:`lld-latn-it`,lle:`lle-latn-zz`,llf:`llf-latn-pg`,llg:`llg-latn-id`,lli:`lli-latn-cg`,llj:`llj-latn-au`,llk:`llk-latn-my`,lll:`lll-latn-pg`,llm:`llm-latn-id`,lln:`lln-latn-zz`,llp:`llp-latn-vu`,llq:`llq-latn-id`,llu:`llu-latn-sb`,llx:`llx-latn-fj`,lma:`lma-latn-gn`,lmb:`lmb-latn-vu`,lmc:`lmc-latn-au`,lmd:`lmd-latn-sd`,lme:`lme-latn-td`,lmf:`lmf-latn-id`,lmg:`lmg-latn-pg`,lmh:`lmh-deva-np`,lmi:`lmi-latn-cd`,lmj:`lmj-latn-id`,lmk:`lmk-latn-in`,"lmk-mymr":`lmk-mymr-in`,lml:`lml-latn-vu`,lmn:`lmn-telu-in`,lmo:`lmo-latn-it`,lmp:`lmp-latn-zz`,lmq:`lmq-latn-id`,lmr:`lmr-latn-id`,lmu:`lmu-latn-vu`,lmv:`lmv-latn-fj`,lmw:`lmw-latn-us`,lmx:`lmx-latn-cm`,lmy:`lmy-latn-id`,ln:`ln-latn-cd`,lna:`lna-latn-cf`,lnb:`lnb-latn-na`,lnd:`lnd-latn-id`,lnh:`lnh-latn-my`,lni:`lni-latn-pg`,lnj:`lnj-latn-au`,lnl:`lnl-latn-cf`,lnm:`lnm-latn-pg`,lnn:`lnn-latn-vu`,lns:`lns-latn-zz`,lnu:`lnu-latn-zz`,lnw:`lnw-latn-au`,lnz:`lnz-latn-cd`,lo:`lo-laoo-la`,loa:`loa-latn-id`,lob:`lob-latn-bf`,loc:`loc-latn-ph`,loe:`loe-latn-id`,log:`log-latn-cd`,loh:`loh-latn-ss`,loi:`loi-latn-ci`,loj:`loj-latn-zz`,lok:`lok-latn-zz`,lol:`lol-latn-cd`,lom:`lom-latn-lr`,lon:`lon-latn-mw`,loo:`loo-latn-cd`,lop:`lop-latn-ng`,loq:`loq-latn-cd`,lor:`lor-latn-zz`,los:`los-latn-zz`,lot:`lot-latn-ss`,"lot-arab":`lot-arab-ss`,lou:`lou-latn-us`,low:`low-latn-my`,lox:`lox-latn-id`,loy:`loy-deva-np`,"loy-tibt":`loy-tibt-np`,loz:`loz-latn-zm`,lpa:`lpa-latn-vu`,lpe:`lpe-latn-id`,lpn:`lpn-latn-mm`,lpo:`lpo-plrd-cn`,"lpo-lisu":`lpo-lisu-cn`,lpx:`lpx-latn-ss`,lqr:`lqr-latn-ss`,lra:`lra-latn-my`,lrc:`lrc-arab-ir`,lrg:`lrg-latn-au`,lri:`lri-latn-ke`,lrk:`lrk-arab-pk`,lrl:`lrl-arab-ir`,lrm:`lrm-latn-ke`,lrn:`lrn-latn-id`,lro:`lro-latn-sd`,lrt:`lrt-latn-id`,lrv:`lrv-latn-vu`,lrz:`lrz-latn-vu`,lsa:`lsa-arab-ir`,lsd:`lsd-hebr-il`,lse:`lse-latn-cd`,lsi:`lsi-latn-mm`,lsm:`lsm-latn-ug`,lsr:`lsr-latn-pg`,lss:`lss-arab-pk`,lt:`lt-latn-lt`,ltg:`ltg-latn-lv`,lth:`lth-latn-ug`,lti:`lti-latn-id`,ltn:`ltn-latn-br`,lto:`lto-latn-ke`,lts:`lts-latn-ke`,ltu:`ltu-latn-id`,lu:`lu-latn-cd`,lua:`lua-latn-cd`,luc:`luc-latn-ug`,lud:`lud-latn-ru`,lue:`lue-latn-zm`,luf:`luf-latn-pg`,lui:`lui-latn-us`,luj:`luj-latn-cd`,luk:`luk-tibt-bt`,lul:`lul-latn-ss`,lum:`lum-latn-ao`,lun:`lun-latn-zm`,luo:`luo-latn-ke`,lup:`lup-latn-ga`,luq:`luq-latn-cu`,lur:`lur-latn-id`,lus:`lus-latn-in`,"lus-beng":`lus-beng-bd`,"lus-brai":`lus-brai-in`,lut:`lut-latn-us`,luu:`luu-deva-np`,luv:`luv-arab-om`,luw:`luw-latn-cm`,luy:`luy-latn-ke`,luz:`luz-arab-ir`,lv:`lv-latn-lv`,lva:`lva-latn-tl`,lvi:`lvi-latn-la`,lvk:`lvk-latn-sb`,lvu:`lvu-latn-id`,lwa:`lwa-latn-cd`,lwe:`lwe-latn-id`,lwg:`lwg-latn-ke`,lwh:`lwh-latn-vn`,lwl:`lwl-thai-th`,lwm:`lwm-thai-cn`,lwo:`lwo-latn-ss`,"lwo-za":`lwo-latn-za`,lwt:`lwt-latn-id`,lww:`lww-latn-vu`,lxm:`lxm-latn-pg`,lya:`lya-tibt-bt`,lyn:`lyn-latn-zm`,lzh:`lzh-hans-cn`,lzl:`lzl-latn-vu`,lzn:`lzn-latn-mm`,lzz:`lzz-latn-tr`,maa:`maa-latn-mx`,mab:`mab-latn-mx`,mad:`mad-latn-id`,mae:`mae-latn-ng`,maf:`maf-latn-cm`,mag:`mag-deva-in`,mai:`mai-deva-in`,maj:`maj-latn-mx`,mak:`mak-latn-id`,mam:`mam-latn-gt`,man:`man-latn-gm`,"man-gn":`man-nkoo-gn`,"man-nkoo":`man-nkoo-gn`,maq:`maq-latn-mx`,mas:`mas-latn-ke`,mat:`mat-latn-mx`,mau:`mau-latn-mx`,mav:`mav-latn-br`,maw:`maw-latn-zz`,max:`max-latn-id`,maz:`maz-latn-mx`,mba:`mba-latn-ph`,mbb:`mbb-latn-ph`,mbc:`mbc-latn-br`,mbd:`mbd-latn-ph`,mbf:`mbf-latn-sg`,mbh:`mbh-latn-zz`,mbi:`mbi-latn-ph`,mbj:`mbj-latn-br`,mbk:`mbk-latn-pg`,mbl:`mbl-latn-br`,mbm:`mbm-latn-cg`,mbn:`mbn-latn-co`,mbo:`mbo-latn-zz`,mbp:`mbp-latn-co`,mbq:`mbq-latn-zz`,mbr:`mbr-latn-co`,mbs:`mbs-latn-ph`,mbt:`mbt-latn-ph`,mbu:`mbu-latn-zz`,mbv:`mbv-latn-gn`,mbw:`mbw-latn-zz`,mbx:`mbx-latn-pg`,mby:`mby-arab-pk`,mbz:`mbz-latn-mx`,mca:`mca-latn-py`,mcb:`mcb-latn-pe`,mcc:`mcc-latn-pg`,mcd:`mcd-latn-pe`,mce:`mce-latn-mx`,mcf:`mcf-latn-pe`,mcg:`mcg-latn-ve`,mch:`mch-latn-ve`,mci:`mci-latn-zz`,mcj:`mcj-latn-ng`,mck:`mck-latn-ao`,mcl:`mcl-latn-co`,mcm:`mcm-latn-my`,mcn:`mcn-latn-td`,mco:`mco-latn-mx`,mcp:`mcp-latn-zz`,mcq:`mcq-latn-zz`,mcr:`mcr-latn-zz`,mcs:`mcs-latn-cm`,mct:`mct-latn-cm`,mcu:`mcu-latn-zz`,mcv:`mcv-latn-pg`,mcw:`mcw-latn-td`,mcx:`mcx-latn-cf`,mcy:`mcy-latn-pg`,mcz:`mcz-latn-pg`,mda:`mda-latn-zz`,mdb:`mdb-latn-pg`,mdc:`mdc-latn-pg`,mdd:`mdd-latn-cm`,mde:`mde-arab-zz`,mdf:`mdf-cyrl-ru`,mdg:`mdg-latn-td`,mdh:`mdh-latn-ph`,mdi:`mdi-latn-cd`,mdj:`mdj-latn-zz`,mdk:`mdk-latn-cd`,mdm:`mdm-latn-cd`,mdn:`mdn-latn-cf`,mdp:`mdp-latn-cd`,mdq:`mdq-latn-cd`,mdr:`mdr-latn-id`,mds:`mds-latn-pg`,mdt:`mdt-latn-cg`,mdu:`mdu-latn-cg`,mdv:`mdv-latn-mx`,mdw:`mdw-latn-cg`,mdx:`mdx-ethi-zz`,mdy:`mdy-ethi-et`,"mdy-latn":`mdy-latn-et`,mdz:`mdz-latn-br`,mea:`mea-latn-cm`,meb:`meb-latn-pg`,mec:`mec-latn-au`,med:`med-latn-zz`,mee:`mee-latn-zz`,meh:`meh-latn-mx`,mej:`mej-latn-id`,mek:`mek-latn-zz`,mel:`mel-latn-my`,mem:`mem-latn-au`,men:`men-latn-sl`,meo:`meo-latn-my`,"meo-arab":`meo-arab-my`,mep:`mep-latn-au`,meq:`meq-latn-cm`,mer:`mer-latn-ke`,mes:`mes-latn-td`,met:`met-latn-zz`,meu:`meu-latn-zz`,mev:`mev-latn-lr`,mew:`mew-latn-ng`,mey:`mey-latn-mr`,"mey-arab":`mey-arab-mr`,mez:`mez-latn-us`,mfa:`mfa-arab-th`,mfb:`mfb-latn-id`,mfc:`mfc-latn-cd`,mfd:`mfd-latn-cm`,mfe:`mfe-latn-mu`,mff:`mff-latn-cm`,mfg:`mfg-latn-gn`,"mfg-arab":`mfg-arab-gn`,mfh:`mfh-latn-cm`,mfi:`mfi-arab-cm`,"mfi-latn":`mfi-latn-cm`,mfj:`mfj-latn-cm`,mfk:`mfk-latn-cm`,mfl:`mfl-latn-ng`,mfm:`mfm-latn-ng`,mfn:`mfn-latn-zz`,mfo:`mfo-latn-zz`,mfp:`mfp-latn-id`,mfq:`mfq-latn-zz`,mfr:`mfr-latn-au`,mft:`mft-latn-pg`,mfu:`mfu-latn-ao`,mfv:`mfv-latn-gw`,mfw:`mfw-latn-pg`,mfx:`mfx-latn-et`,"mfx-ethi":`mfx-ethi-et`,mfy:`mfy-latn-mx`,mfz:`mfz-latn-ss`,mg:`mg-latn-mg`,mgb:`mgb-latn-td`,mgc:`mgc-latn-ss`,mgd:`mgd-latn-ss`,"mgd-arab":`mgd-arab-ss`,mge:`mge-latn-td`,mgf:`mgf-latn-id`,mgg:`mgg-latn-cm`,mgh:`mgh-latn-mz`,mgi:`mgi-latn-ng`,mgj:`mgj-latn-ng`,mgk:`mgk-latn-id`,mgl:`mgl-latn-zz`,mgm:`mgm-latn-tl`,mgn:`mgn-latn-cf`,mgo:`mgo-latn-cm`,mgp:`mgp-deva-np`,mgq:`mgq-latn-tz`,mgr:`mgr-latn-zm`,mgs:`mgs-latn-tz`,mgt:`mgt-latn-pg`,mgu:`mgu-latn-pg`,mgv:`mgv-latn-tz`,mgw:`mgw-latn-tz`,mgy:`mgy-latn-tz`,mgz:`mgz-latn-tz`,mh:`mh-latn-mh`,mhb:`mhb-latn-ga`,mhc:`mhc-latn-mx`,mhd:`mhd-latn-tz`,mhe:`mhe-latn-my`,mhf:`mhf-latn-pg`,mhg:`mhg-latn-au`,mhi:`mhi-latn-zz`,mhj:`mhj-arab-af`,mhk:`mhk-latn-cm`,mhl:`mhl-latn-zz`,mhm:`mhm-latn-mz`,mhn:`mhn-latn-it`,mho:`mho-latn-zm`,mhp:`mhp-latn-id`,mhq:`mhq-latn-us`,mhs:`mhs-latn-id`,mht:`mht-latn-ve`,mhu:`mhu-latn-in`,mhw:`mhw-latn-bw`,mhx:`mhx-latn-mm`,mhy:`mhy-latn-id`,mhz:`mhz-latn-id`,mi:`mi-latn-nz`,mia:`mia-latn-us`,mib:`mib-latn-mx`,mic:`mic-latn-ca`,mid:`mid-mand-iq`,mie:`mie-latn-mx`,mif:`mif-latn-zz`,mig:`mig-latn-mx`,mih:`mih-latn-mx`,mii:`mii-latn-mx`,mij:`mij-latn-cm`,mik:`mik-latn-us`,mil:`mil-latn-mx`,mim:`mim-latn-mx`,min:`min-latn-id`,mio:`mio-latn-mx`,mip:`mip-latn-mx`,miq:`miq-latn-ni`,mir:`mir-latn-mx`,mit:`mit-latn-mx`,miu:`miu-latn-mx`,miw:`miw-latn-zz`,mix:`mix-latn-mx`,miy:`miy-latn-mx`,miz:`miz-latn-mx`,mjb:`mjb-latn-tl`,mjc:`mjc-latn-mx`,mjd:`mjd-latn-us`,mje:`mje-latn-td`,mjg:`mjg-latn-cn`,mjh:`mjh-latn-tz`,mji:`mji-latn-cn`,mjj:`mjj-latn-pg`,mjk:`mjk-latn-pg`,mjl:`mjl-deva-in`,"mjl-takr":`mjl-takr-in`,mjm:`mjm-latn-pg`,mjn:`mjn-latn-pg`,mjq:`mjq-mlym-in`,mjr:`mjr-mlym-in`,mjs:`mjs-latn-ng`,mjt:`mjt-deva-in`,"mjt-beng":`mjt-beng-bd`,mju:`mju-telu-in`,mjv:`mjv-mlym-in`,mjw:`mjw-latn-in`,mjx:`mjx-latn-bd`,"mjx-beng":`mjx-beng-bd`,mjy:`mjy-latn-us`,mjz:`mjz-deva-np`,mk:`mk-cyrl-mk`,mka:`mka-latn-ci`,mkb:`mkb-deva-in`,mkc:`mkc-latn-pg`,mke:`mke-deva-in`,mkf:`mkf-latn-ng`,mki:`mki-arab-zz`,mkj:`mkj-latn-fm`,mkk:`mkk-latn-cm`,mkl:`mkl-latn-zz`,mkm:`mkm-thai-th`,mkn:`mkn-latn-id`,mko:`mko-latn-ng`,mkp:`mkp-latn-zz`,mkr:`mkr-latn-pg`,mks:`mks-latn-mx`,mkt:`mkt-latn-nc`,mku:`mku-latn-gn`,mkv:`mkv-latn-vu`,mkw:`mkw-latn-zz`,mkx:`mkx-latn-ph`,mky:`mky-latn-id`,mkz:`mkz-latn-tl`,ml:`ml-mlym-in`,mla:`mla-latn-vu`,mlb:`mlb-latn-cm`,mlc:`mlc-latn-vn`,mle:`mle-latn-zz`,mlf:`mlf-thai-la`,"mlf-latn":`mlf-latn-la`,mlh:`mlh-latn-pg`,mli:`mli-latn-id`,mlj:`mlj-latn-td`,mlk:`mlk-latn-ke`,mll:`mll-latn-vu`,mln:`mln-latn-sb`,mlo:`mlo-latn-sn`,mlp:`mlp-latn-zz`,mlq:`mlq-latn-sn`,"mlq-arab":`mlq-arab-sn`,mlr:`mlr-latn-cm`,mls:`mls-latn-sd`,mlu:`mlu-latn-sb`,mlv:`mlv-latn-vu`,mlw:`mlw-latn-cm`,mlx:`mlx-latn-vu`,mlz:`mlz-latn-ph`,mma:`mma-latn-ng`,mmb:`mmb-latn-id`,mmc:`mmc-latn-mx`,mmd:`mmd-latn-cn`,"mmd-hans":`mmd-hans-cn`,"mmd-hant":`mmd-hant-cn`,mme:`mme-latn-vu`,mmf:`mmf-latn-ng`,mmg:`mmg-latn-vu`,mmh:`mmh-latn-br`,mmi:`mmi-latn-pg`,mmm:`mmm-latn-vu`,mmn:`mmn-latn-ph`,mmo:`mmo-latn-zz`,mmp:`mmp-latn-pg`,mmq:`mmq-latn-pg`,mmr:`mmr-latn-cn`,mmt:`mmt-latn-pg`,mmu:`mmu-latn-zz`,mmv:`mmv-latn-br`,mmw:`mmw-latn-vu`,mmx:`mmx-latn-zz`,mmy:`mmy-latn-td`,mmz:`mmz-latn-cd`,mn:`mn-cyrl-mn`,"mn-cn":`mn-mong-cn`,"mn-mong":`mn-mong-cn`,mna:`mna-latn-zz`,mnb:`mnb-latn-id`,mnd:`mnd-latn-br`,mne:`mne-latn-td`,mnf:`mnf-latn-zz`,mng:`mng-latn-vn`,mnh:`mnh-latn-cd`,mni:`mni-beng-in`,mnj:`mnj-arab-af`,mnl:`mnl-latn-vu`,mnm:`mnm-latn-pg`,mnn:`mnn-latn-vn`,mnp:`mnp-latn-cn`,mnq:`mnq-latn-my`,mnr:`mnr-latn-us`,mns:`mns-cyrl-ru`,mnu:`mnu-latn-id`,mnv:`mnv-latn-sb`,mnw:`mnw-mymr-mm`,mnx:`mnx-latn-id`,mny:`mny-latn-mz`,mnz:`mnz-latn-id`,mo:`mo-latn-ro`,moa:`moa-latn-zz`,moc:`moc-latn-ar`,mod:`mod-latn-us`,moe:`moe-latn-ca`,mog:`mog-latn-id`,moh:`moh-latn-ca`,moi:`moi-latn-ng`,moj:`moj-latn-cg`,mok:`mok-latn-id`,mom:`mom-latn-ni`,moo:`moo-latn-vn`,mop:`mop-latn-bz`,moq:`moq-latn-id`,mor:`mor-latn-sd`,mos:`mos-latn-bf`,mot:`mot-latn-co`,mou:`mou-latn-td`,mov:`mov-latn-us`,mow:`mow-latn-cg`,mox:`mox-latn-zz`,moy:`moy-latn-et`,"moy-ethi":`moy-ethi-et`,moz:`moz-latn-td`,mpa:`mpa-latn-tz`,mpb:`mpb-latn-au`,mpc:`mpc-latn-au`,mpd:`mpd-latn-br`,mpe:`mpe-latn-et`,"mpe-ethi":`mpe-ethi-et`,mpg:`mpg-latn-td`,mph:`mph-latn-au`,mpi:`mpi-latn-cm`,mpj:`mpj-latn-au`,mpk:`mpk-latn-td`,mpl:`mpl-latn-pg`,mpm:`mpm-latn-mx`,mpn:`mpn-latn-pg`,mpo:`mpo-latn-pg`,mpp:`mpp-latn-zz`,mpq:`mpq-latn-br`,mpr:`mpr-latn-sb`,mps:`mps-latn-zz`,mpt:`mpt-latn-zz`,mpu:`mpu-latn-br`,mpv:`mpv-latn-pg`,mpw:`mpw-latn-br`,mpx:`mpx-latn-zz`,mpy:`mpy-latn-id`,mpz:`mpz-thai-th`,mqa:`mqa-latn-id`,mqb:`mqb-latn-cm`,mqc:`mqc-latn-id`,mqe:`mqe-latn-pg`,mqf:`mqf-latn-id`,mqg:`mqg-latn-id`,mqh:`mqh-latn-mx`,mqi:`mqi-latn-id`,mqj:`mqj-latn-id`,mqk:`mqk-latn-ph`,mql:`mql-latn-zz`,mqm:`mqm-latn-pf`,mqn:`mqn-latn-id`,mqo:`mqo-latn-id`,mqp:`mqp-latn-id`,mqq:`mqq-latn-my`,mqr:`mqr-latn-id`,mqs:`mqs-latn-id`,mqu:`mqu-latn-ss`,mqv:`mqv-latn-pg`,mqw:`mqw-latn-pg`,mqx:`mqx-latn-id`,"mqx-bugi":`mqx-bugi-id`,mqy:`mqy-latn-id`,mqz:`mqz-latn-pg`,mr:`mr-deva-in`,mra:`mra-thai-th`,mrb:`mrb-latn-vu`,mrc:`mrc-latn-us`,mrd:`mrd-deva-np`,mrf:`mrf-latn-id`,mrg:`mrg-latn-in`,"mrg-beng":`mrg-beng-in`,"mrg-deva":`mrg-deva-in`,mrh:`mrh-latn-in`,mrj:`mrj-cyrl-ru`,mrk:`mrk-latn-nc`,mrl:`mrl-latn-fm`,mrm:`mrm-latn-vu`,mrn:`mrn-latn-sb`,mro:`mro-mroo-bd`,mrp:`mrp-latn-vu`,mrq:`mrq-latn-pf`,mrr:`mrr-deva-in`,mrs:`mrs-latn-vu`,mrt:`mrt-latn-ng`,mru:`mru-latn-cm`,mrv:`mrv-latn-pf`,mrw:`mrw-latn-ph`,"mrw-arab":`mrw-arab-ph`,mrx:`mrx-latn-id`,mry:`mry-latn-ph`,mrz:`mrz-latn-id`,ms:`ms-latn-my`,"ms-cc":`ms-arab-cc`,msb:`msb-latn-ph`,msc:`msc-latn-gn`,mse:`mse-latn-td`,msf:`msf-latn-id`,msg:`msg-latn-id`,msh:`msh-latn-mg`,msi:`msi-latn-my`,msj:`msj-latn-cd`,msk:`msk-latn-ph`,msl:`msl-latn-id`,msm:`msm-latn-ph`,msn:`msn-latn-vu`,mso:`mso-latn-id`,msp:`msp-latn-br`,msq:`msq-latn-nc`,mss:`mss-latn-id`,msu:`msu-latn-pg`,msv:`msv-latn-cm`,msw:`msw-latn-gw`,msx:`msx-latn-pg`,msy:`msy-latn-pg`,msz:`msz-latn-pg`,mt:`mt-latn-mt`,mta:`mta-latn-ph`,mtb:`mtb-latn-ci`,mtc:`mtc-latn-zz`,mtd:`mtd-latn-id`,mte:`mte-latn-sb`,mtf:`mtf-latn-zz`,mtg:`mtg-latn-id`,mth:`mth-latn-id`,mti:`mti-latn-zz`,mtj:`mtj-latn-id`,mtk:`mtk-latn-cm`,mtl:`mtl-latn-ng`,mtm:`mtm-cyrl-ru`,mtn:`mtn-latn-ni`,mto:`mto-latn-mx`,mtp:`mtp-latn-bo`,mtq:`mtq-latn-vn`,mtr:`mtr-deva-in`,mts:`mts-latn-pe`,mtt:`mtt-latn-vu`,mtu:`mtu-latn-mx`,mtv:`mtv-latn-pg`,mtw:`mtw-latn-ph`,mtx:`mtx-latn-mx`,mty:`mty-latn-pg`,mua:`mua-latn-cm`,mub:`mub-latn-td`,muc:`muc-latn-cm`,mud:`mud-cyrl-ru`,mue:`mue-latn-ec`,mug:`mug-latn-cm`,muh:`muh-latn-ss`,mui:`mui-latn-id`,muj:`muj-latn-td`,muk:`muk-tibt-np`,mum:`mum-latn-pg`,muo:`muo-latn-cm`,muq:`muq-latn-cn`,mur:`mur-latn-zz`,mus:`mus-latn-us`,mut:`mut-deva-in`,muu:`muu-latn-ke`,muv:`muv-taml-in`,mux:`mux-latn-pg`,muy:`muy-latn-cm`,muz:`muz-ethi-et`,"muz-latn":`muz-latn-et`,mva:`mva-latn-zz`,mvd:`mvd-latn-id`,mvf:`mvf-mong-cn`,"mvf-phag":`mvf-phag-cn`,mvg:`mvg-latn-mx`,mvh:`mvh-latn-td`,mvk:`mvk-latn-pg`,mvl:`mvl-latn-au`,mvn:`mvn-latn-zz`,mvo:`mvo-latn-sb`,mvp:`mvp-latn-id`,mvq:`mvq-latn-pg`,mvr:`mvr-latn-id`,mvs:`mvs-latn-id`,mvt:`mvt-latn-vu`,mvu:`mvu-latn-td`,mvv:`mvv-latn-my`,mvw:`mvw-latn-tz`,mvx:`mvx-latn-id`,mvy:`mvy-arab-pk`,mvz:`mvz-ethi-et`,"mvz-arab":`mvz-arab-et`,mwa:`mwa-latn-pg`,mwb:`mwb-latn-pg`,mwc:`mwc-latn-pg`,mwe:`mwe-latn-tz`,mwf:`mwf-latn-au`,mwg:`mwg-latn-pg`,mwh:`mwh-latn-pg`,mwi:`mwi-latn-vu`,mwk:`mwk-latn-ml`,mwl:`mwl-latn-pt`,mwm:`mwm-latn-td`,mwn:`mwn-latn-zm`,mwo:`mwo-latn-vu`,mwp:`mwp-latn-au`,mwq:`mwq-latn-mm`,mwr:`mwr-deva-in`,mws:`mws-latn-ke`,mwt:`mwt-mymr-mm`,"mwt-thai":`mwt-thai-th`,mwu:`mwu-latn-ss`,mwv:`mwv-latn-id`,mww:`mww-hmnp-us`,mwz:`mwz-latn-cd`,mxa:`mxa-latn-mx`,mxb:`mxb-latn-mx`,mxc:`mxc-latn-zw`,mxd:`mxd-latn-id`,mxe:`mxe-latn-vu`,mxf:`mxf-latn-cm`,mxg:`mxg-latn-ao`,mxh:`mxh-latn-cd`,mxi:`mxi-latn-es`,mxj:`mxj-latn-in`,mxk:`mxk-latn-pg`,mxl:`mxl-latn-bj`,mxm:`mxm-latn-zz`,mxn:`mxn-latn-id`,mxo:`mxo-latn-zm`,mxp:`mxp-latn-mx`,mxq:`mxq-latn-mx`,mxr:`mxr-latn-my`,mxs:`mxs-latn-mx`,mxt:`mxt-latn-mx`,mxu:`mxu-latn-cm`,mxv:`mxv-latn-mx`,mxw:`mxw-latn-pg`,mxx:`mxx-latn-ci`,mxy:`mxy-latn-mx`,mxz:`mxz-latn-id`,my:`my-mymr-mm`,myb:`myb-latn-td`,myc:`myc-latn-cd`,mye:`mye-latn-ga`,myf:`myf-latn-et`,myg:`myg-latn-cm`,myh:`myh-latn-us`,myj:`myj-latn-ss`,myk:`myk-latn-zz`,myl:`myl-latn-id`,mym:`mym-ethi-zz`,myp:`myp-latn-br`,myr:`myr-latn-pe`,myu:`myu-latn-br`,myv:`myv-cyrl-ru`,myw:`myw-latn-zz`,myx:`myx-latn-ug`,myy:`myy-latn-co`,myz:`myz-mand-ir`,mza:`mza-latn-mx`,mzd:`mzd-latn-cm`,mze:`mze-latn-pg`,mzh:`mzh-latn-ar`,mzi:`mzi-latn-mx`,mzj:`mzj-latn-lr`,mzk:`mzk-latn-zz`,mzl:`mzl-latn-mx`,mzm:`mzm-latn-zz`,mzn:`mzn-arab-ir`,mzo:`mzo-latn-br`,mzp:`mzp-latn-zz`,mzq:`mzq-latn-id`,mzr:`mzr-latn-br`,mzt:`mzt-latn-my`,mzu:`mzu-latn-pg`,mzv:`mzv-latn-cf`,mzw:`mzw-latn-zz`,mzx:`mzx-latn-gy`,mzz:`mzz-latn-zz`,na:`na-latn-nr`,naa:`naa-latn-id`,nab:`nab-latn-br`,nac:`nac-latn-zz`,nae:`nae-latn-id`,naf:`naf-latn-zz`,nag:`nag-latn-in`,naj:`naj-latn-gn`,nak:`nak-latn-zz`,nal:`nal-latn-pg`,nam:`nam-latn-au`,nan:`nan-hans-cn`,nao:`nao-deva-np`,nap:`nap-latn-it`,naq:`naq-latn-na`,nar:`nar-latn-ng`,nas:`nas-latn-zz`,nat:`nat-latn-ng`,naw:`naw-latn-gh`,nax:`nax-latn-pg`,nay:`nay-latn-au`,naz:`naz-latn-mx`,nb:`nb-latn-no`,nba:`nba-latn-ao`,nbb:`nbb-latn-ng`,nbc:`nbc-latn-in`,nbd:`nbd-latn-cd`,nbe:`nbe-latn-in`,nbh:`nbh-latn-ng`,nbi:`nbi-latn-in`,nbj:`nbj-latn-au`,nbk:`nbk-latn-pg`,nbm:`nbm-latn-cf`,nbn:`nbn-latn-id`,nbo:`nbo-latn-ng`,nbp:`nbp-latn-ng`,nbq:`nbq-latn-id`,nbr:`nbr-latn-ng`,nbt:`nbt-latn-in`,"nbt-deva":`nbt-deva-in`,nbu:`nbu-latn-in`,nbv:`nbv-latn-cm`,nbw:`nbw-latn-cd`,nby:`nby-latn-pg`,nca:`nca-latn-zz`,ncb:`ncb-latn-in`,"ncb-deva":`ncb-deva-in`,ncc:`ncc-latn-pg`,ncd:`ncd-deva-np`,nce:`nce-latn-zz`,ncf:`ncf-latn-zz`,ncg:`ncg-latn-ca`,nch:`nch-latn-mx`,nci:`nci-latn-mx`,ncj:`ncj-latn-mx`,nck:`nck-latn-au`,ncl:`ncl-latn-mx`,ncm:`ncm-latn-pg`,ncn:`ncn-latn-pg`,nco:`nco-latn-zz`,ncq:`ncq-laoo-la`,"ncq-thai":`ncq-thai-la`,ncr:`ncr-latn-cm`,nct:`nct-latn-in`,"nct-beng":`nct-beng-in`,ncu:`ncu-latn-zz`,ncx:`ncx-latn-mx`,ncz:`ncz-latn-us`,nd:`nd-latn-zw`,nda:`nda-latn-cg`,ndb:`ndb-latn-cm`,ndc:`ndc-latn-mz`,ndd:`ndd-latn-ng`,ndf:`ndf-cyrl-ru`,ndg:`ndg-latn-tz`,ndh:`ndh-latn-tz`,ndi:`ndi-latn-ng`,ndj:`ndj-latn-tz`,ndk:`ndk-latn-cd`,ndl:`ndl-latn-cd`,ndm:`ndm-latn-td`,ndn:`ndn-latn-cg`,ndp:`ndp-latn-ug`,ndq:`ndq-latn-ao`,ndr:`ndr-latn-ng`,nds:`nds-latn-de`,ndt:`ndt-latn-cd`,ndu:`ndu-latn-cm`,ndv:`ndv-latn-sn`,ndw:`ndw-latn-cd`,ndx:`ndx-latn-id`,ndy:`ndy-latn-cf`,"ndy-td":`ndy-latn-td`,ndz:`ndz-latn-ss`,ne:`ne-deva-np`,nea:`nea-latn-id`,neb:`neb-latn-zz`,nec:`nec-latn-id`,ned:`ned-latn-ng`,nee:`nee-latn-nc`,neg:`neg-cyrl-ru`,neh:`neh-tibt-bt`,nei:`nei-xsux-tr`,nej:`nej-latn-pg`,nek:`nek-latn-nc`,nem:`nem-latn-nc`,nen:`nen-latn-nc`,neo:`neo-latn-vn`,neq:`neq-latn-mx`,ner:`ner-latn-id`,net:`net-latn-pg`,neu:`neu-latn-001`,new:`new-deva-np`,nex:`nex-latn-zz`,ney:`ney-latn-ci`,nez:`nez-latn-us`,nfa:`nfa-latn-id`,nfd:`nfd-latn-ng`,nfl:`nfl-latn-sb`,nfr:`nfr-latn-zz`,nfu:`nfu-latn-cm`,ng:`ng-latn-na`,nga:`nga-latn-zz`,ngb:`ngb-latn-zz`,ngc:`ngc-latn-cd`,ngd:`ngd-latn-cf`,nge:`nge-latn-cm`,ngg:`ngg-latn-cf`,ngh:`ngh-latn-za`,ngi:`ngi-latn-ng`,ngj:`ngj-latn-cm`,ngk:`ngk-latn-au`,ngl:`ngl-latn-mz`,ngm:`ngm-latn-fm`,ngn:`ngn-latn-cm`,ngp:`ngp-latn-tz`,ngq:`ngq-latn-tz`,ngr:`ngr-latn-sb`,ngs:`ngs-latn-ng`,ngt:`ngt-laoo-la`,ngu:`ngu-latn-mx`,ngv:`ngv-latn-cm`,ngw:`ngw-latn-ng`,ngx:`ngx-latn-ng`,ngy:`ngy-latn-cm`,ngz:`ngz-latn-cg`,nha:`nha-latn-au`,nhb:`nhb-latn-zz`,nhc:`nhc-latn-mx`,nhd:`nhd-latn-py`,nhe:`nhe-latn-mx`,nhf:`nhf-latn-au`,nhg:`nhg-latn-mx`,nhi:`nhi-latn-mx`,nhk:`nhk-latn-mx`,nhm:`nhm-latn-mx`,nhn:`nhn-latn-mx`,nho:`nho-latn-pg`,nhp:`nhp-latn-mx`,nhq:`nhq-latn-mx`,nhr:`nhr-latn-bw`,nht:`nht-latn-mx`,nhu:`nhu-latn-cm`,nhv:`nhv-latn-mx`,nhw:`nhw-latn-mx`,nhx:`nhx-latn-mx`,nhy:`nhy-latn-mx`,nhz:`nhz-latn-mx`,nia:`nia-latn-id`,nib:`nib-latn-pg`,nid:`nid-latn-au`,nie:`nie-latn-td`,nif:`nif-latn-zz`,nig:`nig-latn-au`,nih:`nih-latn-tz`,nii:`nii-latn-zz`,nij:`nij-latn-id`,nil:`nil-latn-id`,nim:`nim-latn-tz`,nin:`nin-latn-zz`,nio:`nio-cyrl-ru`,niq:`niq-latn-ke`,nir:`nir-latn-id`,nis:`nis-latn-pg`,nit:`nit-telu-in`,niu:`niu-latn-nu`,niv:`niv-cyrl-ru`,"niv-latn":`niv-latn-ru`,niw:`niw-latn-pg`,nix:`nix-latn-cd`,niy:`niy-latn-zz`,niz:`niz-latn-zz`,nja:`nja-latn-ng`,njb:`njb-latn-in`,njd:`njd-latn-tz`,njh:`njh-latn-in`,nji:`nji-latn-au`,njj:`njj-latn-cm`,njl:`njl-latn-ss`,njm:`njm-latn-in`,njn:`njn-latn-in`,njo:`njo-latn-in`,njr:`njr-latn-ng`,njs:`njs-latn-id`,njt:`njt-latn-sr`,nju:`nju-latn-au`,njx:`njx-latn-cg`,njy:`njy-latn-cm`,njz:`njz-latn-in`,"njz-beng":`njz-beng-in`,nka:`nka-latn-zm`,nkb:`nkb-latn-in`,nkc:`nkc-latn-cm`,nkd:`nkd-latn-in`,nke:`nke-latn-sb`,nkf:`nkf-latn-in`,nkg:`nkg-latn-zz`,nkh:`nkh-latn-in`,nki:`nki-latn-in`,"nki-beng":`nki-beng-in`,nkj:`nkj-latn-id`,nkk:`nkk-latn-vu`,nkm:`nkm-latn-pg`,nkn:`nkn-latn-ao`,nko:`nko-latn-zz`,nkq:`nkq-latn-gh`,nkr:`nkr-latn-fm`,nks:`nks-latn-id`,nkt:`nkt-latn-tz`,nku:`nku-latn-ci`,nkv:`nkv-latn-mw`,nkw:`nkw-latn-cd`,nkx:`nkx-latn-ng`,nkz:`nkz-latn-ng`,nl:`nl-latn-nl`,nla:`nla-latn-cm`,nlc:`nlc-latn-id`,nle:`nle-latn-ke`,nlg:`nlg-latn-sb`,nli:`nli-arab-af`,nlj:`nlj-latn-cd`,nlk:`nlk-latn-id`,nlm:`nlm-arab-pk`,nlo:`nlo-latn-cd`,nlq:`nlq-latn-mm`,nlu:`nlu-latn-gh`,nlv:`nlv-latn-mx`,nlw:`nlw-latn-au`,nlx:`nlx-deva-in`,nly:`nly-latn-au`,nlz:`nlz-latn-sb`,nma:`nma-latn-in`,nmb:`nmb-latn-vu`,nmc:`nmc-latn-td`,nmd:`nmd-latn-ga`,nme:`nme-latn-in`,nmf:`nmf-latn-in`,nmg:`nmg-latn-cm`,nmh:`nmh-latn-in`,nmi:`nmi-latn-ng`,nmj:`nmj-latn-cf`,nmk:`nmk-latn-vu`,nml:`nml-latn-cm`,nmm:`nmm-deva-np`,"nmm-tibt":`nmm-tibt-np`,nmn:`nmn-latn-bw`,nmo:`nmo-latn-in`,"nmo-beng":`nmo-beng-in`,nmp:`nmp-latn-au`,nmq:`nmq-latn-zw`,nmr:`nmr-latn-cm`,nms:`nms-latn-vu`,nmt:`nmt-latn-fm`,nmu:`nmu-latn-us`,nmv:`nmv-latn-au`,nmw:`nmw-latn-pg`,nmx:`nmx-latn-pg`,nmz:`nmz-latn-zz`,nn:`nn-latn-no`,nna:`nna-latn-au`,nnb:`nnb-latn-cd`,nnc:`nnc-latn-td`,nnd:`nnd-latn-vu`,nne:`nne-latn-ao`,nnf:`nnf-latn-zz`,nng:`nng-latn-in`,"nng-beng":`nng-beng-in`,nnh:`nnh-latn-cm`,nni:`nni-latn-id`,nnj:`nnj-latn-et`,nnk:`nnk-latn-zz`,nnl:`nnl-latn-in`,nnm:`nnm-latn-zz`,nnn:`nnn-latn-td`,nnp:`nnp-wcho-in`,nnq:`nnq-latn-tz`,nnr:`nnr-latn-au`,nnt:`nnt-latn-us`,nnu:`nnu-latn-gh`,nnv:`nnv-latn-au`,nnw:`nnw-latn-bf`,nny:`nny-latn-au`,nnz:`nnz-latn-cm`,no:`no-latn-no`,noa:`noa-latn-co`,noc:`noc-latn-pg`,nod:`nod-lana-th`,noe:`noe-deva-in`,nof:`nof-latn-pg`,nog:`nog-cyrl-ru`,noh:`noh-latn-pg`,noi:`noi-deva-in`,noj:`noj-latn-co`,nok:`nok-latn-us`,nom:`nom-latn-pe`,non:`non-runr-se`,nop:`nop-latn-zz`,noq:`noq-latn-cd`,nos:`nos-yiii-cn`,not:`not-latn-pe`,nou:`nou-latn-zz`,nov:`nov-latn-001`,now:`now-latn-tz`,noy:`noy-latn-td`,npb:`npb-tibt-bt`,npg:`npg-latn-mm`,nph:`nph-latn-in`,npl:`npl-latn-mx`,npn:`npn-latn-pg`,npo:`npo-latn-in`,nps:`nps-latn-id`,npu:`npu-latn-in`,npx:`npx-latn-sb`,npy:`npy-latn-id`,nqg:`nqg-latn-bj`,nqk:`nqk-latn-bj`,nql:`nql-latn-ao`,nqm:`nqm-latn-id`,nqn:`nqn-latn-pg`,nqo:`nqo-nkoo-gn`,nqq:`nqq-latn-mm`,nqt:`nqt-latn-ng`,nqy:`nqy-latn-mm`,nr:`nr-latn-za`,nra:`nra-latn-ga`,nrb:`nrb-latn-zz`,nre:`nre-latn-in`,nrf:`nrf-latn-je`,nrg:`nrg-latn-vu`,nri:`nri-latn-in`,nrk:`nrk-latn-au`,nrl:`nrl-latn-au`,nrm:`nrm-latn-my`,nrp:`nrp-latn-it`,nru:`nru-latn-cn`,"nru-hans":`nru-hans-cn`,"nru-hant":`nru-hant-cn`,nrx:`nrx-latn-au`,nrz:`nrz-latn-pg`,nsa:`nsa-latn-in`,nsb:`nsb-latn-za`,nsc:`nsc-latn-ng`,nsd:`nsd-yiii-cn`,nse:`nse-latn-zm`,nsf:`nsf-yiii-cn`,nsg:`nsg-latn-tz`,nsh:`nsh-latn-cm`,nsk:`nsk-cans-ca`,nsm:`nsm-latn-in`,nsn:`nsn-latn-zz`,nso:`nso-latn-za`,nsq:`nsq-latn-us`,nss:`nss-latn-zz`,nst:`nst-tnsa-in`,nsu:`nsu-latn-mx`,nsv:`nsv-yiii-cn`,nsw:`nsw-latn-vu`,nsx:`nsx-latn-ao`,nsy:`nsy-latn-id`,nsz:`nsz-latn-us`,ntd:`ntd-latn-my`,nte:`nte-latn-mz`,ntg:`ntg-latn-au`,nti:`nti-latn-bf`,ntj:`ntj-latn-au`,ntk:`ntk-latn-tz`,ntm:`ntm-latn-zz`,nto:`nto-latn-cd`,ntp:`ntp-latn-mx`,ntr:`ntr-latn-zz`,ntu:`ntu-latn-sb`,ntx:`ntx-latn-mm`,nty:`nty-yiii-vn`,ntz:`ntz-arab-ir`,nua:`nua-latn-nc`,nuc:`nuc-latn-br`,nud:`nud-latn-pg`,nue:`nue-latn-cd`,nuf:`nuf-latn-cn`,nug:`nug-latn-au`,nuh:`nuh-latn-ng`,nui:`nui-latn-zz`,nuj:`nuj-latn-ug`,nuk:`nuk-latn-ca`,num:`num-latn-to`,nun:`nun-latn-mm`,nuo:`nuo-latn-vn`,nup:`nup-latn-zz`,nuq:`nuq-latn-pg`,nur:`nur-latn-pg`,nus:`nus-latn-ss`,nut:`nut-latn-vn`,nuu:`nuu-latn-cd`,nuv:`nuv-latn-zz`,nuw:`nuw-latn-fm`,nux:`nux-latn-zz`,nuy:`nuy-latn-au`,nuz:`nuz-latn-mx`,nv:`nv-latn-us`,nvh:`nvh-latn-vu`,nvm:`nvm-latn-pg`,nvo:`nvo-latn-cm`,nwb:`nwb-latn-zz`,nwc:`nwc-newa-np`,"nwc-brah":`nwc-brah-np`,"nwc-deva":`nwc-deva-np`,"nwc-sidd":`nwc-sidd-np`,nwe:`nwe-latn-cm`,nwg:`nwg-latn-au`,nwi:`nwi-latn-vu`,nwm:`nwm-latn-ss`,nwo:`nwo-latn-au`,nwr:`nwr-latn-pg`,nww:`nww-latn-tz`,nwx:`nwx-deva-np`,nxa:`nxa-latn-tl`,nxd:`nxd-latn-cd`,nxe:`nxe-latn-id`,nxg:`nxg-latn-id`,nxi:`nxi-latn-tz`,nxl:`nxl-latn-id`,nxn:`nxn-latn-au`,nxo:`nxo-latn-ga`,nxq:`nxq-latn-cn`,nxr:`nxr-latn-zz`,nxx:`nxx-latn-id`,ny:`ny-latn-mw`,nyb:`nyb-latn-gh`,nyc:`nyc-latn-cd`,nyd:`nyd-latn-ke`,nye:`nye-latn-ao`,nyf:`nyf-latn-ke`,nyg:`nyg-latn-cd`,nyh:`nyh-latn-au`,nyi:`nyi-latn-sd`,nyj:`nyj-latn-cd`,nyk:`nyk-latn-ao`,nyl:`nyl-thai-th`,nym:`nym-latn-tz`,nyn:`nyn-latn-ug`,nyo:`nyo-latn-ug`,nyp:`nyp-latn-ug`,nyq:`nyq-arab-ir`,nyr:`nyr-latn-mw`,nys:`nys-latn-au`,nyt:`nyt-latn-au`,nyu:`nyu-latn-mz`,nyv:`nyv-latn-au`,nyx:`nyx-latn-au`,nyy:`nyy-latn-tz`,nza:`nza-latn-cm`,nzb:`nzb-latn-ga`,nzd:`nzd-latn-cd`,nzi:`nzi-latn-gh`,nzk:`nzk-latn-cf`,nzm:`nzm-latn-in`,nzu:`nzu-latn-cg`,nzy:`nzy-latn-td`,nzz:`nzz-latn-ml`,oaa:`oaa-cyrl-ru`,oac:`oac-cyrl-ru`,oar:`oar-syrc-sy`,oav:`oav-geor-ge`,obi:`obi-latn-us`,obk:`obk-latn-ph`,obl:`obl-latn-cm`,obm:`obm-phnx-jo`,obo:`obo-latn-ph`,obr:`obr-mymr-mm`,obt:`obt-latn-fr`,obu:`obu-latn-ng`,oc:`oc-latn-fr`,oca:`oca-latn-pe`,oco:`oco-latn-gb`,ocu:`ocu-latn-mx`,oda:`oda-latn-ng`,odk:`odk-arab-pk`,odt:`odt-latn-nl`,odu:`odu-latn-ng`,ofu:`ofu-latn-ng`,ogb:`ogb-latn-ng`,ogc:`ogc-latn-zz`,ogg:`ogg-latn-ng`,ogo:`ogo-latn-ng`,ogu:`ogu-latn-ng`,oht:`oht-xsux-tr`,oia:`oia-latn-id`,oie:`oie-latn-ss`,oin:`oin-latn-pg`,oj:`oj-cans-ca`,ojb:`ojb-latn-ca`,"ojb-cans":`ojb-cans-ca`,ojc:`ojc-latn-ca`,ojs:`ojs-cans-ca`,ojv:`ojv-latn-sb`,ojw:`ojw-latn-ca`,"ojw-cans":`ojw-cans-ca`,oka:`oka-latn-ca`,okb:`okb-latn-ng`,okc:`okc-latn-cd`,okd:`okd-latn-ng`,oke:`oke-latn-ng`,okg:`okg-latn-au`,oki:`oki-latn-ke`,okk:`okk-latn-pg`,okm:`okm-hang-kr`,oko:`oko-hani-kr`,okr:`okr-latn-zz`,oks:`oks-latn-ng`,oku:`oku-latn-cm`,okv:`okv-latn-zz`,okx:`okx-latn-ng`,okz:`okz-khmr-kh`,ola:`ola-deva-np`,"ola-tibt":`ola-tibt-cn`,old:`old-latn-tz`,ole:`ole-tibt-bt`,olk:`olk-latn-au`,olm:`olm-latn-ng`,olo:`olo-latn-ru`,olr:`olr-latn-vu`,olt:`olt-latn-lt`,olu:`olu-latn-ao`,om:`om-latn-et`,oma:`oma-latn-us`,omb:`omb-latn-vu`,omc:`omc-latn-pe`,omg:`omg-latn-pe`,omi:`omi-latn-cd`,omk:`omk-cyrl-ru`,oml:`oml-latn-cd`,omo:`omo-latn-pg`,omp:`omp-mtei-in`,omr:`omr-modi-in`,omt:`omt-latn-ke`,omu:`omu-latn-pe`,omw:`omw-latn-pg`,ona:`ona-latn-ar`,one:`one-latn-ca`,ong:`ong-latn-zz`,oni:`oni-latn-id`,onj:`onj-latn-pg`,onk:`onk-latn-pg`,onn:`onn-latn-zz`,ono:`ono-latn-ca`,onp:`onp-latn-in`,"onp-deva":`onp-deva-in`,onr:`onr-latn-pg`,ons:`ons-latn-zz`,ont:`ont-latn-pg`,onu:`onu-latn-vu`,onx:`onx-latn-id`,ood:`ood-latn-us`,oon:`oon-deva-in`,oor:`oor-latn-za`,opa:`opa-latn-ng`,opk:`opk-latn-id`,opm:`opm-latn-zz`,opo:`opo-latn-pg`,opt:`opt-latn-mx`,opy:`opy-latn-br`,or:`or-orya-in`,ora:`ora-latn-sb`,orc:`orc-latn-ke`,ore:`ore-latn-pe`,org:`org-latn-ng`,orn:`orn-latn-my`,oro:`oro-latn-zz`,orr:`orr-latn-ng`,ors:`ors-latn-my`,ort:`ort-telu-in`,oru:`oru-arab-zz`,orv:`orv-cyrl-ru`,orw:`orw-latn-br`,orx:`orx-latn-ng`,orz:`orz-latn-id`,os:`os-cyrl-ge`,osa:`osa-osge-us`,osc:`osc-ital-it`,"osc-latn":`osc-latn-it`,osi:`osi-java-id`,oso:`oso-latn-ng`,osp:`osp-latn-es`,ost:`ost-latn-cm`,osu:`osu-latn-pg`,osx:`osx-latn-de`,ota:`ota-arab-zz`,otb:`otb-tibt-cn`,otd:`otd-latn-id`,ote:`ote-latn-mx`,oti:`oti-latn-br`,otk:`otk-orkh-mn`,otl:`otl-latn-mx`,otm:`otm-latn-mx`,otn:`otn-latn-mx`,otq:`otq-latn-mx`,otr:`otr-latn-sd`,ots:`ots-latn-mx`,ott:`ott-latn-mx`,otu:`otu-latn-br`,otw:`otw-latn-ca`,otx:`otx-latn-mx`,oty:`oty-gran-in`,otz:`otz-latn-mx`,oub:`oub-latn-lr`,oue:`oue-latn-pg`,oui:`oui-ougr-143`,oum:`oum-latn-pg`,ovd:`ovd-latn-se`,owi:`owi-latn-pg`,owl:`owl-latn-gb`,oyd:`oyd-latn-et`,oym:`oym-latn-br`,oyy:`oyy-latn-pg`,ozm:`ozm-latn-zz`,pa:`pa-guru-in`,"pa-arab":`pa-arab-pk`,"pa-pk":`pa-arab-pk`,pab:`pab-latn-br`,pac:`pac-latn-vn`,pad:`pad-latn-br`,pae:`pae-latn-cd`,paf:`paf-latn-br`,pag:`pag-latn-ph`,pah:`pah-latn-br`,pai:`pai-latn-ng`,pak:`pak-latn-br`,pal:`pal-phli-ir`,"pal-phlp":`pal-phlp-cn`,pam:`pam-latn-ph`,pao:`pao-latn-us`,pap:`pap-latn-cw`,paq:`paq-cyrl-tj`,par:`par-latn-us`,pas:`pas-latn-id`,pau:`pau-latn-pw`,pav:`pav-latn-br`,paw:`paw-latn-us`,pax:`pax-latn-br`,pay:`pay-latn-hn`,paz:`paz-latn-br`,pbb:`pbb-latn-co`,pbc:`pbc-latn-gy`,pbe:`pbe-latn-mx`,pbf:`pbf-latn-mx`,pbg:`pbg-latn-ve`,pbh:`pbh-latn-ve`,pbi:`pbi-latn-zz`,pbl:`pbl-latn-ng`,pbm:`pbm-latn-mx`,pbn:`pbn-latn-ng`,pbo:`pbo-latn-gw`,pbp:`pbp-latn-gn`,pbr:`pbr-latn-tz`,pbs:`pbs-latn-mx`,pbt:`pbt-arab-af`,pbv:`pbv-latn-in`,pby:`pby-latn-pg`,pca:`pca-latn-mx`,pcb:`pcb-khmr-kh`,pcc:`pcc-latn-cn`,"pcc-hani":`pcc-hani-cn`,pcd:`pcd-latn-fr`,pce:`pce-mymr-mm`,"pce-thai":`pce-thai-th`,pcf:`pcf-mlym-in`,pcg:`pcg-mlym-in`,"pcg-knda":`pcg-knda-in`,"pcg-taml":`pcg-taml-in`,pch:`pch-deva-in`,pci:`pci-deva-in`,"pci-orya":`pci-orya-in`,pcj:`pcj-telu-in`,pck:`pck-latn-in`,pcm:`pcm-latn-ng`,pcn:`pcn-latn-ng`,pcp:`pcp-latn-bo`,pcw:`pcw-latn-ng`,pda:`pda-latn-pg`,pdc:`pdc-latn-us`,pdn:`pdn-latn-id`,pdo:`pdo-latn-id`,pdt:`pdt-latn-ca`,pdu:`pdu-latn-mm`,"pdu-mymr":`pdu-mymr-mm`,pea:`pea-latn-id`,peb:`peb-latn-us`,ped:`ped-latn-zz`,pee:`pee-latn-id`,peg:`peg-orya-in`,pei:`pei-latn-mx`,pek:`pek-latn-pg`,pel:`pel-latn-id`,pem:`pem-latn-cd`,peo:`peo-xpeo-ir`,pep:`pep-latn-pg`,peq:`peq-latn-us`,pev:`pev-latn-ve`,pex:`pex-latn-zz`,pey:`pey-latn-id`,pez:`pez-latn-my`,pfa:`pfa-latn-fm`,pfe:`pfe-latn-cm`,pfl:`pfl-latn-de`,pga:`pga-latn-ss`,pgd:`pgd-khar-pk`,pgg:`pgg-deva-in`,pgi:`pgi-latn-pg`,pgk:`pgk-latn-vu`,pgl:`pgl-ogam-ie`,pgn:`pgn-ital-it`,pgs:`pgs-latn-ng`,pgu:`pgu-latn-id`,phd:`phd-deva-in`,phg:`phg-latn-vn`,phh:`phh-latn-vn`,phk:`phk-mymr-in`,phl:`phl-arab-zz`,phm:`phm-latn-mz`,phn:`phn-phnx-lb`,pho:`pho-laoo-la`,phr:`phr-arab-pk`,pht:`pht-thai-th`,phv:`phv-arab-af`,phw:`phw-deva-np`,pi:`pi-sinh-in`,"pi-brah":`pi-brah-in`,"pi-deva":`pi-deva-in`,"pi-khar":`pi-khar-in`,"pi-khmr":`pi-khmr-in`,"pi-mymr":`pi-mymr-in`,"pi-thai":`pi-thai-in`,pia:`pia-latn-mx`,pib:`pib-latn-pe`,pic:`pic-latn-ga`,pid:`pid-latn-ve`,pif:`pif-latn-fm`,pig:`pig-latn-pe`,pih:`pih-latn-nf`,pij:`pij-latn-co`,pil:`pil-latn-zz`,pim:`pim-latn-us`,pin:`pin-latn-pg`,pio:`pio-latn-co`,pip:`pip-latn-zz`,pir:`pir-latn-br`,pis:`pis-latn-sb`,pit:`pit-latn-au`,piu:`piu-latn-au`,piv:`piv-latn-sb`,piw:`piw-latn-tz`,pix:`pix-latn-pg`,piy:`piy-latn-ng`,piz:`piz-latn-nc`,pjt:`pjt-latn-au`,pka:`pka-brah-in`,pkb:`pkb-latn-ke`,pkg:`pkg-latn-pg`,pkh:`pkh-latn-bd`,"pkh-deva":`pkh-deva-bd`,pkn:`pkn-latn-au`,pko:`pko-latn-ke`,pkp:`pkp-latn-ck`,pkr:`pkr-mlym-in`,pku:`pku-latn-id`,pl:`pl-latn-pl`,pla:`pla-latn-zz`,plb:`plb-latn-vu`,plc:`plc-latn-ph`,pld:`pld-latn-gb`,ple:`ple-latn-id`,plg:`plg-latn-ar`,plh:`plh-latn-id`,plj:`plj-latn-ng`,plk:`plk-arab-pk`,pll:`pll-mymr-mm`,pln:`pln-latn-co`,plo:`plo-latn-mx`,plr:`plr-latn-ci`,pls:`pls-latn-mx`,plu:`plu-latn-br`,plv:`plv-latn-ph`,plw:`plw-latn-ph`,plz:`plz-latn-my`,pma:`pma-latn-vu`,pmb:`pmb-latn-cd`,pmd:`pmd-latn-au`,pme:`pme-latn-nc`,pmf:`pmf-latn-id`,pmh:`pmh-brah-in`,pmi:`pmi-latn-cn`,pmj:`pmj-latn-cn`,pml:`pml-latn-tn`,pmm:`pmm-latn-cm`,pmn:`pmn-latn-cm`,pmo:`pmo-latn-id`,pmq:`pmq-latn-mx`,pmr:`pmr-latn-pg`,pms:`pms-latn-it`,pmt:`pmt-latn-pf`,pmw:`pmw-latn-us`,pmx:`pmx-latn-in`,pmy:`pmy-latn-id`,pmz:`pmz-latn-mx`,pna:`pna-latn-my`,pnc:`pnc-latn-id`,pnd:`pnd-latn-ao`,pne:`pne-latn-my`,png:`png-latn-zz`,pnh:`pnh-latn-ck`,pni:`pni-latn-id`,pnj:`pnj-latn-au`,pnk:`pnk-latn-bo`,pnl:`pnl-latn-bf`,pnm:`pnm-latn-my`,pnn:`pnn-latn-zz`,pno:`pno-latn-pe`,pnp:`pnp-latn-id`,pnq:`pnq-latn-bf`,pnr:`pnr-latn-pg`,pns:`pns-latn-id`,pnt:`pnt-grek-gr`,pnv:`pnv-latn-au`,pnw:`pnw-latn-au`,pny:`pny-latn-cm`,pnz:`pnz-latn-cf`,poc:`poc-latn-gt`,poe:`poe-latn-mx`,pof:`pof-latn-cd`,pog:`pog-latn-br`,poh:`poh-latn-gt`,poi:`poi-latn-mx`,pok:`pok-latn-br`,pom:`pom-latn-us`,pon:`pon-latn-fm`,poo:`poo-latn-us`,pop:`pop-latn-nc`,poq:`poq-latn-mx`,pos:`pos-latn-mx`,pot:`pot-latn-us`,pov:`pov-latn-gw`,pow:`pow-latn-mx`,poy:`poy-latn-tz`,ppa:`ppa-deva-in`,ppe:`ppe-latn-pg`,ppi:`ppi-latn-mx`,ppk:`ppk-latn-id`,ppl:`ppl-latn-sv`,ppm:`ppm-latn-id`,ppn:`ppn-latn-pg`,ppo:`ppo-latn-zz`,ppp:`ppp-latn-cd`,ppq:`ppq-latn-pg`,pps:`pps-latn-mx`,ppt:`ppt-latn-pg`,pqa:`pqa-latn-ng`,pqm:`pqm-latn-ca`,pra:`pra-khar-pk`,prc:`prc-arab-af`,prd:`prd-arab-ir`,pre:`pre-latn-st`,prf:`prf-latn-ph`,prg:`prg-latn-001`,prh:`prh-latn-ph`,pri:`pri-latn-nc`,prk:`prk-latn-mm`,prm:`prm-latn-pg`,pro:`pro-latn-fr`,prp:`prp-gujr-in`,prq:`prq-latn-pe`,prr:`prr-latn-br`,prt:`prt-thai-th`,pru:`pru-latn-id`,prw:`prw-latn-pg`,prx:`prx-arab-in`,"prx-tibt":`prx-tibt-in`,ps:`ps-arab-af`,psa:`psa-latn-id`,pse:`pse-latn-id`,psh:`psh-arab-af`,psi:`psi-arab-af`,psm:`psm-latn-bo`,psn:`psn-latn-id`,psq:`psq-latn-pg`,pss:`pss-latn-zz`,pst:`pst-arab-pk`,psw:`psw-latn-vu`,pt:`pt-latn-br`,pta:`pta-latn-py`,pth:`pth-latn-br`,pti:`pti-latn-au`,ptn:`ptn-latn-id`,pto:`pto-latn-br`,ptp:`ptp-latn-zz`,ptr:`ptr-latn-vu`,ptt:`ptt-latn-id`,ptu:`ptu-latn-id`,ptv:`ptv-latn-vu`,pua:`pua-latn-mx`,pub:`pub-latn-in`,puc:`puc-latn-id`,pud:`pud-latn-id`,pue:`pue-latn-ar`,puf:`puf-latn-id`,pug:`pug-latn-bf`,pui:`pui-latn-co`,puj:`puj-latn-id`,pum:`pum-deva-np`,puo:`puo-latn-vn`,pup:`pup-latn-pg`,puq:`puq-latn-pe`,pur:`pur-latn-br`,put:`put-latn-id`,puu:`puu-latn-ga`,puw:`puw-latn-fm`,pux:`pux-latn-pg`,puy:`puy-latn-us`,pwa:`pwa-latn-zz`,pwb:`pwb-latn-ng`,pwg:`pwg-latn-pg`,pwm:`pwm-latn-ph`,pwn:`pwn-latn-tw`,pwo:`pwo-mymr-mm`,pwr:`pwr-deva-in`,pww:`pww-thai-th`,pxm:`pxm-latn-mx`,pye:`pye-latn-ci`,pym:`pym-latn-ng`,pyn:`pyn-latn-br`,pyu:`pyu-latn-tw`,"pyu-hani":`pyu-hani-tw`,pyx:`pyx-mymr-mm`,pyy:`pyy-latn-mm`,pzh:`pzh-latn-tw`,pzn:`pzn-latn-mm`,qu:`qu-latn-pe`,qua:`qua-latn-us`,qub:`qub-latn-pe`,quc:`quc-latn-gt`,qud:`qud-latn-ec`,quf:`quf-latn-pe`,qug:`qug-latn-ec`,qui:`qui-latn-us`,quk:`quk-latn-pe`,qul:`qul-latn-bo`,qum:`qum-latn-gt`,qun:`qun-latn-us`,qup:`qup-latn-pe`,quq:`quq-latn-es`,qur:`qur-latn-pe`,qus:`qus-latn-ar`,quv:`quv-latn-gt`,quw:`quw-latn-ec`,qux:`qux-latn-pe`,quy:`quy-latn-pe`,qva:`qva-latn-pe`,qvc:`qvc-latn-pe`,qve:`qve-latn-pe`,qvh:`qvh-latn-pe`,qvi:`qvi-latn-ec`,qvj:`qvj-latn-ec`,qvl:`qvl-latn-pe`,qvm:`qvm-latn-pe`,qvn:`qvn-latn-pe`,qvo:`qvo-latn-pe`,qvp:`qvp-latn-pe`,qvs:`qvs-latn-pe`,qvw:`qvw-latn-pe`,qvz:`qvz-latn-ec`,qwa:`qwa-latn-pe`,qwc:`qwc-latn-pe`,qwh:`qwh-latn-pe`,qwm:`qwm-latn-ru`,"qwm-cyrl":`qwm-cyrl-ru`,"qwm-runr":`qwm-runr-ru`,qws:`qws-latn-pe`,qwt:`qwt-latn-us`,qxa:`qxa-latn-pe`,qxc:`qxc-latn-pe`,qxh:`qxh-latn-pe`,qxl:`qxl-latn-ec`,qxn:`qxn-latn-pe`,qxo:`qxo-latn-pe`,qxp:`qxp-latn-pe`,qxq:`qxq-arab-ir`,qxr:`qxr-latn-ec`,qxt:`qxt-latn-pe`,qxu:`qxu-latn-pe`,qxw:`qxw-latn-pe`,qya:`qya-latn-001`,qyp:`qyp-latn-us`,raa:`raa-deva-np`,rab:`rab-deva-np`,rac:`rac-latn-id`,rad:`rad-latn-vn`,raf:`raf-deva-np`,rag:`rag-latn-ke`,rah:`rah-beng-in`,"rah-latn":`rah-latn-in`,rai:`rai-latn-zz`,raj:`raj-deva-in`,rak:`rak-latn-pg`,ram:`ram-latn-br`,ran:`ran-latn-id`,rao:`rao-latn-zz`,rap:`rap-latn-cl`,rar:`rar-latn-ck`,rav:`rav-deva-np`,raw:`raw-latn-mm`,rax:`rax-latn-ng`,ray:`ray-latn-pf`,raz:`raz-latn-id`,rbb:`rbb-mymr-mm`,rbk:`rbk-latn-ph`,rbl:`rbl-latn-ph`,rbp:`rbp-latn-au`,rcf:`rcf-latn-re`,rdb:`rdb-arab-ir`,rea:`rea-latn-pg`,reb:`reb-latn-id`,ree:`ree-latn-my`,reg:`reg-latn-tz`,rei:`rei-orya-in`,"rei-telu":`rei-telu-in`,rej:`rej-latn-id`,rel:`rel-latn-zz`,rem:`rem-latn-pe`,ren:`ren-latn-vn`,res:`res-latn-zz`,ret:`ret-latn-id`,rey:`rey-latn-bo`,rga:`rga-latn-vu`,rgn:`rgn-latn-it`,rgr:`rgr-latn-pe`,rgs:`rgs-latn-vn`,rgu:`rgu-latn-id`,rhg:`rhg-rohg-mm`,rhp:`rhp-latn-pg`,ria:`ria-latn-in`,rif:`rif-latn-ma`,ril:`ril-latn-mm`,rim:`rim-latn-tz`,rin:`rin-latn-ng`,rir:`rir-latn-id`,rit:`rit-latn-au`,riu:`riu-latn-id`,rjg:`rjg-latn-id`,rji:`rji-deva-np`,rjs:`rjs-deva-np`,rka:`rka-khmr-kh`,rkb:`rkb-latn-br`,rkh:`rkh-latn-ck`,rki:`rki-mymr-mm`,rkm:`rkm-latn-bf`,rkt:`rkt-beng-bd`,rkw:`rkw-latn-au`,rm:`rm-latn-ch`,rma:`rma-latn-ni`,rmb:`rmb-latn-au`,rmc:`rmc-latn-sk`,rmd:`rmd-latn-dk`,rme:`rme-latn-gb`,rmf:`rmf-latn-fi`,rmg:`rmg-latn-no`,rmh:`rmh-latn-id`,rmi:`rmi-armn-am`,rmk:`rmk-latn-pg`,rml:`rml-latn-pl`,"rml-cyrl":`rml-cyrl-by`,rmm:`rmm-latn-id`,rmn:`rmn-latn-rs`,"rmn-cyrl":`rmn-cyrl-bg`,"rmn-grek":`rmn-grek-gr`,rmo:`rmo-latn-ch`,rmp:`rmp-latn-pg`,rmq:`rmq-latn-es`,rmt:`rmt-arab-ir`,rmu:`rmu-latn-se`,rmw:`rmw-latn-gb`,rmx:`rmx-latn-vn`,rmz:`rmz-mymr-in`,rn:`rn-latn-bi`,rna:`rna-latn-zz`,rnd:`rnd-latn-cd`,rng:`rng-latn-mz`,rnl:`rnl-latn-in`,rnn:`rnn-latn-id`,rnr:`rnr-latn-au`,rnw:`rnw-latn-tz`,ro:`ro-latn-ro`,rob:`rob-latn-id`,roc:`roc-latn-vn`,rod:`rod-latn-ng`,roe:`roe-latn-pg`,rof:`rof-latn-tz`,rog:`rog-latn-vn`,rol:`rol-latn-ph`,rom:`rom-latn-ro`,"rom-cyrl":`rom-cyrl-ro`,roo:`roo-latn-zz`,rop:`rop-latn-au`,ror:`ror-latn-id`,rou:`rou-latn-td`,row:`row-latn-id`,rpn:`rpn-latn-vu`,rpt:`rpt-latn-pg`,rri:`rri-latn-sb`,rro:`rro-latn-zz`,rrt:`rrt-latn-au`,rsk:`rsk-cyrl-rs`,rtc:`rtc-latn-mm`,rth:`rth-latn-id`,rtm:`rtm-latn-fj`,rtw:`rtw-deva-in`,ru:`ru-cyrl-ru`,rub:`rub-latn-ug`,ruc:`ruc-latn-ug`,rue:`rue-cyrl-ua`,ruf:`ruf-latn-tz`,rug:`rug-latn-sb`,rui:`rui-latn-tz`,ruk:`ruk-latn-ng`,ruo:`ruo-latn-hr`,rup:`rup-latn-ro`,"rup-grek":`rup-grek-gr`,ruq:`ruq-latn-gr`,rut:`rut-cyrl-ru`,"rut-latn":`rut-latn-az`,ruu:`ruu-latn-my`,ruy:`ruy-latn-ng`,ruz:`ruz-latn-ng`,rw:`rw-latn-rw`,rwa:`rwa-latn-pg`,rwk:`rwk-latn-tz`,rwl:`rwl-latn-tz`,rwm:`rwm-latn-ug`,rwo:`rwo-latn-zz`,rwr:`rwr-deva-in`,rxd:`rxd-latn-au`,rxw:`rxw-latn-au`,ryu:`ryu-kana-jp`,sa:`sa-deva-in`,saa:`saa-latn-td`,sab:`sab-latn-pa`,sac:`sac-latn-us`,sad:`sad-latn-tz`,sae:`sae-latn-br`,saf:`saf-latn-gh`,sah:`sah-cyrl-ru`,saj:`saj-latn-id`,sak:`sak-latn-ga`,sam:`sam-samr-ps`,"sam-hebr":`sam-hebr-ps`,"sam-syrc":`sam-syrc-ps`,sao:`sao-latn-id`,saq:`saq-latn-ke`,sar:`sar-latn-bo`,sas:`sas-latn-id`,sat:`sat-olck-in`,sau:`sau-latn-id`,sav:`sav-latn-sn`,saw:`saw-latn-id`,sax:`sax-latn-vu`,say:`say-latn-ng`,saz:`saz-saur-in`,sba:`sba-latn-zz`,sbb:`sbb-latn-sb`,sbc:`sbc-latn-pg`,sbd:`sbd-latn-bf`,sbe:`sbe-latn-zz`,sbg:`sbg-latn-id`,sbh:`sbh-latn-pg`,sbi:`sbi-latn-pg`,sbj:`sbj-latn-td`,sbk:`sbk-latn-tz`,sbl:`sbl-latn-ph`,sbm:`sbm-latn-tz`,sbn:`sbn-arab-pk`,sbo:`sbo-latn-my`,sbp:`sbp-latn-tz`,sbq:`sbq-latn-pg`,sbr:`sbr-latn-id`,sbs:`sbs-latn-na`,sbt:`sbt-latn-id`,sbu:`sbu-tibt-in`,"sbu-deva":`sbu-deva-in`,sbv:`sbv-latn-it`,sbw:`sbw-latn-ga`,sbx:`sbx-latn-id`,sby:`sby-latn-zm`,sbz:`sbz-latn-cf`,sc:`sc-latn-it`,scb:`scb-latn-vn`,sce:`sce-latn-cn`,"sce-arab":`sce-arab-cn`,scf:`scf-latn-pa`,scg:`scg-latn-id`,sch:`sch-latn-in`,sci:`sci-latn-lk`,sck:`sck-deva-in`,scl:`scl-arab-zz`,scn:`scn-latn-it`,sco:`sco-latn-gb`,scp:`scp-deva-np`,scs:`scs-latn-ca`,"scs-cans":`scs-cans-ca`,sct:`sct-laoo-la`,scu:`scu-takr-in`,scv:`scv-latn-ng`,scw:`scw-latn-ng`,scx:`scx-grek-it`,sd:`sd-arab-pk`,"sd-deva":`sd-deva-in`,"sd-in":`sd-deva-in`,"sd-khoj":`sd-khoj-in`,"sd-sind":`sd-sind-in`,sda:`sda-latn-id`,sdb:`sdb-arab-iq`,sdc:`sdc-latn-it`,sde:`sde-latn-ng`,sdf:`sdf-arab-iq`,sdg:`sdg-arab-af`,sdh:`sdh-arab-ir`,sdj:`sdj-latn-cg`,sdk:`sdk-latn-pg`,sdn:`sdn-latn-it`,sdo:`sdo-latn-my`,sdq:`sdq-latn-id`,sds:`sds-arab-tn`,sdu:`sdu-latn-id`,sdx:`sdx-latn-my`,se:`se-latn-no`,sea:`sea-latn-my`,seb:`seb-latn-ci`,sec:`sec-latn-ca`,sed:`sed-latn-vn`,see:`see-latn-us`,sef:`sef-latn-ci`,seg:`seg-latn-tz`,seh:`seh-latn-mz`,sei:`sei-latn-mx`,sej:`sej-latn-pg`,sek:`sek-latn-ca`,"sek-cans":`sek-cans-ca`,sel:`sel-cyrl-ru`,sen:`sen-latn-bf`,seo:`seo-latn-pg`,sep:`sep-latn-bf`,seq:`seq-latn-bf`,ser:`ser-latn-us`,ses:`ses-latn-ml`,set:`set-latn-id`,seu:`seu-latn-id`,sev:`sev-latn-ci`,sew:`sew-latn-pg`,sey:`sey-latn-ec`,sez:`sez-latn-mm`,sfe:`sfe-latn-ph`,sfm:`sfm-plrd-cn`,sfw:`sfw-latn-gh`,sg:`sg-latn-cf`,sga:`sga-ogam-ie`,sgb:`sgb-latn-ph`,sgc:`sgc-latn-ke`,sgd:`sgd-latn-ph`,sge:`sge-latn-id`,sgh:`sgh-cyrl-tj`,"sgh-arab":`sgh-arab-af`,"sgh-latn":`sgh-latn-tj`,sgi:`sgi-latn-cm`,sgj:`sgj-deva-in`,sgm:`sgm-latn-ke`,sgp:`sgp-latn-in`,sgr:`sgr-arab-ir`,sgs:`sgs-latn-lt`,sgt:`sgt-tibt-bt`,sgu:`sgu-latn-id`,sgw:`sgw-ethi-zz`,sgy:`sgy-arab-af`,sgz:`sgz-latn-zz`,sha:`sha-latn-ng`,shb:`shb-latn-br`,shc:`shc-latn-cd`,shd:`shd-arab-pk`,she:`she-latn-et`,shg:`shg-latn-bw`,shh:`shh-latn-us`,shi:`shi-tfng-ma`,shj:`shj-latn-sd`,shk:`shk-latn-zz`,shm:`shm-arab-ir`,shn:`shn-mymr-mm`,sho:`sho-latn-ng`,shp:`shp-latn-pe`,shq:`shq-latn-zm`,shr:`shr-latn-cd`,shs:`shs-latn-ca`,sht:`sht-latn-us`,shu:`shu-arab-zz`,shv:`shv-arab-om`,shw:`shw-latn-sd`,shy:`shy-latn-dz`,"shy-arab":`shy-arab-dz`,"shy-tfng":`shy-tfng-dz`,shz:`shz-latn-ml`,si:`si-sinh-lk`,sia:`sia-cyrl-ru`,sib:`sib-latn-my`,sid:`sid-latn-et`,sie:`sie-latn-zm`,sif:`sif-latn-bf`,sig:`sig-latn-zz`,sih:`sih-latn-nc`,sii:`sii-latn-in`,sij:`sij-latn-pg`,sik:`sik-latn-br`,sil:`sil-latn-zz`,sim:`sim-latn-zz`,sip:`sip-tibt-in`,siq:`siq-latn-pg`,sir:`sir-latn-ng`,sis:`sis-latn-us`,siu:`siu-latn-pg`,siv:`siv-latn-pg`,siw:`siw-latn-pg`,six:`six-latn-pg`,siy:`siy-arab-ir`,siz:`siz-arab-eg`,sja:`sja-latn-co`,sjb:`sjb-latn-id`,sjd:`sjd-cyrl-ru`,sje:`sje-latn-se`,sjg:`sjg-latn-td`,sjl:`sjl-latn-in`,sjm:`sjm-latn-ph`,sjp:`sjp-deva-in`,"sjp-beng":`sjp-beng-in`,sjr:`sjr-latn-zz`,sjt:`sjt-cyrl-ru`,sju:`sju-latn-se`,sjw:`sjw-latn-us`,sk:`sk-latn-sk`,ska:`ska-latn-us`,skb:`skb-thai-th`,skc:`skc-latn-zz`,skd:`skd-latn-us`,ske:`ske-latn-vu`,skf:`skf-latn-br`,skg:`skg-latn-mg`,skh:`skh-latn-id`,ski:`ski-latn-id`,skj:`skj-deva-np`,skm:`skm-latn-pg`,skn:`skn-latn-ph`,sko:`sko-latn-id`,skp:`skp-latn-my`,skq:`skq-latn-bf`,skr:`skr-arab-pk`,sks:`sks-latn-zz`,skt:`skt-latn-cd`,sku:`sku-latn-vu`,skv:`skv-latn-id`,skw:`skw-latn-gy`,skx:`skx-latn-id`,sky:`sky-latn-sb`,skz:`skz-latn-id`,sl:`sl-latn-si`,slc:`slc-latn-co`,sld:`sld-latn-zz`,slg:`slg-latn-id`,slh:`slh-latn-us`,sli:`sli-latn-pl`,slj:`slj-latn-br`,sll:`sll-latn-zz`,slm:`slm-latn-ph`,sln:`sln-latn-us`,slp:`slp-latn-id`,slq:`slq-arab-ir`,slr:`slr-latn-cn`,slu:`slu-latn-id`,slw:`slw-latn-pg`,slx:`slx-latn-cd`,sly:`sly-latn-id`,slz:`slz-latn-id`,sm:`sm-latn-ws`,sma:`sma-latn-se`,smb:`smb-latn-pg`,smc:`smc-latn-pg`,smd:`smd-latn-ao`,smf:`smf-latn-pg`,smg:`smg-latn-pg`,smh:`smh-yiii-cn`,smj:`smj-latn-se`,smk:`smk-latn-ph`,sml:`sml-latn-ph`,smn:`smn-latn-fi`,smp:`smp-samr-il`,smq:`smq-latn-zz`,smr:`smr-latn-id`,sms:`sms-latn-fi`,smt:`smt-latn-in`,smu:`smu-khmr-kh`,smw:`smw-latn-id`,smx:`smx-latn-cd`,smy:`smy-arab-ir`,smz:`smz-latn-pg`,sn:`sn-latn-zw`,snb:`snb-latn-my`,snc:`snc-latn-zz`,sne:`sne-latn-my`,snf:`snf-latn-sn`,sng:`sng-latn-cd`,"sng-brai":`sng-brai-cd`,sni:`sni-latn-pe`,snj:`snj-latn-cf`,snk:`snk-latn-ml`,snl:`snl-latn-ph`,snm:`snm-latn-ug`,snn:`snn-latn-co`,sno:`sno-latn-us`,snp:`snp-latn-zz`,snq:`snq-latn-ga`,snr:`snr-latn-pg`,sns:`sns-latn-vu`,snu:`snu-latn-id`,snv:`snv-latn-my`,snw:`snw-latn-gh`,snx:`snx-latn-zz`,sny:`sny-latn-zz`,snz:`snz-latn-pg`,so:`so-latn-so`,soa:`soa-tavt-th`,"soa-thai":`soa-thai-th`,sob:`sob-latn-id`,soc:`soc-latn-cd`,sod:`sod-latn-cd`,soe:`soe-latn-cd`,sog:`sog-sogd-uz`,soi:`soi-deva-np`,sok:`sok-latn-zz`,sol:`sol-latn-pg`,soo:`soo-latn-cd`,sop:`sop-latn-cd`,soq:`soq-latn-zz`,sor:`sor-latn-td`,sos:`sos-latn-bf`,sou:`sou-thai-th`,sov:`sov-latn-pw`,sow:`sow-latn-pg`,sox:`sox-latn-cm`,soy:`soy-latn-zz`,soz:`soz-latn-tz`,spb:`spb-latn-id`,spc:`spc-latn-ve`,spd:`spd-latn-zz`,spe:`spe-latn-pg`,spg:`spg-latn-my`,spi:`spi-latn-id`,spk:`spk-latn-pg`,spl:`spl-latn-zz`,spm:`spm-latn-pg`,spn:`spn-latn-py`,spo:`spo-latn-us`,spp:`spp-latn-ml`,spq:`spq-latn-pe`,spr:`spr-latn-id`,sps:`sps-latn-zz`,spt:`spt-tibt-in`,spv:`spv-orya-in`,sq:`sq-latn-al`,sqa:`sqa-latn-ng`,sqh:`sqh-latn-ng`,sqm:`sqm-latn-cf`,sqo:`sqo-arab-ir`,sqq:`sqq-laoo-la`,sqt:`sqt-arab-ye`,"sqt-latn":`sqt-latn-ye`,squ:`squ-latn-ca`,sr:`sr-cyrl-rs`,"sr-me":`sr-latn-me`,"sr-ro":`sr-latn-ro`,"sr-ru":`sr-latn-ru`,"sr-tr":`sr-latn-tr`,sra:`sra-latn-pg`,srb:`srb-sora-in`,sre:`sre-latn-id`,srf:`srf-latn-pg`,srg:`srg-latn-ph`,srh:`srh-arab-cn`,sri:`sri-latn-co`,srk:`srk-latn-my`,srl:`srl-latn-id`,srm:`srm-latn-sr`,srn:`srn-latn-sr`,sro:`sro-latn-it`,srq:`srq-latn-bo`,srr:`srr-latn-sn`,srs:`srs-latn-ca`,srt:`srt-latn-id`,sru:`sru-latn-br`,srv:`srv-latn-ph`,srw:`srw-latn-id`,srx:`srx-deva-in`,sry:`sry-latn-pg`,srz:`srz-arab-ir`,ss:`ss-latn-za`,ssb:`ssb-latn-ph`,ssc:`ssc-latn-tz`,ssd:`ssd-latn-zz`,sse:`sse-latn-ph`,"sse-arab":`sse-arab-ph`,ssf:`ssf-latn-tw`,ssg:`ssg-latn-zz`,ssh:`ssh-arab-ae`,ssj:`ssj-latn-pg`,ssl:`ssl-latn-gh`,ssm:`ssm-latn-my`,ssn:`ssn-latn-ke`,sso:`sso-latn-pg`,ssq:`ssq-latn-id`,sss:`sss-laoo-la`,"sss-thai":`sss-thai-th`,sst:`sst-latn-pg`,ssu:`ssu-latn-pg`,ssv:`ssv-latn-vu`,ssx:`ssx-latn-pg`,ssy:`ssy-latn-er`,ssz:`ssz-latn-pg`,st:`st-latn-za`,sta:`sta-latn-zm`,stb:`stb-latn-ph`,ste:`ste-latn-id`,stf:`stf-latn-pg`,stg:`stg-latn-vn`,sth:`sth-latn-ie`,sti:`sti-latn-vn`,"sti-kh":`sti-latn-kh`,stj:`stj-latn-bf`,stk:`stk-latn-zz`,stl:`stl-latn-nl`,stm:`stm-latn-pg`,stn:`stn-latn-sb`,sto:`sto-latn-ca`,stp:`stp-latn-mx`,stq:`stq-latn-de`,str:`str-latn-ca`,sts:`sts-arab-af`,stt:`stt-latn-vn`,stv:`stv-ethi-et`,"stv-arab":`stv-arab-et`,stw:`stw-latn-fm`,sty:`sty-cyrl-ru`,su:`su-latn-id`,sua:`sua-latn-zz`,sub:`sub-latn-cd`,suc:`suc-latn-ph`,sue:`sue-latn-zz`,sug:`sug-latn-pg`,sui:`sui-latn-pg`,suj:`suj-latn-tz`,suk:`suk-latn-tz`,suo:`suo-latn-pg`,suq:`suq-latn-et`,"suq-ethi":`suq-ethi-et`,sur:`sur-latn-zz`,sus:`sus-latn-gn`,sut:`sut-latn-ni`,suv:`suv-latn-in`,"suv-beng":`suv-beng-in`,"suv-deva":`suv-deva-in`,suw:`suw-latn-tz`,suy:`suy-latn-br`,suz:`suz-deva-np`,sv:`sv-latn-se`,sva:`sva-geor-ge`,"sva-cyrl":`sva-cyrl-ge`,"sva-latn":`sva-latn-ge`,svb:`svb-latn-pg`,svc:`svc-latn-vc`,sve:`sve-latn-id`,svm:`svm-latn-it`,svs:`svs-latn-sb`,sw:`sw-latn-tz`,swb:`swb-arab-yt`,swc:`swc-latn-cd`,swf:`swf-latn-cd`,swg:`swg-latn-de`,swi:`swi-hani-cn`,swj:`swj-latn-ga`,swk:`swk-latn-mw`,swm:`swm-latn-pg`,swo:`swo-latn-br`,swp:`swp-latn-zz`,swq:`swq-latn-cm`,swr:`swr-latn-id`,sws:`sws-latn-id`,swt:`swt-latn-id`,swu:`swu-latn-id`,swv:`swv-deva-in`,sww:`sww-latn-vu`,swx:`swx-latn-br`,swy:`swy-latn-td`,sxb:`sxb-latn-ke`,sxe:`sxe-latn-ga`,sxn:`sxn-latn-id`,sxr:`sxr-latn-tw`,sxs:`sxs-latn-ng`,sxu:`sxu-latn-de`,"sxu-runr":`sxu-runr-de`,sxw:`sxw-latn-zz`,sya:`sya-latn-id`,syb:`syb-latn-ph`,syc:`syc-syrc-tr`,syi:`syi-latn-ga`,syk:`syk-latn-ng`,syl:`syl-beng-bd`,sym:`sym-latn-bf`,syn:`syn-syrc-ir`,syo:`syo-latn-kh`,syr:`syr-syrc-iq`,sys:`sys-latn-td`,syw:`syw-deva-np`,syx:`syx-latn-ga`,sza:`sza-latn-my`,szb:`szb-latn-id`,szc:`szc-latn-my`,szd:`szd-latn-my`,szg:`szg-latn-cd`,szl:`szl-latn-pl`,szn:`szn-latn-id`,szp:`szp-latn-id`,szv:`szv-latn-cm`,szw:`szw-latn-id`,szy:`szy-latn-tw`,ta:`ta-taml-in`,taa:`taa-latn-us`,tab:`tab-cyrl-ru`,tac:`tac-latn-mx`,tad:`tad-latn-id`,tae:`tae-latn-br`,taf:`taf-latn-br`,tag:`tag-latn-sd`,taj:`taj-deva-np`,tak:`tak-latn-ng`,tal:`tal-latn-zz`,tan:`tan-latn-zz`,tao:`tao-latn-tw`,tap:`tap-latn-cd`,taq:`taq-latn-zz`,tar:`tar-latn-mx`,tas:`tas-latn-vn`,tau:`tau-latn-us`,tav:`tav-latn-co`,taw:`taw-latn-pg`,tax:`tax-latn-td`,tay:`tay-latn-tw`,"tay-hans":`tay-hans-tw`,"tay-hant":`tay-hant-tw`,taz:`taz-latn-sd`,tba:`tba-latn-br`,tbc:`tbc-latn-zz`,tbd:`tbd-latn-zz`,tbe:`tbe-latn-sb`,tbf:`tbf-latn-zz`,tbg:`tbg-latn-zz`,tbh:`tbh-latn-au`,tbi:`tbi-latn-sd`,tbj:`tbj-latn-pg`,tbk:`tbk-tagb-ph`,"tbk-hano":`tbk-hano-ph`,"tbk-latn":`tbk-latn-ph`,tbl:`tbl-latn-ph`,tbm:`tbm-latn-cd`,tbn:`tbn-latn-co`,tbo:`tbo-latn-zz`,tbp:`tbp-latn-id`,tbs:`tbs-latn-pg`,tbt:`tbt-latn-cd`,tbu:`tbu-latn-mx`,tbv:`tbv-latn-pg`,tbw:`tbw-latn-ph`,tbx:`tbx-latn-pg`,tby:`tby-latn-id`,tbz:`tbz-latn-zz`,tca:`tca-latn-br`,tcb:`tcb-latn-us`,tcc:`tcc-latn-tz`,tcd:`tcd-latn-gh`,tce:`tce-latn-ca`,tcf:`tcf-latn-mx`,tcg:`tcg-latn-id`,tch:`tch-latn-tc`,tci:`tci-latn-zz`,tck:`tck-latn-ga`,tcm:`tcm-latn-id`,tcn:`tcn-tibt-np`,tco:`tco-mymr-mm`,tcp:`tcp-latn-mm`,tcq:`tcq-latn-id`,tcs:`tcs-latn-au`,tcu:`tcu-latn-mx`,tcw:`tcw-latn-mx`,tcx:`tcx-taml-in`,tcy:`tcy-knda-in`,tcz:`tcz-latn-in`,tda:`tda-tfng-ne`,"tda-arab":`tda-arab-ne`,"tda-latn":`tda-latn-ne`,tdb:`tdb-deva-in`,"tdb-beng":`tdb-beng-in`,"tdb-kthi":`tdb-kthi-in`,tdc:`tdc-latn-co`,tdd:`tdd-tale-cn`,tde:`tde-latn-ml`,tdg:`tdg-deva-np`,tdh:`tdh-deva-np`,tdi:`tdi-latn-id`,tdj:`tdj-latn-id`,tdk:`tdk-latn-ng`,tdl:`tdl-latn-ng`,tdm:`tdm-latn-gy`,tdn:`tdn-latn-id`,tdo:`tdo-latn-ng`,tdq:`tdq-latn-ng`,tdr:`tdr-latn-vn`,tds:`tds-latn-id`,tdt:`tdt-latn-tl`,tdu:`tdu-latn-my`,tdv:`tdv-latn-ng`,tdx:`tdx-latn-mg`,tdy:`tdy-latn-ph`,te:`te-telu-in`,tea:`tea-latn-my`,teb:`teb-latn-ec`,tec:`tec-latn-ke`,ted:`ted-latn-zz`,tee:`tee-latn-mx`,teg:`teg-latn-ga`,teh:`teh-latn-ar`,tei:`tei-latn-pg`,tek:`tek-latn-cd`,tem:`tem-latn-sl`,ten:`ten-latn-co`,teo:`teo-latn-ug`,tep:`tep-latn-mx`,teq:`teq-latn-sd`,ter:`ter-latn-br`,tes:`tes-java-id`,tet:`tet-latn-tl`,teu:`teu-latn-ug`,tev:`tev-latn-id`,tew:`tew-latn-us`,tex:`tex-latn-ss`,tey:`tey-latn-sd`,tfi:`tfi-latn-zz`,tfn:`tfn-latn-us`,tfo:`tfo-latn-id`,tfr:`tfr-latn-pa`,tft:`tft-latn-id`,tg:`tg-cyrl-tj`,"tg-arab":`tg-arab-pk`,"tg-pk":`tg-arab-pk`,tga:`tga-latn-ke`,tgb:`tgb-latn-my`,tgc:`tgc-latn-zz`,tgd:`tgd-latn-ng`,tge:`tge-deva-np`,tgf:`tgf-tibt-bt`,tgh:`tgh-latn-tt`,tgi:`tgi-latn-pg`,tgj:`tgj-latn-in`,tgn:`tgn-latn-ph`,tgo:`tgo-latn-zz`,tgp:`tgp-latn-vu`,tgq:`tgq-latn-my`,tgs:`tgs-latn-vu`,tgt:`tgt-latn-ph`,"tgt-hano":`tgt-hano-ph`,"tgt-tagb":`tgt-tagb-ph`,tgu:`tgu-latn-zz`,tgv:`tgv-latn-br`,tgw:`tgw-latn-ci`,tgx:`tgx-latn-ca`,tgy:`tgy-latn-ss`,tgz:`tgz-latn-au`,th:`th-thai-th`,thd:`thd-latn-au`,the:`the-deva-np`,thf:`thf-deva-np`,thh:`thh-latn-mx`,thi:`thi-tale-la`,thk:`thk-latn-ke`,thl:`thl-deva-np`,thm:`thm-thai-th`,thp:`thp-latn-ca`,"thp-dupl":`thp-dupl-ca`,thq:`thq-deva-np`,thr:`thr-deva-np`,ths:`ths-deva-np`,tht:`tht-latn-ca`,thu:`thu-latn-ss`,thv:`thv-latn-dz`,"thv-arab":`thv-arab-dz`,"thv-tfng":`thv-tfng-dz`,thy:`thy-latn-ng`,thz:`thz-latn-ne`,"thz-tfng":`thz-tfng-ne`,ti:`ti-ethi-et`,tic:`tic-latn-sd`,tif:`tif-latn-zz`,tig:`tig-ethi-er`,tih:`tih-latn-my`,tii:`tii-latn-cd`,tij:`tij-deva-np`,tik:`tik-latn-zz`,til:`til-latn-us`,tim:`tim-latn-zz`,tin:`tin-cyrl-ru`,tio:`tio-latn-zz`,tip:`tip-latn-id`,tiq:`tiq-latn-bf`,tis:`tis-latn-ph`,tit:`tit-latn-co`,tiu:`tiu-latn-ph`,tiv:`tiv-latn-ng`,tiw:`tiw-latn-au`,tix:`tix-latn-us`,tiy:`tiy-latn-ph`,tja:`tja-latn-lr`,tjg:`tjg-latn-id`,tji:`tji-latn-cn`,tjj:`tjj-latn-au`,tjl:`tjl-mymr-mm`,tjn:`tjn-latn-ci`,tjo:`tjo-arab-dz`,tjp:`tjp-latn-au`,tjs:`tjs-latn-cn`,tju:`tju-latn-au`,tjw:`tjw-latn-au`,tk:`tk-latn-tm`,tka:`tka-latn-br`,tkb:`tkb-deva-in`,tkd:`tkd-latn-tl`,tke:`tke-latn-mz`,tkf:`tkf-latn-br`,tkg:`tkg-latn-mg`,tkl:`tkl-latn-tk`,tkp:`tkp-latn-sb`,tkq:`tkq-latn-ng`,tkr:`tkr-latn-az`,tks:`tks-arab-ir`,tkt:`tkt-deva-np`,tku:`tku-latn-mx`,tkv:`tkv-latn-pg`,tkw:`tkw-latn-sb`,tkx:`tkx-latn-id`,tkz:`tkz-latn-vn`,tl:`tl-latn-ph`,tla:`tla-latn-mx`,tlb:`tlb-latn-id`,tlc:`tlc-latn-mx`,tld:`tld-latn-id`,tlf:`tlf-latn-zz`,tlg:`tlg-latn-id`,tli:`tli-latn-us`,"tli-cyrl":`tli-cyrl-us`,tlj:`tlj-latn-ug`,tlk:`tlk-latn-id`,tll:`tll-latn-cd`,tlm:`tlm-latn-vu`,tln:`tln-latn-id`,tlp:`tlp-latn-mx`,tlq:`tlq-latn-mm`,tlr:`tlr-latn-sb`,tls:`tls-latn-vu`,tlt:`tlt-latn-id`,tlu:`tlu-latn-id`,tlv:`tlv-latn-id`,tlx:`tlx-latn-zz`,tly:`tly-latn-az`,tma:`tma-latn-td`,tmb:`tmb-latn-vu`,tmc:`tmc-latn-td`,tmd:`tmd-latn-pg`,tme:`tme-latn-br`,tmf:`tmf-latn-py`,tmg:`tmg-latn-id`,tmh:`tmh-latn-ne`,tmi:`tmi-latn-vu`,tmj:`tmj-latn-id`,tmk:`tmk-deva-np`,tml:`tml-latn-id`,tmm:`tmm-latn-vn`,tmn:`tmn-latn-id`,tmo:`tmo-latn-my`,tmq:`tmq-latn-pg`,tmr:`tmr-syrc-il`,tmt:`tmt-latn-vu`,tmu:`tmu-latn-id`,tmv:`tmv-latn-cd`,tmw:`tmw-latn-my`,tmy:`tmy-latn-zz`,tmz:`tmz-latn-ve`,tn:`tn-latn-za`,tna:`tna-latn-bo`,tnb:`tnb-latn-co`,tnc:`tnc-latn-co`,tnd:`tnd-latn-co`,tng:`tng-latn-td`,tnh:`tnh-latn-zz`,tni:`tni-latn-id`,tnk:`tnk-latn-vu`,tnl:`tnl-latn-vu`,tnm:`tnm-latn-id`,tnn:`tnn-latn-vu`,tno:`tno-latn-bo`,tnp:`tnp-latn-vu`,tnq:`tnq-latn-pr`,tnr:`tnr-latn-sn`,tns:`tns-latn-pg`,tnt:`tnt-latn-id`,tnv:`tnv-cakm-bd`,tnw:`tnw-latn-id`,tnx:`tnx-latn-sb`,tny:`tny-latn-tz`,to:`to-latn-to`,tob:`tob-latn-ar`,toc:`toc-latn-mx`,tod:`tod-latn-gn`,tof:`tof-latn-zz`,tog:`tog-latn-mw`,toh:`toh-latn-mz`,toi:`toi-latn-zm`,toj:`toj-latn-mx`,tok:`tok-latn-001`,tol:`tol-latn-us`,tom:`tom-latn-id`,too:`too-latn-mx`,top:`top-latn-mx`,toq:`toq-latn-zz`,tor:`tor-latn-cd`,tos:`tos-latn-mx`,tou:`tou-latn-vn`,tov:`tov-arab-ir`,tow:`tow-latn-us`,tox:`tox-latn-pw`,toy:`toy-latn-id`,toz:`toz-latn-cm`,tpa:`tpa-latn-pg`,tpc:`tpc-latn-mx`,tpe:`tpe-latn-bd`,"tpe-beng":`tpe-beng-bd`,tpf:`tpf-latn-id`,tpg:`tpg-latn-id`,tpi:`tpi-latn-pg`,tpj:`tpj-latn-py`,tpk:`tpk-latn-br`,tpl:`tpl-latn-mx`,tpm:`tpm-latn-zz`,tpn:`tpn-latn-br`,tpp:`tpp-latn-mx`,tpr:`tpr-latn-br`,tpt:`tpt-latn-mx`,tpu:`tpu-khmr-kh`,tpv:`tpv-latn-mp`,tpx:`tpx-latn-mx`,tpy:`tpy-latn-br`,tpz:`tpz-latn-zz`,tqb:`tqb-latn-br`,tql:`tql-latn-vu`,tqm:`tqm-latn-pg`,tqn:`tqn-latn-us`,tqo:`tqo-latn-zz`,tqp:`tqp-latn-pg`,tqt:`tqt-latn-mx`,tqu:`tqu-latn-sb`,tqw:`tqw-latn-us`,tr:`tr-latn-tr`,tra:`tra-arab-af`,trb:`trb-latn-pg`,trc:`trc-latn-mx`,tre:`tre-latn-id`,trf:`trf-latn-tt`,trg:`trg-hebr-il`,trh:`trh-latn-pg`,tri:`tri-latn-sr`,trj:`trj-latn-td`,trl:`trl-latn-gb`,trm:`trm-arab-af`,trn:`trn-latn-bo`,tro:`tro-latn-in`,trp:`trp-latn-in`,"trp-beng":`trp-beng-in`,trq:`trq-latn-mx`,trr:`trr-latn-pe`,trs:`trs-latn-mx`,trt:`trt-latn-id`,tru:`tru-latn-tr`,trv:`trv-latn-tw`,trw:`trw-arab-pk`,trx:`trx-latn-my`,try:`try-latn-in`,trz:`trz-latn-br`,ts:`ts-latn-za`,tsa:`tsa-latn-cg`,tsb:`tsb-latn-et`,tsc:`tsc-latn-mz`,tsd:`tsd-grek-gr`,tsf:`tsf-deva-np`,tsg:`tsg-latn-ph`,tsh:`tsh-latn-cm`,tsi:`tsi-latn-ca`,tsj:`tsj-tibt-bt`,tsl:`tsl-latn-vn`,tsp:`tsp-latn-bf`,tsr:`tsr-latn-vu`,tst:`tst-latn-ml`,tsu:`tsu-latn-tw`,tsv:`tsv-latn-ga`,tsw:`tsw-latn-zz`,tsx:`tsx-latn-pg`,tsz:`tsz-latn-mx`,tt:`tt-cyrl-ru`,ttb:`ttb-latn-ng`,ttc:`ttc-latn-gt`,ttd:`ttd-latn-zz`,tte:`tte-latn-zz`,ttf:`ttf-latn-cm`,tth:`tth-laoo-la`,tti:`tti-latn-id`,ttj:`ttj-latn-ug`,ttk:`ttk-latn-co`,ttl:`ttl-latn-zm`,ttm:`ttm-latn-ca`,ttn:`ttn-latn-id`,tto:`tto-laoo-la`,ttp:`ttp-latn-id`,ttr:`ttr-latn-zz`,tts:`tts-thai-th`,ttt:`ttt-latn-az`,ttu:`ttu-latn-pg`,ttv:`ttv-latn-pg`,ttw:`ttw-latn-my`,tty:`tty-latn-id`,tua:`tua-latn-pg`,tub:`tub-latn-us`,tuc:`tuc-latn-pg`,tud:`tud-latn-br`,tue:`tue-latn-co`,tuf:`tuf-latn-co`,tug:`tug-latn-td`,tuh:`tuh-latn-zz`,tui:`tui-latn-cm`,tuj:`tuj-latn-id`,tul:`tul-latn-zz`,tum:`tum-latn-mw`,tun:`tun-latn-us`,tuo:`tuo-latn-br`,tuq:`tuq-latn-zz`,tus:`tus-latn-ca`,tuu:`tuu-latn-us`,tuv:`tuv-latn-ke`,tux:`tux-latn-br`,tuy:`tuy-latn-ke`,tuz:`tuz-latn-bf`,tva:`tva-latn-sb`,tvd:`tvd-latn-zz`,tve:`tve-latn-id`,tvk:`tvk-latn-vu`,tvl:`tvl-latn-tv`,tvm:`tvm-latn-id`,tvn:`tvn-mymr-mm`,tvo:`tvo-latn-id`,tvs:`tvs-latn-ke`,tvt:`tvt-latn-in`,tvu:`tvu-latn-zz`,tvw:`tvw-latn-id`,tvx:`tvx-latn-tw`,twa:`twa-latn-us`,twb:`twb-latn-ph`,twd:`twd-latn-nl`,twe:`twe-latn-id`,twf:`twf-latn-us`,twg:`twg-latn-id`,twh:`twh-latn-zz`,twl:`twl-latn-mz`,twm:`twm-deva-in`,twn:`twn-latn-cm`,two:`two-latn-bw`,twp:`twp-latn-pg`,twq:`twq-latn-ne`,twr:`twr-latn-mx`,twt:`twt-latn-br`,twu:`twu-latn-id`,tww:`tww-latn-pg`,twx:`twx-latn-mz`,twy:`twy-latn-id`,txa:`txa-latn-my`,txe:`txe-latn-id`,txg:`txg-tang-cn`,txi:`txi-latn-br`,txj:`txj-latn-ng`,txm:`txm-latn-id`,txn:`txn-latn-id`,txo:`txo-toto-in`,txq:`txq-latn-id`,txs:`txs-latn-id`,txt:`txt-latn-id`,txu:`txu-latn-br`,txx:`txx-latn-my`,txy:`txy-latn-mg`,ty:`ty-latn-pf`,tya:`tya-latn-zz`,tye:`tye-latn-ng`,tyh:`tyh-latn-vn`,tyi:`tyi-latn-cg`,tyj:`tyj-latn-vn`,tyl:`tyl-latn-vn`,tyn:`tyn-latn-id`,typ:`typ-latn-au`,tyr:`tyr-tavt-vn`,tys:`tys-latn-vn`,tyt:`tyt-latn-vn`,"tyt-tavt":`tyt-tavt-vn`,tyu:`tyu-latn-bw`,tyv:`tyv-cyrl-ru`,tyx:`tyx-latn-cg`,tyy:`tyy-latn-ng`,tyz:`tyz-latn-vn`,tzh:`tzh-latn-mx`,tzj:`tzj-latn-gt`,tzl:`tzl-latn-001`,tzm:`tzm-latn-ma`,tzn:`tzn-latn-id`,tzo:`tzo-latn-mx`,tzx:`tzx-latn-pg`,uam:`uam-latn-br`,uar:`uar-latn-pg`,uba:`uba-latn-ng`,ubi:`ubi-latn-td`,ubl:`ubl-latn-ph`,ubr:`ubr-latn-pg`,ubu:`ubu-latn-zz`,uda:`uda-latn-ng`,ude:`ude-cyrl-ru`,udg:`udg-mlym-in`,udi:`udi-aghb-ru`,udj:`udj-latn-id`,udl:`udl-latn-cm`,udm:`udm-cyrl-ru`,udu:`udu-latn-sd`,ues:`ues-latn-id`,ufi:`ufi-latn-pg`,ug:`ug-arab-cn`,"ug-cyrl":`ug-cyrl-kz`,"ug-kz":`ug-cyrl-kz`,"ug-mn":`ug-cyrl-mn`,uga:`uga-ugar-sy`,ugb:`ugb-latn-au`,uge:`uge-latn-sb`,ugh:`ugh-cyrl-ru`,ugo:`ugo-thai-th`,uha:`uha-latn-ng`,uhn:`uhn-latn-id`,uis:`uis-latn-pg`,uiv:`uiv-latn-cm`,uji:`uji-latn-ng`,uk:`uk-cyrl-ua`,uka:`uka-latn-id`,ukg:`ukg-latn-pg`,ukh:`ukh-latn-cf`,uki:`uki-orya-in`,ukk:`ukk-latn-mm`,ukp:`ukp-latn-ng`,ukq:`ukq-latn-ng`,uku:`uku-latn-ng`,ukv:`ukv-latn-ss`,ukw:`ukw-latn-ng`,uky:`uky-latn-au`,ula:`ula-latn-ng`,ulb:`ulb-latn-ng`,ulc:`ulc-cyrl-ru`,ule:`ule-latn-ar`,ulf:`ulf-latn-id`,uli:`uli-latn-fm`,ulk:`ulk-latn-au`,ulm:`ulm-latn-id`,uln:`uln-latn-pg`,ulu:`ulu-latn-id`,ulw:`ulw-latn-ni`,uma:`uma-latn-us`,umb:`umb-latn-ao`,umd:`umd-latn-au`,umg:`umg-latn-au`,umi:`umi-latn-my`,umm:`umm-latn-ng`,umn:`umn-latn-mm`,umo:`umo-latn-br`,ump:`ump-latn-au`,umr:`umr-latn-au`,ums:`ums-latn-id`,una:`una-latn-pg`,und:`en-latn-us`,"und-002":`en-latn-ng`,"und-003":`en-latn-us`,"und-005":`pt-latn-br`,"und-009":`en-latn-au`,"und-011":`en-latn-ng`,"und-013":`es-latn-mx`,"und-014":`sw-latn-tz`,"und-015":`ar-arab-eg`,"und-017":`sw-latn-cd`,"und-018":`en-latn-za`,"und-019":`en-latn-us`,"und-021":`en-latn-us`,"und-029":`es-latn-cu`,"und-030":`zh-hans-cn`,"und-034":`hi-deva-in`,"und-035":`id-latn-id`,"und-039":`it-latn-it`,"und-053":`en-latn-au`,"und-054":`en-latn-pg`,"und-057":`en-latn-gu`,"und-061":`sm-latn-ws`,"und-142":`zh-hans-cn`,"und-143":`uz-latn-uz`,"und-145":`ar-arab-sa`,"und-150":`ru-cyrl-ru`,"und-151":`ru-cyrl-ru`,"und-154":`en-latn-gb`,"und-155":`de-latn-de`,"und-202":`en-latn-ng`,"und-419":`es-latn-419`,"und-ad":`ca-latn-ad`,"und-adlm":`ff-adlm-gn`,"und-ae":`ar-arab-ae`,"und-af":`fa-arab-af`,"und-aghb":`udi-aghb-ru`,"und-ahom":`aho-ahom-in`,"und-al":`sq-latn-al`,"und-am":`hy-armn-am`,"und-ao":`pt-latn-ao`,"und-aq":`und-latn-aq`,"und-ar":`es-latn-ar`,"und-arab":`ar-arab-eg`,"und-arab-cc":`ms-arab-cc`,"und-arab-cn":`ug-arab-cn`,"und-arab-gb":`ur-arab-gb`,"und-arab-id":`ms-arab-id`,"und-arab-in":`ur-arab-in`,"und-arab-kh":`cja-arab-kh`,"und-arab-mm":`rhg-arab-mm`,"und-arab-mn":`kk-arab-mn`,"und-arab-mu":`ur-arab-mu`,"und-arab-ng":`ha-arab-ng`,"und-arab-pk":`ur-arab-pk`,"und-arab-tg":`apd-arab-tg`,"und-arab-th":`mfa-arab-th`,"und-arab-tj":`fa-arab-tj`,"und-arab-tr":`apc-arab-tr`,"und-arab-yt":`swb-arab-yt`,"und-armi":`arc-armi-ir`,"und-armn":`hy-armn-am`,"und-as":`sm-latn-as`,"und-at":`de-latn-at`,"und-avst":`ae-avst-ir`,"und-aw":`nl-latn-aw`,"und-ax":`sv-latn-ax`,"und-az":`az-latn-az`,"und-ba":`bs-latn-ba`,"und-bali":`ban-bali-id`,"und-bamu":`bax-bamu-cm`,"und-bass":`bsq-bass-lr`,"und-batk":`bbc-batk-id`,"und-bd":`bn-beng-bd`,"und-be":`nl-latn-be`,"und-beng":`bn-beng-bd`,"und-bf":`fr-latn-bf`,"und-bg":`bg-cyrl-bg`,"und-bh":`ar-arab-bh`,"und-bhks":`sa-bhks-in`,"und-bi":`rn-latn-bi`,"und-bj":`fr-latn-bj`,"und-bl":`fr-latn-bl`,"und-bn":`ms-latn-bn`,"und-bo":`es-latn-bo`,"und-bopo":`zh-bopo-tw`,"und-bq":`pap-latn-bq`,"und-br":`pt-latn-br`,"und-brah":`pka-brah-in`,"und-brai":`fr-brai-fr`,"und-bt":`dz-tibt-bt`,"und-bugi":`bug-bugi-id`,"und-buhd":`bku-buhd-ph`,"und-bv":`und-latn-bv`,"und-by":`be-cyrl-by`,"und-cakm":`ccp-cakm-bd`,"und-cans":`iu-cans-ca`,"und-cari":`xcr-cari-tr`,"und-cd":`sw-latn-cd`,"und-cf":`fr-latn-cf`,"und-cg":`fr-latn-cg`,"und-ch":`de-latn-ch`,"und-cham":`cjm-cham-vn`,"und-cher":`chr-cher-us`,"und-chrs":`xco-chrs-uz`,"und-ci":`fr-latn-ci`,"und-cl":`es-latn-cl`,"und-cm":`fr-latn-cm`,"und-cn":`zh-hans-cn`,"und-co":`es-latn-co`,"und-copt":`cop-copt-eg`,"und-cp":`und-latn-cp`,"und-cpmn":`und-cpmn-cy`,"und-cpmn-cy":`und-cpmn-cy`,"und-cprt":`grc-cprt-cy`,"und-cr":`es-latn-cr`,"und-cu":`es-latn-cu`,"und-cv":`pt-latn-cv`,"und-cw":`pap-latn-cw`,"und-cy":`el-grek-cy`,"und-cyrl":`ru-cyrl-ru`,"und-cyrl-al":`mk-cyrl-al`,"und-cyrl-ba":`sr-cyrl-ba`,"und-cyrl-ge":`ab-cyrl-ge`,"und-cyrl-gr":`mk-cyrl-gr`,"und-cyrl-md":`uk-cyrl-md`,"und-cyrl-ro":`bg-cyrl-ro`,"und-cyrl-sk":`uk-cyrl-sk`,"und-cyrl-tr":`kbd-cyrl-tr`,"und-cyrl-xk":`sr-cyrl-xk`,"und-cz":`cs-latn-cz`,"und-de":`de-latn-de`,"und-deva":`hi-deva-in`,"und-deva-bt":`ne-deva-bt`,"und-deva-fj":`hif-deva-fj`,"und-deva-mu":`bho-deva-mu`,"und-deva-pk":`btv-deva-pk`,"und-diak":`dv-diak-mv`,"und-dj":`aa-latn-dj`,"und-dk":`da-latn-dk`,"und-do":`es-latn-do`,"und-dogr":`doi-dogr-in`,"und-dupl":`fr-dupl-fr`,"und-dz":`ar-arab-dz`,"und-ea":`es-latn-ea`,"und-ec":`es-latn-ec`,"und-ee":`et-latn-ee`,"und-eg":`ar-arab-eg`,"und-egyp":`egy-egyp-eg`,"und-eh":`ar-arab-eh`,"und-elba":`sq-elba-al`,"und-elym":`arc-elym-ir`,"und-er":`ti-ethi-er`,"und-es":`es-latn-es`,"und-et":`am-ethi-et`,"und-ethi":`am-ethi-et`,"und-eu":`en-latn-ie`,"und-ez":`de-latn-ez`,"und-fi":`fi-latn-fi`,"und-fo":`fo-latn-fo`,"und-fr":`fr-latn-fr`,"und-ga":`fr-latn-ga`,"und-ge":`ka-geor-ge`,"und-geor":`ka-geor-ge`,"und-gf":`fr-latn-gf`,"und-gh":`ak-latn-gh`,"und-gl":`kl-latn-gl`,"und-glag":`cu-glag-bg`,"und-gn":`fr-latn-gn`,"und-gong":`wsg-gong-in`,"und-gonm":`esg-gonm-in`,"und-goth":`got-goth-ua`,"und-gp":`fr-latn-gp`,"und-gq":`es-latn-gq`,"und-gr":`el-grek-gr`,"und-gran":`sa-gran-in`,"und-grek":`el-grek-gr`,"und-grek-tr":`bgx-grek-tr`,"und-gs":`und-latn-gs`,"und-gt":`es-latn-gt`,"und-gujr":`gu-gujr-in`,"und-guru":`pa-guru-in`,"und-gw":`pt-latn-gw`,"und-hanb":`zh-hanb-tw`,"und-hang":`ko-hang-kr`,"und-hani":`zh-hani-cn`,"und-hano":`hnn-hano-ph`,"und-hans":`zh-hans-cn`,"und-hant":`zh-hant-tw`,"und-hant-ca":`yue-hant-ca`,"und-hebr":`he-hebr-il`,"und-hebr-se":`yi-hebr-se`,"und-hebr-ua":`yi-hebr-ua`,"und-hebr-us":`yi-hebr-us`,"und-hira":`ja-hira-jp`,"und-hk":`zh-hant-hk`,"und-hluw":`hlu-hluw-tr`,"und-hm":`und-latn-hm`,"und-hmng":`hnj-hmng-la`,"und-hmnp":`hnj-hmnp-us`,"und-hn":`es-latn-hn`,"und-hr":`hr-latn-hr`,"und-ht":`ht-latn-ht`,"und-hu":`hu-latn-hu`,"und-hung":`hu-hung-hu`,"und-ic":`es-latn-ic`,"und-id":`id-latn-id`,"und-il":`he-hebr-il`,"und-in":`hi-deva-in`,"und-iq":`ar-arab-iq`,"und-ir":`fa-arab-ir`,"und-is":`is-latn-is`,"und-it":`it-latn-it`,"und-ital":`ett-ital-it`,"und-jamo":`ko-jamo-kr`,"und-java":`jv-java-id`,"und-jo":`ar-arab-jo`,"und-jp":`ja-jpan-jp`,"und-jpan":`ja-jpan-jp`,"und-kali":`eky-kali-mm`,"und-kana":`ja-kana-jp`,"und-kawi":`kaw-kawi-id`,"und-ke":`sw-latn-ke`,"und-kg":`ky-cyrl-kg`,"und-kh":`km-khmr-kh`,"und-khar":`pra-khar-pk`,"und-khmr":`km-khmr-kh`,"und-khoj":`sd-khoj-in`,"und-kits":`zkt-kits-cn`,"und-km":`ar-arab-km`,"und-knda":`kn-knda-in`,"und-kore":`ko-kore-kr`,"und-kp":`ko-kore-kp`,"und-kr":`ko-kore-kr`,"und-kthi":`bho-kthi-in`,"und-kw":`ar-arab-kw`,"und-kz":`ru-cyrl-kz`,"und-la":`lo-laoo-la`,"und-lana":`nod-lana-th`,"und-laoo":`lo-laoo-la`,"und-laoo-au":`hnj-laoo-au`,"und-laoo-cn":`hnj-laoo-cn`,"und-laoo-fr":`hnj-laoo-fr`,"und-laoo-gf":`hnj-laoo-gf`,"und-laoo-mm":`hnj-laoo-mm`,"und-laoo-sr":`hnj-laoo-sr`,"und-laoo-th":`hnj-laoo-th`,"und-laoo-us":`hnj-laoo-us`,"und-laoo-vn":`hnj-laoo-vn`,"und-latn-af":`tk-latn-af`,"und-latn-am":`ku-latn-am`,"und-latn-cn":`za-latn-cn`,"und-latn-cy":`tr-latn-cy`,"und-latn-dz":`fr-latn-dz`,"und-latn-et":`en-latn-et`,"und-latn-ge":`ku-latn-ge`,"und-latn-ir":`tk-latn-ir`,"und-latn-km":`fr-latn-km`,"und-latn-ma":`fr-latn-ma`,"und-latn-mk":`sq-latn-mk`,"und-latn-mm":`kac-latn-mm`,"und-latn-mo":`pt-latn-mo`,"und-latn-mr":`fr-latn-mr`,"und-latn-ru":`krl-latn-ru`,"und-latn-sy":`fr-latn-sy`,"und-latn-tn":`fr-latn-tn`,"und-latn-tw":`trv-latn-tw`,"und-latn-ua":`pl-latn-ua`,"und-lb":`ar-arab-lb`,"und-lepc":`lep-lepc-in`,"und-li":`de-latn-li`,"und-limb":`lif-limb-in`,"und-lina":`lab-lina-gr`,"und-linb":`grc-linb-gr`,"und-lisu":`lis-lisu-cn`,"und-lk":`si-sinh-lk`,"und-ls":`st-latn-ls`,"und-lt":`lt-latn-lt`,"und-lu":`fr-latn-lu`,"und-lv":`lv-latn-lv`,"und-ly":`ar-arab-ly`,"und-lyci":`xlc-lyci-tr`,"und-lydi":`xld-lydi-tr`,"und-ma":`ar-arab-ma`,"und-mahj":`hi-mahj-in`,"und-maka":`mak-maka-id`,"und-mand":`myz-mand-ir`,"und-mani":`xmn-mani-cn`,"und-marc":`bo-marc-cn`,"und-mc":`fr-latn-mc`,"und-md":`ro-latn-md`,"und-me":`sr-latn-me`,"und-medf":`dmf-medf-ng`,"und-mend":`men-mend-sl`,"und-merc":`xmr-merc-sd`,"und-mero":`xmr-mero-sd`,"und-mf":`fr-latn-mf`,"und-mg":`mg-latn-mg`,"und-mk":`mk-cyrl-mk`,"und-ml":`bm-latn-ml`,"und-mlym":`ml-mlym-in`,"und-mm":`my-mymr-mm`,"und-mn":`mn-cyrl-mn`,"und-mo":`zh-hant-mo`,"und-modi":`mr-modi-in`,"und-mong":`mn-mong-cn`,"und-mq":`fr-latn-mq`,"und-mr":`ar-arab-mr`,"und-mroo":`mro-mroo-bd`,"und-mt":`mt-latn-mt`,"und-mtei":`mni-mtei-in`,"und-mu":`mfe-latn-mu`,"und-mult":`skr-mult-pk`,"und-mv":`dv-thaa-mv`,"und-mx":`es-latn-mx`,"und-my":`ms-latn-my`,"und-mymr":`my-mymr-mm`,"und-mymr-in":`kht-mymr-in`,"und-mymr-th":`mnw-mymr-th`,"und-mz":`pt-latn-mz`,"und-na":`af-latn-na`,"und-nagm":`unr-nagm-in`,"und-nand":`sa-nand-in`,"und-narb":`xna-narb-sa`,"und-nbat":`arc-nbat-jo`,"und-nc":`fr-latn-nc`,"und-ne":`ha-latn-ne`,"und-newa":`new-newa-np`,"und-ni":`es-latn-ni`,"und-nkoo":`man-nkoo-gn`,"und-nl":`nl-latn-nl`,"und-no":`nb-latn-no`,"und-np":`ne-deva-np`,"und-nshu":`zhx-nshu-cn`,"und-ogam":`sga-ogam-ie`,"und-olck":`sat-olck-in`,"und-om":`ar-arab-om`,"und-orkh":`otk-orkh-mn`,"und-orya":`or-orya-in`,"und-osge":`osa-osge-us`,"und-osma":`so-osma-so`,"und-ougr":`oui-ougr-143`,"und-pa":`es-latn-pa`,"und-palm":`arc-palm-sy`,"und-pauc":`ctd-pauc-mm`,"und-pe":`es-latn-pe`,"und-perm":`kv-perm-ru`,"und-pf":`fr-latn-pf`,"und-pg":`tpi-latn-pg`,"und-ph":`fil-latn-ph`,"und-phag":`lzh-phag-cn`,"und-phli":`pal-phli-ir`,"und-phlp":`pal-phlp-cn`,"und-phnx":`phn-phnx-lb`,"und-pk":`ur-arab-pk`,"und-pl":`pl-latn-pl`,"und-plrd":`hmd-plrd-cn`,"und-pm":`fr-latn-pm`,"und-pr":`es-latn-pr`,"und-prti":`xpr-prti-ir`,"und-ps":`ar-arab-ps`,"und-pt":`pt-latn-pt`,"und-pw":`pau-latn-pw`,"und-py":`gn-latn-py`,"und-qa":`ar-arab-qa`,"und-qo":`en-latn-dg`,"und-re":`fr-latn-re`,"und-rjng":`rej-rjng-id`,"und-ro":`ro-latn-ro`,"und-rohg":`rhg-rohg-mm`,"und-rs":`sr-cyrl-rs`,"und-ru":`ru-cyrl-ru`,"und-runr":`non-runr-se`,"und-rw":`rw-latn-rw`,"und-sa":`ar-arab-sa`,"und-samr":`smp-samr-il`,"und-sarb":`xsa-sarb-ye`,"und-saur":`saz-saur-in`,"und-sc":`fr-latn-sc`,"und-sd":`ar-arab-sd`,"und-se":`sv-latn-se`,"und-sgnw":`ase-sgnw-us`,"und-shaw":`en-shaw-gb`,"und-shrd":`sa-shrd-in`,"und-si":`sl-latn-si`,"und-sidd":`sa-sidd-in`,"und-sind":`sd-sind-in`,"und-sinh":`si-sinh-lk`,"und-sj":`nb-latn-sj`,"und-sk":`sk-latn-sk`,"und-sm":`it-latn-sm`,"und-sn":`fr-latn-sn`,"und-so":`so-latn-so`,"und-sogd":`sog-sogd-uz`,"und-sogo":`sog-sogo-uz`,"und-sora":`srb-sora-in`,"und-soyo":`cmg-soyo-mn`,"und-sr":`nl-latn-sr`,"und-st":`pt-latn-st`,"und-sund":`su-sund-id`,"und-sv":`es-latn-sv`,"und-sy":`ar-arab-sy`,"und-sylo":`syl-sylo-bd`,"und-syrc":`syr-syrc-iq`,"und-tagb":`tbw-tagb-ph`,"und-takr":`doi-takr-in`,"und-tale":`tdd-tale-cn`,"und-talu":`khb-talu-cn`,"und-taml":`ta-taml-in`,"und-tang":`txg-tang-cn`,"und-tavt":`blt-tavt-vn`,"und-td":`fr-latn-td`,"und-telu":`te-telu-in`,"und-tf":`fr-latn-tf`,"und-tfng":`zgh-tfng-ma`,"und-tg":`fr-latn-tg`,"und-tglg":`fil-tglg-ph`,"und-th":`th-thai-th`,"und-thaa":`dv-thaa-mv`,"und-thai":`th-thai-th`,"und-thai-cn":`lcp-thai-cn`,"und-thai-kh":`kdt-thai-kh`,"und-thai-la":`kdt-thai-la`,"und-tibt":`bo-tibt-cn`,"und-tirh":`mai-tirh-in`,"und-tj":`tg-cyrl-tj`,"und-tk":`tkl-latn-tk`,"und-tl":`pt-latn-tl`,"und-tm":`tk-latn-tm`,"und-tn":`ar-arab-tn`,"und-tnsa":`nst-tnsa-in`,"und-to":`to-latn-to`,"und-toto":`txo-toto-in`,"und-tr":`tr-latn-tr`,"und-tv":`tvl-latn-tv`,"und-tw":`zh-hant-tw`,"und-tz":`sw-latn-tz`,"und-ua":`uk-cyrl-ua`,"und-ug":`sw-latn-ug`,"und-ugar":`uga-ugar-sy`,"und-uy":`es-latn-uy`,"und-uz":`uz-latn-uz`,"und-va":`it-latn-va`,"und-vaii":`vai-vaii-lr`,"und-ve":`es-latn-ve`,"und-vith":`sq-vith-al`,"und-vn":`vi-latn-vn`,"und-vu":`bi-latn-vu`,"und-wara":`hoc-wara-in`,"und-wcho":`nnp-wcho-in`,"und-wf":`fr-latn-wf`,"und-ws":`sm-latn-ws`,"und-xk":`sq-latn-xk`,"und-xpeo":`peo-xpeo-ir`,"und-xsux":`akk-xsux-iq`,"und-ye":`ar-arab-ye`,"und-yezi":`ku-yezi-ge`,"und-yiii":`ii-yiii-cn`,"und-yt":`fr-latn-yt`,"und-zanb":`cmg-zanb-mn`,"und-zw":`sn-latn-zw`,une:`une-latn-ng`,ung:`ung-latn-au`,uni:`uni-latn-pg`,unk:`unk-latn-br`,unm:`unm-latn-us`,unn:`unn-latn-au`,unr:`unr-beng-in`,"unr-deva":`unr-deva-np`,"unr-np":`unr-deva-np`,unu:`unu-latn-pg`,unx:`unx-beng-in`,unz:`unz-latn-id`,uok:`uok-latn-zz`,uon:`uon-latn-tw`,upi:`upi-latn-pg`,upv:`upv-latn-vu`,ur:`ur-arab-pk`,ura:`ura-latn-pe`,urb:`urb-latn-br`,urc:`urc-latn-au`,ure:`ure-latn-bo`,urf:`urf-latn-au`,urg:`urg-latn-pg`,urh:`urh-latn-ng`,uri:`uri-latn-zz`,urk:`urk-thai-th`,urm:`urm-latn-pg`,urn:`urn-latn-id`,uro:`uro-latn-pg`,urp:`urp-latn-br`,urr:`urr-latn-vu`,urt:`urt-latn-zz`,uru:`uru-latn-br`,urv:`urv-latn-pg`,urw:`urw-latn-zz`,urx:`urx-latn-pg`,ury:`ury-latn-id`,urz:`urz-latn-br`,usa:`usa-latn-zz`,ush:`ush-arab-pk`,usi:`usi-latn-bd`,"usi-beng":`usi-beng-bd`,usk:`usk-latn-cm`,usp:`usp-latn-gt`,uss:`uss-latn-ng`,usu:`usu-latn-pg`,uta:`uta-latn-ng`,ute:`ute-latn-us`,uth:`uth-latn-zz`,utp:`utp-latn-sb`,utr:`utr-latn-zz`,utu:`utu-latn-pg`,uum:`uum-grek-ge`,"uum-cyrl":`uum-cyrl-ge`,uur:`uur-latn-vu`,uve:`uve-latn-nc`,uvh:`uvh-latn-zz`,uvl:`uvl-latn-zz`,uwa:`uwa-latn-au`,uya:`uya-latn-ng`,uz:`uz-latn-uz`,"uz-af":`uz-arab-af`,"uz-arab":`uz-arab-af`,"uz-cn":`uz-cyrl-cn`,uzs:`uzs-arab-af`,vaa:`vaa-taml-in`,vae:`vae-latn-cf`,vaf:`vaf-arab-ir`,vag:`vag-latn-zz`,vah:`vah-deva-in`,vai:`vai-vaii-lr`,vaj:`vaj-latn-na`,val:`val-latn-pg`,vam:`vam-latn-pg`,van:`van-latn-zz`,vao:`vao-latn-vu`,vap:`vap-latn-in`,var:`var-latn-mx`,vas:`vas-deva-in`,"vas-gujr":`vas-gujr-in`,vau:`vau-latn-cd`,vav:`vav-deva-in`,"vav-gujr":`vav-gujr-in`,vay:`vay-deva-np`,vbb:`vbb-latn-id`,vbk:`vbk-latn-ph`,ve:`ve-latn-za`,vec:`vec-latn-it`,vem:`vem-latn-ng`,veo:`veo-latn-us`,vep:`vep-latn-ru`,ver:`ver-latn-ng`,vgr:`vgr-arab-pk`,vi:`vi-latn-vn`,vic:`vic-latn-sx`,vid:`vid-latn-tz`,vif:`vif-latn-cg`,vig:`vig-latn-bf`,vil:`vil-latn-ar`,vin:`vin-latn-tz`,vit:`vit-latn-ng`,viv:`viv-latn-zz`,vka:`vka-latn-au`,vkj:`vkj-latn-td`,vkk:`vkk-latn-id`,vkl:`vkl-latn-id`,vkm:`vkm-latn-br`,vkn:`vkn-latn-ng`,vko:`vko-latn-id`,vkp:`vkp-latn-in`,"vkp-deva":`vkp-deva-in`,vkt:`vkt-latn-id`,vku:`vku-latn-au`,vkz:`vkz-latn-ng`,vlp:`vlp-latn-vu`,vls:`vls-latn-be`,vma:`vma-latn-au`,vmb:`vmb-latn-au`,vmc:`vmc-latn-mx`,vmd:`vmd-knda-in`,vme:`vme-latn-id`,vmf:`vmf-latn-de`,vmg:`vmg-latn-pg`,vmh:`vmh-arab-ir`,vmi:`vmi-latn-au`,vmj:`vmj-latn-mx`,vmk:`vmk-latn-mz`,vml:`vml-latn-au`,vmm:`vmm-latn-mx`,vmp:`vmp-latn-mx`,vmq:`vmq-latn-mx`,vmr:`vmr-latn-mz`,vms:`vms-latn-id`,vmu:`vmu-latn-au`,vmw:`vmw-latn-mz`,vmx:`vmx-latn-mx`,vmy:`vmy-latn-mx`,vmz:`vmz-latn-mx`,vnk:`vnk-latn-sb`,vnm:`vnm-latn-vu`,vnp:`vnp-latn-vu`,vo:`vo-latn-001`,vor:`vor-latn-ng`,vot:`vot-latn-ru`,vra:`vra-latn-vu`,vro:`vro-latn-ee`,vrs:`vrs-latn-sb`,vrt:`vrt-latn-vu`,vto:`vto-latn-id`,vum:`vum-latn-ga`,vun:`vun-latn-tz`,vut:`vut-latn-zz`,vwa:`vwa-latn-cn`,"vwa-mymr":`vwa-mymr-cn`,wa:`wa-latn-be`,waa:`waa-latn-us`,wab:`wab-latn-pg`,wac:`wac-latn-us`,wad:`wad-latn-id`,wae:`wae-latn-ch`,waf:`waf-latn-br`,wag:`wag-latn-pg`,wah:`wah-latn-id`,wai:`wai-latn-id`,waj:`waj-latn-zz`,wal:`wal-ethi-et`,wam:`wam-latn-us`,wan:`wan-latn-zz`,wap:`wap-latn-gy`,waq:`waq-latn-au`,war:`war-latn-ph`,was:`was-latn-us`,wat:`wat-latn-pg`,wau:`wau-latn-br`,wav:`wav-latn-ng`,waw:`waw-latn-br`,wax:`wax-latn-pg`,way:`way-latn-sr`,waz:`waz-latn-pg`,wba:`wba-latn-ve`,wbb:`wbb-latn-id`,wbe:`wbe-latn-id`,wbf:`wbf-latn-bf`,wbh:`wbh-latn-tz`,wbi:`wbi-latn-tz`,wbj:`wbj-latn-tz`,wbk:`wbk-arab-af`,wbl:`wbl-latn-pk`,"wbl-arab":`wbl-arab-af`,"wbl-cyrl":`wbl-cyrl-tj`,wbm:`wbm-latn-cn`,wbp:`wbp-latn-au`,wbq:`wbq-telu-in`,wbr:`wbr-deva-in`,wbt:`wbt-latn-au`,wbv:`wbv-latn-au`,wbw:`wbw-latn-id`,wca:`wca-latn-br`,wci:`wci-latn-zz`,wdd:`wdd-latn-ga`,wdg:`wdg-latn-pg`,wdj:`wdj-latn-au`,wdk:`wdk-latn-au`,wdt:`wdt-latn-ca`,wdu:`wdu-latn-au`,wdy:`wdy-latn-au`,wec:`wec-latn-ci`,wed:`wed-latn-pg`,weg:`weg-latn-au`,weh:`weh-latn-cm`,wei:`wei-latn-pg`,wem:`wem-latn-bj`,weo:`weo-latn-id`,wep:`wep-latn-de`,wer:`wer-latn-zz`,wes:`wes-latn-cm`,wet:`wet-latn-id`,weu:`weu-latn-mm`,wew:`wew-latn-id`,wfg:`wfg-latn-id`,wga:`wga-latn-au`,wgb:`wgb-latn-pg`,wgg:`wgg-latn-au`,wgi:`wgi-latn-zz`,wgo:`wgo-latn-id`,wgu:`wgu-latn-au`,wgy:`wgy-latn-au`,wha:`wha-latn-id`,whg:`whg-latn-zz`,whk:`whk-latn-id`,whu:`whu-latn-id`,wib:`wib-latn-zz`,wic:`wic-latn-us`,wie:`wie-latn-au`,wif:`wif-latn-au`,wig:`wig-latn-au`,wih:`wih-latn-au`,wii:`wii-latn-pg`,wij:`wij-latn-au`,wik:`wik-latn-au`,wil:`wil-latn-au`,wim:`wim-latn-au`,win:`win-latn-us`,wir:`wir-latn-br`,wiu:`wiu-latn-zz`,wiv:`wiv-latn-zz`,wiy:`wiy-latn-us`,wja:`wja-latn-zz`,wji:`wji-latn-zz`,wka:`wka-latn-tz`,wkd:`wkd-latn-id`,wkr:`wkr-latn-au`,wkw:`wkw-latn-au`,wky:`wky-latn-au`,wla:`wla-latn-pg`,wlg:`wlg-latn-au`,wlh:`wlh-latn-tl`,wli:`wli-latn-id`,wlm:`wlm-latn-gb`,wlo:`wlo-arab-id`,wlr:`wlr-latn-vu`,wls:`wls-latn-wf`,wlu:`wlu-latn-au`,wlv:`wlv-latn-ar`,wlw:`wlw-latn-id`,wlx:`wlx-latn-gh`,wma:`wma-latn-ng`,wmb:`wmb-latn-au`,wmc:`wmc-latn-pg`,wmd:`wmd-latn-br`,wme:`wme-deva-np`,wmh:`wmh-latn-tl`,wmi:`wmi-latn-au`,wmm:`wmm-latn-id`,wmn:`wmn-latn-nc`,wmo:`wmo-latn-zz`,wms:`wms-latn-id`,wmt:`wmt-latn-au`,wmw:`wmw-latn-mz`,"wmw-arab":`wmw-arab-mz`,wmx:`wmx-latn-pg`,wnb:`wnb-latn-pg`,wnc:`wnc-latn-zz`,wnd:`wnd-latn-au`,wne:`wne-arab-pk`,wng:`wng-latn-id`,wni:`wni-arab-km`,wnk:`wnk-latn-id`,wnm:`wnm-latn-au`,wnn:`wnn-latn-au`,wno:`wno-latn-id`,wnp:`wnp-latn-pg`,wnu:`wnu-latn-zz`,wnw:`wnw-latn-us`,wny:`wny-latn-au`,wo:`wo-latn-sn`,woa:`woa-latn-au`,wob:`wob-latn-zz`,woc:`woc-latn-pg`,wod:`wod-latn-id`,woe:`woe-latn-fm`,wof:`wof-latn-gm`,"wof-arab":`wof-arab-gm`,wog:`wog-latn-pg`,woi:`woi-latn-id`,wok:`wok-latn-cm`,wom:`wom-latn-ng`,won:`won-latn-cd`,woo:`woo-latn-id`,wor:`wor-latn-id`,wos:`wos-latn-zz`,wow:`wow-latn-id`,wpc:`wpc-latn-ve`,wrb:`wrb-latn-au`,wrg:`wrg-latn-au`,wrh:`wrh-latn-au`,wri:`wri-latn-au`,wrk:`wrk-latn-au`,wrl:`wrl-latn-au`,wrm:`wrm-latn-au`,wro:`wro-latn-au`,wrp:`wrp-latn-id`,wrr:`wrr-latn-au`,wrs:`wrs-latn-zz`,wru:`wru-latn-id`,wrv:`wrv-latn-pg`,wrw:`wrw-latn-au`,wrx:`wrx-latn-id`,wrz:`wrz-latn-au`,wsa:`wsa-latn-id`,wsg:`wsg-gong-in`,wsi:`wsi-latn-vu`,wsk:`wsk-latn-zz`,wsr:`wsr-latn-pg`,wss:`wss-latn-gh`,wsu:`wsu-latn-br`,wsv:`wsv-arab-af`,wtf:`wtf-latn-pg`,wth:`wth-latn-au`,wti:`wti-latn-et`,wtk:`wtk-latn-pg`,wtm:`wtm-deva-in`,wtw:`wtw-latn-id`,"wtw-bugi":`wtw-bugi-id`,wua:`wua-latn-au`,wub:`wub-latn-au`,wud:`wud-latn-tg`,wul:`wul-latn-id`,wum:`wum-latn-ga`,wun:`wun-latn-tz`,wur:`wur-latn-au`,wut:`wut-latn-pg`,wuu:`wuu-hans-cn`,wuv:`wuv-latn-zz`,wux:`wux-latn-au`,wuy:`wuy-latn-id`,wwa:`wwa-latn-zz`,wwb:`wwb-latn-au`,wwo:`wwo-latn-vu`,wwr:`wwr-latn-au`,www:`www-latn-cm`,wxw:`wxw-latn-au`,wyb:`wyb-latn-au`,wyi:`wyi-latn-au`,wym:`wym-latn-pl`,wyn:`wyn-latn-us`,wyr:`wyr-latn-br`,wyy:`wyy-latn-fj`,xaa:`xaa-latn-es`,xab:`xab-latn-ng`,xai:`xai-latn-br`,xaj:`xaj-latn-br`,xak:`xak-latn-ve`,xal:`xal-cyrl-ru`,xam:`xam-latn-za`,xan:`xan-ethi-et`,xao:`xao-latn-vn`,xar:`xar-latn-pg`,xas:`xas-cyrl-ru`,xat:`xat-latn-br`,xau:`xau-latn-id`,xav:`xav-latn-br`,xaw:`xaw-latn-us`,xay:`xay-latn-id`,xbb:`xbb-latn-au`,xbd:`xbd-latn-au`,xbe:`xbe-latn-au`,xbg:`xbg-latn-au`,xbi:`xbi-latn-zz`,xbj:`xbj-latn-au`,xbm:`xbm-latn-fr`,xbn:`xbn-latn-my`,xbp:`xbp-latn-au`,xbr:`xbr-latn-id`,xbw:`xbw-latn-br`,xby:`xby-latn-au`,xch:`xch-latn-us`,xco:`xco-chrs-uz`,xcr:`xcr-cari-tr`,xda:`xda-latn-au`,xdk:`xdk-latn-au`,xdo:`xdo-latn-ao`,xdq:`xdq-cyrl-ru`,xdy:`xdy-latn-id`,xed:`xed-latn-cm`,xeg:`xeg-latn-za`,xem:`xem-latn-id`,xer:`xer-latn-br`,xes:`xes-latn-zz`,xet:`xet-latn-br`,xeu:`xeu-latn-pg`,xgb:`xgb-latn-ci`,xgd:`xgd-latn-au`,xgg:`xgg-latn-au`,xgi:`xgi-latn-au`,xgm:`xgm-latn-au`,xgu:`xgu-latn-au`,xgw:`xgw-latn-au`,xh:`xh-latn-za`,xhe:`xhe-arab-pk`,xhm:`xhm-khmr-kh`,xhv:`xhv-latn-vn`,xii:`xii-latn-za`,xin:`xin-latn-gt`,xir:`xir-latn-br`,xis:`xis-orya-in`,xiy:`xiy-latn-br`,xjb:`xjb-latn-au`,xjt:`xjt-latn-au`,xka:`xka-arab-pk`,xkb:`xkb-latn-bj`,xkc:`xkc-arab-ir`,xkd:`xkd-latn-id`,xke:`xke-latn-id`,xkg:`xkg-latn-ml`,xkj:`xkj-arab-ir`,xkl:`xkl-latn-id`,xkn:`xkn-latn-id`,xkp:`xkp-arab-ir`,xkq:`xkq-latn-id`,xkr:`xkr-latn-br`,xks:`xks-latn-id`,xkt:`xkt-latn-gh`,xku:`xku-latn-cg`,xkv:`xkv-latn-bw`,xkw:`xkw-latn-id`,xkx:`xkx-latn-pg`,xky:`xky-latn-my`,xkz:`xkz-latn-bt`,xla:`xla-latn-zz`,xlc:`xlc-lyci-tr`,xld:`xld-lydi-tr`,xly:`xly-elym-ir`,xma:`xma-latn-so`,xmb:`xmb-latn-cm`,xmc:`xmc-latn-mz`,xmd:`xmd-latn-cm`,xmf:`xmf-geor-ge`,xmg:`xmg-latn-cm`,xmh:`xmh-latn-au`,xmj:`xmj-latn-cm`,xmm:`xmm-latn-id`,xmn:`xmn-mani-cn`,xmo:`xmo-latn-br`,xmp:`xmp-latn-au`,xmq:`xmq-latn-au`,xmr:`xmr-merc-sd`,xmt:`xmt-latn-id`,xmu:`xmu-latn-au`,xmv:`xmv-latn-mg`,xmw:`xmw-latn-mg`,xmx:`xmx-latn-id`,xmy:`xmy-latn-au`,xmz:`xmz-latn-id`,xna:`xna-narb-sa`,xnb:`xnb-latn-tw`,xni:`xni-latn-au`,xnj:`xnj-latn-tz`,xnk:`xnk-latn-au`,xnm:`xnm-latn-au`,xnn:`xnn-latn-ph`,xnq:`xnq-latn-mz`,xnr:`xnr-deva-in`,xnt:`xnt-latn-us`,xnu:`xnu-latn-au`,xny:`xny-latn-au`,xnz:`xnz-latn-eg`,"xnz-arab":`xnz-arab-eg`,xoc:`xoc-latn-ng`,xod:`xod-latn-id`,xog:`xog-latn-ug`,xoi:`xoi-latn-pg`,xok:`xok-latn-br`,xom:`xom-latn-sd`,"xom-ethi":`xom-ethi-et`,xon:`xon-latn-zz`,xoo:`xoo-latn-br`,xop:`xop-latn-pg`,xor:`xor-latn-br`,xow:`xow-latn-pg`,xpa:`xpa-latn-au`,xpb:`xpb-latn-au`,xpd:`xpd-latn-au`,xpf:`xpf-latn-au`,xpg:`xpg-grek-tr`,xph:`xph-latn-au`,xpi:`xpi-ogam-gb`,xpj:`xpj-latn-au`,xpk:`xpk-latn-br`,xpl:`xpl-latn-au`,xpm:`xpm-cyrl-ru`,xpn:`xpn-latn-br`,xpo:`xpo-latn-mx`,xpq:`xpq-latn-us`,xpr:`xpr-prti-ir`,xpt:`xpt-latn-au`,xpv:`xpv-latn-au`,xpw:`xpw-latn-au`,xpx:`xpx-latn-au`,xpz:`xpz-latn-au`,xra:`xra-latn-br`,xrb:`xrb-latn-zz`,xrd:`xrd-latn-au`,xre:`xre-latn-br`,xrg:`xrg-latn-au`,xri:`xri-latn-br`,xrm:`xrm-cyrl-ru`,xrn:`xrn-cyrl-ru`,xrr:`xrr-latn-it`,xru:`xru-latn-au`,xrw:`xrw-latn-pg`,xsa:`xsa-sarb-ye`,xsb:`xsb-latn-ph`,xse:`xse-latn-id`,xsh:`xsh-latn-ng`,xsi:`xsi-latn-zz`,xsm:`xsm-latn-zz`,xsn:`xsn-latn-ng`,xsp:`xsp-latn-pg`,xsq:`xsq-latn-mz`,xsr:`xsr-deva-np`,xss:`xss-cyrl-ru`,xsu:`xsu-latn-ve`,xsy:`xsy-latn-tw`,xta:`xta-latn-mx`,xtb:`xtb-latn-mx`,xtc:`xtc-latn-sd`,xtd:`xtd-latn-mx`,xte:`xte-latn-id`,xth:`xth-latn-au`,xti:`xti-latn-mx`,xtj:`xtj-latn-mx`,xtl:`xtl-latn-mx`,xtm:`xtm-latn-mx`,xtn:`xtn-latn-mx`,xtp:`xtp-latn-mx`,xts:`xts-latn-mx`,xtt:`xtt-latn-mx`,xtu:`xtu-latn-mx`,xtv:`xtv-latn-au`,xtw:`xtw-latn-br`,xty:`xty-latn-mx`,xub:`xub-taml-in`,"xub-knda":`xub-knda-in`,"xub-mlym":`xub-mlym-in`,xud:`xud-latn-au`,xuj:`xuj-taml-in`,xul:`xul-latn-au`,xum:`xum-latn-it`,"xum-ital":`xum-ital-it`,xun:`xun-latn-au`,xuo:`xuo-latn-td`,xut:`xut-latn-au`,xuu:`xuu-latn-na`,xve:`xve-ital-it`,xvi:`xvi-arab-af`,xvn:`xvn-latn-es`,xvo:`xvo-latn-it`,xvs:`xvs-latn-it`,xwa:`xwa-latn-br`,xwd:`xwd-latn-au`,xwe:`xwe-latn-zz`,xwj:`xwj-latn-au`,xwk:`xwk-latn-au`,xwl:`xwl-latn-bj`,xwo:`xwo-cyrl-ru`,xwr:`xwr-latn-id`,xwt:`xwt-latn-au`,xww:`xww-latn-au`,xxb:`xxb-latn-gh`,xxk:`xxk-latn-id`,xxm:`xxm-latn-au`,xxr:`xxr-latn-br`,xxt:`xxt-latn-id`,xya:`xya-latn-au`,xyb:`xyb-latn-au`,xyj:`xyj-latn-au`,xyk:`xyk-latn-au`,xyl:`xyl-latn-br`,xyt:`xyt-latn-au`,xyy:`xyy-latn-au`,xzh:`xzh-marc-cn`,xzp:`xzp-latn-mx`,yaa:`yaa-latn-pe`,yab:`yab-latn-br`,yac:`yac-latn-id`,yad:`yad-latn-pe`,yae:`yae-latn-ve`,yaf:`yaf-latn-cd`,yag:`yag-latn-cl`,yai:`yai-cyrl-tj`,yaj:`yaj-latn-cf`,yak:`yak-latn-us`,yal:`yal-latn-gn`,"yal-arab":`yal-arab-gn`,yam:`yam-latn-zz`,yan:`yan-latn-ni`,yao:`yao-latn-mz`,yap:`yap-latn-fm`,yaq:`yaq-latn-mx`,yar:`yar-latn-ve`,yas:`yas-latn-zz`,yat:`yat-latn-zz`,yau:`yau-latn-ve`,yav:`yav-latn-cm`,yaw:`yaw-latn-br`,yax:`yax-latn-ao`,yay:`yay-latn-zz`,yaz:`yaz-latn-zz`,yba:`yba-latn-zz`,ybb:`ybb-latn-cm`,ybe:`ybe-latn-cn`,"ybe-ougr":`ybe-ougr-cn`,ybh:`ybh-deva-np`,ybi:`ybi-deva-np`,ybj:`ybj-latn-ng`,ybl:`ybl-latn-ng`,ybm:`ybm-latn-pg`,ybn:`ybn-latn-br`,ybo:`ybo-latn-pg`,ybx:`ybx-latn-pg`,yby:`yby-latn-zz`,ycl:`ycl-latn-cn`,ycn:`ycn-latn-co`,yda:`yda-latn-au`,yde:`yde-latn-pg`,ydg:`ydg-arab-pk`,ydk:`ydk-latn-pg`,yea:`yea-mlym-in`,"yea-knda":`yea-knda-in`,yec:`yec-latn-de`,yee:`yee-latn-pg`,yei:`yei-latn-cm`,yej:`yej-grek-il`,yel:`yel-latn-cd`,yer:`yer-latn-zz`,yes:`yes-latn-ng`,yet:`yet-latn-id`,yeu:`yeu-telu-in`,yev:`yev-latn-pg`,yey:`yey-latn-bw`,yga:`yga-latn-au`,ygi:`ygi-latn-au`,ygl:`ygl-latn-pg`,ygm:`ygm-latn-pg`,ygp:`ygp-plrd-cn`,ygr:`ygr-latn-zz`,ygu:`ygu-latn-au`,ygw:`ygw-latn-zz`,yhd:`yhd-hebr-il`,yi:`yi-hebr-001`,yia:`yia-latn-au`,yig:`yig-yiii-cn`,yih:`yih-hebr-de`,yii:`yii-latn-au`,yij:`yij-latn-au`,yil:`yil-latn-au`,yim:`yim-latn-in`,yir:`yir-latn-id`,yis:`yis-latn-pg`,yiv:`yiv-yiii-cn`,yka:`yka-latn-ph`,"yka-arab":`yka-arab-ph`,ykg:`ykg-cyrl-ru`,yki:`yki-latn-id`,ykk:`ykk-latn-pg`,ykm:`ykm-latn-pg`,yko:`yko-latn-zz`,ykr:`ykr-latn-pg`,yky:`yky-latn-cf`,yla:`yla-latn-pg`,ylb:`ylb-latn-pg`,yle:`yle-latn-zz`,ylg:`ylg-latn-zz`,yli:`yli-latn-id`,yll:`yll-latn-zz`,ylr:`ylr-latn-au`,ylu:`ylu-latn-pg`,yly:`yly-latn-nc`,ymb:`ymb-latn-pg`,yme:`yme-latn-pe`,ymg:`ymg-latn-cd`,ymk:`ymk-latn-mz`,"ymk-arab":`ymk-arab-mz`,yml:`yml-latn-zz`,ymm:`ymm-latn-so`,ymn:`ymn-latn-id`,ymo:`ymo-latn-pg`,ymp:`ymp-latn-pg`,yna:`yna-plrd-cn`,ynd:`ynd-latn-au`,yng:`yng-latn-cd`,ynk:`ynk-cyrl-ru`,ynl:`ynl-latn-pg`,ynq:`ynq-latn-ng`,yns:`yns-latn-cd`,ynu:`ynu-latn-co`,yo:`yo-latn-ng`,yob:`yob-latn-pg`,yog:`yog-latn-ph`,yoi:`yoi-jpan-jp`,yok:`yok-latn-us`,yol:`yol-latn-gb`,yom:`yom-latn-cd`,yon:`yon-latn-zz`,yot:`yot-latn-ng`,yoy:`yoy-thai-th`,yra:`yra-latn-pg`,yrb:`yrb-latn-zz`,yre:`yre-latn-zz`,yrk:`yrk-cyrl-ru`,yrl:`yrl-latn-br`,yrm:`yrm-latn-au`,yro:`yro-latn-br`,yrs:`yrs-latn-id`,yrw:`yrw-latn-pg`,yry:`yry-latn-au`,ysd:`ysd-yiii-cn`,ysn:`ysn-yiii-cn`,ysp:`ysp-yiii-cn`,ysr:`ysr-cyrl-ru`,yss:`yss-latn-zz`,ysy:`ysy-plrd-cn`,ytw:`ytw-latn-pg`,yty:`yty-latn-au`,yua:`yua-latn-mx`,yub:`yub-latn-au`,yuc:`yuc-latn-us`,yud:`yud-hebr-il`,yue:`yue-hant-hk`,"yue-cn":`yue-hans-cn`,"yue-hans":`yue-hans-cn`,yuf:`yuf-latn-us`,yug:`yug-cyrl-ru`,yui:`yui-latn-co`,yuj:`yuj-latn-zz`,yul:`yul-latn-cf`,yum:`yum-latn-us`,yun:`yun-latn-ng`,yup:`yup-latn-co`,yuq:`yuq-latn-bo`,yur:`yur-latn-us`,yut:`yut-latn-zz`,yuw:`yuw-latn-zz`,yux:`yux-cyrl-ru`,yuz:`yuz-latn-bo`,yva:`yva-latn-id`,yvt:`yvt-latn-ve`,ywa:`ywa-latn-pg`,ywg:`ywg-latn-au`,ywn:`ywn-latn-br`,ywq:`ywq-plrd-cn`,"ywq-yiii":`ywq-yiii-cn`,ywr:`ywr-latn-au`,ywu:`ywu-plrd-cn`,"ywu-yiii":`ywu-yiii-cn`,yww:`yww-latn-au`,yxa:`yxa-latn-au`,yxg:`yxg-latn-au`,yxl:`yxl-latn-au`,yxm:`yxm-latn-au`,yxu:`yxu-latn-au`,yxy:`yxy-latn-au`,yyr:`yyr-latn-au`,yyu:`yyu-latn-pg`,za:`za-latn-cn`,zaa:`zaa-latn-mx`,zab:`zab-latn-mx`,zac:`zac-latn-mx`,zad:`zad-latn-mx`,zae:`zae-latn-mx`,zaf:`zaf-latn-mx`,zag:`zag-latn-sd`,zah:`zah-latn-ng`,zaj:`zaj-latn-tz`,zak:`zak-latn-tz`,zam:`zam-latn-mx`,zao:`zao-latn-mx`,zap:`zap-latn-mx`,zaq:`zaq-latn-mx`,zar:`zar-latn-mx`,zas:`zas-latn-mx`,zat:`zat-latn-mx`,zau:`zau-tibt-in`,"zau-arab":`zau-arab-in`,zav:`zav-latn-mx`,zaw:`zaw-latn-mx`,zax:`zax-latn-mx`,zay:`zay-latn-et`,"zay-ethi":`zay-ethi-et`,zaz:`zaz-latn-ng`,zba:`zba-arab-001`,zbc:`zbc-latn-my`,zbe:`zbe-latn-my`,zbt:`zbt-latn-id`,zbu:`zbu-latn-ng`,zbw:`zbw-latn-my`,zca:`zca-latn-mx`,zch:`zch-hani-cn`,zdj:`zdj-arab-km`,zea:`zea-latn-nl`,zeg:`zeg-latn-pg`,zeh:`zeh-hani-cn`,zen:`zen-tfng-mr`,"zen-arab":`zen-arab-mr`,zga:`zga-latn-tz`,zgb:`zgb-hani-cn`,zgh:`zgh-tfng-ma`,zgm:`zgm-hani-cn`,zgn:`zgn-hani-cn`,zgr:`zgr-latn-pg`,zh:`zh-hans-cn`,"zh-au":`zh-hant-au`,"zh-bn":`zh-hant-bn`,"zh-bopo":`zh-bopo-tw`,"zh-gb":`zh-hant-gb`,"zh-gf":`zh-hant-gf`,"zh-hanb":`zh-hanb-tw`,"zh-hant":`zh-hant-tw`,"zh-hk":`zh-hant-hk`,"zh-id":`zh-hant-id`,"zh-mo":`zh-hant-mo`,"zh-pa":`zh-hant-pa`,"zh-pf":`zh-hant-pf`,"zh-ph":`zh-hant-ph`,"zh-sr":`zh-hant-sr`,"zh-th":`zh-hant-th`,"zh-tw":`zh-hant-tw`,"zh-us":`zh-hant-us`,"zh-vn":`zh-hant-vn`,zhd:`zhd-hani-cn`,"zhd-latn":`zhd-latn-vn`,zhi:`zhi-latn-ng`,zhn:`zhn-latn-cn`,"zhn-hani":`zhn-hani-cn`,zhw:`zhw-latn-cm`,zhx:`zhx-nshu-cn`,zia:`zia-latn-zz`,zik:`zik-latn-pg`,zil:`zil-latn-gn`,zim:`zim-latn-td`,zin:`zin-latn-tz`,ziw:`ziw-latn-tz`,ziz:`ziz-latn-ng`,zka:`zka-latn-id`,zkb:`zkb-cyrl-ru`,zkd:`zkd-latn-mm`,zko:`zko-cyrl-ru`,zkp:`zkp-latn-br`,zkt:`zkt-kits-cn`,zku:`zku-latn-au`,zkz:`zkz-cyrl-ru`,zla:`zla-latn-cd`,zlj:`zlj-hani-cn`,"zlj-latn":`zlj-latn-cn`,zlm:`zlm-latn-tg`,zln:`zln-hani-cn`,zlq:`zlq-hani-cn`,zma:`zma-latn-au`,zmb:`zmb-latn-cd`,zmc:`zmc-latn-au`,zmd:`zmd-latn-au`,zme:`zme-latn-au`,zmf:`zmf-latn-cd`,zmg:`zmg-latn-au`,zmh:`zmh-latn-pg`,zmi:`zmi-latn-my`,zmj:`zmj-latn-au`,zmk:`zmk-latn-au`,zml:`zml-latn-au`,zmm:`zmm-latn-au`,zmn:`zmn-latn-ga`,zmo:`zmo-latn-sd`,zmp:`zmp-latn-cd`,zmq:`zmq-latn-cd`,zmr:`zmr-latn-au`,zms:`zms-latn-cd`,zmt:`zmt-latn-au`,zmu:`zmu-latn-au`,zmv:`zmv-latn-au`,zmw:`zmw-latn-cd`,zmx:`zmx-latn-cg`,zmy:`zmy-latn-au`,zmz:`zmz-latn-cd`,zna:`zna-latn-td`,zne:`zne-latn-zz`,zng:`zng-latn-vn`,znk:`znk-latn-au`,zns:`zns-latn-ng`,zoc:`zoc-latn-mx`,zoh:`zoh-latn-mx`,zom:`zom-latn-in`,zoo:`zoo-latn-mx`,zoq:`zoq-latn-mx`,zor:`zor-latn-mx`,zos:`zos-latn-mx`,zpa:`zpa-latn-mx`,zpb:`zpb-latn-mx`,zpc:`zpc-latn-mx`,zpd:`zpd-latn-mx`,zpe:`zpe-latn-mx`,zpf:`zpf-latn-mx`,zpg:`zpg-latn-mx`,zph:`zph-latn-mx`,zpi:`zpi-latn-mx`,zpj:`zpj-latn-mx`,zpk:`zpk-latn-mx`,zpl:`zpl-latn-mx`,zpm:`zpm-latn-mx`,zpn:`zpn-latn-mx`,zpo:`zpo-latn-mx`,zpp:`zpp-latn-mx`,zpq:`zpq-latn-mx`,zpr:`zpr-latn-mx`,zps:`zps-latn-mx`,zpt:`zpt-latn-mx`,zpu:`zpu-latn-mx`,zpv:`zpv-latn-mx`,zpw:`zpw-latn-mx`,zpx:`zpx-latn-mx`,zpy:`zpy-latn-mx`,zpz:`zpz-latn-mx`,zqe:`zqe-hani-cn`,"zqe-latn":`zqe-latn-cn`,zrn:`zrn-latn-td`,zro:`zro-latn-ec`,zrp:`zrp-hebr-fr`,zrs:`zrs-latn-id`,zsa:`zsa-latn-pg`,zsr:`zsr-latn-mx`,zsu:`zsu-latn-pg`,zte:`zte-latn-mx`,ztg:`ztg-latn-mx`,ztl:`ztl-latn-mx`,ztm:`ztm-latn-mx`,ztn:`ztn-latn-mx`,ztp:`ztp-latn-mx`,ztq:`ztq-latn-mx`,zts:`zts-latn-mx`,ztt:`ztt-latn-mx`,ztu:`ztu-latn-mx`,ztx:`ztx-latn-mx`,zty:`zty-latn-mx`,zu:`zu-latn-za`,zua:`zua-latn-ng`,zuh:`zuh-latn-pg`,zum:`zum-arab-om`,zun:`zun-latn-us`,zuy:`zuy-latn-cm`,zyg:`zyg-hani-cn`,zyj:`zyj-latn-cn`,"zyj-hani":`zyj-hani-cn`,zyn:`zyn-hani-cn`,zyp:`zyp-latn-mm`,zza:`zza-latn-tr`,zzj:`zzj-hani-cn`},ui={}.hasOwnProperty;function di(e){let{language:t,script:n,region:r}=e,i;var o,c;return n&&r&&(i=li[Yr({language:t,script:n,region:r})])?(e.script=void 0,e.region=void 0):n&&(i=li[Yr({language:t,script:n})])?e.script=void 0:r&&(i=li[Yr({language:t,region:r})])?e.region=void 0:t&&(i=li[t]),i&&(e.language=void 0,o=e,c=ni(i),o.language||=c.language,o.script||=c.script,o.region||=c.region,c.variants&&o.variants.push(...c.variants)),Yr(e)}function fi(e,t){let n=t||{},r=ni(String(e||``).toLowerCase(),n),i=Yr(r);if(!i)return i;let o=-1;for(;++o<oi.length;){let e=oi[o].from;e.slice(0,4)===`und-`&&r.language&&(e=r.language+e.slice(3)),ii(i,e).length>0&&pi(r,e,oi[o].to)}for(o=-1;++o<si.length;)mi(r,si[o].from.field,si[o].from.value)&&hi(r,si[o].to.field,si[o].to.value);if(function(e){di(e);let{language:t,script:n,region:r}=e;if(!t)return e;let i=Yr({language:t,script:n,region:r});i===di(ni(t))?(e.script=void 0,e.region=void 0):r&&i===di(ni(t+`-`+r))?e.script=void 0:n&&i===di(ni(t+`-`+n))&&(e.region=void 0)}(r),r.variants.sort(),r.extensions.sort(gi),n.warning){let e;for(e in ci)if(ui.call(ci,e)){let t=ci[e],i=r[e];if(i&&ui.call(t,i)){let r=t[i];n.warning(`Deprecated `+e+" `"+i+"`, expected one of `"+r.join("`, `")+"`",-1,7)}}}return r.script&&=r.script.charAt(0).toUpperCase()+r.script.slice(1),r.region&&=r.region.toUpperCase(),Yr(r)}function pi(e,t,n){let r=ni(t),i=ni(n),o=[],c=r.language,l;for(l in r)if(ui.call(r,l)){let t=r[l];t&&mi(e,l,t)&&o.push(l)}for(l in i)if(ui.call(i,l)){let t=i[l];c&&t&&(o.includes(l)||!e[l])&&hi(e,l,l===`language`&&t===`und`?c:t)}}function mi(e,t,n){let r,i=!1;if(n){let o=e[t];if(r=o,Array.isArray(o)){r=[];let e=-1;for(;++e<o.length;){let t=o[e];n.includes(t)?i=!0:r.push(t)}}else o===n&&(r=null,i=!0);e[t]=r}return i}function hi(e,t,n){let r=e[t];if(Array.isArray(r)){let e=Array.isArray(n)?n:[n],t=-1;for(;++t<e.length;){let n=e[t];r.includes(n)||r.push(n)}}else e[t]=n}function gi(e,t){return e.singleton>t.singleton?1:e.singleton<t.singleton?-1:0}function _i(e,t){return t+10<=e.length&&e[t]===73&&e[t+1]===68&&e[t+2]===51&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128}function vi(e,t){let n=0;return n=(127&e[t])<<21,n|=(127&e[t+1])<<14,n|=(127&e[t+2])<<7,n|=127&e[t+3],n}function yi(e,t){return t+10<=e.length&&e[t]===51&&e[t+1]===68&&e[t+2]===73&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128}function bi(e,t=0,n=1/0){return function(e,t,n,r){let i=(o=e)instanceof ArrayBuffer?o:o.buffer;var o;let c=1;`BYTES_PER_ELEMENT`in r&&(c=r.BYTES_PER_ELEMENT);let l=(p=e)&&p.buffer instanceof ArrayBuffer&&p.byteLength!==void 0&&p.byteOffset!==void 0?e.byteOffset:0,u=(l+e.byteLength)/c,d=(l+t)/c,f=Math.floor(Math.max(0,Math.min(d,u)));var p;return new r(i,f,Math.floor(Math.min(f+Math.max(n,0),u))-f)}(e,t,n,Uint8Array)}function xi(e,t=!1){let n=t?e.indexOf(0):e.length,r=function(e,t={}){let n;n=e instanceof ArrayBuffer?new DataView(e):new DataView(e.buffer,e.byteOffset,e.byteLength);let r=0,{encoding:i}=t;if(!i){let e=n.getUint8(0),t=n.getUint8(1);e==239&&t==187&&n.getUint8(2)==191?(i=St,r=3):e==254&&t==255?(i=bt,r=2):e==255&&t==254?(i=xt,r=2):i=St}if(typeof TextDecoder<`u`)return new TextDecoder(i).decode(n);let{byteLength:o}=n,c=i!==bt,l,u=``;for(;r<o;){switch(i){case St:if(l=n.getUint8(r),l<128)r++;else if(l>=194&&l<=223)if(r+1<o){let e=n.getUint8(r+1);e>=128&&e<=191?(l=(31&l)<<6|63&e,r+=2):r++}else r++;else if(l>=224&&l<=239)if(r+2<=o-1){let e=n.getUint8(r+1),t=n.getUint8(r+2);e>=128&&e<=191&&t>=128&&t<=191?(l=(15&l)<<12|(63&e)<<6|63&t,r+=3):r++}else r++;else if(l>=240&&l<=244)if(r+3<=o-1){let e=n.getUint8(r+1),t=n.getUint8(r+2),i=n.getUint8(r+3);e>=128&&e<=191&&t>=128&&t<=191&&i>=128&&i<=191?(l=(7&l)<<18|(63&e)<<12|(63&t)<<6|63&i,r+=4):r++}else r++;else r++;break;case bt:case`utf-16`:case xt:l=n.getUint16(r,c),r+=2}u+=String.fromCodePoint(l)}return u}(new DataView(e.buffer,e.byteOffset,n),{encoding:St});return t?r:r.replace(/\0/g,``)}function Si(e){return e.type===`PRIV`?function(e){if(e.size<2)return;let t=xi(e.data,!0),n=new Uint8Array(e.data.subarray(t.length+1));return{key:e.type,info:t,data:n.buffer}}(e):e.type[0]===`W`?function(e){if(e.type===`WXXX`){if(e.size<2)return;let t=1,n=xi(e.data.subarray(t),!0);t+=n.length+1;let r=xi(e.data.subarray(t));return{key:e.type,info:n,data:r}}let t=xi(e.data);return{key:e.type,info:``,data:t}}(e):e.type===`APIC`?function(e){let t={key:e.type,description:``,data:``,mimeType:null,pictureType:null};if(e.size<2)return;if(e.data[0]!==3)return void console.log(`Ignore frame with unrecognized character encoding`);let n=e.data.subarray(1).indexOf(0);if(n===-1)return;let r=xi(bi(e.data,1,n)),i=e.data[2+n],o=e.data.subarray(3+n).indexOf(0);if(o===-1)return;let c=xi(bi(e.data,3+n,o)),l;var u;return l=r===`-->`?xi(bi(e.data,4+n+o)):(u=e.data.subarray(4+n+o))instanceof ArrayBuffer?u:u.byteOffset==0&&u.byteLength==u.buffer.byteLength?u.buffer:new Uint8Array(u).buffer,t.mimeType=r,t.pictureType=i,t.description=c,t.data=l,t}(e):function(e){if(e.size<2)return;if(e.type===`TXXX`){let t=1,{data:n}=e,r=xi(n.subarray(t),!0);t+=r.length+1;let i=xi(n.subarray(t));return{key:e.type,info:r,data:i}}let t=xi(e.data.subarray(1));return{key:e.type,info:``,data:t}}(e)}function Ci(e){let t=String.fromCharCode(e[0],e[1],e[2],e[3]),n=vi(e,4);return{type:t,size:n,data:e.subarray(10,10+n)}}function wi(){let e,t,n,r,i,o,c,l=this.context;function d(e,n){let r=n?n.index:0,o=t.getAdaptationsForType(i[r].mpd.manifest,r,e);if(!o||o.length===0)return null;if(o.length>1&&n){for(let e=0,n=o.length;e<n;e++)if(c=o[e],t.getRolesForAdaptation(c).filter((function(e){return e.schemeIdUri===h.default.DASH_ROLE_SCHEME_ID&&e.value===Y.default.MAIN}))[0])return o[e]}var c;return o[0]}function f(e,n,i,c,l,u){let d,f,p,m,h,g,_=[];if(!c||c.length===0)return[];let v=t.getAdaptationsForPeriod(n);for(m=0,g=c.length;m<g;m++)if(d=c[m],p=t.getIndexForAdaptation(d,e,i.index),f=b(v[p]),u){let e=f.accessibility.length;for(h=0;h<e;h++){if(!f)continue;let e=f.accessibility[h];if(e.schemeIdUri===o.ACCESSIBILITY_CEA608_SCHEME)if(e.value&&e.value!==``){let t=e.value.split(`;`);if(t[0].substring(0,2)===`CC`)for(h=0;h<t.length;h++)f||=b.call(this,v[p]),S(f,t[h].substring(0,3),t[h].substring(4)),_.push(f),f=null;else for(h=0;h<t.length;h++)f||=b.call(this,v[p]),S(f,`CC`+(h+1),t[h]),_.push(f),f=null}else S(f,o.CC1,`eng`),_.push(f),f=null}}else l===o.IMAGE?(f.type=o.IMAGE,_.push(f),f=null):f&&_.push(f);if(r.get().streaming.includePreselectionsInMediainfoArray){let e=t.getPreselectionsForPeriod(n);for(m=0,g=e.length;m<g;m++){let t=e[m];t.hasOwnProperty(`type`)&&t.type===l&&(f=x(e[m]),f&&_.push(f))}}return _}function p(e){let n=m(e);return t.getRegularPeriods(n)}function m(e){let n=_(e);return t.getMpd(n)}function g(){i=[]}function _(e){return e||(i.length>0?i[0].mpd.manifest:null)}function v(e){try{let n=y(e.streamInfo,i),r=t.getAdaptationsForPeriod(n);return e&&e.streamInfo&&e.streamInfo.id!==void 0&&r?r[e.index]:null}catch{return null}}function y(e,t){let n=t.length;for(let r=0;r<n;r++){let n=t[r];if(e&&e.id===n.id)return n}return null}function b(e){if(!e)return null;let n=new Hr,i=e.period.mpd.manifest.Period[e.period.index].AdaptationSet[e.index];return n.id=e.id,n.index=e.index,n.codec=t.getCodec(i),n.type=r.get().streaming.enhancement.codecs.some((e=>n.codec?.includes(e)))?h.default.ENHANCEMENT:e.type,n.streamInfo=C(e.period),n.representationCount=t.getRepresentationCount(i),n.labels=t.getLabelsForAdaptation(i),n.lang=t.getLanguageForAdaptation(i),n.segmentAlignment=t.getSegmentAlignment(i),n.subSegmentAlignment=t.getSubSegmentAlignment(i),n.viewpoint=t.getViewpointForAdaptation(i),n.accessibility=t.getAccessibilityForAdaptation(i),n.accessibility.filter((function(e){if(e.schemeIdUri&&e.schemeIdUri.search(`cea-608`)>=0&&c!==void 0)return!0}))[0]&&(n.embeddedCaptions=!0),n.audioChannelConfiguration=t.getAudioChannelConfigurationForAdaptation(i),n.audioChannelConfiguration.length===0&&i.Representation&&i.Representation.length>0&&(n.audioChannelConfiguration=t.getAudioChannelConfigurationForRepresentation(i.Representation[0])),n.roles=t.getRolesForAdaptation(i),n.mimeType=t.getMimeType(i),n.contentProtection=t.getContentProtectionByAdaptation(i),n.bitrateList=t.getBitrateListForAdaptation(i),n.selectionPriority=t.getSelectionPriority(i),n.contentProtection&&n.contentProtection.length>0&&(n.contentProtection=function(e,n){if(!e||!e.length||!n)return e;let r=t.getContentProtectionByManifest(n);if(!r||!r.length)return e;let i=r.reduce(((e,t)=>(t.refId&&e.set(t.refId,t),e)),new Map);return e.map((e=>{if(e.ref){let t=i.get(e.ref);t&&e.mergeAttributesFromReference(t)}return e}))}(n.contentProtection,e.period.mpd.manifest),n.contentProtection=function(e){let t=e.map((e=>e.cencDefaultKid)).filter((e=>e!==null));if(t.length){let n=t[0];e.forEach((e=>{e.keyId=n}))}return e}(n.contentProtection),n.normalizedKeyIds=function(e){let t=new Set;return e.forEach((e=>{e.cencDefaultKid&&typeof e.cencDefaultKid==`string`&&t.add(e.cencDefaultKid.replace(/-/g,``).toLowerCase())})),t}(n.contentProtection)),n.isText=t.getIsText(i),n.essentialProperties=t.getCombinedEssentialPropertiesForAdaptationSet(i),n.supplementalProperties=t.getCombinedSupplementalPropertiesForAdaptationSet(i),n.isFragmented=t.getIsFragmented(i),n.isEmbedded=!1,n.adaptationSetSwitchingCompatibleIds=function(e){if(!e||!e.supplementalProperties)return[];let t=[],n=e.supplementalProperties.filter((e=>e.schemeIdUri===Y.default.ADAPTATION_SET_SWITCHING_SCHEME_ID_URI));return n&&n.length>0&&(t=n[0].value.toString().split(`,`).map((e=>e))),t}(n),n.segmentSequenceProperties=t.getSegmentSequencePropertiesForAdaptationSet(i),n}function x(e){if(!e)return null;let n=new Hr,r=e.period.mpd.manifest.Period[e.period.index].Preselection[e.index],i=e.period.mpd.manifest.Period[e.period.index].AdaptationSet,o=t.getAdaptationsForPeriod(e.period);return n=b(t.getMainAdaptationSetForPreselection(r,o)),n&&(n.isPreselection=!0,n.tag=e.tag,n.id=e.id,n.codec=t.getCodecForPreselection(r,i),n.selectionPriority=t.getSelectionPriority(r),n.labels=t.getLabelsForAdaptation(r),n.lang=t.getLanguageForAdaptation(r),n.viewpoint=t.getViewpointForAdaptation(r),n.accessibility=t.getAccessibilityForAdaptation(r),n.audioChannelConfiguration=t.getAudioChannelConfigurationForAdaptation(r),n.roles=t.getRolesForAdaptation(r),n.essentialProperties=t.getCombinedEssentialPropertiesForAdaptationSet(r),n.supplementalProperties=t.getCombinedSupplementalPropertiesForAdaptationSet(r)),n}function S(e,t,n){e.id=t,e.index=100+parseInt(t.substring(2,3)),e.type=o.TEXT,e.codec=`cea-608-in-SEI`,e.isEmbedded=!0,e.isFragmented=!1,e.lang=fi(n),e.roles=[{schemeIdUri:`urn:mpeg:dash:role:2011`,value:`caption`}]}function C(e){let n=new Ur;return n.id=e.id,n.index=e.index,n.start=e.start,n.duration=e.duration,n.manifestInfo=function(e){let n=new Wr;return n.dvrWindowSize=e.timeShiftBufferDepth,n.loadedTime=e.manifest.loadedTime,n.availableFrom=e.availabilityStartTime,n.minBufferTime=e.manifest.minBufferTime,n.maxFragmentDuration=e.maxSegmentDuration,n.duration=t.getDuration(e.manifest),n.isDynamic=t.getIsDynamic(e.manifest),n.serviceDescriptions=t.getServiceDescriptions(e.manifest),n.protocol=e.manifest.protocol,n}(e.mpd),n.isLast=e.mpd.manifest.Period.length===1||Math.abs(n.start+n.duration-n.manifestInfo.duration)<1,n.isEncrypted=e.isEncrypted,n}function w(){if(!o)throw Error(`setConfig function has to be called previously`)}function T(e){return i.length>0?i[0].mpd.manifest.Period[e]:null}function E(e,t,n){let r,i,o,c,l,u;if(e){for(i=e.AdaptationSet,l=0;l<i.length;l+=1)for(r=i[l],c=r.Representation,u=0;u<c.length;u+=1)if(o=c[u],t===o.id)return n?u:o}return null}return e={applyPatchToManifest:function(e,t){n.getPatchOperations(t).forEach((t=>{let n=t.getMpdTarget(e);if(n===null)return;let{name:r,target:i,leaf:o}=n;if(t.xpath.findsAttribute()||r===`__text`){switch(t.action){case`add`:case`replace`:i[r]=t.value;break;case`remove`:delete i[r]}return}let c=(i[r]||[]).indexOf(o),l=t.position===`prepend`||t.position===`before`;if(t.action===`remove`||t.action===`replace`)if(Array.isArray(i[r])){if(c!=-1){let e=i[r];e.splice(c,1),e.length>0?i[r]=e:delete i[r]}}else delete i[r];t.action!==`add`&&t.action!==`replace`||Object.keys(t.value).forEach((e=>{let n=t.value[e],o=i[e]||[];if(o.length===0&&i[e]&&o.push(i[e]),o.length===0)o=n;else{let i=o.length;i=e==r&&c!=-1?c+ +!l+(t.action===`replace`?-1:0):l?0:o.length,o.splice.apply(o,[i,0].concat(n))}i[e]=o}))}))},areMediaInfosEqual:function(e,t){if(!e||!t)return!1;let n=e.id===t.id,r=e.codec===t.codec,i=JSON.stringify(e.viewpoint)===JSON.stringify(t.viewpoint),o=e.lang===t.lang,c=JSON.stringify(e.roles)===JSON.stringify(t.roles),l=JSON.stringify(e.accessibility)===JSON.stringify(t.accessibility),u=JSON.stringify(e.audioChannelConfiguration)===JSON.stringify(t.audioChannelConfiguration);return n&&r&&i&&o&&c&&l&&u},getAllMediaInfoForType:function(e,n,r){let c=i,l=r,u=[];if(l)w(),c=p(l);else{if(!(i.length>0))return u;l=i[0].mpd.manifest}let d=y(e,c),m=t.getAdaptationsForType(l,e?e.index:null,n);return u=f(l,d,e,m,n),n===o.TEXT&&(m=t.getAdaptationsForType(l,e?e.index:null,o.VIDEO),u=u.concat(f(l,d,e,m,n,!0))),u},getAvailabilityStartTime:function(e){let n=m(e);return t.getAvailabilityStartTime(n)},getBandwidthForRepresentation:function(e,t){let n;return n=E(T(t),e),n?n.bandwidth:null},getBaseURLsFromElement:function(e){return t.getBaseURLsFromElement(e)},getCodec:function(e,n,r){return t.getCodec(e,n,r)},getCodecForPreselection:function(e,n){return t.getCodecForPreselection(e,n)},getContentSteering:function(e){return t.getContentSteering(e)},getDuration:function(e){let n=_(e);return t.getDuration(n)},getEssentialProperties:function(e){try{return t.getEssentialProperties(e)}catch{return[]}},getEvent:function(e,t,n,r){try{if(!e||!t||isNaN(n)||!r)return null;let i=e.scheme_id_uri,o=e.value;if(!t[i+`/`+o])return null;let c=new nt,l=e.timescale||1,u=r.adaptation.period.start,d=t[i+`/`+o],f=isNaN(r.presentationTimeOffset)?isNaN(d.presentationTimeOffset)?0:d.presentationTimeOffset:r.presentationTimeOffset,p,m=e.presentation_time_delta/l;p=e.version===0?u+n-f+m:u-f+m;let g=e.event_duration/l,_=e.id,v=e.message_data;return c.eventStream=d,c.eventStream.value=o,c.eventStream.timescale=l,c.duration=g,c.id=_,c.calculatedPresentationTime=p,c.messageData=v,c.presentationTimeDelta=m,c.parsedMessageData=i===h.default.ID3_SCHEME_ID_URI?function(e){let t=0,n=[];for(;_i(e,t);){let r=vi(e,t+6);e[t+5]>>6&1&&(t+=10),t+=10;let i=t+r;for(;t+10<i;){let r=Ci(e.subarray(t)),i=Si(r);i&&n.push(i),t+=r.size+10}yi(e,t)&&(t+=10)}return n}(v):null,c}catch{return null}},getEventsFor:function(e,n,r){let o=[];if(i.length>0){let c=i[0].mpd.manifest;if(e instanceof Ur){let n=y(e,i);o=t.getEventsForPeriod(n)}else if(e instanceof Hr){let n=y(r,i);o=t.getEventStreamForAdaptationSet(c,v(e),n)}else if(e instanceof dt){let e=y(r,i);o=t.getEventStreamForRepresentation(c,n,e)}}return o},getFramerate:function(e){return t.getFramerate(e)},getIndexForRepresentation:function(e,t){return function(e,t){let n=E(e,t,!0);return n===null?-1:n}(T(t),e)},getIsDVB:function(e){return t.hasProfile(e,`urn:dvb:dash:profile:dvb-dash:2014`)},getIsDynamic:function(e){let n=_(e);return t.getIsDynamic(n)},getIsPatch:function(e){return n.getIsPatch(e)},getIsTextTrack:function(e){return t.getIsText(e)},getIsTypeOf:function(e,n){return t.getIsTypeOf(e,n)},getLocation:function(e){return t.getLocation(e)},getMainAdaptationForType:d,getMainAdaptationSetForPreselection:function(e,n){return t.getMainAdaptationSetForPreselection(e,n)},getCommonRepresentationForPreselection:function(e,n){return t.getCommonRepresentationForPreselection(e,n)},getManifestUpdatePeriod:function(e,n=0){return t.getManifestUpdatePeriod(e,n)},getMediaInfoForType:function(e,n){if(i.length===0||!e)return null;let r=y(e,i);if(!r)return null;let o=t.getAdaptationsForPeriod(r),c=d(n,e);return c?b(o[t.getIndexForAdaptation(c,i[0].mpd.manifest,e.index)]):null},getMpd:m,getPatchLocation:function(e){let n=t.getPatchLocation(e),r=t.getPublishTime(e);return n&&n.length!==0&&r?n.filter((e=>isNaN(e.ttl)||r.getTime()+e.ttl>new Date().getTime())):[]},getPeriodById:function(e){if(!e||i.length===0)return null;let t=i.filter((t=>t.id===e));return t&&t.length>0?t[0]:null},getPreselectionIsTypeOf:function(e,n,r){return t.getPreselectionIsTypeOf(e,n,r)},getProducerReferenceTimes:function(e,n){let r,o,c=y(e,i);return r=n?n.id:null,i.length>0&&c&&(o=r?t.getAdaptationForId(r,i[0].mpd.manifest,c.index):t.getAdaptationForIndex(n?n.index:null,i[0].mpd.manifest,c.index)),o?t.getProducerReferenceTimesForAdaptation(o):[]},getPublishTime:function(e){return t.getPublishTime(e)},getRealAdaptation:function(e,n){let r,o,c=y(e,i);return r=n?n.id:null,i.length>0&&c&&(o=r?t.getAdaptationForId(r,i[0].mpd.manifest,c.index):t.getAdaptationForIndex(n?n.index:null,i[0].mpd.manifest,c.index)),o},getRealPeriodByIndex:function(e){return t.getRealPeriodForIndex(e,i[0].mpd.manifest)},getRegularPeriods:p,getRepresentationSortFunction:function(){return t.getRepresentationSortFunction()},getStreamsInfo:function(e,t){let n=[],r=i;if(e&&(w(),r=p(e)),r.length>0){(!t||t>r.length)&&(t=r.length);for(let e=0;e<t;e++)n.push(C(r[e]))}return n},getSuggestedPresentationDelay:function(){let e=i.length>0?i[0].mpd:null;return t.getSuggestedPresentationDelay(e)},getSupplementalCodecs:function(e){let t=e[Y.default.SUPPLEMENTAL_CODECS];return t?t.split(` `).map((t=>e.mimeType+`;codecs="`+t+`"`)):[]},getUTCTimingSources:function(){let e=_();return t.getUTCTimingSources(e)},getVoRepresentations:function(e){let n,r=v(e);return n=t.getRepresentationsForAdaptation(r,e),n},isPatchValid:function(e,r){let i=t.getId(e),o=n.getMpdId(r),c=t.getPublishTime(e),l=n.getPublishTime(r),u=n.getOriginalPublishTime(r);return!!(i&&o&&i==o&&c&&u&&c.getTime()==u.getTime()&&l&&c.getTime()<l.getTime())},reset:g,setConfig:function(e){e&&(e.constants&&(o=e.constants),e.cea608parser&&(c=e.cea608parser),e.errHandler&&t.setConfig({errHandler:e.errHandler}),e.BASE64&&t.setConfig({BASE64:e.BASE64}))},updatePeriods:function(e){if(!e)return null;w(),i=p(e)}},t=yt(l).getInstance(),n=Jr(l).getInstance(),r=(0,u.default)(l).getInstance(),g(),e}wi.__dashjs_factory_name=`DashAdapter`;var Ti=i.default.getSingletonFactory(wi);class Ei{static round10(e,t){return function(e,t,n){return n===void 0||+n==0?Math[e](t):(n=+n,(t=+t)===null||isNaN(t)||typeof n!=`number`||n%1!=0?NaN:(t=t.toString().split(`e`),+((t=(t=Math[e](+(t[0]+`e`+(t[1]?+t[1]-n:-n)))).toString().split(`e`))[0]+`e`+(t[1]?+t[1]+n:n))))}(`round`,e,t)}}var Di=class{constructor(){this.TcpList=[],this.HttpList=[],this.RepSwitchList=[],this.BufferLevel=[],this.BufferState=[],this.PlayList=[],this.DroppedFrames=[],this.SchedulingInfo=[],this.DVRInfo=[],this.ManifestUpdate=[],this.RequestsQueue=null,this.DVBErrors=[]}},Oi=class{constructor(){this.t=null,this.mt=null,this.to=null,this.lto=null}},ki=class{constructor(){this.t=null,this.level=null}},Ai=class{constructor(){this.target=null,this.state=c.BUFFER_EMPTY}},ji=class{constructor(){this.time=null,this.range=null,this.manifestInfo=null}},Mi=class{constructor(){this.time=null,this.droppedFrames=null}};class Ni{constructor(){this.mediaType=null,this.type=null,this.requestTime=null,this.fetchTime=null,this.availabilityStartTime=null,this.presentationStartTime=0,this.clientTimeOffset=0,this.currentTime=null,this.buffered=null,this.latency=0,this.streamInfo=[],this.representationInfo=[]}}class Pi{constructor(){this.id=null,this.index=null,this.start=null,this.duration=null}}class Fi{constructor(){this.id=null,this.index=null,this.mediaType=null,this.presentationTimeOffset=null,this.startNumber=null}}var Ii=class{constructor(){this.mediaType=null,this.t=null,this.type=null,this.startTime=null,this.availabilityStartTime=null,this.duration=null,this.bandwidth=null,this.range=null,this.state=null}},Li=class{constructor(){this.loadingRequests=[],this.executedRequests=[]}};function Ri(e){let t=(e||={}).settings,n,r,i=this.context,o=(0,p.default)(i).getInstance();function l(){o.trigger(m.default.METRICS_CHANGED)}function u(e){o.trigger(m.default.METRIC_CHANGED,{mediaType:e}),l()}function d(e,t,n){o.trigger(m.default.METRIC_UPDATED,{mediaType:e,metric:t,value:n}),u(e)}function f(e,t,n){o.trigger(m.default.METRIC_ADDED,{mediaType:e,metric:t,value:n}),u(e)}function g(e,t){let n=null;return e&&(r.hasOwnProperty(e)?n=r[e]:t||(n=new Di,r[e]=n)),n}function _(e,n,r){let i=g(e);i!==null&&(i[n].push(r),i[n].length>t.get().streaming.metrics.maxListDepth&&i[n].shift())}function v(e,t,n){_(e,t,n),f(e,t,n)}return n={addBufferLevel:function(e,t,n){let r=new ki;r.t=t,r.level=n,v(e,c.BUFFER_LEVEL,r)},addBufferState:function(e,t,n){let r=new Ai;r.target=n,r.state=t,v(e,c.BUFFER_STATE,r)},addDVBErrors:function(e){v(h.default.STREAM,c.DVB_ERRORS,e)},addDVRInfo:function(e,t,n,r){let i=new ji;i.time=t,i.range=r,i.manifestInfo=n,v(e,c.DVR_INFO,i)},addDroppedFrames:function(e,t){let n=new Mi,r=g(e).DroppedFrames;t&&(n.time=t.creationTime,n.droppedFrames=t.droppedVideoFrames,r.length>0&&r[r.length-1]==n||v(e,c.DROPPED_FRAMES,n))},addHttpRequest:function e(t,n,r,i){let o=new T.HTTPRequest;n.url&&n.url!==t.url&&(e({mediaType:t.mediaType,type:t.type,url:t.url,serviceLocation:null,range:t.range,startDate:t.startDate,firstByteDate:null,endDate:null,duration:t.duration,fileLoaderType:t.fileLoaderType,resourceTimingValues:t.resourceTimingValues},{url:null,status:null,headers:null},null,i),o.actualurl=n.url),o.tcpid=null,o.type=t.type,o.url=t.url,o.range=t.range||null,o.trequest=t.startDate,o.tresponse=t.firstByteDate,o.responsecode=n.status,o.cmsd=i,o._tfinish=t.endDate,o._stream=t.mediaType,o._mediaduration=t.duration,o._responseHeaders=``;for(let e in n.headers)o._responseHeaders+=e+`: `+n.headers[e]+`\r
52
+ `;o._serviceLocation=t.serviceLocation||null,o._fileLoaderType=t.fileLoaderType,o._resourceTimingValues=t.resourceTimingValues,o._streamId=t&&t.representation&&t.representation.mediaInfo&&t.representation.mediaInfo.streamInfo?t.representation.mediaInfo.streamInfo.id:null,r?r.forEach((e=>{(function(e,t,n,r){let i=new T.HTTPRequestTrace;i.s=t,i.d=n,i.b=r,e.trace.push(i),e.interval||=0,e.interval+=n})(o,e.s,e.d,e.b,e.t)})):(delete o.interval,delete o.trace),v(t.mediaType,c.HTTP_REQUEST,o)},addManifestUpdate:function(e,t,n,r){let i=new Ni;i.mediaType=e,i.type=t,i.requestTime=n,i.fetchTime=r,_(h.default.STREAM,c.MANIFEST_UPDATE,i),f(e,c.MANIFEST_UPDATE,i)},addManifestUpdateRepresentationInfo:function(e,t,n){if(e&&e.representationInfo){let r=new Fi;r.id=t?t.id:null,r.index=t?t.index:null,r.mediaType=n,r.startNumber=t?t.startNumber:null,r.presentationTimeOffset=t?t.presentationTimeOffset:null,e.representationInfo.push(r),d(e.mediaType,c.MANIFEST_UPDATE_TRACK_INFO,e)}},addManifestUpdateStreamInfo:function(e,t,n,r,i){if(e){let o=new Pi;o.id=t,o.index=n,o.start=r,o.duration=i,e.streamInfo.push(o),d(e.mediaType,c.MANIFEST_UPDATE_STREAM_INFO,e)}},addPlayList:function(e){e.trace&&Array.isArray(e.trace)?e.trace.forEach((e=>{e.hasOwnProperty(`subreplevel`)&&!e.subreplevel&&delete e.subreplevel})):delete e.trace,v(h.default.STREAM,c.PLAY_LIST,e)},addRepresentationSwitch:function(e,t,n,r,i){let o=new Oi;o.t=t,o.mt=n,o.to=r,i?o.lto=i:delete o.lto,v(e,c.TRACK_SWITCH,o)},addRequestsQueue:function(e,t,n){let r=new Li;r.loadingRequests=t,r.executedRequests=n,g(e).RequestsQueue=r,f(e,c.REQUESTS_QUEUE,r)},addSchedulingInfo:function(e,t,n,r,i,o,l,u,d){let f=new Ii;f.mediaType=e,f.t=t,f.type=n,f.startTime=r,f.availabilityStartTime=i,f.duration=o,f.bandwidth=l,f.range=u,f.state=d,v(e,c.SCHEDULING_INFO,f)},clearAllCurrentMetrics:function(){r={},l()},clearCurrentMetricsForType:function(e){delete r[e],u(e)},getMetricsFor:g,updateManifestUpdateInfo:function(e,t){if(e){for(let n in t)e[n]=t[n];d(e.mediaType,c.MANIFEST_UPDATE,e)}}},r={},n}Ri.__dashjs_factory_name=`MetricsModel`;var zi=i.default.getSingletonFactory(Ri);class Bi{constructor(){this.start=null,this.mstart=null,this.starttype=null,this.trace=[]}}Bi.INITIAL_PLAYOUT_START_REASON=`initial_playout`,Bi.SEEK_START_REASON=`seek`,Bi.RESUME_FROM_PAUSE_START_REASON=`resume`,Bi.METRICS_COLLECTION_START_REASON=`metrics_collection_start`;class Vi{constructor(){this.representationid=null,this.subreplevel=null,this.start=null,this.mstart=null,this.duration=null,this.playbackspeed=null,this.stopreason=null}}function Hi(e){e||={};let t=this.context,n,r,i,o,l=e.metricsModel;function u(e){let t=l.getMetricsFor(e,!0);if(!t)return null;let n=t.HttpList,r,i=null;if(!n||n.length<=0)return null;for(r=n.length-1;r>=0;){if(n[r].responsecode){i=n[r];break}r--}return i}function d(e){let t=l.getMetricsFor(e,!0);return t&&t.HttpList?t.HttpList:[]}function f(e,t){if(!e)return null;let n=e[t];return n&&n.length!==0?n[n.length-1]:null}return n={getCurrentRepresentationSwitch:function(e){return f(l.getMetricsFor(e,!0),c.TRACK_SWITCH)},getCurrentBufferState:function(e){return f(l.getMetricsFor(e,!0),c.BUFFER_STATE)},getCurrentBufferLevel:function(e){let t=f(l.getMetricsFor(e,!0),c.BUFFER_LEVEL);return t?Ei.round10(t.level/1e3,-3):0},getCurrentHttpRequest:u,getHttpRequests:d,getCurrentDroppedFrames:function(){return f(l.getMetricsFor(h.default.VIDEO,!0),c.DROPPED_FRAMES)},getCurrentSchedulingInfo:function(e){return f(l.getMetricsFor(e,!0),c.SCHEDULING_INFO)},getCurrentDVRInfo:function(e){return f(e?l.getMetricsFor(e,!0):l.getMetricsFor(h.default.VIDEO,!0)||l.getMetricsFor(h.default.AUDIO,!0),c.DVR_INFO)},getCurrentManifestUpdate:function(){return f(l.getMetricsFor(h.default.STREAM),c.MANIFEST_UPDATE)},getLatestFragmentRequestHeaderValueByID:function(e,t){if(!t)return null;let n={},r=u(e);r&&(n=He.default.parseHttpHeaders(r._responseHeaders));let i=n[t.toLowerCase()];return i===void 0?null:i},getLatestMPDRequestHeaderValueByID:function(e){if(!e)return null;let t,n,r,i={};for(t=d(h.default.STREAM),r=t.length-1;r>=0;r--)if(n=t[r],n.type===T.HTTPRequest.MPD_TYPE){i=He.default.parseHttpHeaders(n._responseHeaders);break}let o=i[e.toLowerCase()];return o===void 0?null:o},addRepresentationSwitch:function(e,t,n,r,i){l.addRepresentationSwitch(e,t,n,r,i)},addDVRInfo:function(e,t,n,r){l.addDVRInfo(e,t,n,r)},updateManifestUpdateInfo:function(e){let t=this.getCurrentManifestUpdate();l.updateManifestUpdateInfo(t,e)},addManifestUpdateStreamInfo:function(e){if(e){let t=this.getCurrentManifestUpdate();l.addManifestUpdateStreamInfo(t,e.id,e.index,e.start,e.duration)}},addManifestUpdateRepresentationInfo:function(e,t){if(e){let n=this.getCurrentManifestUpdate();l.addManifestUpdateRepresentationInfo(n,e,t)}},addManifestUpdate:function(e){l.addManifestUpdate(h.default.STREAM,e.type,e.startDate,e.endDate)},addHttpRequest:function(e,t,n,r,i,o){let c={status:n,headers:r,url:t};l.addHttpRequest(e,c,i,o)},addSchedulingInfo:function(e,t){l.addSchedulingInfo(e.mediaType,new Date,e.type,e.startTime,e.availabilityStartTime,e.duration,e.bandwidth,e.range,t)},addRequestsQueue:function(e,t,n){l.addRequestsQueue(e,t,n)},addBufferLevel:function(e,t,n){l.addBufferLevel(e,t,n)},addBufferState:function(e,t,n){l.addBufferState(e,t,n)},addDroppedFrames:function(e){l.addDroppedFrames(h.default.VIDEO,e)},addPlayList:function(){o&&=(l.addPlayList(o),null)},addDVBErrors:function(e){l.addDVBErrors(e)},createPlaylistMetrics:function(e,t){o=new Bi,o.start=new Date,o.mstart=e,o.starttype=t},createPlaylistTraceMetrics:function(e,t,n){!0===r&&(r=!1,i=new Vi,i.representationid=e,i.start=new Date,i.mstart=t,i.playbackspeed=n===null?null:n.toString())},updatePlayListTraceMetrics:function(e){if(i)for(let t in i)i[t]=e[t]},pushPlayListTraceMetrics:function(e,t){if(!1===r&&o&&i&&i.start){let n=i.start;i.duration=e.getTime()-n.getTime(),i.stopreason=t,o.trace.push(i),r=!0}},clearAllCurrentMetrics:function(){l.clearAllCurrentMetrics()}},l||=zi(t).getInstance({settings:e.settings}),r=!0,i=null,o=null,n}Vi.REPRESENTATION_SWITCH_STOP_REASON=`representation_switch`,Vi.REBUFFERING_REASON=`rebuffering`,Vi.USER_REQUEST_STOP_REASON=`user_request`,Vi.END_OF_PERIOD_STOP_REASON=`end_of_period`,Vi.END_OF_CONTENT_STOP_REASON=`end_of_content`,Vi.METRICS_COLLECTION_STOP_REASON=`metrics_collection_end`,Vi.FAILURE_STOP_REASON=`failure`,Hi.__dashjs_factory_name=`DashMetrics`;var Ui=i.default.getSingletonFactory(Hi);function Wi(){let e,t=this.context,n=(0,p.default)(t).getInstance();return e={error:function(e){n.trigger(m.default.ERROR,{error:e})}},e}Wi.__dashjs_factory_name=`ErrorHandler`;var Gi=i.default.getSingletonFactory(Wi),Ki=r(5560);function qi(){let e=this.context,t=(0,p.default)(e).getInstance(),n,r,i,o,c,u,d,f,g,_,v,y;function b(){y.debug(`Stopping the gap controller`),c&&=(clearInterval(c),null),function(){t.off(m.default.WALLCLOCK_TIME_UPDATED,T,this),t.off(m.default.INITIAL_STREAM_SWITCH,w,this),t.off(m.default.PLAYBACK_SEEKING,x,this),t.off(m.default.BUFFER_REPLACEMENT_STARTED,S,n),t.off(m.default.TRACK_CHANGE_RENDERED,C,n)}(),c=null,u=NaN,o=0,_=null,v={}}function x(){_&&=(clearTimeout(_),null)}function S(e){try{if(e.streamId!==f.getActiveStreamInfo().id||e.mediaType!==h.default.VIDEO&&e.mediaType!==h.default.AUDIO)return;e.streamId===f.getActiveStreamInfo().id&&(v[e.mediaType]=!0)}catch(e){y.error(e)}}function C(e){e&&e.mediaType&&(v[e.mediaType]=!1)}function w(){c||function(){try{c||=(y.debug(`Starting the gap controller`),setInterval((()=>{E()&&D(d.getTime())}),100))}catch{}}()}function T(){if(E(i.get().streaming.gaps.enableSeekFix)&&(o++,o>=10)){let e=d.getTime();r===e?D(e,!0):(r=e,u=NaN),o=0}}function E(e=!1){if(!f.getActiveStream())return!1;let t=Object.keys(v).some((e=>v[e])),n=!!e&&function(){let e=f.getActiveStream(),t=parseFloat((e.getStartTime()+e.getDuration()).toFixed(5));return d.getTime()+i.get().streaming.gaps.threshold>=t}();return!t&&i.get().streaming.gaps.jumpGaps&&f.getActiveStreamProcessors().length>0&&(!d.isSeeking()||n)&&!d.isPaused()&&!f.getIsStreamSwitchInProgress()&&!f.getHasMediaOrInitialisationError()}function D(e,t=!1){let n=i.get().streaming.gaps.enableStallFix,r=i.get().streaming.gaps.stallSeek,o=i.get().streaming.gaps.smallGapLimit,c=i.get().streaming.gaps.jumpLargeGaps,l=i.get().streaming.gaps.seekOffset,p=g.getBufferRange(),m,h=NaN,v=!1;if(m=function(e,t){try{if(!e||e.length<=1&&t>0)return NaN;let n=NaN,r=0;for(;isNaN(n)&&r<e.length;){let o=r>0?e.end(r-1):0;t<e.start(r)&&o-t<i.get().streaming.gaps.threshold&&(n=r),r+=1}return n}catch{return null}}(p,e),!isNaN(m)){let t=p.start(m),n=t-e;n>0&&(n<=o||c)&&(h=t)}let b=d.getTimeToStreamEnd();if(isNaN(h)&&t&&isFinite(b)&&!isNaN(b)&&b<o&&(h=parseFloat(d.getStreamEndTime().toFixed(5)),v=!0),n&&isNaN(h)&&t&&isNaN(m)&&function(e,t){for(let n=0,r=e.length;n<r;n++)if(t>=e.start(n)&&t<=e.end(n))return!0;return!1}(p,e)&&(r===0?(y.warn(`Toggle play pause to break stall`),g.pause(),g.play()):(y.warn(`Jumping ${r}s to break stall`),h=e+r)),h>0&&u!==h&&h>e&&!_){let t=h-e;if(v){let n=f.getStreamForTime(h),r=n&&!!n.getPreloaded();y.warn(`Jumping to end of stream because of gap from ${e} to ${h}. Gap duration: ${t}`),d.seek(h+l,!0,r)}else{let n=d.getIsDynamic(),r=m>0?p.end(m-1):e,i=n?1e3*Math.max(0,t-.1):0;_=window.setTimeout((()=>{d.seek(h+l,!0,!0);let e=f.getActiveStream();e&&y.warn(`Jumping gap occuring in period ${e.getStreamId()} starting at ${r} and ending at ${h}. Jumping by: ${h+l-r}`),_=null}),i)}u=h}}return n={reset:b,setConfig:function(e){e&&(e.settings&&(i=e.settings),e.playbackController&&(d=e.playbackController),e.streamController&&(f=e.streamController),e.videoModel&&(g=e.videoModel))},initialize:function(){(function(){t.on(m.default.WALLCLOCK_TIME_UPDATED,T,this),t.on(m.default.INITIAL_STREAM_SWITCH,w,this),t.on(m.default.PLAYBACK_SEEKING,x,this),t.on(m.default.BUFFER_REPLACEMENT_STARTED,S,n),t.on(m.default.TRACK_CHANGE_RENDERED,C,n)})()}},y=(0,l.default)(e).getInstance().getLogger(n),b(),n}qi.__dashjs_factory_name=`GapController`;var Ji=i.default.getSingletonFactory(qi),Yi=class extends ne{constructor(e,t){super(),this.url=e||null,this.type=t||null,this.mediaType=h.default.STREAM,this.responseType=``}};function Xi(e){e||={};let t=this.context,n=(0,p.default)(t).getInstance(),r,i=or(t).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,errors:Ne});return r={load:function(e,t,r){let o=function(i,o){t.resolved=!0,t.resolvedContent=i||null,n.trigger(m.default.XLINK_ELEMENT_LOADED,{element:t,resolveObject:r,error:i||o?null:new Be.default(Ne.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE,Ne.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE+e)})};if(e===`urn:mpeg:dash:resolve-to-zero:2013`)o(null,!0);else{let t=new Yi(e,T.HTTPRequest.XLINK_EXPANSION_TYPE);i.load({request:t,success:function(e){o(e)},error:function(){o(null)}})}},reset:function(){i&&=(i.abort(),null)}},r}Xi.__dashjs_factory_name=`XlinkLoader`;var Zi=i.default.getClassFactory(Xi);let Qi=`onLoad`;function $i(e){e||={};let t=this.context,n=(0,p.default)(t).getInstance(),r=ht(t).getInstance(),i,o,c,l;function u(e,t,n){let i,o,c={};c.elements=e,c.type=t,c.resolveType=n,c.elements.length===0&&f(c);for(let e=0;e<c.elements.length;e++)i=c.elements[e],o=r.isHTTPURL(i.url)?i.url:i.originalContent.BaseURL+i.url,l.load(o,i,c)}function d(e){let t,n,r=``;if(t=e.element,n=e.resolveObject,t.resolvedContent){let e=0;t.resolvedContent.indexOf(`<?xml`)===0&&(e=t.resolvedContent.indexOf(`?>`)+2),r=t.resolvedContent.substr(0,e)+`<response>`+t.resolvedContent.substr(e)+`</response>`,t.resolvedContent=o.parseXml(r).response}(function(e){let t,n;for(t=0;t<e.elements.length;t++)if(n=e.elements[t],!1===n.resolved)return!1;return!0})(n)&&f(n)}function f(e){let t,r,i=[];if(function(e){let t,n,r,i,l,u,d=[];for(i=e.elements.length-1;i>=0;i--){if(t=e.elements[i],n=t.type,t.resolvedContent){if(t.resolvedContent)for(l=0;l<t.resolvedContent[n].length;l++)r=t.resolvedContent[n][l],d.push(r)}else delete t.originalContent[`xlink:actuate`],delete t.originalContent[`xlink:href`],d.push(t.originalContent);for(t.parentElement[n].splice(t.index,1),u=0;u<d.length;u++)t.parentElement[n].splice(t.index+u,0,d[u]);d=[]}e.elements.length>0&&o.getIron().run(c)}(e),e.resolveType===`onActuate`&&n.trigger(m.default.XLINK_READY,{manifest:c}),e.resolveType===Qi)switch(e.type){case Y.default.PERIOD:for(t=0;t<c[Y.default.PERIOD].length;t++)r=c[Y.default.PERIOD][t],r.hasOwnProperty(Y.default.ADAPTATION_SET)&&(i=i.concat(h(r[Y.default.ADAPTATION_SET],r,Y.default.ADAPTATION_SET,Qi))),r.hasOwnProperty(Y.default.EVENT_STREAM)&&(i=i.concat(h(r[Y.default.EVENT_STREAM],r,Y.default.EVENT_STREAM,Qi)));u(i,Y.default.ADAPTATION_SET,Qi);break;case Y.default.ADAPTATION_SET:n.trigger(m.default.XLINK_READY,{manifest:c})}}function h(e,t,n,r){let i,o,c,l=[];for(o=e.length-1;o>=0;o--)i=e[o],i.hasOwnProperty(`xlink:href`)&&i[`xlink:href`]===`urn:mpeg:dash:resolve-to-zero:2013`&&e.splice(o,1);for(o=0;o<e.length;o++)i=e[o],i.hasOwnProperty(`xlink:href`)&&i.hasOwnProperty(`xlink:actuate`)&&i[`xlink:actuate`]===r&&(c=g(i[`xlink:href`],t,n,o,r,i),l.push(c));return l}function g(e,t,n,r,i,o){return{url:e,parentElement:t,type:n,index:r,resolveType:i,originalContent:o,resolvedContent:null,resolved:!1}}return i={resolveManifestOnLoad:function(e){let t;c=e,c.Period?(t=h(c.Period,c,Y.default.PERIOD,Qi),u(t,Y.default.PERIOD,Qi)):n.trigger(m.default.XLINK_READY,{manifest:c})},setParser:function(e){e&&(o=e)},reset:function(){n.off(m.default.XLINK_ELEMENT_LOADED,d,i),l&&=(l.reset(),null)}},n.on(m.default.XLINK_ELEMENT_LOADED,d,i),l=Zi(t).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,settings:e.settings}),i}$i.__dashjs_factory_name=`XlinkController`;var ea=i.default.getClassFactory($i);function ta(e){function t(e,t){for(let n in e)t.hasOwnProperty(n)||(t[n]=e[n])}function n(e,n,r){for(let i=0,o=e.length;i<o;++i){let o=e[i];if(n[o.name])if(r[o.name]){if(o.merge){let e=n[o.name],i=r[o.name];typeof e==`object`&&typeof i==`object`?t(e,i):r[o.name]=e+i}}else r[o.name]=n[o.name]}}function r(e,t){for(let i=0,o=e.children.length;i<o;++i){let o=e.children[i],c=t[o.name];if(c)for(let i=0,l=c.length;i<l;++i){let l=c[i];n(e.properties,t,l),r(o,l)}}}return{run:function(t){if(typeof t!=`object`||!t)return t;if(t.Period&&`period`in e){let n=e.period,i=t.Period;for(let t=0,o=i.length;t<o;++t){let o=i[t];if(r(n,o),`adaptationset`in e){let t=o.AdaptationSet;if(t){let n=e.adaptationset;for(let e=0,i=t.length;e<i;++e)r(n,t[e])}}}}return t}}}ta.__dashjs_factory_name=`ObjectIron`;var na=i.default.getClassFactory(ta),ra=class{constructor(e,t){this._test=e,this._converter=t}get test(){return this._test}get converter(){return this._converter}};let ia=/^([-])?P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/;var aa=class extends ra{constructor(){super(((e,t,n)=>{let r=[Y.default.MIN_BUFFER_TIME,Y.default.MEDIA_PRESENTATION_DURATION,Y.default.MINIMUM_UPDATE_PERIOD,Y.default.TIMESHIFT_BUFFER_DEPTH,Y.default.MAX_SEGMENT_DURATION,Y.default.MAX_SUBSEGMENT_DURATION,Y.default.SUGGESTED_PRESENTATION_DELAY,Y.default.START,h.default.START_TIME,Y.default.DURATION],i=r.length;for(let e=0;e<i;e++)if(t===r[e])return ia.test(n);return!1}),(e=>{let t=ia.exec(e),n=31536e3*parseFloat(t[3]||0)+2592e3*parseFloat(t[5]||0)+86400*parseFloat(t[7]||0)+3600*parseFloat(t[9]||0)+60*parseFloat(t[11]||0)+parseFloat(t[13]||0);return t[1]!==void 0&&(n=-n),n}))}};let oa=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+-])([0-9]{2})(?::?)([0-9]{2}))?/;var sa=class extends ra{constructor(){super(((e,t,n)=>oa.test(n)),(e=>{let t=oa.exec(e),n;if(n=Date.UTC(parseInt(t[1],10),parseInt(t[2],10)-1,parseInt(t[3],10),parseInt(t[4],10),parseInt(t[5],10),t[6]&&parseInt(t[6],10)||0,t[7]&&1e3*parseFloat(t[7])||0),t[9]&&t[10]){let e=60*parseInt(t[9],10)+parseInt(t[10],10);n+=(t[8]===`+`?-1:1)*e*60*1e3}return new Date(n)}))}};let ca=/^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$/,la=[Y.default.ID];var ua=class extends ra{constructor(){super(((e,t,n)=>ca.test(n)&&la.indexOf(t)===-1),(e=>parseFloat(e)))}},da=class extends ra{constructor(){super(((e,t)=>{let n={[Y.default.ADAPTATION_SET]:[Y.default.LANG],[Y.default.REPRESENTATION]:[Y.default.LANG],[Y.default.CONTENT_COMPONENT]:[Y.default.LANG],[Y.default.LABEL]:[Y.default.LANG],[Y.default.GROUP_LABEL]:[Y.default.LANG]};if(n.hasOwnProperty(e)){let r=n[e];return r!==void 0&&r.indexOf(t)>=0}return!1}),(e=>fi(e)||String(e)))}},fa=class{constructor(e){var t;this._name=e,this._merge=(t=e)&&t.length&&t.charAt(0)===t.charAt(0).toUpperCase()}get name(){return this._name}get merge(){return this._merge}},pa=class{constructor(e,t,n){this._name=e||``,this._properties=[],this._children=n||[],Array.isArray(t)&&t.forEach((e=>{this._properties.push(new fa(e))}))}get name(){return this._name}get children(){return this._children}get properties(){return this._properties}},ma=class extends pa{constructor(){let e=[Y.default.AUDIO_CHANNEL_CONFIGURATION,Y.default.AUDIO_SAMPLING_RATE,Y.default.CODECS,Y.default.CODING_DEPENDENCY,Y.default.CONTENT_PROTECTION,Y.default.FRAMERATE,Y.default.FRAME_PACKING,Y.default.HEIGHT,Y.default.INBAND_EVENT_STREAM,Y.default.MAXIMUM_SAP_PERIOD,Y.default.MAX_PLAYOUT_RATE,Y.default.MIME_TYPE,Y.default.PROFILES,Y.default.SAR,Y.default.SCAN_TYPE,Y.default.SEGMENT_PROFILES,Y.default.SEGMENT_SEQUENCE_PROPERTIES,Y.default.START_WITH_SAP,Y.default.WIDTH];super(Y.default.ADAPTATION_SET,e,[new pa(Y.default.REPRESENTATION,e,[new pa(Y.default.SUB_REPRESENTATION,e)])])}},ha=class extends pa{constructor(){let e=[Y.default.SEGMENT_BASE,Y.default.SEGMENT_TEMPLATE,Y.default.SEGMENT_LIST];super(Y.default.PERIOD,e,[new pa(Y.default.ADAPTATION_SET,e,[new pa(Y.default.REPRESENTATION,e)])])}};let ga=[Y.default.ACCESSIBILITY,Y.default.ADAPTATION_SET,Y.default.ADD,Y.default.AUDIO_CHANNEL_CONFIGURATION,Y.default.BASE_URL,Y.default.CONTENT_COMPONENT,Y.default.CONTENT_PROTECTION,Y.default.CONTENT_STEERING,Y.default.ESSENTIAL_PROPERTY,Y.default.EVENT,Y.default.EVENT_STREAM,Y.default.INBAND_EVENT_STREAM,Y.default.LABEL,Y.default.LOCATION,Y.default.METRICS,Y.default.PATCH_LOCATION,Y.default.PERIOD,Y.default.PRESELECTION,Y.default.PRODUCER_REFERENCE_TIME,Y.default.REMOVE,Y.default.REPLACE,Y.default.REPORTING,Y.default.REPRESENTATION,Y.default.ROLE,Y.default.S,Y.default.SEGMENT_SEQUENCE_PROPERTIES,Y.default.SEGMENT_URL,Y.default.SERVICE_DESCRIPTION,Y.default.SUPPLEMENTAL_PROPERTY,Y.default.UTC_TIMING];function _a(e){e||={};let t=this.context,n=e.debug,r,i,o,c;function l(e){try{let t=function(e){let t=function(e,t={}){let n=t.pos||0,r=e.length,i=!!t.keepComments,o=!!t.keepWhitespace;function c(e,t=`#text`){return{nodeName:t,nodeValue:e,attributes:{},childNodes:[]}}function l(t=``){let l=[];for(;e[n];)if(e.charCodeAt(n)==60){if(e.charCodeAt(n+1)===47){let r=n+2;if(n=e.indexOf(`>`,n),!e.startsWith(t,r)){let t=e.substring(0,n).split(`
53
+ `);throw Error(`Unexpected close tag
54
+ Line: `+(t.length-1)+`
55
+ Column: `+(t[t.length-1].length+1)+`
56
+ Char: `+e[n])}return n+1&&(n+=1),l}if(e.charCodeAt(n+1)===63){n=e.indexOf(`>`,n),n++;continue}if(e.charCodeAt(n+1)===33){if(e.charCodeAt(n+2)==45){let t=n;for(;n!==-1&&(e.charCodeAt(n)!==62||e.charCodeAt(n-1)!=45||e.charCodeAt(n-2)!=45||n==-1);)n=e.indexOf(`>`,n+1);n===-1&&(n=r),i&&l.push(c(e.substring(t,n+1),`#comment`))}else{if(e.charCodeAt(n+2)===91&&e.charCodeAt(n+8)===91&&e.startsWith(`CDATA`,n+3)){let t=e.indexOf(`]]>`,n);t==-1?(l.push(c(e.substr(n+9),`#cdata`)),n=r):(l.push(c(e.substring(n+9,t),`#cdata`)),n=t+3);continue}{let t=n+1;n+=2;let r=!1;for(;(e.charCodeAt(n)!==62||!0===r)&&e[n];)e.charCodeAt(n)===91?r=!0:!0===r&&e.charCodeAt(n)===93&&(r=!1),n++;l.push(c(e.substring(t,n),`#doctype`))}}n++;continue}let o=f();l.push(o)}else{let e=u();if(o)e.length>0&&l.push(c(e));else{let t=e.trim();t.length>0&&l.push(c(t))}n++}return l}function u(){let t=n;return n=e.indexOf(`<`,n)-1,n===-2&&(n=r),Tt(e.slice(t,n+1))}function d(){let t=n;for(;`\r
57
+ >/= `.indexOf(e[n])===-1&&e[n];)n++;return e.slice(t,n)}function f(){n++;let t=d(),r=t,i=null,o=t.indexOf(`:`);o!==-1&&(i=t.slice(0,o),r=t.slice(o+1));let c=function(){let t={};for(;e.charCodeAt(n)!==62&&e[n];){let r=e.charCodeAt(n);if(r>64&&r<91||r>96&&r<123){let r=d(),i=``,o=e.charCodeAt(n);for(;o!==39&&o!==34;)n++,o=e.charCodeAt(n);if(o===39||o===34){if(i=p(),n===-1)throw Error(`Missing closing quote`)}else n--;t[r]=Tt(i)}n++}return t}(),u=[],f=e.charCodeAt(n-1);return n++,f!==47&&(u=l(t)),{nodeName:t,nodeValue:null,attributes:c,childNodes:u,prefix:i,localName:r}}function p(){let t=e[n],r=n+1;return n=e.indexOf(t,r),e.slice(r,n)}return{nodeName:`#document`,nodeValue:null,childNodes:l(``),attributes:{}}}(e),n=t.childNodes.find((e=>e.nodeName===`MPD`||e.nodeName===`Patch`))||t.childNodes[0];return function e(t){t.nodeName.indexOf(`:`)!==-1&&(t.__prefix=t.prefix,t.nodeName=t.localName);let{childNodes:n,attributes:r,nodeName:i}=t;t.tagName=i;for(let e in r){let n=r[e];if(i===`S`)n=parseInt(n);else for(let t=0,r=o.length;t<r;t++){let r=o[t];if(r.test(i,e,n)){n=r.converter(n);break}}t[e]=n}let c=n?.length;for(let r=0;r<c;r++){let i=n[r];if(i.nodeName===`#text`){t.__text=i.nodeValue;continue}e(i);let{nodeName:o}=i;Array.isArray(t[o])?t[o].push(i):ga.indexOf(o)===-1?t[o]=i:(t[o]||(t[o]=[]),t[o].push(i))}t.__children=n}(n),n}(e);return{[t.tagName]:t}}catch{return null}}return r={getIron:function(){return c},parseXml:l,parse:function(e){let t,n=window.performance.now();if(t=l(e),!t)throw Error(`failed to parse the manifest`);t.Patch?(t=t.Patch,t.add&&t.add.forEach((e=>c.run(e))),t.replace&&t.replace.forEach((e=>c.run(e)))):(t=t.MPD,c.run(t));let r=window.performance.now();return i.info(`Parsing complete: `+(r-n).toPrecision(3)+`ms`),t.protocol=`DASH`,t}},i=n.getLogger(r),o=[new aa,new sa,new ua,new da],c=na(t).create({adaptationset:new ma,period:new ha}),r}_a.__dashjs_factory_name=`DashParser`;var va=i.default.getClassFactory(_a);function ya(e){e||={};let t=this.context,n=e.debug,r=e.settings,i=(0,p.default)(t).getInstance(),o=ht(t).getInstance(),c,l,u,d,f,g=e.mssHandler,_=e.errHandler;function v(e){i.trigger(m.default.INTERNAL_MANIFEST_LOADED,{manifest:e.manifest})}return c={load:function(e,c=null,p=null){let h=new Date,_=new Yi(e,T.HTTPRequest.MPD_TYPE);c&&(_.serviceLocation=c),p&&(_.queryParams=p),_.startDate||=h,i.trigger(m.default.MANIFEST_LOADING_STARTED,{request:_}),u.load({request:_,success:function(c,u,p){if(!d)return;let h,_,v;if(p&&p!==e?(_=o.parseBaseUrl(p),h=p):(o.isRelative(e)&&(e=o.resolve(e,window.location.href)),_=o.parseBaseUrl(e)),u!=`No Content`)if(f===null&&(f=function(e){let r=null;return e.indexOf(`SmoothStreamingMedia`)>-1?(g&&(r=g.createMssParser(),g.createMssFragmentProcessor(),g.registerEvents()),r):e.indexOf(`MPD`)>-1||e.indexOf(`Patch`)>-1?va(t).create({debug:n}):r}(c)),f!==null){d.setParser(f);try{v=f.parse(c)}catch{i.trigger(m.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new Be.default(Ne.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,Ne.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+`${e}`)});return}if(v){if(v.url=h||e,v.originalUrl||=v.url,r&&r.get().streaming.enableManifestDurationMismatchFix&&v.mediaPresentationDuration&&v.Period.length>1){let e=v.Period.reduce(((e,t)=>e+t.duration),0);!isNaN(e)&&v.mediaPresentationDuration>e&&(l.warn(`Media presentation duration greater than duration of all periods. Setting duration to total period duration`),v.mediaPresentationDuration=e)}v.baseUri=_,v.loadedTime=new Date,d.resolveManifestOnLoad(v),i.trigger(m.default.ORIGINAL_MANIFEST_LOADED,{originalManifest:c})}else i.trigger(m.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new Be.default(Ne.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,Ne.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+`${e}`)})}else i.trigger(m.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new Be.default(Ne.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,Ne.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+`${e}`)});else i.trigger(m.default.INTERNAL_MANIFEST_LOADED,{manifest:null})},error:function(t,n,r){i.trigger(m.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new Be.default(Ne.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE,Ne.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE+`${e}, ${r}`)})}})},reset:function(){i.off(m.default.XLINK_READY,v,c),g&&g.reset(),d&&=(d.reset(),null),u&&=(u.abort(),null)}},l=n.getLogger(c),i.on(m.default.XLINK_READY,v,c),u=or(t).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,urlUtils:o,constants:h.default,dashConstants:Y.default,errors:Ne,requestTimeout:e.settings.get().streaming.manifestRequestTimeout}),d=ea(t).create({errHandler:_,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,settings:e.settings}),f=null,c}ya.__dashjs_factory_name=`ManifestLoader`;var ba=i.default.getClassFactory(ya);function xa(){let e,t,n=this.context,r=(0,p.default)(n).getInstance();return e={getValue:function(){return t},setValue:function(e){t=e,e&&r.trigger(m.default.MANIFEST_LOADED,{data:e})}},e}xa.__dashjs_factory_name=`ManifestModel`;var Sa=i.default.getSingletonFactory(xa);function Ca(){let e=this.context,t=(0,u.default)(e).getInstance(),n,r,i;return n={select:function(e){if(!e||e.length===0)return null;let n=null;return t.get().streaming.applyContentSteering&&(n=function(e){let t=i.getCurrentSteeringResponseData();return t&&t.pathwayPriority&&t.pathwayPriority.length>0?function(e=[],t=[]){let n=0,i=null;for(;n<e.length;){let o=e[n],c=t.findIndex((e=>e.serviceLocation&&e.serviceLocation===o));if(c!==-1&&!r.contains(t[c].serviceLocation)){i=t[c];break}n+=1}return i}(t.pathwayPriority,e):null}(e)),n||=function(e){return e[0]}(e),n},setConfig:function(e){e.blacklistController&&(r=e.blacklistController),e.contentSteeringController&&(i=e.contentSteeringController)},reset:function(){r.reset()}},r=Fe(e).create({updateEventName:m.default.SERVICE_LOCATION_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:m.default.SERVICE_LOCATION_LOCATION_BLACKLIST_ADD}),i=ur(e).getInstance(),n}Ca.__dashjs_factory_name=`LocationSelector`;var wa=i.default.getClassFactory(Ca);function Ta(){let e=this.context,t=(0,p.default)(e).getInstance(),n=ht(e).getInstance(),r,i,o,c,u,d,f,_,v,y,b,x,S,C,w;function T(){S=NaN,_=!1,d=!0,f=!1,E()}function E(){C!==null&&(clearTimeout(C),C=null)}function D(e){E(),f||(isNaN(e)&&!isNaN(S)&&(e=1e3*S),isNaN(e)||(y.debug(`Refresh manifest in `+e+` milliseconds.`),C=setTimeout(A,e)))}function O(e=!1){_=!0;let t=x.getValue(),o=t.url;o&&=He.default.removeQueryParameterFromUrl(o,h.default.CMCD_QUERY_KEY);let c=null,l=r.getPatchLocation(t),u=v.select(l),d=null;if(u&&!e)o=u.url,c=u.serviceLocation,d=u.queryParams;else{let e=function(e){let t=r.getLocation(e),n=i.getSynthesizedLocationElements(t);return t.concat(n)}(t),n=v.select(e);n&&(o=n.url,c=n.serviceLocation,d=n.queryParams)}n.isRelative(o)&&(o=n.resolve(o,t.url)),b.load(o,c,d)}function k(e){if(e){if(r.getIsPatch(e)){let t=e;e=x.getValue();let n=r.isPatchValid(e,t),i=n;if(n){let n=r.getPublishTime(e);r.applyPatchToManifest(e,t);let o=r.getPublishTime(e);i=n.getTime()!==o.getTime()}if(!i)return y.debug(`Patch provided is invalid, performing full manifest refresh`),void O(!0);e.loadedTime=new Date}}else (e=x.getValue()).loadedTime=new Date;if(x.getValue()&&x.getValue().type===Y.default.DYNAMIC&&e.type===Y.default.STATIC)return t.trigger(m.default.DYNAMIC_TO_STATIC),_=!1,void(f=!0);x.setValue(e);let n=new Date,i=(n.getTime()-e.loadedTime.getTime())/1e3;S=r.getManifestUpdatePeriod(e,i),1e3*S>2147483647&&(S=2147483.647),t.trigger(m.default.MANIFEST_UPDATED,{manifest:e}),y.info(`Manifest has been refreshed at `+n+`[`+n.getTime()/1e3+`] `),d||D()}function A(){d||(_?D(w.get().streaming.manifestUpdateRetryInterval):O())}function j(e){if(e.error)e.error.code===Ne.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE&&c.error(e.error);else{let t=e.manifest;(function(e){(function(e){let t=o.getExternalSubtitles();if(!t||t.length===0)return;let n=e&&e.Period?e.Period.length:0;t.forEach((t=>{if(t.periodId===null&&n>1)y.warn(`External subtitle with id ${t.id} has no periodId and the MPD contains more than one period. Unable to add the external subtitle as it is not clear which period shall be used.`);else if(n===1)M(e.Period[0],t);else{let n=e.Period.find((e=>e.id===t.periodId));n?M(n,t):y.warn(`External subtitle with id ${t.id} has periodId ${t.periodId} but the MPD does not contain a period with that id. Unable to add the external subtitle.`)}}))})(e)})(t),k(t)}}function M(e,t){if(!e||!e.AdaptationSet)return e;e.AdaptationSet.push(t.serializeToMpdParserFormat())}function N(){d=!1,D()}function P(){d=!w.get().streaming.scheduling.scheduleWhilePaused,d&&E()}function F(){_=!1}return u={getIsUpdating:function(){return _},initialize:function(){T(),t.on(m.default.STREAMS_COMPOSED,F,this),t.on(g.default.PLAYBACK_STARTED,N,this),t.on(g.default.PLAYBACK_PAUSED,P,this),t.on(m.default.INTERNAL_MANIFEST_LOADED,j,this)},refreshManifest:O,reset:function(){t.off(g.default.PLAYBACK_STARTED,N,this),t.off(g.default.PLAYBACK_PAUSED,P,this),t.off(m.default.STREAMS_COMPOSED,F,this),t.off(m.default.INTERNAL_MANIFEST_LOADED,j,this),T()},setConfig:function(e){e&&(e.manifestModel&&(x=e.manifestModel),e.adapter&&(r=e.adapter),e.manifestLoader&&(b=e.manifestLoader),e.errHandler&&(c=e.errHandler),e.locationSelector&&(v=e.locationSelector),e.settings&&(w=e.settings),e.contentSteeringController&&(i=e.contentSteeringController),e.customParametersModel&&(o=e.customParametersModel))},setManifest:function(e){k(e)}},y=(0,l.default)(e).getInstance().getLogger(u),v=wa(e).create(),o=(0,Kn.default)(e).getInstance(),u}Ta.__dashjs_factory_name=`ManifestUpdater`;var Ea=i.default.getClassFactory(Ta);function Da(){let e=this.context,t=(0,p.default)(e).getInstance(),n,r,i,o,c,u,d,f,_,v,y;function b(e){if(!(e&&e.currentRepresentation&&e.currentRepresentation.mediaInfo&&e.currentRepresentation.mediaInfo.type))return;let t=e.currentRepresentation.mediaInfo.type;d[t]=e.currentRepresentation}function x(e,t){return e&&i[t]&&i[t][e]?i[t][e].list:[]}function S(e,t){return e&&i[t]&&i[t][e]?i[t][e].current:null}function C(e,n={}){if(!e||!e.streamInfo)return;let r=e.type,c=e.streamInfo.id,l=S(r,c);if(i[c]&&i[c][r]&&(i[c][r].current=e,i[c][r].current&&(r!==h.default.TEXT&&!E(e,l)||r===h.default.TEXT&&e.isFragmented)&&t.trigger(m.default.CURRENT_TRACK_CHANGED,{oldMediaInfo:l,newMediaInfo:e,switchMode:o.get().streaming.trackSwitchMode[r],options:n},{streamId:c}),!n.hasOwnProperty(`noSettingsSave`)||!n.noSettingsSave)){let t=function(e){let t={lang:e.lang,viewpoint:e.viewpoint,roles:e.roles,accessibility:e.accessibility,audioChannelConfiguration:e.audioChannelConfiguration,codec:e.codec};return t.lang||t.viewpoint||t.role&&t.role.length>0||t.accessibility&&t.accessibility.length>0||t.audioChannelConfiguration&&t.audioChannelConfiguration.length>0?t:null}(e);if(!t||!i[c][r].storeLastSettings)return;t.roles&&(t.role=t.roles[0],delete t.roles),t.accessibility&&=t.accessibility[0],t.audioChannelConfiguration&&=t.audioChannelConfiguration[0],u[r]=t,y.setSavedMediaSettings(r,t)}}function w(e,t){e&&t&&(c[e]=t)}function T(e){return e?c[e]:null}function E(e,t){if(!e&&!t)return!0;if(!e||!t||e.isPreselection!==t.isPreselection)return!1;let n=e.id===t.id,r=JSON.stringify(e.viewpoint)===JSON.stringify(t.viewpoint),i=e.lang===t.lang,o=e.codec===t.codec,c=JSON.stringify(e.roles)===JSON.stringify(t.roles),l=JSON.stringify(e.accessibility)===JSON.stringify(t.accessibility),u=JSON.stringify(e.audioChannelConfiguration)===JSON.stringify(t.audioChannelConfiguration);return n&&o&&r&&i&&c&&l&&u}function D(){i={},u={},d={},c={audio:null,video:null,text:null},t.off(g.default.REPRESENTATION_SWITCH,b,n)}function O(e,t,n){let i=[];return e.forEach((function(e){t(n,e)&&i.push(e)})),i.length!==0||t===N&&o.get().streaming.assumeDefaultRoleAsMain&&G(n.role,{schemeIdUri:h.default.DASH_ROLE_SCHEME_ID,value:Y.default.MAIN})&&(r.info(`no track with Role set to main - assuming main as default and searching again`),i=O(e,P,null),i.length!==0)?i:(r.info(`Filter-Function (`+t.name+`) resulted in no tracks; setting ignored`),e)}function k(e,t){try{return!e.lang||e.lang instanceof RegExp?t.lang.match(e.lang):t.lang!==``&&ii(t.lang,fi(e.lang)).length>0}catch{return!1}}function A(e,t){return e.index===void 0||e.index===null||t.index===e.index}function j(e,t){return e.id===void 0||e.id===null||t.id===e.id}function M(e,t){return!e.viewpoint||!!t.viewpoint.filter((function(t){return G(t,e.viewpoint)}))[0]}function N(e,t,n=!1){return!!t.roles&&(!e.role||!!t.roles.filter((function(t){return G(t,e.role)}))[0]||t.type===h.default.AUDIO&&n)}function P(e,t){return!t.roles||t.roles.length===0}function F(e,t){let n;return n=e.accessibility?!!t.accessibility.filter((function(t){return G(t,e.accessibility)}))[0]:!t.accessibility.length,n}function I(e,t){return!e.audioChannelConfiguration||!!t.audioChannelConfiguration.filter((function(t){return G(t,e.audioChannelConfiguration)}))[0]}function L(e,t){return!e.codec||e.codec===t.codec}function R(e){let t=0,n=[];return e.forEach((e=>{isNaN(e.selectionPriority)||(e.selectionPriority>t?(t=e.selectionPriority,n=[e]):e.selectionPriority===t&&n.push(e))})),n}function z(e){let t,n=0,r=[];return e.forEach((function(e){t=Math.max.apply(Math,e.bitrateList.map((function(e){return e.bandwidth}))),t>n?(n=t,r=[e]):t===n&&r.push(e)})),r}function B(e){return e[0]&&e[0].type===h.default.VIDEO?function(e){let t,n=1/0,r=[];return e.forEach((function(e){t=e.bitrateList.reduce((function(e,t){let n=Math.max(1,t.width*t.height);return e+t.bandwidth/n}),0)/e.bitrateList.length,t<n?(n=t,r=[e]):t===n&&r.push(e)})),r}(e):e[0]&&e[0].type===h.default.AUDIO?function(e){let t=1/0,n=[];return e.forEach((function(e){let r=e.audioChannelConfiguration.reduce((function(e,t){return e+(kr(t)||0)}),0)/e.audioChannelConfiguration.length;e.hasOwnProperty(`supplementalProperties`)&&e.supplementalProperties.some((e=>e.schemeIdUri===`tag:dolby.com,2018:dash:EC3_ExtensionType:2018`&&e.value===`JOC`))&&(r=16),r||=1;let i=e.bitrateList.reduce((function(e,t){return e+t.bandwidth/r}),0)/e.bitrateList.length;i<t?(t=i,n=[e]):i===t&&n.push(e)})),n}(e):e}function V(e){let t,n=0,r=[];return e.forEach((function(e){t=e.representationCount,t>n?(n=t,r=[e]):t===n&&r.push(e)})),r}function H(e,t){if(e===h.default.TEXT)return function(e){if(!e||e.length===0)return null;let t=e.filter((e=>!(e&&e.roles&&e.roles.length>0)||e.roles.every((e=>e.schemeIdUri!==h.default.DASH_ROLE_SCHEME_ID||e.value!==Y.default.FORCED_SUBTITLE))));return t.length>0?t[0]:e[0]}(t);let n,i=f.getCustomInitialTrackSelectionFunction();if(n=function(e){try{let t;return t=function(e){try{let t=e.filter((e=>{let t=e.type;return e.bitrateList.some((e=>{let n=_.getAbrBitrateParameter(`maxBitrate`,t),r=_.getAbrBitrateParameter(`minBitrate`,t);return!(n>-1&&e.bandwidth>1e3*n||r>-1&&e.bandwidth<1e3*r)}))}));return t.length>0?t:e}catch(t){return r.error(t),e}}(e),t=function(e){try{if(!o.get().streaming.abr.limitBitrateByPortal)return e;let{elementWidth:t}=v.getVideoElementSize(),n=e.filter((e=>e.type!==h.default.VIDEO||e.bitrateList.some((e=>e.width<=t))));return n.length>0?n:e}catch(t){return r.error(t),e}}(t),t}catch(t){return r.error(t),e}}(t),i&&typeof i==`function`)n=i(n);else if(d[e])n=function(e,t){if(!e||e.length===0||!t||!d[t])return e;let n=d[t].bandwidth;if(!n||isNaN(n))return e;let r={min:NaN,track:null};return e.forEach((e=>{e.bitrateList.forEach((t=>{let i=Math.abs(t.bandwidth-n);(isNaN(r.min)||i<r.min)&&(r.min=i,r.track=e)}))})),r.track?[r.track]:e}(n,e);else if(o.get().streaming.ignoreSelectionPriority||(r.info(`Trying to find track with highest selectionPriority`),n=function(e){return R(e)}(n)),n.length>1&&o.get().streaming.prioritizeRoleMain&&(r.info(`Trying to find a main track`),n=O(n,N,{role:{schemeIdUri:h.default.DASH_ROLE_SCHEME_ID,value:Y.default.MAIN}})),n.length>1){r.info(`Selecting track based on selectionModeForInitialTrack`);let e=o.get().streaming.selectionModeForInitialTrack;switch(e){case h.default.TRACK_SELECTION_MODE_HIGHEST_BITRATE:n=function(e){let t=z(e);return t.length>1&&(t=V(t)),t}(n);break;case h.default.TRACK_SELECTION_MODE_FIRST_TRACK:n=U(n);break;case h.default.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY:n=W(n);break;case h.default.TRACK_SELECTION_MODE_WIDEST_RANGE:n=function(e){let t=V(e);return t.length>1&&(t=z(e)),t}(n);break;case h.default.TRACK_SELECTION_MODE_LOWEST_STARTUP_DELAY:n=function(e){let t=e.filter((e=>!(!e.segmentSequenceProperties||e.segmentSequenceProperties.length===0)&&e.segmentSequenceProperties.some((e=>e.cadence===1&&(e.sapType===0||e.sapType===1)))));return W(t.length>0?t:e)}(n);break;default:r.warn(`Track selection mode ${e} is not supported. Falling back to TRACK_SELECTION_MODE_FIRST_TRACK`),n=U(n)}}return n.length>0?n[0]:t[0]}function U(e){return e[0]}function W(e){let t=B(e);return t.length>1&&(t=z(t)),t}function G(e,t){return!(!e||!t)&&JSON.stringify({schemeIdUri:e.schemeIdUri,value:e.value})===JSON.stringify({schemeIdUri:t.schemeIdUri,value:t.value})}return n={addTrack:function(e){if(!e)return;r.info(`addTrack with track.codec='`+e.codec+`', track.type='`+e.type+`'`);let t=e.type;if((n=t)!==h.default.AUDIO&&n!==h.default.VIDEO&&n!==h.default.TEXT&&n!==h.default.IMAGE)return;var n;let c=e.streamInfo.id;i[c]||(i[c]=function(){let e=o.get().streaming.saveLastMediaSettingsForCurrentStreamingSession;return{audio:{list:[],storeLastSettings:e,current:null},video:{list:[],storeLastSettings:e,current:null},text:{list:[],storeLastSettings:e,current:null},image:{list:[],storeLastSettings:e,current:null}}}());let l=i[c][t].list;for(let t=0,n=l.length;t<n;++t)if(E(l[t],e))return;l.push(e)},areTracksEqual:E,clearDataForStream:function(e){i[e]&&delete i[e]},getCurrentTrackFor:S,getInitialSettings:T,getTracksFor:x,getTracksWithHighestSelectionPriority:R,getTracksWithHighestBitrate:z,getTracksWithHighestEfficiency:B,getTracksWithWidestRange:V,initialize:function(){t.on(g.default.REPRESENTATION_SWITCH,b,n)},isCurrentTrack:function(e){if(!e)return!1;let t=e.type,n=e.streamInfo.id;return i[n]&&i[n][t]&&E(i[n][t].current,e)},matchSettings:function(e,t,n=!1){try{let r=!1;if(e.lang){if(e.lang instanceof RegExp)r=t.lang.match(e.lang);else if(t.lang!==``){let n=fi(e.lang);n&&(r=ii(t.lang,n).length>0)}}else r=!0;let i=e.index===void 0||e.index===null||t.index===e.index,o=!e.viewpoint||!!t.viewpoint.filter((function(t){return G(t,e.viewpoint)}))[0],c=!e.role||!!t.roles.filter((function(t){return G(t,e.role)}))[0],l=!e.accessibility||!!t.accessibility.filter((function(t){return G(t,e.accessibility)}))[0],u=!e.audioChannelConfiguration||!!t.audioChannelConfiguration.filter((function(t){return G(t,e.audioChannelConfiguration)}))[0];return r&&i&&o&&(c||t.type===h.default.AUDIO&&n)&&l&&u}catch{return!1}},matchSettingsAccessibility:F,matchSettingsAudioChannelConfig:I,matchSettingsIndex:A,matchSettingsLang:k,matchSettingsRole:N,matchSettingsViewPoint:M,reset:D,saveTextSettingsDisabled:function(){y.setSavedMediaSettings(h.default.TEXT,null)},selectInitialTrack:H,setConfig:function(e){e&&(e.domStorage&&(y=e.domStorage),e.settings&&(o=e.settings),e.customParametersModel&&(f=e.customParametersModel),e.mediaPlayerModel&&(_=e.mediaPlayerModel),e.videoModel&&(v=e.videoModel))},setInitialMediaSettingsForType:function(e,t){let n=u[e]||T(e),i=x(e,t.id),c=[];n&&Object.keys(n).length!==0||(n=y.getSavedMediaSettings(e),n&&delete n.codec,w(e,n)),i&&i.length!==0&&(c=o.get().streaming.includePreselectionsForInitialTrackSelection?Array.from(i):i.filter((e=>!e.isPreselection)),n&&(r.info(`Filtering `+c.length+` `+e+` tracks based on settings`),c=O(c,j,n),c=O(c,k,n),c=O(c,A,n),c=O(c,M,n),e===h.default.AUDIO&&u[e]||(c=O(c,N,n)),c=O(c,F,n),c=O(c,I,n),c=O(c,L,n),r.info(`Filtering `+e+` tracks ended, found `+c.length+` matching track(s).`)),c.length>1?C(H(e,c)):C(c[0]))},setInitialSettings:w,setTrack:C},r=(0,l.default)(e).getInstance().getLogger(n),D(),n}Da.__dashjs_factory_name=`MediaController`;let Oa=i.default.getSingletonFactory(Da);i.default.updateSingletonFactory(Da.__dashjs_factory_name,Oa);var ka=Oa;function Aa(){let e,t,n,r,i=this.context,o=(0,u.default)(i).getInstance();function c(e,n){return isNaN(e)?0:e>0?(n&&t.warn(`Supplied minimum playback rate is a positive value when it should be negative or 0. The supplied rate will not be applied and set to 0: 100% playback speed.`),0):e<-.5?(n&&t.warn(`Supplied minimum playback rate is out of range and will be limited to -0.5: -50% playback speed.`),-.5):e}function d(e,n){return isNaN(e)?0:e<0?(n&&t.warn(`Supplied maximum playback rate is a negative value when it should be negative or 0. The supplied rate will not be applied and set to 0: 100% playback speed.`),0):e>1?(n&&t.warn(`Supplied maximum playback rate is out of range and will be limited to 1: 200% playback speed.`),1):e}function f(){let e=p(),t=n.getLiveDelay();return!isNaN(t)&&t>0?Math.min(e,t):e}function p(){return o.get().streaming.buffer.bufferTimeDefault>0?o.get().streaming.buffer.bufferTimeDefault:m()?20:12}function m(){return o.get().streaming.buffer.fastSwitchEnabled===null?!n.getLowLatencyModeEnabled():o.get().streaming.buffer.fastSwitchEnabled}return e={getAbrBitrateParameter:function(e,t){try{let n=o.get().streaming.abr[e][t];if(!isNaN(n)&&n!==-1)return n;let i=r.getServiceDescriptionSettings();return i&&i[e]&&!isNaN(i[e][t])?i[e][t]:-1}catch{return-1}},getBufferTimeDefault:f,getBufferTimeDefaultUnadjusted:p,getCatchupMaxDrift:function(){if(!isNaN(o.get().streaming.liveCatchup.maxDrift)&&o.get().streaming.liveCatchup.maxDrift>=0)return o.get().streaming.liveCatchup.maxDrift;let e=r.getServiceDescriptionSettings();return e&&e.liveCatchup&&!isNaN(e.liveCatchup.maxDrift)&&e.liveCatchup.maxDrift>=0?e.liveCatchup.maxDrift:12},getCatchupModeEnabled:function(){return o.get().streaming.liveCatchup.enabled===null?n.getInitialCatchupModeActivated():o.get().streaming.liveCatchup.enabled},getCatchupPlaybackRates:function(e){let t=o.get().streaming.liveCatchup.playbackRate;if(!isNaN(t.min)||!isNaN(t.max))return{min:c(t.min,e),max:d(t.max,e)};let n=r.getServiceDescriptionSettings();if(n&&n.liveCatchup&&(!isNaN(n.liveCatchup.playbackRate.min)||!isNaN(n.liveCatchup.playbackRate.max))){let t=n.liveCatchup.playbackRate;return{min:c(t.min,e),max:d(t.max,e)}}return{min:-.5,max:.5}},getFastSwitchEnabled:m,getInitialBufferLevel:function(){let e=o.get().streaming.buffer.initialBufferLevel;return isNaN(e)||e<0?0:Math.min(f(),e)},getRetryAttemptsForType:function(e){let t=isNaN(o.get().streaming.retryAttempts.lowLatencyMultiplyFactor)?5:o.get().streaming.retryAttempts.lowLatencyMultiplyFactor;return n.getLowLatencyModeEnabled()?o.get().streaming.retryAttempts[e]*t:o.get().streaming.retryAttempts[e]},getRetryIntervalsForType:function(e){let t=isNaN(o.get().streaming.retryIntervals.lowLatencyReductionFactor)?10:o.get().streaming.retryIntervals.lowLatencyReductionFactor;return n.getLowLatencyModeEnabled()?o.get().streaming.retryIntervals[e]/t:o.get().streaming.retryIntervals[e]},getScheduleTimeout:function(){return n.getLowLatencyModeEnabled()?o.get().streaming.scheduling.lowLatencyTimeout:o.get().streaming.scheduling.defaultTimeout},reset:function(){},setConfig:function(e){e.playbackController&&(n=e.playbackController),e.serviceDescriptionController&&(r=e.serviceDescriptionController)}},t=(0,l.default)(i).getInstance().getLogger(e),e}Aa.__dashjs_factory_name=`MediaPlayerModel`;var ja=i.default.getSingletonFactory(Aa);function Ma(){let e=this.context,t=(0,p.default)(e).getInstance(),n,r,i,o,u,d,f,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M,N;function P(){R(),w=!1,y=0,C=0,r=0,S=!1,x=!1,o=!1,E=NaN,v=NaN,M&&(t.off(m.default.DATA_UPDATE_COMPLETED,ie,u),t.off(m.default.MANIFEST_UPDATED,Ee,u),t.off(m.default.STREAMS_COMPOSED,De,u),t.off(g.default.PLAYBACK_ENDED,be,u),t.off(g.default.STREAM_INITIALIZING,we,u),t.off(g.default.REPRESENTATION_SWITCH,Te,u),t.off(g.default.BUFFER_LEVEL_STATE_CHANGED,oe,u),re(),M.removeEventListener(`canplay`,J),M.removeEventListener(`canplaythrough`,ae),M.removeEventListener(`ended`,ve),M.removeEventListener(`error`,xe),M.removeEventListener(`loadeddata`,_e),M.removeEventListener(`loadedmetadata`,ge),M.removeEventListener(`pause`,ue),M.removeEventListener(`play`,se),M.removeEventListener(`playing`,le),M.removeEventListener(`progress`,me),M.removeEventListener(`ratechange`,he),M.removeEventListener(`seeked`,fe),M.removeEventListener(`seeking`,de),M.removeEventListener(`stalled`,Ce),M.removeEventListener(`timeupdate`,pe),M.removeEventListener(`volumechange`,ye),M.removeEventListener(`waiting`,ce)),N=null,M=null,A=null,f=null}function F(e=null){return parseFloat((I(e)-H()).toFixed(5))}function I(e){let t=e||A;return t.start+t.duration}function L(e=!1){A&&M&&M.getElement()?(e&&f&&V(H()),M.play()):w=!0}function R(){A&&M&&M.pause()}function z(e,t=!1,n=!1,r=!1){A&&M&&M.getElement()&&e!==(isNaN(E)?M.getTime():E)&&(d=!0===n,d||(E=e),b.info(`Requesting seek to time: `+e+(d?` (internal)`:``)),f&&r&&V(e),M.setCurrentTime(e,t))}function B(){if(!A||!M||!f)return;let e=k&&k.hasVideoTrack()?h.default.VIDEO:h.default.AUDIO,t=i.getCurrentDVRInfo(e);return t&&t.range?t.range.end:0}function V(e){let t=new Date(j.getClientReferenceTime()),r=n.getRegularPeriods()[0];y=j.calcPresentationTimeFromWallTime(t,r)-e}function H(){return A&&M?M.getTime():null}function U(){return A&&M?M.isPaused():null}function W(){return A&&M?M.isSeeking():null}function G(){return A&&M?M.isStalled():null}function K(){return A&&M?M.getPlaybackRate():null}function ee(){return A&&M?M.getEnded():null}function q(){return f}function te(e=null){if(U()||!f||M.getReadyState()===0||W()||S)return;e||=k.hasVideoTrack()?h.default.VIDEO:h.default.AUDIO;let t=H(),n=function(e,t){let n=i.getCurrentDVRInfo(t),r=n?n.range:null,o;return r?(o=e>r.end?Math.max(r.end-y,r.start):e>0&&e+.25<r.start&&Math.abs(e-r.start)<31536e4?x?Math.max(r.end-y,r.start):r.start:e,o):NaN}(t,e);!isNaN(n)&&n!==t&&!W()&&(G()||T||M.getReadyState()===1)&&(b.debug(`UpdateCurrentTime: Seek to actual time: ${n} from currentTime: ${t}`),z(n,!1,!1))}function ne(){N===null&&(N=setInterval((()=>{(function(){if(t.trigger(m.default.WALLCLOCK_TIME_UPDATED,{isDynamic:f,time:new Date}),q()){let e=Date.now();(isNaN(v)||e>v+O.get().streaming.liveUpdateTimeThresholdInMilliseconds)&&(k.addDVRMetric(),U()?function(){let e=Date.now();(!_||e>_+500)&&(_=e,pe())}():te(),v=e)}})()}),O.get().streaming.wallclockTimeUpdateInterval))}function re(){clearInterval(N),N=null}function ie(e){let t=e.currentRepresentation,n=t?t.mediaInfo.streamInfo:null;n!==null&&A.id===n.id&&(A=n)}function J(){t.trigger(m.default.CAN_PLAY)}function ae(){t.trigger(m.default.CAN_PLAY_THROUGH)}function oe(e){e.streamId===k.getActiveStreamInfo().id&&(T=e.state===c.BUFFER_EMPTY,O.get().streaming.buffer.setStallState&&M.setStallState(e.mediaType,e.state===c.BUFFER_EMPTY))}function se(){b.info(`Native video element event: play`),te(),ne(),t.trigger(m.default.PLAYBACK_STARTED,{startTime:H()})}function ce(){b.info(`Native video element event: waiting`),t.trigger(m.default.PLAYBACK_WAITING,{playingTime:H()})}function le(){b.info(`Native video element event: playing`),d=!1,t.trigger(m.default.PLAYBACK_PLAYING,{playingTime:H()})}function ue(){b.info(`Native video element event: pause`),t.trigger(m.default.PLAYBACK_PAUSED,{ended:ee()})}function de(){if(d)return;let e=H();isNaN(E)||E===e||(e=E),E=NaN,b.info(`Seeking to: `+e),ne(),t.trigger(m.default.PLAYBACK_SEEKING,{seekTime:e,streamId:A.id})}function fe(){b.info(`Native video element event: seeked`),d=!1,t.trigger(m.default.PLAYBACK_SEEKED,{streamId:A.id})}function pe(){A&&t.trigger(m.default.PLAYBACK_TIME_UPDATED,{timeToEnd:F(),time:H(),streamId:A.id})}function me(){t.trigger(m.default.PLAYBACK_PROGRESS,{streamId:A.id})}function he(){let e=K();b.info(`Native video element event: ratechange: `,e),t.trigger(m.default.PLAYBACK_RATE_CHANGED,{playbackRate:e})}function ge(){b.info(`Native video element event: loadedmetadata`),t.trigger(m.default.PLAYBACK_METADATA_LOADED),ne()}function _e(){b.info(`Native video element event: loadeddata`),t.trigger(m.default.PLAYBACK_LOADED_DATA)}function ve(){b.info(`Native video element event: ended`),R(),re();let e=k?k.getActiveStreamInfo():null;e&&t.trigger(m.default.PLAYBACK_ENDED,{isLast:e.isLast})}function ye(){t.trigger(m.default.PLAYBACK_VOLUME_CHANGED)}function be(e){if(N&&e.isLast){b.info(`onPlaybackEnded -- PLAYBACK_ENDED but native video element didn't fire ended`);let t=e.seekTime?e.seekTime:I();M.setCurrentTime(t),R(),re()}}function xe(e){let n=e.target||e.srcElement;t.trigger(m.default.PLAYBACK_ERROR,{error:n.error})}function Se(){f=!1}function Ce(e){t.trigger(m.default.PLAYBACK_STALLED,{e})}function we(e){var t;(t=e.mediaInfo)&&t.supplementalProperties&&t.supplementalProperties.find((e=>e.schemeIdUri===h.default.SUPPLEMENTAL_PROPERTY_DVB_LL_SCHEME))&&(b.debug(`Low Latency critical SupplementalProperty set: Enabling low Latency`),x=!0)}function Te(e){let t=k.getActiveStreamInfo();e&&t&&e.currentRepresentation&&e.streamId&&e.streamId===t.id&&e.mediaType&&(e.mediaType===h.default.VIDEO||e.mediaType===h.default.AUDIO)&&(x=!1===e.currentRepresentation.availabilityTimeComplete,x&&!o&&(o=!0))}function Ee(){S=!0}function De(){S=!1}return u={computeAndSetLiveDelay:function(e,t){let i,o,c,l=!isNaN(e)&&isFinite(e)?e:NaN,u=n.getSuggestedPresentationDelay(),d=D.getServiceDescriptionSettings();return i=isNaN(O.get().streaming.delay.liveDelay)?O.get().streaming.delay.liveDelayFragmentCount===null||isNaN(O.get().streaming.delay.liveDelayFragmentCount)||isNaN(l)?d&&!isNaN(d.liveDelay)&&d.liveDelay>0?d.liveDelay:!0===O.get().streaming.delay.useSuggestedPresentationDelay&&u!==null&&!isNaN(u)&&u>0?u:isNaN(l)?t&&!isNaN(t.minBufferTime)?4*t.minBufferTime:4*A.manifestInfo.minBufferTime:4*l:l*O.get().streaming.delay.liveDelayFragmentCount:O.get().streaming.delay.liveDelay,c=n.getAvailabilityStartTime(),c!==null&&(r=c),o=t&&t.dvrWindowSize>0?Math.min(i,t.dvrWindowSize):i,y=o,C=o,o},getAvailabilityStartTime:function(){return r},getBufferLevel:function(e=null){let t=null;return k.getActiveStreamProcessors().forEach((n=>{if(!e||e.length===0||e.indexOf(n.getType())===-1){let e=n.getBufferLevel();t=t===null?e:Math.min(t,e)}})),t},getCurrentLiveLatency:function(){if(!f||isNaN(r))return NaN;let e=H();if(isNaN(e)||e===0)return 0;let t=new Date().getTime()+1e3*j.getClientTimeOffset();return Math.max(((t-r-1e3*e)/1e3).toFixed(3),0)},getEnded:ee,getInitialCatchupModeActivated:function(){return o},getIsDynamic:q,getIsManifestUpdateInProgress:function(){return S},getLiveDelay:function(){return y},getLowLatencyModeEnabled:function(){return x},getOriginalLiveDelay:function(){return C},getPlaybackRate:K,getPlaybackStalled:function(){return T},getPlayedRanges:function(){return A&&M?M.getPlayedRanges():null},getStreamController:function(){return k},getStreamEndTime:I,getTime:H,getTimeToStreamEnd:F,initialize:function(e,n){A=e,!0!==n&&(M.addEventListener(`canplay`,J),M.addEventListener(`canplaythrough`,ae),M.addEventListener(`ended`,ve),M.addEventListener(`error`,xe),M.addEventListener(`loadeddata`,_e),M.addEventListener(`loadedmetadata`,ge),M.addEventListener(`pause`,ue),M.addEventListener(`play`,se),M.addEventListener(`playing`,le),M.addEventListener(`progress`,me),M.addEventListener(`ratechange`,he),M.addEventListener(`seeked`,fe),M.addEventListener(`seeking`,de),M.addEventListener(`stalled`,Ce),M.addEventListener(`timeupdate`,pe),M.addEventListener(`volumechange`,ye),M.addEventListener(`waiting`,ce),f=A.manifestInfo.isDynamic,T=!1,d=!1,t.on(m.default.DATA_UPDATE_COMPLETED,ie,u),t.on(m.default.MANIFEST_UPDATED,Ee,u),t.on(m.default.STREAMS_COMPOSED,De,u),t.on(g.default.PLAYBACK_ENDED,be,u,{priority:p.default.EVENT_PRIORITY_HIGH}),t.on(g.default.STREAM_INITIALIZING,we,u),t.on(g.default.REPRESENTATION_SWITCH,Te,u),t.on(g.default.BUFFER_LEVEL_STATE_CHANGED,oe,u),t.on(g.default.DYNAMIC_TO_STATIC,Se,u),w&&(w=!1,L()))},isPaused:U,isProgressing:function(e=500){return new Promise((n=>{let r=-1,i=null,o=e=>{clearTimeout(i),i=null,t.off(g.default.PLAYBACK_TIME_UPDATED,c,u),n(e)},c=e=>{r<0?r=e.time:e.time>r+.1&&o(!0)};i=setTimeout((()=>{o(!1)}),e),t.on(g.default.PLAYBACK_TIME_UPDATED,c,u)}))},isSeeking:W,isStalled:G,pause:R,play:L,reset:P,seek:z,seekToCurrentLive:function(e=!1,t=!1,n=!1){let r=B();r!==0&&z(r-y,e,t,n)},seekToOriginalLive:function(e=!1,t=!1,n=!1){let r=B();r!==0&&(y=C,z(r-y,e,t,n))},setConfig:function(e){e&&(e.streamController&&(k=e.streamController),e.serviceDescriptionController&&(D=e.serviceDescriptionController),e.dashMetrics&&(i=e.dashMetrics),e.adapter&&(n=e.adapter),e.videoModel&&(M=e.videoModel),e.timelineConverter&&(j=e.timelineConverter),e.settings&&(O=e.settings))},updateCurrentTime:te},b=(0,l.default)(e).getInstance().getLogger(u),P(),u}Ma.__dashjs_factory_name=`PlaybackController`;var Na=i.default.getSingletonFactory(Ma),Pa=class{constructor(){this.availabilityEndTime=NaN,this.availabilityStartTime=NaN,this.duration=NaN,this.index=null,this.indexRange=null,this.isPartialSegment=!1,this.media=null,this.mediaRange=null,this.mediaUrl=null,this.mediaStartTime=NaN,this.presentationStartTime=NaN,this.replacementNumber=NaN,this.replacementTime=null,this.representation=null,this.wallStartTime=NaN}assignAttributes(e){for(let t in e)e.hasOwnProperty(t)&&this.hasOwnProperty(t)&&(this[t]=e[t])}},Fa=class extends Pa{constructor(){super()}};function Ia(){let e=this.context,t,n,r,i,o,c,l,u,d,f,p,m;function h(e,t,r,o){let c=null,u=e?m.resolve(e.path):null,d=o||{init:!0,url:u?u.url:void 0,range:{start:0,end:1500},searching:!1,bytesLoaded:0,bytesToLoad:1500,mediaType:t,representation:e};n.debug(`Start searching for initialization.`);let f=v(d);l.load({request:f,success:function(n){if(d.bytesLoaded=d.range.end,c=i.findInitRange(n),!c)return d.range.end=d.bytesLoaded+d.bytesToLoad,h(e,t,r,d);e.range=c,r(e)},error:function(){r(e)}}),n.debug(`Perform init search: `+d.url)}function g(e,t,r,o,c,u){if(r&&(r.start===void 0||r.end===void 0)){let e=r?r.toString().split(`-`):null;r=e?{start:parseFloat(e[0]),end:parseFloat(e[1])}:null}c||=_;let d=null,f=null,p=!!r,h=e?m.resolve(e.path):null,y={init:!1,url:h?h.url:void 0,range:p?r:{start:0,end:1500},searching:!p,bytesLoaded:u?u.bytesLoaded:0,bytesToLoad:1500,mediaType:t,representation:e},b=v(y);l.load({request:b,success:function(r){let l=y.bytesToLoad,u=r.byteLength;if(y.bytesLoaded=y.range.end-y.range.start,d=i.parse(r),f=d.getBox(`sidx`),f&&f.isComplete){let r=f.references,i,l;if(r!=null&&r.length>0&&(i=r[0].reference_type===1),i){let i,l,u,d,p;n.debug(`Initiate multiple SIDX load.`),y.range.end=y.range.start+f.size;let m=[],h=0,_=(f.offset||y.range.start)+f.size,v=function(t){t?(m=m.concat(t),h++,h>=l&&(m.sort((function(e,t){return e.startTime-t.startTime<0?-1:0})),c(m,e,o))):c(null,e,o)};for(i=0,l=r.length;i<l;i++)u=_,d=_+r[i].referenced_size-1,_+=r[i].referenced_size,p={start:u,end:d},g(e,t,p,o,v,y)}else n.debug(`Parsing segments from SIDX. representation `+t+` - id: `+e.id+` for range : `+y.range.start+` - `+y.range.end),l=function(e,t){let n=e.references,r=n.length,i=e.timescale,o=e.earliest_presentation_time,c=t.range.start+e.offset+e.first_offset+e.size,l=[],u,d,f,p;for(let e=0;e<r;e++)f=n[e].subsegment_duration,p=n[e].referenced_size,u=new Fa,u.duration=f,u.startTime=o,u.timescale=i,d=c+p-1,u.mediaRange=c+`-`+d,l.push(u),o+=f,c+=p;return l}(f,y),c(l,e,o)}else{if(f)y.range.start=f.offset||y.range.start,y.range.end=y.range.start+(f.size||l);else{if(u<y.bytesLoaded)return void c(null,e,o);{let e=d.getLastBox();e&&e.size?(y.range.start=e.offset+e.size,y.range.end=y.range.start+l):y.range.end+=l}}g(e,t,y.range,o,null,y)}},error:function(){c(null,e,o)}}),n.debug(`Perform SIDX load for type ${t} : ${y.url} with range ${y.range.start} - ${y.range.end}`)}function _(e,t,n){n({segments:e,representation:t,error:e?void 0:new Be.default(u.SEGMENT_BASE_LOADER_ERROR_CODE,u.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}function v(e){if(!e.url)return;let t=new ne;return t.setInfo(e),t}return t={setConfig:function(e){e.baseURLController&&(m=e.baseURLController),e.dashMetrics&&(o=e.dashMetrics),e.mediaPlayerModel&&(c=e.mediaPlayerModel),e.errHandler&&(r=e.errHandler),e.boxParser&&(i=e.boxParser),e.debug&&(n=e.debug.getLogger(t)),e.errors&&(u=e.errors),e.urlUtils&&(p=e.urlUtils),e.constants&&(d=e.constants),e.dashConstants&&(f=e.dashConstants)},initialize:function(){l=or(e).create({errHandler:r,dashMetrics:o,mediaPlayerModel:c,boxParser:i,errors:u,urlUtils:p,constants:d,dashConstants:f})},loadInitialization:function(e,t){return new Promise((n=>{h(e,t,n)}))},loadSegments:function(e,t,n){return new Promise((r=>{g(e,t,n,r)}))},reset:function(){l&&=(l.abort(),null)}},t}Ia.__dashjs_factory_name=`SegmentBaseLoader`;var La=i.default.getSingletonFactory(Ia);function Ra(e){let t;e||={};let n=new DataView(e.data),r=0;function i(e,t){let i,o,c=!0,l=0;if(t===void 0&&(t=!1),e.tag>16777215?(n.getUint32(r)!==e.tag&&(c=!1),l=4):e.tag>65535?(i=n.getUint16(r),o=n.getUint8(r+2),256*i+o!==e.tag&&(c=!1),l=3):e.tag>255?(n.getUint16(r)!==e.tag&&(c=!1),l=2):(n.getUint8(r)!==e.tag&&(c=!1),l=1),!c&&e.required&&!t)throw Error(`required tag not found`);return c&&(r+=l),c}function o(e){let t=1,i=128,o=-1,c=0,l=n.getUint8(r),u=0;for(u=0;u<8;u+=1){if((l&i)===i){c=e===void 0?l&~i:l,o=u;break}i>>=1}for(u=0;u<o;u+=1,t+=1)c=c<<8|255&n.getUint8(r+t);return r+=t,c}return t={getPos:function(){return r},setPos:function(e){r=e},consumeTag:i,consumeTagAndSize:function(e,t){let n=i(e,t);return n&&o(),n},parseTag:function(e){let n;return i(e),n=o(),t[e.parse](n)},skipOverElement:function(e,t){let n,c=i(e,t);return c&&(n=o(),r+=n),c},getMatroskaCodedNum:o,getMatroskaFloat:function(e){let t;switch(e){case 4:t=n.getFloat32(r),r+=4;break;case 8:t=n.getFloat64(r),r+=8}return t},getMatroskaUint:function(e){if(e>4)return function(e){let t=Math.floor((2**53-1)/256),i=0;for(let o=0;o<e;o+=1){if(i>t)throw Error(`Value exceeds safe integer limit`);i*=256;let e=n.getUint8(r+o);if(i>2**53-1-e)throw Error(`Value exceeds safe integer limit`);i+=e}return r+=e,i}(e);let t=0;for(let i=0;i<e;i+=1)t<<=8,t|=255&n.getUint8(r+i);return r+=e,t>>>0},moreData:function(){return r<n.byteLength}},t}Ra.__dashjs_factory_name=`EBMLParser`;var za=i.default.getClassFactory(Ra);function Ba(){let e=this.context,t,n,r,i,o,c,l,u,d;function f(e){let t=new ne;return t.setInfo(e),t}return t={setConfig:function(e){if(!(e.baseURLController&&e.dashMetrics&&e.mediaPlayerModel&&e.errHandler))throw Error(h.default.MISSING_CONFIG_ERROR);d=e.baseURLController,o=e.dashMetrics,c=e.mediaPlayerModel,i=e.errHandler,u=e.errors,n=e.debug.getLogger(t)},initialize:function(){l=or(e).create({errHandler:i,dashMetrics:o,mediaPlayerModel:c,errors:u})},loadInitialization:function(e,t){return new Promise((r=>{let i=null,o=e?d.resolve(e.path):null,c=e?e.range.split(`-`):null,u={range:{start:c?parseFloat(c[0]):null,end:c?parseFloat(c[1]):null},request:i,url:o?o.url:void 0,init:!0,mediaType:t};n.info(`Start loading initialization.`),i=f(u),l.load({request:i,success:function(){r(e)},error:function(){r(e)}}),n.debug(`Perform init load: `+u.url)}))},loadSegments:function(t,i,o){return new Promise((c=>{let p=null,m=t?d.resolve(t.path):null,h=m?m.url:void 0;p=f({bytesLoaded:0,bytesToLoad:8192,range:{start:0,end:8192},request:p,url:h,init:!1,mediaType:i,representation:t}),n.debug(`Parsing ebml header`),l.load({request:p,success:function(i){(function(t,i,o,c){if(!t||t.byteLength===0)return void c(null);let u,d,p,m,h=za(e).create({data:t}),g=o?o.split(`-`):null,_=null,v={url:i,range:{start:g?parseFloat(g[0]):null,end:g?parseFloat(g[1]):null},request:_};for(n.debug(`Parse EBML header: `+v.url),h.skipOverElement(r.EBML),h.consumeTag(r.Segment),p=h.getMatroskaCodedNum(),p+=h.getPos(),m=h.getPos();h.moreData()&&!h.consumeTagAndSize(r.Segment.Info,!0);)if(!(h.skipOverElement(r.Segment.SeekHead,!0)||h.skipOverElement(r.Segment.Tracks,!0)||h.skipOverElement(r.Segment.Cues,!0)||h.skipOverElement(r.Void,!0)))throw Error(`no valid top level element found`);for(;u===void 0;){let e=h.getMatroskaCodedNum(!0),t=h.getMatroskaCodedNum();e===r.Segment.Info.Duration.tag?u=h[r.Segment.Info.Duration.parse](t):h.setPos(h.getPos()+t)}_=f(v),l.load({request:_,success:function(t){d=function(t,i,o,c){let l,u,d,f,p,m,h,g;for(u=function(t){let n,i,o=[],c=za(e).create({data:t});for(c.consumeTagAndSize(r.Segment.Cues);c.moreData()&&c.consumeTagAndSize(r.Segment.Cues.CuePoint,!0);){for(n={},n.CueTime=c.parseTag(r.Segment.Cues.CuePoint.CueTime),n.CueTracks=[];c.moreData()&&c.consumeTag(r.Segment.Cues.CuePoint.CueTrackPositions,!0);){let e=c.getMatroskaCodedNum(),t=c.getPos();if(i={},i.Track=c.parseTag(r.Segment.Cues.CuePoint.CueTrackPositions.CueTrack),i.Track===0)throw Error(`Cue track cannot be 0`);i.ClusterPosition=c.parseTag(r.Segment.Cues.CuePoint.CueTrackPositions.CueClusterPosition),n.CueTracks.push(i),c.setPos(t+e)}if(n.CueTracks.length===0)throw Error(`Mandatory cuetrack not found`);o.push(n)}if(o.length===0)throw Error(`mandatory cuepoint not found`);return o}(t),d=[],p=0,m=u.length;p<m;p+=1)f=new Fa,l=0,l=p<u.length-1?u[p+1].CueTime-u[p].CueTime:c-u[p].CueTime,f.duration=l,f.startTime=u[p].CueTime,f.timescale=1e3,h=u[p].CueTracks[0].ClusterPosition+i,g=p<u.length-1?u[p+1].CueTracks[0].ClusterPosition+i-1:o-1,f.mediaRange=h+`-`+g,d.push(f);return n.debug(`Parsed cues: `+d.length+` cues.`),d}(t,m,p,u),c(d)},error:function(){n.error(`Download Error: Cues `+v.url),c(null)}}),n.debug(`Perform cues load: `+v.url+` bytes=`+v.range.start+`-`+v.range.end)})(i,h,o,(function(e){c({segments:e,representation:t,error:e?void 0:new Be.default(u.SEGMENT_BASE_LOADER_ERROR_CODE,u.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}))},error:function(){c({representation:t,error:new Be.default(u.SEGMENT_BASE_LOADER_ERROR_CODE,u.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}})}))},reset:function(){l&&=(l.abort(),null)}},r={EBML:{tag:440786851,required:!0},Segment:{tag:408125543,required:!0,SeekHead:{tag:290298740,required:!0},Info:{tag:357149030,required:!0,TimecodeScale:{tag:2807729,required:!0,parse:`getMatroskaUint`},Duration:{tag:17545,required:!0,parse:`getMatroskaFloat`}},Tracks:{tag:374648427,required:!0},Cues:{tag:475249515,required:!0,CuePoint:{tag:187,required:!0,CueTime:{tag:179,required:!0,parse:`getMatroskaUint`},CueTrackPositions:{tag:183,required:!0,CueTrack:{tag:247,required:!0,parse:`getMatroskaUint`},CueClusterPosition:{tag:241,required:!0,parse:`getMatroskaUint`}}}}},Void:{tag:236,required:!0}},t}Ba.__dashjs_factory_name=`WebmSegmentBaseLoader`;var Va=i.default.getSingletonFactory(Ba);function Ha(e){e||={};let t=this.context,n=e.eventBus,r=e.events,i=e.dashMetrics,o=e.mediaPlayerModel,c=e.errHandler,l=e.baseURLController,u=e.debug,d=e.boxParser,f=e.errors,p,m,h;function g(e){return(e?e.split(`/`)[1]:``).toLowerCase()===`webm`}return p={initialize:function(){m.initialize(),h.initialize()},getSegmentBaseInitSegment:function(e){return g(e.representation.mimeType)?h.loadInitialization(e.representation,e.mediaType):m.loadInitialization(e.representation,e.mediaType)},getSegmentList:function(e){return g(e.mimeType)?h.loadSegments(e.representation,e.mediaType,e.representation?e.representation.indexRange:null):m.loadSegments(e.representation,e.mediaType,e.representation?e.representation.indexRange:null)},reset:function(){m.reset(),h.reset()}},m=La(t).getInstance(),h=Va(t).getInstance(),m.setConfig({baseURLController:l,dashMetrics:i,mediaPlayerModel:o,errHandler:c,eventBus:n,events:r,errors:f,debug:u,boxParser:d}),h.setConfig({baseURLController:l,dashMetrics:i,mediaPlayerModel:o,errHandler:c,eventBus:n,events:r,errors:f,debug:u}),p}Ha.__dashjs_factory_name=`SegmentBaseController`;var Ua=i.default.getSingletonFactory(Ha);let Wa=[h.default.SERVICE_DESCRIPTION_DVB_LL_SCHEME],Ga=`video`,Ka=`audio`;function qa(){let e=this.context,t,n,r,i,o;function c(){n={liveDelay:NaN,liveCatchup:{maxDrift:NaN,playbackRate:{min:NaN,max:NaN}},minBitrate:{},maxBitrate:{},initialBitrate:{},contentSteering:null,clientDataReporting:null},r=[]}function u(e,t,r){try{n[e][t]=r/1e3}catch(e){i.error(e)}}return t={getServiceDescriptionSettings:function(){return n},getProducerReferenceTimeOffsets:function(){return r},calculateProducerReferenceTimeOffsets:function(e){try{let t=[];if(e&&e.length>0){let n=[h.default.VIDEO,h.default.AUDIO,h.default.TEXT],r=o.getAvailabilityStartTime()/1e3;e.forEach((e=>{let i=n.reduce(((t,n)=>t.concat(o.getAllMediaInfoForType(e,n))),[]).reduce(((t,n)=>(o.getProducerReferenceTimes(e,n).forEach((i=>{let c=o.getVoRepresentations(n);if(c&&c.length>0&&c[0].adaptation&&c[0].segmentInfoType===Y.default.SEGMENT_TEMPLATE){let n=c[0],o=r-(new Date(i[Y.default.WALL_CLOCK_TIME]).getTime()/1e3-(i[Y.default.PRESENTATION_TIME]/n[Y.default.TIMESCALE]-n[Y.default.PRESENTATION_TIME_OFFSET]+e.start));t.push({id:i[Y.default.ID],to:o})}})),t)),[]);t=t.concat(i)}))}r=t}catch(e){i.error(e),r=[]}},applyServiceDescription:function(e){if(!e||!e.serviceDescriptions)return;let t=e.serviceDescriptions.filter((e=>Wa.includes(e.schemeIdUri))),o=e.serviceDescriptions.filter((e=>e.schemeIdUri==null)),c=t.length>0?t[t.length-1]:o[o.length-1];c&&(c.latency&&c.latency.target>0&&function(e){let t;if(e.schemeIdUri,h.default.SERVICE_DESCRIPTION_DVB_LL_SCHEME,t=function(e){return{liveDelay:e.latency.target/1e3,maxDrift:!isNaN(e.latency.max)&&e.latency.max>e.latency.target?(e.latency.max-e.latency.target+500)/1e3:NaN,referenceId:e.latency.referenceId||NaN}}(e),r.length>0){let{to:e,id:o}=function(e){let t,n=0,i=r.filter((t=>t.id===e.referenceId));return i.length===0?(n=r.length>0?r[0].to:0,t=r[0].id||NaN):(n=i[0].to||0,t=i[0].id||NaN),{to:n,id:t}}(t);n.liveDelay=t.liveDelay-e,n.liveCatchup.maxDrift=t.maxDrift,i.debug(`\n Found latency properties coming from service description. Applied time offset of ${e} from ProducerReferenceTime element with id ${o}.\n Live Delay: ${t.liveDelay-e}, Live catchup max drift: ${t.maxDrift}\n `)}else n.liveDelay=t.liveDelay,n.liveCatchup.maxDrift=t.maxDrift,i.debug(`Found latency properties coming from service description: Live Delay: ${t.liveDelay}, Live catchup max drift: ${t.maxDrift}`)}(c),c.playbackRate&&function(e){let t=e.playbackRate.min?Math.round(1e3*(e.playbackRate.min-1))/1e3:NaN,r=e.playbackRate.max?Math.round(1e3*(e.playbackRate.max-1))/1e3:NaN;n.liveCatchup.playbackRate.min=t,n.liveCatchup.playbackRate.max=r,i.debug(`Found latency properties coming from service description: Live catchup min playback rate: ${t}`),i.debug(`Found latency properties coming from service description: Live catchup max playback rate: ${r}`)}(c),c.operatingQuality,c.operatingBandwidth&&function(e){if(!e||!e.operatingBandwidth||!e.operatingBandwidth.mediaType||e.operatingBandwidth.mediaType===`all`)return;let t={};t.minBandwidth=e.operatingBandwidth.min,t.maxBandwidth=e.operatingBandwidth.max,t.targetBandwidth=e.operatingBandwidth.target;let n=[];e.operatingBandwidth.mediaType===Ga||e.operatingBandwidth.mediaType===Ka?n.push(e.operatingBandwidth.mediaType):e.operatingBandwidth.mediaType===`any`&&(n.push(Ka),n.push(Ga)),n.forEach((e=>{isNaN(t.minBandwidth)||u(`minBitrate`,e,t.minBandwidth),isNaN(t.maxBandwidth)||u(`maxBitrate`,e,t.maxBandwidth),isNaN(t.targetBandwidth)||u(`initialBitrate`,e,t.targetBandwidth)}))}(c),c.contentSteering&&function(e){n.contentSteering=e.contentSteering}(c),c.clientDataReporting&&function(e){n.clientDataReporting=e.clientDataReporting}(c))},reset:function(){c()},setConfig:function(e){e&&e.adapter&&(o=e.adapter)}},i=(0,l.default)(e).getInstance().getLogger(t),c(),t}qa.__dashjs_factory_name=`ServiceDescriptionController`;var Ja=i.default.getSingletonFactory(qa);class Ya{constructor(e){this._ranges=[];for(let t of e){let e=this._ranges,n={start:t.start,end:t.end},r=e.length?e[e.length-1]:null;!r||n.start>r.end?e.push(n):r.end=n.end}}get length(){return this._ranges.length}start(e){return this._ranges[e].start}end(e){return this._ranges[e].end}}var Xa=class{constructor(e,t){this.eventBus=t,this.mimeType=e,this.updating=!1,this.chunks=[],this.appendWindowStart=0,this.appendWindowEnd=1/0,this.timestampOffset=0,this.mode=`segments`}appendBuffer(e,t,n){if(this.updating)throw Error(`SourceBuffer is currently updating`);this.updating=!0,this.eventBus.trigger(`externalSourceBufferUpdateStart`,{mimeType:this.mimeType,request:`appendBuffer`,data:e,start:t,end:n}),Number.isNaN(t)||(this.chunks.push({data:e,start:t,end:n}),this.chunks.sort(((e,t)=>e.start-t.start))),setTimeout((()=>{this.updating=!1,this.eventBus.trigger(`externalSourceBufferUpdating`,{mimeType:this.mimeType}),this.eventBus.trigger(`externalSourceBufferUpdateEnd`,{mimeType:this.mimeType})}),10)}abort(){this.updating&&(this.updating=!1,this.eventBus.trigger(`externalSourceBufferAbort`,{mimeType:this.mimeType}),this.eventBus.trigger(`externalSourceBufferUpdateEnd`,{mimeType:this.mimeType}))}remove(e,t){if(this.updating)throw Error(`SourceBuffer is currently updating`);this.updating=!0,this.eventBus.trigger(`externalSourceBufferUpdateStart`,{mimeType:this.mimeType,request:`remove`,start:e,end:t}),this.chunks=this.chunks.filter((n=>n.end<=e||n.start>=t)),setTimeout((()=>{this.updating=!1,this.eventBus.trigger(`externalSourceBufferUpdating`,{mimeType:this.mimeType}),this.eventBus.trigger(`externalSourceBufferUpdateEnd`,{mimeType:this.mimeType})}),10)}get buffered(){return new Ya(this.chunks)}},Za=class{constructor(e){this.eventBus=e,this.reset()}get duration(){return this._duration}set duration(e){if(this._readyState!==`open`)throw Error(`ExternalMediaSource is not open`);this._duration=e}get readyState(){return this._readyState}addSourceBuffer(e){if(this._readyState!==`open`)throw Error(`ExternalMediaSource is not open`);let t=new Xa(e,this.eventBus);return this.sourceBuffers.set(t,e),t}removeSourceBuffer(e){if(!this.sourceBuffers.has(e))throw Error(`ExternalSourceBuffer not found`);this.sourceBuffers.delete(e)}open(){this._readyState=`open`,this.eventBus.trigger(`externalMediaSourceOpen`,{})}endOfStream(){if(this._readyState!==`open`)throw Error(`ExternalMediaSource is not open`);this._readyState=`ended`,this.eventBus.trigger(`externalMediaSourceEnded`,{})}close(){this._readyState=`closed`,this.eventBus.trigger(`externalMediaSourceClosed`,{})}reset(){this.sourceBuffers=new Map,this._duration=NaN,this._readyState=`closed`}},Qa=class{constructor(){this.streamId=null,this.segmentType=null,this.index=NaN,this.bytes=null,this.start=NaN,this.end=NaN,this.duration=NaN,this.representation=null,this.endFragment=null}},$a=class extends ne{constructor(e){super(e),this.checkForExistenceOnly=!0}};function eo(e){e||={};let t=this.context,n=e.eventBus,r=e.events,i=e.urlUtils,o=e.errors,c=e.streamId,l,u;return l={abort:function(){u&&u.abort()},checkForExistence:function(e){let t=function(t){n.trigger(r.CHECK_FOR_EXISTENCE_COMPLETED,{request:e,exists:t})};if(e){let n=new $a(e.url);u.load({request:n,success:function(){t(!0)},error:function(){t(!1)}})}else t(!1)},load:function(e){let t=function(t,i){n.trigger(r.LOADING_COMPLETED,{request:e,response:t||null,error:i||null,sender:l})};e?u.load({request:e,progress:function(t){n.trigger(r.LOADING_PROGRESS,{request:e,stream:t.stream,streamId:c}),t.data&&n.trigger(r.LOADING_DATA_PROGRESS,{request:e,response:t.data||null,error:null,sender:l})},success:function(e){t(e)},error:function(e,n,r){t(void 0,new Be.default(o.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE,r,n))},abort:function(e){e&&n.trigger(r.LOADING_ABANDONED,{mediaType:e.mediaType,request:e,sender:l})}}):t(void 0,new Be.default(o.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE,o.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE))},reset:function(){u&&=(u.abort(),u.reset(),null)},resetInitialSettings:function(){u&&u.resetInitialSettings()}},u=or(t).create({errHandler:e.errHandler,errors:o,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,urlUtils:i,constants:h.default,boxParser:e.boxParser,dashConstants:e.dashConstants,requestTimeout:e.settings.get().streaming.fragmentRequestTimeout}),l}eo.__dashjs_factory_name=`FragmentLoader`;var to=i.default.getClassFactory(eo);function no(e){e||={};let t=this.context,n=(0,p.default)(t).getInstance(),r=e.errHandler,i=e.mediaPlayerModel,o=e.dashMetrics,c=(0,l.default)(t).getInstance(),u=e.streamInfo,d,f,_;function v(){return u.id}function y(){for(let e in _)_[e].reset();_={}}function b(e){if(!e.sender)return;let t=e.request,r=e.response,i=t.isInitializationRequest(),o=t.representation.mediaInfo.streamInfo;if(e.error&&(t.mediaType===h.default.AUDIO||t.mediaType===h.default.VIDEO||t.mediaType===h.default.TEXT&&t.representation.mediaInfo.isFragmented)&&n.trigger(m.default.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD,{entry:e.request.serviceLocation}),!r||!o)return void f.warn(`No `+t.mediaType+` bytes to push or stream is inactive.`);let c=function(e,t,n,r){let i=new Qa;return i.streamId=n,i.segmentType=t.type,i.start=t.startTime,i.duration=t.duration,i.end=i.start+i.duration,i.bytes=e,i.index=t.index,i.representation=t.representation,i.endFragment=r,i}(r,t,u.id,e.type!==m.default.FRAGMENT_LOADING_PROGRESS);n.trigger(i?m.default.INIT_FRAGMENT_LOADED:m.default.MEDIA_FRAGMENT_LOADED,{chunk:c,request:t},{streamId:o.id,mediaType:t.mediaType})}return d={getStreamId:v,getModel:function(l){let d=_[l];return d||(d=se(t).create({streamInfo:u,type:l,dashMetrics:o,fragmentLoader:to(t).create({dashMetrics:o,mediaPlayerModel:i,errHandler:r,settings:e.settings,boxParser:e.boxParser,eventBus:n,events:m.default,errors:Ne,dashConstants:e.dashConstants,urlUtils:e.urlUtils,streamId:v()}),debug:c,eventBus:n,events:m.default}),_[l]=d),d},reset:function(){n.off(g.default.FRAGMENT_LOADING_COMPLETED,b,this),n.off(g.default.FRAGMENT_LOADING_PROGRESS,b,this),y()}},f=c.getLogger(d),y(),n.on(g.default.FRAGMENT_LOADING_COMPLETED,b,d),n.on(g.default.FRAGMENT_LOADING_PROGRESS,b,d),d}no.__dashjs_factory_name=`FragmentController`;var ro=i.default.getClassFactory(no),io=class{constructor(e){this.newMediaInfo=e.newMediaInfo,this.previouslySelectedRepresentation=e.previouslySelectedRepresentation,this.newRepresentation=e.newRepresentation}};function ao(e){let t=this.context,n=(0,u.default)(t).getInstance(),r=e.textController,i=e.eventBus,o,c,d,f,p,g,_=[],v=[],y=!1,b=e.mediaSource,x=null;function S(e){return e.mimeType+`;codecs="`+e.codecs+`"`}function C(e){return f=r.getTextSourceBuffer(e),Promise.resolve()}function w(){if(typeof f.addEventListener==`function`)try{f.addEventListener(`updateend`,j,!1),f.addEventListener(`error`,M,!1),f.addEventListener(`abort`,M,!1)}catch{g=setInterval(j,50)}else g=setInterval(j,50)}function E(){try{typeof f.removeEventListener==`function`&&(f.removeEventListener(`updateend`,j,!1),f.removeEventListener(`error`,M,!1),f.removeEventListener(`abort`,M,!1)),clearInterval(g)}catch(e){d.error(e)}}function D(e){return new Promise((t=>{f&&n.get().streaming.buffer.useAppendWindow?N((()=>{try{if(!f)return void t();let n=b.duration,r=0;e&&!isNaN(e.start)&&!isNaN(e.duration)&&isFinite(e.duration)&&(n=e.start+e.duration),e&&!isNaN(e.start)&&(r=e.start),f.appendWindowEnd===n&&f.appendWindowStart===r||(f.appendWindowStart=0,f.appendWindowEnd=n+.01,f.appendWindowStart=Math.max(r-.1,0),d.debug(`Updated append window for ${p.type}. Set start to ${f.appendWindowStart} and end to ${f.appendWindowEnd}`)),t()}catch{d.warn(`Failed to set append window`),t()}})):t()}))}function O(e){return new Promise((t=>{f?N((()=>{try{f.timestampOffset===e||isNaN(e)||(f.timestampOffset=e,d.debug(`Set MSE timestamp offset to ${e}`)),t()}catch{t()}})):t()}))}function k(){if(!y&&v.length>0){y=!0;let e=v[0];v.splice(0,1);let t=function(){y=!1,v.length>0&&k.call(this),e&&e.data&&e.data.segmentType&&e.data.segmentType!==T.HTTPRequest.INIT_SEGMENT_TYPE&&delete e.data.bytes,e.promise.resolve({chunk:e.data})};try{if(x=e.request,e.data.bytes.byteLength===0)t.call(this);else{try{d.debug(`Appending ${e.data.segmentType} from period ${e.data.streamId} to buffer. Request URL: ${e.request.url}, Representation: ID: ${e.data.representation.id}, bitrate: ${e.data.representation.bitrateInKbit}`)}catch{}f instanceof Xa?f.appendBuffer(e.data.bytes,e.data.start,e.data.end):f.appendBuffer?f.appendBuffer(e.data.bytes):f.append(e.data.bytes,e.data),N(t.bind(this))}}catch(t){d.fatal(`SourceBuffer append failed "`+t+`"`),v.length>0?k():y=!1,delete e.data.bytes,e.promise.reject({chunk:e.data,error:new Be.default(t.code,t.message)})}}}function A(){_.length>0&&!f.updating&&(_.shift()(),A())}function j(){f.updating||A()}function M(e){let t=e.target||{};(function(e,t){let n=t||{};i.trigger(e,n,{streamId:p.streamInfo.id,mediaType:c})})(m.default.SOURCE_BUFFER_ERROR,{error:t,lastRequestAppended:x})}function N(e){try{_.push(e),f&&!f.updating&&A()}catch(e){d.error(e)}}return o={abort:function(){return new Promise((e=>{try{v=[],b.readyState===`open`?N((()=>{try{f&&f.abort(),e()}catch{e()}})):(f&&f.setTextTrack&&b.readyState===`ended`&&f.abort(),e())}catch{e()}}))},abortBeforeAppend:function(){return new Promise((e=>{N((()=>{let t=f.appendWindowStart,n=f.appendWindowEnd;f&&(f.abort(),f.appendWindowStart=t,f.appendWindowEnd=n),e()}))}))},append:function(e,t=null){return new Promise(((n,r)=>{e?(v.push({data:e,promise:{resolve:n,reject:r},request:t}),N(k.bind(this))):r({chunk:e,error:new Be.default(Ne.APPEND_ERROR_CODE,Ne.APPEND_ERROR_MESSAGE)})}))},changeType:function(e){let t=S(e);return new Promise((e=>{N((()=>{f.changeType&&(d.debug(`Changing SourceBuffer codec to ${t}`),f.changeType(t)),e()}))}))},getAllBufferRanges:function(){try{return f?.buffered}catch(e){return d.error(`getAllBufferRanges exception: `+e.message),null}},getBuffer:function(){return f},getType:function(){return c},initializeForFirstUse:function(e,t){p=e;let n=e.streamInfo;c=p.type;let r=t?S(t):e.codec;try{if(r.match(/application\/mp4;\s*codecs="(stpp|wvtt).*"/i))return C(n);f=b.addSourceBuffer(r),w();let e=[];return e.push(D(p.streamInfo)),t&&t.mseTimeOffset!==void 0&&e.push(O(t.mseTimeOffset)),Promise.all(e)}catch(e){return p.type==h.default.TEXT&&!p.isFragmented||r.indexOf(`codecs="stpp`)!==-1||r.indexOf(`codecs="vtt`)!==-1||r.indexOf(`text/vtt`)!==-1?C(n):Promise.reject(e)}},initializeForStreamSwitch:function(e,t,n){p=e,c=p.type,function(e){f=e.getBuffer()}(n),w()},remove:function(e){return new Promise(((t,n)=>{let r=e.start,i=e.end;r>=0&&i>r?N((function(){try{f.remove(r,i),N((function(){t({from:r,to:i,unintended:!1}),e.resolve&&e.resolve()}))}catch(t){n({from:r,to:i,unintended:!1,error:new Be.default(Ne.REMOVE_ERROR_CODE,Ne.REMOVE_ERROR_MESSAGE)}),e.reject&&e.reject(t)}})):t()}))},removeEventListeners:E,reset:function(){if(f){try{_=[],E(),y=!1,v=[],f.getClassName&&f.getClassName()===`TextSourceBuffer`||(d.debug(`Removing sourcebuffer from media source`),b.removeSourceBuffer(f))}catch{}f=null}x=null},updateAppendWindow:D,updateTimestampOffset:O},d=(0,l.default)(t).getInstance().getLogger(o),o}ao.__dashjs_factory_name=`SourceBufferSink`;var oo=i.default.getClassFactory(ao);function so(e){let t=this.context,n,r,i,o=[],c=e;function u(e,t){return o=o.filter((n=>!((isNaN(t)||n.start<t)&&(isNaN(e)||n.end>e)))),Promise.resolve()}return n={getAllBufferRanges:function(){let e=[];for(let t=0;t<o.length;t++){let n=o[t];e.length===0||n.start>e[e.length-1].end?e.push({start:n.start,end:n.end}):e[e.length-1].end=n.end}let t={start:function(t){return e[t].start},end:function(t){return e[t].end}};return Object.defineProperty(t,`length`,{get:function(){return e.length}}),t},append:function(e){return e.segmentType===`InitializationSegment`?i=e:(o.push(e),o.sort((function(e,t){return e.start-t.start})),i=null),r.debug(`PreBufferSink appended chunk s: `+e.start+`; e: `+e.end),c&&c({chunk:e}),Promise.resolve()},remove:u,abort:function(){return Promise.resolve()},discharge:function(e,t){let n=function(e,t){return o.filter((n=>(isNaN(t)||n.start<t)&&(isNaN(e)||n.end>e)))}(e,t);return i&&=(n.push(i),null),u(e,t),n},reset:function(){o=[],i=null,c=null},updateTimestampOffset:function(){return Promise.resolve()},waitForUpdateEnd:function(e){e()},getBuffer:function(){return this}},r=(0,l.default)(t).getInstance().getLogger(n),n}so.__dashjs_factory_name=`PreBufferSink`;var co=i.default.getClassFactory(so);function lo(){let e={};return{save:function(t){let n=t.streamId,r=t.representation.id;e[n]=e[n]||{},e[n][r]=t},extract:function(t,n){return e&&e[t]&&e[t][n]?e[t][n]:null},reset:function(){e={}}}}lo.__dashjs_factory_name=`InitCache`;var uo=i.default.getSingletonFactory(lo);let fo=.01,po=`BufferController`;function mo(e){let t=(e||={}).capabilities,n=this.context,r=(0,p.default)(n).getInstance(),i=e.fragmentModel,o=e.playbackController,u=e.representationController,d=e.settings,f=e.streamInfo,_=e.textController,v=e.type,y,b,x,S,C,w,E,D,O,k,A,j,M,N,P,F,I,L,R,z,B;function V(e,t=null){return new Promise(((n,r)=>{w=e,O&&t&&typeof O.discharge==`function`?(k=O,H(t).then((()=>{n()})).catch((e=>{r(e)}))):n()}))}function H(e,t=new Map,i){return new Promise(((o,c)=>{L&&e?w?(A=!1,function(e,t,i){return new Promise((o=>{O=oo(n).create({mediaSource:w,textController:_,eventBus:r}),function(e,t,n){let r=u.getCurrentRepresentation(),i=null;return v!==h.default.VIDEO&&v!==h.default.AUDIO||(i=t.get(v)),i?function(e,t,n,r){O.initializeForStreamSwitch(e,t,n);let i=[];return i.push(O.abortBeforeAppend()),i.push(ve()),i.push(te(t,r)),t&&t.mseTimeOffset!==void 0&&i.push(_e(t)),Promise.allSettled(i)}(e,r,i,n):function(e,t){return O.initializeForFirstUse(e,t)}(e,r)}(e,t,i).then((()=>_e(u.getCurrentRepresentation()))).then((()=>{o(O)})).catch((e=>{b.warn(`Caught error on create SourceBuffer: `+e),o(O)}))}))}(e,t,i).then((e=>{o(e)})).catch((e=>{c(e)}))):(A=!0,function(){return new Promise(((e,t)=>{O=co(n).create(ee.bind(this)),_e(u.getCurrentRepresentation()).then((()=>{e(O)})).catch((()=>{t()}))}))}().then((e=>{o(e)})).catch((e=>{c(e)}))):o(null)}))}function U(e){d.get().streaming.cacheInitSegments&&(b.info(`Init fragment finished loading saving to`,v+`'s init cache`),L.save(e.chunk)),b.debug(`Appending init fragment for type ${v}, representationId ${e.chunk.representation.id} and bandwidth ${e.chunk.representation.bandwidth}`),G(e.chunk)}function W(e){G(e.chunk,e.request)}function G(e,t=null){O&&(O.append(e,t).then((e=>{ee(e)})).catch((e=>{ee(e)})),e.representation.mediaInfo.type===h.default.VIDEO&&Te(m.default.VIDEO_CHUNK_RECEIVED,{chunk:e}))}function K(e){if(e&&e.length>0)for(let t=0,n=e.length;t<n;t++)b.debug(`Buffered range: `+e.start(t)+` - `+e.end(t)+`, currentTime = `,o.getTime())}function ee(e){if(e.error)return e.error.code===22&&function(){if(I=!0,C=.8*Se(),b.warn(`Quota exceeded, Critical Buffer: `+C),C>0){let e=Math.max(.2*C,1),t=C-e,n=Math.min(d.get().streaming.buffer.bufferTimeAtTopQuality,.9*t),r=Math.min(d.get().streaming.buffer.bufferTimeAtTopQualityLongForm,.9*t),i={streaming:{buffer:{bufferToKeep:parseFloat(e.toFixed(5)),bufferTimeAtTopQuality:parseFloat(n.toFixed(5)),bufferTimeAtTopQualityLongForm:parseFloat(r.toFixed(5))}}};d.update(i)}}(),void(e.error.code!==22&&we()||(b.warn(`Clearing playback buffer to overcome quota exceed situation`),Te(m.default.QUOTA_EXCEEDED,{criticalBufferLevel:C,quotaExceededTime:e.chunk.start}),me(pe())));if(!O||(ce(),I=!1,N=e.chunk,!N||!N.endFragment))return;N&&!isNaN(N.index)&&(E=Math.max(N.index,E),le());let t=O.getAllBufferRanges();N.segmentType===T.HTTPRequest.MEDIA_SEGMENT_TYPE&&(K(t),ie(),function(){if(isNaN(B)||A)return;if(v!==h.default.AUDIO&&v!==h.default.VIDEO)return void(B=NaN);let e=o.getTime(),t=oe(e,0),n=oe(B,0);if(t&&n&&t.start===n.start)return void(B=NaN);let r=u.getCurrentRepresentation().segmentDuration,i=oe(B,r);i&&(d.get().streaming.buffer.enableSeekDecorrelationFix&&Math.abs(e-B)>r?B<=i.end&&o.seek(Math.max(B,i.start),!1,!0):e<i.start&&o.seek(i.start,!1,!0))}());let n=!1;j&&=(j.indexOf(N)>0&&(n=!0),null),N&&!n&&Te(m.default.BYTES_APPENDED_END_FRAGMENT,{startTime:N.start,index:N.index,bufferedRanges:t,segmentType:N.segmentType,mediaType:v,representationId:N.representation.id})}function q(e,t){let n=[];return n.push(_e(e)),n.push(O?O.abort():Promise.resolve()),n.push(te(e,t)),Promise.allSettled(n)}function te(e,n){if(!e||!n)return b.warn(`BufferController._changeCodec() is missing the information about the Representations. Doing nothing`),Promise.resolve();if(e&&n&&e.mimeType===n.mimeType&&e.codecFamily===n.codecFamily)return b.debug(`Switching to new codec ${e.codecs} without changeType as previous codec ${n.codecs} is compatible.`),Promise.resolve();if(!d.get().streaming.buffer.useChangeType||!t.supportsChangeType())return b.debug(`changeType() not available`),Promise.resolve();b.debug(`Using changeType() to switch from codec ${n.codecs} to ${e.codecs}`);let r=e.dependentRepresentation?e.dependentRepresentation:e;return O.changeType(r)}function ne(){return new Promise(((e,t)=>{let n=re();if(!n||n.length===0)return ie(),void e();me(n).then((()=>{e()})).catch((e=>{t(e)}))}))}function re(e){let t=[],n=O.getAllBufferRanges();if(!n||n.length===0)return t;if(!e&&e!==0||isNaN(e))t.push({start:n.start(0),end:n.end(n.length-1)+.5});else{let r=function(e,t){let n=d.get().streaming.buffer.bufferToKeep,r=t.start(0);if(e-r>n){let t=Math.max(0,e-n),o=i.getRequests({state:se.FRAGMENT_MODEL_EXECUTED,time:e,threshold:fo})[0];if(o&&(t=Math.min(o.startTime,t)),t>0)return{start:r,end:t}}return null}(e,n),o=function(e,t){let n=t.end(t.length-1)+.5,r=Ce(e),o=f.manifestInfo.duration>=d.get().streaming.buffer.longFormContentDurationThreshold?d.get().streaming.buffer.bufferTimeAtTopQualityLongForm:d.get().streaming.buffer.bufferTimeAtTopQuality,c=isNaN(r)?e:Math.min(r,e+o);if(c>=t.end(t.length-1))return null;let l=i.getRequests({state:se.FRAGMENT_MODEL_EXECUTED,time:e,threshold:fo})[0];if(l&&(c=Math.max(l.startTime+l.duration,c)),d.get().streaming.buffer.avoidCurrentTimeRangePruning){for(let r=0;r<t.length;r++)if(t.start(r)<=e&&e<=t.end(r)&&t.start(r)<=c&&c<=t.end(r)){let i=c;c=r+1<t.length?t.start(r+1):t.end(r)+1,b.debug(`Buffered range [`+t.start(r)+`, `+t.end(r)+`] overlaps with targetTime `+e+` and range to be pruned [`+i+`, `+n+`], using [`+c+`, `+n+`] instead`+(c<n?``:` (no actual pruning)`));break}}return c<t.end(t.length-1)?{start:c,end:n}:null}(e,n);r&&t.push(r),o&&t.push(o)}return t}function ie(){(!z||v===h.default.TEXT&&_.isTextEnabled())&&ce()}function J(){ue()}function ae(){ue(),B=NaN}function oe(e,t){if(!O)return null;let n=O.getAllBufferRanges(),r,i,o=0,c=0,l=null,u=null,d=0,f=isNaN(t)?.15:t;if(n!=null){for(i=0,r=n.length;i<r;i++)if(o=n.start(i),c=n.end(i),l===null)d=Math.abs(o-e),(e>=o&&e<c||d<=f)&&(l=o,u=c);else{if(d=o-u,!(d<=f))break;u=c}if(l!==null)return{start:l,end:u}}return null}function ce(){if(o){let e=o.getTime()||0;A&&(e=isNaN(B)?0:B);let t=d.get().streaming.gaps.jumpGaps&&!isNaN(d.get().streaming.gaps.smallGapLimit)?d.get().streaming.gaps.smallGapLimit:NaN;S=Math.max(function(e,t){let n,r;return d.get().streaming.gaps.jumpGaps&&(t=d.get().streaming.gaps.smallGapLimit),n=oe(e,t),r=n===null?0:n.end-e,r}(e,t),0),Te(m.default.BUFFER_LEVEL_UPDATED,{mediaType:v,bufferLevel:S}),ue()}}function le(){let e=E>=D-1,t=o.getTimeToStreamEnd(f)-S<1e-5;!e&&!t||x||(xe(!0),b.debug(`checkIfBufferingCompleted trigger BUFFERING_COMPLETED for stream id ${f.id} and type ${v}`))}function ue(){if(v!==h.default.AUDIO&&v!==h.default.VIDEO)return;let e=o.getLowLatencyModeEnabled()?d.get().streaming.buffer.lowLatencyStallThreshold:d.get().streaming.buffer.stallThreshold;S<=e&&!x?de(c.BUFFER_EMPTY):(x||S>e)&&de(c.BUFFER_LOADED)}function de(e){M===e||e===c.BUFFER_EMPTY&&o.getTime()===0||v===h.default.TEXT&&!_.isTextEnabled()||(M=e,Te(m.default.BUFFER_LEVEL_STATE_CHANGED,{state:e}),Te(e===c.BUFFER_LOADED?m.default.BUFFER_LOADED:m.default.BUFFER_EMPTY),b.debug(e===c.BUFFER_LOADED?`Got enough buffer to start`:`Waiting for more buffer before starting playback`))}function fe(){O&&v!==h.default.TEXT&&(x||me(pe()))}function pe(){let e=[],t=O.getAllBufferRanges();if(!t||t.length===0)return e;let n=o.getTime(),r=Math.max(0,n-d.get().streaming.buffer.bufferToKeep),c=i.getRequests({state:se.FRAGMENT_MODEL_EXECUTED,time:n,threshold:fo})[0];if(c)r=Math.min(c.startTime,r);else if(n===0&&o.getIsDynamic())return[];if(t.start(0)<=r){let n={start:0,end:r};for(let e=0;e<t.length&&t.end(e)<=r;e++)n.end=t.end(e);n.start<n.end&&e.push(n)}return e}function me(e){return new Promise(((t,n)=>{if(!e||!O||e.length===0)return ce(),void t();let r=[];e.forEach((e=>{r.push(function(e){return new Promise(((t,n)=>{e.resolve=t,e.reject=n,R.push(e)}))}(e))})),F||he(),Promise.all(r).then((()=>{t()})).catch((e=>{n(e)}))}))}function he(){try{if(R.length===0||!O)return b.debug(`Nothing to prune, halt pruning`),R=[],void(F=!1);let e=O.getBuffer();if(!e||!e.buffered||e.buffered.length===0)return b.debug(`SourceBuffer is empty (or does not exist), halt pruning`),R=[],void(F=!1);let t=R.shift();b.debug(`${v}: Removing buffer from: ${t.start} to ${t.end}`),F=!0,o.getTime()<t.end&&xe(!1),O.remove(t).then((e=>{ge(e)})).catch((e=>{ge(e)}))}catch{F=!1}}function ge(e){b.debug(`onRemoved buffer from:`,e.from,`to`,e.to),O&&(K(O.getAllBufferRanges()),R.length===0&&(F=!1,ce()),e.unintended&&(b.warn(`Detected unintended removal from:`,e.from,`to`,e.to,`setting streamprocessor time to`,e.from),Te(m.default.SEEK_TARGET,{time:e.from})),F?he():(z?z=!1:ce(),Te(m.default.BUFFER_CLEARED,{from:e.from,to:e.to,unintended:e.unintended,hasEnoughSpaceToAppend:we(),quotaExceeded:I})))}function _e(e){return new Promise((t=>{e&&e.mseTimeOffset!==void 0&&O&&O.updateTimestampOffset?O.updateTimestampOffset(e.mseTimeOffset).then((()=>{t()})).catch((()=>{t()})):t()}))}function ve(){return O&&!x?O.updateAppendWindow(f):Promise.resolve()}function ye(){P++,P*(d.get().streaming.wallclockTimeUpdateInterval/1e3)>=d.get().streaming.buffer.bufferPruningInterval&&(P=0,fe())}function be(){ue()}function xe(e){x=e,x?Te(m.default.BUFFERING_COMPLETED):D=1/0}function Se(){try{let e=O.getAllBufferRanges(),t,n,r=0;if(!e)return r;for(n=0,t=e.length;n<t;n++)r+=e.end(n)-e.start(n);return r}catch{return 0}}function Ce(e){try{let t=e,n=O.getAllBufferRanges();if(!n||n.length===0)return NaN;let r=0;for(;t===e&&r<n.length;){let e=n.start(r),i=n.end(r);t>=e&&t<=i&&(t=i),r+=1}return t===e?NaN:t}catch{return NaN}}function we(){let e=Se();return isNaN(e)||e<C}function Te(e,t){let n=t||{};r.trigger(e,n,{streamId:f.id,mediaType:v})}function Ee(e,t){if(C=1/0,M=void 0,D=1/0,E=0,N=null,x=!1,F=!1,I=!1,S=0,P=0,R=[],B=NaN,A=!1,O){let n=O;O=null,e||(t?n.removeEventListeners():n.abort().then((()=>{n.reset(t),n=null})))}z=!1}return y={appendInitSegmentFromCache:function(e){let t=L.extract(f.id,e);return!!t&&(b.debug(`Appending init fragment for type ${v}, representationId ${t.representation.id} and bandwidth ${t.representation.bandwidth}`),G(t),!0)},clearBuffers:me,createBufferSink:H,dischargePreBuffer:function(){if(O&&k&&typeof k.discharge==`function`){let e=k.getAllBufferRanges();if(e.length>0){let t=`Beginning `+v+`PreBuffer discharge, adding buffer for:`;for(let n=0;n<e.length;n++)t+=` start: `+e.start(n)+`, end: `+e.end(n)+`;`;b.debug(t)}else b.debug(`PreBuffer discharge requested, but there were no media segments in the PreBuffer.`);j=[];let t=k.discharge(),n=null;for(let e=0;e<t.length;e++){let r=t[e];if(r.segmentType!==T.HTTPRequest.INIT_SEGMENT_TYPE){let e=L.extract(r.streamId,r.representation.id);e&&n!==e&&(j.push(e),O.append(e),n=e)}j.push(r),O.append(r)}k.reset(),k=null}},getAllRangesWithSafetyFactor:re,getBuffer:function(){return O},getBufferControllerType:function(){return po},getBufferLevel:function(){return S},getContinuousBufferTimeForTargetTime:Ce,getIsBufferingCompleted:function(){return x},getIsPruningInProgress:function(){return F},getMediaSource:function(){return w},getRangeAt:oe,getStreamId:function(){return f.id},getType:function(){return v},hasBufferAtTime:function(e){try{let t=O.getAllBufferRanges();if(!t||t.length===0)return!1;let n=0;for(;n<t.length;){let r=t.start(n),i=t.end(n);if(e>=r&&e<=i)return!0;n+=1}return!1}catch(e){return b.error(e),!1}},initialize:function(e){V(e),r.on(m.default.INIT_FRAGMENT_LOADED,U,y),r.on(m.default.MEDIA_FRAGMENT_LOADED,W,y),r.on(m.default.WALLCLOCK_TIME_UPDATED,ye,y),r.on(g.default.PLAYBACK_PLAYING,ae,y),r.on(g.default.PLAYBACK_PROGRESS,ie,y),r.on(g.default.PLAYBACK_TIME_UPDATED,ie,y),r.on(g.default.PLAYBACK_RATE_CHANGED,be,y),r.on(g.default.PLAYBACK_STALLED,J,y)},prepareForAbandonQualitySwitch:function(e,t){return q(e,t)},prepareForDefaultQualitySwitch:function(e,t){return q(e,t)},prepareForFastQualitySwitch:function(e,t){return q(e,t)},prepareForForceReplacementQualitySwitch:function(e,t){return new Promise((n=>{let r=[];r.push(O.abort()),r.push(ve()),r.push(ne()),r.push(_e(e)),r.push(te(e,t)),Promise.allSettled(r).then((()=>{xe(!1),n()}))}))},prepareForNonReplacementTrackSwitch:function(e,t){return new Promise((n=>{let r=[];r.push(ve()),r.push(te(e,t)),Promise.allSettled(r).then((()=>{n()}))}))},prepareForPlaybackSeek:function(){return x&&xe(!1),O.abort()},prepareForReplacementTrackSwitch:function(e,t){return new Promise((n=>{let r=[];r.push(O.abort()),r.push(ve()),r.push(te(e,t)),r.push(ne()),r.push(_e(e)),Promise.allSettled(r).then((()=>{xe(!1),n()}))}))},pruneAllSafely:ne,pruneBuffer:fe,reset:function(e,t){r.off(m.default.INIT_FRAGMENT_LOADED,U,this),r.off(m.default.MEDIA_FRAGMENT_LOADED,W,this),r.off(m.default.WALLCLOCK_TIME_UPDATED,ye,this),r.off(g.default.PLAYBACK_PLAYING,ae,this),r.off(g.default.PLAYBACK_PROGRESS,ie,this),r.off(g.default.PLAYBACK_TIME_UPDATED,ie,this),r.off(g.default.PLAYBACK_RATE_CHANGED,be,this),r.off(g.default.PLAYBACK_STALLED,J,this),Ee(e,t)},segmentRequestingCompleted:function(e){isNaN(e)||(D=e,le())},setIsBufferingCompleted:xe,setMediaSource:V,setSeekTarget:function(e){B=e},updateAppendWindow:ve,updateBufferTimestampOffset:_e},b=(0,l.default)(n).getInstance().getLogger(y),L=uo(n).getInstance(),Ee(),y}mo.__dashjs_factory_name=po;var ho=i.default.getClassFactory(mo);let go=`NotFragmentedTextBufferController`;function _o(e){e||={};let t=this.context,n=(0,p.default)(t).getInstance(),r=e.textController,i=e.errHandler,o=e.streamInfo,c=e.type,l,u,d,f,h,g;function _(e){f=e}function v(e){u!==e&&(u=e,u&&function(e){n.trigger(e,{},{streamId:o.id,mediaType:c})}(m.default.BUFFERING_COMPLETED))}function y(e){e.chunk.bytes&&!u&&(g.save(e.chunk),h.append(e.chunk),v(!0))}return l={initialize:function(e){_(e)},getStreamId:function(){return o.id},getType:function(){return c},getBufferControllerType:function(){return go},createBufferSink:function(e){return new Promise(((o,l)=>{try{h=oo(t).create({mediaSource:f,textController:r,eventBus:n}),h.initializeForFirstUse(e),d||=(h.getBuffer()&&typeof h.getBuffer().initialize==`function`&&h.getBuffer().initialize(),!0),o(h)}catch(e){i.error(new Be.default(Ne.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,Ne.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+c)),l(e)}}))},dischargePreBuffer:function(){},getBuffer:function(){return h},getBufferLevel:function(){return 0},getRangeAt:function(){return null},pruneBuffer:function(){},hasBufferAtTime:function(){return!0},getAllRangesWithSafetyFactor:function(){return[]},getContinuousBufferTimeForTargetTime:function(){return 1/0},setMediaSource:_,getMediaSource:function(){return f},appendInitSegmentFromCache:function(e){return g.extract(o.id,e)!==null},getIsBufferingCompleted:function(){return u},setIsBufferingCompleted:v,getIsPruningInProgress:function(){return!1},reset:function(e){n.off(m.default.INIT_FRAGMENT_LOADED,y,l),!e&&h&&(h.abort(),h.reset(),h=null)},clearBuffers:function(){return Promise.resolve()},prepareForPlaybackSeek:function(){return Promise.resolve()},prepareForReplacementTrackSwitch:function(){return u=!1,Promise.resolve()},setSeekTarget:function(){},updateAppendWindow:function(){return Promise.resolve()},pruneAllSafely:function(){return Promise.resolve()},updateBufferTimestampOffset:function(){return Promise.resolve()},segmentRequestingCompleted:function(){}},d=!1,f=null,u=!1,g=uo(t).getInstance(),n.on(m.default.INIT_FRAGMENT_LOADED,y,l),l}_o.__dashjs_factory_name=go;var vo=i.default.getClassFactory(_o);function yo(e){e||={};let t=this.context,n=(0,p.default)(t).getInstance(),r=e.dashMetrics,i=e.mediaPlayerModel,o=e.fragmentModel,u=e.abrController,d=e.playbackController,f=e.textController,_=e.type,v=e.bufferController,y=e.representationController,b=e.settings,x,S,C,w,T,E,D,O,k,A,j,M;function N(){D=(0,l.default)(t).getInstance().getLogger(w),G(),A=e.streamInfo}function P(){O=!0}function F(){O=!1}function I(e){v.getIsBufferingCompleted()||(L(),k=setTimeout(R,isNaN(e)?0:e))}function L(){k&&=(clearTimeout(k),null)}function R(){let e=i.getScheduleTimeout();try{if(function(){try{return _===h.default.TEXT&&!f.isTextEnabled()||d.isPaused()&&(!d.getStreamController().getInitialPlayback()||!d.getStreamController().getAutoPlay())&&!b.get().streaming.scheduling.scheduleWhilePaused}catch{return!1}}())return void L();(function(){try{return!!O&&y.getCurrentRepresentation()&&(E==null||j||function(){let e=y.getCurrentRepresentation();if(!_||!e)return!0;let t=e&&e.segmentDuration&&!isNaN(e.segmentDuration)?e.segmentDuration:0,n=r.getCurrentBufferLevel(_),i=z();return(i<=t||d.getLowLatencyModeEnabled()||_===h.default.AUDIO&&S)&&(t=0),n+t<i}())}catch{return!1}})()?function(){if(u.handlePendingManualQualitySwitch(A.id,_))return;let e=!1;x&&(e=u.checkPlaybackQuality(_,A.id)),e||function(){let e=y.getCurrentRepresentation();C||e.id!==E||j?function(e){j?(D.debug(`Switch track for `+_+`, representation id = `+e.id),j=!1):D.debug(`Quality has changed, get init request for representationid = `+e.id),n.trigger(m.default.INIT_FRAGMENT_NEEDED,{representationId:e.id,sender:w},{streamId:A.id,mediaType:_}),x=!1,C=!1}(e):(D.debug(`Media segment needed for ${_} and stream id ${A.id}`),n.trigger(m.default.MEDIA_FRAGMENT_NEEDED,{},{streamId:A.id,mediaType:_}),x=!0)}()}():I(e)}catch{I(e)}}function z(){let e=NaN,t=y.getCurrentRepresentation();return _&&t&&(e=_===h.default.TEXT?function(){try{if(f.isTextEnabled()){let e=y.getCurrentRepresentation();if(isNaN(e.fragmentDuration)){let e=r.getCurrentSchedulingInfo(c.SCHEDULING_INFO);return e?e.duration:0}return e.fragmentDuration}return 0}catch{return 0}}():_===h.default.AUDIO&&S?function(){try{let e=r.getCurrentBufferLevel(h.default.VIDEO),t=y.getCurrentRepresentation();return isNaN(t.fragmentDuration)?e+1:Math.max(e+1,t.fragmentDuration)}catch{return 0}}():function(){try{let e=b.get().streaming.enhancement.enabled?y.getCurrentCompositeRepresentation():y.getCurrentRepresentation(),t=e.mediaInfo.streamInfo;return u.isPlayingAtTopQuality(e)?t.manifestInfo.duration>=b.get().streaming.buffer.longFormContentDurationThreshold?b.get().streaming.buffer.bufferTimeAtTopQualityLongForm:b.get().streaming.buffer.bufferTimeAtTopQuality:i.getBufferTimeDefaultUnadjusted()}catch{return i.getBufferTimeDefaultUnadjusted()}}()),e}function B(){V(!0)}function V(e){if(d&&o){let t=o.getRequests({state:se.FRAGMENT_MODEL_EXECUTED,time:d.getTime(),threshold:0})[0];t&&d.getTime()>=t.startTime&&((!T.representation||t.representation.mediaInfo.type===T.representation.mediaInfo.type&&t.representation.mediaInfo.index!==T.representation.mediaInfo.index)&&e&&function(e){D.debug(`Track change rendered for streamId ${A.id} and type ${_}`),n.trigger(m.default.TRACK_CHANGE_RENDERED,{mediaType:_,oldMediaInfo:T&&T.representation&&T.representation.mediaInfo?T.representation.mediaInfo:null,newMediaInfo:e.representation.mediaInfo,streamId:A.id})}(t),T.representation&&t.representation.id===T.representation.id||!e||function(e){D.debug(`Quality change rendered for streamId ${A.id} and type ${_}`),n.trigger(m.default.QUALITY_CHANGE_RENDERED,{mediaType:_,oldRepresentation:T.representation?T.representation:null,newRepresentation:e.representation,streamId:A.id})}(t),T.representation=t.representation)}}function H(){o.abortRequests(),L()}function U(){b.get().streaming.scheduling.scheduleWhilePaused||I()}function W(e){r.updatePlayListTraceMetrics({playbackspeed:e.playbackRate.toString()})}function G(){x=!0,M=0,E=null,T={representation:null},j=!1,C=!1,O=!0}return w={clearScheduleTimer:L,getBufferTarget:z,getPlaybackController:function(){return d},getStreamId:function(){return A.id},getSwitchTrack:function(){return j},getTimeToLoadDelay:function(){return M},getType:function(){return _},initialize:function(e){S=e,n.on(m.default.URL_RESOLUTION_FAILED,H,w),n.on(g.default.PLAYBACK_STARTED,U,w),n.on(g.default.PLAYBACK_RATE_CHANGED,W,w),n.on(g.default.PLAYBACK_TIME_UPDATED,B,w),n.on(g.default.MANAGED_MEDIA_SOURCE_START_STREAMING,P,w),n.on(g.default.MANAGED_MEDIA_SOURCE_END_STREAMING,F,w)},reset:function(){n.off(m.default.URL_RESOLUTION_FAILED,H,w),n.off(g.default.PLAYBACK_STARTED,U,w),n.off(g.default.PLAYBACK_RATE_CHANGED,W,w),n.off(g.default.PLAYBACK_TIME_UPDATED,B,w),n.off(g.default.MANAGED_MEDIA_SOURCE_START_STREAMING,P,w),n.off(g.default.MANAGED_MEDIA_SOURCE_END_STREAMING,F,w),L(),V(!1),G(),A=null},setShouldCheckPlaybackQuality:function(e){x=e},setInitSegmentRequired:function(e){C=e},setLastInitializedRepresentationId:function(e){E=e},setup:N,setSwitchTrack:function(e){j=e},setTimeToLoadDelay:function(e){M=e},startScheduleTimer:I},N(),w}yo.__dashjs_factory_name=`ScheduleController`;var bo=i.default.getClassFactory(yo);let xo=/\$(RepresentationID|Number|SubNumber|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g;var X=class extends Pa{constructor(){super(),this.isPartialSegment=!0,this.replacementSubNumber=NaN,this.totalNumberOfPartialSegments=NaN}};function So(e){return e?e.totalNumberOfPartialSegments&&!isNaN(e.totalNumberOfPartialSegments)&&e.totalNumberOfPartialSegments>0&&!isNaN(e.subNumberOfPartialSegmentToRequest)?function(e){let t=function(e,t){let n=new X,r=e.segmentDurationInSeconds/e.totalNumberOfPartialSegments,{representation:i,timelineConverter:o,isDynamic:c,index:l,totalNumberOfPartialSegments:u}=e,d=Co({representation:i,segmentDurationInSeconds:r,presentationStartTime:e.presentationStartTime+t*r,presentationEndTime:e.presentationStartTime+(t+1)*r,timelineConverter:o,isDynamic:c,mediaTimeInSeconds:e.mediaTimeInSeconds+t*r,index:l});return n.assignAttributes(d),n.replacementSubNumber=t,n.totalNumberOfPartialSegments=u,n}(e,e.subNumberOfPartialSegmentToRequest);return wo(t,e),t}(e):function(e){let t=new Fa,n=Co(e);return t.assignAttributes(n),wo(t,e),t}(e):null}function Co(e){let{representation:t,segmentDurationInSeconds:n,presentationStartTime:r,presentationEndTime:i,mediaTimeInSeconds:o,timelineConverter:c,isDynamic:l,index:u}=e,d={availabilityEndTime:c.calcAvailabilityEndTimeFromPresentationTime(i+n,t,l),availabilityStartTime:c.calcAvailabilityStartTimeFromPresentationTime(i,t,l),duration:n,index:u,mediaStartTime:o,presentationStartTime:r,replacementNumber:t.startNumber+u,representation:t};return d.wallStartTime=c.calcWallTimeForSegment(d,l),d}function wo(e,t){let{tManifest:n,mediaTime:r,mediaUrl:i,mediaRange:o}=t;e.replacementTime=n||r,e.media=Q(i,e.representation.id,e.replacementNumber,e.replacementSubNumber,e.representation.bandwidth,e.replacementTime),e.mediaRange=o,e.mediaUrl=i}function Z(e,t,n,r){let i=t.adaptation.period;if(isFinite(i.duration)&&i.start+i.duration<=n.presentationStartTime)return!1;if(r){if(t.availabilityTimeOffset===`INF`)return!0;let r=e.getClientReferenceTime();return n.availabilityStartTime.getTime()<=r&&(!isFinite(n.availabilityEndTime)||n.availabilityEndTime.getTime()>=r)}return!0}function Q(e,t,n,r,i,o){return e&&function(e,t,n,r,i,o){return e.replace(xo,((e,c,l,u)=>{let d,f;switch(c){case void 0:return`$`;case`RepresentationID`:d=t;break;case`Number`:d=n;break;case`SubNumber`:d=r;break;case`Bandwidth`:d=i;break;case`Time`:if(typeof o==`string`)return o;d=o&&Math.round(o);break;default:d=null}if(d==null)return e;switch(u){case void 0:case`d`:case`i`:case`u`:f=d.toString();break;case`o`:f=d.toString(8);break;case`x`:f=d.toString(16);break;case`X`:f=d.toString(16).toUpperCase();break;default:f=d.toString()}let p=parseInt(l,10)||1;return f.padStart(p,`0`)}))}(e,t,n,r,i,o)}function To(e){let{index:t,isDynamic:n,mediaRange:r,mediaTime:i,mediaUrl:o,representation:c,subNumberOfPartialSegmentToRequest:l,timelineConverter:u,totalNumberOfPartialSegments:d}=e,f,p,m;f=c.segmentDuration,isNaN(f)&&(f=c.adaptation.period.duration),p=parseFloat((c.adaptation.period.start+t*f).toFixed(5)),m=parseFloat((p+f).toFixed(5));let h=So({index:t,isDynamic:n,mediaRange:r,mediaTime:i,mediaTimeInSeconds:u.calcMediaTimeFromPresentationTime(p,c),mediaUrl:o,presentationEndTime:m,presentationStartTime:p,representation:c,segmentDurationInSeconds:f,subNumberOfPartialSegmentToRequest:l,timelineConverter:u,totalNumberOfPartialSegments:d});return Z(u,c,h,n)?h:null}function Eo(e){let{durationInTimescale:t,fTimescale:n,index:r,subNumberOfPartialSegmentToRequest:i,isDynamic:o,mediaRange:c,mediaTime:l,mediaUrl:u,totalNumberOfPartialSegments:d,representation:f,tManifest:p,timelineConverter:m}=e,h=l/n,g=t/n,_=m.calcPresentationTimeFromMediaTime(h,f),v=So({representation:f,segmentDurationInSeconds:g,presentationStartTime:_,presentationEndTime:_+g,mediaTimeInSeconds:h,timelineConverter:m,isDynamic:o,index:r,totalNumberOfPartialSegments:d,subNumberOfPartialSegmentToRequest:i,mediaUrl:u,mediaRange:c,tManifest:p,mediaTime:l});return Z(m,f,v,o)?v:null}function Do(e){return e.k}function Oo(e){let t=(e||={}).eventBus,n=e.events,r=e.abrController,i=e.dashMetrics,o=e.playbackController,c=e.timelineConverter,l=e.type,u=e.streamInfo,d=e.segmentsController,f=e.isDynamic,p,m,_;function v(){return l}function y(){return _?.mediaInfo.type===l?_:function(){let e=_?.dependentRepresentation;if(e){if(!e.mediaInfo)throw Error(`dependentRepresentation has no mediaInfo!`);if(e.mediaInfo.type===l)return e}return null}()}function b(){_=null,m=[]}function x(e){return new Promise(((t,n)=>{let r=e.hasInitialization(),o=e.hasSegments(),l=[];l.push(d.updateInitData(e,r)),l.push(d.updateSegmentData(e,o)),Promise.all(l).then((n=>{var r;n[0]&&!n[0].error&&(e=function(e,t){return t&&!t.error&&t.representation?t.representation:e}(e,n[0])),n[1]&&!n[1].error&&(e=function(e,t){if(!t||t.error)return;let n=t.segments,r=[],i,o,l,u,d=0;for(i=0,o=n?n.length:0;i<o;i++)l=n[i],u=Eo({durationInTimescale:l.duration,fTimescale:l.timescale,index:d,isDynamic:f,mediaRange:l.mediaRange,mediaTime:l.startTime,mediaUrl:l.media,representation:e,timelineConverter:c}),u&&(r.push(u),u=null,d++);return r.length>0&&(e.segments=r),e}(e,n[1])),e.fragmentDuration=e.segmentDuration?e.segmentDuration:e.segments&&e.segments.length>0?e.segments[0].duration:NaN,(r=e).mediaFinishedInformation=d.getMediaFinishedInformation(r),function(e){let t,n=i.getCurrentManifestUpdate(),r=!1;if(n){for(let i=0;i<n.representationInfo.length;i++)if(t=n.representationInfo[i],t.index===e.index&&t.mediaType===v()){r=!0;break}r||i.addManifestUpdateRepresentationInfo(e,v())}}(e),t()})).catch((e=>{n(e)}))}))}function S(e){if(!m||m.length===0)return null;let t=m.filter((t=>t.id===e));return t.length>0?t[0]:null}function C(e){t.trigger(n.DATA_UPDATE_COMPLETED,{currentRepresentation:_,error:e},{streamId:u.id,mediaType:l})}function w(e){_&&_.id===e.id||function(e){(function(){if(!(r&&i&&o&&c))throw Error(h.default.MISSING_CONFIG_ERROR)})();let n=new Date,d=1e3*o.getTime();e&&i.addRepresentationSwitch(e.adaptation.type,n,d,e.id),t.trigger(g.default.REPRESENTATION_SWITCH,{mediaType:l,streamId:u.id,currentRepresentation:e},{streamId:u.id,mediaType:l})}(e),_=e}function T(e){if(e.newDuration){let t=y();t&&t.adaptation.period&&(t.adaptation.period.duration=e.newDuration)}}return p={getCurrentCompositeRepresentation:function(){return _},getCurrentRepresentation:y,getRepresentationById:S,getStreamId:function(){return u.id},getType:v,prepareQualityChange:function(e){let t=m.filter((t=>t.id===e.id));t.length>0&&w(t[0])},reset:function(){t.off(g.default.MANIFEST_VALIDITY_CHANGED,T,p),b()},updateData:function(e,t,n){return new Promise(((c,d)=>{if(m=e,w(S(n)),l!==h.default.VIDEO&&l!==h.default.ENHANCEMENT&&l!==h.default.AUDIO&&(l!==h.default.TEXT||!t))return C(),void c();let f=[];for(let e=0,t=m.length;e<t;e++){let t=m[e];f.push(x(t))}Promise.all(f).then((()=>{(function(){r.setPlaybackQuality(l,u,_);let e=i.getCurrentDVRInfo(l);e&&i.updateManifestUpdateInfo({latency:e.range.end-o.getTime()}),C()})(),c()})).catch((e=>{d(e)}))}))}},b(),t.on(g.default.MANIFEST_VALIDITY_CHANGED,T,p),p}Oo.__dashjs_factory_name=`RepresentationController`;var ko=i.default.getClassFactory(Oo);function Ao(e){let t=(e||={}).eventBus,n=e.debug,r=e.urlUtils,i=e.type,o=e.streamInfo,c=e.segmentsController,l=e.timelineConverter,u=e.baseURLController,d,f,p,m,h;function _(){return i}function v(){p=null}function y(e,t,n){let i=u.resolve(n.path),o,c,l={};return i&&t!==i.url&&r.isRelative(t)?(o=i.url,c=i.serviceLocation,l=i.queryParams,t&&(o=r.resolve(t,o))):o=t,!r.isRelative(o)&&(e.url=o,e.serviceLocation=c,e.queryParams=l,!0)}function b(e,t,n){let r=null;if(!t||!t.segmentInfoType)return r;let i=c.getSegmentByTime(t,n);return i&&(p=i,f.debug(`Index for time `+n+` is `+i.index),r=x(0,i)),r}function x(e,t){if(t==null)return null;let n=new ne,r=t.representation,i=r.bandwidth,o=Q(t.media,r.id,t.replacementNumber,t.replacementSubNumber,i,t.replacementTime);return n.adaptationIndex=r.adaptation.index,n.availabilityEndTime=t.availabilityEndTime,n.availabilityStartTime=t.availabilityStartTime,n.availabilityTimeComplete=r.availabilityTimeComplete,n.bandwidth=r.bandwidth,n.duration=t.duration,n.index=t.index,n.isPartialSegmentRequest=t.isPartialSegment,n.mediaStartTime=t.mediaStartTime,n.mediaType=_(),n.presentationStartTime=t.presentationStartTime,n.range=t.mediaRange,n.representation=r,n.startTime=t.presentationStartTime,n.timescale=r.timescale,n.type=T.HTTPRequest.MEDIA_SEGMENT_TYPE,n.wallStartTime=t.wallStartTime,y(n,o,r)?n:void 0}function S(e){if(!e)return{indexToRequest:0,subNumberOfPartialSegmentToRequest:NaN};let t=e.isPartialSegment,n=!isNaN(e.replacementSubNumber),r=!isNaN(e.totalNumberOfPartialSegments);if(t&&n&&r){let t=e.replacementSubNumber+1;return t<e.totalNumberOfPartialSegments?{indexToRequest:e.index,subNumberOfPartialSegmentToRequest:t}:{indexToRequest:e.index+1,subNumberOfPartialSegmentToRequest:0}}return{indexToRequest:e.index+1,subNumberOfPartialSegmentToRequest:NaN}}function C(e,t,n,r){let i=null,o=c.getSegmentByIndex(t,n,r,p);if(o)i=x(0,o),p=o;else{if(m&&!h)return f.debug(_()+` No segment found at index: `+n+`. Wait for next loop`),null;h=!0}return i}function w(){f.debug(`Dynamic stream complete`),h=!0}return d={getCurrentIndex:function(){return p?p.index:-1},getInitRequest:function(e,t){return t?function(e,t,n){let r=new ne,i=t.adaptation.period,o=i.start;if(r.mediaType=n,r.type=T.HTTPRequest.INIT_SEGMENT_TYPE,r.range=t.range,r.availabilityStartTime=l.calcAvailabilityStartTimeFromPresentationTime(o,t,m),r.availabilityEndTime=l.calcAvailabilityEndTimeFromPresentationTime(o+i.duration,t,m),r.representation=t,y(r,t.initialization,t))return r.url=Q(r.url,t.id,void 0,void 0,t.bandwidth),r}(0,t,_()):null},getLastSegment:function(){return p},getNextSegmentRequest:function(e,t){if(!t||!t.segmentInfoType)return null;if(function(e){return e&&p&&e.endNumber&&p.replacementNumber&&p.replacementNumber>=e.endNumber}(t))return h=!0,null;let{indexToRequest:n,subNumberOfPartialSegmentToRequest:r}=S(p);return C(0,t,n,r)},getNextSegmentRequestIdempotent:function(e,t){let n=null,{indexToRequest:r,subNumberOfPartialSegmentToRequest:i}=S(p),o=c.getSegmentByIndex(t,r,i,p);return o?(n=x(0,o),n):null},getSegmentRequestForTime:b,getStreamId:function(){return o.id},getStreamInfo:function(){return o},getType:_,getValidTimeAheadOfTargetTime:function(e,t,n,r){try{if(isNaN(e)||!t||!n)return NaN;if(e<0&&(e=0),isNaN(r)&&(r=.5),b(0,n,e))return e;if(n.adaptation.period.start+n.adaptation.period.duration<e)return NaN;let i=isFinite(n.adaptation.period.duration)?n.adaptation.period.start+n.adaptation.period.duration:e+30,o=Math.min(e+r,i),c=NaN,l=null;for(;o<=i;){let e=null;if(o<=i&&(e=b(0,n,o)),e){c=o,l=e;break}o+=r}if(l){let t=l.startTime+l.duration;return e>l.startTime&&t-e>r?e:!isNaN(l.startTime)&&e<l.startTime&&c>l.startTime?l.startTime+.001:Math.min(t-r,c)}return c}catch{return NaN}},initialize:function(e){m=e,h=!1,c.initialize(e)},isLastSegmentRequested:function(e,t){return!e||!p?!1:h?!0:!isFinite(e.adaptation.period.duration)||p.presentationStartTime+p.duration>t?!1:e.mediaFinishedInformation&&!isNaN(e.mediaFinishedInformation.numberOfSegments)&&!isNaN(p.index)&&p.index>=e.mediaFinishedInformation.numberOfSegments-1&&(!m||e.segmentInfoType===Y.default.SEGMENT_TEMPLATE||m&&e.segmentInfoType===Y.default.SEGMENT_LIST&&e.adaptation.period.nextPeriodId)?!0:!!(m&&e.adaptation.period.nextPeriodId&&e.segmentInfoType===Y.default.SEGMENT_TIMELINE&&e.mediaFinishedInformation&&!isNaN(e.mediaFinishedInformation.mediaTimeOfLastSignaledSegment)&&p&&!isNaN(p.mediaStartTime)&&!isNaN(p.duration)&&p.mediaStartTime+p.duration>=e.mediaFinishedInformation.mediaTimeOfLastSignaledSegment-.05)},repeatSegmentRequest:function(e,t){return t&&t.segmentInfoType?C(0,t,p?p.index:0,p&&p.isPartialSegment&&!isNaN(p.replacementSubNumber)?p.replacementSubNumber:NaN):null},reset:function(){v(),t.off(g.default.DYNAMIC_TO_STATIC,w,d)}},f=n.getLogger(d),v(),t.on(g.default.DYNAMIC_TO_STATIC,w,d),d}Ao.__dashjs_factory_name=`DashHandler`;var jo=i.default.getClassFactory(Ao);function Mo(e,t){let n=(e||={}).timelineConverter,r=e.dashMetrics,i;function o(e,r){if(function(){if(!n)throw Error(h.default.MISSING_CONFIG_ERROR)}(),!e)return null;r===void 0&&(r=null);let i=null,o=n.calcMediaTimeFromPresentationTime(r,e);return function(e,t){let n=function(e){return e.adaptation.period.mpd.manifest.Period[e.adaptation.period.index].AdaptationSet[e.adaptation.index].Representation[e.index].SegmentTemplate||e.adaptation.period.mpd.manifest.Period[e.adaptation.period.index].AdaptationSet[e.adaptation.index].Representation[e.index].SegmentList}(e),r=n.SegmentTimeline,i=n.SegmentURL,o,l,u,d,f,p,m=0,h=-1;p=e.timescale,o=r.S;let g=!1,_=o.length;for(u=0;u<_&&!g;u++)for(l=o[u],f=0,l.hasOwnProperty(`r`)&&(f=l.r),l.hasOwnProperty(`t`)&&(m=l.t),f<0&&(f=c(e,o[u+1],l,p,m/p)),d=0;d<=f&&!g;d++)h++,g=t({mediaTime:m,segmentBase:n,segmentURL:i,currentSElement:l,sElementCounterIncludingRepeats:h,sElementCounter:u}),g&&(e.segmentDuration=l.d/p),m+=l.d}(e,(function(r){let c=e.timescale;return function(r,o){let{mediaTime:c,segmentBase:l,segmentURL:u,currentSElement:d,sElementCounterIncludingRepeats:f,sElementCounter:p}=o,m=d.d,h=e.timescale;return r<c+m&&r>=c&&(function(r){let{segmentBase:o,segmentURL:c,sElementCounter:l,currentSElement:u,mediaTime:d,durationInTimescale:f,fTimescale:p,requiredMediaTimeInTimescaleUnits:m,sElementCounterIncludingRepeats:h}=r,g=function(e,t,n){let r=e.media;return t&&(r=t[n].media||``),r}(o,c,l),_=function(e,t,n){let r=e.mediaRange;return t&&(r=t[n].mediaRange),r}(u,c,l),v=Do(u),y=function(e){if(!e||e.totalNumberOfPartialSegments===void 0||isNaN(e.totalNumberOfPartialSegments)||e.totalNumberOfPartialSegments<1)return;let{durationInTimescale:t,requiredMediaTimeInTimescaleUnits:n,mediaTime:r,totalNumberOfPartialSegments:i}=e,o=t/i;for(let e=0;e<i;e++){let t=r+e*o;if(n>=t&&n<t+o)return e}return NaN}({durationInTimescale:f,requiredMediaTimeInTimescaleUnits:m,mediaTime:d,totalNumberOfPartialSegments:v});i=Eo({timelineConverter:n,isDynamic:t,representation:e,mediaTime:d,durationInTimescale:f,fTimescale:p,mediaUrl:g,mediaRange:_,index:h,tManifest:u.tManifest,totalNumberOfPartialSegments:v,subNumberOfPartialSegmentToRequest:y})}({segmentBase:l,segmentURL:u,sElementCounter:p,currentSElement:d,mediaTime:c,durationInTimescale:m,fTimescale:h,requiredMediaTimeInTimescaleUnits:r,sElementCounterIncludingRepeats:f}),!0)}(parseFloat((o*c).toPrecision(15)),r)})),i}function c(e,t,i,o,c){let l;if(t&&t.hasOwnProperty(`t`))l=t.t/o;else try{let t=0;if(isNaN(e.adaptation.period.start)||isNaN(e.adaptation.period.duration)||!isFinite(e.adaptation.period.duration)){let e=r.getCurrentDVRInfo();t=isNaN(e.end)?0:e.end}else t=e.adaptation.period.start+e.adaptation.period.duration;l=n.calcMediaTimeFromPresentationTime(t,e),e.segmentDuration=i.d/o}catch{l=0}return Math.max(Math.ceil((l-c)/(i.d/o))-1,0)}return i={getMediaFinishedInformation:function(e){if(!e)return 0;let t=(e.adaptation.period.mpd.manifest.Period[e.adaptation.period.index].AdaptationSet[e.adaptation.index].Representation[e.index].SegmentTemplate||e.adaptation.period.mpd.manifest.Period[e.adaptation.period.index].AdaptationSet[e.adaptation.index].Representation[e.index].SegmentList).SegmentTimeline,n,r,i,o,l,u,d=0,f=0,p=0;u=e.timescale,n=t.S;let m=n.length;for(i=0;i<m;i++)for(r=n[i],l=0,r.hasOwnProperty(`r`)&&(l=r.r),r.hasOwnProperty(`t`)&&(d=r.t,f=d/u),l<0&&(l=c(e,n[i+1],r,u,f)),o=0;o<=l;o++)p++,d+=r.d,f=d/u;return{numberOfSegments:p,mediaTimeOfLastSignaledSegment:f}},getSegmentByIndex:function(e,t){return e?o(e,t&&!isNaN(t.presentationStartTime)?t.presentationStartTime+t.duration+.01:0):null},getSegmentByTime:o},i}Mo.__dashjs_factory_name=`TimelineSegmentsGetter`;var No=i.default.getClassFactory(Mo);function Po(e,t){let n=(e||={}).timelineConverter,r;function i(e,r,i){if(!e)return null;let c=o(e),l=Do(c);l!==void 0&&l>=0&&(i=i!==void 0&&i<l?i:0);let u=To({index:r=Math.max(r,0),isDynamic:t,mediaTime:Math.round(r*e.segmentDuration*e.timescale,10),mediaUrl:c.media,representation:e,subNumberOfPartialSegmentToRequest:i,timelineConverter:n,totalNumberOfPartialSegments:l});return u&&e.endNumber&&u.replacementNumber>e.endNumber?null:u}function o(e){return e.adaptation.period.mpd.manifest.Period[e.adaptation.period.index].AdaptationSet[e.adaptation.index].Representation[e.index].SegmentTemplate}return r={getMediaFinishedInformation:function(e){let t={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};if(!e)return t;let n=e.segmentDuration;return isNaN(n)?t.numberOfSegments=1:t.numberOfSegments=Math.ceil(e.adaptation.period.duration/n),t},getSegmentByIndex:i,getSegmentByTime:function(e,t){if(!e)return null;let r=e.segmentDuration;if(isNaN(r))return null;let c=n.calcPeriodRelativeTimeFromMpdRelativeTime(e,t),l=o(e),u=Math.floor(c/r);return i(e,u,function(e){if(!e||e.totalNumberOfPartialSegments===void 0||isNaN(e.totalNumberOfPartialSegments)||e.totalNumberOfPartialSegments<1)return;let{totalNumberOfPartialSegments:t,representation:n,requestedTimeRelativeToPeriodStart:r,indexWithoutStartNumber:i}=e,o=i*n.segmentDuration,c=n.segmentDuration/t,l=r-o,u=Math.floor(l/c);return u=Math.max(0,Math.min(u,t-1)),u}({totalNumberOfPartialSegments:Do(l),representation:e,requestedTimeRelativeToPeriodStart:c,indexWithoutStartNumber:u}))}},r}Po.__dashjs_factory_name=`TemplateSegmentsGetter`;var Fo=i.default.getClassFactory(Po);function Io(e,t){let n=(e||={}).timelineConverter,r;function i(){if(!n||!n.hasOwnProperty(`calcPeriodRelativeTimeFromMpdRelativeTime`))throw Error(h.default.MISSING_CONFIG_ERROR)}function o(e,r){if(i(),!e)return null;let o=e.adaptation.period.mpd.manifest.Period[e.adaptation.period.index].AdaptationSet[e.adaptation.index].Representation[e.index].SegmentList,c=o.SegmentURL.length,l=e&&!isNaN(e.startNumber)?e.startNumber:1,u=Math.max(l-1,0),d=Math.max(r-u,0),f=null;if(d<c){let i=o.SegmentURL[d];f=To({index:r,isDynamic:t,mediaRange:i.mediaRange,mediaTime:(l+r-1)*e.segmentDuration,representation:e,timelineConverter:n}),f&&(f.media=i.media?i.media:``,f.indexRange=i.indexRange)}return f}return r={getSegmentByIndex:o,getSegmentByTime:function(e,t){if(i(),!e)return null;let r=e.segmentDuration;if(isNaN(r))return null;let c=n.calcPeriodRelativeTimeFromMpdRelativeTime(e,t);return o(e,Math.floor(c/r))},getMediaFinishedInformation:function(e){let t={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};if(!e)return t;let n=e.adaptation.period.mpd.manifest.Period[e.adaptation.period.index].AdaptationSet[e.adaptation.index].Representation[e.index].SegmentList,r=e&&!isNaN(e.startNumber)?e.startNumber:1;return t.numberOfSegments=Math.max(r-1,0)+n.SegmentURL.length,t}},r}Io.__dashjs_factory_name=`ListSegmentsGetter`;var Lo=i.default.getClassFactory(Io);function Ro(e){let t=(e||={}).timelineConverter,n;function r(){if(!t||!t.hasOwnProperty(`calcPeriodRelativeTimeFromMpdRelativeTime`))throw Error(h.default.MISSING_CONFIG_ERROR)}function i(e,t){if(r(),!e)return null;let n=e.segments?e.segments.length:-1,i;if(t<n&&(i=e.segments[t],i&&i.index===t))return i;for(let r=0;r<n;r++)if(i=e.segments[r],i&&i.index===t)return i;return null}return n={getSegmentByIndex:i,getSegmentByTime:function(e,t){return r(),i(e,function(e,t){if(!e)return-1;let n=e.segments,r=n?n.length:null,i,o,c,l,u,d=-1;if(n&&r>0){for(u=0;u<r;u++)if(o=n[u],c=o.presentationStartTime,l=o.duration,i=l/2,t+i>=c&&t-i<c+l){d=o.index;break}}return d}(e,t))},getMediaFinishedInformation:function(e){let t={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};return e&&e.segments&&(t.numberOfSegments=e.segments.length),t}},n}Ro.__dashjs_factory_name=`SegmentBaseGetter`;var zo=i.default.getClassFactory(Ro);function Bo(e){e||={};let t=this.context,n=e.dashConstants,r=e.type,i=e.segmentBaseController,o,c;function l(e){return e?e.segments?c[n.SEGMENT_BASE]:c[e.segmentInfoType]:null}return o={initialize:function(r){c[n.SEGMENT_TIMELINE]=No(t).create(e,r),c[n.SEGMENT_TEMPLATE]=Fo(t).create(e,r),c[n.SEGMENT_LIST]=Lo(t).create(e,r),c[n.SEGMENT_BASE]=zo(t).create(e,r)},updateInitData:function(e,t){return t?Promise.resolve():i.getSegmentBaseInitSegment({representation:e,mediaType:r})},updateSegmentData:function(e,t){return t?Promise.resolve():i.getSegmentList({mimeType:e.mimeType,representation:e,mediaType:r})},getSegmentByIndex:function(e,t,r,i){let o=l(e);return o?e.segmentInfoType?e.segmentInfoType===n.SEGMENT_TIMELINE?o.getSegmentByIndex(e,i):e.segmentInfoType===n.SEGMENT_TEMPLATE?o.getSegmentByIndex(e,t,r):o.getSegmentByIndex(e,t):o.getSegmentByIndex(e,t):null},getSegmentByTime:function(e,t){let n=l(e);return n?n.getSegmentByTime(e,t):null},getMediaFinishedInformation:function(e){let t=l(e);return t?t.getMediaFinishedInformation(e):{numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN}}},c={},o}Bo.__dashjs_factory_name=`SegmentsController`;var Vo=i.default.getClassFactory(Bo);function Ho(){let e;return e={ntpToUTC:function(e){let t=new Date(Date.UTC(1900,0,1,0,0,0));return new Date(t.getTime()+e).getTime()}},e}Ho.__dashjs_factory_name=`TimeUtils`;var Uo=i.default.getSingletonFactory(Ho);function Wo(e){e||={};let t,n,r,i,o,u,d,f,_,v,y,b,x,S,C,w,E,D,O=this.context,k=(0,p.default)(O).getInstance(),A=e.abrController,j=e.adapter,M=e.boxParser,N=e.capabilities,P=e.dashMetrics,F=e.errHandler,I=e.fragmentModel,L=e.manifestModel,R=e.mediaController,z=e.mediaPlayerModel,B=e.mimeType,V=e.playbackController,H=e.segmentBlacklistController,U=e.settings,W=e.streamInfo,G=e.textController,K=e.timelineConverter,ee=e.type;function q(){return W.id}function te(){return ee}function ne(){v=[],i=null,n=0,E=!1,w=!1,b=!1,u=null,D=!1,fe()}function re(e){return!isNaN(e)&&!isNaN(W.duration)&&isFinite(W.duration)&&e>=W.start+W.duration}function ie(e,n=!0){if(e.sender){if(V.getIsManifestUpdateInProgress())oe();else if((!i.isText||G.isTextEnabled())&&t&&e.representationId&&!t.appendInitSegmentFromCache(e.representationId)){let e=x.getCurrentRepresentation();if(e.range===0)return void J();let t=o?o.getInitRequest(i,e):null;t?I.executeRequest(t):n&&(S.setInitSegmentRequired(!0),oe())}}}function J(e,r=!0){if(V.getIsManifestUpdateInProgress()||t.getIsPruningInProgress())return void oe();let c=function(){let e;if(isNaN(n)||te()===h.default.TEXT&&!G.isTextEnabled())return null;if(o){let t=ke();e=E?o.getSegmentRequestForTime(i,t,n):w?o.repeatSegmentRequest(i,t):o.getNextSegmentRequest(i,t)}return e}();c?(E=!1,w=!1,function(e){isNaN(e.startTime+e.duration)||(n=e.startTime+e.duration),e.delayLoadingTime=new Date().getTime()+S.getTimeToLoadDelay(),S.setTimeToLoadDelay(0),function(e){let t=e.url;return e.range&&(t=t.concat(`_`,e.range)),H.contains(t)}(e)?(_.warn(`Fragment request url ${e.url} for stream id ${W.id} and media type ${ee} is on the ignore list and will be skipped`),oe()):(_.debug(`Next fragment request url for stream id ${W.id} and media type ${ee} is ${e.url} with request range ${e.range}`),I.executeRequest(e))}(c)):function(e){let t=x.getCurrentRepresentation();try{if(U.get().streaming.gaps.enableSeekFix&&(E||V.getTime()===0)){let r;if(f?f&&t.segmentInfoType===Y.default.SEGMENT_TIMELINE&&(r=function(e){return o.getValidTimeAheadOfTargetTime(n,i,e,U.get().streaming.gaps.threshold)}(t)):r=function(e){let t=o.getValidTimeAheadOfTargetTime(n,i,e,U.get().streaming.gaps.threshold);return isNaN(t)&&n>=e.adaptation.period.mpd.mediaPresentationDuration-e.segmentDuration&&(t=n-.1),t}(t),!isNaN(r)&&r!==n)return void function(e,t){V.isSeeking()||V.getTime()===0?(_.warn(`Adjusting playback time ${e} because of gap in the manifest. Seeking by ${e-n}`),V.seek(e,!1,!1)):(_.warn(`Adjusting buffering time ${e} because of gap in the manifest. Adjusting time by ${e-n}`),Le(e),t&&oe())}(r,e)}}catch(e){_.error(e)}ae()||e&&oe()}(r)}function ae(){let e=x.getCurrentRepresentation(),r=o.isLastSegmentRequested(e,n);if(r){let e=o.getCurrentIndex();_.debug(`Segment requesting for stream ${W.id} has finished`),k.trigger(m.default.STREAM_REQUESTING_COMPLETED,{segmentIndex:e},{streamId:W.id,mediaType:ee}),t.segmentRequestingCompleted(e),Oe()}return r}function oe(){let e=z.getScheduleTimeout();S.startScheduleTimer(e)}function ce(e){P.addBufferState(ee,e.state,S.getBufferTarget()),e.state!==c.BUFFER_EMPTY||V.isSeeking()||(_.info(`Buffer is empty! Stalling!`),P.pushPlayListTraceMetrics(new Date,Vi.REBUFFERING_REASON))}function le(e){I.syncExecutedRequestsWithBufferedRange(t.getBuffer().getAllBufferRanges(),W.duration),e.quotaExceeded&&e.from>V.getTime()&&Le(e.from),e.hasEnoughSpaceToAppend&&e.quotaExceeded&&S.startScheduleTimer()}function ue(e){if(!e||!e.lastRequestAppended||!e.lastRequestAppended.url)return;let t=e.lastRequestAppended.url;e.lastRequestAppended.range&&(t=t.concat(`_`,e.lastRequestAppended.range)),_.warn(`Blacklisting segment with url ${t}`),H.add(t)}function de(e){if(_.debug(`Appended bytes for ${e.mediaType} and stream id ${e.streamId}`),e.segmentType===T.HTTPRequest.INIT_SEGMENT_TYPE){let t=e.representationId;S.setLastInitializedRepresentationId(t),_.info(`[`+ee+`] lastInitializedRepresentationId changed to `+t)}y&&y.enabled?ye(y.newRepresentation,y.oldRepresentation):D||S.startScheduleTimer(0)}function fe(){y={newRepresentation:null,oldRepresentation:null,enabled:!1}}function pe(e){return new Promise((n=>{if(!x)return Promise.resolve();let r=null;var o;r=e.newRepresentation?{selectedRepresentation:(o=e).newRepresentation,currentMediaInfo:o.newMediaInfo}:i!==null&&j.areMediaInfosEqual(i,e.newMediaInfo)?function(e){return{currentMediaInfo:e.newMediaInfo,selectedRepresentation:x.getCurrentRepresentation()}}(e):function(e){let t=NaN;return t=!U.get().streaming.abr.autoSwitchBitrate[e.newMediaInfo.type]&&e.previouslySelectedRepresentation?e.previouslySelectedRepresentation.bitrateInKbit:A.getInitialBitrateFor(ee),{selectedRepresentation:A.getOptimalRepresentationForBitrate(e.newMediaInfo,t,!1),currentMediaInfo:e.newMediaInfo}}(e),me(r.currentMediaInfo),k.trigger(),function(e){u&&e.selectedRepresentation.dependentRepresentation&&(_.info(`[`+ee+`] selectMediaInfo : call selectMediaInfo on enhancementStreamProcessor for index = `+e.selectedRepresentation.absoluteIndex),u.selectMediaInfo(new io({newMediaInfo:e.selectedRepresentation.mediaInfo,newRepresentation:e.selectedRepresentation})))}(r);let c=A.getPossibleVoRepresentations(i,!1);return x.updateData(c,i.isFragmented,r.selectedRepresentation.id).then((()=>{(function(){let e=x.getCurrentCompositeRepresentation();t.getIsBufferingCompleted()||t.updateBufferTimestampOffset(e)})(),n()})).catch((e=>{_.error(e),n()}))}))}function me(e){j.areMediaInfosEqual(i,e)||k.trigger(g.default.NEW_TRACK_SELECTED,{value:e}),i=e,A.handleNewMediaInfo(i),k.trigger(m.default.MEDIAINFO_UPDATED,{mediaType:ee,streamId:W.id,currentMediaInfo:i})}function he(e){let n=e.newRepresentation,r=e.oldRepresentation,o=Re();n&&r||_.warn(`_handleDifferentSwitchTypes() is missing the target representations`),e.reason&&e.reason.forceReplace?function(e,n){I.abortRequests(),k.trigger(m.default.BUFFER_REPLACEMENT_STARTED,{mediaType:ee,streamId:W.id},{mediaType:ee,streamId:W.id}),S.setShouldCheckPlaybackQuality(!1),t.prepareForForceReplacementQualitySwitch(e,n).then((()=>{ge()})).catch((()=>{ge()}))}(n,r):e&&e.reason&&e.reason.forceAbandon?function(e,n){t.prepareForAbandonQualitySwitch(e,n).then((()=>{_e()})).catch((()=>{_e()}))}(n,r):!z.getFastSwitchEnabled()||o&&o.isPartialSegment?ye(n,r):function(e,n){let r=V.getTime(),o=1.5*(isNaN(e.fragmentDuration)?1:e.fragmentDuration),l=I.getRequests({state:se.FRAGMENT_MODEL_EXECUTED,time:r+o,threshold:0})[0];if(l&&!i.isText){let i=t.getBufferLevel(),u=A.getAbandonmentStateFor(W.id,ee);l.bandwidth<e.bandwidth&&i>=o&&u===c.ALLOW_LOAD?t.prepareForFastQualitySwitch(e,n).then((()=>{ve(r,o)})).catch((()=>{ve(r,o)})):ye(e,n)}else ye(e,n)}(n,r),P.pushPlayListTraceMetrics(new Date,Vi.REPRESENTATION_SWITCH_STOP_REASON),P.createPlaylistTraceMetrics(n.id,1e3*V.getTime(),V.getPlaybackRate())}function ge(){Pe(),fe(),b=!1}function _e(){I.abortRequests(),w=!0,S.setShouldCheckPlaybackQuality(!1),S.startScheduleTimer(),b=!1}function ve(e,t){I.abortRequests(),Le(e+t),S.setShouldCheckPlaybackQuality(!1),S.startScheduleTimer(),b=!1}function ye(e,n){let r=I.getRequests({state:se.FRAGMENT_MODEL_LOADING});if(r&&r.length>0)return _.debug(`Preparing for default quality switch: Waiting for ongoing segment request to be finished before applying switch.`),y.newRepresentation=e,y.oldRepresentation=n,void(y.enabled=!0);t.prepareForDefaultQualitySwitch(e,n).then((()=>{be()})).catch((()=>{be()}))}function be(){S.setShouldCheckPlaybackQuality(!1),i.segmentAlignment||i.subSegmentAlignment?S.startScheduleTimer():Fe(),fe(),b=!1}function xe(e){_.info(`onFragmentLoadingAbandoned request: `+e.request.url+` has been aborted`),V.isSeeking()||S.getSwitchTrack()||b||(_.info(`onFragmentLoadingAbandoned request: `+e.request.url+` has to be downloaded again, origin is not seeking process or switch track call`),e.request&&e.request.isInitializationRequest()?S.setInitSegmentRequired(!0):Le(e.request.startTime+e.request.duration/2),S.startScheduleTimer(0))}function Se(e){_.info(`OnFragmentLoadingCompleted for stream id `+W.id+` and media type `+ee+` - Url:`,e.request?e.request.url:`undefined`,e.request.range?`, Range:`+e.request.range:``),i.isText&&S.startScheduleTimer(0),e.error&&e.request.serviceLocation&&function(e){_.info(`Fragment loading completed with an error`),e&&e.request&&e.request.type&&(e.request.type===T.HTTPRequest.INIT_SEGMENT_TYPE?ie({representationId:e.request.representation.id,sender:{}},!1):e.request.type===T.HTTPRequest.MEDIA_SEGMENT_TYPE&&(Le(e.request.startTime+e.request.duration/2),J(0,!1)))}(e)}function Ce(){Le(V.getTime()),De().startScheduleTimer()}function we(e){let n=e.currentTrackInfo;if(!n)return;let r=v.find((e=>e.index===n.index&&e.lang===n.lang));r&&pe(new io({newMediaInfo:r})).then((()=>{t.setIsBufferingCompleted(!1),Le(V.getTime()),S.setInitSegmentRequired(!0),S.startScheduleTimer()}))}function Te(e){Le(e.quotaExceededTime),Oe()}function Ee(){return t?t.getBuffer():null}function De(){return S}function Oe(){S&&S.clearScheduleTimer()}function ke(e=NaN){let t;return isNaN(e)?t=x?x.getCurrentRepresentation():null:((0,Ve.checkInteger)(e),t=x?x.getRepresentationById(e):null),t}function Ae(){return!!t&&t.getIsBufferingCompleted()}function je(e){if(!U.get().streaming.enableManifestTimescaleMismatchFix)return;let t=e.chunk,n=t.bytes,r=ke(t.representation.id);r&&(r.timescale=M.getMediaTimescaleFromMoov(n))}function Me(e){let t=e.chunk,n=t.bytes,r=ke(t.representation.id);if(r){let t;if(U.get().streaming.parseInbandPrft&&e.request.type===T.HTTPRequest.MEDIA_SEGMENT_TYPE){t||=M.parse(n);let e=function(e,t){let n=e.getBoxes(`prft`),r=[];return n.forEach((e=>{r.push(function(e,t){let n=`unknown`;switch(e.flags){case 0:n=Y.default.PRODUCER_REFERENCE_TIME_TYPE.ENCODER;break;case 16:n=Y.default.PRODUCER_REFERENCE_TIME_TYPE.APPLICATION;break;case 24:n=Y.default.PRODUCER_REFERENCE_TIME_TYPE.CAPTURED}let r=1e3*e.ntp_timestamp_sec+e.ntp_timestamp_frac/2**32*1e3;return r=Uo(O).getInstance().ntpToUTC(r),{type:n,ntpTimestamp:r,mediaTime:e.media_time/t}}(e,t))})),r}(t,r.timescale);e&&e.length&&k.trigger(g.default.INBAND_PRFT,{data:e},{streamId:W.id,mediaType:ee})}let i=j.getEventsFor(r.mediaInfo,null,W),o=j.getEventsFor(r,r,W);if(i&&i.length>0||o&&o.length>0){let r=e.request;t||=M.parse(n);let c=function(e,t,n,r){try{let i={},o=[],c=n.concat(r);for(let e=0,t=c.length;e<t;e++)i[c[e].schemeIdUri+`/`+c[e].value]=c[e];let l=e.getBoxes(`emsg`);if(!l||l.length===0)return o;let u=e.getBox(`sidx`),d=!u||isNaN(u.earliest_presentation_time)||isNaN(u.timescale)?t&&!isNaN(t.mediaStartTime)?t.mediaStartTime:0:u.earliest_presentation_time/u.timescale,f=Math.max(d,0),p=x.getCurrentRepresentation();for(let e=0,t=l.length;e<t;e++){let t=j.getEvent(l[e],i,f,p);t&&o.push(t)}return o}catch{return[]}}(t,r,i,o);k.trigger(m.default.INBAND_EVENTS,{events:c},{streamId:W.id})}}}function Pe(){let e=V.getTime();U.get().streaming.buffer.flushBufferAtTrackSwitch&&V.seek(e+.001,!1,!0),Le(e),t.setSeekTarget(e),S.startScheduleTimer()}function Fe(){let e=V.getTime(),n=t.getContinuousBufferTimeForTargetTime(e);Le(isNaN(n)?e:n),S.startScheduleTimer()}function Ie(e){e&&!isNaN(e.time)&&(Le(e.time),t.setSeekTarget(e.time))}function Le(e){n=e,E=!0}function Re(){return o.getLastSegment()}return d={checkAndHandleCompletedBuffering:ae,clearScheduleTimer:Oe,createBufferSinks:function(e,n){let r=Ee();return r?Promise.resolve(r):t?t.createBufferSink(i,e,n):Promise.resolve(null)},dischargePreBuffer:function(){t.dischargePreBuffer()},finalisePlayList:function(e,t){P.pushPlayListTraceMetrics(e,t)},getAllMediaInfos:function(){return v},getBuffer:Ee,getBufferController:function(){return t},getBufferLevel:function(){return t?t.getBufferLevel():0},getFragmentModel:function(){return I},getLastSegment:Re,getMediaInfo:function(){return i},getMediaSource:function(){return t.getMediaSource()},getRepresentation:ke,getRepresentationController:function(){return x},getScheduleController:De,getStreamId:q,getStreamInfo:function(){return W},getType:te,initialize:function(i,c,u){C=Vo(O).create({events:m.default,eventBus:k,streamInfo:W,timelineConverter:K,dashConstants:Y.default,segmentBaseController:e.segmentBaseController,type:ee}),o=jo(O).create({baseURLController:e.baseURLController,boxParser:M,constants:h.default,dashConstants:Y.default,dashMetrics:P,debug:(0,l.default)(O).getInstance(),errHandler:F,errors:Ne,eventBus:k,events:m.default,mediaPlayerModel:z,segmentsController:C,settings:U,streamInfo:W,timelineConverter:K,type:ee,urlUtils:ht(O).getInstance()}),f=W.manifestInfo.isDynamic,o.initialize(f),A.registerStreamType(ee,d),x=ko(O).create({abrController:A,adapter:j,dashConstants:Y.default,dashMetrics:P,errors:Ne,eventBus:k,events:m.default,isDynamic:f,playbackController:V,segmentsController:C,streamInfo:W,timelineConverter:K,type:ee}),t=function(e,t){let n=null;return e?(n=e!==h.default.TEXT||t?ho(O).create({abrController:A,capabilities:N,errHandler:F,fragmentModel:I,manifestModel:L,mediaController:R,mediaPlayerModel:z,playbackController:V,representationController:x,settings:U,streamInfo:W,textController:G,type:e}):vo(O).create({errHandler:F,fragmentModel:I,mimeType:B,settings:U,streamInfo:W,textController:G,type:e}),n):(F.error(new Be.default(Ne.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,Ne.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+`not properly defined`)),null)}(ee,u),t&&t.initialize(i),S=bo(O).create({abrController:A,adapter:j,bufferController:t,dashMetrics:P,fragmentModel:I,mediaController:R,mediaPlayerModel:z,mimeType:B,playbackController:V,representationController:x,settings:U,streamInfo:W,textController:G,type:ee}),r=c,S.initialize(c),n=0,E=!1,w=!1},isBufferingCompleted:Ae,prepareInnerPeriodPlaybackSeeking:function(e){return new Promise((n=>{if(t.hasBufferAtTime(e.seekTime))return t.pruneBuffer(),re(t.getContinuousBufferTimeForTargetTime(e.seekTime))&&t.setIsBufferingCompleted(!0),void n();Oe(),I.abortRequests(),t.prepareForPlaybackSeek().then((()=>{let n=t.getAllRangesWithSafetyFactor(e.seekTime);return t.clearBuffers(n)})).then((()=>{let r=t.getContinuousBufferTimeForTargetTime(e.seekTime);if(re(r))t.setIsBufferingCompleted(!0),n();else{let i=isNaN(r)?e.seekTime:r;Le(i),t.setSeekTarget(i);let o=[];o.push(t.updateAppendWindow());let c=ke();o.push(t.updateBufferTimestampOffset(c)),Promise.all(o).then((()=>{S.setInitSegmentRequired(!0),S.setShouldCheckPlaybackQuality(!1),S.startScheduleTimer(),n()}))}})).catch((e=>{_.error(e)}))}))},prepareOuterPeriodPlaybackSeeking:function(){return new Promise(((e,n)=>{try{Oe(),I.abortRequests(),t.prepareForPlaybackSeek().then((()=>t.pruneAllSafely())).then((()=>{e()}))}catch(e){n(e)}}))},prepareQualityChange:function(e){e.newRepresentation&&(function(e){if(u)u.prepareQualityChange(e);else if(ee===h.default.ENHANCEMENT){let t=e.oldRepresentation.mediaInfo.type,n=e.newRepresentation.mediaInfo.type;if(t===h.default.ENHANCEMENT&&n===h.default.VIDEO)return _.info(`Stop `+ee+` stream processor`),S.reset(),!0;if(t===h.default.VIDEO&&n===h.default.ENHANCEMENT)return _.info(`Start `+ee+` stream processor`),pe(new io({newMediaInfo:e.newRepresentation.mediaInfo,newRepresentation:e.newRepresentation})).then((()=>{S.setup(),S.initialize(r),S.startScheduleTimer()})),!0}return!1}(e)||(y&&y.enabled&&_.warn(`Canceling queued representation switch to ${y.newRepresentation.id} for ${ee}`),e.isAdaptationSetSwitch?(_.debug(`Preparing quality switch to different AdaptationSet for type ${ee} from representation id ${e.oldRepresentation.id} to ${e.newRepresentation.id}`),function(e){let t=e.newRepresentation;b=!0,Oe(),S.setSwitchTrack(!0);let n=t.mediaInfo;me(n),pe(new io({newMediaInfo:n,newRepresentation:t})).then((()=>{he(e)}))}(e)):(_.debug(`Preparing quality within the same AdaptationSet for type ${ee} from representation id ${e.oldRepresentation.id} to ${e.newRepresentation.id}`),function(e){let t=e.newRepresentation;b=!0,Oe(),x.prepareQualityChange(t),he(e)}(e))))},prepareTrackSwitch:function(e,n=!1){return new Promise((r=>{_.debug(`Preparing track switch for type ${ee}`);let i=ee===h.default.TEXT||n||U.get().streaming.trackSwitchMode[ee]===h.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE&&V.getTimeToStreamEnd(W)>U.get().streaming.buffer.stallThreshold;t.getIsBufferingCompleted()&&!i?function(e){return new Promise((n=>{let r=x.getCurrentRepresentation();t.prepareForNonReplacementTrackSwitch(r,e).then((()=>{k.trigger(m.default.BUFFERING_COMPLETED,{},{streamId:W.id,mediaType:ee}),n()})).catch((()=>{k.trigger(m.default.BUFFERING_COMPLETED,{},{streamId:W.id,mediaType:ee}),n()}))}))}(e).then((()=>{r()})):(S.setSwitchTrack(!0),i?function(e){return new Promise((n=>{k.trigger(m.default.BUFFER_REPLACEMENT_STARTED,{mediaType:ee,streamId:W.id},{mediaType:ee,streamId:W.id}),I.abortRequests();let r=ke();t.prepareForReplacementTrackSwitch(r,e).then((()=>{Pe(),n()})).catch((()=>{Pe(),n()}))}))}(e).then((()=>{r()})):function(e){return new Promise((n=>{let r=()=>{let i=I.getRequests({state:se.FRAGMENT_MODEL_LOADING});if(i&&i.length!==0)k.once(g.default.FRAGMENT_LOADING_COMPLETED,r,d);else{let r=ke();t.prepareForNonReplacementTrackSwitch(r,e).then((()=>{Fe(),n()})).catch((e=>{_.error(e),Fe(),n()}))}};r()}))}(e).then((()=>{r()})))}))},probeNextRequest:function(){let e=ke();return o.getNextSegmentRequestIdempotent(i,e)},reset:function(e,n){o&&o.reset(),t&&=(t.reset(e,n),null),S&&=(S.reset(),null),x&&=(x.reset(),null),C&&=null,A&&A.unRegisterStreamType(q(),ee),k.off(m.default.BUFFER_CLEARED,le,d),k.off(m.default.BUFFER_LEVEL_STATE_CHANGED,ce,d),k.off(m.default.BYTES_APPENDED_END_FRAGMENT,de,d),k.off(m.default.FRAGMENT_LOADING_ABANDONED,xe,d),k.off(m.default.FRAGMENT_LOADING_COMPLETED,Se,d),k.off(m.default.INIT_FRAGMENT_LOADED,je,d),k.off(m.default.INIT_FRAGMENT_NEEDED,ie,d),k.off(m.default.MEDIA_FRAGMENT_LOADED,Me,d),k.off(m.default.MEDIA_FRAGMENT_NEEDED,J,d),k.off(m.default.QUOTA_EXCEEDED,Te,d),k.off(m.default.SEEK_TARGET,Ie,d),k.off(m.default.SET_FRAGMENTED_TEXT_AFTER_DISABLED,Ce,d),k.off(m.default.SET_NON_FRAGMENTED_TEXT,we,d),k.off(m.default.SOURCE_BUFFER_ERROR,ue,d),ne(),ee=null,W=null},selectMediaInfo:pe,setEnhancementStreamProcessor:function(e){u=e,_.info(`enhancementStreamProcessor = `+u)},setExplicitBufferingTime:Le,setMediaInfoArray:function(e){v=e},setMediaSource:function(e){return t.setMediaSource(e,i)},setTrackSwitchInProgress:function(e){D=e},updateStreamInfo:function(e){return W=e,Ae()?Promise.resolve():t.updateAppendWindow()}},_=(0,l.default)(O).getInstance().getLogger(d),ne(),k.on(m.default.BUFFER_CLEARED,le,d),k.on(m.default.BUFFER_LEVEL_STATE_CHANGED,ce,d),k.on(m.default.BYTES_APPENDED_END_FRAGMENT,de,d),k.on(m.default.FRAGMENT_LOADING_ABANDONED,xe,d),k.on(m.default.FRAGMENT_LOADING_COMPLETED,Se,d),k.on(m.default.INIT_FRAGMENT_LOADED,je,d),k.on(m.default.INIT_FRAGMENT_NEEDED,ie,d),k.on(m.default.MEDIA_FRAGMENT_LOADED,Me,d),k.on(m.default.MEDIA_FRAGMENT_NEEDED,J,d),k.on(m.default.QUOTA_EXCEEDED,Te,d),k.on(m.default.SEEK_TARGET,Ie,d),k.on(m.default.SET_FRAGMENTED_TEXT_AFTER_DISABLED,Ce,d),k.on(m.default.SET_NON_FRAGMENTED_TEXT,we,d),k.on(m.default.SOURCE_BUFFER_ERROR,ue,d),d}Wo.__dashjs_factory_name=`StreamProcessor`;var Go=i.default.getClassFactory(Wo),Ko=class{constructor(){this.url=null,this.width=null,this.height=null,this.x=null,this.y=null}},qo=class{constructor(){this.bitrate=0,this.width=0,this.height=0,this.tilesHor=0,this.tilesVert=0,this.widthPerTile=0,this.heightPerTile=0,this.startNumber=0,this.segmentDuration=0,this.timescale=0,this.templateUrl=``,this.id=``}};function Jo(e){let t=this.context,n=e.adapter,r=e.baseURLController,i=e.streamInfo,o=e.timelineConverter,c=e.debug,l=e.eventBus,u=e.events,d=e.dashConstants,f=ht(t).getInstance(),p,m,g,_,v,y,b,x,S;function C(e,t){let i=new qo;i.id=e.id,i.bitrate=e.bandwidth,i.width=e.width,i.height=e.height,i.tilesHor=1,i.tilesVert=1,e.essentialProperties&&e.essentialProperties.forEach((e=>{if(h.default.THUMBNAILS_SCHEME_ID_URIS.indexOf(e.schemeIdUri)>=0&&e.value){let t=e.value.split(`x`);t.length!==2||isNaN(t[0])||isNaN(t[1])||(i.tilesHor=parseInt(t[0],10),i.tilesVert=parseInt(t[1],10))}})),t?b.updateSegmentData(e).then((t=>{(function(e,t,i){let c=[];t.segments=function(e,t){let r=[],i,c,l,u,d=0;for(i=0,c=e.segments.length;i<c;i++)l=e.segments[i],u=Eo({durationInTimescale:l.duration,fTimescale:l.timescale,index:d,isDynamic:n.getIsDynamic(),mediaRange:l.mediaRange,mediaTime:l.startTime,mediaUrl:l.media,representation:t,timelineConverter:o}),u&&(r.push(u),u=null,d++);return r}(i,t),t.fragmentDuration=t.segmentDuration||(t.segments&&t.segments.length>0?t.segments[0].duration:NaN),e.segmentDuration=t.segments[0].duration,e.readThumbnail=function(e,n){let i=null;c.some((t=>{if(t.start<=e&&t.end>e)return i=t.url,!0})),i?n(i):t.segments.some((i=>{if(i.mediaStartTime<=e&&i.mediaStartTime+i.duration>e){let e=new $n({method:`get`,url:r.resolve(t.path).url,responseType:`arraybuffer`,customData:{request:{range:i.mediaRange},onloadend:function(e){let t=S.getSamplesInfo(e.target.response),r=new Blob([e.target.response.slice(t.sampleList[0].offset,t.sampleList[0].offset+t.sampleList[0].size)],{type:`image/jpeg`}),o=window.URL.createObjectURL(r);c.push({start:i.mediaStartTime,end:i.mediaStartTime+i.duration,url:o}),n&&n(o)}}}),o=new er({request:e});return x.load(e,o),!0}}))}})(i,e,t)})):(i.startNumber=e.startNumber,i.segmentDuration=e.segmentDuration,i.timescale=e.timescale,i.templateUrl=function(e){let t=f.isRelative(e.media)?f.resolve(e.media,r.resolve(e.path).url):e.media;return t?Q(t,e.id):``}(e)),i.tilesHor>0&&i.tilesVert>0&&(i.widthPerTile=i.width/i.tilesHor,i.heightPerTile=i.height/i.tilesVert,m.push(i))}function w(){m=[],g=[],v=-1,y=null,_&&=(_.reset(),null)}return p={addTracks:function(){if(!i||!n||(y=n.getMediaInfoForType(i,h.default.IMAGE),!y))return;let e=n.getVoRepresentations(y);e&&e.length>0&&e.forEach((e=>{(e.segmentInfoType===Y.default.SEGMENT_TEMPLATE&&e.segmentDuration>0&&e.media||e.segmentInfoType===Y.default.SEGMENT_TIMELINE)&&C(e),e.segmentInfoType===Y.default.SEGMENT_BASE&&C(e,!0),g.push(e)})),m.length>0&&m.sort(((e,t)=>e.bitrate-t.bitrate))},getCurrentTrack:function(){return v<0?null:m[v]},getCurrentTrackIndex:function(){return v},getRepresentations:function(){return g},getThumbnailRequestForTime:function(e){let t,r=n.getVoRepresentations(y);for(let e=0;e<r.length;e++)if(m[v].id===r[e].id){t=r[e];break}return _.getSegmentRequestForTime(y,t,e)},getTracks:function(){return m},reset:w,setTrackById:function(e){if(!m||m.length===0)return;let t=m.findIndex((t=>t.id===e));t!==-1&&(v=t)},setTrackByIndex:function(e){m&&m.length!==0&&(e>=m.length&&(e=m.length-1),v=e)}},w(),x=We(t).create({}),S=wr(t).getInstance(),b=Vo(t).create({events:u,eventBus:l,streamInfo:i,timelineConverter:o,dashConstants:d,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController,type:h.default.IMAGE}),_=jo(t).create({streamInfo:i,type:h.default.IMAGE,timelineConverter:o,segmentsController:b,baseURLController:r,debug:c,eventBus:l,events:u,dashConstants:d,urlUtils:f}),_.initialize(!!n&&n.getIsDynamic()),p}Jo.__dashjs_factory_name=`ThumbnailTracks`;var Yo=i.default.getClassFactory(Jo);function Xo(e){let t=this.context,n=e.streamInfo,r,i;function o(e){i.setTrackByIndex(e)}function c(){i&&i.reset()}return r={getCurrentTrack:function(){return i.getCurrentTrack()},getCurrentTrackIndex:function(){return i.getCurrentTrackIndex()},getPossibleVoRepresentations:function(){return i.getRepresentations()},getStreamId:function(){return n.id},initialize:function(){i.addTracks();let e=i.getTracks();e&&e.length>0&&o(0)},provide:function(e,t){if(typeof t!=`function`)return;let n=i.getCurrentTrack(),r,o;if(!n||n.segmentDuration<=0||e==null)return void t(null);o=i.getThumbnailRequestForTime(e),o&&(n.segmentDuration=o.duration),r=e%n.segmentDuration;let c=Math.floor(r*n.tilesHor*n.tilesVert/n.segmentDuration),l=new Ko;if(l.width=Math.floor(n.widthPerTile),l.height=Math.floor(n.heightPerTile),l.x=Math.floor(c%n.tilesHor)*n.widthPerTile,l.y=Math.floor(c/n.tilesHor)*n.heightPerTile,`readThumbnail`in n)return n.readThumbnail(e,(e=>{l.url=e,t(l)}));o?(l.url=o.url,n.segmentDuration=NaN):l.url=function(e,t){let n=t+e.startNumber;return Q(e.templateUrl,void 0,n,void 0,e.bandwidth,(n-1)*e.segmentDuration*e.timescale)}(n,Math.floor(e/n.segmentDuration)),t(l)},reset:c,setTrackByIndex:o,setTrackById:function(e){i.setTrackById(e)}},c(),i=Yo(t).create({streamInfo:n,adapter:e.adapter,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:e.debug,eventBus:e.eventBus,events:e.events,dashConstants:e.dashConstants,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController}),r}Xo.__dashjs_factory_name=`ThumbnailController`;var Zo=i.default.getClassFactory(Xo);let Qo=[h.default.VIDEO,h.default.AUDIO,h.default.TEXT,h.default.MUXED,h.default.IMAGE];function $o(e){e||={};let t=this.context,n=(0,p.default)(t).getInstance(),r=ht(t).getInstance(),i=e.manifestModel,o=e.mediaPlayerModel,c=e.dashMetrics,u=e.manifestUpdater,d=e.adapter,f=e.timelineConverter,_=e.capabilities,v=e.errHandler,y=e.abrController,b=e.playbackController,x=e.throughputController,S=e.eventController,C=e.mediaController,w=e.protectionController,T=e.textController,E=e.videoModel,D=e.streamInfo,O=e.settings,k,A,j,M,N,P,F,I,L,R,z,B,V,H,U,W;function G(e,t,n){return new Promise(((r,o)=>{ae(),se();let c=E.getElement(),l=[];Qo.forEach((t=>{if((t!==h.default.TEXT||e)&&(t!==h.default.VIDEO||!c||c&&/^VIDEO$/i.test(c.nodeName))){let r=n.find((e=>e.mediaInfo.type===t));l.push(K(t,e,r))}})),Promise.all(l).then((()=>function(e){return new Promise((t=>{let n={},r=H.map((t=>{let n=t.getRepresentation();return t.createBufferSinks(e,n)}));Promise.all(r).then((e=>{e.forEach((e=>{e&&(n[e.getType()]=e)})),t(n)})).catch((()=>{t(n)}))}))}(t))).then((t=>{if(H.length===0){let e=`No streams to play.`;v.error(new Be.default(Ne.MANIFEST_ERROR_ID_NOSTREAMS_CODE,e,i.getValue())),z.fatal(e)}else ve();e&&T.createTracks(D),r(t)})).catch((e=>{o(e)}))}))}function K(r,i,o){let c,l=d.getAllMediaInfoForType(D,r),u=[],f=null,p=-1;if(!l||l.length===0)return z.info(`No `+r+` data.`),Promise.resolve();r===h.default.VIDEO&&(P=!0),r===h.default.AUDIO&&(M=!0);for(let e=0,t=l.length;e<t;e++)f=l[e],r===h.default.TEXT&&f.isEmbedded&&(T.addEmbeddedTrack(D,f),u.push(f)),ee(f)&&C.addTrack(f),f.type===h.default.ENHANCEMENT&&(p=e);if(u.length>0&&(C.setInitialMediaSettingsForType(r,D),T.addMediaInfosToBuffer(D,r,u)),l=l.filter((e=>!e.isEmbedded)),l.length===0)return Promise.resolve();if(r===h.default.IMAGE)return U=Zo(t).create({streamInfo:D,adapter:d,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:A,eventBus:n,events:m.default,dashConstants:Y.default,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController}),U.initialize(),Promise.resolve();n.trigger(m.default.STREAM_INITIALIZING,{streamInfo:D,mediaInfo:f}),C.setInitialMediaSettingsForType(r,D);let g=q(l,i,r);if(p>=0){let e=new Za(n);e.open(),e.duration=D.manifestInfo.duration;let t=q(l,e,h.default.ENHANCEMENT);t.selectMediaInfo(new io({newMediaInfo:l[p]})),g.setEnhancementStreamProcessor(t)}if(c=C.getCurrentTrackFor(r,D.id),c){let e=new io({newMediaInfo:r===h.default.TEXT&&c.isEmbedded?l[0]:c,previouslySelectedRepresentation:o});return g.selectMediaInfo(e)}return Promise.resolve()}function ee(e){let t=e?e.type:null,n;return t===h.default.MUXED?(n=`Multiplexed representations are intentionally not supported, as they are not compliant with the DASH-AVC/264 guidelines`,z.fatal(n),v.error(new Be.default(Ne.MANIFEST_ERROR_ID_MULTIPLEXED_CODE,n,i.getValue())),!1):!(t!==h.default.TEXT&&t!==h.default.IMAGE&&e.contentProtection&&e.contentProtection.length>0&&!_.supportsEncryptedMedia()&&(v.error(new Be.default(Ne.CAPABILITY_MEDIAKEYS_ERROR_CODE,Ne.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE)),1))}function q(n,r,c){let l=n&&n.length>0?n.filter((e=>e.type===c))[0]:null,u=j.getModel(l?l.type:null),p=l?l.type:null,m=l?l.mimeType:null,g=l?l.isFragmented:null,S=Go(t).create({abrController:y,adapter:d,baseURLController:e.baseURLController,boxParser:k,capabilities:_,dashMetrics:e.dashMetrics,errHandler:v,fragmentModel:u,manifestModel:i,mediaController:C,mediaPlayerModel:o,mimeType:m,playbackController:b,segmentBaseController:e.segmentBaseController,segmentBlacklistController:V,settings:O,streamInfo:D,textController:T,throughputController:x,timelineConverter:f,type:p});return S.initialize(r,P,g),H.push(S),S.setMediaInfoArray(n),p===h.default.TEXT&&T.addMediaInfosToBuffer(D,p,n,u),S}function te(e){let t=H?H.length:0;for(let n=0;n<t;n++){let t=H[n].getFragmentModel();t.abortRequests(),t.resetInitialSettings(),H[n].reset(!1,e)}T&&T.deactivateStream(D),U&&=(U.reset(),null),H=[],I=!1,N=!1,ye(!1),re(!1),n.trigger(m.default.STREAM_DEACTIVATED,{streamInfo:D})}function ne(e){te(e),R=!1,P=!1,M=!1,L=!1,W=[]}function re(e){L=e}function ie(){return D?D.start:NaN}function J(){return D?D.id:null}function ae(){if(!E||!y)throw Error(h.default.MISSING_CONFIG_ERROR)}function oe(e){e.error&&(v.error(e.error),z.fatal(e.error.message))}function se(){if(S){let e=d.getEventsFor(D);e&&e.length>0&&S.addInlineEvents(e,D.id)}}function ce(e){let t=le(e);return t?t.getMediaInfo():null}function le(e){return e?H.find((t=>t.getType()===e)):null}function ue(){let e=ge(),t=e.length;if(t!==0){for(let n=0;n<t;n++)if(!e[n].isBufferingCompleted()&&(e[n].getType()===h.default.AUDIO||e[n].getType()===h.default.VIDEO))return void z.debug(`onBufferingCompleted - One streamProcessor has finished but`,e[n].getType(),`one is not buffering completed`);z.debug(`onBufferingCompleted - trigger STREAM_BUFFERING_COMPLETED`),N=!0,n.trigger(m.default.STREAM_BUFFERING_COMPLETED,{streamInfo:D},{streamInfo:D})}else z.warn(`onBufferingCompleted - can't trigger STREAM_BUFFERING_COMPLETED because no streamProcessor is defined`)}function de(e){S&&S.addInbandEvents(e.events,D.id)}function fe(){ve()}function pe(){se()}function me(e){return e&&e.type?he(e.type):null}function he(e){return e?ge().filter((function(t){return t.getType()===e}))[0]:null}function ge(){let e,t,n=[];for(let r=0;r<H.length;r++)t=H[r],e=t.getType(),e!==h.default.AUDIO&&e!==h.default.VIDEO&&e!==h.default.TEXT&&e!==h.default.ENHANCEMENT||n.push(t);return n}function _e(){let e=H.length;for(let t=0;t<e&&H[t];t++)H[t].getScheduleController().startScheduleTimer()}function ve(){let e=H.length;if(w){w.clearMediaInfoArray();for(let t=0;t<e&&H[t];t++){let e=H[t].getType(),n=H[t].getMediaInfo();if(e===h.default.AUDIO||e===h.default.VIDEO||e===h.default.TEXT&&n&&n.isFragmented){let e=H[t].getMediaInfo();e&&w.initializeForMedia(e)}}w.handleKeySystemFromManifest()}R||(R=!0,E.waitForReadyState(h.default.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,(()=>{n.trigger(m.default.STREAM_INITIALIZED,{streamInfo:D})})))}function ye(e){B=e}function be(){return B}return F={activate:function(e,t,r=[]){return new Promise(((i,o)=>{if(!I)return be()?(I=!0,n.trigger(m.default.STREAM_ACTIVATED,{streamInfo:D}),void i()):void function(e,t,n=[]){return G(e,t,n)}(e,t,r).then((()=>{I=!0,r&&r.length>0&&_e(),n.trigger(m.default.STREAM_ACTIVATED,{streamInfo:D}),i()})).catch((e=>{o(e)}));i()}))},checkAndHandleCompletedBuffering:function(){N||H.forEach((e=>{e.checkAndHandleCompletedBuffering()}))},deactivate:te,getAdapter:function(){return d},getCurrentMediaInfoForType:function(e){let t=he(e);return t?t.getMediaInfo():null},getCurrentRepresentationForType:function(e){let t=he(e);return t?t.getRepresentation():null},getDuration:function(){return D?D.duration:NaN},getHasAudioTrack:function(){return M},getHasFinishedBuffering:function(){return N},getHasVideoTrack:function(){return P},getId:J,getIsActive:function(){return I},getIsEndedEventSignaled:function(){return L},getPreloaded:be,getRepresentationForTypeById:function(e,t){let n;if(e===h.default.IMAGE){if(!U)return null;n=U.getPossibleVoRepresentations()}else n=function(e){let t=le(e);return t?t.getAllMediaInfos():[]}(e).flatMap((e=>y.getPossibleVoRepresentationsFilteredBySettings(e,!0)));if(!n||n.length===0)return null;let r=n.filter((e=>e.id===t));return r&&r.length>0?r[0]:null},getRepresentationForTypeByIndex:function(e,t){let n;if(e===h.default.IMAGE){if(!U)return null;n=U.getPossibleVoRepresentations()}else{let t=ce(e);n=y.getPossibleVoRepresentationsFilteredBySettings(t,!0)}return n[t=Math.max(Math.min(t,n.length-1),0)]},getRepresentationsByType:function(e){if(ae(),e===h.default.IMAGE)return U?U.getPossibleVoRepresentations():[];let t=ce(e);return y.getPossibleVoRepresentationsFilteredBySettings(t,!0)},getStartTime:ie,getStreamId:function(){return D?D.id:null},getStreamInfo:function(){return D},getStreamProcessors:ge,getThumbnailController:function(){return U},initialize:function(){n.on(m.default.BUFFERING_COMPLETED,ue,F),n.on(m.default.INBAND_EVENTS,de,F),n.on(m.default.DATA_UPDATE_COMPLETED,fe,F),n.on(g.default.PLAYBACK_SEEKED,pe,F),w&&(n.on(m.default.KEY_ERROR,oe,F),n.on(m.default.SERVER_CERTIFICATE_UPDATED,oe,F),n.on(m.default.LICENSE_REQUEST_COMPLETE,oe,F),n.on(m.default.KEY_SYSTEM_SELECTED,oe,F),n.on(m.default.KEY_SESSION_CREATED,oe,F)),T.initializeForStream(D),n.trigger(m.default.STREAM_UPDATED,{streamInfo:D})},initializeForTextWithMediaSource:function(e){return new Promise(((t,n)=>{K(h.default.TEXT,e,null).then((()=>function(){let e=he(h.default.TEXT);return e?e.createBufferSinks():Promise.resolve()}())).then((()=>{T.createTracks(D),t()})).catch((e=>{n(e)}))}))},prepareQualityChange:function(e){let t=he(e.mediaType);t&&t.prepareQualityChange(e)},prepareTrackChange:function(e){if(!I||!D)return;N=!1;let t=e.newMediaInfo,n=i.getValue(),r=me(t);if(!r)return;let o=b.getTime();if(z.info(`Stream - Process track changed at current time `+o),n.refreshManifestOnSwitchTrack)W.push(e),u.getIsUpdating()||(z.debug(`Stream - Refreshing manifest for switch track`),u.refreshManifest());else{r.clearScheduleTimer(),r.setTrackSwitchInProgress(!0);let n=r.getRepresentation();r.selectMediaInfo(new io({newMediaInfo:t})).then((()=>{let t=!!(e&&e.options&&e.options.hasOwnProperty(`replaceBuffer`))&&e.options.replaceBuffer;return r.prepareTrackSwitch(n,t)})).then((()=>{r.setTrackSwitchInProgress(!1)}))}},reset:function(e){j&&=(j.reset(),null),y&&D&&y.clearDataForStream(D.id),V&&=(V.reset(),null),T&&D&&T.clearDataForStream(D.id),C&&D&&C.clearDataForStream(D.id),ne(e),D=null,n.off(m.default.BUFFERING_COMPLETED,ue,F),n.off(m.default.INBAND_EVENTS,de,F),n.off(m.default.DATA_UPDATE_COMPLETED,fe,F),n.off(g.default.PLAYBACK_SEEKED,pe,F),w&&(n.off(m.default.KEY_ERROR,oe,F),n.off(m.default.SERVER_CERTIFICATE_UPDATED,oe,F),n.off(m.default.LICENSE_REQUEST_COMPLETE,oe,F),n.off(m.default.KEY_SYSTEM_SELECTED,oe,F),n.off(m.default.KEY_SESSION_CREATED,oe,F))},setIsEndedEventSignaled:re,setMediaSource:function(e){return new Promise(((t,n)=>{let r=[];for(let t=0;t<H.length;)ee(H[t].getMediaInfo())?(r.push(H[t].setMediaSource(e)),t++):(H[t].reset(),H.splice(t,1));Promise.all(r).then((()=>{for(let e=0;e<H.length;e++)H[e].dischargePreBuffer();if(H.length===0){let e=`No streams to play.`;v.error(new Be.default(Ne.MANIFEST_ERROR_ID_NOSTREAMS_CODE,e+`nostreams`,i.getValue())),z.fatal(e)}t()})).catch((e=>{z.error(e),n(e)}))}))},startPreloading:function(e,t,n=[]){return new Promise(((r,i)=>{be()?i():(z.info(`[startPreloading] Preloading next stream with id ${J()}`),ye(!0),G(e,t,n).then((()=>{for(let e=0;e<H.length&&H[e];e++)H[e].setExplicitBufferingTime(ie()),H[e].getScheduleController().startScheduleTimer();r()})).catch((()=>{ye(!1),i()})))}))},startScheduleControllers:_e,triggerProtectionError:function(e){oe(e)},updateData:function(e){return new Promise((t=>{D=e,S&&se();let r,i=[];for(let e=0,t=H.length;e<t;e++){let t=H[e],n=t.getMediaInfo();i.push(t.updateStreamInfo(D));let r=d.getAllMediaInfoForType(D,t.getType());if(r=r.filter((e=>!e.isEmbedded)),t.setMediaInfoArray(r),r)for(let e=0;e<r.length;e++)d.areMediaInfosEqual(n,r[e])&&i.push(t.selectMediaInfo(new io({newMediaInfo:r[e]})))}Promise.all(i).then((()=>{let e=[];for(;W.length>0;){let t=W.pop(),n=t.newMediaInfo;if(r=me(t.oldMediaInfo),!r)return;let i=r.getRepresentation();r.setTrackSwitchInProgress(!0),e.push(r.prepareTrackSwitch(i)),e.push(r.selectMediaInfo(new io({newMediaInfo:n})))}return Promise.all(e)})).then((()=>{ve(),r&&r.setTrackSwitchInProgress(!1),n.trigger(m.default.STREAM_UPDATED,{streamInfo:D}),t()})).catch((e=>{v.error(e)}))}))}},function(){try{A=(0,l.default)(t).getInstance(),z=A.getLogger(F),ne(),k=wr(t).getInstance(),V=Fe(t).create({updateEventName:m.default.SEGMENT_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:m.default.SEGMENT_LOCATION_BLACKLIST_ADD}),j=ro(t).create({streamInfo:D,mediaPlayerModel:o,dashMetrics:c,errHandler:v,settings:O,boxParser:k,dashConstants:Y.default,urlUtils:r})}catch(e){throw e}}(),F}$o.__dashjs_factory_name=`Stream`;var es=i.default.getClassFactory($o);function ts(){let e=this.context,t=(0,p.default)(e).getInstance(),n=ht(e).getInstance(),r,i,o,c,u,d,f,h,g,_,v,y,b,x,S,C;function w(){h=[],g=[],_=null,v=null,b=null,y=NaN,o=!1,c=!1,x=u.get().streaming.utcSynchronization.timeBetweenSyncAttempts}function E(){u.get().streaming.utcSynchronization.enabled&&!o&&!c&&b&&b.value&&b.schemeIdUri&&!isNaN(y)&&!isNaN(u.get().streaming.utcSynchronization.backgroundAttempts)&&(v&&(Date.now()-v)/1e3<30||(h=[],c=!0,D(isNaN(u.get().streaming.utcSynchronization.backgroundAttempts)?2:u.get().streaming.utcSynchronization.backgroundAttempts)))}function D(e){try{if(e<=0)return void z();let t=Date.now();d[b.schemeIdUri](b.value,(function(n){let r=k(t,Date.now(),n);h.push(r),D(e-1)}),(function(){z()}))}catch{z()}}function O(e=null){let t=e||0;if(!g||g.length===0||t>=g.length)return void A();let n=g[t];if(n)if(d.hasOwnProperty(n.schemeIdUri)){let e=new Date().getTime();d[n.schemeIdUri](n.value,(function(t){let r=k(e,new Date().getTime(),t);b=n,A(r)}),(function(){O(t+1)}))}else O(t+1);else A()}function k(e,t,n){return n-(t-(t-e)/2)}function A(e=NaN){let t=isNaN(e);t&&u.get().streaming.utcSynchronization.useManifestDateHeaderTimeSource?function(){let e=f.getLatestMPDRequestHeaderValueByID(`Date`),t=e===null?NaN:new Date(e).getTime();isNaN(t)?R(!0):R(!1,t-Date.now())}():R(t,e)}function j(e){let t=Date.parse(e);return isNaN(t)&&(t=function(e){let t,n,r=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+\-])([0-9]{2})([0-9]{2}))?/.exec(e);return t=Date.UTC(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10),parseInt(r[4],10),parseInt(r[5],10),r[6]&&(parseInt(r[6],10)||0),r[7]&&1e3*parseFloat(r[7])||0),r[9]&&r[10]&&(n=60*parseInt(r[9],10)+parseInt(r[10],10),t+=(r[8]===`+`?-1:1)*n*60*1e3),new Date(t).getTime()}(e)),t}function M(e){return Date.parse(e)}function N(e){return Date.parse(e)}function P(e,t,n){n()}function F(e,t,n){let r=j(e);isNaN(r)?n():t(r)}function I(e,t,r,i,o){let c,l,u=!1,d=new XMLHttpRequest,f=o?T.HTTPRequest.HEAD:T.HTTPRequest.GET,p=t.match(/\S+/g);if(t=p.shift(),c=function(){u||(u=!0,p.length?I(e,p.join(` `),r,i,o):i())},l=function(){let t,n;d.status===200&&(t=o?d.getResponseHeader(`Date`):d.response,n=e(t),isNaN(n)||(r(n),u=!0))},n.isRelative(t)){let e=C.resolve();e&&(t=n.resolve(t,e.url))}d.open(f,t),d.timeout=5e3,d.onload=l,d.onloadend=c,d.send()}function L(e,t,n){I(N,e,t,n,!0)}function R(e,n){if(isNaN(y)||isNaN(n)||e||function(e){try{let t=B(e),n=isNaN(x)?30:x,r=isNaN(u.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor)?2:u.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor,o=isNaN(u.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts)?600:u.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts,c=isNaN(u.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts)?2:u.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts,l;t?(l=Math.min(n*r,o),i.debug(`Increasing timeBetweenSyncAttempts to ${l}`)):(l=Math.max(n/r,c),i.debug(`Decreasing timeBetweenSyncAttempts to ${l}`)),x=l}catch{}}(n),!e&&!isNaN(n)){_=Date.now(),o=!1;let e=isNaN(y);y=n,e&&E(),i.debug(`Completed UTC sync. Setting client - server offset to ${n}`)}e&&(b=null,o=!1,S.error(new Be.default(Ne.TIME_SYNC_FAILED_ERROR_CODE,Ne.TIME_SYNC_FAILED_ERROR_MESSAGE)));let r=u.get().streaming.utcSynchronization.artificialTimeOffsetToApply;t.trigger(m.default.UPDATE_TIME_SYNC_OFFSET,{offset:n+r}),t.trigger(m.default.TIME_SYNCHRONIZATION_COMPLETED)}function z(){if(!h||h.length===0)return;let e=h.reduce(((e,t)=>e+t),0)/h.length;B(e)?i.debug(`Completed background UTC sync. Offset is within allowed threshold and is not adjusted.`):(i.debug(`Completed background UTC sync. Setting client - server offset to ${e}`),y=e,t.trigger(m.default.UPDATE_TIME_SYNC_OFFSET,{offset:y})),c=!1,v=Date.now()}function B(e){try{if(isNaN(y))return!0;let t=u.get().streaming.utcSynchronization.maximumAllowedDrift&&!isNaN(u.get().streaming.utcSynchronization.maximumAllowedDrift)?u.get().streaming.utcSynchronization.maximumAllowedDrift:100;return e>=y-t&&e<=y+t}catch{return!0}}return r={initialize:function(){w(),d={"urn:mpeg:dash:utc:http-head:2014":L,"urn:mpeg:dash:utc:http-xsdate:2014":I.bind(null,j),"urn:mpeg:dash:utc:http-iso:2014":I.bind(null,M),"urn:mpeg:dash:utc:direct:2014":F,"urn:mpeg:dash:utc:http-head:2012":L,"urn:mpeg:dash:utc:http-xsdate:2012":I.bind(null,j),"urn:mpeg:dash:utc:http-iso:2012":I.bind(null,M),"urn:mpeg:dash:utc:direct:2012":F,"urn:mpeg:dash:utc:http-ntp:2014":P,"urn:mpeg:dash:utc:ntp:2014":P,"urn:mpeg:dash:utc:sntp:2014":P}},attemptSync:function(e,n){g=e,o||(function(e){try{if(!e||!u.get().streaming.utcSynchronization.enabled)return!1;let t=isNaN(x)?30:x;return!(_&&t&&!isNaN(t))||(Date.now()-_)/1e3>=t}catch{return!0}}(n)?(o=!0,O()):t.trigger(m.default.TIME_SYNCHRONIZATION_COMPLETED))},setConfig:function(e){e&&(e.dashMetrics&&(f=e.dashMetrics),e.baseURLController&&(C=e.baseURLController),e.errHandler&&(S=e.errHandler),e.settings&&(u=e.settings))},reset:function(){w(),t.off(m.default.ATTEMPT_BACKGROUND_SYNC,E,r)}},i=(0,l.default)(e).getInstance().getLogger(r),t.on(m.default.ATTEMPT_BACKGROUND_SYNC,E,r),r}ts.__dashjs_factory_name=`TimeSyncController`;let ns=i.default.getSingletonFactory(ts);ns.HTTP_TIMEOUT_MS=5e3,i.default.updateSingletonFactory(ts.__dashjs_factory_name,ns);var rs=ns;function is(){let e,t,n,r,i,o=this.context,c=(0,p.default)(o).getInstance();return e={attachMediaSource:function(e){let n=window.URL.createObjectURL(t);return e.setSource(n),r===`managedMediaSource`&&(e.setDisableRemotePlayback(!0),t.addEventListener(`startstreaming`,(()=>{c.trigger(g.default.MANAGED_MEDIA_SOURCE_START_STREAMING)})),t.addEventListener(`endstreaming`,(()=>{c.trigger(g.default.MANAGED_MEDIA_SOURCE_END_STREAMING)}))),n},createMediaSource:function(){let e=`WebKitMediaSource`in window,n=`MediaSource`in window;return`ManagedMediaSource`in window?(t=new ManagedMediaSource,r=`managedMediaSource`,i.info(`Created ManagedMediaSource`)):n?(t=new MediaSource,r=`mediaSource`,i.info(`Created MediaSource`)):e&&(t=new WebKitMediaSource,i.info(`Created WebkitMediaSource`)),t},detachMediaSource:function(e){e.setSource(null)},setConfig:function(e){e&&e.settings&&(n=e.settings)},setDuration:function e(r){t&&t.readyState===`open`&&(r===null&&isNaN(r)||t.duration!==r&&(r!==1/0||n.get().streaming.buffer.mediaSourceDurationInfinity||(r=2**32),function(e){let t=e.sourceBuffers;for(let e=0;e<t.length;e++)if(t[e].updating)return!0;return!1}(t)?setTimeout(e.bind(null,r),50):(i.info(`Set MediaSource duration:`+r),t.duration=r)))},setSeekable:function(e,n){t&&typeof t.setLiveSeekableRange==`function`&&typeof t.clearLiveSeekableRange==`function`&&t.readyState===`open`&&e>=0&&e<n&&(t.clearLiveSeekableRange(),t.setLiveSeekableRange(e,n))},signalEndOfStream:function(e){if(!e||e.readyState!==`open`)return;let t=e.sourceBuffers;for(let e=0;e<t.length;e++)if(t[e].updating||t[e].buffered.length===0)return;i.info(`call to mediaSource endOfStream`),e.endOfStream()}},i=(0,l.default)(o).getInstance().getLogger(e),e}is.__dashjs_factory_name=`MediaSourceController`;var as=i.default.getSingletonFactory(is);function os(){let e=`urn:mpeg:dash:event:2012`,t=`updated`,n=`added`,r=this.context,i=(0,p.default)(r).getInstance(),o,c,u,d,f,m,h,_,v,y,b;function x(){if(!h||!_)throw Error(`setConfig function has to be called previously`)}function S(){b=!1,u={},d={},f=null,y=!1,m=Date.now()/1e3}function C(){try{if(!y){y=!0;let e=_.getTime(),t=e-m;t=m>0?Math.max(0,t):0,w(d,t,e),w(u,t,e),T(d),T(u),m=e,y=!1}}catch(e){y=!1,c.error(e)}}function w(e,t,n){try{k(e,function(r){if(r!==void 0){let i=isNaN(r.duration)?0:r.duration;r.calculatedPresentationTime<=n&&r.calculatedPresentationTime+t+i>=n?j(r,g.default.EVENT_MODE_ON_START):(A(n,i+t,r.calculatedPresentationTime)||function(e){try{let t=e.eventStream.period.start+e.eventStream.period.duration;return e.calculatedPresentationTime>t}catch(e){return c.error(e),!1}}(r))&&(c.debug(`Removing event ${r.id} from period ${r.eventStream.period.id} as it is expired or invalid`),function(e,t){try{let n=t.eventStream.schemeIdUri,r=t.eventStream.period.id,i=t.eventStream.value,o=t.id;e[r][n]=e[r][n].filter((e=>i&&e.eventStream.value&&e.eventStream.value!==i||e.id!==o)),e[r][n].length===0&&delete e[r][n]}catch(e){c.error(e)}}(e,r))}})}catch(e){c.error(e)}}function T(e){try{for(let t in e)e.hasOwnProperty(t)&&Object.keys(e[t]).length===0&&delete e[t]}catch(e){c.error(e)}}function E(e,r,i=!1){let o=e.eventStream.schemeIdUri,c=e.eventStream.value,l=e.id,u=`discarded`;r[o]||(r[o]=[]);let d=r[o].findIndex((e=>(!c||e.eventStream.value&&e.eventStream.value===c)&&e.id===l));if(d===-1)r[o].push(e),e.triggeredReceivedEvent=!1,e.triggeredStartEvent=!1,u=n;else if(i){let n=r[o][d];e.triggeredReceivedEvent=n.triggeredReceivedEvent,e.triggeredStartEvent=n.triggeredStartEvent,r[o][d]=e,u=t}return u}function D(e){try{if(e.eventStream.value==1){let t=e.calculatedPresentationTime,n;n=e.calculatedPresentationTime==4294967295?NaN:e.calculatedPresentationTime+e.duration,i.trigger(g.default.MANIFEST_VALIDITY_CHANGED,{id:e.id,validUntil:t,newDuration:n,newManifestValidAfter:NaN},{mode:g.default.EVENT_MODE_ON_START})}}catch(e){c.error(e)}}function O(e){try{let t=_.getTime();k(e,(function(e){let n=e.eventStream&&e.eventStream.period&&!isNaN(e.eventStream.period.duration)?e.eventStream.period.duration:NaN,r=e.eventStream&&e.eventStream.period&&!isNaN(e.eventStream.period.start)?e.eventStream.period.start:NaN;if(isNaN(n)||isNaN(r))return;let i=e.calculatedPresentationTime;Math.abs(i-t)<300&&j(e,g.default.EVENT_MODE_ON_START)}))}catch(e){c.error(e)}}function k(e,t){try{if(e){let n=Object.keys(e);for(let r=0;r<n.length;r++){let i=e[n[r]],o=Object.keys(i);for(let e=0;e<o.length;e++)i[o[e]].forEach((e=>{e!==void 0&&t(e)}))}}}catch(e){c.error(e)}}function A(e,t,n){try{return e-t>n}catch(e){return c.error(e),!1}}function j(t,n){try{let o=_.getTime(),l=t.id;if(n===g.default.EVENT_MODE_ON_RECEIVE&&!t.triggeredReceivedEvent)return c.debug(`Received event ${l}`),t.triggeredReceivedEvent=!0,void i.trigger(t.eventStream.schemeIdUri,{event:t},{mode:n});t.triggeredStartEvent||=(t.eventStream.schemeIdUri===e&&t.eventStream.value==1?t.duration===0&&t.presentationTimeDelta===0||(c.debug(`Starting manifest refresh event ${l} at ${o}`),function(){try{x(),h.refreshManifest()}catch(e){c.error(e)}}()):t.eventStream.schemeIdUri===`urn:mpeg:dash:event:callback:2015`&&t.eventStream.value==1?(c.debug(`Starting callback event ${l} at ${o}`),function(e){try{let t=We(r).create({}),n=new $n({method:`get`,url:e,responseType:`arraybuffer`,customData:{}}),i=new er({request:n});t.load(n,i)}catch(e){c.error(e)}}(t.messageData instanceof Uint8Array?He.default.uint8ArrayToString(t.messageData):t.messageData)):(c.debug(`Starting event ${l} from period ${t.eventStream.period.id} at ${o}`),i.trigger(t.eventStream.schemeIdUri,{event:t},{mode:n}),v.get().streaming.events.deleteEventMessageDataTimeout>-1&&setTimeout((()=>{delete t.messageData,delete t.parsedMessageData}),v.get().streaming.events.deleteEventMessageDataTimeout)),!0)}catch(e){c.error(e)}}return o={addInlineEvents:function(e,r){try{if(x(),u[r]||(u[r]={}),e)for(let i=0;i<e.length;i++){let o=e[i];if(!A(_.getTime(),isNaN(o.duration)?0:o.duration,o.calculatedPresentationTime)){let e=E(o,u[r],!0);e===n?(c.debug(`Added inline event with id ${o.id} from period ${r}`),j(o,g.default.EVENT_MODE_ON_RECEIVE)):e===t&&c.debug(`Updated inline event with id ${o.id} from period ${r}`)}}}catch(e){throw e}},addInbandEvents:function(t,r){try{x(),d[r]||(d[r]={});for(let i=0;i<t.length;i++){let o=t[i];A(_.getTime(),isNaN(o.duration)?0:o.duration,o.calculatedPresentationTime)||(E(o,d[r],!1)===n?(o.eventStream.schemeIdUri===e&&D(o),c.debug(`Added inband event with id ${o.id} from period ${r}`),j(o,g.default.EVENT_MODE_ON_RECEIVE)):c.debug(`Inband event with scheme_id_uri ${o.eventStream.schemeIdUri}, value ${o.eventStream.value}, period id ${r} and event id ${o.id} was ignored because it has been added before.`))}C()}catch(e){throw e}},getInbandEvents:function(){return d},getInlineEvents:function(){return u},start:function(){try{x(),c.debug(`Start Event Controller`);let e=v.get().streaming.events.eventControllerRefreshDelay;b||isNaN(e)||(b=!0,f=setInterval(C,e))}catch(e){throw e}},setConfig:function(e){try{if(!e)return;e.manifestUpdater&&(h=e.manifestUpdater),e.playbackController&&(_=e.playbackController),e.settings&&(v=e.settings)}catch(e){throw e}},reset:function(){(function(){try{f!==null&&b&&(clearInterval(f),f=null,b=!1,function(){try{O(d),O(u)}catch(e){c.error(e)}}())}catch(e){throw e}})(),S()}},c=(0,l.default)(r).getInstance().getLogger(o),S(),o}os.__dashjs_factory_name=`EventController`;var ss=i.default.getSingletonFactory(os),cs={LEVELS:{SUGGESTION:`Suggestion`,WARNING:`Warning`,ERROR:`Error`},EVENTS:{NO_UTC_TIMING_ELEMENT:{key:`NO_UTC_TIMING_ELEMENT`,message:`No UTCTiming element is present in the manifest. You may experience playback failures. For a detailed validation use https://conformance.dashif.org/`},NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE:{key:`NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE`,message:`SMPTE 2052-1:2013 defines the attribute name as "imageType" and does not define "imagetype"`},INVALID_DVR_WINDOW:{key:`INVALID_DVR_WINDOW`,message:`No valid segment found when applying a specification compliant DVR window calculation. Using SegmentTimeline entries as a fallback.`}}},ls=r(445),us=r(1923);function ds(){let e=this.context,t=(0,p.default)(e).getInstance(),n,r,i,o,u,d,f,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M,N,P,F,I,L,R,z,B,V,H,U,W,G,K,ee,q,te,ne,re,ie,J,ae,oe,se,ce;function le(){if(!(d&&d.hasOwnProperty(`load`)&&j&&j.hasOwnProperty(`initialize`)&&j.hasOwnProperty(`reset`)&&j.hasOwnProperty(`getClientTimeOffset`)&&f&&A&&v&&W))throw Error(h.default.MISSING_CONFIG_ERROR)}function ue(){(function(){try{let e=_.getStreamsInfo();if(!N&&e.length===0)throw Error(`There are no periods in the MPD`);N&&e.length>0&&v.updateManifestUpdateInfo({currentTime:W.getTime(),buffered:U.getBufferRange(),presentationStartTime:e[0].start,clientTimeOffset:j.getClientTimeOffset()}),M.length>0&&function(e){e.length===0?r.warn(`No periods included in the current manifest. Skipping the filtering of outdated stream objects.`):M=M.filter((t=>{let n=e.filter((e=>e.id===t.getId())).length>0||t.getId()===N.getId();return n||(r.debug(`Removing stream ${t.getId()}`),t.reset(!0),t=null),n}))}(e);let n=[];for(let t=0,r=e.length;t<r;t++){let r=e[t];n.push(fe(r)),v.addManifestUpdateStreamInfo(r)}Promise.all(n).then((()=>new Promise(((t,n)=>{N?t():pe(e,t,n)})))).then((()=>{t.trigger(m.default.STREAMS_COMPOSED),Ie()})).catch((e=>{throw e}))}catch(e){A.error(new Be.default(Ne.MANIFEST_ERROR_ID_NOSTREAMS_CODE,e.message+` nostreamscomposed`,f.getValue())),V=!0,it()}})()}function de(){ae=!0}function fe(t){let n=tt(t.id);return n?n.updateData(t):(n=es(e).create({manifestModel:f,mediaPlayerModel:K,dashMetrics:v,manifestUpdater:u,adapter:_,timelineConverter:j,capabilities:i,capabilitiesFilter:o,errHandler:A,baseURLController:S,segmentBaseController:C,textController:F,abrController:T,playbackController:W,throughputController:E,eventController:O,mediaController:D,protectionController:P,videoModel:U,streamInfo:t,settings:J}),M.push(n),n.initialize(),Promise.resolve())}function pe(e,n,i){try{De();let o=v.getCurrentDVRInfo().range;if(o.end<o.start)return void function(e,n,i,o){oe&&clearTimeout(oe);let c=Math.min(1e3*(-1*(e.end-e.start)+2),2147483647);r.debug(`Waiting for ${c} ms before playback can start`),t.trigger(m.default.AST_IN_FUTURE,{delay:c}),oe=setTimeout((()=>{pe(n,i,o)}),c)}(o,e,n,i);J.get().streaming.applyProducerReferenceTime&&G.calculateProducerReferenceTimeOffsets(e);let c=e[0].manifestInfo;if(J.get().streaming.applyServiceDescription&&G.applyServiceDescription(c),_.getIsDynamic()){let e=Ge(0,c);W.computeAndSetLiveDelay(e,c)}(J.get().streaming.applyContentSteering&&x.shouldQueryBeforeStart()?x.loadSteeringData():Promise.resolve()).then((()=>{let e=f.getValue();e&&S.update(e),me(),n()})).catch((e=>{r.error(e),me(),n()}))}catch(e){i(e)}}function me(){let e=function(){let e;return e=_.getIsDynamic()?function(){let e,t=v.getCurrentDVRInfo();e=(t&&t.range?t.range.end:0)-W.getOriginalLiveDelay();let n=t?t.range:null;if(n){if(isNaN(se)&&se.toString().indexOf(`posix:`)===-1){let t=He(!0);isNaN(t)||(r.info(`Start time from URI parameters: ${t}`),e=Math.min(e,t))}else{r.info(`Start time provided by the app: ${se}`);let t=Ue(!0,se);isNaN(t)||(e=Math.min(e,t))}let t=J.get().streaming.timeShiftBuffer.calcFromSegmentTimeline?.1:0;e=Math.max(e,n.start+t)}return e}():function(){let e=ot()[0].getStreamInfo().start;if(isNaN(se)){let t=He(!1);isNaN(t)||(r.info(`Start time from URI parameters: ${t}`),e=Math.max(e,t))}else{r.info(`Start time provided by the app: ${se}`);let t=Ue(!1,se);isNaN(t)||(e=Math.max(e,t))}return e}(),e}(),n=Ee(e),i=n===null?M[0]:n;t.trigger(m.default.INITIAL_STREAM_SWITCH,{startTime:e}),he(i,null,e),re||=setInterval((function(){!z&&W.getTimeToStreamEnd()<=0&&!W.isSeeking()&&t.trigger(m.default.PLAYBACK_ENDED,{isLast:et().isLast})}),200)}function he(e,n,i){try{if(z||!e||n===e&&e.getIsActive())return;z=!0,t.trigger(m.default.PERIOD_SWITCH_STARTED,{fromStreamInfo:n?n.getStreamInfo():null,toStreamInfo:e.getStreamInfo()});let o=!1,c=[],l=ye(n);N=e,n&&(o=we(e,n),c=ve(n),n.deactivate(o)),i=isNaN(i)?!o&&n?e.getStreamInfo().start:NaN:i,r.info(`Switch to stream ${e.getId()}. Seektime is ${i}, current playback time is ${W.getTime()}. Seamless period switch is set to ${o}`),ie=ie.filter((e=>e.getId()!==N.getId())),W.initialize(et(),!!n),U.getElement()?ge({seekTime:i,keepBuffers:o,sourceBufferSinksFromPreviousPeriod:l,streamActivated:!1,representationsFromPreviousPeriod:c}):_e({seekTime:i,keepBuffers:o,sourceBufferSinksFromPreviousPeriod:l})}catch{z=!1}}function ge(e){let t;function n(){if(!H||H.readyState!==`open`)return;r.debug(`MediaSource is open!`),window.URL.revokeObjectURL(t),H.removeEventListener(`sourceopen`,n),H.removeEventListener(`webkitsourceopen`,n),Ve();let i=v.getCurrentDVRInfo();y.setSeekable(i.range.start,i.range.end),e.streamActivated?(isNaN(e.seekTime)||W.seek(e.seekTime,!0,!0),N.setMediaSource(H).then((()=>{N.initializeForTextWithMediaSource(H)}))):_e(e)}function i(){H.addEventListener(`sourceopen`,n,!1),H.addEventListener(`webkitsourceopen`,n,!1),t=y.attachMediaSource(U),r.debug(`MediaSource attached to element. Waiting on open...`)}H?e.keepBuffers?_e(e):(y.detachMediaSource(U),i()):(H=y.createMediaSource(),i())}function _e(e){let n=e.representationsFromPreviousPeriod||[];N.activate(H,e.sourceBufferSinksFromPreviousPeriod,n).then((()=>{isNaN(e.seekTime)||(t.trigger(m.default.SEEK_TARGET,{time:e.seekTime},{streamId:N.getId()}),W.seek(e.seekTime,!1,!0),N.startScheduleControllers()),z=!1,t.trigger(m.default.PERIOD_SWITCH_COMPLETED,{toStreamInfo:et()})}))}function ve(e){return(e?e.getStreamProcessors():[]).map((e=>e.getRepresentation()))}function ye(e){let t=new Map;return e&&(e?e.getStreamProcessors():[]).forEach((e=>{let n=e.getBuffer();n&&t.set(n.getType(),n)})),t}function be(e){let t=Ee(e.seekTime);t&&t!==N?t&&t!==N&&(xe(t),function(e,t){let n=e&&!isNaN(e.seekTime)?e.seekTime:NaN,r=N.getStreamProcessors().map((t=>t.prepareOuterPeriodPlaybackSeeking(e)));Promise.all(r).then((()=>{he(t,N,n)})).catch((e=>{A.error(e)}))}(e,t)):(xe(),function(e){N.getStreamProcessors().forEach((t=>t.prepareInnerPeriodPlaybackSeeking(e))),Xe(Vi.USER_REQUEST_STOP_REASON)}(e)),Y(Bi.SEEK_START_REASON)}function xe(e=null){Se()}function Se(){ie&&ie.length>0&&(ie.forEach((e=>{e.deactivate(!0)})),ie=[])}function Ce(e){if(e.newMediaInfo.streamInfo.id===N.getId()){if(Se(),J.get().streaming.buffer.resetSourceBuffersForTrackSwitch&&e.oldMediaInfo&&e.oldMediaInfo.codec!==e.newMediaInfo.codec){let e=W.getTime();N.deactivate(!1),ge({seekTime:e,keepBuffers:!1,streamActivated:!1});return}N.prepareTrackChange(e)}}function we(e,t){try{return J.get().streaming.buffer.reuseExistingSourceBuffers&&(i.isProtectionCompatible(t.getStreamInfo(),e.getStreamInfo())||ae)&&i.supportsChangeType()&&J.get().streaming.buffer.useChangeType}catch{return!1}}function Te(e,t=null){if(!H||e.getPreloaded()||!we(e,t))return;let n=ve(t),r=ye(t);e.startPreloading(H,r,n).then((()=>{ie.push(e)}))}function Ee(e){if(isNaN(e))return null;let t=M.length;for(let n=0;n<t;n++){let t=M[n];if(e<parseFloat((t.getStartTime()+t.getDuration()).toFixed(5)))return t}return null}function De(){try{let e=_.getIsDynamic(),t=_.getStreamsInfo()[0].manifestInfo,n=W.getTime(),r=j.calcTimeShiftBufferWindow(M,e),i=Re();if(r.start===void 0||r.end===void 0)return;i&&i.length!==0?i.forEach((e=>{v.addDVRInfo(e.getType(),n,t,r)})):v.addDVRInfo(h.default.VIDEO,n,t,r)}catch{}}function Oe(e){if(te&&R){let e=K.getInitialBufferLevel(),t=[h.default.TEXT];(isNaN(e)||e<=W.getBufferLevel(t)||_.getIsDynamic()&&e>W.getLiveDelay())&&(te=!1,Y(Bi.INITIAL_PLAYOUT_START_REASON),W.play())}e&&e.mediaType&&v.addBufferLevel(e.mediaType,new Date,1e3*e.bufferLevel)}function ke(e){e.streamInfo.id===N.getId()&&Se(),tt(e.streamInfo.id).prepareQualityChange(e)}function Ae(){if(_.getIsDynamic()&&W.getOriginalLiveDelay()!==0&&N){let e=_.getStreamsInfo();if(e.length>0){let t=e[0].manifestInfo,n=Ge(0,t);W.computeAndSetLiveDelay(n,t)}}}function je(){if(Je()){let e=U.getPlaybackQuality();e&&v.addDroppedFrames(e)}}function Me(){r.debug(`[onPlaybackStarted]`),!te&&q&&Y(Bi.RESUME_FROM_PAUSE_START_REASON),te&&=!1,ne&&(ne=!1,J.get().streaming.applyContentSteering&&!x.shouldQueryBeforeStart()&&x.loadSteeringData()),q=!1}function Pe(e){r.debug(`[onPlaybackPaused]`),e.ended||(q=!0,Xe(Vi.USER_REQUEST_STOP_REASON))}function Fe(e){r.debug(`Stream with id ${e.streamInfo.id} finished buffering`);let t=e.streamInfo.isLast;H&&t?(r.info(`[onStreamBufferingCompleted] calls signalEndOfStream of mediaSourceController.`),y.signalEndOfStream(H)):Ie()}function Ie(){if(!N)return;if(!N.getHasFinishedBuffering())return void N.checkAndHandleCompletedBuffering();let e=function(e=null){try{let t=e||N||null;if(t){let e=t.getStreamInfo();return M.filter((function(t){let n=t.getStreamInfo();return n.start>e.start&&e.id!==n.id}))}}catch{return[]}}(N),t=0;for(;t<e.length;){let n=e[t],r=t===0?N:e[t-1];!n.getPreloaded()&&r.getHasFinishedBuffering()&&Te(n,r),t+=1}}function Le(){re&&=(clearInterval(re),null)}function Re(){return N?N.getStreamProcessors():[]}function ze(e){if(N&&!N.getIsEndedEventSignaled()){N.setIsEndedEventSignaled(!0);let e=function(e=null){let t=e||N||null;if(!t)return null;let n=t.getStreamInfo(),r=n.start,i=0,o=-1,c=NaN;for(;i<M.length;){let e=M[i].getStreamInfo(),t=e.start-r;t>0&&(isNaN(c)||t<c)&&n.id!==e.id&&(c=t,o=i),i+=1}return o>=0?M[o]:null}();e?(r.debug(`StreamController onEnded, found next stream with id ${e.getStreamInfo().id}. Switching from ${N.getStreamInfo().id} to ${e.getStreamInfo().id}`),he(e,N,NaN)):(r.debug(`StreamController no next stream found`),N.setIsEndedEventSignaled(!1)),Xe(e?Vi.END_OF_PERIOD_STOP_REASON:Vi.END_OF_CONTENT_STOP_REASON)}e&&e.isLast&&(Le(),x.stopSteeringRequestTimer())}function Ve(e){let t=e||et().manifestInfo.duration;y.setDuration(t)}function He(e){let t=w.getURIFragmentData();if(!t||!t.t)return NaN;let n=ot()[0].getStreamInfo().start;return t.t=t.t.split(`,`)[0],We(e,t.t,n)}function Ue(e,t){let n=0;return e||(n=ot()[0].getStreamInfo().start),We(e,t,n)}function We(e,t,n){let r=_.getRegularPeriods()[0],i=t.toString(),o=i.indexOf(`posix:`)===-1?NaN:i.substring(6)===`now`?Date.now()/1e3:parseFloat(i.substring(6));return e&&!isNaN(o)?j.calcPresentationTimeFromWallTime(new Date(1e3*o),r):parseFloat(i)+n}function Ge(e,t){try{return t&&!isNaN(t.maxFragmentDuration)&&isFinite(t.maxFragmentDuration)?t.maxFragmentDuration:NaN}catch{return NaN}}function Ke(){let e=f.getValue();S.initialize(e)}function qe(e){if(e.error)V=!0,it();else{r.info(`Manifest updated... updating data system wide.`);let n=e.manifest;_.updatePeriods(n),o.filterUnsupportedFeatures(n).then((()=>{S.initialize(n);let e=_.getUTCTimingSources();!_.getIsDynamic()||e&&e.length!==0||t.trigger(g.default.CONFORMANCE_VIOLATION,{level:cs.LEVELS.WARNING,event:cs.EVENTS.NO_UTC_TIMING_ELEMENT});let r=_.getIsDynamic()?e.concat(ee.getUTCTimingSources()):e;b.attemptSync(r,_.getIsDynamic()),L.createFinalQueryStrings(n)}))}}function Je(){return!!N&&N.getHasVideoTrack()}function Ye(){return!!N&&N.getHasAudioTrack()}function Xe(e,t){t||=new Date,Re().forEach((n=>{n.finalisePlayList(t,e)})),v.addPlayList()}function Y(e){v.createPlaylistMetrics(1e3*W.getTime(),e)}function Ze(e){P.updateKeyStatusesMap(e),function(){let e=Re(),r=!1;e.forEach((e=>{let t=e.getMediaInfo();!t||i.areKeyIdsUsable(t)?t&&i.areKeyIdsExpired(t)&&function(e){let t=tt(e.getStreamId());t&&t.triggerProtectionError({error:new Be.default(us.default.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE,us.default.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE)})}(e):(r=!0,function(e){let t=e.getAllMediaInfos().filter((e=>i.areKeyIdsUsable(e)));if(t&&t.length!==0)D.setTrack(t[0],{replaceBuffer:!0});else{let t=e.getType();A.error(new Be.default(Ne.NO_SUPPORTED_KEY_IDS,`Type: ${t}: ${Ne.NO_SUPPORTED_KEY_IDS_MESSAGE}`))}}(e))})),r&&(W.getTime()===0?t.once(g.default.FRAGMENT_LOADING_COMPLETED,(()=>{Qe()}),n):W.isProgressing(500).then((e=>{e||Qe()})))}()}function Qe(){let e=W.getTime();W.seek(e+.01,!1,!1)}function $e(e){if(!e.error)return;let t;switch(e.error.code){case 1:t=`MEDIA_ERR_ABORTED`;break;case 2:t=`MEDIA_ERR_NETWORK`;break;case 3:t=`MEDIA_ERR_DECODE`,ce.counts.mediaErrorDecode+=1;break;case 4:t=`MEDIA_ERR_SRC_NOT_SUPPORTED`;break;case 5:t=`MEDIA_ERR_ENCRYPTED`;break;default:t=`UNKNOWN`}t===`MEDIA_ERR_DECODE`&&J.get().errors.recoverAttempts.mediaErrorDecode>=ce.counts.mediaErrorDecode?function(){r.error(`A MEDIA_ERR_DECODE occured: Resetting the MediaSource`);let e=W.getTime();N.deactivate(!1),r.info(`MediaSource has been resetted. Resuming playback from time ${e}`),ge({seekTime:e,keepBuffers:!1,streamActivated:!1})}():(B=!0,e.error.message&&(t+=` (`+e.error.message+`)`),e.error.msExtendedCode&&(t+=` (0x`+(e.error.msExtendedCode>>>0).toString(16).toUpperCase()+`)`),r.fatal(`Video Element Error: `+t),e.error&&r.fatal(e.error),A.error(new Be.default(e.error.code,t)),it())}function et(){return N?N.getStreamInfo():null}function tt(e){for(let t=0,n=M.length;t<n;t++)if(M[t].getId()===e)return M[t];return null}function nt(e){isNaN(e.newDuration)||Ve(e.newDuration)}function rt(){M=[],se=NaN,P=null,z=!1,N=null,B=!1,V=!1,te=!0,ne=!0,q=!1,R=!0,re=null,ae=!1,ie=[],oe=null,ce={counts:{mediaErrorDecode:0}}}function it(){le(),b.reset(),Xe(B||V?Vi.FAILURE_STOP_REASON:Vi.USER_REQUEST_STOP_REASON);for(let e=0,t=M?M.length:0;e<t;e++)M[e].reset(B);t.off(g.default.PLAYBACK_TIME_UPDATED,je,n),t.off(g.default.PLAYBACK_SEEKING,be,n),t.off(g.default.PLAYBACK_ERROR,$e,n),t.off(g.default.PLAYBACK_STARTED,Me,n),t.off(g.default.PLAYBACK_PAUSED,Pe,n),t.off(g.default.PLAYBACK_ENDED,ze,n),t.off(g.default.METRIC_ADDED,at,n),t.off(g.default.MANIFEST_VALIDITY_CHANGED,nt,n),t.off(g.default.BUFFER_LEVEL_UPDATED,Oe,n),t.off(g.default.QUALITY_CHANGE_REQUESTED,ke,n),t.off(g.default.CONTENT_STEERING_REQUEST_COMPLETED,Ke,n),m.default.KEY_SESSION_UPDATED&&t.off(m.default.KEY_SESSION_UPDATED,de,n),t.off(m.default.MANIFEST_UPDATED,qe,n),t.off(m.default.STREAM_BUFFERING_COMPLETED,Fe,n),t.off(m.default.TIME_SYNCHRONIZATION_COMPLETED,ue,n),t.off(m.default.CURRENT_TRACK_CHANGED,Ce,n),t.off(m.default.SETTING_UPDATED_LIVE_DELAY,Ae,n),t.off(m.default.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT,Ae,n),t.off(ls.default.INTERNAL_KEY_STATUSES_CHANGED,Ze,n),S.reset(),u.reset(),O.reset(),v.clearAllCurrentMetrics(),f.setValue(null),d.reset(),j.reset(),k.reset(),H&&=(y.detachMediaSource(U),null),U=null,P&&(P=null,I=null,f.getValue()&&t.trigger(m.default.PROTECTION_DESTROYED,{data:f.getValue().url})),Le(),t.trigger(m.default.STREAM_TEARDOWN_COMPLETE),rt()}function at(e){if(e.metric===c.DVR_INFO){let t=Ye()?h.default.AUDIO:h.default.VIDEO;e.mediaType===t&&y.setSeekable(e.value.range.start,e.value.range.end)}}function ot(){return M}return n={addDVRMetric:De,getActiveStream:function(){return N},getActiveStreamInfo:et,getActiveStreamProcessors:Re,getAutoPlay:function(){return R},getHasMediaOrInitialisationError:function(){return B||V},getInitialPlayback:function(){return te},getIsStreamSwitchInProgress:function(){return z},getStreamById:tt,getStreamForTime:Ee,getStreams:ot,getTimeRelativeToStreamId:function(e,t){let n=null,r=0,i=0,o=null;for(let c=0;c<M.length;c++){if(n=M[c],i=n.getStartTime(),o=n.getDuration(),Number.isFinite(i)&&(r=i),n.getId()===t)return e-r;Number.isFinite(o)&&(r+=o)}return null},hasAudioTrack:Ye,hasVideoTrack:Je,initialize:function(r,i){le(),R=r,I=i,j.initialize(),u=Ea(e).create(),u.setConfig({manifestModel:f,adapter:_,manifestLoader:d,errHandler:A,settings:J,contentSteeringController:x}),u.initialize(),O=ss(e).getInstance(),O.setConfig({manifestUpdater:u,playbackController:W,settings:J}),O.start(),L=Qn(e).getInstance(),b.setConfig({dashMetrics:v,baseURLController:S,errHandler:A,settings:J}),b.initialize(),y.setConfig({settings:J}),P&&(t.trigger(m.default.PROTECTION_CREATED,{controller:P}),P.setMediaElement(U.getElement()),I&&P.setProtectionData(I)),t.on(g.default.PLAYBACK_TIME_UPDATED,je,n),t.on(g.default.PLAYBACK_SEEKING,be,n),t.on(g.default.PLAYBACK_ERROR,$e,n),t.on(g.default.PLAYBACK_STARTED,Me,n),t.on(g.default.PLAYBACK_PAUSED,Pe,n),t.on(g.default.PLAYBACK_ENDED,ze,n),t.on(g.default.METRIC_ADDED,at,n),t.on(g.default.MANIFEST_VALIDITY_CHANGED,nt,n),t.on(g.default.BUFFER_LEVEL_UPDATED,Oe,n),t.on(g.default.QUALITY_CHANGE_REQUESTED,ke,n),t.on(g.default.CONTENT_STEERING_REQUEST_COMPLETED,Ke,n),m.default.KEY_SESSION_UPDATED&&t.on(m.default.KEY_SESSION_UPDATED,de,n),t.on(m.default.MANIFEST_UPDATED,qe,n),t.on(m.default.STREAM_BUFFERING_COMPLETED,Fe,n),t.on(m.default.TIME_SYNCHRONIZATION_COMPLETED,ue,n),t.on(m.default.CURRENT_TRACK_CHANGED,Ce,n),t.on(m.default.SETTING_UPDATED_LIVE_DELAY,Ae,n),t.on(m.default.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT,Ae,n),t.on(ls.default.INTERNAL_KEY_STATUSES_CHANGED,Ze,n)},load:function(e,t=NaN){le(),se=t,d.load(e)},loadWithManifest:function(e,t=NaN){(function(){if(!u||!u.hasOwnProperty(`setManifest`))throw Error(`initialize function has to be called previously`)})(),se=t,u.setManifest(e)},refreshManifest:function(){u.getIsUpdating()||u.refreshManifest()},reset:it,setConfig:function(e){e&&(e.capabilities&&(i=e.capabilities),e.capabilitiesFilter&&(o=e.capabilitiesFilter),e.manifestLoader&&(d=e.manifestLoader),e.manifestModel&&(f=e.manifestModel),e.mediaPlayerModel&&(K=e.mediaPlayerModel),e.customParametersModel&&(ee=e.customParametersModel),e.protectionController&&(P=e.protectionController),e.adapter&&(_=e.adapter),e.dashMetrics&&(v=e.dashMetrics),e.errHandler&&(A=e.errHandler),e.timelineConverter&&(j=e.timelineConverter),e.videoModel&&(U=e.videoModel),e.playbackController&&(W=e.playbackController),e.throughputController&&(E=e.throughputController),e.serviceDescriptionController&&(G=e.serviceDescriptionController),e.contentSteeringController&&(x=e.contentSteeringController),e.textController&&(F=e.textController),e.abrController&&(T=e.abrController),e.mediaController&&(D=e.mediaController),e.settings&&(J=e.settings),e.baseURLController&&(S=e.baseURLController),e.uriFragmentModel&&(w=e.uriFragmentModel),e.segmentBaseController&&(C=e.segmentBaseController),e.manifestUpdater&&(u=e.manifestUpdater))},setProtectionData:function(e){I=e,P&&P.setProtectionData(I)},switchToVideoElement:function(e){N&&(W.initialize(et()),ge({seekTime:e,keepBuffers:!1,streamActivated:!0}))}},r=(0,l.default)(e).getInstance().getLogger(n),b=rs(e).getInstance(),y=as(e).getInstance(),k=uo(e).getInstance(),rt(),n}ds.__dashjs_factory_name=`StreamController`;var fs=i.default.getSingletonFactory(ds),ps=class extends Hr{constructor(){super(),this.captionData=null,this.label=null,this.defaultTrack=!1,this.kind=null,this.isFragmented=!1,this.isEmbedded=!1,this.isTTML=null}},ms=r(7377);function hs(){let e,t=0;function n(e){let t=``;for(let n=0;n<e.length;++n)t+=e[n].uchar;return t.length-t.replace(/^\s+/,``).length}function r(e){return`left: `+3.125*e.x+`%; top: `+6.66*e.y1+`%; width: `+(100-3.125*e.x)+`%; height: `+6.66*Math.max(e.y2-1-e.y1,1)+`%; align-items: flex-start; overflow: visible; -webkit-writing-mode: horizontal-tb;`}function i(e){return e===`red`?`rgb(255, 0, 0)`:e===`green`?`rgb(0, 255, 0)`:e===`blue`?`rgb(0, 0, 255)`:e===`cyan`?`rgb(0, 255, 255)`:e===`magenta`?`rgb(255, 0, 255)`:e===`yellow`?`rgb(255, 255, 0)`:e===`white`?`rgb(255, 255, 255)`:e===`black`?`rgb(0, 0, 0)`:e}function o(e,t){let n=e.videoHeight/15;return t?`font-size: `+n+`px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; color: `+(t.foreground?i(t.foreground):`rgb(255, 255, 255)`)+`; font-style: `+(t.italics?`italic`:`normal`)+`; text-decoration: `+(t.underline?`underline`:`none`)+`; white-space: pre; background-color: `+(t.background?i(t.background):`transparent`)+`;`:`font-size: `+n+`px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; justify-content: flex-start; text-align: left; color: rgb(255, 255, 255); font-style: normal; white-space: pre; line-height: normal; font-weight: normal; text-decoration: none; width: 100%; display: flex;`}function c(e){return e.replace(/^\s+/g,``)}function l(e){return e.replace(/\s+$/g,``)}return e={createHTMLCaptionsFromScreen:function(e,i,u,d){let f=null,p=null,m=!1,h=-1,g={start:i,end:u,spans:[]},_=`style_cea608_white_black`,v={},y={},b=[],x,S;for(x=0;x<15;++x){let e=d.rows[x],t=``,r=null;if(!1===e.isEmpty()){let o=n(e.chars);f===null&&(f={x:o,y1:x,y2:x+1,p:[]}),o!==h&&m&&(f.p.push(g),g={start:i,end:u,spans:[]},f.y2=x,f.name=`region_`+f.x+`_`+f.y1+`_`+f.y2,!1===v.hasOwnProperty(f.name)?(b.push(f),v[f.name]=f):(p=v[f.name],p.p.contat(f.p)),f={x:o,y1:x,y2:x+1,p:[]});for(let n=0;n<e.chars.length;++n){let i=e.chars[n],o=i.penState;if(r===null||!o.equals(r)){t.trim().length>0&&(g.spans.push({name:_,line:t,row:x}),t=``);let e=`style_cea608_`+o.foreground+`_`+o.background;o.underline&&(e+=`_underline`),o.italics&&(e+=`_italics`),y.hasOwnProperty(e)||(y[e]=JSON.parse(JSON.stringify(o))),r=o,_=e}t+=i.uchar}t.trim().length>0&&g.spans.push({name:_,line:t,row:x}),m=!0,h=o}else m=!1,h=-1,f&&=(f.p.push(g),g={start:i,end:u,spans:[]},f.y2=x,f.name=`region_`+f.x+`_`+f.y1+`_`+f.y2,!1===v.hasOwnProperty(f.name)?(b.push(f),v[f.name]=f):(p=v[f.name],p.p.contat(f.p)),null)}f&&=(f.p.push(g),f.y2=x+1,f.name=`region_`+f.x+`_`+f.y1+`_`+f.y2,!1===v.hasOwnProperty(f.name)?(b.push(f),v[f.name]=f):(p=v[f.name],p.p.contat(f.p)),null);let C=[];for(x=0;x<b.length;++x){let n=b[x],d=`sub_cea608_`+ t++,f=document.createElement(`div`);f.id=d;let p=r(n);f.style.cssText=`position: absolute; margin: 0; display: flex; box-sizing: border-box; pointer-events: none;`+p;let m=document.createElement(`div`);m.className=`paragraph bodyStyle`,m.style.cssText=o(e);let h=document.createElement(`div`);h.className=`cueUniWrapper`,h.style.cssText=`unicode-bidi: normal; direction: ltr;`;for(let t=0;t<n.p.length;++t){let r=n.p[t],i=0;for(S=0;S<r.spans.length;++S){let t=r.spans[S];if(t.line.length>0){if(S!==0&&i!=t.row){let e=document.createElement(`br`);e.className=`lineBreak`,h.appendChild(e)}let n=!1;i===t.row&&(n=!0),i=t.row;let u=y[t.name],d=document.createElement(`span`);d.className=`spanPadding `+t.name+` customSpanColor`,d.style.cssText=o(e,u),S!==0&&n?S===r.spans.length-1?d.textContent=l(t.line):d.textContent=t.line:r.spans.length>1&&S<r.spans.length-1&&t.row===r.spans[S+1].row?d.textContent=c(t.line):d.textContent=t.line.trim(),h.appendChild(d)}}}m.appendChild(h),f.appendChild(m);let g={bodyStyle:[`%`,90]};for(let e in y)y.hasOwnProperty(e)&&(g[e]=[`%`,90]);C.push({type:`html`,start:i,end:u,cueHTMLElement:f,cueID:d,cellResolution:[32,15],isFromCEA608:!0,fontSize:g,lineHeight:{},linePadding:{}})}return C}},e}hs.__dashjs_factory_name=`EmbeddedTextHtmlRender`;var gs=i.default.getSingletonFactory(hs),_s=class{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){let n=typeof t==`function`?t():t;console.log(`${this.time} [${e}] ${n}`)}}},vs=class{constructor(){this.foreground=`white`,this.underline=!1,this.italics=!1,this.background=`black`,this.flash=!1}reset(){this.foreground=`white`,this.underline=!1,this.italics=!1,this.background=`black`,this.flash=!1}setStyles(e){for(let t of[`foreground`,`underline`,`italics`,`background`,`flash`])Object.prototype.hasOwnProperty.call(e,t)&&(this[t]=e[t])}isDefault(){return this.foreground===`white`&&!this.underline&&!this.italics&&this.background===`black`&&!this.flash}equals(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}copy(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}},ys=class{constructor(){this.uchar=` `,this.penState=new vs}reset(){this.uchar=` `,this.penState.reset()}setChar(e,t){this.uchar=e,this.penState.copy(t)}setPenState(e){this.penState.copy(e)}equals(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)}copy(e){this.uchar=e.uchar,this.penState.copy(e.penState)}isEmpty(){return this.uchar===` `&&this.penState.isDefault()}};let bs={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499};function xs(e){return String.fromCharCode(bs[e]||e)}var Ss=class{constructor(e=new _s){this.chars=[],this.cueStartTime=null,this.pos=0,this.currPenState=new vs;for(let e=0;e<100;e++)this.chars.push(new ys);this.logger=e}equals(e){for(let t=0;t<100;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<100;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<100;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e}setCursor(e){this.pos!==e&&(this.pos=e),this.pos<0?(this.logger.log(3,`Negative cursor position `+this.pos),this.pos=0):this.pos>100&&(this.logger.log(3,`Too large cursor position `+this.pos),this.pos=100)}moveCursor(e){let t=this.pos+e;if(e>1)for(let e=this.pos+1;e<t+1;e++)this.chars[e].setPenState(this.currPenState);this.setCursor(t)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(` `,this.currPenState)}insertChar(e){e>=144&&this.backSpace();let t=xs(e);this.pos>=100?this.logger.log(0,(()=>`Cannot insert `+e.toString(16)+` (`+t+`) at position `+this.pos+`. Skipping it!`)):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))}clearFromPos(e){let t;for(t=e;t<100;t++)this.chars[t].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){let e=[],t=!0;for(let n=0;n<100;n++){let r=this.chars[n].uchar;r!==` `&&(t=!1),e.push(r)}return t?``:e.join(``)}setPenStyles(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}},Cs=class{constructor(e=new _s){this.rows=[],this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null;for(let t=0;t<15;t++)this.rows.push(new Ss(e));this.logger=e}reset(){for(let e=0;e<15;e++)this.rows[e].clear();this.currRow=14}equals(e){let t=!0;for(let n=0;n<15;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t}copy(e){for(let t=0;t<15;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<15;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(e){this.rows[this.currRow].insertChar(e)}setPen(e){this.rows[this.currRow].setPenStyles(e)}moveCursor(e){this.rows[this.currRow].moveCursor(e)}setCursor(e){this.logger.log(2,`setCursor: `+e),this.rows[this.currRow].setCursor(e)}setPAC(e){this.logger.log(2,(()=>`pacData = `+JSON.stringify(e)));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let e=0;e<15;e++)this.rows[e].clear();let e=this.currRow+1-this.nrRollUpRows,n=this.lastOutputScreen;if(n){let r=n.rows[e].cueStartTime,i=this.logger.time;if(r!==null&&i!==null&&r<i)for(let r=0;r<this.nrRollUpRows;r++)this.rows[t-this.nrRollUpRows+r+1].copy(n.rows[e+r])}}this.currRow=t;let n=this.rows[this.currRow];if(e.indent!==null){let t=e.indent,r=Math.max(t-1,0);n.setCursor(e.indent),e.color=n.chars[r].penState.foreground}let r={foreground:e.color,underline:e.underline,italics:e.italics,background:`black`,flash:!1};this.setPen(r)}setBkgData(e){this.logger.log(2,(()=>`bkgData = `+JSON.stringify(e))),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(this.nrRollUpRows===null)return void this.logger.log(3,`roll_up but nrRollUpRows not set yet`);this.logger.log(1,(()=>this.getDisplayText()));let e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,`Rolling up`)}getDisplayText(e){e||=!1;let t=[],n=``,r=-1;for(let n=0;n<15;n++){let i=this.rows[n].getTextString();i&&(r=n+1,e?t.push(`Row `+r+`: '`+i+`'`):t.push(i.trim()))}return t.length>0&&(n=e?`[`+t.join(` | `)+`]`:t.join(`
58
+ `)),n}getTextAndFormat(){return this.rows}},ws=class{constructor(e,t,n=new _s){this.chNr=e,this.outputFilter=t,this.mode=null,this.displayedMemory=new Cs(n),this.nonDisplayedMemory=new Cs(n),this.lastOutputScreen=new Cs(n),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=n,this.logger.log(2,`new Cea608Channel(`+this.chNr+`)`)}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter?.reset?.(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,(()=>`MODE=`+e)),this.mode===`MODE_POP-ON`?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!==`MODE_ROLL-UP`&&(this.displayedMemory.setRollUpRows(null),this.nonDisplayedMemory.setRollUpRows(null)),this.mode=e)}insertChars(e){for(let t of e)this.writeScreen.insertChar(t);let t=this.writeScreen===this.displayedMemory?`DISP`:`NON_DISP`;this.logger.log(2,(()=>t+`: `+this.writeScreen.getDisplayText(!0))),this.mode!==`MODE_PAINT-ON`&&this.mode!==`MODE_ROLL-UP`||(this.logger.log(1,(()=>`DISPLAYED: `+this.displayedMemory.getDisplayText(!0))),this.outputDataUpdate())}ccRCL(){this.logger.log(2,`RCL - Resume Caption Loading`),this.setMode(`MODE_POP-ON`)}ccBS(){this.logger.log(2,`BS - BackSpace`),this.mode!==`MODE_TEXT`&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,`DER- Delete to End of Row`),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,`RU(`+e+`) - Roll Up`),this.writeScreen=this.displayedMemory,this.setMode(`MODE_ROLL-UP`),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,`FON - Flash On`),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,`RDC - Resume Direct Captioning`),this.setMode(`MODE_PAINT-ON`)}ccTR(){this.logger.log(2,`TR`),this.setMode(`MODE_TEXT`)}ccRTD(){this.logger.log(2,`RTD`),this.setMode(`MODE_TEXT`)}ccEDM(){this.logger.log(2,`EDM - Erase Displayed Memory`),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,`CR - Carriage Return`),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,`ENM - Erase Non-displayed Memory`),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,`EOC - End Of Caption`),this.mode===`MODE_POP-ON`){let e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,(()=>`DISP: `+this.displayedMemory.getDisplayText()))}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,`TO(`+e+`) - Tab Offset`),this.writeScreen.moveCursor(e)}ccMIDROW(e){let t={flash:!1};t.underline=e%2==1,t.italics=e>=46,t.italics?t.foreground=`white`:t.foreground=[`white`,`green`,`blue`,`cyan`,`red`,`yellow`,`magenta`][Math.floor(e/2)-16],this.logger.log(2,`MIDROW: `+JSON.stringify(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){let t=this.logger.time;t!==null&&this.outputFilter&&(this.cueStartTime!==null||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t):this.cueStartTime=t,this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}};let Ts=[`white`,`green`,`blue`,`cyan`,`red`,`yellow`,`magenta`,`black`,`transparent`];function Es(e,t,n){return n.a===e&&n.b===t}function Ds(e){let t=[];for(let n of e)t.push(n.toString(16));return t}let Os={17:2,18:4,21:6,22:8,23:10,19:13,20:15},ks={25:2,26:4,29:6,30:8,31:10,27:13,28:15},As={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},js={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14};function Ms(e,t,n){n.a=e,n.b=t}var Ns=class{constructor(e,t,n){this.currentChannel=0,this.cmdHistory={a:null,b:null},this.lastTime=null;let r=this.logger=new _s;this.channels=[null,new ws(e,t,r),new ws(e+1,n,r)]}addData(e,t){this.lastTime=e,this.logger.time=e;for(let n=0;n<t.length;n+=2){let r=127&t[n],i=127&t[n+1],o=!1,c=null;if(this.lastTime!==null&&(e=this.lastTime+.5*n*1001/3e4,this.logger.time=e),r===0&&i===0)continue;this.logger.log(3,(()=>`[`+Ds([t[n],t[n+1]])+`] -> (`+Ds([r,i])+`)`));let l=this.cmdHistory;if(r>=16&&r<=31){if(Es(r,i,l)){Ms(null,null,l),this.logger.log(3,(()=>`Repeated command (`+Ds([r,i])+`) is dropped`));continue}Ms(r,i,this.cmdHistory),o=this.parseCmd(r,i),o||=this.parseMidrow(r,i),o||=this.parsePAC(r,i),o||=this.parseBackgroundAttributes(r,i)}else Ms(null,null,l);if(!o&&(c=this.parseChars(r,i),c.length)){let e=this.currentChannel;e&&e>0?this.channels[e].insertChars(c):this.logger.log(2,`No channel found yet. TEXT-MODE?`)}o||c||this.logger.log(2,(()=>`Couldn't parse cleaned data `+Ds([r,i])+` orig: `+Ds([t[n],t[n+1]])))}}parseCmd(e,t){if(!((e===20||e===28||e===21||e===29)&&t>=32&&t<=47||(e===23||e===31)&&t>=33&&t<=35))return!1;let n=e===20||e===21||e===23?1:2,r=this.channels[n];return e===20||e===21||e===28||e===29?t===32?r.ccRCL():t===33?r.ccBS():t===34?r.ccAOF():t===35?r.ccAON():t===36?r.ccDER():t===37?r.ccRU(2):t===38?r.ccRU(3):t===39?r.ccRU(4):t===40?r.ccFON():t===41?r.ccRDC():t===42?r.ccTR():t===43?r.ccRTD():t===44?r.ccEDM():t===45?r.ccCR():t===46?r.ccENM():t===47&&r.ccEOC():r.ccTO(t-32),this.currentChannel=n,!0}parseMidrow(e,t){let n=0;if((e===17||e===25)&&t>=32&&t<=47){if(n=e===17?1:2,n!==this.currentChannel)return this.logger.log(0,`Mismatch channel in midrow parsing`),!1;let r=this.channels[n];return!!r&&(r.ccMIDROW(t),this.logger.log(3,(()=>`MIDROW (`+Ds([e,t])+`)`)),!0)}return!1}parsePAC(e,t){let n;if(!((e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127||(e===16||e===24)&&t>=64&&t<=95))return!1;let r=e<=23?1:2;n=t>=64&&t<=95?r===1?As[e]:js[e]:r===1?Os[e]:ks[e];let i=this.channels[r];return!!i&&(i.setPAC(this.interpretPAC(n,t)),this.currentChannel=r,!0)}interpretPAC(e,t){let n,r={color:null,italics:!1,indent:null,underline:!1,row:e};return n=t>95?t-96:t-64,r.underline=!(1&~n),n<=13?r.color=[`white`,`green`,`blue`,`cyan`,`red`,`yellow`,`magenta`,`white`][Math.floor(n/2)]:n<=15?(r.italics=!0,r.color=`white`):r.indent=4*Math.floor((n-16)/2),r}parseChars(e,t){let n,r=[],i=null;if(e>=25?(n=2,i=e-8):(n=1,i=e),i>=17&&i<=19){let e;e=i===17?t+80:i===18?t+112:t+144,this.logger.log(2,(()=>`Special char '`+xs(e)+`' in channel `+n)),r=[e]}else e>=32&&e<=127&&(r=t===0?[e]:[e,t]);return r&&this.logger.log(3,(()=>`Char codes = `+Ds(r).join(`,`))),r}parseBackgroundAttributes(e,t){if(!((e===16||e===24)&&t>=32&&t<=47||(e===23||e===31)&&t>=45&&t<=47))return!1;let n,r={};e===16||e===24?(n=Math.floor((t-32)/2),r.background=Ts[n],t%2==1&&(r.background+=`_semi`)):t===45?r.background=`transparent`:(r.foreground=`black`,t===47&&(r.underline=!0));let i=e<=23?1:2;return this.channels[i].setBkgData(r),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){let t=this.channels[e];t&&t.reset()}Ms(null,null,this.cmdHistory)}cueSplitAtTime(e){for(let t of this.channels)t&&t.cueSplitAtTime(e)}};function Ps(e,t,n){let r=[];for(let i=t;i<n;i++)i+2<n&&e.getUint8(i)===0&&e.getUint8(i+1)===0&&e.getUint8(i+2)===3?(r.push(0),r.push(0),i+=2):r.push(e.getUint8(i));return new DataView(new Uint8Array(r).buffer)}function Fs(e,t,n,r){return!(e!==4||t<8)&&n.getUint8(r)===181&&n.getUint16(r+1)===49&&n.getUint32(r+3)===1195456820&&n.getUint8(r+7)===3}function Is(e,t){return(127&e)>0||(127&t)>0}function Ls(e,t){let n=0;for(;n<e.byteLength;){let i,o=0,c=0;do o+=i=e.getUint8(n++);while(i===255);do c+=i=e.getUint8(n++);while(i===255);if(Fs(o,c,e,n)){let i=n+10,o=i+3*(31&e.getUint8(i-2));for(let n=i;n<o;n+=3){let i=e.getUint8(n);if(4&i){let o=3&i;if((r=o)===0||r===1){let r=e.getUint8(n+1),i=e.getUint8(n+2);Is(r,i)&&t[o].push(r,i)}}}}n+=c}var r}function Rs(e,t,n){let r=0,i=0,o=[[],[]];for(let c=t;c<t+n-5&&(r=e.getUint32(c),i=31&e.getUint8(c+4),!(c+5+r>t+n));c++)i===6&&c+5+r<=e.byteLength&&Ls(Ps(e,c+5,c+5+r),o),c+=r+3;return o}function zs(e){let t=e.errHandler,n=e.manifestModel,r=e.mediaController,i=e.videoModel,o=e.textTracks,c=e.vttParser,u=e.vttCustomRenderingParser,d=e.ttmlParser,f=e.streamInfo,g=e.settings,_=this.context,v=(0,p.default)(_).getInstance(),y,b,x,S,C,w,E,D,O,k,A,j,M,N,P,F,I,L=!1;function R(){w=null,D=NaN,O=[],k=null,E=!1,C=[],S=null}function z(e){let t={};t[Y.default.SUBTITLE]=`subtitles`,t[Y.default.CAPTION]=`captions`,t[Y.default.FORCED_SUBTITLE]=`subtitles`;let n=new ps;for(let t in e)n[t]=e[t];n.defaultTrack=function(e){let t=!1;return j.length>1&&e.isEmbedded?t=e.id&&e.id===h.default.CC1:j.length===1?e.id&&typeof e.id==`string`&&e.id.substring(0,2)===`CC`&&(t=!0):j.length===0&&(t=e.index===C[0].index),t}(e),n.isTTML=function(e){return e.codec&&e.codec.search(h.default.STPP)>=0||e.mimeType&&e.mimeType.search(h.default.TTML)>=0}(e),n.kind=function(e,t){let n=e.roles&&e.roles.length>0?t[e.roles[0].value]:t.caption;return n=Object.values(t).includes(n)?n:t.caption,n}(e,t),o.addTextTrackInfo(n)}function B(e){let t=e.chunk;t.representation.mediaInfo.embeddedCaptions&&H(t.bytes,t)}function V(e){A=e}function H(e,r){let i=r.representation.mediaInfo,l=i.type,u=i.mimeType,d=i.codec||u;d?i.codec.indexOf(`application/mp4`)===-1?l===h.default.VIDEO?function(e,t){let n,r;if(t.segmentType===T.HTTPRequest.INIT_SEGMENT_TYPE)M===0&&(M=x.getMediaTimescaleFromMoov(e));else if(t.segmentType===T.HTTPRequest.MEDIA_SEGMENT_TYPE){if(M===0)return void b.warn(`CEA-608: No timescale for embeddedTextTrack yet`);r=x.getSamplesInfo(e);let i=r.lastSequenceNumber,c=Math.trunc(t.start),l=Math.trunc(t.end);if(F[0]||F[1]||function(){let e;for(let t=0;t<j.length;t++){if(e=o.getTrackIdxForId(j[t].id),e===-1)return void b.warn(`CEA-608: data before track is ready.`);let n=U(e);F[t]=new Ns(t+1,{newCue:n},null)}}(),M){if(function(e,t,n,r,i){return e!==null&&t!==null&&r!==null&&i!==null&&(t===e?r!==i:t!==e+n)}(N,i,r.numSequences,P,c))for(n=0;n<F.length;n++)F[n]&&F[n].reset();let t=function(e,t){if(t.length===0)return null;let n={splits:[],fields:[[],[]]},r=new DataView(e);for(let e=0;e<t.length;e++){let i=t[e],o=Rs(r,i.offset,i.size),c=null,l=0;for(let e=0;e<2;e++)if(o[e].length>0){i.cts===c?l+=1:l=0;let t=W();n.fields[e].push([i.cts+t*M,o[e],l]),c=i.cts}}return n.fields.forEach((function(e){e.sort((function(e,t){return e[0]===t[0]?e[2]-t[2]:e[0]-t[0]}))})),n}(e,r.sampleList);for(let e=0;e<F.length;e++){let r=t.fields[e],i=F[e];if(i)for(n=0;n<r.length;n++)i.addData(r[n][0]/M,r[n][1])}N=i,P=l}}}(e,r):function(e,n,r){let i,c,l=new DataView(e,0,e.byteLength);c=xr.Utils.dataViewToString(l,h.default.UTF8);try{i=G(r).parse(c,0),o.addCaptions(o.getCurrentTrackIdx(),0,i),y.buffered&&y.buffered.add(n.start,n.end)}catch(e){t.error(new Be.default(Ne.TIMED_TEXT_ERROR_ID_PARSE_CODE,Ne.TIMED_TEXT_ERROR_MESSAGE_PARSE+e.message,c))}}(e,r,d):function(e,t,r){let i,l;if(t.segmentType===`InitializationSegment`)E=!0,D=x.getMediaTimescaleFromMoov(e);else{if(!E)return;l=x.getSamplesInfo(e),i=l.sampleList,i.length>0&&(k=i[0].cts-t.start*D),r.search(h.default.STPP)>=0?function(e,t,r){let i,c;for(S=S===null?G(r):S,i=0;i<t.length;i++){let r=t[i],l=r.cts,u=W(),d=u+l/D,f=d+r.duration/D;y.buffered.add(d,f);let p=new DataView(e,r.offset,r.subSizes[0]),m=xr.Utils.dataViewToString(p,h.default.UTF8),g=[],_=r.offset+r.subSizes[0];for(c=1;c<r.subSizes.length;c++){let t=new Uint8Array(e,_,r.subSizes[c]),n=String.fromCharCode.apply(null,t);g.push(n),_+=r.subSizes[c]}try{let e=n.getValue().ttmlTimeIsRelative?l/D:0,t=S.parse(m,e,l/D,(l+r.duration)/D,g);o.addCaptions(A,u,t)}catch(e){w.removeExecutedRequestsBeforeTime(),K(),b.error(`TTML parser error: `+e)}}}(e,i,r):function(e,t){let n,r,i,l=[];for(n=0;n<t.length;n++){let o=t[n];o.cts-=k;let u=W()+o.cts/D,d=u+o.duration/D;y.buffered.add(u,d);let f=e.slice(o.offset,o.offset+o.size),p=xr.parseBuffer(f);for(r=0;r<p.boxes.length;r++){let e=p.boxes[r];if(b.debug(`VTT box1: `+e.type),e.type!==`vtte`&&e.type===`vttc`){b.debug(`VTT vttc boxes.length = `+e.boxes.length);let t={styles:{}};for(i=0;i<e.boxes.length;i++){let n=e.boxes[i];if(b.debug(`VTT box2: `+n.type),n.type===`payl`)t.start=o.cts/D,t.end=(o.cts+o.duration)/D,t.data=n.cue_text;else if(n.type===`sttg`&&n.settings&&n.settings!==``)try{let e=n.settings.split(` `);t.styles=c.getCaptionStyles(e)}catch{}}t&&t.data&&(l.push(t),b.debug(`VTT ${t.start} - ${t.end} : ${t.data}`))}}}l.length>0&&o.addCaptions(A,0,l)}(e,i)}}(e,r,d):b.error(`No text type defined`)}function U(e){return function(t,n,r){let c;c=i.getTTMLRenderingDiv()?I.createHTMLCaptionsFromScreen(i.getElement(),t,n,r):[{start:t,end:n,data:r.getDisplayText(),styles:{}}],c&&o.addCaptions(e,0,c)}}function W(){return isNaN(y.timestampOffset)?0:y.timestampOffset}function G(e){let t;return e.search(h.default.VTT)>=0?t=g.get().streaming.text.webvtt.customRenderingEnabled&&u?u:c:(e.search(h.default.TTML)>=0||e.search(h.default.STPP)>=0)&&(t=d),t}function K(e,t){e===void 0&&e===t&&(e=y.buffered.start(0),t=y.buffered.end(y.buffered.length-1)),y.buffered.remove(e,t),o.deleteCuesFromTrackIdx(A,e,t)}function ee(e){j.forEach((function(t){let n=o.getTrackIdxForId(t.id);n>=0&&o.deleteCuesFromTrackIdx(n,e.from,e.to)}))}return y={initialize:function(){L||(j=[],A=null,M=0,F=[],N=null,P=null,L=!0,I=gs(_).getInstance(),v.on(m.default.VIDEO_CHUNK_RECEIVED,B,y),v.on(m.default.BUFFER_CLEARED,ee,y))},addMediaInfos:function(e,t,n){if(C=C.concat(t),e===h.default.TEXT&&t[0].isFragmented&&!t[0].isEmbedded){w=n,y.buffered=(0,ms.default)(_).create(),O=r.getTracksFor(h.default.TEXT,f.id).filter((e=>e.isFragmented));let e=r.getCurrentTrackFor(h.default.TEXT,f.id);for(let t=0;t<O.length;t++)if(O[t]===e){V(t);break}}for(let e=0;e<t.length;e++)z(t[e])},resetMediaInfos:function(){C=[]},getStreamId:function(){return f.id},append:H,abort:function(){},addEmbeddedTrack:function(e){if(L&&e)if(e.id===h.default.CC1||e.id===h.default.CC3){for(let t=0;t<j.length;t++)if(j[t].id===e.id)return;j.push(e)}else b.warn(`Embedded track `+e.id+` not supported!`)},resetEmbedded:function(){v.off(m.default.VIDEO_CHUNK_RECEIVED,B,y),v.off(m.default.BUFFER_CLEARED,ee,y),o&&o.deleteAllTextTracks(),L=!1,j=[],F=[null,null],N=null,P=null},getConfig:function(){return{fragmentModel:w,fragmentedTracks:O,videoModel:i}},setCurrentFragmentedTrackIdx:V,remove:K,reset:function(){R(),C=[],x=null}},b=(0,l.default)(_).getInstance().getLogger(y),x=wr(_).getInstance(),R(),y}zs.__dashjs_factory_name=`TextSourceBuffer`;var Bs=i.default.getClassFactory(zs);class Vs{constructor(){this.root=null,this.size=0}addCue(e){let t={start:e.startTime,end:e.endTime,cue:e,maxEnd:e.endTime,left:null,right:null,height:1},[n,r]=this._insert(t,this.root);this.root=n,r&&this.size++}removeCue(e){let[t,n]=this._remove(e,this.root);return this.root=t,n&&this.size--,n}findCuesInRange(e,t){let n=[];return this._searchRange(this.root,e,t,n),n}findCuesAtTime(e){return this.findCuesInRange(e,e)}getAllCues(){let e=[];return this._inorderTraversal(this.root,e),e}getSize(){return this.size}clear(){this.root=null,this.size=0}_compareCues(e,t){return e.startTime===t.startTime?e.endTime===t.endTime?typeof VTTCue<`u`&&e instanceof VTTCue&&t instanceof VTTCue||e.text&&t.text?e.text.localeCompare(t.text):0:e.endTime-t.endTime:e.startTime-t.startTime}_compareIntervals(e,t){return this._compareCues(e.cue,t.cue)}_insert(e,t){if(!t)return[e,!0];let n=this._compareIntervals(e,t);if(n<0){let[n]=this._insert(e,t.left);t.left=n}else{if(!(n>0))return[t,!1];{let[n]=this._insert(e,t.right);t.right=n}}t.height=1+Math.max(this._getHeight(t.left),this._getHeight(t.right)),t.maxEnd=Math.max(t.maxEnd,e.maxEnd);let r=this._getBalance(t);return r>1?(this._compareIntervals(e,t.left)<0||(t.left=this._leftRotate(t.left)),[this._rightRotate(t),!0]):r<-1?(this._compareIntervals(e,t.right)>0||(t.right=this._rightRotate(t.right)),[this._leftRotate(t),!0]):[t,!0]}_searchRange(e,t,n,r){e&&(this._overlaps(e,t,n)&&r.push(e.cue),e.left&&e.left.maxEnd>=t&&this._searchRange(e.left,t,n,r),e.right&&e.start<=n&&this._searchRange(e.right,t,n,r))}_inorderTraversal(e,t){e&&(this._inorderTraversal(e.left,t),t.push(e.cue),this._inorderTraversal(e.right,t))}_overlaps(e,t,n){if(n===t){let n=t;return e.start<=n&&n<e.end}return e.start<n&&t<e.end}_getHeight(e){return e?e.height:0}_getBalance(e){return e?this._getHeight(e.left)-this._getHeight(e.right):0}_leftRotate(e){let t=e.right,n=t.left;return t.left=e,e.right=n,e.height=1+Math.max(this._getHeight(e.left),this._getHeight(e.right)),t.height=1+Math.max(this._getHeight(t.left),this._getHeight(t.right)),e.maxEnd=Math.max(e.end,e.left?e.left.maxEnd:0,e.right?e.right.maxEnd:0),t.maxEnd=Math.max(t.end,t.left?t.left.maxEnd:0,t.right?t.right.maxEnd:0),t}_rightRotate(e){let t=e.left,n=t.right;return t.right=e,e.left=n,e.height=1+Math.max(this._getHeight(e.left),this._getHeight(e.right)),t.height=1+Math.max(this._getHeight(t.left),this._getHeight(t.right)),e.maxEnd=Math.max(e.end,e.left?e.left.maxEnd:0,e.right?e.right.maxEnd:0),t.maxEnd=Math.max(t.end,t.left?t.left.maxEnd:0,t.right?t.right.maxEnd:0),t}_remove(e,t){if(!t)return[null,!1];let n=this._compareCues(e,t.cue);if(n<0){let[n,r]=this._remove(e,t.left);return t.left=n,r&&this._updateNode(t),[t,r]}if(n>0){let[n,r]=this._remove(e,t.right);return t.right=n,r&&this._updateNode(t),[t,r]}if(t.left||t.right){if(t.left){if(t.right){let e=this._findMin(t.right);t.cue=e.cue,t.start=e.start,t.end=e.end;let[n]=this._remove(e.cue,t.right);return t.right=n,this._updateNode(t),[t,!0]}return[t.left,!0]}return[t.right,!0]}return[null,!0]}_findMin(e){for(;e.left;)e=e.left;return e}_updateNode(e){e.height=1+Math.max(this._getHeight(e.left),this._getHeight(e.right)),e.maxEnd=Math.max(e.end,e.left?e.left.maxEnd:0,e.right?e.right.maxEnd:0)}}var Hs=r(7640);let Us=[`text`,`align`,`fontSize`,`id`,`isd`,`line`,`lineAlign`,`lineHeight`,`linePadding`,`position`,`positionAlign`,`region`,`size`,`snapToLines`,`vertical`];function Ws(e){let t=this.context,n=(0,p.default)(t).getInstance(),r=e.videoModel,i=e.streamInfo,o=e.settings,c,u,d,f,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M,N=new Map;function P(e){let t=e.kind,n=e.id===void 0?e.lang:e.id,i=e.lang,o=e.isTTML,c=e.isEmbedded;return r.addTextTrack(t,n,i,o,c)}function F(e,t,n,r,i,o){let c=0,l=0;e/t>n/r?(l=t,c=l/r*n):(c=e,l=c/n*r);let u=0,d=0,f=0,p=0;return c/l>i?(p=l,f=l*i):(f=c,p=c/i),u=(e-f)/2,d=(t-p)/2,o?{x:u+.1*f,y:d+.1*p,w:.8*f,h:.8*p}:{x:u,y:d,w:f,h:p}}function I(e,t){let i=r.getClientWidth(),o=r.getClientHeight(),c=r.getVideoWidth(),l=r.getVideoHeight(),u=r.getVideoRelativeOffsetTop(),d=r.getVideoRelativeOffsetLeft();if(c!==0&&l!==0){let r=c/l,f=!1;e.isFromCEA608&&(r=3.5/3,f=!0);let p=F.call(this,i,o,c,l,r,f),m=p.w,h=p.h,_=p.x,v=p.y;if(m!=x||h!=S||_!=y||v!=b||t){if(y=_+d,b=v+u,x=m,S=h,C){let e=C.style;e&&(e.left=y+`px`,e.top=b+`px`,e.width=x+`px`,e.height=S+`px`,e.zIndex=E&&document[E]||D?k:null,n.trigger(g.default.CAPTION_CONTAINER_RESIZE))}let t=e.activeCues;if(t){let e=t.length;for(let n=0;n<e;++n){let e=t[n];e.scaleCue(e)}}}}}function L(e){let t=x,n=S,r,i,o,c,l;if(e.cellResolution){let u=[t/e.cellResolution[0],n/e.cellResolution[1]];if(e.linePadding){for(r in e.linePadding)if(e.linePadding.hasOwnProperty(r)){i=(e.linePadding[r]*u[0]).toString();let t=document.getElementsByClassName(`spanPadding`);for(let e=0;e<t.length;e++)t[e].style.cssText=t[e].style.cssText.replace(/(padding-left\s*:\s*)[\d.,]+(?=\s*px)/gi,`$1`+i),t[e].style.cssText=t[e].style.cssText.replace(/(padding-right\s*:\s*)[\d.,]+(?=\s*px)/gi,`$1`+i)}}if(e.fontSize){for(r in e.fontSize)if(e.fontSize.hasOwnProperty(r)){e.fontSize[r][0]===`%`?o=e.fontSize[r][1]/100:e.fontSize[r][0]===`c`&&(o=e.fontSize[r][1]),i=(o*u[1]).toString(),l=r===`defaultFontSize`?document.getElementsByClassName(`paragraph`):document.getElementsByClassName(r);for(let e=0;e<l.length;e++)l[e].style.cssText=l[e].style.cssText.replace(/(font-size\s*:\s*)[\d.,]+(?=\s*px)/gi,`$1`+i)}if(e.lineHeight){for(r in e.lineHeight)if(e.lineHeight.hasOwnProperty(r)){e.lineHeight[r][0]===`%`?c=e.lineHeight[r][1]/100:e.fontSize[r][0]===`c`&&(c=e.lineHeight[r][1]),i=(c*u[1]).toString(),l=document.getElementsByClassName(r);for(let e=0;e<l.length;e++)l[e].style.cssText=l[e].style.cssText.replace(/(line-height\s*:\s*)[\d.,]+(?=\s*px)/gi,`$1`+i)}}}}if(e.isd){let t=document.getElementById(e.cueID);t&&C.removeChild(t),z(e)}}function R(e,t){let n=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/,r=/^#(.*)$/;if(n.test(t)){let r=n.exec(t),i=parseInt(r[4],10)-1;return`data:image/png;base64,`+btoa(e.images[i])}if(r.test(t)){let n=r.exec(t)[1];return`data:image/png;base64,`+e.embeddedImages[n]}return t}function z(e){if(C){pe.call(this);let t=document.createElement(`div`);C.appendChild(t),O=(0,Hs.renderHTML)(e.isd,t,(function(t){return R(e,t)}),C.clientHeight,C.clientWidth,o.get().streaming.text.imsc.displayForcedOnlyMode,(function(e){u.info(`renderCaption :`,e)}),O,o.get().streaming.text.imsc.enableRollUp),t.id=e.cueID,n.trigger(g.default.CAPTION_RENDERED,{captionDiv:t,currentTrackIdx:v})}}function B(e,t){let n=t.findCuesInRange(e.startTime-.1,e.endTime+.1);for(let t of n)if(V(e,t)&&H(e,t,Us)||V(t,e)&&H(e,t,Us))return t;return null}function V(e,t){return!!t&&t.endTime>=e.startTime}function H(e,t,n){for(let r=0;r<n.length;r++){let i=n[r];if(JSON.stringify(e[i])!==JSON.stringify(t[i]))return!1}return!0}function U(e,t){t&&t.forEach((t=>{t.kind&&t.kind===`image`&&(t.src=R(e,t.src)),U(e,t.contents)}))}function W(e,t,n){let r=ae(e),i=N.get(r),c=o.get().streaming.text.dispatchForManualRendering;if(r&&i&&Array.isArray(n)&&n.length!==0){for(let e=0;e<n.length;e++){let f=null,p=n[e];if(r.cellResolution=p.cellResolution,r.isFromCEA608=p.isFromCEA608,isNaN(p.start)||isNaN(p.end)||(c?f=G(p,t):ne(p)&&C?f=q(p,t,r):p.data&&(f=te(p,t,r))),f){if(o.get().streaming.text.extendSegmentedCues){let e=B(f,i.allCues);e&&(i.allCues.removeCue(e),d=f,(l=e).startTime=Math.min(l.startTime,d.startTime),l.endTime=Math.max(l.endTime,d.endTime),f=l)}i.allCues.addCue(f)}else u.error(`Impossible to display subtitles. You might have missed setting a TTML rendering div via player.attachTTMLRenderingDiv(TTMLRenderingDiv)`)}var l,d;ue()}}function G(e,t){let n=re(e,t);return n.onenter=function(){ne(e)&&M&&M.cueID!==n.cueID&&ee(M),delete n.type,M=n,K(n)},n.onexit=function(){ee(n),M=null},n}function K(e){n.trigger(g.default.CUE_ENTER,e)}function ee(e){n.trigger(g.default.CUE_EXIT,{cueID:e.cueID})}function q(e,t,r){let i=this,o=re(e,t);return C.style.left=y+`px`,C.style.top=b+`px`,C.style.width=x+`px`,C.style.height=S+`px`,o.onenter=function(){r.mode===h.default.TEXT_SHOWING&&(this.isd?(j?requestAnimationFrame((()=>z(this))):z(this),u.debug(`Cue enter id:`+this.cueID)):(C.appendChild(this.cueHTMLElement),L.call(i,this),n.trigger(g.default.CAPTION_RENDERED,{captionDiv:this.cueHTMLElement,currentTrackIdx:v})))},o.onexit=function(){if(C){let e=C.childNodes;for(let t=0;t<e.length;++t)e[t].id===this.cueID&&(u.debug(`Cue exit id:`+e[t].id),C.removeChild(e[t]),--t)}},o}function te(e,t,r){let i=re(e,t);if(e.styles)try{e.styles.align!==void 0&&`align`in i&&(i.align=e.styles.align),e.styles.line!==void 0&&`line`in i&&(i.line=e.styles.line),e.styles.lineAlign!==void 0&&(i.lineAlign=e.styles.lineAlign),e.styles.snapToLines!==void 0&&`snapToLines`in i&&(i.snapToLines=e.styles.snapToLines),e.styles.position!==void 0&&`position`in i&&(i.position=e.styles.position),e.styles.positionAlign!==void 0&&(i.positionAlign=e.styles.positionAlign),e.styles.size!==void 0&&`size`in i&&(i.size=e.styles.size)}catch(e){u.error(e)}return i.onenter=function(){r.mode===h.default.TEXT_SHOWING&&n.trigger(g.default.CAPTION_RENDERED,{currentTrackIdx:v})},i}function ne(e){return e.type===`html`}function re(e,t){return ne(e)?function(e,t){let n=new d(e.start+t,e.end+t,``);return n.cueHTMLElement=e.cueHTMLElement,n.isd=e.isd,n.images=e.images,n.embeddedImages=e.embeddedImages,n.cueID=e.cueID,n.scaleCue=L.bind(self),n.cellResolution=e.cellResolution,n.lineHeight=e.lineHeight,n.linePadding=e.linePadding,n.fontSize=e.fontSize,n.isd&&U(n,n.isd.contents),n}(e,t):function(e,t){let n=new d(e.start-t,e.end-t,e.data);return n.cueID=He.default.generateUuid(),n}(e,t)}function ie(e){if(w){let t=w.childNodes;for(let n=0;n<t.length;++n)t[n].id===e.cueID&&(w.removeChild(t[n]),--n)}}function J(){let e=r.getTextTracks(),t=[];for(let n of e)n.manualMode===h.default.TEXT_SHOWING&&t.push(n);return t}function ae(e){return e>=0&&f[e]?r.getTextTrack(f[e].kind,f[e].id,f[e].lang,f[e].isTTML,f[e].isEmbedded):null}function oe(e){if(e===v)return;v=e;let t=ae(v);se.call(this,t),T&&=(clearInterval(T),null),t&&t.renderingType===`html`&&(I.call(this,t,!0),window.ResizeObserver?(A=new window.ResizeObserver((()=>{I.call(this,t,!0)})),A.observe(r.getElement())):T=setInterval(I.bind(this,t),500))}function se(e){pe.call(this),e&&e.renderingType===`html`?de.call(this):fe.call(this)}function ce(e,t,n,r=!0){return!!e&&(isNaN(t)||(r?e.startTime:e.endTime)>=t)&&(isNaN(n)||(r?e.endTime:e.startTime)<=n)}function le(e,t,n,r=!0){if(!e)return;if(e.cues&&e.cues.length>0)for(let i=e.cues.length-1;i>=0;i--)ce(e.cues[i],t,n,r)&&(e.cues[i].onexit&&e.cues[i].onexit(),e.removeCue(e.cues[i]));let i=N.get(e);if(i){let e=i.activeCues,r=e.filter((e=>e.startTime>=t&&e.endTime<=n));r.forEach((e=>{o.get().streaming.text.dispatchForManualRendering?ee(e):ie(e)})),i.activeCues=e.filter((e=>!r.includes(e)))}}function ue(){for(let e of N.values())e.lastCueWindowUpdate=-1/0}function de(){let e=document.getElementById(`native-cue-style`);if(e)return;e=document.createElement(`style`),e.id=`native-cue-style`,document.head.appendChild(e);let t=e.sheet,n=r.getElement();try{n&&(n.id?t.insertRule(`#`+n.id+`::cue {background: transparent}`,0):n.classList.length===0?t.insertRule(`video::cue {background: transparent}`,0):t.insertRule(`.`+n.className+`::cue {background: transparent}`,0))}catch(e){u.info(``+e.message)}}function fe(){let e=document.getElementById(`native-cue-style`);e&&document.head.removeChild(e)}function pe(){if(C)for(;C.firstChild;)C.removeChild(C.firstChild)}function me(){return f}return c={addCaptions:W,addTextTrackInfo:function(e){f.push(e)},createTracks:function(){f.sort((function(e,t){return e.index-t.index})),C=r.getTTMLRenderingDiv(),w=r.getVttRenderingDiv();let e=-1;for(let t=0;t<f.length;t++){let r=P(f[t]);_.push(r),f[t].defaultTrack&&(r.default=!0,e=t);let i=ae(t);i&&(i.mode=h.default.TEXT_SHOWING,C&&(f[t].isTTML||f[t].isEmbedded)?i.renderingType=`html`:i.renderingType=`default`,N.set(i,{allCues:new Vs,lastCueWindowUpdate:-1/0,activeCues:[]})),W(t,0,f[t].captionData),n.trigger(g.default.TEXT_TRACK_ADDED)}if(oe.call(this,e),e>=0){let t=function(){let r=ae(e);r&&r.renderingType===`html`&&I.call(this,r,!0),n.off(g.default.PLAYBACK_METADATA_LOADED,t,this)};n.on(g.default.PLAYBACK_METADATA_LOADED,t,this);for(let t=0;t<f.length;t++){let n=ae(t);if(n){let r=o.get().streaming.text.dispatchForManualRendering;n.mode=t!==e||r?h.default.TEXT_HIDDEN:h.default.TEXT_SHOWING,n.manualMode=t===e?h.default.TEXT_SHOWING:h.default.TEXT_HIDDEN}}}n.trigger(m.default.TEXT_TRACKS_QUEUE_INITIALIZED,{index:v,tracks:f,streamId:i.id})},deleteAllTextTracks:function(){let e=_?_.length:0;for(let t=0;t<e;t++){let e=ae(t);e&&le.call(this,e,i.start,i.start+i.duration,!1)}_=[],f=[],T&&=(clearInterval(T),null),A&&r&&(A.unobserve(r.getElement()),A=null),v=-1,pe.call(this),N.clear()},deleteCuesFromTrackIdx:function(e,t,n){let r=ae(e);r&&le(r,t,n)},disableManualTracks:function(){let e=J();if(e&&e.length>0){let t=e[0],n=N.get(t);if(!n)return;n.activeCues.forEach((e=>{o.get().streaming.text.dispatchForManualRendering?ee(e):ie(e)})),n.activeCues=[]}},getCurrentTrackIdx:function(){return v},getCurrentTextTrackInfo:function(){return f[v]},getStreamId:function(){return i.id},getTextTrackInfos:me,getTrackIdxForId:function(e){let t=-1;for(let n=0;n<f.length;n++)if(f[n].id===e){t=n;break}return t},initialize:function(){typeof window<`u`&&typeof navigator<`u`&&(d=window.VTTCue||window.TextTrackCue,f=[],_=[],v=-1,y=0,b=0,x=0,S=0,C=null,w=null,T=null,D=!1,k=2147483647,O=null,j=`requestAnimationFrame`in window,N.clear(),document.fullscreenElement===void 0?document.webkitIsFullScreen===void 0?document.msFullscreenElement?E=`msFullscreenElement`:document.mozFullScreen&&(E=`mozFullScreen`):E=`webkitIsFullScreen`:E=`fullscreenElement`)},manualCueProcessing:function(e){let t=J();if(t&&t.length>0){let n=t[0],r=N.get(n);if(!r)return;let i=r.activeCues,c=r.allCues.findCuesAtTime(e),l=i.filter((e=>!c.includes(e))),u=c.filter((e=>!i.includes(e)));l.forEach((e=>{o.get().streaming.text.dispatchForManualRendering?ee(e):ie(e)})),u.forEach((e=>{o.get().streaming.text.dispatchForManualRendering?K(e):WebVTT.processCues(window,[e],w,e.cueID)})),r.activeCues=c}},setCurrentTrackIdx:oe,setModeForTrackIdx:function(e,t){let n=ae(e);n&&n.mode!==t&&(n.mode=t),n&&n.manualMode!==t&&(n.manualMode=t)},updateTextTrackWindow:function(e,t=!1){let n=me(),i=o.get().streaming.text.webvtt.customRenderingEnabled;for(let c=0;c<n.length;c++){let l=n[c],u=ae(c),d=N.get(u);if(!u||!d||!l.isEmbedded&&i)continue;let{bufferToKeep:f,bufferPruningInterval:p}=o.get().streaming.buffer,m=Date.now();if((m-d.lastCueWindowUpdate)/1e3<p&&!t)continue;let g=r.getPlaybackRate()||1,_=Math.max(0,e-f/g),v=e+2*p/g;if(u.cues)for(;u.cues.length>0;)u.removeCue(u.cues[0]);u.mode!==h.default.TEXT_DISABLED&&d.allCues.findCuesInRange(_,v).forEach((e=>{u.addCue(e)})),d.lastCueWindowUpdate=m}},invalidateCueWindow:ue},u=(0,l.default)(t).getInstance().getLogger(c),c}Ws.__dashjs_factory_name=`TextTracks`;var Gs=i.default.getClassFactory(Ws);function $(){let e=this.context,t,n,r,i,o,c;function u(e){let t=e.split(`:`),n=t.length-1;return e=60*parseInt(t[n-1],10)+parseFloat(t[n]),n===2&&(e+=3600*parseInt(t[0],10)),e}function d(e){let t=e.split(i),n=t[1].split(c);return n.shift(),t[1]=n[0],n.shift(),{cuePoints:t,styles:f(n)}}function f(e){let t={};return e.forEach((function(e){let n=e.split(`:`);if(n.length>1){let[e,r]=n;switch(e){case`align`:case`A`:t.align=r;break;case`line`:case`L`:let[e,n]=r.split(`,`),i=e.endsWith(`%`);t.line=e===`auto`?e:parseInt(e,10),i&&(t.snapToLines=!1),n&&(t.lineAlign=n);break;case`position`:case`P`:let[o,c]=r.split(`,`);t.position=parseInt(o,10),c&&(t.positionAlign=c);break;case`size`:case`S`:t.size=parseInt(r,10)}}})),t}function p(e,t){let n,r=t,o=``,c=``;for(;e[r]!==``&&r<e.length;)r++;if(n=r-t,n>1)for(let r=0;r<n;r++){if(c=e[t+r],c.match(i)){o=``;break}o+=c,r!==n-1&&(o+=`
59
+ `)}else c=e[t],c.match(i)||(o=c);return o}return t={parse:function(e){let t=[],c,l;if(!e)return t;c=(e=e.split(r)).length,l=-1;for(let r=0;r<c;r++){let c=e[r];if(c.length>0&&c!==`WEBVTT`&&c.match(i)){let i=d(c),f=i.cuePoints,m=i.styles,h=p(e,r+1),g=u(f[0].replace(o,``)),_=u(f[1].replace(o,``));!isNaN(g)&&!isNaN(_)&&g>=l&&_>g?h===``?n.error(`Skipping cue due to empty/malformed cue text`):(l=g,t.push({start:g,end:_,data:h,styles:m})):n.error(`Skipping cue due to incorrect cue timing`)}}return t},getCaptionStyles:f},n=(0,l.default)(e).getInstance().getLogger(t),r=/(?:\r\n|\r|\n)/gm,i=/-->/,o=/(^[\s]+|[\s]+$)/g,c=/\s\b/g,t}$.__dashjs_factory_name=`VTTParser`;var Ks=i.default.getSingletonFactory($);function qs(){let e,t;return e={parse:function(e){let n=[];return t.oncue=function(e){e.start=e.startTime,e.end=e.endTime,e.data=e.text,e.styles={align:e.align,line:e.line,position:e.position,size:e.size},n.push(e)},t.parse(e),n}},function(){try{window&&window.WebVTT&&window.WebVTT.Parser&&(t=new window.WebVTT.Parser(window,window.vttjs,window.WebVTT.StringDecoder()))}catch{}}(),e}qs.__dashjs_factory_name=`VttCustomRenderingParser`;var Js=i.default.getSingletonFactory(qs);function Ys(){let e=this.context,t=(0,p.default)(e).getInstance(),n,r,i=0;function o(){let e=`cue_TTML_`+i;return i++,e}return n={parse:function(e,n,i,c,l){let u=``,d=[],f,p,h,_={},v={},y=``,b=``,x={onOpenTag:function(e,n,i){if(i[` imagetype`]&&!i[` imageType`]&&(t.trigger(g.default.CONFORMANCE_VIOLATION,{level:cs.LEVELS.ERROR,event:cs.EVENTS.NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE}),i[` imageType`]=i[` imagetype`]),n===`image`&&(e===`http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt`||e===`http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt`)){if(!i[` imageType`]||i[` imageType`].value!==`PNG`)return void r.warn(`smpte-tt imageType != PNG. Discarded`);y=i[`http://www.w3.org/XML/1998/namespace id`].value}},onCloseTag:function(){y&&(v[y]=b.trim()),b=``,y=``},onText:function(e){y&&(b+=e)}};if(!e)throw u=`no ttml data to parse`,Error(u);_.data=e,t.trigger(m.default.TTML_TO_PARSE,_);let S=(0,Hs.fromXML)(_.data,(function(e){u=e}),x);t.trigger(m.default.TTML_PARSED,{ttmlString:_.data,ttmlDoc:S});let C=S.getMediaTimeEvents();for(h=0;h<C.length;h++){let e=(0,Hs.generateISD)(S,C[h],(function(e){u=e}));e.contents.some((e=>e.contents.length))&&(f=C[h]+n,p=C[h+1]+n,f<p&&d.push({start:f,end:p,type:`html`,cueID:o(),isd:e,images:l,embeddedImages:v}))}if(u!==``)throw r.error(u),Error(u);return d}},r=(0,l.default)(e).getInstance().getLogger(n),n}Ys.__dashjs_factory_name=`TTMLParser`;var Xs=i.default.getSingletonFactory(Ys);function Zs(e){let t=this.context,n=(0,p.default)(t).getInstance(),r=ht(t).getInstance(),i=e.adapter,o=e.baseURLController,c,u,d;function f(e,t){let n,c,l=!1;if(o.resolve()){let t=i.getVoRepresentations(e);t&&t.length>0&&(n=o.resolve(t[0].path).url)}let u=e.essentialProperties.filter((e=>e.schemeIdUri&&e.schemeIdUri===h.default.FONT_DOWNLOAD_DVB_SCHEME)),f=e.supplementalProperties.filter((e=>e.schemeIdUri&&e.schemeIdUri===h.default.FONT_DOWNLOAD_DVB_SCHEME));u.length>0?(l=!0,c=u):c=f,c.forEach((i=>{if(function(e){return!(!(e.value&&parseInt(e.value)===1&&e.dvbUrl&&e.dvbUrl.length>0&&e.dvbFontFamily&&e.dvbFontFamily.length>0&&e.dvbMimeType)||e.dvbMimeType!==h.default.OFF_MIMETYPE&&e.dvbMimeType!==h.default.WOFF_MIMETYPE)}(i)){let u=(o=i.dvbUrl,c=n,r.isPathAbsolute(o)?o:r.isRelative(o)?c?r.resolve(o,c):r.resolve(o):o);d.push({fontFamily:i.dvbFontFamily,url:u,mimeType:i.dvbMimeType,trackId:e.id,streamId:t,isEssential:l,status:`unloaded`,fontFace:new FontFace(i.dvbFontFamily,`url(${u})`,{display:`swap`})})}var o,c}))}function m(e,t){let n=d[e];d[e]={...n,status:t}}function _(){d=[]}return c={addFontsFromTracks:function(e,t){if(e&&Array.isArray(e)&&t)for(let n=0;n<e.length;n++)f(e[n],t)},downloadFonts:function(){for(let e=0;e<d.length;e++){let t=d[e];document.fonts.add(t.fontFace),n.trigger(g.default.DVB_FONT_DOWNLOAD_ADDED,t),t.fontFace.load().then((()=>{m(e,`loaded`),n.trigger(g.default.DVB_FONT_DOWNLOAD_COMPLETE,t)}),(r=>{m(e,`error`),u.debug(`Font download error: `,r),n.trigger(g.default.DVB_FONT_DOWNLOAD_FAILED,t)}))}},getFonts:function(){return d},getFontsForTrackId:function(e){return d.filter((t=>t.trackId&&t.trackId===e))},reset:function(){(function(){for(let e of d){let t=document.fonts.delete(e.fontFace);u.debug(`Removal of fontFamily: ${e.fontFamily} was ${t?`successful`:`unsuccessful`}`)}})(),_()}},u=(0,l.default)(t).getInstance().getLogger(c),_(),c}Zs.__dashjs_factory_name=`DVBFonts`;var Qs=i.default.getClassFactory(Zs);function $s(e){let t=this.context,n=e.adapter,r=e.errHandler,i=e.manifestModel,o=e.mediaController,c=e.baseURLController,u=e.videoModel,d=e.settings,f,_,v,y,b,x,S,C,w,T,E,D,O,k;function A(e){if(k.error(`Could not download ${e.isEssential?`an essential`:`a`} font - fontFamily: ${e.fontFamily}, url: ${e.url}`),e.isEssential){let t=y[e.streamId].getTrackIdxForId(e.trackId);y[e.streamId].setModeForTrackIdx(t,h.default.TEXT_DISABLED)}}function j(e){if(k.debug(`Successfully downloaded ${e.isEssential?`an essential`:`a`} font - fontFamily: ${e.fontFamily}, url: ${e.url}`),e.isEssential){let t=y[e.streamId].getTrackIdxForId(e.trackId);t===y[e.streamId].getCurrentTrackIdx()?y[e.streamId].setModeForTrackIdx(t,h.default.TEXT_SHOWING):y[e.streamId].setModeForTrackIdx(t,h.default.TEXT_HIDDEN)}}function M(e){let t=e.tracks,n=e.index,r=e.streamId;if(!1===d.get().streaming.text.defaultEnabled&&!L()||D)R(r,-1);else{let e=o.getCurrentTrackFor(h.default.TEXT,r);if(e){let i={lang:e.lang,role:e.roles[0],index:e.index,codec:e.codec,accessibility:e.accessibility[0]};t.some(((e,t)=>{if(o.matchSettings(i,e))return R(r,t),n=t,!0}))}w=!1}_[r].lastEnabledIndex=n,C.trigger(g.default.TEXT_TRACKS_ADDED,{enabled:L(),index:n,tracks:t,streamId:r}),E=!0,O.addFontsFromTracks(t,r),O.getFonts().forEach((e=>{if(e.isEssential){let t=y[e.streamId].getTrackIdxForId(e.trackId);y[e.streamId].setModeForTrackIdx(t,h.default.TEXT_DISABLED)}})),O.downloadFonts()}function N(e){try{let t=e.streamId,n=y[t];if(!n||isNaN(e.time))return;n.updateTextTrackWindow(e.time),d.get().streaming.text.webvtt.customRenderingEnabled&&n.manualCueProcessing(e.time)}catch{}}function P(e){try{let t=e.streamId;if(!y[t])return;y[t].disableManualTracks()}catch{}}function F(e){try{let t=y[e.streamId];if(!t)return;let n=u.getTime()||0;t.updateTextTrackWindow(n,!0)}catch(e){k.error(e)}}function I(e){try{if(!e||!e.mediaType||e.mediaType!==h.default.AUDIO||!e.currentMediaInfo)return;let t=y[e.streamId].getCurrentTextTrackInfo(),n=NaN;w?n=z(e.streamId):B(t)&&e.currentMediaInfo.lang&&e.currentMediaInfo.lang!==t.lang&&(n=z(e.streamId),isNaN(n)&&(n=-1)),isNaN(n)||R(e.streamId,n)}catch(e){k.error(e)}}function L(){let e=!0;return w&&!T&&(e=!1),e}function R(e,t){w=t===-1,w&&o&&o.saveTextSettingsDisabled();let n=V(e);if(n===t||!y[e])return;y[e].disableManualTracks(),y[e].invalidateCueWindow();let r=y[e].getCurrentTextTrackInfo(),i=r?u.getTextTrack(r.kind,r.id,r.lang,r.isTTML,r.isEmbedded):null;i&&i.mode!==h.default.TEXT_DISABLED&&y[e].setModeForTrackIdx(n,h.default.TEXT_HIDDEN),y[e].setCurrentTrackIdx(t),r=y[e].getCurrentTextTrackInfo();let c=d.get().streaming.text.dispatchForManualRendering;if(r&&!c&&r.mode!==h.default.TEXT_DISABLED&&y[e].setModeForTrackIdx(t,h.default.TEXT_SHOWING),r&&r.isFragmented&&!r.isEmbedded)(function(e,t,n){if(!v[e])return;let r=v[e].getConfig().fragmentedTracks;for(let i=0;i<r.length;i++){let c=r[i];if(t.lang===c.lang&&(c.id?t.id===c.id:t.index===c.index)){let t=o.getCurrentTrackFor(h.default.TEXT,e);(c.id?t.id!==c.id:t.index!==c.index)?(y[e].deleteCuesFromTrackIdx(n),v[e].setCurrentFragmentedTrackIdx(i)):n===-1&&C.trigger(m.default.SET_FRAGMENTED_TEXT_AFTER_DISABLED,{},{streamId:e,mediaType:h.default.TEXT})}}})(e,r,n);else if(r&&!r.isFragmented)(function(e,t){C.trigger(m.default.SET_NON_FRAGMENTED_TEXT,{currentTrackInfo:t},{streamId:e,mediaType:h.default.TEXT})})(e,r);else if(!r&&w){let t=z(e);isNaN(t)||R(e,t);return}o.setTrack(r)}function z(e){let t=function(e){return y[e].getTextTrackInfos().filter(((e,t)=>(e._indexToSelect=t,!!(e&&e.roles&&e.roles.length>0)&&B(e))))}(e);if(!t||t.length<=0)return NaN;let n=o.getCurrentTrackFor(h.default.AUDIO,e);if(!n)return NaN;let r=t.find((e=>n.lang===e.lang));return r?r._indexToSelect:NaN}function B(e){return!(!e||!e.roles||e.roles.length===0)&&e.roles.some((e=>e.schemeIdUri===h.default.DASH_ROLE_SCHEME_ID&&e.value===Y.default.FORCED_SUBTITLE))}function V(e){return y[e].getCurrentTrackIdx()}function H(){v={},y={},_={},w=!0,E=!1,D=!1}return f={addEmbeddedTrack:function(e,t){let n=e.id;v[n]&&v[n].addEmbeddedTrack(t)},addMediaInfosToBuffer:function(e,t,n,r=null){let i=e.id;v[i]&&v[i].addMediaInfos(t,n,r)},createTracks:function(e){let t=e.id;y[t]&&y[t].createTracks()},deactivateStream:function(e){if(!e)return;let t=e.id;v[t]&&v[t].resetMediaInfos(),y[t]&&y[t].deleteAllTextTracks()},enableForcedTextStreaming:function(e){return(0,Ve.checkParameterType)(e,`boolean`),T=e,!0},enableText:function(e,t){return(0,Ve.checkParameterType)(t,`boolean`),L()!==t&&(t&&R(e,_[e].lastEnabledIndex),t||(_[e].lastEnabledIndex=V(e),E?R(e,-1):D=!0)),!0},getAllTracksAreDisabled:function(){return w},getCurrentTrackIdx:V,getTextSourceBuffer:function(e){let t=e.id;if(v&&v[t])return v[t]},initialize:function(){O=Qs(t).create({adapter:n,baseURLController:c}),C.on(m.default.TEXT_TRACKS_QUEUE_INITIALIZED,M,f),C.on(m.default.DVB_FONT_DOWNLOAD_FAILED,A,f),C.on(m.default.DVB_FONT_DOWNLOAD_COMPLETE,j,f),C.on(m.default.MEDIAINFO_UPDATED,I,f),C.on(m.default.PLAYBACK_TIME_UPDATED,N,f),d.get().streaming.text.webvtt.customRenderingEnabled&&C.on(m.default.PLAYBACK_SEEKING,P,f),C.on(m.default.PLAYBACK_SEEKED,F,f)},initializeForStream:function(e){let c=e.id,l=Gs(t).create({videoModel:u,settings:d,streamInfo:e});l.initialize(),y[c]=l;let f=Bs(t).create({errHandler:r,adapter:n,dvbFonts:O,manifestModel:i,mediaController:o,videoModel:u,textTracks:l,vttParser:b,vttCustomRenderingParser:x,ttmlParser:S,streamInfo:e,settings:d});f.initialize(),v[c]=f,_[c]={},_[c].lastEnabledIndex=-1},isTextEnabled:L,reset:function(){Object.keys(v).forEach((e=>{v[e].resetEmbedded(),v[e].reset()})),O.reset(),H(),C.off(m.default.TEXT_TRACKS_QUEUE_INITIALIZED,M,f),C.off(m.default.DVB_FONT_DOWNLOAD_FAILED,A,f),C.off(m.default.DVB_FONT_DOWNLOAD_COMPLETE,j,f),C.off(m.default.MEDIAINFO_UPDATED,I,f),C.off(m.default.PLAYBACK_TIME_UPDATED,N,f),d.get().streaming.text.webvtt.customRenderingEnabled&&C.off(m.default.PLAYBACK_SEEKING,P,f),C.off(m.default.PLAYBACK_SEEKED,F,f)},setTextTrack:R,clearDataForStream:function(e){v[e]&&(v[e].resetEmbedded(),v[e].reset(),delete v[e]),y[e]&&(y[e].deleteAllTextTracks(),delete y[e]),_[e]&&delete _[e]}},T=!1,E=!1,D=!1,b=Ks(t).getInstance(),x=Js(t).getInstance(),S=Xs(t).getInstance(),C=(0,p.default)(t).getInstance(),k=(0,l.default)(t).getInstance().getLogger(f),H(),f}$s.__dashjs_factory_name=`TextController`;var ec=i.default.getClassFactory($s);function tc(e){e||={};let t=this.context,n=(0,l.default)(t).getInstance(),r=e.settings,i=(0,p.default)(t).getInstance(),o,c,u,d,f,m;function _(){return navigator&&navigator.connection&&!isNaN(navigator.connection.downlink)&&navigator.connection.downlink>0?1e3*navigator.connection.downlink:NaN}function v(e,t,n,r){let i=.5**(n/r.fast);e.fastEstimate=(1-i)*t+i*e.fastEstimate;let o=.5**(n/r.slow);e.slowEstimate=(1-o)*t+o*e.slowEstimate,e.totalWeight+=n}function y(){o={},c={},u={},d={}}let b={addEntry:function(e,t){try{if(!(e&&t&&t.trace&&t.trace.length))return;(function(e){o[e]=o[e]||[],c[e]=c[e]||[],u[e]=u[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0},d[e]=d[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0}})(e);let n=t.tresponse.getTime()-t.trequest.getTime()||1,l=function(e,t){return e._fileLoaderType&&e._fileLoaderType===h.default.FILE_LOADER_TYPES.FETCH?function(e){let t=e.trace.reduce(((e,t)=>e+t.b[0]),0),n=e.trace.reduce(((e,t)=>e+t.d),0),i=NaN;return r.get().streaming.abr.throughput.useNetworkInformationApi.fetch&&(i=_()),isNaN(i)&&(i=Math.round(8*t/n)),{downloadedBytes:t,value:i,downloadTimeInMs:n}}(e):function(e,t){let n=NaN,i=NaN,o=!1;if(r.get().streaming.abr.throughput.useResourceTimingApi&&e._resourceTimingValues)n=e._resourceTimingValues.transferSize,i=e._resourceTimingValues.responseEnd-e._resourceTimingValues.responseStart,o=!0;else{if(e.trace.length<=1)return{throughput:NaN,downloadTimeInMs:NaN};n=e.trace.reduce(((e,t)=>e+t.b[0]),0)-e.trace[0].b[0],i=Math.max(e.trace.reduce(((e,t)=>e+t.d),0)-e.trace[0].d,1)}let c=NaN;if(!o&&r.get().streaming.abr.throughput.useNetworkInformationApi.xhr&&(c=_()),isNaN(c)){let e=r.get().streaming.abr.throughput.useDeadTimeLatency?i:i+t;c=Math.round(8*n/e)}return{downloadedBytes:n,value:c,downloadTimeInMs:i}}(e,t)}(t,n);if(l.latencyInMs=n,isNaN(l.value)||!isFinite(l.value))return;if(t.cmsd){let e=t.cmsd.dynamic&&t.cmsd.dynamic.etp?t.cmsd.dynamic.etp:null;if(e){let t=r.get().streaming.cmsd.abr.etpWeightRatio;t>0&&t<=1&&(l.value=l.value*(1-t)+e*t)}}if(function(e,t,n){return r.get().streaming.abr.throughput.useResourceTimingApi&&n._resourceTimingValues?n._resourceTimingValues.transferSize===0&&n._resourceTimingValues.decodedBodySize>0:!isNaN(t)&&(e===h.default.VIDEO?t<r.get().streaming.cacheLoadThresholds[h.default.VIDEO]:e===h.default.AUDIO?t<r.get().streaming.cacheLoadThresholds[h.default.AUDIO]:void 0)}(e,t._tfinish.getTime()-t.trequest.getTime(),t))return void m.debug(`${e} Assuming segment ${t.url} came from cache, ignoring it for throughput calculation`);m.debug(`Added throughput entry for ${e}: ${l.value} kbit/s`),l.serviceLocation=t._serviceLocation,o[e].push(l),c[e].push({value:n}),function(e){o[e].length>r.get().streaming.abr.throughput.sampleSettings.maxMeasurementsToKeep&&o[e].shift(),c[e].length>r.get().streaming.abr.throughput.sampleSettings.maxMeasurementsToKeep&&c[e].shift()}(e),i.trigger(g.default.THROUGHPUT_MEASUREMENT_STORED,{throughputValues:l}),t.type!==T.HTTPRequest.MPD_TYPE&&(v(u[e],l.value,r.get().streaming.abr.throughput.ewma.weightDownloadTimeMultiplicationFactor*l.downloadTimeInMs,f.bandwidthHalfLife),v(d[e],n,1,f.latencyHalfLife))}catch(e){m.error(e)}},getThroughputDict:function(e){return e?o[e]:o},getEwmaThroughputDict:function(e){return e?u[e]:u},getEwmaLatencyDict:function(e){return e?d[e]:d},getEwmaHalfLife:function(){return f},getLatencyDict:function(e){return e?c[e]:c},reset:y};return m=n.getLogger(b),f={bandwidthHalfLife:{fast:r.get().streaming.abr.throughput.ewma.throughputFastHalfLifeSeconds,slow:r.get().streaming.abr.throughput.ewma.throughputSlowHalfLifeSeconds},latencyHalfLife:{fast:r.get().streaming.abr.throughput.ewma.latencyFastHalfLifeCount,slow:r.get().streaming.abr.throughput.ewma.latencySlowHalfLifeCount}},y(),b}tc.__dashjs_factory_name=`ThroughputModel`;var nc=i.default.getClassFactory(tc);function rc(){let e=this.context,t=(0,p.default)(e).getInstance(),n,r,i;function o(){performance.clearResourceTimings()}function l(e){e.metric!==c.HTTP_REQUEST||!e.value||e.value.type!==T.HTTPRequest.MPD_TYPE&&(e.value.type!==T.HTTPRequest.MEDIA_SEGMENT_TYPE||e.mediaType!==h.default.AUDIO&&e.mediaType!==h.default.VIDEO)||n.addEntry(e.mediaType,e.value)}function u(e,t,o=null,c=NaN){let l,u=null,p=n.getEwmaHalfLife(),g=null,C=!0;switch(o||=i.get().streaming.abr.throughput.averageCalculationMode,e){case h.default.THROUGHPUT_TYPES.BANDWIDTH:u=o===h.default.THROUGHPUT_CALCULATION_MODES.EWMA?n.getEwmaThroughputDict(t):n.getThroughputDict(t),g=p.bandwidthHalfLife,C=!0,c=isNaN(c)?r.getIsDynamic()?i.get().streaming.abr.throughput.sampleSettings.live:i.get().streaming.abr.throughput.sampleSettings.vod:c;break;case h.default.THROUGHPUT_TYPES.LATENCY:u=o===h.default.THROUGHPUT_CALCULATION_MODES.EWMA?n.getEwmaLatencyDict(t):n.getLatencyDict(t),g=p.latencyHalfLife,C=!1,c=isNaN(c)?i.get().streaming.abr.throughput.sampleSettings.averageLatencySampleAmount:c}if(!u||u.length===0)return NaN;switch(o){case h.default.THROUGHPUT_CALCULATION_MODES.ARITHMETIC_MEAN:return l=d(u,c,e),f(u,l);case h.default.THROUGHPUT_CALCULATION_MODES.BYTE_SIZE_WEIGHTED_ARITHMETIC_MEAN:return l=d(u,c,e),m(u,l);case h.default.THROUGHPUT_CALCULATION_MODES.DATE_WEIGHTED_ARITHMETIC_MEAN:return l=d(u,c,e),_(u,l);case h.default.THROUGHPUT_CALCULATION_MODES.HARMONIC_MEAN:return l=d(u,c,e),v(u,l);case h.default.THROUGHPUT_CALCULATION_MODES.BYTE_SIZE_WEIGHTED_HARMONIC_MEAN:return l=d(u,c,e),y(u,l);case h.default.THROUGHPUT_CALCULATION_MODES.DATE_WEIGHTED_HARMONIC_MEAN:return l=d(u,c,e),b(u,l);case h.default.THROUGHPUT_CALCULATION_MODES.EWMA:return x(u,g,C);case h.default.THROUGHPUT_CALCULATION_MODES.ZLEMA:return l=d(u,c,e),S(u,l)}}function d(e,t,n){if(e){if(t>=e.length)t=e.length;else if(n===h.default.THROUGHPUT_TYPES.BANDWIDTH&&i.get().streaming.abr.throughput.sampleSettings.enableSampleSizeAdjustment)for(let n=1;n<t;++n){let r=e[e.length-n].value/e[e.length-n-1].value;if((r>=i.get().streaming.abr.throughput.sampleSettings.increaseScale||r<=i.get().streaming.abr.throughput.sampleSettings.decreaseScale)&&(t+=1)===e.length)break}}else t=0;return t}function f(e,t){let n=e;return t!==0&&n&&n.length!==0?(n=n.slice(-t),n.reduce(((e,t)=>e+t.value),0)/n.length):NaN}function m(e,t){let n=e;if(t===0||!n||n.length===0)return NaN;n=n.slice(-t);let r=0;return n.reduce(((e,t)=>{let n=Math.sqrt(t.downloadedBytes);return r+=n,e+t.value*n}),0)/r}function _(e,t){let n=e;if(t===0||!n||n.length===0)return NaN;n=n.slice(-t);let r=0;return n.reduce(((e,t,n)=>{let i=n+1;return r+=i,e+t.value*i}),0)/r}function v(e,t){let n=e;if(t===0||!n||n.length===0)return NaN;n=n.slice(-t);let r=n.reduce(((e,t)=>e+1/t.value),0);return n.length/r}function y(e,t){let n=e;if(t===0||!n||n.length===0)return NaN;n=n.slice(-t);let r=0,i=n.reduce(((e,t)=>{let n=Math.sqrt(t.downloadedBytes);return r+=n,e+1/t.value*n}),0);return r/i}function b(e,t){let n=e;if(t===0||!n||n.length===0)return NaN;n=n.slice(-t);let r=0,i=n.reduce(((e,t,n)=>{let i=n+1;return r+=i,e+1/t.value*i}),0);return r/i}function x(e,t,n=!0){if(!e||e.totalWeight<=0)return NaN;let r=e.fastEstimate/(1-.5**(e.totalWeight/t.fast)),i=e.slowEstimate/(1-.5**(e.totalWeight/t.slow));return n?Math.min(r,i):Math.max(r,i)}function S(e,t){if(t===0||!e||e.length===0)return NaN;let n=e.slice(-t).map((e=>e.value)),r=2/(n.length+1),i=n[n.length-1],o=n[n.length-1];for(let e=0;e<n.length;e++)i=r*n[e]+(1-r)*i,o=r*i+(1-r)*o;return o}function C(e,t=null,n=NaN){let r=u(h.default.THROUGHPUT_TYPES.BANDWIDTH,e,t,n);return Math.round(r)}let w={getArithmeticMean:f,getAverageLatency:function(e,t=null,n=NaN){let r=u(h.default.THROUGHPUT_TYPES.LATENCY,e,t,n);return Math.round(r)},getAverageThroughput:C,getByteSizeWeightedArithmeticMean:m,getByteSizeWeightedHarmonicMean:y,getDateWeightedArithmeticMean:_,getDateWeightedHarmonicMean:b,getEwma:x,getHarmonicMean:v,getRawThroughputData:function(e){return e?n.getThroughputDict(e):[]},getSafeAverageThroughput:function(e,t=null,n=NaN){let r=C(e,t,n);return isNaN(r)||(r*=i.get().streaming.abr.throughput.bandwidthSafetyFactor),r},getZlema:S,initialize:function(){n=nc(e).create({settings:i}),t.on(g.default.METRIC_ADDED,l,w),window.performance?.addEventListener?.(`resourcetimingbufferfull`,o)},reset:function(){n.reset(),t.off(g.default.METRIC_ADDED,l,w),window.performance?.removeEventListener?.(`resourcetimingbufferfull`,o)},setConfig:function(e){e.settings&&(i=e.settings),e.playbackController&&(r=e.playbackController)}};return w}rc.__dashjs_factory_name=`ThroughputController`;var ic=i.default.getSingletonFactory(rc);function ac(){let e=this.context,t=(0,p.default)(e).getInstance(),n=(0,u.default)(e).getInstance(),r,i,o,c;function l(e){c=e}function d(e,t,n,r){let i,o=t.adaptation.period.mpd,c=o.availabilityStartTime;if(r)i=n&&o.timeShiftBufferDepth!==1/0?new Date(c.getTime()+1e3*(e+o.timeShiftBufferDepth)):o.availabilityEndTime;else if(n){let n=t.availabilityTimeOffset;i=new Date(c.getTime()+1e3*(e-n))}else i=c;return i}function f(e,t){return(e.getTime()-t.mpd.availabilityStartTime.getTime()+1e3*c)/1e3}function _(e,t){return e+(t.adaptation.period.start-t.presentationTimeOffset)}function v(e){let t={start:NaN,end:NaN},n=e[0].getAdapter().getRegularPeriods()[0],r=f(new Date,n);if(!e||e.length===0)return{range:t,now:r};e.forEach((e=>{let n=e.getCurrentRepresentationForType(h.default.VIDEO);if(n||=e.getCurrentRepresentationForType(h.default.AUDIO),!n){let t=e.getAdapter(),r=t.getMediaInfoForType(e.getStreamInfo(),h.default.VIDEO)||t.getMediaInfoForType(e.getStreamInfo(),h.default.AUDIO);n=t.getVoRepresentations(r)[0]}let o={start:NaN,end:NaN};if(n)if(n.segmentInfoType===Y.default.SEGMENT_TIMELINE)o=function(e){let t=e.adaptation.period.mpd.manifest.Period[e.adaptation.period.index].AdaptationSet[e.adaptation.index],n=i.getRepresentationFor(e.index,t),r=n.SegmentTemplate||n.SegmentList,o=r.SegmentTimeline,c=r.timescale,l=o.S,u={start:0,end:0},d=l[0].t,f=!isNaN(d),p=f?d:0,m,h,g,v,y=0;for(f&&(u.start=_(p/c,e)),g=0,v=l.length;g<v;g++)m=l[g],h=0,m.hasOwnProperty(`r`)&&(h=m.r),y+=m.d*(1+h);return u.end=_((p+y)/c,e),u}(n);else{let e=n.adaptation.period;o.start=e.start,o.end=Math.max(r,e.start+e.duration)}!isNaN(o.start)&&(isNaN(t.start)||t.start>o.start)&&(t.start=o.start),!isNaN(o.end)&&(isNaN(t.end)||t.end<o.end)&&(t.end=o.end)})),t.end=Math.min(r,t.end);let o=b(e,t.end,!0);return t.end=isNaN(o)?t.end:o,t.start=n&&n.mpd&&n.mpd.timeShiftBufferDepth&&!isNaN(n.mpd.timeShiftBufferDepth)&&!isNaN(t.end)?Math.max(t.end-n.mpd.timeShiftBufferDepth,t.start):t.start,t.start=b(e,t.start),{range:t,now:r}}function y(e,t){o=e-t.end}function b(e,t,n=!1){try{let r=0,i=!1,o=NaN;for(;!i&&r<e.length;){let c=e[r].getStreamInfo();c.start<=t&&(!isFinite(c.duration)||c.start+c.duration>=t)?(o=t,i=!0):!n&&c.start>t&&(isNaN(o)||c.start<o)?o=c.start:n&&c.start+c.duration<t&&(isNaN(o)||c.start+c.duration>o)&&(o=c.start+c.duration),r+=1}return o}catch{return t}}function x(e){e.offset===void 0||isNaN(e.offset)||l(e.offset/1e3)}function S(){c=0,o=0}function C(){t.off(m.default.UPDATE_TIME_SYNC_OFFSET,x,this),S()}return r={calcAvailabilityEndTimeFromPresentationTime:function(e,t,n){return d(e,t,n,!0)},calcAvailabilityStartTimeFromPresentationTime:function(e,t,n){return d(e,t,n)},calcMediaTimeFromPresentationTime:function(e,t){return e-t.adaptation.period.start+t.presentationTimeOffset},calcPeriodRelativeTimeFromMpdRelativeTime:function(e,t){return t-e.adaptation.period.start},calcPresentationTimeFromMediaTime:_,calcPresentationTimeFromWallTime:f,calcTimeShiftBufferWindow:function(e,r){if(!r)return function(e){let t={start:NaN,end:NaN},n=0,r=NaN;return e.forEach((e=>{let t=e.getStreamInfo();n+=t.duration,(isNaN(r)||t.start<r)&&(r=t.start)})),t.start=r,t.end=r+n,t}(e);if(n.get().streaming.timeShiftBuffer.calcFromSegmentTimeline){let t=v(e);return y(t.now,t.range),t.range}return function(e){let r={start:NaN,end:NaN};if(!e||e.length===0)return r;let i=e[0].getAdapter().getRegularPeriods()[0],o=f(new Date,i),c=i.mpd.timeShiftBufferDepth;if(r.start=b(e,isNaN(c)?0:o-c),r.end=!isNaN(r.start)&&o<r.start?o:b(e,o,!0),!isNaN(c)&&r.end<o-c&&(r.end=NaN),n.get().streaming.timeShiftBuffer.fallbackToSegmentTimeline){let n=v(e);if(n.range.end<r.start)return t.trigger(g.default.CONFORMANCE_VIOLATION,{level:cs.LEVELS.WARNING,event:cs.EVENTS.INVALID_DVR_WINDOW}),y(n.now,n.range),n.range}return r}(e)},calcWallTimeForSegment:function(e,t){let n,r,i;return t&&(n=e.representation.adaptation.period.mpd.suggestedPresentationDelay,r=e.presentationStartTime+n,i=new Date(e.availabilityStartTime.getTime()+1e3*r)),i},getClientReferenceTime:function(){return Date.now()-1e3*o+1e3*c},getClientTimeOffset:function(){return c},initialize:function(){S(),t.on(m.default.UPDATE_TIME_SYNC_OFFSET,x,this)},reset:C,setClientTimeOffset:l,setConfig:function(e){e&&e.dashManifestModel&&(i=e.dashManifestModel)}},i=yt(e).getInstance(),C(),r}ac.__dashjs_factory_name=`TimelineConverter`;var oc=i.default.getSingletonFactory(ac),sc=class{constructor(){this.t=null,this.xywh=null,this.track=null,this.id=null,this.s=null,this.r=null}};function cc(){let e,t;return e={initialize:function(e){if(t=new sc,!e)return null;let n=e.indexOf(`#`);if(n!==-1){let r=e.substr(n+1).split(`&`);for(let e=0,n=r.length;e<n;++e){let n=r[e],i=n.indexOf(`=`);if(i!==-1){let e=n.substring(0,i);t.hasOwnProperty(e)&&(t[e]=n.substr(i+1))}}}},getURIFragmentData:function(){return t}},e}cc.__dashjs_factory_name=`URIFragmentModel`;var lc=i.default.getSingletonFactory(cc);let uc=new Map([[h.default.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,`loadedmetadata`],[h.default.VIDEO_ELEMENT_READY_STATES.HAVE_CURRENT_DATA,`loadeddata`],[h.default.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,`canplay`],[h.default.VIDEO_ELEMENT_READY_STATES.HAVE_ENOUGH_DATA,`canplaythrough`]]);function dc(){let e,t,n,r,i,o,c,d,f,g,_,v,y=this.context,b=(0,p.default)(y).getInstance(),x=[];function S(e,t=!1){n&&(t?n.playbackRate=e:N(h.default.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,(()=>{n.playbackRate=e})))}function C(){return x.length>0}function w(e){let t=x.indexOf(e);if(e!==null&&(t!==-1&&x.splice(t,1),g.get().streaming.buffer.syntheticStallEvents.enabled&&n&&!C())){let e=()=>{if(S(o||1,g.get().streaming.buffer.syntheticStallEvents.ignoreReadyState),!n.paused){let e=document.createEvent(`Event`);e.initEvent(`playing`,!0,!1),n.dispatchEvent(e)}};g.get().streaming.buffer.syntheticStallEvents.ignoreReadyState?e():(d&&d.func&&d.event&&D(d.event,d.func),d=N(h.default.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,e))}}function T(){if(n&&C()&&n.playbackRate===0){let e=document.createEvent(`Event`);e.initEvent(`waiting`,!0,!1),n.dispatchEvent(e)}}function E(e,t){n&&n.addEventListener(e,t)}function D(e,t){n&&n.removeEventListener(e,t)}function O(){return n?n.readyState:NaN}function k(){return n?n.buffered:null}function A(){return n?n.clientWidth:NaN}function j(){return n?n.clientHeight:NaN}function M(e,t,r,i,o){if(n){for(let c=0;c<n.textTracks.length;c++)if(n.textTracks[c].kind===e&&(!t||n.textTracks[c].label==t)&&n.textTracks[c].language===r&&n.textTracks[c].isTTML===i&&n.textTracks[c].isEmbedded===o)return n.textTracks[c]}return null}function N(e,t){return e===h.default.VIDEO_ELEMENT_READY_STATES.HAVE_NOTHING||O()>=e?(t(),null):function(e,t){let n=()=>{D(e,n),t(e)};return E(e,n),{func:n,event:e}}(uc.get(e),t)}return r={addEventListener:E,addTextTrack:function(e,t,r,i,o){if(!n)return null;let c=M(e,t,r,i,o);return c||(c=n.addTextTrack(e,t,r),c.isEmbedded=o,c.isTTML=i),c},appendChild:function(e){n&&(n.appendChild(e),e.isTTML!==void 0&&(n.textTracks[n.textTracks.length-1].isTTML=e.isTTML,n.textTracks[n.textTracks.length-1].isEmbedded=e.isEmbedded))},getBufferRange:k,getClientHeight:j,getClientWidth:A,getElement:function(){return n},getEnded:function(){return n?n.ended:null},getPlaybackQuality:function(){if(!n)return null;let e=`webkitDroppedFrameCount`in n&&`webkitDecodedFrameCount`in n,t=null;return`getVideoPlaybackQuality`in n?t=n.getVideoPlaybackQuality():e&&(t={droppedVideoFrames:n.webkitDroppedFrameCount,totalVideoFrames:n.webkitDroppedFrameCount+n.webkitDecodedFrameCount,creationTime:new Date}),t},getPlaybackRate:function(){return n?n.playbackRate:null},getPlayedRanges:function(){return n?n.played:null},getReadyState:O,getSource:function(){return n?n.src:null},getTTMLRenderingDiv:function(){return e},getTextTrack:M,getTextTracks:function(){return n?n.textTracks:[]},getTime:function(){return n?isNaN(t)?n.currentTime:t:null},getVideoElementSize:function(){let e=g.get().streaming.abr.usePixelRatioInLimitBitrateByPortal&&window.hasOwnProperty(`devicePixelRatio`)?window.devicePixelRatio:1;return{elementWidth:A()*e,elementHeight:j()*e}},getVideoHeight:function(){return n?n.videoHeight:NaN},getVideoRelativeOffsetLeft:function(){if(n){let e=n.parentNode.host||n.parentNode;return e?n.getBoundingClientRect().left-e.getBoundingClientRect().left:NaN}return NaN},getVideoRelativeOffsetTop:function(){if(n){let e=n.parentNode.host||n.parentNode;return e?n.getBoundingClientRect().top-e.getBoundingClientRect().top:NaN}return NaN},getVideoWidth:function(){return n?n.videoWidth:NaN},getVttRenderingDiv:function(){return v},initialize:function(){b.on(m.default.PLAYBACK_PLAYING,T,this)},isPaused:function(){return n?n.paused:null},isSeeking:function(){return n?n.seeking||!isNaN(t):null},isStalled:C,pause:function(){n&&(n.pause(),n.autoplay=!1)},play:function(){if(n){n.autoplay=!0;let e=n.play();e&&e.catch&&typeof Promise<`u`&&e.catch((e=>{e.name===`NotAllowedError`&&b.trigger(m.default.PLAYBACK_NOT_ALLOWED),i.warn(`Caught pending play exception - continuing (${e})`)}))}},removeChild:function(e){n&&n.removeChild(e)},removeEventListener:D,reset:function(){clearTimeout(_),b.off(m.default.PLAYBACK_PLAYING,T,this),x.length=0,function(){try{c&&n&&(c.unobserve(n),c.disconnect(),c=null)}catch{}}()},setConfig:function(e){e&&e.settings&&(g=e.settings)},setCurrentTime:function(e,r){n&&(f&&f.func&&f.event&&D(f.event,f.func),t=e,f=N(h.default.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,(()=>{if(n)if(n.currentTime!==t)try{t=r?function(e){let t=k(),n=e,r=9999999999;if(t)for(let i=0;i<t.length;i++){let o=t.start(i),c=t.end(i),l=Math.abs(o-e),u=Math.abs(c-e);if(e>=o&&e<=c)return e;l<r&&(r=l,n=o),u<r&&(r=u,n=c)}return n}(t):t,isNaN(t)||(n.currentTime=t),t=NaN}catch(e){n.readyState===0&&e.code===e.INVALID_STATE_ERR&&(_=setTimeout((function(){n.currentTime=t,t=NaN}),400))}else t=NaN})))},setDisableRemotePlayback:function(e){n&&(n.disableRemotePlayback=e)},setElement:function(e){if(!(e==null||e&&/^(VIDEO|AUDIO)$/i.test(e.nodeName)))throw`element is not video or audio DOM type!`;n=e,function(e){try{if(!c||!e)return;c.observe(e)}catch{}}(n)},setPlaybackRate:S,setSource:function(e){n&&(e?n.src=e:(n.removeAttribute(`src`),n.load()))},setStallState:function(e,t){(function(e,t){t?function(e){if(e!==null&&n&&!n.seeking&&x.indexOf(e)===-1&&(x.push(e),g.get().streaming.buffer.syntheticStallEvents.enabled&&n&&x.length===1&&(g.get().streaming.buffer.syntheticStallEvents.ignoreReadyState||O()>=h.default.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA))){o=n.playbackRate,S(0,!0);let e=document.createEvent(`Event`);e.initEvent(`waiting`,!0,!1),n.dispatchEvent(e)}}(e):w(e)})(e,t)},setTTMLRenderingDiv:function(t){e=t,e.style.position=`absolute`,e.style.display=`flex`,e.style.overflow=`hidden`,e.style.pointerEvents=`none`,e.style.top=0,e.style.left=0},setVttRenderingDiv:function(e){v=e},waitForReadyState:N},i=(0,l.default)(y).getInstance().getLogger(r),g=(0,u.default)(y).getInstance(),t=NaN,function(){try{c=new ResizeObserver((()=>{b.trigger(m.default.VIDEO_ELEMENT_RESIZED)}))}catch{}}(),r}dc.__dashjs_factory_name=`VideoModel`;var fc=i.default.getSingletonFactory(dc),pc=r(8986);function mc(){let e=`You must first call initialize() and set a source before calling this method`,t=`You must first call initialize() and set a valid source and view before calling this method`,n=`You must first call attachView() to set the video element before calling this method`,r=`You must first call attachSource() with a valid source before calling this method`,o=`MediaPlayer not initialized!`,d=this.context,f=(0,p.default)(d).getInstance(),_=(0,u.default)(d).getInstance(),v=(0,l.default)(d).getInstance({settings:_}),y,b,x,S,C,w,E,D,O,k,A,j,M,N,P,F,I,L,R,z,B,V,H,U,W,G,K,ee,q,te,ne,re,ie,J,ae,oe,se,ce,le,ue,de;function fe(){Oe(null),Ee(null),S=null,P&&=(P.reset(),null),F&&=(F.reset(),null),B&&B.reset(),_.reset(),L&&=(L.reset(),null)}function pe(){return!!x&&!!se.getElement()}function me(){return(0,pc.getVersionString)()}function he(){if(!E)throw t;return q.isPaused()}function ge(){if(!E)throw t;return q.getIsDynamic()}function _e(e){let t=G&&G.hasVideoTrack()?h.default.VIDEO:h.default.AUDIO,n=ie.getCurrentDVRInfo(t);return n?ve(n.range.start+e,n):0}function ve(e,t){let n=q.getOriginalLiveDelay();return e>t.range.end-n&&(e=t.range.end-n),e}function ye(e=``){if(!E)throw t;let n=we().currentTime;return e!==``&&(n=G.getTimeRelativeToStreamId(n,e)),n}function be(e){(0,Ve.checkParameterType)(e,`boolean`),D=e}function Se(){B.restoreDefaultUTCTimingSources()}function Ce(){return ie}function we(){if(!se.getElement())throw n;return se.getElement()}function Ee(e){if(!C)throw o;se.setElement(e),e&&(Pe(),function(){if(F||typeof dashjs>`u`)return;let e=dashjs.MetricsReporting;typeof e==`function`&&(F=e(d).create().createMetricsReporting({debug:v,eventBus:f,mediaElement:we(),adapter:R,dashMetrics:ie,mediaPlayerModel:z,events:m.default,constants:h.default,metricsConstants:c}))}(),function(){if(I||typeof dashjs>`u`)return;let e=dashjs.MssHandler;typeof e==`function`&&(Ne.extend(e.errors),I=e(d).create({eventBus:f,mediaPlayerModel:z,dashMetrics:ie,manifestModel:J,playbackController:q,streamController:G,protectionController:P,baseURLController:H,errHandler:V,events:m.default,constants:h.default,debug:v,initSegmentType:T.HTTPRequest.INIT_SEGMENT_TYPE,BASE64:Te,ISOBoxer:xr,settings:_}))}(),G&&G.switchToVideoElement(O)),E&&(Ae(),je()),Ie(O)}function De(t){if(!w)throw e;let n=G.getActiveStreamInfo();return n?N.getTracksFor(t,n.id).filter((e=>!P||P.areKeyIdsUsable(e.normalizedKeyIds))):[]}function Oe(e,t=NaN){if(!C)throw o;typeof e==`string`&&ce.initialize(e),t??=NaN,isNaN(t)||(t=Math.max(0,t)),O=t,x=e,(w||E)&&(Ae(),je()),pe()&&Ie(O)}function ke(){if(!w)throw e;let t=G.getActiveStreamInfo();return t?G.getStreamById(t.id):null}function Ae(){E=!1,w=!1,R.reset(),G.reset(),ee.reset(),re.reset(),q.reset(),te.reset(),ne.reset(),k.reset(),A.reset(),N.reset(),ue.reset(),P&&(_.get().streaming.protection.keepProtectionMediaKeys?P.stop():(P.reset(),P=null,Pe())),K.reset(),ae.reset(),oe.reset()}function je(){B.resetPlaybackSessionSpecificSettings()}function Me(){return ba(d).create({debug:v,errHandler:V,dashMetrics:ie,mediaPlayerModel:z,mssHandler:I,settings:_})}function Pe(){if(P)return P;if(typeof dashjs>`u`)return null;let e=dashjs.Protection;if(typeof e==`function`){let t=e(d).create();return m.default.extend(e.events),g.default.extend(e.events,{publicOnly:!0}),Ne.extend(e.errors),P=t.createProtectionSystem({debug:v,errHandler:V,videoModel:se,customParametersModel:B,capabilities:U,eventBus:f,events:m.default,BASE64:Te,constants:h.default,cmcdModel:ae,settings:_}),U||=(0,Tr.default)(d).getInstance(),U.setProtectionController(P),P}return null}function Fe(){if(!C)throw o;if(L)return L;if(typeof dashjs>`u`)return null;let e=dashjs.OfflineController;if(typeof e==`function`){m.default.extend(e.events),g.default.extend(e.events,{publicOnly:!0}),Ne.extend(e.errors);let t=Me(),n=Ea(d).create();return n.setConfig({manifestModel:J,adapter:R,manifestLoader:t,errHandler:V,contentSteeringController:ne}),L=e(d).create({debug:v,manifestUpdater:n,baseURLController:H,manifestLoader:t,manifestModel:J,mediaPlayerModel:z,abrController:k,playbackController:q,adapter:R,errHandler:V,dashMetrics:ie,timelineConverter:M,segmentBaseController:ue,schemeLoaderFactory:j,eventBus:f,events:m.default,errors:Ne,constants:h.default,settings:_,dashConstants:Y.default,urlUtils:ht(d).getInstance()}),L}return null}function Ie(e=NaN){L&&L.resetRecords(),!w&&x&&(w=!0,b.info(`Streaming Initialized`),function(){let e=Me();G||=fs(d).getInstance(),K||=ec(d).create({errHandler:V,manifestModel:J,adapter:R,mediaController:N,baseURLController:H,videoModel:se,settings:_}),W.setConfig({capabilities:U,customParametersModel:B,adapter:R,settings:_,protectionController:P,manifestModel:J,errHandler:V}),G.setConfig({capabilities:U,capabilitiesFilter:W,manifestLoader:e,manifestModel:J,mediaPlayerModel:z,customParametersModel:B,protectionController:P,textController:K,adapter:R,dashMetrics:ie,errHandler:V,timelineConverter:M,videoModel:se,playbackController:q,serviceDescriptionController:te,contentSteeringController:ne,abrController:k,throughputController:A,mediaController:N,settings:_,baseURLController:H,uriFragmentModel:ce,segmentBaseController:ue}),ee.setConfig({settings:_,playbackController:q,streamController:G,videoModel:se,timelineConverter:M,adapter:R}),q.setConfig({streamController:G,serviceDescriptionController:te,dashMetrics:ie,adapter:R,videoModel:se,timelineConverter:M,settings:_}),re.setConfig({streamController:G,playbackController:q,mediaPlayerModel:z,videoModel:se,settings:_}),A.setConfig({settings:_,playbackController:q}),k.setConfig({streamController:G,capabilities:U,domStorage:le,mediaPlayerModel:z,customParametersModel:B,throughputController:A,cmsdModel:oe,dashMetrics:ie,adapter:R,videoModel:se,settings:_}),ae.setConfig({abrController:k,dashMetrics:ie,playbackController:q,serviceDescriptionController:te,throughputController:A}),de.setConfig({serviceDescriptionController:te}),oe.setConfig({}),N.initialize(),A.initialize(),k.initialize(),G.initialize(D,S),K.initialize(),ee.initialize(),re.initialize(),ae.initialize(D),oe.initialize(),ne.initialize(),ue.initialize()}(),typeof x==`string`?G.load(x,e):G.loadWithManifest(x,e)),!E&&pe()&&(E=!0,f.trigger(g.default.PLAYBACK_INITIALIZED),b.info(`Playback Initialized`))}return y={addABRCustomRule:function(e,t,n){B.addAbrCustomRule(e,t,n)},addExternalSubtitle:function(e){e instanceof Ki.default||b.error(`Invalid external subtitle object. Must be an instance of dashjs.ExternalSubtitle`),B.addExternalSubtitle(e)},addRequestInterceptor:function(e){B.addRequestInterceptor(e)},addResponseInterceptor:function(e){B.addResponseInterceptor(e)},addUTCTimingSource:function(e,t){B.addUTCTimingSource(e,t)},attachProtectionController:function(e){P=e},attachSource:Oe,attachTTMLRenderingDiv:function(e){if(!se.getElement())throw n;se.setTTMLRenderingDiv(e)},attachView:Ee,attachVttRenderingDiv:function(e){if(!se.getElement())throw n;se.setVttRenderingDiv(e)},clearDefaultUTCTimingSources:function(){B.clearDefaultUTCTimingSources()},convertToTimeCode:function(e){e=Math.max(e,0);let t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%3600%60);return(t===0?``:t<10?`0`+t.toString()+`:`:t.toString()+`:`)+(n<10?`0`+n.toString():n.toString())+`:`+(r<10?`0`+r.toString():r.toString())},destroy:function(){fe(),i.default.deleteSingletonInstances(d)},duration:function(){if(!E)throw t;let e=we().duration;if(q.getIsDynamic()){let t=G&&G.hasVideoTrack()?h.default.VIDEO:h.default.AUDIO,n=ie.getCurrentDVRInfo(t);e=n?n.range.end-n.range.start:0}return e},enableForcedTextStreaming:function(e){return!(!G.getActiveStreamInfo()||!K)&&K.enableForcedTextStreaming(e)},enableText:function(e){let t=G.getActiveStreamInfo();return!(!t||!K)&&K.enableText(t.id,e)},extend:function(e,t,n){i.default.extend(e,t,n,d)},formatUTC:function(e,t,n,r=!1){let i=new Date(1e3*e),o=i.toLocaleDateString(t),c=i.toLocaleTimeString(t,{hour12:n});return r?c+` `+o:c},getABRCustomRules:function(){return B.getAbrCustomRules()},getActiveStream:ke,getAutoPlay:function(){return D},getAvailableBaseUrls:function(){let e=J.getValue();return e?H.getBaseUrls(e):[]},getAvailableLocations:function(){let e=J.getValue();if(!e)return[];let t=R.getLocation(e),n=ne.getSynthesizedLocationElements(t);return t.concat(n)},getAverageLatency:function(e=h.default.VIDEO,t=null,n=NaN){return A?A.getAverageLatency(e,t,n):0},getAverageThroughput:function(e=h.default.VIDEO,t=null,n=NaN){return A?A.getAverageThroughput(e,t,n):0},getBufferLength:function(e){let t=[h.default.VIDEO,h.default.AUDIO,h.default.TEXT];if(e)return t.indexOf(e)===-1?(b.warn(`getBufferLength requested for invalid type`),NaN):Ce().getCurrentBufferLevel(e)||NaN;{let e=t.map((e=>De(e).length>0?Ce().getCurrentBufferLevel(e):Number.MAX_VALUE)).reduce(((e,t)=>Math.min(e,t)));return e===Number.MAX_VALUE?NaN:e}},getCurrentLiveLatency:function(){if(!C)throw o;return E?q.getCurrentLiveLatency():NaN},getCurrentRepresentationForType:function(t){if(!w)throw e;if(t!==h.default.IMAGE&&t!==h.default.VIDEO&&t!==h.default.AUDIO)return null;let n=ke();if(!n)return null;if(t===h.default.IMAGE){let e=n.getThumbnailController();return e?e.getCurrentTrack():-1}return n.getCurrentRepresentationForType(t)},getCurrentSteeringResponseData:function(){if(ne)return ne.getCurrentSteeringResponseData()},getCurrentTextTrackIndex:function(){let e=NaN,t=G.getActiveStreamInfo();if(t&&K)return e=K.getCurrentTrackIdx(t.id),e},getCurrentTrackFor:function(t){if(!w)throw e;let n=G.getActiveStreamInfo();return n?N.getCurrentTrackFor(t,n.id):null},getDashAdapter:function(){return R},getDashMetrics:Ce,getDebug:function(){return v},getDvrSeekOffset:_e,getDvrWindow:function(){if(!E)throw t;let e=G&&G.hasVideoTrack()?h.default.VIDEO:h.default.AUDIO,n=ie.getCurrentDVRInfo(e);if(!n)return{};let r=0,i=q.getIsDynamic();return i&&(r=n.manifestInfo.availableFrom.getTime()/1e3),{start:n.range.start,end:n.range.end,startAsUtc:i?r+n.range.start:NaN,endAsUtc:i?r+n.range.end:NaN,size:n.range.end-n.range.start}},getExternalSubtitles:function(){B.getExternalSubtitles()},getInitialMediaSettingsFor:function(e){if(!C)throw o;return N.getInitialSettings(e)},getLowLatencyModeEnabled:function(){if(!E)throw t;return q.getLowLatencyModeEnabled()},getManifest:function(){return J.getValue()},getOfflineController:function(){return Fe()},getPlaybackRate:function(){return we().playbackRate},getProtectionController:function(){return Pe()},getRawThroughputData:function(e=h.default.VIDEO){return A?A.getRawThroughputData(e):[]},getRepresentationsByType:function(t,n=null){if(!w)throw e;let r=n?G.getStreamById(n):ke();return r?r.getRepresentationsByType(t):[]},getSafeAverageThroughput:function(e=h.default.VIDEO,t=null,n=NaN){return A?A.getSafeAverageThroughput(e,t,n):0},getSettings:function(){return _.get()},getSource:function(){if(!x)throw r;return x},getStreamsFromManifest:function(t){if(!w)throw e;return R.getStreamsInfo(t)},getTTMLRenderingDiv:function(){return se?se.getTTMLRenderingDiv():null},getTargetLiveDelay:function(){if(!E)throw t;return q.getOriginalLiveDelay()},getTracksFor:De,getTracksForTypeFromManifest:function(t,n,r){if(!w)throw e;return(r||=R.getStreamsInfo(n,1)[0])?R.getAllMediaInfoForType(r,t,n):[]},getVersion:me,getVideoElement:we,getVolume:function(){return we().volume},getXHRWithCredentialsForType:function(e){return B.getXHRWithCredentialsForType(e)},initialize:function(e,t,n,r=NaN){U||(U=(0,Tr.default)(d).getInstance(),U.setConfig({settings:_,protectionController:P})),V||=Gi(d).getInstance(),U.supportsMediaSource()?(C||(C=!0,M=oc(d).getInstance(),A||=ic(d).getInstance(),k||=xe(d).getInstance(),j||=ir(d).getInstance(),q||=Na(d).getInstance(),N||=ka(d).getInstance(),G||=fs(d).getInstance(),ee||=Ji(d).getInstance(),re||=Nr(d).getInstance(),te||=Ja(d).getInstance(),ne||=ur(d).getInstance(),W||=jr(d).getInstance(),R=Ti(d).getInstance(),J=Sa(d).getInstance(),ae=Rn(d).getInstance(),oe=Gn(d).getInstance(),de=Xn(d).getInstance(),ie=Ui(d).getInstance({settings:_}),le=Vr(d).getInstance({settings:_}),R.setConfig({constants:h.default,cea608parser:new Ns,errHandler:V,BASE64:Te}),H||=gr(d).create(),H.setConfig({adapter:R,contentSteeringController:ne}),te.setConfig({adapter:R}),ue||=Ua(d).getInstance({dashMetrics:ie,mediaPlayerModel:z,errHandler:V,baseURLController:H,events:m.default,eventBus:f,debug:v,boxParser:wr(d).getInstance(),errors:Ne}),N.setConfig({domStorage:le,settings:_,mediaPlayerModel:z,customParametersModel:B,videoModel:se}),z.setConfig({playbackController:q,serviceDescriptionController:te}),ne.setConfig({adapter:R,errHandler:V,dashMetrics:ie,mediaPlayerModel:z,manifestModel:J,serviceDescriptionController:te,throughputController:A,eventBus:f}),Se(),be(n===void 0||n),Fe()),e&&Ee(e),t&&Oe(t,r),b.info(`[dash.js `+me()+`] MediaPlayer has been initialized`)):V.error(new Be.default(Ne.CAPABILITY_MEDIASOURCE_ERROR_CODE,Ne.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE))},isDynamic:ge,isMuted:function(){return we().muted},isPaused:he,isReady:pe,isSeeking:function(){if(!E)throw t;return q.isSeeking()},isTextEnabled:function(){let e=G.getActiveStreamInfo();return!(!e||!K)&&K.isTextEnabled(e)},off:function(e,t,n){f.off(e,t,n)},on:function(e,t,n,r){f.on(e,t,n,r)},pause:function(){if(!E)throw t;q.pause()},play:function(){if(!E)throw t;(!D||he()&&E)&&q.play(!0)},preload:function(){if(!se.getElement()&&!w){if(!x)throw r;Ie(O)}},provideThumbnail:function(e,t){if(typeof t!=`function`)return;if(e<0)return void t(null);let n=q.getIsDynamic()?_e(e):e,r=G.getStreamForTime(n);if(r===null)return void t(null);let i=r.getThumbnailController();if(i)return i.provide(n,t);t(null)},refreshManifest:function(e){if(!C)throw o;if(!pe())return e(null,r);let t=this;if(typeof e==`function`){let n=function(r){f.off(m.default.INTERNAL_MANIFEST_LOADED,n,t),r.error?e(null,r.error):e(r.manifest)};f.on(m.default.INTERNAL_MANIFEST_LOADED,n,t)}G.refreshManifest()},registerCustomCapabilitiesFilter:function(e){B.registerCustomCapabilitiesFilter(e)},registerLicenseRequestFilter:function(e){B.registerLicenseRequestFilter(e)},registerLicenseResponseFilter:function(e){B.registerLicenseResponseFilter(e)},removeABRCustomRule:function(e){B.removeAbrCustomRule(e)},removeAllABRCustomRule:function(){B.removeAllAbrCustomRule()},removeExternalSubtitleById:function(e){B.removeExternalSubtitleById(e)},removeExternalSubtitleByUrl:function(e){B.removeExternalSubtitleByUrl(e)},removeRequestInterceptor:function(e){B.removeRequestInterceptor(e)},removeResponseInterceptor:function(e){B.removeResponseInterceptor(e)},removeUTCTimingSource:function(e,t){B.removeUTCTimingSource(e,t)},reset:fe,resetCustomInitialTrackSelectionFunction:function(){B.resetCustomInitialTrackSelectionFunction(null)},resetSettings:function(){_.reset()},restoreDefaultUTCTimingSources:Se,retrieveManifest:function(e,t){let n=Me(),r=this,i=function(e){e.error?t(null,e.error):t(e.manifest),f.off(m.default.INTERNAL_MANIFEST_LOADED,i,r),n.reset()};f.on(m.default.INTERNAL_MANIFEST_LOADED,i,r),ce.initialize(e),n.load(e)},seek:function(e){if(!E)throw t;if((0,Ve.checkParameterType)(e,`number`),isNaN(e))throw h.default.BAD_ARGUMENT_ERROR;e<0&&(e=0);let n=q.getIsDynamic()?_e(e):e,r=we();!q.getIsDynamic()&&r.duration&&(n=Math.min(r.duration,n)),q.seek(n,!1,!1,!0)},seekToOriginalLive:function(){E&&ge()&&q.seekToOriginalLive()},seekToPresentationTime:function(e){if(!E)throw t;if((0,Ve.checkParameterType)(e,`number`),isNaN(e))throw h.default.BAD_ARGUMENT_ERROR;e<0&&(e=0);let n=we();if(!q.getIsDynamic()&&n.duration&&(e=Math.min(n.duration,e)),q.getIsDynamic()){let t=G&&G.hasVideoTrack()?h.default.VIDEO:h.default.AUDIO,n=ie.getCurrentDVRInfo(t);if(!n)return;(e=ve(e,n))<n.range.start&&(e=n.range.start)}q.seek(e,!1,!1,!0)},setAutoPlay:be,setConfig:function(e){e&&(e.capabilities&&(U=e.capabilities),e.capabilitiesFilter&&(W=e.capabilitiesFilter),e.streamController&&(G=e.streamController),e.textController&&(K=e.textController),e.gapController&&(ee=e.gapController),e.throughputController&&(A=e.throughputController),e.playbackController&&(q=e.playbackController),e.serviceDescriptionController&&(te=e.serviceDescriptionController),e.contentSteeringController&&(ne=e.contentSteeringController),e.clientDataReportingController&&(de=e.clientDataReportingController),e.catchupController&&(re=e.catchupController),e.mediaPlayerModel&&(z=e.mediaPlayerModel),e.customParametersModel&&(B=e.customParametersModel),e.abrController&&(k=e.abrController),e.schemeLoaderFactory&&(j=e.schemeLoaderFactory),e.mediaController&&(N=e.mediaController),e.settings&&(_=e.settings),e.dashMetrics&&(ie=e.dashMetrics))},setCurrentTrack:function(t,n=!1){if(!w)throw e;!P||P.areKeyIdsUsable(t.normalizedKeyIds)?N.setTrack(t,{noSettingsSave:n}):b.error(`Can not switch to track with index ${t.index} because key is not usable`)},setCustomInitialTrackSelectionFunction:function(e){B.setCustomInitialTrackSelectionFunction(e)},setInitialMediaSettingsFor:function(e,t){if(!C)throw o;let n=function(e){let t=_.get().streaming.defaultSchemeIdUri,n={};function r(e,t,n){let r={};if(t){if(t instanceof Array)throw`Array type not supported for settings!`;return t instanceof Object?(r.schemeIdUri=t.schemeIdUri?t.schemeIdUri:``,r.value=t.value?t.value:``):(r.schemeIdUri=n,r.value=t,b.warn(`No schemeIdUri provided for `+e+`, using default "`+n+`"`)),r}return null}return e.id!==void 0&&(n.id=e.id),e.lang!==void 0&&(n.lang=e.lang),isNaN(e.index)||(n.index=e.index),e.viewpoint!==void 0&&(n.viewpoint=r(`viewpoint`,e.viewpoint,t.viewpoint)),e.audioChannelConfiguration!==void 0&&(n.audioChannelConfiguration=r(`audioChannelConfiguration`,e.audioChannelConfiguration,t.audioChannelConfiguration)),e.role!==void 0&&e.role!==null&&(n.role=r(`role`,e.role,t.role),n.role.schemeIdUri===h.default.DASH_ROLE_SCHEME_ID&&n.role.value===`Main`&&(n.role.value=Y.default.MAIN)),e.accessibility!==void 0&&(n.accessibility=r(`accessibility`,e.accessibility,t.accessibility)),n}(t);N.setInitialSettings(e,n)},setMute:function(e){(0,Ve.checkParameterType)(e,`boolean`),we().muted=e},setPlaybackRate:function(e){we().playbackRate=e},setProtectionData:function(e){S=e,G&&G.setProtectionData(S)},setRepresentationForTypeById:function(t,n,r=!1){if(t!==h.default.IMAGE&&t!==h.default.VIDEO&&t!==h.default.AUDIO)return;if(!w)throw e;let i=ke();if(i)if(t===h.default.IMAGE){let e=i.getThumbnailController();e&&e.setTrackById(n)}else{let e=i.getRepresentationForTypeById(t,n);e&&k.manuallySetPlaybackQuality(t,G.getActiveStreamInfo(),e,{forceReplace:r})}},setRepresentationForTypeByIndex:function(t,n,r=!1){if(t!==h.default.IMAGE&&t!==h.default.VIDEO&&t!==h.default.AUDIO)return;if(!w)throw e;let i=ke();if(i)if(t===h.default.IMAGE){let e=i.getThumbnailController();e&&e.setTrackByIndex(n)}else{let e=i.getRepresentationForTypeByIndex(t,n);e&&k.manuallySetPlaybackQuality(t,G.getActiveStreamInfo(),e,{forceReplace:r})}},setTextTrack:function(e){if(!E)throw t;let n=G.getActiveStreamInfo();n&&K&&K.setTextTrack(n.id,e)},setVolume:function(e){if(typeof e!=`number`||isNaN(e)||e<0||e>1)throw h.default.BAD_ARGUMENT_ERROR;we().volume=e},setXHRWithCredentialsForType:function(e,t){B.setXHRWithCredentialsForType(e,t)},time:ye,timeAsUTC:function(){if(!E)throw t;if(!q.getIsDynamic()||ye()<0)return NaN;let e=G&&G.hasVideoTrack()?h.default.VIDEO:h.default.AUDIO,n,r,i=ie.getCurrentDVRInfo(e);return i?(n=i.manifestInfo.availableFrom.getTime()/1e3,r=n+ye(),r):0},timeInDvrWindow:function(){if(!E)throw t;if(!q.getIsDynamic())return ye();let e=we().currentTime,n=G&&G.hasVideoTrack()?h.default.VIDEO:h.default.AUDIO,r=ie.getCurrentDVRInfo(n);return e=r===null||e===0?0:Math.max(0,e-r.range.start),e},trigger:function(e,t,n){f.trigger(e,t,n)},triggerSteeringRequest:function(){if(ne)return ne.loadSteeringData()},unregisterCustomCapabilitiesFilter:function(e){B.unregisterCustomCapabilitiesFilter(e)},unregisterLicenseRequestFilter:function(e){B.unregisterLicenseRequestFilter(e)},unregisterLicenseResponseFilter:function(e){B.unregisterLicenseResponseFilter(e)},updateSettings:function(e){_.update(e)},updateSource:function(e){x=e,G.load(x)}},b=v.getLogger(y),C=!1,E=!1,w=!1,D=!0,O=NaN,P=null,L=null,S=null,R=null,ue=null,m.default.extend(g.default),z=ja(d).getInstance(),B=(0,Kn.default)(d).getInstance(),se=fc(d).getInstance(),ce=lc(d).getInstance(),y}mc.__dashjs_factory_name=`MediaPlayer`;let hc=i.default.getClassFactory(mc);hc.events=g.default,hc.errors=Ne,i.default.updateClassFactory(mc.__dashjs_factory_name,hc);var gc=hc},1191:function(e,t,n){n.r(t);var r=n(7252);class i extends r.default{constructor(){super(),this.AST_IN_FUTURE=`astInFuture`,this.BASE_URLS_UPDATED=`baseUrlsUpdated`,this.BUFFER_EMPTY=`bufferStalled`,this.BUFFER_LOADED=`bufferLoaded`,this.BUFFER_LEVEL_STATE_CHANGED=`bufferStateChanged`,this.BUFFER_LEVEL_UPDATED=`bufferLevelUpdated`,this.DVB_FONT_DOWNLOAD_ADDED=`dvbFontDownloadAdded`,this.DVB_FONT_DOWNLOAD_COMPLETE=`dvbFontDownloadComplete`,this.DVB_FONT_DOWNLOAD_FAILED=`dvbFontDownloadFailed`,this.DYNAMIC_TO_STATIC=`dynamicToStatic`,this.ERROR=`error`,this.FRAGMENT_LOADING_COMPLETED=`fragmentLoadingCompleted`,this.FRAGMENT_LOADING_PROGRESS=`fragmentLoadingProgress`,this.FRAGMENT_LOADING_STARTED=`fragmentLoadingStarted`,this.FRAGMENT_LOADING_ABANDONED=`fragmentLoadingAbandoned`,this.LOG=`log`,this.MANIFEST_LOADING_STARTED=`manifestLoadingStarted`,this.MANIFEST_LOADING_FINISHED=`manifestLoadingFinished`,this.MANIFEST_LOADED=`manifestLoaded`,this.METRICS_CHANGED=`metricsChanged`,this.METRIC_CHANGED=`metricChanged`,this.METRIC_ADDED=`metricAdded`,this.METRIC_UPDATED=`metricUpdated`,this.PERIOD_SWITCH_STARTED=`periodSwitchStarted`,this.PERIOD_SWITCH_COMPLETED=`periodSwitchCompleted`,this.QUALITY_CHANGE_REQUESTED=`qualityChangeRequested`,this.QUALITY_CHANGE_RENDERED=`qualityChangeRendered`,this.NEW_TRACK_SELECTED=`newTrackSelected`,this.TRACK_CHANGE_RENDERED=`trackChangeRendered`,this.STREAM_INITIALIZING=`streamInitializing`,this.STREAM_UPDATED=`streamUpdated`,this.STREAM_ACTIVATED=`streamActivated`,this.STREAM_DEACTIVATED=`streamDeactivated`,this.STREAM_INITIALIZED=`streamInitialized`,this.STREAM_TEARDOWN_COMPLETE=`streamTeardownComplete`,this.TEXT_TRACKS_ADDED=`allTextTracksAdded`,this.TEXT_TRACK_ADDED=`textTrackAdded`,this.CUE_ENTER=`cueEnter`,this.CUE_EXIT=`cueExit`,this.THROUGHPUT_MEASUREMENT_STORED=`throughputMeasurementStored`,this.TTML_PARSED=`ttmlParsed`,this.TTML_TO_PARSE=`ttmlToParse`,this.CAPTION_RENDERED=`captionRendered`,this.CAPTION_CONTAINER_RESIZE=`captionContainerResize`,this.CAN_PLAY=`canPlay`,this.CAN_PLAY_THROUGH=`canPlayThrough`,this.PLAYBACK_ENDED=`playbackEnded`,this.PLAYBACK_ERROR=`playbackError`,this.PLAYBACK_INITIALIZED=`playbackInitialized`,this.PLAYBACK_NOT_ALLOWED=`playbackNotAllowed`,this.PLAYBACK_METADATA_LOADED=`playbackMetaDataLoaded`,this.PLAYBACK_LOADED_DATA=`playbackLoadedData`,this.PLAYBACK_PAUSED=`playbackPaused`,this.PLAYBACK_PLAYING=`playbackPlaying`,this.PLAYBACK_PROGRESS=`playbackProgress`,this.PLAYBACK_RATE_CHANGED=`playbackRateChanged`,this.PLAYBACK_SEEKED=`playbackSeeked`,this.PLAYBACK_SEEKING=`playbackSeeking`,this.PLAYBACK_STALLED=`playbackStalled`,this.PLAYBACK_STARTED=`playbackStarted`,this.PLAYBACK_TIME_UPDATED=`playbackTimeUpdated`,this.PLAYBACK_VOLUME_CHANGED=`playbackVolumeChanged`,this.PLAYBACK_WAITING=`playbackWaiting`,this.MANIFEST_VALIDITY_CHANGED=`manifestValidityChanged`,this.EVENT_MODE_ON_START=`eventModeOnStart`,this.EVENT_MODE_ON_RECEIVE=`eventModeOnReceive`,this.CONFORMANCE_VIOLATION=`conformanceViolation`,this.REPRESENTATION_SWITCH=`representationSwitch`,this.ADAPTATION_SET_REMOVED_NO_CAPABILITIES=`adaptationSetRemovedNoCapabilities`,this.CONTENT_STEERING_REQUEST_COMPLETED=`contentSteeringRequestCompleted`,this.INBAND_PRFT=`inbandPrft`,this.MANAGED_MEDIA_SOURCE_START_STREAMING=`managedMediaSourceStartStreaming`,this.MANAGED_MEDIA_SOURCE_END_STREAMING=`managedMediaSourceEndStreaming`}}t.default=new i},5212:function(e,t,n){n.r(t),t.default={STREAM:`stream`,VIDEO:`video`,ENHANCEMENT:`enhancement`,AUDIO:`audio`,TEXT:`text`,MUXED:`muxed`,IMAGE:`image`,STPP:`stpp`,TTML:`ttml`,VTT:`vtt`,WVTT:`wvtt`,CONTENT_STEERING:`contentSteering`,LIVE_CATCHUP_MODE_DEFAULT:`liveCatchupModeDefault`,LIVE_CATCHUP_MODE_LOLP:`liveCatchupModeLoLP`,MOVING_AVERAGE_SLIDING_WINDOW:`slidingWindow`,MOVING_AVERAGE_EWMA:`ewma`,BAD_ARGUMENT_ERROR:`Invalid Arguments`,MISSING_CONFIG_ERROR:`Missing config parameter(s)`,TRACK_SWITCH_MODE_ALWAYS_REPLACE:`alwaysReplace`,TRACK_SWITCH_MODE_NEVER_REPLACE:`neverReplace`,TRACK_SELECTION_MODE_FIRST_TRACK:`firstTrack`,TRACK_SELECTION_MODE_HIGHEST_BITRATE:`highestBitrate`,TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY:`highestEfficiency`,TRACK_SELECTION_MODE_LOWEST_STARTUP_DELAY:`lowestStartupDelay`,TRACK_SELECTION_MODE_WIDEST_RANGE:`widestRange`,CMCD_QUERY_KEY:`CMCD`,CMCD_MODE_QUERY:`query`,CMCD_MODE_HEADER:`header`,CMCD_AVAILABLE_KEYS:[`br`,`d`,`ot`,`tb`,`bl`,`dl`,`mtp`,`nor`,`nrr`,`su`,`bs`,`rtp`,`cid`,`pr`,`sf`,`sid`,`st`,`v`],CMCD_V2_AVAILABLE_KEYS:[`msd`,`ltc`],CMCD_AVAILABLE_REQUESTS:[`segment`,`mpd`,`xlink`,`steering`,`other`],INITIALIZE:`initialize`,TEXT_SHOWING:`showing`,TEXT_HIDDEN:`hidden`,TEXT_DISABLED:`disabled`,ACCESSIBILITY_CEA608_SCHEME:`urn:scte:dash:cc:cea-608:2015`,CC1:`CC1`,CC3:`CC3`,UTF8:`utf-8`,SCHEME_ID_URI:`schemeIdUri`,START_TIME:`starttime`,SERVICE_DESCRIPTION_DVB_LL_SCHEME:`urn:dvb:dash:lowlatency:scope:2019`,SUPPLEMENTAL_PROPERTY_DVB_LL_SCHEME:`urn:dvb:dash:lowlatency:critical:2019`,CTA_5004_2023_SCHEME:`urn:mpeg:dash:cta-5004:2023`,THUMBNAILS_SCHEME_ID_URIS:[`http://dashif.org/thumbnail_tile`,`http://dashif.org/guidelines/thumbnail_tile`],FONT_DOWNLOAD_DVB_SCHEME:`urn:dvb:dash:fontdownload:2014`,COLOUR_PRIMARIES_SCHEME_ID_URI:`urn:mpeg:mpegB:cicp:ColourPrimaries`,URL_QUERY_INFO_SCHEME:`urn:mpeg:dash:urlparam:2014`,EXT_URL_QUERY_INFO_SCHEME:`urn:mpeg:dash:urlparam:2016`,MATRIX_COEFFICIENTS_SCHEME_ID_URI:`urn:mpeg:mpegB:cicp:MatrixCoefficients`,TRANSFER_CHARACTERISTICS_SCHEME_ID_URI:`urn:mpeg:mpegB:cicp:TransferCharacteristics`,SEGMENT_SEQUENCE_REPRESENTATION_SCHEME_ID_URI:`urn:mpeg:dash:ssr:2023`,HDR_METADATA_FORMAT_SCHEME_ID_URI:`urn:dvb:dash:hdr-dmi`,HDR_METADATA_FORMAT_VALUES:{ST2094_10:`ST2094-10`,SL_HDR2:`SL-HDR2`,ST2094_40:`ST2094-40`},MEDIA_CAPABILITIES_API:{COLORGAMUT:{SRGB:`srgb`,P3:`p3`,REC2020:`rec2020`},TRANSFERFUNCTION:{SRGB:`srgb`,PQ:`pq`,HLG:`hlg`},HDR_METADATATYPE:{SMPTE_ST_2094_10:`smpteSt2094-10`,SLHDR2:`slhdr2`,SMPTE_ST_2094_40:`smpteSt2094-40`}},XML:`XML`,ARRAY_BUFFER:`ArrayBuffer`,DVB_REPORTING_URL:`dvb:reportingUrl`,DVB_PROBABILITY:`dvb:probability`,OFF_MIMETYPE:`application/font-sfnt`,WOFF_MIMETYPE:`application/font-woff`,VIDEO_ELEMENT_READY_STATES:{HAVE_NOTHING:0,HAVE_METADATA:1,HAVE_CURRENT_DATA:2,HAVE_FUTURE_DATA:3,HAVE_ENOUGH_DATA:4},FILE_LOADER_TYPES:{FETCH:`fetch_loader`,XHR:`xhr_loader`},THROUGHPUT_TYPES:{LATENCY:`throughput_type_latency`,BANDWIDTH:`throughput_type_bandwidth`},THROUGHPUT_CALCULATION_MODES:{EWMA:`throughputCalculationModeEwma`,ZLEMA:`throughputCalculationModeZlema`,ARITHMETIC_MEAN:`throughputCalculationModeArithmeticMean`,BYTE_SIZE_WEIGHTED_ARITHMETIC_MEAN:`throughputCalculationModeByteSizeWeightedArithmeticMean`,DATE_WEIGHTED_ARITHMETIC_MEAN:`throughputCalculationModeDateWeightedArithmeticMean`,HARMONIC_MEAN:`throughputCalculationModeHarmonicMean`,BYTE_SIZE_WEIGHTED_HARMONIC_MEAN:`throughputCalculationModeByteSizeWeightedHarmonicMean`,DATE_WEIGHTED_HARMONIC_MEAN:`throughputCalculationModeDateWeightedHarmonicMean`},LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE:{MOOF_PARSING:`lowLatencyDownloadTimeCalculationModeMoofParsing`,DOWNLOADED_DATA:`lowLatencyDownloadTimeCalculationModeDownloadedData`,AAST:`lowLatencyDownloadTimeCalculationModeAast`},RULES_TYPES:{QUALITY_SWITCH_RULES:`qualitySwitchRules`,ABANDON_FRAGMENT_RULES:`abandonFragmentRules`},QUALITY_SWITCH_RULES:{BOLA_RULE:`BolaRule`,THROUGHPUT_RULE:`ThroughputRule`,INSUFFICIENT_BUFFER_RULE:`InsufficientBufferRule`,SWITCH_HISTORY_RULE:`SwitchHistoryRule`,DROPPED_FRAMES_RULE:`DroppedFramesRule`,LEARN_TO_ADAPT_RULE:`L2ARule`,LOL_PLUS_RULE:`LoLPRule`},ABANDON_FRAGMENT_RULES:{ABANDON_REQUEST_RULE:`AbandonRequestsRule`},ID3_SCHEME_ID_URI:`https://aomedia.org/emsg/ID3`,COMMON_ACCESS_TOKEN_HEADER:`common-access-token`,DASH_ROLE_SCHEME_ID:`urn:mpeg:dash:role:2011`,CODEC_FAMILIES:{MP3:`mp3`,AAC:`aac`,AC3:`ac3`,EC3:`ec3`,DTSX:`dtsx`,DTSC:`dtsc`,AVC:`avc`,HEVC:`hevc`}}},2861:function(e,t,n){n.r(t),t.default={CLEARKEY_KEYSTEM_STRING:`org.w3.clearkey`,WIDEVINE_KEYSTEM_STRING:`com.widevine.alpha`,PLAYREADY_KEYSTEM_STRING:`com.microsoft.playready`,PLAYREADY_RECOMMENDATION_KEYSTEM_STRING:`com.microsoft.playready.recommendation`,WIDEVINE_UUID:`edef8ba9-79d6-4ace-a3c8-27dcd51d21ed`,PLAYREADY_UUID:`9a04f079-9840-4286-ab92-e65be0885f95`,CLEARKEY_UUID:`e2719d58-a985-b3c9-781a-b030af78d30e`,W3C_CLEARKEY_UUID:`1077efec-c0b2-4d02-ace3-3c1e52e2fb4b`,INITIALIZATION_DATA_TYPE_CENC:`cenc`,INITIALIZATION_DATA_TYPE_KEYIDS:`keyids`,INITIALIZATION_DATA_TYPE_WEBM:`webm`,ENCRYPTION_SCHEME_CENC:`cenc`,ENCRYPTION_SCHEME_CBCS:`cbcs`,MEDIA_KEY_MESSAGE_TYPES:{LICENSE_REQUEST:`license-request`,LICENSE_RENEWAL:`license-renewal`,LICENSE_RELEASE:`license-release`,INDIVIDUALIZATION_REQUEST:`individualization-request`},ROBUSTNESS_STRINGS:{WIDEVINE:{SW_SECURE_CRYPTO:`SW_SECURE_CRYPTO`,SW_SECURE_DECODE:`SW_SECURE_DECODE`,HW_SECURE_CRYPTO:`HW_SECURE_CRYPTO`,HW_SECURE_DECODE:`HW_SECURE_DECODE`,HW_SECURE_ALL:`HW_SECURE_ALL`}},MEDIA_KEY_STATUSES:{USABLE:`usable`,EXPIRED:`expired`,RELEASED:`released`,OUTPUT_RESTRICTED:`output-restricted`,OUTPUT_DOWNSCALED:`output-downscaled`,STATUS_PENDING:`status-pending`,INTERNAL_ERROR:`internal-error`}}},4469:function(e,t,n){n.r(t),n.d(t,{default:function(){return te}});class r{constructor(){this.mpdurl=null,this.errorcode=null,this.terror=null,this.url=null,this.ipaddress=null,this.servicelocation=null}}r.SSL_CONNECTION_FAILED_PREFIX=`SSL`,r.DNS_RESOLUTION_FAILED=`C00`,r.HOST_UNREACHABLE=`C01`,r.CONNECTION_REFUSED=`C02`,r.CONNECTION_ERROR=`C03`,r.CORRUPT_MEDIA_ISOBMFF=`M00`,r.CORRUPT_MEDIA_OTHER=`M01`,r.BASE_URL_CHANGED=`F00`,r.BECAME_REPORTER=`S00`;var i=r,o=n(913),c=n(138);function l(e){let t,n,r=(e||={}).eventBus,c=e.dashMetrics,l=e.metricsConstants,u=e.events;function d(e){let t=new i;if(n){for(let n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.mpdurl||=n.originalUrl||n.url,t.terror||=new Date,c.addDVBErrors(t)}}function f(e){e.error||(n=e.manifest)}function p(e){d({errorcode:i.BASE_URL_CHANGED,servicelocation:e.entry})}function m(){d({errorcode:i.BECAME_REPORTER})}function h(e){var t;e.metric===l.HTTP_REQUEST&&((t=e.value).responsecode===0||t.responsecode==null||t.responsecode>=400||t.responsecode<100||t.responsecode>=600)&&d({errorcode:t.responsecode||i.CONNECTION_ERROR,url:t.url,terror:t.tresponse,servicelocation:t._serviceLocation})}function g(e){let t;switch(e.error?e.error.code:0){case MediaError.MEDIA_ERR_NETWORK:t=i.CONNECTION_ERROR;break;case MediaError.MEDIA_ERR_DECODE:t=i.CORRUPT_MEDIA_OTHER;break;default:return}d({errorcode:t})}return t={initialize:function(){r.on(u.MANIFEST_UPDATED,f,t),r.on(u.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,p,t),r.on(u.METRIC_ADDED,h,t),r.on(u.METRIC_UPDATED,h,t),r.on(u.PLAYBACK_ERROR,g,t),r.on(o.default.BECAME_REPORTING_PLAYER,m,t)},reset:function(){r.off(u.MANIFEST_UPDATED,f,t),r.off(u.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,p,t),r.off(u.METRIC_ADDED,h,t),r.off(u.METRIC_UPDATED,h,t),r.off(u.PLAYBACK_ERROR,g,t),r.off(o.default.BECAME_REPORTING_PLAYER,m,t)}},t}l.__dashjs_factory_name=`DVBErrorsTranslator`;var u=c.default.getSingletonFactory(l),d=n(7377);function f(e){e||={};let t,n,r=!1,i=this.context,o=e.mediaElement;return t={initialize:function(e){e&&e.length&&(e.forEach((e=>{let t=e.starttime,r=t+e.duration;n.add(t,r)})),r=!!e[0]._useWallClockTime)},reset:function(){n.clear()},isEnabled:function(){let e,t=n.length;if(!t)return!0;e=r?new Date().getTime()/1e3:o.currentTime;for(let r=0;r<t;r+=1){let t=n.start(r),i=n.end(r);if(t<=e&&e<i)return!0}return!1}},n=(0,d.default)(i).create(),t}f.__dashjs_factory_name=`RangeController`;var p=c.default.getClassFactory(f);function m(){return{serialise:function e(t){let n,r,i=[],o=[];for(n in t)if(t.hasOwnProperty(n)&&n.indexOf(`_`)!==0){if(r=t[n],r??=``,Array.isArray(r)){if(!r.length)continue;o=[],r.forEach((function(t){let n=Object.prototype.toString.call(t).slice(8,-1)!==`Object`;o.push(n?t:e(t))})),r=o.map(encodeURIComponent).join(`,`)}else typeof r==`string`?r=encodeURIComponent(r):r instanceof Date?r=r.toISOString():typeof r==`number`&&(r=Math.round(r));i.push(n+`=`+r)}return i.join(`&`)}}}m.__dashjs_factory_name=`MetricSerialiser`;var h=c.default.getSingletonFactory(m);function g(){let e,t,n,r=window.crypto||window.msCrypto,i=Uint32Array,o=2**(8*i.BYTES_PER_ELEMENT)-1;function c(){r&&(e||=new i(10),r.getRandomValues(e),t=0)}return n={random:function(n,i){let l;return n||=0,i||=1,r?(t===e.length&&c(),l=e[t]/o,t+=1):l=Math.random(),l*(i-n)+n}},c(),n}g.__dashjs_factory_name=`RNG`;var _=c.default.getSingletonFactory(g),v=n(1926);function y(e){let t;e||={};let n,r,i,o,c,l,u,d=this.context,f=[],p=e.metricsConstants;function m(){o=!1,c=!1,l=null,u=null}return t={report:function(e,t){Array.isArray(t)||(t=[t]),c&&u.isEnabled()&&t.forEach((function(t){let i=n.serialise(t);e!==p.DVB_ERRORS&&(i=`metricname=${e}&${i}`),i=`${l}?${i}`,function(e,t,n){let i=new XMLHttpRequest;i.withCredentials=r.getXHRWithCredentialsForType(p.HTTP_REQUEST_DVB_REPORTING_TYPE);let o=function(){let e=f.indexOf(i);e!==-1&&(f.splice(e,1),!(i.status>=200&&i.status<300)&&n&&n())};f.push(i);try{i.open(`GET`,e),i.onloadend=o,i.onerror=o,i.send()}catch{i.onerror()}}(i,0,(function(){c=!1}))}))},initialize:function(e,t){let n;if(u=t,l=e.dvbReportingUrl,!l)throw Error(`required parameter missing (dvb:reportingUrl)`);o||=(n=e.dvbProbability,n&&(n===1e3||n/1e3>=i.random())&&(c=!0),!0)},reset:function(){m()}},n=h(d).getInstance(),i=_(d).getInstance(),r=(0,v.default)(d).getInstance(),m(),t}y.__dashjs_factory_name=`DVBReporting`;var b=c.default.getClassFactory(y);function x(e){e||={};let t={"urn:dvb:dash:reporting:2014":b},n=this.context,r,i=e.debug?e.debug.getLogger(r):{},o=e.metricsConstants,c=e.mediaPlayerModel||{};return r={create:function(e,r){let l;try{l=t[e.schemeIdUri](n).create({metricsConstants:o,mediaPlayerModel:c}),l.initialize(e,r)}catch(t){l=null,i.error(`ReportingFactory: could not create Reporting with schemeIdUri ${e.schemeIdUri} (${t.message})`)}return l},register:function(e,n){t[e]=n},unregister:function(e){delete t[e]}},r}x.__dashjs_factory_name=`ReportingFactory`;var S=c.default.getSingletonFactory(x);function C(e){let t,n=[],r=S(this.context).getInstance(e);return t={initialize:function(e,t){e.some((e=>{let i=r.create(e,t);if(i)return n.push(i),!0}))},reset:function(){n.forEach((e=>e.reset())),n=[]},report:function(e,t){n.forEach((n=>n.report(e,t)))}},t}C.__dashjs_factory_name=`ReportingController`;var w=c.default.getClassFactory(C);function T(){return{reconstructFullMetricName:function(e,t,n){let r=e;return t&&(r+=`(`+t,n&&n.length&&(r+=`,`+n),r+=`)`),r},validateN:function(e){if(!e)throw Error(`missing n`);if(isNaN(e))throw Error(`n is NaN`);if(e<0)throw Error(`n must be positive`);return e}}}T.__dashjs_factory_name=`HandlerHelpers`;var E=c.default.getSingletonFactory(T);function D(e){let t,n,r,i,o,c;e||={};let l=this.context,u=E(l).getInstance(),d=[],f=e.metricsConstants;function p(){let e=function(){try{return Object.keys(d).map((e=>d[e])).reduce(((e,t)=>e.level<t.level?e:t))}catch{return}}();e&&c!==e.t&&(c=e.t,n.report(i,e))}return t={initialize:function(e,t,c){t&&(r=u.validateN(c),n=t,i=u.reconstructFullMetricName(e,c),o=setInterval(p,r))},reset:function(){clearInterval(o),o=null,r=0,n=null,c=null},handleNewMetric:function(e,t,n){e===f.BUFFER_LEVEL&&(d[n]=t)}},t}D.__dashjs_factory_name=`BufferLevelHandler`;var O=c.default.getClassFactory(D),k=c.default.getClassFactory((function(e){let t,n,r=(e||={}).eventBus,i=e.metricsConstants;function c(){r.off(o.default.METRICS_INITIALISATION_COMPLETE,c,this),r.trigger(o.default.BECAME_REPORTING_PLAYER)}return t={initialize:function(e,t){t&&(n=t,r.on(o.default.METRICS_INITIALISATION_COMPLETE,c,this))},reset:function(){n=null},handleNewMetric:function(e,t){e===i.DVB_ERRORS&&n&&n.report(e,t)}},t}));function A(e){let t,n,r,i,o,c;e||={};let l=[],u=E(this.context).getInstance(),d=e.metricsConstants;function f(){var e=l;e.length&&n&&n.report(o,e),l=[]}return t={initialize:function(e,t,l,d){t&&(r=u.validateN(l),n=t,d&&d.length&&(i=d),o=u.reconstructFullMetricName(e,l,d),c=setInterval(f,r))},reset:function(){clearInterval(c),c=null,r=null,i=null,l=[],n=null},handleNewMetric:function(e,t){e===d.HTTP_REQUEST&&(i&&i!==t.type||l.push(t))}},t}A.__dashjs_factory_name=`HttpListHandler`;var j=c.default.getClassFactory(A);function M(){let e,t,n;return e={initialize:function(e,r){t=e,n=r},reset:function(){n=null,t=void 0},handleNewMetric:function(e,r){e===t&&n&&n.report(t,r)}},e}M.__dashjs_factory_name=`GenericMetricHandler`;var N=c.default.getClassFactory(M);function P(e){let t,n=(e||={}).debug?e.debug.getLogger(t):{},r=/([a-zA-Z]*)(\(([0-9]*)(\,\s*([a-zA-Z]*))?\))?/,i=this.context,o={BufferLevel:O,DVBErrors:k,HttpList:j,PlayList:N,RepSwitchList:N,TcpList:N};return t={create:function(t,c){var l,u=t.match(r);if(u){try{(l=o[u[1]](i).create({eventBus:e.eventBus,metricsConstants:e.metricsConstants})).initialize(u[1],c,u[3],u[5])}catch(e){l=null,n.error(`MetricsHandlerFactory: Could not create handler for type ${u[1]} with args ${u[3]}, ${u[5]} (${e.message})`)}return l}},register:function(e,t){o[e]=t},unregister:function(e){delete o[e]}},t}P.__dashjs_factory_name=`MetricsHandlerFactory`;var F=c.default.getSingletonFactory(P);function I(e){e||={};let t,n=[],r=this.context,i=e.eventBus,o=e.events,c=F(r).getInstance({debug:e.debug,eventBus:e.eventBus,metricsConstants:e.metricsConstants});function l(e){n.forEach((t=>{t.handleNewMetric(e.metric,e.value,e.mediaType)}))}return t={initialize:function(e,r){e.split(`,`).forEach(((e,t,i)=>{let o;if(e.indexOf(`(`)!==-1&&e.indexOf(`)`)===-1){let n=i[t+1];n&&n.indexOf(`(`)===-1&&n.indexOf(`)`)!==-1&&(e+=`,`+n,delete i[t+1])}o=c.create(e,r),o&&n.push(o)})),i.on(o.METRIC_ADDED,l,t),i.on(o.METRIC_UPDATED,l,t)},reset:function(){i.off(o.METRIC_ADDED,l,t),i.off(o.METRIC_UPDATED,l,t),n.forEach((e=>e.reset())),n=[]}},t}I.__dashjs_factory_name=`MetricsHandlersController`;var L=c.default.getClassFactory(I);function R(e){let t,n,r,i;e||={};let o=this.context;function c(){t&&t.reset(),n&&n.reset(),r&&r.reset()}return i={initialize:function(i){try{r=p(o).create({mediaElement:e.mediaElement}),r.initialize(i.Range),n=w(o).create({debug:e.debug,metricsConstants:e.metricsConstants,mediaPlayerModel:e.mediaPlayerModel}),n.initialize(i.Reporting,r),t=L(o).create({debug:e.debug,eventBus:e.eventBus,metricsConstants:e.metricsConstants,events:e.events}),t.initialize(i.metrics,n)}catch(e){throw c(),e}},reset:c},i}R.__dashjs_factory_name=`MetricsController`;var z=c.default.getClassFactory(R),B=class{constructor(){this.metrics=``,this.Range=[],this.Reporting=[]}},V=class{constructor(){this.starttime=0,this.duration=1/0,this._useWallClockTime=!1}},H=class{constructor(){this.schemeIdUri=``,this.value=``,this.dvbReportingUrl=``,this.dvbProbability=1e3}};function U(e){let t,n=(e||={}).adapter,r=e.constants;return t={getMetrics:function(e){let t=[];return e&&e.Metrics&&e.Metrics.forEach((i=>{var o=new B,c=n.getIsDynamic(e);i.hasOwnProperty(`metrics`)&&(o.metrics=i.metrics,i.Range&&i.Range.forEach((t=>{var i=new V;i.starttime=function(e,t,i){let o,c,l=0;return t?l=n.getAvailabilityStartTime(e)/1e3:(o=n.getRegularPeriods(e),o.length&&(l=o[0].start)),c=l,i&&i.hasOwnProperty(r.START_TIME)&&(c+=i.starttime),c}(e,c,t),t.hasOwnProperty(`duration`)?i.duration=t.duration:i.duration=n.getDuration(e),i._useWallClockTime=c,o.Range.push(i)})),i.Reporting&&(i.Reporting.forEach((e=>{var t=new H;e.hasOwnProperty(r.SCHEME_ID_URI)&&(t.schemeIdUri=e.schemeIdUri,e.hasOwnProperty(`value`)&&(t.value=e.value),e.hasOwnProperty(r.DVB_REPORTING_URL)&&(t.dvbReportingUrl=e[r.DVB_REPORTING_URL]),e.hasOwnProperty(r.DVB_PROBABILITY)&&(t.dvbProbability=e[r.DVB_PROBABILITY]),o.Reporting.push(t))})),t.push(o)))})),t}},t}U.__dashjs_factory_name=`ManifestParsing`;var W=c.default.getSingletonFactory(U);function G(e){let t;e||={};let n={},r=this.context,i=e.eventBus,c=e.events;function l(t){if(t.error)return;let c=Object.keys(n);W(r).getInstance({adapter:e.adapter,constants:e.constants}).getMetrics(t.manifest).forEach((t=>{let i=JSON.stringify(t);if(n.hasOwnProperty(i))c.splice(i,1);else try{let o=z(r).create(e);o.initialize(t),n[i]=o}catch{}})),c.forEach((e=>{n[e].reset(),delete n[e]})),i.trigger(o.default.METRICS_INITIALISATION_COMPLETE)}function u(){Object.keys(n).forEach((e=>{n[e].reset()})),n={}}return t={reset:function(){i.off(c.MANIFEST_UPDATED,l,t),i.off(c.STREAM_TEARDOWN_COMPLETE,u,t)}},i.on(c.MANIFEST_UPDATED,l,t),i.on(c.STREAM_TEARDOWN_COMPLETE,u,t),t}G.__dashjs_factory_name=`MetricsCollectionController`;var K=c.default.getClassFactory(G);function ee(){let e,t,n=this.context;return e={createMetricsReporting:function(e){return t=u(n).getInstance({eventBus:e.eventBus,dashMetrics:e.dashMetrics,metricsConstants:e.metricsConstants,events:e.events}),t.initialize(),K(n).create(e)},getReportingFactory:function(){return S(n).getInstance()},getMetricsHandlerFactory:function(){return F(n).getInstance()}},e}ee.__dashjs_factory_name=`MetricsReporting`;let q=c.default.getClassFactory(ee);q.events=o.default,c.default.updateClassFactory(ee.__dashjs_factory_name,q);var te=q},913:function(e,t,n){n.r(t);var r=n(7252);class i extends r.default{constructor(){super(),this.METRICS_INITIALISATION_COMPLETE=`internal_metricsReportingInitialized`,this.BECAME_REPORTING_PLAYER=`internal_becameReportingPlayer`,this.CMCD_DATA_GENERATED=`cmcdDataGenerated`}}t.default=new i},1926:function(e,t,n){n.r(t);var r=n(5717),i=n(138),o=n(8261),c=n(656),l=n(5212),u=n(5560);function d(){let e,t,n,i,d,f,p,m,h,g,_,v=this.context,y=(0,o.default)(v).getInstance();function b(){i=[],d=[],f=[],p=[],m=[],_=[],h=null,t=[],g=new Set}function x(e,t){let n=-1;e.some(((e,r)=>{if(e===t)return n=r,!0})),n<0||e.splice(n,1)}function S(e){let t;for(t=0;t<_.length;t++)if(_[t].rulename===e)return t;return-1}function C(e,t){let n=!1;return g.forEach((r=>{r[e]===t&&(n=!0)})),n}function w(e,n){T(e,n);let i=new r.default;i.schemeIdUri=e,i.value=n,t.push(i)}function T(e,n){(0,c.checkParameterType)(e,`string`),(0,c.checkParameterType)(n,`string`),t.forEach((function(r,i){r.schemeIdUri===e&&r.value===n&&t.splice(i,1)}))}return e={addAbrCustomRule:function(e,t,n){if(typeof e!=`string`||e!==l.default.RULES_TYPES.ABANDON_FRAGMENT_RULES&&e!==l.default.RULES_TYPES.QUALITY_SWITCH_RULES||typeof t!=`string`)throw l.default.BAD_ARGUMENT_ERROR;let r=S(t);r===-1?_.push({type:e,rulename:t,rule:n}):(_[r].type=e,_[r].rule=n)},addExternalSubtitle:function(e){if(!(e&&e.id!==void 0&&e.url&&e.language&&e.mimeType&&e.bandwidth!==void 0))return;let t=new u.default(e);C(`url`,t.url)||C(`id`,t.id)||g.add(t)},addRequestInterceptor:function(e){i.push(e)},addResponseInterceptor:function(e){d.push(e)},addUTCTimingSource:w,clearDefaultUTCTimingSources:function(){t=[]},getAbrCustomRules:function(){return _},getCustomCapabilitiesFilters:function(){return m},getCustomInitialTrackSelectionFunction:function(){return h},getExternalSubtitles:function(){return g},getLicenseRequestFilters:function(){return f},getLicenseResponseFilters:function(){return p},getRequestInterceptors:function(){return i},getResponseInterceptors:function(){return d},getUTCTimingSources:function(){return t},getXHRWithCredentialsForType:function(e){let t=n[e];return t===void 0?n.default:t},registerCustomCapabilitiesFilter:function(e){m.push(e)},registerLicenseRequestFilter:function(e){f.push(e)},registerLicenseResponseFilter:function(e){p.push(e)},removeAbrCustomRule:function(e){if(e){let t=S(e);t!==-1&&_.splice(t,1)}else _=[]},removeAllAbrCustomRule:function(){_=[]},removeExternalSubtitleById:function(e){g.forEach((t=>{t.id===e&&g.delete(t)}))},removeExternalSubtitleByUrl:function(e){g.forEach((t=>{t.url===e&&g.delete(t)}))},removeRequestInterceptor:function(e){x(i,e)},removeResponseInterceptor:function(e){x(d,e)},removeUTCTimingSource:T,reset:function(){b()},resetCustomInitialTrackSelectionFunction:function(){h=null},resetPlaybackSessionSpecificSettings:function(){g=new Set},restoreDefaultUTCTimingSources:function(){let e=y.get().streaming.utcSynchronization.defaultTimingSource;w(e.scheme,e.value)},setConfig:function(){},setCustomInitialTrackSelectionFunction:function(e){h=e},setXHRWithCredentialsForType:function e(t,r){t?n[t]=!!r:Object.keys(n).forEach((t=>{e(t,r)}))},unregisterCustomCapabilitiesFilter:function(e){x(m,e)},unregisterLicenseRequestFilter:function(e){x(f,e)},unregisterLicenseResponseFilter:function(e){x(p,e)}},n={default:!1},b(),e}d.__dashjs_factory_name=`CustomParametersModel`,t.default=i.default.getSingletonFactory(d)},3888:function(e,t,n){n.r(t),n.d(t,{default:function(){return xe}});var r=n(8854),i=n(2861);let o={prefixes:[`clearkey`,`dashif`,`ck`]};class c{static findMp4ProtectionElement(e){let t=null;for(let n=0;n<e.length;++n){let o=e[n];o.schemeIdUri&&o.schemeIdUri.toLowerCase()===r.default.MP4_PROTECTION_SCHEME&&o.value&&(o.value.toLowerCase()===i.default.ENCRYPTION_SCHEME_CENC||o.value.toLowerCase()===i.default.ENCRYPTION_SCHEME_CBCS)&&(t=o)}return t}static getPSSHData(e){let t=8,n=new DataView(e),r=n.getUint8(t);return t+=20,r>0&&(t+=4+16*n.getUint32(t)),t+=4,e.slice(t)}static getPSSHForKeySystem(e,t){let n=c.parsePSSHList(t);return e&&n.hasOwnProperty(e.uuid.toLowerCase())?n[e.uuid.toLowerCase()]:null}static parseInitDataFromContentProtection(e,t){return`pssh`in e&&e.pssh?(e.pssh.__text=e.pssh.__text.replace(/\r?\n|\r/g,``).replace(/\s+/g,``),t.decodeArray(e.pssh.__text).buffer):null}static parsePSSHList(e){if(e==null)return[];let t=new DataView(e.buffer||e),n={},r=0;for(;;){let e,i,o,c,l,u,d=r;if(r>=t.buffer.byteLength)break;if(e=t.getUint32(r),i=r+e,r+=4,t.getUint32(r)===1886614376)if(r+=4,o=t.getUint8(r),o===0||o===1){for(r++,r+=3,c=``,l=0;l<4;l++)u=t.getUint8(r+l).toString(16),c+=u.length===1?`0`+u:u;for(r+=4,c+=`-`,l=0;l<2;l++)u=t.getUint8(r+l).toString(16),c+=u.length===1?`0`+u:u;for(r+=2,c+=`-`,l=0;l<2;l++)u=t.getUint8(r+l).toString(16),c+=u.length===1?`0`+u:u;for(r+=2,c+=`-`,l=0;l<2;l++)u=t.getUint8(r+l).toString(16),c+=u.length===1?`0`+u:u;for(r+=2,c+=`-`,l=0;l<6;l++)u=t.getUint8(r+l).toString(16),c+=u.length===1?`0`+u:u;r+=6,c=c.toLowerCase(),r+=4,n[c]=t.buffer.slice(d,i),r=i}else r=i;else r=i}return n}static getLicenseServerUrlFromMediaInfo(e,t){try{if(!e||e.length===0)return null;let n=0,r=null;for(;n<e.length&&!r;){let i=e[n];if(i&&i.contentProtection&&i.contentProtection.length>0){let e=i.contentProtection.filter((e=>e.schemeIdUri&&e.schemeIdUri===t));if(e&&e.length>0){let t=0;for(;t<e.length&&!r;){let n=e[t];n.laUrl&&n.laUrl.__prefix&&o.prefixes.includes(n.laUrl.__prefix)&&n.laUrl.__text&&(r=n.laUrl.__text),t+=1}}}n+=1}return r}catch{return null}}static hexKidToBufferSource(e){let t=e.replace(/-/g,``);return new Uint8Array(t.match(/[\da-f]{2}/gi).map((function(e){return parseInt(e,16)}))).buffer}}var l=c,u=class{constructor(e,t){this.contentType=e,this.robustness=t}},d=class{constructor(e,t,n,r,o,c){this.initDataTypes=c&&c.length>0?c:[i.default.INITIALIZATION_DATA_TYPE_CENC],e&&e.length&&(this.audioCapabilities=e),t&&t.length&&(this.videoCapabilities=t),this.distinctiveIdentifier=n,this.persistentState=r,this.sessionTypes=o}},f=n(1923),p=n(1944),m=class{constructor(e,t,n,r,i,o,c,l){this.url=e,this.method=t,this.responseType=n,this.headers=r,this.withCredentials=i,this.messageType=o,this.sessionId=c,this.data=l}},h=class{constructor(e,t,n){this.url=e,this.headers=t,this.data=n}},g=n(7568),_=n(7263),v=n(5212),y=n(138);function b(e){let t=(e||={}).BASE64,n=e.cmcdModel,r=e.constants,o=e.customParametersModel,c=e.debug,y=e.eventBus,b=e.events,x=e.protectionKeyController,S=e.settings,C,w,T,E,D,O,k,A,j,M,N,P,F=e.protectionModel,I=[];function L(){if(!(y&&y.hasOwnProperty(`on`)&&x&&x.hasOwnProperty(`getSupportedKeySystemMetadataFromContentProtection`)))throw Error(`Missing config parameter(s)`)}function R(e,n){N||E?N&&z():function(e,n){if(E)return;var r;E=!0;let i=function(e){let t=[];for(let n=0;n<e.length;n++){let r=B(e[n]);t.push({ks:e[n].ks,configs:[r],protData:e[n].protData})}return t}(e=(r=e).sort(((e,t)=>(C&&C[e.ks.systemString]&&C[e.ks.systemString].priority>=0?C[e.ks.systemString].priority:r.length)-(C&&C[t.ks.systemString]&&C[t.ks.systemString].priority>=0?C[t.ks.systemString].priority:r.length)))),o;F.requestKeySystemAccess(i).then((e=>(o=e.data,function(e){let t=e&&e.selectedSystemString?e.selectedSystemString:e.keySystem.systemString;return k.info(`DRM: KeySystem Access Granted for system string (`+t+`)! Selecting key system...`),F.selectKeySystem(e)}(o)))).then((e=>{(function(e,n){try{N=e,E=!1,y.trigger(b.KEY_SYSTEM_SELECTED,{data:n});let r=U(N);r&&r.serverCertificate&&r.serverCertificate.length>0&&F.setServerCertificate(t.decodeArray(r.serverCertificate).buffer),z()}catch(e){k.error(e)}})(e,o)})).catch((e=>{(function(e,t){N=null,E=!1,t||y.trigger(b.KEY_SYSTEM_SELECTED,{data:null,error:new p.default(f.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,f.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+`Error selecting key system! -- `+e.error)})})(e,n)}))}(e,n)}function z(){let e;for(let n=0;n<j.length;n++)for(e=0;e<j[n].length;e++)if(N===j[n][e].ks){t=j[n][e],x.isClearKey(N)&&function(e){if(e.protData&&e.protData.hasOwnProperty(`clearkeys`)&&Object.keys(e.protData.clearkeys).length!==0){let t={kids:Object.keys(e.protData.clearkeys)};e.initData=new TextEncoder().encode(JSON.stringify(t))}}(t),t.sessionId?V(t):t.initData!==null&&H(t);break}var t;j=[]}function B(e){let t=e.protData,n=[],o=[],c=t&&t.initDataTypes&&t.initDataTypes.length>0?t.initDataTypes:[i.default.INITIALIZATION_DATA_TYPE_CENC],l=t&&t.audioRobustness&&t.audioRobustness.length>0?t.audioRobustness:M,f=t&&t.videoRobustness&&t.videoRobustness.length>0?t.videoRobustness:M,p=e.sessionType,m=t&&t.distinctiveIdentifier?t.distinctiveIdentifier:`optional`,h=t&&t.persistentState?t.persistentState:p===`temporary`?`optional`:`required`;return A.forEach((e=>{e.type===r.AUDIO?n.push(new u(e.codec,l)):e.type===r.VIDEO&&o.push(new u(e.codec,f))})),new d(n,o,m,h,[p],c)}function V(e){L(),F.loadKeySession(e)}function H(e){if(e&&function(e){if(!e)return!1;try{let t=F.getSessionTokens();for(let n=0;n<t.length;n++)if(t[n].getKeyId()===e)return!0;return!1}catch{return!1}}(e.keyId))return;(function(){if(!S)return;let e=S.get().streaming.protection.keepProtectionMediaKeys,t=S.get().streaming.protection.keepProtectionMediaKeysMaximumOpenSessions;if(typeof t!=`number`||t<=0)return;if(!e)return void k.warn(`DRM: keepProtectionMediaKeysMaximumOpenSessions is set to `+t+`, but keepProtectionMediaKeys is not enabled. Therefore, keepProtectionMediaKeysMaximumOpenSessions will be ignored.`);if(!F||typeof F.getSessionTokens!=`function`)return;let n=F.getSessionTokens()||[];if(n.length<t)return;let r=n[0];r&&(k.info(`DRM: Maximum number of open MediaKeySessions reached (`+t+`), closing oldest session.`),G(r))})();let t=l.getPSSHForKeySystem(N,e?e.initData:null);if(t){if(W(t))return;try{e.initData=t,F.createKeySession(e)}catch(e){y.trigger(b.KEY_SESSION_CREATED,{data:null,error:new p.default(f.default.KEY_SESSION_CREATED_ERROR_CODE,f.default.KEY_SESSION_CREATED_ERROR_MESSAGE+e.message)})}}else e&&e.initData?F.createKeySession(e):y.trigger(b.KEY_SESSION_CREATED,{data:null,error:new p.default(f.default.KEY_SESSION_CREATED_ERROR_CODE,f.default.KEY_SESSION_CREATED_ERROR_MESSAGE+`Selected key system is `+(N?N.systemString:null)+`. needkey/encrypted event contains no initData corresponding to that key system!`)})}function U(e){if(e){let t=e.systemString;if(C)return t in C?C[t]:null}return null}function W(e){if(!e)return!1;try{let t=F.getAllInitData();for(let n=0;n<t.length;n++)if(x.initDataEquals(e,t[n]))return k.debug(`DRM: Ignoring initData because we have already seen it!`),!0;return!1}catch{return!1}}function G(e){L(),F.closeKeySession(e)}function K(e){L(),e?(F.setMediaElement(e),y.on(b.NEED_KEY,ae,w)):e===null&&(F.setMediaElement(e),y.off(b.NEED_KEY,ae,w))}function ee(e){k.debug(`DRM: onKeyMessage`);let t=e.data;y.trigger(b.KEY_MESSAGE,{data:t});let n=t.messageType?t.messageType:i.default.MEDIA_KEY_MESSAGE_TYPES.LICENSE_REQUEST,r=t.message,c=t.sessionToken,u=U(N),d=x.getLicenseServerModelInstance(N,u,n),v={sessionToken:c,messageType:n};if(r&&r.byteLength!==0){if(!d)return k.debug(`DRM: License server request not required for this message (type = `+e.data.messageType+`). Session ID = `+c.getSessionId()),void q(v);if(x.isClearKey(N)){let e=x.processClearKeyLicenseRequest(N,u,r);if(e&&e.keyPairs&&e.keyPairs.length>0)return k.debug(`DRM: ClearKey license request handled by application!`),q(v),void F.updateKeySession(c,e)}(function(e,t,n){let r=e.sessionToken,c=e.messageType?e.messageType:i.default.MEDIA_KEY_MESSAGE_TYPES.LICENSE_REQUEST,u={sessionToken:r,messageType:c},d=N?N.systemString:null,v=function(e,t,n,r,i){let o=null,c=r.message;if(e&&e.serverURL){let n=e.serverURL;typeof n==`string`&&n!==``?o=n:typeof n==`object`&&n.hasOwnProperty(t)&&(o=n[t])}else if(e&&e.laURL&&e.laURL!==``)o=e.laURL;else if(o=l.getLicenseServerUrlFromMediaInfo(A,N.schemeIdURI),!o&&!x.isClearKey(N)){let e=l.getPSSHData(n.initData);o=N.getLicenseServerURLFromInitData(e),o||=r.laURL}return o=i.getServerURLFromMessage(o,c,t),o}(n,c,r,e,t);if(!v)return void q(u,new p.default(f.default.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE,f.default.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE));let y={},b=!1;n&&re(y,n.httpRequestHeaders);let C=e.message;re(y,N.getRequestHeadersFromMessage(C)),Object.keys(y).forEach((e=>{e.toLowerCase()===`authorization`&&(b=!0)})),n&&typeof n.withCredentials==`boolean`&&(b=n.withCredentials);let w=function(e){if(F)if(e.status>=200&&e.status<=299){let n=_.default.parseHttpHeaders(e.getAllResponseHeaders?e.getAllResponseHeaders():null),i=new h(e.responseURL,n,e.response);J(o.getLicenseResponseFilters(),i).then((()=>{let n=t.getLicenseMessage(i.data,d,c);n===null?ie(e,u,d,c,t):(q(u),F.updateKeySession(r,n))}))}else ie(e,u,d,c,t)},T=function(e){q(u,new p.default(f.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,f.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+d+` update, XHR aborted. status is "`+e.statusText+`" (`+e.status+`), readyState is `+e.readyState))},E=function(e){q(u,new p.default(f.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,f.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+d+` update, XHR error. status is "`+e.statusText+`" (`+e.status+`), readyState is `+e.readyState))},D=N.getLicenseRequestFromMessage(C),O=t.getHTTPMethod(c),k=t.getResponseType(d,c),j=n&&!isNaN(n.httpTimeout)?n.httpTimeout:8e3,M=r.getSessionId()||null,P=new m(v,O,k,y,b,c,M,D),I=isNaN(S.get().streaming.retryAttempts[g.HTTPRequest.LICENSE])?3:S.get().streaming.retryAttempts[g.HTTPRequest.LICENSE];J(o.getLicenseRequestFilters(),P).then((()=>{te(P,I,j,w,T,E)}))})(t,d,u)}else q(v,new p.default(f.default.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE,f.default.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE))}function q(e,t=null){y.trigger(b.LICENSE_REQUEST_COMPLETE,{data:e,error:t})}function te(e,t,r,i,o,c){let l=new XMLHttpRequest,u=n.getCmcdParametersFromManifest();if(n.isCmcdEnabled()&&(u.mode?u.mode:S.get().streaming.cmcd.mode)===v.default.CMCD_MODE_QUERY){let t=n.getQueryParameter({url:e.url,type:g.HTTPRequest.LICENSE});t&&(e.url=_.default.addAdditionalQueryParameterToUrl(e.url,[t]))}l.open(e.method,e.url,!0),l.responseType=e.responseType,l.withCredentials=e.withCredentials,r>0&&(l.timeout=r);for(let t in e.headers)l.setRequestHeader(t,e.headers[t]);if(n.isCmcdEnabled()&&(u.mode?u.mode:S.get().streaming.cmcd.mode)===v.default.CMCD_MODE_HEADER){let t=n.getHeaderParameters({url:e.url,type:g.HTTPRequest.LICENSE});if(t)for(let e in t){let n=t[e];n&&l.setRequestHeader(e,n)}}let d=function(){t--;let n=isNaN(S.get().streaming.retryIntervals[g.HTTPRequest.LICENSE])?1e3:S.get().streaming.retryIntervals[g.HTTPRequest.LICENSE];D=setTimeout((function(){te(e,t,r,i,o,c)}),n)};l.onload=function(){O=null,this.status>=200&&this.status<=299||t<=0?i(this):(k.warn(`License request failed (`+this.status+`). Retrying it... Pending retries: `+t),d())},l.ontimeout=l.onerror=function(){O=null,t<=0?c(this):(k.warn(`License request network request failed . Retrying it... Pending retries: `+t),d())},l.onabort=function(){o(this)},y.trigger(b.LICENSE_REQUEST_SENDING,{url:e.url,headers:e.headers,payload:e.data,sessionId:e.sessionId}),O=l,l.send(e.data)}function ne(){O&&=(O.onloadend=O.onerror=O.onprogress=void 0,O.abort(),null),D&&=(clearTimeout(D),null)}function re(e,t){if(t)for(let n in t)e[n]=t[n]}function ie(e,t,n,r,i){let o=`NONE`,c=null;e.response&&(o=i.getErrorResponse(e.response,n,r),c={serverResponse:e.response||null,responseCode:e.status||null,responseText:e.statusText||null}),q(t,new p.default(f.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,f.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+n+` update, XHR complete. status is "`+e.statusText+`" (`+e.status+`), readyState is `+e.readyState+`. Response is `+o,c))}function J(e,t){return e?e.reduce(((e,n)=>e.then((()=>n(t)))),Promise.resolve()):Promise.resolve()}function ae(e,t){if(S.get().streaming.protection.ignoreEmeEncryptedEvent)return;if(k.debug(`DRM: onNeedKey`),e.key.initDataType!==i.default.INITIALIZATION_DATA_TYPE_CENC)return void k.warn(`DRM: Only 'cenc' initData is supported! Ignoring initData of type: `+e.key.initDataType);if(A.length===0&&(k.warn(`DRM: onNeedKey called before initializeForMedia, wait until initialized`),(t=t===void 0?1:t+1)<5))return void I.push(setTimeout((()=>{ae(e,t)}),500));let n=e.key.initData;if(ArrayBuffer.isView(n)&&(n=n.buffer),N){let e=l.getPSSHForKeySystem(N,n);if(e&&W(e))return}k.debug(`DRM: initData:`,String.fromCharCode.apply(null,new Uint8Array(n)));let r=x.getSupportedKeySystemMetadataFromSegmentPssh(n,C,P);r.length===0?k.debug(`DRM: Received needkey event with initData, but we don't support any of the key systems!`):function(e){j.push(e),R(e,!1)}(r)}function oe(e,t){if(e.size<=0)return!1;if(t.size>0&&[...e].every((e=>{let n=t.get(e);return n!==void 0&&n!==``})))return!0;let n=F.getSessionTokens();if(n&&n.length>0){let t=n.filter((t=>[...e].includes(t.normalizedKeyId)));if(t.some((e=>!e.hasTriggeredKeyStatusMapUpdate))||t.length===0)return!1}return!S.get().streaming.protection.ignoreKeyStatuses&&e&&e.size>0&&t&&t.size>0}return w={areKeyIdsExpired:function(e){try{return!!oe(e,T)&&[...e].every((e=>T.get(e)===i.default.MEDIA_KEY_STATUSES.EXPIRED))}catch(e){return k.error(e),!1}},areKeyIdsUsable:function(e){try{return!oe(e,T)||[...e].some((e=>{let t=T.get(e);return t&&t!==i.default.MEDIA_KEY_STATUSES.INTERNAL_ERROR&&t!==i.default.MEDIA_KEY_STATUSES.OUTPUT_RESTRICTED}))}catch(e){return k.error(e),!0}},clearMediaInfoArray:function(){A=[]},closeKeySession:G,createKeySession:H,getKeySystems:function(){return x?x.getKeySystems():[]},getSupportedKeySystemMetadataFromContentProtection:function(e){return L(),x.getSupportedKeySystemMetadataFromContentProtection(e,C,P)},handleKeySystemFromManifest:function(){if(!A||A.length===0)return;let e=[];A.forEach((t=>{let n=x.getSupportedKeySystemMetadataFromContentProtection(t.contentProtection,C,P);n.length>0&&(e.length===0&&(e=n),j.push(n))})),e&&e.length>0&&R(e,!0)},initializeForMedia:function(e){if(!e)throw Error(`mediaInfo can not be null or undefined`);L(),A.push(e)},loadKeySession:V,removeKeySession:function(e){L(),F.removeKeySession(e)},reset:function(){y.off(b.INTERNAL_KEY_MESSAGE,ee,w),L(),ne(),K(null),N=null,E=!1,T=new Map,F&&=(F.reset(),null),I.forEach((e=>clearTimeout(e))),I=[],A=[],j=[]},setKeySystems:function(e){x&&x.setKeySystems(e)},setMediaElement:K,setProtectionData:function(e){C=e,x.setProtectionData(e)},setRobustnessLevel:function(e){M=e},setServerCertificate:function(e){return L(),F.setServerCertificate(e)},setSessionType:function(e){P=e},stop:function(){ne(),F&&F.stop()},updateKeyStatusesMap:function(e){try{if(!e||!e.sessionToken||!e.parsedKeyStatuses)return;e.sessionToken.hasTriggeredKeyStatusMapUpdate=!0;let t=e.parsedKeyStatuses,n=_.default.parseUserAgent(),r=n&&n.browser&&n.browser.name&&n.browser.name.toLowerCase()===`edge`;t.forEach((e=>{r&&N.uuid===i.default.PLAYREADY_UUID&&e.keyId&&e.keyId.byteLength===16&&function(e){let t=_.default.bufferSourceToDataView(e),n=t.getUint32(0,!0),r=t.getUint16(4,!0),i=t.getUint16(6,!0);t.setUint32(0,n,!1),t.setUint16(4,r,!1),t.setUint16(6,i,!1)}(e.keyId);let t=_.default.bufferSourceToHex(e.keyId).slice(0,32);t&&t!==``&&T.set(t,e.status)})),y.trigger(b.KEY_STATUSES_MAP_UPDATED,{keyStatusMap:T})}catch(e){k.error(e)}}},k=c.getLogger(w),j=[],A=[],P=`temporary`,M=``,O=null,D=null,T=new Map,y.on(b.INTERNAL_KEY_MESSAGE,ee,w),w}b.__dashjs_factory_name=`ProtectionController`;var x=y.default.getClassFactory(b),S=class{constructor(e,t){this.keyID=e,this.key=t}},C=class{constructor(e,t){if(t&&t!==`persistent`&&t!==`temporary`)throw Error(`Invalid ClearKey key set type! Must be one of 'persistent' or 'temporary'`);this.keyPairs=e,this.type=t}toJWK(){let e,t=this.keyPairs.length,n={keys:[]};for(e=0;e<t;e++){let t={kty:`oct`,alg:`A128KW`,kid:this.keyPairs[e].keyID,k:this.keyPairs[e].key};n.keys.push(t)}this.type&&(n.type=this.type);let r=JSON.stringify(n),i=r.length,o=new ArrayBuffer(i),c=new Uint8Array(o);for(e=0;e<i;e++)c[e]=r.charCodeAt(e);return o}};let w=i.default.CLEARKEY_UUID,T=i.default.CLEARKEY_KEYSTEM_STRING,E=`urn:uuid:`+w;function D(e){let t,n=(e||={}).BASE64;return t={uuid:w,schemeIdURI:E,systemString:T,getInitData:function(e,t){try{let r=l.parseInitDataFromContentProtection(e,n);if(!r&&t){let e={kids:[function(e){try{let t=e.replace(/-/g,``);return t=btoa(t.match(/\w{2}/g).map((e=>String.fromCharCode(parseInt(e,16)))).join(``)),t.replace(/=/g,``).replace(/\//g,`_`).replace(/\+/g,`-`)}catch{return null}}(t.cencDefaultKid)]};r=new TextEncoder().encode(JSON.stringify(e))}return r}catch{return null}},getRequestHeadersFromMessage:function(){return{"Content-Type":`application/json`}},getLicenseRequestFromMessage:function(e){return JSON.stringify(JSON.parse(String.fromCharCode.apply(null,new Uint8Array(e))))},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(e,t){let n=null;if(e){let r=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),i=[];for(let t=0;t<r.kids.length;t++){let n=r.kids[t],o=e.clearkeys&&e.clearkeys.hasOwnProperty(n)?e.clearkeys[n]:null;if(!o)throw Error(`DRM: ClearKey keyID (`+n+`) is not known!`);i.push(new S(n,o))}n=new C(i)}return n}},t}D.__dashjs_factory_name=`KeySystemClearKey`;var O=y.default.getSingletonFactory(D);let k=i.default.W3C_CLEARKEY_UUID,A=i.default.CLEARKEY_KEYSTEM_STRING,j=`urn:uuid:`+k;function M(e){let t,n=e.BASE64,r=e.debug.getLogger(t);return t={uuid:k,schemeIdURI:j,systemString:A,getInitData:function(e){return l.parseInitDataFromContentProtection(e,n)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(e,t){let n=null;if(e){let i=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),o=[];for(let t=0;t<i.kids.length;t++){let n=i.kids[t],r=e.clearkeys&&e.clearkeys.hasOwnProperty(n)?e.clearkeys[n]:null;if(!r)throw Error(`DRM: ClearKey keyID (`+n+`) is not known!`);o.push(new S(n,r))}n=new C(o),r.warn(`ClearKey schemeIdURI is using W3C Common PSSH systemID (1077efec-c0b2-4d02-ace3-3c1e52e2fb4b) in Content Protection. See DASH-IF IOP v4.1 section 7.6.2.4`)}return n}},t}M.__dashjs_factory_name=`KeySystemW3CClearKey`;var N=y.default.getSingletonFactory(M);let P=i.default.WIDEVINE_UUID,F=i.default.WIDEVINE_KEYSTEM_STRING,I=`urn:uuid:`+P;function L(e){let t,n=(e||={}).BASE64;return t={uuid:P,schemeIdURI:I,systemString:F,getInitData:function(e){return l.parseInitDataFromContentProtection(e,n)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null}},t}L.__dashjs_factory_name=`KeySystemWidevine`;var R=y.default.getSingletonFactory(L);let z=i.default.PLAYREADY_UUID,B=i.default.PLAYREADY_KEYSTEM_STRING,V=`urn:uuid:`+z;function H(e){let t,n=`utf-16`,r=(e||={}).BASE64,i=e.settings;function o(){if(!r||!r.hasOwnProperty(`decodeArray`)||!r.hasOwnProperty(`decodeArray`))throw Error(`Missing config parameter(s)`)}return t={uuid:z,schemeIdURI:V,systemString:B,getInitData:function(e){let t=new Uint8Array([112,115,115,104,0,0,0,0]),n=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]),i,c,u,d,f,p=0,m=null;if(o(),!e)return null;if(`pssh`in e&&e.pssh)return l.parseInitDataFromContentProtection(e,r);if(`pro`in e&&e.pro)m=r.decodeArray(e.pro.__text);else{if(!(`prheader`in e)||!e.prheader)return null;m=r.decodeArray(e.prheader.__text)}return i=m.length,c=4+t.length+n.length+4+i,u=new ArrayBuffer(c),d=new Uint8Array(u),f=new DataView(u),f.setUint32(p,c),p+=4,d.set(t,p),p+=t.length,d.set(n,p),p+=n.length,f.setUint32(p,i),p+=4,d.set(m,p),p+=i,d.buffer},getRequestHeadersFromMessage:function(e){let t,r,o={},c=new DOMParser;if(i&&i.get().streaming.protection.detectPlayreadyMessageFormat&&n===`utf-16`&&e&&e.byteLength%2==1)return o[`Content-Type`]=`text/xml; charset=utf-8`,o;let l=n===`utf-16`?new Uint16Array(e):new Uint8Array(e);t=String.fromCharCode.apply(null,l),r=c.parseFromString(t,`application/xml`);let u=r.getElementsByTagName(`name`),d=r.getElementsByTagName(`value`);for(let e=0;e<u.length;e++)o[u[e].childNodes[0].nodeValue]=d[e].childNodes[0].nodeValue;return o.hasOwnProperty(`Content`)&&(o[`Content-Type`]=o.Content,delete o.Content),o.hasOwnProperty(`Content-Type`)||(o[`Content-Type`]=`text/xml; charset=utf-8`),o},getLicenseRequestFromMessage:function(e){let t=null,c=new DOMParser;if(i&&i.get().streaming.protection.detectPlayreadyMessageFormat&&n===`utf-16`&&e&&e.byteLength%2==1)return e;let l=n===`utf-16`?new Uint16Array(e):new Uint8Array(e);o();let u=String.fromCharCode.apply(null,l),d=c.parseFromString(u,`application/xml`);if(!d.getElementsByTagName(`PlayReadyKeyMessage`)[0])return e;{let e=d.getElementsByTagName(`Challenge`)[0].childNodes[0].nodeValue;e&&(t=r.decode(e))}return t},getLicenseServerURLFromInitData:function(e){if(e){let t=new DataView(e),n=t.getUint16(4,!0),r=6,i=new DOMParser;for(let o=0;o<n;o++){let n=t.getUint16(r,!0);r+=2;let o=t.getUint16(r,!0);if(r+=2,n!==1){r+=o;continue}let c=e.slice(r,r+o),l=String.fromCharCode.apply(null,new Uint16Array(c)),u=i.parseFromString(l,`application/xml`);if(u.getElementsByTagName(`LA_URL`)[0]){let e=u.getElementsByTagName(`LA_URL`)[0].childNodes[0].nodeValue;if(e)return e}if(u.getElementsByTagName(`LUI_URL`)[0]){let e=u.getElementsByTagName(`LUI_URL`)[0].childNodes[0].nodeValue;if(e)return e}}}return null},getCDMData:function(e){let t,n,i,c;if(o(),!e)return null;for(t=[],c=0;c<e.length;++c)t.push(e.charCodeAt(c)),t.push(0);for(t=String.fromCharCode.apply(null,t),t=r.encode(t),n=`<PlayReadyCDMData type="LicenseAcquisition"><LicenseAcquisition version="1.0" Proactive="false"><CustomData encoding="base64encoded">%CUSTOMDATA%</CustomData></LicenseAcquisition></PlayReadyCDMData>`.replace(`%CUSTOMDATA%`,t),i=[],c=0;c<n.length;++c)i.push(n.charCodeAt(c)),i.push(0);return new Uint8Array(i).buffer},setPlayReadyMessageFormat:function(e){if(e!==`utf-8`&&e!==`utf-16`)throw Error(`Specified message format is not one of "utf-8" or "utf-16"`);n=e}},t}H.__dashjs_factory_name=`KeySystemPlayReady`;var U=y.default.getSingletonFactory(H);function W(e){let t=(e||={}).BASE64,n={},r;return n[i.default.WIDEVINE_KEYSTEM_STRING]={responseType:`json`,getLicenseMessage:function(e){return t.decodeArray(e.license)},getErrorResponse:function(e){return e}},n[i.default.PLAYREADY_KEYSTEM_STRING]={responseType:`arraybuffer`,getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}},r={getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return`POST`},getResponseType:function(e){return n[e].responseType},getLicenseMessage:function(e,r){return function(){if(!t||!t.hasOwnProperty(`decodeArray`))throw Error(`Missing config parameter(s)`)}(),n[r].getLicenseMessage(e)},getErrorResponse:function(e,t){return n[t].getErrorResponse(e)}},r}W.__dashjs_factory_name=`DRMToday`;var G=y.default.getSingletonFactory(W);function K(){let e,t=`http://schemas.xmlsoap.org/soap/envelope/`;function n(e){let t=String.fromCharCode.apply(null,new Uint8Array(e));return decodeURIComponent(escape(t))}function r(e){if(window.DOMParser){let r=n(e),i=new window.DOMParser().parseFromString(r,`text/xml`),o=i?i.getElementsByTagNameNS(t,`Envelope`)[0]:null,c=o?o.getElementsByTagNameNS(t,`Body`)[0]:null;if(c&&c.getElementsByTagNameNS(t,`Fault`)[0])return null}return e}function i(e){let r=``,i=``,o=``,c=-1,l=-1;if(window.DOMParser){let u=n(e),d=new window.DOMParser().parseFromString(u,`text/xml`),f=d?d.getElementsByTagNameNS(t,`Envelope`)[0]:null,p=f?f.getElementsByTagNameNS(t,`Body`)[0]:null,m=p?p.getElementsByTagNameNS(t,`Fault`)[0]:null,h=m?m.getElementsByTagName(`detail`)[0]:null,g=h?h.getElementsByTagName(`Exception`)[0]:null,_=null;if(m===null)return u;_=m.getElementsByTagName(`faultstring`)[0].firstChild,r=_?_.nodeValue:null,g!==null&&(_=g.getElementsByTagName(`StatusCode`)[0],i=_?_.firstChild.nodeValue:null,_=g.getElementsByTagName(`Message`)[0],o=_?_.firstChild.nodeValue:null,c=o?o.lastIndexOf(`[`)+1:-1,l=o?o.indexOf(`]`):-1,o=o?o.substring(c,l):``)}let u=`code: ${i}, name: ${r}`;return o&&(u+=`, message: ${o}`),u}return e={getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return`POST`},getResponseType:function(){return`arraybuffer`},getLicenseMessage:function(e){return r.call(this,e)},getErrorResponse:function(e){return i.call(this,e)}},e}K.__dashjs_factory_name=`PlayReady`;var ee=y.default.getSingletonFactory(K);function q(){let e;return e={getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return`POST`},getResponseType:function(){return`arraybuffer`},getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}},e}q.__dashjs_factory_name=`Widevine`;var te=y.default.getSingletonFactory(q);function ne(){let e;return e={getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return`POST`},getResponseType:function(){return`json`},getLicenseMessage:function(e){if(!e.hasOwnProperty(`keys`))return null;let t=[];for(let n=0;n<e.keys.length;n++){let r=e.keys[n],i=r.kid.replace(/=/g,``),o=r.k.replace(/=/g,``);t.push(new S(i,o))}return new C(t)},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}},e}ne.__dashjs_factory_name=`ClearKey`;var re=y.default.getSingletonFactory(ne),ie=class{constructor(e){this.ks=e.ks,this.keyId=e.keyId,this.initData=e.initData,this.protData=e.protData,this.cdmData=e.cdmData,this.sessionId=e.sessionId,this.sessionType=e.sessionType}};function J(){let e,t,n,r,o,c,u,d,f=this.context;function p(e,t){return t&&e in t?t[e]:null}function m(e,t){return e&&e.sessionId?e.sessionId:t&&t.sessionId?t.sessionId:null}function h(e,t){return e&&e.sessionType?e.sessionType:t}return e={getKeySystemBySystemString:function(e){for(let t=0;t<r.length;t++)if(r[t].systemString===e)return r[t];return null},getKeySystems:function(){return r},getLicenseServerModelInstance:function(e,t,n){if(n===i.default.MEDIA_KEY_MESSAGE_TYPES.LICENSE_RELEASE||n===i.default.MEDIA_KEY_MESSAGE_TYPES.INDIVIDUALIZATION_REQUEST)return null;let r=null;return t&&t.hasOwnProperty(`drmtoday`)?r=G(f).getInstance({BASE64:o}):e.systemString===i.default.WIDEVINE_KEYSTEM_STRING?r=te(f).getInstance():e.systemString===i.default.PLAYREADY_KEYSTEM_STRING?r=ee(f).getInstance():e.systemString===i.default.CLEARKEY_KEYSTEM_STRING&&(r=re(f).getInstance()),r},getSupportedKeySystemMetadataFromContentProtection:function(e,t,n){let i,o,c,u,d=[];if(!e||!e.length)return d;let f=l.findMp4ProtectionElement(e);for(c=0;c<r.length;c++){o=r[c];let l=p(o.systemString,t);for(u=0;u<e.length;u++)if(i=e[u],i.schemeIdUri.toLowerCase()===o.schemeIdURI){let e=o.getInitData(i,f),t=new ie({ks:r[c],keyId:i.keyId,initData:e,protData:l,cdmData:o.getCDMData(l?l.cdmData:null),sessionId:m(l,i),sessionType:h(l,n)});l?d.unshift(t):d.push(t)}}return d},getSupportedKeySystemMetadataFromSegmentPssh:function(e,t,n){let i,o,c=[],u=l.parsePSSHList(e);for(let e=0;e<r.length;++e){i=r[e],o=i.systemString;let l=p(o,t);i.uuid in u&&c.push({ks:i,initData:u[i.uuid],protData:l,cdmData:i.getCDMData(l?l.cdmData:null),sessionId:m(l),sessionType:h(l,n)})}return c},initDataEquals:function(e,t){if(e.byteLength===t.byteLength){let n=new Uint8Array(e),r=new Uint8Array(t);for(let e=0;e<n.length;e++)if(n[e]!==r[e])return!1;return!0}return!1},initialize:function(){let e;r=[],e=U(f).getInstance({BASE64:o,settings:c}),r.push(e),e=R(f).getInstance({BASE64:o}),r.push(e),e=O(f).getInstance({BASE64:o}),r.push(e),u=e,e=N(f).getInstance({BASE64:o,debug:t}),r.push(e),d=e},isClearKey:function(e){return e===u||e===d},processClearKeyLicenseRequest:function(e,t,r){try{return e.getClearKeysFromProtectionData(t,r)}catch{return n.error(`Failed to retrieve clearkeys from ProtectionData`),null}},setConfig:function(r){r&&(r.debug&&(t=r.debug,n=t.getLogger(e)),r.BASE64&&(o=r.BASE64),r.settings&&(c=r.settings))},setKeySystems:function(e){r=e},setProtectionData:function(e){for(var t,n,i=0;i<r.length;i++){var o=r[i];o.hasOwnProperty(`init`)&&o.init((t=o.systemString,n=void 0,n=null,e&&(n=t in e?e[t]:null),n))}}},e}J.__dashjs_factory_name=`ProtectionKeyController`;var ae=y.default.getSingletonFactory(J),oe=n(445),se=class{constructor(e,t){this.initData=e,this.initDataType=t}},ce=class{constructor(e,t,n,r){this.sessionToken=e,this.message=t,this.defaultURL=n,this.messageType=r||i.default.MEDIA_KEY_MESSAGE_TYPES.LICENSE_REQUEST}},le=class{constructor(e,t){this.keySystem=e,this.ksConfiguration=t,this.nativeMediaKeySystemAccessObject=null,this.selectedSystemString=null}};let ue={};function de(e){e||={};let t=this.context,n=e.eventBus,r=e.events,o=e.debug,c,l,u,d,m,h,g,_;function v(e,t,i,o){if(navigator.requestMediaKeySystemAccess===void 0||typeof navigator.requestMediaKeySystemAccess!=`function`){let e=`Insecure origins are not allowed`;n.trigger(r.KEY_SYSTEM_ACCESS_COMPLETE,{error:e}),o({error:e});return}let c=e[t].protData&&e[t].protData.systemStringPriority?e[t].protData.systemStringPriority:null,l=e[t].configs,u=e[t].ks,d=u.systemString;(function(e,t){return new Promise(((n,r)=>{y(e,t,0,n,r)}))})(c||(ue[d]?ue[d]:[d]),l).then((e=>{let t=new le(u,e&&e.nativeMediaKeySystemAccessObject&&typeof e.nativeMediaKeySystemAccessObject.getConfiguration==`function`?e.nativeMediaKeySystemAccessObject.getConfiguration():null);t.selectedSystemString=e.selectedSystemString,t.nativeMediaKeySystemAccessObject=e.nativeMediaKeySystemAccessObject,n.trigger(r.KEY_SYSTEM_ACCESS_COMPLETE,{data:t}),i({data:t})})).catch((c=>{if(t+1<e.length)v(e,t+1,i,o);else{let e=`Key system access denied! `;n.trigger(r.KEY_SYSTEM_ACCESS_COMPLETE,{error:e+c.message}),o({error:e+c.message})}}))}function y(e,t,n,r,i){let o=e[n];l.debug(`Requesting key system access for system string ${o}`),navigator.requestMediaKeySystemAccess(o,t).then((e=>{r({nativeMediaKeySystemAccessObject:e,selectedSystemString:o})})).catch((o=>{n+1<e.length?y(e,t,n+1,r,i):i(o)}))}function b(e){if(!e||!e.session)return Promise.resolve;let t=e.session;return t.removeEventListener(`keystatuseschange`,e),t.removeEventListener(`message`,e),t.close()}function x(e){for(let t=0;t<h.length;t++)if(h[t]===e){h.splice(t,1);break}}function S(e,t){let o={session:e,keyId:t.keyId,normalizedKeyId:t&&t.keyId&&typeof t.keyId==`string`?t.keyId.replace(/-/g,``).toLowerCase():``,initData:t.initData,sessionId:t.sessionId,sessionType:t.sessionType,hasTriggeredKeyStatusMapUpdate:!1,handleEvent:function(e){switch(e.type){case`keystatuseschange`:this._onKeyStatusesChange(e);break;case`message`:this._onKeyMessage(e)}},_onKeyStatusesChange:function(e){n.trigger(r.KEY_STATUSES_CHANGED,{data:this});let t=[];e.target.keyStatuses.forEach((function(){t.push(C(arguments))})),n.trigger(r.INTERNAL_KEY_STATUSES_CHANGED,{parsedKeyStatuses:t,sessionToken:o})},_onKeyMessage:function(e){let t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;n.trigger(r.INTERNAL_KEY_MESSAGE,{data:new ce(this,t,void 0,e.messageType)})},getKeyId:function(){return this.keyId},getSessionId:function(){return e.sessionId},getSessionType:function(){return this.sessionType},getExpirationTime:function(){return e.expiration},getKeyStatuses:function(){return e.keyStatuses},getUsable:function(){let t=!1;return e.keyStatuses.forEach((function(){C(arguments).status===i.default.MEDIA_KEY_STATUSES.USABLE&&(t=!0)})),t}};return e.addEventListener(`keystatuseschange`,o),e.addEventListener(`message`,o),e.closed.then((()=>{x(o),l.debug(`DRM: Session closed. SessionID = `+o.getSessionId()),n.trigger(r.KEY_SESSION_CLOSED,{data:o.getSessionId()})})),h.push(o),o}function C(e){let t,n;return e&&e.length>0&&(e[0]&&(typeof e[0]==`string`?t=e[0]:n=e[0]),e[1]&&(typeof e[1]==`string`?t=e[1]:n=e[1])),{status:t,keyId:n}}return c={closeKeySession:function(e){b(e).catch((function(t){x(e),n.trigger(r.KEY_SESSION_CLOSED,{data:null,error:`Error closing session (`+e.getSessionId()+`) `+t.name})}))},createKeySession:function(e){if(!u||!m)throw Error(`Can not create sessions until you have selected a key system`);let t=m.createSession(e.sessionType),o=S(t,e),c=u.systemString===i.default.CLEARKEY_KEYSTEM_STRING&&(e.initData||e.protData&&e.protData.clearkeys)?i.default.INITIALIZATION_DATA_TYPE_KEYIDS:i.default.INITIALIZATION_DATA_TYPE_CENC;t.generateRequest(c,e.initData).then((function(){l.debug(`DRM: Session created. SessionID = `+o.getSessionId()),n.trigger(r.KEY_SESSION_CREATED,{data:o})})).catch((function(e){x(o),n.trigger(r.KEY_SESSION_CREATED,{data:null,error:new p.default(f.default.KEY_SESSION_CREATED_ERROR_CODE,f.default.KEY_SESSION_CREATED_ERROR_MESSAGE+`Error generating key request -- `+e.name)})}))},getAllInitData:function(){let e=[];for(let t=0;t<h.length;t++)h[t].initData&&e.push(h[t].initData);return e},getSessionTokens:function(){return h},loadKeySession:function(e){if(!u||!m)throw Error(`Can not load sessions until you have selected a key system`);let t=e.sessionId;for(let e=0;e<h.length;e++)if(t===h[e].sessionId)return void l.warn(`DRM: Ignoring session ID because we have already seen it!`);let i=m.createSession(e.sessionType),o=S(i,e);o.hasTriggeredKeyStatusMapUpdate=!0,i.load(t).then((function(e){e?(l.debug(`DRM: Session loaded. SessionID = `+o.getSessionId()),n.trigger(r.KEY_SESSION_CREATED,{data:o})):(x(o),n.trigger(r.KEY_SESSION_CREATED,{data:null,error:new p.default(f.default.KEY_SESSION_CREATED_ERROR_CODE,f.default.KEY_SESSION_CREATED_ERROR_MESSAGE+`Could not load session! Invalid Session ID (`+t+`)`)}))})).catch((function(e){x(o),n.trigger(r.KEY_SESSION_CREATED,{data:null,error:new p.default(f.default.KEY_SESSION_CREATED_ERROR_CODE,f.default.KEY_SESSION_CREATED_ERROR_MESSAGE+`Could not load session (`+t+`)! `+e.name)})}))},removeKeySession:function(e){e.session.remove().then((function(){l.debug(`DRM: Session removed. SessionID = `+e.getSessionId()),n.trigger(r.KEY_SESSION_REMOVED,{data:e.getSessionId()})}),(function(t){n.trigger(r.KEY_SESSION_REMOVED,{data:null,error:`Error removing session (`+e.getSessionId()+`). `+t.name})}))},requestKeySystemAccess:function(e){return new Promise(((t,n)=>{v(e,0,t,n)}))},reset:function(){let e=h.length,t;if(e!==0){let i=function(e){x(e),h.length===0&&(d?(d.removeEventListener(`encrypted`,g),d.setMediaKeys(null).then((function(){n.trigger(r.TEARDOWN_COMPLETE)}))):n.trigger(r.TEARDOWN_COMPLETE))};for(let n=0;n<e;n++)t=h[n],function(e){b(t),i(e)}(t)}else n.trigger(r.TEARDOWN_COMPLETE)},selectKeySystem:function(e){return new Promise(((t,n)=>{e.nativeMediaKeySystemAccessObject.createMediaKeys().then((t=>(u=e.keySystem,m=t,d?d.setMediaKeys(m):Promise.resolve()))).then((()=>{t(u)})).catch((function(){n({error:`Error selecting keys system (`+e.keySystem.systemString+`)! Could not create MediaKeys -- TODO`})}))}))},setMediaElement:function(e){d!==e&&(d&&(d.removeEventListener(`encrypted`,g),d.setMediaKeys&&d.setMediaKeys(null)),d=e,d&&(d.addEventListener(`encrypted`,g),d.setMediaKeys&&m&&d.setMediaKeys(m)))},setServerCertificate:function(e){return new Promise((t=>{m.setServerCertificate(e).then((function(){l.info(`DRM: License server certificate successfully updated.`),n.trigger(r.SERVER_CERTIFICATE_UPDATED),t()})).catch((e=>{n.trigger(r.SERVER_CERTIFICATE_UPDATED,{error:new p.default(f.default.SERVER_CERTIFICATE_UPDATED_ERROR_CODE,f.default.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE+e.name)}),t()}))}))},stop:function(){let e;for(let t=0;t<h.length;t++)e=h[t],e.getUsable()||(b(e),x(e))},updateKeySession:function(e,t){let i=e.session;_.isClearKey(u)&&(t=t.toJWK()),i.update(t).then((()=>{n.trigger(r.KEY_SESSION_UPDATED)})).catch((function(t){n.trigger(r.KEY_ERROR,{error:new p.default(f.default.MEDIA_KEYERR_CODE,`Error sending update() message! `+t.name,e)})}))}},l=o.getLogger(c),u=null,d=null,m=null,h=[],_=ae(t).getInstance(),g={handleEvent:function(e){if(e.type===`encrypted`&&e.initData){let t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;n.trigger(r.NEED_KEY,{key:new se(t,e.initDataType)})}}},c}ue[i.default.PLAYREADY_KEYSTEM_STRING]=[i.default.PLAYREADY_KEYSTEM_STRING,i.default.PLAYREADY_RECOMMENDATION_KEYSTEM_STRING],ue[i.default.WIDEVINE_KEYSTEM_STRING]=[i.default.WIDEVINE_KEYSTEM_STRING],ue[i.default.CLEARKEY_KEYSTEM_STRING]=[i.default.CLEARKEY_KEYSTEM_STRING],de.__dashjs_factory_name=`DefaultProtectionModel`;var fe=y.default.getClassFactory(de);function pe(e){e||={};let t=this.context,n=e.eventBus,r=e.events,o=e.debug,c=e.api,l,u,m,h,g,_,v,y,b;function x(){try{for(let e=0;e<v.length;e++)S(v[e]);m&&m.removeEventListener(c.needkey,y),n.trigger(r.TEARDOWN_COMPLETE)}catch(e){n.trigger(r.TEARDOWN_COMPLETE,{error:`Error tearing down key sessions and MediaKeys! -- `+e.message})}}function S(e){let t=e.session;t.removeEventListener(c.error,e),t.removeEventListener(c.message,e),t.removeEventListener(c.ready,e),t.removeEventListener(c.close,e);for(let t=0;t<v.length;t++)if(v[t]===e){v.splice(t,1);break}t[c.release]()}function C(){let e=null,t=function(){m.removeEventListener(`loadedmetadata`,e),m[c.setMediaKeys](g),n.trigger(r.VIDEO_ELEMENT_SELECTED)};m.readyState>=1?t():(e=t.bind(this),m.addEventListener(`loadedmetadata`,e))}return l={getAllInitData:function(){let e=[];for(let t=0;t<v.length;t++)e.push(v[t].initData);return e},getSessionTokens:function(){return v},requestKeySystemAccess:function(e){return new Promise(((t,i)=>{let o=!1;for(let i=0;i<e.length;i++){let l=e[i].ks.systemString,u=e[i].configs,f=null,p=null;for(let e=0;e<u.length;e++){let i=u[e].audioCapabilities,m=u[e].videoCapabilities;if(i&&i.length!==0){f=[];for(let e=0;e<i.length;e++)window[c.MediaKeys].isTypeSupported(l,i[e].contentType)&&f.push(i[e])}if(m&&m.length!==0){p=[];for(let e=0;e<m.length;e++)window[c.MediaKeys].isTypeSupported(l,m[e].contentType)&&p.push(m[e])}if(!f&&!p||f&&f.length===0||p&&p.length===0)continue;o=!0;let h=new d(f,p),g=new le(b.getKeySystemBySystemString(l),h);n.trigger(r.KEY_SYSTEM_ACCESS_COMPLETE,{data:g}),t({data:g});break}}if(!o){let e=`Key system access denied! -- No valid audio/video content configurations detected!`;n.trigger(r.KEY_SYSTEM_ACCESS_COMPLETE,{error:e}),i({error:e})}}))},selectKeySystem:function(e){return new Promise(((t,n)=>{try{g=e.mediaKeys=new window[c.MediaKeys](e.keySystem.systemString),h=e.keySystem,_=e,m&&C(),t(h)}catch{n({error:`Error selecting keys system (`+h.systemString+`)! Could not create MediaKeys -- TODO`})}}))},setMediaElement:function(e){m!==e&&(m&&m.removeEventListener(c.needkey,y),m=e,m&&(m.addEventListener(c.needkey,y),g&&C()))},createKeySession:function(e){if(!h||!g||!_)throw Error(`Can not create sessions until you have selected a key system`);let t=null;if(_.ksConfiguration.videoCapabilities&&_.ksConfiguration.videoCapabilities.length>0&&(t=_.ksConfiguration.videoCapabilities[0]),t===null&&_.ksConfiguration.audioCapabilities&&_.ksConfiguration.audioCapabilities.length>0&&(t=_.ksConfiguration.audioCapabilities[0]),t===null)throw Error(`Can not create sessions for unknown content types.`);let i=t.contentType,o=g.createSession(i,new Uint8Array(e.initData),e.cdmData?new Uint8Array(e.cdmData):null),l=function(e,t){return{session:e,keyId:t.keyId,normalizedKeyId:t&&t.keyId&&typeof t.keyId==`string`?t.keyId.replace(/-/g,``).toLowerCase():``,initData:t.initData,hasTriggeredKeyStatusMapUpdate:!1,getKeyId:function(){return this.keyId},getSessionId:function(){return this.session.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return`temporary`},getKeyStatuses:function(){return{size:0,has:()=>!1,get:()=>{}}},handleEvent:function(e){switch(e.type){case c.error:n.trigger(r.KEY_ERROR,{error:new p.default(f.default.MEDIA_KEYERR_CODE,`KeyError`,this)});break;case c.message:let t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;n.trigger(r.INTERNAL_KEY_MESSAGE,{data:new ce(this,t,e.destinationURL)});break;case c.ready:u.debug(`DRM: Key added.`),n.trigger(r.KEY_ADDED);break;case c.close:u.debug(`DRM: Session closed. SessionID = `+this.getSessionId()),n.trigger(r.KEY_SESSION_CLOSED,{data:this.getSessionId()})}}}}(o,e);o.addEventListener(c.error,l),o.addEventListener(c.message,l),o.addEventListener(c.ready,l),o.addEventListener(c.close,l),v.push(l),u.debug(`DRM: Session created. SessionID = `+l.getSessionId()),n.trigger(r.KEY_SESSION_CREATED,{data:l})},updateKeySession:function(e,t){let i=e.session;b.isClearKey(h)?i.update(new Uint8Array(t.toJWK())):i.update(new Uint8Array(t)),n.trigger(r.KEY_SESSION_UPDATED)},closeKeySession:S,setServerCertificate:function(){return Promise.resolve()},loadKeySession:function(){},removeKeySession:function(){},stop:x,reset:x},u=o.getLogger(l),m=null,h=null,g=null,_=null,v=[],b=ae(t).getInstance(),y={handleEvent:function(e){if(e.type===c.needkey&&e.initData){let t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;n.trigger(r.NEED_KEY,{key:new se(t,i.default.INITIALIZATION_DATA_TYPE_CENC)})}}},l}pe.__dashjs_factory_name=`ProtectionModel_3Feb2014`;var me=y.default.getClassFactory(pe);function he(e){e||={};let t=this.context,n=e.eventBus,r=e.events,o=e.debug,c=e.api,l=e.errHandler,u,m,h,g,_,v,y,b,x;function S(){h&&T();for(let e=0;e<y.length;e++)C(y[e]);n.trigger(r.TEARDOWN_COMPLETE)}function C(e){try{h[c.cancelKeyRequest](g.systemString,e.sessionId)}catch(t){n.trigger(r.KEY_SESSION_CLOSED,{data:null,error:`Error closing session (`+e.sessionId+`) `+t.message})}}function w(e,t){if(t&&e){let n=e.length;for(let r=0;r<n;r++)if(e[r].sessionId==t)return e[r];return null}return null}function T(){h.removeEventListener(c.keyerror,x),h.removeEventListener(c.needkey,x),h.removeEventListener(c.keymessage,x),h.removeEventListener(c.keyadded,x)}return u={getAllInitData:function(){let e=[];for(let t=0;t<v.length;t++)e.push(v[t].initData);for(let t=0;t<y.length;t++)e.push(y[t].initData);return e},getSessionTokens:function(){return y.concat(v)},requestKeySystemAccess:function(e){return new Promise(((t,i)=>{let o=h;o||=document.createElement(`video`);let c=!1;for(let i=0;i<e.length;i++){let l=e[i].ks.systemString,u=e[i].configs,f=null;for(let e=0;e<u.length;e++){let i=u[e].videoCapabilities;if(i&&i.length!==0){f=[];for(let e=0;e<i.length;e++)o.canPlayType(i[e].contentType,l)!==``&&f.push(i[e])}if(!f||f&&f.length===0)continue;c=!0;let p=new d(null,f),m=new le(_.getKeySystemBySystemString(l),p);n.trigger(r.KEY_SYSTEM_ACCESS_COMPLETE,{data:m}),t({data:m});break}}if(!c){let e=`Key system access denied! -- No valid audio/video content configurations detected!`;n.trigger(r.KEY_SYSTEM_ACCESS_COMPLETE,{error:e}),i({error:e})}}))},selectKeySystem:function(e){return g=e.keySystem,Promise.resolve(g)},setMediaElement:function(e){if(h!==e){if(h){T();for(var t=0;t<y.length;t++)C(y[t]);y=[]}h=e,h&&(h.addEventListener(c.keyerror,x),h.addEventListener(c.needkey,x),h.addEventListener(c.keymessage,x),h.addEventListener(c.keyadded,x),n.trigger(r.VIDEO_ELEMENT_SELECTED))}},createKeySession:function(e){if(!g)throw Error(`Can not create sessions until you have selected a key system`);if(b||y.length===0){let t={sessionId:null,keyId:e.keyId,normalizedKeyId:e&&e.keyId&&typeof e.keyId==`string`?e.keyId.replace(/-/g,``).toLowerCase():``,initData:e.initData,hasTriggeredKeyStatusMapUpdate:!1,getKeyId:function(){return this.keyId},getSessionId:function(){return this.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return`temporary`},getKeyStatuses:function(){return{size:0,has:()=>!1,get:()=>{}}}};return v.push(t),h[c.generateKeyRequest](g.systemString,new Uint8Array(e.initData)),t}throw Error(`Multiple sessions not allowed!`)},updateKeySession:function(e,t){let i=e.sessionId;if(_.isClearKey(g))for(let e=0;e<t.keyPairs.length;e++)h[c.addKey](g.systemString,t.keyPairs[e].key,t.keyPairs[e].keyID,i);else h[c.addKey](g.systemString,new Uint8Array(t),new Uint8Array(e.initData),i);n.trigger(r.KEY_SESSION_UPDATED)},closeKeySession:C,setServerCertificate:function(){return Promise.resolve()},loadKeySession:function(){},removeKeySession:function(){},stop:S,reset:S},m=o.getLogger(u),h=null,g=null,v=[],y=[],_=ae(t).getInstance(),x={handleEvent:function(e){let t=null;switch(e.type){case c.needkey:let o=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;n.trigger(r.NEED_KEY,{key:new se(o,i.default.INITIALIZATION_DATA_TYPE_CENC)});break;case c.keyerror:if(t=w(y,e.sessionId),t||=w(v,e.sessionId),t){let i=f.default.MEDIA_KEYERR_CODE,o=``;switch(e.errorCode.code){case 1:i=f.default.MEDIA_KEYERR_UNKNOWN_CODE,o+=`MEDIA_KEYERR_UNKNOWN - `+f.default.MEDIA_KEYERR_UNKNOWN_MESSAGE;break;case 2:i=f.default.MEDIA_KEYERR_CLIENT_CODE,o+=`MEDIA_KEYERR_CLIENT - `+f.default.MEDIA_KEYERR_CLIENT_MESSAGE;break;case 3:i=f.default.MEDIA_KEYERR_SERVICE_CODE,o+=`MEDIA_KEYERR_SERVICE - `+f.default.MEDIA_KEYERR_SERVICE_MESSAGE;break;case 4:i=f.default.MEDIA_KEYERR_OUTPUT_CODE,o+=`MEDIA_KEYERR_OUTPUT - `+f.default.MEDIA_KEYERR_OUTPUT_MESSAGE;break;case 5:i=f.default.MEDIA_KEYERR_HARDWARECHANGE_CODE,o+=`MEDIA_KEYERR_HARDWARECHANGE - `+f.default.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE;break;case 6:i=f.default.MEDIA_KEYERR_DOMAIN_CODE,o+=`MEDIA_KEYERR_DOMAIN - `+f.default.MEDIA_KEYERR_DOMAIN_MESSAGE}o+=` System Code = `+e.systemCode,n.trigger(r.KEY_ERROR,{error:new p.default(i,o,t)})}else m.error(`No session token found for key error`);break;case c.keyadded:t=w(y,e.sessionId),t||=w(v,e.sessionId),t?(m.debug(`DRM: Key added.`),n.trigger(r.KEY_ADDED,{data:t})):m.debug(`No session token found for key added`);break;case c.keymessage:if(b=e.sessionId!==null&&e.sessionId!==void 0,b?(t=w(y,e.sessionId),!t&&v.length>0&&(t=v.shift(),y.push(t),t.sessionId=e.sessionId,n.trigger(r.KEY_SESSION_CREATED,{data:t}))):v.length>0&&(t=v.shift(),y.push(t),v.length!==0&&l.error(new p.default(f.default.MEDIA_KEY_MESSAGE_ERROR_CODE,f.default.MEDIA_KEY_MESSAGE_ERROR_MESSAGE))),t){let i=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;t.keyMessage=i,n.trigger(r.INTERNAL_KEY_MESSAGE,{data:new ce(t,i,e.defaultURL)})}else m.warn(`No session token found for key message`)}}},u}he.__dashjs_factory_name=`ProtectionModel_01b`;var ge=y.default.getClassFactory(he);let _e=[{generateKeyRequest:`generateKeyRequest`,addKey:`addKey`,cancelKeyRequest:`cancelKeyRequest`,needkey:`needkey`,keyerror:`keyerror`,keyadded:`keyadded`,keymessage:`keymessage`},{generateKeyRequest:`webkitGenerateKeyRequest`,addKey:`webkitAddKey`,cancelKeyRequest:`webkitCancelKeyRequest`,needkey:`webkitneedkey`,keyerror:`webkitkeyerror`,keyadded:`webkitkeyadded`,keymessage:`webkitkeymessage`}],ve=[{setMediaKeys:`setMediaKeys`,MediaKeys:`MediaKeys`,release:`close`,needkey:`needkey`,error:`keyerror`,message:`keymessage`,ready:`keyadded`,close:`keyclose`},{setMediaKeys:`msSetMediaKeys`,MediaKeys:`MSMediaKeys`,release:`close`,needkey:`msneedkey`,error:`mskeyerror`,message:`mskeymessage`,ready:`mskeyadded`,close:`mskeyclose`}];function ye(){let e,t=this.context;function n(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(typeof e[r[Object.keys(r)[0]]]==`function`)return r}return null}return e={createProtectionSystem:function(r){let i=null,o=ae(t).getInstance();o.setConfig({debug:r.debug,BASE64:r.BASE64,settings:r.settings}),o.initialize();let c=function(r){let i=r.debug,o=i.getLogger(e),c=r.eventBus,l=r.errHandler,u=r.videoModel?r.videoModel.getElement():null;return u&&u.onencrypted===void 0||u&&u.mediaKeys===void 0?n(u,ve)?(o.info(`EME detected on this user agent! (ProtectionModel_3Feb2014)`),me(t).create({debug:i,eventBus:c,events:r.events,api:n(u,ve)})):n(u,_e)?(o.info(`EME detected on this user agent! (ProtectionModel_01b)`),ge(t).create({debug:i,eventBus:c,errHandler:l,events:r.events,api:n(u,_e)})):(o.warn(`No supported version of EME detected on this user agent! - Attempts to play encrypted content will fail!`),null):(o.info(`EME detected on this user agent! (DefaultProtectionModel`),fe(t).create({debug:i,eventBus:c,events:r.events}))}(r);return c&&(i=x(t).create({BASE64:r.BASE64,cmcdModel:r.cmcdModel,constants:r.constants,customParametersModel:r.customParametersModel,debug:r.debug,eventBus:r.eventBus,events:r.events,protectionKeyController:o,protectionModel:c,settings:r.settings}),r.capabilities.setEncryptedMediaSupported(!0)),i}},e}ye.__dashjs_factory_name=`Protection`;let be=y.default.getClassFactory(ye);be.events=oe.default,be.errors=f.default,y.default.updateClassFactory(ye.__dashjs_factory_name,be);var xe=be},445:function(e,t,n){n.r(t);var r=n(7252);class i extends r.default{constructor(){super(),this.INTERNAL_KEY_MESSAGE=`internalKeyMessage`,this.INTERNAL_KEY_STATUSES_CHANGED=`internalkeyStatusesChanged`,this.KEY_ADDED=`public_keyAdded`,this.KEY_ERROR=`public_keyError`,this.KEY_MESSAGE=`public_keyMessage`,this.KEY_SESSION_CLOSED=`public_keySessionClosed`,this.KEY_SESSION_CREATED=`public_keySessionCreated`,this.KEY_SESSION_REMOVED=`public_keySessionRemoved`,this.KEY_STATUSES_CHANGED=`public_keyStatusesChanged`,this.KEY_STATUSES_MAP_UPDATED=`keyStatusesMapUpdated`,this.KEY_SYSTEM_ACCESS_COMPLETE=`public_keySystemAccessComplete`,this.KEY_SYSTEM_SELECTED=`public_keySystemSelected`,this.LICENSE_REQUEST_COMPLETE=`public_licenseRequestComplete`,this.LICENSE_REQUEST_SENDING=`public_licenseRequestSending`,this.NEED_KEY=`needkey`,this.PROTECTION_CREATED=`public_protectioncreated`,this.PROTECTION_DESTROYED=`public_protectiondestroyed`,this.SERVER_CERTIFICATE_UPDATED=`serverCertificateUpdated`,this.TEARDOWN_COMPLETE=`protectionTeardownComplete`,this.VIDEO_ELEMENT_SELECTED=`videoElementSelected`,this.KEY_SESSION_UPDATED=`public_keySessionUpdated`}}t.default=new i},1923:function(e,t,n){n.r(t);var r=n(8748);class i extends r.default{constructor(){super(),this.MEDIA_KEYERR_CODE=100,this.MEDIA_KEYERR_UNKNOWN_CODE=101,this.MEDIA_KEYERR_CLIENT_CODE=102,this.MEDIA_KEYERR_SERVICE_CODE=103,this.MEDIA_KEYERR_OUTPUT_CODE=104,this.MEDIA_KEYERR_HARDWARECHANGE_CODE=105,this.MEDIA_KEYERR_DOMAIN_CODE=106,this.MEDIA_KEY_MESSAGE_ERROR_CODE=107,this.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE=108,this.SERVER_CERTIFICATE_UPDATED_ERROR_CODE=109,this.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE=110,this.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE=111,this.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE=112,this.KEY_SESSION_CREATED_ERROR_CODE=113,this.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE=114,this.MEDIA_KEYERR_UNKNOWN_MESSAGE=`An unspecified error occurred. This value is used for errors that don't match any of the other codes.`,this.MEDIA_KEYERR_CLIENT_MESSAGE=`The Key System could not be installed or updated.`,this.MEDIA_KEYERR_SERVICE_MESSAGE=`The message passed into update indicated an error from the license service.`,this.MEDIA_KEYERR_OUTPUT_MESSAGE=`There is no available output device with the required characteristics for the content protection system.`,this.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE=`A hardware configuration change caused a content protection error.`,this.MEDIA_KEYERR_DOMAIN_MESSAGE=`An error occurred in a multi-device domain licensing configuration. The most common error is a failure to join the domain.`,this.MEDIA_KEY_MESSAGE_ERROR_MESSAGE=`Multiple key sessions were creates with a user-agent that does not support sessionIDs!! Unpredictable behavior ahead!`,this.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE=`DRM: Empty key message from CDM`,this.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE=`Error updating server certificate -- `,this.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE=`DRM: KeyStatusChange error! -- License has expired`,this.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE=`DRM: No license server URL specified!`,this.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE=`DRM: KeySystem Access Denied! -- `,this.KEY_SESSION_CREATED_ERROR_MESSAGE=`DRM: unable to create session! --`,this.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE=`DRM: licenser error! --`}}t.default=new i},4246:function(e,t,n){n.r(t);var r=n(138);let i={DEFAULT:.5,STRONG:1,WEAK:0};function o(e,t,n,r){let o,c,l,u,d;return c=e===void 0?null:e,l=function(e){let t=i.DEFAULT;return e!==i.DEFAULT&&e!==i.STRONG&&e!==i.WEAK||(t=e),t}(n),u=t===void 0?null:t,d=r===void 0?null:r,o={representation:c,reason:u,rule:d,priority:l},o}o.__dashjs_factory_name=`SwitchRequest`;let c=r.default.getClassFactory(o);c.NO_CHANGE=null,c.PRIORITY=i,r.default.updateClassFactory(o.__dashjs_factory_name,c),t.default=c},559:function(e,t,n){n.r(t),n.d(t,{supportsMediaSource:function(){return u}});var r=n(138),i=n(5212),o=n(2861),c=n(7393),l=n(649);function u(){let e=`ManagedMediaSource`in window,t=`WebKitMediaSource`in window,n=`MediaSource`in window;return e||t||n}function d(){let e,t,n,r,d,f,p=this.context,m=(0,c.default)(p).getInstance();function h(e,t){let n;t===i.default.VIDEO?n=function(e){let t={video:{}};return e?(e.width&&(t.video.width=e.width),e.height&&(t.video.height=e.height),e.framerate&&(t.video.framerate=parseFloat(e.framerate)),e.hdrMetadataType&&(t.video.hdrMetadataType=e.hdrMetadataType),e.colorGamut&&(t.video.colorGamut=e.colorGamut),e.transferFunction&&(t.video.transferFunction=e.transferFunction),t):t}(e):t===i.default.AUDIO&&(n=function(e){let t={audio:{}};return e.samplerate&&(t.audio.samplerate=e.samplerate),e.channels&&(t.audio.channels=e.channels),t}(e)),n[t].contentType=e.codec,n[t].bitrate=parseInt(e.bitrate),n.type=`media-source`;let r=e.codec;return e.width&&e.height&&(r+=`;width="`+e.width+`";height="`+e.height+`"`),n.mediaSourceCodecString=r,function(e,t,n){if(!t||!t.keySystemsMetadata||t.keySystemsMetadata.length===0)return[e];let r=[];return t.keySystemsMetadata.forEach((t=>{if(!t.ks)return void r.push({...e});let c=t.protData&&t.protData.systemStringPriority?t.protData.systemStringPriority:null,l=t.ks.systemString;(c||[l]).forEach((c=>{let l={...e};l.keySystemConfiguration={},c&&(l.keySystemConfiguration.keySystem=c);let u=``;t.ks.systemString===o.default.WIDEVINE_KEYSTEM_STRING&&(u=o.default.ROBUSTNESS_STRINGS.WIDEVINE.SW_SECURE_CRYPTO);let d=t.protData,f=d&&d.audioRobustness&&d.audioRobustness.length>0?d.audioRobustness:u,p=d&&d.videoRobustness&&d.videoRobustness.length>0?d.videoRobustness:u;n===i.default.AUDIO?l.keySystemConfiguration[n]={robustness:f}:n===i.default.VIDEO&&(l.keySystemConfiguration[n]={robustness:p}),r.push(l)}))})),r}(n,e,t)}function g(e){return t.get().streaming.enhancement.codecs.some((t=>e.includes(t)))}function _(e){if(r&&r.length!==0&&e)return r.find((t=>{let n=v(e,t,i.default.AUDIO),r=v(e,t,i.default.VIDEO),o=v(e,t,`keySystemConfiguration`);return n&&r&&o}))}function v(e,t,n){return!e[n]&&!t[n]||!(!e[n]||!t[n])&&m.areEqual(e[n],t[n])}function y(e,t){return(e=e.filter((e=>!(e.schemeIdUri&&t.some((t=>t.schemeIdUri===e.schemeIdUri)))))).push(...t),e}return e={areKeyIdsExpired:function(e){return!!(n&&e&&e.normalizedKeyIds&&e.normalizedKeyIds.size!==0)&&n.areKeyIdsExpired(e.normalizedKeyIds)},areKeyIdsUsable:function(e){return!(n&&e&&e.normalizedKeyIds&&e.normalizedKeyIds.size!==0)||n.areKeyIdsUsable(e.normalizedKeyIds)},isCodecSupportedBasedOnTestedConfigurations:function(e,t){if(!e||!e.codec||!1===e.isSupported)return!1;let n=h(e,t).map((e=>_(e))).filter((e=>e!=null));return!(n&&n.length>0)||function(e){return e.some((e=>e&&e.decodingInfo&&e.decodingInfo.supported))}(n)},isProtectionCompatible:function(e,t){return!t||!(!e.isEncrypted&&t.isEncrypted)},runCodecSupportCheck:function(e,n){if(n!==i.default.AUDIO&&n!==i.default.VIDEO)return Promise.resolve();if(t.get().streaming.enhancement.enabled&&g(e.codec))return r=r.filter((e=>!g(e.mediaSourceCodecString))),Promise.resolve(!0);let o=h(e,n);return function(e,n){return t.get().streaming.capabilities.useMediaCapabilitiesApi&&navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo&&(e.codec&&n===i.default.AUDIO||n===i.default.VIDEO&&e.codec&&e.width&&e.height&&e.bitrate&&e.framerate)}(e,n)?function(e){return new Promise((t=>{if(!e||e.length===0)return void t();let n=e.map((e=>function(e){return new Promise((t=>{_(e)?t():navigator.mediaCapabilities.decodingInfo(e).then((n=>{e.decodingInfo=n,r.push(e),t()})).catch((n=>{e.decodingInfo={supported:!1},r.push(e),f.error(n),t()}))}))}(e)));Promise.allSettled(n).then((()=>{t()})).catch((e=>{f.error(e),t()}))}))}(o):(function(e){if(!e||!e.length)return;let t=e[0];if(_(t))return;let n={supported:!1};(`ManagedMediaSource`in window&&ManagedMediaSource.isTypeSupported(t.mediaSourceCodecString)||`MediaSource`in window&&MediaSource.isTypeSupported(t.mediaSourceCodecString)||`WebKitMediaSource`in window&&WebKitMediaSource.isTypeSupported(t.mediaSourceCodecString))&&(n.supported=!0),t.decodingInfo=n,r.push(t)}(o),Promise.resolve())},setConfig:function(e){e&&(e.settings&&(t=e.settings),e.protectionController&&(n=e.protectionController))},setEncryptedMediaSupported:function(e){d=e},setProtectionController:function(e){n=e},supportsChangeType:function(){return!!window.SourceBuffer&&!!SourceBuffer.prototype&&!!SourceBuffer.prototype.changeType},supportsEncryptedMedia:function(){return d},supportsEssentialProperty:function(e){let n=t.get().streaming.capabilities.supportedEssentialProperties;t.get().streaming.capabilities.useMediaCapabilitiesApi&&t.get().streaming.capabilities.filterVideoColorimetryEssentialProperties&&(n=y(n,[{schemeIdUri:i.default.COLOUR_PRIMARIES_SCHEME_ID_URI},{schemeIdUri:i.default.MATRIX_COEFFICIENTS_SCHEME_ID_URI},{schemeIdUri:i.default.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI}])),t.get().streaming.capabilities.useMediaCapabilitiesApi&&t.get().streaming.capabilities.filterHDRMetadataFormatEssentialProperties&&(n=y(n,[{schemeIdUri:i.default.HDR_METADATA_FORMAT_SCHEME_ID_URI}]));try{return e.inArray(n)}catch{return!0}},supportsMediaSource:u},d=!1,r=[],f=(0,l.default)(p).getInstance().getLogger(e),e}d.__dashjs_factory_name=`Capabilities`,t.default=r.default.getSingletonFactory(d)},7377:function(e,t,n){n.r(t);var r=n(138),i=n(656);function o(){return{customTimeRangeArray:[],length:0,add:function(e,t){let n;for(n=0;n<this.customTimeRangeArray.length&&e>this.customTimeRangeArray[n].start;n++);for(this.customTimeRangeArray.splice(n,0,{start:e,end:t}),n=0;n<this.customTimeRangeArray.length-1;n++)this.mergeRanges(n,n+1)&&n--;this.length=this.customTimeRangeArray.length},clear:function(){this.customTimeRangeArray=[],this.length=0},remove:function(e,t){for(let n=0;n<this.customTimeRangeArray.length;n++)if(e<=this.customTimeRangeArray[n].start&&t>=this.customTimeRangeArray[n].end)this.customTimeRangeArray.splice(n,1),n--;else{if(e>this.customTimeRangeArray[n].start&&t<this.customTimeRangeArray[n].end){this.customTimeRangeArray.splice(n+1,0,{start:t,end:this.customTimeRangeArray[n].end}),this.customTimeRangeArray[n].end=e;break}e>this.customTimeRangeArray[n].start&&e<this.customTimeRangeArray[n].end?this.customTimeRangeArray[n].end=e:t>this.customTimeRangeArray[n].start&&t<this.customTimeRangeArray[n].end&&(this.customTimeRangeArray[n].start=t)}this.length=this.customTimeRangeArray.length},mergeRanges:function(e,t){let n=this.customTimeRangeArray[e],r=this.customTimeRangeArray[t];return n.start<=r.start&&r.start<=n.end&&n.end<=r.end?(n.end=r.end,this.customTimeRangeArray.splice(t,1),!0):r.start<=n.start&&n.start<=r.end&&r.end<=n.end?(n.start=r.start,this.customTimeRangeArray.splice(t,1),!0):r.start<=n.start&&n.start<=r.end&&n.end<=r.end?(this.customTimeRangeArray.splice(e,1),!0):n.start<=r.start&&r.start<=n.end&&r.end<=n.end&&(this.customTimeRangeArray.splice(t,1),!0)},start:function(e){return(0,i.checkInteger)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].start},end:function(e){return(0,i.checkInteger)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].end}}}o.__dashjs_factory_name=`CustomTimeRanges`,t.default=r.default.getClassFactory(o)},7393:function(e,t,n){n.r(t);var r=n(138),i=n(7316);function o(){let e;return e={areEqual:function(e,t){return i(e,t)}},e}o.__dashjs_factory_name=`ObjectUtils`,t.default=r.default.getSingletonFactory(o)},656:function(e,t,n){n.r(t),n.d(t,{checkInteger:function(){return o},checkIsVideoOrAudioType:function(){return l},checkParameterType:function(){return i},checkRange:function(){return c}});var r=n(5212);function i(e,t){if(typeof e!==t)throw r.default.BAD_ARGUMENT_ERROR}function o(e){if(e===null||isNaN(e)||e%1!=0)throw r.default.BAD_ARGUMENT_ERROR+` : argument is not an integer`}function c(e,t,n){if(e<t||e>n)throw r.default.BAD_ARGUMENT_ERROR+` : argument out of range`}function l(e){if(typeof e!=`string`||e!==r.default.AUDIO&&e!==r.default.VIDEO)throw r.default.BAD_ARGUMENT_ERROR}},1944:function(e,t,n){n.r(t),t.default=class{constructor(e,t,n){this.code=e||null,this.message=t||null,this.data=n||null}}},5560:function(e,t,n){n.r(t);var r=n(8854);t.default=class{constructor(e){this.id=e.id,this.url=e.url,this.language=e.language,this.mimeType=e.mimeType,this.bandwidth=e.bandwidth,this.periodId=e.periodId||null}serializeToMpdParserFormat(){return{tagName:r.default.ADAPTATION_SET,mimeType:this.mimeType,lang:this.language,Representation:[{tagName:r.default.REPRESENTATION,id:this.id,bandwidth:this.bandwidth,BaseURL:[{tagName:r.default.BASE_URL,__text:this.url}],mimeType:this.mimeType}]}}}},7568:function(e,t,n){n.r(t),n.d(t,{HTTPRequest:function(){return r},HTTPRequestTrace:function(){return i}});class r{constructor(){this.tcpid=null,this.type=null,this.url=null,this.actualurl=null,this.range=null,this.trequest=null,this.tresponse=null,this.responsecode=null,this.interval=null,this.trace=[],this.cmsd=null,this._stream=null,this._tfinish=null,this._mediaduration=null,this._responseHeaders=null,this._serviceLocation=null,this._fileLoaderType=null,this._resourceTimingValues=null}}class i{constructor(){this.s=null,this.d=null,this.b=[]}}r.GET=`GET`,r.HEAD=`HEAD`,r.MPD_TYPE=`MPD`,r.XLINK_EXPANSION_TYPE=`XLinkExpansion`,r.INIT_SEGMENT_TYPE=`InitializationSegment`,r.INDEX_SEGMENT_TYPE=`IndexSegment`,r.MEDIA_SEGMENT_TYPE=`MediaSegment`,r.BITSTREAM_SWITCHING_SEGMENT_TYPE=`BitstreamSwitchingSegment`,r.MSS_FRAGMENT_INFO_SEGMENT_TYPE=`FragmentInfoSegment`,r.DVB_REPORTING_TYPE=`DVBReporting`,r.LICENSE=`license`,r.CONTENT_STEERING_TYPE=`ContentSteering`,r.OTHER_TYPE=`other`}},ud={},cd.amdO={},cd.d=function(e,t){for(var n in t)cd.o(t,n)&&!cd.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},cd.g=function(){if(typeof globalThis==`object`)return globalThis;try{return this||Function(`return this`)()}catch{if(typeof window==`object`)return window}}(),cd.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},cd.r=function(e){typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,`__esModule`,{value:!0})},dd={},cd.r(dd),cd.d(dd,{Constants:function(){return bd.default},Debug:function(){return yd.default},ExternalSubtitle:function(){return Sd.default},MediaPlayer:function(){return fd.MediaPlayer},MediaPlayerFactory:function(){return vd},MetricsReporting:function(){return pd.default},Protection:function(){return md.default},default:function(){return Cd},supportsMediaSource:function(){return xd.supportsMediaSource}}),fd=cd(5393),pd=cd(4469),md=cd(3888),hd=cd(8200),_d=function(){let e=`application/dash+xml`,t;function n(n,r,i){if(!n||!/^VIDEO$/i.test(n.nodeName))return null;if(n._dashjs_player)return n._dashjs_player;let o,c=n.id||n.name||`video element`;if(!(r||=[].slice.call(n.querySelectorAll(`source`)).filter((function(t){return t.type==e}))[0])&&n.src)(r=document.createElement(`source`)).src=n.src;else if(!r&&!n.src)return null;return i||={},o=(0,hd.default)(i).create(),o.initialize(n,r.src,n.autoplay),t||=o.getDebug().getLogger(),t.debug(`Converted `+c+` to dash.js player and added content: `+r.src),n._dashjs_player=o,o}function r(e){return/^VIDEO$/i.test(e.nodeName)?e:r(e.parentNode)}return{create:n,createAll:function(t,i){let o=[];t||=`[data-dashjs-player]`;let c=(i||=document).querySelectorAll(t);for(let e=0;e<c.length;e++){let t=n(c[e],null);o.push(t)}let l=i.querySelectorAll(`source[type="`+e+`"]`);for(let e=0;e<l.length;e++){let t=n(r(l[e]),null);o.push(t)}return o}}}(),!(typeof window<`u`&&window&&window.dashjs&&window.dashjs.skipAutoCreate)&&typeof window<`u`&&window&&window.addEventListener&&(window.document.readyState===`complete`?window.dashjs?_d.createAll():gd=window.setInterval((function(){window.dashjs&&(window.clearInterval(gd),_d.createAll())}),500):window.addEventListener(`load`,(function e(){window.removeEventListener(`load`,e),_d.createAll()}))),vd=_d,yd=cd(649),bd=cd(5212),xd=cd(559),Sd=cd(5560),dashjs.Protection=md.default,dashjs.MetricsReporting=pd.default,dashjs.MediaPlayerFactory=vd,dashjs.Debug=yd.default,dashjs.supportsMediaSource=xd.supportsMediaSource,dashjs.Constants=bd.default,dashjs.ExternalSubtitle=Sd.default,Cd=dashjs,wd=(dd=dd.default).Constants,Td=dd.Debug,Ed=dd.ExternalSubtitle,Dd=dd.MediaPlayer,Od=dd.MediaPlayerFactory,kd=dd.MetricsReporting,Ad=dd.Protection,jd=dd.default,Md=dd.supportsMediaSource})),Pd,Fd=n((()=>{Pd=class{id=`dash`;isNative=!1;video=null;player=null;dashjs=null;loadVersion=0;cancelPendingLoad;lastSource=null;retryCount=0;maxRetries=2;runtimeConfig={performance:{startupMode:`balanced`,startupBufferSeconds:1.2,manifestFastPath:!1},abr:{startupProfile:`balanced`,upgradeAggression:`medium`,rebufferSafetyBias:`medium`}};lastRebufferDowngradeAt=0;listeners=new Map;domListeners=[];setRuntimeConfig(e){this.runtimeConfig={performance:{startupMode:e.performance?.startupMode??this.runtimeConfig.performance.startupMode,startupBufferSeconds:e.performance?.startupBufferSeconds??this.runtimeConfig.performance.startupBufferSeconds,manifestFastPath:e.performance?.manifestFastPath??this.runtimeConfig.performance.manifestFastPath},abr:{startupProfile:e.abr?.startupProfile??this.runtimeConfig.abr.startupProfile,upgradeAggression:e.abr?.upgradeAggression??this.runtimeConfig.abr.upgradeAggression,rebufferSafetyBias:e.abr?.rebufferSafetyBias??this.runtimeConfig.abr.rebufferSafetyBias}}}canPlayType(e){return e===`dash`}canPlaySource(e){return e.toLowerCase().includes(`.mpd`)}async preload(){await this.ensureDashJs()}async ensureDashJs(){return this.dashjs||=await Promise.resolve().then(()=>(Nd(),sd)),this.dashjs}attach(e){this.video=e,this.bindDomEvents(),this.player&&this.player.attachView(e)}bindDomEvents(){if(!this.video)return;this.unbindDomEvents();let e=(e,t,n=()=>void 0)=>{let r=r=>{let i=n(r);e===`waiting`&&this.rebufferAwareDowngrade(),this.emit(t,i)};this.video.addEventListener(e,r),this.domListeners.push({event:e,handler:r})};e(`play`,`play`),e(`pause`,`pause`),e(`playing`,`playing`),e(`ended`,`ended`),e(`waiting`,`waiting`),e(`seeked`,`seeked`,()=>({currentTime:this.video.currentTime})),e(`canplay`,`ready`),e(`timeupdate`,`timeupdate`,()=>({currentTime:this.video.currentTime})),e(`durationchange`,`durationchange`,()=>({duration:this.video.duration,isLive:this.player?.isDynamic?.()})),e(`volumechange`,`volumechange`,()=>({volume:this.video.volume,muted:this.video.muted})),e(`ratechange`,`ratechange`,()=>({playbackRate:this.video.playbackRate})),e(`progress`,`progress`,()=>{let e=[],t=this.video.buffered;for(let n=0;n<t.length;n++)e.push({start:t.start(n),end:t.end(n)});return{buffered:e}})}unbindDomEvents(){this.video&&(this.domListeners.forEach(({event:e,handler:t})=>{this.video.removeEventListener(e,t)}),this.domListeners=[])}async load(e){if(!this.video)throw Error(`Video element not attached`);this.video.poster=e.poster||``;let t=++this.loadVersion;this.lastSource=e,this.retryCount=0;let n=await this.ensureDashJs();if(t!==this.loadVersion)return;this.player&&this.player.destroy(),this.player=n.MediaPlayer().create(),this.emit(`telemetry`,{name:`manifest_parse_started`,at:Date.now()});let r=this.runtimeConfig.abr.startupProfile,i=this.runtimeConfig.performance.startupMode,o=this.runtimeConfig.performance.manifestFastPath||i===`fast-first-frame`;e.drm&&this.player.setProtectionData(e.drm);let c=r===`fast`?350:r===`quality`?1400:800;this.player.updateSettings({streaming:{buffer:{fastSwitchEnabled:o,bufferTimeDefault:o?4:12},trackSwitchMode:{audio:`alwaysReplace`,video:`neverReplace`},cacheInitSegments:o,scheduling:{scheduleWhilePaused:!0},abr:{autoSwitchBitrate:{video:!0},initialBitrate:{video:c}},text:{defaultEnabled:!o}}}),this.registerTrackSyncEvents(),this.player.on(n.MediaPlayer.events.QUALITY_CHANGE_RENDERED,e=>{if(e.mediaType===`video`){let e=this.player.getSettings().streaming?.abr?.autoSwitchBitrate?.video;this.emit(`qualitychange`,{level:e?`auto`:this.currentQualityIndex()}),this.syncTracks()}}),this.player.on(n.MediaPlayer.events.TRACK_CHANGE_RENDERED,()=>{this.syncTracks()}),await new Promise((t,r)=>{this.cancelPendingLoad=()=>r(new DOMException(`Load superseded`,`AbortError`));let i=!1,o=()=>{this.player&&(this.player.off(n.MediaPlayer.events.STREAM_INITIALIZED,c),this.player.off(n.MediaPlayer.events.PLAYBACK_METADATA_LOADED,c),this.player.off(n.MediaPlayer.events.ERROR,l))},c=()=>{i||(i=!0,this.emit(`telemetry`,{name:`manifest_parse_completed`,at:Date.now()}),this.emit(`telemetry`,{name:`first_append_completed`,at:Date.now()}),this.syncTracks(),o(),this.cancelPendingLoad=void 0,t())},l=e=>{let t=e?.error?.code||`UNKNOWN`,n=String(e?.error?.message||`Dash error`),c=n.toLowerCase();if((c.includes(`manifest`)||c.includes(`segment`)||c.includes(`download`))&&this.retryCount<this.maxRetries&&this.lastSource){this.retryCount+=1,this.player?.attachSource?.(this.lastSource.src),this.emit(`error`,{error:{code:`DASH_${String(t)}_RETRY`,message:`Recovered load failure (${this.retryCount}/${this.maxRetries})`,engine:this.id,recoverable:!0,originalError:e}});return}this.emit(`error`,{error:{code:`DASH_${String(t)}`,message:n,engine:this.id,recoverable:!1,originalError:e}}),i||(o(),r(Error(e?.error?.message||`Dash load failed`)))};this.player.on(n.MediaPlayer.events.STREAM_INITIALIZED,c),this.player.on(n.MediaPlayer.events.PLAYBACK_METADATA_LOADED,c);for(let[e,t]of[[`MANIFEST_LOADING`,`manifest_request_started`],[`MANIFEST_LOADED`,`manifest_received`],[`FRAGMENT_LOADING_STARTED`,`first_segment_request_started`],[`FRAGMENT_LOADING_COMPLETED`,`first_segment_received`]]){let r=n.MediaPlayer.events[e];r&&this.player.on(r,()=>{this.emit(`telemetry`,{name:t,at:Date.now()})})}this.player.on(n.MediaPlayer.events.ERROR,l),this.emit(`telemetry`,{name:`manifest_request_started`,at:Date.now()}),this.player.initialize(this.video,e.src,!1)})}registerTrackSyncEvents(){if(!this.player||!this.dashjs)return;for(let e of[`STREAM_INITIALIZED`,`PLAYBACK_METADATA_LOADED`,`CAN_PLAY`,`PERIOD_SWITCH_COMPLETED`,`MANIFEST_LOADED`,`TEXT_TRACKS_ADDED`,`TEXT_TRACK_ADDED`,`TRACK_CHANGE_RENDERED`]){let t=this.dashjs.MediaPlayer.events[e];t&&this.player.on(t,()=>{this.syncTracks()})}let e=this.dashjs.MediaPlayer.events.ERROR;e&&this.player.on(e,e=>{this.handleDashRuntimeError(e)})}handleDashRuntimeError(e){let t=String(e?.error?.code||``).toLowerCase(),n=String(e?.error?.message||``).toLowerCase(),r=t.includes(`buffer_stalled`)||t.includes(`bufferstalled`)||n.includes(`buffer stalled`),i=t.includes(`manifest`)||t.includes(`download`)||n.includes(`segment`)||n.includes(`manifest`),o=t.includes(`media`)||n.includes(`decode`);if(r){this.emit(`error`,{error:{code:`DASH_BUFFER_STALL`,message:`Buffer stall detected`,engine:this.id,recoverable:!0,originalError:e}});return}if(i&&this.retryCount<this.maxRetries&&this.lastSource){this.retryCount+=1,this.player.attachSource?.(this.lastSource.src),this.emit(`error`,{error:{code:`DASH_NETWORK_RETRY`,message:`Retrying network/segment request (${this.retryCount}/${this.maxRetries})`,engine:this.id,recoverable:!0,originalError:e}});return}if(o){let t=this.currentQualityIndex();if(typeof t==`number`&&t>0){this.player.updateSettings({streaming:{abr:{autoSwitchBitrate:{video:!1}}}}),this.player.setRepresentationForTypeByIndex?.(`video`,t-1),this.emit(`error`,{error:{code:`DASH_DECODE_FALLBACK`,message:`Decode issue detected, switched to lower quality`,engine:this.id,recoverable:!0,originalError:e}});return}}}currentQualityIndex(){let e=this.player?.getCurrentRepresentationForType(`video`)?.id;return this.getQualityLadder().findIndex(t=>t.id===e)}getQualityLadder(){if(!this.player)return[];let e=this.player,t=e.getBitrateInfoListFor?.(`video`);if(Array.isArray(t)&&t.length>0)return t;let n=e.getRepresentationsByType?.(`video`);return Array.isArray(n)&&n.length>0?n.map((e,t)=>({qualityIndex:e.qualityIndex??t,bitrate:e.bandwidth??e.bitrate,width:e.width,height:e.height,id:e.id})):[]}getTracks(e){if(!this.player)return[];let t=this.player.getTracksFor?.(e);return Array.isArray(t)&&t.length>0?t:this.video&&e===`text`&&this.video.textTracks?Array.from(this.video.textTracks).map((e,t)=>({id:String(t),index:t,lang:e.language,label:e.label,kind:e.kind,_native:e})):[]}normalizeTrackLabel(e,t,n){let r=e?.roles?.[0]?.value??e?.roles?.[0],i=typeof r==`string`?` (`+r+`)`:``,o=e?.lang||e?.language||``;return`${e?.label||e?.name||o||`${t} ${n+1}`}${i}`}getTrackId(e,t){return String(t)}enforceSingleNativeTextTrack(e){if(!this.video?.textTracks)return;let t=this.video.textTracks;for(let n=0;n<t.length;n+=1){let r=t[n];if(e===null){r.mode=`disabled`;continue}r.mode=n===e?`showing`:`disabled`}}matchesTrackId(e,t,n){return this.getTrackId(e,t)===n}syncTracks(){if(!this.player)return;let e=this.getQualityLadder().map((e,t)=>{let n=e.qualityIndex??t,r=e.bandwidth??e.bitrate;return{id:n,label:e.height?`${e.height}p (${Math.round((r||0)/1e3)}kbps)`:`Quality ${t+1} (${Math.round((r||0)/1e3)}kbps)`,bitrate:r,width:e.width,height:e.height,selected:!this.player.getSettings().streaming?.abr?.autoSwitchBitrate?.video&&this.currentQualityIndex()===n}}),t=this.getTracks(`text`),n=new Set,r=t.filter(e=>{let t=`${String(e?.lang||e?.language||``)}|${String(e?.label||e?.name||``)}|${String(e?.kind||``)}`;return n.has(t)?!1:(n.add(t),!0)}),i=this.player.getCurrentTrackFor?.(`text`),o=r.map(e=>({id:String(t.indexOf(e)),label:this.normalizeTrackLabel(e,`Subtitle`,t.indexOf(e)),language:e.lang||e.language,selected:i?i.index===e.index:e._native?.mode===`showing`})),c=this.getTracks(`audio`),l=this.player.getCurrentTrackFor?.(`audio`),u=c.map((e,t)=>({id:this.getTrackId(e,t),label:this.normalizeTrackLabel(e,`Audio`,t),language:e.lang||e.language,selected:l?l.index===e.index:!!e?.selected}));this.emit(`trackschange`,{qualities:e,subtitles:o,audioTracks:u})}rebufferAwareDowngrade(){if(!this.player)return;let e=Date.now();if(e-this.lastRebufferDowngradeAt<2500||!this.video||this.video.currentTime<.5)return;let t=this.currentQualityIndex();if(typeof t!=`number`||t<=0)return;let n=this.runtimeConfig.abr.rebufferSafetyBias,r=Math.max(0,t-(n===`high`?2:1));try{this.player.setRepresentationForTypeByIndex(`video`,r),this.lastRebufferDowngradeAt=e,this.emit(`telemetry`,{name:`abr_rebuffer_downgrade`,at:e,data:{from:t,to:r,bias:n}}),this.syncTracks()}catch{}}async play(){await this.video?.play()}pause(){this.video?.pause()}async destroy(){++this.loadVersion,this.cancelPendingLoad?.(),this.cancelPendingLoad=void 0,this.unbindDomEvents(),this.player&&=(this.player.destroy(),null),this.video&&(this.video.src=``,this.video.removeAttribute(`src`)),this.video=null,this.listeners.clear()}seek(e){this.video&&(this.video.currentTime=e)}setVolume(e){this.video&&(this.video.volume=e)}setMuted(e){this.video&&(this.video.muted=e)}setPlaybackRate(e){this.video&&(this.video.playbackRate=e)}setQuality(e){this.player&&(e===`auto`?(this.player.updateSettings({streaming:{abr:{autoSwitchBitrate:{video:!0}}}}),this.emit(`qualitychange`,{level:`auto`})):(this.player.updateSettings({streaming:{abr:{autoSwitchBitrate:{video:!1}}}}),this.player.setRepresentationForTypeByIndex(`video`,Number(e)),this.emit(`qualitychange`,{level:e})))}setSubtitle(e){if(this.player){if(e===null)this.player.setTextTrack(-1),this.enforceSingleNativeTextTrack(null);else{let t=this.player.getTracksFor(`text`).findIndex((t,n)=>this.matchesTrackId(t,n,e));t>=0&&(typeof this.player.enableText==`function`&&this.player.enableText(!0),this.player.setTextTrack(t),this.enforceSingleNativeTextTrack(t))}this.syncTracks()}}setAudioTrack(e){if(this.player){let t=this.player.getTracksFor(`audio`),n=t.findIndex((t,n)=>this.matchesTrackId(t,n,e));if(n>=0){let e=t[n];typeof this.player.setInitialMediaSettingsFor==`function`&&this.player.setInitialMediaSettingsFor(`audio`,{lang:e?.lang,index:e?.index,role:Array.isArray(e?.roles)?e.roles[0]:void 0}),this.player.setCurrentTrack(e)}this.syncTracks()}}on(e,t){let n=e;return this.listeners.has(n)||this.listeners.set(n,[]),this.listeners.get(n).push(t),()=>this.off(e,t)}off(e,t){let n=e,r=this.listeners.get(n);if(!r)return;let i=r.indexOf(t);i>-1&&r.splice(i,1)}emit(e,t){let n=e,r=this.listeners.get(n);if(r)for(let e of[...r])e(t)}}})),Id=r({DashEngine:()=>Pd}),Ld=n((()=>{Fd()})),Rd=new WeakSet,zd=new Map;function Bd(e,t){let n=new m;n.setPerformance(t.performance),n.setAbr(t.abr);let r=new O,i=typeof e==`string`?document.querySelector(e):e;if(!i)throw Error(`Player target element not found`);if(Rd.has(i))throw Error(`Player target already mounted. Destroy previous instance before creating a new one.`);Rd.add(i),n.registry.register(new h);let o=!1,c=!1,l=null,u=null,d=null,p=null,g;t.ui?.headless?(g=document.createElement(`video`),g.setAttribute(`playsinline`,``),g.preload=`auto`,g.muted=!!(t.source?.muted??!0),i.appendChild(g),n.attachVideo(g)):l=new w(n,e,t.ui),i&&(C(i.querySelector(`.flux-player-wrapper`)||i,t.theme||`dark`),u=new _(n,i)),t.analytics&&(d=new T(n,t.analytics.adapter)),t.devtools&&(p=new E(n,i||document.body));let v=async e=>{let t=e.type&&e.type!==`auto`?e.type:f(e.src,e.mimeType);if((t===`hls`||t===`auto`)&&!o)try{let e=new(await(Promise.resolve().then(()=>(od(),ad)))).HlsEngine;await e.preload?.(),n.registry.register(e),o=!0}catch(e){console.warn(`Failed to lazy load HLS engine`,e)}if((t===`dash`||t===`auto`)&&!c)try{let e=new(await(Promise.resolve().then(()=>(Ld(),Id)))).DashEngine;await e.preload?.(),n.registry.register(e),c=!0}catch(e){console.warn(`Failed to lazy load DASH engine`,e)}},y=e=>{if(!t.performance?.manifestFastPath)return()=>void 0;let n=document.createElement(`link`);return n.rel=`preload`,n.as=`fetch`,n.href=e,n.setAttribute(`fetchpriority`,`high`),n.crossOrigin=`anonymous`,document.head.appendChild(n),()=>{n.parentNode&&n.parentNode.removeChild(n)}},b=e=>{if(!t.performance?.manifestFastPath)return()=>void 0;let n=new URL(e,window.location.href).origin;if(zd.has(n))return()=>void 0;let r=[],i=(e,t)=>{let n=document.createElement(`link`);n.rel=e,n.href=t,e===`preconnect`&&(n.crossOrigin=`anonymous`),document.head.appendChild(n),r.push(n)};return i(`preconnect`,n),i(`dns-prefetch`,n),zd.set(n,r),()=>void 0},x=!1,S=null,D=()=>{let e=navigator;return typeof e.userAgentData?.mobile==`boolean`?e.userAgentData.mobile:/android|iphone|ipad|ipod|mobile/i.test(navigator.userAgent||``)},k=e=>{let t=e.currentTime,n=e.buffered;for(let e=0;e<n.length;e+=1){let r=n.start(e),i=n.end(e);if(t>=r-.25&&t<=i+.05)return Math.max(0,i-t)}return 0},A=()=>{let e=t.performance,r;if(typeof e?.startupBufferSeconds==`number`&&Number.isFinite(e.startupBufferSeconds))r=Math.max(0,e.startupBufferSeconds);else{let t=e?.startupStrategy??(e?.startupMode===`fast-first-frame`?`aggressive`:`balanced`),i=n.getState(),o=D(),c=!!(i.isLive||i.isDvr);r=t===`aggressive`?c?o?.12:.08:o?.18:.12:t===`safe`?c?o?.55:.45:o?.9:.75:c?o?.35:.28:o?.55:.45}let i=navigator.connection,o=1;switch(i?.saveData&&(o*=1.2),(i?.effectiveType||``).toLowerCase()){case`slow-2g`:o*=1.7;break;case`2g`:o*=1.45;break;case`3g`:o*=1.2;break;case`4g`:o*=.9;break;default:break}typeof i?.downlink==`number`&&Number.isFinite(i.downlink)&&(i.downlink>=12?o*=.82:i.downlink>=6?o*=.9:i.downlink<=1.5&&(o*=1.22)),typeof i?.rtt==`number`&&Number.isFinite(i.rtt)&&i.rtt>250&&(o*=1.1);let c=r*o;return Math.max(.12,Math.min(1.5,c))},j=()=>{if((t.performance?.startupBufferSeconds??0)>=.5)return 4500;let e=t.performance?.startupStrategy??(t.performance?.startupMode===`fast-first-frame`?`aggressive`:`balanced`);return e===`safe`?3500:e===`aggressive`?1200:2200},M=async()=>{let e=i.querySelector(`video`);if(!e)return;let t=Math.max(0,A()),o=j(),c=Date.now(),l=HTMLMediaElement.HAVE_FUTURE_DATA,u=``,d=()=>{let t=k(e),r=n.getStartupReadiness(),i=!r||r.mediaSourceReadyState===null||r?.mediaSourceReadyState===`open`,o=r?.sourceBuffersUpdating!==!0,c=e.buffered.length>0;return{ahead:t,readyEnough:e.readyState>=l,hasBufferedRange:c,mediaSourceOpen:i,sourceBuffersIdle:o,engineReadiness:r}},f=(n,r)=>{let i=t;return e.readyState>=HTMLMediaElement.HAVE_ENOUGH_DATA&&n.ahead>=.25&&(i=Math.min(i,Math.max(.2,t*.65))),r>900&&n.hasBufferedRange&&n.sourceBuffersIdle&&n.mediaSourceOpen&&(i=Math.min(i,.28)),i},p=(e,t)=>{let n=[];return e.hasBufferedRange||n.push(`no_buffered_range`),e.ahead<t&&n.push(`insufficient_buffer_ahead`),e.readyEnough||n.push(`ready_state_below_have_future_data`),e.mediaSourceOpen||n.push(`media_source_not_open`),e.sourceBuffersIdle||n.push(`source_buffer_updating`),(e.engineReadiness?.appendQueueDepth??0)>0&&n.push(`append_queue_not_empty`),e.engineReadiness?.appendWaitActive&&n.push(`append_wait_active`),n},m=(n,i,o)=>{let c=p(n,o),l=c.join(`|`);!l||l===u||(u=l,r.onTelemetry(`startup_gate_pending`,Date.now(),{waitedMs:i,minAhead:o,baseMinAhead:t,ahead:n.ahead,readyState:e.readyState,reasons:c,mediaSourceReadyState:n.engineReadiness?.mediaSourceReadyState??null,sourceBuffersUpdating:n.engineReadiness?.sourceBuffersUpdating??null,appendQueueDepth:n.engineReadiness?.appendQueueDepth??null,appendWaitActive:n.engineReadiness?.appendWaitActive??null,appendBackpressureCount:n.engineReadiness?.appendBackpressureCount??null}))},h=d();if(h.hasBufferedRange&&h.readyEnough&&h.ahead>=f(h,0)&&h.mediaSourceOpen&&h.sourceBuffersIdle){r.onTelemetry(`startup_gate_ready`,Date.now(),{minAhead:f(h,0),baseMinAhead:t,ahead:h.ahead,readyState:e.readyState,waitedMs:0});return}await new Promise(n=>{let i=!1,l=null,u=null,p=()=>{l!==null&&window.cancelAnimationFrame(l),u!==null&&window.clearTimeout(u);for(let t of[`progress`,`loadeddata`,`canplay`,`canplaythrough`])e.removeEventListener(t,_)},h=(e,t)=>{i||(i=!0,p(),r.onTelemetry(e,Date.now(),t),n())},g=()=>{if(i||x){p(),n();return}let r=Date.now()-c,u=d(),_=f(u,r),{ahead:v,readyEnough:y,hasBufferedRange:b,mediaSourceOpen:S,sourceBuffersIdle:C}=u;if(b&&y&&v>=_&&S&&C){h(`startup_gate_ready`,{minAhead:_,baseMinAhead:t,ahead:v,readyState:e.readyState,waitedMs:r});return}if(m(u,r,_),r>=o){h(`startup_gate_timeout`,{minAhead:_,baseMinAhead:t,ahead:v,readyState:e.readyState,waitedMs:r});return}l=window.requestAnimationFrame(g)},_=()=>{g()};for(let t of[`progress`,`loadeddata`,`canplay`,`canplaythrough`])e.addEventListener(t,_);u=window.setTimeout(g,o),g()})},N=()=>{S?.(),S=null;let e=e=>{if(`requestVideoFrameCallback`in HTMLVideoElement.prototype){let t=e,n=t.requestVideoFrameCallback(()=>{r.onFirstFrame()});S=()=>{t.cancelVideoFrameCallback?.(n)};return}{let t=null,n=Date.now(),i=()=>{if(!e.paused&&e.currentTime>0&&e.readyState>=2){r.onFirstFrame();return}Date.now()-n>15e3||(t=window.requestAnimationFrame(i))};t=window.requestAnimationFrame(i);let o=S;S=()=>{o?.(),t!==null&&window.cancelAnimationFrame(t)}}},t=i.querySelector(`video`);if(t){e(t);return}let n=new MutationObserver(()=>{let t=i.querySelector(`video`);t&&(n.disconnect(),e(t))});n.observe(i,{childList:!0,subtree:!0}),S=()=>{n.disconnect()}},P=0,F=0,I=null,L=async e=>{if(x)throw Error(`Player has been destroyed`);let t=++P;S?.(),r.resetForNewSource(),r.onSourceLoadRequested();let i=b(e.src),o=f(e.src,e.mimeType),c=[e.type,o].some(e=>e===`dash`||e===`hls`)?y(e.src):()=>void 0;try{await v(e),!x&&t===P&&await n.load(e)}finally{i(),c()}},R=e=>{++F;let t=L(e);I=t;let n=()=>{I===t&&(I=null)};return t.then(n,n),t};t.source&&R(t.source).catch(e=>console.error(`Autoload failed`,e));let z={load:R,play:async()=>{let e=++F;if(r.onPlayCalled(),I&&await I,x||e!==F)return;let i=t.performance;if(!(i?.startupMode===`fast-first-frame`&&i.startupBufferSeconds===void 0&&i.startupStrategy!==`safe`)&&n.getState().currentTime===0&&await M(),!(x||e!==F))return n.play()},pause:()=>{++F,n.pause()},destroy:async()=>{x||(x=!0,l&&l.destroy(),u&&u.destroy(),d&&d.destroy(),p&&p.destroy(),S?.(),await n.destroy(),g?.remove(),Rd.delete(i))},seek:e=>n.seek(e),setVolume:e=>n.setVolume(e),setMuted:e=>n.setMuted(e),setPlaybackRate:e=>n.setPlaybackRate(e),setToolbar:e=>l?.setToolbar(e),setTheme:e=>{i&&C(i.querySelector(`.flux-player-wrapper`)||i,e)},setQuality:e=>n.setQuality(e),setSubtitle:e=>n.setSubtitle(e),setAudioTrack:e=>n.setAudioTrack(e),getState:()=>n.getState(),getStats:()=>n.getStats(),getStartupMetrics:()=>r.getStartupMetrics(),printStartupReport:()=>r.printStartupReport(),on:(e,t)=>n.on(e,t)};return z.setDevtoolsVisible=e=>{p?.setVisible(e)},z.isDevtoolsVisible=()=>p?.isVisible()??!1,z.getSessionTrace=()=>{let e=d?.getSessionTrace()??[],t=r.getSessionTrace();return[...e,...t].sort((e,t)=>e.at-t.at)},n.on(`telemetry`,e=>{r.onTelemetry(e?.name||`telemetry`,e?.at||Date.now(),e?.data)}),n.on(`waiting`,()=>{r.onWaiting()}),n.on(`playback_requested`,()=>r.onPlayCalled()),n.on(`play`,()=>{N(),r.onPlayCalled()}),n.on(`playing`,()=>{r.onPlaying()}),n.on(`error`,e=>{r.onError(e)}),z}var Vd=`[data-flux-player]`,Hd=e=>{if(e!==null)return e===`true`||e===`1`},Ud=e=>{let t=e.getAttribute(`data-src`);if(!t)throw Error(`Missing data-src for data-flux-player element.`);let n=e.getAttribute(`data-type`)||`auto`,r=e.getAttribute(`data-poster`)||void 0,i=e.getAttribute(`data-thumbnail-vtt`)||void 0,o=e.getAttribute(`data-theme`)||`dark`,c=e.getAttribute(`data-startup-mode`)||`fast-first-frame`;return{source:{src:t,type:n,poster:r,thumbnailVtt:i,autoplay:Hd(e.getAttribute(`data-autoplay`)),muted:Hd(e.getAttribute(`data-muted`))},theme:o,performance:{startupMode:c}}},Wd=(e={})=>{let t=e.selector||Vd,n=e.root||document,r=Array.from(n.querySelectorAll(t)).filter(e=>e instanceof HTMLElement),i=[];for(let e of r){if(e.dataset.fluxMounted===`true`)continue;let t=Bd(e,Ud(e));i.push(t),e.dataset.fluxMounted=`true`}return i};typeof window<`u`&&typeof document<`u`&&window.__FLUX_AUTO_INIT__!==!1&&(document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,()=>Wd(),{once:!0}):Wd());var Gd={createPlayer:Bd,autoInitFluxPlayers:Wd};typeof window<`u`&&(window.Flux=Gd),e.Flux=Gd,e.autoInitFluxPlayers=Wd,e.createPlayer=Bd});