UNPKG

spectatr-player-sdk

Version:

A custom video player built with Stencil with Shaka Player integration

78 lines 826 kB
import{r as t,a as n,h as e,c as i,H as r}from"./p-DL4jhjLq.js";import{a,b as u,c as s}from"./p-iOhrDaXh.js";function o(t){const{player:n}=t;if(!n)return;const e=n.getAudioTracks();const i=new Map;e.forEach((t=>{const n=t.language;if(!i.has(n)){i.set(n,{index:t.id,language:n,label:t.label||`Audio ${n}`,enabled:t.active})}}));t.audioTracks=Array.from(i.values());t.currentAudioTrack=0;f(t)}function f(t){const{player:n}=t;if(!n)return;const e=n.getVariantTracks();t.qualities=e.filter((n=>!n.label||n.label===t.audioTracks[t.currentAudioTrack]?.label)).reduce(((t,n)=>{const e=n.height?`${n.height}p`:`${Math.floor(n.bandwidth/1e3)}kbps`;t.push({index:n.id,height:n.height,bitrate:n.bandwidth,name:e});return t}),[]);t.currentQuality=-1}function c(t){const n=t.videoElement;if(n.paused){n.play();t.playVideo.emit();window.parent.postMessage({type:"ON_VIDEO_PLAY"},"*")}else{n.pause();t.pauseVideo.emit();window.parent.postMessage({type:"ON_VIDEO_PAUSE"},"*")}}function l(t){t.videoElement.muted=!t.videoElement.muted}function h(t,n){if(n!==0&&t.videoElement.muted){t.videoElement.muted=false}t.videoElement.volume=n}function d(t,n){if(t.isLive){const e=t.player.seekRange().start;t.videoElement.currentTime=Math.max(n,e);t.currentTime=t.videoElement.currentTime}else{t.videoElement.currentTime=n;t.currentTime=n}}function v(t){t.videoElement.currentTime=Math.min(t.duration,t.videoElement.currentTime+10)}function p(t){let n=t.videoElement.currentTime-10;if(t.isLive){const e=t.player.seekRange().start;if(n<e){n=e}}t.videoElement.currentTime=n}const m=t=>{const n=t.videoContainer;if(!n){console.error("Video container element not found");t.videoError.emit("Video container element not found");return}if(!document.fullscreenElement){if(n.requestFullscreen){n.requestFullscreen().then((()=>{t.isFullscreen=true})).catch((n=>{console.error("Error attempting to enable fullscreen:",n);t.videoError.emit("Error attempting to enable fullscreen")}))}}else{if(document.exitFullscreen){document.exitFullscreen().then((()=>{t.isFullscreen=false})).catch((n=>{console.error("Error attempting to exit fullscreen:",n);t.videoError.emit("Error attempting to exit fullscreen")}))}}};function w(t){t.progressUpdateInterval=setInterval((()=>{t.currentTime=t.videoElement.currentTime}),100)}function g(t){if(t.progressUpdateInterval){clearInterval(t.progressUpdateInterval)}}async function b(t,n){if(!t.player)return;if(n===-1){t.player.configure({abr:{enabled:true}})}else{t.player.configure({abr:{enabled:false}});const e=t.player.getVariantTracks().filter((n=>!n.label||n.label===t.audioTracks[t.currentAudioTrack]?.label));t.player.selectVariantTrack(e[n],true)}t.currentQuality=n}function y(t,n){if(!t.player)return;const e=t.player.getAudioTracks();if(e[n]){t.player.selectAudioTrack(e[n]);t.currentAudioTrack=n;f(t)}}function k(t,n){n.stopPropagation();t.showSettings=!t.showSettings;if(t.showSettings){t.showMainSettings=true;t.showQualityOptions=false;t.showAudioOptions=false}}function T(t){t.duration=t.player.seekRange().end;t.videoElement.currentTime=t.duration}function E(t,n){if(!t.showSettings)return;const e=t.hostElement.shadowRoot?.querySelector(".settings-menu");const i=t.hostElement.shadowRoot?.querySelector(".control-btn");const r=e?.contains(n.target);const a=i?.contains(n.target);if(!r&&!a){t.showSettings=false;t.showQualityOptions=false;t.showAudioOptions=false}}function S(t){return t.videoDescription.length>200}function A(t){t.showFullDescription=!t.showFullDescription}async function I(t){try{t.isLiked=!t.isLiked;t.isDisliked=false;t.totalLikes=t.isLiked?t.totalLikes+1:t.totalLikes-1;await a(t,"like")}catch(n){t.isLiked=!t.isLiked;t.isDisliked=false;t.totalLikes=t.isLiked?t.totalLikes+1:t.totalLikes-1;console.error("like toggle failed:",n);t.videoError.emit("React to video failed")}}async function M(t){const n=t.isLiked;const e=t.isDisliked;const i=t.totalLikes;try{if(t.isLiked){t.isLiked=false;t.totalLikes--}t.isDisliked=!t.isDisliked;await a(t,"dislike")}catch(r){t.isLiked=n;t.isDisliked=e;t.totalLikes=i;console.error("Dislike toggle failed:",r);t.videoError.emit("React to video failed")}}function x(t){const n=new Date(t);const e=new Date;const i=Math.floor((e.getTime()-n.getTime())/1e3);const r={year:31536e3,month:2592e3,week:604800,day:86400,hour:3600,minute:60,second:1};for(const[t,n]of Object.entries(r)){const e=Math.floor(i/n);if(e>=1){return new Intl.RelativeTimeFormat("en",{numeric:"auto"}).format(-e,t)}}return"just now"}function N(t){return Math.abs(t)>=1e9?(t/1e9).toFixed(1).replace(/\.0$/,"")+"B":Math.abs(t)>=1e6?(t/1e6).toFixed(1).replace(/\.0$/,"")+"M":Math.abs(t)>=1e3?(t/1e3).toFixed(1).replace(/\.0$/,"")+"K":t.toString()}function C(t){if(t)return t;if(localStorage.getItem("spactatr_user_id")){return localStorage.getItem("spactatr_user_id")}else{const t=crypto.randomUUID();localStorage.setItem("spactatr_user_id",t);return t}}function P(t){t.src=null;t.token=null;t.videoDescription="";t.videoTitle="";t.isLoading=true;t.showPoll=false;t.showQuiz=false;t.pollAnswered=[];t.quizAnswered=[];t.quizzes=null;t.timelineEvents=[];t.isLive=false;t.currentTime=0;t.duration=0;clearTimeout(t.controlsTimeout);clearInterval(t.progressUpdateInterval);clearInterval(t.livePollingInterval);clearInterval(t.reactionPollingInterval)}function R(t,n){switch(t){case"minimal-dark":n.style.setProperty("--vp-primary-bg","#121212");n.style.setProperty("--vp-controls-bg","rgba(0, 0, 0, 0.7)");n.style.setProperty("--vp-accent","#ff5555");n.style.setProperty("--vp-video-text","#ffffff");n.style.setProperty("--vp-text","#ffffff");break;case"minimal-light":n.style.setProperty("--vp-primary-bg","#f8f8f8");n.style.setProperty("--vp-controls-bg","rgba(48, 48, 48, 0.7)");n.style.setProperty("--vp-accent","#e53e3e");n.style.setProperty("--vp-video-text","#ffffff");n.style.setProperty("--vp-text","#1a202c");break;case"classic-youtube":n.style.setProperty("--vp-primary-bg","#f9f9f9");n.style.setProperty("--vp-controls-bg","rgba(0, 0, 0, 0.7)");n.style.setProperty("--vp-accent","#065fd4");n.style.setProperty("--vp-video-text","#ffffff");n.style.setProperty("--vp-text","#000");break;case"cinema-mode":n.style.setProperty("--vp-primary-bg","#f9f9f9");n.style.setProperty("--vp-controls-bg","rgba(156, 3, 29, 0.45)");n.style.setProperty("--vp-accent","#cd2843ff");n.style.setProperty("--vp-video-text","#ffffff");n.style.setProperty("--vp-text","#000");break;case"true-back":n.style.setProperty("--vp-primary-bg","#000000");n.style.setProperty("--vp-controls-bg","rgba(255, 255, 255, 0.3)");n.style.setProperty("--vp-accent","#000000");n.style.setProperty("--vp-video-text","#ffffff");n.style.setProperty("--vp-text","#aaaaaa");break}}const D=":host{display:block;position:relative;float:calc(50%);width:100%;height:100%;background:var(--vp-primary-bg);--title-font:'Inter', -apple-system, sans-serif;--description-font:'SF Pro Text', system-ui, sans-serif;padding:2px;border-radius:4px}.video-wrapper-container{display:flex;justify-content:space-between;height:100%;gap:1.5rem}@media (max-width: 768px){.video-wrapper-container{flex-direction:column;gap:2rem}}";const L=class{constructor(n){t(this,n)}clientId;baseUrl="https://media-ingestion.antino.ca";videoId="";userId="";autoPlay=false;showSuggestions=true;captureReaction=true;theme="classic-youtube";get host(){return n(this)}_videoId;_nextVideoId;_clientId;_userId;_baseUrl;_autoPlay;_showSuggestions;_captureReaction;_theme;isIframe=false;suggestions=[];suggestionsHeight=0;componentWillLoad(){this.isIframe=window.self!==window.top;const t=new URLSearchParams(window.location.search);this._videoId=t.get("videoId")||this.videoId;this._clientId=t.get("clientId")||this.clientId;this._userId=C(t.get("userId")||this.userId);this._baseUrl=t.get("baseUrl")||this.baseUrl;this._autoPlay=t.get("autoPlay")?t.get("autoPlay")==="true":this.autoPlay;this._showSuggestions=t.get("showSuggestions")?t.get("showSuggestions")==="true":this.showSuggestions;this._captureReaction=t.get("captureReaction")?t.get("captureReaction")==="true":this.captureReaction;this._theme=t.get("theme")??this.theme;const n=document.documentElement;R(this._theme,n)}setPlayerHeight(){const t=this.host.shadowRoot.querySelector("video-player");if(!t){return}const n=t.shadowRoot;if(!t)return;const e=n.querySelector("#spectart-video-player")?.clientHeight;const i=n.querySelector(".video-info")?.clientHeight;this.suggestionsHeight=e+(i??10)}setNextVideoId(){if(!this.suggestions.length)return;let t=-1;t=this.suggestions.findIndex((t=>t.id===this._videoId));if(t>=0&&t<this.suggestions.length-1){this._nextVideoId=this.suggestions[t+1].id}else if(t<0){this._nextVideoId=this.suggestions[0].id}}setVideoId=t=>{if(!t)return;this._videoId=t;this.setNextVideoId();this.setPlayerHeight()};setSuggestions=t=>{this.suggestions=t;this.setPlayerHeight();this.setNextVideoId()};render(){if(!this._clientId){console.error("Please provide client id to the player to proceed.");return}return e("div",{class:"video-wrapper-container"},e("video-player",{autoPlay:this._autoPlay,captureReaction:this._captureReaction,videoId:this._videoId,userId:this._userId,clientId:this._clientId,baseUrl:this._baseUrl,setVideoId:this.setVideoId,nextVideoId:this._nextVideoId}),this._showSuggestions&&e("video-suggestions",{baseUrl:this._baseUrl,height:this.suggestionsHeight,clientId:this._clientId,setSuggestions:this.setSuggestions,videoId:this._videoId,handlePlaySuggestion:this.setVideoId}))}};L.style=D;var O=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function _(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t["default"]:t}var U={};
/*
 @license
 Shaka Player
 Copyright 2016 Google LLC
 SPDX-License-Identifier: Apache-2.0
*/var B;function H(){if(B)return U;B=1;(function(t){(function(){var n=typeof window!="undefined"?window:O;var e={};(function(t,n,e){var i;function r(t){var n=0;return function(){return n<t.length?{done:false,value:t[n++]}:{done:true}}}var a="function"==typeof Object.defineProperties?Object.defineProperty:function(t,n,e){if(t==Array.prototype||t==Object.prototype)return t;t[n]=e.value;return t};function u(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof t&&t,"object"==typeof self&&self,"object"==typeof n&&n];for(var i=0;i<e.length;++i){var r=e[i];if(r&&r.Math==Math)return r}throw Error("Cannot find global object")}var s=u(this);function o(t,n){if(n)t:{var e=s;t=t.split(".");for(var i=0;i<t.length-1;i++){var r=t[i];if(!(r in e))break t;e=e[r]}t=t[t.length-1];i=e[t];n=n(i);n!=i&&null!=n&&a(e,t,{configurable:true,writable:true,value:n})}}o("Symbol",(function(t){function n(t){if(this instanceof n)throw new TypeError("Symbol is not a constructor");return new e(i+(t||"")+"_"+r++,t)}function e(t,n){this.g=t;a(this,"description",{configurable:true,writable:true,value:n})}if(t)return t;e.prototype.toString=function(){return this.g};var i="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",r=0;return n}));o("Symbol.iterator",(function(t){if(t)return t;t=Symbol("Symbol.iterator");for(var n="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),e=0;e<n.length;e++){var i=s[n[e]];"function"===typeof i&&"function"!=typeof i.prototype[t]&&a(i.prototype,t,{configurable:true,writable:true,value:function(){return f(r(this))}})}return t}));function f(t){t={next:t};t[Symbol.iterator]=function(){return this};return t}function c(t){var n="undefined"!=typeof Symbol&&Symbol.iterator&&t[Symbol.iterator];if(n)return n.call(t);if("number"==typeof t.length)return{next:r(t)};throw Error(String(t)+" is not an iterable or ArrayLike")}function l(t){if(!(t instanceof Array)){t=c(t);for(var n,e=[];!(n=t.next()).done;)e.push(n.value);t=e}return t}var h="function"==typeof Object.create?Object.create:function(t){function n(){}n.prototype=t;return new n},d;if("function"==typeof Object.setPrototypeOf)d=Object.setPrototypeOf;else{var v;t:{var p={a:true},m={};try{m.__proto__=p;v=m.a;break t}catch(t){}v=false}d=v?function(t,n){t.__proto__=n;if(t.__proto__!==n)throw new TypeError(t+" is not extensible");return t}:null}var w=d;function g(t,n){t.prototype=h(n.prototype);t.prototype.constructor=t;if(w)w(t,n);else for(var e in n)if("prototype"!=e)if(Object.defineProperties){var i=Object.getOwnPropertyDescriptor(n,e);i&&Object.defineProperty(t,e,i)}else t[e]=n[e];t.ym=n.prototype}function b(){this.o=false;this.l=null;this.h=void 0;this.g=1;this.j=this.m=0;this.A=this.i=null}function y(t){if(t.o)throw new TypeError("Generator is already running");t.o=true}b.prototype.s=function(t){this.h=t};function k(t,n){t.i={Qh:n,bi:true};t.g=t.m||t.j}b.prototype.return=function(t){this.i={return:t};this.g=this.j};function T(t,n,e){t.g=e;return{value:n}}b.prototype.u=function(t){this.g=t};function E(t){t.g=0}function S(t,n,e){t.m=n;void 0!=e&&(t.j=e)}function A(t,n){t.m=0;t.j=n||0}function I(t,n,e){t.g=n;t.m=e||0}function M(t,n){t.m=n||0;n=t.i.Qh;t.i=null;return n}function x(t){t.A=[t.i];t.m=0;t.j=0}function N(t,n){var e=t.A.splice(0)[0];(e=t.i=t.i||e)?e.bi?t.g=t.m||t.j:void 0!=e.u&&t.j<e.u?(t.g=e.u,t.i=null):t.g=t.j:t.g=n}function C(t){this.g=new b;this.h=t}function P(t,n){y(t.g);var e=t.g.l;if(e)return R(t,"return"in e?e["return"]:function(t){return{value:t,done:true}},n,t.g.return);t.g.return(n);return D(t)}function R(t,n,e,i){try{var r=n.call(t.g.l,e);if(!(r instanceof Object))throw new TypeError("Iterator result "+r+" is not an object");if(!r.done)return t.g.o=false,r;var a=r.value}catch(n){return t.g.l=null,k(t.g,n),D(t)}t.g.l=null;i.call(t.g,a);return D(t)}function D(t){for(;t.g.g;)try{var n=t.h(t.g);if(n)return t.g.o=false,{value:n.value,done:false}}catch(n){t.g.h=void 0,k(t.g,n)}t.g.o=false;if(t.g.i){n=t.g.i;t.g.i=null;if(n.bi)throw n.Qh;return{value:n.return,done:true}}return{value:void 0,done:true}}function L(t){this.next=function(n){y(t.g);t.g.l?n=R(t,t.g.l.next,n,t.g.s):(t.g.s(n),n=D(t));return n};this.throw=function(n){y(t.g);t.g.l?n=R(t,t.g.l["throw"],n,t.g.s):(k(t.g,n),n=D(t));return n};this.return=function(n){return P(t,n)};this[Symbol.iterator]=function(){return this}}function O(t){function n(n){return t.next(n)}function e(n){return t.throw(n)}return new Promise((function(i,r){function a(t){t.done?i(t.value):Promise.resolve(t.value).then(n,e).then(a,r)}a(t.next())}))}function _(t){return O(new L(new C(t)))}function U(){for(var t=Number(this),n=[],e=t;e<arguments.length;e++)n[e-t]=arguments[e];return n}o("Promise",(function(t){function n(t){this.h=0;this.i=void 0;this.g=[];this.o=false;var n=this.j();try{t(n.resolve,n.reject)}catch(t){n.reject(t)}}function e(){this.g=null}function i(t){return t instanceof n?t:new n((function(n){n(t)}))}if(t)return t;e.prototype.h=function(t){if(null==this.g){this.g=[];var n=this;this.i((function(){n.l()}))}this.g.push(t)};var r=s.setTimeout;e.prototype.i=function(t){r(t,0)};e.prototype.l=function(){for(;this.g&&this.g.length;){var t=this.g;this.g=[];for(var n=0;n<t.length;++n){var e=t[n];t[n]=null;try{e()}catch(t){this.j(t)}}}this.g=null};e.prototype.j=function(t){this.i((function(){throw t}))};n.prototype.j=function(){function t(t){return function(i){e||(e=true,t.call(n,i))}}var n=this,e=false;return{resolve:t(this.F),reject:t(this.l)}};n.prototype.F=function(t){if(t===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(t instanceof n)this.H(t);else{t:switch(typeof t){case"object":var e=null!=t;break t;case"function":e=true;break t;default:e=false}e?this.C(t):this.m(t)}};n.prototype.C=function(t){var n=void 0;try{n=t.then}catch(t){this.l(t);return}"function"==typeof n?this.I(n,t):this.m(t)};n.prototype.l=function(t){this.s(2,t)};n.prototype.m=function(t){this.s(1,t)};n.prototype.s=function(t,n){if(0!=this.h)throw Error("Cannot settle("+t+", "+n+"): Promise already settled in state"+this.h);this.h=t;this.i=n;2===this.h&&this.G();this.A()};n.prototype.G=function(){var t=this;r((function(){if(t.B()){var n=s.console;"undefined"!==typeof n&&n.error(t.i)}}),1)};n.prototype.B=function(){if(this.o)return false;var t=s.CustomEvent,n=s.Event,e=s.dispatchEvent;if("undefined"===typeof e)return true;"function"===typeof t?t=new t("unhandledrejection",{cancelable:true}):"function"===typeof n?t=new n("unhandledrejection",{cancelable:true}):(t=s.document.createEvent("CustomEvent"),t.initCustomEvent("unhandledrejection",false,true,t));t.promise=this;t.reason=this.i;return e(t)};n.prototype.A=function(){if(null!=this.g){for(var t=0;t<this.g.length;++t)a.h(this.g[t]);this.g=null}};var a=new e;n.prototype.H=function(t){var n=this.j();t.Je(n.resolve,n.reject)};n.prototype.I=function(t,n){var e=this.j();try{t.call(n,e.resolve,e.reject)}catch(t){e.reject(t)}};n.prototype.then=function(t,e){function i(t,n){return"function"==typeof t?function(n){try{r(t(n))}catch(t){a(t)}}:n}var r,a,u=new n((function(t,n){r=t;a=n}));this.Je(i(t,r),i(e,a));return u};n.prototype.catch=function(t){return this.then(void 0,t)};n.prototype.Je=function(t,n){function e(){switch(i.h){case 1:t(i.i);break;case 2:n(i.i);break;default:throw Error("Unexpected state: "+i.h)}}var i=this;null==this.g?a.h(e):this.g.push(e);this.o=true};n.resolve=i;n.reject=function(t){return new n((function(n,e){e(t)}))};n.race=function(t){return new n((function(n,e){for(var r=c(t),a=r.next();!a.done;a=r.next())i(a.value).Je(n,e)}))};n.all=function(t){var e=c(t),r=e.next();return r.done?i([]):new n((function(t,n){function a(n){return function(e){u[n]=e;s--;0==s&&t(u)}}var u=[],s=0;do{u.push(void 0),s++,i(r.value).Je(a(u.length-1),n),r=e.next()}while(!r.done)}))};return n}));function B(t,n){return Object.prototype.hasOwnProperty.call(t,n)}o("WeakMap",(function(t){function n(t){this.g=(o+=Math.random()+1).toString();if(t){t=c(t);for(var n;!(n=t.next()).done;)n=n.value,this.set(n[0],n[1])}}function e(){}function i(t){var n=typeof t;return"object"===n&&null!==t||"function"===n}function r(t){if(!B(t,s)){var n=new e;a(t,s,{value:n})}}function u(t){var n=Object[t];n&&(Object[t]=function(t){if(t instanceof e)return t;Object.isExtensible(t)&&r(t);return n(t)})}if(function(){if(!t||!Object.seal)return false;try{var n=Object.seal({}),e=Object.seal({}),i=new t([[n,2],[e,3]]);if(2!=i.get(n)||3!=i.get(e))return false;i.delete(n);i.set(e,4);return!i.has(n)&&4==i.get(e)}catch(t){return false}}())return t;var s="$jscomp_hidden_"+Math.random();u("freeze");u("preventExtensions");u("seal");var o=0;n.prototype.set=function(t,n){if(!i(t))throw Error("Invalid WeakMap key");r(t);if(!B(t,s))throw Error("WeakMap key fail: "+t);t[s][this.g]=n;return this};n.prototype.get=function(t){return i(t)&&B(t,s)?t[s][this.g]:void 0};n.prototype.has=function(t){return i(t)&&B(t,s)&&B(t[s],this.g)};n.prototype.delete=function(t){return i(t)&&B(t,s)&&B(t[s],this.g)?delete t[s][this.g]:false};return n}));o("Map",(function(t){function n(){var t={};return t.sc=t.next=t.head=t}function e(t,n){var e=t[1];return f((function(){if(e){for(;e.head!=t[1];)e=e.sc;for(;e.next!=e.head;)return e=e.next,{done:false,value:n(e)};e=null}return{done:true,value:void 0}}))}function i(t,n){var e=n&&typeof n;"object"==e||"function"==e?a.has(n)?e=a.get(n):(e=""+ ++u,a.set(n,e)):e="p_"+n;var i=t[0][e];if(i&&B(t[0],e))for(t=0;t<i.length;t++){var r=i[t];if(n!==n&&r.key!==r.key||n===r.key)return{id:e,list:i,index:t,entry:r}}return{id:e,list:i,index:-1,entry:void 0}}function r(t){this[0]={};this[1]=n();this.size=0;if(t){t=c(t);for(var e;!(e=t.next()).done;)e=e.value,this.set(e[0],e[1])}}if(function(){if(!t||"function"!=typeof t||!t.prototype.entries||"function"!=typeof Object.seal)return false;try{var n=Object.seal({x:4}),e=new t(c([[n,"s"]]));if("s"!=e.get(n)||1!=e.size||e.get({x:4})||e.set({x:4},"t")!=e||2!=e.size)return false;var i=e.entries(),r=i.next();if(r.done||r.value[0]!=n||"s"!=r.value[1])return false;r=i.next();return r.done||4!=r.value[0].x||"t"!=r.value[1]||!i.next().done?false:true}catch(t){return false}}())return t;var a=new WeakMap;r.prototype.set=function(t,n){t=0===t?0:t;var e=i(this,t);e.list||(e.list=this[0][e.id]=[]);e.entry?e.entry.value=n:(e.entry={next:this[1],sc:this[1].sc,head:this[1],key:t,value:n},e.list.push(e.entry),this[1].sc.next=e.entry,this[1].sc=e.entry,this.size++);return this};r.prototype.delete=function(t){t=i(this,t);return t.entry&&t.list?(t.list.splice(t.index,1),t.list.length||delete this[0][t.id],t.entry.sc.next=t.entry.next,t.entry.next.sc=t.entry.sc,t.entry.head=null,this.size--,true):false};r.prototype.clear=function(){this[0]={};this[1]=this[1].sc=n();this.size=0};r.prototype.has=function(t){return!!i(this,t).entry};r.prototype.get=function(t){return(t=i(this,t).entry)&&t.value};r.prototype.entries=function(){return e(this,(function(t){return[t.key,t.value]}))};r.prototype.keys=function(){return e(this,(function(t){return t.key}))};r.prototype.values=function(){return e(this,(function(t){return t.value}))};r.prototype.forEach=function(t,n){for(var e=this.entries(),i;!(i=e.next()).done;)i=i.value,t.call(n,i[1],i[0],this)};r.prototype[Symbol.iterator]=r.prototype.entries;var u=0;return r}));o("Set",(function(t){function n(t){this.g=new Map;if(t){t=c(t);for(var n;!(n=t.next()).done;)this.add(n.value)}this.size=this.g.size}if(function(){if(!t||"function"!=typeof t||!t.prototype.entries||"function"!=typeof Object.seal)return false;try{var n=Object.seal({x:4}),e=new t(c([n]));if(!e.has(n)||1!=e.size||e.add(n)!=e||1!=e.size||e.add({x:4})!=e||2!=e.size)return false;var i=e.entries(),r=i.next();if(r.done||r.value[0]!=n||r.value[1]!=n)return false;r=i.next();return r.done||r.value[0]==n||4!=r.value[0].x||r.value[1]!=r.value[0]?false:i.next().done}catch(t){return false}}())return t;n.prototype.add=function(t){t=0===t?0:t;this.g.set(t,t);this.size=this.g.size;return this};n.prototype.delete=function(t){t=this.g.delete(t);this.size=this.g.size;return t};n.prototype.clear=function(){this.g.clear();this.size=0};n.prototype.has=function(t){return this.g.has(t)};n.prototype.entries=function(){return this.g.entries()};n.prototype.values=function(){return this.g.values()};n.prototype.keys=n.prototype.values;n.prototype[Symbol.iterator]=n.prototype.values;n.prototype.forEach=function(t,n){var e=this;this.g.forEach((function(i){return t.call(n,i,i,e)}))};return n}));function H(t,n){t instanceof String&&(t+="");var e=0,i=false,r={next:function(){if(!i&&e<t.length){var r=e++;return{value:n(r,t[r]),done:false}}i=true;return{done:true,value:void 0}}};r[Symbol.iterator]=function(){return r};return r}o("Array.prototype.values",(function(t){return t?t:function(){return H(this,(function(t,n){return n}))}}));o("Array.from",(function(t){return t?t:function(t,n,e){n=null!=n?n:function(t){return t};var i=[],r="undefined"!=typeof Symbol&&Symbol.iterator&&t[Symbol.iterator];if("function"==typeof r){t=r.call(t);for(var a=0;!(r=t.next()).done;)i.push(n.call(e,r.value,a++))}else for(r=t.length,a=0;a<r;a++)i.push(n.call(e,t[a],a));return i}}));o("Array.prototype.keys",(function(t){return t?t:function(){return H(this,(function(t){return t}))}}));o("Object.is",(function(t){return t?t:function(t,n){return t===n?0!==t||1/t===1/n:t!==t&&n!==n}}));o("Array.prototype.includes",(function(t){return t?t:function(t,n){var e=this;e instanceof String&&(e=String(e));var i=e.length;n=n||0;for(0>n&&(n=Math.max(n+i,0));n<i;n++){var r=e[n];if(r===t||Object.is(r,t))return true}return false}}));function F(t,n,e){if(null==t)throw new TypeError("The 'this' value for String.prototype."+e+" must not be null or undefined");if(n instanceof RegExp)throw new TypeError("First argument to String.prototype."+e+" must not be a regular expression");return t+""}o("String.prototype.includes",(function(t){return t?t:function(t,n){return-1!==F(this,t,"includes").indexOf(t,n||0)}}));o("String.fromCodePoint",(function(t){return t?t:function(t){for(var n="",e=0;e<arguments.length;e++){var i=Number(arguments[e]);if(0>i||1114111<i||i!==Math.floor(i))throw new RangeError("invalid_code_point "+i);65535>=i?n+=String.fromCharCode(i):(i-=65536,n+=String.fromCharCode(i>>>10&1023|55296),n+=String.fromCharCode(i&1023|56320))}return n}}));function V(t,n,e){t instanceof String&&(t=String(t));for(var i=t.length,r=0;r<i;r++){var a=t[r];if(n.call(e,a,r,t))return{Zh:r,v:a}}return{Zh:-1,v:void 0}}o("Array.prototype.findIndex",(function(t){return t?t:function(t,n){return V(this,t,n).Zh}}));o("WeakSet",(function(t){function n(t){this.g=new WeakMap;if(t){t=c(t);for(var n;!(n=t.next()).done;)this.add(n.value)}}if(function(){if(!t||!Object.seal)return false;try{var n=Object.seal({}),e=Object.seal({}),i=new t([n]);if(!i.has(n)||i.has(e))return false;i.delete(n);i.add(e);return!i.has(n)&&i.has(e)}catch(t){return false}}())return t;n.prototype.add=function(t){this.g.set(t,true);return this};n.prototype.has=function(t){return this.g.has(t)};n.prototype.delete=function(t){return this.g.delete(t)};return n}));o("Array.prototype.find",(function(t){return t?t:function(t,n){return V(this,t,n).v}}));o("String.prototype.startsWith",(function(t){return t?t:function(t,n){var e=F(this,t,"startsWith"),i=e.length,r=t.length;n=Math.max(0,Math.min(n|0,e.length));for(var a=0;a<r&&n<i;)if(e[n++]!=t[a++])return false;return a>=r}}));o("Object.entries",(function(t){return t?t:function(t){var n=[],e;for(e in t)B(t,e)&&n.push([e,t[e]]);return n}}));var z="function"==typeof Object.assign?Object.assign:function(t,n){for(var e=1;e<arguments.length;e++){var i=arguments[e];if(i)for(var r in i)B(i,r)&&(t[r]=i[r])}return t};o("Object.assign",(function(t){return t||z}));o("Promise.prototype.finally",(function(t){return t?t:function(t){return this.then((function(n){return Promise.resolve(t()).then((function(){return n}))}),(function(n){return Promise.resolve(t()).then((function(){throw n}))}))}}));o("Array.prototype.entries",(function(t){return t?t:function(){return H(this,(function(t,n){return[t,n]}))}}));o("Number.isNaN",(function(t){return t?t:function(t){return"number"===typeof t&&isNaN(t)}}));o("String.prototype.repeat",(function(t){return t?t:function(t){var n=F(this,null,"repeat");if(0>t||1342177279<t)throw new RangeError("Invalid count value");t|=0;for(var e="";t;)if(t&1&&(e+=n),t>>>=1)n+=n;return e}}));o("Number.EPSILON",(function(){return Math.pow(2,-52)}));o("Number.MAX_SAFE_INTEGER",(function(){return 9007199254740991}));o("Number.isFinite",(function(t){return t?t:function(t){return"number"!==typeof t?false:!isNaN(t)&&Infinity!==t&&-Infinity!==t}}));o("Object.values",(function(t){return t?t:function(t){var n=[],e;for(e in t)B(t,e)&&n.push(t[e]);return n}}));o("Math.log2",(function(t){return t?t:function(t){return Math.log(t)/Math.LN2}}));o("String.prototype.endsWith",(function(t){return t?t:function(t,n){var e=F(this,t,"endsWith");void 0===n&&(n=e.length);n=Math.max(0,Math.min(n|0,e.length));for(var i=t.length;0<i&&0<n;)if(e[--n]!=t[--i])return false;return 0>=i}}));o("Math.trunc",(function(t){return t?t:function(t){t=Number(t);if(isNaN(t)||Infinity===t||-Infinity===t||0===t)return t;var n=Math.floor(Math.abs(t));return 0>t?-n:n}}));var X=this||self;function q(t,n){t=t.split(".");var e=X;t[0]in e||"undefined"==typeof e.execScript||e.execScript("var "+t[0]);for(var i;t.length&&(i=t.shift());)t.length||void 0===n?e[i]&&e[i]!==Object.prototype[i]?e=e[i]:e=e[i]={}:e[i]=n}function j(t){this.g=Math.exp(Math.log(.5)/t);this.i=this.h=0}j.prototype.sample=function(t,n){var e=Math.pow(this.g,t);n=n*(1-e)+e*this.h;isNaN(n)||(this.h=n,this.i+=t)};function G(t){return t.h/(1-Math.pow(t.g,t.i))}function K(){this.h=new j(2);this.j=new j(5);this.g=0;this.i=128e3;this.l=16e3}K.prototype.configure=function(t){this.i=t.minTotalBytes;this.l=t.minBytes;this.h.g=Math.exp(Math.log(.5)/t.fastHalfLife);this.j.g=Math.exp(Math.log(.5)/t.slowHalfLife)};K.prototype.sample=function(t,n){if(!(n<this.l)){var e=8e3*n/t;t/=1e3;this.g+=n;this.h.sample(t,e);this.j.sample(t,e)}};K.prototype.getBandwidthEstimate=function(t){return this.g<this.i?t:Math.min(G(this.h),G(this.j))};function W(){}function $(){}function Y(){}function Q(t){var n=U.apply(1,arguments);nt.has(t)||(nt.add(t),Y.apply(W,l(n)))}function J(){}function Z(){}function tt(){}var nt=new Set;t.console&&((new Map).set(1,(function(){return console.error.apply(console,l(U.apply(0,arguments)))})).set(2,(function(){return console.warn.apply(console,l(U.apply(0,arguments)))})).set(3,(function(){return console.info.apply(console,l(U.apply(0,arguments)))})).set(4,(function(){return console.log.apply(console,l(U.apply(0,arguments)))})).set(5,(function(){return console.debug.apply(console,l(U.apply(0,arguments)))})).set(6,(function(){return console.debug.apply(console,l(U.apply(0,arguments)))})),Y=function(){return console.warn.apply(console,l(U.apply(0,arguments)))},$=function(){console.error.apply(console,l(U.apply(0,arguments)))});function et(){this.g=new Map}i=et.prototype;i.push=function(t,n){this.g.has(t)?this.g.get(t).push(n):this.g.set(t,[n])};i.get=function(t){return this.g.has(t)?this.g.get(t).slice():null};i.remove=function(t,n){if(this.g.has(t)){var e=this.g.get(t).filter((function(t){return t!=n}));this.g.set(t,e);e.length||this.g.delete(t)}};i.forEach=function(t){this.g.forEach((function(n,e){t(e,n)}))};i.size=function(){return this.g.size};i.keys=function(){return Array.from(this.g.keys())};function it(){this.g=new et}i=it.prototype;i.release=function(){this.Qa();this.g=null};i.D=function(t,n,e,i){this.g&&(t=new rt(t,n,e,i),this.g.push(n,t))};i.za=function(t,n,e,i){function r(i){a.Ja(t,n,r);e(i)}var a=this;this.D(t,n,r,i)};i.Ja=function(t,n,e){if(this.g){var i=this.g.get(n)||[];i=c(i);for(var r=i.next();!r.done;r=i.next())r=r.value,r.target!=t||e!=r.listener&&e||(r.Ja(),this.g.remove(n,r))}};i.Qa=function(){if(this.g){for(var t=[],n=c(this.g.g.values()),e=n.next();!e.done;e=n.next())t.push.apply(t,l(e.value));t=c(t);for(n=t.next();!n.done;n=t.next())n.value.Ja();this.g.g.clear()}};q("shaka.util.EventManager",it);it.prototype.removeAll=it.prototype.Qa;it.prototype.unlisten=it.prototype.Ja;it.prototype.listenOnce=it.prototype.za;it.prototype.listen=it.prototype.D;it.prototype.release=it.prototype.release;function rt(t,n,e,i){this.target=t;this.type=n;this.listener=e;this.g=at(t,i);this.target.addEventListener(n,e,this.g)}rt.prototype.Ja=function(){this.target.removeEventListener(this.type,this.listener,this.g);this.listener=this.target=null;this.g=false};function at(t,n){if(void 0==n)return false;if("boolean"==typeof n)return n;var e=new Set(["passive","capture"]);Object.keys(n).filter((function(t){return!e.has(t)}));return ut(t)?n:n.capture||false}function ut(t){var n=st;if(void 0==n){n=false;try{var e={},i={get:function(){n=true;return false}};Object.defineProperty(e,"passive",i);Object.defineProperty(e,"capture",i);i=function(){};t.addEventListener("test",i,e);t.removeEventListener("test",i,e)}catch(t){n=false}st=n}return n||false}var st=void 0;q("shaka.config.AutoShowText",{NEVER:0,ALWAYS:1,IF_PREFERRED_TEXT_LANGUAGE:2,IF_SUBTITLES_MAY_BE_NEEDED:3});function ot(t){this.h=t;this.g=void 0}ot.prototype.value=function(){void 0===this.g&&(this.g=this.h());return this.g};
/*
		 @license
		 Shaka Player
		 Copyright 2025 Google LLC
		 SPDX-License-Identifier: Apache-2.0
		*/function ft(){return ht.value()}var ct=null,lt=null,ht=new ot((function(){var t=void 0;ct&&(t=ct());!t&&lt&&(t=lt());return t}));function dt(t,n){this.g=t;this.h=n}dt.prototype.toString=function(){return"v"+this.g+"."+this.h};function vt(t,n){var e=new dt(5,0),i=wt,r=i.g,a=e.h-r.h;(0<(e.g-r.g||a)?i.i:i.h)(i.g,e,t,n)}function pt(t,n,e,i){Y([e,"has been deprecated and will be removed in",n,". We are currently at version",t,". Additional information:",i].join(" "))}function mt(t,n,e,i){$([e,"has been deprecated and has been removed in",n,". We are now at version",t,". Additional information:",i].join(" "))}var wt=null;
/*
		 @license
		 Copyright 2008 The Closure Library Authors
		 SPDX-License-Identifier: Apache-2.0
		*/var gt=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");
/*
		 @license
		 Copyright 2006 The Closure Library Authors
		 SPDX-License-Identifier: Apache-2.0
		*/function bt(t){var n;t instanceof bt?(yt(this,t.ac),this.bd=t.bd,kt(this,t.Cb),Tt(this,t.sd),this.mb=t.mb,Et(this,t.g.clone()),this.Mc=t.Mc):t&&(n=String(t).match(gt))?(yt(this,n[1]||"",true),this.bd=St(n[2]||""),kt(this,n[3]||"",true),Tt(this,n[4]),this.mb=St(n[5]||"",true),Et(this,n[6]||"",true),this.Mc=St(n[7]||"")):this.g=new Rt(null)}i=bt.prototype;i.ac="";i.bd="";i.Cb="";i.sd=null;i.mb="";i.Mc="";i.toString=function(){var t=[],n=this.ac;n&&t.push(At(n,Mt,true),":");if(n=this.Cb){t.push("//");var e=this.bd;e&&t.push(At(e,Mt,true),"@");t.push(encodeURIComponent(n).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));n=this.sd;null!=n&&t.push(":",String(n))}if(n=this.mb)this.Cb&&"/"!=n.charAt(0)&&t.push("/"),t.push(At(n,"/"==n.charAt(0)?Nt:xt,true));(n=this.g.toString())&&t.push("?",n);(n=this.Mc)&&t.push("#",At(n,Pt));return t.join("")};i.resolve=function(t){var n=this.clone();"data"===n.ac&&(n=new bt);var e=!!t.ac;e?yt(n,t.ac):e=!!t.bd;e?n.bd=t.bd:e=!!t.Cb;e?kt(n,t.Cb):e=null!=t.sd;var i=t.mb;if(e)Tt(n,t.sd);else if(e=!!t.mb){if("/"!=i.charAt(0))if(this.Cb&&!this.mb)i="/"+i;else{var r=n.mb.lastIndexOf("/");-1!=r&&(i=n.mb.substr(0,r+1)+i)}if(".."==i||"."==i)i="";else if(-1!=i.indexOf("./")||-1!=i.indexOf("/.")){r=0==i.lastIndexOf("/",0);i=i.split("/");for(var a=[],u=0;u<i.length;){var s=i[u++];"."==s?r&&u==i.length&&a.push(""):".."==s?((1<a.length||1==a.length&&""!=a[0])&&a.pop(),r&&u==i.length&&a.push("")):(a.push(s),r=true)}i=a.join("/")}}e?n.mb=i:e=""!==t.g.toString();e?Et(n,t.g.clone()):e=!!t.Mc;e&&(n.Mc=t.Mc);return n};i.clone=function(){return new bt(this)};function yt(t,n,e){t.ac=e?St(n,true):n;t.ac&&(t.ac=t.ac.replace(/:$/,""))}function kt(t,n,e){t.Cb=e?St(n,true):n}function Tt(t,n){if(n){n=Number(n);if(isNaN(n)||0>n)throw Error("Bad port number "+n);t.sd=n}else t.sd=null}function Et(t,n,e){n instanceof Rt?t.g=n:(e||(n=At(n,Ct)),t.g=new Rt(n))}function St(t,n){return t?n?decodeURI(t):decodeURIComponent(t):""}function At(t,n,e){return null!=t?(t=encodeURI(t).replace(n,It),e&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function It(t){t=t.charCodeAt(0);return"%"+(t>>4&15).toString(16)+(t&15).toString(16)}var Mt=/[#\/\?@]/g,xt=/[#\?:]/g,Nt=/[#\?]/g,Ct=/[#\?@]/g,Pt=/#/g;function Rt(t){this.g=t||null}function Dt(t){if(!t.fb&&(t.fb=new Map,t.Id=0,t.g))for(var n=t.g.split("&"),e=0;e<n.length;e++){var i=n[e].indexOf("="),r=null;if(0<=i){var a=n[e].substring(0,i);r=n[e].substring(i+1)}else a=n[e];a=decodeURIComponent(a.replace(/\+/g," "));r=r||"";t.add(a,decodeURIComponent(r.replace(/\+/g," ")))}}i=Rt.prototype;i.fb=null;i.Id=null;function Lt(t){Dt(t);return t.Id}i.add=function(t,n){Dt(this);this.g=null;var e=this.fb.has(t)?this.fb.get(t):null;e||this.fb.set(t,e=[]);e.push(n);this.Id++;return this};i.set=function(t,n){Dt(this);this.g=null;this.fb.has(t)?this.fb.set(t,[n]):this.add(t,n);return this};i.get=function(t){Dt(this);return this.fb.get(t)||[]};i.toString=function(){if(this.g)return this.g;if(!this.fb||!this.fb.size)return"";for(var t=[],n=c(this.fb.keys()),e=n.next();!e.done;e=n.next()){var i=e.value;e=encodeURIComponent(i);i=this.fb.get(i);for(var r=0;r<i.length;r++){var a=e;""!==i[r]&&(a+="="+encodeURIComponent(i[r]));t.push(a)}}return this.g=t.join("&")};i.clone=function(){var t=new Rt;t.g=this.g;if(this.fb){for(var n=new Map,e=c(this.fb),i=e.next();!i.done;i=e.next()){var r=c(i.value);i=r.next().value;r=r.next().value;n.set(i,r.concat())}t.fb=n;t.Id=this.Id}return t};function Ot(){}function _t(t,n){if(!t&&!n)return true;if(!t||!n||t.byteLength!=n.byteLength)return false;if((ArrayBuffer.isView(t)?t.buffer:t)==(ArrayBuffer.isView(n)?n.buffer:n)&&(t.byteOffset||0)==(n.byteOffset||0))return true;var e=Bt(t);n=Bt(n);for(var i=0;i<t.byteLength;i++)if(e[i]!=n[i])return false;return true}function Ut(t){return ArrayBuffer.isView(t)?0==t.byteOffset&&t.byteLength==t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer:t}function Bt(t,n,e){e=void 0===e?Infinity:e;return Vt(t,void 0===n?0:n,e,Uint8Array)}function Ht(t,n,e){e=void 0===e?Infinity:e;return Vt(t,void 0===n?0:n,e,Uint16Array)}function Ft(t,n,e){e=void 0===e?Infinity:e;return Vt(t,void 0===n?0:n,e,DataView)}function Vt(t,n,e,i){var r=ArrayBuffer.isView(t)?t.buffer:t,a=1;"BYTES_PER_ELEMENT"in i&&(a=i.BYTES_PER_ELEMENT);var u=((t.byteOffset||0)+t.byteLength)/a;t=Math.floor(Math.max(0,Math.min(((t.byteOffset||0)+n)/a,u)));return new i(r,t,Math.floor(Math.min(t+Math.max(e,0),u))-t)}q("shaka.util.BufferUtils",Ot);Ot.toDataView=Ft;Ot.toUint16=Ht;Ot.toUint8=Bt;Ot.toArrayBuffer=Ut;Ot.equal=_t;function zt(t,n,e){var i=U.apply(3,arguments);this.severity=t;this.category=n;this.code=e;this.data=i;this.handled=false;this.message="Shaka Error "+this.code;try{throw Error(this.message||"Shaka Error")}catch(t){this.stack=t.stack}}zt.prototype.toString=function(){return"shaka.util.Error "+JSON.stringify(this,null,"  ")};q("shaka.util.Error",zt);zt.Severity={RECOVERABLE:1,CRITICAL:2};zt.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9,ADS:10};zt.Code={UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,REQUEST_FILTER_ERROR:1006,RESPONSE_FILTER_ERROR:1007,MALFORMED_TEST_URI:1008,UNEXPECTED_TEST_REQUEST:1009,ATTEMPTS_EXHAUSTED:1010,SEGMENT_MISSING:1011,INVALID_TEXT_HEADER:2e3,INVALID_TEXT_CUE:2001,UNABLE_TO_DETECT_ENCODING:2003,BAD_ENCODING:2004,INVALID_XML:2005,INVALID_MP4_TTML:2007,INVALID_MP4_VTT:2008,UNABLE_TO_EXTRACT_CUE_START_TIME:2009,INVALID_MP4_CEA:2010,TEXT_COULD_NOT_GUESS_MIME_TYPE:2011,CANNOT_ADD_EXTERNAL_TEXT_TO_SRC_EQUALS:2012,TEXT_ONLY_WEBVTT_SRC_EQUALS:2013,MISSING_TEXT_PLUGIN:2014,UNSUPPORTED_EXTERNAL_THUMBNAILS_URI:2017,BUFFER_READ_OUT_OF_BOUNDS:3e3,JS_INTEGER_OVERFLOW:3001,EBML_OVERFLOW:3002,EBML_BAD_FLOATING_POINT_SIZE:3003,MP4_SIDX_WRONG_BOX_TYPE:3004,MP4_SIDX_INVALID_TIMESCALE:3005,MP4_SIDX_TYPE_NOT_SUPPORTED:3006,WEBM_CUES_ELEMENT_MISSING:3007,WEBM_EBML_HEADER_ELEMENT_MISSING:3008,WEBM_SEGMENT_ELEMENT_MISSING:3009,WEBM_INFO_ELEMENT_MISSING:3010,WEBM_DURATION_ELEMENT_MISSING:3011,WEBM_CUE_TRACK_POSITIONS_ELEMENT_MISSING:3012,WEBM_CUE_TIME_ELEMENT_MISSING:3013,MEDIA_SOURCE_OPERATION_FAILED:3014,MEDIA_SOURCE_OPERATION_THREW:3015,VIDEO_ERROR:3016,QUOTA_EXCEEDED_ERROR:3017,TRANSMUXING_FAILED:3018,CONTENT_TRANSFORMATION_FAILED:3019,MSS_MISSING_DATA_FOR_TRANSMUXING:3020,MSS_TRANSMUXING_FAILED:3022,TRANSMUXING_NO_VIDEO_DATA:3023,STREAMING_NOT_ALLOWED:3024,UNABLE_TO_GUESS_MANIFEST_TYPE:4e3,DASH_INVALID_XML:4001,DASH_NO_SEGMENT_INFO:4002,DASH_EMPTY_ADAPTATION_SET:4003,DASH_EMPTY_PERIOD:4004,DASH_WEBM_MISSING_INIT:4005,DASH_UNSUPPORTED_CONTAINER:4006,DASH_PSSH_BAD_ENCODING:4007,DASH_NO_COMMON_KEY_SYSTEM:4008,DASH_MULTIPLE_KEY_IDS_NOT_SUPPORTED:4009,DASH_CONFLICTING_KEY_IDS:4010,RESTRICTIONS_CANNOT_BE_MET:4012,HLS_PLAYLIST_HEADER_MISSING:4015,INVALID_HLS_TAG:4016,HLS_INVALID_PLAYLIST_HIERARCHY:4017,DASH_DUPLICATE_REPRESENTATION_ID:4018,HLS_MULTIPLE_MEDIA_INIT_SECTIONS_FOUND:4020,HLS_REQUIRED_ATTRIBUTE_MISSING:4023,HLS_REQUIRED_TAG_MISSING:4024,HLS_COULD_NOT_GUESS_CODECS:4025,HLS_KEYFORMATS_NOT_SUPPORTED:4026,DASH_UNSUPPORTED_XLINK_ACTUATE:4027,DASH_XLINK_DEPTH_LIMIT:4028,CONTENT_UNSUPPORTED_BY_BROWSER:4032,CANNOT_ADD_EXTERNAL_TEXT_TO_LIVE_STREAM:4033,NO_VARIANTS:4036,PERIOD_FLATTENING_FAILED:4037,INCONSISTENT_DRM_ACROSS_PERIODS:4038,HLS_VARIABLE_NOT_FOUND:4039,HLS_MSE_ENCRYPTED_MP2T_NOT_SUPPORTED:4040,HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED:4041,NO_WEB_CRYPTO_API:4042,CANNOT_ADD_EXTERNAL_THUMBNAILS_TO_LIVE_STREAM:4045,MSS_INVALID_XML:4046,MSS_LIVE_CONTENT_NOT_SUPPORTED:4047,AES_128_INVALID_IV_LENGTH:4048,AES_128_INVALID_KEY_LENGTH:4049,DASH_CONFLICTING_AES_128:4050,DASH_UNSUPPORTED_AES_128:4051,DASH_INVALID_PATCH:4052,HLS_EMPTY_MEDIA_PLAYLIST:4053,DASH_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED:4054,CANNOT_ADD_EXTERNAL_CHAPTERS_TO_LIVE_STREAM:4054,STREAMING_ENGINE_STARTUP_INVALID_STATE:5006,NO_RECOGNIZED_KEY_SYSTEMS:6e3,REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE:6001,FAILED_TO_CREATE_CDM:6002,FAILED_TO_ATTACH_TO_VIDEO:6003,INVALID_SERVER_CERTIFICATE:6004,FAILED_TO_CREATE_SESSION:6005,FAILED_TO_GENERATE_LICENSE_REQUEST:6006,LICENSE_REQUEST_FAILED:6007,LICENSE_RESPONSE_REJECTED:6008,ENCRYPTED_CONTENT_WITHOUT_DRM_INFO:6010,NO_LICENSE_SERVER_GIVEN:6012,OFFLINE_SESSION_REMOVED:6013,EXPIRED:6014,SERVER_CERTIFICATE_REQUIRED:6015,INIT_DATA_TRANSFORM_ERROR:6016,SERVER_CERTIFICATE_REQUEST_FAILED:6017,MIN_HDCP_VERSION_NOT_MATCH:6018,ERROR_CHECKING_HDCP_VERSION:6019,MISSING_EME_SUPPORT:6020,LOAD_INTERRUPTED:7e3,OPERATION_ABORTED:7001,NO_VIDEO_ELEMENT:7002,OBJECT_DESTROYED:7003,CONTENT_NOT_LOADED:7004,SRC_EQUALS_PRELOAD_NOT_SUPPORTED:7005,PRELOAD_DESTROYED:7006,QUEUE_INDEX_OUT_OF_BOUNDS:7007,CAST_API_UNAVAILABLE:8e3,NO_CAST_RECEIVERS:8001,ALREADY_CASTING:8002,UNEXPECTED_CAST_ERROR:8003,CAST_CANCELED_BY_USER:8004,CAST_CONNECTION_TIMED_OUT:8005,CAST_RECEIVER_APP_UNAVAILABLE:8006,STORAGE_NOT_SUPPORTED:9e3,INDEXED_DB_ERROR:9001,DEPRECATED_OPERATION_ABORTED:9002,REQUESTED_ITEM_NOT_FOUND:9003,MALFORMED_OFFLINE_URI:9004,CANNOT_STORE_LIVE_OFFLINE:9005,NO_INIT_DATA_FOR_OFFLINE:9007,LOCAL_PLAYER_INSTANCE_REQUIRED:9008,NEW_KEY_OPERATION_NOT_SUPPORTED:9011,KEY_NOT_FOUND:9012,MISSING_STORAGE_CELL:9013,STORAGE_LIMIT_REACHED:9014,DOWNLOAD_SIZE_CALLBACK_ERROR:9015,MODIFY_OPERATION_NOT_SUPPORTED:9016,INDEXED_DB_INIT_TIMED_OUT:9017,CS_IMA_SDK_MISSING:1e4,CS_AD_MANAGER_NOT_INITIALIZED:10001,SS_IMA_SDK_MISSING:10002,SS_AD_MANAGER_NOT_INITIALIZED:10003,CURRENT_DAI_REQUEST_NOT_FINISHED:10004,MT_AD_MANAGER_NOT_INITIALIZED:10005,INTERSTITIAL_AD_MANAGER_NOT_INITIALIZED:10006,VAST_INVALID_XML:10007};function Xt(){}function qt(n){if(!n)return"";n=Bt(n);239==n[0]&&187==n[1]&&191==n[2]&&(n=n.subarray(3));if(t.TextDecoder&&!ft().lh())return n=(new TextDecoder).decode(n),n.includes("�")&&$('Decoded string contains an "unknown character" codepoint.  That probably means the UTF8 encoding was incorrect!'),n;for(var e="",i=0;i<n.length;++i){var r=65533;0==(n[i]&128)?r=n[i]:n.length>=i+2&&192==(n[i]&224)&&128==(n[i+1]&192)?(r=(n[i]&31)<<6|n[i+1]&63,i+=1):n.length>=i+3&&224==(n[i]&240)&&128==(n[i+1]&192)&&128==(n[i+2]&192)?(r=(n[i]&15)<<12|(n[i+1]&63)<<6|n[i+2]&63,i+=2):n.length>=i+4&&240==(n[i]&241)&&128==(n[i+1]&192)&&128==(n[i+2]&192)&&128==(n[i+3]&192)&&(r=(n[i]&7)<<18|(n[i+1]&63)<<12|(n[i+2]&63)<<6|n[i+3]&63,i+=3);if(65535>=r)e+=String.fromCharCode(r);else{r-=65536;var a=r&1023;e+=String.fromCharCode(55296+(r>>10));e+=String.fromCharCode(56320+a)}}return e}function jt(t,n,e){if(!t)return"";if(!e&&0!=t.byteLength%2)throw new zt(2,2,2004);e=Math.floor(t.byteLength/2);var i=new Uint16Array(e);t=Ft(t);for(var r=0;r<e;r++)i[r]=t.getUint16(2*r,n);return $t(i)}function Gt(t){function n(t){return e.byteLength<=t||9<=e[t]&&126>=e[t]}if(!t)return"";var e=Bt(t);if(239==e[0]&&187==e[1]&&191==e[2])return qt(e);if(254==e[0]&&255==e[1])return jt(e.subarray(2),false);if(255==e[0]&&254==e[1])return jt(e.subarray(2),true);if(0==e[0]&&0==e[2])return jt(t,false);if(0==e[1]&&0==e[3])return jt(t,true);if(n(0)&&n(1)&&n(2)&&n(3))return qt(t);throw new zt(2,2,2003)}function Kt(n){if(t.TextEncoder&&!ft().lh()){var e=new TextEncoder;return Ut(e.encode(n))}n=encodeURIComponent(n);n=unescape(n);e=new Uint8Array(n.length);for(var i=0;i<n.length;i++)e[i]=n[i].charCodeAt(0);return Ut(e)}function Wt(t,n){for(var e=new ArrayBuffer(2*t.length),i=new DataView(e),r=0;r<t.length;++r)i.setUint16(2*r,t.charCodeAt(r),n);return e}function $t(t){return Qt.value()(t)}function Yt(t){var n={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&apos;":"'","&nbsp;":" ","&lrm;":"‎","&rlm;":"‏"},e=/&(?:amp|lt|gt|quot|apos|nbsp|lrm|rlm|#[xX]?[0-9a-fA-F]+);/g,i=RegExp(e.source);return t&&i.test(t)?t.replace(e,(function(t){return"#"==t[1]?(t="x"==t[2]||"X"==t[2]?parseInt(t.substring(3),16):parseInt(t.substring(2),10),0<=t&&1114111>=t?String.fromCodePoint(t):""):n[t]||"'"})):t||""}q("shaka.util.StringUtils",Xt);Xt.resetFromCharCode=function(){Qt.g=void 0};Xt.toUTF16=Wt;Xt.toUTF8=Kt;Xt.fromBytesAutoDetect=Gt;Xt.fromUTF16=jt;Xt.fromUTF8=qt;var Qt=new ot((function(){function t(t){try{var n=new Uint8Array(t);return 0<String.fromCharCode.apply(null,n).length}catch(t){return false}}for(var n={Gc:65536};0<n.Gc;n={Gc:n.Gc},n.Gc/=2)if(t(n.Gc))return function(t){return function(n){for(var e="",i=0;i<n.length;i+=t.Gc)e+=String.fromCharCode.apply(null,n.subarray(i,i+t.Gc));return e}}(n);return null}));function Jt(){}function Zt(t){t=$t(Bt(t));return btoa(t)}function tn(t,n){n=void 0==n?true:n;t=Zt(t).replace(/\+/g,"-").replace(/\//g,"_");return n?t:t.replace(/[=]*$/,"")}function nn(n){n=t.atob(n.replace(/-/g,"+").replace(/_/g,"/"));for(var e=new Uint8Array(n.length),i=0;i<n.length;++i)e[i]=n.charCodeAt(i);return e}function en(n){for(var e=n.length/2,i=new Uint8Array(e),r=0;r<e;r++)i[r]=t.parseInt(n.substr(2*r,2),16);return i}function rn(t){var n=Bt(t);t="";n=c(n);for(var e=n.next();!e.done;e=n.next())e=e.value,e=e.toString(16),1==e.length&&(e="0"+e),t+=e;return t}function an(){for(var t=U.apply(0,arguments),n=0,e=0;e<t.length;++e)n+=t[e].byteLength;n=new Uint8Array(n);for(var i=e=0;i<t.length;++i){var r=t[i];ArrayBuffer.isView(r)&&1===r.BYTES_PER_ELEMENT?n.set(r,e):n.set(Bt(r),e);e+=r.byteLength}return n}q("shaka.util.Uint8ArrayUtils",Jt);Jt.concat=an;Jt.toHex=rn;Jt.fromHex=en;Jt.fromBase64=nn;Jt.toBase64=tn;Jt.toStandardBase64=Zt;function un(t,n,e){e=void 0===e?"":e;if(0==n.length)return t;if(1==t.length&&1==n.length){var i=new bt(t[0]);n=new bt(n[0]);n=i.resolve(n);e&&Et(n,e);return[n.toString()]}n=n.map((function(t){return new bt(t)}));i=[];t=c(t);for(var r=t.next();!r.done;r=t.next()){r=new bt(r.value);for(var a=c(n),u=a.next();!u.done;u=a.next())u=r.resolve(u.value),e&&Et(u,e),i.push(u.toString())}return i}function sn(t,n,e,i){t={keySystem:t,encryptionScheme:n,licenseServerUri:"",distinctiveIdentifierRequired:false,persistentStateRequired:false,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:e||[],keyIds:new Set};i&&(t.keySystemUris=new Set([i]));return t}function on(n,e){e=void 0===e?"cenc":e;var i=[],r=[],a=[];n.forEach((function(t,n){var e=n;22!=e.length&&(e=tn(en(n),false));var u=t;22!=u.length&&(u=tn(en(t),false));t={kty:"oct",kid:e,k:u};i.push(t);r.push(t.kid);a.push(n)}));n=JSON.stringify({keys:i});var u=JSON.stringify({kids:r});u=[{initData:Bt(Kt(u)),initDataType:"keyids"}];return{keySystem:"org.w3.clearkey",encryptionScheme:e,licenseServerUri:"data:application/json;base64,"+t.btoa(n),distinctiveIdentifierRequired:false,persistentStateRequired:false,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",sessionType:"",initData:u,keyIds:new Set(a)}}function fn(t,n){if(1==n.length)return n[0];t=cn(t,n);if(null!=t)return t;throw new zt(2,4,4025,n)}function cn(t,n){var e=pn.get(t);e=c(e);for(var i=e.next();!i.done;i=e.next()){i=i.value;for(var r=c(n),a=r.next();!a.done;a=r.next())if(a=a.value,i.test(a.trim()))return a.trim()}return t==hn?"":null}function ln(t,n){var e=[];t=pn.get(t);t=c(t);for(var i=t.next();!i.done;i=t.next()){i=i.value;for(var r=c(n),a=r.next();!a.done;a=r.next())a=a.value,i.test(a.trim())&&e.push(a.trim())}return e}var hn="text",dn={xa:"video",ea:"audio",Ya:hn,Pf:"image",fl:"application"},vn=1/15,pn=(new Map).set("audio",[/^vorbis$/,/^Opus$/,/^opus$/,/^fLaC$/,/^flac$/,/^mp4a/,/^[ae]c-3$/,/^ac-4/,/^dts[cex]$/,/^iamf/,/^mhm[12]/,/^ac3$/,/^eac3$/,/^apac$/]).set("video",[/^avc/,/^hev/,/^hvc/,/^vvc/,/^vvi/,/^vp0?[89]/,/^av01/,/^dvh/,/^dva/,/^dav/]).set("text",[/^vtt$/,/^wvtt/,/^stpp/]);function mn(t,n,e,i){this.g=null;this.l=t;this.i=n;this.m=e;this.o=i;this.j=false;t:{"undefined"===typeof libDPIModule&&Y("Could not find LCEVC Library dependencies on this page");if("undefined"!==typeof LCEVCdec)this.h=LCEVCdec;else if("undefined"!==typeof LcevcDil)this.h=LcevcDil,this.j=true,vt("LcevcDil","lcevc_dil.js is deprecated, please use lcevc_dec.js instead");else{Y("Could not find LCEVC Library on this page");t=false;break t}"undefined"===typeof this.h.SupportObject?(Y("Could not find LCEVC Library on this page"),t=false):(this.h.SupportObject.SupportStatus||Y(this.h.SupportObject.SupportError),t="undefined"!==typeof this.h&&"undefined"!==typeof libDPIModule&&this.i instanceof HTMLCanvasElement&&this.h.SupportObject.SupportStatus)}t&&!this.g&&this.h.SupportObject.webGLSupport(this.i)&&(this.i.classList.remove("shaka-hidden"),this.g=this.j?new this.h.LcevcDil(this.l,this.i,this.m):new this.h.LCEVCdec(this.l,this.i,this.m))}function wn(t,n,e,i){"video"!==i.type||t.o&&!i.baseOriginalId||t.g&&t.g.appendBuffer(n,"video",i.id,-e,!t.o)}function gn(t){t.g&&t.i.classList.add("shaka-hidden")}mn.prototype.release=function(){this.g&&(this.g.close(),this.g=null)};function bn(t){return t&&"undefined"!==typeof LCEVCdec?"lvc1"==t.codecs:false}q("shaka.lcevc.Dec",mn);mn.prototype.release=mn.prototype.release;function yn(n){if(En.has(n))return En.get(n);var e=t.ManagedMediaSource||t.MediaSource;return e?(e=e.isTypeSupported(n),En.set(n,e),e):false}function kn(){var n=t.ManagedSourceBuffer||t.SourceBuffer;return!!n&&!!n.prototype&&!!n.prototype.changeType}function Tn(){var n=t.ManagedMediaSource||t.MediaSource;return n&&n.prototype?!!n.prototype.setLiveSeekableRange&&!!n.prototype.clearLiveSeekableRange:false}var En=new Map;function Sn(){}Sn.prototype.extract=function(){};Sn.prototype.decode=function(){return[]};Sn.prototype.clear=function(){};Sn.prototype.getStreams=function(){return[]};function An(){}An.prototype.init=function(){};An.prototype.parse=function(){return[]};function In(){}i=In.prototype;i.init=function(){};i.rf=function(){};i.Cd=function(){};i.remove=function(){};i.Qf=function(){};q("shaka.media.IClosedCaptionParser",In);function Mn(t){this.h=new Map;this.i=0;this.j=new An;if(t=Nn(t.toLowerCase()))this.j=t();this.g=new Sn;if(t=Pn)this.g=t(),this.h.set(this.i,this.g)}i=Mn.prototype;i.init=function(t,n,e){n=void 0===n?false:n;e=void 0===e?-1:e;if(-1!=e&&this.i!=e){n=e;var i=this.h.get(n);this.h.set(this.i,this.g);if(i)this.g=i;else{if(i=Pn)this.g=i();this.h.set(n,this.g)}}else n||this.Cd();this.j.init(t);-1!=e&&(this.i=e)};i.rf=function(t){t=this.j.parse(t);t=c(t);for(var n=t.next();!n.done;n=t.next()){n=n.value;var e=Bt(n.packet);0<e.length&&this.g.extract(e,n.pts)}return this.g.decode()};i.Cd=function(){this.g.clear()};i.remove=function(t){t=void 0===t?[]:t;t=new Set(t);for(var n=c(this.h.keys()),e=n.next();!e.done;e=n.next())if(e=e.value,!t.has(e)){var i=this.h.get(e);i&&i.clear();this.h.delete(e)}};i.Qf=function(){return this.g.getStreams()};function xn(t,n){Cn.set(t,n)}function Nn(t){return Cn.get(t)}q("shaka.media.ClosedCaptionParser",Mn);Mn.findDecoder=function(){return Pn};Mn.unregisterDecoder=function(){Pn=null};Mn.registerDecoder=function(t){Pn=t};Mn.findParser=Nn;Mn.unregisterParser=function(t){Cn.delete(t)};Mn.registerParser=xn;var Cn=new Map,Pn=null;function Rn(){this.id="";this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0;this.height=this.width=100;this.viewportAnchorUnits=this.widthUnits=this.heightUnits=Dn;this.scroll=Ln}q("shaka.text.CueRegion",Rn);var Dn=1;Rn.units={PX:0,PERCENTAGE:Dn,LINES:2};var Ln="";Rn.scrollMode={NONE:Ln,UP:"up"};function On(t,n){return"number"===typeof t&&"number"===typeof n&&isNaN(t)&&isNaN(n)?true:t===n}function _n(t,n){n=t.indexOf(n);-1<n&&t.splice(n,1)}function Un(t,n,e){e||(e=On);if(t.length!=n.length)return false;n=n.slice();t=c(t);for(var i=t.next(),r={};!i.done;r={di:void 0},i=t.next()){r.di=i.value;i=n.findIndex(function(t){return function(n){return e(t.di,n)}}(r));if(-1==i)return false;n[i]=n[n.length-1];n.pop()}return 0==n.length}function Bn(t,n,e){if(t===n)return true;if(!t||!n)return t==n;e||(e=On);if(t.length!=n.length)return false;for(var i=0;i<t.length;i++)if(!e(t[i],n[i]))return false;return true}function Hn(t){this.h=t||"";this.g=0}function Fn(t){Vn(t,/[ \t]+/gm)}function Vn(t,n){n.lastIndex=t.g;n=n.exec(t.h);n=null==n?null:{position:n.index,length:n[0].length,results:n};if(t.g==t.h.length||null==n||n.position!=t.g)return null;t.g+=n.length;return n.results}function zn(t){return t.g==t.h.length?null:(t=Vn(t,/[^ \t\n]*/gm))?t[0]:null}function Xn(t){t=Vn(t,jn);if(null==t)return null;var n=Number(t[2]),e=Number(t[3]);return 59<n||59<e?null:(Number(t[6])||0)/1e3+e+60*n+3600*(Number(t[1])||0)}function qn(t){return t?Xn(new Hn(t)):null}var jn=/(?:(\d{1,}):)?(\d{2}):(\d{2})((\.(\d{1,3})))?/g;function Gn(){}function Kn(t){function n(t){switch(typeof t){case"undefined":case"boolean":case"number":case"string":case"symbol":case"function":return t;default:if(!t||ArrayBuffer.isView(t))return t;if(e.has(t))return null;var i=Array.isArray(t);if(t.constructor!=Object&&!i)return null;e.add(t);var r=i?[]:{},a;for(a in t)r[a]=n(t[a]);i&&(r.length=t.length);return r}}var e=new WeakSet;return n(t)}function Wn(t){var n={},e;for(e in t)n[e]=t[e];return n}function $n(t){if(Array.isArray(t)){for(var n=[],e=0;e<t.length;e++){var i=e.toString(),r=t[e];void 0!==r&&(r=$n(r))&&n.push(i+":"+r)}t="["+n.join(",")+"]"}else if("function"==typeof t)t="";else if(t instanceof Object){e=Object.keys(t);e.sort();n=[];e=c(e);for(i=e.next();!i.done;i=e.next())r=i.value,i=JSON.stringify(r),r=t[r],void 0!==r&&(r=$n(r))&&n.push(i+":"+r);t="{"+n.join(",")+"}"}else t=JSON.stringify(t);return t}q("shaka.util.ObjectUtils",Gn);Gn.alphabeticalKeyOrderStringify=$n;Gn.shallowCloneObject=Wn;Gn.cloneObject=Kn;
/*
		 @license
		 tXml
		 Copyright 2015 Tobias Nickel
		 SPDX-License-Identifier: MIT
		*/function Yn(t,n){var e=void 0===e?false:e;t=Gt(t);return Qn(t,n,e)}function Qn(t,n,e){t=Zn(t,void 0===e?false:e);return!n&&t.length?t[0]:(t=t.find((function(t){return n.split(",").includes(t.tagName)})))?t:null}function Jn(t){return Me.has(t)?Me.get(t):""}function Zn(t,n){function e(a,u){u=void 0===u?false:u;for(var s=[];t[r];)if(60==t.charCodeAt(r)){if(47===t.charCodeAt(r+1)){u=r+2;r=t.indexOf(">",r);u=t.substring(u,r);var o=u.indexOf(a);if(-1==o){var f=a.indexOf(".");0<f&&(o=u.indexOf(a.substring(0,f)))}if(-1==o)throw a=t.substring(0,r).split("\n"),Error("Unexpected close tag\nLine: "+(a.length-1)+"\nColumn: "+(a[a.length-1].length+1)+"\nChar: "+t[r]);r+1&&(r+=1);break}else if(33===t.charCodeAt(r+1)){if(45==t.charCodeAt(r+2)){for(;-1!==r&&(62!==t.charCodeAt(r)||45!=t.charCodeAt(r-1)||45!=t.charCodeAt(r-2)||-1==r);)r=t.indexOf(">",r+1);-1===r&&(r=t.length)}else if(91===t.charCodeAt(r+2)&&91===t.charCodeAt(r+8)&&"cdata"===t.substr(r+3,5).toLowerCase()){o=t.indexOf("]]>",r);-1==o?(s.push(t.substr(r+9)),r=t.length):(s.push(t.substring(r+9,o)),r=o+3);continue}r++;continue}t:{f=u;r++;var c=i(),h={};for(o=[];62!==t.charCodeAt(r)&&t[r];){var d=t.charCodeAt(r);if(64<d&&91>d||96<d&&123>d){d=i();for(var v=t.charCodeAt(r);v&&39!==v&&34!==v&&!(64<v&&91>v||96<v&&123>v)&&62!==v;)r++,v=t.charCodeAt(r);var p=r+1;r=t.indexOf(t[r],p);p=t.slice(p,r);if(39===v||34===v){if(-1===r){f={tagName:c,attributes:h,children:o,parent:null};if(n)for(c=0;c<o.length;c++)"string"!==typeof o[c]&&(o[c].parent=f);o=f;break t}}else p=null,r--;if(d.startsWith("xmlns:")){v=p;var m=d.split(":")[1];Me.set(v,m);xe.set(m,v)}"tt"===c&&"xml:space"===d&&"preserve"===p&&(f=true);h[d]=p}r++}47!==t.charCodeAt(r-1)?(r++,o=e(c,f)):r++;f={tagName:c,attributes:h,children:o,parent:null};c=o.length;for(h=0;h<c;h++)d=o[h],"string"!==typeof d?n&&(d.parent=f):h==c-1&&"\n"==d&&o.pop();o=f}s.push(o);if("string"===typeof o)break;"?"===o.tagName[0]&&o.children&&(s.push.apply(s,l(o.children)),o.children=[])}else o=r,r=t.indexOf("<",r)-1,-2===r&&(r=t.length),o=t.slice(o,r+1),u?0<o.length&&s.push(o):s.length&&1==o.length&&"\n"==o[0]?s.push(o):0<o.trim().length&&s.push(o),r++;return s}function i(){for(var n=r;-1==="\r\n\t>/= ".indexOf(t[r])&&t[r];)r++;return t.slice(n,r)}var r=0;return e("")}function te(t){return"string"===typeof t}function ne(t){var n=[];if(!t.children)return[];t=c(t.children);for(var e=t.next();!e.done;e=t.next())e=e.value,"string"!==typeof e&&n.push(e);return n}function ee(t,n){var e=[];if(!t.children)return[];t=c(t.children);for(var i=t.next();!i.done;i=t.next())i=i.value,i.tagName===n&&e.push(i);return e}function ie(t){if("string"===typeof t)return Yt(t);t=t.children.reduce((function(t,n){return"string"===typeof n?t+n:t}),"");return""===t?null:Yt(t)}function re(t){if(!Array.from(t.children).every((function(t){return"string"===typeof t})))return null;(t=ie(t))&&(t=t.trim());return t}function ae(t,n,e){e=void 0===e?[]:e;t.tagName===n&&e.push(t);if(t.children){t=c(t.children);for(var i=t.next();!i.done;i=t.next())ae(i.value,n,e)}return e}function ue(t,n){t=ee(t,n);return 1!=t.length?null:t[0]}function se(t,n,e){t=ce(t,n,e);return 1!=t.length?null:t[0]}function oe(t,n,e,i){i=void 0===i?null:i;var r=null;t=t.attributes[n];null!=t&&(r=e(t));return null==r?i:r}function fe(t,n,e){n=Jn(n);return t.attributes[n+":"+e]||null}function ce(t,n,e){var i=Jn(n);n=[];if(t.children)for(e=i?i+":"+e:e,t=c(t.children),i=t.next();!i.done;i=t.next())(i=i.value)&&i.tagName===e&&n.push(i);return n}function le(t,n,e){n=c(n);for(var i=n.next();!i.done;i=n.next())if(i=fe(t,i.value,e))return i;return null}function he(t){if(!t)return null;/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t)&&(t+="Z");t=Date.parse(t);return isNaN(t)?null:t/1e3}function de(t){if(!t)return null;t=RegExp("^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$","i").exec(t);if(!t)return null;t=31536e3*Number(t[1]||null)+2592e3*Number(t[2]||null)+86400*Number(t[3]||null)+3600*Number(t[4]||null)+60*Number(t[5]||null)+Number(t[6]||null);return isFinite(t)?t:null}function ve(t){var n=/([0-9]+)-([0-9]+)/.exec(t);if(!n)return null;t=Number(n[1]);if(!isFinite(t))return null;n=Number(n[2]);return isFinite(n)?{start:t,end:n}:null}function pe(t){t=Number(t);return 0===t%1?t:null}function me(t){t=Number(t);return 0===t%1&&0<t?t:null}function we(t){t=Number(t);return 0===t%1&&0<=t?t:null}function ge(t){t=Number(t);return isNaN(t)?null:t}function be(t){return t?"true"===t.toLowerCase():false}function ye(t){var n;var e=(n=t.match(/^(\d+)\/(\d+)$/))?Number(n[1])/Number(n[2]):Number(t);return isNaN(e)?null:e}function ke(t){var n=[];t=Yt(t).split(/\/+(?=(?:[^'"]*['"][^'"]*['"])*[^'"]*$)/);t=c(t);for(var e=t.next();!e.done;e=t.next()){e=e.value;var i=e.match(/^([\w]+)/);if(i){var r=e.match(/(@id='(.*?)')/),a=e.match(/(@t='(\d+)')/),u=e.match(/(@n='(\d+)')/),s=e.match(/\[(\d+)\]/);n.push({name:i[0],id:r?r[0].match(/'(.*?)'/)[0].replace(/'/gm,""):null,t:a?Number(a[0].match(/'(.*?)'/)[0].replace(/'/gm,"")):null,n:u?Number(u[0].match(/'(.*?)'/)[0].replace(/'/gm,"")):null,position:s?Number(s[1])-1:null,wc:e.split("/@")[1]||null})}else e.startsWith("@")&&n.length&&(n[n.length-1].wc=e.slice(1))}return n}function Te(t,n){var e=ke(n.attributes.sel||"");if(e.length){var i=e[e.length-1],r=n.attributes.pos||null;e=i.position;null==e&&(null!==i.t&&(e=Ee(t,"t",i.t)),null!==i.n&&(e=Ee(t,"n",i.n)));null===e?e="prepend"===r?0:t.length:"prepend"===r?--e:"after"===r&&++e;r=n.tagName;(i=i.wc)&&t[e]?Se(t[e],r,i,re(n)||""):("remove"!==r&&"replace"!==r||t.splice(e,1),"add"!==r&&"replace"!==r||t.splice.apply(t,[e,0].concat(l(n.children))))}}function Ee(t,n,e){var i=0;t=c(t);for(var r=t.next();!r.done;r=t.next()){if(Number(r.value.attributes[n])===e)return i;i++}return null}function Se(t,n,e,i){if("remove"===n)delete t.attributes[e];else if("add"===n||"replace"===n)t.attributes[e]=i}function Ae(t){var n="",e=t.tagName.split(":");0<e.length&&(n=e[0],n=xe.has(n)?xe.get(n):"");n=document.createElementNS(n,t.tagName);for(var i in t.attributes)n.setAttribute(i,t.attributes[i]);t=c(t.children);for(i=t.next();!i.done;i=t.next())i=i.value,e=void 0,"string"==typeof i?e=new Text(i):e=Ae(i),n.appendChild(e);return n}function Ie(t){if(!t)return null;var n={tagName:t.tagName,attributes:Wn(t.attributes),children:[],parent:null};t=c(t.children);for(var e=t.next();!e.done;e=t.next())e=e.value,"string"===typeof e?n.children.push(e):(e=Ie(e),e.parent=n,n.children.push(e));return n}var Me=new Map,xe=new Map;function Ne(t,n,e){this.startTime=t;this.endTime=n;this.payload=e;this.region=new Rn;this.position=null;this.positionAlign=Ue;this.size=0;this.textAlign=Be;this.direction=ze;this.writingMode=Xe;this.lineInterpretation=qe;this.line=null;this.lineHeight="";this.lineAlign=je;this.displayAlign=Fe;this.fontSize=this.border=this.backgroundImage=this.backgroundColor=this.color="";this.fontWeight=$e;this.fontStyle=Qe;this.linePadding=this.letterSpacing=this.fontFamily="";this.opacity=1;this.textCombineUpright="";this.textDecoration=[];this.textStrokeWidth=this.textStrokeColor=this.textShadow="";this.wrapLine=true;this.id="";this.nestedCues=[];this.lineBreak=this.isContainer=false;this.rubyTag=null;this.cellResolution={Kc:32,rows:15}}function Ce(t,n){t=new Ne(t,n,"");t.lineBreak=true;return t}Ne.prototype.clone=function(){var t=new Ne(0,0,""),n;for(n in this)t[n]=this[n],Array.isArray(t[n])&&(t[n]=t[n].slice());return t};function Pe(t,n){if(t.payload!=n.payload||!(.001>Math.abs(t.startTime-n.startTime)&&.001>Math.abs(t.endTime-n.endTime)))return false;for(var e in t)if("startTime"!=e&&"endTime"!=e&&"payload"!=e)if("nestedCues"==e){if(!Bn(t.nestedCues,n.nestedCues,Pe))return false}else if("region"==e||"cellResolution"==e)for(var i in t[e]){if(t[e][i]!=n[e][i])return false}else if(Array.isArray(t[e])){if(!Bn(t[e],n[e]))return false}else if(t[e]!=n[e])return false;return true}function Re(t,n){n=void 0===n?new Map:n;var e=t.payload;if(e.includes("<")){0===n.size&&De(n);var i=e;e=[];for(var r=-1,a=0;a<i.length;a++)"<"===i[a]?r=a+1:">"===i[a]&&0<r&&(r=i.substr(r,a-r),r.match(ni)&&e.push(r),r=-1);e=c(e);for(a=e.next();!a.done;a=e.next())a=a.value,i=i.replace("<"+a+">",'<div time="'+a+'">'),i+="</div>";t:{a=i;r=[];var u=-1;e="";i=false;for(var s=0;s<a.length;s++)if("/"===a[s]){var o=a.indexOf(">",s);if(-1===o){e=a;break t}if((o=a.substring(s+1,o))&&"v"==o){i=true;var f=null;r.length&&(f=r[r.length-1]);if(f){if(f===o)e+="/"+o+">";else{if(!f.startsWith("v")){e+=a[s];continue}e+="/"+f+">"}s+=o.length+1}else e+=a[s]}else e+=a[s]}else"<"===a[s]?(u=s+1,"v"!=a[u]&&(u=-1)):">"===a[s]&&0<u&&(r.push(a.substr(u,s-u)),u=-1),e+=a[s];a=c(r);for(r=a.next();!r.done;r=a.next())r=r.value,u=r.replace(" ",".voice-"),e=e.replace("<"+r+">","<"+u+">"),e=e.replace("</"+r+">","</"+u+">"),i||(e+="</"+u+">")}e=Le(e);t.payload="";try{var l=Qn("<span>"+e+"</span>","span")}catch(t){}if(l)if(l=l.children,1!=l.length||l[0].tagName)for(l=c(l),e=l.next();!e.done;e=l.next())Oe(e.value,t,n);else t.payload=Yt(e);else t.payload=Yt(e)}else t.payload=Yt(e)}function De(t){for(var n=c(Object.entries(Ke)),e=n.next();!e.done;e=n.next()){var i=c(e.value);e=i.next().value;i=i.next().value;var r=new Ne(0,0,"");r.color=i;t.set("."+e,r)}n=c(Object.entries(We));for(e=n.next();!e.done;e=n.next())i=c(e.value),e=i.next().value,i=i.next().value,r=new Ne(0,0,""),r.backgroundColor=i,t.set("."+e,r)}function Le(t){var n={"< ":""," >":" &gt;"},e=/(< +>|<\s|\s>)/g,i=RegExp(e.source);return t&&i.test(t)?t.replace(e,(function(t){return n[t]||""})):t||""}function Oe(t,n,e){var i=n.clone();i.nestedCues=[];i.payload="";i.rubyTag="";i.line=null;i.region=new Rn;i.position=null;i.size=0;i.textAlign=Be;if(t.tagName)for(var r=c(t.tagName.split(/(?=[ .])+/g)),a=r.next();!a.done;a=r.next()){var u=a=a.value;if(u.startsWith(".voice-")){var s=u.split("-").pop();u='v[voice="'+s+'"]';e.has(u)||(u="v[voice="+s+"]")}e.has(u)&&(s=i,u=e.get(u))&&(s.backgroundColor=_e(u.backgroundColor,s.backgroundColor),s.color=_e(u.color,s.color),s.fontFamily=_e(u.fontFamily,s.fontFamily),s.fontSize=_e(u.fontSize,s.fontSize),s.textShadow=_e(u.textShadow,s.textShadow),s.fontWeight=u.fontWeight,s.fontStyle=u.fontStyle,s.opacity=u.opacity,s.rubyTag=u.rubyTag,s.textCombineUpright=u.textCombineUpright,s.wrapLine=u.wrapLine);switch(a){case"br":i=Ce(i.startTime,i.endTime);n.nestedCues.push(i);return;case"b":i.fontWeight=Ye;break;case"i":i.fontStyle=Je;break;case"u":i.textDecoration.push(ti);break;case"font":if(a=t.attributes.color)i.color=a;break;case"div":a=t.attributes.time;if(!a)break;if(a=qn(a))i.startTime=a;break;case"ruby":case"rp":case"rt":i.rubyTag=a}}r=t.children;if(te(t)||1==r.length&&te(r[0]))for(e=ie(t).split("\n"),t=true,e=c(e),r=e.next();!r.done;r=e.next())r=r.value,t||(t=Ce(i.startTime,i.endTime),n.nestedCues.push(t)),0<r.length&&(t=i.clone(),t.payload=Yt(r),n.nestedCues.push(t)),t=false;else for(n.nestedCues.push(i),n=c(r),t=n.next();!t.done;t=n.next())Oe(t.value,i,e)}function _e(t,n){return t&&0<t.length?t:n}q("shaka.text.Cue",Ne);Ne.parseCuePayload=Re;Ne.equal=Pe;Ne.prototype.clone=Ne.prototype.clone;var Ue="auto";Ne.positionAlign={LEFT:"line-left",RIGHT:"line-right",CENTER:"center",AUTO:Ue};var Be="center",He={LEFT:"left",RIGHT:"right",CENTER:Be,START:"start",END:"end"};Ne.textAlign=He;var Fe="after",Ve={BEFORE:"before",CENTER:"center",AFTER:Fe};Ne.displayAlign=Ve;var ze="ltr";Ne.direction={HORIZONTAL_LEFT_TO_RIGHT:ze,HORIZONTAL_RIGHT_TO_LEFT:"rtl"};var Xe="horizontal-tb";Ne.writingMode={HORIZONTAL_TOP_TO_BOTTOM:Xe,VERTICAL_LEFT_TO_RIGHT:"vertical-lr",VERTICAL_RIGHT_TO_LEFT:"vertical-rl"};var qe=0;Ne.lineInterpretation={LINE_NUMBER:qe,PERCENTAGE:1};var je="start",Ge={CENTER:"center",START:je,END:"end"};Ne.lineAlign=Ge;var Ke={white:"white",lime:"lime",cyan:"cyan",red:"red",yellow:"yellow",magenta:"magenta",blue:"blue",black:"black"};Ne.defaultTextColor=Ke;var We={bg_white:"white",bg_lime:"lime",bg_cyan:"cyan",bg_red:"red",bg_yellow:"yellow",bg_magenta:"magenta",bg_blue:"blue",bg_black:"black"};Ne.defaultTextBackgroundColor=We;var $e=400,Ye=700;Ne.fontWeight={NORMAL:$e,BOLD:Ye};var Qe="normal",Je="italic",Ze={NORMAL:Qe,ITALIC:Je,OBLIQUE:"oblique"};Ne.fontStyle=Ze;var ti="underline";Ne.textDecoration={UNDERLINE:ti,LINE_THROUGH:"lineThrough",OVERLINE:"overline"};var ni=/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g;function ei(){}ei.prototype.destroy=function(){};function ii(t,n,e){ai.set(t.toLowerCase().split(";")[0]+"-"+e,{priority:e,tf:n})}function ri(t,n){for(var e=t.toLowerCase().split(";")[0],i=c([fi,oi,si,ui]),r=i.next();!r.done;r=i.next())if(r=ai.get(e+"-"+r.value)){var a=r.tf(),u=a.isSupported(t,n);a.destroy();if(u)return r.tf}return null}q("shaka.transmuxer.TransmuxerEngine",ei);ei.findTransmuxer=ri;ei.unregisterTransmuxer=function(t,n){ai.delete(t.toLowerCase().split(";")[0]+"-"+n)};ei.registerTransmuxer=ii;ei.prototype.destroy=ei.prototype.destroy;var ai=new Map,ui=1,si=2,oi=3,fi=4;ei.PluginPriority={FALLBACK:ui,PREFERRED_SECONDARY:si,PREFERRED:oi,APPLICATION:fi};function ci(){}function li(t,n){var e=t;n&&!ki.includes(t)&&(e+='; codecs="'+n+'"');return e}function hi(t,n){n&&(t+='; codecs="'+n+'"');return t}function di(t,n,e){var i=li(t,n);n=hi(t,n);ri(n)?(t=ri(n))?(t=t(),e=t.convertCodecs(e,n),t.destroy()):e=n:e="video/mp2t"!=t&&"audio"==e?i.replace("video","audio"):i;return e}function vi(t){return t.split(";")[0].split("/")[1]}function pi(t){var n=yi(t);t=n[0].toLowerCase();n=n[1].toLowerCase();switch(true){case"mp4a"===t&&"69"===n:case"mp4a"===t&&"6b"===n:case"mp4a"===t&&"40.34"===n:return"mp3";case"mp4a"===t&&"66"===n:case"mp4a"===t&&"67"===n:case"mp4a"===t&&"68"===n:case"mp4a"===t&&"40.2"===n:case"mp4a"===t&&"40.02"===n:case"mp4a"===t&&"40.5"===n:case"mp4a"===t&&"40.05"===n:case"mp4a"===t&&"40.29"===n:case"mp4a"===t&&"40.42"===n:return"aac";case"mp4a"===t&&"a5"===n:case"ac3"===t:case"ac-3"===t:return"ac-3";case"mp4a"===t&&"a6"===n:case"eac3"===t:case"ec-3"===t:return"ec-3";case"ac-4"===t:return"ac-4";case"mp4a"===t&&"b2"===n:return"dtsx";case"mp4a"===t&&"a9"===n:return"dtsc";case"vp09"===t:case"vp9"===t:return"vp9";case"avc1"===t:case"avc3"===t:return"avc";case"hvc1"===t:case"hev1"===t:return"hevc";case"vvc1"===t:case"vvi1"===t:return"vvc";case"dvh1"===t:case"dvhe"===t:return n&&n.startsWith("05")?"dovi-p5":"dovi-hevc";case"dvav"===t:case"dva1"===t:return"dovi-avc";case"dav1"===t:return"dovi-av1";case"dvc1"===t:case"dvi1"===t:return"dovi-vvc"}return t}function mi(t){var n=[];t=c(t.split(","));for(var e=t.next();!e.done;e=t.next())e=yi(e.value),n.push(e[0]);return n.sort().join(",")}function wi(t){return t.split(";")[0]}function gi(t){t=t.split(/ *; */);t.shift();return(t=t.find((function(t){return t.startsWith("codecs=")})))?t.split("=")[1].replace(/^"|"$/g,""):""}function bi(t){return"application/x-mpegurl"===t||"application/vnd.apple.mpegurl"===t}function yi(t){t=t.split(".");var n=t[0];t.shift();return[n,t.join(".")]}q("shaka.util.MimeUtils",ci);ci.getFullTypeWithAllCodecs=hi;ci.getFullType=li;(new Map).set("codecs","codecs").set("frameRate","framerate").set("bandwidth","bitrate").set("width","width").set("height","height").set("channelsCount","channels");var ki=["audio/aac","audio/ac3","audio/ec3","audio/mpeg"];function Ti(t){this.i=null;this.j=t;this.B=false;this.l=this.s=0;this.m=Infinity;this.h=this.g=null;this.C="";this.A=function(){};this.o=new Map}function Ei(t,n){Pi.set(t,n)}function Si(t){return Pi.get(t)}function Ai(t){return Pi.has(t)?true:"application/cea-608"==t||"application/cea-708"==t?!!Pn:false}Ti.prototype.destroy=function(){this.j=this.i=null;this.o.clear();return Promise.resolve()};function Ii(t,n,e,i,r){var a,u,s,o,f,l,h;return _((function(d){if(1==d.g)return T(d,Promise.resolve(),2);if(!t.i||!t.j)return d.return();if(null==e||null==i)return t.i.parseInit(Bt(n)),d.return();a=t.B?e:t.s;u={periodStart:t.s,segmentStart:e,segmentEnd:i,vttOffset:a};s=t.i.parseMedia(Bt(n),u,r,[]);o=c(s);for(f=o.next();!f.done;f=o.next())l=f.value,t.A(l,r||null,u);h=s.filter((function(n){return n.startTime>=t.l&&n.startTime<t.m}));t.j.append(h);null==t.g&&(t.g=Math.max(e,t.l));t.h=Math.min(i,t.m);E(d)}))}Ti.prototype.remove=function(t,n){var e=this;return _((function(i){if(1==i.g)return T(i,Promise.resolve(),2);!e.j||!e.j.remove(t,n)||null==e.g||n<=e.g||t>=e.h||(t<=e.g&&n>=e.h?e.g=e.h=null:t<=e.g&&n<e.h?e.g=n:t>e.g&&n>=e.h&&(e.h=t));E(i)}))};function Mi(t,n,e){t.l=n;t.m=e}function xi(t,n,e){t.C=n;if(n=t.o.get(n))for(var i=c(n.keys()),r=i.next();!r.done;r=i.next())(r=n.get(r.value).filter((function(t){return t.endTime<=e})))&&t.j.append(r)}function Ni(t,n,e){n.startTime+=e;n.endTime+=e;n=c(n.nestedCues);for(var i=n.next();!i.done;i=n.next())Ni(t,i.value,e)}function Ci(t,n,e,i,r){var a=e+" "+i,u=new Map;n=c(n);for(var s=n.next();!s.done;s=n.next()){var o=s.value;s=o.stream;o=o.cue;u.has(s)||u.set(s,new Map);u.get(s).has(a)||u.get(s).set(a,[]);Ni(t,o,r);o.startTime>=t.l&&o.startTime<t.m&&(u.get(s).get(a).push(o),s==t.C&&t.j.append([o]))}r=c(u.keys());for(a=r.next();!a.done;a=r.next())for(a=a.value,t.o.has(a)||t.o.set(a,new Map),n=c(u.get(a).keys()),s=n.next();!s.done;s=n.next())s=s.value,o=u.get(a).get(s),t.o.get(a).set(s,o);t.g=null==t.g?Math.max(e,t.l):Math.min(t.g,Math.max(e,t.l));t.h=Math.max(t.h,Math.min(i,t.m))}q("shaka.text.TextEngine",Ti);Ti.prototype.destroy=Ti.prototype.destroy;Ti.findParser=Si;Ti.unregisterParser=function(t){Pi.delete(t)};Ti.registerParser=Ei;var Pi=new Map;function Ri(t){this.h=t;this.g=null}Ri.prototype.ha=function(n){var e=this;this.stop();var i=true,r=null;this.g=function(){t.clearTimeout(r);i=false};r=t.setTimeout((function(){i&&e.h()}),1e3*n);return this};Ri.prototype.stop=function(){this.g&&(this.g(),this.g=null)};function Di(t){this.h=t;this.g=null}Di.prototype.Hb=function(){this.stop();this.h();return this};Di.prototype.ha=function(t){var n=this;this.stop();this.g=new Ri((function(){n.h()})).ha(t);return this};Di.prototype.Ga=function(t){var n=this;this.stop();this.g=new Ri((function(){n.g.ha(t);n.h()})).ha(t);return this};Di.prototype.stop=function(){this.g&&(this.g.stop(),this.g=null)};q("shaka.util.Timer",Di);Di.prototype.stop=Di.prototype.stop;Di.prototype.tickEvery=Di.prototype.Ga;Di.prototype.tickAfter=Di.prototype.ha;Di.prototype.tickNow=Di.prototype.Hb;function Li(t,n){return t.concat(n)}function Oi(){}function _i(t){return null!=t}function Ui(t,n){return Promise.race([n,new Promise((function(n,e){new Di(e).ha(t)}))])}function Bi(){}function Hi(t,n){t=zi(t);n=zi(n);return t.split("-")[0]==n.split("-")[0]}function Fi(t,n){t=zi(t);n=zi(n);t=t.split("-");n=n.split("-");return t[0]==n[0]&&1==t.length&&2==n.length}function Vi(t,n){t=zi(t);n=zi(n);t=t.split("-");n=n.split("-");return 2==t.length&&2==n.length&&t[0]==n[0]}function zi(t){t=c(t.split("-x-"));var n=t.next().value;n=void 0===n?"":n;t=t.next().value;t=void 0===t?"":t;var e=c(n.split("-"));n=e.next().value;n=void 0===n?"":n;e=e.next().value;e=void 0===e?"":e;t=t?"x-"+t:"";n=n.toLowerCase();n=Ki.get(n)||n;e=e.toUpperCase();return(e?n+"-"+e:n)+(t?"-"+t:"")}function Xi(t,n){t=zi(t);n=zi(n);return n==t?4:Fi(n,t)?3:Vi(n,t)?2:Fi(t,n)?1:0}function qi(t){var n=t.indexOf("-");t=0<=n?t.substring(0,n):t;t=t.toLowerCase();return t=Ki.get(t)||t}function ji(t){return t.language?zi(t.language):t.audio&&t.audio.language?zi(t.audio.language):t.video&&t.video.language?zi(t.video.language):"und"}function Gi(t,n){t=zi(t);var e=new Set;n=c(n);for(var i=n.next();!i.done;i=n.next())e.add(zi(i.value));n=c(e);for(i=n.next();!i.done;i=n.next())if(i=i.value,i==t)return i;n=c(e);for(i=n.next();!i.done;i=n.next())if(i=i.value,Fi(i,t))return i;n=c(e);for(i=n.next();!i.done;i=n.next())if(i=i.value,Vi(i,t))return i;e=c(e);for(n=e.next();!n.done;n=e.next())if(n=n.value,Fi(t,n))return n;return null}q("shaka.util.LanguageUtils",Bi);Bi.findClosestLocale=Gi;Bi.getLocaleForVariant=ji;Bi.getLocaleForText=function(t){return zi(t.language||"und")};Bi.getBase=qi;Bi.relatedness=Xi;Bi.areSiblings=function(t,n){var e=qi(t),i=qi(n);return t!=e&&n!=i&&e==i};Bi.normalize=zi;Bi.isSiblingOf=Vi;Bi.isParentOf=Fi;Bi.areLanguageCompatible=Hi;Bi.areLocaleCompatible=function(t,n){t=zi(t);n=zi(n);return t==n};var Ki=new Map([["aar","aa"],["abk","ab"],["afr","af"],["aka","ak"],["alb","sq"],["amh","am"],["ara","ar"],["arg","an"],["arm","hy"],["asm","as"],["ava","av"],["ave","ae"],["aym","ay"],["aze","az"],["bak","ba"],["bam","bm"],["baq","eu"],["bel","be"],["ben","bn"],["bih","bh"],["bis","bi"],["bod","bo"],["bos","bs"],["bre","br"],["bul","bg"],["bur","my"],["cat","ca"],["ces","cs"],["cha","ch"],["che","ce"],["chi","zh"],["chu","cu"],["chv","cv"],["cor","kw"],["cos","co"],["cre","cr"],["cym","cy"],["cze","cs"],["dan","da"],["deu","de"],["div","dv"],["dut","nl"],["dzo","dz"],["ell","el"],["eng","en"],["epo","eo"],["est","et"],["eus","eu"],["ewe","ee"],["fao","fo"],["fas","fa"],["fij","fj"],["fin","fi"],["fra","fr"],["fre","fr"],["fry","fy"],["ful","ff"],["geo","ka"],["ger","de"],["gla","gd"],["gle","ga"],["glg","gl"],["glv","gv"],["gre","el"],["grn","gn"],["guj","gu"],["hat","ht"],["hau","ha"],["heb","he"],["her","hz"],["hin","hi"],["hmo","ho"],["hrv","hr"],["hun","hu"],["hye","hy"],["ibo","ig"],["ice","is"],["ido","io"],["iii","ii"],["iku","iu"],["ile","ie"],["ina","ia"],["ind","id"],["ipk","ik"],["isl","is"],["ita","it"],["jav","jv"],["jpn","ja"],["kal","kl"],["kan","kn"],["kas","ks"],["kat","ka"],["kau","kr"],["kaz","kk"],["khm","km"],["kik","ki"],["kin","rw"],["kir","ky"],["kom","kv"],["kon","kg"],["kor","ko"],["kua","kj"],["kur","ku"],["lao","lo"],["lat","la"],["lav","lv"],["lim","li"],["lin","ln"],["lit","lt"],["ltz","lb"],["lub","lu"],["lug","lg"],["mac","mk"],["mah","mh"],["mal","ml"],["mao","mi"],["mar","mr"],["may","ms"],["mkd","mk"],["mlg","mg"],["mlt","mt"],["mon","mn"],["mri","mi"],["msa","ms"],["mya","my"],["nau","na"],["nav","nv"],["nbl","nr"],["nde","nd"],["ndo","ng"],["nep","ne"],["nld","nl"],["nno","nn"],["nob","nb"],["nor","no"],["nya","ny"],["oci","oc"],["oji","oj"],["ori","or"],["orm","om"],["oss","os"],["pan","pa"],["per","fa"],["pli","pi"],["pol","pl"],["por","pt"],["pus","ps"],["que","qu"],["roh","rm"],["ron","ro"],["rum","ro"],["run","rn"],["rus","ru"],["sag","sg"],["san","sa"],["sin","si"],["slk","sk"],["slo","sk"],["slv","sl"],["sme","se"],["smo","sm"],["sna","sn"],["snd","sd"],["som","so"],["sot","st"],["spa","es"],["sqi","sq"],["srd","sc"],["srp","sr"],["ssw","ss"],["sun","su"],["swa","sw"],["swe","sv"],["tah","ty"],["tam","ta"],["tat","tt"],["tel","te"],["tgk","tg"],["tgl","tl"],["tha","th"],["tib","bo"],["tir","ti"],["ton","to"],["tsn","tn"],["tso","ts"],["tuk","tk"],["tur","tr"],["twi","tw"],["uig","ug"],["ukr","uk"],["urd","ur"],["uzb","uz"],["ven","ve"],["vie","vi"],["vol","vo"],["wel","cy"],["wln","wa"],["wol","wo"],["xho","xh"],["yid","yi"],["yor","yo"],["zha","za"],["zho","zh"],["zul","zu"]]);function Wi(){}function $i(t,n,e,i,r){function a(t){var n=String(t.width||"")+String(t.height||"")+String(Math.round(t.frameRate||0))+(t.hdr||"")+t.fastSwitching;t.dependencyStream&&(n+=t.dependencyStream.baseOriginalId||"");return n}function u(t){var n=t.language+(t.channelsCount||0)+(t.audioSamplingRate||0)+t.roles.join(",")+t.label+t.groupId+t.fastSwitching;t.dependencyStream&&(n+=t.dependencyStream.baseOriginalId||"");return n}if(r.length){var s=t.textStreams;r=c(r);for(var o=r.next(),f={};!o.done;f={uh:void 0},o=r.next())if(f.uh=o.value,o=s.filter(function(t){return function(n){return n.codecs.startsWith(t.uh)||n.mimeType.startsWith(t.uh)?true:false}}(f)),o.length){s=o;break}t.textStreams=s}s=t.variants;if(n.length||e.length)s=Yi(s,n,e);if(i.length){n=new et;e=c(s);for(s=e.next();!s.done;s=e.next())s=s.value,n.push(String(s.video.width||0),s);var h=[];n.forEach((function(t,n){t=0;var e=[];n=c(n);for(var r=n.next(),a={};!r.done;a={Nf:void 0},r=n.next())a.Nf=r.value,r=i.filter(function(t){return function(n){return t.Nf.decodingInfos[0][n]}}(a)).length,r>t?(t=r,e=[a.Nf]):r==t&&e.push(a.Nf);h.push.apply(h,l(e))}));s=h}e=new Set;n=new Set;s=c(s);for(r=s.next();!r.done;r=s.next())r=r.value,r.audio&&e.add(r.audio),r.video&&n.add(r.video);s=Array.from(e).sort((function(t,n){return t.bandwidth-n.bandwidth}));var d=[];e=new Map;s=c(s);for(r=s.next();!r.done;r=s.next()){r=r.value;o=u(r);f=e.get(o)||[];if(f.length){var v=f[f.length-1],p=pi(v.codecs),m=pi(r.codecs);p!=m||r.bandwidth&&v.bandwidth&&!(r.bandwidth>v.bandwidth)||(f.push(r),d.push(r.id))}else f.push(r),d.push(r.id);e.set(o,f)}var w={vp8:1,avc:1,"dovi-avc":.95,vp9:.9,vp09:.9,hevc:.85,"dovi-hevc":.8,"dovi-p5":.75,av01:.7,"dovi-av1":.65,vvc:.6};s=Array.from(n).sort((function(t,n){if(!t.bandwidth||!n.bandwidth||t.bandwidth==n.bandwidth){if(t.codecs&&n.codecs&&t.codecs!=n.codecs&&t.width==n.width){var e=pi(t.codecs),i=pi(n.codecs);if(e!=i)return(w[e]||1)-(w[i]||1)}return t.width-n.width}return t.bandwidth-n.bandwidth}));n=kn();var g=[];e=new Map;s=c(s);for(r=s.next();!r.done;r=s.next()){r=r.value;o=a(r);f=e.get(o)||[];if(f.length){v=f[f.length-1];if(!n&&(p=pi(v.codecs),m=pi(r.codecs),p!==m))continue;p=pi(v.codecs);m=pi(r.codecs);p!=m||r.bandwidth&&v.bandwidth&&!(r.bandwidth>v.bandwidth)||(f.push(r),g.push(r.id))}else f.push(r),g.push(r.id);e.set(o,f)}t.variants=t.variants.filter((function(t){var n=t.audio;t=t.video;return n&&!d.includes(n.id)||t&&!g.includes(t.id)?false:true}))}function Yi(t,n,e){n=c(n);for(var i=n.next(),r={};!i.done;r={videoCodec:void 0},i=n.next())if(r.videoCodec=i.value,i=t.filter(function(t){return function(n){return n.video&&n.video.codecs.startsWith(t.videoCodec)}}(r)),i.length){t=i;break}e=c(e);n=e.next();for(i={};!n.done;i={audioCodec:void 0},n=e.next())if(i.audioCodec=n.value,n=t.filter(function(t){return function(n){return n.audio&&n.audio.codecs.startsWith(t.audioCodec)}}(i)),n.length){t=n;break}return t}function Qi(t,n,e){t.variants=t.variants.filter((function(t){return Ji(t,n,e)}))}function Ji(t,n,e){function i(t,n,e){return t>=n&&t<=e}var r=t.video;if(r&&r.width&&r.height){var a=r.width,u=r.height;u>a&&(u=c([u,a]),a=u.next().value,u=u.next().value);if(!i(a,n.minWidth,Math.min(n.maxWidth,e.width))||!i(u,n.minHeight,Math.min(n.maxHeight,e.height))||!i(r.width*r.height,n.minPixels,n.maxPixels))return false}return t&&t.video&&t.video.frameRate&&!i(t.video.frameRate,n.minFrameRate,n.maxFrameRate)||t&&t.audio&&t.audio.channelsCount&&!i(t.audio.channelsCount,n.minChannelsCount,n.maxChannelsCount)||!i(t.bandwidth,n.minBandwidth,n.maxBandwidth)?false:true}function Zi(t,n,e,i){e=void 0===e?[]:e;i=void 0===i?{}:i;return _((function(r){if(1==r.g)return T(r,tr(t,n,0<n.offlineSessionIds.length,e,i),2);fr(n);return T(r,cr(n),0)}))}function tr(t,n,e,i,r){var a,u;return _((function(s){if(1==s.g)return ft().Oi()&&nr(n.variants),T(s,ar(n.variants,e,false,i),2);a=null;t&&(u=t.g)&&(a=u.keySystem);n.variants=n.variants.filter((function(t){var n=er(t,a,r);if(!n){var e=[];t.audio&&e.push(Er(t.audio));t.video&&e.push(Er(t.video))}return n}));E(s)}))}function nr(t){var n=(new Map).set("dvav","avc3").set("dva1","avc1").set("dvhe","hev1").set("dvh1","hvc1").set("dvc1","vvc1").set("dvi1","vvi1"),e=new Set;t=c(t);for(var i=t.next();!i.done;i=t.next())i=i.value,i.video&&e.add(i.video);e=c(e);for(t=e.next();!t.done;t=e.next()){t=t.value;i=c(n);for(var r=i.next();!r.done;r=i.next()){var a=c(r.value);r=a.next().value;a=a.next().value;if(t.codecs.includes(r)){t.codecs=t.codecs.replace(r,a);break}}}}function er(t,n,e){if(!t.decodingInfos.some((function(t){return!t.supported||n&&(t=t.keySystemAccess)&&(e[t.keySystem]||t.keySystem)!=n?false:true})))return false;var i=ft(),r="Xbox"===i.Mb();i="MOBILE"===i.La()&&"GECKO"===i.Da();var a=t.video,u=a&&a.width||0,s=a&&a.height||0;if(r&&a&&(1920<u||1080<s)&&(a.codecs.includes("avc1.")||a.codecs.includes("avc3."))||(r=a&&a.dependencyStream)&&!bn(r))return false;t=t.audio;return i&&t&&t.encrypted&&t.codecs.toLowerCase().includes("opus")||t&&t.dependencyStream?false:true}function ir(t,n){var e,i,r,a,u,s,o;return _((function(f){if(1==f.g){e=function(t,n){if(t){var e=Wn(t);e.supported=t.supported&&n.supported;e.powerEfficient=t.powerEfficient&&n.powerEfficient;e.smooth=t.smooth&&n.smooth;n.keySystemAccess&&!e.keySystemAccess&&(e.keySystemAccess=n.keySystemAccess);return e}return n};i=null;r=[];a=c(n);u=a.next();for(s={};!u.done;s={cache:void 0,Ie:void 0},u=a.next())o=u.value,s.Ie=$n(o),s.cache=Ar,s.cache.has(s.Ie)?i=e(i,s.cache.get(s.Ie)):r.push(rr(o).then(function(t){return function(n){var r=null;n=c(n||[]);for(var a=n.next();!a.done;a=n.next())r=e(r,a.value);r&&(t.cache.set(t.Ie,r),i=e(i,r))}}(s)));return T(f,Promise.all(r),2)}i&&t.decodingInfos.push(i);E(f)}))}function rr(t){var n=[""];t.video&&(n=gi(t.video.contentType).split(","));var e=[""];t.audio&&(e=gi(t.audio.contentType).split(","));var i=[];n=c(n);for(var r=n.next();!r.done;r=n.next()){r=r.value;for(var a=c(e),u=a.next(),s={};!u.done;s={Lc:void 0},u=a.next())u=u.value,s.Lc=Kn(t),t.video&&(s.Lc.video.contentType=li(wi(s.Lc.video.contentType),r)),t.audio&&(s.Lc.audio.contentType=li(wi(s.Lc.audio.contentType),u)),i.push(new Promise(function(t){return function(n,e){("MOBILE"==ft().La()?Ui(5,navigator.mediaCapabilities.decodingInfo(t.Lc)):navigator.mediaCapabilities.decodingInfo(t.Lc)).then((function(t){n(t)})).catch(e)}}(s)))}return Promise.all(i).catch((function(){JSON.stringify(t);return null}))}function ar(t,n,e,i){var r,a,u,s,o,f,l,h,d,v,p,m,w,g,b,y,k,E;return _((function(S){switch(S.g){case 1:if(t.some((function(t){return t.decodingInfos.length})))return S.return();r=c(i);a=r.next();u={};case 2:if(a.done){S.u(4);break}u.ti=a.value;s=false;o=c(t);f=o.next();case 5:if(f.done){S.u(7);break}l=f.value;h=ur(l,n,e).filter(function(t){return function(n){n=n[0];return(n.keySystemConfiguration&&n.keySystemConfiguration.keySystem)===t.ti}}(u));d=c(h);v=d.next();case 8:if(v.done){S.u(10);break}p=v.value;return T(S,ir(l,p),9);case 9:v=d.next();S.u(8);break;case 10:l.decodingInfos.length&&(s=true);f=o.next();S.u(5);break;case 7:if(s)return S.return();u={ti:void 0};a=r.next();S.u(2);break;case 4:m=c(t),w=m.next();case 12:if(w.done){S.u(0);break}g=w.value;b=ur(g,n,e).filter((function(t){t=t[0];t=t.keySystemConfiguration&&t.keySystemConfiguration.keySystem;return!t||!i.includes(t)}));y=c(b);k=y.next();case 15:if(k.done){w=m.next();S.u(12);break}E=k.value;return T(S,ir(g,E),16);case 16:k=y.next(),S.u(15)}}))}function ur(t,n,e){var i=t.audio,r=t.video,a=[],u=[];if(r)for(var s=c(r.fullMimeTypes),o=s.next();!o.done;o=s.next()){o=o.value;var f=gi(o);if(f.includes(",")&&!i){var l=f.split(","),h=wi(o);f=fn("video",l);l=fn("audio",l);l=sr(l,h);h=di(h,l,"audio");u.push({contentType:h,channels:2,bitrate:t.bandwidth||1,samplerate:1,spatialRendering:false})}f=or(f);o={contentType:di(wi(o),f,"video"),width:r.width||64,height:r.height||64,bitrate:r.bandwidth||t.bandwidth||1,framerate:r.frameRate||1};if(r.hdr)switch(r.hdr){case"SDR":o.transferFunction="srgb";break;case"PQ":o.transferFunction="pq";break;case"HLG":o.transferFunction="hlg"}r.colorGamut&&(o.colorGamut=r.colorGamut);a.push(o)}if(i)for(s=c(i.fullMimeTypes),o=s.next();!o.done;o=s.next())f=o.value,o=wi(f),f=sr(gi(f),o),o=di(o,f,"audio"),u.push({contentType:o,channels:i.channelsCount||2,bitrate:i.bandwidth||t.bandwidth||1,samplerate:i.audioSamplingRate||1,spatialRendering:i.spatialAudio});s=[];0==a.length&&a.push(null);0==u.length&&u.push(null);a=c(a);for(o=a.next();!o.done;o=a.next())for(o=o.value,f=c(u),h=f.next();!h.done;h=f.next())h=h.value,l={type:e?"file":"media-source"},o&&(l.video=o),h&&(l.audio=h),s.push(l);u=(t.video?t.video.drmInfos:[]).concat(t.audio?t.audio.drmInfos:[]);if(!u.length)return[s];t=[];e=new Map;u=c(u);for(a=u.next();!a.done;a=u.next())a=a.value,e.get(a.keySystem)||e.set(a.keySystem,[]),e.get(a.keySystem).push(a);u=n?"required":"optional";n=n?["persistent-license"]:["temporary"];a=c(e.keys());for(o=a.next();!o.done;o=a.next()){o=o.value;h=e.get(o);f=new Map;h=c(h);for(l=h.next();!l.done;l=h.next()){l=l.value;var d=l.videoRobustness+","+l.audioRobustness;f.get(d)||f.set(d,[]);f.get(d).push(l)}f=c(f.values());for(h=f.next();!h.done;h=f.next()){h=h.value;l=[];d=c(s);for(var v=d.next();!v.done;v=d.next()){v=Object.assign({},v.value);for(var p={keySystem:o,initDataType:"cenc",persistentState:u,distinctiveIdentifier:"optional",sessionTypes:n},m=c(h),w=m.next();!w.done;w=m.next()){w=w.value;if(w.initData&&w.initData.length){for(var g=new Set,b=c(w.initData),y=b.next();!y.done;y=b.next())g.add(y.value.initDataType);p.initDataType=w.initData[0].initDataType}w.distinctiveIdentifierRequired&&(p.distinctiveIdentifier="required");w.persistentStateRequired&&(p.persistentState="required");w.sessionType&&(p.sessionTypes=[w.sessionType]);i&&(p.audio?(w.encryptionScheme&&(p.audio.encryptionScheme=p.audio.encryptionScheme||w.encryptionScheme),p.audio.robustness=p.audio.robustness||w.audioRobustness):(p.audio={robustness:w.audioRobustness},w.encryptionScheme&&(p.audio.encryptionScheme=w.encryptionScheme)),""==p.audio.robustness&&delete p.audio.robustness);r&&(p.video?(w.encryptionScheme&&(p.video.encryptionScheme=p.video.encryptionScheme||w.encryptionScheme),p.video.robustness=p.video.robustness||w.videoRobustness):(p.video={robustness:w.videoRobustness},w.encryptionScheme&&(p.video.encryptionScheme=w.encryptionScheme)),""==p.video.robustness&&delete p.video.robustness)}v.keySystemConfiguration=p;l.push(v)}t.push(l)}}return t}function sr(t,n){var e=ft();return"flac"==t.toLowerCase()?"WEBKIT"!=e.Da()?"flac":"fLaC":"opus"===t.toLowerCase()?"WEBKIT"!=e.Da()?"opus":"mp4"==vi(n)?"Opus":"opus":"ac-3"==t.toLowerCase()&&e.be()?"ec-3":t}function or(t){if(t.includes("avc1")){var n=t.split(".");if(3==n.length)return t=n.shift()+".",t+=parseInt(n.shift(),10).toString(16),t+=("000"+parseInt(n.shift(),10).toString(16)).slice(-4)}else if("vp9"==t)return"vp09.00.41.08";return t}function fr(t){t.textStreams=t.textStreams.filter((function(t){t=li(t.mimeType,t.codecs);return Ai(t)}))}function cr(t){var n,e,i,r,a,u,s;return _((function(o){switch(o.g){case 1:n=[],e=c(t.imageStreams),i=e.next();case 2:if(i.done){o.u(4);break}r=i.value;a=r.mimeType;"application/mp4"==a&&"mjpg"==r.codecs&&(a="image/jpg");if(Mr.has(a)){o.u(5);break}u=xr.get(a);if(!u){Mr.set(a,false);o.u(5);break}return T(o,lr(u),7);case 7:s=o.h,Mr.set(a,s);case 5:Mr.get(a)&&n.push(r);i=e.next();o.u(2);break;case 4:t.imageStreams=n,E(o)}}))}function lr(t){return new Promise((function(n){var e=new Image;e.src=t;"decode"in e?e.decode().then((function(){n(true)})).catch((function(){n(false)})):e.onload=e.onerror=function(){n(2===e.height)}}))}function hr(t){var n=t.audio,e=t.video,i=n?n.mimeType:null,r=e?e.mimeType:null,a=n?n.codecs:null,u=e?e.codecs:null,s=n?n.groupId:null,o=[];e&&o.push(e.mimeType);n&&o.push(n.mimeType);o=o[0]||null;var f=[];n&&f.push(n.kind);e&&f.push(e.kind);f=f[0]||null;var l=new Set;if(n)for(var h=c(n.roles),d=h.next();!d.done;d=h.next())l.add(d.value);if(e)for(h=c(e.roles),d=h.next();!d.done;d=h.next())l.add(d.value);t={id:t.id,active:false,type:"variant",bandwidth:t.bandwidth,language:t.language,label:null,kind:f,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,colorGamut:null,videoLayout:null,mimeType:o,audioMimeType:i,videoMimeType:r,codecs:"",audioCodec:a,videoCodec:u,primary:t.primary,roles:Array.from(l),audioRoles:null,forced:false,videoId:null,audioId:null,audioGroupId:s,channelsCount:null,audioSamplingRate:null,spatialAudio:false,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,originalImageId:null,accessibilityPurpose:null,originalLanguage:null};if(e){t.videoId=e.id;t.originalVideoId=e.originalId;t.width=e.width||null;t.height=e.height||null;t.frameRate=e.frameRate||null;t.pixelAspectRatio=e.pixelAspectRatio||null;t.videoBandwidth=e.bandwidth||null;t.hdr=e.hdr||null;t.colorGamut=e.colorGamut||null;t.videoLayout=e.videoLayout||null;if(i=e.dependencyStream)t.width=i.width||t.width,t.height=i.height||t.height,t.videoCodec=i.codecs||t.videoCodec;if(u.includes(",")){t.channelsCount=e.channelsCount;t.audioSamplingRate=e.audioSamplingRate;t.spatialAudio=e.spatialAudio;t.originalLanguage=e.originalLanguage;t.audioMimeType=r;e=u.split(",");try{t.videoCodec=fn("video",e),t.audioCodec=fn("audio",e)}catch(t){}}}n&&(t.audioId=n.id,t.originalAudioId=n.originalId,t.channelsCount=n.channelsCount,t.audioSamplingRate=n.audioSamplingRate,t.audioBandwidth=n.bandwidth||null,t.spatialAudio=n.spatialAudio,t.label=n.label,t.audioRoles=n.roles,t.accessibilityPurpose=n.accessibilityPurpose,t.originalLanguage=n.originalLanguage,n=n.dependencyStream)&&(t.audioCodec=n.codecs||t.audioCodec);n=[];t.videoCodec&&n.push(t.videoCodec);t.audioCodec&&n.push(t.audioCodec);t.codecs=n.join(", ");return t}function dr(t){return{id:t.id,active:false,type:hn,bandwidth:t.bandwidth||0,language:t.language,label:t.label,kind:t.kind||null,mimeType:t.mimeType,codecs:t.codecs||null,primary:t.primary,roles:t.roles,accessibilityPurpose:t.accessibilityPurpose,forced:t.forced,originalTextId:t.originalId,originalLanguage:t.originalLanguage}}function vr(t){var n=t.width||null,e=t.height||null,i=null;t.segmentIndex&&(i=Gf(t.segmentIndex));var r=t.tilesLayout;i&&(r=i.tilesLayout||r);r&&null!=n&&(n/=Number(r.split("x")[0]));r&&null!=e&&(e/=Number(r.split("x")[1]));return{id:t.id,type:"image",bandwidth:t.bandwidth||0,width:n,height:e,mimeType:t.mimeType,codecs:t.codecs||null,tilesLayout:r||null,originalImageId:t.originalId}}function pr(t){t.__shaka_id||(t.__shaka_id=Ir++);return t.__shaka_id}function mr(t){var n={id:pr(t),active:"disabled"!=t.mode,type:hn,bandwidth:0,language:zi(t.language||"und"),label:t.label,kind:t.kind,mimeType:null,codecs:null,primary:false,roles:[],accessibilityPurpose:null,forced:"forced"==t.kind,originalTextId:t.id,originalLanguage:t.language};"captions"==t.kind&&(n.mimeType="unknown");"subtitles"==t.kind&&(n.mimeType="text/vtt");t.kind&&(n.roles=[t.kind]);return n}function wr(t,n){var e=t?t.language:null;e={id:pr(t||n),active:t?t.enabled:n.selected,type:"variant",bandwidth:0,language:zi(e||"und"),label:t?t.label:null,kind:t?t.kind:null,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,colorGamut:null,videoLayout:null,mimeType:null,audioMimeType:null,videoMimeType:null,codecs:null,audioCodec:null,videoCodec:null,primary:t?"main"==t.kind:false,roles:[],forced:false,audioRoles:null,videoId:null,audioId:null,audioGroupId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:false,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:n?n.id:null,originalAudioId:t?t.id:null,originalTextId:null,originalImageId:null,accessibilityPurpose:null,originalLanguage:e};t&&t.kind&&(e.roles=[t.kind],e.audioRoles=[t.kind]);t&&t.configuration&&(t.configuration.codec&&(e.audioCodec=t.configuration.codec,e.codecs=e.audioCodec),t.configuration.bitrate&&(e.audioBandwidth=t.configuration.bitrate,e.bandwidth+=e.audioBandwidth),t.configuration.sampleRate&&(e.audioSamplingRate=t.configuration.sampleRate),t.configuration.numberOfChannels&&(e.channelsCount=t.configuration.numberOfChannels));if(n&&n.configuration&&(n.configuration.codec&&(e.videoCodec=n.configuration.codec,e.codecs=e.codecs?e.codecs+(","+e.videoCodec):e.videoCodec),n.configuration.bitrate&&(e.videoBandwidth=n.configuration.bitrate,e.bandwidth+=e.videoBandwidth),n.configuration.framerate&&(e.frameRate=n.configuration.framerate),n.configuration.width&&(e.width=n.configuration.width),n.configuration.height&&(e.height=n.configuration.height),n.configuration.colorSpace&&n.configuration.colorSpace.transfer))switch(n.configuration.colorSpace.transfer){case"pq":e.hdr="PQ";break;case"hlg":e.hdr="HLG";break;case"bt709":e.hdr="SDR"}return e}function gr(t){return t.allowedByApplication&&t.allowedByKeySystem&&0==t.disabledUntilTime}function br(t){return t.filter((function(t){return gr(t)}))}function yr(t,n,e,i){var r=t,a=t.filter((function(t){return t.primary}));a.length&&(r=a);var u=r.length?r[0].language:"";r=r.filter((function(t){return t.language==u}));if(n){var s=Gi(zi(n),t.map((function(t){return t.language})));s&&(r=t.filter((function(t){return zi(t.language)==s})))}r=r.filter((function(t){return t.forced==i}));if(e){if(t=kr(r,e),t.length)return t}else if(t=r.filter((function(t){return 0==t.roles.length})),t.length)return t;t=r.map((function(t){return t.roles})).reduce(Li,[]);return t.length?kr(r,t[0]):r}function kr(t,n){return t.filter((function(t){return t.roles.includes(n)}))}function Tr(t,n){n.length&&(n=n.filter((function(n){return pi(t.codecs)==pi(n.codecs)})).sort((function(t,n){return t.bandwidth&&n.bandwidth&&t.bandwidth!=n.bandwidth?t.bandwidth-n.bandwidth:(t.width||0)-(n.width||0)})),t.trickModeVideo=n[0],1<n.length&&(n=n.find((function(n){return t.width==n.width&&t.height==n.height}))))&&(t.trickModeVideo=n)}function Er(t){return"audio"==t.type?"type=audio codecs="+t.codecs+" bandwidth="+t.bandwidth+" channelsCount="+t.channelsCount+" audioSamplingRate="+t.audioSamplingRate:"video"==t.type?"type=video codecs="+t.codecs+" bandwidth="+t.bandwidth+" frameRate="+t.frameRate+" width="+t.width+" height="+t.height:"unexpected stream type"}function Sr(t,n,e){if(0==e.autoShowText)return false;if(1==e.autoShowText)return true;var i=zi(e.preferredTextLanguage);n=zi(n.language);if(2==e.autoShowText)return Hi(n,i);if(3==e.autoShowText){if(!t)return false;t=zi(t.language);return Hi(n,i)&&!Hi(t,n)}Y("Invalid autoShowText setting!");return false}q("shaka.util.StreamUtils",Wi);Wi.meetsRestrictions=Ji;var Ar=new Map,Ir=0,Mr=(new Map).set("image/svg+xml",true).set("image/png",true).set("image/jpeg",true).set("image/jpg",true),xr=(new Map).set("image/webp","data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA").set("image/avif","data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=");function Nr(){var n=this;this.G=null;this.o=false;this.m=new K;this.j=new it;navigator.connection&&navigator.connection.addEventListener&&this.j.D(navigator.connection,"change",(function(){if(n.o&&n.g.useNetworkInformation){n.m=new K;n.g&&n.m.configure(n.g.advanced);var t=n.chooseVariant();t&&navigator.onLine&&n.G(t,n.g.clearBufferSwitch,n.g.safeMarginSwitch)}}));this.F=[];this.H=1;this.I=false;this.h=this.l=this.g=this.s=null;this.A=new Di((function(){if(n.o&&(n.g.restrictToElementSize||n.g.restrictToScreenSize)){var t=n.chooseVariant();t&&n.G(t,n.g.clearBufferSwitch,n.g.safeMarginSwitch)}}));this.B=t;"documentPictureInPicture"in t&&this.j.D(t.documentPictureInPicture,"enter",(function(){n.B=t.documentPictureInPicture.window;n.A&&n.A.Hb();n.j.za(n.B,"pagehide",(function(){n.B=t;n.A&&n.A.Hb()}))}));this.C=this.i=null}i=Nr.prototype;i.stop=function(){this.G=null;this.o=false;this.F=[];this.H=1;this.l=this.s=null;this.h&&(this.h.disconnect(),this.h=null);this.A.stop();this.C=this.i=null};i.release=function(){this.j.release();this.A=null};i.init=function(t){this.G=t};i.chooseVariant=function(){var t=Infinity,n=Infinity;if(this.g.restrictToScreenSize){var e=this.g.ignoreDevicePixelRatio?1:this.B.devicePixelRatio;t=this.B.screen.height*e;n=this.B.screen.width*e}if(this.h&&this.g.restrictToElementSize){e=this.g.ignoreDevicePixelRatio?1:this.B.devicePixelRatio;var i=this.l.clientHeight,r=this.l.clientWidth;this.i&&document.pictureInPictureElement&&document.pictureInPictureElement==this.l&&(i=this.i.height,r=this.i.width);t=Math.min(t,i*e);n=Math.min(n,r*e)}e=this.F.filter((function(t){return t&&!(t.audio&&t.audio.fastSwitching||t.video&&t.video.fastSwitching)}));e.length||(e=this.F);i=e;e.length!=this.F.length&&(i=this.F.filter((function(t){return t&&(t.audio&&t.audio.fastSwitching||t.video&&t.video.fastSwitching?true:false)})));e=Pr(this,this.g.restrictions,i,Infinity,Infinity);if(Infinity!=t||Infinity!=n){e=Rr(e);e=c(e);for(r=e.next();!r.done;r=e.next())if(r=r.value,r.height>=t&&r.width>=n){t=r.height;n=r.width;break}e=Pr(this,this.g.restrictions,i,t,n)}t=this.getBandwidthEstimate();i.length&&!e.length&&(e=Pr(this,null,i,Infinity,Infinity),e=[e[0]]);n=e[0]||null;for(i=0;i<e.length;i++){r=e[i];for(var a=isNaN(this.H)?1:Math.abs(this.H),u=a*r.bandwidth/this.g.bandwidthDowngradeTarget,s={bandwidth:Infinity},o=i+1;o<e.length;o++)if(r.bandwidth!=e[o].bandwidth){s=e[o];break}a=a*s.bandwidth/this.g.bandwidthUpgradeTarget;t>=u&&t<=a&&(n.bandwidth!=r.bandwidth||n.bandwidth==r.bandwidth&&n.video&&r.video&&(n.video.width<r.video.width||n.video.height<r.video.height))&&(n=r)}this.s=Date.now();return n};i.enable=function(){this.o=true};i.disable=function(){this.o=false};i.segmentDownloaded=function(t,n,e,i){var r=t;this.g.removeLatencyFromFirstPacketTime&&i&&1===i.packetNumber&&i.timeToFirstByte&&(r=t-i.timeToFirstByte);r<this.g.cacheLoadThreshold||(this.m.sample(r,n),e&&null!=this.s&&this.o&&Cr(this))};i.trySuggestStreams=function(){null!=this.s&&this.o&&Cr(this)};i.getBandwidthEstimate=function(){var t=this.g.defaultBandwidthEstimate;navigator.connection&&navigator.connection.downlink&&this.g.useNetworkInformation&&(t=1e6*navigator.connection.downlink);if(navigator.connection&&navigator.connection.downlink&&this.g.useNetworkInformation&&this.g.preferNetworkInformationBandwidth)return t;t=this.m.getBandwidthEstimate(t);return this.C?this.C.getBandwidthEstimate(t):t};i.setVariants=function(t){this.F=t};i.playbackRateChanged=function(t){this.H=t};i.setMediaElement=function(n){function e(){i.A.ha(Dr)}var i=this;this.l=n;this.h&&(this.h.disconnect(),this.h=null);this.l&&"ResizeObserver"in t&&(this.h=new ResizeObserver(e),this.h.observe(this.l));this.j.D(n,"enterpictureinpicture",(function(t){t.pictureInPictureWindow&&(i.i=t.pictureInPictureWindow,i.j.D(i.i,"resize",e))}));this.j.D(n,"leavepictureinpicture",(function(){i.i&&i.j.Ja(i.i,"resize",e);i.i=null}))};i.setCmsdManager=function(t){this.C=t};i.configure=function(t){this.g=t;this.m&&this.g&&this.m.configure(this.g.advanced)};function Cr(t){if(!t.I){var n=t.m;if(!(n.g>=n.i))return;t.I=true;t.s-=1e3*(t.g.switchInterval-t.g.minTimeToSwitch)}Date.now()-t.s<1e3*t.g.switchInterval||(n=t.chooseVariant(),t.getBandwidthEstimate(),n&&t.G(n,t.g.clearBufferSwitch,t.g.safeMarginSwitch))}function Pr(t,n,e,i,r){if(t.C){var a=t.C.Wh();a&&(e=e.filter((function(t){return t.bandwidth&&a?t.bandwidth<=a:true})))}n&&(e=e.filter((function(t){return Ji(t,n,{width:r,height:i})})));return e.sort((function(t,n){return t.bandwidth-n.bandwidth}))}function Rr(t){var n=[];t=c(t);for(var e=t.next();!e.done;e=t.next())(e=e.value.video)&&e.height&&e.width&&n.push({height:e.height,width:e.width});return n.sort((function(t,n){return t.width-n.width}))}q("shaka.abr.SimpleAbrManager",Nr);Nr.prototype.configure=Nr.prototype.configure;Nr.prototype.setCmsdManager=Nr.prototype.setCmsdManager;Nr.prototype.setMediaElement=Nr.prototype.setMediaElement;Nr.prototype.playbackRateChanged=Nr.prototype.playbackRateChanged;Nr.prototype.setVariants=Nr.prototype.setVariants;Nr.prototype.getBandwidthEstimate=Nr.prototype.getBandwidthEstimate;Nr.prototype.trySuggestStreams=Nr.prototype.trySuggestStreams;Nr.prototype.segmentDownloaded=Nr.prototype.segmentDownloaded;Nr.prototype.disable=Nr.prototype.disable;Nr.prototype.enable=Nr.prototype.enable;Nr.prototype.chooseVariant=Nr.prototype.chooseVariant;Nr.prototype.init=Nr.prototype.init;Nr.prototype.release=Nr.prototype.release;Nr.prototype.stop=Nr.prototype.stop;var Dr=1;q("shaka.config.CrossBoundaryStrategy",{KEEP:"keep",RESET:"reset",RESET_TO_ENCRYPTED:"reset_to_encrypted",RESET_ON_ENCRYPTION_CHANGE:"RESET_ON_ENCRYPTION_CHANGE"});function Lr(t,n){if(t===n||!t.length||!n.length)return true;t=c(t);for(var e=t.next();!e.done;e=t.next()){e=e.value;if(Br(e))return true;for(var i=c(n),r=i.next();!r.done;r=i.next())if(r=r.value,e.keySystem===r.keySystem||Br(r))return true}return false}function Or(t,n){if(!t.length)return n;if(!n.length)return t;var e=[];t=c(t);for(var i=t.next();!i.done;i=t.next()){i=i.value;for(var r=c(n),a=r.next();!a.done;a=r.next())if(a=a.value,i.keySystem==a.keySystem){r=new Map;for(var u=c((i.initData||[]).concat(a.initData||[])),s=u.next();!s.done;s=u.next())s=s.value,r.set(s.keyId,s);r=Array.from(r.values());u=i.keyIds&&a.keyIds?new Set([].concat(l(i.keyIds),l(a.keyIds))):i.keyIds||a.keyIds;e.push({keySystem:i.keySystem,licenseServerUri:i.licenseServerUri||a.licenseServerUri,distinctiveIdentifierRequired:i.distinctiveIdentifierRequired||a.distinctiveIdentifierRequired,persistentStateRequired:i.persistentStateRequired||a.persistentStateRequired,videoRobustness:i.videoRobustness||a.videoRobustness,audioRobustness:i.audioRobustness||a.audioRobustness,serverCertificate:i.serverCertificate||a.serverCertificate,serverCertificateUri:i.serverCertificateUri||a.serverCertificateUri,initData:r,keyIds:u});break}else Br(i)?e.push(i):Br(a)&&e.push(a)}return e}function _r(t){return t?!!t.match(/^com\.(microsoft|chromecast)\.playready/):false}function Ur(t){return t?!!t.match(/^com\.apple\.fps/):false}function Br(t){return(t=t.licenseServerUri)?t.startsWith("data:application/json;base64,"):false}var Hr=new ot((function(){return Ut(new Uint8Array([0]))})),Fr=new Map;function Vr(t,n){var e=Xr();this.l=null==t.maxAttempts?e.maxAttempts:t.maxAttempts;this.j=null==t.baseDelay?e.baseDelay:t.baseDelay;this.o=null==t.fuzzFactor?e.fuzzFactor:t.fuzzFactor;this.m=null==t.backoffFactor?e.backoffFactor:t.backoffFactor;this.g=0;this.h=this.j;if(this.i=void 0===n?false:n)this.g=1}function zr(t){var n,e;return _((function(i){if(1==i.g){if(t.g>=t.l)if(t.i)t.g=1,t.h=t.j;else throw new zt(2,7,1010);n=t.g;t.g++;if(0==n)return i.return();e=t.h*(1+(2*Math.random()-1)*t.o);return T(i,new Promise((function(t){new Di(t).ha(e/1e3)})),2)}t.h*=t.m;E(i)}))}function Xr(){return{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4}}function qr(){var t,n,e=new Promise((function(e,i){t=e;n=i}));e.resolve=t;e.reject=n;return e}qr.prototype.resolve=function(){};qr.prototype.reject=function(){};function jr(t,n){this.promise=t;this.i=n;this.g=null}function Gr(t){return new jr(Promise.reject(t),(function(){return Promise.resolve()}))}function Kr(){var t=Promise.reject(new zt(2,7,7001));t.catch((function(){}));return new jr(t,(function(){return Promise.resolve()}))}function Wr(t){return new jr(Promise.resolve(t),(function(){return Promise.resolve()}))}function $r(t){return new jr(t,(function(){return t.catch((function(){}))}))}jr.prototype.abort=function(){this.g||(this.g=this.i());return this.g};function Yr(t){return new jr(Promise.all(t.map((function(t){return t.promise}))),(function(){return Promise.all(t.map((function(t){return t.abort()})))}))}jr.prototype.finally=function(t){this.promise.then((function(){return t(true)}),(function(){return t(false)}));return this};jr.prototype.Ua=function(t,n){function e(e){return function(s){if(r.g&&e)a.reject(u);else{var o=e?t:n;o?i=Qr(o,s,a):(e?a.resolve:a.reject)(s)}}}function i(){a.reject(u);return r.abort()}var r=this,a=new qr;a.catch((function(){}));var u=new zt(2,7,7001);this.promise.then(e(true),e(false));return new jr(a,(function(){return i()}))};function Qr(t,n,e){try{var i=t(n);if(i&&i.promise&&i.abort)return e.resolve(i.promise),function(){return i.abort()};e.resolve(i);return function(){return Promise.resolve(i).then((function(){}),(function(){}))}}catch(t){return e.reject(t),function(){return Promise.resolve()}}}s.Object.defineProperties(jr.prototype,{aborted:{configurable:true,enumerable:true,get:function(){return null!==this.g}}});q("shaka.util.AbortableOperation",jr);jr.prototype.chain=jr.prototype.Ua;jr.prototype["finally"]=jr.prototype.finally;jr.all=Yr;jr.prototype.abort=jr.prototype.abort;jr.notAbortable=$r;jr.completed=Wr;jr.aborted=Kr;jr.failed=Gr;function Jr(n,e){if(e)if(e instanceof Map)for(var i=c(e.keys()),r=i.next();!r.done;r=i.next())r=r.value,Object.defineProperty(this,r,{value:e.get(r),writable:true,enumerable:true});else for(i in e)Object.defineProperty(this,i,{value:e[i],writable:true,enumerable:true});this.defaultPrevented=this.cancelable=this.bubbles=false;this.timeStamp=t.performance&&t.performance.now?t.performance.now():Date.now();this.type=n;this.isTrusted=false;this.target=this.currentTarget=null;this.g=false}function Zr(t){var n=new Jr(t.type),e;for(e in t)Object.defineProperty(n,e,{value:t[e],writable:true,enumerable:true});return n}Jr.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=true)};Jr.prototype.stopImmediatePropagation=function(){this.g=true};Jr.prototype.stopPropagation=function(){};q("shaka.util.FakeEvent",Jr);var ta={il:"abrstatuschanged",jl:"adaptation",kl:"audiotrackchanged",ll:"audiotrackschanged",ol:"boundarycrossed",ql:"buffering",rl:"canupdatestarttime",ul:"complete",vl:"currentitemchanged",wl:"downloadcompleted",xl:"downloadfailed",yl:"downloadheadersreceived",zl:"drmsessionupdate",Bl:"emsg",Hl:"itemsinserted",Il:"itemsremoved",Yl:"prft",Error:"error",Cl:"expirationupdated",Dl:"firstquartile",El:"gapjumped",Jl:"keystatuschanged",Nl:"loaded",Ol:"loading",Ql:"manifestparsed",Rl:"manifestupdated",Sl:"mediaqualitychanged",Tl:"mediasourcerecovered",Ul:"metadataadded",Metadata:"metadata",Vl:"midpoint",Wl:"nospatialvideoinfo",Xl:"onstatechange",Zl:"ratechange",bm:"segmentappended",cm:"sessiondata",dm:"spatialvideoinfo",em:"stalldetected",fm:"started",gm:"statechanged",hm:"streaming",im:"textchanged",jm:"texttrackvisibility",lm:"thirdquartile",mm:"timelineregionadded",nm:"timelineregionenter",om:"timelineregionexit",pm:"trackschanged",rm:"unloading",tm:"variantchanged"};function na(){this.Xa=new et;this.xe=this}na.prototype.addEventListener=function(t,n){this.Xa&&this.Xa.push(t,n)};na.prototype.removeEventListener=function(t,n){this.Xa&&this.Xa.remove(t,n)};na.prototype.dispatchEvent=function(t){if(!this.Xa)return true;var n=this.Xa.get(t.type)||[],e=this.Xa.get("All");e&&(n=n.concat(e));n=c(n);for(e=n.next();!e.done;e=n.next()){e=e.value;t.target=this.xe;t.currentTarget=this.xe;try{e.handleEvent?e.handleEvent(t):e.call(this,t)}catch(t){}if(t.g)break}return t.defaultPrevented};na.prototype.release=function(){this.Xa=null};function ea(){this.g=[]}function ia(t,n){t.g.push(n.finally((function(){_n(t.g,n)})))}ea.prototype.destroy=function(){for(var t=[],n=c(this.g),e=n.next();!e.done;e=n.next())e=e.value,e.promise.catch((function(){})),t.push(e.abort());this.g=[];return Promise.all(t)};function ra(t,n,e,i,r,a,u){na.call(this);this.i=null;this.j=false;this.s=new ea;this.g=new Set;this.h=new Set;this.o=t||null;this.m=n||null;this.A=e||null;this.B=i||null;this.C=r||null;this.G=a||null;this.F=u||null;this.l=new Map}g(ra,na);i=ra.prototype;i.configure=function(t){this.i=t};function aa(t,n,e,i){i=void 0===i?false:i;e=e||pa;var r=ma.get(t);(!r||e>=r.priority)&&ma.set(t,{priority:e,tf:n,zk:i})}function ua(t,n){for(var e=c(t.g),i=e.next();!i.done;i=e.next())n.g.add(i.value);t=c(t.h);for(e=t.next();!e.done;e=t.next())n.h.add(e.value)}i.Ck=function(t){this.g.add(t)};i.Yk=function(t){this.g.delete(t)};i.jj=function(){this.g.clear()};i.Dk=function(t){this.h.add(t)};i.Zk=function(t){this.h.delete(t)};i.kj=function(){this.h.clear()};i.Kh=function(){this.l.clear()};function sa(t,n,e){return{uris:t,method:"GET",body:null,headers:{},allowCrossSiteCredentials:false,retryParameters:n,licenseRequestType:null,sessionId:null,drmInfo:null,initData:null,initDataType:null,streamDataCallback:void 0===e?null:e}}i.destroy=function(){this.j=true;this.g.clear();this.h.clear();this.l.clear();na.prototype.release.call(this);return this.s.destroy()};i.request=function(t,n,e){var i=this,r=new ha;if(this.j){var a=Promise.reject(new zt(2,7,7001));a.catch((function(){}));return new da(a,(function(){return Promise.resolve()}),r)}n.method=n.method||"GET";n.headers=n.headers||{};n.retryParameters=n.retryParameters?Kn(n.retryParameters):Xr();n.uris=Kn(n.uris);a=oa(this,t,n,e);var u=a.Ua((function(){return fa(i,t,n,e,new Vr(n.retryParameters,false),0,null,r)})),s=u.Ua((function(n){return ca(i,t,n,e)})),o=Date.now(),f=0;a.promise.then((function(){f=Date.now()-o}),(function(){}));var c=0;u.promise.then((function(){c=Date.now()}),(function(){}));var l=s.Ua((function(r){var a=Date.now()-c,u=r.response;u.timeMs+=f;u.timeMs+=a;r.Zj||!i.o||u.fromCache||"HEAD"==n.method||t!=va||i.o(u.timeMs,u.data.byteLength,la(e),n,e);i.F&&i.F(t,u,e);return u}),(function(t){t&&(t.severity=2);throw t}));a=new da(l.promise,(function(){return l.abort()}),r);ia(this.s,a);return a};function oa(t,n,e,i){function r(t){a=a.Ua((function(){e.body&&(e.body=Ut(e.body));return t(n,e,i)}))}var a=Wr(void 0);t.C&&r(t.C);t=c(t.g);for(var u=t.next();!u.done;u=t.next())r(u.value);return a.Ua(void 0,(function(t){if(t instanceof zt&&7001==t.code)throw t;throw new zt(2,1,1006,t)}))}function fa(t,n,e,i,r,a,u,s){t.i.forceHTTP&&(e.uris[a]=e.uris[a].replace("https://","http://"));t.i.forceHTTPS&&(e.uris[a]=e.uris[a].replace("http://","https://"));0<a&&t.G&&t.G(n,i,e.uris[a],e.uris[a-1]);var o=new bt(e.uris[a]),f=o.ac,c=false;f||(f=location.protocol,f=f.slice(0,-1),yt(o,f),e.uris[a]=o.toString());f=f.toLowerCase();var l=(f=ma.get(f))?f.tf:null;if(!l)return Gr(new zt(2,1,1e3,o));var h=f.zk;(o=t.l.get(o.Cb))&&(e.headers["common-access-token"]=o);var d=null,v=null,p=false,m=false,w;return $r(zr(r)).Ua((function(){if(t.j)return Kr();w=Date.now();var r=0;e.requestStartTime=Date.now();var u=l(e.uris[a],e,n,(function(a,u,o){d&&d.stop();v&&v.ha(f/1e3);t.o&&n==va&&(r++,e.packetNumber=r,t.o(a,u,la(i),e,i),c=true,s.g=o)}),(function(i){m=true;e.timeToFirstByte=Date.now()-e.requestStartTime;t.m&&t.m(i,e,n)}),{minBytesForProgressEvents:t.i.minBytesForProgressEvents});if(!h)return u;var o=e.retryParameters.connectionTimeout;o&&(d=new Di((function(){p=true;u.abort()})),d.ha(o/1e3));var f=e.retryParameters.stallTimeout;f&&(v=new Di((function(){p=true;u.abort()})));return u})).Ua((function(i){d&&d.stop();v&&v.stop();void 0==i.timeMs&&(i.timeMs=Date.now()-w);var r=i.headers["common-access-token"];if(r){var a=new bt(i.uri);t.l.set(a.Cb,r)}r={response:i,Zj:c};!m&&t.m&&t.m(i.headers,e,n);t.A&&t.A(e,i);return r}),(function(o){d&&d.stop();v&&v.stop();if(t.B){var f=null,c=0;o instanceof zt&&(f=o,1001==o.code&&(c=o.data[1]));t.B(e,f,c,p)}if(t.j)return Kr();p&&(o=new zt(1,1,1003,e.uris[a],n));if(o instanceof zt){if(7001==o.code)throw o;if(1010==o.code)throw u;if(1==o.severity){f=(new Map).set("error",o);f=new Jr("retry",f);f.cancelable=true;t.dispatchEvent(f);if(f.defaultPrevented)throw o;a=(a+1)%e.uris.length;return fa(t,n,e,i,r,a,o,s)}}throw o}))}function ca(t,n,e,i){var r=Wr(void 0);t=c(t.h);for(var a=t.next(),u={};!a.done;u={Ci:void 0},a=t.next())u.Ci=a.value,r=r.Ua(function(t){return function(){var r=e.response;r.data&&(r.data=Ut(r.data));return(0,t.Ci)(n,r,i)}}(u));return r.Ua((function(){return e}),(function(t){var n=2;if(t instanceof zt){if(7001==t.code)throw t;n=t.severity}throw new zt(n,1,1007,t)}))}function la(t){if(t){var n=t.segment;t=t.stream;if(n&&t&&t.fastSwitching&&n.o)return false}return true}q("shaka.net.NetworkingEngine",ra);ra.prototype.request=ra.prototype.request;ra.prototype.destroy=ra.prototype.destroy;ra.makeRequest=sa;ra.defaultRetryParameters=function(){return Xr()};ra.prototype.clearCommonAccessTokenMap=ra.prototype.Kh;ra.prototype.clearAllResponseFilters=ra.prototype.kj;ra.prototype.unregisterResponseFilter=ra.prototype.Zk;ra.prototype.registerResponseFilter=ra.prototype.Dk;ra.prototype.clearAllRequestFilters=ra.prototype.jj;ra.prototype.unregisterRequestFilter=ra.prototype.Yk;ra.prototype.registerRequestFilter=ra.prototype.Ck;ra.unregisterScheme=function(t){ma.delete(t)};ra.registerScheme=aa;ra.prototype.configure=ra.prototype.configure;function ha(){this.g=0}ra.NumBytesRemainingClass=ha;function da(t,n,e){jr.call(this,t,n);this.h=e}g(da,jr);ra.PendingRequest=da;var va=1;ra.RequestType={MANIFEST:0,SEGMENT:va,LICENSE:2,APP:3,TIMING:4,SERVER_CERTIFICATE:5,KEY:6,ADS:7,CONTENT_STEERING:8};ra.AdvancedRequestType={INIT_SEGMENT:0,MEDIA_SEGMENT:1,MEDIA_PLAYLIST:2,MASTER_PLAYLIST:3,MPD:4,MSS:5,MPD_PATCH:6,MEDIATAILOR_SESSION_INFO:7,MEDIATAILOR_TRACKING_INFO:8,MEDIATAILOR_STATIC_RESOURCE:9,MEDIATAILOR_TRACKING_EVENT:10,INTERSTITIAL_ASSET_LIST:11,INTERSTITIAL_AD_URL:12};var pa=3;ra.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:pa};var ma=new Map;function wa(t){this.g=false;this.h=new qr;this.i=t}wa.prototype.destroy=function(){var t=this;if(this.g)return this.h;this.g=true;return this.i().then((function(){t.h.resolve()}),(function(){t.h.resolve()}))};function ga(t,n){if(t.g){if(n instanceof zt&&7003==n.code)throw n;throw new zt(2,7,7003,n)}}function ba(t,n){var e=[];t=c(t);for(var i=t.next();!i.done;i=t.next())e.push(n(i.value));return e}function ya(t,n){t=c(t);for(var e=t.next();!e.done;e=t.next())if(!n(e.value))return false;return true}function ka(t){for(var n=new Map,e=c(Object.keys(t)),i=e.next();!i.done;i=e.next())i=i.value,n.set(i,t[i]);return n}function Ta(t){var n={};t.forEach((function(t,e){n[e]=t}));return n}function Ea(t,n){this.h=Ft(t);this.i=n==Aa;this.g=0}i=Ea.prototype;i.Fa=function(){return this.g<this.h.byteLength};i.Ma=function(){return this.g};i.getLength=function(){return this.h.byteLength};i.X=function(){try{var t=this.h.getUint8(this.g);this.g+=1;return t}catch(t){throw Sa()}};i.Aa=function(){try{var t=this.h.getUint16(this.g,this.i);this.g+=2;return t}catch(t){throw Sa()}};i.T=function(){try{var t=this.h.getUint32(this.g,this.i);this.g+=4;return t}catch(t){throw Sa()}};i.Ug=function(){try{var t=this.h.getInt32(this.g,this.i);this.g+=4;return t}catch(t){throw Sa()}};i.vd=function(){try{if(this.i){var t=this.h.getUint32(this.g,true);var n=this.h.getUint32(this.g+4,true)}else n=this.h.getUint32(this.g,false),t=this.h.getUint32(this.g+4,false)}catch(t){throw Sa()}if(2097151<n)throw new zt(2,3,3001);this.g+=8;return n*Math.pow(2,32)+t};i.Sb=function(t){if(this.g+t>this.h.byteLength)throw Sa();var n=Bt(this.h,this.g,t);this.g+=t;return n};i.skip=function(t){if(this.g+t>this.h.byteLength)throw Sa();this.g+=t};i.Di=function(t){if(this.g<t)throw Sa();this.g-=t};i.seek=function(t){if(0>t||t>this.h.byteLength)throw Sa();this.g=t};i.Uc=function(){for(var t=this.g;this.Fa()&&0!=this.h.getUint8(this.g);)this.g+=1;t=Bt(this.h,t,this.g-t);this.g+=1;return qt(t)};function Sa(){return new zt(2,3,3e3)}q("shaka.util.DataViewReader",Ea);Ea.prototype.readTerminatedString=Ea.prototype.Uc;Ea.prototype.seek=Ea.prototype.seek;Ea.prototype.rewind=Ea.prototype.Di;Ea.prototype.skip=Ea.prototype.skip;Ea.prototype.readBytes=Ea.prototype.Sb;Ea.prototype.readUint64=Ea.prototype.vd;Ea.prototype.readInt32=Ea.prototype.Ug;Ea.prototype.readUint32=Ea.prototype.T;Ea.prototype.readUint16=Ea.prototype.Aa;Ea.prototype.readUint8=Ea.prototype.X;Ea.prototype.getLength=Ea.prototype.getLength;Ea.prototype.getPosition=Ea.prototype.Ma;Ea.prototype.hasMoreData=Ea.prototype.Fa;var Aa=1;Ea.Endianness={BIG_ENDIAN:0,LITTLE_ENDIAN:Aa};function Ia(){this.i=new Map;this.h=new Map;this.g=false}i=Ia.prototype;i.box=function(t,n){t=Ra(t);this.i.set(t,Oa);this.h.set(t,n);return this};i.R=function(t,n){t=Ra(t);this.i.set(t,_a);this.h.set(t,n);return this};i.stop=function(){this.g=true};i.parse=function(t,n,e){t=new Ea(t,0);for(this.g=false;t.Fa()&&!this.g;)this.qd(0,t,n,e)};i.qd=function(t,n,e,i){var r=n.Ma();if(i&&r+8>n.getLength())this.g=true;else{var a=n.T(),u=n.T(),s=Da(u),o=false;switch(a){case 0:a=n.getLength()-r;break;case 1:if(i&&n.Ma()+8>n.getLength()){this.g=true;return}a=n.vd();o=true}var f=this.h.get(u);if(f){var c=null,l=null;if(this.i.get(u)==_a){if(i&&n.Ma()+4>n.getLength()){this.g=true;return}l=n.T();c=l>>>24;l&=16777215}u=r+a;e&&u>n.getLength()&&(u=n.getLength());i&&u>n.getLength()?this.g=true:(u-=n.Ma(),n=0<u?n.Sb(u):new Uint8Array(0),n=new Ea(n,0),f({name:s,parser:this,partialOkay:e||false,stopOnPartial:i||false,version:c,flags:l,reader:n,size:a,start:r+t,has64BitSize:o}))}else n.skip(Math.min(r+a-n.Ma(),n.getLength()-n.Ma()))}};function Ma(t){for(var n=La(t);t.reader.Fa()&&!t.parser.g;)t.parser.qd(t.start+n,t.reader,t.partialOkay,t.stopOnPartial)}function xa(t){for(var n=La(t),e=t.reader.T(),i=0;i<e&&(t.parser.qd(t.start+n,t.reader,t.partialOkay,t.stopOnPartial),!t.parser.g);i++);}function Na(t){var n=La(t);for(t.reader.skip(78);t.reader.Fa()&&!t.parser.g;)t.parser.qd(t.start+n,t.reader,t.partialOkay,t.stopOnPartial)}function Ca(t){var n=La(t);t.reader.skip(8);var e=t.reader.Aa();t.reader.skip(6);2==e?t.reader.skip(48):t.reader.skip(12);for(1==e&&t.reader.skip(16);t.reader.Fa()&&!t.parser.g;)t.parser.qd(t.start+n,t.reader,t.partialOkay,t.stopOnPartial)}function Pa(t){return function(n){t(n.reader.Sb(n.reader.getLength()-n.reader.Ma()))}}function Ra(t){var n=0;t=c(t);for(var e=t.next();!e.done;e=t.next())n=n<<8|e.value.charCodeAt(0);return n}function Da(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,t&255)}function La(t){return 8+(t.has64BitSize?8:0)+(null!=t.flags?4:0)}q("shaka.util.Mp4Parser",Ia);Ia.headerSize=La;Ia.typeToString=Da;Ia.allData=Pa;Ia.audioSampleEntry=Ca;Ia.visualSampleEntry=Na;Ia.sampleDescription=xa;Ia.children=Ma;Ia.prototype.parseNext=Ia.prototype.qd;Ia.prototype.parse=Ia.prototype.parse;Ia.prototype.stop=Ia.prototype.stop;Ia.prototype.fullBox=Ia.prototype.R;Ia.prototype.box=Ia.prototype.box;var Oa=0,_a=1;function Ua(t){var n=this;this.g=[];this.h=[];this.data=[];(new Ia).box("moov",Ma).box("moof",Ma).R("pssh",(function(t){if(!(1<t.version)){var e=Bt(t.reader.h,-12,t.size);n.data.push(e);n.g.push(rn(t.reader.Sb(16)));if(0<t.version){e=t.reader.T();for(var i=0;i<e;i++){var r=rn(t.reader.Sb(16));n.h.push(r)}}}})).parse(t)}function Ba(t,n,e,i){var r=t.length,a=n.length+16+r;0<i&&(a+=4+16*e.size);var u=new Uint8Array(a),s=Ft(u),o=0;s.setUint32(o,a);o+=4;s.setUint32(o,1886614376);o+=4;1>i?s.setUint32(o,0):s.setUint32(o,16777216);o+=4;u.set(n,o);o+=n.length;if(0<i)for(s.setUint32(o,e.size),o+=4,n=c(e),e=n.next();!e.done;e=n.next())e=en(e.value),u.set(e,o),o+=e.length;s.setUint32(o,r);u.set(t,o+4);return u}function Ha(t){var n=this;this.C=t;this.j=this.A=null;this.oa=this.ia=false;this.H=0;this.g=null;this.o=new it;this.i=new Map;this.S=[];this.B=new Map;this.K=false;this.m=new qr;this.h=null;this.s=function(e){2==e.severity&&n.m.reject(e);t.onError(e)};this.W=new Map;this.ka=new Map;this.L=new Di((function(){return fu(n)}));this.N=false;this.M=[];this.U=false;this.I=new Di((function(){vu(n)}));this.m.catch((function(){}));this.l=new wa((function(){return Fa(n)}));this.ba=false;this.F=this.G=null;this.P=function(){return false}}i=Ha.prototype;i.destroy=function(){return this.l.destroy()};function Fa(t){return _((function(n){switch(n.g){case 1:return t.o.release(),t.o=null,t.m.reject(),t.I.stop(),t.I=null,t.L.stop(),t.L=null,T(n,hu(t),2);case 2:if(!t.j){n.u(3);break}S(n,4);return T(n,t.j.setMediaKeys(null),6);case 6:I(n,5);break;case 4:M(n);case 5:t.j=null;case 3:t.g=null,t.A=null,t.B=new Map,t.h=null,t.s=function(){},t.C=null,t.ba=false,t.G=null,E(n)}}))}i.configure=function(t,n){this.h=t;n&&(this.P=n);this.I&&this.I.Ga(this.h.updateExpirationTime)};function Va(t,n,e){t.oa=true;t.B=new Map;t.N=e;return qa(t,n,false)}function za(t,n,e,i){i=void 0===i?true:i;t.B=new Map;e=c(e);for(var r=e.next();!r.done;r=e.next())t.B.set(r.value,{initData:null,initDataType:null});e=c(t.h.persistentSessionsMetadata);for(r=e.next();!r.done;r=e.next())r=r.value,t.B.set(r.sessionId,{initData:r.initData,initDataType:r.initDataType});t.N=0<t.B.size;return qa(t,n,i)}function Xa(t,n,e,i,r,a){var u=new Map;r={audioCapabilities:r,videoCapabilities:a,distinctiveIdentifier:"optional",persistentState:"required",sessionTypes:["persistent-license"],label:n};r.drmInfos=[{keySystem:n,licenseServerUri:e,distinctiveIdentifierRequired:false,persistentStateRequired:true,audioRobustness:"",videoRobustness:"",serverCertificate:i,serverCertificateUri:"",initData:null,keyIds:null}];u.set(n,r);return Za(t,u,[])}function qa(t,n,e){var i,r,a,u,s,o,f,l,h,d,v,p,m,w,g,b,y,k;return _((function(E){if(1==E.g){yu(t.h.clearKeys,n);i=n.some((function(t){return t.video&&t.video.drmInfos.length||t.audio&&t.audio.drmInfos.length?true:false}));r=ka(t.h.servers);a=ka(t.h.advanced||{});!i&&e&&wu(n,r);u=new WeakSet;s=c(n);for(o=s.next();!o.done;o=s.next())for(f=o.value,l=du(f),h=c(l),d=h.next();!d.done;d=h.next())v=d.value,u.has(v)||(u.add(v),bu(v,r,a,t.h.keySystemsMapping));p=function(n,e){var i=[];n=c(n);for(var r=n.next();!r.done;r=n.next()){r=r.value;var u=r[e]||a.has(r.keySystem)&&a.get(r.keySystem)[e]||"",s;if(s=""==u)s=(s=r.keySystem)?!!s.match(/^com\.widevine\.alpha/):false;s&&("audioRobustness"==e?u=[t.h.defaultAudioRobustnessForWidevine]:"videoRobustness"==e&&(u=[t.h.defaultVideoRobustnessForWidevine]));if("string"===typeof u)i.push(r);else if(Array.isArray(u))for(0===u.length&&(u=[""]),u=c(u),s=u.next();!s.done;s=u.next()){var o={};i.push(Object.assign({},r,(o[e]=s.value,o)))}}return i};m=new WeakSet;w=c(n);for(g=w.next();!g.done;g=w.next())b=g.value,b.video&&!m.has(b.video)&&(b.video.drmInfos=p(b.video.drmInfos,"videoRobustness"),b.video.drmInfos=p(b.video.drmInfos,"audioRobustness"),m.add(b.video)),b.audio&&!m.has(b.audio)&&(b.audio.drmInfos=p(b.audio.drmInfos,"videoRobustness"),b.audio.drmInfos=p(b.audio.drmInfos,"audioRobustness"),m.add(b.audio));return T(E,ar(n,t.N,t.ba,t.h.preferredKeySystems),2)}ga(t.l);y=i||0<r.size;if(!y)return t.ia=true,E.return(Promise.resolve());k=Za(t,void 0,n);return E.return(i?k:k.catch((function(){})))}))}function ja(t){var n;return _((function(e){switch(e.g){case 1:if(t.j.mediaKeys)return e.return();if(!t.G){e.u(2);break}return T(e,t.G,3);case 3:return ga(t.l),e.return();case 2:return S(e,4),t.G=t.j.setMediaKeys(t.A),T(e,t.G,6);case 6:I(e,5);break;case 4:n=M(e),t.s(new zt(2,6,6003,n.message));case 5:ga(t.l),E(e)}}))}function Ga(t,n){return _((function(e){if(1==e.g)return T(e,ja(t),2);Ya(t,n.initDataType,Bt(n.initData));E(e)}))}i.dc=function(t){var n=this,e,i,r;return _((function(a){if(1==a.g){if(n.j===t)return a.return();if(!n.A)return n.o.za(t,"encrypted",(function(){n.s(new zt(2,6,6010))})),a.return();n.j=t;n.o.za(n.j,"play",(function(){for(var t=c(n.M),e=t.next();!e.done;e=t.next())su(n,e.value);n.U=true;n.M=[]}));n.j.remote?(n.o.D(n.j.remote,"connect",(function(){return hu(n)})),n.o.D(n.j.remote,"connecting",(function(){return hu(n)})),n.o.D(n.j.remote,"disconnect",(function(){return hu(n)}))):"webkitCurrentPlaybackTargetIsWireless"in n.j&&n.o.D(n.j,"webkitcurrentplaybacktargetiswirelesschanged",(function(){return hu(n)}));n.F=n.g?n.g.initData.find((function(t){return 0<t.initData.length}))||null:null;e=n.g.keySystem;i="com.apple.fps"==e;r=ft().Da();"GECKO"===r&&e.startsWith("com.microsoft.playready.recommendation")&&(i=true);return i||!(n.F||n.B.size||n.h.parseInbandPsshEnabled)?(n.o.D(n.j,"encrypted",(function(t){return Ga(n,t)})),a.u(2)):T(a,ja(n),2)}$a(n).catch((function(){}));E(a)}))};function Ka(t){var n,e,i,r,a;return _((function(u){switch(u.g){case 1:if(!t.A||!t.g)return u.return();if(!t.g.serverCertificateUri||t.g.serverCertificate&&t.g.serverCertificate.length){u.u(2);break}n=sa([t.g.serverCertificateUri],t.h.retryParameters);S(u,3);e=t.C.pc.request(5,n,{isPreload:t.P()});return T(u,e.promise,5);case 5:i=u.h;t.g.serverCertificate=Bt(i.data);I(u,4);break;case 3:throw r=M(u),new zt(2,6,6017,r);case 4:if(t.l.g)return u.return();case 2:if(!t.g.serverCertificate||!t.g.serverCertificate.length)return u.return();S(u,6);return T(u,t.A.setServerCertificate(t.g.serverCertificate),8);case 8:I(u,0);break;case 6:throw a=M(u),new zt(2,6,6004,a.message)}}))}function Wa(t,n){var e,i,r;return _((function(a){if(1==a.g)return T(a,ru(t,n,{initData:null,initDataType:null}),2);if(3!=a.g){e=a.h;if(!e)return a.return();i=[];if(r=t.i.get(e))r.Ib=new qr,i.push(r.Ib);i.push(e.remove());return T(a,Promise.all(i),3)}t.i.delete(e);E(a)}))}function $a(t){var n,e,i,r,a;return _((function(u){if(1==u.g){if(!t.B.size)return u.u(2);t.B.forEach((function(n,e){ru(t,e,n)}));return T(u,t.m,3)}if(2!=u.g){n=t.g&&t.g.keyIds||new Set([]);if(0<n.size&&mu(t))return u.return(t.m);t.K=false;t.m=new qr;t.m.catch((function(){}))}e=(t.g?t.g.initData:[])||[];i=c(e);for(r=i.next();!r.done;r=i.next())a=r.value,Ya(t,a.initDataType,a.initData);pu(t)&&t.m.resolve();return u.return(t.m)}))}function Ya(t,n,e){if(e.length){if(t.h.ignoreDuplicateInitData){var i=t.i.values();i=c(i);for(var r=i.next();!r.done;r=i.next())if(_t(e,r.value.initData))return;var a=false;t.B.forEach((function(t){!a&&_t(e,t.initData)&&(a=true)}));if(a)return}t.K=true;0<t.i.size&&pu(t)&&(t.m.resolve(),t.K=false,t.m=new qr,t.m.catch((function(){})));au(t,n,e,t.g.sessionType)}}function Qa(t){t=t.i.keys();t=ba(t,(function(t){return t.sessionId}));return Array.from(t)}i.Ag=function(){var t=this,n=this.i.keys();n=ba(n,(function(n){var e=t.i.get(n);return{sessionId:n.sessionId,sessionType:e.type,initData:e.initData,initDataType:e.initDataType}}));return Array.from(n)};i.Nd=function(){var t=Infinity,n=this.i.keys();n=c(n);for(var e=n.next();!e.done;e=n.next())e=e.value,isNaN(e.expiration)||(t=Math.min(t,e.expiration));return t};function Ja(t){return t.H?t.H:NaN}i.Re=function(){return Ta(this.ka)};function Za(t,n,e){var i,r,a,u,s,o,f,l;return _((function(h){switch(h.g){case 1:i=new Map;if(e.length){r=tu(t,e,i);h.u(2);break}return T(h,nu(t,n),3);case 3:r=h.h;case 2:a=r;if(!a){if(!navigator.requestMediaKeySystemAccess)throw new zt(2,6,6020);throw new zt(2,6,6001)}ga(t.l);S(h,4);a.getConfiguration();u=t.h.keySystemsMapping[a.keySystem]||a.keySystem;if(e.length){var d=u;var v=i.get(u);var p=[],m=[],w=[],g=[],b=[],y=new Set,k=new Set;gu(v,p,m,g,w,b,y,k);var E=t.N?"persistent-license":"temporary";d={keySystem:d,encryptionScheme:p[0],licenseServerUri:m[0],distinctiveIdentifierRequired:v[0].distinctiveIdentifierRequired,persistentStateRequired:v[0].persistentStateRequired,sessionType:v[0].sessionType||E,audioRobustness:v[0].audioRobustness||"",videoRobustness:v[0].videoRobustness||"",serverCertificate:g[0],serverCertificateUri:w[0],initData:b,keyIds:y};0<k.size&&(d.keySystemUris=k);v=c(v);for(k=v.next();!k.done;k=v.next())k=k.value,k.distinctiveIdentifierRequired&&(d.distinctiveIdentifierRequired=k.distinctiveIdentifierRequired),k.persistentStateRequired&&(d.persistentStateRequired=k.persistentStateRequired);v=d}else v=u,k=n.get(u),d=[],p=[],m=[],w=[],g=[],b=new Set,gu(k.drmInfos,d,p,w,m,g,b),v={keySystem:v,encryptionScheme:d[0],licenseServerUri:p[0],distinctiveIdentifierRequired:"required"==k.distinctiveIdentifier,persistentStateRequired:"required"==k.persistentState,sessionType:k.sessionTypes[0]||"temporary",audioRobustness:(k.audioCapabilities?k.audioCapabilities[0].robustness:"")||"",videoRobustness:(k.videoCapabilities?k.videoCapabilities[0].robustness:"")||"",serverCertificate:w[0],serverCertificateUri:m[0],initData:g,keyIds:b};t.g=v;if(!t.g.licenseServerUri)throw new zt(2,6,6012,t.g.keySystem);return T(h,a.createMediaKeys(),6);case 6:s=h.h;ga(t.l);t.A=s;if(!(""!=t.h.minHdcpVersion&&"getStatusForPolicy"in t.A)){h.u(7);break}S(h,8);return T(h,t.A.getStatusForPolicy({minHdcpVersion:t.h.minHdcpVersion}),10);case 10:o=h.h;if("usable"!=o)throw new zt(2,6,6018);ga(t.l);I(h,7,4);break;case 8:f=M(h,4);if(f instanceof zt)throw f;throw new zt(2,6,6019,f.message);case 7:return t.ia=true,T(h,Ka(t),11);case 11:ga(t.l);I(h,0);break;case 4:l=M(h);ga(t.l,l);t.g=null;if(l instanceof zt)throw l;throw new zt(2,6,6002,l.message)}}))}function tu(t,n,e){for(var i=c(n),r=i.next();!r.done;r=i.next()){r=c(du(r.value));for(var a=r.next();!a.done;a=r.next())a=a.value,e.has(a.keySystem)||e.set(a.keySystem,[]),e.get(a.keySystem).push(a)}if(1==e.size&&e.has(""))throw new zt(2,6,6e3);i=t.h.preferredKeySystems;i.length||(r=ka(t.h.servers),1==r.size&&(i=Array.from(r.keys())));r=c(i);var u=r.next();for(a={};!u.done;a={ui:void 0},u=r.next()){a.ui=u.value;u=c(n);for(var s=u.next();!s.done;s=u.next())if(s=s.value.decodingInfos.find(function(t){return function(n){return n.supported&&null!=n.keySystemAccess&&n.keySystemAccess.keySystem==t.ui}}(a)))return s.keySystemAccess}r=c([true,false]);for(a=r.next();!a.done;a=r.next())for(a=a.value,u=c(n),s=u.next();!s.done;s=u.next()){s=c(s.value.decodingInfos);for(var o=s.next();!o.done;o=s.next())if(o=o.value,o.supported&&o.keySystemAccess){var f=o.keySystemAccess.keySystem;if(!i.includes(f)){var l=e.get(f);!l&&t.h.keySystemsMapping[f]&&(l=e.get(t.h.keySystemsMapping[f]));f=c(l);for(l=f.next();!l.done;l=f.next())if(!!l.value.licenseServerUri==a)return o.keySystemAccess}}}return null}function nu(t,n){var e,i,r,a,u,s,o,f,l,h,d,v,p,m,w,g;return _((function(b){switch(b.g){case 1:if(1==n.size&&n.has(""))throw new zt(2,6,6e3);i=c(n.values());for(r=i.next();!r.done;r=i.next())a=r.value,0==a.audioCapabilities.length&&delete a.audioCapabilities,0==a.videoCapabilities.length&&delete a.videoCapabilities;u=c(t.h.preferredKeySystems);s=u.next();case 2:if(s.done){b.u(4);break}o=s.value;if(!n.has(o)){b.u(3);break}f=n.get(o);S(b,6);return T(b,navigator.requestMediaKeySystemAccess(o,[f]),8);case 8:return e=b.h,b.return(e);case 6:M(b);case 7:ga(t.l);case 3:s=u.next();b.u(2);break;case 4:l=c([true,false]),h=l.next();case 9:if(h.done){b.u(11);break}d=h.value;v=c(n.keys());p=v.next();case 12:if(p.done){h=l.next();b.u(9);break}m=p.value;w=n.get(m);g=w.drmInfos.some((function(t){return!!t.licenseServerUri}));if(g!=d){b.u(13);break}S(b,15);return T(b,navigator.requestMediaKeySystemAccess(m,[w]),17);case 17:return e=b.h,b.return(e);case 15:M(b);case 16:ga(t.l);case 13:p=v.next();b.u(12);break;case 11:return b.return(e)}}))}function eu(t){pu(t)&&t.m.resolve()}function iu(t,n){new Di((function(){n.loaded=true;eu(t)})).ha(Tu)}function ru(t,n,e){var i,r,a,u,s,o,f;return _((function(c){switch(c.g){case 1:try{i=t.A.createSession("persistent-license")}catch(n){return r=new zt(2,6,6005,n.message),t.s(r),c.return(Promise.reject(r))}t.o.D(i,"message",(function(n){t.j&&t.h.delayLicenseRequestUntilPlayed&&t.j.paused&&!t.U?t.M.push(n):su(t,n)}));t.o.D(i,"keystatuseschange",(function(n){return ou(t,n)}));a={initData:e.initData,initDataType:e.initDataType,loaded:false,Pg:Infinity,Ib:null,type:"persistent-license"};t.i.set(i,a);S(c,2);return T(c,i.load(n),4);case 4:return u=c.h,ga(t.l),u||(t.i.delete(i),s=t.h.persistentSessionOnlinePlayback?1:2,t.s(new zt(s,6,6013)),a.loaded=true),iu(t,a),eu(t),c.return(i);case 2:o=M(c),ga(t.l,o),t.i.delete(i),f=t.h.persistentSessionOnlinePlayback?1:2,t.s(new zt(f,6,6005,o.message)),a.loaded=true,eu(t);case 3:return c.return(Promise.resolve())}}))}function au(t,n,e,i){try{var r=t.A.createSession(i)}catch(n){t.s(new zt(2,6,6005,n.message));return}t.o.D(r,"message",(function(n){t.j&&t.h.delayLicenseRequestUntilPlayed&&t.j.paused&&!t.U?t.M.push(n):su(t,n)}));t.o.D(r,"keystatuseschange",(function(n){return ou(t,n)}));t.i.set(r,{initData:e,initDataType:n,loaded:false,Pg:Infinity,Ib:null,type:i});try{e=t.h.initDataTransform(e,n,t.g)}catch(e){n=e;e instanceof zt||(n=new zt(2,6,6016,e));t.s(n);return}t.h.logLicenseExchange&&tn(e);r.generateRequest(n,e).catch((function(n){if(!t.l.g){t.i.delete(r);var e=n.errorCode;if(e&&e.systemCode){var i=e.systemCode;0>i&&(i+=Math.pow(2,32));i="0x"+i.toString(16)}t.s(new zt(2,6,6006,n.message,n,i))}}))}function uu(t){return _((function(n){return 1==n.g?t.K?T(n,t.m,3):n.u(0):T(n,Promise.all(t.S.map((function(t){return t.promise}))),0)}))}function su(t,n){var e,i,r,a,u,s,o,f,l,h,d,v,p,m;_((function(w){switch(w.g){case 1:e=n.target;t.h.logLicenseExchange&&tn(n.message);i=t.i.get(e);r=t.g.licenseServerUri;a=t.h.advanced[t.g.keySystem];"individualization-request"==n.messageType&&a&&a.individualizationServer&&(r=a.individualizationServer);u=sa([r],t.h.retryParameters);u.body=n.message;u.method="POST";u.licenseRequestType=n.messageType;u.sessionId=e.sessionId;u.drmInfo=t.g;i&&(u.initData=i.initData,u.initDataType=i.initDataType);if(a&&a.headers)for(s in a.headers)u.headers[s]=a.headers[s];if("org.w3.clearkey"===t.g.keySystem){var g=u,b=t.g;try{var y=Gt(g.body);if(y){var k=JSON.parse(y);k.type||(k.type=b.sessionType,g.body=Kt(JSON.stringify(k)))}}catch(t){}}if(_r(t.g.keySystem))if(g=jt(u.body,true,true),g.includes("PlayReadyKeyMessage")){g=Qn(g,"PlayReadyKeyMessage");b=ae(g,"HttpHeader");b=c(b);for(y=b.next();!y.done;y=b.next())k=y.value,y=ae(k,"name")[0],k=ae(k,"value")[0],u.headers[ie(y)]=ie(k);g=ae(g,"Challenge")[0];u.body=nn(ie(g))}else u.headers["Content-Type"]="text/xml; charset=utf-8";o=Date.now();S(w,2);l=t.C.pc.request(2,u,{isPreload:t.P()});t.S.push(l);return T(w,l.promise,4);case 4:f=w.h;_n(t.S,l);I(w,3);break;case 2:h=M(w);if(t.l.g)return w.return();d=new zt(2,6,6007,h);1==t.i.size?(t.s(d),i&&i.Ib&&i.Ib.reject(d)):(i&&i.Ib&&i.Ib.reject(d),t.i.delete(e),pu(t)&&(t.m.resolve(),t.L.ha(.1)));return w.return();case 3:if(t.l.g)return w.return();t.H+=(Date.now()-o)/1e3;t.h.logLicenseExchange&&tn(f.data);S(w,5);return T(w,e.update(f.data),7);case 7:I(w,6);break;case 5:return v=M(w),p=new zt(2,6,6008,v.message),t.s(p),i&&i.Ib&&i.Ib.reject(p),w.return();case 6:if(t.l.g)return w.return();m=new Jr("drmsessionupdate");t.C.onEvent(m);i&&(i.Ib&&i.Ib.resolve(),iu(t,i));E(w)}}))}function ou(t,n){n=n.target;var e=t.i.get(n),i=false;n.keyStatuses.forEach((function(n,r){if("string"==typeof r){var a=r;r=n;n=a}a=ft();if(_r(t.g.keySystem)&&16==r.byteLength&&a.ah()){a=Ft(r);var u=a.getUint32(0,true),s=a.getUint16(4,true),o=a.getUint16(6,true);a.setUint32(0,u,false);a.setUint16(4,s,false);a.setUint16(6,o,false)}"status-pending"!=n&&(e.loaded=true);"expired"==n&&(i=true);r=rn(r).slice(0,32);t.W.set(r,n)}));var r=n.expiration-Date.now();(0>r||i&&1e3>r)&&e&&!e.Ib&&(t.i.delete(n),lu(n));pu(t)&&(t.m.resolve(),t.L.ha(Eu))}function fu(t){var n=t.W,e=t.ka;e.clear();n.forEach((function(t,n){return e.set(n,t)}));n=Array.from(e.values());n.length&&n.every((function(t){return"expired"==t}))&&t.s(new zt(2,6,6014));t.C.nf(Ta(e))}function cu(){var n,e,i,r,a,u,s,o,f,l,h,d,v,p,m,w,g,b,y,k,A,x,N,C,P,R,D,L,O,U,B,H,F,V,z;return _((function(X){if(1==X.g){n="org.w3.clearkey com.widevine.alpha com.widevine.alpha.experiment com.microsoft.playready com.microsoft.playready.hardware com.microsoft.playready.recommendation com.microsoft.playready.recommendation.3000 com.microsoft.playready.recommendation.3000.clearlead com.chromecast.playready com.apple.fps.1_0 com.apple.fps com.huawei.wiseplay".split(" ");if(!(t.MediaKeys&&t.navigator&&t.navigator.requestMediaKeySystemAccess&&t.MediaKeySystemAccess&&t.MediaKeySystemAccess.prototype.getConfiguration)){e={};i=c(n);for(r=i.next();!r.done;r=i.next())a=r.value,e[a]=null;return X.return(e)}u="1.0 1.1 1.2 1.3 1.4 2.0 2.1 2.2 2.3".split(" ");s=["SW_SECURE_CRYPTO","SW_SECURE_DECODE","HW_SECURE_CRYPTO","HW_SECURE_DECODE","HW_SECURE_ALL"];o=["150","2000","3000"];f={"com.widevine.alpha":s,"com.widevine.alpha.experiment":s,"com.microsoft.playready.recommendation":o};l=[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}];h=[{contentType:'audio/mp4; codecs="mp4a.40.2"'},{contentType:'audio/webm; codecs="opus"'}];d={videoCapabilities:l,audioCapabilities:h,initDataTypes:["cenc","sinf","skd","keyids"]};v=[null,"cenc","cbcs","cbcs-1-9"];p=new Map;m=ft();w=function(t,n){var e,i,r,a,s,o,f,l,h,d,v,w,g;return _((function(b){switch(b.g){case 1:return S(b,2),T(b,n.createMediaKeys(),5);case 5:e=b.h;case 4:I(b,3);break;case 2:return M(b),b.return();case 3:r=(i=n.getConfiguration().sessionTypes)?i.includes("persistent-license"):false;m.li()&&(r=false);a=n.getConfiguration().videoCapabilities;s=n.getConfiguration().audioCapabilities;o={persistentState:r,encryptionSchemes:[],videoRobustnessLevels:[],audioRobustnessLevels:[],minHdcpVersions:[]};p.has(t)&&p.get(t)?o=p.get(t):p.set(t,o);(f=a[0].encryptionScheme)&&!o.encryptionSchemes.includes(f)&&o.encryptionSchemes.push(f);(l=a[0].robustness)&&!o.videoRobustnessLevels.includes(l)&&o.videoRobustnessLevels.push(l);(h=s[0].robustness)&&!o.audioRobustnessLevels.includes(h)&&o.audioRobustnessLevels.push(h);if("getStatusForPolicy"in e){d=[];v=c(u);w=v.next();for(g={};!w.done;g={Rd:void 0},w=v.next())g.Rd=w.value,o.minHdcpVersions.includes(g.Rd)||d.push(e.getStatusForPolicy({minHdcpVersion:g.Rd}).then(function(t){return function(n){"usable"!=n||o.minHdcpVersions.includes(t.Rd)||o.minHdcpVersions.push(t.Rd)}}(g)));return T(b,Promise.all(d),0)}b.u(0)}}))};g=function(t,n,e,i){var r,a,u,s,o,f,l,h,v,p,m;return _((function(g){switch(g.g){case 1:S(g,2);r=Kn(d);a=c(r.videoCapabilities);for(u=a.next();!u.done;u=a.next())s=u.value,s.encryptionScheme=n,s.robustness=e;o=c(r.audioCapabilities);for(f=o.next();!f.done;f=o.next())l=f.value,l.encryptionScheme=n,l.robustness=i;h=Kn(r);h.persistentState="required";h.sessionTypes=["persistent-license"];v=[h,r];m=ft();return"MOBILE"==m.La()?T(g,Ui(5,navigator.requestMediaKeySystemAccess(t,v)),7):T(g,navigator.requestMediaKeySystemAccess(t,v),6);case 6:p=g.h;g.u(5);break;case 7:p=g.h;case 5:return T(g,w(t,p),8);case 8:I(g,0);break;case 2:M(g),E(g)}}))};b=function(t,n,e,i){var r,a,u,s;return _((function(o){switch(o.g){case 1:return S(o,2),r={type:"media-source",video:{contentType:l[0].contentType,width:640,height:480,bitrate:1,framerate:1},audio:{contentType:h[0].contentType,channels:2,bitrate:1,samplerate:1},keySystemConfiguration:{keySystem:t,video:{encryptionScheme:n,robustness:e},audio:{encryptionScheme:n,robustness:i}}},u=ft(),"MOBILE"==u.La()?T(o,Ui(5,navigator.mediaCapabilities.decodingInfo(r)),7):T(o,navigator.mediaCapabilities.decodingInfo(r),6);case 6:a=o.h;o.u(5);break;case 7:a=o.h;case 5:return s=a.keySystemAccess,T(o,w(t,s),8);case 8:I(o,0);break;case 2:M(o),E(o)}}))};y=c(n);for(k=y.next();!k.done;k=y.next())A=k.value,p.set(A,null);x=function(t){return"WEBKIT"===ft().Da()&&"org.w3.clearkey"===t?false:true};N=[];C=c(v);for(P=C.next();!P.done;P=C.next())for(R=P.value,D=c(n),L=D.next();!L.done;L=D.next())O=L.value,x(O)&&(N.push(g(O,R,"","")),N.push(b(O,R,"","")));U=c(n);for(B=U.next();!B.done;B=U.next())for(H=B.value,F=c(f[H]||[]),V=F.next();!V.done;V=F.next())z=V.value,x(H)&&(N.push(g(H,null,z,"")),N.push(g(H,null,"",z)),N.push(b(H,null,z,"")),N.push(b(H,null,"",z)));return T(X,Promise.all(N),2)}return X.return(Ta(p))}))}function lu(t){return _((function(n){if(1==n.g)return S(n,2),T(n,Ui(ku,Promise.all([t.close().catch((function(){})),t.closed])),4);if(2!=n.g)return I(n,0);M(n);E(n)}))}function hu(t){var n;return _((function(e){n=Array.from(t.i.entries());t.i.clear();return T(e,Promise.all(n.map((function(n){n=c(n);var e=n.next().value,i=n.next().value;return _((function(n){if(1==n.g)return S(n,2),t.oa||t.B.has(e.sessionId)||"persistent-license"!==i.type||t.h.persistentSessionOnlinePlayback?T(n,lu(e),5):T(n,e.remove(),5);if(2!=n.g)return I(n,0);M(n);E(n)}))}))),0)}))}function du(t){return(t.video?t.video.drmInfos:[]).concat(t.audio?t.audio.drmInfos:[])}function vu(t){t.i.forEach((function(n,e){var i=n.Pg,r=e.expiration;isNaN(r)&&(r=Infinity);r!=i&&(t.C.onExpirationUpdated(e.sessionId,r),n.Pg=r)}))}function pu(t){t=t.i.values();return ya(t,(function(t){return t.loaded}))}function mu(t){for(var n=c(t.g&&t.g.keyIds||new Set([])),e=n.next();!e.done;e=n.next())if("usable"!==t.W.get(e.value))return false;return true}function wu(t,n){var e=[];n.forEach((function(t,n){e.push({keySystem:n,licenseServerUri:t,distinctiveIdentifierRequired:false,persistentStateRequired:false,audioRobustness:"",videoRobustness:"",serverCertificate:null,serverCertificateUri:"",initData:[],keyIds:new Set})}));t=c(t);for(n=t.next();!n.done;n=t.next())n=n.value,n.video&&(n.video.drmInfos=e),n.audio&&(n.audio.drmInfos=e)}function gu(n,e,i,r,a,u,s,o){var f=[];n=c(n);for(var h=n.next(),d={};!h.done;d={Ha:void 0},h=n.next()){d.Ha=h.value;e.includes(d.Ha.encryptionScheme)||e.push(d.Ha.encryptionScheme);"org.w3.clearkey"==d.Ha.keySystem&&d.Ha.licenseServerUri.startsWith("data:application/json;base64,")?f.includes(d.Ha.licenseServerUri)||f.push(d.Ha.licenseServerUri):i.includes(d.Ha.licenseServerUri)||i.push(d.Ha.licenseServerUri);a.includes(d.Ha.serverCertificateUri)||a.push(d.Ha.serverCertificateUri);d.Ha.serverCertificate&&(r.some(function(t){return function(n){return _t(n,t.Ha.serverCertificate)}}(d))||r.push(d.Ha.serverCertificate));if(d.Ha.initData){h=c(d.Ha.initData);for(var v=h.next(),p={};!v.done;p={Gg:void 0},v=h.next())p.Gg=v.value,u.some(function(t){return function(n){var e=t.Gg;return n.keyId&&n.keyId==e.keyId?true:n.initDataType==e.initDataType&&_t(n.initData,e.initData)}}(p))||u.push(p.Gg)}if(d.Ha.keyIds)for(h=c(d.Ha.keyIds),v=h.next();!v.done;v=h.next())s.add(v.value);if(d.Ha.keySystemUris&&o)for(d=c(d.Ha.keySystemUris),h=d.next();!h.done;h=d.next())o.add(h.value)}if(1==f.length)i.push(f[0]);else if(0<f.length){e=[];f=c(f);for(r=f.next();!r.done;r=f.next())r=t.atob(r.value.split("data:application/json;base64,").pop()),r=JSON.parse(r),e.push.apply(e,l(r.keys));f=JSON.stringify({keys:e});i.push("data:application/json;base64,"+t.btoa(f))}}function bu(n,e,i,r){var a=n.keySystem;if(a&&("org.w3.clearkey"!=a||!n.licenseServerUri)){e.size&&e.get(a)&&(e=e.get(a),n.licenseServerUri=e);n.keyIds||(n.keyIds=new Set);if(i=i.get(a))n.distinctiveIdentifierRequired||(n.distinctiveIdentifierRequired=i.distinctiveIdentifierRequired),n.persistentStateRequired||(n.persistentStateRequired=i.persistentStateRequired),n.serverCertificate||(n.serverCertificate=i.serverCertificate),i.sessionType&&(n.sessionType=i.sessionType),n.serverCertificateUri||(n.serverCertificateUri=i.serverCertificateUri);r[a]&&(n.keySystem=r[a]);t.cast&&t.cast.__platform__&&"com.microsoft.playready"==a&&(n.keySystem="com.chromecast.playready")}}function yu(t,n){t=ka(t);if(0!=t.size){t=on(t);n=c(n);for(var e=n.next();!e.done;e=n.next())e=e.value,e.video&&(e.video.drmInfos=[t]),e.audio&&(e.audio.drmInfos=[t])}}var ku=1,Tu=5,Eu=.5;function Su(t,n,e){e=void 0===e?true:e;this.h=t;this.g=new Set([t]);n=n||[];t=c(n);for(n=t.next();!n.done;n=t.next())this.add(n.value,e)}Su.prototype.add=function(t,n){var e=this.h;n=void 0===n?true:n;var i;if(!(i=!!e.audio!=!!t.audio||!!e.video!=!!t.video||e.language!=t.language)&&(i=e.audio&&t.audio)){i=e.audio;var r=t.audio;i=!(!((!i.channelsCount||!r.channelsCount||2<i.channelsCount||2<r.channelsCount)&&i.channelsCount!=r.channelsCount||i.spatialAudio!==r.spatialAudio||n&&!Au(i,r))&&Iu(i.roles,r.roles)&&i.groupId===r.groupId)}!i&&(i=e.video&&t.video)&&(e=e.video,i=t.video,i=!((!n||Au(e,i))&&Iu(e.roles,i.roles)));return i?false:(this.g.add(t),true)};Su.prototype.values=function(){return this.g.values()};function Au(t,n){if(t.mimeType!=n.mimeType)return false;t=t.codecs.split(",").map((function(t){return mi(t)}));n=n.codecs.split(",").map((function(t){return mi(t)}));if(t.length!=n.length)return false;t.sort();n.sort();for(var e=0;e<t.length;e++)if(t[e]!=n[e])return false;return true}function Iu(t,n){t=new Set(t);n=new Set(n);t.delete("main");n.delete("main");if(t.size!=n.size)return false;t=c(t);for(var e=t.next();!e.done;e=t.next())if(!n.has(e.value))return false;return true}q("shaka.media.AdaptationSet",Su);q("shaka.config.CodecSwitchingStrategy",{RELOAD:"reload",SMOOTH:"smooth"});function Mu(){}Mu.prototype.create=function(){};Mu.prototype.configure=function(){};Mu.prototype.getConfiguration=function(){};q("shaka.media.AdaptationSetCriteria",Mu);function xu(){this.g=Cu;this.i=(new Map).set(Cu,2).set(Nu,1);this.h=0}var Nu=0,Cu=1;
/*
		 @license
		 Shaka Player
		 Copyright 2023 Google LLC
		 SPDX-License-Identifier: Apache-2.0
		*/function Pu(t,n,e){this.g=t;this.i=n;this.h=e}function Ru(t,n){return _((function(e){if(1==e.g)return T(e,Zi(t.h,n,t.g.drm.preferredKeySystems,t.g.drm.keySystemsMapping),2);t.g.streaming.dontChooseCodecs||$i(n,t.g.preferredVideoCodecs,t.g.preferredAudioCodecs,t.g.preferredDecodingAttributes,t.g.preferredTextFormats);if(!n.variants.some(gr))throw new zt(2,4,4032);return e.return(Lu(t,n))}))}function Du(t,n){var e=t.g.restrictions;t=t.i;var i=false;n=c(n.variants);for(var r=n.next();!r.done;r=n.next()){r=r.value;var a=r.allowedByApplication;r.allowedByApplication=Ji(r,e,t);a!=r.allowedByApplication&&(i=true)}return i}function Lu(t,n){var e=Du(t,n);if(n){var i=t.h?t.h.g:null;if(i&&t.h.A){for(var r=new Set,a=c(n.variants),u=a.next();!u.done;u=a.next())u=u.value,u.audio&&r.add(u.audio),u.video&&r.add(u.video);r=c(r);for(a=r.next();!a.done;a=r.next())Ou(t,i.keySystem,a.value)}_u(t,n)}return e}function Ou(t,n,e){e=c(e.drmInfos);for(var i=e.next();!i.done;i=e.next())if(i=i.value,i.keySystem==n){i=c(i.initData||[]);for(var r=i.next();!r.done;r=i.next())r=r.value,Ya(t.h,r.initDataType,r.initData)}}function _u(t,n){t=t.h?t.h.Re():{};var e=Object.keys(t);e=e.length&&"00"==e[0];var i=false,r=false,a=new Set,u=new Set,s=new Set;n=c(n.variants);for(var o=n.next();!o.done;o=n.next())o=o.value,o.audio&&s.add(o.audio),o.video&&s.add(o.video),o.allowedByApplication?o.allowedByKeySystem&&(i=true):r=true;s=c(s);for(n=s.next();!n.done;n=s.next())if(n=n.value,n.keyIds.size)for(n=c(n.keyIds),o=n.next();!o.done;o=n.next()){o=o.value;var f=t[e?"00":o];f?Uu.includes(f)&&u.add(f):a.add(o)}if(!i)throw t={hasAppRestrictions:r,missingKeys:Array.from(a),restrictedKeyStatuses:Array.from(u)},new zt(2,4,4012,t)}var Uu=["output-restricted","internal-error"];function Bu(){}function Hu(t,n){zu.set(t,n)}function Fu(){var t={};ft();if(qy())for(var n=c(zu.keys()),e=n.next();!e.done;e=n.next())t[e.value]=true;n=c(["application/dash+xml","application/x-mpegurl","application/vnd.apple.mpegurl","application/vnd.ms-sstr+xml"]);for(e=n.next();!e.done;e=n.next())e=e.value,t[e]=qy()?zu.has(e):""!=Ws().canPlayType(e);return t}function Vu(t,n){if(n){var e=zu.get(n.toLowerCase());if(e)return e}throw new zt(2,4,4e3,t,n)}q("shaka.media.ManifestParser",Bu);Bu.unregisterParserByMime=function(t){zu.delete(t)};Bu.registerParserByMime=Hu;Bu.registerParserByExtension=function(){vt("ManifestParser.registerParserByExtension","Please use an ManifestParser with registerParserByMime function.")};Bu.AccessibilityPurpose={sm:"visually impaired",Fl:"hard of hearing",am:"spoken subtitles"};var zu=new Map;function Xu(t,n){var e=null,i=null,r=null,a=null,u=t.T();n&1&&(r=t.vd());n&2&&(a=t.T());n&8&&(e=t.T());n&16&&(i=t.T());return{trackId:u,Jd:e,Kd:i,fj:r,Ei:a}}function qu(t,n){return 1==n?(n=t.T(),t=t.T(),{baseMediaDecodeTime:n*Math.pow(2,32)+t}):{baseMediaDecodeTime:t.T()}}function ju(t,n){1==n?(t.skip(8),t.skip(8)):(t.skip(4),t.skip(4));n=t.T();t.skip(4);t=t.Aa();return{timescale:n,language:String.fromCharCode((t>>10)+96)+String.fromCharCode(((t&960)>>5)+96)+String.fromCharCode((t&31)+96)}}function Gu(t,n,e){var i=t.T(),r=[],a=null;e&1&&(a=t.Ug());e&4&&t.skip(4);for(var u=0;u<i;u++){var s={dh:null,sampleSize:null,yf:null};e&256&&(s.dh=t.T());e&512&&(s.sampleSize=t.T());e&1024&&t.skip(4);e&2048&&(s.yf=0==n?t.T():t.Ug());r.push(s)}return{xm:i,bh:r,ig:a}}function Ku(t){t.skip(6);t.skip(2);t.skip(8);var n=t.Aa();t.skip(2);t.skip(2);t.skip(2);t=t.Aa()+t.Aa()/65536;return{channelCount:n,sampleRate:t}}function Wu(t){t=t.T();return{codec:Da(t)}}function $u(t){var n=null,e=null,i=t.Sb(4);var r=String.fromCharCode(i[0]);r+=String.fromCharCode(i[1]);r+=String.fromCharCode(i[2]);r+=String.fromCharCode(i[3]);if("nclx"===r){switch(t.Aa()){case 1:case 5:case 6:case 7:n="srgb";break;case 9:n="rec2020";break;case 11:case 12:n="p3"}i=t.Aa();t.Aa();switch(i){case 1:case 6:case 13:case 14:case 15:e="SDR";break;case 16:e="PQ";break;case 18:e="HLG"}}return{colorGamut:n,le:e}}function Yu(t,n){n=void 0===n?false:n;t=t.toString(16).toUpperCase();return n?t:("0"+t).slice(-2)}function Qu(t){return(10>t?"0":"")+t}function Ju(t){if(!cs){cs=true;var n=new Uint8Array([105,115,111,109]),e=new Uint8Array([97,118,99,49]),i=new Uint8Array([0,0,0,1]);Ts=fs("ftyp",n,i,n,e);n=fs("dref",Es);Ss=fs("dinf",n)}this.g=t}function Zu(t){for(var n=[],e=c(t.g),i=e.next();!i.done;i=e.next()){var r=n,a=r.push;var u=i.value;i=fs;var s=u.id+1;var o=u.stream.width||0,f=u.stream.height||0;"audio"==u.type&&(f=o=0);var h=u.duration*u.timescale,d=Math.floor(h/(ls+1));h=Math.floor(h%(ls+1));s=new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3].concat(l(us(s,4)),[0,0,0,0],l(us(d,4)),l(us(h,4)),[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],l(us(o,2)),[0,0],l(us(f,2)),[0,0]));s=fs("tkhd",s);o=fs;d=u.duration*u.timescale;f=Math.floor(d/(ls+1));d=Math.floor(d%(ls+1));h=u.stream.language;h=h.charCodeAt(0)-96<<10|h.charCodeAt(1)-96<<5|h.charCodeAt(2)-96;f=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3].concat(l(us(u.timescale,4)),l(us(f,4)),l(us(d,4)),l(us(h,2)),[0,0]));f=fs("mdhd",f);d=u;h=new Uint8Array([]);switch(d.type){case"video":h=ds;break;case"audio":h=vs}d=fs("hdlr",h);t:{switch(u.type){case"video":u=fs("minf",fs("vmhd",bs),Ss,ts(u));break t;case"audio":u=fs("minf",fs("smhd",ys),Ss,ts(u));break t}u=new Uint8Array([])}u=o("mdia",f,d,u);i=i("trak",s,u);a.call(r,i)}n=an.apply(Jt,l(n));a=t.g[0];e=fs;i=a.duration*a.timescale;r=Math.floor(i/(ls+1));i=Math.floor(i%(ls+1));r=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3].concat(l(us(a.timescale,4)),l(us(r,4)),l(us(i,4)),[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]));r=fs("mvhd",r);i=[];t=c(t.g);for(o=t.next();!o.done;o=t.next())u=i,s=u.push,o=new Uint8Array([0,0,0,0].concat(l(us(o.value.id+1,4)),[0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),o=fs("trex",o),s.call(u,o);t=an.apply(Jt,l(i));t=fs("mvex",t);i=[];if(a.encrypted){a=c(a.stream.drmInfos);for(u=a.next();!u.done;u=a.next())if(u=u.value,u.initData)for(u=c(u.initData),s=u.next();!s.done;s=u.next())i.push(s.value.initData);a=an.apply(Jt,l(i))}else a=new Uint8Array([]);t=e("moov",r,n,t,a);n=new Uint8Array(Ts.byteLength+t.byteLength);n.set(Ts);n.set(t,Ts.byteLength);return n}function ts(t){var n=fs,e="aac";t.codecs.includes("mp3")?e="mp3":t.codecs.includes("ac-3")?e=ft().be()?"ec-3":"ac-3":t.codecs.includes("ec-3")?e="ec-3":t.codecs.includes("opus")&&(e="opus");var i=new Uint8Array([]);switch(t.type){case"video":if(t.codecs.includes("avc1")){e=t.stream.width||0;i=t.stream.height||0;if(0<t.Na.byteLength)var r=fs("avcC",t.Na);else{r=fs;for(var a=7,u=[],s=[],o=0,f=0,c=0,h=0;h<t.Ab.length;h++){var d=ss(t.Ab[h]);switch(d[0]&31){case 7:u.push(d);a+=d.length+2;break;case 8:s.push(d),a+=d.length+2}}0<u.length&&(o=u[0][1],c=u[0][2],f=u[0][3]);a=new Uint8Array(a);h=0;a[h++]=1;a[h++]=o;a[h++]=c;a[h++]=f;a[h++]=255;a[h++]=224|u.length;for(o=0;o<u.length;o++)a[h++]=(u[o].length&65280)>>8,a[h++]=u[o].length&255,a.set(u[o],h),h+=u[o].length;a[h++]=s.length;for(u=0;u<s.length;u++)a[h++]=(s[u].length&65280)>>8,a[h++]=s[u].length&255,a.set(s[u],h),h+=s[u].length;r=r("avcC",a)}e=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].concat(l(us(e,2)),l(us(i,2)),[0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]));i="avc1";s=ns(t);u=new Uint8Array([]);t.encrypted&&(u=is(0,t.stream,t.codecs),i="encv");i=fs(i,e,r,s,u)}else t.codecs.includes("hvc1")&&(i=t.stream.width||0,r=t.stream.height||0,e=new Uint8Array([]),0<t.Na.byteLength&&(e=fs("hvcC",t.Na)),i=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].concat(l(us(i,2)),l(us(r,2)),[0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17])),r="hvc1",s=ns(t),u=new Uint8Array([]),t.encrypted&&(u=is(0,t.stream,t.codecs),r="encv"),i=fs(r,i,e,s,u));break;case"audio":if("mp3"==e)t=fs(".mp3",es(t));else if("ac-3"==e)e=fs("dac3",t.Ea),i="ac-3",r=new Uint8Array([]),t.encrypted&&(r=is(0,t.stream,t.codecs),i="enca"),t=fs(i,es(t),e,r);else if("ec-3"==e)e=fs("dec3",t.Ea),i="ec-3",r=new Uint8Array([]),t.encrypted&&(r=is(0,t.stream,t.codecs),i="enca"),t=fs(i,es(t),e,r);else if("opus"==e)e=fs("dOps",t.Ea),i="Opus",r=new Uint8Array([]),t.encrypted&&(r=is(0,t.stream,t.codecs),i="enca"),t=fs(i,es(t),e,r);else{if(0<t.Ea.byteLength)e=fs("esds",t.Ea);else{e=fs;i=t.id+1;r=t.stream.channelsCount||2;u=t.stream.audioSamplingRate||44100;o=fn("audio",t.codecs.split(","));f={96e3:0,88200:1,64e3:2,48e3:3,44100:4,32e3:5,24e3:6,22050:7,16e3:8,12e3:9,11025:10,8e3:11,7350:12};s=f[u];if("mp4a.40.5"===o||"mp4a.40.29"===o)s=f[2*u];u=parseInt(o.split(".").pop(),10);i=new Uint8Array([0,0,0,0,3,25].concat(l(us(i,2)),[0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,0,5,2,u<<3|s>>>1,s<<7|r<<3,6,1,2]));e=e("esds",i)}i="mp4a";r=new Uint8Array([]);t.encrypted&&(r=is(0,t.stream,t.codecs),i="enca");t=fs(i,es(t),e,r)}i=t}t=fs("stsd",ks,i);return n("stbl",t,fs("stts",ps),fs("stsc",ms),fs("stsz",gs),fs("stco",ws))}function ns(t){if(!t.Va&&!t.Wa)return new Uint8Array([]);var n=t.Wa;t=new Uint8Array([].concat(l(us(t.Va,4)),l(us(n,4))));return fs("pasp",t)}function es(t){return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.stream.channelsCount||2,0,16,0,0,0,0].concat(l(us(t.stream.audioSamplingRate||44100,2)),[0,0]))}function is(t,n,e){t=fs;e=new Uint8Array([].concat(l(us(os(e.split(".")[0]),4))));e=fs("frma",e);var i="cenc";var r=n.drmInfos[0];r&&r.encryptionScheme&&(i=r.encryptionScheme);i=new Uint8Array([0,0,0,0].concat(l(us(os(i),4)),[0,1,0,0]));i=fs("schm",i);r=fs;var a=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);n=c(n.drmInfos);for(var u=n.next();!u.done;u=n.next())if((u=u.value)&&u.keyIds&&u.keyIds.size){u=c(u.keyIds);for(var s=u.next();!s.done;s=u.next())a=ss(s.value)}n=new Uint8Array([0,0,0,0,0,0,1,8]);n=fs("tenc",n,a);return t("sinf",e,i,r("schi",n))}function rs(t){var n=[];t=c(t.g);for(var e=t.next();!e.done;e=t.next()){e=e.value;var i=n.push,r=i.apply;var a=fs;var u=new Uint8Array([0,0,0,0].concat(l(us(e.data?e.data.Tb:0,4))));u=fs("mfhd",u);var s;var o=e.data?e.data.yb:[];var f=new Uint8Array(4+o.length);for(s=0;s<o.length;s++){var h=o[s].flags;f[s+4]=h.ib<<4|h.kb<<2|h.jb}o=fs("sdtp",f);var d=o.length+92;f=fs;s=new Uint8Array([0,0,0,58].concat(l(us(e.id+1,4)),[0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0]));s=fs("tfhd",s);h=e.data?e.data.baseMediaDecodeTime:0;var v=Math.floor(h%(ls+1));h=new Uint8Array([1,0,0,0].concat(l(us(Math.floor(h/(ls+1)),4)),l(us(v,4))));h=fs("tfdt",h);var p=d;d=e.data?e.data.yb:[];v=d.length;var m=12+16*v,w=new Uint8Array(m);p+=8+m;w.set(["video"===e.type?1:0,0,15,1].concat(l(us(v,4)),l(us(p,4))),0);for(p=0;p<v;p++){var g=d[p];m=us(g.duration,4);var b=us(g.size,4),y=g.flags;g=us(g.qb,4);w.set([].concat(l(m),l(b),[y.vb<<2|y.ib,y.kb<<6|y.jb<<4|y.wb,y.hb&61440,y.hb&15],l(g)),12+16*p)}d=fs("trun",w);o=f("traf",s,h,d,o);a=a("moof",u,o);r.call(i,n,[a,as(e)])}return an.apply(Jt,l(n))}function as(t){t=(t.data?t.data.yb:[]).map((function(t){return t.data}));t=an.apply(Jt,l(t));return fs("mdat",t)}function us(t,n){var e=[];for(--n;0<=n;n--)e.push(t>>8*n&255);return e}function ss(t){for(var n=new Uint8Array(t.length/2),e=0;e<t.length/2;e+=1)n[e]=parseInt(String(t[2*e]+t[2*e+1]),16);return n}function os(t){for(var n=0,e=0;e<t.length;e+=1)n|=t.charCodeAt(e)<<8*(t.length-e-1);return n}function fs(t){var n=U.apply(1,arguments),e=hs.get(t);e||(e=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)],hs.set(t,e));for(var i=8,r=n.length-1;0<=r;r--)i+=n[r].byteLength;r=new Uint8Array(i);r[0]=i>>24&255;r[1]=i>>16&255;r[2]=i>>8&255;r[3]=i&255;r.set(e,4);e=0;for(i=8;e<n.length;e++)r.set(n[e],i),i+=n[e].byteLength;return r}var cs=false,ls=Math.pow(2,32)-1,hs=new Map,ds=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]),vs=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]),ps=new Uint8Array([0,0,0,0,0,0,0,0]),ms=new Uint8Array([0,0,0,0,0,0,0,0]),ws=new Uint8Array([0,0,0,0,0,0,0,0]),gs=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),bs=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),ys=new Uint8Array([0,0,0,0,0,0,0,0]),ks=new Uint8Array([0,0,0,0,0,0,0,1]),Ts=new Uint8Array([]),Es=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),Ss=new Uint8Array([]);function As(t){t=Bt(t);var n=null;(new Ia).box("moov",Ma).box("trak",Ma).box("mdia",Ma).box("minf",Ma).box("stbl",Ma).R("stsd",xa).box("enca",(function(t){n=t.reader.h;return Ca(t)})).box("sinf",Ma).box("frma",(function(t){t.parser.stop();"ec-3"===Wu(t.reader).codec&&n&&2!==n.getUint16(16)&&n.setUint16(16,2)})).parse(t);return t}function Is(t,n,e){function i(t){h.push({box:t,ni:1701733217})}function r(t){h.push({box:t,ni:1701733238})}function a(t){o=true;t.parser.stop()}function u(t){l.push(t);Ma(t)}var s=n=Bt(n),o=false,f,l=[],h=[];(new Ia).box("moov",u).box("trak",u).box("mdia",u).box("minf",u).box("stbl",u).R("stsd",(function(t){f=t;l.push(t);xa(t)})).R("encv",a).R("enca",a).R("dvav",r).R("dva1",r).R("dvh1",r).R("dvhe",r).R("dvc1",r).R("dvi1",r).R("hev1",r).R("hvc1",r).R("avc1",r).R("avc3",r).R("ac-3",i).R("ec-3",i).R("ac-4",i).R("Opus",i).R("fLaC",i).R("mp4a",i).parse(n);if(o)return n;if(0==h.length||!f)throw tt(rn(n)),new zt(2,3,3019,e);h.reverse();e=c(h);for(var d=e.next();!d.done;d=e.next())d=d.value,s=Ns(t,s,f,d.box,l,d.ni);return ft().zi()?(t=new Uint8Array(n.byteLength+s.byteLength),t.set(s),t.set(n,s.byteLength),t):s}function Ms(t){t=Bt(t);var n=[];(new Ia).box("mdat",(function(t){n.push(t)})).parse(t);for(var e=[],i=0;i<n.length;i++){var r=n[i-1],a=n[i];e.push(xs(t.subarray(r?r.start+r.size:0,a.start+a.size)))}return an.apply(Jt,l(e))}function xs(t){function n(t){u.push(t);Ma(t)}var e,i,r,a,u=[];(new Ia).box("moof",n).box("traf",n).R("tfhd",(function(t){e=t;r=Xu(t.reader,t.flags)})).R("trun",(function(t){i=t;a=Gu(t.reader,t.version,t.flags)})).parse(t);if(r&&2!==r.Ei){var s=e.start+La(e)+4+(null!==r.fj?8:0),o=Ft(t);if(null!==r.Ei)o.setUint32(s,2);else{Cs(t,e.start,e.size+4);var f=o.getUint32(e.start+8);o.setUint32(e.start+8,f|2);a&&null!==a.ig&&o.setInt32(i.start+La(i)+4,a.ig+4);f=t.subarray(0,s);o=t.subarray(s);t=new Uint8Array(t.byteLength+4);t.set(f);f=[];for(var l=3;0<=l;l--)f.push(2>>8*l&255);t.set(new Uint8Array(f),s);t.set(o,s+4);s=c(u);for(o=s.next();!o.done;o=s.next())o=o.value,Cs(t,o.start,o.size+4)}}return t}function Ns(t,n,e,i,r,a){var u=is(new Ju([]),t,i.name),s=n.subarray(i.start,i.start+i.size);t=new Uint8Array(i.size+u.byteLength);t.set(s,0);Ft(t).setUint32(4,a);t.set(u,i.size);Cs(t,0,t.byteLength);a=new Uint8Array(n.byteLength+t.byteLength);i=ft().Ye()?i.start:i.start+i.size;u=n.subarray(i);a.set(n.subarray(0,i));a.set(t,i);a.set(u,i+t.byteLength);n=c(r);for(r=n.next();!r.done;r=n.next())r=r.value,Cs(a,r.start,r.size+t.byteLength);t=Ft(a,e.start);e=La(e);n=t.getUint32(e);t.setUint32(e,n+1);return a}function Cs(t,n,e){t=Ft(t,n);n=t.getUint32(0);0!=n&&(1==n?(t.setUint32(8,e>>32),t.setUint32(12,e&4294967295)):t.setUint32(0,e))}function Ps(t){function n(t){Ma(t)}var e=Bt(t);(new Ia).box("moov",n).box("trak",n).box("mdia",n).box("minf",n).box("stbl",n).box("stsd",(function(t){for(var n=Ft(e,t.start),i=0;i<t.size-3;i++){var r=n.getUint32(i);1633889587==r?n.setUint32(i,1700998451):1684103987==r&&n.setUint32(i,1684366131)}})).parse(e);return e}function Rs(t,n,e,i,r,a,u,s){this.O=t;this.startByte=n;this.endByte=e;this.od=void 0===i?null:i;this.timescale=void 0===r?null:r;this.h=void 0===a?null:a;this.aesKey=void 0===u?null:u;this.g=this.mimeType=this.codecs=null;this.encrypted=void 0===s?false:s}Rs.prototype.Ac=function(){return this.startByte};Rs.prototype.yc=function(){return this.endByte};Rs.prototype.ee=function(t){this.h=t};Rs.prototype.Wb=function(){return this.h};function Ds(t,n){return t===n?true:t&&n?t.Ac()==n.Ac()&&t.yc()==n.yc()&&Bn(t.O().sort(),n.O().sort())&&_t(t.Wb(),n.Wb()):t==n}q("shaka.media.InitSegmentReference",Rs);Rs.prototype.getEndByte=Rs.prototype.yc;Rs.prototype.getStartByte=Rs.prototype.Ac;function Ls(t,n,e,i,r,a,u,s,o,f,l,h,d,v,p,m){f=void 0===f?[]:f;v=void 0===v?_s:v;this.startTime=t;this.j=this.endTime=n;this.C=e;this.startByte=i;this.endByte=r;this.Y=a;this.timestampOffset=u;this.appendWindowStart=s;this.appendWindowEnd=o;this.g=f;this.tilesLayout=void 0===l?"":l;this.B=void 0===h?null:h;this.h=void 0===d?null:d;this.status=v;this.preload=false;this.l=true;this.m=false;this.aesKey=void 0===p?null:p;this.thumbnailSprite=null;this.i=-1;this.A=void 0===m?false:m;this.F=this.o=false;t=c(this.g);for(n=t.next();!n.done;n=t.next())n.value.ji();this.A&&this.g.length&&this.g[this.g.length-1].ii();this.s=this.bandwidth=this.mimeType=this.codecs=null;this.G=false}i=Ls.prototype;i.O=function(){return this.C()};i.getStartTime=function(){return this.startTime};i.yj=function(){return this.endTime};i.Ac=function(){return this.startByte};i.yc=function(){return this.endByte};i.Uj=function(){return this.tilesLayout};i.Tj=function(){return this.B};i.Bc=function(){return this.status};i.pk=function(){this.status=Us};i.Mg=function(){this.preload=true};i.isPreload=function(){return this.preload};i.nd=function(){this.l=false};i.ek=function(){return this.l};i.ji=function(){this.o=true};i.gk=function(){return this.o};i.ii=function(){this.F=true};i.fk=function(){return this.F};i.gi=function(){this.m=true};i.$j=function(){return this.m};i.Ef=function(t){this.thumbnailSprite=t};i.Rj=function(){return this.thumbnailSprite};i.offset=function(t){this.startTime+=t;this.endTime+=t;this.j+=t;for(var n=c(this.g),e=n.next();!e.done;e=n.next())e=e.value,e.startTime+=t,e.endTime+=t,e.j+=t};i.rh=function(t){null==this.h?$("Sync attempted without sync time!"):(t=this.h-t-this.startTime,.001<=Math.abs(t)&&this.offset(t))};i.ee=function(t,n){this.s=t;this.G=void 0===n?false:n};i.Wb=function(t){var n=this.s;(void 0===t||t)&&this.G&&(this.s=null);return n};function Os(t,n){t.Y=n;t=c(t.g);for(var e=t.next();!e.done;e=t.next())Os(e.value,n)}q("shaka.media.SegmentReference",Ls);Ls.prototype.getSegmentData=Ls.prototype.Wb;Ls.prototype.setSegmentData=Ls.prototype.ee;Ls.prototype.syncAgainst=Ls.prototype.rh;Ls.prototype.offset=Ls.prototype.offset;Ls.prototype.getThumbnailSprite=Ls.prototype.Rj;Ls.prototype.setThumbnailSprite=Ls.prototype.Ef;Ls.prototype.hasByterangeOptimization=Ls.prototype.$j;Ls.prototype.markAsByterangeOptimization=Ls.prototype.gi;Ls.prototype.isLastPartial=Ls.prototype.fk;Ls.prototype.markAsLastPartial=Ls.prototype.ii;Ls.prototype.isPartial=Ls.prototype.gk;Ls.prototype.markAsPartial=Ls.prototype.ji;Ls.prototype.isIndependent=Ls.prototype.ek;Ls.prototype.markAsNonIndependent=Ls.prototype.nd;Ls.prototype.isPreload=Ls.prototype.isPreload;Ls.prototype.markAsPreload=Ls.prototype.Mg;Ls.prototype.markAsUnavailable=Ls.prototype.pk;Ls.prototype.getStatus=Ls.prototype.Bc;Ls.prototype.getTileDuration=Ls.prototype.Tj;Ls.prototype.getTilesLayout=Ls.prototype.Uj;Ls.prototype.getEndByte=Ls.prototype.yc;Ls.prototype.getStartByte=Ls.prototype.Ac;Ls.prototype.getEndTime=Ls.prototype.yj;Ls.prototype.getStartTime=Ls.prototype.getStartTime;Ls.prototype.getUris=Ls.prototype.O;var _s=0,Us=1;Ls.Status={hl:_s,qm:Us,Pl:2};function Bs(t){return 1==t.length&&1e-4>t.end(0)-t.start(0)}function Hs(t){return!t||Bs(t)?null:t.length?t.end(t.length-1):null}function Fs(t,n){return!t||!t.length||Bs(t)||n>t.end(t.length-1)?false:n>=t.start(0)}function Vs(t,n){if(!t||!t.length||Bs(t))return 0;var e=0;t=c(Xs(t));for(var i=t.next();!i.done;i=t.next()){var r=i.value;i=r.start;r=r.end;r>n&&(e+=r-Math.max(i,n))}return e}function zs(t,n,e){if(!t||!t.length||Bs(t))return null;t=Xs(t).findIndex((function(t,i,r){return t.start>n&&(0==i||r[i-1].end-n<=e)}));return 0<=t?t:null}function Xs(t){if(!t)return[];for(var n=[],e=0;e<t.length;e++)n.push({start:t.start(e),end:t.end(e)});return n}function qs(){}function js(t,n){var e=document.createElement("source");e.src=t;e.type=void 0===n?"":n;return e}function Gs(t){for(var n=false,e=t.getElementsByTagName("source"),i=e.length-1;0<=i;--i)t.removeChild(e[i]),n=true;t.src&&(t.removeAttribute("src"),n=true);return n}function Ks(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function Ws(){if(Qs)return Qs;Ys||(Ys=new Di((function(){Qs=null})));(Qs=document.getElementsByTagName("video")[0]||document.getElementsByTagName("audio")[0])||(Qs=document.createElement("video"));Ys.ha(1);return Qs}function $s(n,e){var i,r,a,u,s;return _((function(o){if(1==o.g)return"fonts"in document&&"FontFace"in t?T(o,document.fonts.ready,2):o.return();if(!("entries"in document.fonts))return o.return();i=function(t){t=t.entries();for(var n=[],e=t.next();false===e.done;)n.push(e.value),e=t.next();return n};r=c(i(document.fonts));for(a=r.next();!a.done;a=r.next())if(u=a.value,u.family===n&&"swap"===u.display)return o.return();s=new FontFace(n,"url("+e+")",{display:"swap"});document.fonts.add(s);E(o)}))}q("shaka.util.Dom",qs);qs.removeAllChildren=Ks;qs.clearSourceFromVideo=Gs;var Ys=null,Qs=null;
/*
		 @license
		 Shaka Player
		 Copyright 2022 Google LLC
		 SPDX-License-Identifier: Apache-2.0
		*/function Js(){}function Zs(t,n){return n+10<=t.length&&73===t[n]&&68===t[n+1]&&51===t[n+2]&&255>t[n+3]&&255>t[n+4]&&128>t[n+6]&&128>t[n+7]&&128>t[n+8]&&128>t[n+9]?true:false}function to(t,n){return n+10<=t.length&&51===t[n]&&68===t[n+1]&&73===t[n+2]&&255>t[n+3]&&255>t[n+4]&&128>t[n+6]&&128>t[n+7]&&128>t[n+8]&&128>t[n+9]?true:false}function no(t,n){var e=(t[n]&127)<<21;e|=(t[n+1]&127)<<14;e|=(t[n+2]&127)<<7;return e|=t[n+3]&127}function eo(t){var n={key:t.type,description:"",data:"",mimeType:null,pictureType:null};if("APIC"===t.type){if(2>t.size||3!==t.data[0])return null;var e=t.data.subarray(1).indexOf(0);if(-1===e)return null;var i=qt(Bt(t.data,1,e)),r=t.data[2+e],a=t.data.subarray(3+e).indexOf(0);if(-1===a)return null;var u=qt(Bt(t.data,3+e,a)),s;"--\x3e"===i?s=qt(Bt(t.data,4+e+a)):s=Ut(t.data.subarray(4+e+a));n.mimeType=i;n.pictureType=r;n.description=u;n.data=s;return n}if("TXXX"===t.type){if(2>t.size||3!==t.data[0])return null;i=t.data.subarray(1).indexOf(0);if(-1===i)return null;e=qt(Bt(t.data,1,i));t=qt(Bt(t.data,2+i)).replace(/\0*$/,"");n.description=e;n.data=t;return n}if("WXXX"===t.type){if(2>t.size||3!==t.data[0])return null;i=t.data.subarray(1).indexOf(0);if(-1===i)return null;e=qt(Bt(t.data,1,i));t=qt(Bt(t.data,2+i)).replace(/\0*$/,"");n.description=e;n.data=t;return n}if("PRIV"===t.type){if(2>t.size)return null;e=t.data.indexOf(0);if(-1===e)return null;e=qt(Bt(t.data,0,e));n.description=e;"com.apple.streaming.transportStreamTimestamp"==e?(e=t.data.subarray(e.length+1),t=e[3]&1,e=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7],e/=45,t&&(e+=47721858.84),n.data=e):(t=Ut(t.data.subarray(e.length+1)),n.data=t);return n}if("T"===t.type[0]){if(2>t.size||3!==t.data[0])return null;t=qt(t.data.subarray(1)).replace(/\0*$/,"");n.data=t;return n}return"W"===t.type[0]?(t=qt(t.data).replace(/\0*$/,""),n.data=t,n):t.data?(n.data=Ut(t.data),n):null}function io(t){for(var n=0,e=[];Zs(t,n);){var i=no(t,n+6);t[n+5]>>6&1&&(n+=10);n+=10;for(i=n+i;n+10<i;){var r=t.subarray(n),a=no(r,4);r={type:String.fromCharCode(r[0],r[1],r[2],r[3]),size:a,data:r.subarray(10,10+a)};(a=eo(r))&&e.push(a);n+=r.size+10}to(t,n)&&(n+=10)}return e}function ro(t,n){for(var e=n=void 0===n?0:n,i=0;Zs(t,n);)t[n+5]>>6&1&&(i+=10),i+=10,i+=no(t,n+6),to(t,n+10)&&(i+=10),n+=i;return 0<i?t.subarray(e,e+i):new Uint8Array([])}q("shaka.util.Id3Utils",Js);Js.getID3Data=ro;Js.getID3Frames=io;function ao(t){return new Date(Date.UTC(1900,0,1,0,0,0,0)+t).getTime()}function uo(t,n){this.j=t;if(void 0===n?0:n){n=new Uint8Array(t.byteLength);for(var e=0,i=0;i<t.byteLength;i++)2<=i&&3==t[i]&&0==t[i-1]&&0==t[i-2]||(n[e]=t[i],e++);this.j=Bt(n,0,e)}this.i=this.j.byteLength;this.g=this.h=0}function so(t){var n=t.j.byteLength-t.i,e=new Uint8Array(4),i=Math.min(4,t.i);0!==i&&(e.set(t.j.subarray(n,n+i)),t.h=new Ea(e,0).T(),t.g=8*i,t.i-=i)}function oo(t,n){if(t.g<=n){n-=t.g;var e=Math.floor(n/8);n-=8*e;t.g-=e;so(t)}t.h<<=n;t.g-=n}function fo(t,n){var e=Math.min(t.g,n),i=t.h>>>32-e;t.g-=e;0<t.g?t.h<<=e:0<t.i&&so(t);e=n-e;return 0<e?i<<e|fo(t,e):i}function co(t){var n;for(n=0;n<t.g;++n)if(0!==(t.h&2147483648>>>n))return t.h<<=n,t.g-=n,n;so(t);return n+co(t)}function lo(t){oo(t,1+co(t))}function ho(t){var n=co(t);return fo(t,n+1)-1}function vo(t){t=ho(t);return 1&t?1+t>>>1:-1*(t>>>1)}function po(t){return 1===fo(t,1)}function mo(t){return fo(t,8)}function wo(t,n){for(var e=8,i=8,r=0;r<n;r++)0!==i&&(i=vo(t),i=(e+i+256)%256),e=0===i?e:i}function go(t){mo(t);ho(t);return ho(t)}q("shaka.util.ExpGolomb",uo);function bo(){this.H=null;this.I=false;this.m=this.K=null;this.j=[];this.g=[];this.B=this.C=null;this.i=[];this.h=[];this.F=null;this.l=[];this.A=this.G=this.o=this.s=null}i=bo.prototype;i.clearData=function(){this.j=[];this.g=[];this.i=[];this.h=[];this.l=[]};i.Cf=function(t){null!=this.A&&this.A!=t&&(this.o=this.s=null);this.A=t};i.parse=function(t){if(564>t.length)return this;for(var n=Math.max(0,Io(t)),e=t.length-(t.length+n)%188,i=false,r=n;r<e;r+=188)if(71==t[r]){var a=!!(t[r+1]&64),u=((t[r+1]&31)<<8)+t[r+2];if(1<(t[r+3]&48)>>4){var s=r+5+t[r+4];if(s==r+188)continue}else s=r+4;switch(u){case 0:a&&(s+=t[s]+1);this.H=(t[s+10]&31)<<8|t[s+11];break;case 17:case 8191:break;case this.H:a&&(s+=t[s]+1);a=t;u={audio:-1,video:-1,We:-1,audioCodec:"",videoCodec:""};var o=s+3+((a[s+1]&15)<<8|a[s+2])-4;for(s+=12+((a[s+10]&15)<<8|a[s+11]);s<o;){var f=(a[s+1]&31)<<8|a[s+2],c=(a[s+3]&15)<<8|a[s+4];switch(a[s]){case 6:if(0<c)for(var l=s+5,h=c;2<h;){var d=a[l+1]+2;switch(a[l]){case 5:var v=$t(a.subarray(l+2,l+d));-1==u.audio&&"Opus"===v?(u.audio=f,u.audioCodec="opus"):-1==u.video&&"AV01"===v&&(u.video=f,u.videoCodec="av1");break;case 106:-1==u.audio&&(u.audio=f,u.audioCodec="ac3");break;case 122:-1==u.audio&&(u.audio=f,u.audioCodec="ec3");break;case 124:-1==u.audio&&(u.audio=f,u.audioCodec="aac");break;case 127:"opus"==u.audioCodec&&(v=null,128===a[l+2]&&(v=a[l+3]),null!=v&&(this.G={channelCount:0===(v&15)?2:v&15,ij:v,sampleRate:48e3}))}l+=d;h-=d}break;case 15:-1==u.audio&&(u.audio=f,u.audioCodec="aac");break;case 17:-1==u.audio&&(u.audio=f,u.audioCodec="aac-loas");break;case 21:-1==u.We&&(u.We=f);break;case 27:-1==u.video&&(u.video=f,u.videoCodec="avc");break;case 3:case 4:-1==u.audio&&(u.audio=f,u.audioCodec="mp3");break;case 36:-1==u.video&&(u.video=f,u.videoCodec="hvc");break;case 129:-1==u.audio&&(u.audio=f,u.audioCodec="ac3");break;case 132:case 135:-1==u.audio&&(u.audio=f,u.audioCodec="ec3")}s+=c+5}a=u;-1!=a.video&&(this.K=a.video,this.m=a.videoCodec);-1!=a.audio&&(this.C=a.audio,this.B=a.audioCodec);-1!=a.We&&(this.F=a.We);i&&!this.I&&(i=false,r=n-188);this.I=true;break;case this.K:s=t.subarray(s,r+188);a?this.j.push([s]):this.j.length&&this.j[this.j.length-1]&&this.j[this.j.length-1].push(s);break;case this.C:s=t.subarray(s,r+188);a?this.i.push([s]):this.i.length&&this.i[this.i.length-1]&&this.i[this.i.length-1].push(s);break;case this.F:s=t.subarray(s,r+188);a?this.l.push([s]):this.l.length&&this.l[this.l.length-1]&&this.l[this.l.length-1].push(s);break;default:i=true}}return this};function yo(t,n){if(1!==(n[0]<<16|n[1]<<8|n[2]))return null;var e={data:new Uint8Array(0),packetLength:n[4]<<8|n[5],pts:null,dts:null,nalus:[]};if(e.packetLength&&e.packetLength>n.byteLength-6)return null;var i=n[7];if(i&192){var r=536870912*(n[9]&14)+4194304*(n[10]&255)+16384*(n[11]&254)+128*(n[12]&255)+(n[13]&254)/2;null==t.s&&(t.s=r);e.pts=So(r,t.s);t.s=e.pts;e.dts=e.pts;i&64&&(i=536870912*(n[14]&14)+4194304*(n[15]&255)+16384*(n[16]&254)+128*(n[17]&255)+(n[18]&254)/2,null==t.o&&(t.o=i),e.dts=e.pts!=r?So(i,t.o):i);t.o=e.dts}t=n[8]+9;if(n.byteLength<=t)return null;e.data=n.subarray(t);return e}i.yk=function(t){vt("TsParser.parseAvcNalus","Please use parseNalus function instead.");return this.Rg(t,{Xd:null,state:null})};i.Rg=function(t,n){var e=t.pts?t.pts/9e4:null;t=t.data;var i=t.byteLength,r=1;"hvc"==this.m&&(r=2);var a=n.state||0,u=a,s=0,o=[],f=-1,c=0;-1==a&&(f=0,c="hvc"==this.m?t[0]>>1&63:t[0]&31,a=0,s=1);for(;s<i;){var l=t[s++];if(a)if(1===a)a=l?0:2;else if(l)if(1==l){l=s-a-1;if(0<=f)o.push({data:t.subarray(f+r,l),fullData:t.subarray(f,l),type:c,time:e,state:null});else if(a=o.length?o[o.length-1]:n.Xd)u&&s<=4-u&&a.state&&(a.data=a.data.subarray(0,a.data.byteLength-u),a.fullData=a.fullData.subarray(0,a.fullData.byteLength-u)),0<l&&(l=t.subarray(0,l),a.data=an(a.data,l),a.fullData=an(a.fullData,l),a.state=0);s<i?(c="hvc"==this.m?t[s]>>1&63:t[s]&31,f=s,a=0):a=-1}else a=0;else a=3;else a=l?0:1}0<=f&&0<=a&&o.push({data:t.subarray(f+r,i),fullData:t.subarray(f,i),type:c,time:e,state:a});!o.length&&n.Xd&&(e=o.length?o[o.length-1]:n.Xd)&&(e.data=an(e.data,t),e.fullData=an(e.fullData,t));n.state=a;return o};i.getMetadata=function(){for(var t=[],n=c(this.l),e=n.next();!e.done;e=n.next())e=an.apply(Jt,l(e.value)),(e=yo(this,e))&&t.push({cueTime:e.pts?e.pts/9e4:null,data:e.data,frames:io(e.data),dts:e.dts,pts:e.pts});return t};i.rb=function(){if(this.i.length&&!this.h.length)for(var t=c(this.i),n=t.next();!n.done;n=t.next()){var e=an.apply(Jt,l(n.value)),i=yo(this,e);n=this.h.length?this.h[this.h.length-1]:null;i&&null!=i.pts&&null!=i.dts&&(!n||n.pts!=i.pts&&n.dts!=i.dts)?this.h.push(i):this.h.length&&(e=i?i.data:e)&&(n=this.h.pop(),n.data=an(n.data,e),this.h.push(n))}return this.h};i.Qc=function(t){t=void 0===t?true:t;if(this.j.length&&!this.g.length){for(var n=c(this.j),e=n.next();!e.done;e=n.next()){var i=an.apply(Jt,l(e.value)),r=yo(this,i);e=this.g.length?this.g[this.g.length-1]:null;r&&null!=r.pts&&null!=r.dts&&(!e||e.pts!=r.pts&&e.dts!=r.dts)?this.g.push(r):this.g.length&&(i=r?r.data:i)&&(e=this.g.pop(),e.data=an(e.data,i),this.g.push(e))}if(t){n={Xd:null,state:null};e=[];i=c(this.g);for(r=i.next();!r.done;r=i.next())r=r.value,r.nalus=this.Rg(r,n),r.nalus.length&&(e.push(r),n.Xd=r.nalus[r.nalus.length-1]);this.g=e}}return t?this.g:(t=this.g,this.g=[],t)};i.getStartTime=function(t){if("audio"==t){t=null;var n=this.rb();n.length&&(t=n[0],t=Math.min(t.dts,t.pts)/9e4);return t}return"video"==t?(t=null,n=this.Qc(false),n.length&&(t=n[0],t=Math.min(t.dts,t.pts)/9e4),t):null};i.Md=function(){return{audio:this.B,video:this.m}};i.Ve=function(){for(var t=[],n=c(this.Qc()),e=n.next();!e.done;e=n.next())t.push.apply(t,l(e.value.nalus));return t};i.Xj=function(){vt("TsParser.getVideoResolution","Please use getVideoInfo function instead.");var t=this.Eg();return{height:t.height,width:t.width}};i.Eg=function(){return"hvc"==this.m?Eo(this):To(this)};function ko(t){var n=t.Qc();return 1<n.length&&(t=n[0].pts,n=n[1].pts,!isNaN(n-t))?String(1/(n-t)*9e4):null}function To(t){var n={height:null,width:null,codec:null,frameRate:null},e=t.Ve();if(!e.length)return n;e=e.find((function(t){return 7==t.type}));if(!e)return n;e=new uo(e.data);var i=mo(e),r=mo(e),a=mo(e);lo(e);if(Mo.includes(i)){var u=ho(e);3===u&&oo(e,1);lo(e);lo(e);oo(e,1);if(po(e)){u=3!==u?8:12;for(var s=0;s<u;s++)po(e)&&(6>s?wo(e,16):wo(e,64))}}lo(e);u=ho(e);if(0===u)ho(e);else if(1===u)for(oo(e,1),lo(e),lo(e),u=ho(e),s=0;s<u;s++)lo(e);lo(e);oo(e,1);u=ho(e);s=ho(e);var o=fo(e,1);0===o&&oo(e,1);oo(e,1);var f=0,c=0,l=0,h=0;po(e)&&(f=ho(e),c=ho(e),l=ho(e),h=ho(e));n.height=String((2-o)*(s+1)*16-2*l-2*h);n.width=String(16*(u+1)-2*f-2*c);n.codec="avc1."+("0"+i.toString(16).toUpperCase()).slice(-2)+("0"+r.toString(16).toUpperCase()).slice(-2)+("0"+a.toString(16).toUpperCase()).slice(-2);n.frameRate=ko(t);return n}function Eo(t){var n={height:null,width:null,codec:null,frameRate:null},e=t.Ve();if(!e.length)return n;e=e.find((function(t){return 33==t.type}));if(!e)return n;var i=new uo(e.fullData,true);mo(i);mo(i);fo(i,4);var r=fo(i,3);po(i);var a=fo(i,2),u=fo(i,1),s=fo(i,5),o=fo(i,32);e=mo(i);for(var f=mo(i),c=mo(i),l=mo(i),h=mo(i),d=mo(i),v=mo(i),p=[],m=[],w=0;w<r;w++)p.push(po(i)),m.push(po(i));if(0<r)for(w=r;8>w;w++)fo(i,2);for(w=0;w<r;w++)p[w]&&fo(i,88),m[w]&&mo(i);ho(i);r=ho(i);3==r&&fo(i,1);p=ho(i);m=ho(i);var g=w=0,b=0,y=0;po(i)&&(w+=ho(i),g+=ho(i),b+=ho(i),y+=ho(i));n.width=String(p-(w+g)*(1===r||2===r?2:1));n.height=String(m-(b+y)*(1===r?2:1));i=function(t){for(var n=0,e=0;32>e;e++)n|=(t>>e&1)<<31-e;return n>>>0}(o);u=1==u?"H":"L";a="hvc1"+("."+["","A","B","C"][a]+s);a+="."+i.toString(16).toUpperCase();a+="."+u+v;d&&(a+="."+d.toString(16).toUpperCase());h&&(a+="."+h.toString(16).toUpperCase());l&&(a+="."+l.toString(16).toUpperCase());c&&(a+="."+c.toString(16).toUpperCase());f&&(a+="."+f.toString(16).toUpperCase());e&&(a+="."+e.toString(16).toUpperCase());n.codec=a;n.frameRate=ko(t);return n}function So(t,n){var e=1;for(t>n&&(e=-1);4294967296<Math.abs(n-t);)t+=8589934592*e;return t}function Ao(t){return 0>Io(t)?false:true}function Io(t){for(var n=Math.min(1e3,t.length-564),e=0;e<n;){if(71==t[e]&&71==t[e+188]&&71==t[e+376])return e;e++}return-1}q("shaka.util.TsParser",bo);bo.syncOffset=Io;bo.probe=Ao;bo.prototype.getVideoInfo=bo.prototype.Eg;bo.prototype.getVideoResolution=bo.prototype.Xj;bo.prototype.getVideoNalus=bo.prototype.Ve;bo.prototype.getCodecs=bo.prototype.Md;bo.prototype.getStartTime=bo.prototype.getStartTime;bo.prototype.getVideoData=bo.prototype.Qc;bo.prototype.getAudioData=bo.prototype.rb;bo.prototype.getMetadata=bo.prototype.getMetadata;bo.prototype.parseNalus=bo.prototype.Rg;bo.prototype.parseAvcNalus=bo.prototype.yk;bo.prototype.parse=bo.prototype.parse;bo.prototype.setDiscontinuitySequence=bo.prototype.Cf;bo.prototype.clearData=bo.prototype.clearData;bo.Timescale=9e4;var Mo=[100,110,122,244,44,83,86,118,128,138,139,134];function xo(t,n,e,i,r){var a=this;this.g=t;this.N=e;this.A=i;this.ia=n;this.l=new Map;this.C=new Map;this.Xa=new Map;this.h=null;this.Ka=false;this.M=r||null;this.o=new Map;this.s=new it;this.j=new Map;this.I=null;this.K=new qr;this.Ba="";this.eb=false;this.ya=true;this.L=false;this.B=this.P=null;this.i=No(this,this.K);this.Oa=this.F=false;this.H=new wa((function(){return Ro(a)}));this.G=false;this.W="UNKNOWN";this.Za=this.ab=false;this.Ta=new qr;this.m=false;this.wa=null;this.ba=new Map;this.oa=this.S=this.va=this.U=null;this.ka=new qr;this.g.remote&&(this.L="disconnected"!=this.g.remote.state,this.s.D(this.g.remote,"connect",(function(){a.L="disconnected"!=a.g.remote.state})),this.s.D(this.g.remote,"connecting",(function(){a.L="disconnected"!=a.g.remote.state})),this.s.D(this.g.remote,"disconnect",(function(){a.L="disconnected"!=a.g.remote.state})))}function No(n,e){n.ya=true;if(t.ManagedMediaSource){n.B||(n.g.disableRemotePlayback=true);var i=new ManagedMediaSource;n.s.D(i,"startstreaming",(function(){n.ya=true}));n.s.D(i,"endstreaming",(function(){n.ya=false}))}else i=new MediaSource;n.s.za(i,"sourceopen",(function(){URL.revokeObjectURL(n.Ba);e.resolve()}));n.s.za(n.g,"playing",(function(){n.eb=true}));n.Ba=mf(i);n.A.useSourceElements?(n.g.removeAttribute("src"),n.P&&n.g.removeChild(n.P),n.B&&n.g.removeChild(n.B),n.P=js(n.Ba),n.g.appendChild(n.P),n.B&&n.g.appendChild(n.B),n.g.load()):n.g.src=n.Ba;return i}function Co(n,e,i){n.g&&t.ManagedMediaSource&&n.i&&n.A.useSourceElements&&(n.B&&n.g.removeChild(n.B),n.B=js(e,i),n.g.appendChild(n.B),n.g.disableRemotePlayback=false)}function Po(){var t='video/mp4; codecs="avc1.42E01E",video/mp4; codecs="avc3.42E01E",video/mp4; codecs="hev1.1.6.L93.90",video/mp4; codecs="hvc1.1.6.L93.90",video/mp4; codecs="hev1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="hvc1.2.4.L153.B0"; eotf="smpte2084",video/mp4; codecs="vp9",video/mp4; codecs="vp09.00.10.08",video/mp4; codecs="av01.0.01M.08",video/mp4; codecs="dvh1.05.01",video/mp4; codecs="dvh1.20.01",audio/mp4; codecs="mp4a.40.2",audio/mp4; codecs="ac-3",audio/mp4; codecs="ec-3",audio/mp4; codecs="ac-4.02.01.01",audio/mp4; codecs="opus",audio/mp4; codecs="flac",audio/mp4; codecs="dtsc",audio/mp4; codecs="dtse",audio/mp4; codecs="dtsx",audio/mp4; codecs="apac.31.00",video/webm; codecs="vp8",video/webm; codecs="vp9",video/webm; codecs="vp09.00.10.08",audio/webm; codecs="vorbis",audio/webm; codecs="opus",video/mp2t; codecs="avc1.42E01E",video/mp2t; codecs="avc3.42E01E",video/mp2t; codecs="hvc1.1.6.L93.90",video/mp2t; codecs="mp4a.40.2",video/mp2t; codecs="ac-3",video/mp2t; codecs="ec-3",text/vtt,application/mp4; codecs="wvtt",application/ttml+xml,application/mp4; codecs="stpp"'.split(",").concat(l(ki)),n={};ft();t=c(t);for(var e=t.next();!e.done;e=t.next()){e=e.value;Ai(e)?n[e]=true:n[e]=qy()?yn(e)||(ri(e)?true:false):""!=Ws().canPlayType(e);var i=e.split(";")[0];n[i]=n[i]||n[e]}return n}i=xo.prototype;i.destroy=function(){return this.H.destroy()};function Ro(t){var n,e,i,r,a,u,s,o,f,l,h,d,v,p,m;return _((function(w){if(1==w.g){n=[];e=c(t.o);for(i=e.next();!i.done;i=e.next())for(r=i.value,a=c(r),u=a.next().value,s=a.next().value,o=s[0],f=u,t.o.set(f,s.slice(0,1)),o&&n.push(o.p.catch(Oi)),l=c(s.slice(1)),h=l.next();!h.done;h=l.next())d=h.value,d.p.reject(new zt(2,7,7003,void 0));t.h&&n.push(t.h.destroy());return T(w,Promise.all(n),2)}v=c(t.j.values());for(p=v.next();!p.done;p=v.next())m=p.value,m.destroy();t.s&&(t.s.release(),t.s=null);t.g&&t.B&&t.g.removeChild(t.B);t.g&&t.P&&(t.g.removeChild(t.P),t.g.load(),t.g.disableRemotePlayback=false);t.g=null;t.P=null;t.B=null;t.A=null;t.i=null;t.h=null;t.ia=null;t.l.clear();t.Xa.clear();t.j.clear();t.I=null;t.o.clear();t.M=null;t.ba.clear();t.N=null;E(w)}))}i.init=function(t,n,e,i){n=void 0===n?false:n;e=void 0===e?"UNKNOWN":e;i=void 0===i?false:i;var r=this,a,u,s,o,f,l;return _((function(h){if(1==h.g)return a=dn,T(h,r.K,2);if(3!=h.g){if(!_o(r)&&!Uo(r))return h.u(3);$("Expected MediaSource to be open during init(); reopening the media source.");r.K=new qr;r.i=No(r,r.K);return T(h,r.K,3)}r.G=n;r.W=e;r.ab=i;r.Za=!r.G&&"HLS"==r.W&&!r.ab;r.ba.clear();r.U=null;r.va=null;r.S=null;r.oa=null;r.ka=new qr;u=c(t.keys());for(s=u.next();!s.done;s=u.next())o=s.value,f=t.get(o),Do(r,o,f,f.codecs),r.m?(r.o.set(a.ea,[]),r.o.set(a.xa,[])):r.o.set(o,[]);(l=t.get(a.ea))&&l.isAudioMuxedInVideo&&(r.m=true);E(h)}))};function Do(t,n,e,i){"audio"==n&&i&&(i=sr(i,e.mimeType));var r=li(e.mimeType,i);if(n==hn)Oo(t,r,t.G,e.external);else{var a=t.A.forceTransmux;if(!yn(r)||!t.G&&ki.includes(r))a=true;var u=hi(e.mimeType,i);if(a){a=cn("audio",(i||"").split(","));i=cn("video",(i||"").split(","));if(a&&i){t.m=true;Do(t,"audio",e,a);Do(t,"video",e,i);return}if(i=ri(u))r=i(),t.j.set(n,r),r=r.convertCodecs(n,u)}u=r+t.A.addExtraFeaturesToSourceBuffer(r);ga(t.H);try{var s=t.i.addSourceBuffer(u)}catch(n){throw new zt(2,3,3015,n,"The mediaSource_ status was "+t.i.readyState+" expected 'open'",null)}t.G&&(s.mode=wf);t.s.D(s,"error",(function(){var e=t.o.get(n)[0];e.p.reject(new zt(2,3,3014,t.g.error?t.g.error.code:0,e.uri))}));t.s.D(s,"updateend",(function(){return nf(t,n)}));t.l.set(n,s);t.C.set(n,r);t.Xa.set(n,!!e.drmInfos.length)}}i.configure=function(t){this.A=t;this.h&&(this.h.A=t.modifyCueCallback)};function Lo(t){return t.ya&&!t.L&&!t.F}function Oo(t,n,e,i){t.h||(t.h=new Ti(t.ia),t.h&&(t.h.A=t.A.modifyCueCallback));var r=t.h;i=i||t.Ka;t=t.W;"application/cea-608"==n||"application/cea-708"==n?r.i=null:(r.i=Pi.get(n)(),r.i.setSequenceMode?r.i.setSequenceMode(e):vt("Text parsers w/ setSequenceMode",'Text parsers should have a "setSequenceMode" method!'),r.i.setManifestType?r.i.setManifestType(t):vt("Text parsers w/ setManifestType",'Text parsers should have a "setManifestType" method!'),r.B=i)}function _o(t){return t.F?false:t.i?"ended"==t.i.readyState:true}function Uo(t){return t.F?false:t.i?"closed"==t.i.readyState:true}function Bo(t,n){t.l.size?n==hn?t=t.h.g:(t=Vo(t,n),t=!t||Bs(t)?null:1==t.length&&0>t.start(0)?0:t.length?t.start(0):null):t=null;return t}function Ho(t,n){return t.l.size?n==hn?t.h.h:Hs(Vo(t,n)):null}function Fo(t,n,e){if(n==hn)return t=t.h,null==t.h||t.h<e?0:t.h-Math.max(e,t.g);t=Vo(t,n);return Vs(t,e)}i.Lb=function(){var t={total:this.F?[]:Xs(this.g.buffered),audio:Xs(Vo(this,"audio")),video:Xs(Vo(this,"video")),text:[]};if(this.h){var n=this.h.g,e=this.h.h;null!=n&&null!=e&&t.text.push({start:n,end:e})}return t};function Vo(t,n){if(t.F||t.L)return null;try{return t.l.get(n).buffered}catch(e){return t.l.has(n),null}}function zo(t,n,e,i,r,a){var u=null,s=[],o=Bt(e);if(ki.includes(a))n=io(o),n.length&&i&&((e=n.find((function(t){return"com.apple.streaming.transportStreamTimestamp"===t.description})))&&"number"==typeof e.data&&(u=Math.round(e.data)/1e3),t.N.onMetadata([{cueTime:i.startTime,data:o,frames:n,dts:i.startTime,pts:i.startTime}],0,i.endTime));else if(a.includes("/mp4")&&i&&i.Y&&i.Y.timescale){var f=i.Y.timescale;if(!isNaN(f)){var c=null!=r.emsgSchemeIdUris&&0<r.emsgSchemeIdUris.length||t.A.dispatchAllEmsgBoxes,l=0,h=false;o=new Ia;c&&o.R("emsg",(function(n){var e=r.emsgSchemeIdUris;if(0===n.version){var a=n.reader.Uc();var u=n.reader.Uc();var s=n.reader.T();var o=n.reader.T();var f=n.reader.T();var c=n.reader.T();var l=i.startTime+o/s}else s=n.reader.T(),l=n.reader.vd()/s+i.timestampOffset,o=l-i.startTime,f=n.reader.T(),c=n.reader.T(),a=n.reader.Uc(),u=n.reader.Uc();n=n.reader.Sb(n.reader.getLength()-n.reader.Ma());if(e&&e.includes(a)||t.A.dispatchAllEmsgBoxes)if("urn:mpeg:dash:event:2012"==a)t.N.xk();else if(e=l+f/s,s={startTime:l,endTime:e,schemeIdUri:a,value:u,timescale:s,presentationTimeDelta:o,eventDuration:f,id:c,messageData:n},c=(new Map).set("detail",s),new Jr("emsg",c).cancelable=true,t.N.vk(s),"https://aomedia.org/emsg/ID3"==a||"https://developer.apple.com/streaming/emsg-id3"==a)if(a=io(n),a.length)t.N.onMetadata([{cueTime:l,data:n,frames:a,dts:l,pts:l}],0,e)}));o.R("prft",(function(n){var e=n.reader,i=n.version;e.T();n=e.T();var r=e.T();n=1e3*n+r/Math.pow(2,32)*1e3;0===i?e=e.T():(i=e.T(),e=e.T(),e=i*Math.pow(2,32)+e);n=ao(n);e=(new Map).set("detail",{wallClockTime:n,programStartDate:new Date(n-e/f*1e3)});e=new Jr("prft",e);t.N.onEvent(e)})).box("moof",Ma).box("traf",Ma).R("tfdt",(function(t){h||(l=qu(t.reader,t.version).baseMediaDecodeTime/f,h=true,c||t.parser.stop())})).parse(e,true);h&&0==i.timestampOffset&&(u=l)}}else a.includes("/mp4")||a.includes("/webm")||!Ao(o)||(t.ba.has(n)||t.ba.set(n,new bo),s=t.ba.get(n),s.clearData(),s.Cf(i.i),s.parse(o),o=s.getStartTime(n),null!=o&&(u=o),s=s.getMetadata());return{timestamp:u,metadata:s}}function Xo(t,n,e,i,r,a,u,s,o,f,c){u=void 0===u?false:u;s=void 0===s?false:s;o=void 0===o?false:o;f=void 0===f?false:f;var l,h,d,v,p,m,w,g,b,y,k,S,A,I,M,x,N;return _((function(C){switch(C.g){case 1:l=dn;if(n!=l.Ya){C.u(2);break}if("HLS"!=t.W){C.u(3);break}return T(C,t.Ta,4);case 4:h=C.h,t.h.s=h;case 3:return T(C,Ii(t.h,e,i?i.startTime:null,i?i.endTime:null,i?i.O()[0]:null),5);case 5:return C.return();case 2:if(f||!t.m){C.u(6);break}return T(C,Xo(t,l.ea,e,i,r,a,u,s,o,true),7);case 7:return T(C,Xo(t,l.xa,e,i,r,a,u,s,o,true),8);case 8:return C.return();case 6:if(!t.l.has(n))return C.return();d=t.l.get(n).timestampOffset;v=t.C.get(n);t.j.has(n)&&(v=t.j.get(n).getOriginalMimeType());if(i&&(p=zo(t,n,e,i,r,v),m=p.timestamp,w=p.metadata,null!=m&&(null==t.U&&n==l.xa&&(t.U=m,t.va=i.startTime,null!=t.S&&(g=0,t.va==t.oa&&(g=t.U-t.S),t.ka.resolve(g))),null==t.S&&n==l.ea&&(t.S=m,t.oa=i.startTime,null!=t.U&&(b=0,t.va==t.oa&&(b=t.U-t.S),t.ka.resolve(b))),y=m,k=ki,!t.G&&k.includes(t.C.get(n))&&(y=0),S=i.startTime-y,A=Math.abs(d-S),(.001<=A||u||s)&&(!o||0<S||!d)&&(d=S,t.Za&&(ef(t,n,(function(){return Jo(t,n)}),null),ef(t,n,(function(){return Zo(t,n,d)}),null))),(n==l.xa||!t.l.has(l.xa))&&t.Ta.resolve(d)),w.length))t.N.onMetadata(w,d,i?i.endTime:null);a&&n==l.xa&&(t.h||Oo(t,"application/cea-608",t.G,false),t.I||(I=v.split(";",1)[0],t.I=new Mn(I)),i?(M=t.I.rf(e),M.length&&Ci(t.h,M,i.startTime,i.endTime,d)):t.I.init(e,s,c));if(!t.j.has(n)){C.u(9);break}return T(C,t.j.get(n).transmux(e,r,i,t.i.duration,n),10);case 10:e=C.h;case 9:e=of(t,r,e,i,n);if(!i||!t.G||n==l.Ya){C.u(11);break}if(!u&&!s){C.u(11);break}x=i.startTime;if("HLS"!=t.W||t.m||n!=l.ea||!t.l.has(l.xa)){C.u(13);break}return T(C,t.ka,14);case 14:N=C.h,.15<Math.abs(N)&&(x-=N);case 13:ef(t,n,(function(){return Jo(t,n)}),null),ef(t,n,(function(){return Zo(t,n,x)}),null);case 11:return T(C,ef(t,n,(function(){var i=e;t.M&&wn(t.M,i,d,r);t.l.get(n).appendBuffer(i)}),i?i.O()[0]:null),15);case 15:E(C)}}))}function qo(t,n){var e=Ho(t,"video")||0;xi(t.h,n,e)}function jo(t){t.h&&xi(t.h,"",0)}i.remove=function(t,n,e,i){var r=this,a;return _((function(u){return 1==u.g?(a=dn,t==a.xa&&r.I&&r.I.remove(i),t==a.Ya?T(u,r.h.remove(n,e),0):e>n?T(u,ef(r,t,(function(){return Qo(r,t,n,e)}),null),5):u.u(0)):r.m?T(u,ef(r,a.ea,(function(){return Qo(r,a.ea,n,e)}),null),0):u.u(0)}))};function Go(t,n){var e;return _((function(i){return 1==i.g?(e=dn,n==e.Ya?t.h?T(i,t.h.remove(0,Infinity),0):i.return():T(i,ef(t,n,(function(){return Qo(t,n,0,t.i.duration)}),null),4)):t.m?T(i,ef(t,e.ea,(function(){return Qo(t,e.ea,0,t.i.duration)}),null),0):i.u(0)}))}i.flush=function(t){var n=this,e;return _((function(i){return 1==i.g?(e=dn,t==e.Ya?i.return():T(i,ef(n,t,(function(){n.g.currentTime-=.001;nf(n,t)}),null),2)):n.m?T(i,ef(n,e.ea,(function(){var t=e.ea;n.g.currentTime-=.001;nf(n,t)}),null),0):i.u(0)}))};function Ko(t,n,e,i,r,a,u,s,o){var f,c,l;return _((function(h){if(1==h.g){f=dn;if(n==f.Ya)return a||(t.h.s=e),Mi(t.h,i,r),h.return();c=[];return T(h,vf(t,n,u,s,o),2)}l=h.h;l||(c.push(ef(t,n,(function(){return Jo(t,n)}),null)),t.m&&c.push(ef(t,f.ea,(function(){return Jo(t,f.ea)}),null)));a||(c.push(ef(t,n,(function(){return Zo(t,n,e)}),null)),t.m&&c.push(ef(t,f.ea,(function(){return Zo(t,f.ea,e)}),null)));if(0!=i||Infinity!=r)c.push(ef(t,n,(function(){return tf(t,n,i,r)}),null)),t.m&&c.push(ef(t,f.ea,(function(){return tf(t,f.ea,i,r)}),null));return c.length?T(h,Promise.all(c),0):h.u(0)}))}function Wo(t,n,e){var i,r;return _((function(a){if(1==a.g){i=dn;if(n==i.Ya)return a.return();n==i.xa&&(t.Ta=new qr);if(!t.G||(r=Ho(t,n))&&.15>Math.abs(r-e))return a.return();ef(t,n,(function(){return Jo(t,n)}),null);t.m&&ef(t,i.ea,(function(){return Jo(t,i.ea)}),null);return T(a,ef(t,n,(function(){return Zo(t,n,e)}),null),2)}return t.m?T(a,ef(t,i.ea,(function(){return Zo(t,i.ea,e)}),null),0):a.u(0)}))}i.endOfStream=function(t){var n=this;return _((function(e){return T(e,rf(n,(function(){_o(n)||Uo(n)||(t?n.i.endOfStream(t):n.i.endOfStream())})),0)}))};i.ob=function(t){var n=this;return _((function(e){return T(e,rf(n,(function(){if(n.A.durationReductionEmitsUpdateEnd&&t<n.i.duration)for(var e=c(n.l.keys()),i=e.next();!i.done;i=e.next()){i=i.value;var r={start:function(){},p:new qr,uri:null};n.o.get(i).unshift(r)}n.i.duration=t;n.wa=t})),0)}))};i.getDuration=function(){return this.i.duration};function $o(t,n,e){_((function(i){return t.H.g||t.g.error||t.L||t.F||_o(t)||Uo(t)?i.return():T(i,rf(t,(function(){_o(t)||Uo(t)||t.i.setLiveSeekableRange(n,e)})),0)}))}function Yo(t){_((function(n){return t.H.g||t.g.error||t.L||t.F||_o(t)||Uo(t)?n.return():T(n,rf(t,(function(){_o(t)||Uo(t)||t.i.clearLiveSeekableRange()})),0)}))}function Qo(t,n,e,i){i<=e?nf(t,n):t.l.get(n).remove(e,i)}function Jo(t,n){var e=t.l.get(n),i=e.appendWindowStart,r=e.appendWindowEnd;e.abort();e.appendWindowStart=i;e.appendWindowEnd=r;nf(t,n)}function Zo(t,n,e){0>e&&(e+=.001);t.l.get(n).timestampOffset=e;nf(t,n)}function tf(t,n,e,i){var r=t.l.get(n);if(r.appendWindowEnd!==i||r.appendWindowStart!==e)r.appendWindowStart=0,r.appendWindowEnd=i,r.appendWindowStart=e;nf(t,n)}function nf(t,n){if(t.F||t.H.g){var e=t.o.get(n);e&&e.length&&((e=e[0])&&e.p&&e.p.resolve(),t.o.set(n,[]))}else if(e=t.o.get(n)[0])e.p.resolve(),af(t,n)}function ef(t,n,e,i){ga(t.H);e={start:e,p:new qr,uri:i};t.o.get(n).push(e);1==t.o.get(n).length&&uf(t,n);return e.p}function rf(t,n){var e,i,r,a,u,s,o,f,l,h,d,v,p;return _((function(m){switch(m.g){case 1:ga(t.H);e=[];i=Array.from(t.l.keys());r=c(i);a=r.next();for(u={};!a.done;u={ready:void 0},a=r.next())s=a.value,u.ready=new qr,o={start:function(t){return function(){return t.ready.resolve()}}(u),p:u.ready,uri:null},f=t.o.get(s),f.push(o),e.push(u.ready),1==f.length&&o.start();S(m,2);return T(m,Promise.all(e),4);case 4:I(m,3);break;case 2:throw l=M(m),l;case 3:return S(m,5,6),T(m,n(),6);case 6:x(m);h=c(i);for(d=h.next();!d.done;d=h.next())v=d.value,af(t,v);N(m,0);break;case 5:throw p=M(m),new zt(2,3,3015,p,t.g.error||"No error in the media element",null)}}))}function af(t,n){t.o.get(n).shift();uf(t,n)}function uf(t,n){var e=t.o.get(n)[0];if(e)try{e.start()}catch(i){"QuotaExceededError"==i.name?e.p.reject(new zt(2,3,3017,n)):Lo(t)?e.p.reject(new zt(2,3,3015,i,t.g.error||"No error in the media element",e.uri)):e.p.reject(new zt(2,3,3024,n)),af(t,n)}}function sf(t,n){t.ia=n;t.h&&(t.h.j=n)}function of(t,n,e,i,r){if("mp4"!=vi(t.C.get(r)))return e;var a=null===i,u=t.Xa.get(r),s=t.N.Dj(),o=false;i&&i.Y&&(o=i.Y.encrypted);i=i?i.O()[0]:null;var f=ft();t.A.correctEc3Enca&&a&&"audio"===r&&(e=As(e));t.A.insertFakeEncryptionInInit&&u&&f.ce(s,r)&&(a?e=Is(n,e,i):!o&&f.Ai(r)&&(e=Ms(e)));a&&f.be()&&(e=Ps(e));return e}function ff(t,n,e,i){return ef(t,n,(function(){if(n!==hn){t.C.get(n);if(kn()){t.j.has(n)&&(t.j.get(n).destroy(),t.j.delete(n));i&&t.j.set(n,i);var r=e+t.A.addExtraFeaturesToSourceBuffer(e);t.l.get(n).changeType(r);t.C.set(n,e)}nf(t,n)}}),null)}function cf(t,n){var e,i,r,a,u,s,o,f,l,h,d,v,p,m,w,g,b,y,k,E;return _((function(S){if(1==S.g){if(t.F||t.L)return S.return();e=dn;t.F=true;t.m=false;i=t.g.currentTime;r=t.g.autoplay;t.g.paused||(t.Oa=true);t.eb&&(t.g.autoplay=false);A(S,2);t.s.Qa();a=c(t.j.values());for(u=a.next();!u.done;u=a.next())s=u.value,s.destroy();o=c(t.l.values());for(f=o.next();!f.done;f=o.next()){l=f.value;try{t.i.removeSourceBuffer(l)}catch(t){}}t.j.clear();t.l.clear();h=t.i.duration;t.K=new qr;t.i=No(t,t.K);return T(S,t.K,4)}if(2!=S.g){!isNaN(h)&&h?t.i.duration=h:!isNaN(t.wa)&&t.wa&&(t.i.duration=t.wa);d=new qr;v=t.i.sourceBuffers;p=n.size;m=0;w=function(){m++;m===p&&(d.resolve(),t.s.Ja(v,"addsourcebuffer",w))};t.s.D(v,"addsourcebuffer",w);g=c(n.keys());for(b=g.next();!b.done;b=g.next())y=b.value,k=n.get(y),Do(t,y,k,k.codecs);(E=n.get(e.ea))&&E.isAudioMuxedInVideo&&(t.m=true);t.m&&!t.o.has(e.ea)&&t.o.set(e.ea,[]);t.g.currentTime=i;return T(S,d,2)}x(S);t.F=false;ga(t.H);t.s.za(t.g,"canplaythrough",(function(){t.H.g||(t.g.autoplay=r,t.Oa&&(t.Oa=false,t.g.play()))}));return N(S,0)}))}function lf(t,n){return rf(t,(function(){return cf(t,n)}))}function hf(t,n,e,i){var r=false,a=cn("audio",(i||"").split(",")),u=cn("video",(i||"").split(",")),s=u;"audio"==n&&(s=a);s||(s=i);i=li(e,s);var o=wi(t.C.get(n)),f=t.A.forceTransmux;!yn(i)||!t.G&&ki.includes(i)?f=true:f||e==o||(f="WEBKIT"===ft().Da()&&ki.includes(e));if(f&&(t=hi(e,s),e=ri(t))){var c=e();a&&u&&(r=true);i=c.convertCodecs(n,t)}n=pi(gi(i));return{cc:c,Wk:r,Hh:wi(i),codec:n,mimeType:i}}function df(t,n,e,i,r){if(n==hn)return{type:gf,kf:e,cc:null};var a=pi(gi(t.C.get(n))),u=wi(t.C.get(n)),s=hf(t,n,e,i),o=s.cc,f=s.Wk,c=s.Hh,l=s.codec;s=s.mimeType;var h=true;f&&t.C.has("audio")&&(e=hf(t,"audio",e,i),i=pi(gi(t.C.get("audio"))),h=wi(t.C.get("audio")),h=i==e.codec&&h==e.Hh,e.cc&&e.cc.destroy());if(a===l&&u===c&&h)return{type:gf,kf:s,cc:o};a=true;if(t.m&&!r.has("audio")||f&&o&&!t.j.has(n))a=false;if(a&&"smooth"===t.A.codecSwitchingStrategy&&kn())return{type:yf,kf:s,cc:o};o&&o.destroy();return{type:bf,kf:s,cc:null}}function vf(t,n,e,i,r){var a,u,s,o,f,c;return _((function(l){if(1==l.g){a=dn;u=df(t,n,e,i,r);s=u.type;o=u.cc;f=u.kf;if(c=r.get(a.ea))t.m=c.isAudioMuxedInVideo;if(s==gf)return t.j.has(n)&&!o?(t.j.get(n).destroy(),t.j.delete(n)):!t.j.has(n)&&o?t.j.set(n,o):o&&(t.j.has(n)&&t.j.get(n).transmux!==o.transmux?(t.j.get(n).destroy(),t.j.set(n,o)):o.destroy()),l.return(false);if(s==yf)return T(l,ff(t,n,f,o),3);if(s!=bf)return l.u(3);o&&o.destroy();return T(l,lf(t,r),3)}return l.return(true)}))}function pf(t,n,e,i,r){t=df(t,n,e,i,r);t.cc&&t.cc.destroy();return t.type==bf}var mf=t.URL.createObjectURL,wf="sequence",gf="none",bf="reset",yf="changeType";function kf(t,n,e){this.i=t;this.C=n;this.s=this.l=Infinity;this.h=1;this.g=this.j=null;this.A=0;this.B=true;this.I=false;this.H=0;this.F=void 0===e?true:e;this.G=0;this.o=false;this.m=t}i=kf.prototype;i.getDuration=function(){return this.l};i.Gj=function(){return this.h};i.Ki=function(t){this.i=t};i.ob=function(t){this.l=t};i.Mj=function(){return this.i};i.Ji=function(t){this.A=t};i.Yc=function(t){t&&!this.B&&(this.I=true);this.B=t};i.Df=function(t){this.s=t};i.Ue=function(){return this.s};i.hh=function(t){this.C=t};i.xj=function(){return this.C};i.ri=function(t,n){if(0!=t.length){var e=(Date.now()+this.A)/1e3;t=t.filter((function(t){return t.start+n<e}));if(0!=t.length){var i=t[t.length-1].end+n;this.lf(t[0].start+n);this.h=t.reduce((function(t,n){return Math.max(t,n.end-n.start)}),this.h);this.g=Math.max(this.g,i);null!=this.i&&this.F&&!this.o&&(this.i=e-this.g-this.h)}}};i.Yd=function(t){if(0!=t.length){var n=t[0].startTime,e=t[0].endTime,i=(Date.now()+this.A)/1e3;t=c(t);for(var r=t.next();!r.done;r=t.next())r=r.value,i<r.startTime||(n=Math.min(n,r.startTime),e=Math.max(e,r.endTime),this.h=Math.max(this.h,r.endTime-r.startTime));this.lf(n);this.g=Math.max(this.g,e);null!=this.i&&this.F&&!this.o&&(this.i=i-this.g-this.h)}};i.pi=function(t,n){this.lf(t);Infinity==n||this.V()||(this.g=Math.max(this.g,n))};i.Hj=function(){return this.g};i.df=function(){this.o=true};i.hk=function(){return this.o};i.ih=function(t){this.m=t};i.Cj=function(){return this.m};i.lf=function(t){null==this.j?this.j=t:this.I||(this.j=Math.min(this.j,t))};i.Ng=function(t){this.h=Math.max(this.h,t)};i.offset=function(t){null!=this.j&&(this.j+=t);null!=this.g&&(this.g+=t)};i.V=function(){return Infinity==this.l&&!this.B};i.Sc=function(){return Infinity!=this.l&&!this.B};i.Fb=function(){return Math.max(this.H,this.zc()-this.s)};i.Mi=function(t){this.H=t};i.zc=function(){return this.V()||this.Sc()?Math.min(Math.max(0,(Date.now()+this.A)/1e3-this.h-this.i)+this.G,this.l):this.g?Math.min(this.g,this.l):this.l};i.Od=function(t){var n=Math.max(this.j,this.H);return Infinity==this.s?Math.ceil(1e3*n)/1e3:Math.max(n,Math.min(this.zc()-this.s+t,this.Eb()))};i.Vb=function(){return this.Od(0)};i.Eb=function(){return Math.max(0,this.zc()-(this.V()||this.Sc()?this.C:0))};i.Yi=function(){return null==this.i||null!=this.g&&this.F?false:true};i.Ii=function(t){this.G=t};i.sj=function(){return this.G};q("shaka.media.PresentationTimeline",kf);kf.prototype.getAvailabilityTimeOffset=kf.prototype.sj;kf.prototype.setAvailabilityTimeOffset=kf.prototype.Ii;kf.prototype.usingPresentationStartTime=kf.prototype.Yi;kf.prototype.getSeekRangeEnd=kf.prototype.Eb;kf.prototype.getSeekRangeStart=kf.prototype.Vb;kf.prototype.getSafeSeekRangeStart=kf.prototype.Od;kf.prototype.getSegmentAvailabilityEnd=kf.prototype.zc;kf.prototype.setUserSeekStart=kf.prototype.Mi;kf.prototype.getSegmentAvailabilityStart=kf.prototype.Fb;kf.prototype.isInProgress=kf.prototype.Sc;kf.prototype.isLive=kf.prototype.V;kf.prototype.offset=kf.prototype.offset;kf.prototype.notifyMaxSegmentDuration=kf.prototype.Ng;kf.prototype.notifyMinSegmentStartTime=kf.prototype.lf;kf.prototype.getInitialProgramDateTime=kf.prototype.Cj;kf.prototype.setInitialProgramDateTime=kf.prototype.ih;kf.prototype.isStartTimeLocked=kf.prototype.hk;kf.prototype.lockStartTime=kf.prototype.df;kf.prototype.getMaxSegmentEndTime=kf.prototype.Hj;kf.prototype.notifyPeriodDuration=kf.prototype.pi;kf.prototype.notifySegments=kf.prototype.Yd;kf.prototype.notifyTimeRange=kf.prototype.ri;kf.prototype.getDelay=kf.prototype.xj;kf.prototype.setDelay=kf.prototype.hh;kf.prototype.getSegmentAvailabilityDuration=kf.prototype.Ue;kf.prototype.setSegmentAvailabilityDuration=kf.prototype.Df;kf.prototype.setStatic=kf.prototype.Yc;kf.prototype.setClockOffset=kf.prototype.Ji;kf.prototype.getPresentationStartTime=kf.prototype.Mj;kf.prototype.setDuration=kf.prototype.ob;kf.prototype.setPresentationStartTime=kf.prototype.Ki;kf.prototype.getMaxSegmentDuration=kf.prototype.Gj;kf.prototype.getDuration=kf.prototype.getDuration;function Tf(t,n,e,i){var r=this;this.s=i;this.g=t;this.B=n;this.h=e;this.o=new it;this.l=false;this.F=t.readyState;this.G=this.C=this.j=0;this.m=Sf(this);this.A=false;this.o.D(t,"waiting",(function(){return Ef(r)}));this.i=new Di((function(){Ef(r)})).Ga(this.h.gapJumpTimerTime)}Tf.prototype.release=function(){this.o&&(this.o.release(),this.o=null);null!=this.i&&(this.i.stop(),this.i=null);this.m&&(this.m.release(),this.m=null);this.g=this.B=this.s=null};Tf.prototype.pf=function(){this.A=true;this.i&&this.i.Ga(this.h.gapJumpTimerTime);Ef(this)};function Ef(t){if(0!=t.g.readyState){if(t.g.seeking){if(!t.l)return}else t.l=false;if(!t.g.paused||t.g.currentTime==t.j&&(t.g.autoplay||t.g.currentTime!=t.j)){t.g.readyState!=t.F&&(t.F=t.g.readyState);var n;if(!(n=!t.m)){n=t.m;var e=n.h,i=Mf(e),r=e.g.currentTime,a=Date.now()/1e3;if(n.g!=r||n.m!=i)n.l=a,n.g=r,n.m=i,n.i=false;r=a-n.l;if(i=r>=n.o&&i&&!n.i)n.j&&n.j(n.g,r),n.i=true,n.g=e.g.currentTime;n=!i}n&&(n=t.g.currentTime,e=t.g.buffered,i=zs(e,n,t.h.gapDetectionThreshold),null==i||0==i&&!t.A||(r=e.start(i),(a=t.h.gapPadding)&&(r=Math.ceil(100*(r+a))/100),r>=t.B.Eb()||.001>r-n||(0!=i&&e.end(i-1),t.g.currentTime=r,n==t.j&&(t.j=r),t.C++,t.s(new Jr("gapjumped")))))}}}function Sf(t){if(!t.h.stallEnabled)return null;var n=t.h.stallThreshold,e=t.h.stallSkip;return new Af(new If(t.g),n,(function(){var n;return _((function(i){if(1==i.g)return n=Xs(t.g.buffered),n.length?e?(t.g.currentTime+=e,i.u(2)):T(i,t.g.play(),3):i.return();if(2!=i.g){if(!t.g)return i.return();t.g.pause();t.g.play()}t.G++;t.s(new Jr("stalldetected"));E(i)}))}))}function Af(t,n,e){this.h=t;this.m=Mf(t);this.g=t.g.currentTime;this.l=Date.now()/1e3;this.i=false;this.o=n;this.j=e}Af.prototype.release=function(){this.h&&this.h.release();this.j=this.h=null};function If(t){var n=this;this.g=t;this.h=new it;this.i=false;this.h.D(this.g,"audiofocuspaused",(function(){n.i=true}));this.h.D(this.g,"audiofocusgranted",(function(){n.i=false}));this.h.D(this.g,"audiofocuslost",(function(){n.i=true}))}function Mf(t){if(t.g.paused||0==t.g.playbackRate||t.i||0==t.g.buffered.length)var n=false;else t:{n=t.g.currentTime;t=c(Xs(t.g.buffered));for(var e=t.next();!e.done;e=t.next())if(e=e.value,!(n<e.start-.1||n>e.end-.5)){n=true;break t}n=false}return n}If.prototype.release=function(){this.h&&this.h.release();this.h=null};function xf(t,n,e,i){n==HTMLMediaElement.HAVE_NOTHING||t.readyState>=n?i():(n=Nf.value().get(n),e.za(t,n,i))}var Nf=new ot((function(){return new Map([[HTMLMediaElement.HAVE_METADATA,"loadedmetadata"],[HTMLMediaElement.HAVE_CURRENT_DATA,"loadeddata"],[HTMLMediaElement.HAVE_FUTURE_DATA,"canplay"],[HTMLMediaElement.HAVE_ENOUGH_DATA,"canplaythrough"]])}));function Cf(t,n,e,i){var r=this;this.g=t;this.m=n;this.s=e;this.l=null;this.j=function(){null==r.l&&(r.l=i());return r.l};this.o=false;this.h=new it;this.i=new Of(t);xf(this.g,HTMLMediaElement.HAVE_METADATA,this.h,(function(){Df(r,r.j())}))}Cf.prototype.release=function(){this.h&&(this.h.release(),this.h=null);null!=this.i&&(this.i.release(),this.i=null);this.m=function(){};this.g=null};function Pf(t){return t.o?t.g.currentTime:t.j()}function Rf(t,n){0<t.g.readyState?_f(t.i,n):xf(t.g,HTMLMediaElement.HAVE_METADATA,t.h,(function(){Df(t,t.j())}))}function Df(t,n){.001>Math.abs(t.g.currentTime-n)?Lf(t):(t.h.za(t.g,"seeking",(function(){Lf(t)})),_f(t.i,t.g.currentTime&&0!=t.g.currentTime?t.g.currentTime:n))}function Lf(t){t.o=true;t.h.D(t.g,"seeking",(function(){return t.m()}));t.s(t.g.currentTime)}function Of(t){var n=this;this.g=t;this.m=10;this.j=this.l=this.i=0;this.h=new Di((function(){0>=n.i?n.h.stop():n.g.currentTime!=n.l||n.g.currentTime===n.j?n.h.stop():(n.g.currentTime=n.j,n.i--)}))}Of.prototype.release=function(){this.h&&(this.h.stop(),this.h=null);this.g=null};function _f(t,n){t.l=t.g.currentTime;t.j=n;t.i=t.m;t.g.currentTime=n;t.h.Ga(.1)}function Uf(t){this.g=t;this.i=false;this.h=null;this.j=new it}i=Uf.prototype;i.ready=function(){function t(){if(null==n.h||0==n.h&&Infinity!=n.g.duration)n.i=true;else{var t=n.g.currentTime,e=null;if("number"===typeof n.h)e=n.h;else if(n.h instanceof Date){var i=Bf(n);null!==i&&(e=n.h.getTime()/1e3-i,e=Hf(n,e))}null==e?n.i=true:(0>e&&(e=Math.max(0,t+e)),t!=e?(n.j.za(n.g,"seeking",(function(){n.i=true})),n.g.currentTime=e):n.i=true)}}var n=this;xf(this.g,HTMLMediaElement.HAVE_FUTURE_DATA,this.j,(function(){t()}))};i.release=function(){this.j&&(this.j.release(),this.j=null);this.g=null};i.Rf=function(t){this.h=this.i?this.h:t};i.Be=function(){var t=this.i?this.g.currentTime:this.h;t instanceof Date&&(t=t.getTime()/1e3-(Bf(this)||0),t=Hf(this,t));return t||0};i.Ch=function(){return 0};i.Bh=function(){return 0};i.oi=function(){};i.ai=function(){var t=Hs(this.g.buffered);return null!=t&&t>=this.g.duration-1};function Bf(t){return t.g.getStartDate&&(t=t.g.getStartDate().getTime(),!isNaN(t))?t/1e3:null}function Hf(t,n){t=t.g.seekable;0<t.length&&(n=Math.max(t.start(0),n),n=Math.min(t.end(t.length-1),n));return n}function Ff(t,n,e,i,r,a){var u=this;this.h=t;this.g=n.presentationTimeline;this.l=e;this.s=r;this.o=null;this.j=new Tf(t,n.presentationTimeline,e,a);this.i=new Cf(t,(function(){t:{var t=u.j;t.l=true;t.A=false;t.i&&t.i.Ga(t.h.gapJumpTimerTime);Ef(t);var n=Pf(u.i);t=Xf(u,n);if(!Tn()&&.001<Math.abs(t-n)){n=false;var e=ft().Fi();if(e){var i=Date.now()/1e3;if(!u.o||u.o<i-e)u.o=i,n=true}else n=true;if(n){Rf(u.i,t);t=void 0;break t}}u.s();t=void 0}return t}),(function(t){var n=u.j;n.g.seeking&&!n.l&&(n.l=true,n.j=t);n.i&&n.i.Ga(n.h.gapJumpTimerTime);Ef(n)}),(function(){return Vf(u,i)}));this.m=new Di((function(){if(0!=u.h.readyState&&!u.h.paused){var t=Pf(u.i),n=u.g.Vb(),e=u.g.Eb();3>e-n&&(n=e-3);t<n&&(t=Xf(u,t),u.h.currentTime=t)}}))}i=Ff.prototype;i.ready=function(){this.m.Ga(.25)};i.release=function(){this.i&&(this.i.release(),this.i=null);this.j&&(this.j.release(),this.j=null);this.m&&(this.m.stop(),this.m=null);this.h=this.i=this.g=this.l=null;this.s=function(){}};i.Rf=function(t){Rf(this.i,Vf(this,t))};i.Be=function(){var t=Pf(this.i);return 0<this.h.readyState&&!this.h.paused?qf(this,t):t};i.Ch=function(){return this.j.G};i.Bh=function(){return this.j.C};function Vf(t,n){null==n?n=Infinity>t.g.getDuration()?t.g.Vb():t.g.Eb():n instanceof Date?n=n.getTime()/1e3-(t.g.m||t.g.i):0>n&&(n=t.g.Eb()+n);return zf(t,qf(t,n))}i.oi=function(){this.j.pf()};i.ai=function(){if(this.g.V()){var t=this.g.zc(),n=Hs(this.h.buffered);if(null!=n&&n>=t)return true}return false};function zf(t,n){var e=t.g.getDuration();return n>=e?e-t.l.durationBackoff:n}function Xf(t,n){var e=t.l.rebufferingGoal,i=t.l.safeSeekOffset,r=t.g.Vb(),a=t.g.Eb(),u=t.g.getDuration();3>a-r&&(r=a-3);var s=t.g.Od(e),o=t.g.Od(i);e=t.g.Od(e+i);return n>=u?zf(t,n):n>a?a-t.l.safeSeekEndOffset:n<r?t.g.V()&&t.l.returnToEndOfLiveWindowWhenOutside?a-t.l.safeSeekEndOffset:Fs(t.h.buffered,o)?o:e:n>=s||Fs(t.h.buffered,n)?n:e}function qf(t,n){var e=t.g.Vb();if(n<e)return e;t=t.g.Eb();return n>t?t:n}function jf(t){this.g=t;this.m=null;this.i=0;this.o=false}i=jf.prototype;i.getNumReferences=function(){return this.g.length};i.getNumEvicted=function(){return this.i};i.release=function(){this.o||(this.g=[],this.m&&this.m.stop(),this.m=null)};i.qk=function(){this.o=true};i.Db=function(t){for(var n=c(this.g),e=n.next();!e.done;e=n.next())t(e.value)};function Gf(t){return t.g[0]||null}i.find=function(t){for(var n=this.g.length-1,e=n;0<=e;--e){var i=this.g[e],r=e<n?this.g[e+1].startTime:i.endTime;if(t>=i.startTime&&t<r)return e+this.i}return this.g.length&&t<this.g[0].startTime?this.i:null};i.get=function(t){if(0==this.g.length)return null;t-=this.i;return 0>t||t>=this.g.length?null:this.g[t]};i.offset=function(t){if(!this.o)for(var n=c(this.g),e=n.next();!e.done;e=n.next())e.value.offset(t)};i.gf=function(t){if(!this.o&&t.length){var n=Math.round(1e3*t[0].startTime)/1e3;this.g=this.g.filter((function(t){return Math.round(1e3*t.startTime)/1e3<n}));this.g.push.apply(this.g,l(t))}};i.Wd=function(t,n){var e=this;t=t.filter((function(t){return t.endTime>n&&(0==e.g.length||t.endTime>e.g[0].startTime)}));this.gf(t);this.$a(n)};i.$a=function(t){if(!this.o){var n=this.g.length;this.g=this.g.filter((function(n){return n.endTime>t}));this.i+=n-this.g.length}};i.hd=function(t,n,e){e=void 0===e?false:e;if(!this.o){for(;this.g.length;)if(this.g[this.g.length-1].startTime>=n)this.g.pop();else break;for(;this.g.length;)if(this.g[0].endTime<=t)this.g.shift(),e||this.i++;else break;0!=this.g.length&&(t=this.g[this.g.length-1],n=new Ls(t.startTime,n,t.C,t.startByte,t.endByte,t.Y,t.timestampOffset,t.appendWindowStart,t.appendWindowEnd,t.g,t.tilesLayout,t.B,t.h,t.status,t.aesKey),n.mimeType=t.mimeType,n.codecs=t.codecs,n.i=t.i,this.g[this.g.length-1]=n)}};i.Hf=function(t,n){var e=this;this.o||(this.m&&this.m.stop(),this.m=new Di((function(){var t=n();t?e.g.push.apply(e.g,l(t)):(e.m.stop(),e.m=null)})),this.m.Ga(t))};jf.prototype[Symbol.iterator]=function(){return this.Ub(0)};jf.prototype.Ub=function(t,n,e){n=void 0===n?false:n;e=void 0===e?false:e;var i=this.find(t);if(null==i)return null;var r=this.get(i);e?i++:i--;var a=-1;if(r&&0<r.g.length)for(var u=r.g.length-1;0<=u;--u){var s=r.g[u];if(t>=s.startTime&&t<s.endTime){if(!n){for(;u&&!s.l;)u--,s=r.g[u];if(!s.l)return $("No independent partial segment found!"),null}e?i--:i++;a=u-1;break}}return new Wf(this,i,a,e)};jf.prototype.Ne=function(){return-1};function Kf(t,n,e){t=new Ls(t,t+n,(function(){return e}),0,null,null,t,t,t+n);return new jf([t])}q("shaka.media.SegmentIndex",jf);jf.forSingleSegment=Kf;jf.prototype.getIteratorForTime=jf.prototype.Ub;jf.prototype.updateEvery=jf.prototype.Hf;jf.prototype.fit=jf.prototype.hd;jf.prototype.evict=jf.prototype.$a;jf.prototype.mergeAndEvict=jf.prototype.Wd;jf.prototype.offset=jf.prototype.offset;jf.prototype.get=jf.prototype.get;jf.prototype.find=jf.prototype.find;jf.prototype.markImmutable=jf.prototype.qk;jf.prototype.release=jf.prototype.release;jf.prototype.getNumEvicted=jf.prototype.getNumEvicted;jf.prototype.getNumReferences=jf.prototype.getNumReferences;function Wf(t,n,e,i){this.i=t;this.h=n;this.g=e;this.reverse=i}i=Wf.prototype;i.zd=function(t){this.reverse=t};i.nj=function(){return this.h};i.current=function(){var t=this.i.get(this.h);t&&0<t.g.length&&t.A&&this.g>=t.g.length&&(this.h++,this.g=0,t=this.i.get(this.h));return t&&0<t.g.length?t.g[this.g]:t};i.next=function(){var t=this.i.get(this.h);this.reverse?t&&0<t.g.length?(this.g--,0>this.g&&(this.h--,this.g=(t=this.i.get(this.h))&&0<t.g.length?t.g.length-1:0)):(this.h--,this.g=0):t&&0<t.g.length?(this.g++,t.A&&this.g==t.g.length&&(this.h++,this.g=0)):(this.h++,this.g=0);t=this.current();return{value:t,done:!t}};i.Zg=function(){var t=this.current();if(t.o&&!t.l&&(t=this.i.get(this.h))&&0<t.g.length)for(var n=t.g[this.g];n.l&&!(0>=this.g);)this.g--,n=t.g[this.g]};q("shaka.media.SegmentIterator",Wf);Wf.prototype.resetToLastIndependent=Wf.prototype.Zg;Wf.prototype.next=Wf.prototype.next;Wf.prototype.current=Wf.prototype.current;Wf.prototype.currentPosition=Wf.prototype.nj;Wf.prototype.setReverse=Wf.prototype.zd;function $f(){jf.call(this,[]);this.h=[]}g($f,jf);i=$f.prototype;i.clone=function(){var t=new $f;t.h=this.h.slice();t.i=this.i;return t};i.release=function(){for(var t=c(this.h),n=t.next();!n.done;n=t.next())n.value.release();this.h=[]};i.Db=function(t){for(var n=c(this.h),e=n.next();!e.done;e=n.next())e.value.Db(t)};function Yf(t,n){t=c(t.h);for(var e=t.next();!e.done;e=t.next())n(e.value)}i.find=function(t){for(var n=this.i,e=c(this.h),i=e.next();!i.done;i=e.next()){i=i.value;var r=i.find(t);if(null!=r)return r+n;n+=i.getNumEvicted()+i.getNumReferences()}return null};function Qf(t,n){t=c(t.h);for(var e=t.next();!e.done;e=t.next())if(e=e.value,null!=e.find(n))return e.Ne();return-1}i.get=function(t){for(var n=this.i,e=c(this.h),i=e.next();!i.done;i=e.next()){i=i.value;var r=i.get(t-n);if(r)return r;r=i.getNumReferences();n+=i.getNumEvicted()+r}return null};i.offset=function(){};i.gf=function(){};i.$a=function(t){for(var n=c(this.h),e=n.next();!e.done;e=n.next())e.value.$a(t);for(;1<this.h.length&&0==this.h[0].getNumReferences();)t=this.h.shift(),this.i+=t.getNumEvicted(),t.release()};i.Wd=function(){};i.hd=function(){};i.Hf=function(){};q("shaka.media.MetaSegmentIndex",$f);$f.prototype.updateEvery=$f.prototype.Hf;$f.prototype.fit=$f.prototype.hd;$f.prototype.mergeAndEvict=$f.prototype.Wd;$f.prototype.evict=$f.prototype.$a;$f.prototype.merge=$f.prototype.gf;$f.prototype.offset=$f.prototype.offset;$f.prototype.get=$f.prototype.get;$f.prototype.find=$f.prototype.find;$f.prototype.forEachTopLevelReference=$f.prototype.Db;$f.prototype.release=$f.prototype.release;function Jf(t){var n=this;this.g=t;this.j=false;this.i=this.g.Te();this.h=new Di((function(){n.g.mi(.25*n.i)}))}Jf.prototype.release=function(){this.set(this.Oc());this.h&&(this.h.stop(),this.h=null);this.g=null};Jf.prototype.set=function(t){this.i=t;Zf(this)};Jf.prototype.Oc=function(){return this.g.Oc()};function Zf(t){t.h.stop();var n=t.j?0:t.i;if(0<=n)try{t.g.Te()!=n&&t.g.jh(n);return}catch(t){}t.h.Ga(.25);0!=t.g.Te()&&t.g.jh(0)}function tc(t){var n=this;this.j=t;this.h=new it;this.g=new Set;this.i=new Di((function(){nc(n,false)})).Hb();t.paused||this.i.Ga(.25);this.h.D(t,"playing",(function(){n.i.Hb().Ga(.25)}));this.h.D(t,"pause",(function(){n.i.stop()}))}tc.prototype.release=function(){this.h&&(this.h.release(),this.h=null);this.i.stop();for(var t=c(this.g),n=t.next();!n.done;n=t.next())n.value.release();this.g.clear()};function nc(t,n){var e=t.j.currentTime;t=c(t.g);for(var i=t.next();!i.done;i=t.next())i.value.j(e,n)}function ec(t){na.call(this);this.g=new Map;this.h=t}g(ec,na);ec.prototype.release=function(){this.g.clear();na.prototype.release.call(this)};function ic(t,n){var e=t.g.get(n);e||(e={ae:[],hg:null,contentType:n},t.g.set(n,e));return e}function rc(t,n,e){var i=ic(t,n.contentType);uc(t,i);t={od:n,position:e};i=i.ae;n=i.findIndex((function(t){return t.position>=e}));0<=n?i.splice(n,i[n].position==e?1:0,t):i.push(t)}ec.prototype.j=function(t){for(var n=c(this.g.values()),e=n.next();!e.done;e=n.next()){e=e.value;var i=e.hg;t:{var r=e.ae;for(var a=r.length-1;0<=a;a--){var u=r[a];if(u.position<=t){r=u.od;break t}}r=null}a=r&&!(i===r||i&&r&&i.bandwidth==r.bandwidth&&i.audioSamplingRate==r.audioSamplingRate&&i.codecs==r.codecs&&i.contentType==r.contentType&&i.frameRate==r.frameRate&&i.height==r.height&&i.mimeType==r.mimeType&&i.channelsCount==r.channelsCount&&i.pixelAspectRatio==r.pixelAspectRatio&&i.width==r.width);u=r&&i&&r.label&&i.label&&i.label!==r.label;var s=r&&i&&r.language&&i.language&&i.language!==r.language;i=r&&i&&r.roles&&i.roles&&!Bn(i.roles,r.roles);(u||s||i)&&ac(this,t,r.contentType)&&(e.hg=r,i=new Jr("audiotrackchange",new Map([["quality",r],["position",t]])),this.dispatchEvent(i));a&&ac(this,t,r.contentType)&&(e.hg=r,JSON.stringify(r),e=new Jr("qualitychange",new Map([["quality",r],["position",t]])),this.dispatchEvent(e))}};function ac(t,n,e){return(t=t.h()[e])&&0<t.length&&(e=t[t.length-1].end,n>=t[0].start&&n<e)?true:false}function uc(t,n){if((t=t.h()[n.contentType])&&0<t.length){var e=t[0].start,i=t[t.length-1].end,r=n.ae;n.ae=r.filter((function(t,n){return t.position<=e&&n+1<r.length&&r[n+1].position<=e||t.position>=i?false:true}))}else n.ae=[]}function sc(t){var n={bandwidth:t.bandwidth||0,audioSamplingRate:null,codecs:t.codecs,contentType:t.type,frameRate:null,height:null,mimeType:t.mimeType,channelsCount:null,pixelAspectRatio:null,width:null,label:null,roles:t.roles,language:null};"video"==t.type&&(n.frameRate=t.frameRate||null,n.height=t.height||null,n.pixelAspectRatio=t.pixelAspectRatio||null,n.width=t.width||null);"audio"==t.type&&(n.audioSamplingRate=t.audioSamplingRate,n.channelsCount=t.channelsCount,n.label=t.label||null,n.language=t.language);return n}function oc(t){na.call(this);this.h=new Map;this.i=t;this.g=null}g(oc,na);oc.prototype.release=function(){this.h.clear();this.g&&(this.g.stop(),this.g=null);na.prototype.release.call(this)};function fc(t,n){var e=n.schemeIdUri+"_"+n.id+"_"+(n.startTime.toFixed(1)+"_"+n.endTime.toFixed(1));t.h.has(e)||(t.h.set(e,n),n=new Jr("regionadd",new Map([["region",n]])),t.dispatchEvent(n),cc(t))}function cc(t){t.g||(t.g=new Di((function(){for(var n=t.i(),e=c(t.h),i=e.next();!i.done;i=e.next()){var r=c(i.value);i=r.next().value;r=r.next().value;r.endTime<n.start&&(t.h.delete(i),i=new Jr("regionremove",new Map([["region",r]])),t.dispatchEvent(i))}!t.h.size&&t.g&&(t.g.stop(),t.g=null)})).Ga(2))}function lc(t,n,e,i){this.m=t;this.i=n;this.l=e;this.h=new Map;this.j=new Map;this.g=null;this.o=i}function hc(t,n){t.l=n;t=c(t.h.values());for(var e=t.next();!e.done;e=t.next())e.value.g=n}function dc(t,n,e){e=void 0===e?false:e;if(!t.i.segmentIndex)return Promise.resolve();t.g||(t.g=t.i.segmentIndex.Ub(n,true,t.o));if(!t.g)return Promise.resolve();e&&t.g.next();for(n=[];t.h.size<t.m;){e=t.g.next().value;if(!e)break;var i=true;e.isPreload()&&null!=e.endByte&&(i=false);2==e.Bc()&&(i=false);e.Wb(false)&&(i=false);i&&e.Y&&n.push(vc(t,e.Y));i&&!t.h.has(e)&&(i=new kc(t.l),n.push(Tc(i,e,t.i)),t.h.set(e,i))}wc(t);return Promise.all(n)}function vc(t,n){if(!t.i.segmentIndex||n.Wb()||Array.from(t.j.keys()).some((function(t){return Ds(t,n)})))return Promise.resolve();var e=new kc(t.l),i=Tc(e,n,t.i);t.j.set(n,e);return i}function pc(t,n){n=c(n.keys());for(var e=n.next();!e.done;e=n.next())(e=e.value)&&yc(t,e)}function mc(t){pc(t,t.h);pc(t,t.j);t.g=null}lc.prototype.$a=function(t,n){n=void 0===n?false:n;for(var e=c(this.h.keys()),i=e.next();!i.done;i=e.next())i=i.value,t>i.endTime&&yc(this,i);n&&wc(this)};lc.prototype.zd=function(t){this.o=t;this.g&&this.g.zd(t)};function wc(t){for(var n=Array.from(t.h.keys()),e=c(t.j.keys()),i=e.next(),r={};!i.done;r={Hg:void 0},i=e.next())r.Hg=i.value,n.some(function(t){return function(n){return Ds(n.Y,t.Hg)}}(r))||yc(t,r.Hg)}function gc(t,n){t.m=n;for(var e=Array.from(t.h.keys());e.length>n;){var i=e.pop();i&&yc(t,i)}wc(t)}function bc(t,n){n&&n!==t.i&&(mc(t),t.i=n)}function yc(t,n){var e=t.h;n instanceof Rs&&(e=t.j);t=e.get(n);e.delete(n);t&&t.abort()}function kc(t){this.g=t;this.Zd=this.oh=null}function Tc(t,n,e){var i=new Uint8Array(0);t.Zd=t.g(n,e,(function(n){return _((function(e){if(1==e.g)return 0<i.byteLength?i=an(i,n):i=n,t.oh?T(e,t.oh(i),3):e.u(0);i=new Uint8Array(0);E(e)}))}));return t.Zd.promise.catch((function(t){return t instanceof zt&&7001==t.code?Promise.resolve():Promise.reject(t)}))}kc.prototype.abort=function(){this.Zd&&this.Zd.abort()};function Ec(t){var n=wi(t),e=n.split("/")[0];t=gi(t);return{type:e,mimeType:n,codecs:t,language:null,height:null,width:null,channelCount:null,sampleRate:null,closedCaptions:new Map,le:null,colorGamut:null,frameRate:null}}function Sc(t,n,e){function i(t){g=t.name;var n=t.reader;n.skip(24);var e=n.Aa(),i=n.Aa();n.skip(50);d=String(e);h=String(i);t.reader.Fa()&&Ma(t)}function r(t){var n=Ku(t.reader);v=n.channelCount;p=n.sampleRate;a(t.name)}function a(t){t=t.toLowerCase();switch(t){case"avc1":case"avc3":s.push(t+".42E01E");f=true;break;case"hev1":case"hvc1":s.push(t+".1.6.L93.90");f=true;break;case"dvh1":case"dvhe":s.push(t+".05.04");f=true;break;case"vp09":s.push(t+".00.10.08");f=true;break;case"av01":s.push(t+".0.01M.08");f=true;break;case"mp4a":u.push("mp4a.40.2");o=true;break;case"ac-3":case"ec-3":case"ac-4":case"opus":case"flac":u.push(t);o=true;break;case"apac":u.push("apac.31.00"),o=true}}var u=[],s=[],o=false,f=false,l=null,h=null,d=null,v=null,p=null,m=null,w=null,g;(new Ia).box("moov",Ma).box("trak",Ma).box("mdia",Ma).R("mdhd",(function(t){l=ju(t.reader,t.version).language})).box("minf",Ma).box("stbl",Ma).R("stsd",xa).box("mp4a",(function(t){var n=Ku(t.reader);v=n.channelCount;p=n.sampleRate;t.reader.Fa()?Ma(t):a(t.name)})).box("esds",(function(t){t=t.reader;for(var n="mp4a",e,i;t.Fa();){e=t.X();for(var r=t.X();r&128;)r=t.X();if(3==e)t.Aa(),r=t.X(),r&128&&t.Aa(),r&64&&t.skip(t.X()),r&32&&t.Aa();else if(4==e)i=t.X(),t.skip(12);else if(5==e)break}i&&(n+="."+Yu(i),5==e&&t.Fa()&&(e=t.X(),i=(e&248)>>3,31===i&&t.Fa()&&(i=32+((e&7)<<3)+((t.X()&224)>>5)),n+="."+i));u.push(n);o=true})).box("ac-3",r).box("ec-3",r).box("ac-4",r).box("Opus",r).box("fLaC",r).box("apac",r).box("avc1",i).box("avc3",i).box("hev1",i).box("hvc1",i).box("dva1",i).box("dvav",i).box("dvh1",i).box("dvhe",i).box("vp09",i).box("av01",i).box("avcC",(function(t){var n=g||"";switch(g){case"dvav":n="avc3";break;case"dva1":n="avc1"}t=t.reader;t.skip(1);t=n+"."+Yu(t.X())+Yu(t.X())+Yu(t.X());s.push(t);f=true})).box("hvcC",(function(t){var n=g||"";switch(g){case"dvh1":n="hvc1";break;case"dvhe":n="hev1"}var e=t.reader;e.skip(1);t=e.X();var i=["","A","B","C"][t>>6],r=t&31,a=e.T(),u=(t&32)>>5?"H":"L";t=[e.X(),e.X(),e.X(),e.X(),e.X(),e.X()];e=e.X();for(var o=0,c=0;32>c;c++){o|=a&1;if(31==c)break;o<<=1;a>>=1}n=n+("."+i+r)+("."+Yu(o,true));n+="."+u+e;i="";for(r=t.length;r--;)if((u=t[r])||i)i="."+u.toString(16).toUpperCase()+i;n+=i;s.push(n);f=true})).box("dvcC",(function(t){var n=g||"";switch(g){case"hvc1":n="dvh1";break;case"hev1":n="dvhe";break;case"avc1":n="dva1";break;case"avc3":n="dvav";break;case"av01":n="dav1"}var e=t.reader;e.skip(2);t=e.X();e=e.X();s.push(n+"."+Qu(t>>1&127)+"."+Qu(t<<5&32|e>>3&31));f=true})).box("dvvC",(function(t){var n=g||"";switch(g){case"hvc1":n="dvh1";break;case"hev1":n="dvhe";break;case"avc1":n="dva1";break;case"avc3":n="dvav";break;case"av01":n="dav1"}var e=t.reader;e.skip(2);t=e.X();e=e.X();s.push(n+"."+Qu(t>>1&127)+"."+Qu(t<<5&32|e>>3&31));f=true})).R("vpcC",(function(t){var n=g||"",e=t.reader;t=e.X();var i=e.X();e=e.X()>>4&15;s.push(n+"."+Qu(t)+"."+Qu(i)+"."+Qu(e));f=true})).box("av1C",(function(t){var n=g||"";switch(g){case"dav1":n="av01"}var e=t.reader;e.skip(1);t=e.X();e=e.X();var i=t>>>5,r=(e&64)>>6;s.push(n+"."+i+"."+Qu(t&31)+(e>>>7?"H":"M")+"."+Qu(2===i&&r?(e&32)>>5?12:10:r?10:8)+"."+((e&16)>>4)+"."+((e&8)>>3)+((e&4)>>2)+(e&3)+"."+Qu(1)+"."+Qu(1)+"."+Qu(1)+".0");f=true})).box("enca",Ca).box("encv",Na).box("sinf",Ma).box("frma",(function(t){t=Wu(t.reader).codec;a(t)})).box("colr",(function(t){s=s.map((function(n){if(n.startsWith("av01.")){var e=t.reader,i=e.Ma(),r=e.Sb(4);var a=String.fromCharCode(r[0]);a+=String.fromCharCode(r[1]);a+=String.fromCharCode(r[2]);a+=String.fromCharCode(r[3]);if("nclx"===a){r=e.Aa();a=e.Aa();var u=e.Aa(),s=e.X()>>7,o=n.split(".");10==o.length&&(o[6]=Qu(r),o[7]=Qu(a),o[8]=Qu(u),o[9]=String(s),n=o.join("."))}e.seek(i)}return n}));var n=$u(t.reader),e=n.colorGamut;m=n.le;w=e})).parse(t||n,true,true);if(!u.length&&!s.length)return null;var b=o&&!f,y=new Map;if(f&&!e){e=new Mn("video/mp4");t&&e.init(t);try{e.rf(n);for(var k=c(e.Qf()),T=k.next();!T.done;T=k.next()){var E=T.value;y.set(E,E)}}catch(t){}e.Cd()}return{type:b?"audio":"video",mimeType:b?"audio/mp4":"video/mp4",codecs:Ac(u.concat(s)).join(", "),language:l,height:h,width:d,channelCount:v,sampleRate:p,closedCaptions:y,le:m,colorGamut:w,frameRate:null}}function Ac(t){var n=new Set,e=[];t=c(t);for(var i=t.next();!i.done;i=t.next()){i=i.value;var r=mi(i);n.has(r)||(e.push(i),n.add(r))}n=ln("audio",e);i=ln("video",e);t=ln(hn,e);i=Ic(i);n=n.concat(i).concat(t);return e.length&&!n.length?e:n}function Ic(t){if(1>=t.length)return t;var n=t.find((function(t){return t.startsWith("dvav.")||t.startsWith("dva1.")||t.startsWith("dvh1.")||t.startsWith("dvhe.")||t.startsWith("dav1.")||t.startsWith("dvc1.")||t.startsWith("dvi1.")}));return n?yn('video/mp4; codecs="'+n+'"')?[n]:t.filter((function(t){return t!=n})):t}function Mc(t){var n=null;(new Ia).box("moov",Ma).box("trak",Ma).box("mdia",Ma).box("minf",Ma).box("stbl",Ma).R("stsd",xa).box("encv",Na).box("enca",Ca).box("sinf",Ma).box("schi",Ma).R("tenc",(function(t){t=t.reader;t.X();t.X();t.X();t.X();n=rn(t.Sb(16))})).parse(t,true);return n}function xc(n,e,i){var r,a,u,s,o;return _((function(f){if(1==f.g)return r=e,r.cryptoKey?f.u(2):T(f,r.fetchKey(),3);a=r.iv;if(!a)for(a=Bt(new ArrayBuffer(16)),u=r.firstMediaSequenceNumber+i,s=a.byteLength-1;0<=s;s--)a[s]=u&255,u>>=8;"CBC"==e.blockCipherMode?o={name:"AES-CBC",iv:a}:o={name:"AES-CTR",counter:a,length:64};return f.return(t.crypto.subtle.decrypt(o,r.cryptoKey,n))}))}function Nc(t,n,e,i,r){t=sa(t,i,r);if(0!=n||null!=e)t.headers.Range=e?"bytes="+n+"-"+e:"bytes="+n+"-";return t}function Cc(t,n){var e=this;this.g=n;this.j=t;this.i=null;this.K=new Map;this.C=1;this.A=this.o=null;this.P=0;this.h=new Map;this.I=false;this.S=null;this.B=false;this.l=new wa((function(){return Pc(e)}));this.M=Date.now()/1e3;this.m=new Map;this.N={projection:null,hfov:null};this.W=0;this.U=Infinity;this.F=null;this.L=[];this.s=new Di((function(){if(e.j&&e.g)if(e.j.presentationTimeline.V()){var t=e.j.presentationTimeline.Vb(),n=e.j.presentationTimeline.Eb();1<n-t?$o(e.g.Z,t,n):Yo(e.g.Z)}else Yo(e.g.Z),e.s&&e.s.stop();else e.s&&e.s.stop()}));this.G=null;this.H=new Di((function(){var t=e.g.video;!t.ended&&e.G&&(t.currentTime=e.G,e.G=null)}))}i=Cc.prototype;i.destroy=function(){return this.l.destroy()};function Pc(t){var n,e,i,r,a,u,s;return _((function(o){if(1==o.g){t.s&&t.s.stop();t.s=null;t.H&&t.H.stop();t.H=null;n=[];e=c(t.h.values());for(i=e.next();!i.done;i=e.next())r=i.value,ol(r),n.push(fl(r)),r.$&&(mc(r.$),r.$=null);a=c(t.m.values());for(u=a.next();!u.done;u=a.next())s=u.value,mc(s);return T(o,Promise.all(n),2)}t.h.clear();t.m.clear();t.g=null;t.j=null;t.i=null;t.G=null;E(o)}))}i.configure=function(t){this.i=t;this.S=new Vr({maxAttempts:Math.max(t.retryParameters.maxAttempts,2),baseDelay:t.retryParameters.baseDelay,backoffFactor:t.retryParameters.backoffFactor,fuzzFactor:t.retryParameters.fuzzFactor},true);if(t.disableAudioPrefetch){var n=this.h.get("audio");n&&n.$&&(mc(n.$),n.$=null);n=c(this.m.keys());for(var e=n.next();!e.done;e=n.next())e=e.value,mc(this.m.get(e)),this.m.delete(e)}t.disableTextPrefetch&&(n=this.h.get(hn))&&n.$&&(mc(n.$),n.$=null);t.disableVideoPrefetch&&(n=this.h.get("video"))&&n.$&&(mc(n.$),n.$=null);n=c(this.h.keys());for(e=n.next();!e.done;e=n.next())e=this.h.get(e.value),e.$?(gc(e.$,t.segmentPrefetchLimit),0<t.segmentPrefetchLimit||(mc(e.$),e.$=null)):0<t.segmentPrefetchLimit&&(e.$=jc(this,e.stream));t.disableAudioPrefetch||Gc(this)};function Rc(t,n,e){t.j.presentationTimeline.V()||(t.W=n,t.U=e)}i.start=function(t){var n=this;return _((function(e){if(1==e.g)return T(e,Xc(n,t||new Map),2);ga(n.l);n.I=true;E(e)}))};function Dc(t,n){var e,i,r,a,u,s;_((function(o){switch(o.g){case 1:return e=dn,t.P++,i=t.P,S(o,2),T(o,Go(t.g.Z,e.Ya),4);case 4:I(o,3);break;case 2:if(r=M(o),t.g)t.g.onError(r);case 3:a=li(n.mimeType,n.codecs),Oo(t.g.Z,a,t.j.sequenceMode,n.external),u=t.g.Z.ia,(u.isTextVisible()||t.i.alwaysStreamText)&&t.P==i&&(s=qc(t,n),t.h.set(e.Ya,s),sl(t,s,0)),E(o)}}))}function Lc(t){var n=t.h.get(hn);n&&(ol(n),fl(n).catch((function(){})),t.F=t.h.get(hn),t.h.delete(hn),n.stream&&n.stream.closeSegmentIndex&&n.stream.closeSegmentIndex());t.A=null}function Oc(t,n){for(var e=0>t.g.sb(),i=c(t.h.values()),r=i.next();!r.done;r=i.next())r=r.value,r.sa&&r.sa.zd(e),r.$&&r.$.zd(e);i=c(t.m.values());for(r=i.next();!r.done;r=i.next())r.value.zd(e);if(e=t.h.get("video"))if(i=e.stream)if(n)(n=i.trickModeVideo)&&!e.Ec&&(Fc(t,n,false,0,false),e.Ec=i);else if(n=e.Ec)e.Ec=null,Fc(t,n,true,0,false)}function _c(t,n,e,i,r,a){e=void 0===e?false:e;i=void 0===i?0:i;r=void 0===r?false:r;a=void 0===a?false:a;t.o=n;t.I&&(n.video&&Fc(t,n.video,e,i,r,a),n.audio&&Fc(t,n.audio,e,i,r,a))}function Uc(t,n){_((function(e){if(1==e.g)return t.F=null,t.A=n,t.I?n.segmentIndex?e.u(2):T(e,n.createSegmentIndex(),2):e.return();Fc(t,n,true,0,false);E(e)}))}function Bc(t){var n=t.h.get(hn);n&&Fc(t,n.stream,true,0,true)}function Hc(t,n){for(var e=c(t.K.entries()),i=e.next();!i.done;i=e.next()){var r=c(i.value);i=r.next().value;r=r.next().value;i.includes(n.type)&&(r(),t.K.delete(i))}}function Fc(t,n,e,i,r,a){var u=t.h.get(n.type);u||n.type!=hn?u&&(u.Ec&&(n.trickModeVideo?(u.Ec=n,n=n.trickModeVideo):u.Ec=null),u.stream!=n||r)&&(t.m.has(n)?u.$=t.m.get(n):u.$&&bc(u.$,n),n.type==hn&&u.stream!=n&&(r=li(n.mimeType,n.codecs),Oo(t.g.Z,r,t.j.sequenceMode,n.external)),!t.m.has(u.stream)&&u.stream.closeSegmentIndex&&(u.Pa?(r="("+u.type+":"+u.stream.id+")",t.K.has(r)||t.K.set(r,u.stream.closeSegmentIndex)):u.stream.closeSegmentIndex()),r=u.stream.isAudioMuxedInVideo!=n.isAudioMuxedInVideo,u.stream=n,u.sa=null,u.Xf=!!a,n.dependencyStream?u.Ld=qc(t,n.dependencyStream):u.Ld=null,r&&(u.xb=null,u.kc=null,u.jc=null,n.isAudioMuxedInVideo&&(n=null,"video"===u.type?n=t.h.get("audio"):"audio"===u.type&&(n=t.h.get("video")),n&&(fl(n).catch((function(){})),n.xb=null,n.kc=null,n.jc=null,zc(t,n),Vc(t,n).catch((function(n){if(t.g)t.g.onError(n)}))))),e?u.Jc?u.Of=true:u.Pa?(u.Hc=true,u.Me=i,u.Of=true):(ol(u),ul(t,u,true,i).catch((function(n){if(t.g)t.g.onError(n)}))):u.Pa||u.zb||sl(t,u,0),Vc(t,u).catch((function(n){if(t.g)t.g.onError(n)}))):Dc(t,n)}function Vc(t,n){var e,i;return _((function(r){if(1==r.g){if(!n.Gb)return r.return();e=n.stream;i=n.Gb;return e.segmentIndex?r.u(2):T(r,e.createSegmentIndex(),2)}if(n.Gb!=i||n.stream!=e)return r.return();var a=t.g.Pc();var u=Ho(t.g.Z,n.type),s=n.stream.segmentIndex.find(n.Ia?n.Ia.endTime:a),o=null==s?null:n.stream.segmentIndex.get(s);s=o?o.endByte?o.endByte-o.startByte:null:null;o&&!s&&(s=(o.endTime-o.getStartTime())*(n.stream.bandwidth||0)/8);s?((o=o.Y)&&(s+=(o.endByte?o.endByte-o.startByte:null)||0),o=t.g.getBandwidthEstimate(),a=8*s/o<(u||0)-a-t.i.rebufferingGoal||n.Gb.h.g>s?true:false):a=false;a&&n.Gb.abort();E(r)}))}i.Xc=function(){if(this.g){for(var t=this.g.Pc(),n=c(this.h.keys()),e=n.next();!e.done;e=n.next()){var i=e.value;e=this.h.get(i);var r=this.g.Z;i==hn?(r=r.h,r=null==r.g||null==r.h?false:t>=r.g&&t<r.h):(r=Vo(r,i),r=Fs(r,t));if(!r){this.M=0;e.$&&(e.$.g=null);if("audio"===e.type){r=c(this.m.values());for(var a=r.next();!a.done;a=r.next())a.value.g=null}e.sa=null;(null!=Ho(this.g.Z,i)||e.Pa)&&zc(this,e);e.Gb&&(e.Gb.abort(),e.Gb=null);i===hn&&(i=this.g.Z,i.I&&i.I.Cd());e.Xc=true}}"keep"!==this.i.crossBoundaryStrategy&&dl(this)}};function zc(t,n){n.Jc||n.Hc||(n.Pa?(n.Hc=true,n.Me=0):null==Bo(t.g.Z,n.type)?null==n.zb&&sl(t,n,0):(ol(n),ul(t,n,false,0).catch((function(n){if(t.g)t.g.onError(n)}))))}function Xc(t,n){var e,i,r,a,u,s,o,f;return _((function(l){if(1==l.g){if(!t.o)throw new zt(2,5,5006);e=pl(t,true);i=t.g.Z;return T(l,i.init(e,t.j.sequenceMode,t.j.type,t.j.ignoreManifestTimestampsInSegmentsMode),2)}ga(t.l);t.updateDuration();r=c(e.keys());for(a=r.next();!a.done;a=r.next())u=a.value,s=e.get(u),t.h.has(u)||(o=qc(t,s),n.has(s.id)&&(f=n.get(s.id),hc(f,(function(n,e,i){return al(n,e,i||null,t.i.retryParameters,t.g.pc)})),o.$=f),t.h.set(u,o),sl(t,o,0));E(l)}))}function qc(t,n){var e={stream:n,type:n.type,sa:null,$:jc(t,n),Ia:null,xb:null,cf:null,kc:null,jc:null,$e:null,bf:null,Ec:null,endOfStream:false,Pa:false,zb:null,Hc:false,Me:0,Of:false,Jc:false,Xc:true,Xf:false,Wg:false,Qd:false,Gb:null,Ld:null};n.dependencyStream&&(e.Ld=qc(t,n.dependencyStream));return e}function jc(t,n){if("video"===n.type&&t.i.disableVideoPrefetch||"audio"===n.type&&t.i.disableAudioPrefetch||n.type===hn&&("application/cea-608"==n.mimeType||"application/cea-708"==n.mimeType)||n.type===hn&&t.i.disableTextPrefetch)return null;if(t.m.has(n))return t.m.get(n);var e=t.h.get(n.type);return(e=e&&e.$)&&n===e.i?e:0<t.i.segmentPrefetchLimit?new lc(t.i.segmentPrefetchLimit,n,(function(n,e,i){return al(n,e,i||null,t.i.retryParameters,t.g.pc)}),0>t.g.sb()):null}function Gc(t){for(var n=t.i.segmentPrefetchLimit,e=t.i.prefetchAudioLanguages,i=c(t.j.variants),r=i.next(),a={};!r.done;a={Kb:void 0},r=i.next())if(a.Kb=r.value,a.Kb.audio)if(t.m.has(a.Kb.audio)){if(r=t.m.get(a.Kb.audio),gc(r,n),!(0<n&&e.some(function(t){return function(n){return Hi(t.Kb.audio.language,n)}}(a)))){var u=t.h.get(a.Kb.audio.type);r!==(u&&u.$)&&mc(r);t.m.delete(a.Kb.audio)}}else 0>=n||!e.some(function(t){return function(n){return Hi(t.Kb.audio.language,n)}}(a))||!(r=jc(t,a.Kb.audio))||(a.Kb.audio.segmentIndex||a.Kb.audio.createSegmentIndex(),t.m.set(a.Kb.audio,r))}i.updateDuration=function(){var t=Tn(),n=this.j.presentationTimeline.getDuration();Infinity>n?(t&&(this.s&&this.s.stop(),Yo(this.g.Z)),this.g.Z.ob(n)):t?(this.s&&this.s.Ga(.5),this.g.Z.ob(Infinity)):this.g.Z.ob(Math.pow(2,32))};function Kc(t,n){var e,i,r,a,u,s;return _((function(o){switch(o.g){case 1:ga(t.l);if(n.Pa||null==n.zb||n.Jc)return o.return();n.zb=null;if(!n.Hc){o.u(2);break}return T(o,ul(t,n,n.Of,n.Me),3);case 3:return o.return();case 2:Hc(t,n);if(n.stream.segmentIndex){o.u(4);break}e=n.stream;S(o,5);return T(o,n.stream.createSegmentIndex(),7);case 7:I(o,6);break;case 5:return i=M(o),T(o,cl(t,n,i),8);case 8:return o.return();case 6:if(e!=n.stream)return e.closeSegmentIndex&&e.closeSegmentIndex(),n.Pa||n.zb||sl(t,n,0),o.return();case 4:S(o,9);r=Wc(t,n);null!=r&&(sl(t,n,r),n.Qd=false);I(o,10);break;case 9:return a=M(o),T(o,cl(t,n,a),11);case 11:return o.return();case 10:u=Array.from(t.h.values());if(!t.I||!u.every((function(t){return t.endOfStream}))){o.u(0);break}return T(o,t.g.Z.endOfStream(),13);case 13:ga(t.l),s=t.g.Z.getDuration(),0!=s&&s<t.j.presentationTimeline.getDuration()&&t.j.presentationTimeline.ob(s),E(o)}}))}function Wc(t,n){if(il(n))return qo(t.g.Z,n.stream.originalId||""),null;n.type==hn&&jo(t.g.Z);if(n.stream.isAudioMuxedInVideo)return null;var e=t.i.updateIntervalSeconds/Math.max(1,Math.abs(t.g.sb()));if(!Lo(t.g.Z)&&n.type!=hn)return e/2;var i=t.g.Pc();if("audio"===n.type)for(var r=c(t.m.keys()),a=r.next();!a.done;a=r.next())a=t.m.get(a.value),a.$a(i,true),dc(a,i);r=n.Ia?n.Ia.endTime:i;var u=Fo(t.g.Z,n.type,i);a=Math.max(1,Math.max(t.i.rebufferingGoal,t.i.bufferingGoal)*t.C);var s=t.j.presentationTimeline.getDuration()-r,o=Ho(t.g.Z,n.type);if(1e-6>s&&o)return n.endOfStream=true,"video"==n.type&&(t=t.h.get(hn))&&il(t)&&(t.endOfStream=true),null;n.endOfStream=false;if(u>=a)return e/2;s=!n.sa;o=$c(t,n,i,o);if(!o)return e;u=false;s&&n.Xf&&(u=true,n.Xf=false);s=Infinity;var f=Array.from(t.h.values());f=c(f);for(var l=f.next();!l.done;l=f.next())l=l.value,il(l)||l.sa&&!l.sa.current()||(s=Math.min(s,l.Ia?l.Ia.endTime:i));if(r>=s+t.j.presentationTimeline.h)return e;if("keep"!==t.i.crossBoundaryStrategy&&vl(t,n,o))return null;n.$&&n.sa&&!t.m.has(n.stream)&&(n.$.$a(o.startTime+.001),dc(n.$,o.startTime).catch((function(){})));Yc(t,n,i,o,u).catch((function(){}));n.Ld&&Qc(t,n.Ld,i,a);return null}function $c(t,n,e,i){if(n.sa)return(e=n.sa.current())&&n.Ia&&.001>Math.abs(n.Ia.startTime-e.startTime)&&(e=n.sa.next().value),e;if(n.Ia||i)return e=n.Ia?n.Ia.endTime:i,t=0>t.g.sb(),n.stream.segmentIndex&&(n.sa=n.stream.segmentIndex.Ub(e,false,t)),n.sa&&n.sa.next().value;i=t.j.sequenceMode?0:t.i.inaccurateManifestTolerance;var r=Math.max(e-i,0);t=0>t.g.sb();var a=null;i&&(n.stream.segmentIndex&&(n.sa=n.stream.segmentIndex.Ub(r,false,t)),a=n.sa&&n.sa.next().value);a||(n.stream.segmentIndex&&(n.sa=n.stream.segmentIndex.Ub(e,false,t)),a=n.sa&&n.sa.next().value);return a}function Yc(n,e,i,r,a){var u,s,o,f,c,l,h,d,v,p,m,w,g,b,y,k,A;return _((function(x){switch(x.g){case 1:u=dn;s=e.stream;o=e.sa;e.Pa=true;S(x,2);if(2==r.Bc())throw new zt(1,1,1011);return T(x,Zc(n,e,r,a),4);case 4:ga(n.l);if(n.B)return x.return();f="video/mp4"==s.mimeType||"audio/mp4"==s.mimeType;c=t.ReadableStream;if(n.i.lowLatencyMode&&n.j.isLowLatency&&c&&f&&("HLS"!=n.j.type||r.m))return d=new Uint8Array(0),p=v=false,w=function(t){var u,o,f;return _((function(c){switch(c.g){case 1:if(v)return c.return();p=true;ga(n.l);if(n.B)return c.return();S(c,2);d=an(d,t);u=false;o=0;(new Ia).box("mdat",(function(t){o=t.size+t.start;u=true})).parse(d,false,true);if(!u){c.u(4);break}f=d.subarray(0,o);d=d.subarray(o);return T(c,nl(n,e,i,s,r,f,true,a),5);case 5:e.$&&e.sa&&dc(e.$,r.startTime,true);case 4:I(c,0);break;case 2:m=M(c),E(c)}}))},T(x,rl(n,e,r,w),9);l=rl(n,e,r);return T(x,l,7);case 7:h=x.h;ga(n.l);if(n.B)return x.return();ga(n.l);return e.Hc?(e.Pa=false,sl(n,e,0),x.return()):T(x,nl(n,e,i,s,r,h,false,a),6);case 9:g=x.h;if(m)throw m;if(p){x.u(10);break}v=true;ga(n.l);return n.B?x.return():e.Hc?(e.Pa=false,sl(n,e,0),x.return()):T(x,nl(n,e,i,s,r,g,false,a),10);case 10:e.$&&e.sa&&dc(e.$,r.startTime,true);case 6:ga(n.l);if(n.B)return x.return();e.Ia=r;o.next();e.Pa=false;e.Wg=false;b=n.g.Z.Lb();y=b[e.type];Z(JSON.stringify(y));e.Hc||(k=null,e.type===u.xa?k=n.h.get(u.ea):e.type===u.ea&&(k=n.h.get(u.xa)),k&&k.type==u.ea?n.g.pf(r,e.stream,k.stream.isAudioMuxedInVideo):n.g.pf(r,e.stream,e.stream.codecs.includes(",")));sl(n,e,0);I(x,0);break;case 2:A=M(x);ga(n.l,A);if(n.B)return x.return();e.Pa=false;if(7001==A.code)e.Pa=false,ol(e),sl(n,e,0),x.u(0);else if(e.type==u.Ya&&n.i.ignoreTextStreamFailures)n.h.delete(u.Ya),x.u(0);else{if(3017==A.code)return T(x,Jc(n,e,A),0);e.Qd=true;1==A.category&&e.$&&yc(e.$,r);A.severity=2;return T(x,cl(n,e,A),0)}}}))}function Qc(t,n,e,i){var r,a,u,s,o,f,c,h,d,v,p;return _((function(m){switch(m.g){case 1:r=n.stream;for(s=(u=(a=r.segmentIndex)&&a.Ub(e))&&u.next().value;s&&t.L.includes(s.startTime);)s=u&&u.next().value;if(!s){m.u(0);break}o=s.Y;if(!o||Ds(o,n.xb)){m.u(3);break}n.xb=o;S(m,4);return T(m,rl(t,n,o),6);case 6:f=m.h;var w=t.g.Z;w.M&&wn(w.M,f,0,r);t.L=[];I(m,3);break;case 4:throw c=M(m),n.xb=null,c;case 3:if(n.Ia&&n.Ia==s){m.u(0);break}n.Ia=s;S(m,8);return T(m,rl(t,n,s),10);case 10:h=m.h;w=t.g.Z;w.M&&wn(w.M,h,0,r);t.L.push(s.startTime);I(m,9);break;case 8:throw d=M(m),n.Ia=null,d;case 9:v=Math.max.apply(Math,[0].concat(l(t.L)));p=t.g.Pc();if(p+i>v)return T(m,Qc(t,n,s.startTime,i),0);m.u(0)}}))}function Jc(t,n,e){var i,r,a,u;return _((function(s){if(1==s.g){i=Array.from(t.h.values());if(i.some((function(t){return t!=n&&t.Wg})))return s.u(2);r=0===t.i.maxDisabledTime&&1011==e.code?1:t.i.maxDisabledTime;if(t.g.disableStream(n.stream,r))return s.return();if(t.i.avoidEvictionOnQuotaExceededError)return sl(t,n,4),s.return();a=Math.round(100*t.C);if(20<a)t.C-=.2;else if(4<a)t.C-=.04;else return n.Qd=true,t.B=true,t.g.onError(e),s.return();n.Wg=true;u=t.g.Pc();return T(s,el(t,n,u),2)}sl(t,n,4);E(s)}))}function Zc(t,n,e,i){var r,a,u,s,o,f,c,l,h,d,v,p,m,w,g,b;return _((function(y){switch(y.g){case 1:r=dn;a=null==n.Ia;u=[];s=Math.max(0,Math.max(e.appendWindowStart,t.W)-.1);o=Math.min(e.appendWindowEnd,t.U)+.1;f=e.codecs||n.stream.codecs;c=mi(f);l=wi(e.mimeType||n.stream.mimeType);h=e.timestampOffset;if(h==n.cf&&s==n.kc&&o==n.jc&&c==n.$e&&l==n.bf){y.u(2);break}d=n.$e&&n.bf&&pf(t.g.Z,n.type,l,f,pl(t));if(!d){y.u(3);break}v=null;n.type===r.xa?v=t.h.get(r.ea):n.type===r.ea&&(v=t.h.get(r.xa));if(!v){y.u(3);break}return T(y,fl(v).catch((function(){})),5);case 5:v.xb=null,v.kc=null,v.jc=null,zc(t,v);case 3:return T(y,tl(t,n,h,s,o,e,c,l),2);case 2:return Ds(e.Y,n.xb)||(n.xb=e.Y,e.l&&e.Y&&(p=rl(t,n,e.Y),m=function(){var a,u,s,o,f,c,l,h,d;return _((function(v){switch(v.g){case 1:return S(v,2),T(v,p,4);case 4:return a=v.h,ga(t.l),u=null,s=new Map,o={projection:null,hfov:null},f=new Ia,f.box("moov",Ma).box("trak",Ma).box("mdia",Ma).R("mdhd",(function(t){u=ju(t.reader,t.version).timescale})).box("hdlr",(function(t){t=t.reader;t.skip(8);switch(t.Uc()){case"soun":s.set(r.ea,u);break;case"vide":s.set(r.xa,u)}u=null})),n.type===r.xa&&f.box("minf",Ma).box("stbl",Ma).R("stsd",xa).box("encv",Na).box("avc1",Na).box("avc3",Na).box("hev1",Na).box("hvc1",Na).box("dvav",Na).box("dva1",Na).box("dvh1",Na).box("dvhe",Na).box("dvc1",Na).box("dvi1",Na).box("vexu",Ma).box("proj",Ma).R("prji",(function(t){t=t.reader.Uc();o.projection=t})).box("hfov",(function(t){t=t.reader.T()/1e3;o.hfov=t})),f.parse(a,true,true),n.type===r.xa&&hl(t,o),s.has(n.type)?e.Y.timescale=s.get(n.type):null!=u&&(e.Y.timescale=u),c=n.stream.segmentIndex,c instanceof $f&&(l=Qf(c,e.startTime)),h=n.stream.closedCaptions&&0<n.stream.closedCaptions.size,T(v,t.g.Ih(n.type,a),5);case 5:return T(v,Xo(t.g.Z,n.type,a,null,n.stream,h,n.Xc,i,false,false,l),6);case 6:I(v,0);break;case 2:throw d=M(v),n.xb=null,d}}))},w=e.startTime,a&&(g=Ho(t.g.Z,n.type),null!=g&&(w=g)),t.g.wk(w,e.Y),u.push(m()))),b=n.Ia?n.Ia.i:-1,e.i!=b&&u.push(Wo(t.g.Z,n.type,e.startTime)),T(y,Promise.all(u),0)}}))}function tl(t,n,e,i,r,a,u,s){var o,f,c,l,h;return _((function(d){switch(d.g){case 1:o=dn;f=pl(t);S(d,2);n.kc=i;n.jc=r;u&&(n.$e=u);s&&(n.bf=s);n.cf=e;c=t.j.sequenceMode||"HLS"==t.j.type;l=null;n.type===o.xa?l=t.h.get(o.ea):n.type===o.ea&&(l=t.h.get(o.xa));if(!(l&&l.stream&&l.stream.isAudioMuxedInVideo)){d.u(4);break}return T(d,Ko(t.g.Z,l.type,e,i,r,c,l.stream.mimeType,l.stream.codecs,f),4);case 4:return T(d,Ko(t.g.Z,n.type,e,i,r,c,a.mimeType||n.stream.mimeType,a.codecs||n.stream.codecs,f),6);case 6:I(d,0);break;case 2:throw h=M(d),n.kc=null,n.jc=null,n.$e=null,n.bf=null,n.cf=null,h}}))}function nl(t,n,e,i,r,a,u,s){u=void 0===u?false:u;s=void 0===s?false:s;var o,f,c,l;return _((function(h){switch(h.g){case 1:return o=i.closedCaptions&&0<i.closedCaptions.size,t.i.shouldFixTimestampOffset&&(f="video/mp4"==i.mimeType||"audio/mp4"==i.mimeType,c=null,r.Y&&(c=r.Y.timescale),f&&c&&"video"===i.type&&"DASH"==t.j.type&&(new Ia).box("moof",Ma).box("traf",Ma).R("tfdt",(function(e){var i,a,u,s,o,f;return _((function(l){i=qu(e.reader,e.version);a=i.baseMediaDecodeTime;if(!a)return l.return();u=-a/c;s=Number(n.cf)||0;if(!(s<u))return l.u(0);o=n.kc;f=n.jc;return T(l,tl(t,n,u,o,f,r),0)}))})).parse(a,false,u)),T(h,el(t,n,e),2);case 2:return ga(t.l),l=n.Xc,n.Xc=false,T(h,t.g.Ih(n.type,a),3);case 3:return T(h,Xo(t.g.Z,n.type,a,r,i,o,l,s,u),4);case 4:ga(t.l),E(h)}}))}function el(t,n,e){var i,r,a,u,s,o,f,c,l;return _((function(h){if(1==h.g){i=n.stream.segmentIndex;i instanceof $f&&(i.$a(t.j.presentationTimeline.Fb()),r=[],Yf(i,(function(t){r.push(t.Ne())})));a=Math.max(t.i.bufferBehind*t.C,t.j.presentationTimeline.h);u=Bo(t.g.Z,n.type);if(null==u)return t.F==n&&(t.F=null),h.return();s=e-u;o=t.i.evictionGoal;f=t.j.presentationTimeline.Vb();c=t.j.presentationTimeline.Eb();l=s-a;c-f>o&&(l=Math.max(s-a,f-o-u));return l<=o?h.return():T(h,t.g.Z.remove(n.type,u,u+l,r),2)}if(4!=h.g)return ga(t.l),t.F?T(h,el(t,t.F,e),4):h.u(0);ga(t.l);E(h)}))}function il(t){return t&&t.type==hn&&("application/cea-608"==t.stream.mimeType||"application/cea-708"==t.stream.mimeType)}function rl(t,n,e,i){var r,a,u,s,o;return _((function(f){switch(f.g){case 1:if(r=e.Wb())return f.return(r);a=null;if(n.$){var c=n.$,l=c.h;e instanceof Rs&&(l=c.j);l.has(e)?(c=l.get(e),i&&(c.oh=i),a=c.Zd):a=null}a||(a=al(e,n.stream,i||null,t.i.retryParameters,t.g.pc));u=0;n.sa&&(u=n.sa.h);n.Gb=a;return T(f,a.promise,2);case 2:s=f.h;n.Gb=null;o=s.data;if(!e.aesKey){f.u(3);break}return T(f,xc(o,e.aesKey,u),4);case 4:o=f.h;case 3:return f.return(o)}}))}function al(t,n,e,i,r,a){a=void 0===a?false:a;var u=t instanceof Ls?t:void 0,s=u?1:0;t=Nc(t.O(),t.startByte,t.endByte,i,e);t.contentType=n.type;return r.request(va,t,{type:s,stream:n,segment:u,isPreload:a})}function ul(t,n,e,i){var r,a;return _((function(u){if(1==u.g)return n.Hc=false,n.Of=false,n.Me=0,n.Jc=true,n.Ia=null,n.sa=null,n.$&&!t.m.has(n.stream)&&mc(n.$),i?(r=t.g.Pc(),a=t.g.Z.getDuration(),T(u,t.g.Z.remove(n.type,r+i,a),3)):T(u,Go(t.g.Z,n.type),4);if(3!=u.g)return ga(t.l),e?T(u,t.g.Z.flush(n.type),3):u.u(3);ga(t.l);n.Jc=false;n.endOfStream=false;n.Pa||n.zb||sl(t,n,0);E(u)}))}function sl(t,n,e){var i=n.type;if(i!=hn||t.h.has(i))n.zb=new Ri((function(){var e;return _((function(i){if(1==i.g)return S(i,2),T(i,Kc(t,n),4);if(2!=i.g)return I(i,0);e=M(i);if(t.g)t.g.onError(e);E(i)}))})).ha(e)}function ol(t){null!=t.zb&&(t.zb.stop(),t.zb=null)}function fl(t){return _((function(n){return t.Gb?T(n,t.Gb.abort(),0):n.u(0)}))}function cl(t,n,e){var i;return _((function(r){if(1==r.g)return 3024==e.code?(n.Pa=false,ol(n),sl(t,n,0),r.return()):T(r,zr(t.S),2);ga(t.l);if(1===e.category&&1003!=e.code){if(n.Ec)return Oc(t,false),r.return();i=0===t.i.maxDisabledTime&&1011==e.code?1:t.i.maxDisabledTime;e.handled=t.g.disableStream(n.stream,i);e.handled&&(e.severity=1)}if(!e.handled||1011!=e.code)t.g.onError(e);e.handled||t.i.failureCallback(e);E(r)}))}function ll(t,n){n=void 0===n?false:n;var e=void 0===e?true:e;var i,r,a,u,s;return _((function(o){if(1==o.g){i=Date.now()/1e3;r=t.i.minTimeBetweenRecoveries;if(!n){if(!t.i.allowMediaSourceRecoveries||i-t.M<r)return o.return(false);t.M=i}a=dn;if(u=t.h.get(a.ea))u.xb=null,u.kc=null,u.jc=null,e&&zc(t,u),fl(u).catch((function(){})),u.sa&&u.sa.Zg(),ol(u);if(s=t.h.get(a.xa))s.xb=null,s.kc=null,s.jc=null,e&&zc(t,s),fl(s).catch((function(){})),s.sa&&s.sa.Zg(),ol(s);return T(o,lf(t.g.Z,pl(t)),2)}!s||s.Jc||s.Pa||s.zb||sl(t,s,0);!u||u.Jc||u.Pa||u.zb||sl(t,u,0);return o.return(true)}))}function hl(t,n){if(t.N.projection!=n.projection||t.N.hfov!=n.hfov){if(null!=n.projection||null!=n.hfov){var e=(new Map).set("detail",n);e=new Jr("spatialvideoinfo",e)}else e=new Jr("nospatialvideoinfo");e.cancelable=true;t.g.onEvent(e);t.N=n}}function dl(t){if("keep"!==t.i.crossBoundaryStrategy){t.H.stop();var n=t.g.Pc(),e=t.h.get("video")||t.h.get("audio");e&&(e=e.xb)&&null!==e.g&&(n=e.g-n,0>n||1<n||(t.G=e.g+.1,t.H.ha(n)))}}function vl(t,n,e){if(n.type===hn)return false;var i=n.xb;if(!i)return false;var r=e.Y;e=i.g!==r.g;"reset_to_encrypted"===t.i.crossBoundaryStrategy&&(i.encrypted||r.encrypted||(e=false),i.encrypted&&(t.i.crossBoundaryStrategy="keep"));"RESET_ON_ENCRYPTION_CHANGE"===t.i.crossBoundaryStrategy&&i.encrypted==r.encrypted&&(e=false);if(e&&n.Xc){var a=t.g.video,u=a.paused;ll(t,true).then((function(){var n=(new Map).set("oldEncrypted",i.encrypted).set("newEncrypted",r.encrypted);t.g.onEvent(new Jr("boundarycrossed",n));u||a.play()}))}return e}function pl(t,n){n=void 0===n?false:n;var e=new Map;t.o.audio&&e.set("audio",t.o.audio);t.o.video&&e.set("video",t.o.video);n&&t.A&&e.set(hn,t.A);return e}function ml(){}function wl(t,n,e,i,r){var a=r in i;var u=a?e.constructor==Object&&0==Object.keys(i).length:e.constructor==Object&&0==Object.keys(e).length;var s=a||u,o=true,f;for(f in n){var c=r+"."+f,l=a?i[r]:e[f];s||f in e?void 0===n[f]?void 0===l||s?delete t[f]:t[f]=Kn(l):u?t[f]=n[f]:l.constructor==Object&&n[f]&&n[f].constructor==Object?(t[f]||(t[f]=Kn(l)),c=wl(t[f],n[f],l,i,c),o=o&&c):typeof n[f]!=typeof l||null==n[f]||"function"!=typeof n[f]&&n[f].constructor!=l.constructor?($("Invalid config, wrong type for "+c),o=false):"function"==typeof e[f]&&e[f].length!=n[f].length?(Y("Unexpected number of arguments for "+c),t[f]=n[f]):t[f]=Array.isArray(t[f])?n[f].slice():n[f]:($("Invalid config, unrecognized key "+c),o=false)}return o}function gl(t,n){for(var e={},i=e,r=0,a=0;;){r=t.indexOf(".",r);if(0>r)break;if(0==r||"\\"!=t[r-1])a=t.substring(a,r).replace(/\\\./g,"."),i[a]={},i=i[a],a=r+1;r+=1}i[t.substring(a).replace(/\\\./g,".")]=n;return e}function bl(t,n){return t&&n}function yl(t,n){function e(t){for(var n=c(Object.keys(t)),i=n.next();!i.done;i=n.next())if(i=i.value,!(t[i]instanceof HTMLElement))if(r(t[i])&&0===Object.keys(t[i]).length)delete t[i];else{var a=t[i];Array.isArray(a)&&0===a.length?delete t[i]:"function"==typeof t[i]?delete t[i]:r(t[i])&&(e(t[i]),0===Object.keys(t[i]).length&&delete t[i])}}function i(t,n){return Object.keys(t).reduce((function(e,a){var u=t[a];if(n.hasOwnProperty(a))if(u instanceof HTMLElement&&n[a]instanceof HTMLElement)u.isEqualNode(n[a])||(e[a]=u);else if(r(u)&&r(n[a])){if(u=i(u,n[a]),0<Object.keys(u).length||!r(u))e[a]=u}else Array.isArray(u)&&Array.isArray(n[a])?Un(u,n[a])||(e[a]=u):Number.isNaN(u)&&Number.isNaN(n[a])||u!==n[a]&&(e[a]=u);else e[a]=u;return e}),{})}function r(t){return t&&"object"===typeof t&&!Array.isArray(t)}t=i(t,n);e(t);return t}q("shaka.util.ConfigUtils",ml);ml.getDifferenceFromConfigObjects=yl;ml.convertToConfigObject=gl;ml.mergeConfigObjects=wl;q("shaka.config.RepeatMode",{OFF:0,ALL:1,SINGLE:2});function kl(){}function Tl(t){t=Gt(t);return new bt(t).Cb}function El(t,n,e){function i(t){Ft(a).setUint32(u,t.byteLength,true);u+=4;a.set(Bt(t),u);u+=t.byteLength}if(!e||!e.byteLength)throw new zt(2,6,6015);var r;"string"==typeof n?r=Wt(n,true):r=n;t=Gt(t);t=Wt(t,true);var a=new Uint8Array(12+t.byteLength+r.byteLength+e.byteLength),u=0;i(t);i(r);i(e);return a}function Sl(t,n,e){if("skd"!==n)return t;n=e.serverCertificate;e=Gt(t).split("skd://").pop();return El(t,e,n)}function Al(t,n){2===t&&(t=n.drmInfo)&&Ur(t.keySystem)&&(n.headers["Content-Type"]="application/octet-stream")}q("shaka.drm.FairPlay",kl);kl.commonFairPlayResponse=function(t,n){if(2===t&&(t=n.originalRequest.drmInfo)&&Ur(t.keySystem)){try{var e=qt(n.data)}catch(t){return}t=false;e=e.trim();"<ckc>"===e.substr(0,5)&&"</ckc>"===e.substr(-6)&&(e=e.slice(5,-6),t=true);if(!t)try{var i=JSON.parse(e);i.ckc&&(e=i.ckc,t=true);i.CkcMessage&&(e=i.CkcMessage,t=true);i.License&&(e=i.License,t=true)}catch(t){}t&&(n.data=Ut(nn(e)))}};kl.muxFairPlayRequest=function(t,n){Al(t,n)};kl.expressplayFairPlayRequest=function(t,n){if(2===t){var e=n.drmInfo;e&&Ur(e.keySystem)&&Al(t,n)}};kl.conaxFairPlayRequest=function(t,n){Al(t,n)};kl.ezdrmFairPlayRequest=function(t,n){Al(t,n)};kl.verimatrixFairPlayRequest=function(t,n){2===t&&(t=n.drmInfo)&&Ur(t.keySystem)&&(t=Bt(n.body),t=tn(t),n.headers["Content-Type"]="application/x-www-form-urlencoded",n.body=Kt("spc="+t))};kl.muxInitDataTransform=function(t,n,e){return Sl(t,n,e)};kl.expressplayInitDataTransform=function(t,n,e){return Sl(t,n,e)};kl.conaxInitDataTransform=function(n,e,i){if("skd"!==e)return n;e=i.serverCertificate;i=Gt(n).split("skd://").pop().split("?").shift();i=t.atob(i);var r=new ArrayBuffer(2*i.length);r=Ht(r);for(var a=0,u=i.length;a<u;a++)r[a]=i.charCodeAt(a);return El(n,r,e)};kl.ezdrmInitDataTransform=function(t,n,e){if("skd"!==n)return t;n=e.serverCertificate;e=Gt(t).split(";").pop();return El(t,e,n)};kl.verimatrixInitDataTransform=function(t,n,e){return Sl(t,n,e)};kl.initDataTransform=El;kl.defaultGetContentId=Tl;kl.isFairPlaySupported=function(){var t;return _((function(n){if(1==n.g)return t={initDataTypes:["cenc","sinf","skd"],videoCapabilities:[{contentType:'video/mp4; codecs="avc1.42E01E"'}]},S(n,2),T(n,navigator.requestMediaKeySystemAccess("com.apple.fps",[t]),4);if(2!=n.g)return n.return(true);M(n);return n.return(false)}))};function Il(){this.g=null}Il.prototype.configure=function(t){this.g=t};Il.prototype.getConfiguration=function(){return this.g};Il.prototype.create=function(t){var n;if(this.g.language){var e=Ml(t,this.g.language);e.length&&(n=e)}n||(n=t.filter((function(t){return t.primary})),n=n.length?n:t);t=xl(n,this.g.role);t.length&&(n=t);this.g.videoLayout&&(t=Dl(n,this.g.videoLayout),t.length&&(n=t));this.g.Dc&&(t=Rl(n,this.g.Dc),t.length&&(n=t));var i=[this.g.channelCount,this.g.preferredAudioChannelCount];t=i.filter((function(t,n){return t&&i.indexOf(t)===n}));if(t.length)for(t=c(t),e=t.next();!e.done;e=t.next())if(e=Pl(n,e.value),e.length){n=e;break}this.g.Ic&&(t=Nl(n,this.g.Ic),t.length&&(n=t));this.g.Bd&&(t=Cl(n,this.g.Bd),t.length&&(n=t));t=Ll(n,this.g.spatialAudio);t.length&&(n=t);var r=[this.g.audioCodec,this.g.Dd].concat(l(this.g.preferredAudioCodecs));t=r.filter((function(t,n){return t&&r.indexOf(t)===n}));if(t.length)for(t=c(t),e=t.next();!e.done;e=t.next())if(e=Ol(n,e.value),e.length){n=e;break}return new Su(n[0],n,!("smooth"==this.g.codecSwitchingStrategy&&kn()))};function Ml(t,n){n=zi(n);var e=Gi(n,t.map((function(t){return ji(t)})));return e?t.filter((function(t){return e==ji(t)})):[]}function xl(t,n){return t.filter((function(t){return t.audio?n?t.audio.roles.includes(n):0==t.audio.roles.length:false}))}function Nl(t,n){return t.filter((function(t){return t.audio&&t.audio.label?t.audio.label.toLowerCase()==n.toLowerCase():false}))}function Cl(t,n){return t.filter((function(t){return t.video&&t.video.label?t.video.label.toLowerCase()==n.toLowerCase():false}))}function Pl(t,n){return t.filter((function(t){return t.audio&&t.audio.channelsCount&&t.audio.channelsCount>n?false:true})).sort((function(t,n){return t.audio||n.audio?t.audio?n.audio?(n.audio.channelsCount||0)-(t.audio.channelsCount||0):1:-1:0}))}function Rl(t,n){if("AUTO"==n){var e=t.some((function(t){return t.video&&t.video.hdr&&"HLG"==t.video.hdr?true:false}));n=jy(e)}return t.filter((function(t){return t.video&&t.video.hdr&&t.video.hdr!=n?false:true}))}function Dl(t,n){return t.filter((function(t){return t.video&&t.video.videoLayout&&t.video.videoLayout!=n?false:true}))}function Ll(t,n){return t.filter((function(t){return t.audio&&t.audio.spatialAudio!=n?false:true}))}function Ol(t,n){return t.filter((function(t){return t.audio&&t.audio.codecs!=n?false:true}))}function _l(){}function Ul(){var n=Infinity,e=ft();navigator.connection&&navigator.connection.saveData&&(n=360);var i={retryParameters:Xr(),servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:false,persistentSessionOnlinePlayback:false,persistentSessionsMetadata:[],initDataTransform:function(n,e,i){"apple"===t.shakaMediaKeysPolyfill&&"skd"==e&&(e=i.serverCertificate,i=Tl(n),n=El(n,i,e));return n},logLicenseExchange:false,updateExpirationTime:1,preferredKeySystems:[],keySystemsMapping:{},parseInbandPsshEnabled:false,minHdcpVersion:"",ignoreDuplicateInitData:true,defaultAudioRobustnessForWidevine:"SW_SECURE_CRYPTO",defaultVideoRobustnessForWidevine:"SW_SECURE_DECODE"},r="reload",a=false;kn()&&e.$c()&&(r="smooth",a=true);a={retryParameters:Xr(),availabilityWindowOverride:NaN,disableAudio:false,disableVideo:false,disableText:false,disableThumbnails:false,disableIFrames:false,defaultPresentationDelay:0,segmentRelativeVttTiming:false,raiseFatalErrorOnManifestUpdateRequestFailure:false,continueLoadingWhenPaused:true,ignoreSupplementalCodecs:false,updatePeriod:-1,ignoreDrmInfo:false,dash:{clockSyncUri:"",disableXlinkProcessing:true,xlinkFailGracefully:false,ignoreMinBufferTime:false,autoCorrectDrift:true,initialSegmentLimit:1e3,ignoreSuggestedPresentationDelay:false,ignoreEmptyAdaptationSet:false,ignoreMaxSegmentDuration:false,keySystemsByURI:{"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:79f0049a-4098-8642-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:94ce86fb-07ff-4f43-adb8-93d2fa968ca2":"com.apple.fps","urn:uuid:3d5e6d35-9b9a-41e8-b843-dd3c6e72c42c":"com.huawei.wiseplay"},manifestPreprocessor:Vl,manifestPreprocessorTXml:zl,sequenceMode:false,multiTypeVariantsAllowed:a,useStreamOnceInPeriodFlattening:false,enableFastSwitching:true},hls:{ignoreTextStreamFailures:false,ignoreImageStreamFailures:false,defaultAudioCodec:"mp4a.40.2",defaultVideoCodec:"avc1.42E01E",ignoreManifestProgramDateTime:false,ignoreManifestProgramDateTimeForTypes:[],mediaPlaylistFullMimeType:'video/mp2t; codecs="avc1.42E01E, mp4a.40.2"',liveSegmentsDelay:3,sequenceMode:e.Zc(),ignoreManifestTimestampsInSegmentsMode:false,disableCodecGuessing:false,disableClosedCaptionsDetection:false,allowLowLatencyByteRangeOptimization:true,allowRangeRequestsToGuessMimeType:false},mss:{manifestPreprocessor:Vl,manifestPreprocessorTXml:zl,sequenceMode:false,keySystemsBySystemId:{"9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","79f0049a-4098-8642-ab92-e65be0885f95":"com.microsoft.playready"}}};var u={trackSelectionCallback:function(t){return _((function(n){return n.return(t)}))},downloadSizeCallback:function(t){var n;return _((function(e){if(1==e.g)return navigator.storage&&navigator.storage.estimate?T(e,navigator.storage.estimate(),3):e.return(true);n=e.h;return e.return(n.usage+t<.95*n.quota)}))},progressCallback:function(t,n){return bl([t,n])},usePersistentLicense:true,numberOfParallelDownloads:5},s={drm:i,manifest:a,streaming:{retryParameters:Xr(),failureCallback:function(t){return bl([t])},rebufferingGoal:0,bufferingGoal:10,bufferBehind:30,evictionGoal:1,ignoreTextStreamFailures:false,alwaysStreamText:false,startAtSegmentBoundary:false,gapDetectionThreshold:.5,gapPadding:0,gapJumpTimerTime:.25,durationBackoff:1,safeSeekOffset:5,safeSeekEndOffset:0,stallEnabled:true,stallThreshold:1,stallSkip:.1,useNativeHlsForFairPlay:true,inaccurateManifestTolerance:2,lowLatencyMode:false,preferNativeDash:false,preferNativeHls:false,updateIntervalSeconds:1,observeQualityChanges:false,maxDisabledTime:30,segmentPrefetchLimit:1,prefetchAudioLanguages:[],disableAudioPrefetch:false,disableTextPrefetch:false,disableVideoPrefetch:false,liveSync:{enabled:false,targetLatency:.5,targetLatencyTolerance:.5,maxPlaybackRate:1.1,minPlaybackRate:.95,panicMode:false,panicThreshold:60,dynamicTargetLatency:{enabled:false,stabilityThreshold:60,rebufferIncrement:.5,maxAttempts:10,maxLatency:4,minLatency:1}},allowMediaSourceRecoveries:true,minTimeBetweenRecoveries:5,vodDynamicPlaybackRate:false,vodDynamicPlaybackRateLowBufferRate:.95,vodDynamicPlaybackRateBufferRatio:.5,preloadNextUrlWindow:30,loadTimeout:30,clearDecodingCache:false,dontChooseCodecs:false,shouldFixTimestampOffset:false,avoidEvictionOnQuotaExceededError:false,crossBoundaryStrategy:"keep",returnToEndOfLiveWindowWhenOutside:false},networking:{forceHTTP:false,forceHTTPS:false,minBytesForProgressEvents:16e3},mediaSource:{codecSwitchingStrategy:r,addExtraFeaturesToSourceBuffer:function(t){return bl([t],"")},forceTransmux:false,insertFakeEncryptionInInit:true,correctEc3Enca:false,modifyCueCallback:function(t,n){return bl([t,n])},dispatchAllEmsgBoxes:false,useSourceElements:true,durationReductionEmitsUpdateEnd:true},offline:u,abrFactory:function(){return new Nr},adaptationSetCriteriaFactory:function(){return new(Function.prototype.bind.apply(Il,[null].concat(l(U.apply(0,arguments)))))},abr:{enabled:true,useNetworkInformation:true,defaultBandwidthEstimate:1e6,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:n,minPixels:0,maxPixels:Infinity,minFrameRate:0,maxFrameRate:Infinity,minBandwidth:0,maxBandwidth:Infinity,minChannelsCount:0,maxChannelsCount:Infinity},advanced:{minTotalBytes:128e3,minBytes:16e3,fastHalfLife:2,slowHalfLife:5},restrictToElementSize:false,restrictToScreenSize:false,ignoreDevicePixelRatio:false,clearBufferSwitch:false,safeMarginSwitch:0,cacheLoadThreshold:20,minTimeToSwitch:0,preferNetworkInformationBandwidth:false,removeLatencyFromFirstPacketTime:true},autoShowText:3,preferredAudioLanguage:"",preferredAudioLabel:"",preferredTextLanguage:"",preferredVariantRole:"",preferredTextRole:"",preferredAudioChannelCount:2,preferredVideoHdrLevel:"AUTO",preferredVideoLayout:"",preferredVideoLabel:"",preferredVideoCodecs:[],preferredAudioCodecs:[],preferredTextFormats:[],preferForcedSubs:false,preferSpatialAudio:false,preferredDecodingAttributes:[],restrictions:{minWidth:0,maxWidth:Infinity,minHeight:0,maxHeight:Infinity,minPixels:0,maxPixels:Infinity,minFrameRate:0,maxFrameRate:Infinity,minBandwidth:0,maxBandwidth:Infinity,minChannelsCount:0,maxChannelsCount:Infinity},playRangeStart:0,playRangeEnd:Infinity,textDisplayer:{captionsUpdatePeriod:.25,fontScaleFactor:1},textDisplayFactory:function(){return null},cmcd:{enabled:false,sessionId:"",contentId:"",rtpSafetyFactor:5,useHeaders:false,includeKeys:[],version:1},cmsd:{enabled:true,applyMaximumSuggestedBitrate:true,estimatedThroughputWeightRatio:.5},lcevc:{enabled:false,dynamicPerformanceScaling:true,logLevel:0,drawLogo:false,poster:true},ads:{customPlayheadTracker:false,skipPlayDetection:false,supportsMultipleMediaElements:true,disableHLSInterstitial:false,disableDASHInterstitial:false,allowPreloadOnDomElements:true,allowStartInMiddleOfInterstitial:true},ignoreHardwareResolution:false,queue:{preloadNextUrlWindow:30,repeatMode:0}};u.trackSelectionCallback=function(t){return _((function(n){return n.return(Fl(t,s.preferredAudioLanguage,s.preferredVideoHdrLevel))}))};return e.Sa(s)}function Bl(){return{streaming:{inaccurateManifestTolerance:0,segmentPrefetchLimit:2,updateIntervalSeconds:.1,maxDisabledTime:1,retryParameters:{baseDelay:100}},manifest:{dash:{autoCorrectDrift:false},retryParameters:{baseDelay:100}},drm:{retryParameters:{baseDelay:100}}}}function Hl(t,n,e){var i={".drm.keySystemsMapping":"",".drm.servers":"",".drm.clearKeys":"",".drm.advanced":{distinctiveIdentifierRequired:false,persistentStateRequired:false,videoRobustness:[],audioRobustness:[],sessionType:"",serverCertificate:new Uint8Array(0),serverCertificateUri:"",individualizationServer:"",headers:{}}};return wl(t,n,e||Ul(),i,"")}function Fl(t,n,e){var i=e;"AUTO"==i&&(e=t.some((function(t){return t.hdr&&"HLG"==t.hdr?true:false})),i=jy(e));var r=t.filter((function(t){return"variant"!=t.type||t.hdr&&t.hdr!=i?false:true}));e=[];var a=Gi(n,r.map((function(t){return t.language})));a&&(e=r.filter((function(t){return zi(t.language)==a})));0==e.length&&(e=r.filter((function(t){return t.primary})));0==e.length&&(r.map((function(t){return t.language})),e=r);var u=e.filter((function(t){return t.height&&480>=t.height}));u.length&&(u.sort((function(t,n){return n.height-t.height})),e=u.filter((function(t){return t.height==u[0].height})));n=[];e.length&&(r=Math.floor(e.length/2),e.sort((function(t,n){return t.bandwidth-n.bandwidth})),n.push(e[r]));t=c(t);for(e=t.next();!e.done;e=t.next())e=e.value,e.type!=hn&&"image"!=e.type||n.push(e);return n}function Vl(t){return bl([t],t)}function zl(t){return bl([t],t)}q("shaka.util.PlayerConfiguration",_l);_l.mergeConfigObjects=Hl;_l.createDefaultForLL=Bl;_l.createDefault=Ul;function Xl(){this.g=null;this.h=[]}function ql(t,n){var e=0;t.g&&t.g.state==n&&(e+=t.g.duration);t=c(t.h);for(var i=t.next();!i.done;i=t.next())i=i.value,e+=i.state==n?i.duration:0;return e}function jl(t){function n(t){return{timestamp:t.timestamp,state:t.state,duration:t.duration}}for(var e=[],i=c(t.h),r=i.next();!r.done;r=i.next())e.push(n(r.value));t.g&&e.push(n(t.g));return e}function Gl(){this.i=this.h=null;this.g=[]}function Kl(t,n,e){t.i!=n&&(t.i=n,t.g.push({timestamp:Date.now()/1e3,id:n.id,type:"text",fromAdaptation:e,bandwidth:null}))}function Wl(){this.B=this.W=NaN;this.l="";this.j=this.ei=this.s=this.A=this.K=this.C=this.o=this.m=this.I=this.F=this.i=this.S=this.U=this.M=this.N=this.P=NaN;this.L=0;this.G=this.H=NaN;this.g=new Xl;this.h=new Gl}function $l(t,n,e){t.P=n;t.N=e}function Yl(t,n,e){t.W=n;t.B=e}function Ql(t,n){t.i=isNaN(t.i)?n:Math.max(t.i,n)}function Jl(t,n){t.j=isNaN(t.j)?n:t.j+n}function Zl(t){var n=t.W,e=t.B,i=t.l,r=t.A,a=t.N,u=t.P,s=t.M,o=t.U,f=t.S,l=t.s,h=t.i,d=t.F,v=t.I,p=t.m,m=ql(t.g,"playing"),w=ql(t.g,"paused"),g=ql(t.g,"buffering"),b=t.o,y=t.C,k=t.K,T=t.ei,E=t.j,S=t.L,A=t.H,I=t.G,M=jl(t.g),x=[];t=c(t.h.g);for(var N=t.next();!N.done;N=t.next())N=N.value,x.push({timestamp:N.timestamp,id:N.id,type:N.type,fromAdaptation:N.fromAdaptation,bandwidth:N.bandwidth});return{width:n,height:e,currentCodecs:i,streamBandwidth:r,decodedFrames:a,droppedFrames:u,corruptedFrames:s,stallsDetected:o,gapsJumped:f,estimatedBandwidth:l,completionPercent:h,loadLatency:d,manifestTimeSeconds:v,drmTimeSeconds:p,playTime:m,pauseTime:w,bufferingTime:g,licenseTime:b,liveLatency:y,maxSegmentDuration:k,manifestSizeBytes:T,bytesDownloaded:E,nonFatalErrorCount:S,manifestPeriodCount:A,manifestGapCount:I,stateHistory:M,switchHistory:x}}function th(t,n,e,i){na.call(this);this.N=t;this.W=n;this.Oa=i.networkingEngine;this.m=e;this.A=null;this.Ka=0;this.ab=i.ed;this.F=i.lk;this.eb=i.nk;this.g=i.config;this.l=this.G=this.h=null;this.wa=false;this.H=i.Bk;this.ya=false;this.i=null;this.oa=false;this.j=this.C=null;this.ia=false;this.M=new Map;this.Ba=false;this.Ta=i.Ak;this.ba=new Wl;this.va=new qr;this.s=new qr;this.P=null;this.o=false;this.ka=i.dj;this.U=this.K=null;this.Za=i.cj;this.S=false;this.L=[];this.I=[];this.B=true}g(th,na);function nh(t,n,e){(t=n?t.I:t.L)?t.push(e):e()}function eh(t){if(t.I)for(var n=c(t.I),e=n.next();!e.done;e=n.next())e=e.value,e();t.I=null}function ih(t,n){t.P=n;t.S=true;if(t.L){n=c(t.L);for(var e=n.next();!e.done;e=n.next())e=e.value,e()}t.L=null}i=th.prototype;i.getStartTime=function(){return this.m};i.kd=function(){return this.N};i.Bg=function(){return this.h};function rh(t){t.ia=true;return t.j}function ah(t){t.ya=true;return t.H}i.getStats=function(){return this.ba};function uh(t){t.oa=true;return t.i}i.Lj=function(){return this.K?hr(this.K):null};i.Kj=function(){return this.U?dr(this.U):null};function sh(t){t.Ba=true;return t.M}i.start=function(){var n=this;(function(){var e;return _((function(i){switch(i.g){case 1:return T(i,Promise.resolve(),2);case 2:return S(i,3),T(i,ch(n),5);case 5:oh(n);if("webkit"===t.shakaMediaKeysPolyfill){i.u(6);break}return T(i,lh(n),7);case 7:oh(n);case 6:return T(i,hh(n),8);case 8:oh(n);if(!n.ka||!n.i){i.u(9);break}return T(i,uu(n.i),10);case 10:oh(n);case 9:n.s.resolve();I(i,0);break;case 3:e=M(i),e instanceof zt&&(7001==e.code||7003==e.code)||n.s.reject(e),E(i)}}))})()};i.dispatchEvent=function(t){return this.P?this.P.dispatchEvent(t):na.prototype.dispatchEvent.call(this,t)};i.onError=function(t){2===t.severity&&(this.s.reject(t),this.destroy());var n=(new Map).set("detail",t);n=new Jr("error",n);this.dispatchEvent(n);n.defaultPrevented&&(t.handled=true)};function oh(t){if(t.o)throw new zt(2,7,7003)}function fh(t,n){t.dispatchEvent(new Jr("onstatechange",(new Map).set("state",n)))}function ch(t){var n,e,i,r,a,u,s,o,f;return _((function(l){switch(l.g){case 1:fh(t,"manifest-parser");t.l||(t.G=Vu(t.N,t.W),t.l=t.G(),t.l.configure(t.g.manifest,(function(){return t.B})));n=Date.now()/1e3;fh(t,"manifest");if(t.h){l.u(2);break}return T(l,t.l.start(t.N,t.eb),3);case 3:t.h=l.h;if(1!=t.h.variants.length){l.u(2);break}e=[];i=t.h.variants[0];r=c([i.video,i.audio]);for(a=r.next();!a.done;a=r.next())(u=a.value)&&!u.segmentIndex&&e.push(u.createSegmentIndex());if(!(0<e.length)){l.u(2);break}return T(l,Promise.all(e),2);case 2:return t.va.resolve(),s=new Jr("manifestparsed",void 0),T(l,Promise.resolve(),7);case 7:t.dispatchEvent(s);if(0==t.h.variants.length)throw new zt(2,4,4036);vh(t.h);o=Date.now()/1e3;f=o-n;t.ba.I=f;E(l)}}))}function lh(t,n){var e,i,r,a,u,s;return _((function(o){switch(o.g){case 1:if(!t.h||t.i)return o.return();fh(t,"drm-engine");t.Ka=Date.now()/1e3;t.i=t.ab();t.F.h=t.i;t.i.configure(t.g.drm,(function(){return t.B}));e=Du(t.F,t.h);if(!e){o.u(2);break}i=new Jr("trackschanged",void 0);return T(o,Promise.resolve(),3);case 3:oh(t),t.dispatchEvent(i);case 2:return r=br(t.h.variants),a=true,t.h&&t.h.presentationTimeline&&"HLS"!=t.h.type&&(a=t.h.presentationTimeline.V()),T(o,za(t.i,r,t.h.offlineSessionIds,a),4);case 4:oh(t);if(!n){o.u(5);break}return T(o,t.i.dc(n),6);case 6:oh(t);case 5:return T(o,Ru(t.F,t.h),7);case 7:u=o.h;if(!u){o.u(0);break}s=new Jr("trackschanged",void 0);return T(o,Promise.resolve(),9);case 9:t.dispatchEvent(s),E(o)}}))}i.configure=function(t,n){t=gl(t,n);Hl(this.g,t)};i.getConfiguration=function(){return Kn(this.g)};function hh(t){var n,e,i,r,a,u,s;return _((function(o){t.A||(t.A=t.g.adaptationSetCriteriaFactory(),t.A.configure({language:t.g.preferredAudioLanguage,role:t.g.preferredVariantRole,channelCount:t.g.preferredAudioChannelCount,Dc:t.g.preferredVideoHdrLevel,spatialAudio:t.g.preferSpatialAudio,videoLayout:t.g.preferredVideoLayout,Ic:t.g.preferredAudioLabel,Bd:t.g.preferredVideoLabel,codecSwitchingStrategy:t.g.mediaSource.codecSwitchingStrategy,audioCodec:"",Dd:"",De:0,preferredAudioCodecs:t.g.preferredAudioCodecs,preferredAudioChannelCount:t.g.preferredAudioChannelCount}));t.Za&&(n=t.g.abrFactory,t.C=n,t.j=n(),t.j.configure(t.g.abr));if(!t.ka)return o.u(0);e=t.h.presentationTimeline.V();i=br(t.h.variants);r=t.A.create(i);t.j.configure(t.g.abr);t.j.setVariants(Array.from(r.values()));a=t.j.chooseVariant();if(!a)return o.u(0);u=[];t.K=a;a.video&&u.push(dh(t,a.video,e));a.audio&&u.push(dh(t,a.audio,e));(s=yr(t.h.textStreams,t.g.preferredTextLanguage,t.g.preferredTextRole,t.g.preferForcedSubs)[0]||null)&&Sr(a.audio,s,t.g)&&(u.push(dh(t,s,e)),t.U=s);return T(o,Promise.all(u),0)}))}function dh(t,n,e){var i,r,a,u,s;return _((function(o){if(1==o.g)return i=t.g.streaming.segmentPrefetchLimit||2,r=new lc(i,n,(function(n,e,i){return al(n,e,i||null,t.g.streaming.retryParameters,t.Oa,t.B)}),false),t.M.set(n.id,r),n.segmentIndex?o.u(2):T(o,n.createSegmentIndex(),2);a="number"===typeof t.m?t.m:0;u=n.segmentIndex.Ub(a);s=null;u&&(s=u.current(),s||(s=u.next().value));s||(s=Gf(n.segmentIndex));return s?e?s.Y?T(o,vc(r,s.Y),0):o.u(0):T(o,dc(r,s.startTime),0):o.u(0)}))}i.cl=function(){return this.s};i.destroy=function(){var t=this,n,e,i;return _((function(r){switch(r.g){case 1:t.o=true;if(!t.l||t.wa){r.u(2);break}return T(r,t.l.stop(),2);case 2:if(!t.j||t.ia){r.u(4);break}return T(r,t.j.stop(),4);case 4:t.H&&!t.ya&&t.H.release();if(!t.i||t.oa){r.u(6);break}return T(r,t.i.destroy(),6);case 6:if(0<t.M.size&&!t.Ba)for(n=c(t.M.values()),e=n.next();!e.done;e=n.next())i=e.value,mc(i);E(r)}}))};function vh(t){function n(t){return t.video&&t.audio||t.video&&t.video.codecs.includes(",")}t.variants.some(n)&&(t.variants=t.variants.filter(n))}q("shaka.media.PreloadManager",th);th.prototype.destroy=th.prototype.destroy;th.prototype.waitForFinish=th.prototype.cl;th.prototype.getPrefetchedTextTrack=th.prototype.Kj;th.prototype.getPrefetchedVariantTrack=th.prototype.Lj;function ph(t,n){na.call(this);var e=this;this.i=t;this.l=n;this.g=new Map;this.m=[{dd:null,cd:gh,Rc:function(t,n){return mh(e,"enter",t,n)}},{dd:wh,cd:gh,Rc:function(t,n){return mh(e,"enter",t,n)}},{dd:bh,cd:gh,Rc:function(t,n){return mh(e,"enter",t,n)}},{dd:gh,cd:wh,Rc:function(t,n){return mh(e,"exit",t,n)}},{dd:gh,cd:bh,Rc:function(t,n){return mh(e,"exit",t,n)}},{dd:wh,cd:bh,Rc:function(t,n){n?mh(e,"skip",t,n):(mh(e,"enter",t,n),mh(e,"exit",t,n))}},{dd:bh,cd:wh,Rc:function(t,n){return mh(e,"skip",t,n)}}];this.h=new it;this.h.D(this.i,"regionremove",(function(t){e.g.delete(t.region)}))}g(ph,na);ph.prototype.release=function(){this.i=null;this.g.clear();this.h.release();this.h=null;na.prototype.release.call(this)};ph.prototype.j=function(t,n){if(!this.l||0!=t){this.l=false;for(var e=c(this.i.h.values()),i=e.next();!i.done;i=e.next()){i=i.value;var r=this.g.get(i),a=t<i.startTime?wh:t>i.endTime?bh:gh;this.g.set(i,a);for(var u=c(this.m),s=u.next();!s.done;s=u.next())s=s.value,s.dd==r&&s.cd==a&&s.Rc(i,n)}}};function mh(t,n,e,i){n=new Jr(n,new Map([["region",e],["seeking",i]]));t.dispatchEvent(n)}var wh=1,gh=2,bh=3;function yh(t,n,e){var i,r,a,u,s,o,f;return _((function(c){switch(c.g){case 1:var l=new bt(t).mb.split("/").pop().split(".");i=1==l.length?"":l.pop().toLowerCase();if(r=kh.get(i))return c.return(r);a=0;u=sa([t],e);S(c,2);u.method="HEAD";return T(c,n.request(a,u).promise,4);case 4:s=c.h;r=s.headers["content-type"];I(c,3);break;case 2:o=M(c);if(!o||1002!=o.code&&1001!=o.code){c.u(3);break}u.method="GET";return T(c,n.request(a,u).promise,6);case 6:f=c.h,r=f.headers["content-type"];case 3:return c.return(r?r.toLowerCase().split(";").shift():"")}}))}var kh=(new Map).set("mp4","video/mp4").set("m4v","video/mp4").set("m4a","audio/mp4").set("webm","video/webm").set("weba","audio/webm").set("mkv","video/webm").set("ts","video/mp2t").set("ogv","video/ogg").set("ogg","audio/ogg").set("mpg","video/mpeg").set("mpeg","video/mpeg").set("mov","video/quicktime").set("m3u8","application/x-mpegurl").set("mpd","application/dash+xml").set("ism","application/vnd.ms-sstr+xml").set("mp3","audio/mpeg").set("aac","audio/aac").set("flac","audio/flac").set("wav","audio/wav").set("sbv","text/x-subviewer").set("srt","text/srt").set("vtt","text/vtt").set("webvtt","text/vtt").set("ttml","application/ttml+xml").set("lrc","application/x-subtitle-lrc").set("ssa","text/x-ssa").set("ass","text/x-ssa").set("jpeg","image/jpeg").set("jpg","image/jpeg").set("png","image/png").set("svg","image/svg+xml").set("webp","image/webp").set("avif","image/avif").set("html","text/html").set("htm","text/html");
/*
		 @license
		 Copyright 2013 Ali Al Dallal

		 Licensed under the MIT license.

		 Permission is hereby granted, free of charge, to any person obtaining a copy
		 of this software and associated documentation files (the "Software"), to deal
		 in the Software without restriction, including without limitation the rights
		 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
		 copies of the Software, and to permit persons to whom the Software is
		 furnished to do so, subject to the following conditions:

		 The above copyright notice and this permission notice shall be included in
		 all copies or substantial portions of the Software.

		 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
		 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
		 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
		 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
		 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
		 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
		 SOFTWARE.
		*/for(var Th={ach:"Lwo",ady:"Адыгэбзэ",af:"Afrikaans","af-NA":"Afrikaans (Namibia)","af-ZA":"Afrikaans (South Africa)",ak:"Tɕɥi",ar:"العربية","ar-AR":"العربية","ar-MA":"العربية","ar-SA":"العربية (السعودية)","ay-BO":"Aymar aru",az:"Azərbaycan dili","az-AZ":"Azərbaycan dili","be-BY":"Беларуская",bg:"Български","bg-BG":"Български",bn:"বাংলা","bn-IN":"বাংলা (ভারত)","bn-BD":"বাংলা(বাংলাদেশ)","bs-BA":"Bosanski",ca:"Català","ca-ES":"Català",cak:"Maya Kaqchikel","ck-US":"ᏣᎳᎩ (tsalagi)",cs:"Čeština","cs-CZ":"Čeština",cy:"Cymraeg","cy-GB":"Cymraeg",da:"Dansk","da-DK":"Dansk",de:"Deutsch","de-AT":"Deutsch (Österreich)","de-DE":"Deutsch (Deutschland)","de-CH":"Deutsch (Schweiz)",dsb:"Dolnoserbšćina",el:"Ελληνικά","el-GR":"Ελληνικά",en:"English","en-GB":"English (UK)","en-AU":"English (Australia)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-IN":"English (India)","en-PI":"English (Pirate)","en-UD":"English (Upside Down)","en-US":"English (US)","en-ZA":"English (South Africa)","en@pirate":"English (Pirate)",eo:"Esperanto","eo-EO":"Esperanto",es:"Español","es-AR":"Español (Argentine)","es-419":"Español (Latinoamérica)","es-CL":"Español (Chile)","es-CO":"Español (Colombia)","es-EC":"Español (Ecuador)","es-ES":"Español (España)","es-LA":"Español (Latinoamérica)","es-NI":"Español (Nicaragua)","es-MX":"Español (México)","es-US":"Español (Estados Unidos)","es-VE":"Español (Venezuela)",et:"eesti keel","et-EE":"Eesti (Estonia)",eu:"Euskara","eu-ES":"Euskara",fa:"فارسی","fa-IR":"فارسی","fb-LT":"Leet Speak",ff:"Fulah",fi:"Suomi","fi-FI":"Suomi","fo-FO":"Føroyskt",fr:"Français","fr-CA":"Français (Canada)","fr-FR":"Français (France)","fr-BE":"Français (Belgique)","fr-CH":"Français (Suisse)","fy-NL":"Frysk",ga:"Gaeilge","ga-IE":"Gaeilge (Gaelic)",gl:"Galego","gl-ES":"Galego","gn-PY":"Avañe'ẽ","gu-IN":"ગુજરાતી","gx-GR":"Ἑλληνική ἀρχαία",he:"עברית‏","he-IL":"עברית‏",hi:"हिन्दी","hi-IN":"हिन्दी",hr:"Hrvatski","hr-HR":"Hrvatski",hsb:"Hornjoserbšćina",ht:"Kreyòl",hu:"Magyar","hu-HU":"Magyar","hy-AM":"Հայերեն",id:"Bahasa Indonesia","id-ID":"Bahasa Indonesia",is:"Íslenska","is-IS":"Íslenska (Iceland)",it:"Italiano","it-IT":"Italiano",ja:"日本語","ja-JP":"日本語","jv-ID":"Basa Jawa","ka-GE":"ქართული","kk-KZ":"Қазақша",km:"ភាសាខ្មែរ","km-KH":"ភាសាខ្មែរ",kab:"Taqbaylit",kn:"ಕನ್ನಡ","kn-IN":"ಕನ್ನಡ (India)",ko:"한국어","ko-KR":"한국어 (韩国)",ku:"Kurdî","ku-TR":"Kurdî",la:"Latin","la-VA":"Latin",lb:"Lëtzebuergesch","li-NL":"Lèmbörgs",lt:"Lietuvių","lt-LT":"Lietuvių",lv:"Latviešu","lv-LV":"Latviešu",mai:"मैथिली, মৈথিলী","mg-MG":"Malagasy",mk:"Македонски","mk-MK":"Македонски (Македонски)",ml:"മലയാളം","ml-IN":"മലയാളം","mn-MN":"Монгол",mr:"मराठी","mr-IN":"मराठी",ms:"Bahasa Melayu","ms-MY":"Bahasa Melayu",mt:"Malti","mt-MT":"Malti",my:"ဗမာစကာ",nb:"Norsk (bokmål)","nb-NO":"Norsk (bokmål)",ne:"नेपाली","ne-NP":"नेपाली",nl:"Nederlands","nl-BE":"Nederlands (België)","nl-NL":"Nederlands (Nederland)","nn-NO":"Norsk (nynorsk)",no:"Norsk",oc:"Occitan","or-IN":"ଓଡ଼ିଆ",pa:"ਪੰਜਾਬੀ","pa-IN":"ਪੰਜਾਬੀ (ਭਾਰਤ ਨੂੰ)",pl:"Polski","pl-PL":"Polski","ps-AF":"پښتو",pt:"Português","pt-BR":"Português (Brasil)","pt-PT":"Português (Portugal)","qu-PE":"Qhichwa","rm-CH":"Rumantsch",ro:"Română","ro-RO":"Română",ru:"Русский","ru-RU":"Русский","sa-IN":"संस्कृतम्","se-NO":"Davvisámegiella","si-LK":"පළාත",sk:"Slovenčina","sk-SK":"Slovenčina (Slovakia)",sl:"Slovenščina","sl-SI":"Slovenščina","so-SO":"Soomaaliga",sq:"Shqip","sq-AL":"Shqip",sr:"Српски","sr-RS":"Српски (Serbia)",su:"Basa Sunda",sv:"Svenska","sv-SE":"Svenska",sw:"Kiswahili","sw-KE":"Kiswahili",ta:"தமிழ்","ta-IN":"தமிழ்",te:"తెలుగు","te-IN":"తెలుగు",tg:"забо́ни тоҷикӣ́","tg-TJ":"тоҷикӣ",th:"ภาษาไทย","th-TH":"ภาษาไทย (ประเทศไทย)",tl:"Filipino","tl-PH":"Filipino",tlh:"tlhIngan-Hol",tr:"Türkçe","tr-TR":"Türkçe","tt-RU":"татарча",uk:"Українська","uk-UA":"Українська",ur:"اردو","ur-PK":"اردو",uz:"O'zbek","uz-UZ":"O'zbek",vi:"Tiếng Việt","vi-VN":"Tiếng Việt","xh-ZA":"isiXhosa",yi:"ייִדיש","yi-DE":"ייִדיש (German)",zh:"中文","zh-HANS":"中文简体","zh-HANT":"中文繁體","zh-CN":"中文(中国)","zh-HK":"中文(香港)","zh-SG":"中文(新加坡)","zh-TW":"中文(台灣)","zu-ZA":"isiZulu"},Eh=c(Object.keys(Th)),Sh=Eh.next();!Sh.done;Sh=Eh.next()){var Ah=Sh.value;Th[Ah.toLowerCase()]=Th[Ah]}function Ih(t,n){if(t.lineBreak)return"\n";if(t.nestedCues.length)return t.nestedCues.map((function(n){return Ih(n,t)})).join("");if(!t.payload)return t.payload;var e=[],i=t.fontWeight>=Ye,r=t.fontStyle==Je,a=t.textDecoration.includes(ti);i&&e.push(["b"]);r&&e.push(["i"]);a&&e.push(["u"]);r=t.color;""==r&&n&&(r=n.color);i="";(r=Mh(r))&&(i+="."+r);r=t.backgroundColor;""==r&&n&&(r=n.backgroundColor);(n=Mh(r))&&(i+=".bg_"+n);i&&e.push(["c",i]);return e.reduceRight((function(t,n){var e=c(n);n=e.next().value;e=e.next().value;return"<"+n+(void 0===e?"":e)+">"+t+"</"+n+">"}),t.payload)}function Mh(t){t=t.toLowerCase();var n=t.replace(/\s/g,"").match(/^rgba?\((\d+),(\d+),(\d+),?([^,\s)]+)?/i);n?t="#"+(parseInt(n[1],10)|256).toString(16).slice(1)+(parseInt(n[2],10)|256).toString(16).slice(1)+(parseInt(n[3],10)|256).toString(16).slice(1):t.startsWith("#")&&7<t.length&&(t=t.slice(0,7));switch(t){case"white":case"#fff":case"#ffffff":return"white";case"lime":case"#0f0":case"#00ff00":return"lime";case"cyan":case"#0ff":case"#00ffff":return"cyan";case"red":case"#f00":case"#ff0000":return"red";case"yellow":case"#ff0":case"#ffff00":return"yellow";case"magenta":case"#f0f":case"#ff00ff":return"magenta";case"blue":case"#00f":case"#0000ff":return"blue";case"black":case"#000":case"#000000":return"black"}return null}function xh(t,n){var e=[];t=c(Nh(t));for(var i=t.next();!i.done;i=t.next())if(i=i.value,i.isContainer)e.push.apply(e,l(xh(i.nestedCues,i)));else{var r=i.clone();r.nestedCues=[];r.payload=Ih(i,n);e.push(r)}return e}function Nh(t){var n=[];t=c(t);for(var e=t.next(),i={};!e.done;i={eg:void 0},e=t.next())i.eg=e.value,n.some(function(t){return function(n){return Pe(t.eg,n)}}(i))||n.push(i.eg);return n}function Ch(t){function n(t){for(var n=5381,e=t.length;e;)n=33*n^t.charCodeAt(--e);return(n>>>0).toString()}if(t.startTime>=t.endTime)return null;var e=new VTTCue(t.startTime,t.endTime,t.payload);e.id=n(t.startTime.toString())+n(t.endTime.toString())+n(t.payload);e.lineAlign=t.lineAlign;e.positionAlign=t.positionAlign;t.size&&(e.size=t.size);try{e.align=t.textAlign}catch(t){}"center"==t.textAlign&&"center"!=e.align&&(e.align="middle");"vertical-lr"==t.writingMode?e.vertical="lr":"vertical-rl"==t.writingMode&&(e.vertical="rl");1==t.lineInterpretation&&(e.snapToLines=false);null!=t.line&&(e.line=t.line);null!=t.position&&(e.position=t.position);return e}function Ph(t,n){var e=xh(n),i=[];n=t.cues?Array.from(t.cues):[];e=c(e);for(var r=e.next(),a={};!r.done;a={md:void 0},r=e.next())a.md=r.value,!n.some(function(t){return function(n){return n.startTime==t.md.startTime&&n.endTime==t.md.endTime&&n.text==t.md.payload?true:false}}(a))&&a.md.payload&&(r=Ch(a.md))&&i.push(r);n=i.slice().sort((function(t,n){return t.startTime!=n.startTime?t.startTime-n.startTime:t.endTime!=n.endTime?t.endTime-n.startTime:"line"in VTTCue.prototype?i.indexOf(n)-i.indexOf(t):i.indexOf(t)-i.indexOf(n)}));n=c(n);for(e=n.next();!e.done;e=n.next())t.addCue(e.value)}function Rh(t,n){var e=false;"disabled"===t.mode&&(e=true,t.mode="hidden");for(var i=0;i<t.cues.length;){var r=t.cues[i];n(r)?t.removeCue(r):i++}e&&(t.mode="disabled")}function Dh(t){var n=this;this.i=t;this.l=new it;this.j=null;this.h=new Map;this.g=-1;this.s=false;this.o=null;this.B=function(){n.l.Ja(n.i,"textchanged",n.m);n.l.Ja(n.j.textTracks,"change",n.A);for(var t=c(n.h.values()),e=t.next();!e.done;e=t.next())e.value.remove();n.h.clear();n.g=-1;n.j=null};this.m=function(){var t=new Map,e=n.i.Cc();e=c(e);for(var i=e.next();!i.done;i=e.next()){i=i.value;if(n.h.has(i.id)){var r=n.h.get(i.id);i.active||"disabled"===r.track.mode||(r.track.mode="disabled");n.h.delete(i.id)}else{r=n.j.ownerDocument.createElement("track");r.kind=Lh(i);var a=r,u=void 0;if(i.label)u=i.label;else if(i.language)if(i.language in Th)u=Th[i.language];else{var s=qi(i.language);s in Th&&(u=Th[s]+" ("+i.language+")")}u||(u=i.originalTextId,i.language&&i.language!==i.originalTextId&&(u+=" ("+i.language+")"));a.label=u;i.language in Th&&(r.srclang=i.language);"CHROMIUM"===ft().Da()&&(r.src="data:,WEBVTT");r.track.mode="disabled";n.j.appendChild(r)}t.set(i.id,r);i.active&&(n.g=i.id)}e=c(n.h.values());for(i=e.next();!i.done;i=e.next())i.value.remove();-1<n.g&&(t.has(n.g)?(e=t.get(n.g).track,"disabled"===e.mode&&(e.mode=n.s?"showing":"hidden")):n.g=-1);n.h=t};this.A=function(){if(!n.o){var t=n.j;n.o=new Di((function(){n.o=null;if(n.j===t){var e=-1,i=false;if(n.h.has(n.g)){var r=n.h.get(n.g);"showing"===r.track.mode?(e=n.g,i=true):"hidden"===r.track.mode&&(e=n.g)}if(!i)for(i=c(n.h),r=i.next();!r.done;r=i.next()){var a=c(r.value);r=a.next().value;a=a.next().value;if("showing"===a.track.mode){e=r;break}else 0>e&&"hidden"===a.track.mode&&(e=r)}i=c(n.h);for(r=i.next();!r.done;r=i.next())a=c(r.value),r=a.next().value,a=a.next().value,r!==e&&"disabled"!==a.track.mode&&(a.track.mode="disabled");n.g!==e&&(n.g=e,-1<e&&n.i.fh({id:e}));n.i.kh(-1<e&&"showing"===n.h.get(e).track.mode)}})).ha(0)}};this.l.D(t,"loaded",(function(){return n.enableTextDisplayer()}));this.enableTextDisplayer()}i=Dh.prototype;i.configure=function(){};i.remove=function(t,n){if(this.i)this.h.has(this.g)&&Rh(this.h.get(this.g).track,(function(e){return e.startTime<n&&e.endTime>t}));else return false;return true};i.append=function(t){this.h.has(this.g)&&Ph(this.h.get(this.g).track,t)};i.destroy=function(){this.i&&(this.j&&this.B(),this.i=null);this.l&&(this.l.release(),this.l=null);return Promise.resolve()};i.isTextVisible=function(){return this.s};i.setTextVisibility=function(t){this.s=t;if(this.h.has(this.g)){var n=this.h.get(this.g).track;"disabled"!==n.mode&&(t=t?"showing":"hidden",n.mode!==t&&(n.mode=t))}else if(this.i&&3===this.i.m)if(n=Array.from(this.i.h.textTracks).filter((function(t){return["captions","subtitles","forced"].includes(t.kind)})),t){t=null;n=c(n);for(var e=n.next();!e.done;e=n.next())if(e=e.value,"showing"===e.mode){t=null;break}else t||"hidden"!==e.mode||(t=e);t&&(t.mode="showing")}else for(t=c(n),n=t.next();!n.done;n=t.next())n=n.value,"showing"===n.mode&&(n.mode="hidden")};i.setTextLanguage=function(){};i.enableTextDisplayer=function(){!this.j&&this.i&&2===this.i.m&&(this.j=this.i.h,this.l.za(this.i,"unloading",this.B),this.l.D(this.i,"textchanged",this.m),this.l.D(this.j.textTracks,"change",this.A),this.m())};function Lh(t){var n=ft();return t.forced&&"WEBKIT"===n.Da()?"forced":"caption"===t.kind||t.roles&&t.roles.some((function(t){return t.includes("transcribes-spoken-dialog")}))&&t.roles.some((function(t){return t.includes("describes-music-and-sound")}))?"captions":"subtitles"}q("shaka.text.NativeTextDisplayer",Dh);Dh.prototype.enableTextDisplayer=Dh.prototype.enableTextDisplayer;Dh.prototype.setTextLanguage=Dh.prototype.setTextLanguage;Dh.prototype.setTextVisibility=Dh.prototype.setTextVisibility;Dh.prototype.isTextVisible=Dh.prototype.isTextVisible;Dh.prototype.destroy=Dh.prototype.destroy;Dh.prototype.append=Dh.prototype.append;Dh.prototype.remove=Dh.prototype.remove;Dh.prototype.configure=Dh.prototype.configure;function Oh(t,n){vt("SimpleTextDisplayer","Please migrate to NativeTextDisplayer");this.h=t;this.i=n;this.g=null;t=c(Array.from(this.h.textTracks));for(n=t.next();!n.done;n=t.next())n=n.value,"metadata"!==n.kind&&"chapters"!==n.kind&&(n.mode="disabled",n.label==this.i&&(this.g=n));this.g&&(this.g.mode="hidden")}i=Oh.prototype;i.configure=function(){};i.remove=function(t,n){if(!this.g)return false;Rh(this.g,(function(e){return e.startTime<n&&e.endTime>t}));return true};i.append=function(t){this.g&&Ph(this.g,t)};i.destroy=function(){this.g&&(Rh(this.g,(function(){return true})),this.g.mode="disabled");this.g=this.h=null;return Promise.resolve()};i.isTextVisible=function(){return this.g?"showing"==this.g.mode:false};i.setTextVisibility=function(t){t&&!this.g&&_h(this);this.g&&(this.g.mode=t?"showing":"hidden")};i.setTextLanguage=function(){};i.enableTextDisplayer=function(){_h(this)};function _h(t){t.h&&!t.g&&(t.g=t.h.addTextTrack("subtitles",t.i),t.g.mode="hidden")}q("shaka.text.SimpleTextDisplayer",Oh);Oh.prototype.enableTextDisplayer=Oh.prototype.enableTextDisplayer;Oh.prototype.setTextLanguage=Oh.prototype.setTextLanguage;Oh.prototype.setTextVisibility=Oh.prototype.setTextVisibility;Oh.prototype.isTextVisible=Oh.prototype.isTextVisible;Oh.prototype.destroy=Oh.prototype.destroy;Oh.prototype.append=Oh.prototype.append;Oh.prototype.remove=Oh.prototype.remove;Oh.prototype.configure=Oh.prototype.configure;function Uh(){}i=Uh.prototype;i.configure=function(){};i.remove=function(){};i.append=function(){};i.destroy=function(){};i.isTextVisible=function(){return false};i.setTextVisibility=function(){};i.setTextLanguage=function(){};i.enableTextDisplayer=function(){};q("shaka.text.StubTextDisplayer",Uh);Uh.prototype.enableTextDisplayer=Uh.prototype.enableTextDisplayer;Uh.prototype.setTextLanguage=Uh.prototype.setTextLanguage;Uh.prototype.setTextVisibility=Uh.prototype.setTextVisibility;Uh.prototype.isTextVisible=Uh.prototype.isTextVisible;Uh.prototype.destroy=Uh.prototype.destroy;Uh.prototype.append=Uh.prototype.append;Uh.prototype.remove=Uh.prototype.remove;Uh.prototype.configure=Uh.prototype.configure;function Bh(n,e){var i=this;this.m=false;this.h=[];this.j=n;this.o=e;this.B=this.s=null;this.g=document.createElement("div");this.g.classList.add("shaka-text-container");this.g.style.textAlign="center";this.g.style.display="flex";this.g.style.flexDirection="column";this.g.style.alignItems="center";this.g.style.justifyContent="flex-end";this.A=new Di((function(){i.j.paused||zh(i)}));Hh(this);this.l=new Map;this.i=new it;this.i.D(document,"fullscreenchange",(function(){zh(i,true)}));this.i.D(this.j,"seeking",(function(){zh(i,true)}));this.i.D(this.j,"ratechange",(function(){Hh(i)}));this.i.D(this.j,"resize",(function(){var t=i.j,n=t.videoWidth;t=t.videoHeight;n&&t?i.s=n/t:i.s=null}));this.C=null;"ResizeObserver"in t&&(this.C=new ResizeObserver((function(){zh(i,true)})),this.C.observe(this.g));this.F=new Map}i=Bh.prototype;i.configure=function(t){this.B=t;Hh(this);zh(this,true)};i.append=function(t){var n=[].concat(l(this.h));t=c(Nh(t));for(var e=t.next(),i={};!e.done;i={fg:void 0},e=t.next())i.fg=e.value,n.some(function(t){return function(n){return Pe(n,t.fg)}}(i))||this.h.push(i.fg);this.h.length&&Hh(this);zh(this)};i.destroy=function(){if(!this.g)return Promise.resolve();this.g.parentElement&&this.o.removeChild(this.g);this.g=null;this.m=false;this.h=[];this.A&&(this.A.stop(),this.A=null);this.l.clear();this.i&&(this.i.release(),this.i=null);this.C&&(this.C.disconnect(),this.C=null);return Promise.resolve()};i.remove=function(t,n){if(!this.g)return false;var e=this.h.length;this.h=this.h.filter((function(e){return e.startTime<t||e.endTime>=n}));zh(this,e>this.h.length);this.h.length||Hh(this);return true};i.isTextVisible=function(){return this.m};i.setTextVisibility=function(t){(this.m=t)?(this.g.parentElement||this.o.appendChild(this.g),zh(this,true)):this.g.parentElement&&this.o.removeChild(this.g)};i.setTextLanguage=function(t){t&&"und"!=t?this.g.setAttribute("lang",t):this.g.setAttribute("lang","")};i.enableTextDisplayer=function(){};function Hh(t){t.A&&(t.h.length?t.A.Ga((t.B?t.B.captionsUpdatePeriod:.25)/Math.max(1,Math.abs(t.j.playbackRate))):t.A.stop())}function Fh(t,n){for(;null!=n;){if(n==t.g)return true;n=n.parentElement}return false}function Vh(t,n,e,i,r){var a=false,u=[],s=[];n=c(n);for(var o=n.next();!o.done;o=n.next()){o=o.value;r.push(o);var f=t.l.get(o),l=o.startTime<=i&&o.endTime>i,h=f?f.$i:null;f&&(u.push(f.gg),f.Wc&&u.push(f.Wc),l||(a=true,t.l.delete(o),f=null));l&&(s.push(o),f?Fh(t,h)||(a=true):(Xh(t,o,r),f=t.l.get(o),h=f.$i,a=true));0<o.nestedCues.length&&h&&Vh(t,o.nestedCues,h,i,r);r.pop()}if(a){i=c(u);for(r=i.next();!r.done;r=i.next())r=r.value,r.parentElement&&r.parentElement.removeChild(r);s.sort((function(t,n){return t.startTime!=n.startTime?t.startTime-n.startTime:t.endTime-n.endTime}));s=c(s);for(i=s.next();!i.done;i=s.next())i=t.l.get(i.value),i.Wc?(i.Wc.contains(e)&&i.Wc.removeChild(e),e.appendChild(i.Wc),i.Wc.appendChild(i.gg)):e.appendChild(i.gg)}}function zh(t,n){if(t.g){var e=t.j.currentTime;if(!t.m||(void 0===n?0:n)){n=c(t.F.values());for(var i=n.next();!i.done;i=n.next())Ks(i.value);Ks(t.g);t.l.clear();t.F.clear()}t.m&&Vh(t,t.h,t.g,e,[])}}function Xh(t,n,e){var i=1<e.length,r=i?"span":"div";n.lineBreak&&(r="br");n.rubyTag&&(r=n.rubyTag);i=!i&&0<n.nestedCues.length;var a=document.createElement(r);"br"!=r&&jh(t,a,n,e,i);e=null;if(n.region&&n.region.id){var u=n.region,s=t.s===4/3?2.5:1.9;e=u.id+"_"+u.width+"x"+u.height+(u.heightUnits==Dn?"%":"px")+"-"+u.viewportAnchorX+"x"+u.viewportAnchorY+(u.viewportAnchorUnits==Dn?"%":"px");if(t.F.has(e))e=t.F.get(e);else{r=document.createElement("span");var o=u.heightUnits==Dn?"%":"px",f=u.widthUnits==Dn?"%":"px",c=u.viewportAnchorUnits==Dn?"%":"px";r.id="shaka-text-region---"+e;r.classList.add("shaka-text-region");r.style.position="absolute";var l=u.height,h=u.width;2===u.heightUnits&&(l=5.33*u.height,o="%");2===u.widthUnits&&(h=u.width*s,f="%");r.style.height=l+o;r.style.width=h+f;2===u.viewportAnchorUnits?(s=u.viewportAnchorY/75*100,o=u.viewportAnchorX/(t.s===4/3?160:210)*100,s-=u.regionAnchorY*l/100,o-=u.regionAnchorX*h/100,r.style.top=s+"%",r.style.left=o+"%"):(r.style.top=u.viewportAnchorY-u.regionAnchorY*l/100+c,r.style.left=u.viewportAnchorX-u.regionAnchorX*h/100+c);0!==u.heightUnits&&0!==u.widthUnits&&0!==u.viewportAnchorUnits&&(u=Math.max(0,Math.min(100-(parseInt(r.style.width.slice(0,-1),10)||0),parseInt(r.style.left.slice(0,-1),10)||0)),r.style.top=Math.max(0,Math.min(100-(parseInt(r.style.height.slice(0,-1),10)||0),parseInt(r.style.top.slice(0,-1),10)||0))+"%",r.style.left=u+"%");r.style.display="flex";r.style.flexDirection="column";r.style.alignItems="center";r.style.justifyContent="before"==n.displayAlign?"flex-start":"center"==n.displayAlign?"center":"flex-end";t.F.set(e,r);e=r}}r=a;i&&(r=document.createElement("span"),r.classList.add("shaka-text-wrapper"),r.style.backgroundColor=n.backgroundColor,r.style.lineHeight="normal",a.appendChild(r));t.l.set(n,{gg:a,$i:r,Wc:e})}function qh(t){var n=t.direction,e=t.positionAlign;t=t.textAlign;return e!==Ue?e:"left"===t||"start"===t&&n===ze||"end"===t&&"rtl"===n?"line-left":"right"===t||"start"===t&&"rtl"===n||"end"===t&&n===ze?"line-right":"center"}function jh(t,n,e,i,r){var a=n.style,u=0==e.nestedCues.length,s=1<i.length;a.whiteSpace="pre-wrap";var o=e.payload.replace(/\s+$/g,(function(t){return" ".repeat(t.length)}));a.webkitTextStrokeColor=e.textStrokeColor;a.webkitTextStrokeWidth=e.textStrokeWidth;a.color=e.color;a.direction=e.direction;a.opacity=e.opacity;a.paddingLeft=Gh(e.linePadding,e,t.o);a.paddingRight=Gh(e.linePadding,e,t.o);a.textCombineUpright=e.textCombineUpright;a.textShadow=e.textShadow;if(e.backgroundImage)a.backgroundImage="url('"+e.backgroundImage+"')",a.backgroundRepeat="no-repeat",a.backgroundSize="contain",a.backgroundPosition="center",e.backgroundColor&&(a.backgroundColor=e.backgroundColor),a.width="100%",a.height="100%";else{if(e.nestedCues.length)var f=n;else f=document.createElement("span"),n.appendChild(f);e.border&&(f.style.border=e.border);r||((n=Kh(i,(function(t){return t.backgroundColor})))?f.style.backgroundColor=n:o&&(f.style.backgroundColor="rgba(0, 0, 0, 0.8)"));o&&(f.setAttribute("translate","no"),f.textContent=o)}if(s&&!i[i.length-1].isContainer)a.display="inline";else{a.display="flex";a.flexDirection="column";a.alignItems="center";if("left"==e.textAlign||"start"==e.textAlign)a.width="100%",a.alignItems="start";else if("right"==e.textAlign||"end"==e.textAlign)a.width="100%",a.alignItems="end";a.justifyContent="before"==e.displayAlign?"flex-start":"center"==e.displayAlign?"center":"flex-end"}u||(a.margin="0");a.fontFamily=e.fontFamily;a.fontWeight=e.fontWeight.toString();a.fontStyle=e.fontStyle;a.letterSpacing=e.letterSpacing;a.fontSize=Gh(e.fontSize,e,t.o,t.B?t.B.fontScaleFactor:1);i=e.line;null!=i&&(u=e.lineInterpretation,u==qe&&(u=1,s=16,t.s&&1>t.s&&(s=32),i=0>i?100+i/s*100:i/s*100),1==u&&(a.position="absolute",e.writingMode==Xe?(a.width="100%",e.lineAlign==je?a.top=i+"%":"end"==e.lineAlign&&(a.bottom=100-i+"%")):"vertical-lr"==e.writingMode?(a.height="100%",e.lineAlign==je?a.left=i+"%":"end"==e.lineAlign&&(a.right=100-i+"%")):(a.height="100%",e.lineAlign==je?a.right=i+"%":"end"==e.lineAlign&&(a.left=100-i+"%"))));a.lineHeight=e.lineHeight;t=qh(e);"line-left"==t?(a.cssFloat="left",null!==e.position&&(a.position="absolute",e.writingMode==Xe?(a.left=e.position+"%",a.width="auto"):a.top=e.position+"%")):"line-right"==t?(a.cssFloat="right",null!==e.position&&(a.position="absolute",e.writingMode==Xe?(a.right=100-e.position+"%",a.width="auto"):a.bottom=e.position+"%")):null!==e.position&&50!=e.position&&(a.position="absolute",e.writingMode==Xe?(a.left=e.position+"%",a.width="auto"):a.top=e.position+"%");a.textAlign=e.textAlign;a.textDecoration=e.textDecoration.join(" ");a.writingMode=e.writingMode;"writingMode"in document.documentElement.style&&a.writingMode==e.writingMode||(a.webkitWritingMode=e.writingMode);e.size&&(e.writingMode==Xe?a.width=e.size+"%":a.height=e.size+"%")}function Gh(t,n,e,i){i=void 0===i?1:i;var r=(r=new RegExp(/(\d*\.?\d+)([a-z]+|%+)/).exec(t))?{value:Number(r[1]),unit:r[2]}:null;if(!r)return t;t=r.unit;i*=r.value;switch(t){case"%":return i/100*e.clientHeight/n.cellResolution.rows+"px";case"c":return e.clientHeight*i/n.cellResolution.rows+"px";default:return i+t}}function Kh(t,n){for(var e=t.length-1;0<=e;e--){var i=n(t[e]);if(i||0===i)return i}return null}q("shaka.text.UITextDisplayer",Bh);Bh.prototype.enableTextDisplayer=Bh.prototype.enableTextDisplayer;Bh.prototype.setTextLanguage=Bh.prototype.setTextLanguage;Bh.prototype.setTextVisibility=Bh.prototype.setTextVisibility;Bh.prototype.isTextVisible=Bh.prototype.isTextVisible;Bh.prototype.remove=Bh.prototype.remove;Bh.prototype.destroy=Bh.prototype.destroy;Bh.prototype.append=Bh.prototype.append;Bh.prototype.configure=Bh.prototype.configure;function Wh(t,n){function e(t){for(var e=t,i=c(n),r=i.next();!r.done;r=i.next())r=r.value,r.end&&r.start<t&&(e+=r.end-r.start);t=Math.floor(e/3600);i=Math.floor(e/60%60);r=Math.floor(e%60);e=Math.floor(1e3*e%1e3);return(10>t?"0":"")+t+":"+(10>i?"0":"")+i+":"+(10>r?"0":"")+r+"."+(100>e?10>e?"00":"0":"")+e}var i=xh(t);t="WEBVTT\n\n";i=c(i);for(var r=i.next();!r.done;r=i.next())r=r.value,t+=e(r.startTime)+" --\x3e "+e(r.endTime)+function(t){var n=[];switch(t.textAlign){case"left":n.push("align:left");break;case"right":n.push("align:right");break;case Be:n.push("align:middle");break;case"start":n.push("align:start");break;case"end":n.push("align:end")}switch(t.writingMode){case"vertical-lr":n.push("vertical:lr");break;case"vertical-rl":n.push("vertical:rl")}return n.length?" "+n.join(" "):""}(r)+"\n",t+=r.payload+"\n\n";return t}q("shaka.text.WebVttGenerator",(function(){}));function $h(t,n){this.h=t;this.g=n;this.i=void 0;this.s=false;this.F=true;this.l=this.B=false;this.o=this.m=void 0;this.A=0;this.G=false;this.C=new it;this.j=null}$h.prototype.setMediaElement=function(t){this.j=t;td(this)};$h.prototype.configure=function(t){this.g=t};function Yh(t){t.s=false;t.F=true;t.B=false;t.l=false;t.m=0;t.o=0;t.A=0;t.G=false;t.j=null;t.C.Qa()}function Qh(t,n){t.l=n;t.l?t.i==yd?t.i=kd:t.i==Td&&(t.i=Ed):t.i==kd?t.i=yd:t.i==Ed&&(t.i=Td)}function Jh(t,n){if(t.g&&t.g.enabled&&t.g.version==bd&&t.j&&t.j.autoplay){var e=t.j.play();e&&e.then((function(){t.A=n})).catch((function(){t.A=0}))}}function Zh(t,n,e){try{if(!t.g.enabled)return n;var i=nd(t);t:{switch(e.toLowerCase()){case"audio/mp4":case"audio/webm":case"audio/ogg":case"audio/mpeg":case"audio/aac":case"audio/flac":case"audio/wav":var r=dd;break t;case"video/webm":case"video/mp4":case"video/mpeg":case"video/mp2t":r=pd;break t;case"application/x-mpegurl":case"application/vnd.apple.mpegurl":case"application/dash+xml":case"video/vnd.mpeg.dash.mpd":case"application/vnd.ms-sstr+xml":r=hd;break t}r=void 0}i.ot=r;i.su=true;var a=fd(i);return ld(n,a)}catch(t){return Q("CMCD_SRC_ERROR","Could not generate src CMCD data.",t),n}}function td(t){t.C.za(t.j,"play",(function(){t.m||(t.m=Date.now())}));t.C.za(t.j,"playing",(function(){t.o||(t.o=Date.now())}))}function nd(n){n.g.sessionId||(n.g.sessionId=t.crypto.randomUUID());return{v:n.g.version,sf:n.i,sid:n.g.sessionId,cid:n.g.contentId,mtp:n.h.getBandwidthEstimate()/1e3}}function ed(t,n,e){e=void 0===e?{}:e;var i=void 0===i?t.g.useHeaders:i;if(t.g.enabled)if(t=od(t,e),i)i=cd(t),Object.keys(i).length&&Object.assign(n.headers,i);else{var r=fd(t);r&&(n.uris=n.uris.map((function(t){return ld(t,r)})))}}function id(t,n){var e=t.g.includeKeys;return e.length?Object.keys(n).reduce((function(t,i){e.includes(i)&&(t[i]=n[i]);return t}),{}):n}function rd(t){if(0===t.type)return md;if(t=t.stream){var n=t.type;if("video"==n)return t.codecs&&t.codecs.includes(",")?pd:vd;if("audio"==n)return dd;if("text"==n)return"application/mp4"===t.mimeType?gd:wd}}function ad(t,n){n=t.h.Lb()[n];if(!n.length)return NaN;var e=t.h.getCurrentTime();return(t=n.find((function(t){return t.start<=e&&t.end>=e})))?1e3*(t.end-e):NaN}function ud(t,n){n=t.h.Lb()[n];if(!n.length)return 0;var e=t.h.getCurrentTime();return(t=n.find((function(t){return t.start<=e&&t.end>=e})))?1e3*(t.end-e):0}function sd(t,n){var e=t.h.Ob();if(!e.length)return NaN;t=e[0];e=c(e);for(var i=e.next();!i.done;i=e.next())i=i.value,"variant"===i.type&&i.bandwidth>t.bandwidth&&(t=i);switch(n){case vd:return t.videoBandwidth||NaN;case dd:return t.audioBandwidth||NaN;default:return t.bandwidth}}function od(t,n){n=void 0===n?{}:n;Object.assign(n,nd(t));n.pr=t.h.sb();var e=n.ot===vd||n.ot===pd;t.B&&e&&(n.bs=true,n.su=true,t.B=false);null==n.su&&(n.su=t.F);n.v===bd&&(t.h.V()&&(n.ltc=t.h.Se()),e=!t.G&&t.o&&t.m?t.o-(t.A||t.m):void 0,void 0!=e&&(n.msd=e,t.G=true));return id(t,n)}function fd(t){function n(t){return 100*e(t/100)}function e(t){return Math.round(t)}function i(t){return!Number.isNaN(t)&&null!=t&&""!==t&&false!==t}var r=[],a={br:e,d:e,bl:n,dl:n,mtp:n,nor:function(t){return encodeURIComponent(t)},rtp:n,tb:e},u=Object.keys(t||{}).sort();u=c(u);for(var s=u.next();!s.done;s=u.next()){s=s.value;var o=t[s];if(i(o)&&("v"!==s||1!==o)&&("pr"!=s||1!==o)){var f=a[s];f&&(o=f(o));f=typeof o;var l=void 0;l="string"===f&&"ot"!==s&&"sf"!==s&&"st"!==s?s+"="+JSON.stringify(o):"boolean"===f?s:"symbol"===f?s+"="+o.description:s+"="+o;r.push(l)}}return r.join(",")}function cd(t){var n=Object.keys(t),e={},i=["Object","Request","Session","Status"],r=[{},{},{},{}],a={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,ltc:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,msd:2,bs:3,rtp:3};n=c(n);for(var u=n.next();!u.done;u=n.next())u=u.value,r[null!=a[u]?a[u]:1][u]=t[u];for(t=0;t<r.length;t++)(a=fd(r[t]))&&(e["CMCD-"+i[t]]=a);return e}function ld(t,n){if(!n||t.includes("offline:"))return t;t=new bt(t);t.g.set("CMCD",n);return t.toString()}var hd="m",dd="a",vd="v",pd="av",md="i",wd="c",gd="tt",bd=2,yd="d",kd="ld",Td="h",Ed="lh";q("shaka.util.CmcdManager.StreamingFormat",{DASH:yd,Ll:kd,HLS:Td,Ml:Ed,$l:"s",OTHER:"o"});function Sd(t){this.h=t;this.g=null}i=Sd.prototype;i.configure=function(t){this.h=t};i.Wh=function(){return this.h.enabled&&this.h.applyMaximumSuggestedBitrate&&this.g&&this.g.has(Md)?1e3*this.g.get(Md):null};i.Uh=function(){return this.h.enabled&&this.g&&this.g.has(Id)?1e3*this.g.get(Id):null};i.Nj=function(){return this.h.enabled&&this.g&&this.g.has(xd)?this.g.get(xd):null};i.Oj=function(){return this.h.enabled&&this.g&&this.g.has(Nd)?this.g.get(Nd):null};i.getBandwidthEstimate=function(t){var n=this.Uh();if(!n)return t;var e=this.h.estimatedThroughputWeightRatio;return 0<e&&1>=e?t*(1-e)+n*e:t};function Ad(t){return t?"false"===t.toLowerCase()?false:/^[-0-9]/.test(t)?parseInt(t,10):t.replace(/["]+/g,""):true}q("shaka.util.CmsdManager",Sd);Sd.prototype.getBandwidthEstimate=Sd.prototype.getBandwidthEstimate;Sd.prototype.getRoundTripTime=Sd.prototype.Oj;Sd.prototype.getResponseDelay=Sd.prototype.Nj;Sd.prototype.getEstimatedThroughput=Sd.prototype.Uh;Sd.prototype.getMaxBitrate=Sd.prototype.Wh;var Id="etp",Md="mb",xd="rd",Nd="rtt";function Cd(){this.g=null;this.h=[]}function Pd(t,n){return _((function(e){if(1==e.g)return t.g?T(e,new Promise((function(n){return t.h.push(n)})),2):e.u(2);t.g=n;E(e)}))}Cd.prototype.release=function(){0<this.h.length?this.h.shift()():this.g=null};function Rd(n,e,i){e=void 0===e?null:e;na.call(this);var r=this;this.m=ep;this.h=null;this.ue=e;this.ba=false;this.ze=new it;this.me=new it;this.j=new it;this.Yb=new it;this.td=new it;this.F=this.G=this.C=this.I=null;this.Ae=0;this.ia=new Cd;this.N=this.nc=this.W=this.i=this.qc=this.H=this.l=this.je=this.S=this.Eh=this.oa=this.L=this.Za=this.wa=this.ke=this.P=this.Ba=this.K=this.eb=null;this.Ka=false;this.Ta=this.s=null;this.se=1e9;this.ye=[];this.ab=[];this.Sf=-1;this.g=Av(this);this.Uf=Bl();this.U=null;this.Ce=-1;this.Xb=null;this.va={width:Infinity,height:Infinity};this.re=new Pu(this.g,this.va,null);this.we=[];this.A=null;this.M=this.g.adaptationSetCriteriaFactory();this.M.configure({language:this.g.preferredAudioLanguage,role:this.g.preferredVariantRole,channelCount:0,Dc:this.g.preferredVideoHdrLevel,spatialAudio:this.g.preferSpatialAudio,videoLayout:this.g.preferredVideoLayout,Ic:this.g.preferredAudioLabel,Bd:this.g.preferredVideoLabel,codecSwitchingStrategy:this.g.mediaSource.codecSwitchingStrategy,audioCodec:"",Dd:"",De:0,preferredAudioCodecs:this.g.preferredAudioCodecs,preferredAudioChannelCount:this.g.preferredAudioChannelCount});this.ud=this.g.preferredTextLanguage;this.qe=this.g.preferredTextRole;this.pe=this.g.preferForcedSubs;this.oe=[];i&&i(this);this.L=lv(this);this.oa=new Sd(this.g.cmsd);this.I=iv(this);this.wd=this.ka=this.ya=this.B=null;this.Wf=false;this.Tf=[];this.Vf=new Di((function(){return _((function(t){if(1==t.g)return r.ka?T(t,r.dc(r.wd,true),3):t.u(0);if(4!=t.g)return T(t,r.load(r.ka),4);r.Wf?r.wd.pause():r.wd.play();r.ka=null;r.Wf=false;E(t)}))}));sp&&(this.B=sp(),this.B.configure(this.g.ads),this.td.D(this.B,"ad-content-pause-requested",(function(t){var n;return _((function(e){if(1==e.g){r.Vf.stop();if(r.ka)return e.u(0);r.wd=r.h;r.Wf=r.Ud();n=t.saveLivePosition||false;return T(e,r.Oh(true,n),3)}r.ka=e.h;E(e)}))})),this.td.D(this.B,"ad-content-resume-requested",(function(t){t=t.offset||0;if(r.ka){var n=r.ka;n.m&&t&&("number"===typeof n.m?n.m+=t:n.m.setTime(n.m.getTime()+1e3*t))}r.Vf.ha(.1)})),this.td.D(this.B,"ad-content-attach-requested",(function(){return _((function(t){return r.h||!r.wd?t.u(0):T(t,r.dc(r.wd,true),0)}))})));op&&(this.ya=op(this),this.ya.configure(this.g.queue));this.ze.D(t,"online",(function(){Gv(r);r.$g()}));this.ve=new Di((function(){for(var t=Date.now()/1e3,n=false,e=true,i=c(r.i.variants),a=i.next();!a.done;a=i.next())a=a.value,0<a.disabledUntilTime&&a.disabledUntilTime<=t&&(a.disabledUntilTime=0,n=true),0<a.disabledUntilTime&&(e=false);e&&r.ve.stop();n&&Lv(r,false,void 0,false,false)}));this.Oa=null;n&&(vt("Player w/ mediaElement","Please migrate from initializing Player with a mediaElement; use the attach method instead."),this.dc(n,true));this.o=null}g(Rd,na);function Dd(t){null!=t.S&&(gn(t.S),t.S.release(),t.S=null)}function Ld(t,n,e){e||n.lcevc.enabled?(Dd(t),null==t.S&&(t.S=new mn(t.h,t.Eh,n.lcevc,e),t.G&&(t.G.M=t.S))):Dd(t)}function Od(t,n){return new Jr(t,n)}i=Rd.prototype;i.destroy=function(){var t=this,n;return _((function(e){switch(e.g){case 1:if(t.m==np)return e.return();Dd(t);n=t.detach();t.m=np;return T(e,n,2);case 2:return T(e,t.jg(),3);case 3:t.ze&&(t.ze.release(),t.ze=null);t.me&&(t.me.release(),t.me=null);t.j&&(t.j.release(),t.j=null);t.Yb&&(t.Yb.release(),t.Yb=null);t.td&&(t.td.release(),t.td=null);t.Ta=null;t.g=null;t.A=null;t.ue=null;t.L=null;t.oa=null;if(!t.I){e.u(4);break}return T(e,t.I.destroy(),5);case 5:t.I=null;case 4:t.s&&(t.s.release(),t.s=null),t.ya&&(t.ya.destroy(),t.ya=null),na.prototype.release.call(t),E(e)}}))};function _d(t,n){up.set(t,n)}function Ud(t,n){t.dispatchEvent(Od("onstatechange",(new Map).set("state",n)))}i.dc=function(t,n){n=void 0===n?true:n;var e=this,i,r,a;return _((function(u){switch(u.g){case 1:if(e.m==np)throw new zt(2,7,7e3);i=e.h&&e.h==t;if(!e.h||e.h==t){u.u(2);break}return T(u,e.detach(),2);case 2:return T(u,Bd(e,"attach"),4);case 4:if(u.h)return u.return();S(u,5,6);i||(Ud(e,"attach"),r=function(){var t=Yv(e,false);t&&Kv(e,t)},e.me.D(t,"error",r),e.h=t,e.L&&e.L.setMediaElement(t));ft();if(!n||!qy()||e.G){u.u(6);break}return T(u,Gd(e),6);case 6:x(u);e.ia.release();N(u,0);break;case 5:return a=M(u),T(u,e.detach(),10);case 10:throw a}}))};i.ej=function(t){this.Eh=t};i.detach=function(t){t=void 0===t?false:t;var n=this;return _((function(e){if(1==e.g){if(n.m==np)throw new zt(2,7,7e3);return T(e,n.vc(false,t),2)}if(3!=e.g)return T(e,Bd(n,"detach"),3);if(e.h)return e.return();try{n.h&&(n.me.Qa(),n.h=null),Ud(n,"detach"),n.B&&!t&&n.B.release()}finally{n.ia.release()}E(e)}))};function Bd(t,n){var e;return _((function(i){return 1==i.g?(e=++t.Ae,T(i,Pd(t.ia,n),2)):e!=t.Ae?(t.ia.release(),i.return(true)):i.return(false)}))}i.vc=function(n,e){n=void 0===n?true:n;e=void 0===e?false:e;var i=this,r,a,u,s,o,f,l,h,d,v,p,m,w;return _((function(g){switch(g.g){case 1:return i.m!=np&&(i.m=ep),T(g,Bd(i,"unload"),2);case 2:if(g.h)return g.return();A(g,3);i.Ka=false;Ud(i,"unload");Dd(i);r=i.oe.map((function(t){return t()}));i.oe=[];return T(g,Promise.all(r),5);case 5:i.dispatchEvent(Od("unloading"));i.ke&&(i.ke.release(),i.ke=null);i.wa&&(i.wa.release(),i.wa=null);i.Za&&(i.Za.release(),i.Za=null);i.h&&(i.j.Qa(),i.Yb.Qa());i.ve.stop();i.eb&&(i.eb.release(),i.eb=null);i.Ba&&(i.Ba.stop(),i.Ba=null);if(!i.H){g.u(6);break}return T(g,i.H.stop(),7);case 7:i.H=null,i.qc=null;case 6:if(!i.s){g.u(8);break}return T(g,i.s.stop(),8);case 8:if(!i.l){g.u(10);break}return T(g,i.l.destroy(),11);case 11:i.l=null;case 10:i.K&&(i.K.release(),i.K=null);i.F&&(i.F.release(),i.F=null);if("webkit"!==t.shakaMediaKeysPolyfill||!i.C){g.u(12);break}return T(g,i.C.destroy(),13);case 13:i.C=null;case 12:if(!i.G){g.u(14);break}return T(g,i.G.destroy(),15);case 15:i.G=null;case 14:if(i.B&&!e)i.B.onAssetUnload();i.ka&&!e&&(i.ka.destroy(),i.ka=null);e||i.Vf.stop();i.L&&Yh(i.L);i.oa&&(i.oa.g=null);if(!i.o){g.u(16);break}return T(g,i.o.destroy(),17);case 17:i.o=null;case 16:i.ba=false;if(i.h){a=c(i.Tf);for(u=a.next();!u.done;u=a.next())s=u.value,s.src.startsWith("blob:")&&URL.revokeObjectURL(s.src),s.remove();i.Tf=[];Gs(i.h)&&i.h.load()}if(!i.C){g.u(18);break}return T(g,i.C.destroy(),19);case 19:i.C=null;case 18:i.Oa&&i.W!=i.Oa.kd()&&(i.Oa.o||i.Oa.destroy(),i.Oa=null);i.W=null;i.nc=null;i.P=null;if(i.i){o=c(i.i.variants);for(f=o.next();!f.done;f=o.next())for(l=f.value,h=c([l.audio,l.video]),d=h.next();!d.done;d=h.next())(v=d.value)&&v.segmentIndex&&v.segmentIndex.release();p=c(i.i.textStreams);for(m=p.next();!m.done;m=p.next())w=m.value,w.segmentIndex&&w.segmentIndex.release()}i.g&&i.g.streaming.clearDecodingCache&&(Ar.clear(),Fr.clear());i.i=null;i.A=new Wl;i.Dh=null;i.Xb=null;i.U=null;i.Ce=-1;i.ye=[];i.ab=[];i.Sf=-1;i.I&&i.I.Kh();xv(i);case 3:x(g);i.ia.release();N(g,4);break;case 4:ft();if(n&&qy()&&!i.G&&i.h)return T(g,Gd(i),0);g.u(0)}}))};i.al=function(t){this.N=t};i.load=function(t,n,e){n=void 0===n?null:n;var i=this,r,a,u,s,o,f,l,h,d,v,p,m,w,g;return _((function(b){switch(b.g){case 1:if(i.m==np)throw new zt(2,7,7e3);r=null;a="";if(t instanceof th){if(t.o)throw new zt(2,7,7006);r=t;a=r.kd()||""}else a=t||"";return T(b,Pd(i.ia,"load"),2);case 2:i.ia.release();if(!i.h)throw new zt(2,7,7002);if(!i.W){b.u(3);break}i.W=a;return T(b,i.vc(false),3);case 3:u=++i.Ae;s=function(){return _((function(t){if(1==t.g)return i.Ae==u?t.u(0):r?T(t,r.destroy(),3):t.u(3);throw new zt(2,7,7e3)}))};o=function(t,n){return _((function(e){switch(e.g){case 1:return A(e,2),T(e,Pd(i.ia,n),4);case 4:return T(e,s(),5);case 5:return T(e,t(),6);case 6:return T(e,s(),7);case 7:r&&i.g&&(r.g=i.g);case 2:x(e),i.ia.release(),N(e,0)}}))};S(b,5,6);null==n&&r&&(n=r.getStartTime());i.N=n;i.Ka=false;i.dispatchEvent(Od("loading"));if(r){e=r.W;b.u(8);break}if(e){b.u(8);break}return T(b,o((function(){return _((function(t){if(1==t.g)return T(t,Xd(i,a),2);e=t.h;E(t)}))}),"guessMimeType_"),8);case 8:f=!!r;if(r){ih(r,i);i.A=r.getStats();b.u(11);break}return T(b,Vd(i,a,n,e,true,i.g),12);case 12:(r=b.h)?(r.B=false,ih(r,i),i.A=r.getStats(),r.start(),r.s.catch((function(){}))):i.A=new Wl;case 11:l=!r;h=Date.now()/1e3;i.A=r?r.getStats():new Wl;i.W=a;i.nc=e||null;xv(i);d=function(){var t=i.Lb(),n={start:0,end:0};if(t.total.length){n.start=Infinity;t=c(t.total);for(var e=t.next();!e.done;e=t.next())e=e.value,e.start<n.start&&(n.start=e.start),e.end>n.end&&(n.end=e.end)}return n};i.wa=new oc(d);i.wa.addEventListener("regionadd",(function(t){tv(i,t.region,"metadataadded")}));if(l)return T(b,o((function(){return _((function(t){return T(t,$d(i,e),0)}))}),"initializeSrcEqualsDrmInner_"),23);i.Za=new oc(d);return T(b,o((function(){return _((function(t){if(1==t.g)return T(t,Promise.race([r.va,r.s]),2);i.qc=r.G;var n=r;n.wa=true;i.H=n.l;i.i=r.Bg();E(t)}))}),"waitForFinish"),15);case 15:if(i.G){b.u(16);break}return T(b,o((function(){return _((function(t){return T(t,Gd(i),0)}))}),"initializeMediaSourceEngineInner_"),16);case 16:return i.i&&i.i.textStreams.length&&(i.o.enableTextDisplayer?i.o.enableTextDisplayer():vt("Text displayer w/ enableTextDisplayer",'Text displayer should have a "enableTextDisplayer" method!')),T(b,o((function(){return _((function(t){return T(t,r.s,0)}))}),"waitForFinish"),18);case 18:i.g=r.getConfiguration();i.re=r.F;i.H&&i.H.setMediaElement&&i.h&&i.H.setMediaElement(i.h);i.ke=ah(r);i.je=r.Ta;if(v=r.A)i.M=v;f&&i.h&&"AUDIO"===i.h.nodeName&&(Hd(i),i.configure("manifest.disableVideo",true));if(r.i){b.u(19);break}return T(b,o((function(){return _((function(t){return T(t,lh(r,i.h),0)}))}),"drmEngine_.init"),19);case 19:return i.C=uh(r),T(b,o((function(){return _((function(t){return T(t,i.C.dc(i.h),0)}))}),"drmEngine_.attach"),21);case 21:return!(p=r.C)||i.Ta&&i.Ta==p||(i.s=rh(r),i.Ta=r.C,"function"!=typeof i.s.setMediaElement&&(vt("AbrManager w/o setMediaElement","Please use an AbrManager with setMediaElement function."),i.s.setMediaElement=function(){}),"function"!=typeof i.s.setCmsdManager&&(vt("AbrManager w/o setCmsdManager","Please use an AbrManager with setCmsdManager function."),i.s.setCmsdManager=function(){}),"function"!=typeof i.s.trySuggestStreams&&(vt("AbrManager w/o trySuggestStreams","Please use an AbrManager with trySuggestStreams function."),i.s.trySuggestStreams=function(){})),m=sh(r),w=r.K,T(b,o((function(){return _((function(t){return T(t,Wd(i,h,w,m),0)}))}),"loadInner_"),22);case 22:eh(r);i.nc&&ft().Vi()&&bi(i.nc)&&Co(i.G,i.W,i.nc);b.u(14);break;case 23:return T(b,o((function(){return _((function(t){return T(t,Yd(i,h,e),0)}))}),"srcEqualsInner_"),14);case 14:i.dispatchEvent(Od("loaded"));case 6:x(b);if(!r){b.u(25);break}return T(b,r.destroy(),25);case 25:i.Oa=null;N(b,0);break;case 5:g=M(b);if(!g||7e3==g.code){b.u(27);break}return T(b,i.vc(false),27);case 27:throw g}}))};function Hd(t){for(var n=c(t.i.variants),e=n.next();!e.done;e=n.next())e=e.value,e.video&&(e.video.closeSegmentIndex(),e.video=null),e.bandwidth=e.audio&&e.audio.bandwidth?e.audio.bandwidth:0;t.i.variants=t.i.variants.filter((function(t){return t.audio}))}i.Xk=function(t,n){t=void 0===t?true:t;n=void 0===n?false:n;var e=this,i;return _((function(r){return 1==r.g?T(r,Fd(e),2):3!=r.g?(i=r.h,T(r,e.vc(t,n),3)):r.return(i)}))};i.Oh=function(t,n){t=void 0===t?false:t;n=void 0===n?false:n;var e=this,i;return _((function(r){return 1==r.g?T(r,Fd(e,n),2):3!=r.g?(i=r.h,T(r,e.detach(t),3)):r.return(i)}))};function Fd(t,n){n=void 0===n?false:n;var e,i;return _((function(r){if(1==r.g){e=null;if(!(t.i&&t.H&&t.qc&&t.W&&t.g))return r.u(2);i=t.h.currentTime;t.V()&&!n&&(i=null);return T(r,zd(t,t.W,i,t.nc,t.g,true,false,false),3)}if(2!=r.g){e=r.h;t.we.push(e);t.H&&t.H.setMediaElement&&t.H.setMediaElement(null);var a=e,u=t.H,s=t.qc;a.h=t.i;a.l=u;a.G=s;a=e;u=t.Ta;a.j=t.s;a.C=u;e.A=t.M;e.start();t.i=null;t.H=null;t.qc=null;t.s=null;t.Ta=null}return r.return(e)}))}i.preload=function(t,n,e,i){n=void 0===n?null:n;var r=this,a,u;return _((function(s){if(1==s.g)return a=Av(r),Hl(a,i||r.g,Av(r)),T(s,Vd(r,t,n,e,false,a),2);(u=s.h)?u.start():Kv(r,new zt(2,7,7005));return s.return(u)}))};i.jg=function(){var t=this,n,e,i,r;return _((function(a){n=[];e=c(t.we);for(i=e.next();!i.done;i=e.next())r=i.value,r.o||n.push(r.destroy());t.we=[];return T(a,Promise.all(n),0)}))};function Vd(t,n,e,i,r,a){r=void 0===r?false:r;var u,s,o,f;return _((function(c){if(1==c.g)return i?c.u(2):T(c,Xd(t,n),3);2!=c.g&&(i=c.h);if(qd(t,i))return c.return(null);u=a||t.g;s=false;o=true;r&&(t.s&&t.Ta==u.abrFactory&&(o=false),t.h&&"AUDIO"===t.h.nodeName&&(s=true));f=zd(t,n,e,i||null,u,!r,s,o);f=r?f.then((function(t){t.B=false;return t})):f.then((function(n){t.we.push(n);return n}));return c.return(f)}))}function zd(t,n,e,i,r,a,u,s){a=void 0===a?true:a;u=void 0===u?false:u;s=void 0===s?true:s;var o,f,l,h,d,v,p,m,w,g,b,y,k,S,A;return _((function(I){if(1==I.g){o=null;f=Kn(r);u&&(f.manifest.disableVideo=true);l=function(){return o.S&&o.o?null:o};h=function(){return l()?l().getConfiguration():t.g};if(Infinity!=t.va.width||Infinity!=t.va.height||t.g.ignoreHardwareResolution)return I.u(2);d=ft();return T(I,d.fc(),3)}2!=I.g&&(v=I.h,t.va.width=v.width,t.va.height=v.height);p=new Pu(f,t.va,null);m={networkingEngine:t.I,filter:function(t){var n,e;return _((function(i){if(1==i.g)return T(i,Ru(p,t),2);if(4!=i.g){n=i.h;if(!n)return i.u(0);e=Od("trackschanged");return T(i,Promise.resolve(),4)}o.dispatchEvent(e);E(i)}))},makeTextStreamsForClosedCaptions:function(n){return Iv(t,n)},onTimelineRegionAdded:function(t){fc(o.H,t)},onEvent:function(t){return o.dispatchEvent(t)},onError:function(t){return o.onError(t)},isLowLatencyMode:function(){return h().streaming.lowLatencyMode},updateDuration:function(){t.l&&o.S&&t.l.updateDuration()},newDrmInfo:function(t){var n=o.i,e=n?n.g:null;e&&n.A&&Ou(p,e.keySystem,t)},onManifestUpdated:function(){var n=(new Map).set("isLive",t.V());o.dispatchEvent(Od("manifestupdated",n));nh(o,false,(function(){if(t.B)t.B.onManifestUpdated(t.V())}))},getBandwidthEstimate:function(){return t.s.getBandwidthEstimate()},onMetadata:function(n,e,i,r){var a=n;if("com.apple.hls.interstitial"==n&&(a="com.apple.quicktime.HLS",n={startTime:e,endTime:i,values:r},t.B))t.B.onHLSInterstitialMetadata(t,t.h,n);r=c(r);n=r.next();for(var u={};!n.done;u={Tg:void 0},n=r.next())u.Tg=n.value,"ID"!=u.Tg.name&&nh(o,false,function(n){return function(){nv(t,e,i,a,n.Tg)}}(u))},disableStream:function(n){return t.disableStream(n,t.g.streaming.maxDisabledTime)},addFont:function(n,e){return t.addFont(n,e)}};w=new oc((function(){return t.Ra()}));w.addEventListener("regionadd",(function(n){var e=n.region;Wv(t,"timelineregionadded",e,o);nh(o,false,(function(){t.B&&(t.B.onDashTimedMetadata(e),t.B.onDASHInterstitialMetadata(t,t.h,e))}))}));g=null;f.streaming.observeQualityChanges&&(g=new ec((function(){return t.Lb()})),g.addEventListener("qualitychange",(function(n){$v(t,n.quality,n.position)})),g.addEventListener("audiotrackchange",(function(n){$v(t,n.quality,n.position,true)})));b=true;y={pc:t.I,onError:function(t){return o.onError(t)},nf:function(n){nh(o,true,(function(){if(t.C)t:{var e=n,i=Od("keystatuschanged");t.dispatchEvent(i);var r=Object.keys(e);1==r.length&&""==r[0]&&(r=["00"],e={"00":e[""]});i=1==r.length&&"00"==r[0];var a=false;if(r.length){r=t.keySystem();for(var u=ka(t.g.drm.clearKeys),s=c(t.i.variants),o=s.next();!o.done;o=s.next()){o=o.value;var f=[];o.audio&&f.push(o.audio);o.video&&f.push(o.video);f=c(f);for(var l=f.next();!l.done;l=f.next()){var h=l.value;l=o.allowedByKeySystem;if(h.keyIds.size)if(h.drmInfos.length&&!u.size){h=c(h.drmInfos);for(var d=h.next();!d.done;d=h.next())if(d=d.value,d.keyIds.size&&d.keySystem==r){o.allowedByKeySystem=true;d=c(d.keyIds);for(var v=d.next();!v.done;v=d.next())if(v=v.value,(v=e[i?"00":v])||t.C.F)o.allowedByKeySystem=o.allowedByKeySystem&&!!v&&!Uu.includes(v)}}else for(o.allowedByKeySystem=true,h=c(h.keyIds),d=h.next();!d.done;d=h.next())if(d=d.value,(d=e[i?"00":d])||t.C.F)o.allowedByKeySystem=o.allowedByKeySystem&&!!d&&!Uu.includes(d);l!=o.allowedByKeySystem&&(a=true)}}}if(a&&(Bv(t),!Dv(t)))break t;(e=t.l.o)&&!e.allowedByKeySystem&&Lv(t)}}))},onExpirationUpdated:function(t,n){var e=Od("expirationupdated");o.dispatchEvent(e);if((e=o.l)&&e.onExpirationUpdated)e.onExpirationUpdated(t,n)},onEvent:function(n){o.dispatchEvent(n);"drmsessionupdate"==n.type&&b&&(b=false,n=Date.now()/1e3-o.Ka,(t.A||o.getStats()).m=n,t.S&&gn(t.S))}};k=iv(t,l);ua(t.I,k);S=function(){return t.ed(y)};A={config:f,nk:m,Bk:w,Ak:g,ed:S,lk:p,networkingEngine:k,dj:a,cj:s};o=new th(n,i,e,A);return I.return(o)}))}function Xd(t,n){var e,i,r;return _((function(a){if(1==a.g)return e=t.g.manifest.retryParameters,T(a,yh(n,t.I,e),2);i=a.h;"application/x-mpegurl"==i&&(r=ft(),"WEBKIT"===r.Da()&&(i="application/vnd.apple.mpegurl"));return a.return(i)}))}function qd(t,n){if(!qy(ft()))return true;if(n){if(""==(t.h||Ws()).canPlayType(n))return false;if(!qy(ft())||!zu.has(n))return true;if(bi(n))return"WEBKIT"===ft().Da()&&(t.g.drm.servers["com.apple.fps"]||t.g.drm.servers["com.apple.fps.1_0"])?t.g.streaming.useNativeHlsForFairPlay:t.g.streaming.preferNativeHls;if("application/dash+xml"===n||"video/vnd.mpeg.dash.mpd"===n)return t.g.streaming.preferNativeDash}return false}function jd(t){var n=t.g.textDisplayFactory;if(t.Dh!==n){var e=t.o;t.o=n();t.o.configure?t.o.configure(t.g.textDisplayer):vt("Text displayer w/ configure",'Text displayer should have a "configure" method!');t.o.setTextLanguage||vt("Text displayer w/ setTextLanguage",'Text displayer should have a "setTextLanguage" method!');e?(t.o.setTextVisibility(e.isTextVisible()),e.destroy().catch((function(){}))):t.o.setTextVisibility(t.ba);t.G&&sf(t.G,t.o);t.Dh=n;t.l&&Bc(t.l)}else t.o&&t.o.configure&&t.o.configure(t.g.textDisplayer)}function Gd(t){var n,e,i;return _((function(r){if(1==r.g)return ft(),Ud(t,"media-source"),t.g.mediaSource.useSourceElements&&Gs(t.h),jd(t),n=cv(t.h,t.o,{Dj:function(){return t.keySystem()},onMetadata:function(n,e,i){n=c(n);for(var r=n.next();!r.done;r=n.next())if(r=r.value,r.data&&"number"==typeof r.cueTime&&r.frames){var a=r.cueTime+e,u=i;u&&a>u&&(u=a);for(var s=c(r.frames),o=s.next();!o.done;o=s.next())nv(t,a,u,"org.id3",o.value);if(t.B)t.B.onHlsTimedMetadata(r,a)}},vk:function(n){t.Za&&fc(t.Za,{schemeIdUri:n.schemeIdUri,startTime:n.startTime,endTime:n.endTime,id:String(n.id),emsg:n})},onEvent:function(n){return t.dispatchEvent(n)},xk:function(){t.H&&t.H.update&&t.H.update()}},t.S,t.g.mediaSource),e=t.g.manifest,i=e.segmentRelativeVttTiming,n.Ka=i,T(r,n.K,2);t.G=n;E(r)}))}function Kd(t,n,e){function i(){return Cv(t)}t.j.D(n,"playing",i);t.j.D(n,"pause",i);t.j.D(n,"ended",i);t.j.D(n,"ratechange",(function(){var n=t.h.playbackRate;0!=n&&(t.K&&(t.K.set(n),t.m==ip&&t.s.playbackRateChanged(n),Nv(t,n)),n=Od("ratechange"),t.dispatchEvent(n))}));n.remote&&(t.j.D(n.remote,"connect",(function(){t.l&&"connected"==n.remote.state&&zv(t);Bv(t)})),t.j.D(n.remote,"connecting",(function(){return Bv(t)})),t.j.D(n.remote,"disconnect",(function(){return _((function(e){if(1==e.g)return t.l&&"disconnected"==n.remote.state?T(e,ll(t.l),3):e.u(2);2!=e.g&&zv(t);Bv(t);E(e)}))})));n.audioTracks&&(t.j.D(n.audioTracks,"addtrack",(function(){return Bv(t)})),t.j.D(n.audioTracks,"removetrack",(function(){return Bv(t)})),t.j.D(n.audioTracks,"change",(function(){return Bv(t)})));n.videoTracks&&(t.j.D(n.videoTracks,"addtrack",(function(){return Bv(t)})),t.j.D(n.videoTracks,"removetrack",(function(){return Bv(t)})),t.j.D(n.videoTracks,"change",(function(){return Bv(t)})));if(n.textTracks){var r=function(){t.m===rp&&t.o instanceof Dh&&zv(t);Bv(t)};t.j.D(n.textTracks,"addtrack",(function(n){if(n.track)switch(n=n.track,n.kind){case"metadata":Zd(t,n);break;case"chapters":ev(t,n);break;default:r()}}));t.j.D(n.textTracks,"removetrack",r);t.j.D(n.textTracks,"change",r);"keep"!==t.g.streaming.crossBoundaryStrategy&&(t.j.D(n,"waiting",(function(){t.l&&dl(t.l)})),t.j.D(n,"timeupdate",(function(){t.l&&dl(t.l)})))}"none"!=n.preload&&t.j.za(n,"loadedmetadata",(function(){t.A.F=Date.now()/1e3-e}))}function Wd(n,e,i,r){var a,u,s,o,f,l,h,d,v,p,m,w,g,b,y,k,S,A,I,M,x,N,C,P,R,D,L,O;return _((function(U){switch(U.g){case 1:Ud(n,"load");a=n.h;n.K=new Jf({Te:function(){return a.playbackRate},Oc:function(){return a.defaultPlaybackRate},jh:function(t){a.playbackRate=t},mi:function(t){a.currentTime+=t}});Kd(n,a,e);"onchange"in t.screen&&n.j.D(t.screen,"change",(function(){if(n.M.getConfiguration){var t=n.M.getConfiguration();"AUTO"==t.Dc?Dv(n):"AUTO"==n.g.preferredVideoHdrLevel&&n.g.abr.enabled&&(t.Dc="AUTO",n.M.configure(t),Dv(n))}}));u=false;s=c(n.i.variants);for(o=s.next();!o.done;o=s.next())f=o.value,(l=f.video&&f.video.dependencyStream)&&(u=bn(l));Ld(n,n.g,u);n.ud=n.g.preferredTextLanguage;n.qe=n.g.preferredTextRole;n.pe=n.g.preferForcedSubs;Qv(n.i.presentationTimeline,n.g.playRangeStart,n.g.playRangeEnd);n.s.init((function(t,e,i){n.i&&n.l&&t!=n.l.o&&Ov(n,t,true,void 0===e?false:e,void 0===i?0:i)}));n.s.setMediaElement(a);n.s.setCmsdManager(n.oa);n.l=hv(n);n.l.configure(n.g.streaming);n.m=ip;n.dispatchEvent(Od("streaming"));h=i;case 2:(v=n.l.o)||h||(h=Dv(n)?n.s.chooseVariant():null);p=[];d=v||h;m=c([d.video,d.audio]);for(w=m.next();!w.done;w=m.next())(g=w.value)&&!g.segmentIndex&&(p.push(g.createSegmentIndex()),g.dependencyStream&&p.push(g.dependencyStream.createSegmentIndex()));if(!(0<p.length)){U.u(4);break}return T(U,Promise.all(p),4);case 4:if(!d||0!=d.disabledUntilTime){U.u(2);break}if(n.H&&n.H.onInitialVariantChosen)n.H.onInitialVariantChosen(d);n.i.isLowLatency&&(n.g.streaming.lowLatencyMode?n.configure(n.Uf):Y("Low-latency live stream detected, but low-latency streaming mode is not enabled in Shaka Player. Set streaming.lowLatencyMode configuration to true, and see https://bit.ly/3clctcj for details."));n.L&&(Qh(n.L,n.i.isLowLatency&&n.g.streaming.lowLatencyMode),Jh(n.L,1e3*e));Qv(n.i.presentationTimeline,n.g.playRangeStart,n.g.playRangeEnd);Rc(n.l,n.g.playRangeStart,n.g.playRangeEnd);n.Ka=true;n.dispatchEvent(Od("canupdatestarttime"));b=function(t){n.F=rv(n,t);n.eb=av(n,t);sv(n,a,false)};n.g.streaming.startAtSegmentBoundary||(y=n.N,null==y&&n.i.startTime&&(y=n.i.startTime),b(y));if(v){U.u(7);break}if(!n.g.streaming.startAtSegmentBoundary){U.u(8);break}k=n.i.presentationTimeline;n.N instanceof Date&&(A=k.m||k.i,I=n.N.getTime()/1e3-A,null!=I&&(S=I));null==S&&(S="number"===typeof n.N?n.N:n.h.currentTime);null==n.N&&n.i.startTime&&(S=n.i.startTime);M=k.Vb();x=k.Eb();S<M?S=M:S>x&&(S=x);return T(U,Mv(h,S),9);case 9:N=U.h,b(N);case 8:Ov(n,h,true,false,0);case 7:return n.F.ready(),C=n.Cc().find((function(t){return t.active})),C||((P=yr(n.i.textStreams,n.ud,n.qe,n.pe)[0]||null)&&Kl(n.A.h,P,true),h&&(P?(Sr(h.audio,P,n.g)&&(n.ba=true),n.ba&&n.o.setTextVisibility(true)):(n.ba=false,n.o.setTextVisibility(false)),Xv(n)),P&&(n.g.streaming.alwaysStreamText||n.Jg())&&(Uc(n.l,P),jv(n))),T(U,n.l.start(r),10);case 10:n.g.abr.enabled&&(n.s.enable(),qv(n));Bv(n);Dv(n);n.i.variants.some((function(t){return t.primary}));if((R=n.V())&&(n.g.streaming.liveSync&&n.g.streaming.liveSync.enabled||n.i.serviceDescription||n.g.streaming.liveSync.panicMode)||n.g.streaming.vodDynamicPlaybackRate)D=function(){return Pv(n)},n.j.D(a,"timeupdate",D);R||(L=function(){return Rv(n)},n.j.D(a,"timeupdate",L),Rv(n),n.i.nextUrl&&(0<n.g.streaming.preloadNextUrlWindow&&(O=function(){var t;return _((function(e){if(1==e.g){t=n.Ra().end-n.h.currentTime;if(isNaN(t)||!(t<=n.g.streaming.preloadNextUrlWindow))return e.u(0);n.j.Ja(a,"timeupdate",O);return T(e,n.preload(n.i.nextUrl),4)}n.Oa=e.h;E(e)}))},n.j.D(a,"timeupdate",O)),n.j.D(a,"ended",(function(){n.load(n.Oa||n.i.nextUrl)}))));if(n.B)n.B.onManifestUpdated(R);E(U)}}))}function $d(t,n){var e,i,r,a,u;return _((function(s){return 1==s.g?(e=dn,i=Date.now()/1e3,r=true,t.C=t.ed({pc:t.I,onError:function(n){Kv(t,n)},nf:function(){},onExpirationUpdated:function(){var n=Od("expirationupdated");t.dispatchEvent(n)},onEvent:function(n){t.dispatchEvent(n);"drmsessionupdate"==n.type&&r&&(r=false,t.A.m=Date.now()/1e3-i)}}),t.C.configure(t.g.drm),a={id:0,language:"und",disabledUntilTime:0,primary:false,audio:null,video:null,bandwidth:100,allowedByApplication:true,allowedByKeySystem:true,decodingInfos:[]},u={id:0,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:n?wi(n):"",codecs:n?gi(n):"",encrypted:true,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:e.xa,primary:false,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:false,channelsCount:null,audioSamplingRate:null,spatialAudio:false,closedCaptions:null,accessibilityPurpose:null,external:false,fastSwitching:false,fullMimeTypes:new Set,isAudioMuxedInVideo:false,baseOriginalId:null},u.fullMimeTypes.add(li(u.mimeType,u.codecs)),n.startsWith("audio/")?(u.type=e.ea,a.audio=u):a.video=u,t.C.ba=true,T(s,za(t.C,[a],[]),2)):T(s,t.C.dc(t.h),0)}))}function Yd(t,n,e){var i,r,a,u,s,o,f,l,h,d,v,p;return _((function(m){switch(m.g){case 1:Ud(t,"src-equals");i=t.h;t.F=new Uf(i);r=false;t.oe.push((function(){r=true}));t.dispatchEvent(Od("canupdatestarttime"));null!=t.N&&t.F.Rf(t.N);t.eb=uv(t,t.N||0);t.K=new Jf({Te:function(){return i.playbackRate},Oc:function(){return i.defaultPlaybackRate},jh:function(t){i.playbackRate=t},mi:function(t){i.currentTime+=t}});sv(t,i,true);i.textTracks&&(jd(t),a=function(n){if(!(t.o instanceof Dh)){var e=gv(t).find((function(t){return"disabled"!==t.mode}));e&&(e.mode=n?"showing":"hidden");t.o instanceof Oh&&(e=bv(t))&&(e.mode=!n&&t.o.isTextVisible()?"showing":"hidden")}},t.j.D(i,"enterpictureinpicture",(function(){return a(true)})),t.j.D(i,"leavepictureinpicture",(function(){return a(false)})),i.remote?(t.j.D(i.remote,"connect",(function(){return a(false)})),t.j.D(i.remote,"connecting",(function(){return a(false)})),t.j.D(i.remote,"disconnect",(function(){return a(false)}))):"webkitCurrentPlaybackTargetIsWireless"in i&&t.j.D(i,"webkitcurrentplaybacktargetiswirelesschanged",(function(){return a(false)})),u=i,u.webkitSupportsFullscreen&&t.j.D(u,"webkitpresentationmodechanged",(function(){return a("inline"!==u.webkitPresentationMode)})));Kd(t,i,n);s=Zh(t.L,t.W,e);!s.includes("#t=")&&(0<t.g.playRangeStart||isFinite(t.g.playRangeEnd))&&(s+="#t=",0<t.g.playRangeStart&&(s+=t.g.playRangeStart),isFinite(t.g.playRangeEnd)&&(s+=","+t.g.playRangeEnd));if(!t.G){m.u(2);break}return T(m,t.G.destroy(),3);case 3:t.G=null;case 2:return Gs(i),i.src=s,o=ft(),"TV"==o.La()&&i.load(),"none"!=i.preload&&!i.autoplay&&bi(e)&&"WEBKIT"===o.Da()&&i.load(),t.m=rp,t.dispatchEvent(Od("streaming")),f=new qr,xf(i,HTMLMediaElement.HAVE_METADATA,t.j,(function(){t.F.ready();f.resolve()})),l=function(){return new Promise((function(n){var e=new Di(n);t.j.D(i.textTracks,"change",(function(){return e.ha(.5)}));e.ha(.5)}))},xf(i,HTMLMediaElement.HAVE_CURRENT_DATA,t.j,(function(){var n,e,i,a,u;return _((function(s){if(1==s.g)return T(s,l(),2);if(r)return s.return();Qd(t);n=gv(t);n.some((function(t){return"showing"===t.mode}))&&(t.ba=true,t.o.setTextVisibility(true));if(!(t.o instanceof Dh))for(n.length&&(t.o.enableTextDisplayer?t.o.enableTextDisplayer():vt("Text displayer w/ enableTextDisplayer",'Text displayer should have a "enableTextDisplayer" method')),e=false,i=c(n),a=i.next();!a.done;a=i.next())u=a.value,"disabled"!==u.mode&&(e?(u.mode="disabled",Y("Found more than one enabled text track, disabling it",u)):(wv(t,u),e=true));Jd(t);E(s)}))})),i.error?f.reject(Yv(t)):"none"==i.preload&&(Y('With <video preload="none">, the browser will not load anything until play() is called. We are unable to measure load latency in a meaningful way, and we cannot provide track info yet. Please do not use preload="none" with Shaka Player.'),f.resolve()),t.j.za(i,"error",(function(){f.reject(Yv(t))})),T(m,Ui(t.g.streaming.loadTimeout,f),4);case 4:if((h=t.V())&&(t.g.streaming.liveSync&&t.g.streaming.liveSync.enabled||t.g.streaming.liveSync.panicMode)||t.g.streaming.vodDynamicPlaybackRate)d=function(){return Pv(t)},t.j.D(i,"timeupdate",d);h||(v=function(){return Rv(t)},t.j.D(i,"timeupdate",v),Rv(t));t.B&&(t.B.onManifestUpdated(h),h&&(p=t.Ra().end,t.j.D(i,"progress",(function(){var n=t.Ra().end;p!=n&&(t.B.onManifestUpdated(t.V()),p=n)}))));t.Ka=true;E(m)}}))}function Qd(t){var n=t.g.preferredAudioLanguage;""!=n&&t.Gi(n,t.g.preferredVariantRole)}function Jd(t){var n=t.g.preferredTextLanguage;""!=n&&t.eh(n,t.g.preferredTextRole,t.g.preferForcedSubs)}function Zd(t,n){if("metadata"==n.kind){n.mode="hidden";t.j.D(n,"cuechange",(function(){if(n.activeCues)for(var e=c(n.activeCues),i=e.next();!i.done;i=e.next())if(i=i.value,nv(t,i.startTime,i.endTime,i.type,i.value),t.B)t.B.onCueMetadataChange(i.value);if(n.cues){e=[];i=c(n.cues);for(var r=i.next(),a={};!r.done;a={xc:void 0},r=i.next())a.xc=r.value,"com.apple.quicktime.HLS"==a.xc.type&&null!=a.xc.startTime&&(r=e.find(function(t){return function(n){return n.startTime==t.xc.startTime&&n.endTime==t.xc.endTime}}(a)),r||(r={startTime:a.xc.startTime,endTime:a.xc.endTime,values:[]},e.push(r)),r.values.push(a.xc.value));e=c(e);for(i=e.next();!i.done;i=e.next())i=i.value,i.values.some((function(t){return"X-ASSET-URI"==t.key||"X-ASSET-LIST"==t.key}))&&t.B&&(i.values.push({key:"CUE",description:"",data:0!=i.startTime||t.V()?"ONCE":"ONCE,PRE",mimeType:null,pictureType:null}),t.B.onHLSInterstitialMetadata(t,t.h,i))}}));var e=new Di((function(){var n=yv(t);n=c(n);for(var e=n.next();!e.done;e=n.next())e.value.mode="hidden"})).Hb().ha(.5);t.oe.push((function(){e.stop()}))}}function tv(t,n,e){n=(new Map).set("startTime",n.startTime).set("endTime",n.endTime).set("metadataType",n.schemeIdUri).set("payload",n.payload);t.dispatchEvent(Od(e,n))}function nv(t,n,e,i,r){t.wa&&(n={schemeIdUri:i,startTime:n,endTime:e||Infinity,id:"",payload:r},n.id=JSON.stringify(n),fc(t.wa,n))}function ev(t,n){if(n&&"chapters"==n.kind){n.mode="hidden";var e=new Di((function(){n.mode="hidden"})).Hb().ha(.5);t.oe.push((function(){e.stop()}))}}i.Fk=function(){for(var t=this.ia;t.g;)t.release()};i.ed=function(t){return new Ha(t)};function iv(t,n){function e(e){n()?n().dispatchEvent(e):t.dispatchEvent(e)}function i(t){n()?nh(n(),true,t):t()}n||(n=function(){return null});var r=new ra((function(e,i,r,a,u){var s=n()?n().j:t.s;s&&s.segmentDownloaded(e,i,r,a,u)}),(function(n,r,a){r=(new Map).set("headers",n).set("request",r).set("requestType",a);e(Od("downloadheadersreceived",r));i((function(){if(t.oa){var e=t.oa;if(e.h.enabled){var i=n["cmsd-static"];if(i)try{var r=new Map,a=i.split(",");for(i=0;i<a.length;i++){var u=a[i].split("=");r.set(u[0],Ad(u[1]))}}catch(t){}if(r=n["cmsd-dynamic"]){try{var s=new Map,o=r.split(";");for(r=1;r<o.length;r++){var f=o[r].split("=");s.set(f[0],Ad(f[1]))}var c=s}catch(t){c=null}c&&(e.g=c)}}}}))}),(function(t,n){t=(new Map).set("request",t).set("response",n);e(Od("downloadcompleted",t))}),(function(t,n,i,r){t=(new Map).set("request",t).set("error",n).set("httpResponseCode",i).set("aborted",r);e(Od("downloadfailed",t))}),(function(n,e,r){i((function(){var i=t.L,a=r;a=void 0===a?{}:a;if(i.g.enabled)if("HEAD"===e.method)ed(i,e);else switch(n){case 0:try{if(i.g.enabled){if(a.type){t:{switch(a.type){case 4:var u=i.l?kd:yd;break t;case 3:case 2:u=i.l?Ed:Td;break t;case 5:u="s";break t}u=void 0}i.i=u}ed(i,e,{ot:hd,su:!i.s})}}catch(t){Q("CMCD_MANIFEST_ERROR","Could not generate manifest CMCD data.",t)}break;case va:try{if(i.g.enabled){var s=e.uris[0],o=a.segment;u=0;o&&(u=o.endTime-o.startTime);var f={d:1e3*u,st:i.h.V()?"l":"v"};f.ot=rd(a);var c=f.ot===vd||f.ot===dd||f.ot===pd||f.ot===gd,l=a.stream;if(l){var h=i.h.sb();if(c&&(f.bl=ad(i,l.type),f.ot!==gd)){var d=ud(i,l.type);f.dl=h?d/Math.abs(h):d}l.bandwidth&&(f.br=l.bandwidth/1e3);if(l.segmentIndex&&o){var v=l.segmentIndex.Ub(o.endTime,true,0>h);if(v){var p=v.next().value;if(p&&p!=o){if(s&&!Bn(o.O(),p.O())){var m=p.O()[0],w=new URL(m),g=new URL(s);if(w.origin!==g.origin)var b=m;else{for(var y=w.pathname.split("/").slice(1),k=g.pathname.split("/").slice(1,-1);y[0]===k[0];)y.shift(),k.shift();for(;k.length;)k.shift(),y.unshift("..");b=y.join("/")}f.nor=b}if((p.startByte||p.endByte)&&(o.startByte!=p.startByte||o.endByte!=p.endByte)){var T=p.startByte+"-";p.endByte&&(T+=p.endByte);f.nrr=T}}}var E=i.h.sb()||1,S=ud(i,l.type)||500,A=l.bandwidth;var I=A?A*(o.endTime-o.startTime)/1e3/(S/E/1e3)*i.g.rtpSafetyFactor:NaN;isNaN(I)||(f.rtp=I)}}c&&f.ot!==gd&&(f.tb=sd(i,f.ot)/1e3);ed(i,e,f)}}catch(t){Q("CMCD_SEGMENT_ERROR","Could not generate segment CMCD data.",t)}break;case 2:case 5:case 6:ed(i,e,{ot:"k"});break;case 4:ed(i,e,{ot:"o"})}}))}),(function(e,i,r,a){(e=n()?n().l:t.H)&&e.banLocation&&e.banLocation(a)}),(function(e,i){if(i.data){i=i.data.byteLength;var r=n()?n().getStats():t.A;r&&(Jl(r,i),0===e&&(r.ei=i))}}));r.configure(t.g.networking);return r}function rv(t,n){return new Ff(t.h,t.i,t.g.streaming,n,(function(){t.eb&&nc(t.eb,true);t.l&&t.l.Xc();t.P&&fv(t)}),(function(n){return t.dispatchEvent(n)}))}function av(t,n){var e=t.V()||"number"===typeof n&&0<n;n=new ph(t.ke,e);n.addEventListener("enter",(function(n){Wv(t,"timelineregionenter",n.region)}));n.addEventListener("exit",(function(n){Wv(t,"timelineregionexit",n.region)}));n.addEventListener("skip",(function(n){var e=n.region;n.seeking||(Wv(t,"timelineregionenter",e),Wv(t,"timelineregionexit",e))}));var i=new ph(t.wa,e);i.addEventListener("enter",(function(n){tv(t,n.region,"metadata")}));e=new ph(t.Za,e);e.addEventListener("enter",(function(n){n=(new Map).set("detail",n.region.emsg);t.dispatchEvent(Od("emsg",n))}));var r=new tc(t.h);r.g.add(n);r.g.add(i);r.g.add(e);t.je&&r.g.add(t.je);return r}function uv(t,n){n=new ph(t.wa,n instanceof Date||0<n);n.addEventListener("enter",(function(n){tv(t,n.region,"metadata")}));var e=new tc(t.h);e.g.add(n);return e}function sv(t,n,e){t.P=new xu;t.P.g=Nu;ov(t);xv(t);t.Ba=new Di((function(){fv(t)}));t.g.streaming.rebufferingGoal&&t.Ba.Ga(.25);t.j.D(n,"waiting",(function(){return fv(t)}));t.j.D(n,"canplaythrough",(function(){return fv(t)}));t.j.D(n,"playing",(function(){return fv(t)}));t.j.D(n,"seeked",(function(){return fv(t)}));e&&(t.j.D(n,"stalled",(function(){return fv(t)})),t.j.D(n,"progress",(function(){return fv(t)})),t.j.D(n,"timeupdate",(function(){return fv(t)})))}function ov(t){var n=t.g.streaming.rebufferingGoal;t.P.i.set(Cu,Math.min(.5,n/2)).set(Nu,n)}function fv(t){var n=t.G?_o(t.G):false,e=t.Ud()||n||t.F.ai(),i=Vs(t.h.buffered,t.h.currentTime);n=t.P;var r=n.i.get(n.g),a=n.g;e=e||i>=r&&0<i?Cu:Nu;n.g=e;(a=a!=e)&&e===Cu&&(n.h=Date.now());a&&xv(t)}function cv(t,n,e,i,r){return new xo(t,n,e,r,i)}function lv(t){return new $h({getBandwidthEstimate:function(){return t.s?t.s.getBandwidthEstimate():NaN},Lb:function(){return t.Lb()},getCurrentTime:function(){return t.h?t.h.currentTime:0},sb:function(){return t.sb()},Nb:function(){return t.Nb()},Ob:function(){return t.Ob()},V:function(){return t.V()},Se:function(){return t.Se()}},t.g.cmcd)}function hv(t){return new Cc(t.i,{Pc:function(){return t.F?t.F.Be():0},getBandwidthEstimate:function(){return t.s.getBandwidthEstimate()},sb:function(){return t.sb()},video:t.h,Z:t.G,pc:t.I,onError:function(n){return Kv(t,n)},onEvent:function(n){return t.dispatchEvent(n)},pf:function(n,e,i){var r=n.startTime;n=n.endTime;e=e.type;if(e!=hn){if(t.F){t.F.oi();var a=Bo(t.G,e);!t.V()&&t.h.paused&&!t.h.seeking&&null!=a&&0<a&&t.F.Be()<a&&t.F.Rf(a)}fv(t)}i=(new Map).set("start",r).set("end",n).set("contentType",e).set("isMuxed",i);t.dispatchEvent(Od("segmentappended",i))},wk:function(n,e){(e=e.od)&&t.je&&rc(t.je,e,n)},Ih:function(n,e){var i=t.C;if(i.h.parseInbandPsshEnabled&&!i.F&&["audio","video"].includes(n)){n=new Ua(Bt(e));e=0;for(var r=c(n.data),a=r.next();!a.done;a=r.next())e+=a.value.length;if(0==e)i=Promise.resolve();else{e=new Uint8Array(e);r=0;n=c(n.data);for(a=n.next();!a.done;a=n.next())a=a.value,e.set(a,r),r+=a.length;Ya(i,"cenc",e);i=i.m}}else i=Promise.resolve();return i},disableStream:function(n,e){return t.disableStream(n,e)}})}i.configure=function(t,n){2==arguments.length&&"string"==typeof t&&(t=gl(t,n));t.streaming&&"forceTransmuxTS"in t.streaming&&(vt("streaming.forceTransmuxTS configuration","Please Use mediaSource.forceTransmux instead."),t.mediaSource=t.mediaSource||{},t.mediaSource.mediaSource=t.streaming.forceTransmuxTS,delete t.streaming.forceTransmuxTS);t.streaming&&"forceTransmux"in t.streaming&&(vt("streaming.forceTransmux configuration","Please Use mediaSource.forceTransmux instead."),t.mediaSource=t.mediaSource||{},t.mediaSource.mediaSource=t.streaming.forceTransmux,delete t.streaming.forceTransmux);if(t.streaming&&"useNativeHlsOnSafari"in t.streaming){vt("streaming.useNativeHlsOnSafari configuration","Please Use streaming.useNativeHlsForFairPlay or streaming.preferNativeHls instead.");var e=ft();t.streaming.preferNativeHls=t.streaming.useNativeHlsOnSafari&&"WEBKIT"===e.Da();delete t.streaming.useNativeHlsOnSafari}t.streaming&&"boolean"==typeof t.streaming.liveSync&&(vt("streaming.liveSync","Please Use streaming.liveSync.enabled instead."),e=t.streaming.liveSync,t.streaming.liveSync={},t.streaming.liveSync.enabled=e);if(t.streaming&&!(t.streaming.liveSync&&"targetLatency"in t.streaming.liveSync)&&("liveSyncMinLatency"in t.streaming||"liveSyncMaxLatency"in t.streaming)){e=t.streaming.liveSyncMinLatency||0;var i=Math.abs((t.streaming.liveSyncMaxLatency||1)-e)/2;t.streaming.liveSync=t.streaming.liveSync||{};t.streaming.liveSync.targetLatency=e+i;t.streaming.liveSync.targetLatencyTolerance=i}t.streaming&&"liveSyncMaxLatency"in t.streaming&&(vt("streaming.liveSyncMaxLatency","Please Use streaming.liveSync.targetLatency and streaming.liveSync.targetLatencyTolerance instead. Or, set the values in your DASH manifest"),delete t.streaming.liveSyncMaxLatency);t.streaming&&"liveSyncMinLatency"in t.streaming&&(vt("streaming.liveSyncMinLatency","Please Use streaming.liveSync.targetLatency and streaming.liveSync.targetLatencyTolerance instead. Or, set the values in your DASH manifest"),delete t.streaming.liveSyncMinLatency);t.streaming&&"liveSyncTargetLatency"in t.streaming&&(vt("streaming.liveSyncTargetLatency","Please Use streaming.liveSync.targetLatency instead."),t.streaming.liveSync=t.streaming.liveSync||{},t.streaming.liveSync.targetLatency=t.streaming.liveSyncTargetLatency,delete t.streaming.liveSyncTargetLatency);t.streaming&&"liveSyncTargetLatencyTolerance"in t.streaming&&(vt("streaming.liveSyncTargetLatencyTolerance","Please Use streaming.liveSync.targetLatencyTolerance instead."),t.streaming.liveSync=t.streaming.liveSync||{},t.streaming.liveSync.targetLatencyTolerance=t.streaming.liveSyncTargetLatencyTolerance,delete t.streaming.liveSyncTargetLatencyTolerance);t.streaming&&"liveSyncPlaybackRate"in t.streaming&&(vt("streaming.liveSyncPlaybackRate","Please Use streaming.liveSync.maxPlaybackRate instead."),t.streaming.liveSync=t.streaming.liveSync||{},t.streaming.liveSync.maxPlaybackRate=t.streaming.liveSyncPlaybackRate,delete t.streaming.liveSyncPlaybackRate);t.streaming&&"liveSyncMinPlaybackRate"in t.streaming&&(vt("streaming.liveSyncMinPlaybackRate","Please Use streaming.liveSync.minPlaybackRate instead."),t.streaming.liveSync=t.streaming.liveSync||{},t.streaming.liveSync.minPlaybackRate=t.streaming.liveSyncMinPlaybackRate,delete t.streaming.liveSyncMinPlaybackRate);t.streaming&&"liveSyncPanicMode"in t.streaming&&(vt("streaming.liveSyncPanicMode","Please Use streaming.liveSync.panicMode instead."),t.streaming.liveSync=t.streaming.liveSync||{},t.streaming.liveSync.panicMode=t.streaming.liveSyncPanicMode,delete t.streaming.liveSyncPanicMode);t.streaming&&"liveSyncPanicThreshold"in t.streaming&&(vt("streaming.liveSyncPanicThreshold","Please Use streaming.liveSync.panicThreshold instead."),t.streaming.liveSync=t.streaming.liveSync||{},t.streaming.liveSync.panicThreshold=t.streaming.liveSyncPanicThreshold,delete t.streaming.liveSyncPanicThreshold);if(t.mediaSource&&"sourceBufferExtraFeatures"in t.mediaSource){vt("mediaSource.sourceBufferExtraFeatures configuration","Please Use mediaSource.addExtraFeaturesToSourceBuffer() instead.");var r=t.mediaSource.sourceBufferExtraFeatures;t.mediaSource.addExtraFeaturesToSourceBuffer=function(){return r};delete t.mediaSource.sourceBufferExtraFeatures}t.manifest&&t.manifest.hls&&"useSafariBehaviorForLive"in t.manifest.hls&&(vt("manifest.hls.useSafariBehaviorForLive configuration","Please Use liveSync config to keep on live Edge instead."),delete t.manifest.hls.useSafariBehaviorForLive);t.streaming&&"parsePrftBox"in t.streaming&&(vt("streaming.parsePrftBox configuration","Now fired without needing a configuration."),delete t.streaming.parsePrftBox);t.manifest&&t.manifest.dash&&"enableAudioGroups"in t.manifest.dash&&(vt("manifest.dash.enableAudioGroups configuration","It is now enabled by default and cannot be disabled."),delete t.manifest.dash.enableAudioGroups);t.streaming&&"dispatchAllEmsgBoxes"in t.streaming&&(vt("streaming.dispatchAllEmsgBoxes configuration","Please Use mediaSource.dispatchAllEmsgBoxes instead."),t.mediaSource=t.mediaSource||{},t.mediaSource.dispatchAllEmsgBoxes=t.streaming.dispatchAllEmsgBoxes,delete t.streaming.dispatchAllEmsgBoxes);t.streaming&&"autoLowLatencyMode"in t.streaming&&(vt("streaming.autoLowLatencyMode configuration","Please Use streaming.lowLatencyMode instead."),t.streaming.lowLatencyMode=t.streaming.autoLowLatencyMode,delete t.streaming.autoLowLatencyMode);t.manifest&&t.manifest.dash&&"ignoreSupplementalCodecs"in t.manifest.dash&&(vt("manifest.dash.ignoreSupplementalCodecs configuration","Please Use manifest.ignoreSupplementalCodecs instead."),t.manifest.ignoreSupplementalCodecs=t.manifest.dash.ignoreSupplementalCodecs,delete t.manifest.dash.ignoreSupplementalCodecs);t.manifest&&t.manifest.hls&&"ignoreSupplementalCodecs"in t.manifest.hls&&(vt("manifest.hls.ignoreSupplementalCodecs configuration","Please Use manifest.ignoreSupplementalCodecs instead."),t.manifest.ignoreSupplementalCodecs=t.manifest.hls.ignoreSupplementalCodecs,delete t.manifest.hls.ignoreSupplementalCodecs);t.manifest&&t.manifest.dash&&"updatePeriod"in t.manifest.dash&&(vt("manifest.dash.updatePeriod configuration","Please Use manifest.updatePeriod instead."),t.manifest.updatePeriod=t.manifest.dash.updatePeriod,delete t.manifest.dash.updatePeriod);t.manifest&&t.manifest.hls&&"updatePeriod"in t.manifest.hls&&(vt("manifest.hls.updatePeriod configuration","Please Use manifest.updatePeriod instead."),t.manifest.updatePeriod=t.manifest.hls.updatePeriod,delete t.manifest.hls.updatePeriod);t.manifest&&t.manifest.dash&&"ignoreDrmInfo"in t.manifest.dash&&(vt("manifest.dash.ignoreDrmInfo configuration","Please Use manifest.ignoreDrmInfo instead."),t.manifest.ignoreDrmInfo=t.manifest.dash.ignoreDrmInfo,delete t.manifest.dash.ignoreDrmInfo);if(t.drm&&t.drm.advanced){e=false;for(var a in t.drm.advanced){var u=t.drm.advanced[a];i=u.videoRobustness;u=u.audioRobustness;"videoRobustness"in t.drm.advanced[a]&&!Array.isArray(t.drm.advanced[a].videoRobustness)&&(t.drm.advanced[a].videoRobustness=[i],e=true);"audioRobustness"in t.drm.advanced[a]&&!Array.isArray(t.drm.advanced[a].audioRobustness)&&(t.drm.advanced[a].audioRobustness=[u],e=true)}e&&vt("AdvancedDrmConfiguration's videoRobustness and audioRobustness","These properties are no longer strings but array of strings, please update your usage of these properties.")}t.streaming&&"forceHTTP"in t.streaming&&(vt("streaming.forceHTTP configuration","Please Use networking.forceHTTP instead."),t.networking=t.networking||{},t.networking.forceHTTP=t.streaming.forceHTTP,delete t.streaming.forceHTTP);t.streaming&&"forceHTTPS"in t.streaming&&(vt("streaming.forceHTTPS configuration","Please Use networking.forceHTTP instead."),t.networking=t.networking||{},t.networking.forceHTTPS=t.streaming.forceHTTPS,delete t.streaming.forceHTTPS);t.streaming&&"minBytesForProgressEvents"in t.streaming&&(vt("streaming.minBytesForProgressEvents configuration","Please Use networking.minBytesForProgressEvents instead."),t.networking=t.networking||{},t.networking.minBytesForProgressEvents=t.streaming.minBytesForProgressEvents,delete t.streaming.minBytesForProgressEvents);t.streaming&&"crossBoundaryStrategy"in t.streaming&&"keep"!=t.streaming.crossBoundaryStrategy&&(t.streaming.inaccurateManifestTolerance=0);a=Hl(this.g,t,Av(this));dv(this);return a};i.mj=function(t){this.Uf=t};function dv(t){t.re=new Pu(t.g,t.va,t.C);if(t.H){var n=Kn(t.g.manifest);t.h&&"AUDIO"===t.h.nodeName&&(n.disableVideo=true);t.H.configure(n)}t.C&&t.C.configure(t.g.drm);if(t.l){t.l.configure(t.g.streaming);try{t.m!=np&&Lu(t.re,t.i)&&Bv(t)}catch(n){Kv(t,n)}t.s&&Dv(t);n=t.l.o;!n||n.allowedByApplication&&n.allowedByKeySystem||Lv(t)}t.I&&t.I.configure(t.g.networking);t.G&&(t.G.configure(t.g.mediaSource),t.G.Ka=t.g.manifest.segmentRelativeVttTiming);t.o&&jd(t);t.s&&(t.s.configure(t.g.abr),t.g.abr.enabled?t.s.enable():t.s.disable(),qv(t));t.P&&ov(t);t.Ba&&(t.g.streaming.rebufferingGoal?t.Ba.Ga(.25):t.Ba.stop());t.i&&Qv(t.i.presentationTimeline,t.g.playRangeStart,t.g.playRangeEnd);t.B&&t.B.configure(t.g.ads);t.L&&t.L.configure(t.g.cmcd);t.oa&&t.oa.configure(t.g.cmsd);t.ya&&t.ya.configure(t.g.queue)}i.getConfiguration=function(){var t=Av(this);Hl(t,this.g,Av(this));return t};i.wj=function(){return this.Uf};i.Xh=function(){var t=Av(this);Hl(t,this.g,Av(this));return yl(this.g,Av(this))};i.Th=function(){if(this.h){var t=this.h.buffered.length;t=t?this.h.buffered.end(t-1):0;var n=this.getConfiguration().streaming.bufferingGoal;n=Math.min(this.h.currentTime+n,this.Ra().end);if(t>=n)return 1;if(!(t<=this.h.currentTime)&&t<n)return(t-this.h.currentTime)/(n-this.h.currentTime)}return 0};i.Bi=function(){for(var t in this.g)delete this.g[t];Hl(this.g,Av(this),Av(this));dv(this)};i.Ej=function(){return this.m};i.Vh=function(){return this.i?this.i.type:null};i.Ij=function(){return this.h};i.Nb=function(){return this.I};i.kd=function(){return this.W};i.Sh=function(){return this.B?this.B:null};i.Yh=function(){return this.ya?this.ya:null};i.V=function(){return this.i&&!this.ua()?this.i.presentationTimeline.V():this.h&&(this.h.src||this.ua())?Infinity==this.h.duration:false};i.Sc=function(){return this.i?this.i.presentationTimeline.Sc():false};i.bk=function(){if(this.i&&!this.ua()){var t=this.i.variants;return t.length?!t[0].video:false}return this.h&&(this.h.src||this.ua())?this.h.videoTracks?0==this.h.videoTracks.length:0==this.h.videoHeight:false};i.ik=function(){if(this.i&&!this.ua()){var t=this.i.variants;if(!t.length)return false;t=t[0];return t.audio||!t.video?false:!t.video.codecs.includes(",")}return this.h&&(this.h.src||this.ua())&&this.h.audioTracks?0==this.h.audioTracks.length:false};i.Ra=function(){if(this.i&&!this.ua()){if(!this.Ka&&"HLS"==this.i.type)return{start:0,end:0};var t=this.i.presentationTimeline;return{start:t.Vb(),end:t.Eb()}}if(this.h&&(this.h.src||this.ua())&&(t=this.h.seekable)&&t.length){var n=this.g?this.g.playRangeStart:0;n=Math.max(t.start(0),n);var e=this.g?this.g.playRangeEnd:Infinity;t=Math.min(t.end(t.length-1),e);return{start:n,end:t}}return{start:0,end:0}};i.Yj=function(){this.V()&&(this.h.currentTime=this.Ra().end)};i.ck=function(){return this.Ka};i.keySystem=function(){var t=this.drmInfo();return t?t.keySystem:""};i.drmInfo=function(){return this.C?this.C.g:null};i.Nd=function(){return this.C?this.C.Nd():Infinity};i.Ag=function(){return this.C?this.C.Ag():[]};i.Re=function(){return this.C?this.C.Re():{}};i.Ig=function(){return this.P?this.P.g==Nu:!!this.W};i.sb=function(){return this.h?this.K?this.K.i:1:0};i.Ah=function(t){this.m==ip&&this.l&&Oc(this.l,t)};i.ie=function(t,n){n=void 0===n?true:n;0==t?Y("A trick play rate of 0 is unsupported!"):(this.K.set(t),this.m==ip&&(this.s.playbackRateChanged(t),this.Ah(n&&1!=t)),Nv(this,t))};i.Fd=function(){var t=this.K.Oc();this.m==rp&&this.K.set(t);this.m==ip&&(this.K.set(t),this.s.playbackRateChanged(t),this.Ah(false));this.Yb.Qa()};i.Ob=function(){if(this.i&&!this.ua()){for(var t=this.l?this.l.o:null,n=[],e=0,i=c(this.i.variants),r=i.next();!r.done;r=i.next())if(r=r.value,gr(r)){var a=hr(r);a.active=r==t;a.active||1==e||null==t||r.video!=t.video||r.audio!=t.audio||(a.active=true);a.active&&e++;n.push(a)}return n}if(this.h&&this.h.audioTracks){var u=Uv(this);t=Array.from(this.h.audioTracks);return t.length?t.map((function(t){return wr(t,u)})):u?[wr(null,u)]:[]}return[]};i.Cc=function(){if(this.i){if(this.ua())return[];for(var t=this.l?this.l.A:null,n=[],e=c(this.i.textStreams),i=e.next();!i.done;i=e.next()){i=i.value;var r=dr(i);r.active=i==t;n.push(r)}return n}return this.h&&this.h.src&&this.h.textTracks?gv(this).map((function(t){return mr(t)})):[]};i.Bj=function(){var t=this.ye;this.i&&(t=this.i.imageStreams);return t.map((function(t){return vr(t)}))};i.pj=function(t){var n=this,e,i;return _((function(r){if(1==r.g)return T(r,pv(n,t),2);e=r.h;if(!e)return r.return(null);i=[];e.segmentIndex.Db((function(t){var n=vv(t.tilesLayout||e.tilesLayout);if(n)for(var r=n.rows*n.Kc,a=t.j-t.startTime,u=0;u<r;u++){var s=mv(t,e,t.startTime+a*u/r,n);i.push(s)}}));e.closeSegmentIndex&&e.closeSegmentIndex();return r.return(i)}))};function vv(t){return t?(t=/(\d+)x(\d+)/.exec(t))?{Kc:parseInt(t[1],10),rows:parseInt(t[2],10)}:null:null}i.Sj=function(t,n){var e=this,i,r,a,u;return _((function(s){if(1==s.g)return T(s,pv(e,t),2);i=s.h;if(!i)return s.return(null);r=i.segmentIndex.find(n);if(null==r)return s.return(null);a=i.segmentIndex.get(r);return(u=vv(a.tilesLayout||i.tilesLayout))?s.return(mv(a,i,n,u)):s.return(null)}))};function pv(t,n){var e,i;return _((function(r){if(1==r.g){if(t.m!=ip&&t.m!=rp)return r.return(null);e=t.ye;t.i&&(e=t.i.imageStreams);i=e[0];if(!i)return r.return(null);null!=n&&(i=e.find((function(t){return t.id==n})));return i?i.segmentIndex?r.u(2):T(r,i.createSegmentIndex(),2):r.return(null)}return r.return(i)}))}function mv(t,n,e,i){var r=n.width||0,a=n.height||0,u=r/i.Kc,s=a/i.rows,o=i.Kc*i.rows,f=t.j-t.startTime;f=t.B||f/o;var c=t.startTime,l=0,h=0;1<o&&(h=Math.floor((e-t.startTime)/f),c=t.startTime+h*f,l=h%i.Kc*u,h=Math.floor(h/i.Kc)*s);i=false;if(e=t.thumbnailSprite)i=true,s=e.height,l=e.positionX,h=e.positionY,u=e.width;return{segment:t,imageHeight:a,imageWidth:r,height:s,positionX:l,positionY:h,startTime:c,duration:f,uris:t.O(),startByte:t.Ac(),endByte:t.yc(),width:u,sprite:i,mimeType:t.mimeType||n.mimeType,codecs:t.codecs||n.codecs}}i.fh=function(t){function n(){var n=e.i.textStreams.find((function(n){return n.id==t.id}));n&&n!=e.l.A&&(Kl(e.A.h,n,false),Uc(e.l,n),zv(e),jv(e),e.ud=n.language)}var e=this;if(this.i&&this.F&&(n(),!this.ua()))return;(function(){if(e.h&&e.h.textTracks){var n=gv(e),i=n.find((function(n){return pr(n)===t.id}));if(i){if(e.o instanceof Dh){n=c(n);for(var r=n.next();!r.done;r=n.next()){r=r.value;var a=r===i?e.ba?"showing":"hidden":"disabled";r.mode!==a&&(r.mode=a)}}else n=n.find((function(t){return"disabled"!==t.mode})),n!==i&&(n&&(n.mode="disabled",e.j.Ja(n,"cuechange"),e.o.remove(0,Infinity)),i&&wv(e,i));zv(e);jv(e)}}})()};function wv(t,n){t.j.D(n,"cuechange",(function(){t.o.remove(0,Math.max(0,t.h.currentTime-t.g.streaming.bufferBehind));var e={periodStart:0,segmentStart:0,segmentEnd:t.h.duration,vttOffset:0},i=[],r=Array.from(n.activeCues||[]);r=c(r);for(var a=r.next();!a.done;a=r.next()){a=a.value;if(Infinity===a.endTime||a.endTime<a.startTime)a=null;else{var u=new Ne(a.startTime,a.endTime,a.text);u.line="number"===typeof a.line?a.line:null;a.lineAlign&&(u.lineAlign=a.lineAlign);u.lineInterpretation=a.snapToLines?qe:1;u.position="number"===typeof a.position?a.position:null;a.positionAlign&&(u.positionAlign=a.positionAlign);u.size=a.size;u.textAlign=a.align;"lr"===a.vertical?u.writingMode="vertical-lr":"rl"===a.vertical&&(u.writingMode="vertical-rl");a.region&&(u.region.id=a.region.id,u.region.height=a.region.lines,u.region.heightUnits=2,u.region.regionAnchorX=a.region.regionAnchorX,u.region.regionAnchorY=a.region.regionAnchorY,u.region.scroll=a.region.scroll,u.region.viewportAnchorX=a.region.viewportAnchorX,u.region.viewportAnchorY=a.region.viewportAnchorY,u.region.viewportAnchorUnits=Dn,u.region.width=a.region.width,u.region.widthUnits=Dn);Re(u);a=u}a&&((u=t.g.mediaSource.modifyCueCallback)&&u(a,null,e),i.push(a))}t.o.append(i)}));n.mode=document.pictureInPictureElement?"showing":"hidden"}i.Bf=function(t,n,e){function i(){var i=r.i.variants.find((function(n){return n.id==t.id}));if(i&&gr(i)){var a=r.l.o;r.g.abr.enabled&&(a.video!=i.video||a.audio&&i.audio&&a.audio.language==i.audio.language&&a.audio.channelsCount==i.audio.channelsCount&&a.audio.label==i.audio.label)&&Y("Changing tracks while abr manager is enabled will likely result in the selected track being overridden. Consider disabling abr before calling selectVariantTrack().");r.ua()?Ov(r,i,false,false,0):Ov(r,i,false,n||false,e||0);r.M.configure({language:i.language,role:i.audio&&i.audio.roles&&i.audio.roles[0]||"",channelCount:i.audio&&i.audio.channelsCount?i.audio.channelsCount:0,Dc:i.video&&i.video.hdr?i.video.hdr:"",spatialAudio:i.audio&&i.audio.spatialAudio?i.audio.spatialAudio:false,videoLayout:i.video&&i.video.videoLayout?i.video.videoLayout:"",Ic:i.audio&&i.audio.label?i.audio.label:"",Bd:"",codecSwitchingStrategy:r.g.mediaSource.codecSwitchingStrategy,audioCodec:i.audio&&i.audio.codecs?i.audio.codecs:"",Dd:a.audio&&a.audio.codecs?a.audio.codecs:"",De:a.audio&&a.audio.channelsCount?a.audio.channelsCount:0,preferredAudioCodecs:r.g.preferredAudioCodecs,preferredAudioChannelCount:r.g.preferredAudioChannelCount});Dv(r)}}var r=this;n=void 0===n?false:n;e=void 0===e?0:e;if(this.i&&this.F&&(i(),!this.ua()))return;(function(){if(t.originalAudioId&&r.h&&r.h.audioTracks){var n=Array.from(r.h.audioTracks);n=c(n);for(var e=n.next();!e.done;e=n.next())if(e=e.value,pr(e)==t.id){_v(r,e);break}}})()};i.Nk=function(t,n){function e(){var e=i.M.getConfiguration();e.audioCodec=t.codecs||"";e.Ic=t.label||"";e.channelCount=t.channelsCount||0;e.language=t.language;e.role=t.roles[0]||"";e.spatialAudio=t.spatialAudio;i.M.configure(e);Lv(i,true,n,false,false)}var i=this;n=void 0===n?0:n;if(this.i&&this.F&&(e(),!this.ua()))return;(function(){if(i.h&&i.h.audioTracks){var n=Array.from(i.h.audioTracks),e=null;n=c(n);for(var r=n.next();!r.done;r=n.next())if(r=r.value,r.label==t.label&&r.language==t.language&&r.kind==t.roles[0]){e=r;break}e&&_v(i,e)}})()};i.getAudioTracks=function(){if(this.i&&!this.ua()){var t=this.Ob();if(!t.length)return[];var n=t.find((function(t){return t.active}));if(!n)return[];var e=t;this.m!=ip||this.ua()||(e=t.filter((function(t){return t.originalVideoId===n.originalVideoId&&t.audioCodec})));if(!e.length)return[];t=new Map;e=c(e);for(var i=e.next();!i.done;i=e.next()){i=i.value;var r=i.originalAudioId;r||null==i.audioId||(r=String(i.audioId));r&&t.set(r,{active:i.active,language:i.language,label:i.label,mimeType:i.audioMimeType,codecs:i.audioCodec,primary:i.primary,roles:i.audioRoles||[],accessibilityPurpose:i.accessibilityPurpose,channelsCount:i.channelsCount,audioSamplingRate:i.audioSamplingRate,spatialAudio:i.spatialAudio,originalLanguage:i.originalLanguage})}return Array.from(t.values())}return this.h&&this.h.audioTracks?Array.from(this.h.audioTracks).map((function(t){var n=t.language;n={active:t.enabled,language:zi(n||"und"),label:t.label,mimeType:null,codecs:null,primary:"main"==t.kind,roles:[],accessibilityPurpose:null,channelsCount:null,audioSamplingRate:null,spatialAudio:false,originalLanguage:n};t.kind&&n.roles.push(t.kind);t.configuration&&(t.configuration.codec&&(n.codecs=t.configuration.codec),t.configuration.sampleRate&&(n.audioSamplingRate=t.configuration.sampleRate),t.configuration.numberOfChannels&&(n.channelsCount=t.configuration.numberOfChannels));return n})):[]};i.Pk=function(t,n,e){n=void 0===n?false:n;e=void 0===e?0:e;var i=this.Ob();if(i.length){var r=i.find((function(t){return t.active}));r&&(i=i.find((function(n){return n.audioId===r.audioId&&(n.videoBandwidth||n.bandwidth)==t.bandwidth&&n.width==t.width&&n.height==t.height&&n.frameRate==t.frameRate&&n.pixelAspectRatio==t.pixelAspectRatio&&n.hdr==t.hdr&&n.colorGamut==t.colorGamut&&n.videoLayout==t.videoLayout&&n.videoMimeType==t.mimeType&&n.videoCodec==t.codecs})))&&!i.active&&this.Bf(i,n,e)}};i.getVideoTracks=function(){if(this.m==rp||this.ua())return[];var t=this.Ob();if(!t.length)return[];var n=t.find((function(t){return t.active}));if(!n)return[];var e=t.filter((function(t){return t.originalAudioId===n.originalAudioId&&t.audioId===n.audioId&&t.audioGroupId===n.audioGroupId&&t.videoCodec}));if(!e.length)return[];t=new Map;e=c(e);for(var i=e.next();!i.done;i=e.next()){i=i.value;var r=i.originalVideoId;r||null==i.videoId||(r=String(i.videoId));r&&t.set(r,{active:i.active,bandwidth:i.videoBandwidth||i.bandwidth,width:i.width,height:i.height,frameRate:i.frameRate,pixelAspectRatio:i.pixelAspectRatio,hdr:i.hdr,colorGamut:i.colorGamut,videoLayout:i.videoLayout,mimeType:i.videoMimeType,codecs:i.videoCodec})}return Array.from(t.values())};i.rj=function(){return tp(this.Ob())};i.Qj=function(){return tp(this.Cc())};i.qj=function(){return Array.from(Zv(this.Ob()))};i.Pj=function(){return Array.from(Zv(this.Cc()))};i.Gi=function(t,n,e,i,r,a,u){function s(){function s(t,n){return t.video||n.video?t.video&&n.video?Math.abs((t.video.height||0)-(n.video.height||0))+Math.abs((t.video.width||0)-(n.video.width||0)):Infinity:0}var f=o.l.o;o.M=o.g.adaptationSetCriteriaFactory();o.M.configure({language:t,role:n||"",channelCount:e||0,Dc:"",spatialAudio:a||false,videoLayout:"",Ic:u||"",Bd:"",codecSwitchingStrategy:o.g.mediaSource.codecSwitchingStrategy,audioCodec:r||"",Dd:f.audio&&f.audio.codecs?f.audio.codecs:"",De:f.audio&&f.audio.channelsCount?f.audio.channelsCount:0,preferredAudioCodecs:o.g.preferredAudioCodecs,preferredAudioChannelCount:o.g.preferredAudioChannelCount});var l=o.M.create(o.i.variants),h=null;l=c(l.values());for(var d=l.next();!d.done;d=l.next())d=d.value,gr(d)&&(!h||s(h,f)>s(d,f))&&(h=d);h!=f&&(h?(f=hr(h),o.Bf(f,true,i||0)):Lv(o))}var o=this;e=void 0===e?0:e;i=void 0===i?0:i;r=void 0===r?"":r;a=void 0===a?false:a;u=void 0===u?"":u;if(this.i&&this.F&&(s(),!this.ua()))return;(function(){if(o.h&&o.h.audioTracks){var e=yr(o.Ob(),t,n||"",false)[0];e&&o.Bf(e)}})()};i.eh=function(t,n,e){function i(){r.ud=t;r.qe=n||"";r.pe=e||false;var i=yr(r.i.textStreams,r.ud,r.qe,r.pe)[0]||null;i&&i!=r.l.A&&(Kl(r.A.h,i,false),r.g.streaming.alwaysStreamText||r.Jg())&&(Uc(r.l,i),zv(r),jv(r))}var r=this;e=void 0===e?false:e;if(this.i&&this.F&&(i(),!this.ua()))return;(function(){var i=yr(r.Cc(),t,n||"",e||false)[0];i&&r.fh(i)})()};i.Ok=function(t,n,e){function i(){for(var i=null,a=c(r.i.variants),u=a.next();!u.done;u=a.next())if(u=u.value,u.audio.label==t){i=u;break}null!=i&&(r.M=r.g.adaptationSetCriteriaFactory(),r.M.configure({language:i.language,role:"",channelCount:0,Dc:"",spatialAudio:false,videoLayout:"",Bd:"",Ic:t,codecSwitchingStrategy:r.g.mediaSource.codecSwitchingStrategy,audioCodec:"",Dd:"",De:0,preferredAudioCodecs:r.g.preferredAudioCodecs,preferredAudioChannelCount:r.g.preferredAudioChannelCount}),Lv(r,n,e))}var r=this;n=void 0===n?true:n;e=void 0===e?0:e;if(this.i&&this.F&&(i(),!this.ua()))return;(function(){if(r.h&&r.h.audioTracks){var n=Array.from(r.h.audioTracks),e=null;n=c(n);for(var i=n.next();!i.done;i=n.next())i=i.value,i.label==t&&(e=i);e&&_v(r,e)}})()};i.Jg=function(){var t=this.ba;return this.o?this.o.isTextVisible():t};i.vj=function(){return this.ab.map((function(t){return dr(t)}))};i.tj=function(t){vt("getChapters","Please use an getChaptersAsync.");if(!this.ab.length)return[];var n=zi(t);t=this.ab.filter((function(t){return zi(t.language)==n}));if(!t.length)return[];var e=[],i=new Set;t=c(t);for(var r=t.next();!r.done;r=t.next())r=r.value,r.segmentIndex&&r.segmentIndex.Db((function(t){var n=t.O()[0],r=t.startTime+"-"+t.endTime+"-"+n;t={id:r,title:n,startTime:t.startTime,endTime:t.endTime};i.has(r)||(e.push(t),i.add(r))}));return e};i.uj=function(t){var n=this,e,i,r,a,u,s,o;return _((function(f){switch(f.g){case 1:if(!n.ab.length)return f.return([]);e=zi(t);i=n.ab.filter((function(t){return zi(t.language)==e}));if(!i.length)return f.return([]);r=[];a=new Set;u=c(i);s=u.next();case 2:if(s.done){f.u(4);break}o=s.value;if(o.segmentIndex){f.u(5);break}return T(f,o.createSegmentIndex(),5);case 5:o.segmentIndex.Db((function(t){var n=t.O()[0],e=t.startTime+"-"+t.endTime+"-"+n;t={id:e,title:n,startTime:t.startTime,endTime:t.endTime};a.has(e)||(r.push(t),a.add(e))}));s=u.next();f.u(2);break;case 4:return f.return(r)}}))};function gv(t){return Array.from(t.h.textTracks).filter((function(t){return"metadata"!=t.kind&&"chapters"!=t.kind&&"Shaka Player TextTrack"!=t.label}))}function bv(t){return Array.from(t.h.textTracks).find((function(t){return"Shaka Player TextTrack"==t.label}))}function yv(t){return Array.from(t.h.textTracks).filter((function(t){return"metadata"==t.kind}))}i.kh=function(t){t=!!t;this.ba!=t&&(this.ba=t,this.m==ip?(this.o.setTextVisibility(t),this.g.streaming.alwaysStreamText||(t?this.l.A||(t=yr(this.i.textStreams,this.ud,this.qe,this.pe),0<t.length&&(Uc(this.l,t[0]),zv(this),jv(this))):Lc(this.l))):this.h&&this.h.src&&this.h.textTracks&&this.o.setTextVisibility(t),Xv(this))};i.Jj=function(){if(this.F)var t=this.F.Be();else{if(null==this.N)return new Date;if(this.N instanceof Date)return this.N;t=this.N}if(this.i&&!this.ua()){var n=this.i.presentationTimeline;return new Date(1e3*((n.m||n.i)+t))}return this.h&&this.h.getStartDate?(n=this.h.getStartDate(),isNaN(n.getTime())?null:new Date(n.getTime()+1e3*t)):null};i.Cg=function(){if(this.i&&!this.ua()){var t=this.i.presentationTimeline;return new Date(1e3*(t.m||t.i))}return this.h&&this.h.getStartDate?(t=this.h.getStartDate(),isNaN(t.getTime())?null:t):null};i.Ue=function(){return this.V()?this.i?this.i.presentationTimeline.Ue():null:null};i.Lb=function(){if(this.m==ip)return this.G.Lb();var t={total:[],audio:[],video:[],text:[]};this.m==rp&&(t.total=Xs(this.h.buffered));return t};i.Se=function(){if(!this.h||!this.h.currentTime)return null;var t=this.Cg().getTime()+1e3*this.h.currentTime;return Math.floor(Date.now()-t)};i.getStats=function(){if(this.m!=ip&&this.m!=rp)return{width:NaN,height:NaN,currentCodecs:"",streamBandwidth:NaN,decodedFrames:NaN,droppedFrames:NaN,corruptedFrames:NaN,stallsDetected:NaN,gapsJumped:NaN,estimatedBandwidth:NaN,completionPercent:NaN,loadLatency:NaN,manifestTimeSeconds:NaN,drmTimeSeconds:NaN,playTime:NaN,pauseTime:NaN,bufferingTime:NaN,licenseTime:NaN,liveLatency:NaN,maxSegmentDuration:NaN,manifestSizeBytes:NaN,bytesDownloaded:NaN,nonFatalErrorCount:NaN,manifestPeriodCount:NaN,manifestGapCount:NaN,switchHistory:[],stateHistory:[]};Cv(this);var t=this.h,n=t.currentTime/t.duration;isNaN(n)||this.V()||Ql(this.A,Math.round(100*n));this.F&&(this.A.S=this.F.Bh(),this.A.U=this.F.Ch());t.getVideoPlaybackQuality&&(n=t.getVideoPlaybackQuality(),$l(this.A,Number(n.droppedVideoFrames),Number(n.totalVideoFrames)),this.A.M=Number(n.corruptedVideoFrames));this.A.o=this.C?Ja(this.C):NaN;Yl(this.A,t.videoWidth||NaN,t.videoHeight||NaN);this.A.l="";this.V()&&null!=this.Cg()&&(t=this.Se()||0,this.A.C=t/1e3);n=this.Ob().find((function(t){return t.active}));t=this.Cc().find((function(t){return t.active}));if(n){if(n.bandwidth){var e=this.K?this.K.i:1,i=e*n.bandwidth;t&&t.bandwidth&&(i+=e*t.bandwidth);this.A.A=i}n.width&&n.height&&Yl(this.A,n.width||NaN,n.height||NaN);n=n.codecs;t&&(n+=","+(t.codecs||t.mimeType));n&&(this.A.l=n)}this.m!=ip||this.ua()||(this.i&&(this.A.H=this.i.periodCount,this.A.G=this.i.gapCount,this.i.presentationTimeline&&(this.A.K=this.i.presentationTimeline.h)),t=this.s.getBandwidthEstimate(),this.A.s=t);this.m==rp&&Jl(this.A,NaN);return Zl(this.A)};i.Ed=function(t,n,e,i,r,a,u){u=void 0===u?false:u;var s=this,o,f,c,l,h,d,v,p,m,w,g,b;return _((function(y){switch(y.g){case 1:if(s.m!=ip&&s.m!=rp)throw new zt(1,7,7004);"subtitles"!=e&&"captions"!=e&&Y("Using a kind value different of `subtitles` or `captions` can cause unwanted issues.");if(i){y.u(2);break}return T(y,kv(s,t),3);case 3:i=y.h;case 2:o=[];s.B&&(o=s.B.getCuePoints());if(s.m!=rp){y.u(4);break}f=ft();u&&"WEBKIT"===f.Da()&&(e="forced");return T(y,Tv(s,t,n,e,i,a||"",o),5);case 5:c=y.h;if(c.track)return Bv(s),y.return(mr(c.track));throw new zt(1,2,2012);case 4:l=dn;h=s.Ra();d=h.end-h.start;s.i&&(d=s.i.presentationTimeline.getDuration());if(Infinity==d)throw new zt(1,4,4033);if(!o.length){y.u(6);break}return T(y,Ev(s,t,s.I,s.g.streaming.retryParameters),7);case 7:v=y.h,p=Sv(s,v,i,o),m=new Blob([p],{type:"text/vtt"}),t=mf(m),i="text/vtt";case 6:w={id:s.se++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:Kf(0,d,[t]),mimeType:i||"",codecs:r||"",kind:e,encrypted:false,drmInfos:[],keyIds:new Set,language:n,originalLanguage:n,label:a||null,type:l.Ya,primary:false,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!!u,channelsCount:null,audioSamplingRate:null,spatialAudio:false,closedCaptions:null,accessibilityPurpose:null,external:true,fastSwitching:false,fullMimeTypes:new Set([li(i||"",r||"")]),isAudioMuxedInVideo:false,baseOriginalId:null};g=li(w.mimeType,w.codecs);b=Ai(g);if(!b)throw new zt(2,2,2014,i);s.i.textStreams.push(w);Bv(s);return y.return(dr(w))}}))};i.Fe=function(t,n){var e=this,i,r,a,u,s,o,f,l,h,d,v,p,m,w,g,b,y,k;return _((function(E){switch(E.g){case 1:if(e.m!=ip&&e.m!=rp)throw new zt(1,7,7004);if(n){E.u(2);break}return T(E,kv(e,t),3);case 3:n=E.h;case 2:if("text/vtt"!=n)throw new zt(1,2,2017,t);i=dn;r=e.Ra();a=r.end-r.start;e.i&&(a=e.i.presentationTimeline.getDuration());if(Infinity==a)throw new zt(1,4,4045);return T(E,Ev(e,t,e.I,e.g.streaming.retryParameters),4);case 4:u=E.h;s=Si(n);if(!s)throw new zt(2,2,2014,n);o=s();f={periodStart:0,segmentStart:0,segmentEnd:a,vttOffset:0};l=Bt(u);h=o.parseMedia(l,f,t,[]);d=[];v=c(h);p=v.next();for(m={};!p.done;m={Mf:void 0,fd:void 0},p=v.next())m.fd=p.value,m.Mf=null,w=function(n){return function(){null==n.Mf&&(n.Mf=un([t],[n.fd.payload]));return n.Mf||[]}}(m),g=new Ls(m.fd.startTime,m.fd.endTime,w,0,null,null,0,0,Infinity),m.fd.payload.includes("#xywh")&&(b=m.fd.payload.split("#xywh=")[1].split(","),4===b.length&&g.Ef({height:parseInt(b[3],10),positionX:parseInt(b[0],10),positionY:parseInt(b[1],10),width:parseInt(b[2],10)})),d.push(g);y=n;if(!d.length){E.u(5);break}return T(E,yh(d[0].O()[0],e.I,e.g.manifest.retryParameters),6);case 6:y=E.h;case 5:return k={id:e.se++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new jf(d),mimeType:y||"",codecs:"",kind:"",encrypted:false,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:i.Pf,primary:false,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:false,channelsCount:null,audioSamplingRate:null,spatialAudio:false,closedCaptions:null,tilesLayout:"1x1",accessibilityPurpose:null,external:true,fastSwitching:false,fullMimeTypes:new Set([li(y||"","")]),isAudioMuxedInVideo:false,baseOriginalId:null},e.m==rp?e.ye.push(k):e.i.imageStreams.push(k),Bv(e),E.return(vr(k))}}))};i.Ee=function(t,n,e){var i=this,r,a,u,s,o,f,l,h,d,v,p,m,w,g,b;return _((function(y){switch(y.g){case 1:if(i.m!=ip&&i.m!=rp)throw new zt(1,7,7004);if(e){y.u(2);break}return T(y,kv(i,t),3);case 3:e=y.h;case 2:r=dn;a=i.Ra();u=a.end-a.start;i.i&&(u=i.i.presentationTimeline.getDuration());if(Infinity==u)throw new zt(1,4,4054);return T(y,Ev(i,t,i.I,i.g.streaming.retryParameters),4);case 4:s=y.h;o=Si(e);if(!o)throw new zt(2,2,2014,e);f=o();l={periodStart:0,segmentStart:0,segmentEnd:u,vttOffset:0};h=Bt(s);d=f.parseMedia(h,l,t,[]);v=[];p=c(d);m=p.next();for(w={};!m.done;w={Oe:void 0},m=p.next())w.Oe=m.value,g=new Ls(w.Oe.startTime,w.Oe.endTime,function(t){return function(){return[t.Oe.payload]}}(w),0,null,null,0,0,Infinity),v.push(g);b={id:i.se++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new jf(v),mimeType:"text/plain",codecs:"",kind:"",encrypted:false,drmInfos:[],keyIds:new Set,language:n,originalLanguage:n,label:null,type:r.Ya,primary:false,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:false,channelsCount:null,audioSamplingRate:null,spatialAudio:false,closedCaptions:null,accessibilityPurpose:null,external:true,fastSwitching:false,fullMimeTypes:new Set([li("text/plain","")]),isAudioMuxedInVideo:false,baseOriginalId:null};i.ab.push(b);Bv(i);return y.return(dr(b))}}))};function kv(t,n){var e;return _((function(i){switch(i.g){case 1:return S(i,2),T(i,yh(n,t.I,t.g.streaming.retryParameters),4);case 4:e=i.h;I(i,3);break;case 2:M(i);case 3:if(e)return i.return(e);throw new zt(1,2,2011,n)}}))}function Tv(t,n,e,i,r,a,u){var s,o,f,c;return _((function(l){if(1==l.g)return"text/vtt"!=r||u.length?T(l,Ev(t,n,t.I,t.g.streaming.retryParameters),3):l.u(2);2!=l.g&&(s=l.h,o=Sv(t,s,r,u),f=new Blob([o],{type:"text/vtt"}),n=mf(f),r="text/vtt");c=document.createElement("track");var h=t.L,d=n;try{if(h.g.enabled){var v=nd(h);v.ot=wd;v.su=true;var p=fd(v);var m=ld(d,p)}else m=d}catch(t){Q("CMCD_TEXT_TRACK_ERROR","Could not generate text track CMCD data.",t),m=d}c.src=m;c.label=a;c.kind=i;c.srclang=e;t.h.getAttribute("crossorigin")||t.h.setAttribute("crossorigin","anonymous");t.h.appendChild(c);t.Tf.push(c);return l.return(c)}))}function Ev(t,n,e,i){var r,a,u;return _((function(s){if(1==s.g){r=va;a=sa([n],i);a.method="GET";var o=t.L;try{o.g.enabled&&ed(o,a,{ot:wd,su:true})}catch(t){Q("CMCD_TEXT_ERROR","Could not generate text CMCD data.",t)}return T(s,e.request(r,a).promise,2)}u=s.h;return s.return(u.data)}))}function Sv(t,n,e,i){var r=Si(e);if(r)return e=r(),t={periodStart:0,segmentStart:0,segmentEnd:t.h.duration,vttOffset:0},n=Bt(n),n=e.parseMedia(n,t,null,[]),Wh(n,i);throw new zt(2,2,2014,e)}i.Uk=function(t,n){this.va.width=t;this.va.height=n};i.$g=function(t){if(this.m==ip){var n=this.l;t=void 0===t?.1:t;if(n.l.g)n=false;else if(n.B)n=false;else{for(var e=c(n.h.values()),i=e.next();!i.done;i=e.next())i=i.value,!i.Qd||i.Pa||i.zb||(i.Qd=false,sl(n,i,t));n=true}}else n=false;return n};i.Bg=function(){Y("Shaka Player's internal Manifest structure is NOT covered by semantic versioning compatibility guarantees.  It may change at any time!  Please consider filing a feature request for whatever you use getManifest() for.");return this.i};i.Fj=function(){return this.qc};i.zj=function(){var t={video:null,audio:null,text:null};if(this.m!=ip)return t;var n=this.l.o,e=this.h.currentTime;n=c([n.video,n.audio,this.l.A]);for(var i=n.next();!i.done;i=n.next())if((i=i.value)&&i.segmentIndex){var r=i.segmentIndex.find(e);r=i.segmentIndex.get(r);r={codecs:r.codecs||i.codecs,mimeType:r.mimeType||i.mimeType,bandwidth:r.bandwidth||i.bandwidth};"video"==i.type?(r.width=i.width,r.height=i.height,t.video=r):"audio"==i.type?t.audio=r:i.type==hn&&(t.text=r)}return t};function Av(t){var n=Ul();n.streaming.failureCallback=function(n){if(t.V()){var e=null;1001==n.code||1002==n.code?(e=1,t.g.streaming.lowLatencyMode&&(e=.1)):1003==n.code&&(e=.1);null!=e&&(n.severity=1,t.$g(e))}};n.textDisplayFactory=function(){var n=ft();return t.ue&&(document.fullscreenEnabled||"WEBKIT"!==n.Da())?new Bh(t.h,t.ue):"track"in document.createElement("track")?new Dh(t):new Uh};return n}i.Ni=function(t){this.ue=t};function Iv(t,n){for(var e=new Set,i=c(n.textStreams),r=i.next();!r.done;r=i.next())r=r.value,"application/cea-608"!=r.mimeType&&"application/cea-708"!=r.mimeType||e.add(r.originalId);i=c(n.variants);for(r=i.next();!r.done;r=i.next())if((r=r.value.video)&&r.closedCaptions)for(var a=c(r.closedCaptions.keys()),u=a.next();!u.done;u=a.next())if(u=u.value,!e.has(u)){var s=u.startsWith("CC")?"application/cea-608":"application/cea-708",o=new $f,f=r.closedCaptions.get(u);s={id:t.se++,originalId:u,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:o,mimeType:s,codecs:"",kind:"caption",encrypted:false,drmInfos:[],keyIds:new Set,language:f,originalLanguage:f,label:null,type:hn,primary:false,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:r.roles,forced:false,channelsCount:null,audioSamplingRate:null,spatialAudio:false,closedCaptions:null,accessibilityPurpose:null,external:false,fastSwitching:false,fullMimeTypes:new Set([li(s,"")]),isAudioMuxedInVideo:false,baseOriginalId:null};n.textStreams.push(s);e.add(u)}}function Mv(t,n){var e,i,r,a,u;return _((function(s){if(1==s.g)return e=t.audio,i=t.video,r=function(t,n){var e,i,r;return _((function(a){if(1==a.g)return t?t.segmentIndex?a.u(2):T(a,t.createSegmentIndex(),2):a.return(null);i=(e=t.segmentIndex.Ub(n))?e.next().value:null;if(!i)return a.return(null);r=i.startTime;return a.return(r)}))},T(s,r(e,n),2);if(3!=s.g)return a=s.h,T(s,r(i,n),3);u=s.h;return null!=u&&null!=a?s.return(Math.max(u,a)):null!=u?s.return(u):null!=a?s.return(a):s.return(n)}))}function xv(t){var n=t.Ig();if(t.A&&t.P&&t.F){if(0==t.g.streaming.rebufferingGoal){var e=t.K;e.j=false;Zf(e)}else e=t.K,e.j=n,Zf(e);t.L&&(e=t.L,n||e.s||(e.s=true),e.s&&n&&(e.B=true),e.F=n);Cv(t);e=t.g.streaming.liveSync.dynamicTargetLatency.maxAttempts;if(t.g.streaming.liveSync.dynamicTargetLatency.enabled&&n&&t.Ce<e){e=t.g.streaming.liveSync.dynamicTargetLatency.maxLatency;var i=t.g.streaming.liveSync.targetLatencyTolerance,r=t.g.streaming.liveSync.dynamicTargetLatency.rebufferIncrement;t.U&&(t.U=Math.min(t.U+ ++t.Ce*r,e-i))}}n=(new Map).set("buffering",n);t.dispatchEvent(Od("buffering",n))}function Nv(t,n){t.Yb.Qa();t.Yb.D(t.h,"timeupdate",(function(){var e=t.h.currentTime,i=t.Ra(),r=t.V(),a=r?t.g.streaming.safeSeekOffset:0;0<n?(!r||1<=n)&&Math.floor(e)>=Math.floor(i.end)&&t.Fd():Math.floor(e)<=Math.floor(i.start+a)&&t.Fd()}))}function Cv(t){if(t.A&&t.P){var n=t.A.g,e="playing";t.P.g==Nu?e="buffering":t.Ud()?e="ended":t.h.paused&&(e="paused");var i=e;if(null==n.g)n.g={timestamp:Date.now()/1e3,state:i,duration:0},n=true;else{var r=Date.now()/1e3;n.g.duration=r-n.g.timestamp;n.g.state==i?n=false:(n.h.push(n.g),n.g={timestamp:r,state:i,duration:0},n=true)}n&&(e=(new Map).set("newstate",e),t.dispatchEvent(Od("statechanged",e)))}}function Pv(t){var n=t.h.playbackRate,e=t.V();if(t.g.streaming.vodDynamicPlaybackRate&&!e){var i=t.g.streaming.vodDynamicPlaybackRateLowBufferRate,r=t.Th();r<=t.g.streaming.vodDynamicPlaybackRateBufferRatio?n!=i&&t.ie(i,false):1==r&&n!==t.K.Oc()&&t.Fd()}if(e&&(e=t.Ra(),Number.isFinite(e.end)&&!(t.h.currentTime<e.start||t.h.paused))){i=t.g.streaming.liveSync.targetLatencyTolerance;r=t.g.streaming.liveSync.dynamicTargetLatency.enabled;var a=t.g.streaming.liveSync.dynamicTargetLatency.stabilityThreshold;if(t.g.streaming.liveSync&&t.g.streaming.liveSync.enabled){var u=t.g.streaming.liveSync.targetLatency;var s=u+i;var o=Math.max(0,u-i);var f=t.g.streaming.liveSync.maxPlaybackRate;var c=t.g.streaming.liveSync.minPlaybackRate}else t.i&&t.i.serviceDescription&&(u=t.i.serviceDescription.targetLatency,null!=t.i.serviceDescription.targetLatency?s=t.i.serviceDescription.targetLatency+i:null!=t.i.serviceDescription.maxLatency&&(s=t.i.serviceDescription.maxLatency),null!=t.i.serviceDescription.targetLatency?o=Math.max(0,t.i.serviceDescription.targetLatency-i):null!=t.i.serviceDescription.minLatency&&(o=t.i.serviceDescription.minLatency),f=t.i.serviceDescription.maxPlaybackRate||t.g.streaming.liveSync.maxPlaybackRate,c=t.i.serviceDescription.minPlaybackRate||t.g.streaming.liveSync.minPlaybackRate);t.U||"number"!==typeof u||(t.U=u);var l=t.g.streaming.liveSync.dynamicTargetLatency.maxAttempts;r&&t.Xb&&null!==t.U&&"number"===typeof u&&t.Ce<l&&Date.now()-t.Xb>1e3*a&&(a=t.g.streaming.liveSync.dynamicTargetLatency.minLatency,t.U=Math.max(t.U-(u-a)/2,a+i),t.Xb=Date.now());r&&null!==t.U&&(s=t.U+i,o=t.U-i);u=e.end-t.h.currentTime;i=0;t.m==rp&&(r=t.h.buffered,0<r.length&&(i=r.end(r.length-1),i=Math.max(f,i-e.end)));e=t.g.streaming.liveSync.panicMode;r=1e3*t.g.streaming.liveSync.panicThreshold;a=Date.now()-t.P.h;e&&!c&&(c=t.g.streaming.liveSync.minPlaybackRate);e&&c&&a<=r?n!=c&&t.ie(c,false):void 0!=s&&f&&u-i>s?(n!=f&&t.ie(f,false),t.Xb=null):void 0!=o&&c&&u-i<o?(n!=c&&t.ie(c,false),t.Xb=null):n!==t.K.Oc()&&(t.Fd(),t.Xb=Date.now())}}function Rv(t){if(t.h){var n=function(n,e){var i=void 0===i?Number.EPSILON:i;if(n===e)i=true;else{var r=Math.abs(n-e);i=r<=i?true:i!==Number.EPSILON?Math.abs(r-i)<=Number.EPSILON:false}return(i||e>n)&&t.Sf<n?(t.Sf=n,true):false},e=t.Ra();e=e.end-e.start;e=0<e?t.h.currentTime/e:0;if(!isNaN(e)){e*=100;if(n(0,e))var i=Od("started");else if(n(25,e))i=Od("firstquartile");else if(n(50,e))i=Od("midpoint");else if(n(75,e))i=Od("thirdquartile");else{if(n(100,e)||100<e)i=Od("complete");t.g&&Infinity!=t.g.playRangeEnd&&t.Ud()&&t.h.pause()}i&&t.dispatchEvent(i)}}}function Dv(t){try{_u(t.re,t.i)}catch(n){return Kv(t,n),false}var n=br(t.i.variants);n=t.M.create(n);t.s.setVariants(Array.from(n.values()));return true}function Lv(t,n,e,i,r){n=void 0===n?true:n;e=void 0===e?0:e;i=void 0===i?false:i;r=void 0===r?true:r;var a;(a=Dv(t)?t.s.chooseVariant():null)&&Ov(t,a,r,n,e,i)}function Ov(t,n,e,i,r,a){a=void 0===a?false:a;var u=t.l.o;if(n==u)i&&_c(t.l,n,i,r,true);else{var s=t.A.h;s.h!=n&&(s.h=n,s.g.push({timestamp:Date.now()/1e3,id:n.id,type:"variant",fromAdaptation:e,bandwidth:n.bandwidth}));_c(t.l,n,i,r,a,e);i=null;u&&(i=hr(u));u=hr(n);u.active=true;if(t.S&&(r=t.S,n=n.video)){n.dependencyStream&&(n=n.dependencyStream);a=0;s=-1;switch(n.mimeType){case"video/webm":a=1;break;case"video/mp4":a=2}switch(t.Vh()){case"DASH":s=1;break;case"HLS":s=0}r.g&&(r.g.setLevelSwitching(n.id,true),r.g.setContainerFormat(a),r.j||r.g.setStreamingFormat(s))}e?(e=(new Map).set("oldTrack",i).set("newTrack",u),e=Od("adaptation",e),Jv(t,e)):Hv(t,i,u);Fv(t,i,u)}}function _v(t,n){var e=Array.from(t.h.audioTracks).find((function(t){return t.enabled}));n.enabled=true;if(e){n.id!==e.id&&(e.enabled=false);var i=Uv(t);e=wr(e,i);n=wr(n,i);Hv(t,e,n);Fv(t,e,n)}}function Uv(t){return t.h&&t.h.videoTracks?Array.from(t.h.videoTracks).find((function(t){return t.selected})):null}function Bv(t){var n=Od("trackschanged");Jv(t,n);Vv(t)}function Hv(t,n,e){n=(new Map).set("oldTrack",n).set("newTrack",e);n=Od("variantchanged",n);Jv(t,n)}function Fv(t,n,e){var i=false;n&&n.audioId==e.audioId&&n.audioGroupId==e.audioGroupId||(i=true);i&&Vv(t)}function Vv(t){var n=Od("audiotrackschanged");Jv(t,n)}function zv(t){var n=Od("textchanged");Jv(t,n)}function Xv(t){var n=Od("texttrackvisibility");Jv(t,n)}function qv(t){t.g.abr.enabled||Gv(t);var n=(new Map).set("newStatus",t.g.abr.enabled);Jv(t,Od("abrstatuschanged",n))}function jv(t){var n=t.Cc().find((function(t){return t.active}));n&&t.o&&t.o.setTextLanguage&&t.o.setTextLanguage(n.language)}function Gv(t,n){n=void 0===n?true:n;if(t.m==ip){t.ve.stop();for(var e=c(t.i.variants),i=e.next();!i.done;i=e.next())i.value.disabledUntilTime=0;n&&Dv(t)}}i.disableStream=function(t,n){if(!this.g.abr.enabled||this.m===np||!navigator.onLine||0==n||!this.i)return false;if(this.i.variants.some((function(n){var e=n[t.type];return e&&e.id!==t.id&&!n.disabledUntilTime?"audio"==t.type?t.language===e.language:true:false}))){for(var e=false,i=false,r=c(this.i.variants),a=r.next();!a.done;a=r.next()){a=a.value;var u=a[t.type];u&&(u.id===t.id?(a.disabledUntilTime=Date.now()/1e3+n,e=true):u.trickModeVideo&&u.trickModeVideo.id==t.id&&(i=true))}if(!e&&i)return false;this.ve.Ga(1);n=this.Lb().video.reduce((function(t,n){return t+n.end-n.start}),0);Lv(this,false,n,true,false);return true}return false};function Kv(t,n){var e,i,r,a,u;return _((function(s){switch(s.g){case 1:if(t.m==np)return s.return();1===n.severity&&t.A.L++;e=true;if(!(t.Ka&&t.i&&t.l)||3016!=n.code&&3014!=n.code&&3015!=n.code&&3024!=n.code&&3018!=n.code){s.u(2);break}i=ft();if("WEBKIT"===i.Da()&&3016==n.code)return s.return();S(s,3);return T(s,ll(t.l),5);case 5:r=s.h;e=!r;r&&(a=Od("mediasourcerecovered"),t.dispatchEvent(a));I(s,2);break;case 3:M(s),e=true;case 2:if(!e)return s.return();2===n.severity&&Gv(t,false);u=Od("error",(new Map).set("detail",n));t.dispatchEvent(u);u.defaultPrevented&&(n.handled=true);E(s)}}))}i.addFont=function(t,n){return $s(t,n)};function Wv(t,n,e,i){i=void 0===i?t:i;t=(new Map).set("detail",{schemeIdUri:e.schemeIdUri,value:e.value,startTime:e.startTime,endTime:e.endTime,id:e.id,timescale:e.timescale,eventElement:e.eventElement,eventNode:e.eventNode});i.dispatchEvent(Od(n,t))}function $v(t,n,e,i){i=void 0===i?false:i;n=(new Map).set("mediaQuality",{bandwidth:n.bandwidth,audioSamplingRate:n.audioSamplingRate,codecs:n.codecs,contentType:n.contentType,frameRate:n.frameRate,height:n.height,mimeType:n.mimeType,channelsCount:n.channelsCount,pixelAspectRatio:n.pixelAspectRatio,width:n.width,label:n.label,roles:n.roles,language:n.language}).set("position",e);t.dispatchEvent(Od(i?"audiotrackchanged":"mediaqualitychanged",n))}function Yv(t,n){n=void 0===n?true:n;if(!t.h.error)return n?new zt(2,3,3016):null;var e=t.h.error.code;if(!n&&1==e)return null;if(n=t.h.error.msExtendedCode)0>n&&(n+=Math.pow(2,32)),n=n.toString(16);return new zt(2,3,3016,e,n,t.h.error.message)}function Qv(t,n,e){0<n&&(t.V()||t.Mi(n));n=t.getDuration();e<n&&(t.V()||t.ob(e))}function Jv(t,n){_((function(e){if(1==e.g)return T(e,Promise.resolve(),2);t.m!=np&&t.dispatchEvent(n);E(e)}))}function Zv(t){var n=new Set;t=c(t);for(var e=t.next();!e.done;e=t.next())e=e.value,e.language?n.add(zi(e.language)):n.add("und");return n}function tp(t){for(var n=new Map,e=new Map,i=0;i<t.length;i++){var r=t[i],a="und",u=[];r.language&&(a=zi(r.language));"variant"==r.type?u=r.audioRoles:u=r.roles;u&&u.length||(u=[""]);n.has(a)||n.set(a,new Set);u=c(u);for(var s=u.next();!s.done;s=u.next())s=s.value,n.get(a).add(s),r.label&&(e.has(a)||e.set(a,new Map),e.get(a).set(s,r.label))}var o=[];n.forEach((function(t,n){t=c(t);for(var i=t.next();!i.done;i=t.next()){i=i.value;var r=null;e.has(n)&&e.get(n).has(i)&&(r=e.get(n).get(i));o.push({language:n,role:i,label:r})}}));return o}i.ua=function(){return this.h&&this.h.remote?"disconnected"!=this.h.remote.state:false};i.Ud=function(){return!this.h||this.h.ended?true:this.Ka&&!this.V()&&this.h.currentTime>=this.Ra().end};q("shaka.Player",Rd);Rd.prototype.isEnded=Rd.prototype.Ud;Rd.prototype.isRemotePlayback=Rd.prototype.ua;Rd.prototype.addFont=Rd.prototype.addFont;Rd.prototype.setVideoContainer=Rd.prototype.Ni;Rd.prototype.getFetchedPlaybackInfo=Rd.prototype.zj;Rd.prototype.getManifestParserFactory=Rd.prototype.Fj;Rd.prototype.getManifest=Rd.prototype.Bg;Rd.prototype.retryStreaming=Rd.prototype.$g;Rd.prototype.setMaxHardwareResolution=Rd.prototype.Uk;Rd.prototype.addChaptersTrack=Rd.prototype.Ee;Rd.prototype.addThumbnailsTrack=Rd.prototype.Fe;Rd.prototype.addTextTrackAsync=Rd.prototype.Ed;Rd.prototype.getStats=Rd.prototype.getStats;Rd.prototype.getBufferedInfo=Rd.prototype.Lb;Rd.prototype.getSegmentAvailabilityDuration=Rd.prototype.Ue;Rd.prototype.getPresentationStartTimeAsDate=Rd.prototype.Cg;Rd.prototype.getPlayheadTimeAsDate=Rd.prototype.Jj;Rd.prototype.setTextTrackVisibility=Rd.prototype.kh;Rd.prototype.getChaptersAsync=Rd.prototype.uj;Rd.prototype.getChapters=Rd.prototype.tj;Rd.prototype.getChaptersTracks=Rd.prototype.vj;Rd.prototype.isTextTrackVisible=Rd.prototype.Jg;Rd.prototype.selectVariantsByLabel=Rd.prototype.Ok;Rd.prototype.selectTextLanguage=Rd.prototype.eh;Rd.prototype.selectAudioLanguage=Rd.prototype.Gi;Rd.prototype.getTextLanguages=Rd.prototype.Pj;Rd.prototype.getAudioLanguages=Rd.prototype.qj;Rd.prototype.getTextLanguagesAndRoles=Rd.prototype.Qj;Rd.prototype.getAudioLanguagesAndRoles=Rd.prototype.rj;Rd.prototype.getVideoTracks=Rd.prototype.getVideoTracks;Rd.prototype.selectVideoTrack=Rd.prototype.Pk;Rd.prototype.getAudioTracks=Rd.prototype.getAudioTracks;Rd.prototype.selectAudioTrack=Rd.prototype.Nk;Rd.prototype.selectVariantTrack=Rd.prototype.Bf;Rd.prototype.selectTextTrack=Rd.prototype.fh;Rd.prototype.getThumbnails=Rd.prototype.Sj;Rd.prototype.getAllThumbnails=Rd.prototype.pj;Rd.prototype.getImageTracks=Rd.prototype.Bj;Rd.prototype.getTextTracks=Rd.prototype.Cc;Rd.prototype.getVariantTracks=Rd.prototype.Ob;Rd.prototype.cancelTrickPlay=Rd.prototype.Fd;Rd.prototype.trickPlay=Rd.prototype.ie;Rd.prototype.useTrickPlayTrackIfAvailable=Rd.prototype.Ah;Rd.prototype.getPlaybackRate=Rd.prototype.sb;Rd.prototype.isBuffering=Rd.prototype.Ig;Rd.prototype.getKeyStatuses=Rd.prototype.Re;Rd.prototype.getActiveSessionsMetadata=Rd.prototype.Ag;Rd.prototype.getExpiration=Rd.prototype.Nd;Rd.prototype.drmInfo=Rd.prototype.drmInfo;Rd.prototype.keySystem=Rd.prototype.keySystem;Rd.prototype.isFullyLoaded=Rd.prototype.ck;Rd.prototype.goToLive=Rd.prototype.Yj;Rd.prototype.seekRange=Rd.prototype.Ra;Rd.prototype.isVideoOnly=Rd.prototype.ik;Rd.prototype.isAudioOnly=Rd.prototype.bk;Rd.prototype.isInProgress=Rd.prototype.Sc;Rd.prototype.isLive=Rd.prototype.V;Rd.prototype.getQueueManager=Rd.prototype.Yh;Rd.prototype.getAdManager=Rd.prototype.Sh;Rd.prototype.getAssetUri=Rd.prototype.kd;Rd.prototype.getNetworkingEngine=Rd.prototype.Nb;Rd.prototype.getMediaElement=Rd.prototype.Ij;Rd.prototype.getManifestType=Rd.prototype.Vh;Rd.prototype.getLoadMode=Rd.prototype.Ej;Rd.prototype.resetConfiguration=Rd.prototype.Bi;Rd.prototype.getBufferFullness=Rd.prototype.Th;Rd.prototype.getNonDefaultConfiguration=Rd.prototype.Xh;Rd.prototype.getConfigurationForLowLatency=Rd.prototype.wj;Rd.prototype.getConfiguration=Rd.prototype.getConfiguration;Rd.prototype.configurationForLowLatency=Rd.prototype.mj;Rd.prototype.configure=Rd.prototype.configure;Rd.prototype.releaseAllMutexes=Rd.prototype.Fk;Rd.prototype.destroyAllPreloads=Rd.prototype.jg;Rd.prototype.preload=Rd.prototype.preload;Rd.prototype.detachAndSavePreload=Rd.prototype.Oh;Rd.prototype.unloadAndSavePreload=Rd.prototype.Xk;Rd.prototype.load=Rd.prototype.load;Rd.prototype.updateStartTime=Rd.prototype.al;Rd.prototype.unload=Rd.prototype.vc;Rd.prototype.detach=Rd.prototype.detach;Rd.prototype.attachCanvas=Rd.prototype.ej;Rd.prototype.attach=Rd.prototype.dc;Rd.probeSupport=function(t){t=void 0===t?true:t;var n,e,i,r,a,u,s;return _((function(o){switch(o.g){case 1:n={};if(!t){o.u(2);break}return T(o,cu(),3);case 3:n=o.h;case 2:return e=Fu(),i=Po(),r=ft(),T(o,r.fc(),4);case 4:return a=o.h,u={manifest:e,media:i,drm:n,hardwareResolution:a},s=up,s.forEach((function(t,n){u[n]=t()})),o.return(u)}}))};Rd.isBrowserSupported=function(){t.Promise||Y("A Promise implementation or polyfill is required");if(!(t.Promise&&t.Uint8Array&&Array.prototype.forEach)||(navigator.userAgent||"").includes("Trident/"))return false;ft();return qy()?true:""!=Ws().canPlayType("application/x-mpegurl")};Rd.setQueueManagerFactory=function(t){op=t};Rd.setAdManagerFactory=function(t){sp=t};Rd.registerSupportPlugin=_d;Rd.prototype.destroy=Rd.prototype.destroy;var np=0,ep=1,ip=2,rp=3;Rd.LoadMode={DESTROYED:np,NOT_LOADED:ep,MEDIA_SOURCE:ip,SRC_EQUALS:rp};Rd.version="v4.15.5";var ap=["4","15"];wt=new function(t){this.g=t;this.i=pt;this.h=mt}(new dt(Number(ap[0]),Number(ap[1])));var up=new Map,sp=null,op=null;function fp(){this.g=[];this.i=this.m=this.l=this.j=this.h=0}function cp(t){return t.g.length?t.g.reduce((function(t,n){return t+n}),0)/t.g.length:0}function lp(t,n,e){var i=this;this.g=t;this.h=n;this.m=e;this.i=false;this.j=this.h.getVolume();this.l=new it;this.l.D(this.h,google.ima.AdEvent.Type.PAUSED,(function(){i.i=true}));this.l.D(this.h,google.ima.AdEvent.Type.RESUMED,(function(){i.i=false}))}i=lp.prototype;i.needsSkipUI=function(){return false};i.isClientRendering=function(){return true};i.hasCustomClick=function(){return true};i.isUsingAnotherMediaElement=function(){return true};i.getDuration=function(){return this.g.getDuration()};i.getMinSuggestedDuration=function(){return this.g.getMinSuggestedDuration()};i.getRemainingTime=function(){return this.h.getRemainingTime()};i.isPaused=function(){return this.i};i.isSkippable=function(){return 0<=this.g.getSkipTimeOffset()};i.getTimeUntilSkippable=function(){var t=this.g.getSkipTimeOffset();t=this.getRemainingTime()-t;return Math.max(t,0)};i.canSkipNow=function(){return this.h.getAdSkippableState()};i.skip=function(){return this.h.skip()};i.pause=function(){return this.h.pause()};i.play=function(){return this.h.resume()};i.getVolume=function(){return this.h.getVolume()};i.setVolume=function(t){this.m.volume=t;return this.h.setVolume(t)};i.isMuted=function(){return 0==this.h.getVolume()};i.isLinear=function(){return this.g.isLinear()};i.resize=function(t,n){this.h.resize(t,n)};i.setMuted=function(t){(this.m.muted=t)?(this.j=this.getVolume(),this.h.setVolume(0)):this.h.setVolume(this.j)};i.getSequenceLength=function(){var t=this.g.getAdPodInfo();return null==t?1:t.getTotalAds()};i.getPositionInSequence=function(){var t=this.g.getAdPodInfo();return null==t?1:t.getAdPosition()};i.getTitle=function(){return this.g.getTitle()};i.getDescription=function(){return this.g.getDescription()};i.getVastMediaBitrate=function(){return this.g.getVastMediaBitrate()};i.getVastMediaHeight=function(){return this.g.getVastMediaHeight()};i.getVastMediaWidth=function(){return this.g.getVastMediaWidth()};i.getVastAdId=function(){return""};i.getAdId=function(){return this.g.getAdId()};i.getCreativeAdId=function(){return this.g.getCreativeAdId()};i.getAdvertiserName=function(){return this.g.getAdvertiserName()};i.getMediaUrl=function(){return this.g.getMediaUrl()};i.getTimeOffset=function(){var t=this.g.getAdPodInfo();return null==t?0:t.getTimeOffset()};i.getPodIndex=function(){var t=this.g.getAdPodInfo();return null==t?0:t.getPodIndex()};i.release=function(){this.h=this.g=null};q("shaka.ads.ClientSideAd",lp);lp.prototype.release=lp.prototype.release;lp.prototype.getPodIndex=lp.prototype.getPodIndex;lp.prototype.getTimeOffset=lp.prototype.getTimeOffset;lp.prototype.getMediaUrl=lp.prototype.getMediaUrl;lp.prototype.getAdvertiserName=lp.prototype.getAdvertiserName;lp.prototype.getCreativeAdId=lp.prototype.getCreativeAdId;lp.prototype.getAdId=lp.prototype.getAdId;lp.prototype.getVastAdId=lp.prototype.getVastAdId;lp.prototype.getVastMediaWidth=lp.prototype.getVastMediaWidth;lp.prototype.getVastMediaHeight=lp.prototype.getVastMediaHeight;lp.prototype.getVastMediaBitrate=lp.prototype.getVastMediaBitrate;lp.prototype.getDescription=lp.prototype.getDescription;lp.prototype.getTitle=lp.prototype.getTitle;lp.prototype.getPositionInSequence=lp.prototype.getPositionInSequence;lp.prototype.getSequenceLength=lp.prototype.getSequenceLength;lp.prototype.setMuted=lp.prototype.setMuted;lp.prototype.resize=lp.prototype.resize;lp.prototype.isLinear=lp.prototype.isLinear;lp.prototype.isMuted=lp.prototype.isMuted;lp.prototype.setVolume=lp.prototype.setVolume;lp.prototype.getVolume=lp.prototype.getVolume;lp.prototype.play=lp.prototype.play;lp.prototype.pause=lp.prototype.pause;lp.prototype.skip=lp.prototype.skip;lp.prototype.canSkipNow=lp.prototype.canSkipNow;lp.prototype.getTimeUntilSkippable=lp.prototype.getTimeUntilSkippable;lp.prototype.isSkippable=lp.prototype.isSkippable;lp.prototype.isPaused=lp.prototype.isPaused;lp.prototype.getRemainingTime=lp.prototype.getRemainingTime;lp.prototype.getMinSuggestedDuration=lp.prototype.getMinSuggestedDuration;lp.prototype.getDuration=lp.prototype.getDuration;lp.prototype.isUsingAnotherMediaElement=lp.prototype.isUsingAnotherMediaElement;lp.prototype.hasCustomClick=lp.prototype.hasCustomClick;lp.prototype.isClientRendering=lp.prototype.isClientRendering;lp.prototype.needsSkipUI=lp.prototype.needsSkipUI;function hp(){}function dp(t,n){var e=[];t=c(ee(t,"Ad"));for(var i=t.next();!i.done;i=t.next())if(i=ue(i.value,"InLine"))if(i=ue(i,"Creatives")){i=c(ee(i,"Creative"));for(var r=i.next();!r.done;r=i.next()){r=r.value;var a=ue(r,"Linear");a&&vp(e,n,a);if(r=ue(r,"NonLinearAds")){r=ee(r,"NonLinear");r=c(r);for(var u=r.next();!u.done;u=r.next())t:{a=e;var s=n,o=u.value,f=ue(o,"StaticResource");if(f)u=f.attributes.creativeType;else{f=ue(o,"HTMLResource");if(!f)break t;u="text/html"}if(f=re(f)){"text/html"===u&&(f="data:text/html;charset=UTF-8,"+encodeURIComponent(f));var l=oe(o,"width",pe)||oe(o,"expandedWidth",pe),h=oe(o,"height",pe)||oe(o,"expandedHeight",pe);if(l||h){var d=null;(o=o.attributes.minSuggestedDuration)&&(d=qn(o));o=0;null!=s&&(o=s);a.push({id:null,groupId:null,startTime:o,endTime:null,uri:f,mimeType:u,isSkippable:false,skipOffset:null,skipFor:null,canJump:false,resumeOffset:0,playoutLimit:d,once:true,pre:null==s,post:Infinity==s,timelineRange:false,loop:false,overlay:{viewport:{x:0,y:0},topLeft:{x:0,y:0},size:{x:l||0,y:h||0}},displayOnBackground:false,currentVideo:null,background:null})}}}}}}return e}function vp(t,n,e){var i=0;null!=n&&(i=n);var r=null;e.attributes.skipoffset&&(r=qn(e.attributes.skipoffset),isNaN(r)&&(r=null));if(e=ue(e,"MediaFiles")){var a=ee(e,"MediaFile");e=a;a=a.filter((function(t){return"streaming"==t.attributes.delivery}));a.length&&(e=a);e=e.sort((function(t,n){return(parseInt(n.attributes.height,10)||0)-(parseInt(t.attributes.height,10)||0)}));e=c(e);for(a=e.next();!a.done;a=e.next())if(a=a.value,!a.attributes.apiFramework){var u=re(a);if(u){t.push({id:null,groupId:null,startTime:i,endTime:null,uri:u,mimeType:a.attributes.type||null,isSkippable:null!=r,skipOffset:r,skipFor:null,canJump:false,resumeOffset:0,playoutLimit:null,once:true,pre:null==n,post:Infinity==n,timelineRange:false,loop:false,overlay:null,displayOnBackground:false,currentVideo:null,background:null});break}}}}q("shaka.ads.Utils",hp);hp.ADS_LOADED="ads-loaded";hp.AD_STARTED="ad-started";hp.AD_FIRST_QUARTILE="ad-first-quartile";hp.AD_MIDPOINT="ad-midpoint";hp.AD_THIRD_QUARTILE="ad-third-quartile";hp.AD_COMPLETE="ad-complete";hp.AD_STOPPED="ad-stopped";hp.AD_SKIPPED="ad-skipped";hp.AD_VOLUME_CHANGED="ad-volume-changed";hp.AD_MUTED="ad-muted";hp.AD_PAUSED="ad-paused";hp.AD_RESUMED="ad-resumed";hp.AD_SKIP_STATE_CHANGED="ad-skip-state-changed";hp.CUEPOINTS_CHANGED="ad-cue-points-changed";hp.IMA_AD_MANAGER_LOADED="ima-ad-manager-loaded";hp.IMA_STREAM_MANAGER_LOADED="ima-stream-manager-loaded";hp.AD_CLICKED="ad-clicked";hp.AD_PROGRESS="ad-progress";hp.AD_BUFFERING="ad-buffering";hp.AD_IMPRESSION="ad-impression";hp.AD_DURATION_CHANGED="ad-duration-changed";hp.AD_CLOSED="ad-closed";hp.AD_LOADED="ad-loaded";hp.ALL_ADS_COMPLETED="all-ads-completed";hp.AD_LINEAR_CHANGED="ad-linear-changed";hp.AD_METADATA="ad-metadata";hp.AD_RECOVERABLE_ERROR="ad-recoverable-error";hp.AD_ERROR="ad-error";hp.AD_BREAK_READY="ad-break-ready";hp.AD_INTERACTION="ad-interaction";hp.AD_CONTENT_PAUSE_REQUESTED="ad-content-pause-requested";hp.AD_CONTENT_RESUME_REQUESTED="ad-content-resume-requested";hp.AD_CONTENT_ATTACH_REQUESTED="ad-content-attach-requested";function pp(t,n,e,i,r){var a=this;this.s=t;this.i=n;this.F=false;this.A=this.o=null;this.G=NaN;this.l=r;this.j=null;this.h=new it;google.ima.settings.setLocale(e);google.ima.settings.setDisableCustomPlaybackForIOS10Plus(true);this.C=new google.ima.AdDisplayContainer(this.s,this.i);this.C.initialize();this.m=new google.ima.AdsLoader(this.C);this.m.getSettings().setPlayerType("shaka-player");this.m.getSettings().setPlayerVersion("v4.15.5");this.g=null;this.B=i||new google.ima.AdsRenderingSettings;this.h.D(this.m,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,(function(t){wp(a,t)}));this.h.D(this.m,google.ima.AdErrorEvent.Type.AD_ERROR,(function(t){mp(a,t)}));this.h.D(this.i,"ended",(function(){a.m.contentComplete()}));this.h.za(this.i,"play",(function(){a.F=true}))}pp.prototype.configure=function(t){this.o=t};pp.prototype.stop=function(){this.g&&this.g.stop();this.s&&Ks(this.s)};pp.prototype.release=function(){this.stop();this.A&&this.A.disconnect();this.h&&this.h.release();this.g&&this.g.destroy();this.m.destroy();this.C.destroy()};function mp(t,n){n.getError();n=(new Map).set("originalEvent",n);t.l(new Jr("ad-error",n));yp(t,null);t.l(new Jr("ad-cue-points-changed",(new Map).set("cuepoints",[])))}function wp(n,e){n.l(new Jr("ads-loaded",(new Map).set("loadTime",Date.now()/1e3-n.G)));if(n.o.customPlayheadTracker){var i={currentTime:n.i.currentTime};n.g=e.getAdsManager(i,n.B);n.i.muted?n.g.setVolume(0):n.g.setVolume(n.i.volume);n.h.D(n.i,"timeupdate",(function(){n.i.duration&&(i.currentTime=n.i.currentTime)}));n.h.D(n.i,"volumechange",(function(){n.j&&(n.j.setVolume(n.i.volume),n.i.muted&&n.j.setMuted(true))}))}else n.g=e.getAdsManager(n.i,n.B);n.l(new Jr("ima-ad-manager-loaded",(new Map).set("imaAdManager",n.g)));var r=n.g.getCuePoints();if(r.length){e=[];r=c(r);for(var a=r.next();!a.done;a=r.next())e.push({start:a.value,end:null});n.l(new Jr("ad-cue-points-changed",(new Map).set("cuepoints",e)))}gp(n);try{n.g.init(n.i.offsetWidth,n.i.offsetHeight),n.h.D(n.i,"loadeddata",(function(){n.g.resize(n.i.offsetWidth,n.i.offsetHeight)})),"ResizeObserver"in t?(n.A=new ResizeObserver((function(){n.g.resize(n.i.offsetWidth,n.i.offsetHeight)})),n.A.observe(n.i)):n.h.D(document,"fullscreenchange",(function(){n.g.resize(n.i.offsetWidth,n.i.offsetHeight)})),n.F||n.o.skipPlayDetection?n.g.start():n.h.za(n.i,"play",(function(){n.F=true;n.g.start()}))}catch(t){yp(n,null)}}function gp(t){function n(n,e){n=(new Map).set("originalEvent",n);t.l(new Jr(e,n))}t.h.D(t.g,google.ima.AdErrorEvent.Type.AD_ERROR,(function(n){mp(t,n)}));t.h.D(t.g,google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,(function(n){bp(t,n)}));t.h.D(t.g,google.ima.AdEvent.Type.STARTED,(function(n){bp(t,n)}));t.h.D(t.g,google.ima.AdEvent.Type.FIRST_QUARTILE,(function(t){n(t,"ad-first-quartile")}));t.h.D(t.g,google.ima.AdEvent.Type.MIDPOINT,(function(t){n(t,"ad-midpoint")}));t.h.D(t.g,google.ima.AdEvent.Type.THIRD_QUARTILE,(function(t){n(t,"ad-third-quartile")}));t.h.D(t.g,google.ima.AdEvent.Type.COMPLETE,(function(t){n(t,"ad-complete")}));t.h.D(t.g,google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,(function(n){yp(t,n)}));t.h.D(t.g,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,(function(n){yp(t,n)}));t.h.D(t.g,google.ima.AdEvent.Type.SKIPPED,(function(t){n(t,"ad-skipped")}));t.h.D(t.g,google.ima.AdEvent.Type.VOLUME_CHANGED,(function(t){n(t,"ad-volume-changed")}));t.h.D(t.g,google.ima.AdEvent.Type.VOLUME_MUTED,(function(t){n(t,"ad-muted")}));t.h.D(t.g,google.ima.AdEvent.Type.PAUSED,(function(e){t.j&&(t.j.i=true,n(e,"ad-paused"))}));t.h.D(t.g,google.ima.AdEvent.Type.RESUMED,(function(e){t.j&&(t.j.i=false,n(e,"ad-resumed"))}));t.h.D(t.g,google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,(function(e){t.j&&n(e,"ad-skip-state-changed")}));t.h.D(t.g,google.ima.AdEvent.Type.CLICK,(function(t){n(t,"ad-clicked")}));t.h.D(t.g,google.ima.AdEvent.Type.AD_PROGRESS,(function(t){n(t,"ad-progress")}));t.h.D(t.g,google.ima.AdEvent.Type.AD_BUFFERING,(function(t){n(t,"ad-buffering")}));t.h.D(t.g,google.ima.AdEvent.Type.IMPRESSION,(function(t){n(t,"ad-impression")}));t.h.D(t.g,google.ima.AdEvent.Type.DURATION_CHANGE,(function(t){n(t,"ad-duration-changed")}));t.h.D(t.g,google.ima.AdEvent.Type.USER_CLOSE,(function(t){n(t,"ad-closed")}));t.h.D(t.g,google.ima.AdEvent.Type.LOADED,(function(t){n(t,"ad-loaded")}));t.h.D(t.g,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,(function(t){n(t,"all-ads-completed")}));t.h.D(t.g,google.ima.AdEvent.Type.LINEAR_CHANGED,(function(t){n(t,"ad-linear-changed")}));t.h.D(t.g,google.ima.AdEvent.Type.AD_METADATA,(function(t){n(t,"ad-metadata")}));t.h.D(t.g,google.ima.AdEvent.Type.LOG,(function(t){n(t,"ad-recoverable-error")}));t.h.D(t.g,google.ima.AdEvent.Type.AD_BREAK_READY,(function(t){n(t,"ad-break-ready")}));t.h.D(t.g,google.ima.AdEvent.Type.INTERACTION,(function(t){n(t,"ad-interaction")}))}function bp(t,n){var e=n.getAd();e?(t.j=new lp(e,t.g,t.i),n.type!=google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED||t.o.supportsMultipleMediaElements||t.l(new Jr("ad-content-pause-requested")),n=(new Map).set("ad",t.j).set("sdkAdObject",e).set("originalEvent",n),t.l(new Jr("ad-started",n)),t.j.isLinear()&&(t.s.setAttribute("ad-active","true"),t.o.customPlayheadTracker||t.i.pause(),t.i.muted?(n=t.j,n.j=t.i.volume,n.h.setVolume(0)):t.j.setVolume(t.i.volume))):Y("The IMA SDK fired a "+n.type+" event with no associated ad. Unable to play ad!")}function yp(t,n){n&&n.type==google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED&&!t.o.supportsMultipleMediaElements&&t.l(new Jr("ad-content-resume-requested"));t.l(new Jr("ad-stopped",(new Map).set("originalEvent",n)));t.j&&t.j.isLinear()&&(t.s.removeAttribute("ad-active"),t.o.customPlayheadTracker||t.i.ended||t.i.play())}function kp(t,n,e,i,r,a){this.g=t;this.i=n;this.j=(this.h=n.isSkippable)?n.skipOffset||0:n.skipOffset;this.l=n.skipFor;this.A=e;this.o=i;this.m=r;this.s=a;this.B=n.overlay}i=kp.prototype;i.needsSkipUI=function(){return true};i.isClientRendering=function(){return true};i.hasCustomClick=function(){return false};i.isUsingAnotherMediaElement=function(){return this.s};i.getDuration=function(){var t=this.g.duration;return isNaN(t)?-1:t};i.getMinSuggestedDuration=function(){return this.getDuration()};i.getRemainingTime=function(){var t=this.g.duration;return isNaN(t)?-1:t-this.g.currentTime};i.isPaused=function(){return this.g.paused};i.isSkippable=function(){return this.h&&null!=this.l?this.getDuration()-this.getRemainingTime()<this.j+this.l:this.h};i.getTimeUntilSkippable=function(){if(this.isSkippable()){var t=this.getRemainingTime()+this.j-this.getDuration();return Math.max(t,0)}return Math.max(this.getRemainingTime(),0)};i.canSkipNow=function(){return this.h&&0==this.getTimeUntilSkippable()};i.skip=function(){this.canSkipNow()&&this.A()};i.pause=function(){return this.g.pause()};i.play=function(){return this.g.play()};i.getVolume=function(){return this.g.volume};i.setVolume=function(t){this.g.volume=t};i.isMuted=function(){return this.g.muted};i.isLinear=function(){return null==this.B};i.resize=function(){};i.setMuted=function(t){this.g.muted=t};i.getSequenceLength=function(){return this.o};i.getPositionInSequence=function(){return this.m};i.getTitle=function(){return""};i.getDescription=function(){return""};i.getVastMediaBitrate=function(){return 0};i.getVastMediaHeight=function(){return 0};i.getVastMediaWidth=function(){return 0};i.getVastAdId=function(){return""};i.getAdId=function(){return this.i.id||""};i.getCreativeAdId=function(){return""};i.getAdvertiserName=function(){return""};i.getMediaUrl=function(){return this.i.uri};i.getTimeOffset=function(){return 0};i.getPodIndex=function(){return 0};i.release=function(){this.g=null};q("shaka.ads.InterstitialAd",kp);kp.prototype.release=kp.prototype.release;kp.prototype.getPodIndex=kp.prototype.getPodIndex;kp.prototype.getTimeOffset=kp.prototype.getTimeOffset;kp.prototype.getMediaUrl=kp.prototype.getMediaUrl;kp.prototype.getAdvertiserName=kp.prototype.getAdvertiserName;kp.prototype.getCreativeAdId=kp.prototype.getCreativeAdId;kp.prototype.getAdId=kp.prototype.getAdId;kp.prototype.getVastAdId=kp.prototype.getVastAdId;kp.prototype.getVastMediaWidth=kp.prototype.getVastMediaWidth;kp.prototype.getVastMediaHeight=kp.prototype.getVastMediaHeight;kp.prototype.getVastMediaBitrate=kp.prototype.getVastMediaBitrate;kp.prototype.getDescription=kp.prototype.getDescription;kp.prototype.getTitle=kp.prototype.getTitle;kp.prototype.getPositionInSequence=kp.prototype.getPositionInSequence;kp.prototype.getSequenceLength=kp.prototype.getSequenceLength;kp.prototype.setMuted=kp.prototype.setMuted;kp.prototype.resize=kp.prototype.resize;kp.prototype.isLinear=kp.prototype.isLinear;kp.prototype.isMuted=kp.prototype.isMuted;kp.prototype.setVolume=kp.prototype.setVolume;kp.prototype.getVolume=kp.prototype.getVolume;kp.prototype.play=kp.prototype.play;kp.prototype.pause=kp.prototype.pause;kp.prototype.skip=kp.prototype.skip;kp.prototype.canSkipNow=kp.prototype.canSkipNow;kp.prototype.getTimeUntilSkippable=kp.prototype.getTimeUntilSkippable;kp.prototype.isSkippable=kp.prototype.isSkippable;kp.prototype.isPaused=kp.prototype.isPaused;kp.prototype.getRemainingTime=kp.prototype.getRemainingTime;kp.prototype.getMinSuggestedDuration=kp.prototype.getMinSuggestedDuration;kp.prototype.getDuration=kp.prototype.getDuration;kp.prototype.isUsingAnotherMediaElement=kp.prototype.isUsingAnotherMediaElement;kp.prototype.hasCustomClick=kp.prototype.hasCustomClick;kp.prototype.isClientRendering=kp.prototype.isClientRendering;kp.prototype.needsSkipUI=kp.prototype.needsSkipUI;function Tp(t,n,e){this.g=t;this.j=n;this.h=e;this.i=null==t.overlay}i=Tp.prototype;i.needsSkipUI=function(){return true};i.isClientRendering=function(){return true};i.hasCustomClick=function(){return false};i.isUsingAnotherMediaElement=function(){return false};i.getDuration=function(){return-1};i.getMinSuggestedDuration=function(){return this.getDuration()};i.getRemainingTime=function(){return-1};i.isPaused=function(){return false};i.isSkippable=function(){return false};i.getTimeUntilSkippable=function(){return 0};i.canSkipNow=function(){return false};i.skip=function(){};i.pause=function(){};i.play=function(){};i.getVolume=function(){return 1};i.setVolume=function(){};i.isMuted=function(){return false};i.isLinear=function(){return this.i};i.resize=function(){};i.setMuted=function(){};i.getSequenceLength=function(){return this.j};i.getPositionInSequence=function(){return this.h};i.getTitle=function(){return""};i.getDescription=function(){return""};i.getVastMediaBitrate=function(){return 0};i.getVastMediaHeight=function(){return 0};i.getVastMediaWidth=function(){return 0};i.getVastAdId=function(){return""};i.getAdId=function(){return this.g.id||""};i.getCreativeAdId=function(){return""};i.getAdvertiserName=function(){return""};i.getMediaUrl=function(){return this.g.uri};i.getTimeOffset=function(){return 0};i.getPodIndex=function(){return 0};i.release=function(){};q("shaka.ads.InterstitialStaticAd",Tp);Tp.prototype.release=Tp.prototype.release;Tp.prototype.getPodIndex=Tp.prototype.getPodIndex;Tp.prototype.getTimeOffset=Tp.prototype.getTimeOffset;Tp.prototype.getMediaUrl=Tp.prototype.getMediaUrl;Tp.prototype.getAdvertiserName=Tp.prototype.getAdvertiserName;Tp.prototype.getCreativeAdId=Tp.prototype.getCreativeAdId;Tp.prototype.getAdId=Tp.prototype.getAdId;Tp.prototype.getVastAdId=Tp.prototype.getVastAdId;Tp.prototype.getVastMediaWidth=Tp.prototype.getVastMediaWidth;Tp.prototype.getVastMediaHeight=Tp.prototype.getVastMediaHeight;Tp.prototype.getVastMediaBitrate=Tp.prototype.getVastMediaBitrate;Tp.prototype.getDescription=Tp.prototype.getDescription;Tp.prototype.getTitle=Tp.prototype.getTitle;Tp.prototype.getPositionInSequence=Tp.prototype.getPositionInSequence;Tp.prototype.getSequenceLength=Tp.prototype.getSequenceLength;Tp.prototype.setMuted=Tp.prototype.setMuted;Tp.prototype.resize=Tp.prototype.resize;Tp.prototype.isLinear=Tp.prototype.isLinear;Tp.prototype.isMuted=Tp.prototype.isMuted;Tp.prototype.setVolume=Tp.prototype.setVolume;Tp.prototype.getVolume=Tp.prototype.getVolume;Tp.prototype.play=Tp.prototype.play;Tp.prototype.pause=Tp.prototype.pause;Tp.prototype.skip=Tp.prototype.skip;Tp.prototype.canSkipNow=Tp.prototype.canSkipNow;Tp.prototype.getTimeUntilSkippable=Tp.prototype.getTimeUntilSkippable;Tp.prototype.isSkippable=Tp.prototype.isSkippable;Tp.prototype.isPaused=Tp.prototype.isPaused;Tp.prototype.getRemainingTime=Tp.prototype.getRemainingTime;Tp.prototype.getMinSuggestedDuration=Tp.prototype.getMinSuggestedDuration;Tp.prototype.getDuration=Tp.prototype.getDuration;Tp.prototype.isUsingAnotherMediaElement=Tp.prototype.isUsingAnotherMediaElement;Tp.prototype.hasCustomClick=Tp.prototype.hasCustomClick;Tp.prototype.isClientRendering=Tp.prototype.isClientRendering;Tp.prototype.needsSkipUI=Tp.prototype.needsSkipUI;function Ep(t,n,e,i){var r=this;this.M=null;this.B=t;this.C=n;this.g=e;this.G=null;this.A=true;this.h=this.g;this.i=i;this.U=new Set;this.H=new Set;this.F=new Map;this.L=new Map;this.j=new Rd;Bp(this);this.I=new it;this.l=new it;this.K=false;this.ia=this.o=this.s=this.m=null;this.ka=false;this.P=-1;this.ba=function(){if(!r.K&&r.m&&!r.C.ua()){r.m=r.g.currentTime;var t=Cp(r);t&&Pp(r,t,1,1,Date.now())}};this.W=function(){if(!(r.K||r.m||r.C.ua())){r.m=r.g.currentTime;var t=Cp(r,true);t&&Pp(r,t,1,1,Date.now())}};this.oa=function(){if(!r.K&&r.m&&!r.C.ua()){var t=r.g.currentTime;r.s&&!r.s.pre&&!r.s.post&&t<(r.s.endTime||r.s.startTime)&&(r.s=null)}};this.S=new Di(this.ba);this.N=new Di((function(){var t,n,e,i,a,u,s,o,f,l,h;return _((function(d){switch(d.g){case 1:if(!r.H.size||null==r.m){d.u(0);break}t=r.C.m;if(t==np||t==ep)return d.return();n=false;e=Array.from(r.H);i=r.C.Ra();a=c(e);u=a.next();case 3:if(u.done){d.u(5);break}s=u.value;if(s==r.s){d.u(4);break}o=s.endTime||s.startTime;if(!(1<=i.start-o)){f=s.startTime-r.m;0<f&&10>=f&&(!r.F.has(s)&&Fp(s)&&r.F.set(s,r.j.preload(s.uri,null,s.mimeType||void 0)),zp(r,s));d.u(4);break}if(!r.F.has(s)){d.u(7);break}return T(d,r.F.get(s),8);case 8:(l=d.h)&&l.destroy(),r.F.delete(s);case 7:Xp(r,s),h=JSON.stringify(s),r.U.has(h)&&r.U.delete(h),r.H.delete(s),Ap(r),s.overlay||(n=true);case 4:u=a.next();d.u(3);break;case 5:n&&Up(r),E(d)}}))}));this.configure(this.C.getConfiguration().ads)}i=Ep.prototype;i.configure=function(t){this.M=t;Ip(this)};function Sp(t){if(!t.ka&&t.H.size){t.I.D(t.g,"playing",t.W);t.I.D(t.g,"timeupdate",t.W);t.I.D(t.g,"seeked",t.oa);t.I.D(t.g,"ended",t.ba);if("requestVideoFrameCallback"in t.g&&!Vp()){var n=t.g,e=function(){-1!=t.P&&(t.ba(),-1!=t.P&&(t.P=n.requestVideoFrameCallback(e)))};t.P=n.requestVideoFrameCallback(e)}else t.S.Ga(.025);t.N&&t.N.Ga(1);t.ka=true}}function Ap(t){t.ka&&!t.H.size&&(t.I.Ja(t.g,"playing",t.W),t.I.Ja(t.g,"timeupdate",t.W),t.I.Ja(t.g,"seeked",t.oa),t.I.Ja(t.g,"ended",t.ba),-1!=t.P&&(t.g.cancelVideoFrameCallback(t.P),t.P=-1),t.S&&t.S.stop(),t.N&&t.N.stop(),t.ka=false)}function Ip(t){if(t.B&&t.M&&!t.K){var n=t.M.supportsMultipleMediaElements,e=t.g;e.webkitSupportsFullscreen&&e.webkitDisplayingFullscreen&&(n=false);t.A==n&&(t.A=!n,t.A?(t.h=t.g,t.G&&(t.G.parentElement&&t.B.removeChild(t.G),t.G=null)):(t.G||(n=document.createElement(t.g.tagName),n.autoplay=true,n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.width="100%",n.style.height="100%",n.style.display="none",n.setAttribute("playsinline",""),t.G=n),t.h=t.G))}else t.A=true}i.stop=function(){this.l&&this.l.Qa();this.U.clear();this.H.clear();this.j.jg();if(this.F.size){var t=Array.from(this.F.values());t=c(t);for(var n=t.next();!n.done;n=t.next())(n=n.value)&&n.then((function(t){t&&t.destroy()}))}this.F.clear();if(this.L.size)for(t=Array.from(this.L.keys()),t=c(t),n=t.next();!n.done;n=t.next())Xp(this,n.value);this.L.clear();this.j.detach();this.K=false;this.s=this.m=null;this.A=true;this.h=this.g;this.G=null;Op(this);Ap(this);this.B&&Ks(this.B);this.o&&(this.o.stop(),this.o=null)};i.release=function(){this.stop();this.I&&this.I.release();this.l&&this.l.release();this.S&&(this.S.stop(),this.S=null);this.N&&(this.N.stop(),this.N=null);this.j.destroy()};i.ld=function(){return this.j};function Mp(t,n){var e;_((function(i){if(1==i.g)return Bp(t),T(i,_p(t,n),2);e=i.h;e.length?Np(t,e):Y("Unsupported HLS interstitial",n);E(i)}))}function xp(t,n){var e=ue(n.eventNode,"OverlayEvent"),i=e.attributes.uri,r=e.attributes.mimeType,a="true"==e.attributes.loop,u=oe(e,"z",pe);if(i&&0!=u){var s=null,o=ue(e,"Background");if(o){var f=o.attributes.uri;f?s="center / contain no-repeat url('"+f+"')":s=re(o)}o=1920;f=1080;var c=ue(e,"Viewport");if(c){o=oe(c,"x",pe);if(null==o)return;f=oe(c,"y",pe);if(null==f)return}var l={viewport:{x:o,y:f},topLeft:{x:0,y:0},size:{x:o,y:f}},h=ue(e,"Overlay");if(c&&h){var d=ue(h,"TopLeft"),v=ue(h,"Size");if(d&&v){h=oe(d,"x",pe);if(null==h)return;d=oe(d,"y",pe);if(null==d)return;var p=oe(v,"x",pe);if(null==p)return;v=oe(v,"y",pe);if(null==v)return;l.topLeft.x=h;l.topLeft.y=d;l.size.x=p;l.size.y=v}}h=null;e=ue(e,"Squeeze");if(c&&e&&(v=ue(e,"TopLeft"),e=ue(e,"Size"),v&&e)){c=oe(v,"x",pe);if(null==c)return;h=oe(v,"y",pe);if(null==h)return;v=oe(e,"x",pe);if(null==v)return;e=oe(e,"y",pe);if(null==e)return;h={viewport:{x:o,y:f},topLeft:{x:c,y:h},size:{x:v,y:e}}}Np(t,[{id:n.id,groupId:null,startTime:n.startTime,endTime:n.endTime,uri:i,mimeType:r,isSkippable:false,skipOffset:null,skipFor:null,canJump:true,resumeOffset:null,playoutLimit:null,once:false,pre:false,post:false,timelineRange:true,loop:a,overlay:l,displayOnBackground:-1==u,currentVideo:h,background:s}])}}i.addAdUrlInterstitial=function(t){var n=this,e,i,r,a,u,s,o,f,h;return _((function(d){switch(d.g){case 1:return e={type:12},T(d,Hp(n,t,e),2);case 2:i=d.h;r=Yn(i,"VAST,vmap:VMAP");if(!r)throw new zt(2,10,10007);a=[];if("VAST"==r.tagName){a=dp(r,n.m);d.u(3);break}if("vmap:VMAP"!=r.tagName){d.u(3);break}for(var v=[],p=c(ee(r,"vmap:AdBreak")),m=p.next();!m.done;m=p.next()){var w=m.value,g=w.attributes.timeOffset;g&&(m=null,"start"==g?m=0:"end"==g?m=Infinity:m=qn(g),(w=ue(w,"vmap:AdSource"))&&(w=ue(w,"vmap:AdTagURI"))&&(w=ie(w))&&v.push({time:m,uri:w}))}u=c(v);s=u.next();case 5:if(s.done){d.u(3);break}o=s.value;return T(d,Hp(n,o.uri,e),8);case 8:f=d.h;h=Yn(f,"VAST");if(!h)throw new zt(2,10,10007);a.push.apply(a,l(dp(h,o.time)));s=u.next();d.u(5);break;case 3:Np(n,a),E(d)}}))};function Np(t,n){var e,i,r,a,u,s,o,f;_((function(l){switch(l.g){case 1:e=false,i=c(n),r=i.next();case 2:if(r.done){l.u(4);break}a=r.value;if(!a.uri){Y("Missing URL in interstitial",a);l.u(3);break}if(a.mimeType){l.u(5);break}S(l,6);u=t.j.Nb();return T(l,yh(a.uri,u,t.C.getConfiguration().streaming.retryParameters),8);case 8:a.mimeType=l.h;I(l,5);break;case 6:M(l);case 5:s=a.id||JSON.stringify(a);if(t.U.has(s)){l.u(3);break}a.loop&&!a.overlay&&Y("Loop is only supported in overlay interstitials",a);a.overlay||(e=true);t.U.add(s);t.H.add(a);o=false;a.pre&&null==t.m?o=true:0!=a.startTime||a.canJump?null!=t.m&&(f=a.startTime-t.m,0<f&&10>=f&&(o=true)):o=true;o&&(!t.F.has(a)&&Fp(a)&&t.F.set(a,t.j.preload(a.uri,null,a.mimeType||void 0)),zp(t,a));case 3:r=i.next();l.u(2);break;case 4:e&&Up(t),Sp(t),E(l)}}))}function Cp(t,n,e){n=void 0===n?false:n;e=void 0===e?null:e;var i=0,r=null;if(t.H.size&&null!=t.m){var a=t.g.ended,u=Array.from(t.H).sort((function(t,n){return n.startTime-t.startTime})),s=u;s=n?u.filter((function(t){return t.pre})):a?u.filter((function(t){return t.post})):u.filter((function(t){return!t.pre&&!t.post}));u=c(s);for(s=u.next();!s.done;s=u.next()){s=s.value;var o=false;if(n)o=s.pre;else if(a)o=s.post;else if(!s.pre&&!s.post){var f=t.m-Math.round(1e3*s.startTime)/1e3,l=1;t.M.allowStartInMiddleOfInterstitial&&s.endTime&&Infinity!=s.endTime&&(l=s.endTime-s.startTime);0<f&&(f<=l||!s.canJump)&&(o=null==e&&t.s&&!t.s.pre&&!t.s.post&&t.s.startTime>=s.startTime?false:true)}o&&(!t.s||s.startTime>=t.s.startTime)&&(i==(e||0)?r=s:r&&!s.canJump&&.001<Math.round(1e3*s.startTime)/1e3-Math.round(1e3*r.startTime)/1e3&&(r=s,i=0),i++)}}return r}function Pp(t,n,e,i,r,a){a=void 0===a?0:a;t.s=n;Ip(t);t.A||!t.B||t.h.parentElement||t.B.appendChild(t.h);1==i&&1==e&&(e=Array.from(t.H).filter((function(t){return n.pre?t.pre==n.pre:n.post?t.post==n.post:.001>Math.abs(t.startTime-n.startTime)})).length);n.once&&(a++,t.H.delete(n),Ap(t),n.overlay||Up(t));n.mimeType&&(n.mimeType.startsWith("image/")||"text/html"===n.mimeType)?n.overlay?Rp(t,n,e,i,a):Y("Unsupported interstitial",n):t.A&&n.overlay?Y("Unsupported interstitial",n):Dp(t,n,e,i,r,a)}function Rp(t,n,e,i,r){function a(){t.o&&(t.o.stop(),t.o=null);t.B.removeChild(o);Op(t,n);t.i(new Jr("ad-stopped"));t.l.Qa();var a=Cp(t,n.pre,i-r);a?Pp(t,a,e,++i,Date.now(),r):t.K=false}t.K=true;var u=n.overlay,s="text/html"==n.mimeType?"iframe":"img",o=document.createElement(s);o.style.objectFit="contain";o.style.position="absolute";o.style.border="none";Lp(t,n);t.i(new Jr("ad-started",(new Map).set("ad",new Tp(n,e,i))));"iframe"==s?o.src=n.uri:(o.src=n.uri,o.onerror=function(n){t.i(new Jr("ad-error",(new Map).set("originalEvent",n)));a()});var f=u.viewport,c=u.topLeft;u=u.size;0==f.x&&0==f.y?(o.width=n.overlay.size.x,o.height=n.overlay.size.y,o.style.bottom="10%",o.style.left="0",o.style.right="0",o.style.width="100%",n.overlay.size.y||"iframe"!=s||(o.style.height="auto")):(o.style.height=u.y/f.y*100+"%",o.style.left=c.x/f.x*100+"%",o.style.top=c.y/f.y*100+"%",o.style.width=u.x/f.x*100+"%");t.B.appendChild(o);var l=Date.now();t.o&&t.o.stop();t.o=new Di((function(){n.playoutLimit&&(Date.now()-l)/1e3>n.playoutLimit?(t.i(new Jr("ad-complete")),a()):n.endTime&&t.g.currentTime>n.endTime?(t.i(new Jr("ad-complete")),a()):t.g.currentTime<n.startTime&&(t.i(new Jr("ad-skipped")),a())}));n.playoutLimit&&!n.endTime?t.o.ha(n.playoutLimit):n.endTime&&t.o.Ga(.025);t.l.D(t.g,"seeked",(function(){var e=t.g.currentTime;if(e<n.startTime||n.endTime&&e>n.endTime)t.o&&t.o.stop(),t.i(new Jr("ad-skipped")),a()}))}function Dp(t,n,e,i,r,a){var u,s,o,f,c,l,h,d,v,p,m,w,g,b,y,k,A,x,N,C;_((function(P){switch(P.g){case 1:u=Date.now();t.K=true;if(!t.A||1!=i){P.u(2);break}t.i(new Jr("ad-content-pause-requested",(new Map).set("saveLivePosition",true)));s=new qr;o=function(n){return _((function(e){if(1==e.g)return"detach"!=n.state?e.u(0):Vp()?T(e,new Promise((function(t){return new Di(t).ha(.1)})),3):e.u(3);s.resolve();t.l.Ja(t.C,"onstatechange",o);E(e)}))};t.l.D(t.C,"onstatechange",o);return T(P,s,2);case 2:return Lp(t,n),t.A||(t.h.style.display="",n.overlay?(t.h.loop=n.loop,f=n.overlay.viewport,c=n.overlay.topLeft,l=n.overlay.size,t.h.style.height=l.y/f.y*100+"%",t.h.style.left=c.x/f.x*100+"%",t.h.style.top=c.y/f.y*100+"%",t.h.style.width=l.x/f.x*100+"%"):(t.g.pause(),null!=n.resumeOffset&&0!=n.resumeOffset&&(t.g.currentTime+=n.resumeOffset),t.h.loop=false,t.h.style.height="100%",t.h.style.left="0",t.h.style.top="0",t.h.style.width="100%")),h=false,d=function(){if(!t.A&&!n.overlay&&null==n.resumeOffset)if(n.timelineRange&&n.endTime&&Infinity!=n.endTime)t.g.currentTime!=n.endTime&&(t.g.currentTime=n.endTime);else{var e=Date.now();t.g.currentTime+=(e-r)/1e3;r=e}},v=function(u){var s,o;return _((function(f){if(1==f.g){d();s=Cp(t,n.pre,i-a);if(u&&n.groupId)for(;s&&s.groupId==n.groupId;)i++,s=Cp(t,n.pre,i-a);t.o&&(!n.groupId||s&&s.groupId!=n.groupId)&&(t.o.stop(),t.o=null);Op(t,n);if(s&&!s.overlay)return f.u(2);n.post&&(t.m=null,t.s=null);return t.A?T(f,t.j.detach(),4):T(f,t.j.vc(),4)}2!=f.g&&(t.A&&(o=n.resumeOffset,null==o&&(o=n.timelineRange&&n.endTime&&Infinity!=n.endTime?n.endTime-(t.m||0):(Date.now()-r)/1e3),t.i(new Jr("ad-content-resume-requested",(new Map).set("offset",o)))),t.i(new Jr("ad-stopped")),t.l.Qa(),t.K=false,t.A?Up(t):(t.h.style.display="none",d(),t.g.ended||t.g.play()));Ip(t);s&&(t.i(new Jr("ad-stopped")),t.l.Qa(),Pp(t,s,e,++i,r,a));E(f)}))},p=function(n){return _((function(e){if(h)return e.return();h=true;t.i(new Jr("ad-error",(new Map).set("originalEvent",n)));return T(e,v(false),0)}))},m=function(){return _((function(n){if(1==n.g){if(h)return n.return();h=true;return T(n,v(false),2)}t.i(new Jr("ad-complete"));E(n)}))},t.ia=function(){return _((function(n){if(h)return n.return();h=true;t.i(new Jr("ad-skipped"));return T(n,v(true),0)}))},w=new kp(t.h,n,t.ia,e,i,!t.A),t.A||(w.setMuted(t.g.muted),w.setVolume(t.g.volume)),t.i(new Jr("ad-started",(new Map).set("ad",w))),(g=w.canSkipNow())&&t.i(new Jr("ad-skip-state-changed")),t.l.za(t.j,"error",p),t.l.D(t.h,"timeupdate",(function(){if(t.h.duration){var n=w.canSkipNow();g!=n&&0<w.getRemainingTime()&&0<w.getDuration()&&t.i(new Jr("ad-skip-state-changed"));g=n}})),t.l.za(t.j,"firstquartile",(function(){d();t.i(new Jr("ad-first-quartile"))})),t.l.za(t.j,"midpoint",(function(){d();t.i(new Jr("ad-midpoint"))})),t.l.za(t.j,"thirdquartile",(function(){d();t.i(new Jr("ad-third-quartile"))})),t.l.za(t.j,"complete",m),t.l.D(t.h,"play",(function(){t.i(new Jr("ad-resumed"))})),t.l.D(t.h,"pause",(function(){var n=t.j.getConfiguration();t.h.currentTime>=n.playRangeEnd?m():t.i(new Jr("ad-paused"))})),t.l.D(t.h,"volumechange",(function(){t.h.muted?t.i(new Jr("ad-muted")):t.i(new Jr("ad-volume-changed"))})),S(P,4),Bp(t),n.startTime&&n.endTime&&Infinity!=n.endTime&&n.startTime!=n.endTime&&(b=n.endTime-n.startTime,0<b&&t.j.configure("playRangeEnd",b)),n.playoutLimit&&!t.o&&(t.o=new Di((function(){t.ia()})).ha(n.playoutLimit),t.j.configure("playRangeEnd",n.playoutLimit)),T(P,t.j.dc(t.h),6);case 6:return y=null,t.M.allowStartInMiddleOfInterstitial&&null!=t.m&&(k=t.m-n.startTime,.25<Math.abs(k)&&(y=k)),t.F.has(n)?T(P,t.F.get(n),10):T(P,t.j.load(n.uri,y,n.mimeType||void 0),8);case 10:return A=P.h,t.F.delete(n),A?T(P,t.j.load(A),8):T(P,t.j.load(n.uri,y,n.mimeType||void 0),8);case 8:t.h.play();x=(Date.now()-u)/1e3;t.i(new Jr("ads-loaded",(new Map).set("loadTime",x)));t.A&&t.g.play();n.overlay&&(N=function(){var e=t.g.currentTime-n.startTime;.1<Math.abs(e-t.h.currentTime)&&(t.h.currentTime=e)},t.l.za(t.h,"playing",N),t.l.D(t.g,"seeking",N),t.l.D(t.g,"seeked",(function(){var e=t.g.currentTime;(e<n.startTime||n.endTime&&e>n.endTime)&&t.ia()})));I(P,0);break;case 4:C=M(P);if(!t.K)return P.return();p(C);E(P)}}))}function Lp(t,n){n.displayOnBackground&&(t.g.style.zIndex="1");if(null!=n.currentVideo){var e=n.currentVideo;t.g.style.transformOrigin="top left";var i=true,r=[],a=e.topLeft.x/e.viewport.x*100;0<a&&100>=a&&(r.push("translateX("+a+"%)"),i=false);a=e.topLeft.y/e.viewport.y*100;0<a&&100>=a&&(r.push("translateY("+a+"%)"),i=false);a=e.size.x/e.viewport.x;1>a&&r.push("scaleX("+a+")");e=e.size.y/e.viewport.y;1>a&&r.push("scaleY("+e+")");r.length&&(t.g.style.transform=r.join(" "));i&&(t.g.style.transition="transform 250ms")}t.B&&(t.B.style.pointerEvents="none",n.background&&(t.B.style.background=n.background));t.G&&(t.G.style.background=n.overlay?"":"rgb(0, 0, 0)")}function Op(t,n){if(!n||n.displayOnBackground)t.g.style.zIndex="";n&&null==n.currentVideo||(t.g.style.transformOrigin="",t.g.style.transition="",t.g.style.transform="");t.B&&(t.B.style.pointerEvents="",!n||n.background)&&(t.B.style.background="");t.G&&(t.G.style.background="")}function _p(t,n){var e,i,r,a,u,s,o,f,c,l,h,d,v,p,m,w,g,b,y,k,E,A,x,N,C,P,R,D,L,O,U,B,H,F,V,z,X,q,j,G,K,W;return _((function(_){switch(_.g){case 1:e=[];if(!n)return _.return(e);i=n.values.find((function(t){return"X-ASSET-URI"==t.key}));r=n.values.find((function(t){return"X-ASSET-LIST"==t.key}));if(!i&&!r)return _.return(e);a=null;if(u=n.values.find((function(t){return"ID"==t.key})))a=u.data;s=null==a?Math.floor(10*n.startTime)/10:n.startTime;(o=n.endTime)&&Infinity!=n.endTime&&"number"==typeof n.endTime&&(o=null==a?Math.floor(10*n.endTime)/10:n.endTime);f=n.values.find((function(t){return"X-RESTRICT"==t.key}));l=c=true;f&&f.data&&(h=f.data,c=!h.includes("SKIP"),l=!h.includes("JUMP"));d=c?0:null;if(v=n.values.find((function(t){return"X-ENABLE-SKIP-AFTER"==t.key})))p=v.data,d=parseFloat(p),isNaN(d)&&(d=c?0:null);m=null;if(w=n.values.find((function(t){return"X-ENABLE-SKIP-FOR"==t.key})))g=w.data,m=parseFloat(g),isNaN(d)&&(m=null);b=null;if(y=n.values.find((function(t){return"X-RESUME-OFFSET"==t.key})))k=y.data,b=parseFloat(k),isNaN(b)&&(b=null);E=null;if(A=n.values.find((function(t){return"X-PLAYOUT-LIMIT"==t.key})))x=A.data,E=parseFloat(x),isNaN(E)&&(E=null);P=C=N=false;if(R=n.values.find((function(t){return"CUE"==t.key})))D=R.data,N=D.includes("ONCE"),C=D.includes("PRE"),P=D.includes("POST");L=false;(O=n.values.find((function(t){return"X-TIMELINE-OCCUPIES"==t.key})))?(U=O.data,L=U.includes("RANGE")):!y&&t.C.V()&&(L=!C&&!P);if(i){B=i.data;if(!B)return _.return(e);e.push({id:a,groupId:null,startTime:s,endTime:o,uri:B,mimeType:null,isSkippable:c,skipOffset:d,skipFor:m,canJump:l,resumeOffset:b,playoutLimit:E,once:N,pre:C,post:P,timelineRange:L,loop:false,overlay:null,displayOnBackground:false,currentVideo:null,background:null});_.u(2);break}if(!r){_.u(2);break}H=r.data;if(!H)return _.return(e);S(_,4);F={type:11};return T(_,Hp(t,H,F),6);case 6:V=_.h;z=qt(V);X=JSON.parse(z);if(q=X["SKIP-CONTROL"])j=q["ENABLE-SKIP-AFTER"],"number"==typeof j&&(d=parseFloat(j),isNaN(j)&&(d=c?0:null)),G=q["ENABLE-SKIP-FOR"],"number"==typeof G&&(m=parseFloat(G),isNaN(G)&&(m=null));for(K=0;K<X.ASSETS.length;K++)W=X.ASSETS[K],W.URI&&e.push({id:a+"_shaka_asset_"+K,groupId:a,startTime:s,endTime:o,uri:W.URI,mimeType:null,isSkippable:c,skipOffset:d,skipFor:m,canJump:l,resumeOffset:b,playoutLimit:E,once:N,pre:C,post:P,timelineRange:L,loop:false,overlay:null,displayOnBackground:false,currentVideo:null,background:null});I(_,2);break;case 4:M(_);case 2:return _.return(e)}}))}function Up(t){for(var n=[],e=c(t.H),i=e.next(),r={};!i.done;r={uc:void 0},i=e.next())i=i.value,i.overlay||(r.uc={start:i.startTime,end:null},i.pre?(r.uc.start=0,r.uc.end=null):i.post?(r.uc.start=-1,r.uc.end=null):i.timelineRange&&(r.uc.end=i.endTime),n.find(function(t){return function(n){return t.uc.start==n.start&&t.uc.end==n.end}}(r))||n.push(r.uc));t.i(new Jr("ad-cue-points-changed",(new Map).set("cuepoints",n)))}function Bp(t){t.j.configure(t.C.Xh());t.j.configure("ads.disableHLSInterstitial",true);t.j.configure("ads.disableDASHInterstitial",true);t.j.configure("playRangeEnd",Infinity);ua(t.C.Nb(),t.j.Nb())}function Hp(t,n,e){var i,r,a;return _((function(u){if(1==u.g)return i=sa([n],Xr()),r=t.C.Nb().request(7,i,e),T(u,r.promise,2);a=u.h;return u.return(a.data)}))}function Fp(t){return(t=t.mimeType)?!t.startsWith("image/")&&"text/html"!==t:true}function Vp(){var t=ft().La();return"TV"==t||"CONSOLE"==t||"CAST"==t?true:false}function zp(t,n){if(!(t.L.has(n)||t.M&&!t.M.allowPreloadOnDomElements)){var e=function(t){var n=document.createElement("link");n.rel="preload";n.href=t;n.as="image";document.head.appendChild(n);return n},i=[];if(n.background){var r=n.background.match(/url\(('|")?([^'"()]+)('|")\)?/);r&&i.push(e(r[2]))}n.mimeType.startsWith("image/")&&i.push(e(n.uri));t.L.set(n,i)}}function Xp(t,n){if(t.L.has(n)){var e=t.L.get(n);e=c(e);for(var i=e.next();!i.done;i=e.next())i=i.value,i.parentNode.removeChild(i);t.L.delete(n)}}function qp(t,n,e,i,r){this.h=t;this.j=qn(this.h.skipOffset);this.g=r;this.i=n;this.l=e;this.o=i;this.m=false}i=qp.prototype;i.needsSkipUI=function(){return true};i.isClientRendering=function(){return false};i.hasCustomClick=function(){return false};i.isUsingAnotherMediaElement=function(){return false};i.getDuration=function(){return this.h.durationInSeconds};i.getMinSuggestedDuration=function(){return this.getDuration()};i.getRemainingTime=function(){return this.h.startTimeInSeconds+this.h.durationInSeconds-this.g.currentTime};i.isPaused=function(){return this.g.paused};i.isSkippable=function(){return"number"==typeof this.j?true:false};i.getTimeUntilSkippable=function(){if("number"!=typeof this.j)return this.getRemainingTime();var t=this.getRemainingTime()+this.j-this.getDuration();return Math.max(t,0)};i.canSkipNow=function(){return 0==this.getTimeUntilSkippable()};i.skip=function(){this.m=true;this.g.currentTime+=this.getRemainingTime()};i.pause=function(){return this.g.pause()};i.play=function(){return this.g.play()};i.getVolume=function(){return this.g.volume};i.setVolume=function(t){this.g.volume=t};i.isMuted=function(){return this.g.muted};i.isLinear=function(){return this.o};i.resize=function(){};i.setMuted=function(t){this.g.muted=t};i.getSequenceLength=function(){return this.l?this.l:1};i.getPositionInSequence=function(){return this.i?this.i:1};i.getTitle=function(){return this.h.adTitle};i.getDescription=function(){return""};i.getVastMediaBitrate=function(){return 0};i.getVastMediaHeight=function(){return 0};i.getVastMediaWidth=function(){return 0};i.getVastAdId=function(){return this.h.vastAdId||""};i.getAdId=function(){return this.h.adId};i.getCreativeAdId=function(){return this.h.creativeId};i.getAdvertiserName=function(){return""};i.getMediaUrl=function(){return null};i.getTimeOffset=function(){return 0};i.getPodIndex=function(){return 0};i.release=function(){this.l=this.i=this.g=this.h=null};q("shaka.ads.MediaTailorAd",qp);qp.prototype.release=qp.prototype.release;qp.prototype.getPodIndex=qp.prototype.getPodIndex;qp.prototype.getTimeOffset=qp.prototype.getTimeOffset;qp.prototype.getMediaUrl=qp.prototype.getMediaUrl;qp.prototype.getAdvertiserName=qp.prototype.getAdvertiserName;qp.prototype.getCreativeAdId=qp.prototype.getCreativeAdId;qp.prototype.getAdId=qp.prototype.getAdId;qp.prototype.getVastAdId=qp.prototype.getVastAdId;qp.prototype.getVastMediaWidth=qp.prototype.getVastMediaWidth;qp.prototype.getVastMediaHeight=qp.prototype.getVastMediaHeight;qp.prototype.getVastMediaBitrate=qp.prototype.getVastMediaBitrate;qp.prototype.getDescription=qp.prototype.getDescription;qp.prototype.getTitle=qp.prototype.getTitle;qp.prototype.getPositionInSequence=qp.prototype.getPositionInSequence;qp.prototype.getSequenceLength=qp.prototype.getSequenceLength;qp.prototype.setMuted=qp.prototype.setMuted;qp.prototype.resize=qp.prototype.resize;qp.prototype.isLinear=qp.prototype.isLinear;qp.prototype.isMuted=qp.prototype.isMuted;qp.prototype.setVolume=qp.prototype.setVolume;qp.prototype.getVolume=qp.prototype.getVolume;qp.prototype.play=qp.prototype.play;qp.prototype.pause=qp.prototype.pause;qp.prototype.skip=qp.prototype.skip;qp.prototype.canSkipNow=qp.prototype.canSkipNow;qp.prototype.getTimeUntilSkippable=qp.prototype.getTimeUntilSkippable;qp.prototype.isSkippable=qp.prototype.isSkippable;qp.prototype.isPaused=qp.prototype.isPaused;qp.prototype.getRemainingTime=qp.prototype.getRemainingTime;qp.prototype.getMinSuggestedDuration=qp.prototype.getMinSuggestedDuration;qp.prototype.getDuration=qp.prototype.getDuration;qp.prototype.isUsingAnotherMediaElement=qp.prototype.isUsingAnotherMediaElement;qp.prototype.hasCustomClick=qp.prototype.hasCustomClick;qp.prototype.isClientRendering=qp.prototype.isClientRendering;qp.prototype.needsSkipUI=qp.prototype.needsSkipUI;function jp(t,n,e,i){this.B=t;this.K=n;this.h=e;this.l=null;this.P=NaN;this.i=i;this.I=false;this.A=null;this.j=[];this.M=[];this.L=this.C=this.g=null;this.F=new Map;this.m=[];this.s=[];this.G="";this.N=true;this.H="";this.o=new it}jp.prototype.stop=function(){for(var t=c(this.m),n=t.next();!n.done;n=t.next())n=n.value,this.o.Ja(n.target,n.type,n.listener);Zp(this);this.m=[];this.s=[];this.G="";this.N=true;this.H="";this.A=null;this.j=[];this.M=[];this.F.clear()};jp.prototype.release=function(){this.stop();this.o&&this.o.release()};jp.prototype.onManifestUpdated=function(t){this.I=t;""!=this.G&&(Kp(this,this.G,this.N),this.N=false)};jp.prototype.getCuePoints=function(){for(var t=[],n=c(this.j),e=n.next();!e.done;e=n.next()){e=c(e.value.ads);for(var i=e.next();!i.done;i=e.next())i=i.value,t.push({start:i.startTimeInSeconds,end:i.startTimeInSeconds+i.durationInSeconds})}return t};function Gp(t,n,e){var i,r,a,u,s,o,f,c,l,h,d,v;_((function(p){if(1==p.g)return i={type:7},r=sa([n],Xr()),r.method="POST",e&&(a=JSON.stringify(e),r.body=Kt(a)),u=t.K.request(7,r,i),S(p,2),T(p,u.promise,4);if(2!=p.g){s=p.h;o=qt(s.data);f=JSON.parse(o);if(f.manifestUrl&&f.trackingUrl)c=new bt(n),l=new bt(f.trackingUrl),t.G=c.resolve(l).toString(),h=Date.now()/1e3,d=h-t.P,t.i(new Jr("ads-loaded",(new Map).set("loadTime",d))),v=new bt(f.manifestUrl),t.l.resolve(c.resolve(v).toString()),t.l=null;else throw Error("Insufficient data from MediaTailor.");return I(p,0)}M(p);if(!t.H.length)return t.l.reject("MediaTailor request returned an error and there was no backup asset uri provided."),t.l=null,p.return();t.l.resolve(t.H);t.l=null;E(p)}))}function Kp(t,n,e){var i,r,a,u,s,o,f,l,h,d,v,p,m,w,g,b;_((function(y){if(1==y.g)return i={type:8},r=sa([n],Xr()),a=t.K.request(7,r,i),S(y,2),T(y,a.promise,4);if(2!=y.g){u=y.h;s=[];o=qt(u.data);f=JSON.parse(o);if(0<f.avails.length){if(JSON.stringify(t.j)!=JSON.stringify(f.avails)){t.j=f.avails;l=c(t.j);for(h=l.next();!h.done;h=l.next())for(d=h.value,v=c(d.nonLinearAdsList),p=v.next();!p.done;p=v.next())for(m=p.value,w=c(m.nonLinearAdList),g=w.next();!g.done;g=w.next())b=g.value,Wp(t,b);s=t.getCuePoints();t.i(new Jr("ad-cue-points-changed",(new Map).set("cuepoints",s)))}}else t.j.length&&t.i(new Jr("ad-cue-points-changed",(new Map).set("cuepoints",s))),Zp(t),t.j=[];e&&(t.I||0<s.length)&&Yp(t);return I(y,0)}M(y);E(y)}))}function Wp(t,n){var e,i,r,a,u,s,o,f;_((function(c){if(1==c.g){if(!n.staticResource)return c.return();e=$p(n);if(t.F.get(e))return c.return();i={type:9};r=sa([n.staticResource],Xr());a=t.K.request(7,r,i);S(c,2);t.F.set(e,[]);return T(c,a.promise,4)}if(2!=c.g)return u=c.h,s=qt(u.data),o=JSON.parse(s),f=o.apps,t.F.set(e,f),I(c,0);M(c);t.F.delete(e);E(c)}))}function $p(t){return[t.adId,t.adParameters,t.adSystem,t.adTitle,t.creativeAdId,t.creativeId,t.creativeSequence,t.height,t.width,t.staticResource].join("")}function Yp(t){Jp(t);t.I||(Qp(t),t.o.D(t.h,"seeked",(function(){Qp(t)})),t.o.D(t.h,"ended",(function(){Zp(t)})));t.o.D(t.h,"timeupdate",(function(){Jp(t)}))}function Qp(t){var n=t.h.currentTime;if(0!=n&&null==t.A){for(var e,i,r=c(t.j),a=r.next();!a.done;a=r.next()){a=a.value;for(var u=c(a.ads),s=u.next();!s.done;s=u.next())if(s=s.value,!i)s.startTimeInSeconds<n&&(i=s,e=a);else if(s.startTimeInSeconds<n&&s.startTimeInSeconds>i.startTimeInSeconds+i.durationInSeconds){i=s;e=a;break}}e&&i&&!t.M.includes(i.adId)&&(t.A=n,t.h.currentTime=e.startTimeInSeconds)}}function Jp(t){if(t.h.duration&&(t.g||t.j.length)){var n=t.h.currentTime,e=false;if(t.g){e=true;var i=t.C,r=i.startTimeInSeconds+.5*i.durationInSeconds,a=i.startTimeInSeconds+.75*i.durationInSeconds;n>=i.startTimeInSeconds+.25*i.durationInSeconds&&!t.s.includes("firstQuartile")?(t.s.push("firstQuartile"),nm(t,"firstQuartile")):n>=r&&!t.s.includes("midpoint")?(t.s.push("midpoint"),nm(t,"midpoint")):n>=a&&!t.s.includes("thirdQuartile")&&(t.s.push("thirdQuartile"),nm(t,"thirdQuartile"));i=t.g.getRemainingTime();r=t.g.getDuration();t.g.canSkipNow()&&0<i&&0<r&&nm(t,"skipStateChanged");0<r&&(0>=i||i>r)&&Zp(t)}if(!t.g||!t.g.isLinear()){t:for(i=c(t.j),r=i.next();!r.done;r=i.next()){r=r.value;if(t.g&&t.g.isLinear())break;for(a=0;a<r.ads.length;a++){var u=r.ads[a],s=u.startTimeInSeconds+u.durationInSeconds;if(u.startTimeInSeconds<=n&&s>n){if(t.M.includes(u.adId)){if(t.h.ended)continue;t.h.currentTime=s;break t}Zp(t);t.L=r;t.g=new qp(u,a+1,r.ads.length,true,t.h);t.C=u;0===a&&nm(t,"breakStart");tm(t);break}}}if(!t.g)for(i=c(t.j),r=i.next();!r.done;r=i.next()){r=r.value;if(t.g)break;for(a=0;a<r.nonLinearAdsList.length;a++)if(u=r.nonLinearAdsList[a],u.nonLinearAdList.length){s=r.startTimeInSeconds;var o=t.F.get($p(u.nonLinearAdList[0]));if(s<=n&&o&&o.length){Zp(t);s=t;o=c(o);for(var f=o.next();!f.done;f=o.next())if(f=f.value,f.data.source.length){var l=document.createElement("img");l.src=f.data.source[0].url;l.style.top=(f.placeholder.top||0)+"%";l.style.height=100-(f.placeholder.top||0)+"%";l.style.left=(f.placeholder.left||0)+"%";l.style.maxWidth=100-(f.placeholder.left||0)+"%";l.style.objectFit="contain";l.style.position="absolute";s.B.appendChild(l)}t.L=r;t.g=new qp(u,a+1,r.ads.length,false,t.h);t.C=u;0===a&&nm(t,"breakStart");tm(t);break}}}e&&!t.g&&(n=t.h.currentTime,t.A&&t.A>n&&(t.h.currentTime=t.A),t.A=null)}}}function Zp(t){if(t.g){for(;t.B.lastChild;)t.B.removeChild(t.B.firstChild);t.I||t.M.push(t.C.adId);var n=t.g.m;(void 0===n?0:n)?nm(t,"skip"):nm(t,"complete");n=c(t.m);for(var e=n.next();!e.done;e=n.next())e=e.value,t.o.Ja(e.target,e.type,e.listener);t.m=[];t.s=[];n=t.g.getPositionInSequence();e=t.g.getSequenceLength();n===e&&nm(t,"breakEnd");t.g=null;t.C=null;t.L=null}}function tm(t){var n=false;t.h.paused?n=true:(nm(t,"impression"),nm(t,"start"));t.m.push({target:t.h,type:"volumechange",listener:function(){t.h.muted&&nm(t,"mute")}});t.m.push({target:t.h,type:"volumechange",listener:function(){t.h.muted||nm(t,"unmute")}});t.m.push({target:t.h,type:"play",listener:function(){n?(nm(t,"impression"),nm(t,"start"),n=false):nm(t,"resume")}});t.m.push({target:t.h,type:"pause",listener:function(){nm(t,"pause")}});for(var e=c(t.m),i=e.next();!i.done;i=e.next())i=i.value,t.o.D(i.target,i.type,i.listener)}function nm(t,n){var e=t.C.trackingEvents.find((function(t){return t.eventType==n}));e||(e=t.L.adBreakTrackingEvents.find((function(t){return t.eventType==n})));if(e){var i={type:10};e=c(e.beaconUrls);for(var r=e.next();!r.done;r=e.next())(r=r.value)&&""!=r&&(r=sa([r],Xr()),r.method="POST",t.K.request(7,r,i))}switch(n){case"impression":t.i(new Jr("ad-impression"));break;case"start":t.i(new Jr("ad-started",(new Map).set("ad",t.g)));break;case"mute":t.i(new Jr("ad-muted"));break;case"unmute":t.i(new Jr("ad-volume-changed"));break;case"resume":t.i(new Jr("ad-resumed"));break;case"pause":t.i(new Jr("ad-paused"));break;case"firstQuartile":t.i(new Jr("ad-first-quartile"));break;case"midpoint":t.i(new Jr("ad-midpoint"));break;case"thirdQuartile":t.i(new Jr("ad-third-quartile"));break;case"complete":t.i(new Jr("ad-complete"));t.i(new Jr("ad-stopped"));break;case"skip":t.i(new Jr("ad-skipped"));t.i(new Jr("ad-stopped"));break;case"breakStart":t.B.setAttribute("ad-active","true");break;case"breakEnd":t.B.removeAttribute("ad-active");break;case"skipStateChanged":t.i(new Jr("ad-skip-state-changed"))}}function em(t,n){this.g=t;this.i=null;this.h=n}i=em.prototype;i.needsSkipUI=function(){return true};i.isClientRendering=function(){return false};i.hasCustomClick=function(){return true};i.isUsingAnotherMediaElement=function(){return false};i.getDuration=function(){return this.i?this.i.duration:-1};i.getMinSuggestedDuration=function(){return this.getDuration()};i.getRemainingTime=function(){return this.i?this.i.duration-this.i.currentTime:-1};i.isPaused=function(){return this.h.paused};i.isSkippable=function(){return this.g.isSkippable()};i.getTimeUntilSkippable=function(){var t=this.g.getSkipTimeOffset();t=this.getRemainingTime()-t;return Math.max(t,0)};i.canSkipNow=function(){return 0==this.getTimeUntilSkippable()};i.skip=function(){this.h.currentTime+=this.getRemainingTime()};i.pause=function(){return this.h.pause()};i.play=function(){return this.h.play()};i.getVolume=function(){return this.h.volume};i.setVolume=function(t){this.h.volume=t};i.isMuted=function(){return this.h.muted};i.isLinear=function(){return true};i.resize=function(){};i.setMuted=function(t){this.h.muted=t};i.getSequenceLength=function(){var t=this.g.getAdPodInfo();return null==t?1:t.getTotalAds()};i.getPositionInSequence=function(){var t=this.g.getAdPodInfo();return null==t?1:t.getAdPosition()};i.getTitle=function(){return this.g.getTitle()};i.getDescription=function(){return this.g.getDescription()};i.getVastMediaBitrate=function(){return 0};i.getVastMediaHeight=function(){return this.g.getVastMediaHeight()};i.getVastMediaWidth=function(){return this.g.getVastMediaWidth()};i.getVastAdId=function(){return""};i.getAdId=function(){return this.g.getAdId()};i.getCreativeAdId=function(){return this.g.getCreativeAdId()};i.getAdvertiserName=function(){return this.g.getAdvertiserName()};i.getMediaUrl=function(){return null};i.getTimeOffset=function(){var t=this.g.getAdPodInfo();return null==t?0:t.getTimeOffset()};i.getPodIndex=function(){var t=this.g.getAdPodInfo();return null==t?0:t.getPodIndex()};i.release=function(){this.h=this.i=this.g=null};q("shaka.ads.ServerSideAd",em);em.prototype.release=em.prototype.release;em.prototype.getPodIndex=em.prototype.getPodIndex;em.prototype.getTimeOffset=em.prototype.getTimeOffset;em.prototype.getMediaUrl=em.prototype.getMediaUrl;em.prototype.getAdvertiserName=em.prototype.getAdvertiserName;em.prototype.getCreativeAdId=em.prototype.getCreativeAdId;em.prototype.getAdId=em.prototype.getAdId;em.prototype.getVastAdId=em.prototype.getVastAdId;em.prototype.getVastMediaWidth=em.prototype.getVastMediaWidth;em.prototype.getVastMediaHeight=em.prototype.getVastMediaHeight;em.prototype.getVastMediaBitrate=em.prototype.getVastMediaBitrate;em.prototype.getDescription=em.prototype.getDescription;em.prototype.getTitle=em.prototype.getTitle;em.prototype.getPositionInSequence=em.prototype.getPositionInSequence;em.prototype.getSequenceLength=em.prototype.getSequenceLength;em.prototype.setMuted=em.prototype.setMuted;em.prototype.resize=em.prototype.resize;em.prototype.isLinear=em.prototype.isLinear;em.prototype.isMuted=em.prototype.isMuted;em.prototype.setVolume=em.prototype.setVolume;em.prototype.getVolume=em.prototype.getVolume;em.prototype.play=em.prototype.play;em.prototype.pause=em.prototype.pause;em.prototype.skip=em.prototype.skip;em.prototype.canSkipNow=em.prototype.canSkipNow;em.prototype.getTimeUntilSkippable=em.prototype.getTimeUntilSkippable;em.prototype.isSkippable=em.prototype.isSkippable;em.prototype.isPaused=em.prototype.isPaused;em.prototype.getRemainingTime=em.prototype.getRemainingTime;em.prototype.getMinSuggestedDuration=em.prototype.getMinSuggestedDuration;em.prototype.getDuration=em.prototype.getDuration;em.prototype.isUsingAnotherMediaElement=em.prototype.isUsingAnotherMediaElement;em.prototype.hasCustomClick=em.prototype.hasCustomClick;em.prototype.isClientRendering=em.prototype.isClientRendering;em.prototype.needsSkipUI=em.prototype.needsSkipUI;function im(t,n,e,i){var r=this;this.s=t;this.l=n;this.j=null;this.F=NaN;this.i=i;this.G=false;this.A=this.m=this.o=null;this.B="";this.C=[];this.h=new it;t=new google.ima.dai.api.UiSettings;t.setLocale(e);this.g=new google.ima.dai.api.StreamManager(this.l,this.s,t);this.i(new Jr("ima-stream-manager-loaded",(new Map).set("imaStreamManager",this.g)));this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.LOADED,(function(t){rm(r,t)}));this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.ERROR,(function(){r.B.length?r.j.resolve(r.B):r.j.reject("IMA Stream request returned an error and there was no backup asset uri provided.");r.j=null}));this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED,(function(){}));this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.STARTED,(function(t){t=t.getAd();r.m=new em(t,r.l);r.A&&(r.m.i=r.A);r.i(new Jr("ad-started",(new Map).set("ad",r.m)));r.s.setAttribute("ad-active","true")}));this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED,(function(){r.s.removeAttribute("ad-active");var t=r.l.currentTime;r.o&&r.o>t&&(r.l.currentTime=r.o,r.o=null)}));this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.AD_PROGRESS,(function(t){r.A=t.getStreamData().adProgressData;r.m&&(r.m.i=r.A)}));this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.FIRST_QUARTILE,(function(){r.i(new Jr("ad-first-quartile"))}));this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.MIDPOINT,(function(){r.i(new Jr("ad-midpoint"))}));this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.THIRD_QUARTILE,(function(){r.i(new Jr("ad-third-quartile"))}));this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.COMPLETE,(function(){r.i(new Jr("ad-complete"));r.i(new Jr("ad-stopped"));r.s.removeAttribute("ad-active");r.m=null}));this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.SKIPPED,(function(){r.i(new Jr("ad-skipped"));r.i(new Jr("ad-stopped"))}));this.h.D(this.g,google.ima.dai.api.StreamEvent.Type.CUEPOINTS_CHANGED,(function(t){var n=t.getStreamData();t=[];n=c(n.cuepoints);for(var e=n.next();!e.done;e=n.next())e=e.value,t.push({start:e.start,end:e.end});r.C=t;r.i(new Jr("ad-cue-points-changed",(new Map).set("cuepoints",t)))}))}i=im.prototype;i.configure=function(){};i.stop=function(){this.B="";this.o=null;this.C=[]};i.release=function(){this.stop();this.h&&this.h.release()};i.onCueMetadataChange=function(t){if(t.key&&t.data){var n={};n[t.key]=t.data;this.g.onTimedMetadata(n)}};i.getCuePoints=function(){return this.C};function rm(t,n){t.i(new Jr("ads-loaded",(new Map).set("loadTime",Date.now()/1e3-t.F)));n=n.getStreamData().url;t.j.resolve(n);t.j=null;t.G||t.h.D(t.l,"seeked",(function(){var n=t.l.currentTime;if(0!=n){t.g.streamTimeForContentTime(n);var e=t.g.previousCuePointForStreamTime(n);e&&!e.played&&(t.o=n,t.l.currentTime=e.start)}}))}function am(){na.call(this);this.h=this.i=this.j=this.g=null;this.m=new fp;this.o=navigator.language;this.l=null}g(am,na);i=am.prototype;i.setLocale=function(t){this.o=t};i.configure=function(t){this.l=t;this.g&&this.g.configure(this.l);this.j&&this.j.configure(this.l);this.h&&this.h.configure(this.l)};i.initInterstitial=function(t,n,e){var i=this;this.g&&this.g.release();this.g=new Ep(t,n,e,(function(t){return um(i,t)}));this.g.configure(this.l)};i.initClientSide=function(n,e,i){var r=this;if(!t.google||!google.ima||!google.ima.AdsLoader)throw new zt(2,10,1e4);this.j&&this.j.release();this.j=new pp(n,e,this.o,i,(function(t){return um(r,t)}));this.j.configure(this.l)};i.release=function(){this.g&&(this.g.release(),this.g=null);this.j&&(this.j.release(),this.j=null);this.i&&(this.i.release(),this.i=null);this.h&&(this.h.release(),this.h=null);na.prototype.release.call(this)};i.onAssetUnload=function(){this.g&&this.g.stop();this.j&&this.j.stop();this.i&&this.i.stop();this.h&&this.h.stop();this.dispatchEvent(new Jr("ad-stopped"));this.dispatchEvent(new Jr("ad-content-attach-requested"));this.m=new fp};i.requestClientSideAds=function(t){if(!this.j)throw new zt(1,10,10001);var n=this.j;n.g&&n.g.destroy();n.m&&n.m.contentComplete();n.G=Date.now()/1e3;n.m.requestAds(t)};i.updateClientSideAdsRenderingSettings=function(t){if(!this.j)throw new zt(1,10,10001);var n=this.j;n.B=t;n.g&&n.g.updateAdsRenderingSettings(n.B)};i.initMediaTailor=function(t,n,e){var i=this;this.i&&this.i.release();this.i=new jp(t,n,e,(function(t){return um(i,t)}))};i.requestMediaTailorStream=function(t,n,e){if(!this.i)throw new zt(1,10,10005);var i=this.i;e=void 0===e?"":e;i.l?t=Promise.reject(new zt(1,10,10004)):(i.l=new qr,Gp(i,t,n),i.H=e||"",i.P=Date.now()/1e3,t=i.l);return t};i.addMediaTailorTrackingUrl=function(t){if(!this.i)throw new zt(1,10,10005);var n=this.i;n.G=t;n.i(new Jr("ads-loaded",(new Map).set("loadTime",0)))};i.initServerSide=function(n,e){var i=this;if(!t.google||!google.ima||!google.ima.dai)throw new zt(2,10,10002);this.h&&this.h.release();this.h=new im(n,e,this.o,(function(t){return um(i,t)}));this.h.configure(this.l)};i.requestServerSideStream=function(t,n){n=void 0===n?"":n;if(!this.h)throw new zt(1,10,10003);t.adTagParameters||(t.adTagParameters={});var e=t.adTagParameters;(e.mpt||e.mpv)&&Y('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overridden.');t.adTagParameters.mpt="shaka-player";t.adTagParameters.mpv="v4.15.5";e=this.h;e.j?t=Promise.reject(new zt(1,10,10004)):(t instanceof google.ima.dai.api.LiveStreamRequest&&(e.G=true),e.j=new qr,e.g.requestStream(t),e.B=n||"",e.F=Date.now()/1e3,t=e.j);return t};i.replaceServerSideAdTagParameters=function(t){if(!this.h)throw new zt(1,10,10003);(t.mpt||t.mpv)&&Y('You have attempted to set "mpt" and/or "mpv" parameters of the ad tag. Please note that those parameters are used for Shaka adoption tracking and will be overridden.');t.mpt="Shaka Player";t.mpv="v4.15.5";this.h.g.replaceAdTagParameters(t)};i.getServerSideCuePoints=function(){vt("AdManager.getServerSideCuePoints","Please use getCuePoints function.");return this.getCuePoints()};i.getCuePoints=function(){var t=[];this.h&&(t=t.concat(this.h.getCuePoints()));this.i&&(t=t.concat(this.i.getCuePoints()));return t};i.getStats=function(){var t=this.m;return{loadTimes:t.g,averageLoadTime:cp(t),started:t.h,overlayAds:t.j,playedCompletely:t.l,skipped:t.m,errors:t.i}};i.onManifestUpdated=function(t){if(this.i)this.i.onManifestUpdated(t)};i.onDashTimedMetadata=function(t){this.h&&"urn:google:dai:2018"==t.schemeIdUri&&this.h.g.processMetadata(t.schemeIdUri,t.eventNode?t.eventNode.attributes.messageData:null,t.startTime)};i.onHlsTimedMetadata=function(t,n){this.h&&this.h.g.processMetadata("ID3",t.data,n)};i.onCueMetadataChange=function(t){if(this.h)this.h.onCueMetadataChange(t)};i.onHLSInterstitialMetadata=function(t,n,e){this.l&&this.l.disableHLSInterstitial||(this.g||this.initInterstitial(null,t,n),this.g&&Mp(this.g,e))};i.onDASHInterstitialMetadata=function(t,n,e){if(!this.l||!this.l.disableDASHInterstitial){var i=e.schemeIdUri;if("urn:mpeg:dash:event:alternativeMPD:insert:2025"==i||"urn:mpeg:dash:event:alternativeMPD:replace:2025"==i){if(this.g||this.initInterstitial(null,t,n),this.g&&(t=this.g,n="urn:mpeg:dash:event:alternativeMPD:replace:2025"==e.schemeIdUri,i="urn:mpeg:dash:event:alternativeMPD:insert:2025"==e.schemeIdUri,n||i)){for(var r=e.startTime,a=e.endTime,u=null,s=0,o,f=c(e.eventNode.children),l=f.next();!l.done;l=f.next())if(l=l.value,"AlternativeMPD"==l.tagName){if(l=l.attributes.uri){o=l;break}}else if("InsertPresentation"==l.tagName||"ReplacePresentation"==l.tagName){var h=l.attributes.url;if(h){o=h;(f=oe(l,"maxDuration",pe))&&(u=f/e.timescale);(f=oe(l,"returnOffset",pe))&&(s=f/e.timescale);n&&s&&(a=r+s);break}}o&&Np(t,[{id:e.id,groupId:null,startTime:r,endTime:a,uri:o,mimeType:null,isSkippable:false,skipOffset:null,skipFor:null,canJump:true,resumeOffset:i?s:null,playoutLimit:u,once:false,pre:false,post:false,timelineRange:n&&!i,loop:false,overlay:null,displayOnBackground:false,currentVideo:null,background:null}])}}else("urn:mpeg:dash:event:2012"==i||"urn:scte:dash:scte214-events"==i)&&e.eventNode&&ue(e.eventNode,"OverlayEvent")&&(this.g||this.initInterstitial(null,t,n),this.g&&xp(this.g,e))}};i.addCustomInterstitial=function(t){if(!this.g)throw new zt(1,10,10006);Np(this.g,[t])};i.addAdUrlInterstitial=function(t){if(!this.g)throw new zt(1,10,10006);return this.g.addAdUrlInterstitial(t)};i.getInterstitialPlayer=function(){if(!this.g)throw new zt(1,10,10006);return this.g.ld()};function um(t,n){if(n&&n.type)switch(n.type){case"ads-loaded":t.m.g.push(n.loadTime);break;case"ad-started":t.m.h++;var e=n.ad;e&&!e.isLinear()&&t.m.j++;break;case"ad-complete":t.m.l++;break;case"ad-skipped":t.m.m++;break;case"ad-error":t.m.i++}t.dispatchEvent(n)}q("shaka.ads.AdManager",am);am.prototype.getInterstitialPlayer=am.prototype.getInterstitialPlayer;am.prototype.addAdUrlInterstitial=am.prototype.addAdUrlInterstitial;am.prototype.addCustomInterstitial=am.prototype.addCustomInterstitial;am.prototype.onDASHInterstitialMetadata=am.prototype.onDASHInterstitialMetadata;am.prototype.onHLSInterstitialMetadata=am.prototype.onHLSInterstitialMetadata;am.prototype.onCueMetadataChange=am.prototype.onCueMetadataChange;am.prototype.onHlsTimedMetadata=am.prototype.onHlsTimedMetadata;am.prototype.onDashTimedMetadata=am.prototype.onDashTimedMetadata;am.prototype.onManifestUpdated=am.prototype.onManifestUpdated;am.prototype.getStats=am.prototype.getStats;am.prototype.getCuePoints=am.prototype.getCuePoints;am.prototype.getServerSideCuePoints=am.prototype.getServerSideCuePoints;am.prototype.replaceServerSideAdTagParameters=am.prototype.replaceServerSideAdTagParameters;am.prototype.requestServerSideStream=am.prototype.requestServerSideStream;am.prototype.initServerSide=am.prototype.initServerSide;am.prototype.addMediaTailorTrackingUrl=am.prototype.addMediaTailorTrackingUrl;am.prototype.requestMediaTailorStream=am.prototype.requestMediaTailorStream;am.prototype.initMediaTailor=am.prototype.initMediaTailor;am.prototype.updateClientSideAdsRenderingSettings=am.prototype.updateClientSideAdsRenderingSettings;am.prototype.requestClientSideAds=am.prototype.requestClientSideAds;am.prototype.onAssetUnload=am.prototype.onAssetUnload;am.prototype.release=am.prototype.release;am.prototype.initClientSide=am.prototype.initClientSide;am.prototype.initInterstitial=am.prototype.initInterstitial;am.prototype.configure=am.prototype.configure;am.prototype.setLocale=am.prototype.setLocale;am.ADS_LOADED="ads-loaded";am.AD_STARTED="ad-started";am.AD_FIRST_QUARTILE="ad-first-quartile";am.AD_MIDPOINT="ad-midpoint";am.AD_THIRD_QUARTILE="ad-third-quartile";am.AD_COMPLETE="ad-complete";am.AD_STOPPED="ad-stopped";am.AD_SKIPPED="ad-skipped";am.AD_VOLUME_CHANGED="ad-volume-changed";am.AD_MUTED="ad-muted";am.AD_PAUSED="ad-paused";am.AD_RESUMED="ad-resumed";am.AD_SKIP_STATE_CHANGED="ad-skip-state-changed";am.CUEPOINTS_CHANGED="ad-cue-points-changed";am.IMA_AD_MANAGER_LOADED="ima-ad-manager-loaded";am.IMA_STREAM_MANAGER_LOADED="ima-stream-manager-loaded";am.AD_CLICKED="ad-clicked";am.AD_PROGRESS="ad-progress";am.AD_BUFFERING="ad-buffering";am.AD_IMPRESSION="ad-impression";am.AD_DURATION_CHANGED="ad-duration-changed";am.AD_CLOSED="ad-closed";am.AD_LOADED="ad-loaded";am.ALL_ADS_COMPLETED="all-ads-completed";am.AD_LINEAR_CHANGED="ad-linear-changed";am.AD_METADATA="ad-metadata";am.AD_RECOVERABLE_ERROR="ad-recoverable-error";am.AD_ERROR="ad-error";am.AD_BREAK_READY="ad-break-ready";am.AD_INTERACTION="ad-interaction";am.AD_CONTENT_PAUSE_REQUESTED="ad-content-pause-requested";am.AD_CONTENT_RESUME_REQUESTED="ad-content-resume-requested";am.AD_CONTENT_ATTACH_REQUESTED="ad-content-attach-requested";sp=function(){return new am};function sm(t){return JSON.stringify(t,(function(t,n){if("function"!=typeof n){if(n instanceof Event||n instanceof Jr){var e={};for(i in n)(t=n[i])&&"object"==typeof t?"detail"==i&&(e[i]=t):i in Event||(e[i]=t);return e}if(n instanceof Error){var i=new Set(["name","message","stack"]);for(e in n)i.add(e);e=c(Object.getOwnPropertyNames(n));for(t=e.next();!t.done;t=e.next())i.add(t.value);e={};i=c(i);for(t=i.next();!t.done;t=i.next())t=t.value,e[t]=n[t];n={__type__:"Error",contents:e}}else if(n instanceof TimeRanges){i={__type__:"TimeRanges",length:n.length,start:[],end:[]};n=c(Xs(n));for(e=n.next();!e.done;e=n.next())e=e.value,t=e.end,i.start.push(e.start),i.end.push(t);n=i}else n=ArrayBuffer.isView(n)&&1===n.BYTES_PER_ELEMENT?{__type__:"Uint8Array",entries:Array.from(n)}:"number"==typeof n?isNaN(n)?"NaN":isFinite(n)?n:0>n?"-Infinity":"Infinity":n;return n}}))}function om(t){return JSON.parse(t,(function(t,n){if("NaN"==n)var e=NaN;else if("-Infinity"==n)e=-Infinity;else if("Infinity"==n)e=Infinity;else if(n&&"object"==typeof n&&"TimeRanges"==n.__type__)e=fm(n);else if(n&&"object"==typeof n&&"Uint8Array"==n.__type__)e=new Uint8Array(n.entries);else if(n&&"object"==typeof n&&"Error"==n.__type__){t=n.contents;n=Error(t.message);for(e in t)n[e]=t[e];e=n}else e=n;return e}))}function fm(t){return{length:t.length,start:function(n){return t.start[n]},end:function(n){return t.end[n]}}}var cm="ended play playing pause pausing ratechange seeked seeking timeupdate volumechange".split(" "),lm="buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume".split(" "),hm=["loop","playbackRate"],dm=["pause","play"],vm=(new Map).set("getAssetUri",2).set("getAudioLanguages",4).set("getAudioLanguagesAndRoles",4).set("getBufferFullness",1).set("getBufferedInfo",2).set("getExpiration",2).set("getKeyStatuses",2).set("getPlaybackRate",2).set("getTextLanguages",4).set("getTextLanguagesAndRoles",4).set("isAudioOnly",10).set("isBuffering",1).set("isInProgress",1).set("isLive",10).set("isTextTrackVisible",1).set("isVideoOnly",10).set("keySystem",10).set("seekRange",1).set("getLoadMode",10).set("getManifestType",10).set("isFullyLoaded",1).set("isEnded",1),pm=(new Map).set("getConfiguration",4).set("getConfigurationForLowLatency",4).set("getStats",5).set("getAudioTracks",2).set("getChaptersTracks",2).set("getImageTracks",2).set("getVideoTracks",2).set("getTextTracks",2).set("getVariantTracks",2),mm=(new Map).set("getPlayheadTimeAsDate",1).set("getPresentationStartTimeAsDate",20).set("getSegmentAvailabilityDuration",20),wm=[["getConfiguration","configure","getConfigurationForLowLatency","configurationForLowLatency"]],gm=[["isTextTrackVisible","setTextTrackVisibility"]],bm="cancelTrickPlay configure configurationForLowLatency getChapters resetConfiguration retryStreaming selectAudioLanguage selectAudioTrack selectTextLanguage selectTextTrack selectVariantTrack selectVariantsByLabel selectVideoTrack setTextTrackVisibility trickPlay updateStartTime goToLive useTrickPlayTrackIfAvailable".split(" "),ym="addChaptersTrack addTextTrackAsync addThumbnailsTrack getAllThumbnails getChaptersAsync getThumbnails attach attachCanvas detach load unload".split(" ");function km(t,n,e,i,r,a,u){var s=this;this.G=t;this.K=u;this.l=new Di(n);this.L=e;this.s=false;this.A=i;this.F=r;this.M=a;this.i=this.m=false;this.I="";this.o=null;this.B=function(){return Im(s)};this.C=function(t,n){t=om(n);switch(t.type){case"event":var e=t.targetName,i=Zr(t.event);s.A(e,i);break;case"update":e=t.update;for(i in e){t=s.g[i]||{};for(var r in e[i])t[r]=e[i][r]}s.s&&(s.L(),s.s=false);break;case"asyncComplete":if(r=t.id,i=t.error,n=t.res,t=s.h.get(r),s.h.delete(r),t)if(i){r=new zt(i.severity,i.category,i.code);for(e in i)r[e]=i[e];t.reject(r)}else t.resolve(n)}};this.g={video:{},player:{}};this.H=0;this.h=new Map;this.j=null;Dm.add(this)}i=km.prototype;i.destroy=function(){Dm.delete(this);Mm(this);Pm&&Am(this);this.l&&(this.l.stop(),this.l=null);this.F=this.A=null;this.i=this.m=false;this.C=this.B=this.j=this.h=this.g=this.o=null;return Promise.resolve()};i.ub=function(){return this.i};i.Vg=function(){return this.I};i.init=function(){if(this.G.length)if(t.chrome&&chrome.cast&&chrome.cast.isAvailable){this.m=true;this.l.Hb();var n=new chrome.cast.SessionRequest(this.G,[],null,this.K,null);n=new chrome.cast.ApiConfig(n,(function(t){for(var n=c(Dm),e=n.next();!e.done;e=n.next()){e=e.value;var i=t;e.j=new qr;e.s=true;Em(e,i)}}),(function(t){for(var n=c(Dm),e=n.next();!e.done;e=n.next())e=e.value,Cm="available"==t,e.l.Hb()}),"origin_scoped");chrome.cast.initialize(n,(function(){}),(function(){}));Cm&&this.l.ha(Nm);(n=Pm)&&n.status!=chrome.cast.SessionStatus.STOPPED?(this.j=new qr,this.s=true,Em(this,n)):Pm=null}else t.__onGCastApiAvailable!==Lm&&(Rm=t.__onGCastApiAvailable||null,t.__onGCastApiAvailable=Lm)};i.gh=function(t){this.o=t;this.i&&xm(this,{type:"appData",appData:this.o})};i.cast=function(){var t=this;return _((function(n){if(!t.m)throw new zt(1,8,8e3);if(!Cm)throw new zt(1,8,8001);if(t.i)throw new zt(1,8,8002);t.j=new qr;chrome.cast.requestSession((function(n){return Em(t,n)}),(function(n){return Sm(t,n)}));return T(n,t.j,0)}))};function Tm(t){t.i&&chrome.cast.requestSession((function(n){return Em(t,n)}),(function(n){return Sm(t,n)}))}i.jd=function(){if(this.i){Mm(this);if(Pm){Am(this);try{Pm.stop((function(){}),(function(){}))}catch(t){}Pm=null}Im(this)}};i.get=function(t,n){var e=this;if("video"==t){if(dm.includes(n))return function(){return e.xi.apply(e,[t,n].concat(l(U.apply(0,arguments))))}}else if("player"==t){if(mm.has(n)&&!this.get("player","isLive")())return function(){};if(bm.includes(n))return function(){return e.xi.apply(e,[t,n].concat(l(U.apply(0,arguments))))};if(ym.includes(n))return function(){return e.Gk.apply(e,[t,n].concat(l(U.apply(0,arguments))))};if(vm.has(n)||pm.has(n))return function(){return e.g[t][n]}}return this.g[t][n]};i.set=function(t,n,e){this.g[t][n]=e;xm(this,{type:"set",targetName:t,property:n,value:e})};function Em(t,n){var e=t.M();Pm=n;n.addUpdateListener(t.B);n.addMessageListener("urn:x-cast:com.google.shaka.v2",t.C);Im(t);xm(t,{type:"init",initState:e,appData:t.o});t.j.resolve()}function Sm(t,n){var e=8003;switch(n.code){case"cancel":e=8004;break;case"timeout":e=8005;break;case"receiver_unavailable":e=8006}t.j.reject(new zt(2,8,e,n))}i.xi=function(t,n){xm(this,{type:"call",targetName:t,methodName:n,args:U.apply(2,arguments)})};i.Gk=function(t,n){var e=U.apply(2,arguments),i=new qr,r=this.H.toString();this.H++;this.h.set(r,i);try{xm(this,{type:"asyncCall",targetName:t,methodName:n,args:e,id:r})}catch(t){i.reject(t)}return i};function Am(t){var n=Pm;n.removeUpdateListener(t.B);n.removeMessageListener("urn:x-cast:com.google.shaka.v2",t.C)}function Im(t){var n=Pm?"connected"==Pm.status:false;if(t.i&&!n){t.F();for(var e in t.g)t.g[e]={};Mm(t)}t.i=n;t.I=n?Pm.receiver.friendlyName:"";t.l.Hb()}function Mm(t){if(t.h)for(var n=c(t.h.keys()),e=n.next();!e.done;e=n.next()){e=e.value;var i=t.h.get(e);t.h.delete(e);i.reject(new zt(1,7,7e3))}}function xm(t,n){n=sm(n);var e=Pm;try{e.sendMessage("urn:x-cast:com.google.shaka.v2",n,(function(){}),J)}catch(i){throw n=new zt(2,8,8005,i),e=new Jr("error",(new Map).set("detail",n)),t.A("player",e),t.jd(),n}}var Nm=.02,Cm=false,Pm=null,Rm=null,Dm=new Set;function Lm(n){Rm?t.__onGCastApiAvailable=Rm:delete t.__onGCastApiAvailable;Rm=null;if(n)for(var e=c(Dm),i=e.next();!i.done;i=e.next())i.value.init();"function"===typeof t.__onGCastApiAvailable&&t.__onGCastApiAvailable(n)}function Om(n,e,i,r){r=void 0===r?false:r;na.call(this);var a=this;this.i=n;this.h=e;this.l=this.o=this.m=this.s=this.j=null;this.H=i;this.G=r;this.C=[];this.B=[];this.A=[];this.F=new Map;this.g=null;t.chrome?(this.g=new km(i,(function(){return Fm(a)}),(function(){return Vm(a)}),(function(t,n){return jm(a,t,n)}),(function(){return zm(a)}),(function(){return Hm(a)}),r),_m(this)):(this.j=this.i,this.s=this.h)}g(Om,na);i=Om.prototype;i.destroy=function(t){this.g&&(void 0===t?0:t)&&this.g.jd();this.l&&(this.l.release(),this.l=null);t=[];this.h&&(t.push(this.h.destroy()),this.h=null);this.g&&(t.push(this.g.destroy()),this.g=null);this.s=this.j=this.i=null;na.prototype.release.call(this);return Promise.all(t)};i.Wj=function(){return this.j};i.ld=function(){return this.s};i.gj=function(){return this.g?this.g.m&&Cm:false};i.ub=function(){return this.g?this.g.ub():false};i.Vg=function(){return this.g?this.g.Vg():""};i.cast=function(){var t=this;return _((function(n){return 1==n.g?t.g?T(n,t.g.cast(),2):n.return():t.h?T(n,t.h.vc(),0):n.return()}))};i.gh=function(t){this.g&&this.g.gh(t)};i.Vk=function(){this.g&&Tm(this.g)};i.jd=function(){this.g&&this.g.jd()};i.hj=function(t,n){n=void 0===n?false:n;var e=this;return _((function(i){if(1==i.g){if(t==e.H&&n==e.G)return i.return();e.H=t;e.G=n;if(!e.g)return i.return();e.g.jd();return T(i,e.g.destroy(),2)}e.g=null;e.g=new km(t,(function(){return Fm(e)}),(function(){return Vm(e)}),(function(t,n){return jm(e,t,n)}),(function(){return zm(e)}),(function(){return Hm(e)}),n);e.g.init();E(i)}))};function _m(t){t.g.init();t.l=new it;for(var n=c(cm),e=n.next();!e.done;e=n.next())t.l.D(t.i,e.value,(function(n){t.g.ub()||(n=Zr(n),t.m.dispatchEvent(n))}));for(var i in ta)t.l.D(t.h,ta[i],(function(n){t.g.ub()||t.o.dispatchEvent(n)}));t.j={};n={};for(var r in t.i)n={Vd:n.Vd},n.Vd=r,Object.defineProperty(t.j,n.Vd,{configurable:false,enumerable:true,get:function(n){return function(){return Xm(t,n.Vd)}}(n),set:function(n){return function(e){var i=n.Vd;t.g.ub()?t.g.set("video",i,e):t.i[i]=e}}(n)});t.s={};Bm(t,(function(n){Object.defineProperty(t.s,n,{configurable:false,enumerable:true,get:function(){return qm(t,n)}})}));Um(t);t.m=new na;t.m.xe=t.j;t.o=new na;t.o.xe=t.s;t.l.D(t.h,"unloading",(function(){t.g&&t.g.ub()||Gm(t)}))}function Um(t){var n=new Map;Bm(t,(function(e,i){n.has(i)?(i=n.get(i),e.length<i.length?t.F.set(e,i):t.F.set(i,e)):n.set(i,e)}))}function Bm(t,n){function e(t){return"constructor"==t||"function"!=typeof i[t]?false:!r.has(t)}var i=t.h,r=new Set,a;for(a in i)e(a)&&(r.add(a),n(a,i[a]));t=Object.getPrototypeOf(i);for(a=Object.getPrototypeOf({});t&&t!=a;){for(var u=c(Object.getOwnPropertyNames(t)),s=u.next();!s.done;s=u.next())s=s.value,e(s)&&(r.add(s),n(s,i[s]));t=Object.getPrototypeOf(t)}}function Hm(t){var n={video:{},player:{},playerAfterLoad:{},manifest:t.h.kd(),startTime:null,addThumbnailsTrackCalls:t.C,addTextTrackAsyncCalls:t.B,addChaptersTrackCalls:t.A};t.i.pause();for(var e=c(hm),i=e.next();!i.done;i=e.next())i=i.value,n.video[i]=t.i[i];t.i.ended||(n.startTime=t.i.currentTime);e=c(wm);for(i=e.next();!i.done;i=e.next()){var r=i.value;i=r[1];r=t.h[r[0]]();n.player[i]=r}e=c(gm);for(i=e.next();!i.done;i=e.next())r=i.value,i=r[1],r=t.h[r[0]](),n.playerAfterLoad[i]=r;return n}function Fm(t){var n=new Jr("caststatuschanged");t.dispatchEvent(n)}function Vm(t){var n=new Jr(t.j.paused?"pause":"play");t.m.dispatchEvent(n)}function zm(t){for(var n=c(wm),e=n.next();!e.done;e=n.next()){var i=e.value;e=i[1];i=t.g.get("player",i[0])();t.h[e](i)}var r=t.C,a=t.B,u=t.A;Gm(t);var s=t.g.get("player","getAssetUri")();i=t.g.get("video","ended");n=Promise.resolve();var o=t.i.autoplay;e=null;i||(e=t.g.get("video","currentTime"));var f;(i=t.g.get("player","getTextTracks")())&&i.length&&(f=i.find((function(t){return t.active})));var h=t.g.get("player","isTextTrackVisible")();s&&(t.i.autoplay=false,n=t.h.load(s,e));var d={};e=c(hm);for(i=e.next();!i.done;i=e.next())i=i.value,d[i]=t.g.get("video",i);n.then((function(){if(t.i){for(var n=c(r),e=n.next();!e.done;e=n.next()){e=e.value;var i;(i=t.ld()).Fe.apply(i,l(e))}n=c(a);for(i=n.next();!i.done;i=n.next()){i=i.value;var v;(v=t.ld()).Ed.apply(v,l(i))}v=c(u);for(n=v.next();!n.done;n=v.next()){n=n.value;var p;(p=t.ld()).Ee.apply(p,l(n))}p=c(hm);for(v=p.next();!v.done;v=p.next())v=v.value,t.i[v]=d[v];p=c(gm);for(v=p.next();!v.done;v=p.next())n=v.value,v=n[1],n=t.g.get("player",n[0])(),t.h[v](n);t.h.kh(h);f&&t.h.eh(f.language,f.roles,f.forced);t.i.autoplay=o;s&&t.i.play()}}),(function(n){n=(new Map).set("detail",n);n=new Jr("error",n);t.h.dispatchEvent(n)}))}function Xm(t,n){if("addEventListener"==n)return function(n,e,i){return t.m.addEventListener(n,e,i)};if("removeEventListener"==n)return function(n,e,i){return t.m.removeEventListener(n,e,i)};if(t.g.ub()&&0==Object.keys(t.g.g.video).length){var e=t.i[n];if("function"!=typeof e)return e}return t.g.ub()?t.g.get("video",n):(n=t.i[n],"function"==typeof n&&(n=n.bind(t.i)),n)}function qm(t,n,e){e=void 0===e?false:e;t.F.has(n)&&(n=t.F.get(n));if("addEventListener"==n)return function(n,e,i){return t.o.addEventListener(n,e,i)};if("removeEventListener"==n)return function(n,e,i){return t.o.removeEventListener(n,e,i)};if("getMediaElement"==n)return function(){return t.j};if("getSharedConfiguration"==n)return t.g.get("player","getConfiguration");if("getNetworkingEngine"==n)return function(){return t.h.Nb()};if("getDrmEngine"==n)return function(){return t.h.C};if("getAdManager"==n)return function(){return t.h.Sh()};if("getQueueManager"==n)return function(){return t.h.Yh()};if("setVideoContainer"==n)return function(n){return t.h.Ni(n)};if(!e){if("addThumbnailsTrack"==n)return function(){var e=U.apply(0,arguments);t.C.push(e);return qm(t,n,true).apply(null,l(e))};if("addTextTrackAsync"==n)return function(){var e=U.apply(0,arguments);t.B.push(e);return qm(t,n,true).apply(null,l(e))};if("addChaptersTrack"==n)return function(){var e=U.apply(0,arguments);t.A.push(e);return qm(t,n,true).apply(null,l(e))}}if(t.g.ub()){if("getManifest"==n||"drmInfo"==n)return function(){Y(n+"() does not work while casting!");return null};if("attach"==n||"detach"==n)return function(){Y(n+"() does not work while casting!");return Promise.resolve()};if("getChapters"==n)return function(){Y(n+"() does not work while casting!");return[]}}return t.g.ub()&&0==Object.keys(t.g.g.video).length&&(vm.has(n)||pm.has(n))||!t.g.ub()?t.h[n].bind(t.h):t.g.get("player",n)}function jm(t,n,e){t.g.ub()&&("video"==n?t.m.dispatchEvent(e):"player"==n&&("unloading"==e.type&&Gm(t),t.o.dispatchEvent(e)))}function Gm(t){t.C=[];t.B=[];t.A=[]}q("shaka.cast.CastProxy",Om);Om.prototype.changeReceiverId=Om.prototype.hj;Om.prototype.forceDisconnect=Om.prototype.jd;Om.prototype.suggestDisconnect=Om.prototype.Vk;Om.prototype.setAppData=Om.prototype.gh;Om.prototype.cast=Om.prototype.cast;Om.prototype.receiverName=Om.prototype.Vg;Om.prototype.isCasting=Om.prototype.ub;Om.prototype.canCast=Om.prototype.gj;Om.prototype.getPlayer=Om.prototype.ld;Om.prototype.getVideo=Om.prototype.Wj;Om.prototype.destroy=Om.prototype.destroy;function Km(t,n,e,i){na.call(this);var r=this;this.h=t;this.g=n;this.j=new it;this.H={video:t,player:n};this.F=e||function(){};this.I=i||function(t){return t};this.i=null;this.G=false;this.o=true;this.m=0;this.B=false;this.A=true;this.s=this.l=null;this.C=new Di((function(){Zm(r)}));Wm(this)}g(Km,na);i=Km.prototype;i.isConnected=function(){return this.G};i.dk=function(){return this.o};i.Sk=function(t){this.i=t};i.lj=function(){this.i=null};i.Tk=function(t){this.i||(this.i={metadataType:cast.receiver.media.MetadataType.GENERIC});this.i.title=t};i.Rk=function(t){this.i||(this.i={metadataType:cast.receiver.media.MetadataType.GENERIC});this.i.images=[{url:t}]};i.Qk=function(t){this.i||(this.i={});this.i.artist=t;this.i.metadataType=cast.receiver.media.MetadataType.MUSIC_TRACK};i.destroy=function(){var t=this,n,e;return _((function(i){if(1==i.g)return t.j&&(t.j.release(),t.j=null),n=[],t.g&&(n.push(t.g.destroy()),t.g=null),t.C&&(t.C.stop(),t.C=null),t.h=null,t.H=null,t.F=null,t.G=false,t.o=true,t.l=null,t.s=null,na.prototype.release.call(t),T(i,Promise.all(n),2);e=cast.receiver.CastReceiverManager.getInstance();e.stop();E(i)}))};function Wm(t){var n=cast.receiver.CastReceiverManager.getInstance();n.onSenderConnected=function(){return $m(t)};n.onSenderDisconnected=function(){return $m(t)};n.onSystemVolumeChanged=function(){var n=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();n&&aw(t,{type:"update",update:{video:{volume:n.level,muted:n.muted}}},t.l);aw(t,{type:"event",targetName:"video",event:{type:"volumechange"}},t.l)};t.s=n.getCastMessageBus("urn:x-cast:com.google.cast.media");t.s.onMessage=function(n){return iw(t,n)};t.l=n.getCastMessageBus("urn:x-cast:com.google.shaka.v2");t.l.onMessage=function(n){return ew(t,n)};n.start();n=c(cm);for(var e=n.next();!e.done;e=n.next())t.j.D(t.h,e.value,(function(n){return Jm(t,"video",n)}));for(var i in ta)t.j.D(t.g,ta[i],(function(n){return Jm(t,"player",n)}));t.j.D(t.h,"loadeddata",(function(){t.B=true}));t.j.D(t.g,"loading",(function(){t.o=false;Ym(t)}));t.j.D(t.h,"playing",(function(){t.o=false;Ym(t)}));t.j.D(t.h,"pause",(function(){Ym(t)}));t.j.D(t.g,"unloading",(function(){t.o=true;Ym(t)}));t.j.D(t.h,"ended",(function(){new Di((function(){t.h&&t.h.ended&&(t.o=true,Ym(t))})).ha(ow)}))}function $m(t){t.m=0;t.A=true;t.G=0!=cast.receiver.CastReceiverManager.getInstance().getSenders().length;Ym(t)}function Ym(t){var n;_((function(e){if(1==e.g)return T(e,Promise.resolve(),2);if(!t.g)return e.return();n=new Jr("caststatuschanged");t.dispatchEvent(n);tw(t)||uw(t);E(e)}))}function Qm(t,n,e){var i,r,a,u,s,o,f,h,d,v,p,m,w,g,b,y,k,A,x;_((function(N){switch(N.g){case 1:for(i in n.player)r=n.player[i],t.g[i](r);t.F(e);a=t.h.autoplay;return n.manifest?(t.h.autoplay=false,S(N,5),T(N,t.g.load(n.manifest,n.startTime),7)):T(N,Promise.resolve(),3);case 7:if(n.addThumbnailsTrackCalls)for(u=c(n.addThumbnailsTrackCalls),s=u.next();!s.done;s=u.next())o=s.value,t.g.Fe.apply(t.g,l(o));if(n.addTextTrackAsyncCalls)for(f=c(n.addTextTrackAsyncCalls),h=f.next();!h.done;h=f.next())d=h.value,t.g.Ed.apply(t.g,l(d));if(n.addChaptersTrackCalls)for(v=c(n.addChaptersTrackCalls),p=v.next();!p.done;p=v.next())m=p.value,t.g.Ee.apply(t.g,l(m));I(N,3);break;case 5:return w=M(N),g=(new Map).set("detail",w),b=new Jr("error",g),t.g&&t.g.dispatchEvent(b),N.return();case 3:if(!t.g)return N.return();for(y in n.video)k=n.video[y],t.h[y]=k;for(A in n.playerAfterLoad)x=n.playerAfterLoad[A],t.g[A](x);t.h.autoplay=a;n.manifest&&(t.h.play(),uw(t));E(N)}}))}function Jm(t,n,e){t.g&&(Zm(t),aw(t,{type:"event",targetName:n,event:e},t.l))}function Zm(t){t.C.ha(sw);for(var n={video:{},player:{}},e=c(lm),i=e.next();!i.done;i=e.next())i=i.value,n.video[i]=t.h[i];t.g.V()&&mm.forEach((function(e,i){0==t.m%e&&(n.player[i]=t.g[i]())}));vm.forEach((function(e,i){0==t.m%e&&(n.player[i]=t.g[i]())}));if(e=cast.receiver.CastReceiverManager.getInstance().getSystemVolume())n.video.volume=e.level,n.video.muted=e.muted;aw(t,{type:"update",update:n},t.l);pm.forEach((function(n,e){0==t.m%n&&(n={player:{}},n.player[e]=t.g[e](),aw(t,{type:"update",update:n},t.l))}));t.B&&(t.m+=1);tw(t)}function tw(t){return t.A&&(t.h.duration||t.g.V())?(nw(t),t.A=false,true):false}function nw(t,n){var e={contentId:t.g.kd(),streamType:t.g.V()?"LIVE":"BUFFERED",contentType:""};t.g.V()||(e.duration=t.h.duration);t.i&&(e.metadata=t.i);uw(t,void 0===n?0:n,e)}function ew(t,n){var e=om(n.data);switch(e.type){case"init":t.m=0;t.B=false;t.A=true;Qm(t,e.initState,e.appData);Zm(t);break;case"appData":t.F(e.appData);break;case"set":var i=e.targetName,r=e.property;e=e.value;if("video"==i)if(n=cast.receiver.CastReceiverManager.getInstance(),"volume"==r){n.setSystemVolumeLevel(e);break}else if("muted"==r){n.setSystemVolumeMuted(e);break}t.H[i][r]=e;break;case"call":i=t.H[e.targetName];i[e.methodName].apply(i,e.args);break;case"asyncCall":i=e.targetName;r=e.methodName;"player"==i&&"load"==r&&(t.m=0,t.B=false);var a=e.id,u=n.senderId;n=t.H[i];e=n[r].apply(n,e.args);"player"==i&&"load"==r&&(e=e.then((function(){t.A=true})));e.then((function(n){return rw(t,u,a,null,n)}),(function(n){return rw(t,u,a,n,null)}))}}function iw(t,n){var e=om(n.data);switch(e.type){case"PLAY":t.h.play();uw(t);break;case"PAUSE":t.h.pause();uw(t);break;case"SEEK":n=e.currentTime;var i=e.resumeState;null!=n&&(t.h.currentTime=Number(n));i&&"PLAYBACK_START"==i?(t.h.play(),uw(t)):i&&"PLAYBACK_PAUSE"==i&&(t.h.pause(),uw(t));break;case"STOP":t.g.vc().then((function(){t.g&&uw(t)}));break;case"GET_STATUS":nw(t,Number(e.requestId));break;case"VOLUME":i=e.volume;n=i.level;i=i.muted;var r=t.h.volume,a=t.h.muted;null!=n&&(t.h.volume=Number(n));null!=i&&(t.h.muted=i);r==t.h.volume&&a==t.h.muted||uw(t);break;case"LOAD":t.m=0;t.B=false;t.A=false;n=e.media;i=e.currentTime;r=t.I(n.contentId);a=e.autoplay||true;t.F(n.customData);a&&(t.h.autoplay=true);t.g.load(r,i).then((function(){t.g&&nw(t)})).catch((function(n){var i="LOAD_FAILED";7==n.category&&7e3==n.code&&(i="LOAD_CANCELLED");aw(t,{requestId:Number(e.requestId),type:i},t.s)}));break;default:aw(t,{requestId:Number(e.requestId),type:"INVALID_REQUEST",reason:"INVALID_COMMAND"},t.s)}}function rw(t,n,e,i,r){t.g&&aw(t,{type:"asyncComplete",id:e,error:i,res:r},t.l,n)}function aw(t,n,e,i){t.G&&(t=sm(n),i?e.getCastChannel(i).send(t):e.broadcast(t))}function uw(t,n,e){e=void 0===e?null:e;var i={mediaSessionId:0,playbackRate:t.h.playbackRate,playerState:t.o?fw:t.g.Ig()?lw:t.h.paused?hw:cw,currentTime:t.h.currentTime,supportedMediaCommands:63,volume:{level:t.h.volume,muted:t.h.muted}};e&&(i.media=e);aw(t,{requestId:void 0===n?0:n,type:"MEDIA_STATUS",status:[i]},t.s)}q("shaka.cast.CastReceiver",Km);Km.prototype.destroy=Km.prototype.destroy;Km.prototype.setContentArtist=Km.prototype.Qk;Km.prototype.setContentImage=Km.prototype.Rk;Km.prototype.setContentTitle=Km.prototype.Tk;Km.prototype.clearContentMetadata=Km.prototype.lj;Km.prototype.setContentMetadata=Km.prototype.Sk;Km.prototype.isIdle=Km.prototype.dk;Km.prototype.isConnected=Km.prototype.isConnected;var sw=.5,ow=5,fw="IDLE",cw="PLAYING",lw="BUFFERING",hw="PAUSED";function dw(t,n,e,i,r){if(i>=r)return null;for(var a=-1,u=-1,s=0;s<e.length;s++)if(e[s].some((function(t){return null!=t&&""!=t.g.trim()}))){a=s;break}for(s=e.length-1;0<=s;s--)if(e[s].some((function(t){return null!=t&&""!=t.g.trim()}))){u=s;break}if(-1===a||-1===u)return null;for(var o=s=false,f="white",c="black",l=vw(i,r,s,o,f,c);a<=u;a++){for(var h=e[a],d=-1,v=-1,p=0;p<h.length;p++)if(null!=h[p]&&""!==h[p].g.trim()){d=p;break}for(p=h.length-1;0<=p;p--)if(null!=h[p]&&""!==h[p].g.trim()){v=p;break}if(-1===d||-1===v)h=pw(i,r),t.nestedCues.push(h);else{for(;d<=v;d++)if(p=h[d]){var m=p.l,w=p.i,g=p.j,b=p.h;if(m!=s||w!=o||g!=f||b!=c)l.payload&&t.nestedCues.push(l),l=vw(i,r,m,w,g,b),s=m,o=w,f=g,c=b;l.payload+=p.g}else l.payload+=" ";l.payload&&t.nestedCues.push(l);a!==u&&(l=pw(i,r),t.nestedCues.push(l));l=vw(i,r,s,o,f,c)}}return t.nestedCues.length?{cue:t,stream:n}:null}function vw(t,n,e,i,r,a){t=new Ne(t,n,"");e&&t.textDecoration.push(ti);i&&(t.fontStyle=Je);t.color=r;t.backgroundColor=a;return t}function pw(t,n){t=new Ne(t,n,"");t.lineBreak=true;return t}function mw(t,n,e,i,r){this.g=t;this.l=n;this.i=e;this.h=i;this.j=r}function ww(t,n){this.i=[];this.g=1;this.h=0;this.C=t;this.B=n;this.j=this.m=false;this.l="white";this.o="black";this.s=this.A=null;bw(this)}function gw(t,n,e){var i="CC"+((t.C<<1|t.B)+1),r=new Ne(n,e,"");r.lineInterpretation=1;var a=Mw.get(t.g);a&&(r.line=a);null!=t.s&&null!=t.A&&(r.position=10+Math.min(70,10*t.s)+2.5*t.A);(n=dw(r,i,t.i,n,e))&&15<t.g+n.cue.nestedCues.length-3&&(a=Mw.get(t.g+3-n.cue.nestedCues.length))&&(r.line=a);return n}function bw(t){Tw(t,0,15);t.g=1}function yw(t,n,e){if(!(32>e||127<e)){var i="";switch(n){case 0:i=Ew.has(e)?Ew.get(e):String.fromCharCode(e);break;case 1:i=Sw.get(e);break;case 2:t.i[t.g].pop();i=Aw.get(e);break;case 3:t.i[t.g].pop(),i=Iw.get(e)}i&&t.i[t.g].push(new mw(i,t.m,t.j,t.o,t.l))}}function kw(t,n,e,i){if(!(0>e||0>n))if(n>=e)for(--i;0<=i;i--)t.i[n+i]=t.i[e+i].map((function(t){return t}));else for(var r=0;r<i;r++)t.i[n+r]=t.i[e+r].map((function(t){return t}))}function Tw(t,n,e){for(var i=0;i<=e;i++)t.i[n+i]=[]}var Ew=new Map([[39,"’"],[42,"á"],[92,"é"],[92,"é"],[94,"í"],[95,"ó"],[96,"ú"],[123,"ç"],[124,"÷"],[125,"Ñ"],[126,"ñ"],[127,"█"]]),Sw=new Map([[48,"®"],[49,"°"],[50,"½"],[51,"¿"],[52,"™"],[53,"¢"],[54,"£"],[55,"♪"],[56,"à"],[57," "],[58,"è"],[59,"â"],[60,"ê"],[61,"î"],[62,"ô"],[63,"û"]]),Aw=new Map([[32,"Á"],[33,"É"],[34,"Ó"],[35,"Ú"],[36,"Ü"],[37,"ü"],[38,"‘"],[39,"¡"],[40,"*"],[41,"'"],[42,"─"],[43,"©"],[44,"℠"],[45,"·"],[46,"“"],[47,"”"],[48,"À"],[49,"Â"],[50,"Ç"],[51,"È"],[52,"Ê"],[53,"Ë"],[54,"ë"],[55,"Î"],[56,"Ï"],[57,"ï"],[58,"Ô"],[59,"Ù"],[60,"ù"],[61,"Û"],[62,"«"],[63,"»"]]),Iw=new Map([[32,"Ã"],[33,"ã"],[34,"Í"],[35,"Ì"],[36,"ì"],[37,"Ò"],[38,"ò"],[39,"Õ"],[40,"õ"],[41,"{"],[42,"}"],[43,"\\"],[44,"^"],[45,"_"],[46,"|"],[47,"~"],[48,"Ä"],[49,"ä"],[50,"Ö"],[51,"ö"],[52,"ß"],[53,"¥"],[54,"¤"],[55,"│"],[56,"Å"],[57,"å"],[58,"Ø"],[59,"ø"],[60,"┌"],[61,"┐"],[62,"└"],[63,"┘"]]),Mw=new Map([[1,10],[2,15.33],[3,20.66],[4,26],[5,31.33],[6,36.66],[7,42],[8,47.33],[9,52.66],[10,58],[11,63.33],[12,68.66],[13,74],[14,79.33],[15,84.66]]);function xw(t,n){this.h=0;this.o=new ww(t,n);this.i=new ww(t,n);this.g=this.j=new ww(t,n);this.l=0;this.m=null}function Nw(t,n,e){t.g=t.i;var i=t.g,r=null;3!==t.h&&4!==t.h&&(r=gw(i,t.l,e),e=t.i,e.g=0<e.h?e.h:0,Tw(e,0,15),e=t.j,e.g=0<e.h?e.h:0,Tw(e,0,15),i.g=15);t.h=3;i.h=n;return r}function Cw(t){t.h=1;t.g=t.j;t.g.h=0}function Pw(t){Q("Cea608DataChannel","CEA-608 text mode entered, but is unsupported");t.g=t.o;t.h=4}var Rw="black green blue cyan red yellow magenta black".split(" "),Dw="white green blue cyan red yellow magenta white_italics".split(" ");function Lw(t,n){this.I=n;this.M=t;this.K=this.l=false;this.m=this.o=this.G=this.L=this.H=0;this.F=2;this.i=[];this.g=this.h=this.j=0;this.C=this.A=false;this.B="white";this.s="black";Ow(this)}function Ow(t){t.i=[];for(var n=0;16>n;n++)t.i.push(_w())}function _w(){for(var t=[],n=0;42>n;n++)t.push(null);return t}function Uw(t,n){Bw(t)&&(t.i[t.h][t.g]=new mw(n,t.C,t.A,t.s,t.B),t.g++)}function Bw(t){var n=t.g<t.m&&0<=t.g;return t.h<t.o&&0<=t.h&&n}Lw.prototype.isVisible=function(){return this.l};function Hw(t){for(var n=0,e=1;16>e;e++,n++)t.i[n]=t.i[e];for(e=0;1>e;e++,n++)t.i[n]=_w()}function Fw(t,n,e){var i=new Ne(t.j,n,"");i.textAlign=0===t.F?"left":1===t.F?"right":Be;var r=i.region;t.I&&(r.id+="svc"+t.I);r.id+="win"+t.M;r.height=t.o;r.width=t.m;r.heightUnits=2;r.widthUnits=2;r.viewportAnchorX=t.H;r.viewportAnchorY=t.L;r.viewportAnchorUnits=t.K?Dn:2;switch(t.G){case 0:r.regionAnchorX=0;r.regionAnchorY=0;break;case 1:r.regionAnchorX=50;r.regionAnchorY=0;break;case 2:r.regionAnchorX=100;r.regionAnchorY=0;break;case 3:r.regionAnchorX=0;r.regionAnchorY=50;break;case 4:r.regionAnchorX=50;r.regionAnchorY=50;break;case 5:r.regionAnchorX=100;r.regionAnchorY=50;break;case 6:r.regionAnchorX=0;r.regionAnchorY=100;break;case 7:r.regionAnchorX=50;r.regionAnchorY=100;break;case 8:r.regionAnchorX=100,r.regionAnchorY=100}if(e=dw(i,"svc"+e,t.i,t.j,n))t.j=n;return e}Lw.prototype.display=function(){this.l=true};function Vw(){this.i=[];this.h=null;this.g=0}function zw(t,n){3===n.type?(t.g=2*(n.value&63)-1,t.h=[]):t.h&&(0<t.g&&(t.h.push(n),t.g--),0===t.g&&(t.i.push(new Xw(t.h)),t.h=null,t.g=0))}function Xw(t){this.g=0;this.h=t}Xw.prototype.Fa=function(){return this.g<this.h.length};Xw.prototype.Ma=function(){return this.g};function qw(t){if(!t.Fa())throw new zt(2,2,3e3);return t.h[t.g++]}Xw.prototype.skip=function(t){if(this.g+t>this.h.length)throw new zt(2,2,3e3);this.g+=t};Xw.prototype.Di=function(t){if(0>this.g-t)throw new zt(2,2,3e3);this.g-=t};function jw(t){this.i=t;this.h=[null,null,null,null,null,null,null,null];this.g=null}function Gw(t,n,e,i){if(!t.g)return[];if(24==e)return e=qw(n).value,i=qw(n).value,e=function(t){return t.map((function(t){return("0"+(t&255).toString(16)).slice(-2)})).join("")}([e,i]),Uw(t.g,String.fromCharCode(parseInt(e,16))),[];n=t.g;var r=null;switch(e){case 8:!Bw(n)||0>=n.g&&0>=n.h||(0>=n.g?(n.g=n.m-1,n.h--):n.g--,n.i[n.h][n.g]=null);break;case 13:n.isVisible()&&(r=Fw(n,i,t.i));n.h+1>=n.o?Hw(n):n.h++;n.g=0;break;case 14:n.isVisible()&&(r=Fw(n,i,t.i));n.i[n.h]=_w();n.g=0;break;case 12:n.isVisible()&&(r=Fw(n,i,t.i)),Ow(n),n.h=0,n.g=0}return r?[r]:[]}function Kw(t,n,e,i){if(128<=e&&135>=e)i=e&7,t.h[i]&&(t.g=t.h[i]);else{if(136===e){e=qw(n).value;n=[];e=c(Ww(t,e));for(var r=e.next();!r.done;r=e.next()){r=t.h[r.value];if(r.isVisible()){var a=Fw(r,i,t.i);a&&n.push(a)}Ow(r)}return n}if(137===e)for(n=qw(n).value,n=c(Ww(t,n)),e=n.next();!e.done;e=n.next())e=t.h[e.value],e.isVisible()||(e.j=i),e.display();else{if(138===e){e=qw(n).value;n=null;e=c(Ww(t,e));for(r=e.next();!r.done;r=e.next())r=t.h[r.value],r.isVisible()&&(n=Fw(r,i,t.i)),r.l=false;return n?[n]:[]}if(139===e){e=qw(n).value;n=null;e=c(Ww(t,e));for(r=e.next();!r.done;r=e.next())r=t.h[r.value],r.isVisible()?n=Fw(r,i,t.i):r.j=i,r.l=!r.l;return n?[n]:[]}if(140===e)return n=qw(n).value,$w(t,n,i);if(143===e)return i=$w(t,255,i),Yw(t),i;if(144===e)n.skip(1),i=qw(n).value,t.g&&(t.g.A=0<(i&128),t.g.C=0<(i&64));else if(145===e)i=qw(n).value,e=qw(n).value,n.skip(1),t.g&&(n=Qw((e&48)>>4,(e&12)>>2,e&3),t.g.B=Qw((i&48)>>4,(i&12)>>2,i&3),t.g.s=n);else if(146===e)i=qw(n).value,n=qw(n).value,t.g&&(t=t.g,t.h=i&15,t.g=n&63);else if(151===e)n.skip(1),n.skip(1),i=qw(n).value,n.skip(1),t.g&&(t.g.F=i&3);else if(152<=e&&159>=e){e=(e&15)-8;r=null!==t.h[e];r||(a=new Lw(e,t.i),a.j=i,t.h[e]=a);i=qw(n).value;a=qw(n).value;var u=qw(n).value,s=qw(n).value,o=qw(n).value;n=qw(n).value;r&&0===(n&7)||(n=t.h[e],n.h=0,n.g=0,n.C=false,n.A=false,n.B="white",n.s="black");n=t.h[e];n.l=0<(i&32);n.L=a&127;n.H=u;n.G=(s&240)>>4;n.K=0<(a&128);n.o=(s&15)+1;n.m=(o&63)+1;t.g=t.h[e]}}}return[]}function Ww(t,n){for(var e=[],i=0;8>i;i++)1===(n&1)&&t.h[i]&&e.push(i),n>>=1;return e}function $w(t,n,e){var i=[];n=c(Ww(t,n));for(var r=n.next();!r.done;r=n.next()){r=r.value;var a=t.h[r];a.isVisible()&&(a=Fw(a,e,t.i))&&i.push(a);t.h[r]=null}return i}function Yw(t){t.g=null;t.h=[null,null,null,null,null,null,null,null]}function Qw(t,n,e){var i={0:0,1:0,2:1,3:1};t=i[t];n=i[n];e=i[e];return Zw[t<<2|n<<1|e]}var Jw=new Map([[32," "],[33," "],[37,"…"],[42,"Š"],[44,"Œ"],[48,"█"],[49,"‘"],[50,"’"],[51,"“"],[52,"”"],[53,"•"],[57,"™"],[58,"š"],[60,"œ"],[61,"℠"],[63,"Ÿ"],[118,"⅛"],[119,"⅜"],[120,"⅝"],[121,"⅞"],[122,"│"],[123,"┐"],[124,"└"],[125,"─"],[126,"┘"],[127,"┌"]]),Zw="black blue green cyan red magenta yellow white".split(" ");function tg(){this.h=[];this.g=[];this.i=new Vw;this.l=0;this.m=new Map([["CC1",new xw(0,0)],["CC2",new xw(0,1)],["CC3",new xw(1,0)],["CC4",new xw(1,1)]]);this.s=this.o=0;this.j=new Map;this.B=true;this.A=new Set;ng(this)}tg.prototype.clear=function(){this.l=0;this.h=[];this.g=[];var t=this.i;t.i=[];t.h=[];t.g=0;ng(this);t=c(this.j.values());for(var n=t.next();!n.done;n=t.next())Yw(n.value)};function ng(t){t.o=0;t.s=0;for(var n=c(t.m.values()),e=n.next();!e.done;e=n.next())e=e.value,e.h=0,e.g=e.j,e.m=null,bw(e.i),bw(e.j),bw(e.o);t.B=true}tg.prototype.extract=function(t,n){if(this.B){for(var e=c(this.m.values()),i=e.next();!i.done;i=e.next())i.value.l=n;this.B=false}t=new Ea(t,0);if(!(8>t.getLength())&&181===t.X()&&49===t.Aa()&&1195456820===t.T()&&3===t.X()&&(e=t.X(),0!==(e&64)))for(e&=31,t.skip(1),i=0;i<e;i++){var r=t.X(),a=(r&4)>>2,u=t.X(),s=t.X();a&&(r&=3,0===r||1===r?this.h.push({pts:n,type:r,Bb:u,ec:s,order:this.h.length}):(this.g.push({pts:n,type:r,value:u,order:this.g.length}),this.g.push({pts:n,type:2,value:s,order:this.g.length})))}};tg.prototype.decode=function(){function t(t,n){return t.pts-n.pts||t.order-n.order}var n=[];this.h.sort(t);this.g.sort(t);for(var e=c(this.h),i=e.next();!i.done;i=e.next())(i=eg(this,i.value))&&n.push(i);e=c(this.g);for(i=e.next();!i.done;i=e.next())zw(this.i,i.value);e=c(this.i.i);for(i=e.next();!i.done;i=e.next())i=ig(this,i.value),n.push.apply(n,l(i));this.i.i=[];this.h=[];this.g=[];return n};function eg(t,n){var e=n.type;if(16===(n.Bb&112)){var i=n.Bb>>3&1;0===e?t.o=i:t.s=i}i="CC"+((e<<1|(e?t.s:t.o))+1);e=t.m.get(i);if(255===n.Bb&&255===n.ec||!n.Bb&&!n.ec||!rg(n.Bb)||!rg(n.ec))return 45<=++t.l&&ng(t),null;t.l=0;n.Bb&=127;n.ec&=127;var r=n.Bb;if(1<=r&&15>=r||!n.Bb&&!n.ec)return null;r=null;if(16===(n.Bb&112))t:{t.A.add(i),i=n.Bb;t=n.ec;if(e.m===(i<<8|t))e.m=null;else if(e.m=i<<8|t,16===(i&240)&&64===(t&192)){n=[11,11,1,2,3,4,12,13,14,15,5,6,7,8,9,10][(i&7)<<1|t>>5&1];i="white";r=false;var a=null;var u=95<t?t-96:t-64;13>=u?i=Dw[Math.floor(u/2)]:15>=u?r=true:a=Math.floor((u-16)/2);t=1===(t&1);4!==e.h&&(u=e.g,3===e.h&&n!==u.g&&(e=1+n-u.h,kw(u,e,1+u.g-u.h,u.h),Tw(u,0,e-1),Tw(u,n+1,15-n)),u.g=n,u.m=t,u.j=r,u.l=i,u.s=a,u.o="black")}else if(17===(i&247)&&32===(t&240))e.g.m=false,e.g.j=false,e.g.l="white",yw(e.g,0,32),i=false,n=Dw[(t&14)>>1],"white_italics"===n&&(n="white",i=true),e.g.m=1===(t&1),e.g.j=i,e.g.l=n;else if(16===(i&247)&&32===(t&240)||23===(i&247)&&45===(t&255))n="black",0===(i&7)&&(n=Rw[(t&14)>>1]),e.g.o=n;else if(17===(i&247)&&48===(t&240))yw(e.g,1,t);else if(18===(i&246)&&32===(t&224))yw(e.g,i&1?3:2,t);else{if(20===(i&246)&&32===(t&240)){t=n.pts;i=null;switch(n.ec){case 32:Cw(e);break;case 33:e=e.g;e.i[e.g].pop();break;case 37:i=Nw(e,2,t);break;case 38:i=Nw(e,3,t);break;case 39:i=Nw(e,4,t);break;case 40:yw(e.g,0,32);break;case 41:e.h=2;e.g=e.i;e.g.h=0;e.l=t;break;case 42:bw(e.o);Pw(e);break;case 43:Pw(e);break;case 44:n=e.i;i=null;4!==e.h&&(i=gw(n,e.l,t));Tw(n,0,15);break;case 45:n=e.g;3!==e.h?i=null:(i=gw(n,e.l,t),r=n.g-n.h+1,kw(n,r-1,r,n.h),Tw(n,0,r-1),Tw(n,n.g,15-n.g),e.l=t);break;case 46:Tw(e.j,0,15);break;case 47:n=null,4!==e.h&&(n=gw(e.i,e.l,t)),i=e.j,e.j=e.i,e.i=i,Cw(e),e.l=t,i=n}r=i;break t}(23==i||31==i)&&33<=t&&35>=t&&(e.g.A=t-32)}r=null}else t=n.ec,yw(e.g,0,n.Bb),yw(e.g,0,t);return r}function ig(t,n){var e=[];try{for(;n.Fa();){var i=qw(n).value,r=(i&224)>>5,a=i&31;7===r&&0!=a&&(r=qw(n).value&63);if(0!=r){t.A.add("svc"+r);t.j.has(r)||t.j.set(r,new jw(r));for(var u=t.j.get(r),s=n.Ma();n.Ma()-s<a;){r=u;var o=n,f=qw(o),c=f.value,h=f.pts;if(16===c){var d=qw(o);c=c<<16|d.value}if(0<=c&&31>=c)var v=Gw(r,o,c,h);else if(128<=c&&159>=c)v=Kw(r,o,c,h);else{if(4096<=c&&4127>=c)r=o,o=c&255,8<=o&&15>=o?r.skip(1):16<=o&&23>=o?r.skip(2):24<=o&&31>=o&&r.skip(3);else if(4224<=c&&4255>=c)r=o,o=c&255,128<=o&&135>=o?r.skip(4):136<=o&&143>=o&&r.skip(5);else if(32<=c&&127>=c)o=c,r.g&&(127===o?Uw(r.g,"♪"):Uw(r.g,String.fromCharCode(o)));else if(160<=c&&255>=c)r.g&&Uw(r.g,String.fromCharCode(c));else if(4128<=c&&4223>=c){if(o=c&255,r.g)if(Jw.has(o)){var p=Jw.get(o);Uw(r.g,p)}else Uw(r.g,"_")}else 4256<=c&&4351>=c&&r.g&&(160!=(c&255)?Uw(r.g,"_"):Uw(r.g,"[CC]"));v=[]}e.push.apply(e,l(v))}}}}catch(t){if(t instanceof zt&&3e3===t.code)Q("CEA708_INVALID_DATA","Buffer read out of bounds / invalid CEA-708 Data.");else throw t}return e}function rg(t){for(var n=0;t;)n^=t&1,t>>=1;return 1===n}tg.prototype.getStreams=function(){return Array.from(this.A)};q("shaka.cea.CeaDecoder",tg);Pn=function(){return new tg};function ag(t){for(var n=[],e=t,i=t=0;i<e.length;)2==t&&3==e[i]?(t=0,e=[].concat(l(e)),e.splice(i,1),e=new Uint8Array(e)):0==e[i]?t++:t=0,i++;t=e;for(i=0;i<t.length;){for(e=0;255==t[i];)e+=255,i++;e+=t[i++];for(var r=0;255==t[i];)r+=255,i++;r+=t[i++];4==e&&n.push(t.subarray(i,i+r));i+=r}return n}function ug(){this.j=new Map;this.i=this.h=0;this.g=og}ug.prototype.init=function(t){function n(t){t=t.name;hg.has(t)&&(e.g=hg.get(t))}var e=this,i=[],r=[];(new Ia).box("moov",Ma).box("mvex",Ma).R("trex",(function(t){var n=t.reader;n.skip(4);n.skip(4);t=n.T();n=n.T();e.h=t;e.i=n})).box("trak",Ma).R("tkhd",(function(t){var n=t.reader;t=t.version;1==t?(n.skip(8),n.skip(8)):(n.skip(4),n.skip(4));var e=n.T();1==t?n.skip(8):n.skip(4);n.skip(4);n.skip(8);n.skip(2);n.skip(2);n.skip(2);n.skip(2);n.skip(36);n.Aa();n.Aa();n.Aa();n.Aa();i.push(e)})).box("mdia",Ma).R("mdhd",(function(t){t=ju(t.reader,t.version);r.push(t.timescale)})).box("minf",Ma).box("stbl",Ma).R("stsd",xa).box("avc1",n).box("avc3",n).box("dvav",n).box("dva1",n).box("hev1",n).box("hvc1",n).box("dvh1",n).box("dvhe",n).box("vvc1",n).box("vvi1",n).box("dvc1",n).box("dvi1",n).box("encv",Na).box("sinf",Ma).box("frma",(function(t){t=Wu(t.reader).codec;hg.has(t)&&(e.g=hg.get(t))})).parse(t,true,true);if(!i.length||!r.length||i.length!=r.length)throw new zt(2,2,2010);this.g==og&&Y("Unable to determine bitstream format for CEA parsing!");i.forEach((function(t,n){e.j.set(t,r[n])}))};ug.prototype.parse=function(t){var n=this;if(this.g==og)return[];var e=[],i=0,r=[];(new Ia).box("moof",(function(t){i=t.start;r=[];Ma(t)})).box("traf",(function(t){r.push({baseMediaDecodeTime:null,Jd:n.h,Kd:n.i,si:[],timescale:9e4});Ma(t)})).R("trun",(function(t){var n=r[r.length-1];t=Gu(t.reader,t.version,t.flags);n.si.push(t)})).R("tfhd",(function(t){var e=r[r.length-1];t=Xu(t.reader,t.flags);e.Jd=t.Jd||n.h;e.Kd=t.Kd||n.i;t=t.trackId;n.j.has(t)&&(e.timescale=n.j.get(t))})).R("tfdt",(function(t){var n=r[r.length-1];t=qu(t.reader,t.version);n.baseMediaDecodeTime=t.baseMediaDecodeTime})).box("mdat",(function(t){for(var a=i-t.start-8,u=t.reader.Ma(),s=c(r),o=s.next();!o.done;o=s.next())o=o.value,null===o.baseMediaDecodeTime?Y("Unable to find base media decode time for CEA captions!"):(t.reader.seek(u),sg(n,t.reader,o.baseMediaDecodeTime,o.timescale,o.Jd,o.Kd,a,o.si,e))})).parse(t,false,true);return e};function sg(t,n,e,i,r,a,u,s,o){var f=0,h=a,d=s.map((function(t){return t.bh}));d=[].concat.apply([],l(d));d.length&&(h=d[0].sampleSize||a);for(n.skip(u+s[0].ig);n.Fa();){u=n.T();var v=n.X(),p=null;p=false;s=1;switch(t.g){case fg:p=v&31;p=6==p;break;case cg:s=2;n.skip(1);p=v>>1&63;p=39==p||40==p;break;case lg:s=2;n.skip(1);p=v>>1&63;p=23==p||24==p;break;default:return}if(p)for(v=0,f<d.length&&(v=d[f].yf||0),v=(e+v)/i,s=c(ag(n.Sb(u-s))),p=s.next();!p.done;p=s.next())o.push({packet:p.value,pts:v});else try{n.skip(u-s)}catch(t){break}h-=u+4;0==h&&(e=f<d.length?e+(d[f].dh||r):e+r,f++,f<d.length?h=d[f].sampleSize||a:h=a)}}q("shaka.cea.Mp4CeaParser",ug);var og=0,fg=1,cg=2,lg=3,hg=(new Map).set("avc1",fg).set("avc3",fg).set("dvav",fg).set("dva1",fg).set("hev1",cg).set("hvc1",cg).set("dvh1",cg).set("dvhe",cg).set("vvc1",lg).set("vvi1",lg).set("dvc1",lg).set("dvi1",lg);xn("video/mp4",(function(){return new ug}));function dg(){this.g=null}dg.prototype.init=function(){};dg.prototype.parse=function(t){this.g?this.g.clearData():this.g=new bo;var n=[];t=Bt(t);if(!Ao(t))return n;t=this.g.parse(t);var e=t.Md(),i=t.Ve();t=[];switch(e.video){case"avc":t.push(6);break;case"hvc":t.push(39),t.push(40)}if(!t.length)return n;e=c(i);for(i=e.next();!i.done;i=e.next())if(i=i.value,t.includes(i.type)&&null!=i.time)for(var r=c(ag(i.data)),a=r.next();!a.done;a=r.next())n.push({packet:a.value,pts:i.time});return n};q("shaka.cea.TsCeaParser",dg);xn("video/mp2t",(function(){return new dg}));function vg(t){var n=0,e=Ft(t),i=e.getUint32(n,true);if(i!=t.byteLength)return[];t:{t=n+6;for(n=[];t<e.byteLength-1;){i=e.getUint16(t,true);t+=2;var r=e.getUint16(t,true);t+=2;if(0!=(r&1)||r+t>e.byteLength){e=[];break t}var a=Bt(e,t,r);n.push({type:i,value:a});t+=r}e=n}return e}function pg(t){t=nn(ie(t));t=vg(t).filter((function(t){return t.type===wg}))[0];if(!t)return null;t=jt(t.value,true);return(t=Qn(t,"WRMHEADER"))?t:null}function mg(t){try{var n=pg(t);if(n)t:{for(var e=c(ae(n,"DATA")),i=e.next();!i.done;i=e.next()){var r=i.value;if(r.children)for(var a=c(r.children),u=a.next();!u.done;u=a.next()){var s=u.value;if("LA_URL"==s.tagName){var o=ie(s);break t}}}o=""}else o="";return o}catch(t){return""}}var wg=1;function gg(t,n,e){var i=Tg(t),r=null;t=[];var a=[],u=null,s=new Set(i.map((function(t){return t.keyId})));s.delete(null);var o="cenc";if(1<s.size)throw new zt(2,4,4010);if(!n){a=i.filter((function(t){return"urn:mpeg:dash:sea:2012"==t.xd}));if(1<a.length)throw new zt(2,4,4050);a.length&&(u=Sg(a[0]));(a=i.find((function(t){return"urn:mpeg:dash:mp4protection:2011"==t.xd})))&&a.encryptionScheme&&(o=a.encryptionScheme);a=i.filter((function(t){return"urn:mpeg:dash:mp4protection:2011"==t.xd?(r=t.init||r,false):"urn:mpeg:dash:sea:2012"!=t.xd}));a.length&&(t=kg(r,o,a,e,s),0==t.length&&(t=[sn("",o,r)]))}if(i.length&&!u&&(n||!a.length))for(t=[],n=c(Object.values(e)),e=n.next();!e.done;e=n.next())e=e.value,"org.w3.clearkey"!=e&&t.push(sn(e,o,r));if(s=Array.from(s)[0]||null)for(o=c(t),n=o.next();!n.done;n=o.next())for(n=c(n.value.initData),e=n.next();!e.done;e=n.next())e.value.keyId=s;return{Mh:s,um:r,drmInfos:t,Yf:u,Rh:true}}function bg(t,n,e,i){var r=gg(t,e,i);if(n.Rh){t=1==n.drmInfos.length&&!n.drmInfos[0].keySystem;e=0==r.drmInfos.length;if(0==n.drmInfos.length||t&&!e)n.drmInfos=r.drmInfos;n.Rh=false}else if(0<r.drmInfos.length&&(n.drmInfos=n.drmInfos.filter((function(t){return r.drmInfos.some((function(n){return n.keySystem==t.keySystem}))})),0==n.drmInfos.length))throw new zt(2,4,4008);return r.Mh||n.Mh}function yg(t){var n=se(t.node,"https://dashif.org/CPS","Laurl");if(n&&(n=ie(n)))return n;if((n=se(t.node,"urn:microsoft:playready","pro"))&&ie(n))return mg(n);if(t=se(t.node,"urn:mpeg:cenc:2013","pssh"))if(t=ie(t)){n=nn(t);t=8;n=Ft(n);var e=n.getUint8(t);t+=20;0<e&&(t+=4+16*n.getUint32(t));t=Bt(n,t+4);t=Zt(t);t=Qn("<pro>"+t+"</pro>");return mg(t)}return""}function kg(t,n,e,i,r){var a=[];e=c(e);for(var u=e.next();!u.done;u=e.next()){u=u.value;var s=i[u.xd];if(s){var o;if((o=se(u.node,"urn:microsoft:playready","pro"))&&ie(o)){o=ie(o);o=nn(o);var f=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);o=[{initData:Ba(o,f,new Set,0),initDataType:"cenc",keyId:u.keyId}]}else o=null;f=null;if("urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e"===u.xd){f=u;var l=r;if(0==l.size)f=null;else{var h=new Uint8Array([16,119,239,236,192,178,77,2,172,227,60,30,82,226,251,75]),d=new Uint8Array([]);f=[{initData:Ba(d,h,l,1),initDataType:"cenc",keyId:f.keyId}]}}o=sn(s,n,u.init||t||o||f);if(s=Ag.get(s))o.licenseServerUri=s(u);a.push(o)}}return a}function Tg(t){var n=[];t=c(t);for(var e=t.next();!e.done;e=t.next())(e=Eg(e.value))&&n.push(e);return n}function Eg(t){var n=t.attributes.schemeIdUri,e=fe(t,"urn:mpeg:cenc:2013","default_KID"),i=ce(t,"urn:mpeg:cenc:2013","pssh").map(re),r=t.attributes.value;if(!n)return null;n=n.toLowerCase();if(e&&(e=e.replace(/-/g,"").toLowerCase(),e.includes(" ")))throw new zt(2,4,4009);var a=[];try{a=i.map((function(t){return{initDataType:"cenc",initData:nn(t),keyId:null}}))}catch(t){throw new zt(2,4,4007)}return{node:t,xd:n,keyId:e,init:0<a.length?a:null,encryptionScheme:r}}function Sg(n){if(!t.crypto||!t.crypto.subtle)throw Y("Web Crypto API is not available to decrypt AES-128. (Web Crypto only exists in secure origins like https)"),new zt(2,4,4042);var e=se(n.node,"urn:mpeg:dash:schema:sea:2012","SegmentEncryption");if(!e)throw new zt(2,4,4051);if("urn:mpeg:dash:sea:aes128-cbc:2013"!=e.attributes.schemeIdUri)throw new zt(2,4,4051);e=se(n.node,"urn:mpeg:dash:schema:sea:2012","CryptoPeriod");if(!e)throw new zt(2,4,4051);n=e.attributes.IV;e=Yt(e.attributes.keyUriTemplate);if(!n||!e)throw new zt(2,4,4051);n=en(n.substr(2));if(16!=n.byteLength)throw new zt(2,4,4048);return{jk:e,iv:n}}var Ag=(new Map).set("com.apple.fps",(function(n){if("apple"===t.shakaMediaKeysPolyfill)throw new zt(2,4,4054);if(n=se(n.node,"https://dashif.org/CPS","Laurl"))if(n=ie(n))return n;return""})).set("com.widevine.alpha",(function(t){var n=se(t.node,"https://dashif.org/CPS","Laurl");return n&&(n=ie(n))?n:(t=se(t.node,"urn:microsoft","laurl"))?Yt(t.attributes.licenseUrl)||"":""})).set("com.microsoft.playready",yg).set("com.microsoft.playready.recommendation",yg).set("com.microsoft.playready.software",yg).set("com.microsoft.playready.hardware",yg).set("org.w3.clearkey",(function(t){var n=se(t.node,"https://dashif.org/CPS","Laurl");return n&&(n=ie(n))?n:(t=se(t.node,"http://dashif.org/guidelines/clearKey","Laurl"))&&"EME-1.0"===t.attributes.Lic_type&&t&&(t=ie(t))?t:""}));function Ig(n,e,i,r,a,u){var s=(new Map).set("RepresentationID",e).set("Number",i).set("SubNumber",r).set("Bandwidth",a).set("Time",u);return n.replace(/\$(RepresentationID|Number|SubNumber|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g,(function(n,e,i,r){if("$$"==n)return"$";var a=s.get(e);if(null==a)return n;"RepresentationID"==e&&i&&(i=void 0);"Time"==e&&"bigint"!=typeof a&&(.2<=Math.abs(a-Math.round(a))&&Y("Calculated $Time$ values must be close to integers"),a=Math.round(a));switch(r){case void 0:case"d":case"i":case"u":n=a.toString();break;case"o":n=a.toString(8);break;case"x":n=a.toString(16);break;case"X":n=a.toString(16).toUpperCase();break;default:n=a.toString()}i=t.parseInt(i,10)||1;return Array(Math.max(0,i-n.length)+1).join("0")+n}))}function Mg(t,n){var e=Ng(t,n,"timescale"),i=1;e&&(i=me(e)||1);e=Ng(t,n,"duration");var r=(e=me(e||""))?e/i:null,a=Ng(t,n,"startNumber"),u=Number(Ng(t,n,"presentationTimeOffset"))||0,s=we(a||"");if(null==a||null==s)s=1;a=null;if(n=Cg(t,n,"SegmentTimeline")){n=ee(n,"S");a=i;t=t.na.duration||Infinity;for(var o=s,f=[],c=-u,l=0;l<n.length;++l){var h=n[l],d=n[l+1],v=oe(h,"t",we),p=oe(h,"d",we),m=oe(h,"r",pe);h=oe(h,"k",pe)||0;null!=v&&(v-=u);if(p){v=null!=v?v:c;m=m||0;if(0>m)if(d){d=oe(d,"t",we);if(null==d)break;else if(v>=d)break;m=Math.ceil((d-v)/p)-1}else{if(Infinity==t)break;else if(v/a>=t)break;m=Math.ceil((t*a-v)/p)-1}0<f.length&&v!=c&&(f[f.length-1].end=v/a);for(d=0;d<=m;++d)c=v+p,f.push({start:v/a,end:c/a,yh:v,rc:h,Mk:f.length+o}),v=c}}a=f}return{timescale:i,Gf:e,gb:r,fe:s,$b:u/i||0,xh:u,timeline:a}}function xg(t,n){return[n(t.J),n(t.ma),n(t.ra)].filter(_i)}function Ng(t,n,e){n=xg(t,n);t=null;n=c(n);for(var i=n.next();!i.done&&!(t=i.value.attributes[e]);i=n.next());return t}function Cg(t,n,e){n=xg(t,n);t=null;n=c(n);for(var i=n.next();!i.done&&!(t=ue(i.value,e));i=n.next());return t}function Pg(t,n,e,i,r,a){for(var u=fe(t,"http://www.w3.org/1999/xlink","href"),s=fe(t,"http://www.w3.org/1999/xlink","actuate")||"onRequest",o=c(Object.keys(t.attributes)),f=o.next();!f.done;f=o.next()){f=f.value;var l=f.split(":"),h=Jn("http://www.w3.org/1999/xlink");l[0]==h&&delete t.attributes[f]}if(5<=a)return Gr(new zt(2,4,4028));if("onLoad"!=s)return Gr(new zt(2,4,4027));var d=un([i],[u]);return r.request(0,sa(d,n)).Ua((function(i){i=Yn(i.data,t.tagName);if(!i)return Gr(new zt(2,4,4001,u));for(t.children=[];i.children.length;){var s=i.children.shift();t.children.push(s)}s=c(Object.keys(i.attributes));for(var o=s.next();!o.done;o=s.next())o=o.value,t.attributes[o]=i.attributes[o];return Rg(t,n,e,d[0],r,a+1)}))}function Rg(t,n,e,i,r,a){a=void 0===a?0:a;if(fe(t,"http://www.w3.org/1999/xlink","href")){var u=Pg(t,n,e,i,r,a);e&&(u=u.Ua(void 0,(function(){return Rg(t,n,e,i,r,a)})));return u}u=[];for(var s=c(ne(t)),o=s.next(),f={};!o.done;f={Gd:void 0},o=s.next())f.Gd=o.value,"urn:mpeg:dash:resolve-to-zero:2013"==fe(f.Gd,"http://www.w3.org/1999/xlink","href")?t.children=t.children.filter(function(t){return function(n){return n!==t.Gd}}(f)):"SegmentTimeline"!=f.Gd.tagName&&u.push(Rg(f.Gd,n,e,i,r,a));return Yr(u).Ua((function(){return t}))}function Dg(t,n,e,i,r,a,u){var s,o=(new Ia).R("sidx",(function(t){s=Lg(n,i,r,a,u,e,t)}));t&&o.parse(t);if(s)return s;throw new zt(2,3,3004)}function Lg(t,n,e,i,r,a,u){var s=[];u.reader.skip(4);var o=u.reader.T();if(0==o)throw new zt(2,3,3005);if(0==u.version){var f=u.reader.T();var c=u.reader.T()}else f=u.reader.vd(),c=u.reader.vd();u.reader.skip(2);var l=u.reader.Aa();t=t+u.size+c;for(c=0;c<l;c++){var h=u.reader.T(),d=(h&2147483648)>>>31;h&=2147483647;var v=u.reader.T();u.reader.skip(4);if(1==d)throw new zt(2,3,3006);s.push(new Ls(f/o+e,(f+v)/o+e,(function(){return a}),t,t+h-1,n,e,i,r));f+=v;t+=h}u.parser.stop();return s}function Og(t){this.h=Ft(t);this.g=new Ea(this.h,0)}Og.prototype.Fa=function(){return this.g.Fa()};function _g(t){var n=Ug(t);if(7<n.length)throw new zt(2,3,3002);var e=0;n=c(n);for(var i=n.next();!i.done;i=n.next())e=256*e+i.value;n=Ug(t);t:{i=c(Bg);for(var r=i.next();!r.done;r=i.next())if(_t(n,new Uint8Array(r.value))){i=true;break t}i=false}if(i)n=t.h.byteLength-t.g.Ma();else{if(8==n.length&&n[1]&224)throw new zt(2,3,3001);for(r=i=0;r<n.length;r++){var a=n[r];i=0==r?a&(1<<8-n.length)-1:256*i+a}n=i}n=t.g.Ma()+n<=t.h.byteLength?n:t.h.byteLength-t.g.Ma();i=Ft(t.h,t.g.Ma(),n);t.g.skip(n);return new Hg(e,i)}function Ug(t){var n=t.g.Ma(),e=t.g.X();if(0==e)throw new zt(2,3,3002);e=8-Math.floor(Math.log2(e));t.g.skip(e-1);return Bt(t.h,n,e)}var Bg=[[255],[127,255],[63,255,255],[31,255,255,255],[15,255,255,255,255],[7,255,255,255,255,255],[3,255,255,255,255,255,255],[1,255,255,255,255,255,255,255]];function Hg(t,n){this.id=t;this.g=n}function Fg(t){if(8<t.g.byteLength)throw new zt(2,3,3002);if(8==t.g.byteLength&&t.g.getUint8(0)&224)throw new zt(2,3,3001);for(var n=0,e=0;e<t.g.byteLength;e++){var i=t.g.getUint8(e);n=256*n+i}return n}function Vg(t,n,e,i,r,a,u,s,o){function f(){return r}var c=[];t=new Og(t.g);for(var l=null,h=null;t.Fa();){var d=_g(t);if(187==d.id){var v=zg(d);v&&(d=e*v.$k,v=n+v.Ek,null!=l&&c.push(new Ls(l+u,d+u,f,h,v-1,a,u,s,o)),l=d,h=v)}}null!=l&&c.push(new Ls(l+u,i+u,f,h,null,a,u,s,o));return c}function zg(t){var n=new Og(t.g);t=_g(n);if(179!=t.id)throw new zt(2,3,3013);t=Fg(t);n=_g(n);if(183!=n.id)throw new zt(2,3,3012);n=new Og(n.g);for(var e=0;n.Fa();){var i=_g(n);if(241==i.id){e=Fg(i);break}}return{$k:t,Ek:e}}function Xg(t,n,e){n=Cg(t,n,"Initialization");if(!n)return null;var i=t.J.cb(),r=n.attributes.sourceURL;r&&(i=un(i,[Yt(r)],t.Jb()));r=0;var a=null;if(n=oe(n,"range",ve))r=n.start,a=n.end;e=new Rs((function(){return i}),r,a,Yg(t),null,null,e,t.ma.encrypted);e.codecs=t.J.codecs;e.mimeType=t.J.mimeType;t.na&&(e.g=t.na.start+t.na.duration);return e}function qg(t,n,e){var i=Number(Ng(t,Gg,"presentationTimeOffset"))||0,r=Ng(t,Gg,"timescale"),a=1;r&&(a=me(r)||1);var u=i/a||0,s=Xg(t,Gg,e);Wg(t,s);var o=Wn(t);return{endTime:-1,timeline:-1,Nc:function(){var t=Cg(o,Gg,"RepresentationIndex");var e=o.J.cb();t&&(t=Yt(t.attributes.sourceURL))&&(e=un(e,[t],o.Jb()));t=Kg(o);return jg(o,n,s,e,t.start,t.end,u)},timescale:a}}function jg(t,n,e,i,r,a,u){var s,o,f,l,h,d,v,p,m,w,g,b,y,k,E,S,A,I;return _((function(M){if(1==M.g)return s=t.presentationTimeline,o=!t.ic||!t.na.ci,f=t.na.start,l=t.na.duration,h=t.J.mimeType.split("/")[1],d=n,v=null,p=[d(i,r,a,false),"webm"==h?d(e.O(),e.startByte,e.endByte,true):null],d=null,T(M,Promise.all(p),2);m=M.h;w=m[0];g=m[1]||null;b=null;y=f-u;k=f;E=l?f+l:Infinity;if("mp4"==h)var x=Dg(w,r,i,e,y,k,E);else{x=w;var N=new Og(g);if(440786851!=_g(N).id)throw new zt(2,3,3008);var C=_g(N);if(408125543!=C.id)throw new zt(2,3,3009);N=C.g.byteOffset;C=new Og(C.g);for(var P=null;C.Fa();){var R=_g(C);if(357149030==R.id){P=R;break}}if(!P)throw new zt(2,3,3010);P=new Og(P.g);R=1e6;for(C=null;P.Fa();){var D=_g(P);if(2807729==D.id)R=Fg(D);else if(17545==D.id)if(4==D.g.byteLength)C=D.g.getFloat32(0);else if(8==D.g.byteLength)C=D.g.getFloat64(0);else throw new zt(2,3,3003)}if(null==C)throw new zt(2,3,3011);P=R/1e9;C*=P;x=_g(new Og(x));if(475249515!=x.id)throw new zt(2,3,3007);x=Vg(x,N,P,C,i,e,y,k,E)}b=x;S=c(b);for(A=S.next();!A.done;A=S.next())I=A.value,I.codecs=t.J.codecs,I.mimeType=t.J.mimeType,I.bandwidth=t.bandwidth;s.Yd(b);v=new jf(b);o&&v.hd(k,E,true);return M.return(v)}))}function Gg(t){return t.yd}function Kg(t){var n=Cg(t,Gg,"RepresentationIndex");t=Ng(t,Gg,"indexRange");t=ve(t||"");n&&(t=oe(n,"range",ve,t));return t}function Wg(t,n){$g(t,n);if(!Kg(t))throw new zt(2,4,4002)}function $g(t,n){var e=t.J.mimeType.split("/")[1];if(t.J.contentType!=hn&&"mp4"!=e&&"webm"!=e)throw new zt(2,4,4006);if("webm"==e&&!n)throw new zt(2,4,4005)}function Yg(t){var n=t.J;return{bandwidth:t.bandwidth,audioSamplingRate:n.audioSamplingRate,codecs:n.codecs,contentType:n.contentType,frameRate:n.frameRate||null,height:n.height||null,mimeType:n.mimeType,channelsCount:n.mf,pixelAspectRatio:n.pixelAspectRatio||null,width:n.width||null,label:t.ma.label||null,roles:t.roles||null,language:t.ma.language||null}}function Qg(t,n,e){var i=Xg(t,Jg,e),r=Zg(t);if(!r.gb&&!r.timeline&&1<r.pd.length)throw new zt(2,4,4002);if(!r.gb&&!t.na.duration&&!r.timeline&&1==r.pd.length)throw new zt(2,4,4002);if(r.timeline&&0==r.timeline.length)throw new zt(2,4,4002);var a=null,u=null;t.ra.id&&t.J.id&&(u=n.get(t.ra.id+","+t.J.id))&&(a=u.segmentIndex);var s=tb(t.na.start,t.na.duration,t.J.cb,r,i,e,t.J.mimeType,t.J.codecs,t.bandwidth,t.Jb);n=!a;a?a.Wd(s,t.presentationTimeline.Fb()):a=new jf(s);t.presentationTimeline.Yd(s);t.ic&&t.na.ci||a.hd(t.na.start,t.na.duration?t.na.start+t.na.duration:Infinity,n);u&&(u.segmentIndex=a);return{endTime:-1,timeline:-1,Nc:function(){a&&0!=a.getNumReferences()||a.gf(s);return Promise.resolve(a)},timescale:r.timescale}}function Jg(t){return t.tc}function Zg(t){var n=nb(t);t=Mg(t,Jg);var e=t.fe;0==e&&(e=1);var i=0;t.gb?i=t.gb*(e-1):t.timeline&&0<t.timeline.length&&(i=t.timeline[0].start);return{gb:t.gb,startTime:i,fe:e,$b:t.$b,timescale:t.timescale,timeline:t.timeline,pd:n}}function tb(t,n,e,i,r,a,u,s,o,f){var c=i.pd.length;i.timeline&&i.timeline.length!=i.pd.length&&(c=Math.min(i.timeline.length,i.pd.length));for(var l=t-i.$b,h=n?t+n:Infinity,d=[],v=i.startTime,p={},m=0;m<c;p={If:void 0,zf:void 0},m++){p.zf=i.pd[m];var w=v;v=void 0;v=null!=i.gb?w+i.gb:i.timeline?i.timeline[m].end:w+n;p.If=null;p=new Ls(t+w,t+v,function(t){return function(){null==t.If&&(t.If=un(e(),[t.zf.rk],f()));return t.If}}(p),p.zf.start,p.zf.end,r,l,t,h,[],"",null,null,_s,a);p.codecs=s;p.mimeType=u;p.bandwidth=o;d.push(p)}return d}function nb(t){return[t.J.tc,t.ma.tc,t.ra.tc].filter(_i).map((function(t){return ee(t,"SegmentURL")})).reduce((function(t,n){return 0<t.length?t:n})).map((function(n){n.attributes.indexRange&&!t.Fg&&(t.Fg=true);var e=Yt(n.attributes.media);n=oe(n,"mediaRange",ve,{start:0,end:null});return{rk:e,start:n.start,end:n.end}}))}function eb(t,n,e,i,r,a,u,s,o,f){o||t.J.Xe||(t.J.Xe=Ng(t,ib,"initialization"));var l=t.J.Xe?sb(t,u):null,h=rb(t);ab(h);var d=Wn(t);if(h.Td)return $g(t,l),{endTime:-1,timeline:-1,Nc:function(){var t=Ig(h.Td,d.J.originalId,null,null,d.bandwidth||null,null);t=un(d.J.cb(),[t]);return jg(d,n,l,t,0,null,h.$b)},timescale:h.timescale};if(h.gb)return i||"image"===t.ma.contentType||"text"===t.ma.contentType||(i=t.na.start,f=t.ra.id,e=t.na.duration,f=(f=null!=f&&a.get(f)||e)?i+f:Infinity,t.presentationTimeline.Ng(h.gb),t.presentationTimeline.pi(i,f)),{endTime:-1,timeline:-1,Nc:function(){return ub(d,h,r,l,a,u,s,t.J.Af)},timescale:h.timescale};var v=null;i=i=null;t.ra.id&&t.J.id&&(i=t.ra.id+","+t.J.id,i=e.get(i))&&(v=i.segmentIndex);var p=t.na.start,m=t.na.duration?p+t.na.duration:Infinity;if(v)f=v,fb(f,h,p,m,l),f.$a(t.presentationTimeline.Fb());else{e=0;o=-1;if(null!=t.ra.id&&null!=t.J.id){var w=f.get(t.ra.id);if(w)o=w.timeline;else for(f=c(f.values()),w=f.next();!w.done;w=f.next())if(w=w.value,Math.abs(h.$b-w.endTime)<=vn&&w.Xg.includes(t.J.id)){o=w.timeline;break}else w.timeline>=e&&(e=w.timeline+1)}-1==o&&(o=e);v=new ob(h,t.J.originalId,t.bandwidth,t.J.cb,t.Jb,p,m,l,u,t.J.Af,o)}h.timeline&&"image"!==t.ma.contentType&&"text"!==t.ma.contentType&&t.presentationTimeline.ri(v.h?v.h.timeline:[],p);i&&t.ic&&(i.segmentIndex=v);i=(i=(i=h.timeline)&&i[i.length-1])?i.end+h.$b:-1;f=-1;v instanceof ob&&(f=v.Ne());return{endTime:i,timeline:f,Nc:function(){v instanceof ob&&0==v.getNumReferences()&&fb(v,h,p,m,l);return Promise.resolve(v)},timescale:h.timescale}}function ib(t){return t.Fc}function rb(t){var n=Mg(t,ib),e=Ng(t,ib,"media"),i=Ng(t,ib,"index"),r=Ng(t,ib,"k"),a=0;r&&(a=parseInt(r,10));return{Gf:n.Gf,gb:n.gb,timescale:n.timescale,fe:n.fe,$b:n.$b,xh:n.xh,timeline:n.timeline,Zb:e&&Yt(e),Td:i,mimeType:t.J.mimeType,codecs:t.J.codecs,bandwidth:t.bandwidth,tk:a}}function ab(t){var n=t.Td?1:0;n+=t.timeline?1:0;n+=t.gb?1:0;if(0==n)throw new zt(2,4,4002);1!=n&&(t.Td&&(t.timeline=null),t.Gf=null,t.gb=null);if(!t.Td&&!t.Zb)throw new zt(2,4,4002)}function ub(n,e,i,r,a,u,s,o){function f(i){var a=i-g,s=a*w,f=e.Gf,c=a*f;"BigInt"in t&&c>Number.MAX_SAFE_INTEGER&&(c=BigInt(a)*BigInt(f));s+=v;a=s+w;f=Math.min(a,h());var l=[],d=e.tk;if(d)for(var p=(f-s)/d,m={},A=0;A<d;m={Qi:void 0},A++){var I=s+p*A,M=I+p;m.Qi=A+1;m=new Ls(I,M,function(t){return function(){var n=Ig(b,k,i,t.Qi,y,c);return un(T(),[n],E())}}(m),0,null,r,S,v,h(),[],"",null,null,_s,u);m.codecs=n.J.codecs;m.mimeType=n.J.mimeType;0==o?0<A&&m.nd():0!=A%o&&m.nd();l.push(m)}s=new Ls(s,f,(function(){if(d)return[];var t=Ig(b,k,i,null,y,c);return un(T(),[t],E())}),0,null,r,S,v,h(),l,"",null,null,_s,u,0<l.length);s.codecs=n.J.codecs;s.mimeType=n.J.mimeType;s.bandwidth=n.bandwidth;s.j=a;return s}function l(){var t=[Math.max(d.Fb(),v),Math.min(d.zc(),h())].map((function(t){return t-v}));t=[Math.ceil(t[0]/w),Math.ceil(t[1]/w)-1];n.J.pb&&t[1]++;return t.map((function(t){return t+g}))}function h(){var t=null!=p&&a.get(p)||m;return t?v+t:Infinity}var d=n.presentationTimeline,v=n.na.start,p=n.ra.id,m=n.na.duration,w=e.gb,g=e.fe,b=e.Zb,y=n.bandwidth||null,k=n.J.originalId,T=n.J.cb,E=n.Jb,S=v-e.$b,A=l();i=n.ic?Math.max(A[0],A[1]-i+1):A[0];s=s||A[1];A=[];for(var I=i;I<=s;++I){var M=f(I);A.push(M)}var x=new jf(A);A=d.zc()<h();I=d.V();if(A||I){var N=Math.max(i,s+1);i=w;n.J.pb&&(i=.1);x.Hf(i,(function(){var t=d.Fb();x.$a(t);var n=c(l());n.next();n=n.next().value;for(var e=[];N<=n;){var i=f(N);e.push(i);N++}return t>h()&&!e.length?null:e}))}return Promise.resolve(x)}function sb(t,n){var e=t.J.Xe;e||(e=Ng(t,ib,"initialization"));if(!e)return null;e=Yt(e);var i=t.J.originalId,r=t.bandwidth||null,a=t.J.cb,u=t.Jb;n=new Rs((function(){var t=Ig(e,i,null,null,r,null);return un(a(),[t],u())}),0,null,Yg(t),null,null,n,t.ma.encrypted);n.codecs=t.J.codecs;n.mimeType=t.J.mimeType;t.na&&(n.g=t.na.start+t.na.duration);return n}function ob(t,n,e,i,r,a,u,s,o,f,c){jf.call(this,[]);this.h=t;this.F=n;this.B=e;this.C=i;this.H=r;this.j=a;this.l=u;this.s=s;this.A=o;this.G=f;this.I=c;lb(this)}g(ob,jf);i=ob.prototype;i.getNumReferences=function(){return this.h?this.h.timeline.length:0};i.release=function(){jf.prototype.release.call(this);this.h=null};i.$a=function(t){if(this.h){for(var n=0,e=this.h.timeline,i=0;i<e.length;i+=1)if(e[i].end+this.j<=t)n+=1;else break;0<n&&(this.h.timeline=e.slice(n),this.g.length>=n&&(this.g=this.g.slice(n)),this.i+=n,0===this.getNumReferences()&&this.release())}};function fb(t,n,e,i,r){cb(t,r);if(t.h){e=t.h.timeline;t.h.Zb!==n.Zb&&(t.h.Zb=n.Zb);if(e.length){var a=e[e.length-1];n=n.timeline.filter((function(t){return t.end>a.end}))}else n=n.timeline.slice();0<n.length&&t.h.timeline.push.apply(t.h.timeline,l(n));t.l!==i&&(t.l=i)}else t.h=n,t.j=e,t.l=i;lb(t)}function cb(t,n){if(t.s!==n){t.s=n;t=c(t.g);for(var e=t.next();!e.done;e=t.next())(e=e.value)&&Os(e,n)}}function lb(t){if(t.h&&!t.o){for(var n=[],e=c(t.h.timeline),i=e.next();!i.done;i=e.next())i=i.value,i.start>=t.l||0>=i.end||n.push(i);t.h.timeline=n;t.$a(t.j)}}i.find=function(t){if(this.h&&this.h.timeline&&this.h.timeline.length&&t<this.h.timeline[0].start+this.j)return this.i;if(!this.h)return null;var n=this.h.timeline;if(t<this.j||t>=this.l)return null;for(var e=n.length-1,i=0;i<n.length;i++){var r=n[i],a=r.start+this.j;r=i<e?n[i+1].start+this.j:Infinity===this.l?r.end+this.j:this.l;if(t>=a&&t<r)return i+this.i}return null};i.get=function(t){var n=this;t-=this.i;if(0>t||t>=this.getNumReferences()||!this.h)return null;var e=this.g[t];if(!e){e=this.h.timeline[t];var i=e.Mk,r=e.yh+this.h.xh,a=this.j-this.h.$b,u=this.j+e.end,s=u;t===this.getNumReferences()-1&&Infinity!==this.l&&(s=.1<Math.abs(s-this.l)?Math.min(s,this.l):this.l);var o=this.h.codecs,f=this.h.mimeType,c=this.h.bandwidth,l=[],h=false;e.rc&&this.h&&this.h.Zb&&(h=this.h.Zb.includes("$SubNumber$"));if(h){h=(e.end-e.start)/e.rc;for(var d={},v=0;v<e.rc;d={Jf:void 0,Ri:void 0},v++){var p=e.start+h*v,m=p+h;d.Ri=v+1;d.Jf=null;d=new Ls(this.j+p,this.j+m,function(t){return function(){if(!n.h)return[];null==t.Jf&&(t.Jf=hb(n.h.Zb,n.F,i,n.B,r,t.Ri,n.C,n.H));return t.Jf}}(d),0,null,this.s,a,this.j,this.l,[],"",null,null,_s,this.A);d.codecs=o;d.mimeType=f;d.bandwidth=c;0==this.G?0<v&&d.nd():0!=v%this.G&&d.nd();l.push(d)}}e=new Ls(this.j+e.start,s,(function(){return 0<l.length||!n.h?[]:hb(n.h.Zb,n.F,i,n.B,r,null,n.C,n.H)}),0,null,this.s,a,this.j,this.l,l,"",null,null,_s,this.A,0<l.length);e.codecs=o;e.mimeType=f;e.j=u;e.bandwidth=c;this.g[t]=e}return e};i.Db=function(t){lb(this);for(var n=0;n<this.getNumReferences();n++){var e=this.get(n+this.i);e&&t(e)}};function hb(t,n,e,i,r,a,u,s){t=Ig(t,n,e,a,i||null,r);return un(u(),[t],s()).map((function(t){return t.toString()}))}i.Ne=function(){return this.I};function db(t){this.o=null;this.A=t;this.G=new ea;this.i=[];this.h=null;this.m=[];this.B=null;this.F=[];this.C=300;this.l=new Map;this.j=new Map;this.g=null;this.s="UNKNOWN"}db.prototype.configure=function(t){this.o=t};db.prototype.destroy=function(){this.A=this.o=null;this.i=[];this.h=null;this.m=[];this.F=[];this.l.clear();null!=this.g&&(this.g.stop(),this.g=null);return this.G.destroy()};db.prototype.setManifestType=function(t){this.s=t};function vb(t,n){var e,i,r,a,u,s,o;return _((function(f){if(1==f.g)return e=un(t.i,[pb(t,n)]),i=sa(e,t.o.retryParameters),r=t.A.networkingEngine.request(8,i),ia(t.G,r),S(f,2),T(f,r.promise,4);if(2!=f.g)return a=f.h,u=qt(a.data),s=JSON.parse(u),1==s.VERSION&&mb(t,s,a.uri),I(f,0);if((o=M(f))&&7001==o.code)return f.return();null!=t.g&&(t.g.stop(),t.g=null);t.g=new Di((function(){vb(t,n)}));t.g.ha(t.C);E(f)}))}function pb(t,n){if(!t.m.length)return n;n=new bt(n);var e=t.B||t.m[0],i=Math.round(t.A.getBandwidthEstimate()),r=n.g;"DASH"==t.s?(r.add("_DASH_pathway",e),r.add("_DASH_throughput",String(i))):"HLS"==t.s&&(r.add("_HLS_pathway",e),r.add("_HLS_throughput",String(i)));Lt(r)&&Et(n,r);return n.toString()}function mb(t,n,e){null!=t.g&&(t.g.stop(),t.g=null);var i=n["RELOAD-URI"]||e;t.g=new Di((function(){vb(t,i)}));if(e=n.TTL)t.C=e;t.g.ha(t.C);t.m=n["PATHWAY-PRIORITY"]||[];t.F=n["PATHWAY-CLONES"]||[]}function wb(t,n,e,i){var r=t.l.get(n);r||(r=new Map);r.set(e,i);t.l.set(n,r)}db.prototype.banLocation=function(t){this.j.set(t,Date.now()+6e4)};function gb(t,n,e){e=void 0===e?false:e;n=t.l.get(n)||new Map;for(var i=[],r=c(t.m),a=r.next(),u={};!a.done;u={rd:void 0},a=r.next())if(u.rd=a.value,a=n.get(u.rd))i.push({Sg:u.rd,location:a});else if(a=t.F.find(function(t){return function(n){return n.Gl==t.rd}}(u))){var s=n.get(a["BASE-ID"]);s&&(a["URI-REPLACEMENT"].aj?(s=new bt(s),kt(s,a["URI-REPLACEMENT"].aj),i.push({Sg:u.rd,location:s.toString()})):i.push({Sg:u.rd,location:s}))}r=Date.now();u=c(t.j.keys());for(a=u.next();!a.done;a=u.next())a=a.value,s=t.j.get(a),r>s&&t.j.delete(a);i=i.filter((function(n){for(var e=c(t.j.keys()),i=e.next();!i.done;i=e.next())if(i.value.includes(new bt(n.location).Cb))return false;return true}));i.length&&(t.B=i[0].Sg);i=i.map((function(t){return t.location}));if(!i.length&&t.h)for(r=c(t.h.split(",")),u=r.next();!u.done;u=r.next())if(u=n.get(u.value))t.B=t.h,i.push(u);if(!i.length)for(n=c(n.values()),r=n.next();!r.done;r=n.next())i.push(r.value);return e?i:un(t.i,i)}function bb(){this.l=[];this.h=[];this.g=[];this.j=[];this.i=[];this.s=this.o=false;this.m=new Set}i=bb.prototype;i.release=function(){for(var t=c(this.h.concat(this.g,this.j,this.i)),n=t.next();!n.done;n=t.next())n=n.value,n.segmentIndex&&n.segmentIndex.release();this.h=[];this.g=[];this.j=[];this.i=[];this.l=[];this.s=this.o=false;this.m.clear()};i.Vj=function(){return this.l};i.Dg=function(){return this.j.slice()};i.Aj=function(){return this.i};i.Nh=function(t,n){if(t){if("audio"==t.type)for(var e=c(this.h),i=e.next();!i.done;i=e.next())i=i.value,i.matchedStreams=i.matchedStreams.filter((function(n){return n!==t}));else if("video"==t.type)for(e=c(this.g),i=e.next();!i.done;i=e.next())i=i.value,i.matchedStreams=i.matchedStreams.filter((function(n){return n!==t})),i.trickModeVideo&&(i.trickModeVideo.matchedStreams=i.trickModeVideo.matchedStreams.filter((function(n){return n!==t}))),i.dependencyStream&&(i.dependencyStream.matchedStreams=i.dependencyStream.matchedStreams.filter((function(n){return n!==t})));else if(t.type==hn)for(e=c(this.j),i=e.next();!i.done;i=e.next())i=i.value,i.matchedStreams=i.matchedStreams.filter((function(n){return n!==t}));else if("image"==t.type)for(e=c(this.i),i=e.next();!i.done;i=e.next())i=i.value,i.matchedStreams=i.matchedStreams.filter((function(n){return n!==t}));t.segmentIndex&&t.closeSegmentIndex();this.m.delete(n)}};function yb(t,n){var e=[],i=[],r=[],a=[];t=c(t);for(var u=t.next();!u.done;u=t.next()){var s=u.value;u=new Map(s.audioStreams.map((function(t){return[Kb(t),t]})));var o=new Map(s.videoStreams.map((function(t){return[Gb(t),t]}))),f=new Map(s.textStreams.map((function(t){return[Wb(t),t]})));s=new Map(s.imageStreams.map((function(t){return[$b(t),t]})));if(n){var l=zb(hn);f.set(Wb(l),l);l=zb("image");s.set($b(l),l)}e.push(u);i.push(o);r.push(f);a.push(s)}return{Gh:e,Zi:i,Wi:r,$h:a}}i.cg=function(t,n,e){e=void 0===e?false:e;var i=this,r,a,u,s,o,f,l,h,d,v,p,m,w,g,b,y,k,S,A,I,M,x,N,C,P,R,D,L,O,U,B,H;return _((function(_){if(1==_.g){r=dn;if(!n&&1==t.length)return a=yb(t,false),u=a.Gh,s=a.Zi,o=a.Wi,f=a.$h,i.h=Array.from(u[0].values()),i.g=Array.from(s[0].values()),i.j=Array.from(o[0].values()),i.i=Array.from(f[0].values()),_.u(2);l=e?i.m.size:0;h=-1;for(d=0;d<t.length;d++)v=t[d],i.m.has(v.id)||(i.m.add(v.id),-1==h&&(h=d));if(-1==h)return _.return();p=yb(t,true);m=p.Gh;w=p.Zi;g=p.Wi;b=p.$h;return T(_,Promise.all([Tb(i,i.h,m,h,Mb,Nb,l),Tb(i,i.g,w,h,Mb,Nb,l),Tb(i,i.j,g,h,Mb,Nb,l),Tb(i,i.i,b,h,Mb,Nb,l)]),2)}y=0;k=[];if(i.g.length&&i.h.length)for(C=c(i.h),P=C.next();!P.done;P=C.next())for(R=P.value,D=c(i.g),L=D.next();!L.done;L=D.next())O=L.value,U=Or(R.drmInfos,O.drmInfos),R.drmInfos.length&&O.drmInfos.length&&!U.length||(B=(R.bandwidth||0)+(O.bandwidth||0),R.dependencyStream&&(B+=R.dependencyStream.bandwidth||0),O.dependencyStream&&(B+=O.dependencyStream.bandwidth||0),H=y++,k.push({id:H,language:R.language,disabledUntilTime:0,primary:R.primary,audio:R,video:O,bandwidth:B,drmInfos:U,allowedByApplication:true,allowedByKeySystem:true,decodingInfos:[]}));else for(S=i.g.length?i.g:i.h,A=c(S),I=A.next();!I.done;I=A.next())M=I.value,x=y++,N=M.bandwidth||0,M.dependencyStream&&(N+=M.dependencyStream.bandwidth||0),k.push({id:x,language:M.language,disabledUntilTime:0,primary:M.primary,audio:M.type==r.ea?M:null,video:M.type==r.xa?M:null,bandwidth:N,drmInfos:M.drmInfos,allowedByApplication:true,allowedByKeySystem:true,decodingInfos:[]});i.l=k;E(_)}))};function kb(t){var n,e,i,r,a,u,s,o,f,l,h,d,v,p,m,w,g,b,y,k,E,S,A,I,M,x,N,C,P,R;return _((function(D){switch(D.g){case 1:n=dn;if(1==t.length)return D.return(t[0]);e=t.map((function(t){return new Map(t.filter((function(t){return t.type===n.ea})).map((function(t){return[Kb(t),t]})))}));i=t.map((function(t){return new Map(t.filter((function(t){return t.type===n.xa})).map((function(t){return[Gb(t),t]})))}));r=t.map((function(t){return new Map(t.filter((function(t){return t.type===n.Ya})).map((function(t){return[Wb(t),t]})))}));a=t.map((function(t){return new Map(t.filter((function(t){return t.type===n.Pf})).map((function(t){return[$b(t),t]})))}));u=c(r);for(s=u.next();!s.done;s=u.next())o=s.value,f=Vb(n.Ya),o.set(Wb(f),f);l=c(a);for(h=l.next();!h.done;h=l.next())d=h.value,v=Vb(n.Pf),d.set($b(v),v);p=new bb;return T(D,Tb(p,[],e,0,xb,Cb,0),2);case 2:return m=D.h,T(D,Tb(p,[],i,0,xb,Cb,0),3);case 3:return w=D.h,T(D,Tb(p,[],r,0,xb,Cb,0),4);case 4:return g=D.h,T(D,Tb(p,[],a,0,xb,Cb,0),5);case 5:b=D.h;y=0;if(w.length&&m.length)for(I=c(m),M=I.next();!M.done;M=I.next())for(x=M.value,N=c(w),C=N.next();!C.done;C=N.next())P=C.value,R=y++,P.variantIds.push(R),x.variantIds.push(R);else for(k=w.concat(m),E=c(k),S=E.next();!S.done;S=E.next())A=S.value,A.variantIds=[y++];return D.return(w.concat(m).concat(g).concat(b))}}))}function Tb(t,n,e,i,r,a,u){var s,o,f,l,h,d,v,p,m,w,g,b,y,k,E,S,A,I,M;return _((function(x){switch(x.g){case 1:s=[];for(o=0;o<e.length;o++)o>=i?s.push(new Set(e[o].values())):s.push(new Set);f=c(n);l=f.next();case 2:if(l.done){x.u(4);break}h=l.value;return T(x,Eb(t,h,e,i,a,s,u),5);case 5:d=x.h;if(!d)throw new zt(2,4,4037);l=f.next();x.u(2);break;case 4:v=c(s);for(p=v.next();!p.done;p=v.next())for(m=p.value,w=c(m),g=w.next();!g.done;g=w.next())b=g.value,(y=Ab(t,b,e,r,a,s))&&n.push(y);k=c(s);for(E=k.next();!E.done;E=k.next())for(S=E.value,A=c(S),I=A.next(),M={};!I.done;M={mh:void 0},I=A.next())if(M.mh=I.value,!jb(M.mh)&&n.some(function(n){return function(e){return Lb(t,n.mh,e)}}(M)))throw new zt(2,4,4037);return x.return(n)}}))}function Eb(t,n,e,i,r,a,u){return _((function(s){if(1==s.g)return Pb(t,e,n,0<u),n.matchedStreams?n.segmentIndex?T(s,Sb(n,i+u),2):s.u(2):s.return(false);Ib(n,i,r,a,u);return s.return(true)}))}function Sb(t,n){var e,i,r,a,u,s;return _((function(o){if(1==o.g){e=[];i=t.matchedStreams;for(r=n;r<i.length;r++)a=i[r],e.push(a.createSegmentIndex()),a.trickModeVideo&&!a.trickModeVideo.segmentIndex&&e.push(a.trickModeVideo.createSegmentIndex()),a.dependencyStream&&!a.dependencyStream.segmentIndex&&e.push(a.dependencyStream.createSegmentIndex());return T(o,Promise.all(e),2)}if(t.segmentIndex instanceof $f)for(u=n;u<i.length;u++)s=i[u],s.segmentIndex&&t.segmentIndex.h.push(s.segmentIndex);E(o)}))}function Ab(t,n,e,i,r,a){if(jb(n))return null;var u=i(n);Pb(t,e,u);u.createSegmentIndex&&(u.createSegmentIndex=function(){return _((function(t){if(u.segmentIndex)return t.u(0);u.segmentIndex=new $f;return T(t,Sb(u,0),0)}))});if(!u.matchedStreams||!u.matchedStreams.length)return null;Ib(u,0,r,a,0);return u}function Ib(t,n,e,i,r){var a=t.matchedStreams;for(n+=r;n<a.length;n++){var u=a[n];e(t,u);var s=true;"audio"==t.type&&0==Xi(t.language,u.language)&&(s=false);if(s&&(i[n-r].delete(u),u.fullMimeTypes))for(u=c(u.fullMimeTypes.values()),s=u.next();!s.done;s=u.next())t.fullMimeTypes.add(s.value)}}function Mb(t){var n=Object.assign({},t);n.originalId=null;n.createSegmentIndex=function(){return Promise.resolve()};n.closeSegmentIndex=function(){n.segmentIndex&&(n.segmentIndex.release(),n.segmentIndex=null);if(n.matchedStreams)for(var t=c(n.matchedStreams),e=t.next();!e.done;e=t.next())e=e.value,e.segmentIndex&&(e.segmentIndex.release(),e.segmentIndex=null)};n.roles=n.roles.slice();n.segmentIndex=null;n.emsgSchemeIdUris=[];n.keyIds=new Set(t.keyIds);n.closedCaptions=t.closedCaptions?new Map(t.closedCaptions):null;n.trickModeVideo=null;n.dependencyStream=null;return n}function xb(t){var n=Object.assign({},t);n.roles=n.roles.slice();n.keyIds=new Set(t.keyIds);n.segments=[];n.variantIds=[];n.closedCaptions=t.closedCaptions?new Map(t.closedCaptions):null;return n}function Nb(t,n){function e(t,n){t||(t=[]);n=c(n);for(var e=n.next();!e.done;e=n.next())e=e.value,t.includes(e)||t.push(e);return t}t.roles=e(t.roles,n.roles);n.emsgSchemeIdUris&&(t.emsgSchemeIdUris=e(t.emsgSchemeIdUris,n.emsgSchemeIdUris));for(var i=c(n.keyIds),r=i.next();!r.done;r=i.next())t.keyIds.add(r.value);null==t.originalId?t.originalId=n.originalId:(i=n.originalId||"")&&!t.originalId.endsWith(i)&&(t.originalId+=","+i);i=Or(t.drmInfos,n.drmInfos);if(n.drmInfos.length&&t.drmInfos.length&&!i.length)throw new zt(2,4,4038);t.drmInfos=i;t.encrypted=t.encrypted||n.encrypted;if(n.closedCaptions)for(t.closedCaptions||(t.closedCaptions=new Map),i=c(n.closedCaptions),r=i.next();!r.done;r=i.next()){var a=c(r.value);r=a.next().value;a=a.next().value;t.closedCaptions.set(r,a)}t.bandwidth&&n.bandwidth&&(t.bandwidth=Math.max(t.bandwidth,n.bandwidth));n.trickModeVideo?(t.trickModeVideo||(t.trickModeVideo=Mb(n.trickModeVideo),t.trickModeVideo.matchedStreams=[],t.trickModeVideo.createSegmentIndex=function(){if(t.trickModeVideo.segmentIndex)return Promise.resolve();for(var n=new $f,e=c(t.trickModeVideo.matchedStreams),i=e.next();!i.done;i=e.next())n.h.push(i.value.segmentIndex);t.trickModeVideo.segmentIndex=n;return Promise.resolve()}),t.trickModeVideo.matchedStreams.push(n.trickModeVideo),Nb(t.trickModeVideo,n.trickModeVideo)):t.trickModeVideo&&(t.trickModeVideo.matchedStreams.push(n),Nb(t.trickModeVideo,n));n.dependencyStream?(t.dependencyStream||(t.dependencyStream=Mb(n.dependencyStream),t.dependencyStream.matchedStreams=[],t.dependencyStream.createSegmentIndex=function(){if(t.dependencyStream.segmentIndex)return Promise.resolve();for(var n=new $f,e=c(t.dependencyStream.matchedStreams),i=e.next();!i.done;i=e.next())n.h.push(i.value.segmentIndex);t.dependencyStream.segmentIndex=n;return Promise.resolve()}),t.dependencyStream.matchedStreams.push(n.dependencyStream),Nb(t.dependencyStream,n.dependencyStream)):t.dependencyStream&&(t.dependencyStream.matchedStreams.push(n),Nb(t.dependencyStream,n))}function Cb(t,n){var e=t.roles;e||(e=[]);for(var i=c(n.roles),r=i.next();!r.done;r=i.next())r=r.value,e.includes(r)||e.push(r);t.roles=e;e=c(n.keyIds);for(i=e.next();!i.done;i=e.next())t.keyIds.add(i.value);t.encrypted=t.encrypted&&n.encrypted;t.segments.push.apply(t.segments,l(n.segments));if(n.closedCaptions)for(t.closedCaptions||(t.closedCaptions=new Map),n=c(n.closedCaptions),e=n.next();!e.done;e=n.next())i=c(e.value),e=i.next().value,i=i.next().value,t.closedCaptions.set(e,i)}function Pb(t,n,e,i){i=(void 0===i?0:i)?e.matchedStreams:[];n=c(n);for(var r=n.next();!r.done;r=n.next()){r=Rb(t,r.value,e);if(!r)return;i.push(r)}e.matchedStreams=i}function Rb(t,n,e){var i={audio:Kb,video:Gb,text:Wb,image:$b}[e.type],r=null,a=i(e);if(n.has(a))r=n.get(a);else{a={audio:function(n,e){return Lb(t,n,e)},video:function(n,e){return Lb(t,n,e)},text:Ob,image:_b}[e.type];for(var u={audio:Ub,video:Bb,text:Hb,image:Fb}[e.type],s=c(n.values()),o=s.next();!o.done;o=s.next())o=o.value,!a(e,o)||e.fastSwitching!=o.fastSwitching||r&&!u(e,r,o)||(r=o)}t.s&&!jb(r)&&n.delete(i(r));return r}function Db(t,n){return t.mimeType!=n.mimeType?false:Yb(t.codecs)===Yb(n.codecs)}i.Hi=function(t){this.o=t};i.Li=function(t){this.s=t};function Lb(t,n,e){return!Db(n,e)&&!t.o||n.drmInfos&&!Lr(n.drmInfos,e.drmInfos)?false:true}function Ob(t,n){return n.language?t.forced!==n.forced||0==Xi(t.language,n.language)||n.kind!=t.kind?false:true:true}function _b(){return true}function Ub(t,n,e){var i=Db(t,n),r=Db(t,e);if(i&&!r)return false;if(!i&&r)return true;i=Xi(t.language,n.language);r=Xi(t.language,e.language);if(r>i)return true;if(r<i)return false;if(n.label!==e.label){if(t.label===n.label)return false;if(t.label===e.label)return true}if(t.roles.length){i=n.roles.filter((function(n){return t.roles.includes(n)}));r=e.roles.filter((function(n){return t.roles.includes(n)}));if(r.length>i.length)return true;if(r.length<i.length)return false;if(e.roles.length!==n.roles.length)return e.roles.length<n.roles.length}else{if(!e.roles.length&&n.roles.length)return true;if(e.roles.length&&!n.roles.length)return false}if(!n.primary&&e.primary)return true;if(n.primary&&!e.primary)return false;i=Xb(t.channelsCount,n.channelsCount,e.channelsCount);if(i==Qb)return true;if(i==Zb)return false;i=Xb(t.audioSamplingRate,n.audioSamplingRate,e.audioSamplingRate);return i==Qb?true:i==Zb?false:t.bandwidth&&qb(t.bandwidth,n.bandwidth,e.bandwidth)==Qb?true:false}function Bb(t,n,e){var i=Db(t,n),r=Db(t,e);if(i&&!r)return false;if(!i&&r)return true;i=Xb(t.width*t.height,n.width*n.height,e.width*e.height);if(i==Qb)return true;if(i==Zb)return false;if(t.frameRate){i=Xb(t.frameRate,n.frameRate,e.frameRate);if(i==Qb)return true;if(i==Zb)return false}return t.bandwidth&&qb(t.bandwidth,n.bandwidth,e.bandwidth)==Qb?true:false}function Hb(t,n,e){var i=Xi(t.language,n.language),r=Xi(t.language,e.language);if(r>i)return true;if(r<i)return false;if(!n.primary&&e.primary)return true;if(n.primary&&!e.primary)return false;if(n.label!==e.label){if(t.label===n.label)return false;if(t.label===e.label)return true}if(t.roles.length){i=n.roles.filter((function(n){return t.roles.includes(n)}));r=e.roles.filter((function(n){return t.roles.includes(n)}));if(r.length>i.length)return true;if(r.length<i.length)return false}else{if(!e.roles.length&&n.roles.length)return true;if(e.roles.length&&!n.roles.length)return false}return e.mimeType!=t.mimeType||e.codecs!=t.codecs||n.mimeType==t.mimeType&&n.codecs==t.codecs?false:true}function Fb(t,n,e){return Xb(t.width*t.height,n.width*n.height,e.width*e.height)==Qb?true:false}function Vb(t){return{id:0,originalId:"",groupId:null,primary:false,type:t,mimeType:"",codecs:"",language:"",originalLanguage:null,label:null,width:null,height:null,encrypted:false,keyIds:new Set,segments:[],variantIds:[],roles:[],forced:false,channelsCount:null,audioSamplingRate:null,spatialAudio:false,closedCaptions:null,external:false,fastSwitching:false,isAudioMuxedInVideo:false,baseOriginalId:null}}function zb(t){return{id:0,originalId:"",groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new jf([]),mimeType:"",codecs:"",encrypted:false,drmInfos:[],keyIds:new Set,language:"",originalLanguage:null,label:null,type:t,primary:false,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:false,channelsCount:null,audioSamplingRate:null,spatialAudio:false,closedCaptions:null,accessibilityPurpose:null,external:false,fastSwitching:false,fullMimeTypes:new Set,isAudioMuxedInVideo:false,baseOriginalId:null}}function Xb(t,n,e){if(n==t&&t!=e)return Zb;if(e==t&&t!=n)return Qb;if(n>t){if(e<=t||e-t<n-t)return Qb;if(e-t>n-t)return Zb}else{if(e>t)return Zb;if(t-e<t-n)return Qb;if(t-e>t-n)return Zb}return Jb}function qb(t,n,e){n=Math.abs(t-n);t=Math.abs(t-e);return t<n?Qb:n<t?Zb:Jb}function jb(t){switch(t.type){case hn:return!t.language;case"image":return!t.tilesLayout;default:return false}}function Gb(t){return JSON.stringify([t.fastSwitching,t.width,t.frameRate,Yb(t.codecs),t.mimeType,t.label,t.roles,t.closedCaptions?Array.from(t.closedCaptions.entries()):null,t.bandwidth,t.dependencyStream?t.dependencyStream.baseOriginalId:null,Array.from(t.keyIds)])}function Kb(t){return JSON.stringify([t.fastSwitching,t.channelsCount,t.language,t.bandwidth,t.label,Yb(t.codecs),t.mimeType,t.roles,t.audioSamplingRate,t.primary,t.dependencyStream?t.dependencyStream.baseOriginalId:null,Array.from(t.keyIds)])}function Wb(t){return JSON.stringify([t.language,t.label,t.codecs,t.mimeType,t.bandwidth,t.roles])}function $b(t){return JSON.stringify([t.width,t.codecs,t.mimeType])}function Yb(t){if(!ty.has(t)){var n=pi(t);ty.set(t,n)}return ty.get(t)}q("shaka.util.PeriodCombiner",bb);bb.prototype.setUseStreamOnce=bb.prototype.Li;bb.prototype.setAllowMultiTypeVariants=bb.prototype.Hi;bb.prototype.combinePeriods=bb.prototype.cg;bb.prototype.deleteStream=bb.prototype.Nh;bb.prototype.getImageStreams=bb.prototype.Aj;bb.prototype.getTextStreams=bb.prototype.Dg;bb.prototype.getVariants=bb.prototype.Vj;var Qb=1,Jb=0,Zb=-1,ty=new Map;function ny(t,n){var e=new DOMParser,i=iy.value()(t);t=null;try{t=e.parseFromString(i,"text/xml")}catch(t){return null}e=t.documentElement;if(!e||e.getElementsByTagName("parsererror").length||e.tagName!=n)return null;if(!("createNodeIterator"in document))return e;for(n=document.createNodeIterator(t,NodeFilter.SHOW_ALL);t=n.nextNode();)if(t instanceof HTMLElement||t instanceof SVGElement)return null;return e}function ey(t,n){try{var e=Gt(t);return ny(e,n)}catch(t){return null}}var iy=new ot((function(){if("undefined"!==typeof trustedTypes){var t=trustedTypes.createPolicy("shaka-player#xml",{createHTML:function(t){return t}});return function(n){return t.createHTML(n)}}return function(t){return t}}));function ry(){var t=this;this.j=this.g=null;this.A=[];this.i=null;this.Ba=1;this.G=[];this.l={jf:"",type:"",profiles:[],mc:null,pb:0,cb:null,$d:0};this.s=new Map;this.B=new Map;this.o=new Map;this.C=new Map;this.wa=new Map;this.m=new bb;this.K=0;this.ya=new j(5);this.L=new Di((function(){if(t.I&&!t.g.continueLoadingWhenPaused&&(t.H.Ja(t.I,"timeupdate"),t.I.paused)){t.H.za(t.I,"timeupdate",(function(){return Iy(t)}));return}Iy(t)}));this.P=new ea;this.N=null;this.F=[];this.ia=Infinity;this.va=false;this.h=null;this.M=0;this.S=false;this.H=new it;this.I=null;this.U=false;this.ba="";this.oa=function(){return false};this.W=[];this.ka=new Set}i=ry.prototype;i.configure=function(t,n){var e=this.j&&t.updatePeriod!=this.g.updatePeriod&&0<=t.updatePeriod;this.g=t;n&&(this.oa=n);e&&this.i&&this.i.presentationTimeline.V()&&this.L.Hb();this.h&&this.h.configure(this.g);this.m&&(this.m.Hi(this.g.dash.multiTypeVariantsAllowed&&kn()),this.m.Li(this.g.dash.useStreamOnceInPeriodFlattening))};i.start=function(t,n){var e=this,i;return _((function(r){if(1==r.g)return e.va=n.isLowLatencyMode(),e.A=[t],e.j=n,T(r,ay(e),2);i=r.h;e.j&&My(e,i);if(!e.j)throw new zt(2,7,7001);return r.return(e.i)}))};i.stop=function(){for(var t=c(this.o.values()),n=t.next();!n.done;n=t.next())n=n.value,n.segmentIndex&&n.segmentIndex.release();this.m&&this.m.release();this.g=this.j=null;this.A=[];this.i=null;this.o.clear();this.C.clear();this.s.clear();this.B.clear();this.l={jf:"",type:"",profiles:[],mc:null,pb:0,cb:null,$d:0};this.m=null;null!=this.L&&(this.L.stop(),this.L=null);this.h&&this.h.destroy();this.H&&(this.H.release(),this.H=null);this.ka.clear();return this.P.destroy()};i.update=function(){var t=this,n;return _((function(e){if(1==e.g)return S(e,2),T(e,ay(t),4);if(2!=e.g)return I(e,0);n=M(e);if(!t.j||!n)return e.return();t.j.onError(n);E(e)}))};i.onExpirationUpdated=function(){};i.onInitialVariantChosen=function(t){if(this.i&&this.i.presentationTimeline.V()){var n=t.video||t.audio;if(n&&n.segmentIndex){t=this.i.presentationTimeline.zc();var e=n.segmentIndex.find(t);null!=e&&(n=n.segmentIndex.get(e))&&(this.K=n.endTime-t,My(this,0))}}};i.banLocation=function(t){this.h&&this.h.banLocation(t)};i.setMediaElement=function(t){this.I=t};function ay(t){var n,e,i,r,a,u,s,o,f,c,l;return _((function(h){if(1==h.g)return n=4,e="MPD",i=By(t),r=t.A,i.length?(r=i,e="Patch",n=6):1<t.A.length&&t.h&&(a=gb(t.h,"Location",true),a.length&&(r=a)),u=sa(r,t.g.retryParameters),s=Date.now(),T(h,Uy(t,u,0,{type:n}),2);if(3!=h.g){o=h.h;if(!t.j)return h.return(0);o.uri&&o.uri!=o.originalUri&&!t.A.includes(o.uri)&&t.A.unshift(o.uri);f=new bt(o.uri);t.ba=f.g.toString();return T(h,uy(t,o.data,o.uri,e),3)}c=Date.now();l=(c-s)/1e3;t.ya.sample(1,l);t.ka.clear();return h.return(l)}))}function uy(t,n,e,i){var r,a,u,s,o,f,c,l,h,d;return _((function(v){if(1==v.g){r=n;a=t.g.dash.manifestPreprocessor;u=Vl;if(a!=u){vt("manifest.dash.manifestPreprocessor configuration","Please Use manifest.dash.manifestPreprocessorTXml instead.");s=ey(r,i);if(!s)throw new zt(2,4,4001,e);a(s);r=Kt(s.outerHTML)}o=Yn(r,i);if(!o)throw new zt(2,4,4001,e);f=t.g.dash.manifestPreprocessorTXml;c=zl;f!=c&&f(o);if("Patch"===i)return v.return(fy(t,o));if(t.g.dash.disableXlinkProcessing)return v.return(sy(t,o,e));l=t.g.dash.xlinkFailGracefully;h=Rg(o,t.g.retryParameters,l,e,t.j.networkingEngine);ia(t.P,h);return T(v,h.promise,2)}d=v.h;return v.return(sy(t,d,e))}))}function sy(t,n,e){var i,r,a,u,s,o,f,l,h,d,v,p,m,w,g,b,y,k,S,A,I,M,x,N,C,P,R,D,L,O,U,B,H,F,V,z,X,q,j,G,K,W,$,Y,Q,J,Z,tt,nt,et,it,rt;return _((function(_){switch(_.g){case 1:t.h&&t.h.l.clear();i=[e];r=[];a=new Map;u=ee(n,"Location");s=c(u);for(o=s.next();!o.done;o=s.next())if(f=o.value,l=f.attributes.serviceLocation,h=re(f))d=un(i,[h])[0],l&&(t.h?wb(t.h,"Location",l,d):a.set(l,d)),r.push(d);t.h?(v=gb(t.h,"Location",true),0<v.length&&(i=t.A=v)):r.length&&(i=t.A=r);t.l.jf=n.attributes.id||"";t.l.$d=oe(n,"publishTime",he)||0;t.G=ee(n,"PatchLocation");p=Promise.resolve();if((m=ue(n,"ContentSteering"))&&t.j){w=m.attributes.defaultServiceLocation;if(t.h)t.h.i=i,t.h.h=w;else if(t.h=new db(t.j),t.h.configure(t.g),t.h.setManifestType("DASH"),t.h.i=i,t.h.h=w,g=re(m))oe(m,"queryBeforeStart",be,false)?p=vb(t.h,g):vb(t.h,g);b=c(a.keys());for(y=b.next();!y.done;y=b.next())k=y.value,S=a.get(k),wb(t.h,"Location",k,S)}A=ee(n,"BaseURL");I=false;if(t.h)for(M=c(A),x=M.next();!x.done;x=M.next())N=x.value,C=N.attributes.serviceLocation,P=re(N),C&&P&&(wb(t.h,"BaseURL",C,P),I=true);t.W=null;I&&t.h||(R=A.map(re),t.W=un(i,R));D=function(){return t.h&&I?gb(t.h,"BaseURL"):t.W?t.W:[]};t.l.cb=D;L=0;A&&A.length&&(L=oe(A[0],"availabilityTimeOffset",ge)||0);t.l.pb=L;t.K=oe(n,"minimumUpdatePeriod",de,-1);O=oe(n,"availabilityStartTime",he);U=oe(n,"timeShiftBufferDepth",de);B=t.g.dash.ignoreSuggestedPresentationDelay;H=null;B||(H=oe(n,"suggestedPresentationDelay",de));F=t.g.dash.ignoreMaxSegmentDuration;V=null;F||(V=oe(n,"maxSegmentDuration",de));z=n.attributes.type||"static";t.i&&t.i.presentationTimeline&&(t.U=t.i.presentationTimeline.V()&&"static"==z);t.l.type=z;if(t.i)for(X=t.i.presentationTimeline,q=X.Fb(),j=c(t.o.values()),G=j.next();!G.done;G=j.next())K=G.value,K.segmentIndex&&K.segmentIndex.$a(q);else W=t.g.dash.ignoreMinBufferTime,$=0,W||($=oe(n,"minBufferTime",de)||0),Y=0,Y=null!=H?Math.min(H,U||Infinity):0<t.g.defaultPresentationDelay?t.g.defaultPresentationDelay:Math.min(1.5*$,U||Infinity),X=new kf(O,Y,t.g.dash.autoCorrectDrift);X.Yc("static"==z);X.V()&&!isNaN(t.g.availabilityWindowOverride)&&(U=t.g.availabilityWindowOverride);null==U&&(U=Infinity);X.Df(U);Q=n.attributes.profiles||"";t.l.profiles=Q.split(",");J={ic:"static"!=z,presentationTimeline:X,ra:null,na:null,ma:null,J:null,bandwidth:0,Fg:false,pb:L,mc:null,profiles:Q.split(","),roles:null,Jb:function(){return""}};return T(_,p,2);case 2:t.M=0;Z=my(t,J,D,n,false);tt=Z.duration;nt=Z.periods;("static"!=z||t.U)&&Z.Ph||X.ob(tt||Infinity);t.S&&t.va&&X.Ii(t.ia);X.Ng(V||1);t.S&&t.va&&(et=null!=H?H:t.g.defaultPresentationDelay,X.hh(et));if(!t.i)return T(_,t.m.cg(nt,J.ic),6);t.i.periodCount=nt.length;t.i.gapCount=t.M;return T(_,oy(t,nt,false),4);case 6:t.i={presentationTimeline:X,variants:t.m.l,textStreams:t.m.Dg(),imageStreams:t.m.i,offlineSessionIds:[],sequenceMode:t.g.dash.sequenceMode,ignoreManifestTimestampsInSegmentsMode:false,type:"DASH",serviceDescription:vy(n),nextUrl:py(n),periodCount:nt.length,gapCount:t.M,isLowLatency:t.S,startTime:null};if(!X.Yi()){_.u(7);break}it=ee(n,"UTCTiming");return T(_,Dy(t,D,it),8);case 8:rt=_.h;if(!t.j)return _.return();X.Ji(rt);case 7:X.df(),t.m&&!t.i.presentationTimeline.V()&&t.m.release();case 4:t.j.makeTextStreamsForClosedCaptions(t.i),wy(t),gy(t,nt),E(_)}}))}function oy(t,n,e){var i;return _((function(r){if(1==r.g)return T(r,t.m.cg(n,true,e),2);t.i.variants=t.m.l;i=t.m.Dg();0<i.length&&(t.i.textStreams=i);t.i.imageStreams=t.m.i;t.j.filter(t.i);E(r)}))}function fy(t,n){var e,i,r,a,u,s,o,f,h,d,v,p,m,w,g,b,y,k,S,A,I,M,x,N,C,P,R;return _((function(D){if(1==D.g){e=n.attributes.mpdId;i=oe(n,"originalPublishTime",he);if(!e||e!==t.l.jf||i!==t.l.$d)throw t.G=[],new zt(1,4,4052);r=[];a=[];u=new Set;s=c(ne(n));for(o=s.next();!o.done;o=s.next())if(f=o.value,h=ke(f.attributes.sel||""),d=h[h.length-1],v=re(f)||"","MPD"===d.name)if("mediaPresentationDuration"===d.wc){p=re(f)||"";var L=de(p);if(null!=L){t.l.mc=L;for(var O=c(t.s.values()),_=O.next();!_.done;_=O.next())_.value.mc=L}}else if("type"===d.wc){t.i.presentationTimeline.Yc("static"==v);t.l.type=v;L=c(t.s.values());for(O=L.next();!O.done;O=L.next())O.value.ic="dynamic"==v;"static"==v&&(t.K=-1)}else"publishTime"===d.wc?t.l.$d=he(v)||0:null===d.wc&&"add"===f.tagName&&a.push(f);else if("PatchLocation"===d.name)Te(t.G,f);else if("Period"===d.name)"add"===f.tagName?a.push(f):"remove"===f.tagName&&d.id&&ly(t,d.id);else if("SegmentTemplate"===d.name){O=ke(f.attributes.sel||"");L=O[O.length-1];if(L.wc){O=hy(t,O);_=re(f)||"";for(var U=c(O),B=U.next();!B.done;B=U.next())B=t.s.get(B.value),Se(B.J.Fc,f.tagName,L.wc,_);L=O}else L=[];m=L;w=c(m);for(g=w.next();!g.done;g=w.next())b=g.value,u.add(b)}else if("SegmentTimeline"===d.name||"S"===d.name){L=ke(f.attributes.sel||"");L=hy(t,L);O=c(L);for(_=O.next();!_.done;_=O.next())_=t.s.get(_.value),_=Cg(_,ib,"SegmentTimeline"),U=ee(_,"S"),Te(U,f),_.children=U;y=L;k=c(y);for(S=k.next();!S.done;S=k.next())A=S.value,u.add(A)}I=c(u);for(M=I.next();!M.done;M=I.next())x=M.value,dy(t,x);N=c(a);for(C=N.next();!C.done;C=N.next())P=C.value,r.push.apply(r,l(cy(t,P)));if(!r.length)return D.u(2);t.i.periodCount+=r.length;t.i.gapCount=t.M;return T(D,oy(t,r,true),2)}"static"==t.l.type&&(R=t.l.mc,t.i.presentationTimeline.ob(R||Infinity));E(D)}))}function cy(t,n){return my(t,{ic:"dynamic"==t.l.type,presentationTimeline:t.i.presentationTimeline,ra:null,na:null,ma:null,J:null,bandwidth:0,Fg:false,pb:t.l.pb,profiles:t.l.profiles,mc:t.l.mc,roles:null,Jb:function(){return""}},t.l.cb,n,true).periods}function ly(t,n){t.i.periodCount--;for(var e=c(t.s.keys()),i=e.next();!i.done;i=e.next())if(i=i.value,i.startsWith(n)){var r=t.s.get(i);Cg(r,ib,"SegmentTimeline").children=[];dy(t,i);t.s.delete(i)}t.F=t.F.filter((function(t){return t!==n}))}function hy(t,n){var e="",i="",r=-1,a="";n=c(n);for(var u=n.next();!u.done;u=n.next())u=u.value,"Period"===u.name?e=u.id:"AdaptationSet"===u.name?(i=u.id,null!==u.position&&(r=u.position)):"Representation"===u.name&&(a=u.id);n=[];if(a)n.push(e+","+a);else if(i)for(r=c(t.s.values()),t=r.next();!t.done;t=r.next())t=t.value,t.ra.id===e&&t.ma.id===i&&t.J.id&&n.push(e+","+t.J.id);else if(-1<r)for(i=c(t.s.values()),t=i.next();!t.done;t=i.next())t=t.value,t.ra.id===e&&t.ma.position===r&&t.J.id&&n.push(e+","+t.J.id);return n}function dy(t,n){var e=t.s.get(n),i=t.o.get(n);i.segmentIndex&&i.segmentIndex.$a(t.i.presentationTimeline.Fb());try{var r=eb(e,(function(n,e,i,r){return Oy(t,n,e,i,r)}),t.o,true,t.g.dash.initialSegmentLimit,t.wa,e.J.aesKey,null,true,t.B);i.createSegmentIndex=function(){return _((function(t){if(1==t.g)return i.segmentIndex?t.u(0):T(t,r.Nc(),3);i.segmentIndex=t.h;E(t)}))}}catch(t){if(n=e.J.contentType,n!=hn&&"application"!=n&&"image"!=n||4002!=t.code)throw t}}function vy(t){var n=ue(t,"ServiceDescription");if(!n)return null;t=ue(n,"Latency");n=ue(n,"PlaybackRate");if(!t&&!n)return null;var e={};t&&("target"in t.attributes&&(e.targetLatency=parseInt(t.attributes.target,10)/1e3),"max"in t.attributes&&(e.maxLatency=parseInt(t.attributes.max,10)/1e3),"min"in t.attributes&&(e.minLatency=parseInt(t.attributes.min,10)/1e3));n&&("max"in n.attributes&&(e.maxPlaybackRate=parseFloat(n.attributes.max)),"min"in n.attributes&&(e.minPlaybackRate=parseFloat(n.attributes.min)));return e}function py(t){t=ee(t,"SupplementalProperty");if(!t.length)return null;t=c(t);for(var n=t.next();!n.done;n=t.next())if(n=n.value,"urn:mpeg:dash:chaining:2016"==n.attributes.schemeIdUri)return n.attributes.value;return null}function my(t,n,e,i,r){var a=n.mc;a||(a=oe(i,"mediaPresentationDuration",de),t.l.mc=a);var u=0;t.i&&t.i.presentationTimeline&&t.U&&(u=t.i.presentationTimeline.Vb());var s=[],o=u;i=ee(i,"Period");for(var f=0;f<i.length;f++){var l=i[f],h=i[f+1],d=oe(l,"start",de,o),v=l.attributes.id,p=oe(l,"duration",de);d=0==f&&0==d&&t.U?u:d;var m=null;if(h){var w=oe(h,"start",de);null!=w&&(m=w-d+u)}else null!=a&&(m=a-d+u);w=vn;m&&p&&Math.abs(m-p)>w&&m>p&&t.M++;null==m&&(m=p);if(!(null!==t.N&&null!==v&&null!==d&&d<t.N)||t.F.includes(v)||f+1==i.length){null!==d&&(null===t.N||d>t.N)&&(t.N=d);o=by(t,n,e,{start:d,duration:m,node:l,ci:null==m||!h});s.push(o);n.ra.id&&m&&t.wa.set(n.ra.id,m);if(null==m){o=null;break}o=d+m}}if(r)for(n=c(s),e=n.next();!e.done;e=n.next())e=e.value.id,t.F.includes(e)||t.F.push(e);else t.F=s.map((function(t){return t.id}));return null!=a?{periods:s,duration:a+u,Ph:false}:{periods:s,duration:o,Ph:true}}function wy(t){var n=Array.from(t.C.keys()).filter((function(n){return!t.F.includes(n)}));n=c(n);for(var e=n.next();!e.done;e=n.next()){e=e.value;for(var i=true,r=c(t.C.get(e)),a=r.next();!a.done;a=r.next()){a=a.value;var u=t.o.get(a);u&&(u.segmentIndex&&0!=u.segmentIndex.getNumReferences()?i=false:(t.m&&t.m.Nh(u,e),t.o.delete(a)))}i&&t.C.delete(e)}}function gy(t,n){n=new Set(n.map((function(t){return t.id})));for(var e=c(t.B.keys()),i=e.next();!i.done;i=e.next())i=i.value,n.has(i)||t.B.delete(i)}function by(t,n,e,i){n.ra=xy(t,i.node,null,e);n.na=i;n.ra.pb=n.pb;n.ra.id||(n.ra.id="__shaka_period_"+i.start);var r=ee(i.node,"EventStream");e=n.presentationTimeline.Fb();r=c(r);for(var a=r.next();!a.done;a=r.next())Ly(t,i.start,i.duration,a.value,e);e=ee(i.node,"SupplementalProperty");e=c(e);for(r=e.next();!r.done;r=e.next())if(r=r.value,"urn:mpeg:dash:urlparam:2014"==r.attributes.schemeIdUri&&(r=Ty(t,r)))n.Jb=r;e=ee(i.node,"AdaptationSet").map((function(e,i){return ky(t,n,i,e)})).filter(_i);if(n.ic){r=[];a=c(e);for(var u=a.next();!u.done;u=a.next()){u=c(u.value.Ik);for(var s=u.next();!s.done;s=u.next())r.push(s.value)}if(r.length!=new Set(r).size)throw new zt(2,4,4018)}r=new Map;a=c(e);for(u=a.next();!u.done;u=a.next())for(u=c(u.value.oj),s=u.next();!s.done;s=u.next()){var o=c(s.value);s=o.next().value;o=o.next().value;r.set(s,o)}if(r.size)for(a=null,u=c(e),s=u.next();!s.done;s=u.next()){s=s.value;o=[];for(var f=c(s.streams),h=f.next(),d={};!h.done;d={nh:void 0},h=f.next())if(d.nh=h.value,r.has(d.nh.originalId)){a||(a=ee(i.node,"AdaptationSet").map((function(e,i){return ky(t,n,i,e)})).filter(_i));h=c(a);for(var v=h.next();!v.done;v=h.next())if(v=v.value.streams.find(function(t){return function(n){return n.originalId==t.nh.originalId}}(d)))v.dependencyStream=r.get(v.originalId),v.originalId+=v.dependencyStream.originalId,o.push(v)}o.length&&s.streams.push.apply(s.streams,l(o))}i=e.filter((function(t){return!t.wh}));e=e.filter((function(t){return t.wh}));if(!t.g.disableIFrames)for(e=c(e),r=e.next();!r.done;r=e.next())for(r=r.value,a=r.wh.split(" "),u=c(i),s=u.next();!s.done;s=u.next())if(s=s.value,a.includes(s.id))for(s=c(s.streams),o=s.next();!o.done;o=s.next())Tr(o.value,r.streams);e=yy(t.g.disableAudio,i,"audio");r=yy(t.g.disableVideo,i,"video");a=yy(t.g.disableText,i,hn);i=yy(t.g.disableThumbnails,i,"image");if(0===r.length&&0===e.length)throw new zt(2,4,4004);return{id:n.ra.id,audioStreams:e,videoStreams:r,textStreams:a,imageStreams:i}}function yy(t,n,e){return t||!n.length?[]:n.reduce((function(t,n){if(n.contentType!=e)return t;t.push.apply(t,l(n.streams));return t}),[])}function ky(t,n,e,i){function r(e){var i=e.attributes["dvb:fontFamily"];e=e.attributes["dvb:url"];i&&e&&(e=un(n.ma.cb(),[e],n.Jb()),t.j.addFont(i,e[0]))}function a(t){switch(t){case 1:case 5:case 6:case 7:return"srgb";case 9:return"rec2020";case 11:case 12:return"p3"}}function u(t){switch(t){case 1:case 6:case 13:case 14:case 15:return"SDR";case 16:return"PQ";case 18:return"HLG"}}n.ma=xy(t,i,n.ra,null);n.ma.position=e;var s=false;e=ee(i,"Role");var o=e.map((function(t){return t.attributes.value})).filter(_i),f=void 0,h=n.ma.contentType==hn;h&&(f="subtitle");e=c(e);for(var d=e.next();!d.done;d=e.next()){d=d.value;var v=d.attributes.schemeIdUri;if(null==v||"urn:mpeg:dash:role:2011"==v)switch(d=d.attributes.value,d){case"main":s=true;break;case"caption":case"subtitle":f=d}}var p=ee(i,"EssentialProperty");e=null;var m=false;d=null;v=false;p=c(p);for(var w=p.next();!w.done;w=p.next()){w=w.value;var g=w.attributes.schemeIdUri;if("http://dashif.org/guidelines/trickmode"==g)e=w.attributes.value;else if("urn:mpeg:mpegB:cicp:TransferCharacteristics"==g)var b=u(parseInt(w.attributes.value,10));else if("urn:mpeg:mpegB:cicp:ColourPrimaries"==g)var y=a(parseInt(w.attributes.value,10));else"urn:mpeg:mpegB:cicp:MatrixCoefficients"!=g&&("urn:mpeg:dash:ssr:2023"==g&&t.g.dash.enableFastSwitching?m=true:"urn:dvb:dash:fontdownload:2014"==g?r(w):"urn:mpeg:dash:urlparam:2014"==g?(d=Ty(t,w))||(v=true):v=true)}if(v)return null;var k=null;v=ee(i,"SupplementalProperty");v=c(v);for(p=v.next();!p.done;p=v.next())p=p.value,w=p.attributes.schemeIdUri,"http://dashif.org/guidelines/last-segment-number"==w?k=parseInt(p.attributes.value,10)-1:"urn:mpeg:mpegB:cicp:TransferCharacteristics"==w?b=u(parseInt(p.attributes.value,10)):"urn:mpeg:mpegB:cicp:ColourPrimaries"==w?y=a(parseInt(p.attributes.value,10)):"urn:dvb:dash:fontdownload:2014"==w?r(p):"urn:mpeg:dash:urlparam:2014"==w&&(d=Ty(t,p));d&&(n.Jb=d);d=ee(i,"Accessibility");var T=new Map,E;d=c(d);for(v=d.next();!v.done;v=d.next())if(p=v.value,v=p.attributes.schemeIdUri,p=p.attributes.value,"urn:scte:dash:cc:cea-608:2015"!=v||t.g.disableText)if("urn:scte:dash:cc:cea-708:2015"!=v||t.g.disableText)"urn:mpeg:dash:role:2011"==v?null!=p&&(o.push(p),"captions"==p&&(f="caption")):"urn:tva:metadata:cs:AudioPurposeCS:2007"==v&&("1"==p?E="visually impaired":"2"==p?E="hard of hearing":"9"==p&&(E="spoken subtitles"));else if(v=1,null!=p)for(p=c(p.split(";")),w=p.next();!w.done;w=p.next()){g=w.value;var S=w=void 0;g.includes("=")?(g=g.split("="),w="svc"+g[0],S=g[1].split(",")[0].split(":").pop()):(w="svc"+v,v++,S=g);T.set(w,zi(S))}else T.set("svc1","und");else if(v=1,null!=p)for(p=p.split(";"),w=c(p),g=w.next();!g.done;g=w.next()){S=g.value;var A=g=void 0;S.includes("=")?(S=S.split("="),g=S[0].startsWith("CC")?S[0]:"CC"+S[0],A=S[1]||"und"):(g="CC"+v,2==p.length?v+=2:v++,A=S);T.set(g,zi(A))}else T.set("CC1","und");d=ee(i,"ContentProtection");var I=gg(d,t.g.ignoreDrmInfo,t.g.dash.keySystemsByURI);n.ma.encrypted=0<d.length;var M=zi(n.ma.language||"und"),x=n.ma.label,N=new Map;i=ee(i,"Representation");if(!t.g.ignoreSupplementalCodecs){d=[];v=c(i);for(p=v.next();!p.done;p=v.next())if(w=p.value,p=fe(w,"urn:scte:dash:scte214-extensions","supplementalCodecs"))w=Kn(w),w.attributes.codecs=p.split(" ").join(","),w.attributes.id&&(w.attributes.supplementalId=w.attributes.id+"_supplementalCodecs"),d.push(w);i.push.apply(i,l(d))}d=i.map((function(e){var i=Ey(t,n,I,f,M,x,s,o,T,e,E,k);return i&&(i.hdr=i.hdr||b,i.colorGamut=i.colorGamut||y,i.fastSwitching=m,e=e.attributes.dependencyId)?(i.baseOriginalId=e,N.set(e,i),null):i})).filter((function(t){return!!t}));if(0==d.length&&0==N.size){e="image"==n.ma.contentType;if(t.g.dash.ignoreEmptyAdaptationSet||h||e)return null;throw new zt(2,4,4003)}if(!n.ma.contentType||"application"==n.ma.contentType)for(n.ma.contentType=_y(d[0].mimeType,d[0].codecs),h=c(d),v=h.next();!v.done;v=h.next())v.value.type=n.ma.contentType;h=n.ma.id||"__fake__"+t.Ba++;v=c(d);for(p=v.next();!p.done;p=v.next()){p=p.value;w=c(I.drmInfos);for(g=w.next();!g.done;g=w.next())g=g.value,g.keyIds=g.keyIds&&p.keyIds?new Set([].concat(l(g.keyIds),l(p.keyIds))):g.keyIds||p.keyIds;p.groupId=h}i=i.map((function(t){return t.attributes.supplementalId||t.attributes.id})).filter(_i);return{id:h,contentType:n.ma.contentType,language:M,vm:s,streams:d,drmInfos:I.drmInfos,wh:e,Ik:i,oj:N}}function Ty(t,n){if((n=se(n,"urn:mpeg:dash:schema:urlparam:2014","UrlQueryInfo"))&&oe(n,"useMPDUrlQuery",be,false)){var e=n.attributes.queryTemplate;if(e)return function(){return"$querypart$"==e?t.ba:e.split("&").map((function(n){if("$querypart$"==n)return t.ba;var e=/\$query:(.*?)\$/g.exec(n);if(e&&2==e.length){e=e[1];var i=new Rt(t.ba).get(e);if(i.length)return e+"="+i[0]}return n})).join("&")}}return null}function Ey(n,e,i,r,a,u,s,o,f,c,l,h){e.J=xy(n,c,e.ma,null);var d=e.J.id;n.ia=Math.min(n.ia,e.J.pb);n.S=0<n.ia;if(!Py(e.J))return null;var v=e.na.start;e.bandwidth=oe(c,"bandwidth",me)||0;e.roles=o;var p=ee(c,"SupplementalProperty"),m=ee(c,"EssentialProperty"),w=ee(c,"ContentProtection");c=null;var g=m.find((function(t){return"urn:mpeg:dash:urlparam:2014"==t.attributes.schemeIdUri}));g?c=Ty(n,g):(g=p.find((function(t){return"urn:mpeg:dash:urlparam:2014"==t.attributes.schemeIdUri})))&&(c=Ty(n,g));c&&(e.Jb=c);g=e.J.contentType;c=g==hn||"application"==g;g="image"==g;w.length&&(e.ma.encrypted=true);try{var b=void 0;if(i.Yf){var y=e.J.cb,k=e.Jb,S=un(y(),[i.Yf.jk],k()),A=sa(S,n.g.retryParameters);b={bitsKey:128,blockCipherMode:"CBC",iv:i.Yf.iv,firstMediaSequenceNumber:0,fetchKey:function(){var e,i,r;return _((function(a){if(1==a.g)return T(a,Uy(n,A,6),2);if(3!=a.g){e=a.h;if(!e.data||16!=e.data.byteLength)throw new zt(2,4,4049);i={name:"AES-CBC"};r=b;return T(a,t.crypto.subtle.importKey("raw",e.data,i,true,["decrypt"]),3)}r.cryptoKey=a.h;b.fetchKey=void 0;E(a)}))}}}e.J.aesKey=b;y=function(t,e,i,r){return Oy(n,t,e,i,r)};if(e.J.yd)var I=qg(e,y,b);else if(e.J.tc)I=Qg(e,n.o,b);else if(e.J.Fc)I=eb(e,y,n.o,!!n.i,n.g.dash.initialSegmentLimit,n.wa,b,h,false,n.B);else{var M=e.na.duration||0,x=e.J.cb,N=e.J.mimeType,C=e.J.codecs;I={endTime:-1,timeline:-1,Nc:function(){var t=Kf(v,M,x());t.Db((function(t){t.mimeType=N;t.codecs=C}));return Promise.resolve(t)},timescale:1}}}catch(t){if((c||g)&&4002==t.code)return null;throw t}h=bg(w,i,n.g.ignoreDrmInfo,n.g.dash.keySystemsByURI);h=new Set(h?[h]:[]);w=false;p.some((function(t){return"tag:dolby.com,2018:dash:EC3_ExtensionType:2018"==t.attributes.schemeIdUri&&"JOC"==t.attributes.value}))&&(w=true);p=false;c&&(p=o.includes("forced_subtitle")||o.includes("forced-subtitle"));var P;if(g&&((m=m.find((function(t){return["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"].includes(t.attributes.schemeIdUri)})))&&(P=m.attributes.value),!P))return null;var R;c=e.J.codecs;e.profiles.includes("http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10")&&(c.includes("hvc1.2.4.L153.B0")||c.includes("hev1.2.4.L153.B0"))&&(R="PQ");m=e.J.id?e.ra.id+","+e.J.id:"";n.G.length&&d&&n.s.set(e.ra.id+","+d,Ay(e));e.J.vf&&Sy(n,e.J.vf,I,e.presentationTimeline);-1!=I.endTime&&null!=e.ra.id&&null!=e.J.id&&((d=n.B.get(e.ra.id))?(d.endTime=I.endTime,d.Xg.includes(e.J.id)||d.Xg.push(e.J.id),n.B.set(e.ra.id,d)):n.B.set(e.ra.id,{endTime:I.endTime,timeline:I.timeline,Xg:[e.J.id]}));var D=m&&n.o.has(m)?n.o.get(m):{id:n.Ba++,originalId:e.J.id,groupId:null,createSegmentIndex:function(){return Promise.resolve()},closeSegmentIndex:function(){D.segmentIndex&&(D.segmentIndex.release(),D.segmentIndex=null)},segmentIndex:null,mimeType:e.J.mimeType,codecs:c,frameRate:e.J.frameRate,pixelAspectRatio:e.J.pixelAspectRatio,bandwidth:e.bandwidth,width:e.J.width,height:e.J.height,kind:r,encrypted:0<i.drmInfos.length,drmInfos:i.drmInfos,keyIds:h,language:a,originalLanguage:e.ma.language,label:u,type:e.ma.contentType,primary:s,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:e.J.emsgSchemeIdUris,roles:o,forced:p,channelsCount:e.J.mf,audioSamplingRate:e.J.audioSamplingRate,spatialAudio:w,closedCaptions:f,hdr:R,colorGamut:void 0,videoLayout:void 0,tilesLayout:P,accessibilityPurpose:l,external:false,fastSwitching:false,fullMimeTypes:new Set([li(e.J.mimeType,e.J.codecs)]),isAudioMuxedInVideo:false,baseOriginalId:null};D.createSegmentIndex=function(){var t;return _((function(n){if(1==n.g){if(D.segmentIndex)return n.u(0);t=D;return T(n,I.Nc(),3)}t.segmentIndex=n.h;E(n)}))};m&&e.ic&&!n.o.has(m)&&(e=e.ra.id||"",n.C.has(e)||n.C.set(e,[]),n.o.set(m,D),n.C.get(e).push(m));return D}function Sy(t,n,e,i){if(!t.ka.has(n)){t.ka.add(n);var r=oe(n,"presentationTime",we)||0,a=ue(n,"UTCTiming"),u;if(u=a&&a.attributes.schemeIdUri)a=a.attributes.schemeIdUri,u=!("urn:mpeg:dash:utc:http-ntp:2014"===a||"urn:mpeg:dash:utc:ntp:2014"===a||"urn:mpeg:dash:utc:sntp:2014"===a);u?n=1e3*(oe(n,"wallClockTime",he)||0):(n=oe(n,"wallClockTime",we)||0,n=ao(n));e=new Date(n-r/e.timescale*1e3);r=e.getTime()/1e3;isNaN(r)||(i.o||i.ih(r),i=(new Map).set("detail",{wallClockTime:n,programStartDate:e}),i=new Jr("prft",i),t.j.onEvent(i))}}function Ay(t){function n(t){if(!t)return null;t=Wn(t);t.yd=null;t.tc=null;t.Fc=Ie(t.Fc);t.vf=null;return t}t=Wn(t);t.ra=n(t.ra);t.ma=n(t.ma);t.J=n(t.J);t.na&&(t.na=Wn(t.na),t.na.node=null);return t}function Iy(t){var n,e;return _((function(i){switch(i.g){case 1:return n=0,S(i,2),T(i,ay(t),4);case 4:n=i.h;I(i,3);break;case 2:if(e=M(i),t.j){if(t.g.raiseFatalErrorOnManifestUpdateRequestFailure)return t.j.onError(e),i.return();e.severity=1;t.j.onError(e)}case 3:if(!t.j)return i.return();t.j.onManifestUpdated();My(t,n);E(i)}}))}function My(t,n){if(!(0>t.K)){var e=t.K;0<=t.g.updatePeriod&&(e=t.g.updatePeriod);t.L.ha(Math.max(e-n,G(t.ya)))}}function xy(t,n,e,i){e=e||{contentType:"",mimeType:"",codecs:"",emsgSchemeIdUris:[],frameRate:void 0,pixelAspectRatio:void 0,mf:null,audioSamplingRate:null,pb:0,Af:0,encrypted:false};i=i||e.cb;var r=n.attributes.id,a=n.attributes.supplementalId,u=ee(n,"BaseURL"),s,o=false;if(t.h)for(var f=c(u),l=f.next();!l.done;l=f.next()){var h=l.value;l=h.attributes.serviceLocation;h=re(h);l&&h&&(wb(t.h,r,l,h),o=true)}o&&t.h||(s=u.map(re));f=n.attributes.contentType||e.contentType;l=n.attributes.mimeType||e.mimeType;h=Ac([n.attributes.codecs||e.codecs]).join(",");var d=oe(n,"frameRate",ye)||e.frameRate,v=n.attributes.sar||e.pixelAspectRatio,p=Ny(ee(n,"InbandEventStream"),e.emsgSchemeIdUris),m=ee(n,"AudioChannelConfiguration");m=Cy(m)||e.mf;var w=oe(n,"audioSamplingRate",we)||e.audioSamplingRate;f||(f=_y(l,h));var g=ue(n,"SegmentBase"),b=ue(n,"SegmentTemplate"),y=g?oe(g,"availabilityTimeOffset",ge)||0:0,k=b?oe(b,"availabilityTimeOffset",ge)||0:0,T=u&&u.length?oe(u[0],"availabilityTimeOffset",ge)||0:0;y=e.pb+T+y+k;k=null;(T=ue(n,"SegmentSequenceProperties"))&&(T=ue(T,"SAP"))&&(k=oe(T,"cadence",pe));T=n.attributes.label;var E=ee(n,"Label");E&&E.length&&(E=E[0],ie(E)&&(T=ie(E)));return{cb:function(){return un(i(),u.length?t.h&&o?gb(t.h,r):s?s:[]:[])},yd:g||e.yd,tc:ue(n,"SegmentList")||e.tc,Fc:b||e.Fc,vf:ue(n,"ProducerReferenceTime")||e.vf,width:oe(n,"width",we)||e.width,height:oe(n,"height",we)||e.height,contentType:f,mimeType:l,codecs:h,frameRate:d,pixelAspectRatio:v,emsgSchemeIdUris:p,id:a||r,originalId:r,language:n.attributes.lang,mf:m,audioSamplingRate:w,pb:y,Xe:null,Af:k||e.Af,label:T||null,encrypted:false}}function Ny(t,n){n=n.slice();t=c(t);for(var e=t.next();!e.done;e=t.next())e=e.value.attributes.schemeIdUri,n.includes(e)||n.push(e);return n}function Cy(t){t=c(t);for(var n=t.next();!n.done;n=t.next()){n=n.value;var e=n.attributes.schemeIdUri;if(e&&(n=n.attributes.value))switch(e){case"urn:mpeg:dash:outputChannelPositionList:2012":return n.trim().split(/ +/).length;case"urn:mpeg:dash:23003:3:audio_channel_configuration:2011":case"urn:dts:dash:audio_channel_configuration:2012":n=parseInt(n,10);if(!n)continue;return n;case"tag:dolby.com,2015:dash:audio_channel_configuration:2015":e=[2,1,2,2,2,2,1,2,2,1,1,1,1,2,1,1,2,2];n=parseInt(n,16);if(!n)continue;for(var i=0,r=0;r<e.length;r++)n&1<<r&&(i+=e[r]);if(i)return i;continue;case"tag:dolby.com,2014:dash:audio_channel_configuration:2011":case"urn:dolby:dash:audio_channel_configuration:2011":e=[1,1,1,1,1,2,2,1,1,2,2,2,1,2,1,1].reverse();n=parseInt(n,16);if(!n)continue;for(r=i=0;r<e.length;r++)n&1<<r&&(i+=e[r]);if(i)return i;continue;case"urn:mpeg:mpegB:cicp:ChannelConfiguration":if(e=[0,1,2,3,4,5,6,8,2,3,4,7,8,24,8,12,10,12,14,12,14],(n=parseInt(n,10))&&0<n&&n<e.length)return e[n]}}return null}function Py(t){var n=t.yd?1:0;n+=t.tc?1:0;n+=t.Fc?1:0;if(0==n)return t.contentType==hn||"application"==t.contentType?true:false;1!=n&&(t.yd&&(t.tc=null),t.Fc=null);return true}function Ry(t,n,e,i){var r,a,u,s,o,f,c;return _((function(l){if(1==l.g)return r=[Yt(e)],a=un(n(),r),u=sa(a,t.g.retryParameters),u.method=i,s=t.j.networkingEngine.request(4,u,{isPreload:t.oa()}),ia(t.P,s),T(l,s.promise,2);o=l.h;if("HEAD"==i){if(!o.headers||!o.headers.date)return l.return(0);f=o.headers.date}else f=qt(o.data);c=Date.parse(f);return isNaN(c)?l.return(0):l.return(c-Date.now())}))}function Dy(t,n,e){var i,r,a,u,s,o,f,l;return _((function(h){switch(h.g){case 1:i=e.map((function(t){return{scheme:t.attributes.schemeIdUri,value:t.attributes.value}})),r=t.g.dash.clockSyncUri,!i.length&&r&&i.push({scheme:"urn:mpeg:dash:utc:http-head:2014",value:r}),a=c(i),u=a.next();case 2:if(u.done){h.u(4);break}s=u.value;S(h,5);o=s.scheme;f=s.value;switch(o){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":return h.u(7);case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":return h.u(8);case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":return l=Date.parse(f),h.return(isNaN(l)?0:l-Date.now());case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":Y("NTP UTCTiming scheme is not supported");break;default:Y("Unrecognized scheme in UTCTiming element",o)}h.u(9);break;case 7:return T(h,Ry(t,n,f,"HEAD"),10);case 10:return h.return(h.h);case 8:return T(h,Ry(t,n,f,"GET"),11);case 11:return h.return(h.h);case 9:I(h,3);break;case 5:M(h);case 3:u=a.next();h.u(2);break;case 4:return Y("A UTCTiming element should always be given in live manifests! This content may not play on clients with bad clocks!"),h.return(0)}}))}function Ly(t,n,e,i,r){var a=i.attributes.schemeIdUri||"",u=i.attributes.value||"",s=oe(i,"timescale",we)||1,o=oe(i,"presentationTimeOffset",we)||0;i=c(ee(i,"Event"));for(var f=i.next();!f.done;f=i.next()){f=f.value;var l=oe(f,"presentationTime",we)||0,h=oe(f,"duration",we)||0;l=Math.max((l-o)/s+n,n);h=l+h/s;null!=e&&(l=Math.min(l,n+e),h=Math.min(h,n+e));h<r||(f={schemeIdUri:a,value:u,startTime:l,endTime:h,id:f.attributes.id||"",timescale:s,eventElement:Ae(f),eventNode:Ie(f)},t.j.onTimelineRegionAdded(f))}}function Oy(t,n,e,i,r){var a,u,s,o;return _((function(f){if(1==f.g)return a=va,u=r?0:1,s=Nc(n,e,i,t.g.retryParameters),T(f,Uy(t,s,a,{type:u}),2);o=f.h;return f.return(o.data)}))}function _y(t,n){n=li(t,n);return Ai(n)?hn:t.split("/")[0]}function Uy(t,n,e,i){i||(i={});i.isPreload=t.oa();n=t.j.networkingEngine.request(e,n,i);ia(t.P,n);return n.promise}function By(t){var n=t.l.$d;if(!t.l.jf||!n||!t.G.length)return[];var e=Date.now()/1e3,i=t.G.filter((function(t){t=we(t.attributes.ttl);return!t||n+t>e})).map(re).filter(_i);return i.length?un(t.A,i):[]}q("shaka.dash.DashParser",ry);Hu("application/dash+xml",(function(){return new ry}));Hu("video/vnd.mpeg.dash.mpd",(function(){return new ry}));function Hy(){}q("shaka.dependencies",Hy);Hy.has=function(t){return zy.has(t)};Hy.add=function(t,n){if(!Vy[t])throw Error(t+" is not supported");t==Fy?vt("mux.js","mux.js is no longer used in Shaka Player."):zy.set(t,(function(){return n}))};var Fy="muxjs",Vy={wm:Fy,ISOBoxer:"ISOBoxer"};Hy.Allowed=Vy;var zy=new Map([["ISOBoxer",function(){return t.ISOBoxer}]]);function Xy(){this.j=new ot((function(){return["Oculus","Quest"].some((function(t){return navigator.userAgent.includes(t.toLowerCase())}))?"VR":navigator.userAgent.match(/Smart( ?|_)TV/i)||navigator.userAgent.match(/Android ?TV/i)?"TV":navigator.userAgentData?navigator.userAgentData.mobile?"MOBILE":"DESKTOP":/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)?"MOBILE":navigator.userAgentData&&navigator.userAgentData.platform?"android"==navigator.userAgentData.platform.toLowerCase()?"MOBILE":"DESKTOP":navigator.userAgent.includes("Android")?"MOBILE":"DESKTOP"}));this.l=new ot((function(){return navigator.vendor.includes("Apple")&&(navigator.userAgent.includes("Version/")||navigator.userAgent.includes("OS/"))?"WEBKIT":navigator.userAgent.includes("Edge/")?"EDGE":navigator.userAgent.includes("Chrome/")?"CHROMIUM":navigator.userAgent.includes("Firefox/")?"GECKO":"UNKNOWN"}))}function qy(){var n=t.ManagedMediaSource||t.MediaSource;return n&&n.isTypeSupported?true:false}i=Xy.prototype;i.bc=function(){return!!navigator.mediaCapabilities};i.La=function(){return this.j.value()};i.Da=function(){return this.l.value()};i.ce=function(){return false};i.zi=function(){return false};i.Ye=function(){return false};i.Ai=function(){return false};i.be=function(){return false};i.Zc=function(){return true};i.$c=function(){return true};i.ge=function(){return true};i.Fi=function(){return 0};i.fc=function(){return Promise.resolve({width:Infinity,height:Infinity})};i.Oi=function(){return false};i.lh=function(){return false};i.Sa=function(t){var n=this.La();if("TV"===n||"CONSOLE"===n||"CAST"===n)t.ads.customPlayheadTracker=true,t.ads.skipPlayDetection=true,t.ads.supportsMultipleMediaElements=false;return t};i.qh=function(){return!!t.indexedDB};i.wi=function(){return[]};function jy(n){ft();return void 0!==t.matchMedia&&t.matchMedia("(color-gamut: p3)").matches?n?"HLG":"PQ":"SDR"}i.Vi=function(){return false};i.ki=function(){return false};i.ah=function(){return false};i.ph=function(){return true};i.li=function(){return false};i.Ui=function(){return true};i.toString=function(){return"Device: "+this.Mb()+" v"+this.Ca()+"; Type: "+this.La()};function Gy(){Xy.call(this);this.g=new ot((function(){var t=navigator.userAgent.match(/Version\/(\d+)/);return t?parseInt(t[1],10):(t=navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(t[1],10):null}));this.h=new ot((function(){return/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||1<navigator.maxTouchPoints?"xr"in navigator?"APPLE_VR":"MOBILE":"xr"in navigator?"APPLE_VR":"DESKTOP"}))}g(Gy,Xy);i=Gy.prototype;i.Ca=function(){return this.g.value()};i.Mb=function(){return"Apple Browser"};i.La=function(){return this.h.value()};i.Da=function(){return"WEBKIT"};i.bc=function(){return false};i.ce=function(t,n){return"audio"===n};i.Ye=function(){return true};i.Ai=function(t){return"audio"===t};i.Sa=function(t){Xy.prototype.Sa.call(this,t);t.abr.minTimeToSwitch=.5;return t};i.Vi=function(){return true};(navigator.vendor||"").includes("Apple")&&(/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||1<navigator.maxTouchPoints||navigator.userAgentData&&navigator.userAgentData.platform&&"macos"==navigator.userAgentData.platform.toLowerCase()||navigator.platform&&navigator.platform.toLowerCase().includes("mac"))&&(ct=function(){return new Gy});function Ky(){if(!Wy())throw Error("Not a Chromecast device!");Xy.call(this);this.h=new ot((function(){var t=navigator.userAgent.match(/Chrome\/(\d+)/);return t?parseInt(t[1],10):null}));this.g=new ot((function(){var t=navigator.userAgentData&&navigator.userAgentData.platform||navigator.userAgent;t=t.toLowerCase();return t.includes("android")?$y:t.includes("fuchsia")?Yy:Qy}))}g(Ky,Xy);i=Ky.prototype;i.Ca=function(){return this.h.value()};i.Mb=function(){return"Chromecast with "+this.g.value()};i.La=function(){return"CAST"};i.Da=function(){return"CHROMIUM"};i.bc=function(){return Xy.prototype.bc.call(this)&&this.g.value()!==Qy};i.$c=function(){return this.g.value()!==Qy};i.Fi=function(){switch(this.g.value()){case $y:return 0;case Yy:return 3;default:return 1}};i.fc=function(){var n,e,i,r,a;return _((function(u){switch(u.g){case 1:n=t.cast&&cast.__platform__&&cast.__platform__.canDisplayType;e={width:1280,height:720};S(u,2);if(!(i=n)){u.u(4);break}return T(u,cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=3840; height=2160'),5);case 5:i=u.h;case 4:if(i){e.width=3840;e.height=2160;u.u(6);break}if(!(r=n)){u.u(7);break}return T(u,cast.__platform__.canDisplayType('video/mp4; codecs="avc1.640028"; width=1920; height=1080'),8);case 8:r=u.h;case 7:r&&(e.width=1920,e.height=1080);case 6:I(u,3);break;case 2:a=M(u),$("Failed to check canDisplayType:",a);case 3:return u.return(e)}}))};i.Sa=function(t){Xy.prototype.Sa.call(this,t);t.streaming.stallSkip=0;return t};i.qh=function(){return false};function Wy(){return navigator.userAgent.includes("CrKey")&&!navigator.userAgent.includes("VIZIO SmartCast")}var $y="Android",Yy="Fuchsia",Qy="Linux";Wy()&&(ct=function(){return new Ky});function Jy(){Xy.call(this);var t=this;this.i=new ot((function(){var t=navigator.userAgent.match(/(Chrome|Firefox)\/(\d+)/);return t?parseInt(t[2],10):null}));this.g=new ot((function(){return navigator.userAgent.match(/Edge?\//)?"Edge":navigator.userAgent.includes("Chrome")?"Chrome":navigator.userAgent.includes("Firefox")?"Firefox":"Unknown"}));this.h=new ot((function(){return navigator.userAgentData&&navigator.userAgentData.platform?"windows"==navigator.userAgentData.platform.toLowerCase():navigator.platform?navigator.platform.toLowerCase().includes("win32"):false}));this.o=new ot((function(){return navigator.userAgent.match(/Edge?\//)?!t.h.value():true}));this.m=new ot((function(){return navigator.userAgent.includes("sony.hbbtv.tv")}))}g(Jy,Xy);i=Jy.prototype;i.Ca=function(){return this.i.value()};i.Mb=function(){return this.g.value()};i.ce=function(t){return _r(t)?"Edge"===this.g.value()&&this.h.value():false};i.zi=function(){return"Edge"===this.g.value()&&this.h.value()};i.Ye=function(){return"Edge"===this.g.value()&&this.h.value()};i.$c=function(){return this.o.value()};i.Sa=function(t){Xy.prototype.Sa.call(this,t);if(this.h.value())switch(this.g.value()){case"Firefox":t.drm.keySystemsMapping={"com.microsoft.playready":"com.microsoft.playready.recommendation"};break;case"Chrome":t.drm.keySystemsMapping={"com.microsoft.playready":"com.microsoft.playready.recommendation.3000","com.microsoft.playready.recommendation":"com.microsoft.playready.recommendation.3000"}}return t};i.ah=function(){return"Edge"===this.g.value()||this.m.value()};lt=function(){return new Jy};function Zy(){Xy.apply(this,arguments)}g(Zy,Xy);i=Zy.prototype;i.Ca=function(){return null};i.Mb=function(){return"Hisense"};i.La=function(){return"TV"};i.bc=function(){return false};i.fc=function(){var n={width:1920,height:1080},e=null;if(t.Hisense_Get4KSupportState)try{e=t.Hisense_Get4KSupportState()}catch(t){}null==e&&(e=navigator.userAgent.includes("UHD"));e&&(n.width=3840,n.height=2160);return Promise.resolve(n)};i.Sa=function(t){Xy.prototype.Sa.call(this,t);t.streaming.stallSkip=0;return t};if(navigator.userAgent.includes("Hisense")||navigator.userAgent.includes("VIDAA"))ct=function(){return new Zy};function tk(){Xy.call(this);this.g=new ot((function(){var t=navigator.userAgent.match(/PlayStation (\d+)/);return t?parseInt(t[1],10):null}))}g(tk,Xy);i=tk.prototype;i.Mb=function(){return"PlayStation"};i.La=function(){return"CONSOLE"};i.Da=function(){return"WEBKIT"};i.Ca=function(){return this.g.value()};i.bc=function(){return false};i.Zc=function(){return false};i.$c=function(){return false};i.lh=function(){return 4===this.Ca()};i.fc=function(){var n,e,i,r,a;return _((function(u){switch(u.g){case 1:return n={width:1920,height:1080},e=false,S(u,2),T(u,t.msdk.device.getDisplayInfo(),4);case 4:i=u.h;e="4K"===i.resolution;I(u,3);break;case 2:return M(u),S(u,5),T(u,t.msdk.device.getDisplayInfoImmediate(),7);case 7:r=u.h;e="4K"===r.resolution;I(u,3);break;case 5:a=M(u),Y("PlayStation: Failed to get the display info:",a);case 3:return e&&(n.width=3840,n.height=2160),u.return(n)}}))};i.Sa=function(t){Xy.prototype.Sa.call(this,t);4===this.Ca()&&t.drm.preferredKeySystems.push("com.microsoft.playready");t.streaming.clearDecodingCache=true;return t};i.ah=function(){return 4===this.Ca()};i.ph=function(){return 4!==this.Ca()};navigator.userAgent.includes("PlayStation")&&(ct=function(){return new tk});function nk(){Xy.call(this);var t=navigator.userAgent.match(/Tizen (\d+).(\d+)/);this.g=t?parseInt(t[1],10):null;this.h=t?parseInt(t[2],10):null}g(nk,Xy);i=nk.prototype;i.Ca=function(){return this.g};i.Mb=function(){return"Tizen"};i.Da=function(){return"CHROMIUM"};i.La=function(){return"TV"};i.ce=function(){return true};i.be=function(){return 3===this.Ca()};i.bc=function(){return false};i.Zc=function(){var t=this.Ca();return null!==t?4<=t:Xy.prototype.Zc.call(this)};i.$c=function(){return false};i.ge=function(){return this.g&&this.h?5===this.g?5<=this.h:5<this.g:Xy.prototype.ge.call(this)};i.fc=function(){var n=t.devicePixelRatio;n={width:1920<t.screen.width*n?3840:1920,height:1080<t.screen.height*n?2160:1080};try{if(webapis.systeminfo&&webapis.systeminfo.getMaxVideoResolution){var e=webapis.systeminfo.getMaxVideoResolution();n.width=e.width;n.height=e.height}else webapis.productinfo.is8KPanelSupported&&webapis.productinfo.is8KPanelSupported()?(n.width=7680,n.height=4320):webapis.productinfo.isUdPanelSupported&&webapis.productinfo.isUdPanelSupported()&&(n.width=3840,n.height=2160)}catch(t){Y("Tizen: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(n)};i.Sa=function(t){Xy.prototype.Sa.call(this,t);t.drm.ignoreDuplicateInitData=2!==this.Ca();3===this.Ca()&&(t.streaming.crossBoundaryStrategy="reset");t.streaming.shouldFixTimestampOffset=true;t.streaming.stallSkip=0;t.streaming.gapPadding=2;return t};i.wi=function(){var t=[];null!==this.g&&5>this.g&&t.push("opus");return t};i.ki=function(){return true};i.li=function(){return 3===this.Ca()};navigator.userAgent.includes("Tizen")&&(ct=function(){return new nk});function ek(){Xy.apply(this,arguments)}g(ek,Xy);ek.prototype.Ca=function(){return null};ek.prototype.Mb=function(){return"Vizio"};ek.prototype.La=function(){return"TV"};ek.prototype.bc=function(){return false};navigator.userAgent.includes("VIZIO SmartCast")&&(ct=function(){return new ek});function ik(){Xy.call(this);this.h=new ot((function(){return navigator.userAgent.includes("DT_STB_BCM")}));this.g=new ot((function(){if(navigator.userAgent.includes("DT_STB_BCM"))return 11;var t=navigator.userAgent.match(/Version\/(\d+)/);return t?parseInt(t[1],10):(t=navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(t[1],10):null}))}g(ik,Xy);i=ik.prototype;i.Ca=function(){return this.g.value()};i.Mb=function(){return"WebKit STB"};i.La=function(){return"TV"};i.Da=function(){return"WEBKIT"};i.bc=function(){return false};i.Zc=function(){var t=this.g.value();return null!==t?15<=t:true};i.fc=function(){return Promise.resolve({width:t.screen.width*t.devicePixelRatio,height:t.screen.height*t.devicePixelRatio})};i.ph=function(){return!this.h.value()};if(navigator.userAgent.includes("DT_STB_BCM")||navigator.userAgent.includes("DT_STB_BCM")||!(!(navigator.vendor||"").includes("Apple")||/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||1<navigator.maxTouchPoints||navigator.userAgentData&&navigator.userAgentData.platform&&"macos"==navigator.userAgentData.platform.toLowerCase()||navigator.platform&&navigator.platform.toLowerCase().includes("mac")))ct=function(){return new ik};function rk(){Xy.call(this);this.g=ak()}g(rk,Xy);i=rk.prototype;i.Ca=function(){return this.g};i.Mb=function(){return"WebOS"};i.La=function(){return"TV"};i.Da=function(){return"CHROMIUM"};i.bc=function(){return false};i.Zc=function(){var t=this.Ca();return null!==t?3<t:Xy.prototype.Zc.call(this)};i.$c=function(){var t=this.Ca();return null!==t?6<t:Xy.prototype.$c.call(this)};i.ge=function(){var t=this.Ca();return null!==t?3<t:Xy.prototype.ge.call(this)};i.fc=function(){var n={width:1920,height:1080};try{var e=JSON.parse(t.PalmSystem.deviceInfo);n.width=Math.max(1920,e.screenWidth);n.height=Math.max(1080,e.screenHeight)}catch(t){Y("WebOS: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(n)};i.Sa=function(t){Xy.prototype.Sa.call(this,t);3===this.Ca()&&(t.streaming.crossBoundaryStrategy="reset");t.streaming.shouldFixTimestampOffset=true;t.streaming.stallSkip=0;return t};function ak(){var t=null,n=navigator.userAgent.match(/Chrome\/(\d+)/);n&&(t=parseInt(n[1],10));switch(t){case 38:return 3;case 53:return 4;case 68:return 5;case 79:return 6;case 87:return 22;case 94:return 23;case 108:return 24;case 120:return 25;default:return null}}i.Ui=function(){return false};navigator.userAgent.includes("Web0S")&&(ct=function(){return new rk});function uk(){Xy.call(this);this.g=navigator.userAgent.includes("Edge/");var t=navigator.userAgent.match(/Edge?\/(\d+)/);this.h=t?parseInt(t[1],10):null}g(uk,Xy);i=uk.prototype;i.Ca=function(){return this.h};i.Mb=function(){return"Xbox"};i.La=function(){return"CONSOLE"};i.Da=function(){return this.g?"EDGE":"CHROMIUM"};i.ce=function(){return true};i.Ye=function(){return true};i.Oi=function(){return this.g};i.fc=function(){var t={width:1920,height:1080},n=sk();if(n)try{var e=new n.Media.Protection.ProtectionCapabilities,i=n.Media.Protection.ProtectionCapabilityResult;n=null;do{n=e.isTypeSupported('video/mp4;codecs="hvc1,mp4a";features="decode-res-x=3840,decode-res-y=2160,decode-bitrate=20000,decode-fps=30,decode-bpc=10,display-res-x=3840,display-res-y=2160,display-bpc=8"',"com.microsoft.playready.recommendation")}while(n===i.maybe);n===i.probably&&(t.width=3840,t.height=2160)}catch(t){Y("Xbox: Error detecting screen size, default screen size 1920x1080.")}return Promise.resolve(t)};i.Sa=function(t){Xy.prototype.Sa.call(this,t);t.drm.parseInbandPsshEnabled=this.g;t.drm.preferredKeySystems.push("com.microsoft.playready");this.g&&(t.streaming.gapPadding=.01);return t};i.qh=function(){return false};function sk(){var t=null;try{t="undefined"!==typeof Windows?Windows:chrome.webview.hostObjects.sync.Windows}catch(t){}return t}if(navigator.userAgent.includes("Xbox One")||null!==sk())ct=function(){return new uk};function ok(t,n,e){this.type=t;this.aa=n;this.segments=e||null}function fk(t,n,e,i){this.id=t;this.name=n;this.attributes=e;this.value=void 0===i?null:i}fk.prototype.toString=function(t){function n(t){return t.name+"="+(isNaN(Number(t.value))?'"'+t.value+'"':t.value)}var e="#"+this.name,i=this.attributes?this.attributes.filter((function(n){return t?!t.has(n.name):true})).map(n):[];this.value&&i.unshift(this.value);0<i.length&&(e+=":"+i.join(","));return e};function ck(t,n){if(n)return t.toString();n=(new Set).add("AUDIO").add("VIDEO").add("SUBTITLES").add("PATHWAY-ID").add("GROUP-ID").add("URI");return t.toString(n)}function lk(t,n){t=t.attributes.filter((function(t){return t.name==n}));return t.length?t[0]:null}function hk(t,n,e){return(t=lk(t,n))?t.value:e||null}function dk(t,n){t=lk(t,n);if(!t)throw new zt(2,4,4023,n);return t.value}function vk(t,n,e){e=void 0===e?[]:e;this.aa=n;this.g=t;this.rc=e}function pk(t,n){this.name=t;this.value=n}function mk(t,n){return t.filter((function(t){return t.name==n}))}function wk(t,n){return t.filter((function(t){return dk(t,"TYPE")==n}))}function gk(t,n){t=c(t);for(var e=t.next();!e.done;e=t.next())if(e=e.value,e.name===n)return e;return null}function bk(t,n,e){e=void 0===e?0:e;return(t=gk(t,n))?Number(t.value):e}function yk(t,n,e){return n?kk(t,[n],e):[]}function kk(t,n,e){if(!n.length)return[];var i=n;e&&e.size&&(i=n.map((function(t){return Tk(t,e)})));return un(t,i)}function Tk(t,n){if(!n||!n.size)return t;t=String(t).replace(/%7B/g,"{").replace(/%7D/g,"}");var e=t.match(/{\$\w*}/g);if(e){e=c(e);for(var i=e.next();!i.done;i=e.next()){i=i.value;var r=i.slice(2,i.length-1),a=n.get(r);if(a)t=t.replace(i,a);else throw new zt(2,4,4039,r)}}return t}function Ek(){this.g=0}function Sk(t,n){n=qt(n);n=n.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n").trim();var e=n.split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(e[0]))throw new zt(2,4,4015);n=0;for(var i=true,r=c(e),a=r.next();!a.done;a=r.next())if(a=a.value,/^#(?!EXT)/m.test(a)||i)i=false;else if(a=Ak(t,a),--t.g,Ik.includes(a.name)){n=1;break}else"EXT-X-STREAM-INF"==a.name&&(i=true);r=[];i=true;for(a=0;a<e.length;a++){var u=e[a],s=e[a+1];if(/^#(?!EXT)/m.test(u)||i)i=false;else{u=Ak(t,u);if(Mk.includes(u.name)){if(1!=n)throw new zt(2,4,4017);u=e.splice(a,e.length-a);e=[];i=[];a=[];s=null;u=c(u);for(var o=u.next();!o.done;o=u.next())o=o.value,/^(#EXT)/.test(o)?(o=Ak(t,o),Ik.includes(o.name)?r.push(o):"EXT-X-MAP"==o.name?s=o:"EXT-X-PART"==o.name?a.push(o):"EXT-X-PRELOAD-HINT"==o.name?"PART"==hk(o,"TYPE")?a.push(o):"MAP"==hk(o,"TYPE")&&(o.name="EXT-X-MAP",s=o):i.push(o)):/^#(?!EXT)/m.test(o)||(o=o.trim(),s&&i.push(s),e.push(new vk(o,i,a)),i=[],a=[]);a.length&&(s&&i.push(s),e.push(new vk("",i,a)));return new ok(n,r,e)}r.push(u);"EXT-X-STREAM-INF"==u.name&&(u.attributes.push(new pk("URI",s)),i=true)}}return new ok(n,r)}function Ak(t,n){t=t.g++;var e=n.match(/^#(EXT[^:]*)(?::(.*))?$/);if(!e)throw new zt(2,4,4016,n);n=e[1];var i=e[2];e=[];var r;if(i){i=new Hn(i);var a;(a=Vn(i,/^([^,=]+)(?:,|$)/g))&&(r=a[1]);for(var u=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g;a=Vn(i,u);)e.push(new pk(a[1],a[2]||a[3])),Fn(i)}return new fk(t,n,e,r)}var Ik="EXT-X-TARGETDURATION EXT-X-MEDIA-SEQUENCE EXT-X-DISCONTINUITY-SEQUENCE EXT-X-PLAYLIST-TYPE EXT-X-I-FRAMES-ONLY EXT-X-ENDLIST EXT-X-SERVER-CONTROL EXT-X-SKIP EXT-X-PART-INF EXT-X-DATERANGE".split(" "),Mk="EXTINF EXT-X-BYTERANGE EXT-X-DISCONTINUITY EXT-X-PROGRAM-DATE-TIME EXT-X-KEY EXT-X-DATERANGE EXT-X-MAP EXT-X-GAP EXT-X-TILES".split(" ");function xk(){}function Nk(t,n){try{var e=Ck(t);return Wr({uri:t,originalUri:t,data:e.data,headers:{"content-type":e.contentType},originalRequest:n})}catch(t){return Gr(t)}}function Ck(n){var e=n.split(":");if(2>e.length||"data"!=e[0])throw new zt(2,1,1004,n);e=e.slice(1).join(":").split(",");if(2>e.length)throw new zt(2,1,1004,n);var i=e[0];n=t.decodeURIComponent(e.slice(1).join(","));e=i.split(";");i=e[0];var r=false;1<e.length&&"base64"==e[e.length-1]&&(r=true,e.pop());var a;r?a=nn(n):a=Kt(n);return{data:a,contentType:i}}q("shaka.net.DataUriPlugin",xk);xk.parse=Nk;aa("data",Nk);function Pk(){var t=this;this.g=this.h=null;this.G=1;this.A=new Map;this.K=new Map;this.B=new Map;this.B.set("video",new Map);this.B.set("audio",new Map);this.B.set(hn,new Map);this.B.set("image",new Map);this.Yb=(new Map).set("com.apple.streamingkeydelivery",(function(n,e,i){return BT(t,n,e,i)})).set("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",(function(t){var n=dk(t,"METHOD");if(["SAMPLE-AES","SAMPLE-AES-CTR"].includes(n)){var e="cenc";"SAMPLE-AES"==n&&(e="cbcs");n=dk(t,"URI");n=Ck(n.split("?")[0]);n=Bt(n.data);e=sn("com.widevine.alpha",e,[{initDataType:"cenc",initData:n}]);(t=hk(t,"KEYID"))&&e.keyIds.add(t.toLowerCase().substr(2));t=Promise.resolve(e)}else t=Promise.resolve(null);return t})).set("com.microsoft.playready",(function(t){var n=dk(t,"METHOD");if(["SAMPLE-AES","SAMPLE-AES-CTR"].includes(n)){var e="cenc";"SAMPLE-AES"==n&&(e="cbcs");t=dk(t,"URI");t=Ck(t.split("?")[0]);t=Bt(t.data);n=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);n=Ba(t,n,new Set,0);e=sn("com.microsoft.playready",e,[{initDataType:"cenc",initData:n}]);if(t=Qn(["<PLAYREADY>",tn(t),"</PLAYREADY>"].join("\n")))e.licenseServerUri=mg(t);e=Promise.resolve(e)}else e=Promise.resolve(null);return e})).set("urn:uuid:3d5e6d35-9b9a-41e8-b843-dd3c6e72c42c",(function(t){var n=dk(t,"METHOD");if(["SAMPLE-AES","SAMPLE-AES-CTR"].includes(n)){var e="cenc";"SAMPLE-AES"==n&&(e="cbcs");n=dk(t,"URI");n=Ck(n.split("?")[0]);n=Bt(n.data);e=sn("com.huawei.wiseplay",e,[{initDataType:"cenc",initData:n}]);(t=hk(t,"KEYID"))&&e.keyIds.add(t.toLowerCase().substr(2));t=Promise.resolve(e)}else t=Promise.resolve(null);return t}));this.ab=new Set;this.i=new Map;this.l=null;this.F="";this.Oa=new Ek;this.L=-1;this.ia=Infinity;this.ba=this.qc=this.Za=false;this.C=new Di((function(){if(t.U&&!t.g.continueLoadingWhenPaused&&(t.S.Ja(t.U,"timeupdate"),t.U.paused)){t.S.za(t.U,"timeupdate",(function(){return DT(t)}));return}DT(t)}));this.Ba=WT;this.m=null;this.Ta=0;this.o=Infinity;this.Xa=this.Ka=this.P=0;this.W=new ea;this.H=new Map;this.I=new Map;this.ya=new Map;this.oa=new Map;this.M=new Map;this.va=new Map;this.wa=new Map;this.nc=this.ka=false;this.eb=new j(5);this.j=null;this.N=true;this.S=new it;this.s=this.U=null;this.Xb=function(){return false}}i=Pk.prototype;i.configure=function(t,n){var e=this.h&&t.updatePeriod!=this.g.updatePeriod&&0<=t.updatePeriod;this.g=t;n&&(this.Xb=n);this.j&&this.j.configure(this.g);e&&this.m&&this.m.presentationTimeline.V()&&this.C.Hb()};i.start=function(t,n){var e=this,i;return _((function(r){return 1==r.g?(e.h=n,e.ka=n.isLowLatencyMode(),T(r,RT(e,[t]).promise,2)):3!=r.g?(i=r.h,e.F=i.uri,T(r,Uk(e,i.data),3)):r.return(e.m)}))};i.stop=function(){this.C&&(this.C.stop(),this.C=null);var t=[];this.W&&(t.push(this.W.destroy()),this.W=null);this.g=this.h=null;this.ab.clear();this.m=null;this.i.clear();this.K.clear();this.I.clear();this.A.clear();this.ya.clear();this.oa.clear();this.M.clear();this.va.clear();this.wa.clear();this.j&&this.j.destroy();this.S&&(this.S.release(),this.S=null);return Promise.all(t)};i.update=function(){var t=this,n,e,i,r,a,u,s,o,f,h,d,v;return _((function(p){if(1==p.g){if(!LT(t))return p.return();n=[];e=Array.from(t.i.values());t.o=Infinity;t.m.gapCount=0;i=e.filter((function(t){return t.stream.segmentIndex}));r=c(i);for(a=r.next();!a.done;a=r.next())u=a.value,n.push(Dk(t,u));return T(p,Promise.all(n),2)}oT(t,i.map((function(t){return t.stream})));s=i.some((function(t){return 0==t.Pd}));i.length&&!s&&(o=QT,OT(t,o.bj),f=i.map((function(t){return t.lc})),t.l.ob(Math.min.apply(Math,l(f))),t.h.updateDuration());s&&Fk(t);h=c(i);for(d=h.next();!d.done;d=h.next())v=d.value,v.stream.isAudioMuxedInVideo||!v.stream.segmentIndex||Gf(v.stream.segmentIndex)||t.h.disableStream(v.stream);E(p)}))};function Rk(t,n){return LT(t)?t.B.get(n.type):n.ef}function Dk(t,n){var e,i,r,a,u,s,o,f,h,d,v,p,m,w,g,b,y,k,A,x,N,C,P,R,D,L,O,U,B,H,F,V,z,X,q,j;return _((function(_){switch(_.g){case 1:if(n.stream.isAudioMuxedInVideo)return _.return();e=[];i=c(n.O());for(r=i.next();!r.done;r=i.next())a=r.value,u=new bt(a),s=u.g,n.Ke&&(0<=n.Qb&&s.add("_HLS_msn",String(n.Qb)),0<=n.Rb&&s.add("_HLS_part",String(n.Rb))),n.Le&&s.add("_HLS_skip","YES"),Lt(s)&&Et(u,St(s.toString())),e.push(u.toString());S(_,2);return T(_,RT(t,e,true).promise,4);case 4:o=_.h;I(_,3);break;case 2:throw f=M(_),t.h&&t.h.disableStream(n.stream),f;case 3:if(!n.stream.segmentIndex)return _.return();h=Sk(t.Oa,o.data);if(1!=h.type)throw new zt(2,4,4017);d=o.uri;d==o.originalUri||n.O().includes(d)||n.wf.push(d);v=mk(h.aa,"EXT-X-DEFINE");p=zk(t,v,d);m=n.stream;w=Rk(t,n);return T(_,pT(t,h,m.mimeType,n.O,p),5);case 5:g=_.h;b=g.keyIds;y=g.drmInfos;k=g.encrypted;A=g.Fh;m.encrypted||!k||A||(m.encrypted=true);x=function(t,n){return t.size===n.size&&[].concat(l(t)).every((function(t){return n.has(t)}))};x(m.keyIds,b)||(m.keyIds=b,m.drmInfos=y,t.h.newDrmInfo(m));N=IT(t,h,w,p,n.O,n.type);C=N.segments;if(P=N.bandwidth)m.bandwidth=P;R=sc(m);D=c(C);for(L=D.next();!L.done;L=D.next())O=L.value,O.Y&&(O.Y.od=R);m.segmentIndex.Wd(C,t.l.Fb());C.length&&(U=bk(h.aa,"EXT-X-MEDIA-SEQUENCE",0),H=(B=gk(h.aa,"EXT-X-SKIP"))?Number(hk(B,"SKIPPED-SEGMENTS")):0,F=dT(U,C),V=F.Qb,z=F.Rb,n.Qb=V+H,n.Rb=z,X=w.get(U),m.segmentIndex.$a(X));if(q=Gf(m.segmentIndex))n.Tc=q.startTime,j=C[C.length-1],n.lc=j.endTime;if(gk(h.aa,"EXT-X-ENDLIST"))n.Pd=true;bT(t,h);AT(t,h.aa,m.type,p,n.O);E(_)}}))}i.onExpirationUpdated=function(){};i.onInitialVariantChosen=function(){};i.banLocation=function(t){this.j&&this.j.banLocation(t)};i.setMediaElement=function(t){this.U=t};function Lk(t,n,e){e=void 0===e?false:e;for(var i=-1==t.L,r=c(n),a=r.next();!a.done;a=r.next()){a=a.value;var u=a.stream.segmentIndex,s=Rk(t,a);if(u=Gf(u)){s=c(s);for(var o=s.next();!o.done;o=s.next()){o=c(o.value);var f=o.next().value;if(o.next().value==u.startTime){i&&(t.L=Math.max(t.L,f));a.kg=f;break}}}}if(!(0>t.L))for(n=c(n),i=n.next();!i.done;i=n.next())if(i=i.value,cT(t,i.type)||e)if(r=i.stream.segmentIndex)if(a=t.L-i.kg,0<a&&(r.g.splice(0,a),r=Gf(r)))r=-r.startTime,i.stream.segmentIndex.offset(r),_k(t,i,r)}function Ok(t,n){if(Infinity==t.ia){n=c(n);for(var e=n.next();!e.done;e=n.next())e=Gf(e.value.stream.segmentIndex),null!=e&&null!=e.h&&(t.ia=Math.min(t.ia,e.h))}n=t.ia;if(Infinity!=n){e=c(t.i.values());for(var i=e.next();!i.done;i=e.next())if(i=i.value,!cT(t,i.type)){var r=i.stream.segmentIndex;if(null!=r){var a=Gf(r);if(a)if(null==a.h)$("Missing EXT-X-PROGRAM-DATE-TIME for stream",i.O(),"Expect AV sync issues!");else for(_k(t,i,a.h-n-a.startTime),i=c(r),r=i.next();!r.done;r=i.next())r.value.rh(n)}}}}function _k(t,n,e){if(!(.001>Math.abs(e))){n.Tc+=e;n.lc+=e;t=Rk(t,n);for(var i=c(t),r=i.next();!r.done;r=i.next()){var a=c(r.value);r=a.next().value;a=a.next().value;t.set(r,a+e)}n.O()}}function Uk(t,n){var e,i,r,a,u,s,o,f,h,d,v,p,m,w,g,b,y,k,S,A,I,M,x,N,C,P,R,D,L,O,U,B,H,F,V,z,X,q,j,G,K,W,$;return _((function(_){switch(_.g){case 1:e=dn;i=Sk(t.Oa,n);r=mk(i.aa,"EXT-X-DEFINE");a=[];u=[];s=[];t.l=new kf(null,0);t.l.Yc(true);o=function(){return[t.F]};f=null;h=new Map;if(1==i.type)return t.N=false,B=mk(i.aa,"EXT-X-DEFINE"),h=zk(t,B,t.F),f=e.xa,H="",F=new Map,T(_,hT(t,t.G++,h,i,o,"",f,H,true,"Media Playlist",null,F,null,false,null,false),7);Vk(t,r);d=mk(i.aa,"EXT-X-MEDIA");v=mk(i.aa,"EXT-X-STREAM-INF");p=mk(i.aa,"EXT-X-IMAGE-STREAM-INF");m=mk(i.aa,"EXT-X-I-FRAME-STREAM-INF");w=mk(i.aa,"EXT-X-SESSION-KEY");g=mk(i.aa,"EXT-X-SESSION-DATA");b=mk(i.aa,"EXT-X-CONTENT-STEERING");qk(t,g);return T(_,jk(t,b),4);case 4:if(!t.g.ignoreSupplementalCodecs){y=[];k=c(v);S=k.next();for(A={};!S.done;A={Si:void 0},S=k.next())if(I=S.value,M=hk(I,"SUPPLEMENTAL-CODECS"))A.Si=M.split(/\s*,\s*/).map((function(t){return t.split("/")[0]})),x=I.attributes.map(function(t){return function(n){var e=n.name,i=n.value;"CODECS"==e&&(i=t.Si.join(","),n=n.value.split(","),1<n.length&&(n=cn("audio",n))&&(i+=","+n));return new pk(e,i)}}(A)),y.push(new fk(I.id,I.name,x,null));v.push.apply(v,l(y));N=[];C=c(m);P=C.next();for(R={};!P.done;R={Ti:void 0},P=C.next())if(D=P.value,L=hk(D,"SUPPLEMENTAL-CODECS"))R.Ti=L.split(/\s*,\s*/).map((function(t){return t.split("/")[0]})),O=D.attributes.map(function(t){return function(n){var e=n.name;n=n.value;"CODECS"==e&&(n=t.Ti.join(","));return new pk(e,n)}}(R)),N.push(new fk(D.id,D.name,O,null));m.push.apply(m,l(N))}Xk(t,v);nT(t,d);U=Yk(t,m);return T(_,Qk(t,v,w,d,o,t.A,U),5);case 5:return a=_.h,u=Gk(t,d),T(_,Wk(t,p,m),6);case 6:s=_.h;_.u(3);break;case 7:V=_.h,t.i.set(t.F,V),V.stream&&(z=sc(V.stream),V.stream.segmentIndex.Db((function(t){t.Y&&(t.Y.od=z)}))),f=V.stream.type,X=true,t.g.disableAudio&&"audio"==V.type?X=false:t.g.disableVideo&&"video"==V.type&&!V.stream.codecs.includes(",")&&(X=false),X&&a.push({id:0,language:zi(H||"und"),disabledUntilTime:0,primary:true,audio:"audio"==V.type?V.stream:null,video:"video"==V.type?V.stream:null,bandwidth:V.stream.bandwidth||0,allowedByApplication:true,allowedByKeySystem:true,decodingInfos:[]});case 3:if(!t.h)throw new zt(2,7,7001);wT(t,i);1==i.type&&(LT(t)&&(yT(t,i),q=t.o,t.C.ha(q)),j=Array.from(t.i.values()),fT(t,j),Fk(t),AT(t,i.aa,f,h,o));t.m={presentationTimeline:t.l,variants:a,textStreams:u,imageStreams:s,offlineSessionIds:[],sequenceMode:t.g.hls.sequenceMode,ignoreManifestTimestampsInSegmentsMode:t.g.hls.ignoreManifestTimestampsInSegmentsMode,type:"HLS",serviceDescription:null,nextUrl:null,periodCount:1,gapCount:0,isLowLatency:false,startTime:t.s};if(t.ba||!t.g.hls.disableCodecGuessing){_.u(8);break}G=[];K=c(t.m.variants);for(W=K.next();!W.done;W=K.next())$=W.value,$.audio&&""===$.audio.codecs&&G.push($.audio.createSegmentIndex()),$.video&&""===$.video.codecs&&G.push($.video.createSegmentIndex());return T(_,Promise.all(G),8);case 8:t.h.makeTextStreamsForClosedCaptions(t.m),E(_)}}))}function Bk(t,n){var e,i,r,a,u,s,o,f,l,h,d,v,p,m,w,g,b,y;return _((function(k){if(1==k.g){e=Ec(t.g.hls.mediaPlaylistFullMimeType);if(!n.length)return k.return(e);i=NT(t,n);r=i.segment;a=i.segmentIndex;u=r.O();s=u[0];o=new bt(s);f=o.mb.split(".").pop();return(l=VT.get(f))?k.return(Ec(l)):T(k,Promise.all([Hk(t,r.Y,0),Hk(t,r,a)]),2)}h=k.h;d=h[1].mimeType;v=h[0].data;p=h[1].data;m="mp4 mp4a m4s m4i m4a m4f cmfa mp4v m4v cmfv fmp4".split(" ");w=["audio/mp4","video/mp4","video/iso.segment"];g=r.Y||w.includes(d);if(!g&&Ao(Bt(p))){var E=p,S=t.g.disableAudio,A=t.g.disableVideo,I=t.g.disableText;var M=Bt(E);var x=(new bo).parse(M),N=x.Md();M=x.Eg();var C=[],P=false,R=false;if(!S)switch(N.audio){case"aac":case"aac-loas":x.rb().length&&(C.push("mp4a.40.2"),P=true);break;case"mp3":x.rb().length&&(C.push("mp4a.40.34"),P=true);break;case"ac3":x.rb().length&&(C.push("ac-3"),P=true);break;case"ec3":x.rb().length&&(C.push("ec-3"),P=true);break;case"opus":x.rb().length&&(C.push("opus"),P=true)}if(!A)switch(N.video){case"avc":M.codec?C.push(M.codec):C.push("avc1.42E01E");R=true;break;case"hvc":M.codec?C.push(M.codec):C.push("hvc1.1.6.L93.90");R=true;break;case"av1":C.push("av01.0.01M.08"),R=true}if(C.length){S=P&&!R;A=new Map;if(R&&!I){I=new Mn("video/mp2t");I.rf(E);E=c(I.Qf());for(R=E.next();!R.done;R=E.next())R=R.value,A.set(R,R);I.Cd()}M={type:S?"audio":"video",mimeType:"video/mp2t",codecs:C.join(", "),language:null,height:M.height,width:M.width,channelCount:null,sampleRate:null,closedCaptions:A,le:null,colorGamut:null,frameRate:M.frameRate}}else M=null;if(b=M)return k.return(b)}else if(g||m.includes(f))if(y=Sc(v,p,t.g.disableText))return k.return(y);return d?k.return(Ec(d)):k.return(e)}))}function Hk(t,n,e){var i,r,a,u,s,o;return _((function(f){switch(f.g){case 1:if(!n)return f.return({mimeType:null,data:null});i=va;r=Nc(n.O(),n.Ac(),n.yc(),t.g.retryParameters);a=n instanceof Ls?1:0;return T(f,_T(t,r,i,{type:a}).promise,2);case 2:u=f.h;s=u.data;if(!n.aesKey){f.u(3);break}return T(f,xc(s,n.aesKey,e),4);case 4:s=f.h;case 3:return n instanceof Ls?n.ee(s,true):n.ee(s),(o=u.headers["content-type"])&&(o=o.split(";")[0].toLowerCase()),f.return({mimeType:o,data:s})}}))}function Fk(t){if(LT(t)){if(t.Ba==YT){for(var n=Infinity,e=Infinity,i=c(t.i.values()),r=i.next();!r.done;r=i.next())r=r.value,r.stream.segmentIndex&&"text"!=r.stream.type&&!r.stream.isAudioMuxedInVideo&&(n=Math.min(n,r.lc),e=Math.min(e,r.Tc));n=n-e||0;isNaN(t.g.availabilityWindowOverride)||(n=t.g.availabilityWindowOverride);t.l.Df(n)}}else t.l.ob(sT(t));if(!t.l.o)for(n=c(t.i.values()),e=n.next();!e.done;e=n.next())e=e.value,!e.stream.segmentIndex||"audio"!=e.type&&"video"!=e.type||(e=Gf(e.stream.segmentIndex))&&e.h&&t.l.ih(e.h);t.l.df()}function Vk(t,n){var e=new bt(t.F).g;n=c(n);for(var i=n.next();!i.done;i=n.next()){var r=i.value;i=hk(r,"NAME");var a=hk(r,"VALUE");r=hk(r,"QUERYPARAM");i&&a&&(t.A.has(i)||t.A.set(i,a));r&&(i=e.get(r)[0])&&!t.A.has(i)&&t.A.set(r,i)}}function zk(t,n,e){e=new bt(e).g;var i=new Map;n=c(n);for(var r=n.next();!r.done;r=n.next()){var a=r.value,u=hk(a,"NAME"),s=hk(a,"VALUE");r=hk(a,"QUERYPARAM");a=hk(a,"IMPORT");u&&s&&(i.has(u)||i.set(u,s));r&&(u=e.get(r)[0])&&!i.has(u)&&i.set(r,u);a&&(r=t.A.get(a))&&i.set(a,r)}return i}function Xk(t,n){n=c(n);for(var e=n.next();!e.done;e=n.next()){var i=e.value,r=hk(i,"AUDIO");e=hk(i,"VIDEO");var a=hk(i,"SUBTITLES");i=Zk(t,i);if(a){var u=cn(hn,i);t.I.set(a,u);_n(i,u)}r&&(a=cn("audio",i),a||(a=t.g.hls.defaultAudioCodec),t.I.set(r,a));e&&(r=cn("video",i),r||(r=t.g.hls.defaultVideoCodec),t.I.set(e,r))}}function qk(t,n){n=c(n);for(var e=n.next();!e.done;e=n.next()){var i=e.value,r=hk(i,"DATA-ID");e=hk(i,"URI");var a=hk(i,"LANGUAGE");i=hk(i,"VALUE");r=(new Map).set("id",r);e&&r.set("uri",yk([t.F],e,t.A)[0]);a&&r.set("language",a);i&&r.set("value",i);e=new Jr("sessiondata",r);if(t.h)t.h.onEvent(e)}}function jk(t,n){var e,i,r,a,u,s;return _((function(o){if(!t.h||!t.g)return o.return();i=c(n);for(r=i.next();!r.done;r=i.next())if(a=r.value,u=hk(a,"PATHWAY-ID"),s=hk(a,"SERVER-URI"),u&&s){t.j=new db(t.h);t.j.configure(t.g);t.j.i=[t.F];t.j.setManifestType("HLS");t.j.h=u;e=vb(t.j,s);break}return T(o,e,0)}))}function Gk(t,n){var e=wk(n,"SUBTITLES");n=e.map((function(n){if(t.g.disableText)return null;try{return eT(t,[n],new Map).stream}catch(n){if(t.g.hls.ignoreTextStreamFailures)return null;throw n}}));e=c(e);for(var i=e.next();!i.done;i=e.next()){var r=dk(i.value,"GROUP-ID");if(i=t.I.get(r))if(r=t.K.get(r)){r=c(r);for(var a=r.next();!a.done;a=r.next())a=a.value,a.stream.codecs=i,a.stream.mimeType=MT(hn,i)||xT(hn),Kk(a.stream)}}return n.filter((function(t){return t}))}function Kk(t){var n=new Set([li(t.mimeType,t.codecs)]);t.segmentIndex&&t.segmentIndex.Db((function(e){e.mimeType&&n.add(li(e.mimeType,t.codecs))}));t.fullMimeTypes=n}function Wk(t,n,e){var i,r;return _((function(a){if(1==a.g)return i=n.map((function(n){var e,i;return _((function(r){if(1==r.g){if(t.g.disableThumbnails)return r.return(null);S(r,2);return T(r,iT(t,n),4)}if(2!=r.g)return e=r.h,r.return(e.stream);i=M(r);if(t.g.hls.ignoreImageStreamFailures)return r.return(null);throw i}))})).concat(e.map((function(n){if(t.g.disableThumbnails)return null;try{var e=rT(t,n);return"image"!==e.stream.type?null:e.stream}catch(n){if(t.g.hls.ignoreImageStreamFailures)return null;throw n}}))),T(a,Promise.all(i),2);r=a.h;return a.return(r.filter((function(t){return t})))}))}function $k(t,n,e){n=n.filter((function(t){var n=hk(t,"URI")||"";t=hk(t,"TYPE");return"SUBTITLES"!=t&&(""!=n||"AUDIO"==t)}));var i={};n=c(n);for(var r=n.next();!r.done;r=n.next()){r=r.value;var a=ck(r,!t.j);i[a]?i[a].push(r):i[a]=[r]}for(var u in i)eT(t,i[u],e,false)}function Yk(t,n){return n.map((function(n){n=rT(t,n);return"video"!==n.stream.type?null:n.stream})).filter((function(t){return t}))}function Qk(t,n,e,i,r,a,u){var s,o,f,h,d,v,p,m,w,g,b,y,k,E,S,A,I,M,x,N,C,P,R,D,L,O,U,B,H,F,V,z,X,q,j,G;return _((function(_){switch(_.g){case 1:s=[];o=new Set;if(t.g.ignoreDrmInfo||!(0<e.length)){_.u(2);break}f=c(e);h=f.next();case 3:if(h.done){_.u(2);break}d=h.value;v=dk(d,"METHOD");p=hk(d,"KEYFORMAT")||"identity";m=null;if("NONE"==v){_.u(4);break}if(UT(v)){w=yk(r(),dk(d,"URI"),a);g=w.sort().join("");t.M.has(g)||(b=sa(w,t.g.retryParameters),y=_T(t,b,6).promise,t.M.set(g,y));_.u(4);break}if("identity"==p)return T(_,HT(t,d,"",r,null,a),12);k=t.Yb.get(p);if(!k){E=null;_.u(10);break}return T(_,k(d,"",null),11);case 11:E=_.h;case 10:m=E;_.u(6);break;case 12:m=_.h;case 6:if(m){if(m.keyIds)for(S=c(m.keyIds),A=S.next();!A.done;A=S.next())I=A.value,o.add(I);s.push(m)}case 4:h=f.next();_.u(3);break;case 2:M={};x=c(n);for(N=x.next();!N.done;N=x.next())C=N.value,P=ck(C,!t.j),M[P]?M[P].push(C):M[P]=[C];R=[];for(D in M)L=M[D],O=L[0],U=hk(O,"FRAME-RATE"),B=Number(hk(O,"AVERAGE-BANDWIDTH"))||Number(dk(O,"BANDWIDTH")),H=hk(O,"RESOLUTION"),F=c(H?H.split("x"):[null,null]),V=F.next().value,z=F.next().value,X=hk(O,"VIDEO-RANGE"),(q=hk(O,"REQ-VIDEO-LAYOUT"))&&q.includes(",")&&(j=q.split(",").filter((function(t){return"CH-STEREO"==t||"CH-MONO"==t})),q=j[0]),q=q||"CH-MONO",G=Jk(t,L,i),R.push.apply(R,l(tT(t,G.audio,G.video,B,V,z,U,X,q,s,o,u)));return _.return(R.filter((function(t){return null!=t})))}}))}function Jk(t,n,e){for(var i={audio:[],video:[]},r=new Map,a=[],u=false,s=false,o=c(n),f=o.next();!f.done;f=o.next()){var h=f.value;f=hk(h,"AUDIO");var d=hk(h,"VIDEO"),v=f||d;v&&(a.includes(v)||a.push(v),(h=hk(h,"PATHWAY-ID"))&&r.set(v,h),f?u=true:d&&(s=true))}a.length&&e.length&&(e=e.filter((function(t){return a.includes(dk(t,"GROUP-ID"))})),$k(t,e,r));e=(r=a.sort().join(","))&&t.K.has(r)?t.K.get(r):[];u?i.audio.push.apply(i.audio,l(e)):s&&i.video.push.apply(i.video,l(e));u=false;var p=n.map((function(t){return dk(t,"URI")}));f=i.audio.find((function(t){return t&&t.O().find((function(t){return p.includes(t)}))}));s=Zk(t,n[0]);e=cn("video",s);(o=cn("audio",s))&&!e?(f="audio",u=0<i.audio.length):!i.audio.length&&!i.video.length&&o&&e?(f="video",s=[[e,o].join()]):i.audio.length&&f?(f="audio",u=true):f=i.video.length&&!i.audio.length?"audio":"video";u||(t=aT(t,n,s,f),r&&(t.stream.groupId=r),i[t.stream.type]=[t]);return i}function Zk(t,n){n=hk(n,"CODECS")||"";t.ba=0<n.length;t.ba||t.g.hls.disableCodecGuessing||(n=[],t.g.disableVideo||n.push(t.g.hls.defaultVideoCodec),t.g.disableAudio||n.push(t.g.hls.defaultAudioCodec),n=n.join(","));return Ac(n.split(/\s*,\s*/))}function tT(t,n,e,i,r,a,u,s,o,f,l,h){for(var d=c(e),v=d.next();!v.done;v=d.next())PT(v.value.stream,r,a,u,s,o,null);r=t.g.disableAudio;if(!n.length||r)n=[null];r=t.g.disableVideo;if(!e.length||r)e=[null];r=[];n=c(n);for(a=n.next();!a.done;a=n.next())for(a=a.value,u=c(e),s=u.next();!s.done;s=u.next()){var p=s.value;if(s=a?a.stream:null)s.drmInfos=f,s.keyIds=l;if(o=p?p.stream:null)o.drmInfos=f,o.keyIds=l,t.g.disableIFrames||Tr(o,h);o&&!s&&(o.bandwidth=i);!o&&s&&(s.bandwidth=i);d=a?a.stream.drmInfos:null;v=p?p.stream.drmInfos:null;p=p?p.O().sort().join(","):"";var m=a?a.O().sort().join(","):"",w=[];s&&s.codecs&&w.push(s.codecs);o&&o.codecs&&w.push(o.codecs);p=[p,m,w.sort()].join("-");s&&o&&!Lr(d,v)||t.ab.has(p)||(s={id:t.G++,language:s?s.language:"und",disabledUntilTime:0,primary:!!s&&s.primary||!!o&&o.primary,audio:s,video:o,bandwidth:i,allowedByApplication:true,allowedByKeySystem:true,decodingInfos:[]},r.push(s),t.ab.add(p))}return r}function nT(t,n){n=wk(n,"CLOSED-CAPTIONS");t.N=0==n.length;n=c(n);for(var e=n.next();!e.done;e=n.next()){var i=e.value,r=hk(i,"LANGUAGE");e=zi(r||"und");r||(r=hk(i,"NAME"))&&(e=r);r=dk(i,"GROUP-ID");i=dk(i,"INSTREAM-ID").replace("SERVICE","svc");t.H.get(r)||t.H.set(r,new Map);t.H.get(r).set(i,e)}}function eT(t,n,e,i){i=void 0===i?true:i;for(var r=[],a=[],u=new Map,s=c(n),o=s.next();!o.done;o=s.next()){var f=o.value;o=i?dk(f,"URI"):hk(f,"URI")||"shaka://hls-muxed";f=dk(f,"GROUP-ID");r.push(o);a.push(f);u.set(f,o)}i=a.sort().join(",");o=n[0];n="";s=dk(o,"TYPE").toLowerCase();"subtitles"==s&&(s=hn);if(s==hn)n=hk(o,"CODECS")||"";else for(a=c(a),f=a.next();!f.done;f=a.next())if(f=f.value,t.I.has(f)){n=t.I.get(f);break}a=r.sort().join(",");if(t.i.has(a))return t.i.get(a);f=t.G++;if(t.j){u=c(u);for(var l=u.next();!l.done;l=u.next()){var h=c(l.value);l=h.next().value;h=h.next().value;(l=e.get(l))&&wb(t.j,f,l,h)}}e=hk(o,"LANGUAGE");u=hk(o,"NAME");l="YES"==hk(o,"DEFAULT");"audio"==s?h=(h=hk(o,"CHANNELS"))?parseInt(h.split("/")[0],10):null:h=null;var d;"audio"==s?(d=hk(o,"CHANNELS"))?(d=d.split("/"),d=2!=d.length?false:"JOC"===d[1]||d[1].includes("ATMOS")):d=false:d=false;var v=hk(o,"CHARACTERISTICS"),p="YES"==hk(o,"FORCED");"audio"==s?o=(o=hk(o,"SAMPLE-RATE"))?parseInt(o,10):null:o=null;r=uT(t,f,r,n,s,e,l,u,h,null,v,p,o,d);r.stream&&(r.stream.groupId=i);t.K.has(i)?t.K.get(i).push(r):t.K.set(i,[r]);t.i.set(a,r);return r}function iT(t,n){var e,i,r,a,u,s,o,f,c,l;return _((function(h){if(1==h.g){e=dk(n,"URI");i=hk(n,"CODECS","jpeg")||"";if(t.i.has(e))return h.return(t.i.get(e));r=hk(n,"LANGUAGE");a=hk(n,"NAME");u=hk(n,"CHARACTERISTICS");s=uT(t,t.G++,[e],i,"image",r,false,a,null,null,u,false,null,false);return(o=hk(n,"RESOLUTION"))?T(h,s.stream.createSegmentIndex(),3):h.u(2)}2!=h.g&&(f=Gf(s.stream.segmentIndex),c=f.tilesLayout)&&(s.stream.width=Number(o.split("x")[0])*Number(c.split("x")[0]),s.stream.height=Number(o.split("x")[1])*Number(c.split("x")[1]));if(l=hk(n,"BANDWIDTH"))s.stream.bandwidth=Number(l);t.i.set(e,s);return h.return(s)}))}function rT(t,n){var e="video",i=dk(n,"URI"),r=hk(n,"CODECS")||"";"mjpg"==r&&(e="image");if(t.i.has(i))return t.i.get(i);var a=hk(n,"LANGUAGE"),u=hk(n,"NAME"),s=hk(n,"CHARACTERISTICS");e=uT(t,t.G++,[i],r,e,a,false,u,null,null,s,false,null,false);r=hk(n,"RESOLUTION");a=c(r?r.split("x"):[null,null]);r=a.next().value;a=a.next().value;e.stream.width=Number(r)||void 0;e.stream.height=Number(a)||void 0;if(n=hk(n,"BANDWIDTH"))e.stream.bandwidth=Number(n);t.i.set(i,e);return e}function aT(t,n,e,i){for(var r=t.G++,a=[],u=c(n),s=u.next();!s.done;s=u.next()){var o=s.value;s=dk(o,"URI");o=hk(o,"PATHWAY-ID");t.j&&o&&wb(t.j,r,o,s);a.push(s)}u=a.sort().join(",")+e.sort().join(",");if(t.i.has(u))return t.i.get(u);s=a.join(",");t:{n=hk(n[0],"CLOSED-CAPTIONS");if("video"==i){if(t.g.disableText){t.N=false;n=null;break t}if(n){if("NONE"!=n){n=t.H.get(n);break t}t.N=false}else if(!n&&t.H.size)for(n=c(t.H.keys()).next();!n.done;){n=t.H.get(n.value);break t}}n=null}e=fn(i,e);i=uT(t,r,a,e,i,null,false,s,null,n,null,false,null,false);t.i.set(u,i);return i}function uT(t,n,e,i,r,a,u,s,o,f,l,h,d,v){function p(n){var e,p,b,y,k,A,x,N,C,P,R,D,L,O,U,B,H,F,V,z,X,q,j;return _((function(_){switch(_.g){case 1:return e=dn,S(_,2),T(_,n.promise,4);case 4:p=_.h;if(n.aborted)return _.return();b=p.uri;b!=p.originalUri&&(y=g.O(),y.includes(b)||g.wf.push(b));k=Sk(t.Oa,p.data);if(1!=k.type)throw new zt(2,4,4017);A=mk(k.aa,"EXT-X-DEFINE");x=zk(t,A,b);N=false;(!t.ba&&t.g.hls.disableCodecGuessing||t.N&&r==e.xa&&!t.g.hls.disableClosedCaptionsDetection)&&0<k.segments.length&&(t.N=false,N=true);C=!t.ba&&t.g.hls.disableCodecGuessing;P=LT(t);return T(_,hT(t,0,x,k,m,i,r,a,u,s,o,f,l,h,d,v,void 0,N,C),5);case 5:R=_.h;if(n.aborted)return _.return();D=R.stream;wT(t,k);LT(t)&&!P&&yT(t,k);g.Tc=R.Tc;g.lc=R.lc;g.Le=R.Le;g.Ke=R.Ke;g.Pd=R.Pd;g.ef=R.ef;g.Qb=R.Qb;g.Rb=R.Rb;g.Lg=true;w.segmentIndex=D.segmentIndex;w.encrypted=D.encrypted;w.drmInfos=D.drmInfos;w.keyIds=D.keyIds;w.mimeType=D.mimeType;w.bandwidth=w.bandwidth||D.bandwidth;w.codecs=w.codecs||D.codecs;w.closedCaptions=w.closedCaptions||D.closedCaptions;w.width=w.width||D.width;w.height=w.height||D.height;w.hdr=w.hdr||D.hdr;w.colorGamut=w.colorGamut||D.colorGamut;w.frameRate=w.frameRate||D.frameRate;"und"==w.language&&"und"!=D.language&&(w.language=D.language);w.language=w.language||D.language;w.channelsCount=w.channelsCount||D.channelsCount;w.audioSamplingRate=w.audioSamplingRate||D.audioSamplingRate;Kk(w);w.drmInfos.length&&t.h.newDrmInfo(w);L=false;if(!f&&w.closedCaptions||f&&w.closedCaptions&&f.size!=w.closedCaptions.size)L=true;t.m&&L&&t.h.makeTextStreamsForClosedCaptions(t.m);if(r==e.xa||r==e.ea)for(O=c(t.i.values()),U=O.next();!U.done;U=O.next())B=U.value,B.Lg||B.type!=r||B.stream.isAudioMuxedInVideo||(B.stream.mimeType=D.mimeType,Kk(B.stream));r==e.Ya&&(H=Gf(D.segmentIndex))&&H.Y&&(w.mimeType="application/mp4",Kk(w));F=sc(w);w.segmentIndex.Db((function(t){t.Y&&(t.Y.od=F)}));lT(t)&&(t.qc?fT(t,[g]):(t.qc=true,V=Array.from(t.i.values()),z=V.filter((function(t){return t.stream.segmentIndex})),fT(t,z),Fk(t),X=t.o,0<X&&t.C.ha(X)));AT(t,k.aa,w.type,x,m);t.m&&(t.m.startTime=t.s);I(_,0);break;case 2:q=M(_);w.closeSegmentIndex();if(7001===q.code)return _.return();j=t.h.disableStream(w);if(!j)throw q;E(_)}}))}function m(){return t.j&&1<e.length?gb(t.j,n):g.wf.concat(kk([t.F],e,t.A))}var w=vT(t,i,r,a,u,s,o,f,l,h,d,v);e.includes("shaka://hls-muxed")&&(w.isAudioMuxedInVideo=true,w.mimeType="video/mp2t",Kk(w));var g={stream:w,type:r,wf:[],Tc:0,lc:0,ef:new Map,Le:false,Ke:false,Pd:false,kg:-1,Qb:-1,Rb:-1,Lg:false,O:m},b=null,y;w.createSegmentIndex=function(){if(b)return b;if(w.isAudioMuxedInVideo)return w.segmentIndex=new jf([]),Promise.resolve();y=RT(t,g.O(),true);return b=new Promise((function(t){t(p(y))}))};w.closeSegmentIndex=function(){b&&!w.segmentIndex&&y.abort();w.segmentIndex&&(w.segmentIndex.release(),w.segmentIndex=null);b=null};return g}function sT(t){var n=Infinity;t=c(t.i.values());for(var e=t.next();!e.done;e=t.next())e=e.value,e.stream.segmentIndex&&"text"!=e.stream.type&&!e.stream.isAudioMuxedInVideo&&(n=Math.min(n,e.lc));return n}function oT(t,n){var e=[];n=c(n);for(var i=n.next();!i.done;i=n.next())i=i.value,i.segmentIndex&&i.segmentIndex.Db((function(t){e.push(t)}));t.l.Yd(e)}function fT(t,n){if(!LT(t))for(var e=sT(t),i=c(n),r=i.next();!r.done;r=i.next())r.value.stream.segmentIndex.hd(0,e);oT(t,n.map((function(t){return t.stream})));i=Array.from(t.i.values()).filter((function(t){return t.stream.segmentIndex}));e=i.some((function(t){return"audio"==t.stream.type}));r=i.some((function(t){return"video"==t.stream.type}));i=LT(t)&&!t.Za;e=!LT(t)&&t.Za&&!(e&&r);t.g.hls.ignoreManifestProgramDateTime||i||e?Lk(t,n,i):(Ok(t,n),0<t.g.hls.ignoreManifestProgramDateTimeForTypes.length&&Lk(t,n))}function cT(t,n){return t.g.hls.ignoreManifestProgramDateTime?true:t.g.hls.ignoreManifestProgramDateTimeForTypes.includes(n)}function lT(t){if(!t.m)return false;var n=[],e=[];t=c(t.m.variants);for(var i=t.next();!i.done;i=t.next())i=i.value,i.video&&n.push(i.video),i.audio&&e.push(i.audio);return 0<n.length&&!n.some((function(t){return t.segmentIndex}))||0<e.length&&!e.some((function(t){return t.segmentIndex}))?false:true}function hT(t,n,e,i,r,a,u,s,o,f,c,l,h,d,v,p,m,w,g){w=void 0===w?true:w;g=void 0===g?true:g;var b,y,k,E,S,A,I,M,x,N,C,P,R,D,L,O,U,B,H,F,V,z,X,q,j,G,K,W,$;return _((function(n){switch(n.g){case 1:b=i.segments||[];y=b.every((function(t){return gk(t.aa,"EXT-X-GAP")?true:false}));if(!b.length||y)throw new zt(2,4,4053);gT(t,i);LT(t)&&bT(t,i);k=LT(t)?t.B.get(u):new Map;E=IT(t,i,k,e,r,u);S=E.segments;A=E.bandwidth;C=N=x=M=I=null;if(!(0<S.length&&w)){n.u(2);break}return T(n,Bk(t,S),3);case 3:P=n.h,u!=P.type&&LT(t)&&(t.B.set(P.type,t.B.get(u)),t.B.set(u,new Map)),u=P.type,s=P.language,c=P.channelCount,v=P.sampleRate,t.g.disableText||(l=P.closedCaptions),M=P.height,I=P.width,x=P.le,N=P.colorGamut,C=P.frameRate,g&&(m=P.mimeType,a=P.codecs);case 2:if(m){n.u(4);break}return T(n,CT(t,u,a,S),5);case 5:m=n.h,u!=hn||a||"application/mp4"!=m||!S[0]||S[0].Y||(m="text/vtt");case 4:return T(n,pT(t,i,m,r,e),6);case 6:R=n.h;D=R.drmInfos;L=R.keyIds;O=R.encrypted;U=R.Fh;if(O&&!D.length&&!U)throw new zt(2,4,4026);B=vT(t,a,u,s,o,f,c,l,h,d,v,p);B.encrypted=O&&!U;B.drmInfos=D;B.keyIds=L;B.mimeType=m;A&&(B.bandwidth=A);Kk(B);"video"==u&&(I||M||x||N)&&PT(B,I,M,C,x,null,N);LT(t)&&bT(t,i);H=S[0].startTime;F=S[S.length-1];V=F.endTime;z=new jf(S);B.segmentIndex=z;q=(X=gk(i.aa,"EXT-X-SERVER-CONTROL"))?null!=lk(X,"CAN-SKIP-UNTIL"):false;j=X?null!=lk(X,"CAN-BLOCK-RELOAD"):false;G=bk(i.aa,"EXT-X-MEDIA-SEQUENCE",0);K=dT(G,S);W=K.Qb;$=K.Rb;return n.return({stream:B,type:u,wf:[],O:r,Tc:H,lc:V,Le:q,Ke:j,Pd:false,kg:-1,Qb:W,Rb:$,ef:k,Lg:false})}}))}function dT(t,n){t=t+n.length-1;var e=-1;if(!n.length)return t++,{Qb:t,Rb:e};n=n[n.length-1];var i=n.g;if(!n.g.length)return t++,n.m&&(e=0),{Qb:t,Rb:e};e=i.length-1;i[i.length-1].isPreload()||(t++,e=0);return{Qb:t,Rb:e}}function vT(t,n,e,i,r,a,u,s,o,f,l,h){var d=MT(e,n)||xT(e),v=[];if(o){o=c(o.split(","));for(var p=o.next();!p.done;p=o.next())v.push(p.value)}o=void 0;p=null;e==hn?o=v.includes("public.accessibility.transcribes-spoken-dialog")&&v.includes("public.accessibility.describes-music-and-sound")?"caption":"subtitle":v.includes("public.accessibility.describes-video")&&(p="visually impaired");v.length||"subtitle"!==o||v.push("subtitle");t={id:t.G++,originalId:a,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:d,codecs:n,kind:e==hn?"subtitle":void 0,encrypted:false,drmInfos:[],keyIds:new Set,language:zi(i||"und"),originalLanguage:i,label:a,type:e,primary:r,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,frameRate:void 0,pixelAspectRatio:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:v,forced:f,channelsCount:u,audioSamplingRate:l,spatialAudio:h,closedCaptions:s,hdr:void 0,colorGamut:void 0,videoLayout:void 0,tilesLayout:void 0,accessibilityPurpose:p,external:false,fastSwitching:false,fullMimeTypes:new Set,isAudioMuxedInVideo:false,baseOriginalId:null};Kk(t);return t}function pT(t,n,e,i,r){var a,u,s,o,f,l,h,d,v,p,m,w,g,b,y,k,E,S,A,I,M,x,N,C,P,R,D,L,O;return _((function(_){switch(_.g){case 1:a=new Map;if(!t.g.ignoreDrmInfo&&n.segments)for(u=c(n.segments),s=u.next();!s.done;s=u.next())if(o=s.value,f=mk(o.aa,"EXT-X-KEY"),l=null,f.length)for(l=kT(t,n,o.aa,i,r),h=c(f),d=h.next();!d.done;d=h.next())v=d.value,a.set(v,l);m=p=false;w=[];g=new Set;b=c(a);y=b.next();case 2:if(y.done){_.u(4);break}k=y.value;E=c(k);S=E.next().value;A=E.next().value;I=S;M=A;x=dk(I,"METHOD");if("NONE"==x){_.u(3);break}p=true;N=hk(I,"KEYFORMAT")||"identity";C=null;if(UT(x)){m=true;_.u(3);break}if("identity"==N)return T(_,HT(t,I,e,i,M,r),11);P=t.Yb.get(N);if(!P){R=null;_.u(9);break}return T(_,P(I,e,M),10);case 10:R=_.h;case 9:C=R;_.u(6);break;case 11:C=_.h;case 6:if(C){if(C.keyIds)for(D=c(C.keyIds),L=D.next();!L.done;L=D.next())O=L.value,g.add(O);w.push(C)}case 3:y=b.next();_.u(2);break;case 4:return _.return({drmInfos:w,keyIds:g,encrypted:p,Fh:m})}}))}function mT(n,e,i,r,a){if(!t.crypto||!t.crypto.subtle)throw Y("Web Crypto API is not available to decrypt AES. (Web Crypto only exists in secure origins like https)"),new zt(2,4,4042);var u=0,s=hk(e,"IV","");if(s){var o=en(s.substr(2));if(16!=o.byteLength)throw new zt(2,4,4048)}else u=bk(i.aa,"EXT-X-MEDIA-SEQUENCE",0);var f=yk(r(),dk(e,"URI"),a),c=f.sort().join("");i=e.toString()+"-"+u+"-"+c;if(!n.oa.has(i)){var l={bitsKey:128,blockCipherMode:"CBC",iv:o,firstMediaSequenceNumber:u};switch(dk(e,"METHOD")){case"AES-256":l.bitsKey=256;break;case"AES-256-CTR":l.bitsKey=256,l.blockCipherMode="CTR"}l.fetchKey=function(){var e,i,r,a;return _((function(u){if(1==u.g)return n.M.has(c)||(e=sa(f,n.g.retryParameters),i=_T(n,e,6).promise,n.M.set(c,i)),T(u,n.M.get(c),2);if(3!=u.g){r=u.h;if(!r.data||r.data.byteLength!=l.bitsKey/8)throw new zt(2,4,4049);a={name:"CTR"==l.blockCipherMode?"AES-CTR":"AES-CBC",length:l.bitsKey};return T(u,t.crypto.subtle.importKey("raw",r.data,a,true,["decrypt"]),3)}l.cryptoKey=u.h;l.fetchKey=void 0;E(u)}))};n.oa.set(i,l)}return n.oa.get(i)}function wT(t,n){null==t.s&&(n=gk(n.aa,"EXT-X-START"))&&(t.s=Number(dk(n,"TIME-OFFSET")))}function gT(t,n){var e=gk(n.aa,"EXT-X-PLAYLIST-TYPE");n=gk(n.aa,"EXT-X-ENDLIST");n=e&&"VOD"==e.value||n;e=e&&"EVENT"==e.value&&!n;e=!n&&!e;n?OT(t,WT):e?OT(t,YT):OT(t,$T)}function bT(t,n){var e=Infinity,i=n.segments;if(i.length)for(var r=i.length-1;0<=r;){var a=gk(i[r].aa,"EXTINF");if(a){e=Number(a.value.split(",")[0]);break}r--}i=gk(n.aa,"EXT-X-TARGETDURATION");if(!i)throw new zt(2,4,4024,"EXT-X-TARGETDURATION");i=Number(i.value);if(r=gk(n.aa,"EXT-X-PART-INF"))t.P=Number(dk(r,"PART-TARGET"));n=gk(n.aa,"EXT-X-SERVER-CONTROL");t.ka&&t.P?(t.o=t.nc?5*t.P<=e?Math.min(t.P,t.o):Math.min(e,t.o):Math.min(t.P,t.o),t.Xa=n?Number(dk(n,"PART-HOLD-BACK")):0):(t.o=Math.min(e,t.o),e=n?lk(n,"HOLD-BACK"):null,t.Ka=e?Number(e.value):0);t.Ta=Math.max(i,t.Ta)}function yT(t,n){var e=0;if(t.g.defaultPresentationDelay)e=t.g.defaultPresentationDelay;else if(t.Xa)e=t.Xa;else if(t.Ka)e=t.Ka;else for(var i=n.segments.length,r=i-Math.min(i,t.g.hls.liveSegmentsDelay);r<i;r++){var a=gk(n.segments[r].aa,"EXTINF");e=a?e+Number(a.value.split(",")[0]):e+t.Ta}t.s&&0>t.s&&(e=Math.min(-t.s,e),t.s+=e);t.l.Ki(0);t.l.hh(e);t.l.Yc(false)}function kT(t,n,e,i,r){var a=gk(e,"EXT-X-MAP");if(!a)return null;var u=dk(a,"URI"),s=yk(i(),u,r);u=[s.toString(),hk(a,"BYTERANGE","")].join("-");if(!t.ya.has(u)){var o=void 0,f=null,l=false;e=c(e);for(var h=e.next();!h.done;h=e.next())h=h.value,"EXT-X-KEY"==h.name?(l=dk(h,"METHOD"),UT(l)&&h.id<a.id?(l=false,o=mT(t,h,n,i,r)):l="NONE"!=l):"EXT-X-BYTERANGE"==h.name&&h.id<a.id&&(f=h);n=TT(s,a,f,o,l);t.ya.set(u,n)}return t.ya.get(u)}function TT(t,n,e,i,r){var a=0,u=null;n=hk(n,"BYTERANGE");!n&&e&&(n=e.value);n&&(a=n.split("@"),u=Number(a[0]),a=Number(a[1]),u=a+u-1,i&&(e=u+1-a,e%16&&(u+=16-e%16)));return new Rs((function(){return t}),a,u,null,null,null,i,r)}function ET(n,e,i,r,a,u,s,o,f){function l(t){t=new bt(t).mb.split(".").pop();var n=GT.get(s).get(t);n||(n=VT.get(t));return n}var h=r.aa,d=gk(h,"EXTINF"),v=0,p=0,m=null;r.rc.length&&(n.m.isLowLatency=true);var w=null;if(!n.g.hls.ignoreManifestProgramDateTime){var g=gk(h,"EXT-X-PROGRAM-DATE-TIME");g&&g.value&&(w=he(g.value),n.Za=true)}var b=_s;gk(h,"EXT-X-GAP")&&(n.m.gapCount++,b=2);if(!d){if(0==r.rc.length)throw new zt(2,4,4024,"EXTINF");if(!n.ka)return null}var y=[];g=false;var k=null,T=false,E=false;if(n.ka&&r.rc.length){v=e&&t.ReadableStream&&n.g.hls.allowLowLatencyByteRangeOptimization;for(var S=w,A={},I=0;I<r.rc.length;A={Kf:void 0,qf:void 0},I++){var M=r.rc[I],x=0==I?i:y[y.length-1],N=0==I?a:x.endTime,C=Number(hk(M,"DURATION"))||n.P;if(C){var P=N+C,R=0,D=null;"EXT-X-PRELOAD-HINT"==M.name?(R=(R=hk(M,"BYTERANGE-START"))?Number(R):0,(x=hk(M,"BYTERANGE-LENGTH"))?D=R+Number(x)-1:R&&(D=Number.MAX_SAFE_INTEGER)):(R=hk(M,"BYTERANGE"),D=c(ST(x,R)),R=D.next().value,D=D.next().value);A.qf=hk(M,"URI");if(A.qf){x=_s;"YES"==hk(M,"GAP")&&(n.m.gapCount++,x=2,T=true);A.Kf=null;var L=function(t){return function(){null==t.Kf&&(t.Kf=yk(o(),t.qf,u));return t.Kf}}(A);v&&0<=R&&null!=D&&(k=L,g=true);N=new Ls(N,P,L,R,D,e,0,0,Infinity,[],"",null,S,x,f);"EXT-X-PRELOAD-HINT"==M.name&&(N.Mg(),E=true);"YES"!=hk(M,"INDEPENDENT")&&0<I&&N.nd();if(A=l(A.qf))N.mimeType=A,KT.has(A)&&(N.Y=null);y.push(N);S&&(S+=C)}}}}if(d){d=Number(d.value.split(",")[0]);if(0==d)return null;v=a+d}else if(y.length)v=y[y.length-1].endTime;else return null;g&&(T||0!=y[0].startByte?(g=false,k=null):y=[]);(d=gk(h,"EXT-X-BYTERANGE"))?(m=c(ST(i,d.value)),p=m.next().value,m=m.next().value):y.length&&(p=y[0].startByte,m=y[y.length-1].endByte);i="";d=null;"image"==s&&(i="1x1",h=gk(h,"EXT-X-TILES"))&&(i=dk(h,"LAYOUT"),(h=hk(h,"DURATION"))&&(d=Number(h)));var O=null;e=new Ls(a,v,(function(){if(k)return k();null==O&&(O=yk(o(),r.g,u));return O||[]}),p,m,e,0,0,Infinity,y,i,d,w,b,f,0<y.length&&!!r.g);if(a=l(r.g))e.mimeType=a,KT.has(a)&&(e.Y=null);g&&(n.nc=true,e.gi(),E&&e.Mg());return e}function ST(t,n){var e=0,i=null;n&&(e=n.split("@"),n=Number(e[0]),e=e[1]?Number(e[1]):t.endByte+1,i=e+n-1);return[e,i]}function AT(t,n,e,i,r){if("video"==e||"audio"==e){var a=t.l.m;if(a&&!cT(t,e))for(n=mk(n,"EXT-X-DATERANGE"),n=n.filter((function(t){return null!=lk(t,"START-DATE")})).sort((function(t,n){t=dk(t,"START-DATE");n=dk(n,"START-DATE");return t<n?-1:t>n?1:0})),e=0;e<n.length;e++){var u=n[e];try{var s=dk(u,"START-DATE"),o=he(s);if(!isNaN(o)){var f=Math.max(0,o-a),l=null,h=hk(u,"END-DATE");if(h){var d=he(h);if(!isNaN(d)&&(l=d-a,0>l))continue}if(null==l){var v=hk(u,"DURATION")||hk(u,"PLANNED-DURATION");if(v){var p=parseFloat(v);isNaN(p)||(l=f+p);if(0>o-a+p)continue}}var m=hk(u,"CLASS")||"com.apple.quicktime.HLS",w="YES"==hk(u,"END-ON-NEXT");if(null==l&&w){for(var g=e+1;g<n.length;g++){var b=hk(n[g],"CLASS")||"com.apple.quicktime.HLS";if(m==b){var y=dk(n[g],"START-DATE"),k=he(y);if(!isNaN(k)&&k&&k>o){l=Math.max(0,k-a);break}}}if(null==l)continue}g=["CLASS","START-DATE","END-DATE","DURATION","END-ON-NEXT"];for(var T=[],E=c(u.attributes),S=E.next();!S.done;S=E.next()){var A=S.value;if(!g.includes(A.name)){var I=Tk(A.value,i);if("X-ASSET-URI"==A.name||"X-ASSET-LIST"==A.name)I=yk(r(),A.value,i)[0];T.push({key:A.name,description:"",data:I,mimeType:null,pictureType:null})}}if(1<T.length)t.h.onMetadata(m,f,l,T)}}catch(t){}}}}function IT(t,n,e,i,r,a){var u=n.segments,s=void 0,o=bk(n.aa,"EXT-X-DISCONTINUITY-SEQUENCE",-1),f=bk(n.aa,"EXT-X-MEDIA-SEQUENCE",0),l=gk(n.aa,"EXT-X-SKIP"),h=l?Number(hk(l,"SKIPPED-SEGMENTS")):0,d=f+h,v=0;LT(t)&&e.has(d)&&(v=e.get(d));0===v&&t.Ba==YT&&0<e.size&&!e.has(d)&&null!=t.l.i&&(v=t.l.Fb());var p=[],m=null;l=[];for(var w=0;w<u.length;w++){var g=u[w],b=0==w?v:m.endTime;d=f+h+w;gk(g.aa,"EXT-X-DISCONTINUITY")&&(o++,m&&m.Y&&(m.Y.g=b));var y=c(g.aa);for(var k=y.next();!k.done;k=y.next())k=k.value,"EXT-X-KEY"==k.name&&(UT(dk(k,"METHOD"))?s=mT(t,k,n,r,i):s=void 0);e.set(d,b);y=kT(t,n,g.aa,r,i);if(b=ET(t,y,m,g,b,i,a,r,s))(m=bk(g.aa,"EXT-X-BITRATE"))?l.push({bitrate:m,duration:b.endTime-b.startTime}):l.length&&(m=l.pop(),m.duration+=b.endTime-b.startTime,l.push(m)),m=b,b.i=o,cT(t,a)&&null!=t.L&&d<t.L||p.push(b)}n=void 0;l.length&&(n=l.reduce((function(t,n){return t+n.duration}),0),n=Math.round(l.reduce((function(t,n){return t+n.bitrate*n.duration}),0)/n*1e3));if(l=p.some((function(t){return null!=t.h})))for(e={},i=0;i<p.length;e={Qe:void 0,Pe:void 0,He:void 0,Vc:void 0,Ge:void 0},i++)if(e.Vc=p[i],null==e.Vc.h)for(e.Pe=0,e.Qe=i,r=function(t){return function(){var n=p[t.Qe];if(n){if(null!=n.h)return n.h+t.Pe;t.Pe-=n.endTime-n.startTime;t.Qe+=1}return null}}(e),e.Ge=0,e.He=i,u=function(t){return function(){var n=p[t.He];if(n){n!=t.Vc&&(t.Ge+=n.endTime-n.startTime);if(null!=n.h)return n.h+t.Ge;--t.He}return null}}(e);null==e.Vc.h;)e.Vc.h=u(),null==e.Vc.h&&(e.Vc.h=r());if(l)for(e=c(p),i=e.next();!i.done;i=e.next())for(r=i.value,i=r.h,r=c(r.g),u=r.next();!u.done;u=r.next())u=u.value,u.h=i,i+=u.endTime-u.startTime;e=t.ia;if(l&&Infinity!=e&&!cT(t,a))for(t=c(p),a=t.next();!a.done;a=t.next())a.value.rh(e);return{segments:p,bandwidth:n}}function MT(t,n){if(t==hn){if("vtt"==n||"wvtt"==n)return"text/vtt";if(n&&""!==n)return"application/mp4"}return"image"!=t||n&&"jpeg"!=n?"audio"==t&&"mp4a.40.34"==n?"audio/mpeg":"mjpg"==n?"application/mp4":null:"image/jpeg"}function xT(t){return t==hn?"text/vtt":GT.get(t).get("mp4")}function NT(t,n){t=LT(t)?Math.trunc((n.length-1)/2):0;for(var e=n[t];2==e.Bc()&&t+1<n.length;)t++,e=n[t];return{segment:e,segmentIndex:t}}function CT(t,n,e,i){var r,a,u,s,o,f,c,l,h,d,v,p,m;return _((function(w){switch(w.g){case 1:r=va;a=NT(t,i);u=a.segment;if(2==u.status)return w.return(xT(n));s=u.O();o=new bt(s[0]);f=o.mb.split(".").pop();c=GT.get(n);if((l=c.get(f))||(l=VT.get(f))||(l=MT(n,e)))return w.return(l);d=1;v=sa(s,t.g.retryParameters);S(w,2);v.method="HEAD";return T(w,_T(t,v,r,{type:d}).promise,4);case 4:p=w.h;h=p.headers["content-type"];I(w,3);break;case 2:m=M(w);if(!m||1002!=m.code&&1001!=m.code){w.u(3);break}v.method="GET";t.g.hls.allowRangeRequestsToGuessMimeType&&(v.headers.Range="bytes=0-0");return T(w,_T(t,v,r,{type:d}).promise,6);case 6:p=w.h,h=p.headers["content-type"];case 3:if(!h){w.u(7);break}l=h.toLowerCase().split(";")[0];if("application/octet-stream"!=l){w.u(8);break}if(p.data.byteLength){w.u(9);break}v.method="GET";return T(w,_T(t,v,r,{type:d}).promise,10);case 10:p=w.h;case 9:Ao(Bt(p.data))&&(l="video/mp2t");case 8:if("application/octet-stream"!=l)return w.return(l);case 7:return w.return(xT(n))}}))}function PT(t,n,e,i,r,a,u){t&&(t.width=Number(n)||void 0,t.height=Number(e)||void 0,t.frameRate=Number(i)||void 0,t.hdr=r||void 0,t.videoLayout=a||void 0,t.colorGamut=u||void 0)}function RT(t,n,e){return _T(t,sa(n,t.g.retryParameters),0,{type:e?2:3})}function DT(t){var n,e,i,r,a,u;return _((function(s){switch(s.g){case 1:if(!t.h)return s.return();S(s,2);n=Date.now();return T(s,t.update(),4);case 4:e=Date.now();LT(t)&&(i=(e-n)/1e3,t.eb.sample(1,i),r=0<t.g.updatePeriod?t.g.updatePeriod:t.o,a=Math.max(0,r-G(t.eb)),t.C.ha(a));I(s,3);break;case 2:u=M(s);if(!t.h)return s.return();if(t.g.raiseFatalErrorOnManifestUpdateRequestFailure)return t.h.onError(u),s.return();u.severity=1;t.h.onError(u);t.C.ha(.1);case 3:if(!t.h)return s.return();t.h.onManifestUpdated();E(s)}}))}function LT(t){return t.Ba!=WT}function OT(t,n){t.Ba=n;t.l&&t.l.Yc(!LT(t));LT(t)||t.C.stop()}function _T(t,n,e,i){if(!t.W)throw new zt(2,7,7001);i||(i={});i.isPreload=t.Xb();n=t.h.networkingEngine.request(e,n,i);ia(t.W,n);return n}function UT(t){return"AES-128"==t||"AES-256"==t||"AES-256-CTR"==t}function BT(n,e,i,r){var a,u,s,o,f,c;return _((function(l){if(1==l.g){if("video/mp2t"==i)throw new zt(2,4,4040);if("apple"===t.shakaMediaKeysPolyfill)throw new zt(2,4,4041);a=dk(e,"METHOD");u=["SAMPLE-AES","SAMPLE-AES-CTR"];if(!u.includes(a))return l.return(null);s="cenc";"SAMPLE-AES"==a&&(s="cbcs");o=dk(e,"URI");f=sn("com.apple.fps",s,[{initDataType:"sinf",initData:new Uint8Array(0),keyId:null}],o);var h=new bt(o).Cb.replace(/-/g,"").toLowerCase();return(c=32===h.length&&/^[0-9a-f]+$/.test(h)?h:null)||!r?l.u(2):T(l,FT(n,r),3)}2!=l.g&&(c=l.h);c&&f.keyIds.add(c);return l.return(f)}))}function HT(n,e,i,r,a,u){var s,o,f,c,l,h,d,v,p,m,w,g;return _((function(b){switch(b.g){case 1:if("video/mp2t"==i)throw new zt(2,4,4040);if("apple"===t.shakaMediaKeysPolyfill)throw new zt(2,4,4041);s=dk(e,"METHOD");o=["SAMPLE-AES","SAMPLE-AES-CTR"];if(!o.includes(s))return b.return(null);f=yk(r(),dk(e,"URI"),u);if(f[0].startsWith("data:text/plain;base64,")){c=rn(nn(f[0].split("data:text/plain;base64,").pop()));b.u(2);break}l=f.sort().join("");n.va.has(l)||(h=sa(f,n.g.retryParameters),d=_T(n,h,6).promise,n.va.set(l,d));return T(b,n.va.get(l),3);case 3:v=b.h,c=rn(v.data);case 2:p="00000000000000000000000000000000";if(!a){b.u(4);break}return T(b,FT(n,a),5);case 5:(m=b.h)&&(p=m);case 4:return w=new Map,w.set(p,c),g="cenc","SAMPLE-AES"==s&&(g="cbcs"),b.return(on(w,g))}}))}function FT(t,n){var e,i,r,a;return _((function(u){if(1==u.g){e=null;if(t.wa.has(n))return e=t.wa.get(n),u.u(2);i=Nc(n.O(),n.Ac(),n.yc(),t.g.retryParameters);r=va;return T(u,_T(t,i,r,{type:0}).promise,3)}2!=u.g&&(a=u.h,n.ee(a.data),e=Mc(a.data),t.wa.set(n,e));return u.return(e)}))}q("shaka.hls.HlsParser",Pk);var VT=(new Map).set("aac","audio/aac").set("ac3","audio/ac3").set("ec3","audio/ec3").set("mp3","audio/mpeg"),zT=(new Map).set("mp4","audio/mp4").set("mp4a","audio/mp4").set("m4s","audio/mp4").set("m4i","audio/mp4").set("m4a","audio/mp4").set("m4f","audio/mp4").set("cmfa","audio/mp4").set("ts","video/mp2t").set("tsa","video/mp2t"),XT=(new Map).set("mp4","video/mp4").set("mp4v","video/mp4").set("m4s","video/mp4").set("m4i","video/mp4").set("m4v","video/mp4").set("m4f","video/mp4").set("cmfv","video/mp4").set("ts","video/mp2t").set("tsv","video/mp2t"),qT=(new Map).set("mp4","application/mp4").set("m4s","application/mp4").set("m4i","application/mp4").set("m4f","application/mp4").set("cmft","application/mp4").set("vtt","text/vtt").set("webvtt","text/vtt").set("ttml","application/ttml+xml"),jT=(new Map).set("jpg","image/jpeg").set("png","image/png").set("svg","image/svg+xml").set("webp","image/webp").set("avif","image/avif"),GT=(new Map).set("audio",zT).set("video",XT).set("text",qT).set("image",jT),KT=new Set(["video/mp2t"].concat(l(ki))),WT="VOD",$T="EVENT",YT="LIVE",QT={bj:WT,Al:$T,Kl:YT};Hu("application/x-mpegurl",(function(){return new Pk}));Hu("application/vnd.apple.mpegurl",(function(){return new Pk}));function JT(t){return mg(t)}var ZT=(new Map).set("com.microsoft.playready",JT).set("com.microsoft.playready.recommendation",JT).set("com.microsoft.playready.software",JT).set("com.microsoft.playready.hardware",JT);function tE(){var t=this;this.h=this.g=null;this.l=[];this.j=null;this.s=1;this.i=null;this.C=new j(5);this.o=new Di((function(){nE(t)}));this.B=new ea;this.m=new Map;this.A=function(){return false}}i=tE.prototype;i.configure=function(t,n){this.g=t;n&&(this.A=n)};i.start=function(t,n){var e=this;return _((function(i){if(1==i.g)return e.l=[t],e.h=n,T(i,eE(e),2);if(!e.h)throw new zt(2,7,7001);return i.return(e.j)}))};function nE(t){var n;_((function(e){switch(e.g){case 1:return S(e,2),T(e,eE(t),4);case 4:I(e,3);break;case 2:n=M(e),t.h&&(n.severity=1,t.h.onError(n));case 3:if(!t.h)return e.return();E(e)}}))}i.stop=function(){this.g=this.h=null;this.l=[];this.j=null;null!=this.o&&(this.o.stop(),this.o=null);this.m.clear();return this.B.destroy()};i.update=function(){var t=this,n;return _((function(e){if(1==e.g)return S(e,2),T(e,eE(t),4);if(2!=e.g)return I(e,0);n=M(e);if(!t.h||!n)return e.return();t.h.onError(n);E(e)}))};i.onExpirationUpdated=function(){};i.onInitialVariantChosen=function(){};i.banLocation=function(){};i.setMediaElement=function(){};function eE(t){var n,e,i,r,a,u,s;return _((function(o){if(1==o.g)return n=sa(t.l,t.g.retryParameters),e=t.h.networkingEngine,i=Date.now(),r=e.request(0,n,{type:5,isPreload:t.A()}),ia(t.B,r),T(o,r.promise,2);a=o.h;if(!t.h)return o.return();a.uri&&!t.l.includes(a.uri)&&t.l.unshift(a.uri);var f=a.uri,h=a.data,d=t.g.mss.manifestPreprocessor;if(d!=Vl){vt("manifest.mss.manifestPreprocessor configuration","Please Use manifest.mss.manifestPreprocessorTXml instead.");h=ey(h,"SmoothStreamingMedia");if(!h)throw new zt(2,4,4046,f);d(h);h=Kt(h.outerHTML)}var v=Yn(h,"SmoothStreamingMedia");if(!v)throw new zt(2,4,4046,f);f=t.g.mss.manifestPreprocessorTXml;f!=zl&&f(v);t.i||(t.i=new kf(null,0));if(f=oe(v,"IsLive",be,false))throw new zt(2,4,4047);t.i.Yc(!f);d=oe(v,"TimeScale",we,1e7);h=oe(v,"DVRWindowLength",we);f&&(0===h||isNaN(h))&&(h=Infinity);var p=oe(v,"CanSeek",be,false);0===h&&p&&(h=Infinity);p=null;h&&0<h&&(p=h/d);f&&!isNaN(t.g.availabilityWindowOverride)&&(p=t.g.availabilityWindowOverride);null==p&&(p=Infinity);t.i.Df(p);h=oe(v,"Duration",we,Infinity);f||t.i.ob(h/d);f={variants:[],textStreams:[],timescale:d,duration:h/d};var m;p=ee(v,"Protection");d=t.g.mss.keySystemsBySystemId;h=[];p=c(p);for(m=p.next();!m.done;m=p.next())h=h.concat(ee(m.value,"ProtectionHeader"));if(h.length){p=[];for(m=0;m<h.length;m++){var w=h[m],g=w.attributes.SystemID.toLowerCase(),b=d[g];if(b){var y;t:{if(y=pg(w)){y=c(ae(y,"DATA"));for(var k=y.next();!k.done;k=y.next())if(k=ue(k.value,"KID")){y=nn(ie(k));y=new Uint8Array([y[3],y[2],y[1],y[0],y[5],y[4],y[7],y[6]].concat(l(y.slice(8))));y=rn(y);break t}}y=null}k=nn(ie(w));g=en(g.replace(/-/g,""));g=[{initData:Ba(k,g,new Set,0),initDataType:"cenc",keyId:y}];g=sn(b,"cenc",g);y&&g.keyIds.add(y);if(b=ZT.get(b))g.licenseServerUri=b(w);p.push(g)}}d=p}else d=[];m=d;p=[];d=[];h=[];v=ee(v,"StreamIndex");v=c(v);for(w=v.next();!w.done;w=v.next()){w=w.value;b=ee(w,"QualityLevel");g=f.timescale;y=f.duration;k=ee(w,"c");for(var S=[],A=0,I=0;I<k.length;++I){var M=k[I],x=k[I+1],N=oe(M,"t",we),C=oe(M,"d",we);M=oe(M,"r",pe);if(!C)break;N=null!=N?N:A;(M=M||0)&&M--;if(0>M)if(x){x=oe(x,"t",we);if(null==x)break;else if(N>=x)break;M=Math.ceil((x-N)/C)-1}else{if(Infinity==y)break;else if(N/g>=y)break;M=Math.ceil((y*g-N)/C)-1}for(x=0;x<=M;++x)A=N+C,S.push({start:N/g,end:A/g,yh:N}),N=A}g=S;b=c(b);for(y=b.next();!y.done;y=b.next())(y=iE(t,w,y.value,g,m,f))&&("audio"!=y.type||t.g.disableAudio?"video"!=y.type||t.g.disableVideo?y.type!=hn||t.g.disableText||h.push(y):d.push(y):p.push(y))}v=[];p=c(0<p.length?p:[null]);for(m=p.next();!m.done;m=p.next())for(m=m.value,w=c(0<d.length?d:[null]),S=w.next();!S.done;S=w.next())b=v,g=b.push,y=t,k=m,S=S.value,I=0,k&&k.bandwidth&&0<k.bandwidth&&(I+=k.bandwidth),S&&S.bandwidth&&0<S.bandwidth&&(I+=S.bandwidth),y={id:y.s++,language:k?k.language:"und",disabledUntilTime:0,primary:!!k&&k.primary||!!S&&S.primary,audio:k,video:S,bandwidth:I,allowedByApplication:true,allowedByKeySystem:true,decodingInfos:[]},g.call(b,y);f.variants=v;f.textStreams=h;t.j?(t.j.variants=f.variants,t.j.textStreams=f.textStreams,t.h.filter(t.j)):(t.j={presentationTimeline:t.i,variants:f.variants,textStreams:f.textStreams,imageStreams:[],offlineSessionIds:[],sequenceMode:t.g.mss.sequenceMode,ignoreManifestTimestampsInSegmentsMode:false,type:"MSS",serviceDescription:null,nextUrl:null,periodCount:1,gapCount:0,isLowLatency:false,startTime:null},t.i.df());Promise.resolve();u=Date.now();s=(u-i)/1e3;t.C.sample(1,s);E(o)}))}function iE(t,n,e,i,r,a){var u=n.attributes.Type;if("audio"!==u&&"video"!==u&&"text"!==u)return Y("Ignoring unrecognized type:",u),null;var s=n.attributes.Language,o=t.s++,f=oe(e,"Bitrate",me),c=oe(e,"MaxWidth",me),l=oe(e,"MaxHeight",me),h=oe(e,"Channels",me),d=oe(e,"SamplingRate",me),v=a.duration;i.length&&(v=i[i.length-1].end-i[0].start);var p=t.i.getDuration();t.i.ob(Math.min(v,p));var m={id:o,originalId:n.attributes.Name||String(o),groupId:null,createSegmentIndex:function(){return Promise.resolve()},closeSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:"",codecs:"",frameRate:void 0,pixelAspectRatio:void 0,bandwidth:f||0,width:c||void 0,height:l||void 0,kind:"",encrypted:0<r.length,drmInfos:r,keyIds:new Set,language:zi(s||"und"),originalLanguage:s,label:"",type:"",primary:false,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:[],roles:[],forced:false,channelsCount:h,audioSamplingRate:d,spatialAudio:false,closedCaptions:null,hdr:void 0,colorGamut:void 0,videoLayout:void 0,tilesLayout:void 0,matchedStreams:[],mssPrivateData:{duration:v,timescale:a.timescale,codecPrivateData:null},accessibilityPurpose:null,external:false,fastSwitching:false,fullMimeTypes:new Set,isAudioMuxedInVideo:false,baseOriginalId:null};if(r=n.attributes.Subtype)(r=fE.get(r))&&m.roles.push(r),"main"===r&&(m.primary=true);r=e.attributes.FourCC;if(null===r||""===r)r=n.attributes.FourCC;if(!r)if("audio"===u)r="AAC";else if("video"===u)return Y('FourCC is not defined whereas it is required for a QualityLevel element for a StreamIndex of type "video"'),null;if(!oE.includes(r.toUpperCase()))return Y("Codec not supported:",r),null;e=rE(e,u,r,m);m.mssPrivateData.codecPrivateData=e;switch(u){case"audio":if(!e)return Y("Quality unsupported without CodecPrivateData",u),null;m.type="audio";m.mimeType="mss/audio/mp4";m.codecs=aE(r,e);break;case"video":if(!e)return Y("Quality unsupported without CodecPrivateData",u),null;m.type="video";m.mimeType="mss/video/mp4";m.codecs=uE(e);break;case"text":if(m.type=hn,m.mimeType="application/mp4","TTML"===r||"DFXP"===r)m.codecs="stpp"}m.fullMimeTypes.add(li(m.mimeType,m.codecs));m.createSegmentIndex=function(){if(m.segmentIndex)return Promise.resolve();if(t.m.has(m.id))var e=t.m.get(m.id);else e=[],"video"==m.type&&(e=m.mssPrivateData.codecPrivateData.split("00000001").slice(1)),e={id:m.id,type:m.type,codecs:m.codecs,encrypted:m.encrypted,timescale:m.mssPrivateData.timescale,duration:m.mssPrivateData.duration,Ab:e,Ea:new Uint8Array([]),Na:new Uint8Array([]),Va:0,Wa:0,data:null,stream:m},e=Zu(new Ju([e])),t.m.set(m.id,e);e=sE(t,new Rs((function(){return[]}),0,null,sc(m),m.mssPrivateData.timescale,e,null,m.encrypted),m,n,i);m.segmentIndex=new jf(e);return Promise.resolve()};m.closeSegmentIndex=function(){m.segmentIndex&&(m.segmentIndex.release(),m.segmentIndex=null)};return m}function rE(t,n,e,i){if(t=t.attributes.CodecPrivateData)return t;if("audio"!==n)return null;n=i.channelsCount||2;t=i.audioSamplingRate||44100;var r={96e3:0,88200:1,64e3:2,48e3:3,44100:4,32e3:5,24e3:6,22050:7,16e3:8,12e3:9,11025:10,8e3:11,7350:12};i=r[t];if("AACH"===e)return e=new Uint8Array(4),t=r[2*t],e[0]=40|i>>1,e[1]=i<<7|n<<3|t>>1,e[2]=t<<7|8,e[3]=0,n=new Uint16Array(2),n[0]=(e[0]<<8)+e[1],n[1]=(e[2]<<8)+e[3],n[0].toString(16)+n[1].toString(16);e=new Uint8Array(2);e[0]=16|i>>1;e[1]=i<<7|n<<3;n=new Uint16Array(1);n[0]=(e[0]<<8)+e[1];return n[0].toString(16)}function aE(t,n){var e=0;"AACH"===t&&(e=5);n?0===e&&(e=(parseInt(n.substr(0,2),16)&248)>>3):(e=2,"AACH"===t&&(e=5));return"mp4a.40."+e}function uE(t){var n=/00000001[0-9]7/.exec(t);return n.length&&t?"avc1."+t.substr(t.indexOf(n[0])+10,6):""}function sE(t,n,e,i,r){var a=i.attributes.Url.replace("{bitrate}",String(e.bandwidth));i=[];r=c(r);for(var u=r.next(),s={};!u.done;s={Ff:void 0},u=r.next())s.Ff=u.value,i.push(new Ls(s.Ff.start,s.Ff.end,function(n){return function(){return un(t.l,[a.replace("{start time}",String(n.Ff.yh))])}}(s),0,null,n,0,0,e.mssPrivateData.duration));return i}q("shaka.mss.MssParser",tE);var oE="AAC AACL AACH AACP AVC1 H264 TTML DFXP".split(" "),fE=(new Map).set("CAPT","main").set("SUBT","alternate").set("DESC","main");Hu("application/vnd.ms-sstr+xml",(function(){return new tE}));function cE(t,n,e,i,r,a,u){if(200<=e&&299>=e&&202!=e||304==e)return{uri:r||i,originalUri:i,data:n,status:e,headers:t,fromCache:!!t["x-shaka-from-cache"],originalRequest:a};a=null;try{a=Gt(n)}catch(t){}throw new zt(401==e||403==e?2:1,1,1001,i,e,a,t,u,r||i)}function lE(){}function hE(t,n,e,i,r,a){var u=new bE;ka(n.headers).forEach((function(t,n){u.append(n,t)}));var s=new wE,o={Jh:false,Xi:false};t=dE(t,n,e,{body:n.body||void 0,headers:u,method:n.method,signal:s.signal,credentials:n.allowCrossSiteCredentials?"include":void 0},o,i,r,n.streamDataCallback,a.minBytesForProgressEvents||0);t=new jr(t,(function(){o.Jh=true;s.abort();return Promise.resolve()}));if(n=n.retryParameters.timeout){var f=new Di((function(){o.Xi=true;s.abort()}));f.ha(n/1e3);t.finally((function(){f.stop()}))}return t}function dE(t,n,e,i,r,a,u,s,o){var f,c,l,h,d,v,p,m,w,g,b,y,k,A,x;return _((function(N){switch(N.g){case 1:return f=mE,c=gE,h=new ArrayBuffer(0),v=d=0,p={},m=Date.now(),S(N,2),T(N,f(t,i),4);case 4:l=N.h;p=vE(l.headers);u(p);if("HEAD"==i.method){N.u(5);break}g=(w=l.headers.get("Content-Length"))?parseInt(w,10):0;if(!l.body)return T(N,l.arrayBuffer(),9);b=l.clone().body.getReader();y=function(t){function n(){var e,i,r,u;return _((function(f){switch(f.g){case 1:return S(f,2),T(f,b.read(),4);case 4:e=f.h;I(f,3);break;case 2:return M(f),f.return();case 3:if(e.done){f.u(5);break}d+=e.value.byteLength;if(!s){f.u(5);break}return T(f,s(e.value),5);case 5:i=Date.now();r=d-v;if(100<i-m&&r>=o||e.done)u=e.done?0:g-d,a(i-m,r,u),v=d,m=i;e.done?t.close():(t.enqueue(e.value),n());E(f)}}))}n()};new c({start:y});return T(N,l.arrayBuffer(),8);case 8:h=N.h;N.u(5);break;case 9:h=N.h,k=Date.now(),a(k-m,h.byteLength,0);case 5:n.headers.Range&&(A=n.headers.Range.replace("bytes=","").split("-").filter((function(t){return t})).map((function(t){return parseInt(t,10)})),2==A.length&&h.byteLength!=A[1]-A[0]+1&&Y("Payload length does not match range requested bytes",n,l));I(N,3);break;case 2:x=M(N);if(r.Jh)throw new zt(1,1,7001,t,e);if(r.Xi)throw new zt(1,1,1003,t,e);throw new zt(1,1,1002,t,x,e);case 3:return N.return(cE(p,h,l.status,t,l.url,n,e))}}))}function vE(t){var n={};t.forEach((function(t,e){n[e.trim()]=t}));return n}function pE(){if(t.ReadableStream)try{new ReadableStream({})}catch(t){return false}else return false;if(t.Response){if(!new Response("").body)return false}else return false;return!(!t.fetch||"polyfill"in t.fetch||!t.AbortController)}q("shaka.net.HttpFetchPlugin",lE);lE.isSupported=pE;lE.parse=hE;var mE=t.fetch,wE=t.AbortController,gE=t.ReadableStream,bE=t.Headers;pE()&&(aa("http",hE,2,true),aa("https",hE,2,true),aa("blob",hE,2,true));function yE(){}function kE(t,n,e,i,r,a){var u=new TE,s=Date.now(),o=0,f=new Promise((function(f,l){u.open(n.method,t,true);u.responseType="arraybuffer";u.timeout=n.retryParameters.timeout;u.withCredentials=n.allowCrossSiteCredentials;var h={};u.onabort=function(){l(new zt(1,1,7001,t,e))};u.onreadystatechange=function(){if(u.readyState===XMLHttpRequest.HEADERS_RECEIVED){var t=u.getAllResponseHeaders().trim().split("\r\n"),n={};t=c(t);for(var e=t.next();!e.done;e=t.next())e=e.value.split(": "),n[e[0].toLowerCase()]=e.slice(1).join(": ");h=n;r(h)}};u.onload=function(r){var a=u.response;try{i(Date.now()-s,r.loaded-o,0);var c=cE(h,a,u.status,t,u.responseURL,n,e);f(c)}catch(t){l(t)}};u.onerror=function(n){l(new zt(1,1,1002,t,n,e))};u.ontimeout=function(){l(new zt(1,1,1003,t,e))};u.onprogress=function(t){var n=Date.now(),e=a.minBytesForProgressEvents||0,r=t.loaded-o;if(100<n-s&&r>=e||t.lengthComputable&&t.loaded==t.total)i(n-s,r,4==u.readyState?0:t.total-t.loaded),o=t.loaded,s=n};for(var d in n.headers)u.setRequestHeader(d.toLowerCase(),n.headers[d]);u.send(n.body)}));return new jr(f,(function(){u.abort();return Promise.resolve()}))}q("shaka.net.HttpXHRPlugin",yE);yE.parse=kE;var TE=t.XMLHttpRequest;aa("http",kE,1,true);aa("https",kE,1,true);aa("blob",kE,1,true);function EE(t,n,e,i,r){this.g=t;this.i=n;this.groupId=e;this.h=i;this.j=r}function SE(t){var n=t.Wb(false);return n?tn(n):t.O().map((function(t){return"{"+encodeURI(t.split("#xywh=")[0])+"}"})).join("")+":"+t.startByte+":"+t.endByte}function AE(t,n){return Nc(t.g.O(),t.g.startByte,t.g.endByte,n.streaming.retryParameters)}function IE(){this.g=this.j=this.i=0;this.h=new Map;this.l=0}function ME(t,n){t.i+=n;var e=t.l;t.l++;t.h.set(e,n);return e}IE.prototype.close=function(t,n){if(this.h.has(t)){var e=this.h.get(t);this.h.delete(t);this.j+=e;this.g+=n}};function xE(t){return 0==t.i?0:t.j/t.i}function NE(t){var n=this;this.s=t;this.i=new Map;this.h=new wa((function(){return PE(n).catch((function(){}))}));this.j=[];this.o=function(){};this.m=function(){};this.g=new IE;this.l=false}NE.prototype.destroy=function(){return this.h.destroy()};function CE(t,n,e){t.o=n;t.m=e}function PE(t){t.l=true;var n=t.j.map((function(t){return t()}));t.j=[];return Promise.all(n)}NE.prototype.queue=function(t,n,e,i,r){var a=this;ga(this.h);var u=(this.i.get(t)||Promise.resolve()).then((function(){var t,u,s,o,f,c,l;return _((function(h){if(1==h.g)return T(h,LE(a,n),2);t=h.h;if(a.h.g)throw new zt(2,9,7001);if(i)for(o in u=Bt(t),s=new Ua(u),s.data)f=Number(o),c=s.data[f],l=s.g[f],a.m(c,l);a.g.close(e,t.byteLength);a.o(xE(a.g),a.g.g);return h.return(r(t))}))}));this.i.set(t,u);return u};function RE(t,n,e,i,r,a){ga(t.h);var u=(t.i.get(n)||Promise.resolve()).then((function(){if(t.h.g)throw new zt(2,9,7001);if(r){var n=Bt(e);n=new Ua(n);for(var u in n.data){var s=Number(u);t.m(n.data[s],n.g[s])}}t.g.close(i,e.byteLength);t.o(xE(t.g),t.g.g);return a(e)}));t.i.set(n,u)}function DE(t){return _((function(n){return 1==n.g?T(n,Promise.all(t.i.values()),2):n.return(t.g.g)}))}function LE(t,n){var e,i,r,a;return _((function(u){if(1==u.g)return e=va,i=t.s.request(e,n),r=function(){return i.abort()},t.j.push(r),T(u,i.promise,2);a=u.h;_n(t.j,r);return u.return(a.data)}))}function OE(t,n){var e=this;this.i=t;this.h=t.objectStore(n);this.g=new qr;t.onabort=function(t){t.preventDefault();e.g.reject()};t.onerror=function(t){t.preventDefault();e.g.reject()};t.oncomplete=function(){e.g.resolve()}}OE.prototype.abort=function(){var t=this;return _((function(n){if(1==n.g){try{t.i.abort()}catch(t){}S(n,2);return T(n,t.g,4)}if(2!=n.g)return I(n,0);M(n);E(n)}))};function _E(t,n){return new Promise((function(e,i){var r=t.h.openCursor();r.onerror=i;r.onsuccess=function(){var t;return _((function(i){if(1==i.g){if(null==r.result)return e(),i.return();t=r.result;return T(i,n(t.key,t.value,t),2)}t.continue();E(i)}))}}))}OE.prototype.store=function(){return this.h};OE.prototype.promise=function(){return this.g};function UE(t){this.h=t;this.g=[]}UE.prototype.destroy=function(){return Promise.all(this.g.map((function(t){return t.abort()})))};function BE(t,n){return HE(t,n,"readwrite")}function HE(t,n,e){e=t.h.transaction([n],e);var i=new OE(e,n);t.g.push(i);i.promise().then((function(){_n(t.g,i)}),(function(){_n(t.g,i)}));return i}function FE(t,n,e){this.h=new UE(t);this.i=n;this.g=e}i=FE.prototype;i.destroy=function(){return this.h.destroy()};i.hasFixedKeySpace=function(){return true};i.addSegments=function(){return zE(this.i)};i.removeSegments=function(t,n){return XE(this,this.i,t,n)};i.getSegments=function(t){var n=this,e;return _((function(i){if(1==i.g)return T(i,qE(n,n.i,t),2);e=i.h;return i.return(e.map((function(t){return n.Lh(t)})))}))};i.addManifests=function(){return zE(this.g)};i.updateManifest=function(){return Promise.reject(new zt(2,9,9016,"Cannot modify values in "+this.g))};function VE(t,n,e){t=BE(t.h,t.g);var i=t.store();i.get(n).onsuccess=function(){i.put(e,n)};return t.promise()}i.updateManifestExpiration=function(t,n){var e=BE(this.h,this.g),i=e.store();i.get(t).onsuccess=function(e){if(e=e.target.result)e.expiration=n,i.put(e,t)};return e.promise()};i.removeManifests=function(t,n){return XE(this,this.g,t,n)};i.getManifests=function(t){var n=this,e;return _((function(i){if(1==i.g)return T(i,qE(n,n.g,t),2);e=i.h;return i.return(Promise.all(e.map((function(t){return n.Hd(t)}))))}))};i.getAllManifests=function(){var t=this,n,e;return _((function(i){return 1==i.g?(n=HE(t.h,t.g,"readonly"),e=new Map,T(i,_E(n,(function(n,i){var r;return _((function(a){if(1==a.g)return T(a,t.Hd(i),2);r=a.h;e.set(n,r);E(a)}))})),2)):3!=i.g?T(i,n.promise(),3):i.return(e)}))};i.Lh=function(t){return t};i.Hd=function(t){return Promise.resolve(t)};function zE(t){return Promise.reject(new zt(2,9,9011,"Cannot add new value to "+t))}i.add=function(t,n){var e=this,i,r,a,u,s,o,f;return _((function(l){if(1==l.g){i=BE(e.h,t);r=i.store();a=[];u=c(n);s=u.next();for(o={};!s.done;o={Yg:void 0},s=u.next())f=s.value,o.Yg=r.add(f),o.Yg.onsuccess=function(t){return function(){a.push(t.Yg.result)}}(o);return T(l,i.promise(),2)}return l.return(a)}))};function XE(t,n,e,i){t=BE(t.h,n);n=t.store();e=c(e);for(var r=e.next(),a={};!r.done;a={Kg:void 0},r=e.next())a.Kg=r.value,n.delete(a.Kg).onsuccess=function(t){return function(){return i(t.Kg)}}(a);return t.promise()}function qE(t,n,e){var i,r,a,u,s,o,f;return _((function(l){if(1==l.g){i=HE(t.h,n,"readonly");r=i.store();a={};u=[];s=c(e);o=s.next();for(f={};!o.done;f={xf:void 0,Ze:void 0},o=s.next())f.Ze=o.value,f.xf=r.get(f.Ze),f.xf.onsuccess=function(t){return function(){void 0==t.xf.result&&u.push(t.Ze);a[t.Ze]=t.xf.result}}(f);return T(l,i.promise(),2)}if(u.length)throw new zt(2,9,9012,"Could not find values for "+u);return l.return(e.map((function(t){return a[t]})))}))}function jE(t){this.g=new UE(t)}jE.prototype.destroy=function(){return this.g.destroy()};jE.prototype.getAll=function(){var t=this,n,e;return _((function(i){return 1==i.g?(n=HE(t.g,"session-ids","readonly"),e=[],T(i,_E(n,(function(t,n){e.push(n)})),2)):3!=i.g?T(i,n.promise(),3):i.return(e)}))};jE.prototype.add=function(t){var n=BE(this.g,"session-ids"),e=n.store();t=c(t);for(var i=t.next();!i.done;i=t.next())e.add(i.value);return n.promise()};jE.prototype.remove=function(t){var n=this,e;return _((function(i){return 1==i.g?(e=BE(n.g,"session-ids"),T(i,_E(e,(function(n,e,i){t.includes(e.sessionId)&&i.delete()})),2)):T(i,e.promise(),0)}))};function GE(){this.g=new Map}GE.prototype.destroy=function(){for(var t=[],n=c(this.g.values()),e=n.next();!e.done;e=n.next())t.push(e.value.destroy());this.g.clear();return Promise.all(t)};GE.prototype.init=function(){var t=this;tS.forEach((function(n,e){(n=n())&&t.g.set(e,n)}));for(var n=[],e=c(this.g.values()),i=e.next();!i.done;i=e.next())n.push(i.value.init());return Promise.all(n)};function KE(t){var n=null;t.g.forEach((function(t,e){t.getCells().forEach((function(t,i){t.hasFixedKeySpace()||n||(n={path:{Pb:e,bb:i},bb:t})}))}));if(n)return n;throw new zt(2,9,9013,"Could not find a cell that supports add-operations")}function WE(t,n){t.g.forEach((function(t,e){t.getCells().forEach((function(t,i){n({Pb:e,bb:i},t)}))}))}function $E(t,n,e){t=t.g.get(n);if(!t)throw new zt(2,9,9013,"Could not find mechanism with name "+n);n=t.getCells().get(e);if(!n)throw new zt(2,9,9013,"Could not find cell with name "+e);return n}function YE(t,n){t.g.forEach((function(t){n(t.getEmeSessionCell())}))}function QE(t){var n=Array.from(t.g.keys());if(!n.length)throw new zt(2,9,9e3,"No supported storage mechanisms found");return t.g.get(n[0]).getEmeSessionCell()}function JE(t){var n,e,i;return _((function(r){return 1==r.g?(n=Array.from(t.g.values()),e=0<n.length,e||(i=tS,i.forEach((function(t){(t=t())&&n.push(t)}))),T(r,Promise.all(n.map((function(t){return t.erase()}))),2)):e?r.u(0):T(r,Promise.all(n.map((function(t){return t.destroy()}))),0)}))}function ZE(t,n){tS.set(t,n)}q("shaka.offline.StorageMuxer",GE);GE.unregister=function(t){tS.delete(t)};GE.register=ZE;GE.prototype.destroy=GE.prototype.destroy;var tS=new Map;function nS(){FE.apply(this,arguments)}g(nS,FE);nS.prototype.updateManifestExpiration=function(t,n){var e=this,i,r,a;return _((function(u){i=BE(e.h,e.g);r=i.store();a=new qr;r.get(t).onsuccess=function(e){(e=e.target.result)?(e.expiration=n,r.put(e),a.resolve()):a.reject(new zt(2,9,9012,"Could not find values for "+t))};return T(u,Promise.all([i.promise(),a]),0)}))};nS.prototype.Hd=function(t){var n,e,i,r,a,u;return _((function(s){if(1==s.g){n=[];for(e=0;e<t.periods.length;++e)i=e==t.periods.length-1?t.duration:t.periods[e+1].startTime,r=i-t.periods[e].startTime,a=eS(t.periods[e],r),n.push(a);return T(s,kb(n),2)}u=s.h;return s.return({creationTime:0,originalManifestUri:t.originalManifestUri,duration:t.duration,size:t.size,expiration:null==t.expiration?Infinity:t.expiration,streams:u,sessionIds:t.sessionIds,drmInfo:t.drmInfo,appMetadata:t.appMetadata,sequenceMode:false})}))};function eS(t,n){aS(t);for(var e=c(t.streams),i=e.next();!i.done;i=e.next());return t.streams.map((function(e){return iS(e,t.startTime,n)}))}function iS(t,n,e){var i=t.initSegmentUri?rS(t.initSegmentUri):null,r=n+t.presentationTimeOffset,a=n+e;return{id:t.id,originalId:null,groupId:null,primary:t.primary,type:t.contentType,mimeType:t.mimeType,codecs:t.codecs,frameRate:t.frameRate,pixelAspectRatio:void 0,hdr:void 0,colorGamut:void 0,videoLayout:void 0,kind:t.kind,language:t.language,originalLanguage:t.language||null,label:t.label,width:t.width,height:t.height,initSegmentKey:i,encrypted:t.encrypted,keyIds:new Set([t.keyId]),segments:t.segments.map((function(t){var e=rS(t.uri);return{startTime:n+t.startTime,endTime:n+t.endTime,dataKey:e,initSegmentKey:i,appendWindowStart:n,appendWindowEnd:a,timestampOffset:r,tilesLayout:"",mimeType:null,codecs:null,thumbnailSprite:null}})),variantIds:t.variantIds,roles:[],forced:false,audioSamplingRate:null,channelsCount:null,spatialAudio:false,closedCaptions:null,tilesLayout:void 0,external:false,fastSwitching:false,isAudioMuxedInVideo:false}}nS.prototype.Lh=function(t){return{data:t.data}};function rS(t){var n;if((n=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(t))||(n=/^offline:segment\/([0-9]+)$/.exec(t)))return Number(n[1]);throw new zt(2,9,9004,"Could not parse uri "+t)}function aS(t){var n=t.streams.filter((function(t){return"audio"==t.contentType}));t=t.streams.filter((function(t){return"video"==t.contentType}));if(!n.every((function(t){return t.variantIds}))||!t.every((function(t){return t.variantIds}))){for(var e=c(n),i=e.next();!i.done;i=e.next())i.value.variantIds=[];e=c(t);for(i=e.next();!i.done;i=e.next())i.value.variantIds=[];e=0;if(t.length&&!n.length){i=e++;for(var r=c(t),a=r.next();!a.done;a=r.next())a.value.variantIds.push(i)}if(!t.length&&n.length)for(i=e++,r=c(n),a=r.next();!a.done;a=r.next())a.value.variantIds.push(i);if(t.length&&n.length)for(n=c(n),i=n.next();!i.done;i=n.next())for(i=i.value,r=c(t),a=r.next();!a.done;a=r.next()){a=a.value;var u=e++;i.variantIds.push(u);a.variantIds.push(u)}}}function uS(){FE.apply(this,arguments)}g(uS,FE);uS.prototype.Hd=function(t){var n,e,i,r,a,u;return _((function(s){if(1==s.g){n=[];for(e=0;e<t.periods.length;++e){i=e==t.periods.length-1?t.duration:t.periods[e+1].startTime;r=i-t.periods[e].startTime;for(var o=t.periods[e],f=[],l=c(o.streams),h=l.next();!h.done;h=l.next())h=h.value,0!=h.variantIds.length&&f.push(sS(h,o.startTime,o.startTime+r));a=f;n.push(a)}return T(s,kb(n),2)}u=s.h;return s.return({appMetadata:t.appMetadata,creationTime:0,drmInfo:t.drmInfo,duration:t.duration,expiration:null==t.expiration?Infinity:t.expiration,originalManifestUri:t.originalManifestUri,sessionIds:t.sessionIds,size:t.size,streams:u,sequenceMode:false})}))};function sS(t,n,e){return{id:t.id,originalId:t.originalId,groupId:null,primary:t.primary,type:t.contentType,mimeType:t.mimeType,codecs:t.codecs,frameRate:t.frameRate,pixelAspectRatio:t.pixelAspectRatio,hdr:void 0,colorGamut:void 0,videoLayout:void 0,kind:t.kind,language:t.language,originalLanguage:t.language||null,label:t.label,width:t.width,height:t.height,encrypted:t.encrypted,keyIds:new Set([t.keyId]),segments:t.segments.map((function(i){return{startTime:n+i.startTime,endTime:n+i.endTime,initSegmentKey:t.initSegmentKey,appendWindowStart:n,appendWindowEnd:e,timestampOffset:n-t.presentationTimeOffset,dataKey:i.dataKey,tilesLayout:"",mimeType:null,codecs:null,thumbnailSprite:null}})),variantIds:t.variantIds,roles:[],forced:false,audioSamplingRate:null,channelsCount:null,spatialAudio:false,closedCaptions:null,tilesLayout:void 0,external:false,fastSwitching:false,isAudioMuxedInVideo:false}}function oS(){FE.apply(this,arguments)}g(oS,FE);i=oS.prototype;i.hasFixedKeySpace=function(){return false};i.addSegments=function(t){return this.add(this.i,t)};i.addManifests=function(t){return this.add(this.g,t)};i.updateManifest=function(t,n){return VE(this,t,n)};i.Hd=function(t){null==t.expiration&&(t.expiration=Infinity);return Promise.resolve(t)};function fS(){this.m=this.j=this.i=this.h=this.g=this.l=null}i=fS.prototype;i.init=function(){var n=this,e=new qr,i=false,r=new Di((function(){i=true;e.reject(new zt(2,9,9017))}));"number"===typeof lS&&0<lS&&r.ha(lS);var a=t.indexedDB.open("shaka_offline_db",5);a.onsuccess=function(){if(!i){r.stop();var t=a.result;n.l=t;var u=t.objectStoreNames;u=u.contains("manifest")&&u.contains("segment")?new nS(t,"segment","manifest"):null;n.g=u;u=t.objectStoreNames;u=u.contains("manifest-v2")&&u.contains("segment-v2")?new uS(t,"segment-v2","manifest-v2"):null;n.h=u;u=t.objectStoreNames;u=u.contains("manifest-v3")&&u.contains("segment-v3")?new uS(t,"segment-v3","manifest-v3"):null;n.i=u;u=t.objectStoreNames;u=u.contains("manifest-v5")&&u.contains("segment-v5")?new oS(t,"segment-v5","manifest-v5"):null;n.j=u;t=t.objectStoreNames.contains("session-ids")?new jE(t):null;n.m=t;e.resolve()}};a.onupgradeneeded=function(){for(var t=a.result,n=c(["segment-v5","manifest-v5","session-ids"]),e=n.next();!e.done;e=n.next())e=e.value,t.objectStoreNames.contains(e)||t.createObjectStore(e,{autoIncrement:true})};a.onerror=function(t){i||(r.stop(),e.reject(new zt(2,9,9001,a.error)),t.preventDefault())};return e};i.destroy=function(){var t=this;return _((function(n){switch(n.g){case 1:if(!t.g){n.u(2);break}return T(n,t.g.destroy(),2);case 2:if(!t.h){n.u(4);break}return T(n,t.h.destroy(),4);case 4:if(!t.i){n.u(6);break}return T(n,t.i.destroy(),6);case 6:if(!t.j){n.u(8);break}return T(n,t.j.destroy(),8);case 8:if(!t.m){n.u(10);break}return T(n,t.m.destroy(),10);case 10:t.l&&t.l.close(),E(n)}}))};i.getCells=function(){var t=new Map;this.g&&t.set("v1",this.g);this.h&&t.set("v2",this.h);this.i&&t.set("v3",this.i);this.j&&t.set("v5",this.j);return t};i.getEmeSessionCell=function(){return this.m};i.erase=function(){var t=this;return _((function(n){switch(n.g){case 1:if(!t.g){n.u(2);break}return T(n,t.g.destroy(),2);case 2:if(!t.h){n.u(4);break}return T(n,t.h.destroy(),4);case 4:if(!t.i){n.u(6);break}return T(n,t.i.destroy(),6);case 6:if(!t.j){n.u(8);break}return T(n,t.j.destroy(),8);case 8:return t.l&&t.l.close(),T(n,cS(),10);case 10:return t.l=null,t.g=null,t.h=null,t.i=null,t.j=null,T(n,t.init(),0)}}))};function cS(){var n=new qr,e=t.indexedDB.deleteDatabase("shaka_offline_db");e.onblocked=function(){};e.onsuccess=function(){n.resolve()};e.onerror=function(t){n.reject(new zt(2,9,9001,e.error));t.preventDefault()};return n}var lS=5;q("shaka.offline.indexeddb.StorageMechanismOpenTimeout",lS);ZE("idb",(function(){return ft().qh()?new fS:null}));function hS(t,n,e,i){this.g=t;this.i=n;this.h=e;this.l=i;this.j=["offline:",t,"/",n,"/",e,"/",i].join("")}hS.prototype.Pb=function(){return this.i};hS.prototype.bb=function(){return this.h};hS.prototype.key=function(){return this.l};hS.prototype.toString=function(){return this.j};function dS(t){t=/^offline:([a-z]+)\/([^/]+)\/([^/]+)\/([0-9]+)$/.exec(t);if(null==t)return null;var n=t[1];if("manifest"!=n&&"segment"!=n)return null;var e=t[2];if(!e)return null;var i=t[3];return i&&null!=n?new hS(n,e,i,Number(t[4])):null}function vS(t,n){this.h=t;this.g=n}function pS(t,n){var e=new kf(null,0);e.ob(n.duration);var i=n.streams.filter((function(t){return"audio"==t.type})),r=n.streams.filter((function(t){return"video"==t.type}));i=mS(t,i,r,e);r=n.streams.filter((function(t){return t.type==hn})).map((function(n){return wS(t,n,e)}));var a=n.streams.filter((function(t){return"image"==t.type})).map((function(n){return wS(t,n,e)})),u=n.drmInfo?[n.drmInfo]:[];if(n.drmInfo)for(var s=c(i.values()),o=s.next();!o.done;o=s.next())o=o.value,o.audio&&o.audio.encrypted&&(o.audio.drmInfos=u),o.video&&o.video.encrypted&&(o.video.drmInfos=u);return{presentationTimeline:e,offlineSessionIds:n.sessionIds,variants:Array.from(i.values()),textStreams:r,imageStreams:a,sequenceMode:n.sequenceMode||false,ignoreManifestTimestampsInSegmentsMode:false,type:n.type||"UNKNOWN",serviceDescription:null,nextUrl:null,periodCount:1,gapCount:0,isLowLatency:false,startTime:null}}function mS(t,n,e,i){for(var r=new Set,a=c(n),u=a.next();!u.done;u=a.next()){u=c(u.value.variantIds);for(var s=u.next();!s.done;s=u.next())r.add(s.value)}a=c(e);for(u=a.next();!u.done;u=a.next())for(u=c(u.value.variantIds),s=u.next();!s.done;s=u.next())r.add(s.value);a=new Map;r=c(r);for(u=r.next();!u.done;u=r.next())u=u.value,a.set(u,{id:u,language:"",disabledUntilTime:0,primary:false,audio:null,video:null,bandwidth:0,allowedByApplication:true,allowedByKeySystem:true,decodingInfos:[]});n=c(n);for(r=n.next();!r.done;r=n.next())for(u=r.value,r=wS(t,u,i),u=c(u.variantIds),s=u.next();!s.done;s=u.next())s=a.get(s.value),s.language=r.language,s.primary=s.primary||r.primary,s.audio=r;e=c(e);for(n=e.next();!n.done;n=e.next())for(r=n.value,n=wS(t,r,i),r=c(r.variantIds),u=r.next();!u.done;u=r.next())u=a.get(u.value),u.primary=u.primary||n.primary,u.video=n;return a}function wS(t,n,e){var i=n.segments.map((function(e){return gS(t,e,n)}));e.Yd(i);return{id:n.id,originalId:n.originalId,groupId:n.groupId,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new jf(i),mimeType:n.mimeType,codecs:n.codecs,width:n.width||void 0,height:n.height||void 0,frameRate:n.frameRate,pixelAspectRatio:n.pixelAspectRatio,hdr:n.hdr,colorGamut:n.colorGamut,videoLayout:n.videoLayout,kind:n.kind,encrypted:n.encrypted,drmInfos:[],keyIds:n.keyIds,language:n.language,originalLanguage:n.originalLanguage||null,label:n.label,type:n.type,primary:n.primary,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:n.roles,forced:n.forced,channelsCount:n.channelsCount,audioSamplingRate:n.audioSamplingRate,spatialAudio:n.spatialAudio,closedCaptions:n.closedCaptions,tilesLayout:n.tilesLayout,mssPrivateData:n.mssPrivateData,accessibilityPurpose:null,external:n.external,fastSwitching:n.fastSwitching,fullMimeTypes:new Set([li(n.mimeType,n.codecs)]),isAudioMuxedInVideo:false,baseOriginalId:null}}function gS(t,n,e){var i=new hS("segment",t.h,t.g,n.dataKey);t=new Ls(n.startTime,n.endTime,(function(){return[i.toString()]}),0,null,null!=n.initSegmentKey?bS(t,n.initSegmentKey):null,n.timestampOffset,n.appendWindowStart,n.appendWindowEnd,[],n.tilesLayout||"");t.mimeType=n.mimeType||e.mimeType||"";t.codecs=n.codecs||e.codecs||"";n.thumbnailSprite&&t.Ef(n.thumbnailSprite);return t}function bS(t,n){var e=new hS("segment",t.h,t.g,n);return new Rs((function(){return[e.toString()]}),0,null)}function yS(){this.g=null}i=yS.prototype;i.configure=function(){};i.start=function(t,n){var e=this,i,r,a,u,s,o,f;return _((function(c){switch(c.g){case 1:i=dS(t);e.g=i;if(null==i||"manifest"!=i.g)throw new zt(2,1,9004,t);r=new GE;A(c,2);return T(c,r.init(),4);case 4:return T(c,$E(r,i.Pb(),i.bb()),5);case 5:return a=c.h,T(c,a.getManifests([i.key()]),6);case 6:return u=c.h,s=u[0],o=new vS(i.Pb(),i.bb()),f=pS(o,s),n.makeTextStreamsForClosedCaptions(f),c.return(f);case 2:return x(c),T(c,r.destroy(),7);case 7:N(c,0)}}))};i.stop=function(){return Promise.resolve()};i.update=function(){};i.onExpirationUpdated=function(t,n){var e=this,i,r,a,u,s,o,f;return _((function(c){switch(c.g){case 1:return i=e.g,r=new GE,S(c,2,3),T(c,r.init(),5);case 5:return T(c,$E(r,i.Pb(),i.bb()),6);case 6:return a=c.h,T(c,a.getManifests([i.key()]),7);case 7:u=c.h;s=u[0];o=s.sessionIds.includes(t);f=void 0==s.expiration||s.expiration>n;if(!o||!f){c.u(3);break}return T(c,a.updateManifestExpiration(i.key(),n),3);case 3:return x(c),T(c,r.destroy(),10);case 10:N(c,0);break;case 2:M(c),c.u(3)}}))};i.onInitialVariantChosen=function(){};i.banLocation=function(){};i.setMediaElement=function(){};Hu("application/x-offline-manifest",(function(){return new yS}));function kS(){}function TS(t,n){var e=dS(t);e&&"manifest"==e.g?(t={uri:t,originalUri:t,data:new ArrayBuffer(0),headers:{"content-type":"application/x-offline-manifest"},originalRequest:n},t=Wr(t)):t=e&&"segment"==e.g?ES(e.key(),e,n):Gr(new zt(2,1,9004,t));return t}function ES(t,n,e){var i=new GE;return Wr(void 0).Ua((function(){return i.init()})).Ua((function(){return $E(i,n.Pb(),n.bb())})).Ua((function(t){return t.getSegments([n.key()])})).Ua((function(t){return{uri:n,data:t[0].data,headers:{},originalRequest:e}})).finally((function(){return i.destroy()}))}q("shaka.offline.OfflineScheme",kS);kS.plugin=TS;aa("offline",TS);function SS(t,n,e){var i,r,a,u,s,o;return _((function(f){switch(f.g){case 1:i=[];for(var l=[],h=c(e),d=h.next();!d.done;d=h.next()){d=d.value;for(var v=false,p=c(l),m=p.next();!m.done;m=p.next())if(m=m.value,IS(m.info,d)){m.sessionIds.push(d.sessionId);v=true;break}v||l.push({info:d,sessionIds:[d.sessionId]})}r=c(l);a=r.next();case 2:if(a.done){f.u(4);break}u=a.value;s=AS(t,n,u);return T(f,s,5);case 5:o=f.h;i=i.concat(o);a=r.next();f.u(2);break;case 4:return f.return(i)}}))}function AS(t,n,e){var i,r;return _((function(a){switch(a.g){case 1:return i=new Ha({pc:n,onError:function(){},nf:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),S(a,2),i.configure(t),T(a,Xa(i,e.info.keySystem,e.info.licenseUri,e.info.serverCertificate,e.info.audioCapabilities,e.info.videoCapabilities),4);case 4:I(a,3);break;case 2:return M(a),T(a,i.destroy(),5);case 5:return a.return([]);case 3:return r=[],T(a,Promise.all(e.sessionIds.map((function(t){return _((function(n){if(1==n.g)return S(n,2),T(n,Wa(i,t),4);if(2!=n.g)return r.push(t),I(n,0);M(n);E(n)}))}))),6);case 6:return T(a,i.destroy(),7);case 7:return a.return(r)}}))}function IS(t,n){function e(t,n){return t.robustness==n.robustness&&t.contentType==n.contentType}return t.keySystem==n.keySystem&&t.licenseUri==n.licenseUri&&Un(t.audioCapabilities,n.audioCapabilities,e)&&Un(t.videoCapabilities,n.videoCapabilities,e)}function MS(t,n,e){var i=n.presentationTimeline.getDuration();n=NS(n);return{offlineUri:null,originalManifestUri:t,duration:i,size:0,expiration:Infinity,tracks:n,appMetadata:e,isIncomplete:false}}function xS(t,n){var e=pS(new vS(t.Pb(),t.bb()),n),i=n.appMetadata||{};e=NS(e);return{offlineUri:t.toString(),originalManifestUri:n.originalManifestUri,duration:n.duration,size:n.size,expiration:n.expiration,tracks:e,appMetadata:i,isIncomplete:n.isIncomplete||false}}function NS(t){var n=[],e=br(t.variants);e=c(e);for(var i=e.next();!i.done;i=e.next())n.push(hr(i.value));t=c(t.textStreams);for(e=t.next();!e.done;e=t.next())n.push(dr(e.value));return n}function CS(){this.g=new Map}function PS(t,n){var e=n.audio,i=n.video;e&&!i&&t.g.set(e.id,e.bandwidth||n.bandwidth);!e&&i&&t.g.set(i.id,i.bandwidth||n.bandwidth);if(e&&i){var r=e.bandwidth||393216,a=i.bandwidth||n.bandwidth-r;0>=a&&(a=n.bandwidth);t.g.set(e.id,r);t.g.set(i.id,a)}}function RS(t,n){t.g.set(n.id,n.bandwidth||2048)}function DS(t,n){t=t.g.get(n);null==t&&(t=0);return t}function LS(t){var n=this;if(t&&t.constructor!=Rd)throw new zt(2,9,9008);this.g=this.h=null;t?(this.h=t.g,this.g=t.Nb()):(this.h=Ul(),this.g=new ra,this.g.configure(this.h.networking));this.i=[];this.l=[];var e=!t;this.j=new wa((function(){var t,i,r,a,u;return _((function(s){switch(s.g){case 1:return T(s,Promise.all(n.l.map((function(t){return PE(t)}))),2);case 2:t=function(){};i=[];r=c(n.i);for(a=r.next();!a.done;a=r.next())u=a.value,i.push(u.then(t,t));return T(s,Promise.all(i),3);case 3:if(!e){s.u(4);break}return T(s,n.g.destroy(),4);case 4:n.h=null,n.g=null,E(s)}}))}));this.m=1e9}function OS(){if(qy(ft()))t:{var t=c(tS.values());for(var n=t.next();!n.done;n=t.next())if(n=n.value,n=n()){n.destroy();t=true;break t}t=false}else t=false;return t}i=LS.prototype;i.destroy=function(){return this.j.destroy()};i.configure=function(t,n){2==arguments.length&&"string"==typeof t&&(t=gl(t,n));return Hl(this.h,t)};i.getConfiguration=function(){var t=Ul();Hl(t,this.h,Ul());return t};i.Nb=function(){return this.g};i.store=function(t,n,e,i,r){var a=this,u=this.getConfiguration(),s=new NE(this.g);this.l.push(s);n=_S(this,t,n||{},i||[],r||[],(function(){var n;return _((function(i){if(1==i.g)return e?i.u(2):T(i,yh(t,a.g,u.manifest.retryParameters),3);2!=i.g&&(e=i.h);n=Vu(t,e||null);return i.return(n())}))}),u,s);n=new jr(n,(function(){return PE(s)}));n.finally((function(){_n(a.l,s)}));return oA(this,n)};function _S(t,n,e,i,r,a,u,s){var o,f,l,h,d,v,p,m,w,g,b,y,k,E,A,I,C,P,R,D,L,O,U,B;return _((function(_){switch(_.g){case 1:return uA(),f=o=null,l=new GE,v=d=h=null,S(_,2,3),T(_,a(),5);case 5:return o=_.h,T(_,QS(t,n,o,u),6);case 6:p=_.h;aA(t);m=!p.presentationTimeline.V()&&!p.presentationTimeline.Sc();if(!m)throw new zt(2,9,9005,n);w=c(i);g=w.next();case 7:if(g.done){_.u(9);break}b=g.value;return T(_,JS(t,b,p),10);case 10:y=_.h;p.imageStreams.push(y);aA(t);g=w.next();_.u(7);break;case 9:k=c(r),E=k.next();case 11:if(E.done)return yu(u.drm.clearKeys,p.variants),C=p.variants.some((function(t){if(t.audio)for(var n=c(t.audio.drmInfos),e=n.next();!e.done;e=n.next())if(e.value.licenseServerUri.startsWith("data:"))return true;if(t.video)for(t=c(t.video.drmInfos),n=t.next();!n.done;n=t.next())if(n.value.licenseServerUri.startsWith("data:"))return true;return false})),P=u.offline.usePersistentLicense,C&&(P=false),T(_,t.ed(p,(function(t){v=v||t}),u,P),15);A=E.value;return T(_,ZS(t,p,A.uri,A.language,A.kind,A.mime,A.codecs),14);case 14:I=_.h;p.textStreams.push(I);aA(t);E=k.next();_.u(11);break;case 15:f=_.h;aA(t);if(v)throw v;return T(_,FS(p,f,u,P),16);case 16:return T(_,l.init(),17);case 17:return aA(t),T(_,KE(l),18);case 18:return h=_.h,aA(t),R=VS(f,p,n,e,u,s,P),D=R.kk,L=R.vh,T(_,h.bb.addManifests([D]),19);case 19:O=_.h;aA(t);d=O[0];aA(t);if(v)throw v;return T(_,US(t,L,d,D,s,u,h.bb,p,f,P),20);case 20:return aA(t),qS(p,D,f,P),T(_,h.bb.updateManifest(d,D),21);case 21:return aA(t),U=new hS("manifest",h.path.Pb,h.path.bb,d),_.return(xS(U,D));case 3:return x(_),T(_,l.destroy(),22);case 22:if(!o){_.u(23);break}return T(_,o.stop(),23);case 23:if(!f){_.u(25);break}return T(_,f.destroy(),25);case 25:N(_,0);break;case 2:B=M(_);if(null==d){_.u(27);break}return T(_,BS(d),27);case 27:throw v||B}}))}function US(t,n,e,i,r,a,u,s,o,f){var l,h,d,v,p,m,w,g,b,y,k;return _((function(A){switch(A.g){case 1:l={};h=0;d=function(){if(t.j.g||r.l)throw new zt(2,9,7001)};v=function(t,n){var v,p,m,w,g,b,y,k,S;return _((function(A){if(1==A.g){v=c(t);p=v.next();for(m={};!p.done;m={hc:void 0},p=v.next())m.hc=p.value,d(),w=AE(m.hc,a),g=m.hc.i,b=m.hc.h,y=function(t){return function(n){var e,i,r,a;return _((function(s){switch(s.g){case 1:e=t.hc.g;i=e.Wb(false);if(!e.aesKey||i){s.u(2);break}return T(s,xc(n,e.aesKey,t.hc.j),3);case 3:n=s.h;case 2:return r=SE(e),T(s,u.addSegments([{data:n}]),4);case 4:a=s.h,d(),l[r]=a[0],h+=n.byteLength,E(s)}}))}}(m),k=m.hc.g,(S=k.Wb(false))?RE(r,m.hc.groupId,S,g,b,y):r.queue(m.hc.groupId,w,g,b,y);return T(A,DE(r),2)}d();if(!n||r.l)return A.u(0);qS(s,i,o,f);return T(A,u.updateManifest(e,i),0)}))};p=false;S(A,2);if(!zS(s)||!p||XS(s)){A.u(4);break}return T(A,v(n.filter((function(t){return t.h})),true),5);case 5:return d(),n=n.filter((function(t){return!t.h})),m=l,w=h,l={},h=0,T(A,HS(u,e,i,m,w,(function(){return aA(t)})),6);case 6:d();case 4:if(p){A.u(7);break}return T(A,v(n,false),8);case 8:return d(),g=l,b=h,l={},h=0,T(A,HS(u,e,i,g,b,(function(){return d()})),9);case 9:d();case 7:I(A,0);break;case 2:return y=M(A),k=Object.values(l),T(A,u.removeSegments(k,(function(){})),10);case 10:throw y}}))}function BS(t){var n,e,i,r;return _((function(a){switch(a.g){case 1:return n=new GE,T(a,n.init(),2);case 2:return T(a,KE(n),3);case 3:return e=a.h,i=new hS("manifest",e.path.Pb,e.path.bb,t),T(a,n.destroy(),4);case 4:return r=new LS,T(a,r.remove(i.toString()),0)}}))}function HS(t,n,e,i,r,a){var u,s,o,f,l,h,d,v,p,m,w;return _((function(g){switch(g.g){case 1:u=false;S(g,2);s=true;o=c(e.streams);for(f=o.next();!f.done;f=o.next())for(l=f.value,h=c(l.segments),d=h.next();!d.done;d=h.next())v=d.value,p=v.pendingSegmentRefId?i[v.pendingSegmentRefId]:null,null!=p&&(v.dataKey=p,v.pendingSegmentRefId=void 0),p=v.pendingInitSegmentRefId?i[v.pendingInitSegmentRefId]:null,null!=p&&(v.initSegmentKey=p,v.pendingInitSegmentRefId=void 0),v.pendingSegmentRefId&&(s=false),v.pendingInitSegmentRefId&&(s=false);e.size+=r;s&&(e.isIncomplete=false);return T(g,t.updateManifest(n,e),4);case 4:u=true;a();I(g,0);break;case 2:return m=M(g),T(g,BS(n),5);case 5:if(u){g.u(6);break}w=Object.values(i);return T(g,t.removeSegments(w,(function(){})),6);case 6:throw m}}))}function FS(t,n,e,i){var r,a,u,s,o,f,l,h,d,v,p,m,w,g,b,y,k,A,x,N,C,P,R,D,L,O,U,B,H,F;return _((function(_){switch(_.g){case 1:return r={width:Infinity,height:Infinity},Qi(t,e.restrictions,r),T(_,tr(n,t,i,e.drm.preferredKeySystems,e.drm.keySystemsMapping),2);case 2:a=[];u=e.preferredDecodingAttributes;s=e.preferredVideoCodecs;o=e.preferredAudioCodecs;f=e.preferredTextFormats;$i(t,s,o,u,f);l=c(t.variants);for(h=l.next();!h.done;h=l.next())d=h.value,a.push(hr(d));v=c(t.textStreams);for(p=v.next();!p.done;p=v.next())m=p.value,a.push(dr(m));w=c(t.imageStreams);for(g=w.next();!g.done;g=w.next())b=g.value,a.push(vr(b));return T(_,e.offline.trackSelectionCallback(a),3);case 3:y=_.h;k=t.presentationTimeline.getDuration();A=0;x=c(y);for(N=x.next();!N.done;N=x.next())C=N.value,P=C.bandwidth*k/8,A+=P;S(_,4);return T(_,e.offline.downloadSizeCallback(A),6);case 6:R=_.h;if(!R)throw new zt(2,9,9014);I(_,5);break;case 4:D=M(_);if(D instanceof zt)throw D;throw new zt(2,9,9015);case 5:L=new Set;O=new Set;U=new Set;B=c(y);for(H=B.next();!H.done;H=B.next())F=H.value,"variant"==F.type&&L.add(F.id),"text"==F.type&&O.add(F.id),"image"==F.type&&U.add(F.id);t.variants=t.variants.filter((function(t){return L.has(t.id)}));t.textStreams=t.textStreams.filter((function(t){return O.has(t.id)}));t.imageStreams=t.imageStreams.filter((function(t){return U.has(t.id)}));hA(t);E(_)}}))}function VS(t,n,e,i,r,a,u){var s=MS(e,n,i),o=r.offline.progressCallback;CE(a,(function(t,n){s.size=n;o(s,t)}),(function(n,e){f&&u&&l==e&&Ya(t,"cenc",n)}));var f=zS(n)&&!XS(n),l=null;f&&(l=dA.get(t.g.keySystem));for(var h=new CS,d=c(n.textStreams),v=d.next();!v.done;v=d.next())h.g.set(v.value.id,52);d=c(n.imageStreams);for(v=d.next();!v.done;v=d.next())RS(h,v.value);d=c(n.variants);for(v=d.next();!v.done;v=d.next())PS(h,v.value);a=eA(a,h,n,r);r=a.streams;a=a.vh;(h=t.g)&&u&&(h.initData=[]);return{kk:{creationTime:Date.now(),originalManifestUri:e,duration:n.presentationTimeline.getDuration(),size:0,expiration:t.Nd(),streams:r,sessionIds:u?Qa(t):[],drmInfo:h,appMetadata:i,isIncomplete:true,sequenceMode:n.sequenceMode,type:n.type},vh:a}}function zS(t){return t.variants.some((function(t){var n=t.audio&&t.audio.encrypted;return t.video&&t.video.encrypted||n}))}function XS(t){return t.variants.some((function(t){return(t.video?t.video.drmInfos:[]).concat(t.audio?t.audio.drmInfos:[]).some((function(t){return t.initData&&t.initData.length}))}))}function qS(t,n,e,i){n.expiration=e.Nd();e=Qa(e);n.sessionIds=i?e:[];if(zS(t)&&i&&!e.length)throw new zt(2,9,9007)}i.remove=function(t){return sA(this,jS(this,t))};function jS(t,n){var e,i,r,a,u,s;return _((function(o){switch(o.g){case 1:uA();e=dS(n);if(null==e||"manifest"!=e.g)throw new zt(2,9,9004,n);i=e;r=new GE;A(o,2);return T(o,r.init(),4);case 4:return T(o,$E(r,i.Pb(),i.bb()),5);case 5:return a=o.h,T(o,a.getManifests([i.key()]),6);case 6:return u=o.h,s=u[0],T(o,Promise.all([KS(t,s,r),WS(a,i,s)]),2);case 2:return x(o),T(o,r.destroy(),8);case 8:N(o,0)}}))}function GS(t,n){for(var e=[],i=c(t.streams),r=i.next();!r.done;r=i.next())r=r.value,n&&"video"==r.type?e.push({contentType:li(r.mimeType,r.codecs),robustness:t.drmInfo.videoRobustness}):n||"audio"!=r.type||e.push({contentType:li(r.mimeType,r.codecs),robustness:t.drmInfo.audioRobustness});return e}function KS(t,n,e){return _((function(i){return T(i,cA(t.g,t.h.drm,e,n),0)}))}function WS(t,n,e){function i(){}var r=fA(e);xS(n,e);return Promise.all([t.removeSegments(r,i),t.removeManifests([n.key()],i)])}i.Hk=function(){return sA(this,$S(this))};function $S(t){var n,e,i,r,a,u,s,o,f,l;return _((function(h){switch(h.g){case 1:return uA(),n=t.g,e=t.h.drm,i=new GE,r=false,A(h,2),T(h,i.init(),4);case 4:a=[],YE(i,(function(t){return a.push(t)})),u=c(a),s=u.next();case 5:if(s.done){h.u(2);break}o=s.value;return T(h,o.getAll(),8);case 8:return f=h.h,T(h,SS(e,n,f),9);case 9:return l=h.h,T(h,o.remove(l),10);case 10:l.length!=f.length&&(r=true);s=u.next();h.u(5);break;case 2:return x(h),T(h,i.destroy(),11);case 11:N(h,3);break;case 3:return h.return(!r)}}))}i.list=function(){return sA(this,YS())};function YS(){var t,n,e;return _((function(i){switch(i.g){case 1:return uA(),t=[],n=new GE,A(i,2),T(i,n.init(),4);case 4:return e=Promise.resolve(),WE(n,(function(n,i){e=e.then((function(){var e;return _((function(r){if(1==r.g)return T(r,i.getAllManifests(),2);e=r.h;e.forEach((function(e,i){e=xS(new hS("manifest",n.Pb,n.bb,i),e);t.push(e)}));E(r)}))}))})),T(i,e,2);case 2:return x(i),T(i,n.destroy(),6);case 6:N(i,3);break;case 3:return i.return(t)}}))}function QS(t,n,e,i){var r,a,u,s,o;return _((function(f){if(1==f.g)return r=null,a=t.g,u={networkingEngine:a,filter:function(){return Promise.resolve()},makeTextStreamsForClosedCaptions:function(){},onTimelineRegionAdded:function(){},onEvent:function(){},onError:function(t){r=t},isLowLatencyMode:function(){return false},updateDuration:function(){},newDrmInfo:function(){},onManifestUpdated:function(){},getBandwidthEstimate:function(){return i.abr.defaultBandwidthEstimate},onMetadata:function(){},disableStream:function(){},addFont:function(){}},e.configure(i.manifest),aA(t),T(f,e.start(n,u),2);if(3!=f.g)return s=f.h,aA(t),o=lA(s),T(f,Promise.all(ba(o,(function(t){return t.createSegmentIndex()}))),3);aA(t);if(r)throw r;return f.return(s)}))}function JS(t,n,e){var i,r,a,u,s,o,f,l,h,d,v,p,m,w,g;return _((function(b){switch(b.g){case 1:return T(b,tA(t,n),2);case 2:i=b.h;if("text/vtt"!=i)throw new zt(1,2,2017,n);return T(b,nA(n,t.g,t.h.streaming.retryParameters),3);case 3:r=b.h;a=Si(i);if(!a)throw new zt(2,2,2014,i);u=a();s={periodStart:0,segmentStart:0,segmentEnd:e.presentationTimeline.getDuration(),vttOffset:0};o=Bt(r);f=u.parseMedia(o,s,n,[]);l=[];h=c(f);d=h.next();for(v={};!d.done;v={Lf:void 0,gd:void 0},d=h.next())v.gd=d.value,v.Lf=null,p=function(t){return function(){null==t.Lf&&(t.Lf=un([n],[t.gd.payload]));return t.Lf||[]}}(v),m=new Ls(v.gd.startTime,v.gd.endTime,p,0,null,null,0,0,Infinity),v.gd.payload.includes("#xywh")&&(w=v.gd.payload.split("#xywh=")[1].split(","),4===w.length&&m.Ef({height:parseInt(w[3],10),positionX:parseInt(w[0],10),positionY:parseInt(w[1],10),width:parseInt(w[2],10)})),l.push(m);g=i;if(!l.length){b.u(4);break}return T(b,yh(l[0].O()[0],t.g,t.h.manifest.retryParameters),5);case 5:g=b.h;case 4:return b.return({id:t.m++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new jf(l),mimeType:g||"",codecs:"",kind:"",encrypted:false,drmInfos:[],keyIds:new Set,language:"und",originalLanguage:null,label:null,type:"image",primary:false,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:false,channelsCount:null,audioSamplingRate:null,spatialAudio:false,closedCaptions:null,tilesLayout:"1x1",accessibilityPurpose:null,external:true,fastSwitching:false,fullMimeTypes:new Set([li(g||"","")]),isAudioMuxedInVideo:false,baseOriginalId:null})}}))}function ZS(t,n,e,i,r,a,u){var s,o,f;return _((function(c){if(1==c.g)return a?c.u(2):T(c,tA(t,e),3);2!=c.g&&(a=c.h);s={id:t.m++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:Kf(0,n.presentationTimeline.getDuration(),[e]),mimeType:a||"",codecs:u||"",kind:r,encrypted:false,drmInfos:[],keyIds:new Set,language:i,originalLanguage:i,label:null,type:hn,primary:false,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:false,channelsCount:null,audioSamplingRate:null,spatialAudio:false,closedCaptions:null,accessibilityPurpose:null,external:true,fastSwitching:false,fullMimeTypes:new Set([li(a||"",u||"")]),isAudioMuxedInVideo:false,baseOriginalId:null};o=li(s.mimeType,s.codecs);f=Ai(o);if(!f)throw new zt(2,2,2014,a);return c.return(s)}))}function tA(t,n){var e;return _((function(i){switch(i.g){case 1:return S(i,2),T(i,yh(n,t.g,t.h.streaming.retryParameters),4);case 4:e=i.h;I(i,3);break;case 2:M(i);case 3:if(e)return i.return(e);throw new zt(1,2,2011,n)}}))}function nA(t,n,e){var i,r,a;return _((function(u){if(1==u.g)return i=va,r=sa([t],e),r.method="GET",T(u,n.request(i,r).promise,2);a=u.h;return u.return(a.data)}))}i.ed=function(t,n,e,i){var r=this,a;return _((function(u){return 1==u.g?(a=new Ha({pc:r.g,onError:n,nf:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),a.configure(e.drm),T(u,Va(a,t.variants,i),2)):3!=u.g?T(u,$a(a),3):u.return(a)}))};function eA(t,n,e,i){var r=new Map,a=lA(e),u=new Map;a=c(a);for(var s=a.next();!s.done;s=a.next()){s=s.value;var o=iA(t,n,e,s,i,r);u.set(s.id,o)}t=c(e.variants);for(n=t.next();!n.done;n=t.next())n=n.value,n.audio&&u.get(n.audio.id).variantIds.push(n.id),n.video&&u.get(n.video.id).variantIds.push(n.id);return{streams:Array.from(u.values()),vh:Array.from(r.values())}}function iA(t,n,e,i,r,a){var u={id:i.id,originalId:i.originalId,groupId:i.groupId,primary:i.primary,type:i.type,mimeType:i.mimeType,codecs:i.codecs,frameRate:i.frameRate,pixelAspectRatio:i.pixelAspectRatio,hdr:i.hdr,colorGamut:i.colorGamut,videoLayout:i.videoLayout,kind:i.kind,language:i.language,originalLanguage:i.originalLanguage,label:i.label,width:i.width||null,height:i.height||null,encrypted:i.encrypted,keyIds:i.keyIds,segments:[],variantIds:[],roles:i.roles,forced:i.forced,channelsCount:i.channelsCount,audioSamplingRate:i.audioSamplingRate,spatialAudio:i.spatialAudio,closedCaptions:i.closedCaptions,tilesLayout:i.tilesLayout,mssPrivateData:i.mssPrivateData,external:i.external,fastSwitching:i.fastSwitching,isAudioMuxedInVideo:i.isAudioMuxedInVideo},s=r.offline.numberOfParallelDownloads,o=0===s?i.id:0;rA(i,e.presentationTimeline.Fb(),(function(e,r){var f=SE(e),c=void 0;if(!a.has(f)){var l=e.endTime-e.startTime;l=DS(n,i.id)*l;l=ME(t.g,l);a.set(f,new EE(e,l,o,false,r))}e.Y&&(c=SE(e.Y),a.has(c)||(l=.5*DS(n,i.id),l=ME(t.g,l),a.set(c,new EE(e.Y,l,o,true,r))));u.segments.push({pendingInitSegmentRefId:c,initSegmentKey:c?0:null,startTime:e.startTime,endTime:e.endTime,appendWindowStart:e.appendWindowStart,appendWindowEnd:e.appendWindowEnd,timestampOffset:e.timestampOffset,tilesLayout:e.tilesLayout,pendingSegmentRefId:f,dataKey:0,mimeType:e.mimeType,codecs:e.codecs,thumbnailSprite:e.thumbnailSprite});0!==s&&(o=(o+1)%s)}));return u}function rA(t,n,e){n=t.segmentIndex.find(n);if(null!=n)for(var i=t.segmentIndex.get(n);i;)e(i,n),i=t.segmentIndex.get(++n)}function aA(t){if(t.j.g)throw new zt(2,9,7001)}function uA(){if(!OS())throw new zt(2,9,9e3)}function sA(t,n){return _((function(e){if(1==e.g)return t.i.push(n),A(e,2),T(e,n,4);if(2!=e.g)return e.return(e.h);x(e);_n(t.i,n);return N(e,0)}))}function oA(t,n){var e=n.promise;t.i.push(e);return n.finally((function(){_n(t.i,e)}))}function fA(t){var n=new Set;t=c(t.streams);for(var e=t.next();!e.done;e=t.next()){e=c(e.value.segments);for(var i=e.next();!i.done;i=e.next())i=i.value,null!=i.initSegmentKey&&n.add(i.initSegmentKey),n.add(i.dataKey)}return Array.from(n)}function cA(t,n,e,i){var r,a,u;return _((function(s){if(1==s.g){if(!i.drmInfo)return s.return();r=QE(e);a=i.sessionIds.map((function(t){return{sessionId:t,keySystem:i.drmInfo.keySystem,licenseUri:i.drmInfo.licenseServerUri,serverCertificate:i.drmInfo.serverCertificate,audioCapabilities:GS(i,false),videoCapabilities:GS(i,true)}}));return T(s,SS(n,t,a),2)}return 3!=s.g?(u=s.h,T(s,r.remove(u),3)):T(s,r.add(a.filter((function(t){return!u.includes(t.sessionId)}))),0)}))}function lA(t){for(var n=new Set,e=c(t.variants),i=e.next();!i.done;i=e.next())i=i.value,i.audio&&n.add(i.audio),i.video&&n.add(i.video);e=c(t.textStreams);for(i=e.next();!i.done;i=e.next())n.add(i.value);t=c(t.imageStreams);for(e=t.next();!e.done;e=t.next())n.add(e.value);return n}function hA(t){t.variants.map((function(t){return t.video}));var n=new Set(t.variants.map((function(t){return t.audio})));t=t.textStreams;for(var e=c(n),i=e.next();!i.done;i=e.next()){i=c(n);for(var r=i.next();!r.done;r=i.next());}n=c(t);for(e=n.next();!e.done;e=n.next())for(e=c(t),i=e.next();!i.done;i=e.next());}q("shaka.offline.Storage",LS);LS.deleteAll=function(){var t;return _((function(n){return 1==n.g?(t=new GE,A(n,2),T(n,JE(t),2)):5!=n.g?(x(n),T(n,t.destroy(),5)):N(n,0)}))};LS.prototype.list=LS.prototype.list;LS.prototype.removeEmeSessions=LS.prototype.Hk;LS.prototype.remove=LS.prototype.remove;LS.prototype.store=LS.prototype.store;LS.prototype.getNetworkingEngine=LS.prototype.Nb;LS.prototype.getConfiguration=LS.prototype.getConfiguration;LS.prototype.configure=LS.prototype.configure;LS.prototype.destroy=LS.prototype.destroy;LS.support=OS;var dA=(new Map).set("org.w3.clearkey","1077efecc0b24d02ace33c1e52e2fb4b").set("com.widevine.alpha","edef8ba979d64acea3c827dcd51d21ed").set("com.microsoft.playready","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.recommendation","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.software","9a04f07998404286ab92e65be0885f95").set("com.microsoft.playready.hardware","9a04f07998404286ab92e65be0885f95").set("com.huawei.wiseplay","3d5e6d359b9a41e8b843dd3c6e72c42c");_d("offline",OS);function vA(){}function pA(t,n){t={priority:n||0,callback:t};for(n=0;n<mA.length;n++)if(mA[n].priority<t.priority){mA.splice(n,0,t);return}mA.push(t)}q("shaka.polyfill",vA);vA.register=pA;vA.installAll=function(){for(var t=c(mA),n=t.next();!n.done;n=t.next()){n=n.value;try{n.callback()}catch(t){Y("Error installing polyfill!",t)}}};var mA=[];function wA(){}function gA(){if(!Object.getOwnPropertyDescriptor(Element.prototype,"ariaHidden"))for(var t=c(["ariaHidden","ariaLabel","ariaPressed","ariaSelected"]),n=t.next();!n.done;n=t.next())bA(n.value)}function bA(t){var n="aria-"+t.toLowerCase().replace(/^aria/,"");Object.defineProperty(Element.prototype,t,{get:function(){return this.getAttribute(n)},set:function(t){null==t||void 0==t?this.removeAttribute(n):this.setAttribute(n,t)}})}vA.Aria=wA;wA.install=gA;pA(gA);function yA(){}function kA(){ft().ph()&&Jx()}vA.EncryptionScheme=yA;yA.install=kA;pA(kA,-2);function TA(){}function EA(){if(t.Document){var n=Element.prototype;n.requestFullscreen=n.requestFullscreen||n.mozRequestFullScreen||n.msRequestFullscreen||n.webkitRequestFullscreen;n=Document.prototype;n.exitFullscreen=n.exitFullscreen||n.mozCancelFullScreen||n.msExitFullscreen||n.webkitCancelFullScreen;"fullscreenElement"in document||(Object.defineProperty(document,"fullscreenElement",{get:function(){return document.mozFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement||document.webkitFullscreenElement}}),Object.defineProperty(document,"fullscreenEnabled",{get:function(){return document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled}}));document.addEventListener("webkitfullscreenchange",SA);document.addEventListener("webkitfullscreenerror",SA);document.addEventListener("mozfullscreenchange",SA);document.addEventListener("mozfullscreenerror",SA);document.addEventListener("MSFullscreenChange",SA);document.addEventListener("MSFullscreenError",SA)}}function SA(t){var n=t.type.replace(/^(webkit|moz|MS)/,"").toLowerCase(),e=document.createEvent("Event");e.initEvent(n,t.bubbles,t.cancelable);t.target.dispatchEvent(e)}vA.Fullscreen=TA;TA.install=EA;pA(EA);function AA(){}function IA(){ft().bc()||(navigator.mediaCapabilities||(navigator.mediaCapabilities={}),AA.originalMcap=navigator.mediaCapabilities,navigator.mediaCapabilities.decodingInfo=MA)}function MA(t){var n,e,i,r,a,u,s,o,f,c,l;return _((function(h){switch(h.g){case 1:n={supported:false,powerEfficient:true,smooth:true,keySystemAccess:null,configuration:t};ft();e=t.video;i=t.audio;if("media-source"!=t.type){if("file"==t.type){if(e&&(r=e.contentType,a=""!=Ws().canPlayType(r),!a)||i&&(u=i.contentType,s=""!=Ws().canPlayType(u),!s))return h.return(n)}else return h.return(n);h.u(2);break}if(!qy())return h.return(n);if(!e){h.u(3);break}return T(h,xA(e),4);case 4:if(o=h.h,!o)return h.return(n);case 3:if(i){var d=ft().La(),v=i.contentType;"CAST"===d&&i.spatialRendering&&(v+="; spatialRendering=true");f=yn(v);if(!f)return h.return(n)}case 2:if(!t.keySystemConfiguration)return n.supported=true,h.return(n);c=t.keySystemConfiguration;return T(h,NA(e,i,c),6);case 6:if(l=h.h)n.supported=true,n.keySystemAccess=l;case 5:return h.return(n)}}))}function xA(t){var n,e,i;return _((function(r){return 1==r.g?(n=ft(),e=n.La(),"CAST"!==e?r.u(2):T(r,CA(t),3)):2!=r.g?(i=r.h,r.return(i)):r.return(yn(t.contentType))}))}function NA(t,n,e){var i,r,a,u,s,o,f,c,l,h,d;return _((function(v){switch(v.g){case 1:i=[];r=[];e.audio&&(a={robustness:e.audio.robustness||"",contentType:n.contentType},ft().ki()&&n.contentType.includes('codecs="ac-3"')&&(a.contentType='audio/mp4; codecs="ec-3"'),e.audio.encryptionScheme&&(a.encryptionScheme=e.audio.encryptionScheme),i.push(a));e.video&&(u={robustness:e.video.robustness||"",contentType:t.contentType},e.video.encryptionScheme&&(u.encryptionScheme=e.video.encryptionScheme),r.push(u));s={initDataTypes:[e.initDataType],distinctiveIdentifier:e.distinctiveIdentifier,persistentState:e.persistentState,sessionTypes:e.sessionTypes};i.length&&(s.audioCapabilities=i);r.length&&(s.videoCapabilities=r);o=t?t.contentType:"";f=n?n.contentType:"";c=wi(o)+";"+mi(o);l=wi(f)+";"+mi(f);h=e.keySystem;d=null;S(v,2);if(Fr.has(c+"#"+l+"#"+h)){d=Fr.get(c+"#"+l+"#"+h)||null;v.u(4);break}return T(v,navigator.requestMediaKeySystemAccess(e.keySystem,[s]),5);case 5:d=v.h,Fr.set(c+"#"+l+"#"+h,d);case 4:I(v,3);break;case 2:M(v);case 3:return v.return(d)}}))}function CA(n){var e,i,r,a,u;return _((function(s){if(1==s.g){if(!(t.cast&&cast.__platform__&&cast.__platform__.canDisplayType))return s.return(yn(n.contentType));e=n.contentType;n.width&&n.height&&1280<n.width&&720<n.height&&(e+="; width="+n.width+"; height="+n.height);n.framerate&&(i=Math.round(n.framerate),24>i||30<i)&&(e+="; framerate="+n.framerate);r=n.transferFunction||"";switch(r){case"":case"srgb":break;case"pq":e+="; eotf=smpte2084";break;case"hlg":e+="; eotf=arib-std-b67";break;default:return s.return(false)}a=false;u=PA;return u.has(e)?(a=u.get(e),s.u(2)):T(s,cast.__platform__.canDisplayType(e),3)}2!=s.g&&(a=s.h,u.set(e,a));return s.return(a)}))}vA.MediaCapabilities=AA;AA.install=IA;AA.originalMcap=null;var PA=new Map;pA(IA,-1);function RA(){}function DA(){var n=ft(),e="WEBKIT"===n.Da()?n.Ca():null;(t.MediaSource||t.ManagedMediaSource)&&e&&t.MediaSource&&(12>=e?(LA(),OA()):15>=e&&LA());n=c(n.wi());for(e=n.next();!e.done;e=n.next())UA(e.value);(t.MediaSource||t.ManagedMediaSource)&&_A();t.MediaSource&&MediaSource.isTypeSupported('video/webm; codecs="vp9"')&&!MediaSource.isTypeSupported('video/webm; codecs="vp09.00.10.08"')&&BA()}function LA(){var t=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var n=t.apply(this,U.apply(0,arguments));n.abort=function(){};return n}}function OA(){var t=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(n,e){return t.call(this,n,e-.001)}}function _A(){if(t.MediaSource){var n=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=function(t){return"mp2t"!=vi(t)&&n(t)}}if(t.ManagedMediaSource){var e=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);t.ManagedMediaSource.isTypeSupported=function(t){return"mp2t"!=vi(t)&&e(t)}}}function UA(n){var e=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=function(t){return mi(t)!=n&&e(t)};if(t.ManagedMediaSource){var i=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);t.ManagedMediaSource.isTypeSupported=function(t){return mi(t)!=n&&i(t)}}}function BA(){var t=MediaSource.isTypeSupported;ft().Ui()&&(MediaSource.isTypeSupported=function(n){var e=n.split(/ *; */),i=e.findIndex((function(t){return t.startsWith("codecs=")}));if(0>i)return t(n);var r=e[i].replace("codecs=","").replace(/"/g,"").split(/\s*,\s*/),a=r.findIndex((function(t){return t.startsWith("vp09")}));0<=a&&(r[a]="vp9",e[i]='codecs="'+r.join(",")+'"',n=e.join("; "));return t(n)})}vA.MediaSource=RA;RA.install=DA;pA(DA);function HA(){}function FA(){screen.orientation&&screen.orientation.unlock||(void 0!=screen.orientation?VA():void 0!=t.orientation&&zA())}function VA(){void 0===screen.orientation.lock&&(screen.orientation.lock=function(){return Promise.resolve()});void 0===screen.orientation.unlock&&(screen.orientation.unlock=function(){})}function zA(){function n(){switch(t.orientation){case-90:e.type="landscape-secondary";e.angle=270;break;case 0:e.type="portrait-primary";e.angle=0;break;case 90:e.type="landscape-primary";e.angle=90;break;case 180:e.type="portrait-secondary",e.angle=180}}var e=new XA;screen.orientation=e;n();t.addEventListener("orientationchange",(function(){n();var t=new Jr("change");e.dispatchEvent(t)}))}vA.Orientation=HA;HA.install=FA;function XA(){na.call(this);this.type="";this.angle=0}g(XA,na);XA.prototype.lock=function(t){function n(t){return screen.lockOrientation?screen.lockOrientation(t):screen.mozLockOrientation?screen.mozLockOrientation(t):screen.msLockOrientation?screen.msLockOrientation(t):false}var e=false;switch(t){case"natural":e=n("default");break;case"any":e=true;this.unlock();break;default:e=n(t)}if(e)return Promise.resolve();t=Error("screen.orientation.lock() is not available on this device");t.name="NotSupportedError";t.code=DOMException.NOT_SUPPORTED_ERR;return Promise.reject(t)};XA.prototype.unlock=function(){screen.unlockOrientation?screen.unlockOrientation():screen.mozUnlockOrientation?screen.mozUnlockOrientation():screen.msUnlockOrientation&&screen.msUnlockOrientation()};pA(FA);function qA(){}var jA,GA,KA,WA,$A,YA;function QA(n){if(t.HTMLVideoElement&&t.WebKitMediaKeys&&t.shakaMediaKeysPolyfill!=sI){if(void 0===n?0:n)jA=true,GA=Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"mediaKeys"),KA=HTMLMediaElement.prototype.setMediaKeys,WA=t.MediaKeys,$A=t.MediaKeySystemAccess,YA=navigator.requestMediaKeySystemAccess;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys=null;HTMLMediaElement.prototype.setMediaKeys=ZA;t.MediaKeys=eI;t.MediaKeySystemAccess=nI;navigator.requestMediaKeySystemAccess=JA;t.shakaMediaKeysPolyfill=sI;Ar.clear();Fr.clear()}}function JA(t,n){try{var e=new nI(t,n);return Promise.resolve(e)}catch(t){return Promise.reject(t)}}function ZA(t){var n=this.mediaKeys;n&&n!=t&&iI(n,null);delete this.mediaKeys;return(this.mediaKeys=t)?iI(t,this):Promise.resolve()}function tI(t){t=Bt(t.initData);if(Ft(t).getUint32(0,true)+4!=t.byteLength)throw new RangeError("Malformed FairPlay init data");t=jt(t.subarray(4),true);t=Kt(t);var n=new Event("encrypted");n.initDataType="skd";n.initData=Ut(t);this.dispatchEvent(n)}vA.PatchedMediaKeysApple=qA;qA.uninstall=function(){t.shakaMediaKeysPolyfill==sI&&jA&&(jA=false,Object.defineProperty(HTMLMediaElement.prototype,"mediaKeys",GA),HTMLMediaElement.prototype.setMediaKeys=KA,t.MediaKeys=WA,t.MediaKeySystemAccess=$A,navigator.requestMediaKeySystemAccess=YA,GA=YA=KA=$A=WA=null,t.shakaMediaKeysPolyfill="",Ar.clear(),Fr.clear())};qA.install=QA;function nI(t,n){this.keySystem=t;if(t.startsWith("com.apple.fps"))for(t=c(n),n=t.next();!n.done;n=t.next()){var e=n.value;if("required"==e.persistentState)n=null;else{n={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:e.initDataTypes,sessionTypes:["temporary"],label:e.label};var i=false,r=false;if(e.audioCapabilities)for(var a=c(e.audioCapabilities),u=a.next();!u.done;u=a.next())u=u.value,u.contentType&&(i=true,WebKitMediaKeys.isTypeSupported(this.keySystem,u.contentType.split(";")[0])&&(n.audioCapabilities.push(u),r=true));if(e.videoCapabilities)for(e=c(e.videoCapabilities),a=e.next();!a.done;a=e.next())a=a.value,a.contentType&&(i=true,WebKitMediaKeys.isTypeSupported(this.keySystem,a.contentType.split(";")[0])&&(n.videoCapabilities.push(a),r=true));i||(r=WebKitMediaKeys.isTypeSupported(this.keySystem,"video/mp4"));n=r?n:null}if(n){this.g=n;return}}t=Error("Unsupported keySystem");t.name="NotSupportedError";t.code=DOMException.NOT_SUPPORTED_ERR;throw t}nI.prototype.createMediaKeys=function(){var t=new eI(this.keySystem);return Promise.resolve(t)};nI.prototype.getConfiguration=function(){return this.g};function eI(t){this.h=new WebKitMediaKeys(t);this.g=new it}eI.prototype.createSession=function(t){t=t||"temporary";if("temporary"!=t)throw new TypeError("Session type "+t+" is unsupported on this platform.");return new rI(this.h)};eI.prototype.setServerCertificate=function(){return Promise.resolve(false)};function iI(t,n){t.g.Qa();if(!n)return Promise.resolve();t.g.D(n,"webkitneedkey",tI);try{return xf(n,HTMLMediaElement.HAVE_METADATA,t.g,(function(){n.webkitSetMediaKeys(t.h)})),Promise.resolve()}catch(t){return Promise.reject(t)}}eI.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")};function rI(t){na.call(this);this.i=null;this.l=t;this.g=this.h=null;this.j=new it;this.sessionId="";this.expiration=NaN;this.closed=new qr;this.keyStatuses=new uI}g(rI,na);i=rI.prototype;i.generateRequest=function(t,n){var e=this;this.h=new qr;try{var i=this.l.createSession("video/mp4",Bt(n));this.i=i;this.sessionId=i.sessionId||"";this.j.D(this.i,"webkitkeymessage",(function(t){e.h&&(e.h.resolve(),e.h=null);t=(new Map).set("messageType",void 0==e.keyStatuses.Bc()?"license-request":"license-renewal").set("message",Ut(t.message));t=new Jr("message",t);e.dispatchEvent(t)}));this.j.D(i,"webkitkeyadded",(function(){e.g&&(aI(e,"usable"),e.g.resolve(),e.g=null)}));this.j.D(i,"webkitkeyerror",(function(){var t=Error("EME PatchedMediaKeysApple key error");t.errorCode=e.i.error;if(null!=e.h)e.h.reject(t),e.h=null;else if(null!=e.g)e.g.reject(t),e.g=null;else switch(e.i.error.code){case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:aI(e,"output-not-allowed");break;default:aI(e,"internal-error")}}));aI(this,"status-pending")}catch(t){this.h.reject(t)}return this.h};i.load=function(){return Promise.reject(Error("MediaKeySession.load not yet supported"))};i.update=function(t){this.g=new qr;try{this.i.update(Bt(t))}catch(t){this.g.reject(t)}return this.g};i.close=function(){try{this.i.close(),this.closed.resolve(),this.j.Qa()}catch(t){this.closed.reject(t)}return this.closed};i.remove=function(){return Promise.reject(Error("MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform"))};function aI(t,n){var e=t.keyStatuses;e.size=void 0==n?0:1;e.g=n;n=new Jr("keystatuseschange");t.dispatchEvent(n)}function uI(){this.size=0;this.g=void 0}i=uI.prototype;i.Bc=function(){return this.g};i.forEach=function(t){this.g&&t(this.g,Hr.value())};i.get=function(t){if(this.has(t))return this.g};i.has=function(t){var n=Hr.value();return this.g&&_t(t,n)?true:false};i.entries=function(){};i.keys=function(){};i.values=function(){};var sI="apple";pA((function(){t.HTMLVideoElement&&t.WebKitMediaKeys&&(navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||QA())}));function oI(){}function fI(){if(t.MediaKeys){var n=ft();MediaKeys.prototype.setServerCertificate&&n.ge()||(MediaKeys.prototype.setServerCertificate=cI)}}function cI(){return Promise.resolve(false)}vA.PatchedMediaKeysCert=oI;oI.install=fI;pA(fI);function lI(){}function hI(){if(!(!t.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)AI="webkit";else if(!HTMLMediaElement.prototype.generateKeyRequest)return;navigator.requestMediaKeySystemAccess=vI;delete HTMLMediaElement.prototype.mediaKeys;HTMLMediaElement.prototype.mediaKeys=null;HTMLMediaElement.prototype.setMediaKeys=pI;t.MediaKeys=wI;t.MediaKeySystemAccess=mI;t.shakaMediaKeysPolyfill=II}}function dI(t){var n=AI;return n?n+t.charAt(0).toUpperCase()+t.slice(1):t}function vI(t,n){try{var e=new mI(t,n);return Promise.resolve(e)}catch(t){return Promise.reject(t)}}function pI(t){var n=this.mediaKeys;n&&n!=t&&gI(n,null);delete this.mediaKeys;(this.mediaKeys=t)&&gI(t,this);return Promise.resolve()}vA.PatchedMediaKeysWebkit=lI;lI.install=hI;function mI(t,n){this.g=this.keySystem=t;var e=false;"org.w3.clearkey"==t&&(this.g="webkit-org.w3.clearkey",e=false);var i=false;var r=document.getElementsByTagName("video");r=r.length?r[0]:document.createElement("video");n=c(n);for(var a=n.next();!a.done;a=n.next()){a=a.value;var u={audioCapabilities:[],videoCapabilities:[],persistentState:"optional",distinctiveIdentifier:"optional",initDataTypes:a.initDataTypes,sessionTypes:["temporary"],label:a.label},s=false;if(a.audioCapabilities)for(var o=c(a.audioCapabilities),f=o.next();!f.done;f=o.next())f=f.value,f.contentType&&(s=true,r.canPlayType(f.contentType.split(";")[0],this.g)&&(u.audioCapabilities.push(f),i=true));if(a.videoCapabilities)for(o=c(a.videoCapabilities),f=o.next();!f.done;f=o.next())f=f.value,f.contentType&&(s=true,r.canPlayType(f.contentType,this.g)&&(u.videoCapabilities.push(f),i=true));s||(i=r.canPlayType("video/mp4",this.g)||r.canPlayType("video/webm",this.g));"required"==a.persistentState&&(e?(u.persistentState="required",u.sessionTypes=["persistent-license"]):i=false);if(i){this.h=u;return}}e="Unsupported keySystem";if("org.w3.clearkey"==t||"com.widevine.alpha"==t)e="None of the requested configurations were supported.";t=Error(e);t.name="NotSupportedError";t.code=DOMException.NOT_SUPPORTED_ERR;throw t}mI.prototype.createMediaKeys=function(){var t=new wI(this.g);return Promise.resolve(t)};mI.prototype.getConfiguration=function(){return this.h};function wI(t){this.l=t;this.h=null;this.g=new it;this.i=[];this.j=new Map}function gI(t,n){t.h=n;t.g.Qa();var e=AI;n&&(t.g.D(n,e+"needkey",(function(n){var e=new CustomEvent("encrypted");e.initDataType="cenc";e.initData=Ut(n.initData);t.h.dispatchEvent(e)})),t.g.D(n,e+"keymessage",(function(n){var e=bI(t,n.sessionId);e&&(n=(new Map).set("messageType",void 0==e.keyStatuses.Bc()?"licenserequest":"licenserenewal").set("message",n.message),n=new Jr("message",n),e.h&&(e.h.resolve(),e.h=null),e.dispatchEvent(n))})),t.g.D(n,e+"keyadded",(function(n){(n=bI(t,n.sessionId))&&n.ready()})),t.g.D(n,e+"keyerror",(function(n){var e=bI(t,n.sessionId);if(e){var i=Error("EME v0.1b key error"),r=n.errorCode;r.systemCode=n.systemCode;i.errorCode=r;!n.sessionId&&e.h?(45==n.systemCode&&(i.message="Unsupported session type."),e.h.reject(i),e.h=null):n.sessionId&&e.g?(e.g.reject(i),e.g=null):(i=n.systemCode,n.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?EI(e,"output-restricted"):1==i?EI(e,"expired"):EI(e,"internal-error"))}})))}wI.prototype.createSession=function(t){t=t||"temporary";if("temporary"!=t&&"persistent-license"!=t)throw new TypeError("Session type "+t+" is unsupported on this platform.");var n=this.h||document.createElement("video");n.src||(n.src="about:blank");t=new yI(n,this.l,t);this.i.push(t);return t};wI.prototype.setServerCertificate=function(){return Promise.resolve(false)};wI.prototype.getStatusForPolicy=function(){return Promise.resolve("usable")};function bI(t,n){var e=t.j.get(n);return e?e:(e=t.i.shift())?(e.sessionId=n,t.j.set(n,e),e):null}function yI(t,n,e){na.call(this);this.j=t;this.m=false;this.g=this.h=null;this.i=n;this.l=e;this.sessionId="";this.expiration=NaN;this.closed=new qr;this.keyStatuses=new SI}g(yI,na);i=yI.prototype;i.ready=function(){EI(this,"usable");this.g&&this.g.resolve();this.g=null};function kI(t,n,e){if(t.m)return Promise.reject(Error("The session is already initialized."));t.m=true;try{if("persistent-license"==t.l)if(e)var i=Bt(Kt("LOAD_SESSION|"+e));else{var r=Kt("PERSISTENT|");i=an(r,n)}else i=Bt(n)}catch(t){return Promise.reject(t)}t.h=new qr;var a=dI("generateKeyRequest");try{t.j[a](t.i,i)}catch(n){if("InvalidStateError"!=n.name)return t.h=null,Promise.reject(n);new Di((function(){try{t.j[a](t.i,i)}catch(n){t.h.reject(n),t.h=null}})).ha(.01)}return t.h}function TI(t,n,e){if(t.g)t.g.then((function(){return TI(t,n,e)})).catch((function(){return TI(t,n,e)}));else{t.g=n;if("webkit-org.w3.clearkey"==t.i){var i=qt(e);var r=JSON.parse(i);"oct"!=r.keys[0].kty&&(t.g.reject(Error("Response is not a valid JSON Web Key Set.")),t.g=null);i=nn(r.keys[0].k);r=nn(r.keys[0].kid)}else i=Bt(e),r=null;var a=dI("addKey");try{t.j[a](t.i,i,r,t.sessionId)}catch(n){t.g.reject(n),t.g=null}}}function EI(t,n){var e=t.keyStatuses;e.size=void 0==n?0:1;e.g=n;n=new Jr("keystatuseschange");t.dispatchEvent(n)}i.generateRequest=function(t,n){return kI(this,n,null)};i.load=function(t){return"persistent-license"==this.l?kI(this,null,t):Promise.reject(Error("Not a persistent session."))};i.update=function(t){var n=new qr;TI(this,n,t);return n};i.close=function(){if("persistent-license"!=this.l){if(!this.sessionId)return this.closed.reject(Error("The session is not callable.")),this.closed;var t=dI("cancelKeyRequest");try{this.j[t](this.i,this.sessionId)}catch(t){}}this.closed.resolve();return this.closed};i.remove=function(){return"persistent-license"!=this.l?Promise.reject(Error("Not a persistent session.")):this.close()};function SI(){this.size=0;this.g=void 0}i=SI.prototype;i.Bc=function(){return this.g};i.forEach=function(t){this.g&&t(this.g,Hr.value())};i.get=function(t){if(this.has(t))return this.g};i.has=function(t){var n=Hr.value();return this.g&&_t(t,n)?true:false};i.entries=function(){};i.keys=function(){};i.values=function(){};var AI="",II="webkit";pA(hI);function MI(){}function xI(){if(t.HTMLVideoElement){var n=HTMLVideoElement.prototype;n.requestPictureInPicture&&document.exitPictureInPicture||!n.webkitSupportsPresentationMode||(document.pictureInPictureEnabled=true,document.pictureInPictureElement=null,n.requestPictureInPicture=CI,Object.defineProperty(n,"disablePictureInPicture",{get:RI,set:DI,enumerable:true,configurable:true}),document.exitPictureInPicture=PI,document.addEventListener("webkitpresentationmodechanged",NI,true))}}function NI(t){t=t.target;if("picture-in-picture"==t.webkitPresentationMode){document.pictureInPictureElement=t;var n=new Event("enterpictureinpicture");t.dispatchEvent(n)}else document.pictureInPictureElement==t&&(document.pictureInPictureElement=null),n=new Event("leavepictureinpicture"),t.dispatchEvent(n)}function CI(){return this.webkitSupportsPresentationMode("picture-in-picture")?(this.webkitSetPresentationMode("picture-in-picture"),document.pictureInPictureElement=this,Promise.resolve()):Promise.reject(Error("PiP not allowed by video element"))}function PI(){var t=document.pictureInPictureElement;return t?(t.webkitSetPresentationMode("inline"),document.pictureInPictureElement=null,Promise.resolve()):Promise.reject(Error("No picture in picture element found"))}function RI(){return this.hasAttribute("disablePictureInPicture")?true:!this.webkitSupportsPresentationMode("picture-in-picture")}function DI(t){t?this.setAttribute("disablePictureInPicture",""):this.removeAttribute("disablePictureInPicture")}vA.PiPWebkit=MI;MI.install=xI;pA(xI);function LI(){}function OI(){t.crypto&&("randomUUID"in t.crypto||(t.crypto.randomUUID=_I))}function _I(){var t=URL.createObjectURL(new Blob),n=t.toString();URL.revokeObjectURL(t);return n.substr(n.lastIndexOf("/")+1)}vA.RandomUUID=LI;LI.install=OI;pA(OI);function UI(){}function BI(){var t=Symbol.prototype;"description"in t||Object.defineProperty(t,"description",{get:HI})}function HI(){var t=/\((.*)\)/.exec(this.toString());return t?t[1]:void 0}vA.Symbol=UI;UI.install=BI;pA(BI);function FI(){}function VI(){for(var t=c([Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,Int8Array,Int16Array,Int32Array,Float32Array,Float64Array]),n=t.next();!n.done;n=t.next())n=n.value,n.prototype.indexOf||(n.prototype.indexOf=zI),n.prototype.lastIndexOf||(n.prototype.lastIndexOf=XI),n.prototype.includes||(n.prototype.includes=qI)}function zI(t,n){return Array.prototype.indexOf.call(this,t,n)}function XI(t,n){return Array.prototype.lastIndexOf.call(this,t,n)}function qI(t,n){return-1!==this.indexOf(t,n)}vA.TypedArray=FI;FI.install=VI;pA(VI);function jI(){}function GI(){if(t.HTMLMediaElement){var n=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var t=n.apply(this);t&&t.catch((function(){}));return t}}}vA.VideoPlayPromise=jI;jI.install=GI;pA(GI);function KI(){}function WI(){if(t.HTMLVideoElement){var n=HTMLVideoElement.prototype;!n.getVideoPlaybackQuality&&("webkitDroppedFrameCount"in n||"number"===typeof Ws().webkitDroppedFrameCount)&&(n.getVideoPlaybackQuality=$I)}}function $I(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}vA.VideoPlaybackQuality=KI;KI.install=WI;pA(WI);function YI(){}function QI(){if(!t.VTTCue&&t.TextTrackCue){var n=null,e=TextTrackCue.length;if(3==e)n=JI;else if(6==e)n=ZI;else{try{var i=!!JI(1,2,"")}catch(t){i=false}i&&(n=JI)}n&&(t.VTTCue=function(t,e,i){return n(t,e,i)})}}function JI(n,e,i){return new t.TextTrackCue(n,e,i)}function ZI(n,e,i){return new t.TextTrackCue(n+"-"+e+"-"+i,n,e,i)}vA.VTTCue=YI;YI.install=QI;pA(QI);function tM(t){na.call(this);this.h=t;this.l=null;this.g=[];this.i=-1;this.j=null;this.m=new it}g(tM,na);i=tM.prototype;i.destroy=function(){var t=this;return _((function(n){if(1==n.g)return T(n,t.removeAllItems(),2);t.h=null;t.m&&(t.m.release(),t.m=null);na.prototype.release.call(t);E(n)}))};i.configure=function(t){this.l=t};i.getConfiguration=function(){return this.l};i.getCurrentItem=function(){return this.g.length&&0<=this.i&&this.i<this.g.length?this.g[this.i]:null};i.getCurrentItemIndex=function(){return this.i};i.getItems=function(){return this.g.slice()};i.insertItems=function(t){this.g.push.apply(this.g,l(t));this.dispatchEvent(new Jr("itemsinserted"))};i.removeAllItems=function(){var t=this;return _((function(n){switch(n.g){case 1:t.m.Qa();if(!(t.g.length&&0<=t.i)){n.u(2);break}return T(n,t.h.vc(),2);case 2:if(!t.j){n.u(4);break}if(t.j.uf.o){n.u(5);break}return T(n,t.j.uf.destroy(),5);case 5:t.j=null;case 4:t.g=[],t.i=-1,t.dispatchEvent(new Jr("itemsremoved")),E(n)}}))};i.playItem=function(t){var n=this,e,i,r,a,u,s,o,f,l,h,d,v,p,m;return _((function(w){if(1==w.g){n.m.Qa();if(!n.g.length||t>=n.g.length)throw new zt(2,7,7007);e=n.g[t];n.i!=t&&(n.i=t,n.dispatchEvent(new Jr("currentitemchanged")));i=n.h.h;r=n.l?n.l.preloadNextUrlWindow:0;0<r&&(a=false,n.m.D(i,"timeupdate",(function(){var t,e,u,s;return _((function(o){switch(o.g){case 1:if(n.j||1>=n.g.length||a||n.h.V()||!i.duration)return o.return();t=n.h.Ra().end-i.currentTime;if(isNaN(t)){o.u(0);break}if(!(t<=r)){o.u(0);break}e=n.l&&n.l.repeatMode;u=null;n.i+1<n.g.length?u=n.g[n.i+1]:1==e&&(u=n.g[0]);if(!u){o.u(0);break}a=true;s=null;S(o,5);return T(o,n.h.preload(u.manifestUri,u.startTime,u.mimeType,u.config),7);case 7:s=o.h;I(o,6);break;case 5:M(o),s=null;case 6:n.j={item:u,uf:s},a=false,E(o)}}))})));n.m.D(n.h,"complete",(function(){var t=n.l&&n.l.repeatMode,e=false;if(2==t)e=true;else{var r=n.i+1;r<n.g.length?n.playItem(r):1==t&&(1==n.g.length?e=true:n.playItem(0))}e&&(i.paused?(i.currentTime=n.h.Ra().start,i.play()):n.m.D(i,"paused",(function(){i.currentTime=n.h.Ra().start;i.play()})))}));e.config&&(n.h.Bi(),n.h.configure(e.config));u=e.manifestUri;n.j&&n.j.item==e&&n.j.uf&&(u=n.j.uf);return T(w,n.h.load(u,e.startTime,e.mimeType),2)}n.j=null;if(e.extraText)for(s=c(e.extraText),o=s.next();!o.done;o=s.next())f=o.value,f.mime?n.h.Ed(f.uri,f.language,f.kind,f.mime,f.codecs):n.h.Ed(f.uri,f.language,f.kind);if(e.extraThumbnail)for(l=c(e.extraThumbnail),h=l.next();!h.done;h=l.next())d=h.value,n.h.Fe(d);if(e.extraChapter)for(v=c(e.extraChapter),p=v.next();!p.done;p=v.next())m=p.value,n.h.Ee(m.uri,m.language,m.mime);E(w)}))};q("shaka.queue.QueueManager",tM);tM.prototype.playItem=tM.prototype.playItem;tM.prototype.removeAllItems=tM.prototype.removeAllItems;tM.prototype.insertItems=tM.prototype.insertItems;tM.prototype.getItems=tM.prototype.getItems;tM.prototype.getCurrentItemIndex=tM.prototype.getCurrentItemIndex;tM.prototype.getCurrentItem=tM.prototype.getCurrentItem;tM.prototype.getConfiguration=tM.prototype.getConfiguration;tM.prototype.configure=tM.prototype.configure;tM.prototype.destroy=tM.prototype.destroy;op=function(t){return new tM(t)};function nM(){}nM.prototype.parseInit=function(){};nM.prototype.setSequenceMode=function(){};nM.prototype.setManifestType=function(){};nM.prototype.parseMedia=function(t,n){var e=null,i=[];t=qt(t).split(/\r?\n/);t=c(t);for(var r=t.next();!r.done;r=t.next())if((r=r.value)&&!/^\s+$/.test(r)&&(r=eM.exec(r))){var a=iM.exec(r[1]);a=60*parseInt(a[1],10)+parseFloat(a[2].replace(",","."));r=new Ne(a,n.segmentEnd?n.segmentEnd:a+2,r[2]);e&&(e.endTime=a,i.push(e));e=r}e&&i.push(e);return i};q("shaka.text.LrcTextParser",nM);nM.prototype.parseMedia=nM.prototype.parseMedia;nM.prototype.setManifestType=nM.prototype.setManifestType;nM.prototype.setSequenceMode=nM.prototype.setSequenceMode;nM.prototype.parseInit=nM.prototype.parseInit;var eM=/^\[(\d{1,2}:\d{1,2}(?:[.,]\d{1,3})?)\](.*)/,iM=/^(\d+):(\d{1,2}(?:[.,]\d{1,3})?)$/;Ei("application/x-subtitle-lrc",(function(){return new nM}));function rM(){}rM.prototype.parseInit=function(){};rM.prototype.setSequenceMode=function(){};rM.prototype.setManifestType=function(){};rM.prototype.parseMedia=function(t,n,e,i){var r=qt(t);t=[];if(""==r)return t;var a=Qn(r,"tt",true);if(!a)throw new zt(2,2,2005,"Failed to parse TTML.");r=ae(a,"body")[0];if(!r)return[];var u=le(a,DM,"frameRate"),s=le(a,DM,"subFrameRate"),o=le(a,DM,"frameRateMultiplier"),f=le(a,DM,"tickRate"),l=le(a,DM,"cellResolution"),h=a.attributes["xml:space"]||"default",d=le(a,LM,"extent");if("default"!=h&&"preserve"!=h)throw new zt(2,2,2005,"Invalid xml:space value: "+h);h="default"==h;u=new yM(u,s,o,f);l=bM(l);s=ae(a,"metadata")[0];s=(s?s.children:[]).filter((function(t){return"\n"!=t}));o=ae(a,"style");a=ae(a,"region");f=[];for(var v=c(a),p=v.next();!p.done;p=v.next())(p=uM(p.value,o,d))&&f.push(p);if(ee(r,"p").length)throw new zt(2,2,2001,"<p> can only be inside <div> in TTML");d=c(ee(r,"div"));for(v=d.next();!v.done;v=d.next())if(ee(v.value,"span").length)throw new zt(2,2,2001,"<span> can only be inside <p> in TTML");if(n=aM(r,n,u,s,o,a,f,h,l,null,false,e,i))n.backgroundColor||(n.backgroundColor="transparent"),t.push(n);return t};function aM(t,n,e,i,r,a,u,s,o,f,l,h,d){var v=f;if(te(t)){if(!l)return null;var p={tagName:"span",children:[ie(t)],attributes:{},parent:null}}else p=t;for(var m=null,w=c(OM),g=w.next();!g.done&&!(m=vM(p,"backgroundImage",i,"#",g.value)[0]);g=w.next());w=null;g=le(p,OM,"backgroundImage");var b=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/;if(g&&b.test(g)){w=parseInt(g.split(":").pop(),10)-1;if(w>=d.length)return null;w=d[w]}else h&&g&&!g.startsWith("#")&&(b=new bt(h),g=new bt(g),(g=b.resolve(g).toString())&&(w=g));if("p"==t.tagName||m||w)l=true;t=l;g="default"==(p.attributes["xml:space"]||(s?"default":"preserve"));b=p.children.every(te);s=[];if(!b)for(var y=c(p.children),k=y.next();!k.done;k=y.next())(k=aM(k.value,n,e,i,r,a,u,g,o,p,l,h,d))&&s.push(k);i=null!=f;h=ie(p);h=p.children.length&&h&&/\S/.test(h);y=p.attributes.begin||p.attributes.end||p.attributes.dur;if(!(y||h||"br"==p.tagName||0!=s.length||i&&!g))return null;d=mM(p,e);h=d.start;for(d=d.end;v&&v.tagName&&"tt"!=v.tagName;)d=pM(v,e,h,d),h=d.start,d=d.end,v=v.parent;null==h&&(h=0);h+=n.periodStart;d=null==d?Infinity:d+n.periodStart;h=Math.max(h,n.segmentStart);d=Math.min(d,n.segmentEnd);if(!y&&0<s.length)for(h=Infinity,d=0,n=c(s),e=n.next();!e.done;e=n.next())e=e.value,h=Math.min(h,e.startTime),d=Math.max(d,e.endTime);if("br"==p.tagName)return r=new Ne(h,d,""),r.lineBreak=true,r;n="";b&&(n=Yt(ie(p)||""),g&&(n=n.replace(/\s+/g," ")));n=new Ne(h,d,n);n.nestedCues=s;l||(n.isContainer=true);o&&(n.cellResolution=o);o=vM(p,"region",a,"")[0];if(p.attributes.region&&o&&o.attributes["xml:id"]){var T=o.attributes["xml:id"];n.region=u.filter((function(t){return t.id==T}))[0]}u=o;f&&i&&!p.attributes.region&&!p.attributes.style&&(u=vM(f,"region",a,"")[0]);oM(n,p,u,m,w,r,t,0==s.length);return n}function uM(t,n,e){var i=new Rn,r=t.attributes["xml:id"];if(!r)return null;i.id=r;r=null;e&&(r=kM.exec(e)||SM.exec(e));e=r?Number(r[1]):null;r=r?Number(r[2]):null;var a,u=lM(t,n,"extent");if(u){var s=(a=kM.exec(u))||SM.exec(u);null!=s&&(i.width=Number(s[1]),i.height=Number(s[2]),a||(null!=e&&(i.width=100*i.width/e),null!=r&&(i.height=100*i.height/r)),i.widthUnits=a||null!=e?Dn:0,i.heightUnits=a||null!=r?Dn:0)}if(t=lM(t,n,"origin"))if(s=(a=kM.exec(t))||SM.exec(t),null!=s)i.viewportAnchorX=Number(s[1]),i.viewportAnchorY=Number(s[2]),a?u||(i.width=100-i.viewportAnchorX,i.widthUnits=Dn,i.height=100-i.viewportAnchorY,i.heightUnits=Dn):(null!=r&&(i.viewportAnchorY=100*i.viewportAnchorY/r),null!=e&&(i.viewportAnchorX=100*i.viewportAnchorX/e)),i.viewportAnchorUnits=a||null!=e?Dn:0;return i}function sM(t){var n=t.match(/rgba\(([^)]+)\)/);return n&&(n=n[1].split(","),4==n.length)?(n[3]=String(Number(n[3])/255),"rgba("+n.join(",")+")"):t}function oM(t,n,e,i,r,a,u,s){u=u||s;"rtl"==cM(n,e,a,"direction",u)&&(t.direction="rtl");s=cM(n,e,a,"writingMode",u);"tb"==s||"tblr"==s?t.writingMode="vertical-lr":"tbrl"==s?t.writingMode="vertical-rl":"rltb"==s||"rl"==s?t.direction="rtl":s&&(t.direction=ze);(s=cM(n,e,a,"textAlign",true))?(t.positionAlign=RM.get(s),t.lineAlign=PM.get(s),t.textAlign=He[s.toUpperCase()]):t.textAlign=Be;if(s=cM(n,e,a,"displayAlign",true))t.displayAlign=Ve[s.toUpperCase()];if(s=cM(n,e,a,"color",u))t.color=sM(s);if(s=cM(n,e,a,"backgroundColor",u))t.backgroundColor=sM(s);if(s=cM(n,e,a,"border",u))t.border=s;if(s=cM(n,e,a,"fontFamily",u))switch(s){case"monospaceSerif":t.fontFamily="Courier New,Liberation Mono,Courier,monospace";break;case"proportionalSansSerif":t.fontFamily="Arial,Helvetica,Liberation Sans,sans-serif";break;case"sansSerif":t.fontFamily="sans-serif";break;case"monospaceSansSerif":t.fontFamily="Consolas,monospace";break;case"proportionalSerif":t.fontFamily="serif";break;default:t.fontFamily=s.split(",").filter((function(t){return"default"!=t})).join(",")}(s=cM(n,e,a,"fontWeight",u))&&"bold"==s&&(t.fontWeight=Ye);s=cM(n,e,a,"wrapOption",u);t.wrapLine=s&&"noWrap"==s?false:true;(s=cM(n,e,a,"lineHeight",u))&&s.match(EM)&&(t.lineHeight=s);(s=cM(n,e,a,"fontSize",u))&&(s.match(EM)||s.match(TM))&&(t.fontSize=s);if(s=cM(n,e,a,"fontStyle",u))t.fontStyle=Ze[s.toUpperCase()];i?(r=i.attributes.imageType||i.attributes.imagetype,s=i.attributes.encoding,i=ie(i).trim(),"PNG"==r&&"Base64"==s&&i&&(t.backgroundImage="data:image/png;base64,"+i)):r&&(t.backgroundImage=r);if(i=cM(n,e,a,"textOutline",u))i=i.split(" "),i[0].match(EM)?t.textStrokeColor=t.color:(t.textStrokeColor=sM(i[0]),i.shift()),i[0]&&i[0].match(EM)?t.textStrokeWidth=i[0]:t.textStrokeColor="";(i=cM(n,e,a,"letterSpacing",u))&&i.match(EM)&&(t.letterSpacing=i);(i=cM(n,e,a,"linePadding",u))&&i.match(EM)&&(t.linePadding=i);if(i=cM(n,e,a,"opacity",u))t.opacity=parseFloat(i);(i=lM(e,a,"textDecoration"))&&fM(t,i);(i=hM(n,a,"textDecoration"))&&fM(t,i);if(i=cM(n,e,a,"textCombine",u))t.textCombineUpright=i;switch(cM(n,e,a,"ruby",u)){case"container":t.rubyTag="ruby";break;case"text":t.rubyTag="rt"}}function fM(t,n){n=c(n.split(" "));for(var e=n.next();!e.done;e=n.next())switch(e.value){case"underline":t.textDecoration.includes(ti)||t.textDecoration.push(ti);break;case"noUnderline":t.textDecoration.includes(ti)&&_n(t.textDecoration,ti);break;case"lineThrough":t.textDecoration.includes("lineThrough")||t.textDecoration.push("lineThrough");break;case"noLineThrough":t.textDecoration.includes("lineThrough")&&_n(t.textDecoration,"lineThrough");break;case"overline":t.textDecoration.includes("overline")||t.textDecoration.push("overline");break;case"noOverline":t.textDecoration.includes("overline")&&_n(t.textDecoration,"overline")}}function cM(t,n,e,i,r){r=void 0===r?true:r;return(t=hM(t,e,i))?t:r?lM(n,e,i):null}function lM(t,n,e){if(!t)return null;var i=le(t,LM,e);return i?i:dM(t,n,e)}function hM(t,n,e){var i=le(t,LM,e);return i?i:dM(t,n,e)}function dM(t,n,e){t=vM(t,"style",n,"");for(var i=null,r=0;r<t.length;r++){var a=fe(t[r],"urn:ebu:tt:style",e);a||(a=le(t[r],LM,e));a||(a=hM(t[r],n,e));a&&(i=a)}return i}function vM(t,n,e,i,r){var a=[];if(!t||1>e.length)return a;var u=t;for(t=null;!t&&!(t=r?fe(u,r,n):u.attributes[n])&&(u=u.parent,u););if(n=t)for(n=c(n.split(" ")),r=n.next();!r.done;r=n.next())for(r=r.value,t=c(e),u=t.next();!u.done;u=t.next())if(u=u.value,i+u.attributes["xml:id"]==r){a.push(u);break}return a}function pM(t,n,e,i){t=mM(t,n);null==e?e=t.start:null!=t.start&&(e+=t.start);null==i?i=t.end:null!=t.start&&(i+=t.start);return{start:e,end:i}}function mM(t,n){var e=wM(t.attributes.begin,n),i=wM(t.attributes.end,n);t=wM(t.attributes.dur,n);null==i&&null!=t&&(i=e+t);return{start:e,end:i}}function wM(t,n){var e=null;if(AM.test(t)){t=AM.exec(t);e=Number(t[1]);var i=Number(t[2]),r=Number(t[3]),a=Number(t[4]);a+=(Number(t[5])||0)/n.h;r+=a/n.frameRate;e=r+60*i+3600*e}else if(IM.test(t))e=gM(IM,t);else if(MM.test(t))e=gM(MM,t);else if(xM.test(t))t=xM.exec(t),e=Number(t[1])/n.frameRate;else if(NM.test(t))t=NM.exec(t),e=Number(t[1])/n.g;else if(CM.test(t))e=gM(CM,t);else if(t)throw new zt(2,2,2001,"Could not parse cue time range in TTML");return e}function gM(t,n){t=t.exec(n);return null==t||""==t[0]?null:(Number(t[4])||0)/1e3+(Number(t[3])||0)+60*(Number(t[2])||0)+3600*(Number(t[1])||0)}function bM(t){return t?(t=/^(\d+) (\d+)$/.exec(t))?{Kc:parseInt(t[1],10),rows:parseInt(t[2],10)}:null:null}q("shaka.text.TtmlTextParser",rM);rM.prototype.parseMedia=rM.prototype.parseMedia;rM.prototype.setManifestType=rM.prototype.setManifestType;rM.prototype.setSequenceMode=rM.prototype.setSequenceMode;rM.prototype.parseInit=rM.prototype.parseInit;function yM(t,n,e,i){this.frameRate=Number(t)||30;this.h=Number(n)||1;this.g=Number(i);0==this.g&&(this.g=t?this.frameRate*this.h:1);e&&(t=/^(\d+) (\d+)$/g.exec(e))&&(this.frameRate*=Number(t[1])/Number(t[2]))}var kM=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,TM=/^(\d{1,4}(?:\.\d+)?|100)%$/,EM=/^(\d+px|\d+em|\d*\.?\d+c)$/,SM=/^(\d+)px (\d+)px$/,AM=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,IM=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,MM=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,xM=/^(\d*(?:\.\d*)?)f$/,NM=/^(\d*(?:\.\d*)?)t$/,CM=RegExp("^(?:(\\d*(?:\\.\\d*)?)h)?(?:(\\d*(?:\\.\\d*)?)m)?(?:(\\d*(?:\\.\\d*)?)s)?(?:(\\d*(?:\\.\\d*)?)ms)?$"),PM=(new Map).set("left",je).set("center","center").set("right","end").set("start",je).set("end","end"),RM=(new Map).set("left","line-left").set("center","center").set("right","line-right"),DM=["http://www.w3.org/ns/ttml#parameter","http://www.w3.org/2006/10/ttaf1#parameter"],LM=["http://www.w3.org/ns/ttml#styling","http://www.w3.org/2006/10/ttaf1#styling"],OM=["http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt","http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"];Ei("application/ttml+xml",(function(){return new rM}));function _M(){this.g=new rM}_M.prototype.parseInit=function(t){var n=false;(new Ia).box("moov",Ma).box("trak",Ma).box("mdia",Ma).box("minf",Ma).box("stbl",Ma).R("stsd",xa).box("stpp",(function(t){n=true;t.parser.stop()})).parse(t);if(!n)throw new zt(2,2,2007)};_M.prototype.setSequenceMode=function(){};_M.prototype.setManifestType=function(){};_M.prototype.parseMedia=function(t,n,e){var i=[],r=null,a=[],u=new Map,s=[];(new Ia).box("moof",Ma).box("traf",Ma).R("tfhd",(function(t){r=Xu(t.reader,t.flags).Kd})).R("trun",(function(t){t=Gu(t.reader,t.version,t.flags);t=c(t.bh);for(var n=t.next();!n.done;n=t.next())s.push(n.value.sampleSize||r||0)})).R("subs",(function(t){for(var n=t.reader,e=n.T(),i=-1,r=0;r<e;r++){var a=n.T();i+=a;a=n.Aa();for(var s=[],o=0;o<a;o++)1==t.version?s.push(n.T()):s.push(n.Aa()),n.X(),n.X(),n.T();u.set(i,s)}})).box("mdat",Pa((function(t){a.push(t)}))).parse(t,false);if(0==a.length)throw new zt(2,2,2007);for(var o=an.apply(Jt,l(a)),f=0,h=0;h<s.length;h++){var d=Bt(o,f,s[h]);f+=s[h];var v=u.get(h);if(v&&v.length){d=Bt(d,0,v[0]);for(var p=[],m=v[0],w=1;w<v.length;w++){var g=Bt(t,m,v[w]);g=Zt(g);p.push("data:image/png;base64,"+g);m+=v[w]}i=i.concat(this.g.parseMedia(d,n,e,p))}else i=i.concat(this.g.parseMedia(d,n,e,[]))}return i};q("shaka.text.Mp4TtmlParser",_M);_M.prototype.parseMedia=_M.prototype.parseMedia;_M.prototype.setManifestType=_M.prototype.setManifestType;_M.prototype.setSequenceMode=_M.prototype.setSequenceMode;_M.prototype.parseInit=_M.prototype.parseInit;Ei('application/mp4; codecs="stpp"',(function(){return new _M}));Ei('application/mp4; codecs="stpp.ttml"',(function(){return new _M}));Ei('application/mp4; codecs="stpp.ttml.im1i"',(function(){return new _M}));Ei('application/mp4; codecs="stpp.ttml.im1t"',(function(){return new _M}));Ei('application/mp4; codecs="stpp.ttml.im2i"',(function(){return new _M}));Ei('application/mp4; codecs="stpp.ttml.im2t"',(function(){return new _M}));Ei('application/mp4; codecs="stpp.ttml.etd1"',(function(){return new _M}));Ei('application/mp4; codecs="stpp.ttml.etd1|im1t"',(function(){return new _M}));Ei('application/mp4; codecs="stpp.ttml.im1t|etd1"',(function(){return new _M}));Ei('application/mp4; codecs="stpp.TTML.im1t"',(function(){return new _M}));function UM(){this.g="UNKNOWN"}UM.prototype.parseInit=function(){};UM.prototype.setSequenceMode=function(){};UM.prototype.setManifestType=function(t){this.g=t};UM.prototype.parseMedia=function(t,n){t=qt(t);t=t.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");var e=t.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(e[0]))throw new zt(2,2,2e3);t=n.vttOffset;if("HLS"==this.g)if(e[0].includes("X-TIMESTAMP-MAP")){var i=e[0];t=i.match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m);i=i.match(/MPEGTS:(\d+)/m);if(!t||!i)throw new zt(2,2,2e3);t=qn(t[1]);if(null==t)throw new zt(2,2,2e3);i=Number(i[1]);for(var r=n.segmentStart-n.periodStart;95443.7176888889<=r;)r-=95443.7176888889,i+=8589934592;t=n.periodStart+i/9e4-t}else n.periodStart&&n.vttOffset==n.periodStart&&(t=0);n=[];i=c(e[0].split("\n"));for(r=i.next();!r.done;r=i.next())if(r=r.value,/^Region:/.test(r)){r=new Hn(r);var a=new Rn;zn(r);Fn(r);for(var u=zn(r);u;){var s=a,o=u;(u=/^id=(.*)$/.exec(o))?s.id=u[1]:(u=/^width=(\d{1,2}|100)%$/.exec(o))?s.width=Number(u[1]):(u=/^lines=(\d+)$/.exec(o))?(s.height=Number(u[1]),s.heightUnits=2):(u=/^regionanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(o))?(s.regionAnchorX=Number(u[1]),s.regionAnchorY=Number(u[2])):(u=/^viewportanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(o))?(s.viewportAnchorX=Number(u[1]),s.viewportAnchorY=Number(u[2])):/^scroll=up$/.exec(o)&&(s.scroll="up");Fn(r);u=zn(r)}n.push(a)}i=new Map;De(i);r=[];e=c(e.slice(1));for(a=e.next();!a.done;a=e.next()){a=a.value.split("\n");if((1!=a.length||a[0])&&!/^NOTE($|[ \t])/.test(a[0])&&"STYLE"==a[0]){s=[];u=-1;for(o=1;o<a.length;o++)a[o].includes("::cue")&&(s.push([]),u=s.length-1),-1!=u&&(s[u].push(a[o]),a[o].includes("}")&&(u=-1));s=c(s);for(u=s.next();!u.done;u=s.next()){var f=u.value;u="global";(o=f[0].match(/\((.*)\)/))&&(u=o.pop());o=f.slice(1,-1);f[0].includes("}")&&(f=/\{(.*?)\}/.exec(f[0]))&&(o=f[1].split(";"));(f=i.get(u))||(f=new Ne(0,0,""));for(var l=false,h=0;h<o.length;h++){var d=/^\s*([^:]+):\s*(.*)/.exec(o[h]);if(d){var v=d[2].trim().replace(";","");switch(d[1].trim()){case"background-color":case"background":l=true;f.backgroundColor=v;break;case"color":l=true;f.color=v;break;case"font-family":l=true;f.fontFamily=v;break;case"font-size":l=true;f.fontSize=v;break;case"font-weight":if(700<=parseInt(v,10)||"bold"==v)l=true,f.fontWeight=Ye;break;case"font-style":switch(v){case"normal":l=true;f.fontStyle=Qe;break;case"italic":l=true;f.fontStyle=Je;break;case"oblique":l=true,f.fontStyle="oblique"}break;case"opacity":l=true;f.opacity=parseFloat(v);break;case"text-combine-upright":l=true;f.textCombineUpright=v;break;case"text-shadow":l=true;f.textShadow=v;break;case"white-space":l=true,f.wrapLine="noWrap"!=v}}}l&&i.set(u,f)}}f=a;l=t;if(1==f.length&&!f[0]||/^NOTE($|[ \t])/.test(f[0])||"STYLE"==f[0]||"REGION"==f[0])a=null;else if(a=null,f[0].includes("--\x3e")||(a=f[0],f.splice(0,1)),s=new Hn(f[0]),u=Xn(s),h=Vn(s,/[ \t]+--\x3e[ \t]+/g),o=Xn(s),null==u||null==h||null==o)Y("Failed to parse VTT time code. Cue skipped:",a,f),a=null;else{u+=l;o+=l;l=f.slice(1).join("\n").trim();i.has("global")?(f=i.get("global").clone(),f.startTime=u,f.endTime=o,f.payload=l):f=new Ne(u,o,l);Fn(s);for(u=zn(s);u;)BM(f,u,n),Fn(s),u=zn(s);Re(f,i);null!=a&&(f.id=a);a=f}a&&r.push(a)}return r};function BM(t,n,e){var i;if(i=/^align:(start|middle|center|end|left|right)$/.exec(n))n=i[1],"middle"==n?t.textAlign=Be:t.textAlign=He[n.toUpperCase()];else if(i=/^vertical:(lr|rl)$/.exec(n))t.writingMode="lr"==i[1]?"vertical-lr":"vertical-rl";else if(i=/^size:([\d.]+)%$/.exec(n))t.size=Number(i[1]);else if(i=/^position:([\d.]+)%(?:,(line-left|line-right|middle|center|start|end|auto))?$/.exec(n))t.position=Number(i[1]),i[2]&&(n=i[2],t.positionAlign="line-left"==n||"start"==n?"line-left":"line-right"==n||"end"==n?"line-right":"center"==n||"middle"==n?"center":Ue);else if(i=/^region:(.*)$/.exec(n)){if(n=HM(e,i[1]))t.region=n}else if(e=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(n))t.lineInterpretation=1,t.line=Number(e[1]),e[2]&&(t.lineAlign=Ge[e[2].toUpperCase()]);else if(e=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(n))t.lineInterpretation=qe,t.line=Number(e[1]),e[2]&&(t.lineAlign=Ge[e[2].toUpperCase()])}function HM(t,n){t=t.filter((function(t){return t.id==n}));return t.length?t[0]:null}q("shaka.text.VttTextParser",UM);UM.prototype.parseMedia=UM.prototype.parseMedia;UM.prototype.setManifestType=UM.prototype.setManifestType;UM.prototype.setSequenceMode=UM.prototype.setSequenceMode;UM.prototype.parseInit=UM.prototype.parseInit;Ei("text/vtt",(function(){return new UM}));Ei('text/vtt; codecs="vtt"',(function(){return new UM}));Ei('text/vtt; codecs="wvtt"',(function(){return new UM}));function FM(){this.g=null}FM.prototype.parseInit=function(t){var n=this,e=false;(new Ia).box("moov",Ma).box("trak",Ma).box("mdia",Ma).R("mdhd",(function(t){t=ju(t.reader,t.version);n.g=t.timescale})).box("minf",Ma).box("stbl",Ma).R("stsd",xa).box("wvtt",(function(){e=true})).parse(t);if(!this.g)throw new zt(2,2,2008);if(!e)throw new zt(2,2,2008)};FM.prototype.setSequenceMode=function(){};FM.prototype.setManifestType=function(){};FM.prototype.parseMedia=function(t,n){if(!t.length)return[];if(!this.g)throw new zt(2,2,2008);var e=0,i=[],r,a=[],u=false,s=false,o=false,f=null;(new Ia).box("moof",Ma).box("traf",Ma).R("tfdt",(function(t){u=true;e=qu(t.reader,t.version).baseMediaDecodeTime})).R("tfhd",(function(t){f=Xu(t.reader,t.flags).Jd})).R("trun",(function(t){s=true;i=Gu(t.reader,t.version,t.flags).bh})).box("mdat",Pa((function(t){o=true;r=t}))).parse(t,false);if(!o&&!u&&!s)throw new zt(2,2,2008);t=e;for(var l=new Ea(r,0),h=c(i),d=h.next();!d.done;d=h.next()){d=d.value;var v=d.dh||f,p=d.yf?e+d.yf:t;t=p+(v||0);var m=0;do{var w=l.T();m+=w;var g=l.T(),b=null;"vttc"==Da(g)?8<w&&(b=l.Sb(w-8)):l.skip(w-8);v&&b&&(w=VM(b,n.periodStart+p/this.g,n.periodStart+t/this.g),a.push(w))}while(d.sampleSize&&m<d.sampleSize)}return a.filter(_i)};function VM(t,n,e){var i,r,a;(new Ia).box("payl",Pa((function(t){i=qt(t)}))).box("iden",Pa((function(t){r=qt(t)}))).box("sttg",Pa((function(t){a=qt(t)}))).parse(t);return i?zM(i,r,a,n,e):null}function zM(t,n,e,i,r){t=new Ne(i,r,t);Re(t);n&&(t.id=n);if(e)for(n=new Hn(e),e=zn(n);e;)BM(t,e,[]),Fn(n),e=zn(n);return t}q("shaka.text.Mp4VttParser",FM);FM.prototype.parseMedia=FM.prototype.parseMedia;FM.prototype.setManifestType=FM.prototype.setManifestType;FM.prototype.setSequenceMode=FM.prototype.setSequenceMode;FM.prototype.parseInit=FM.prototype.parseInit;Ei('application/mp4; codecs="wvtt"',(function(){return new FM}));function XM(){}XM.prototype.parseInit=function(){};XM.prototype.setSequenceMode=function(){};XM.prototype.setManifestType=function(){};XM.prototype.parseMedia=function(t){var n=qt(t).replace(/\r+/g,"");n=n.trim();t=[];if(""==n)return t;n=c(n.split("\n\n"));for(var e=n.next();!e.done;e=n.next()){e=e.value.split("\n");var i=new Hn(e[0]),r=Xn(i),a=Vn(i,/,/g);i=Xn(i);if(null==r||null==a||null==i)throw new zt(2,2,2001,"Could not parse cue time range in SubViewer");t.push(new Ne(r,i,e.slice(1).join("\n").trim()))}return t};q("shaka.text.SbvTextParser",XM);XM.prototype.parseMedia=XM.prototype.parseMedia;XM.prototype.setManifestType=XM.prototype.setManifestType;XM.prototype.setSequenceMode=XM.prototype.setSequenceMode;XM.prototype.parseInit=XM.prototype.parseInit;Ei("text/x-subviewer",(function(){return new XM}));function qM(){this.g=new UM}qM.prototype.parseInit=function(){};qM.prototype.setSequenceMode=function(){};qM.prototype.setManifestType=function(){};qM.prototype.parseMedia=function(t,n,e){t=qt(t);t=jM(t);t=Bt(Kt(t));return this.g.parseMedia(t,n,e,[])};function jM(t){var n="WEBVTT\n\n";if(""==t)return n;t=t.replace(/\r+/g,"");t=t.trim();t=c(t.split("\n\n"));for(var e=t.next();!e.done;e=t.next())e=e.value.split(/\n/),e[0].match(/\d+/)&&e.shift(),e[0]=e[0].replace(/,/g,"."),n+=e.join("\n").replace(/{b}/g,"<b>").replace(/{\/b}/g,"</b>").replace(/{i}/g,"<i>").replace(/{\/i}/g,"</i>").replace(/{u}/g,"<u>").replace(/{\/u}/g,"</u>")+"\n\n";return n}q("shaka.text.SrtTextParser",qM);qM.srt2webvtt=jM;qM.prototype.parseMedia=qM.prototype.parseMedia;qM.prototype.setManifestType=qM.prototype.setManifestType;qM.prototype.setSequenceMode=qM.prototype.setSequenceMode;qM.prototype.parseInit=qM.prototype.parseInit;Ei("text/srt",(function(){return new qM}));function GM(){}GM.prototype.parseInit=function(){};GM.prototype.setSequenceMode=function(){};GM.prototype.setManifestType=function(){};GM.prototype.parseMedia=function(t){var n="",e="",i=null,r=null;r=qt(t).split(/\r?\n\s*\r?\n/);t=c(r);for(r=t.next();!r.done;r=t.next()){var a=r.value;r=a;if(a=YM.exec(a))i=a[1],r=a[2];"V4 Styles"==i||"V4+ Styles"==i?(n=r,n=e?n+("\n"+r):r):"Events"==i&&(e=e?e+("\n"+r):r)}i=[];r=null;n=c(n.split(/\r?\n/));for(t=n.next();!t.done;t=n.next())if(t=t.value,!/^\s*;/.test(t)&&(a=QM.exec(t)))if(t=a[1].trim(),a=a[2].trim(),"Format"==t)r=a.split(JM);else if("Style"==t){t=a.split(JM);a={};for(var u=0;u<r.length&&u<t.length;u++)a[r[u]]=t[u];i.push(a)}r=[];n=null;e=c(e.split(/\r?\n/));a=e.next();for(t={};!a.done;t={Pi:void 0},a=e.next())if(a=a.value,!/^\s*;/.test(a)&&(u=QM.exec(a)))if(a=u[1].trim(),u=u[2].trim(),"Format"==a)n=u.split(JM);else if("Dialogue"==a){u=u.split(JM);a={};for(var s=0;s<n.length&&s<u.length;s++)a[n[s]]=u[s];s=$M(a.Start);var o=$M(a.End);u=new Ne(s,o,u.slice(n.length-1).join(",").replace(/\\N/g,"\n").replace(/\{[^}]+\}/g,""));t.Pi=a.Style;(t=i.find(function(t){return function(n){return n.Name==t.Pi}}(t)))&&KM(u,t);r.push(u)}return r};function KM(t,n){var e=n.Fontname;e&&(t.fontFamily=e);if(e=n.Fontsize)t.fontSize=e+"px";if(e=n.PrimaryColour)if(e=WM(e))t.color=e;if(e=n.BackColour)if(e=WM(e))t.backgroundColor=e;n.Bold&&(t.fontWeight=Ye);n.Italic&&(t.fontStyle=Je);n.Underline&&t.textDecoration.push(ti);if(e=n.Spacing)t.letterSpacing=e+"px";if(e=n.Alignment)switch(parseInt(e,10)){case 1:t.displayAlign=Fe;t.textAlign="start";break;case 2:t.displayAlign=Fe;t.textAlign=Be;break;case 3:t.displayAlign=Fe;t.textAlign="end";break;case 5:t.displayAlign="before";t.textAlign="start";break;case 6:t.displayAlign="before";t.textAlign=Be;break;case 7:t.displayAlign="before";t.textAlign="end";break;case 9:t.displayAlign="center";t.textAlign="start";break;case 10:t.displayAlign="center";t.textAlign=Be;break;case 11:t.displayAlign="center",t.textAlign="end"}if(n=n.AlphaLevel)t.opacity=parseFloat(n)}function WM(t){t=parseInt(t.replace("&H",""),16);return 0<=t?"rgba("+(t&255)+","+(t>>8&255)+","+(t>>16&255)+","+(t>>24&255^255)/255+")":null}function $M(t){t=ZM.exec(t);return 3600*(t[1]?parseInt(t[1].replace(":",""),10):0)+60*parseInt(t[2],10)+parseFloat(t[3])}q("shaka.text.SsaTextParser",GM);GM.prototype.parseMedia=GM.prototype.parseMedia;GM.prototype.setManifestType=GM.prototype.setManifestType;GM.prototype.setSequenceMode=GM.prototype.setSequenceMode;GM.prototype.parseInit=GM.prototype.parseInit;var YM=/^\s*\[([^\]]+)\]\r?\n([\s\S]*)/,QM=/^\s*([^:]+):\s*(.*)/,JM=/\s*,\s*/,ZM=/^(\d+:)?(\d{1,2}):(\d{1,2}(?:[.]\d{1,3})?)?$/;Ei("text/x-ssa",(function(){return new GM}));function tx(t,n){var e=t[n+1]&1?7:9;return n+e<=t.length&&(t=((t[n+3]&3)<<11|t[n+4]<<3|(t[n+5]&224)>>>5)-e,0<t)?{Sd:e,qa:t}:null}function nx(t,n){var e=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],i=(t[n+2]&60)>>>2;if(i>e.length-1)return null;var r=((t[n+2]&192)>>>6)+1,a=(t[n+2]&1)<<2;a|=(t[n+3]&192)>>>6;return{sampleRate:e[i],channelCount:a,codec:"mp4a.40."+r}}function ex(t,n){if(n+1<t.length&&255===t[n]&&240===(t[n+1]&246)){var e=t[n+1]&1?7:9;if(n+e>=t.length)return false;var i=(t[n+3]&3)<<11|t[n+4]<<3|(t[n+5]&224)>>>5;if(i<=e)return false;n+=i;return n===t.length||n+1<t.length&&255===t[n]&&240===(t[n+1]&246)}return false}function ix(t,n){switch(t){case"mp4a.40.2":if(1===n)return new Uint8Array([0,200,0,128,35,128]);if(2===n)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===n)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===n)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===n)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(6===n)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(1===n)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(2===n||3===n)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])}return null}function rx(t){this.j=t;this.h=0;this.g=new Map;this.i=null}i=rx.prototype;i.destroy=function(){this.g.clear()};i.isSupported=function(t){return"audio/aac"==t.toLowerCase().split(";")[0]?yn(this.convertCodecs("audio",t)):false};i.convertCodecs=function(t,n){return"audio/aac"==n.toLowerCase().split(";")[0]?'audio/mp4; codecs="'+(gi(n)||"mp4a.40.2")+'"':n};i.getOriginalMimeType=function(){return this.j};i.transmux=function(t,n,e,i){for(var r=Bt(t),a=ro(r),u=a.length;u<r.length&&!ex(r,u);u++);t=1e3*e.endTime;a=io(a);a.length&&e&&(a=a.find((function(t){return"com.apple.streaming.transportStreamTimestamp"===t.description})))&&(t=a.data);a=nx(r,u);if(!a)return Promise.reject(new zt(2,3,3018,e?e.O()[0]:null));n.audioSamplingRate=a.sampleRate;n.channelsCount=a.channelCount;for(var s=[];u<r.length;){var o=tx(r,u);if(!o)return Promise.reject(new zt(2,3,3018,e?e.O()[0]:null));var f=o.Sd+o.qa;u+f<=r.length&&s.push({data:r.subarray(u+o.Sd,u+f),size:o.qa,duration:1024,qb:0,flags:{vb:0,kb:0,jb:0,hb:0,ib:2,wb:0}});u+=f}r=a.sampleRate;t=Math.floor(t*r/1e3);i={id:n.id,type:"audio",codecs:a.codec,encrypted:n.encrypted&&0<n.drmInfos.length,timescale:r,duration:i,Ab:[],Ea:new Uint8Array([]),Na:new Uint8Array([]),Va:0,Wa:0,data:{Tb:this.h,baseMediaDecodeTime:t,yb:s},stream:n};i=new Ju([i]);e=n.id+"_"+e.i;this.g.has(e)?n=this.g.get(e):(n=Zu(i),this.g.set(e,n));e=this.i!==n;i=rs(i);this.i=n;this.h++;return e?(n=an(n,i),Promise.resolve(n)):Promise.resolve(i)};q("shaka.transmuxer.AacTransmuxer",rx);rx.prototype.transmux=rx.prototype.transmux;rx.prototype.getOriginalMimeType=rx.prototype.getOriginalMimeType;rx.prototype.convertCodecs=rx.prototype.convertCodecs;rx.prototype.isSupported=rx.prototype.isSupported;rx.prototype.destroy=rx.prototype.destroy;ii("audio/aac",(function(){return new rx("audio/aac")}),ui);function ax(t,n){if(n+8>t.length||11!==t[n]||119!==t[n+1])return null;var e=t[n+4]>>6;if(3<=e)return null;var i=t[n+4]&63,r=2*[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][3*i+e];if(n+r>t.length)return null;var a=t[n+6]>>5,u=0;2===a?u+=2:(a&1&&1!==a&&(u+=2),a&4&&(u+=2));u=(t[n+6]<<8|t[n+7])>>12-u&1;var s=t[n+5]&7;t=new Uint8Array([e<<6|t[n+5]>>3<<1|s>>2,(s&3)<<6|a<<3|u<<2|i>>4,i<<4&224]);return{sampleRate:[48e3,44100,32e3][e],channelCount:[2,1,2,3,3,4,4,5][a]+u,Ea:t,qa:r}}function ux(t,n){if(11===t[n]&&119===t[n+1]){var e=0,i=5;n+=i;for(var r,a;0<i;){a=t[n];var u=Math.min(i,8),s=8-u;r=4278190080>>>24+s<<s;r=(a&r)>>s;e=e?e<<u|r:r;n+=1;i-=u}if(16>e)return true}return false}function sx(t){this.j=t;this.h=0;this.g=new Map;this.i=null}i=sx.prototype;i.destroy=function(){this.g.clear()};i.isSupported=function(t){return"audio/ac3"==t.toLowerCase().split(";")[0]?yn(this.convertCodecs("audio",t)):false};i.convertCodecs=function(t,n){return"audio/ac3"==n.toLowerCase().split(";")[0]?ft().be()?'audio/mp4; codecs="ec-3"':'audio/mp4; codecs="ac-3"':n};i.getOriginalMimeType=function(){return this.j};i.transmux=function(t,n,e,i){t=Bt(t);for(var r=ro(t),a=r.length;a<t.length&&!ux(t,a);a++);var u=1e3*e.endTime;r=io(r);r.length&&e&&(r=r.find((function(t){return"com.apple.streaming.transportStreamTimestamp"===t.description})))&&(u=r.data);r=0;for(var s=new Uint8Array([]),o=[];a<t.length;){var f=ax(t,a);if(!f)return Promise.reject(new zt(2,3,3018,e?e.O()[0]:null));n.audioSamplingRate=f.sampleRate;n.channelsCount=f.channelCount;r=f.sampleRate;s=f.Ea;o.push({data:t.subarray(a,a+f.qa),size:f.qa,duration:1536,qb:0,flags:{vb:0,kb:0,jb:0,hb:0,ib:2,wb:0}});a+=f.qa}t=Math.floor(u*r/1e3);i={id:n.id,type:"audio",codecs:"ac-3",encrypted:n.encrypted&&0<n.drmInfos.length,timescale:r,duration:i,Ab:[],Ea:s,Na:new Uint8Array([]),Va:0,Wa:0,data:{Tb:this.h,baseMediaDecodeTime:t,yb:o},stream:n};i=new Ju([i]);e=n.id+"_"+e.i;this.g.has(e)?n=this.g.get(e):(n=Zu(i),this.g.set(e,n));e=this.i!==n;i=rs(i);this.i=n;this.h++;return e?(n=an(n,i),Promise.resolve(n)):Promise.resolve(i)};q("shaka.transmuxer.Ac3Transmuxer",sx);sx.prototype.transmux=sx.prototype.transmux;sx.prototype.getOriginalMimeType=sx.prototype.getOriginalMimeType;sx.prototype.convertCodecs=sx.prototype.convertCodecs;sx.prototype.isSupported=sx.prototype.isSupported;sx.prototype.destroy=sx.prototype.destroy;ii("audio/ac3",(function(){return new sx("audio/ac3")}),ui);function ox(t,n){if(n+8>t.length||2935!==(t[n]<<8|t[n+1]<<0))return null;var e=new uo(t.subarray(n+2));oo(e,2);oo(e,3);var i=fo(e,11)+1<<1,r=fo(e,2);if(3==r){r=fo(e,2);r=[24e3,22060,16e3][r];var a=3}else r=[48e3,44100,32e3][r],a=fo(e,2);var u=fo(e,3),s=fo(e,1);e=fo(e,5);if(n+i>t.byteLength)return null;t=Math.floor(i*r/(16*[1,2,3,6][a]));t=new Uint8Array([(t&8160)>>5,(t&31)<<3,r<<6|e<<1|0,0|u<<1|s<<0,0]);return{sampleRate:r,channelCount:[2,1,2,3,3,4,4,5][u]+s,Ea:t,qa:i}}function fx(t){this.j=t;this.h=0;this.g=new Map;this.i=null}i=fx.prototype;i.destroy=function(){this.g.clear()};i.isSupported=function(t){return"audio/ec3"==t.toLowerCase().split(";")[0]?yn(this.convertCodecs("audio",t)):false};i.convertCodecs=function(t,n){return"audio/ec3"==n.toLowerCase().split(";")[0]?'audio/mp4; codecs="ec-3"':n};i.getOriginalMimeType=function(){return this.j};i.transmux=function(t,n,e,i){t=Bt(t);for(var r=ro(t),a=r.length;a<t.length&&2935!==(t[a]<<8|t[a+1]<<0);a++);var u=1e3*e.endTime;r=io(r);r.length&&e&&(r=r.find((function(t){return"com.apple.streaming.transportStreamTimestamp"===t.description})))&&(u=r.data);r=0;for(var s=new Uint8Array([]),o=[];a<t.length;){var f=ox(t,a);if(!f)return Promise.reject(new zt(2,3,3018,e?e.O()[0]:null));n.audioSamplingRate=f.sampleRate;n.channelsCount=f.channelCount;r=f.sampleRate;s=f.Ea;o.push({data:t.subarray(a,a+f.qa),size:f.qa,duration:1536,qb:0,flags:{vb:0,kb:0,jb:0,hb:0,ib:2,wb:0}});a+=f.qa}t=Math.floor(u*r/1e3);i={id:n.id,type:"audio",codecs:"ec-3",encrypted:n.encrypted&&0<n.drmInfos.length,timescale:r,duration:i,Ab:[],Ea:s,Na:new Uint8Array([]),Va:0,Wa:0,data:{Tb:this.h,baseMediaDecodeTime:t,yb:o},stream:n};i=new Ju([i]);e=n.id+"_"+e.i;this.g.has(e)?n=this.g.get(e):(n=Zu(i),this.g.set(e,n));e=this.i!==n;i=rs(i);this.i=n;this.h++;return e?(n=an(n,i),Promise.resolve(n)):Promise.resolve(i)};q("shaka.transmuxer.Ec3Transmuxer",fx);fx.prototype.transmux=fx.prototype.transmux;fx.prototype.getOriginalMimeType=fx.prototype.getOriginalMimeType;fx.prototype.convertCodecs=fx.prototype.convertCodecs;fx.prototype.isSupported=fx.prototype.isSupported;fx.prototype.destroy=fx.prototype.destroy;ii("audio/ec3",(function(){return new fx("audio/ec3")}),ui);function cx(t){if(!t.length)return null;var n=t.find((function(t){return 7==t.type}));t=t.find((function(t){return 8==t.type}));if(!n||!t)return null;var e=new uo(n.data),i=mo(e);mo(e);mo(e);lo(e);if(hx.includes(i)&&(i=ho(e),3===i&&oo(e,1),lo(e),lo(e),oo(e,1),po(e))){i=3!==i?8:12;for(var r=0;r<i;r++)po(e)&&(6>r?wo(e,16):wo(e,64))}lo(e);i=ho(e);if(0===i)ho(e);else if(1===i)for(oo(e,1),lo(e),lo(e),i=ho(e),r=0;r<i;r++)lo(e);lo(e);oo(e,1);var a=ho(e),u=ho(e),s=fo(e,1);0===s&&oo(e,1);oo(e,1);var o=0,f=0,c=0,h=0;po(e)&&(o=ho(e),f=ho(e),c=ho(e),h=ho(e));r=i=1;if(po(e)&&po(e)){var d=mo(e),v=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],p=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];0<d&&16>=d?(i=v[d-1],r=p[d-1]):255===d&&(i=fo(e,16),r=fo(e,16))}e=(2-s)*(u+1)*16-2*c-2*h;a=16*(a+1)-2*o-2*f;o=[];n=n.fullData;o.push(n.byteLength>>>8&255);o.push(n.byteLength&255);o=o.concat.apply(o,l(n));n=[];t=t.fullData;n.push(t.byteLength>>>8&255);n.push(t.byteLength&255);n=n.concat.apply(n,l(t));t=new Uint8Array([1,o[3],o[4],o[5],255,225].concat(o,[1],n));return{height:e,width:a,Na:t,Va:i,Wa:r}}function lx(t){function n(t){r={data:new Uint8Array([]),frame:false,isKeyframe:false,pts:t.pts,dts:t.dts,nalus:[]}}function e(){if(r&&r.nalus.length&&r.frame){for(var t=[],n=c(r.nalus),e=n.next();!e.done;e=n.next()){e=e.value;var a=e.fullData.byteLength,u=new Uint8Array(4);u[0]=a>>24&255;u[1]=a>>16&255;u[2]=a>>8&255;u[3]=a&255;t.push(u);t.push(e.fullData)}r.data=an.apply(Jt,l(t));i.push(r)}}for(var i=[],r=null,a=false,u=0;u<t.length;u++){var s=t[u],o=s.nalus,f=false;r&&o.length&&!a&&(e(),n(s));o=c(s.nalus);for(var h=o.next();!h.done;h=o.next()){h=h.value;var d=false;switch(h.type){case 1:var v=false;d=true;var p=h.data;f&&4<p.length&&(p=go(new uo(p)),2===p||4===p||7===p||9===p)&&(v=true);v&&r&&r.frame&&!r.isKeyframe&&(e(),r=null);r||n(s);r.frame=true;r.isKeyframe=v;break;case 5:d=true;r&&r.frame&&!r.isKeyframe&&(e(),r=null);r||n(s);r.frame=true;r.isKeyframe=true;break;case 6:d=true;break;case 7:f=d=true;break;case 8:d=true;break;case 9:a=d=true;r&&r.frame&&(e(),r=null);r||n(s);break;case 12:d=true;break;default:d=false}r&&d&&r.nalus.push(h)}}e();return i}var hx=[100,110,122,244,44,83,86,118,128,138,139,134];function dx(t){if(!t.length)return null;var n=t.find((function(t){return 32==t.type})),e=t.find((function(t){return 33==t.type})),i=t.find((function(t){return 34==t.type}));if(!n||!e||!i)return null;var r=vx(n.fullData);t=px(e.fullData);var a=mx(i.fullData);n=wx(n.fullData,e.fullData,i.fullData,{Og:r.Og,sh:r.sh,yg:t.yg,zg:t.zg,rg:t.rg,xg:t.xg,sg:t.sg,ug:t.ug,vg:t.vg,wg:t.wg,lg:t.lg,mg:t.mg,ng:t.ng,og:t.og,pg:t.pg,qg:t.qg,dg:t.dg,hf:t.hf,ag:t.ag,$f:t.$f,Zf:t.Zf,Qg:a.Qg});return{height:t.height,width:t.width,Na:n,Va:t.Lk,Wa:t.Kk}}function vx(t){var n=new uo(t,true);mo(n);mo(n);fo(n,4);fo(n,2);fo(n,6);t=fo(n,3);n=po(n);return{Og:t+1,sh:n}}function px(t){t=new uo(t,true);mo(t);mo(t);var n=0,e=0,i=0,r=0;fo(t,4);var a=fo(t,3);po(t);for(var u=fo(t,2),s=fo(t,1),o=fo(t,5),f=mo(t),c=mo(t),l=mo(t),h=mo(t),d=mo(t),v=mo(t),p=mo(t),m=mo(t),w=mo(t),g=mo(t),b=mo(t),y=[],k=[],T=0;T<a;T++)y.push(po(t)),k.push(po(t));if(0<a)for(T=a;8>T;T++)fo(t,2);for(T=0;T<a;T++)y[T]&&fo(t,88),k[T]&&mo(t);ho(t);y=ho(t);3==y&&fo(t,1);k=ho(t);T=ho(t);po(t)&&(n+=ho(t),e+=ho(t),i+=ho(t),r+=ho(t));var E=ho(t),S=ho(t),A=ho(t);if(po(t))for(var I=0;I<=a;I++)ho(t),ho(t),ho(t);else ho(t),ho(t),ho(t);ho(t);ho(t);ho(t);ho(t);ho(t);ho(t);if(po(t)&&po(t))for(I=0;4>I;I++)for(var M=0;M<(3===I?2:6);M++)if(po(t)){var x=Math.min(64,1<<4+(I<<1));1<I&&vo(t);for(var N=0;N<x;N++)vo(t)}else ho(t);po(t);po(t);po(t)&&(mo(t),ho(t),ho(t),po(t));I=ho(t);for(x=M=0;x<I;x++)if(N=false,0!==x&&(N=po(t)),N){x===I&&ho(t);po(t);ho(t);for(var C=N=0;C<=M;C++){var P=po(t),R=false;P||(R=po(t));(P||R)&&N++}M=N}else{C=ho(t);N=ho(t);M=C+N;for(P=0;P<C;P++)ho(t),po(t);for(C=0;C<N;C++)ho(t),po(t)}if(po(t))for(I=ho(t),M=0;M<I;M++){for(x=0;x<A+4;x++)fo(t,1);fo(t,1)}I=A=1;M=0;po(t);po(t);if(po(t)){po(t)&&(x=mo(t),N=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],C=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1],0<x&&16>=x?(A=N[x-1],I=C[x-1]):255===x&&(A=fo(t,16),I=fo(t,16)));po(t)&&po(t);po(t)&&(fo(t,3),po(t),po(t)&&(mo(t),mo(t),mo(t)));po(t)&&(ho(t),ho(t));po(t);po(t);po(t);if(x=po(t))ho(t),ho(t),ho(t),ho(t);if(po(t)&&(fo(t,32),fo(t,32),po(t)&&ho(t),po(t))){C=false;x=po(t);N=po(t);if(x||N){if(C=po(t))mo(t),fo(t,5),po(t),fo(t,5);fo(t,4);fo(t,4);C&&fo(t,4);fo(t,5);fo(t,5);fo(t,5)}for(P=0;P<=a;P++){var D=true;R=1;po(t)||(D=po(t));var L=false;D?ho(t):L=po(t);L||(R=ho(t)+1);if(x){for(D=0;D<R;D++)ho(t),ho(t),C&&(ho(t),ho(t));po(t)}if(N){for(D=0;D<R;D++)ho(t),ho(t),C&&(ho(t),ho(t));po(t)}}}po(t)&&(po(t),po(t),po(t),M=ho(t),ho(t),ho(t),ho(t),ho(t))}return{rg:b,yg:u,zg:s,xg:o,sg:f,ug:c,vg:l,wg:h,lg:d,mg:v,ng:p,og:m,pg:w,qg:g,hf:M,dg:0,ag:y,$f:E,Zf:S,width:k-(n+e)*(1===y||2===y?2:1),height:T-(i+r)*(1===y?2:1),Lk:A,Kk:I}}function mx(t){var n=new uo(t,true);mo(n);mo(n);ho(n);ho(n);po(n);po(n);fo(n,3);po(n);po(n);ho(n);ho(n);vo(n);po(n);po(n);po(n)&&ho(n);vo(n);vo(n);po(n);po(n);po(n);po(n);t=po(n);n=po(n);var e=1;n&&t?e=0:n?e=3:t&&(e=2);return{Qg:e}}function wx(t,n,e,i){var r=new Uint8Array(23+(5+t.byteLength)+(5+n.byteLength)+(5+e.byteLength));r[0]=1;r[1]=(i.yg&3)<<6|(i.zg?1:0)<<5|i.xg&31;r[2]=i.sg;r[3]=i.ug;r[4]=i.vg;r[5]=i.wg;r[6]=i.lg;r[7]=i.mg;r[8]=i.ng;r[9]=i.og;r[10]=i.pg;r[11]=i.qg;r[12]=i.rg;r[13]=240|(i.hf&3840)>>8;r[14]=i.hf&255;r[15]=252|i.Qg&3;r[16]=252|i.ag&3;r[17]=248|i.$f&7;r[18]=248|i.Zf&7;r[19]=0;r[20]=0;r[21]=(i.dg&3)<<6|(i.Og&7)<<3|(i.sh?1:0)<<2|3;r[22]=3;r[23]=160;r[24]=0;r[25]=1;r[26]=(t.byteLength&65280)>>8;r[27]=(t.byteLength&255)>>0;r.set(t,28);r[23+(5+t.byteLength)]=161;r[t.byteLength+29]=0;r[t.byteLength+30]=1;r[t.byteLength+31]=(n.byteLength&65280)>>8;r[t.byteLength+32]=(n.byteLength&255)>>0;r.set(n,t.byteLength+33);r[23+(t.byteLength+10+n.byteLength)]=162;r[t.byteLength+10+n.byteLength+24]=0;r[t.byteLength+10+n.byteLength+25]=1;r[t.byteLength+10+n.byteLength+26]=(e.byteLength&65280)>>8;r[t.byteLength+10+n.byteLength+27]=(e.byteLength&255)>>0;r.set(e,t.byteLength+10+n.byteLength+28);return r}function gx(t,n){var e=t[n+1]>>3&3,i=t[n+1]>>1&3,r=t[n+2]>>4&15,a=t[n+2]>>2&3;if(1!==e&&0!==r&&15!==r&&3!==a){var u=t[n+3]>>6;r=1e3*kx[14*(3===e?3-i:3===i?3:4)+r-1];a=Tx[3*(3===e?0:2===e?1:2)+a];e=Ex[e][i];var s=Sx[i],o=Math.floor(e*r/a+(t[n+2]>>1&1))*s,f=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);(f=f?parseInt(f[1],10):0)&&87>=f&&2===i&&224e3<=r&&0===u&&(t[n+3]|=128);return{sampleRate:a,channelCount:3===u?1:2,qa:o,Jk:8*e*s}}return null}function bx(t,n){return 255===t[n]&&224===(t[n+1]&224)&&0!==(t[n+1]&6)}function yx(t,n){if(n+1<t.length&&bx(t,n)){var e=gx(t,n),i=4;e&&e.qa&&(i=e.qa);n+=i;return n===t.length||n+1<t.length&&bx(t,n)}return false}var kx=[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],Tx=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Ex=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Sx=[0,1,1,4];function Ax(t){this.j=t;this.h=0;this.g=new Map;this.i=null}i=Ax.prototype;i.destroy=function(){this.g.clear()};i.isSupported=function(t){return"audio/mpeg"==t.toLowerCase().split(";")[0]?yn(this.convertCodecs("audio",t)):false};i.convertCodecs=function(t,n){return"audio/mpeg"==n.toLowerCase().split(";")[0]?'audio/mp4; codecs="mp3"':n};i.getOriginalMimeType=function(){return this.j};i.transmux=function(t,n,e,i){for(var r=Bt(t),a=ro(r).length;a<r.length&&!yx(r,a);a++);var u;for(t=[];a<r.length;){var s=gx(r,a);if(!s)return Promise.reject(new zt(2,3,3018,e?e.O()[0]:null));u||(u=s);a+s.qa<=r.length&&t.push({data:r.subarray(a,a+s.qa),size:s.qa,duration:1152,qb:0,flags:{vb:0,kb:0,jb:0,hb:0,ib:2,wb:0}});a+=s.qa}if(!u)return Promise.reject(new zt(2,3,3018,e?e.O()[0]:null));r=9e4*u.Jk/u.sampleRate*this.h;i={id:n.id,type:"audio",codecs:"mp3",encrypted:n.encrypted&&0<n.drmInfos.length,timescale:u.sampleRate,duration:i,Ab:[],Ea:new Uint8Array([]),Na:new Uint8Array([]),Va:0,Wa:0,data:{Tb:this.h,baseMediaDecodeTime:r,yb:t},stream:n};i=new Ju([i]);e=n.id+"_"+e.i;this.g.has(e)?n=this.g.get(e):(n=Zu(i),this.g.set(e,n));e=this.i!==n;i=rs(i);this.i=n;this.h++;return e?(n=an(n,i),Promise.resolve(n)):Promise.resolve(i)};q("shaka.transmuxer.Mp3Transmuxer",Ax);Ax.prototype.transmux=Ax.prototype.transmux;Ax.prototype.getOriginalMimeType=Ax.prototype.getOriginalMimeType;Ax.prototype.convertCodecs=Ax.prototype.convertCodecs;Ax.prototype.isSupported=Ax.prototype.isSupported;Ax.prototype.destroy=Ax.prototype.destroy;ii("audio/mpeg",(function(){return new Ax("audio/mpeg")}),ui);function Ix(t){this.h=t;this.g=null}i=Ix.prototype;i.destroy=function(){};i.isSupported=function(t){if("video/mp2t"!=t.toLowerCase().split(";")[0])return false;var n=gi(t).split(","),e=cn("audio",n);n=cn("video",n);return!e||n||"mp3"!=pi(e)?false:yn(this.convertCodecs("audio",t))};i.convertCodecs=function(t,n){return"video/mp2t"==n.toLowerCase().split(";")[0]?"audio/mpeg":n};i.getOriginalMimeType=function(){return this.h};i.transmux=function(t,n,e,i,r){this.g?this.g.clearData():this.g=new bo;this.g.Cf(e.i);t=Bt(t);t=this.g.parse(t);if("mp3"!=t.Md().audio||"audio"!=r)return Promise.reject(new zt(2,3,3018,e?e.O()[0]:null));e=new Uint8Array([]);r=c(t.rb());for(t=r.next();!t.done;t=r.next())if(t=t.value.data)for(n=0;n<t.length;)(i=gx(t,n))?(n+i.qa<=t.length&&(e=an(e,t.subarray(n,n+i.qa))),n+=i.qa):n++;return Promise.resolve(e)};q("shaka.transmuxer.MpegTsTransmuxer",Ix);Ix.prototype.transmux=Ix.prototype.transmux;Ix.prototype.getOriginalMimeType=Ix.prototype.getOriginalMimeType;Ix.prototype.convertCodecs=Ix.prototype.convertCodecs;Ix.prototype.isSupported=Ix.prototype.isSupported;Ix.prototype.destroy=Ix.prototype.destroy;ii("video/mp2t",(function(){return new Ix("video/mp2t")}),si);
/*
		 @license
		 MSS Transmuxer
		 Copyright 2015 Dash Industry Forum
		 SPDX-License-Identifier: BSD-3-Clause
		*/function Mx(t){this.h=t;(this.g=zy.get("ISOBoxer")())&&xx(this)}function xx(t){function n(){this._procFullBox();this.flags&1&&(this._procField("AlgorithmID","uint",24),this._procField("IV_size","uint",8),this._procFieldArray("KID",16,"uint",8));this._procField("sample_count","uint",32);this._procEntries("entry",this.sample_count,(function(t){this._procEntryField(t,"InitializationVector","data",8);this.flags&2&&(this._procEntryField(t,"NumberOfEntries","uint",16),this._procSubEntries(t,"clearAndCryptedData",t.NumberOfEntries,(function(t){this._procEntryField(t,"BytesOfClearData","uint",16);this._procEntryField(t,"BytesOfEncryptedData","uint",32)})))}))}t.g.addBoxProcessor("saio",(function(){this._procFullBox();this.flags&1&&(this._procField("aux_info_type","uint",32),this._procField("aux_info_type_parameter","uint",32));this._procField("entry_count","uint",32);this._procFieldArray("offset",this.entry_count,"uint",1===this.version?64:32)}));t.g.addBoxProcessor("saiz",(function(){this._procFullBox();this.flags&1&&(this._procField("aux_info_type","uint",32),this._procField("aux_info_type_parameter","uint",32));this._procField("default_sample_info_size","uint",8);this._procField("sample_count","uint",32);0===this.default_sample_info_size&&this._procFieldArray("sample_info_size",this.sample_count,"uint",8)}));t.g.addBoxProcessor("senc",n);t.g.addBoxProcessor("uuid",(function(){for(var t=true,e=0;16>e;e++)this.usertype[e]!==Cx[e]&&(t=false);t&&(this._parsing&&(this.type="sepiff"),n.call(this))}))}i=Mx.prototype;i.destroy=function(){};i.isSupported=function(t,n){var e=t.startsWith("mss/");if(!this.g||!e)return false;if(n)return yn(this.convertCodecs(n,t));n=this.convertCodecs("audio",t);t=this.convertCodecs("video",t);return yn(n)||yn(t)};i.convertCodecs=function(t,n){return n.replace("mss/","")};i.getOriginalMimeType=function(){return this.h};i.transmux=function(t,n,e){if(!e)return Promise.resolve(Bt(t));if(!n.mssPrivateData)return Promise.reject(new zt(2,3,3020,e?e.O()[0]:null));try{var i,r=this.g.parseBuffer(t),a=r.fetch("tfhd");a.track_ID=n.id+1;var u=r.fetch("tfdt"),s=r.fetch("traf");null===u&&(u=this.g.createFullBox("tfdt",s,a),u.version=1,u.flags=0,u.baseMediaDecodeTime=Math.floor(e.startTime*n.mssPrivateData.timescale));var o=r.fetch("trun"),f=r.fetch("tfxd");f&&f._parent.boxes.splice(f._parent.boxes.indexOf(f),1);var c=r.fetch("tfrf");c&&c._parent.boxes.splice(c._parent.boxes.indexOf(c),1);var l=r.fetch("sepiff");if(null!==l){l.type="senc";l.usertype=void 0;var h=r.fetch("saio");if(null===h){h=this.g.createFullBox("saio",s);h.version=0;h.flags=0;h.entry_count=1;h.offset=[0];var d=this.g.createFullBox("saiz",s);d.version=0;d.flags=0;d.sample_count=l.sample_count;d.default_sample_info_size=0;d.sample_info_size=[];if(l.flags&2)for(i=0;i<l.sample_count;i+=1)d.sample_info_size[i]=10+6*l.entry[i].NumberOfEntries;else d.default_sample_info_size=8}}a.flags&=16777214;a.flags|=131072;o.flags|=1;var v=r.fetch("moof");o.data_offset=v.getLength()+8;var p=r.fetch("saio");null!==p&&(p.offset[0]=Nx(v,"traf")+Nx(s,"senc")+16);var m=Bt(r.write());return Promise.resolve(m)}catch(t){return t instanceof zt?Promise.reject(t):Promise.reject(new zt(2,3,3022,e?e.O()[0]:null))}};function Nx(t,n){for(var e=8,i=0;i<t.boxes.length&&t.boxes[i].type!==n;i++)e+=t.boxes[i].size;return e}q("shaka.transmuxer.MssTransmuxer",Mx);Mx.prototype.transmux=Mx.prototype.transmux;Mx.prototype.getOriginalMimeType=Mx.prototype.getOriginalMimeType;Mx.prototype.convertCodecs=Mx.prototype.convertCodecs;Mx.prototype.isSupported=Mx.prototype.isSupported;Mx.prototype.destroy=Mx.prototype.destroy;var Cx=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);ii("mss/audio/mp4",(function(){return new Mx("mss/audio/mp4")}),ui);ii("mss/video/mp4",(function(){return new Mx("mss/video/mp4")}),ui);function Px(t){this.m=t;this.g=0;this.j=new Map;this.l=this.i=this.h=null}i=Px.prototype;i.destroy=function(){this.j.clear();this.i&&this.i.destroy()};i.isSupported=function(t,n){if("video/mp2t"!=t.toLowerCase().split(";")[0])return false;var e=t;n&&(e=this.convertCodecs(n,t));var i=gi(e).split(",");e=cn("audio",i);i=cn("video",i);if(e&&(e=pi(e),!Rx.includes(e))||i&&(e=pi(i),!Dx.includes(e)))return false;if(n)return yn(this.convertCodecs(n,t));n=this.convertCodecs("audio",t);t=this.convertCodecs("video",t);return yn(n)||yn(t)};i.convertCodecs=function(t,n){return"video/mp2t"==n.toLowerCase().split(";")[0]?(n=gi(n).replace("mp4a.40.34","mp3").split(",").map((function(t){return sr(t,"audio/mp4")})).map(or).join(","),"audio"==t?'audio/mp4; codecs="'+n+'"':'video/mp4; codecs="'+n+'"'):n};i.getOriginalMimeType=function(){return this.m};i.transmux=function(t,n,e,i,r){var a=Bt(t);if("audio"==r&&!Ao(a)){for(var u=ro(a),s=u.length;s<a.length;s++)if(yx(a,s))return Promise.reject(new zt(2,3,3018,e?e.O()[0]:null));for(s=u.length;s<a.length;s++)if(ex(a,s))return this.i||(this.i=new rx("audio/aac")),this.i.transmux(t,n,e,i,r);return Promise.reject(new zt(2,3,3018,e?e.O()[0]:null))}this.h?this.h.clearData():this.h=new bo;this.h.Cf(e.i);var o=this.h.parse(a),f=[],h=o.Md();try{var d=null;if("video"==r){switch(h.video){case"avc":var v=[],p=null,m=o.Qc(),w=lx(m);if(!w.length)throw new zt(2,3,3023,e?e.O()[0]:null);for(var g=0;g<w.length;g++){var b=w[g];null==p&&(p=b.dts);var y=void 0;y=g+1<w.length?(w[g+1].dts||0)-(b.dts||0):1<w.length?(b.dts||0)-(w[g-1].dts||0):9e4*(e.endTime-e.startTime);v.push({data:b.data,size:b.data.byteLength,duration:y,qb:Math.round((b.pts||0)-(b.dts||0)),flags:{vb:0,kb:0,jb:0,hb:0,ib:b.isKeyframe?2:1,wb:b.isKeyframe?0:1}})}for(var k=[],T=c(m),E=T.next();!E.done;E=T.next())k.push.apply(k,l(E.value.nalus));var S=cx(k);if(!S||null==p)throw new zt(2,3,3018,e?e.O()[0]:null);n.height=S.height;n.width=S.width;d={id:n.id,type:"video",codecs:"avc1",encrypted:n.encrypted&&0<n.drmInfos.length,timescale:9e4,duration:i,Ab:[],Ea:new Uint8Array([]),Na:S.Na,Va:S.Va,Wa:S.Wa,data:{Tb:this.g,baseMediaDecodeTime:p,yb:v},stream:n};break;case"hvc":var A=[],I=null,M=[],x=o.Qc();if(!x.length)throw new zt(2,3,3023,e?e.O()[0]:null);for(var N=0;N<x.length;N++){var C=x[N],P=C.nalus;M.push.apply(M,l(P));for(var R=false,D=[],L=false,O=c(P),_=O.next();!_.done;_=O.next()){var U=_.value;switch(U.type){case 1:case 0:var B=L=true;break;case 19:case 20:case 21:R=B=L=true;break;case 32:B=true;break;case 33:B=true;break;case 34:B=true;break;case 35:L=B=true;break;case 39:case 40:B=true;break;default:B=false}if(L&&B){var H=U.fullData.byteLength,F=new Uint8Array(4);F[0]=H>>24&255;F[1]=H>>16&255;F[2]=H>>8&255;F[3]=H&255;D.push(F);D.push(U.fullData)}}var V=D.length?{data:an.apply(Jt,l(D)),isKeyframe:R}:null;if(V){null==I&&null!=C.dts&&(I=C.dts);var z=void 0;z=N+1<x.length?(x[N+1].dts||0)-(C.dts||0):1<x.length?(C.dts||0)-(x[N-1].dts||0):9e4*(e.endTime-e.startTime);A.push({data:V.data,size:V.data.byteLength,duration:z,qb:Math.round((C.pts||0)-(C.dts||0)),flags:{vb:0,kb:0,jb:0,hb:0,ib:V.isKeyframe?2:1,wb:V.isKeyframe?0:1}})}}var X=dx(M);if(!X||null==I)throw new zt(2,3,3018,e?e.O()[0]:null);n.height=X.height;n.width=X.width;d={id:n.id,type:"video",codecs:"hvc1",encrypted:n.encrypted&&0<n.drmInfos.length,timescale:9e4,duration:i,Ab:[],Ea:new Uint8Array([]),Na:X.Na,Va:X.Va,Wa:X.Wa,data:{Tb:this.g,baseMediaDecodeTime:I,yb:A},stream:n}}d&&(f.push(d),d=null)}if("audio"==r){switch(h.audio){case"aac":for(var q=[],j,G=null,K=null,W=null,$=c(o.rb()),Y=$.next();!Y.done;Y=$.next()){var Q=Y.value,J=Q.data;if(J){var Z=0;if(-1==K&&W)J=an(W,Q.data),K=null;else if(null!=K&&W){Z=Math.max(0,K);var tt=an(W,J.subarray(0,Z));q.push({data:tt,size:tt.byteLength,duration:1024,qb:0,flags:{vb:0,kb:0,jb:0,hb:0,ib:2,wb:0}});K=W=null}j=nx(J,Z);if(!j)throw new zt(2,3,3018,e?e.O()[0]:null);n.audioSamplingRate=j.sampleRate;n.channelsCount=j.channelCount;null==G&&null!==Q.pts&&(G=Q.pts);for(;Z<J.length;){var nt=tx(J,Z);if(!nt){W=J.subarray(Z,J.length);K=-1;break}var et=nt.Sd+nt.qa;K=Math.max(0,Z+et-J.length);0!=K?W=J.subarray(Z+nt.Sd,Z+et):Z+et<=J.length&&q.push({data:J.subarray(Z+nt.Sd,Z+et),size:nt.qa,duration:1024,qb:0,flags:{vb:0,kb:0,jb:0,hb:0,ib:2,wb:0}});Z+=et}}}if(!j||null==G){if(!o.Qc().length)throw new zt(2,3,3018,e?e.O()[0]:null);G=9e4*e.startTime;var it=cn("audio",n.codecs.split(","));if(!it||!n.channelsCount||!n.audioSamplingRate)throw new zt(2,3,3018,e?e.O()[0]:null);j={sampleRate:n.audioSamplingRate,channelCount:n.channelsCount,codec:it};var rt=ix(it,n.channelsCount);if(!rt)throw new zt(2,3,3018,e?e.O()[0]:null);for(var at=G+9e4*(e.endTime-e.startTime),ut=G;ut<at;)q.push({data:rt,size:rt.byteLength,duration:1024,qb:0,flags:{vb:0,kb:0,jb:0,hb:0,ib:2,wb:0}}),ut+=1024/j.sampleRate*9e4}var st=j.sampleRate,ot=G/9e4*st;d={id:n.id,type:"audio",codecs:j.codec,encrypted:n.encrypted&&0<n.drmInfos.length,timescale:st,duration:i,Ab:[],Ea:new Uint8Array([]),Na:new Uint8Array([]),Va:0,Wa:0,data:{Tb:this.g,baseMediaDecodeTime:ot,yb:q},stream:n};break;case"ac3":for(var ft=[],ct=0,lt=new Uint8Array([]),ht=null,dt=c(o.rb()),vt=dt.next();!vt.done;vt=dt.next()){var pt=vt.value,mt=pt.data;null==ht&&null!==pt.pts&&(ht=pt.pts);for(var wt=0;wt<mt.length;){var gt=ax(mt,wt);gt?(n.audioSamplingRate=gt.sampleRate,n.channelsCount=gt.channelCount,ct=gt.sampleRate,lt=gt.Ea,ft.push({data:mt.subarray(wt,wt+gt.qa),size:gt.qa,duration:1536,qb:0,flags:{vb:0,kb:0,jb:0,hb:0,ib:2,wb:0}}),wt+=gt.qa):wt++}}if(0==ct||0==lt.byteLength||null==ht)throw new zt(2,3,3018,e?e.O()[0]:null);var bt=ht/9e4*ct;d={id:n.id,type:"audio",codecs:"ac-3",encrypted:n.encrypted&&0<n.drmInfos.length,timescale:ct,duration:i,Ab:[],Ea:lt,Na:new Uint8Array([]),Va:0,Wa:0,data:{Tb:this.g,baseMediaDecodeTime:bt,yb:ft},stream:n};break;case"ec3":for(var yt=[],kt=0,Tt=new Uint8Array([]),Et=null,St=c(o.rb()),At=St.next();!At.done;At=St.next()){var It=At.value,Mt=It.data;null==Et&&null!==It.pts&&(Et=It.pts);for(var xt=0;xt<Mt.length;){var Nt=ox(Mt,xt);Nt?(n.audioSamplingRate=Nt.sampleRate,n.channelsCount=Nt.channelCount,kt=Nt.sampleRate,Tt=Nt.Ea,yt.push({data:Mt.subarray(xt,xt+Nt.qa),size:Nt.qa,duration:1536,qb:0,flags:{vb:0,kb:0,jb:0,hb:0,ib:2,wb:0}}),xt+=Nt.qa):xt++}}if(0==kt||0==Tt.byteLength||null==Et)throw new zt(2,3,3018,e?e.O()[0]:null);var Ct=Et/9e4*kt;d={id:n.id,type:"audio",codecs:"ec-3",encrypted:n.encrypted&&0<n.drmInfos.length,timescale:kt,duration:i,Ab:[],Ea:Tt,Na:new Uint8Array([]),Va:0,Wa:0,data:{Tb:this.g,baseMediaDecodeTime:Ct,yb:yt},stream:n};break;case"mp3":for(var Pt=[],Rt,Dt=null,Lt=c(o.rb()),Ot=Lt.next();!Ot.done;Ot=Lt.next()){var _t=Ot.value,Ut=_t.data;if(Ut){null==Dt&&null!==_t.pts&&(Dt=_t.pts);for(var Ht=0;Ht<Ut.length;){var Ft=gx(Ut,Ht);Ft?(Rt||(Rt=Ft),Ht+Ft.qa<=Ut.length&&Pt.push({data:Ut.subarray(Ht,Ht+Ft.qa),size:Ft.qa,duration:1152,qb:0,flags:{vb:0,kb:0,jb:0,hb:0,ib:2,wb:0}}),Ht+=Ft.qa):Ht++}}}if(!Rt||null==Dt)throw new zt(2,3,3018,e?e.O()[0]:null);var Vt=Rt.sampleRate,Xt=Dt/9e4*Vt;d={id:n.id,type:"audio",codecs:"mp3",encrypted:n.encrypted&&0<n.drmInfos.length,timescale:Vt,duration:i,Ab:[],Ea:new Uint8Array([]),Na:new Uint8Array([]),Va:0,Wa:0,data:{Tb:this.g,baseMediaDecodeTime:Xt,yb:Pt},stream:n};break;case"opus":var qt=[],jt=null,Gt=o.G;if(!Gt)throw new zt(2,3,3018,e?e.O()[0]:null);var Kt=[];switch(Gt.ij){case 1:case 2:Kt=[0];break;case 0:Kt=[255,1,1,0,1];break;case 128:Kt=[255,2,0,0,1];break;case 3:Kt=[1,2,1,0,2,1];break;case 4:Kt=[1,2,2,0,1,2,3];break;case 5:Kt=[1,3,2,0,4,1,2,3];break;case 6:Kt=[1,4,2,0,4,1,2,3,5];break;case 7:Kt=[1,4,2,0,4,1,2,3,5,6];break;case 8:Kt=[1,5,3,0,6,1,2,3,4,5,7];break;case 130:Kt=[1,1,2,0,1];break;case 131:Kt=[1,1,3,0,1,2];break;case 132:Kt=[1,1,4,0,1,2,3];break;case 133:Kt=[1,1,5,0,1,2,3,4];break;case 134:Kt=[1,1,6,0,1,2,3,4,5];break;case 135:Kt=[1,1,7,0,1,2,3,4,5,6];break;case 136:Kt=[1,1,8,0,1,2,3,4,5,6,7]}var Wt=new Uint8Array([0,Gt.channelCount,0,0,Gt.sampleRate>>>24&255,Gt.sampleRate>>>17&255,Gt.sampleRate>>>8&255,Gt.sampleRate>>>0&255,0,0].concat(l(Kt)));for(var $t=Gt.sampleRate,Yt=c(o.rb()),Qt=Yt.next();!Qt.done;Qt=Yt.next()){var Zt=Qt.value,tn=Zt.data;null==jt&&null!==Zt.pts&&(jt=Zt.pts);for(var nn=0;nn<tn.length;){for(var en=0!==(tn[nn+1]&16),rn=0!==(tn[nn+1]&8),un=nn+2,sn=0;255===tn[un];)sn+=255,un+=1;sn+=tn[un];un+=1;un+=en?2:0;un+=rn?2:0;var on=tn.slice(un,un+sn);qt.push({data:on,size:on.byteLength,duration:960,qb:0,flags:{vb:0,kb:0,jb:0,hb:0,ib:2,wb:0}});nn=un+sn}}if(0==Wt.byteLength||null==jt)throw new zt(2,3,3018,e?e.O()[0]:null);n.audioSamplingRate=Gt.sampleRate;n.channelsCount=Gt.channelCount;var fn=jt/9e4*$t;d={id:n.id,type:"audio",codecs:"opus",encrypted:n.encrypted&&0<n.drmInfos.length,timescale:$t,duration:i,Ab:[],Ea:Wt,Na:new Uint8Array([]),Va:0,Wa:0,data:{Tb:this.g,baseMediaDecodeTime:fn,yb:qt},stream:n}}d&&(f.push(d),d=null)}}catch(t){return t&&3023==t.code?Promise.resolve(new Uint8Array([])):Promise.reject(t)}if(!f.length)return Promise.reject(new zt(2,3,3018,e?e.O()[0]:null));var ln=new Ju(f),hn=n.id+"_"+e.i;if(this.j.has(hn))var dn=this.j.get(hn);else dn=Zu(ln),this.j.set(hn,dn);var vn=this.l!==dn,pn=rs(ln);this.l=dn;this.g++;if(vn){var mn=an(dn,pn);return Promise.resolve(mn)}return Promise.resolve(pn)};q("shaka.transmuxer.TsTransmuxer",Px);Px.prototype.transmux=Px.prototype.transmux;Px.prototype.getOriginalMimeType=Px.prototype.getOriginalMimeType;Px.prototype.convertCodecs=Px.prototype.convertCodecs;Px.prototype.isSupported=Px.prototype.isSupported;Px.prototype.destroy=Px.prototype.destroy;var Rx=["aac","ac-3","ec-3","mp3","opus"],Dx=["avc","hevc"];ii("video/mp2t",(function(){return new Px("video/mp2t")}),oi);function Lx(){}g(Lx,kl);q("shaka.util.FairPlayUtils",Lx);
/*
		 @license
		 EME Encryption Scheme Polyfill
		 Copyright 2019 Google LLC
		 SPDX-License-Identifier: Apache-2.0
		*/function Ox(){}var _x;function Ux(){_x||navigator.emeEncryptionSchemePolyfilled?console.debug("EmeEncryptionSchemePolyfill: Already installed."):navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration?(_x=navigator.requestMediaKeySystemAccess,console.debug("EmeEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.requestMediaKeySystemAccess=Bx,navigator.emeEncryptionSchemePolyfilled=true):console.debug("EmeEncryptionSchemePolyfill: EME not found")}function Bx(t,n){var e=this,i;return _((function(r){if(1==r.g)return console.assert(e==navigator,'bad "this" for requestMediaKeySystemAccess'),T(r,_x.call(e,t,n),2);i=r.h;if($x(i))return console.debug("EmeEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.requestMediaKeySystemAccess=_x,r.return(i);console.debug("EmeEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support.");navigator.requestMediaKeySystemAccess=Hx;return r.return(Hx.call(e,t,n))}))}function Hx(t,n){var e=this,i,r,a,u,s,o,f,l,h,d,v,p;return _((function(m){if(1==m.g){console.assert(e==navigator,'bad "this" for requestMediaKeySystemAccess');i=Wx(t);r=[];a=c(n);for(u=a.next();!u.done;u=a.next())s=u.value,o=Fx(s.videoCapabilities,i),f=Fx(s.audioCapabilities,i),s.videoCapabilities&&s.videoCapabilities.length&&!o.length||s.audioCapabilities&&s.audioCapabilities.length&&!f.length||(l=Object.assign({},s),l.videoCapabilities=o,l.audioCapabilities=f,r.push(l));if(!r.length)throw h=Error("Unsupported keySystem or supportedConfigurations."),h.name="NotSupportedError",h.code=DOMException.NOT_SUPPORTED_ERR,h;return T(m,_x.call(e,t,r),2)}d=m.h;p=v=null;r[0]&&(r[0].videoCapabilities&&(v=r[0].videoCapabilities[0].encryptionScheme),r[0].audioCapabilities&&(p=r[0].audioCapabilities[0].encryptionScheme));return m.return(new Kx(d,v,p))}))}function Fx(t,n){return t?t.filter((function(t){return Yx(t.encryptionScheme,n)})):t}q("EmeEncryptionSchemePolyfill",Ox);Ox.install=Ux;function Vx(){}var zx;function Xx(){zx||navigator.mediaCapabilitiesEncryptionSchemePolyfilled?console.debug("McEncryptionSchemePolyfill: Already installed."):navigator.mediaCapabilities?(zx=navigator.mediaCapabilities.decodingInfo,console.debug("McEncryptionSchemePolyfill: Waiting to detect encryptionScheme support."),navigator.mediaCapabilities.decodingInfo=qx,navigator.mediaCapabilitiesEncryptionSchemePolyfilled=true):console.debug("McEncryptionSchemePolyfill: MediaCapabilities not found")}function qx(t){var n=this,e,i;return _((function(r){switch(r.g){case 1:return console.assert(n==navigator.mediaCapabilities,'bad "this" for decodingInfo'),T(r,zx.call(n,t),2);case 2:e=r.h;if(!e.supported||!t.keySystemConfiguration)return r.return(e);if((i=e.keySystemAccess)&&$x(i))return console.debug("McEncryptionSchemePolyfill: Native encryptionScheme support found."),navigator.mediaCapabilities.decodingInfo=zx,r.return(e);console.debug("McEncryptionSchemePolyfill: No native encryptionScheme support found. Patching encryptionScheme support.");navigator.mediaCapabilities.decodingInfo=jx;if(i){r.u(3);break}return T(r,Gx(t),4);case 4:return e.keySystemAccess=r.h,r.return(e);case 3:return r.return(jx.call(n,t))}}))}function jx(t){var n=this,e,i,r,a,u,s,o;return _((function(f){switch(f.g){case 1:return console.assert(n==navigator.mediaCapabilities,'bad "this" for decodingInfo'),i=e=null,!t.keySystemConfiguration||(r=t.keySystemConfiguration,a=r.keySystem,i=r.audio&&r.audio.encryptionScheme,e=r.video&&r.video.encryptionScheme,u=Wx(a),s={powerEfficient:false,smooth:false,supported:false,keySystemAccess:null,configuration:t},Yx(i,u)&&Yx(e,u))?T(f,zx.call(n,t),2):f.return(s);case 2:o=f.h;if(o.keySystemAccess){o.keySystemAccess=new Kx(o.keySystemAccess,e,i);f.u(3);break}if(!t.keySystemConfiguration){f.u(3);break}return T(f,Gx(t),5);case 5:o.keySystemAccess=f.h;case 3:return f.return(o)}}))}function Gx(t){var n,e;return _((function(i){if(1==i.g){var r=t.keySystemConfiguration,a=[],u=[];r.audio&&a.push({robustness:r.audio.robustness||"",contentType:t.audio.contentType,encryptionScheme:r.audio.encryptionScheme});r.video&&u.push({robustness:r.video.robustness||"",contentType:t.video.contentType,encryptionScheme:r.video.encryptionScheme});r={initDataTypes:r.initDataType?[r.initDataType]:[],distinctiveIdentifier:r.distinctiveIdentifier,persistentState:r.persistentState,sessionTypes:r.sessionTypes};a.length&&(r.audioCapabilities=a);u.length&&(r.videoCapabilities=u);n=r;return T(i,navigator.requestMediaKeySystemAccess(t.keySystemConfiguration.keySystem,[n]),2)}e=i.h;return i.return(e)}))}q("McEncryptionSchemePolyfill",Vx);Vx.install=Xx;function Kx(t,n,e){this.g=t;this.i=n||null;this.h=e||null;this.keySystem=t.keySystem}Kx.prototype.getConfiguration=function(){var t=this.g.getConfiguration();if(t.videoCapabilities)for(var n=c(t.videoCapabilities),e=n.next();!e.done;e=n.next())e.value.encryptionScheme=this.i;if(t.audioCapabilities)for(n=c(t.audioCapabilities),e=n.next();!e.done;e=n.next())e.value.encryptionScheme=this.h;return t};Kx.prototype.createMediaKeys=function(){return this.g.createMediaKeys()};function Wx(t){if(t.startsWith("com.widevine")||t.startsWith("com.microsoft")||t.startsWith("com.chromecast")||t.startsWith("com.adobe")||t.startsWith("org.w3"))return"cenc";if(t.startsWith("com.apple"))return"cbcs";if(t.startsWith("com.huawei"))return"cenc";console.warn("EmeEncryptionSchemePolyfill: Unknown key system:",t,"Please contribute!");return null}function $x(t){t=t.getConfiguration();var n=t.audioCapabilities&&t.audioCapabilities[0];return(t=t.videoCapabilities&&t.videoCapabilities[0]||n)&&void 0!==t.encryptionScheme?true:false}function Yx(t,n){if(!t||t==n)return true;if("cbcs"==t||"cbcs-1-9"==t)if(tN||rN||Zx)return true;return false}function Qx(){}function Jx(){Ux();Xx()}q("EncryptionSchemePolyfills",Qx);Qx.install=Jx;var Zx=navigator.userAgent.includes("CrKey"),tN=100<=parseInt(navigator.userAgent.split("Firefox/").pop(),10),nN;var eN=navigator.userAgent||"";if(eN.includes("Web0S")){var iN=eN.match(/Chrome\/(\d+)/);nN=iN?79<=parseInt(iN[1],10):false}else nN=false;var rN=nN;"undefined"!==typeof e&&e.exports&&(e.exports=Qx)}).call(e,n,n,undefined);for(var i in e.shaka)t[i]=e.shaka[i]})()})(U);return U}var F=H();var V=_(F);async function z(t,n){try{const e=await fetch(`${t.baseUrl}/sp-onboarding/quiz/submit-answer`,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":"bak8zb8uwimo4pjdmyu3-basluiwthvn3u7qznfgy-2thtwws1764g3706xsoo"},body:JSON.stringify({quizOptionIds:n,userId:t.userId})});u(t);if(!e.ok){throw new Error(`HTTP error! status: ${e.status}`)}const i=await e.json();if(!i.success){console.error(i.message||"Failed to submit answer");t.videoError.emit("Failed to submit quiz answer");return false}return true}catch(n){t.videoError.emit("Error submitting quiz answer");console.error("Error submitting quiz answer:",n);return false}}async function X(t,n){try{const e=await fetch(`${t.baseUrl}/sp-onboarding/polls/submit-answer`,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":"bak8zb8uwimo4pjdmyu3-basluiwthvn3u7qznfgy-2thtwws1764g3706xsoo"},body:JSON.stringify({pollOptionIds:n,userId:t.userId})});u(t);if(!e.ok){throw new Error(`HTTP error! status: ${e.status}`)}const i=await e.json();if(!i.success){console.error(i.message||"Failed to submit answer");t.videoError.emit("Failed to submit answer");return false}return true}catch(n){console.error("Error submitting quiz answer:",n);t.videoError.emit("Error submitting quiz answer");return false}}function q(t){if(!t.quizzes||t.showQuiz)return;const n=t.quizzes.quizQuestions.find((n=>Math.abs(n.timestampSeconds-t.currentTime)<5&&!t.quizAnswered.some((t=>t.quizQuestion.id===n.id))));if(t.showQuiz&&n){t.currentQuiz=n;t.showQuiz=true;t.quizTriggered.emit(n)}else{t.showQuiz=false;t.currentQuiz=null}}function j(t,n,e){const i=t.quizQuestions.filter((t=>{const e=t.timestampSeconds;const i=e+t.durationSeconds;return n>=e&&n<=i}));const r=i.find((t=>!e.some((n=>n.quizQuestion.id===t.id))));if(r){return i.reduce(((t,n)=>n.timestampSeconds<t.timestampSeconds?n:t))}return undefined}function G(t,n){const e=t.filter((t=>{const e=t.timestampSeconds;const i=e+t.durationSeconds;return n>=e&&n<=i}));if(!!e.length){return e.reduce(((t,n)=>n.timestampSeconds<t.timestampSeconds?n:t))}return undefined}function K(t,n){const e=t.filter((t=>{const e=t.timestampSeconds;const i=e+t.durationSeconds;return n>=e&&n<=i}));if(!!e.length){return e.reduce(((t,n)=>n.timestampSeconds<t.timestampSeconds?n:t))}return undefined}async function W(t,n){if(!t.currentQuiz)return Promise.resolve();try{const e=t.quizAnswered.findIndex((n=>n.quizQuestion.id===t.currentQuiz.id));const i=await z(t,n);if(!i){return false}if(e>=0){t.quizAnswered[e].answer=n}else{t.quizAnswered.push({quizQuestion:t.currentQuiz,answer:n})}return true}catch(t){throw new Error(t)}}async function $(t,n){if(!t.currentPoll)return Promise.resolve();try{const e=t.pollAnswered.findIndex((n=>n.poll.id===t.currentPoll.id));const i=await X(t,n);if(!i){return false}if(e>=0){t.pollAnswered[e].answer=n}else{t.pollAnswered.push({poll:t.currentPoll,answer:n})}return true}catch(t){throw new Error(t)}}function Y(t){const n=t.videoElement;n.paused&&n.play();t.showQuiz=false}function Q(t){const n=t.videoElement;n.paused&&n.play();t.showPoll=false}function J(t){const n=t.videoElement;n.paused&&n.play();t.showStatistics=false}const Z=({showPoll:t,polls:n,currentTime:i,onClick:r,quizPosition:a})=>{const u=G(n,i);if(!u||t)return null;const s=getComputedStyle(document.documentElement).getPropertyValue("--vp-video-text").trim();const o=u.position||u.position==="top-center"?!!a&&a==="top-left"?"right":"left":(u.position??"").replace("top-","");function f(){const t=n.map((t=>{if(t.id===u.id){return{...t,autoTrigger:false,triggered:true}}return t}));r(u,t)}if(u.autoTrigger&&!u?.triggered){f();return null}return e("div",{class:"poll-notification-container",style:{[o]:"16px"},onClick:f},e("div",{class:"poll-info-icon"},e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:s},e("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"}))),!u?.triggered&&e("div",{class:"poll-alert-strip",style:{[o]:"40px"}},"Poll available! Click to participate."))};let tt=[];let nt=[];let et=false;function it(t,n,i){if(!t.currentPoll)return null;const r=getComputedStyle(document.documentElement).getPropertyValue("--vp-accent").trim();const a=getComputedStyle(document.documentElement).getPropertyValue("--vp-controls-bg").trim();const u=getComputedStyle(document.documentElement).getPropertyValue("--vp-primary-bg").trim();let s=t.pollAnswered.filter((n=>n.poll.id===t.currentPoll.id));let o=!!s.length;const f=t.currentPoll?.pollOptions.reduce(((t,n)=>t+(n?.voteCount??0)),0);const c=t.currentPoll.isMultiSelect;const l=t.currentPoll?.pollOptions;const h=t.currentPoll?.position??"center";const d=h==="top-left"?"start":h==="top-right"?"end":"center";const v=(t,n)=>{if(c){const e=tt.indexOf(n);if(e===-1){tt.push(n);nt.push(t)}else{tt.splice(e,1);nt.splice(e,1)}}else{tt=[n];nt=[t];if(!c){p()}}};const p=async()=>{if(tt.length>0){et=true;t.isLoading=true;await n(tt);t.isLoading=false;et=false;setTimeout((()=>{m()}),1500)}};const m=()=>{tt=[];nt=[];et=false;i()};function w(t){const n=parseInt(t.slice(1,3),16);const e=parseInt(t.slice(3,5),16);const i=parseInt(t.slice(5,7),16);return`rgba(${n}, ${e}, ${i},0.55)`}return e("div",{class:"poll-overlay",style:{justifyContent:d}},e("div",{class:"poll-modal",style:{background:w(u)}},e("div",{class:"poll-header"},e("h3",null,"Poll"),e("button",{class:"close-btn",onClick:m},"×")),e("div",{class:"poll-content"},e("p",{class:"poll-question"},t.currentPoll.question),e("div",{class:"poll-options"},l.map((t=>{const n=tt.includes(t.id);const i=t?.voteCount+(n?1:0);const u=f===0?n?100:0:(i/(f+(n?1:0))*100).toFixed(1);return e("button",{key:t.id,class:`poll-option-full ${o?"voted":""} ${n&&!o?"selected":""}`,onClick:()=>!o&&v(t.option,t.id),disabled:o,style:o&&u?{background:`linear-gradient(to right, ${r} ${u}%, ${a} ${u}%)`}:{background:a}},e("span",null,t.option),o&&e("span",{class:"percentage-text"},u,"%"))}))),!o&&c?!et?e("button",{class:"submit-btn",onClick:p,disabled:tt.length===0},"Submit"):e("button",{class:"submit-btn"},"Submitting..."):null,et&&e("p",{class:"submit-text"},"Submitting..."),o&&e("p",{class:"submit-text"},"Thank you for voting!"))))}let rt=[];let at=[];let ut=false;function st(t,n,i){if(!t.currentQuiz)return null;const r=t.quizAnswered.find((n=>n.quizQuestion.id===t.currentQuiz.id));const a=!!r;const u=t.currentQuiz.questionType==="multi_select";const s=t.currentQuiz?.quizOptions;const o=t.currentQuiz?.position??"center";const f=o==="top-left"?"start":o==="top-right"?"end":"center";const c=(t,n)=>{if(u){const e=rt.indexOf(n);if(e===-1){rt.push(n);at.push(t)}else{rt.splice(e,1);at.splice(e,1)}}else{rt=[n];at=[t];if(!u){l()}}};const l=async()=>{if(rt.length>0){ut=true;t.isLoading=true;await n(rt);t.isLoading=false;ut=false;setTimeout((()=>{h()}),3e3)}};const h=()=>{rt=[];at=[];ut=false;i()};function d(t){const n=parseInt(t.slice(1,3),16);const e=parseInt(t.slice(3,5),16);const i=parseInt(t.slice(5,7),16);return`rgba(${n}, ${e}, ${i},0.55)`}const v=getComputedStyle(document.documentElement).getPropertyValue("--vp-primary-bg").trim();const p=getComputedStyle(document.documentElement).getPropertyValue("--vp-controls-bg").trim();return e("div",{class:"quiz-overlay",style:{justifyContent:f}},e("div",{class:"quiz-modal",style:{background:d(v)}},e("div",{class:"quiz-header"},e("h3",null,"Quiz Question"),e("button",{class:"close-btn",onClick:h},"×")),e("div",{class:"quiz-content"},e("p",{class:"quiz-question"},t.currentQuiz.question),e("div",{class:"quiz-options"},s.map((n=>{const i=a?r.answer.includes(n.id):rt.includes(n.id);const u=t.currentQuiz.answer.includes(n.option);return e("button",{key:n.id,class:`quiz-option-full ${a?"voted":""} ${i?a?u?"correct-opt":"incorrect-opt":"selected":a&&u?"correct-opt":""}`,style:a?{}:{background:p},onClick:()=>!a&&c(n.option,n.id),disabled:a},e("span",null,n.option),a&&i&&e("span",{style:{marginLeft:"auto"}},u?"✔":"X"))}))),!a&&u?!ut?e("button",{class:"submit-btn",onClick:l,disabled:rt.length===0},"Submit"):e("button",{class:"submit-btn"},"Submitting..."):null)))}const ot=({quizzes:t,showQuiz:n,currentTime:i,answered:r,onClick:a,pollPosition:u})=>{const s=j(t,i,r);if(!s||n)return null;const o=!s.position||s.position==="top-center"?!!u&&u==="top-right"?"left":"right":(s.position??"").replace("top-","");const f=getComputedStyle(document.documentElement).getPropertyValue("--vp-video-text").trim();function c(){const n=t.quizQuestions.map((t=>{if(t.id===t.id){return{...t,autoTrigger:false,triggered:true}}return t}));a(s,{...t,quizQuestions:n})}if(s.autoTrigger&&!s?.triggered){c();return null}return e("div",{class:"quiz-notification-container",style:{[o]:"16px"},onClick:c},e("div",{class:"quiz-info-icon"},e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:f},e("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"}))),!s?.triggered&&e("div",{class:"quiz-alert-strip",style:{[o]:"40px"}},"Quiz available! Click to participate."))};function ft(t){const n=Math.floor(t/3600);const e=Math.floor(t%3600/60);const i=Math.floor(t%60);if(n>0){return`${n}:${e.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`}else{return`${e}:${i.toString().padStart(2,"0")}`}}function ct(t,n){const e=Math.floor(t-n);if(Math.abs(e)<=2)return"Live";return`${ft(Math.abs(t))} / Live`}function lt(t,n){const e=t/n*100||0;const i=getComputedStyle(document.documentElement).getPropertyValue("--vp-accent").trim();const r=getComputedStyle(document.documentElement).getPropertyValue("--vp-controls-bg").trim();return`linear-gradient(to right, ${i} 0%, ${i} ${e}%, ${r} ${e}%, ${r} 100%)`}function ht(t,n){const e=t?0:n*100||0;const i=getComputedStyle(document.documentElement).getPropertyValue("--vp-accent").trim();const r=getComputedStyle(document.documentElement).getPropertyValue("--vp-controls-bg").trim();return`linear-gradient(to right, ${i} 0%, ${i} ${e}%, ${r} ${e}%, ${r} 100%)`}function dt(t){if(t.controlsTimeout){clearTimeout(t.controlsTimeout)}t.controlsTimeout=setTimeout((()=>{if(t.isPlaying){t.showControls=false;t.showSettings=false}}),3e3)}function vt(t){const n=new Date(t);return n.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function pt(t){const{videoElement:n,hostElement:e}=t;if(!n)return;n.addEventListener("loadedmetadata",(()=>{if(t.player.isLive)return;t.duration=n.duration}));n.addEventListener("timeupdate",(()=>{t.currentTime=n.currentTime;q(t)}));n.addEventListener("play",(()=>{t.isPlaying=true;t.hasVideoStarted=true;w(t)}));n.addEventListener("ended",(()=>{if(!t.isLive&&t.autoPlay&&!!t.nextVideoId){t.setVideoId&&t.setVideoId(t.nextVideoId)}}));n.addEventListener("pause",(()=>{t.isPlaying=false;g(t)}));n.addEventListener("ended",(()=>{t.hasVideoStarted=true;t.videoCompleted.emit();window.parent.postMessage({type:"ON_VIDEO_COMPLETE"},"*")}));n.addEventListener("volumechange",(()=>{t.volume=n.volume;t.isMuted=n.muted}));e.addEventListener("mousemove",(()=>{t.showControls=true;dt(t)}));e.addEventListener("mouseleave",(()=>{if(t.isPlaying)t.showControls=false}));e.addEventListener("click",(()=>{t.showControls=!t.showControls;if(t.showControls)dt(t)}))}function mt(t){const{videoElement:n,player:e}=t;if(!n)return;e.addEventListener("trackschanged",(()=>o(t)));e.addEventListener("error",(n=>{console.error("Shaka Player error",n);t.videoError.emit("Shaka Player error")}));e.addEventListener("buffering",(n=>{if(n.buffering){t.isLoading=true}else{t.isLoading=false}}))}function wt(t){if(!t.player.isLive()){console.warn("Source is not a n/ live stream!");return}t.isLive=true;const n=t.player.seekRange();if(n.end!==Infinity){t.videoElement.currentTime=n.end;t.duration=n.end;t.isDvrEnabled=true}else{t.videoElement.currentTime=n.end??0;t.isDvrEnabled=false;console.warn("DVR not supported for this live stream.")}t.progressUpdateInterval=setInterval((()=>{const n=t.player.seekRange();if(n.end!==Infinity&&n.end>=t.duration&&t.isPlaying&&!t.isLoading){t.duration=n.end}}),1e3);t.livePollingInterval=setInterval((()=>{if(!t.isLoading&&t.isPlaying)u(t)}),1e4)}async function gt(t){if(!t.clientId)return;if(!t.videoElement)return;try{t.isLoading=true;await u(t,true);if(!t.videoId){t.setVideoId&&t.setVideoId(t.tempVideoId);return}if(!!t.scheduleTime&&new Date(t.scheduleTime)>new Date){t.scheduleTimer=setInterval((async()=>{if(new Date>=new Date(t.scheduleTime)){t.showStartStream=true;clearInterval(t.scheduleTimer)}}),1e3)}else{t.showStartStream=false;t.scheduleTime=null}const n=await V.Player.probeSupport();console.log("support.drm",n.drm);t.player.configure({abr:{enabled:true},streaming:{bufferingGoal:60,rebufferingGoal:2,bufferBehind:30,ignoreTextStreamFailures:true,preferNativeHls:true,useNativeHlsForFairPlay:true},manifest:{hls:{defaultAudioCodec:"mp4a.40.2"}},drm:!!t.token?{servers:{"com.widevine.alpha":"https://drm-widevine-licensing.axprod.net/AcquireLicense","com.apple.fps.1_0":"https://drm-fairplay-licensing.axprod.net/AcquireLicense"},advanced:{"com.apple.fps.1_0":{serverCertificateUri:"https://vtb.axinom.com/FPScert/fairplay.cer"}}}:undefined});if(!!t.token){t.player.getNetworkingEngine().registerRequestFilter(((n,e)=>{if(n!==V.net.NetworkingEngine.RequestType.LICENSE){return}e.headers["X-AxDRM-Message"]=t.token;e.headers["Content-Type"]="application/octet-stream";if(e.uris[0].includes("fairplay")){e.headers["Content-Type"]="application/x-www-form-urlencoded"}}))}if(!t.scheduleTime||new Date>=new Date(t.scheduleTime))await bt(t)}catch(n){t.isLoading=false;t.livePollingInterval=null;t.reactionPollingInterval=null;console.error("Error loading video:",n);t.videoError.emit("Error loading video");await t.player.load("")}}async function bt(t){t.isLoading=true;await t.player.load(t.src);t.isLoading=false;t.showStartStream=false;t.duration=t.videoElement.duration;o(t);if(t.videoElement.paused&&(t.isPlaying||!!t.scheduleTime)){t.scheduleTime=null;t.videoElement.play()}if(t.livePollingInterval){clearInterval(t.livePollingInterval);t.livePollingInterval=null}if(t.progressUpdateInterval){clearInterval(t.progressUpdateInterval);t.progressUpdateInterval=null}if(t.reactionPollingInterval){clearInterval(t.reactionPollingInterval);t.reactionPollingInterval=null}if(t.player.isLive()){wt(t)}else{t.isDvrEnabled=true}mt(t)}const yt=({showStats:t,stats:n,currentTime:i,onClick:r,quizPosition:a,pollPosition:u})=>{const s=K(n,i);if(!s||t)return null;const o=getComputedStyle(document.documentElement).getPropertyValue("--vp-video-text").trim();const f=s.position||s.position==="top-center"?!!a&&a==="top-left"?u==="top-right"?"left":"right":"left":(s.position??"").replace("top-","");function c(){const t=n.map((t=>{if(t.id===s.id){return{...t,autoTrigger:false,triggered:true}}return t}));r(s,t)}if(s.autoTrigger&&!s?.triggered){c();return null}return e("div",{class:"stats-notification-container",style:{[f]:"16px"},onClick:c},e("div",{class:"stats-info-icon"},e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:o},e("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"}))),!s?.triggered&&e("div",{class:"stats-alert-strip",style:{[f]:"40px"}},"Statistics available!"))};function kt(t,n){if(!t.currentStatistics)return null;const i=getComputedStyle(document.documentElement).getPropertyValue("--vp-primary-bg").trim();const r=t.currentStatistics?.position??"center";const a=r==="top-left"?"start":r==="top-right"?"end":"center";const u=()=>{n()};function s(t){const n=parseInt(t.slice(1,3),16);const e=parseInt(t.slice(3,5),16);const i=parseInt(t.slice(5,7),16);return`rgba(${n}, ${e}, ${i},0.55)`}return e("div",{class:"stats-overlay",style:{justifyContent:a}},e("div",{class:"stats-modal",style:{background:s(i)}},e("div",{class:"stats-header"},e("h3",null,"Statistics"),e("button",{class:"close-btn",onClick:u},"×")),e("div",{class:"stats-content",innerHTML:t.currentStatistics.htmlString})))}const Tt=":host{display:flex;flex-direction:column;flex:1;position:relative;width:100%;height:100%;overflow:auto;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif}.scheduled-message{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;background-color:rgba(0, 0, 0, 0.7);color:white;font-size:1.5rem;z-index:10}.video-container{position:relative;width:100%;height:0;padding-bottom:56.25%;background:#000;border-radius:10px;border:none;overflow:hidden}.video-container video{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:contain;}.loading-spinner{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);z-index:100}.spinner{width:40px;height:40px;border:4px solid var(--vp-controls-bg);border-radius:50%;border-top:4px solid var(--vp-accent);animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.controls{position:absolute;bottom:0;left:0;right:0;background:linear-gradient(transparent, rgba(0, 0, 0, 0.8));padding:10px 10px 20px;opacity:0;transition:opacity 0.3s ease;z-index:100}.controls.visible{opacity:1}.controls-row{display:flex;align-items:center;gap:12px;margin-bottom:4px}.control-btn{background:none;border:none;color:white;cursor:pointer;padding:8px;border-radius:4px;transition:background-color 0.2s;display:flex;align-items:center;justify-content:center}.go-live-button{background:var(--vp-accent);color:var(--vp-video-text);border-radius:10px}.control-btn:hover{background:rgba(255, 255, 255, 0.2);color:white}.time-display{color:var(--vp-video-text);font-size:14px;white-space:nowrap}.spacer{flex:1}.volume-control{display:flex;align-items:center;gap:10px}.volume-slider{width:0;opacity:0;transition:all 0.2s ease;height:4px;background:rgba(255, 255, 255, 0.3);border-radius:2px;outline:none;-webkit-appearance:none}.volume-control:hover .volume-slider{width:70px;opacity:1}.volume-slider::-webkit-slider-thumb{-webkit-appearance:none;width:10px;height:10px;background:var(--vp-accent);border-radius:50%;cursor:pointer}.volume-slider::-moz-range-thumb{width:10px;height:10px;background:var(--vp-accent);border-radius:50%;cursor:pointer;border:none}.progress-container{position:relative;width:100%;height:4px}.progress-slider{position:absolute;width:100%;height:5.5px;-webkit-appearance:none;appearance:none;background:transparent;z-index:2;cursor:pointer}.progress-slider::-webkit-slider-thumb{opacity:0;}.buffering-bar{position:absolute;height:4px;background:var(--vp-accent, '#e95b5b');top:0;left:0;z-index:1}.timeline-markers{position:absolute;top:50%;left:0;width:100%;height:100%;pointer-events:none}.timeline-marker{position:absolute;transform:translate(-50%, -50%);top:50%;margin-top:-1.25px;z-index:2;cursor:pointer;pointer-events:auto}.timeline-marker::before{content:attr(data-tooltip);position:absolute;bottom:100%;left:50%;transform:translateX(-50%);background:rgba(0, 0, 0, 0.8);color:white;padding:4px 8px;border-radius:4px;font-size:12px;white-space:nowrap;opacity:0;transition:opacity 0.2s ease;margin-bottom:5px}.timeline-marker:hover::before{opacity:1}.settings-menu{position:absolute;pointer-events:auto;bottom:80px;right:16px;background:rgba(28, 28, 28, 0.9);border-radius:12px;padding:8px 0;width:240px;max-height:60vh;overflow-y:auto;z-index:20;box-shadow:0 4px 20px rgba(0, 0, 0, 0.5);backdrop-filter:blur(16px)}.main-settings{display:flex;flex-direction:column}.settings-item{display:flex;justify-content:space-between;align-items:center;padding:10px 16px;color:white;background:transparent;border:none;width:100%;text-align:left;cursor:pointer;font-size:14px}.settings-item:hover{background:rgba(255, 255, 255, 0.1)}.selected-option{color:#aaa;font-size:13px}.options-panel{display:flex;flex-direction:column}.back-button{display:flex;align-items:center;padding:10px 16px;color:white;background:transparent;border:none;width:100%;text-align:left;cursor:pointer;font-size:14px;gap:8px}.back-button svg{width:18px;height:18px}.options-list{padding:8px 0}.option-item{display:block;padding:8px 16px 8px 40px;color:white;background:transparent;border:none;width:100%;text-align:left;cursor:pointer;font-size:14px}.option-item:hover{background:rgba(255, 255, 255, 0.1)}.option-item.active{color:var(--vp-accent);font-weight:500}.live-tag{position:absolute;bottom:0;left:0;z-index:10;margin:16px;font-size:0.8rem;padding:4px 8px;font-weight:bold;letter-spacing:1px;border:1px solid #ff0000;color:#ff0000;border-radius:4px;background-color:rgba(255, 0, 0, 0.1);display:flex;align-items:center;gap:6px}.live-tag::before{content:'';display:block;width:8px;height:8px;background-color:#ff0000;border-radius:50%;animation:pulse 1.5s infinite}@keyframes pulse{0%{opacity:1}50%{opacity:0.2}100%{opacity:1}}@media (max-width: 768px){.controls{padding:20px 15px 15px}.controls-row{gap:10px}.volume-control{display:none}}.center-controls{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;pointer-events:none;z-index:2;opacity:0;transition:opacity 0.3s ease}.center-controls.visible{opacity:1}.center-controls .controls-container{display:flex;align-items:center;gap:30px;pointer-events:auto}.big-play-pause{width:80px;height:80px;background:var(--vp-controls-bg);border-radius:50%;border:none;display:flex;justify-content:center;align-items:center;cursor:pointer;transition:transform 0.2s ease;outline:none}.big-play-pause:hover{transform:scale(1.1)}.skip-btn{width:50px;height:50px;background:transparent;border-radius:50%;border:none;display:flex;justify-content:center;align-items:center;cursor:pointer;transition:transform 0.2s ease}.skip-btn:hover{transform:scale(1.1)}.buffering-loader{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);z-index:3;display:none}.buffering-loader.active{display:block}@keyframes slideIn{to{transform:translateX(0);opacity:1}}@keyframes fadeOut{to{opacity:0}}.video-info{padding:8px 2px;background:transparent}.title-like-container{display:flex;align-items:center;gap:10px;margin-bottom:8px}.rating-container{display:flex;align-items:center;margin-left:auto;background:var(--vp-video-text);border-radius:4px;padding:4px 8px}.rating-container .divider{width:2px;height:16px;background:var(--vp-controls-bg);margin:0% 8px}.thumb-btn{background:none;border:none;cursor:pointer;display:flex;align-items:center;gap:4px;color:#606060;outline:none}.thumb-btn.active{color:var(--vp-accent)}.count{font-size:14px;color:#606060;font-weight:500}.video-title{font-size:1.6rem;font-weight:bold;margin:0%;color:var(--vp-text);font-family:var(--title-font)}.description-container{background:#f9f9f9;border-radius:8px;padding:12px 16px;margin-top:8px;font-family:var(--description-font)}.video-metadata{color:#606060;font-size:0.9rem;margin-bottom:8px;display:flex;align-items:center}.divider{margin:0 4px}.video-description{margin:0;font-size:0.9rem;line-height:1.5;color:var(--video-description-color, #666);transition:all 0.3s ease}.video-description.truncated{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.show-more-btn{background:none;border:none;color:var(--accent-color, #0066cc);font-size:0.8rem;cursor:pointer;padding:4px 0;margin-top:4px;display:inline-block;outline:none}.show-more-btn:hover{text-decoration:underline}@media (max-width: 768px){.video-info{padding:4px 2px}.video-title{font-size:1.2rem}}";const Et=".quiz-overlay{position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(0, 0, 0, 0.4);display:flex;align-items:start;z-index:300}.quiz-modal{border-radius:12px;margin:10px;max-width:40%;min-width:30%;min-height:30%;max-height:95%;overflow-y:auto}.quiz-header{display:flex;justify-content:space-between;align-items:center;padding:8px;border-bottom:1px solid var(--vp-controls-bg)}.quiz-header h3{margin:0;color:var(--vp-text);font-size:18px}.close-btn{background:none;border:none;font-size:24px;cursor:pointer;color:var(--vp-text);padding:0;width:30px;height:30px;display:flex;align-items:center;justify-content:center}.quiz-content{padding:2px 10px}.quiz-question{font-size:16px;font-weight:500;margin-bottom:8px;color:var(--vp-text);line-height:1.5}.submit-text{color:var(--vp-text)}.quiz-options{display:flex;flex-direction:column;gap:4px}.quiz-option{background:var(--vp-controls-bg);color:var(--vp-video-text);padding:15px;border-radius:8px;cursor:pointer;transition:all 0.2s;text-align:right;font-size:14px}.quiz-notification-container{position:absolute;top:16px;z-index:10;display:flex;align-items:center;gap:4px}.quiz-info-icon{width:24px;height:24px;background-color:var(--vp-controls-bg);color:var(--vp-video-text);border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:bold;font-size:14px;cursor:pointer;border:2px solid var(--vp-video-text)}.quiz-info-icon:hover{transform:scale(1.1)}.quiz-alert-strip{position:absolute;white-space:nowrap;background-color:var(--vp-controls-bg);color:var(--vp-video-text);padding:6px 16px;border-radius:4px;animation:slideIn 0.5s forwards, fadeOut 0.5s 6s forwards;transform:translateX(100%);opacity:0;cursor:pointer}.quiz-option-full{position:relative;width:100%;padding:12px 16px;margin-bottom:8px;border:none;text-align:left;font-weight:500;border-radius:6px;border:1px solid var(--vp-accent);color:var(--vp-video-text);cursor:pointer;display:flex;justify-content:space-between;align-items:center;transition:background 0.3s ease}.quiz-option-full.voted{cursor:default;border:none;color:var(--vp-video-text);background-color:var(--vp-controls-bg)}.quiz-option-full.selected{font-weight:bold;opacity:0.7}.quiz-option-full.correct-opt{font-weight:bold;color:white;border:1px solid rgba(0, 128, 0, 0.5);background:rgba(0, 128, 0, 0.5)}.quiz-option-full.incorrect-opt{font-weight:bold;color:white;border:1px solid rgba(255, 0, 0, 0.5);background:rgba(255, 0, 0, 0.5)}@media (max-width: 768px){.quiz-modal{max-width:85%;min-width:65%;margin:20px}.quiz-content{padding:15px}}.quiz-content .submit-btn{display:block;margin:0% auto;padding:0.4rem 0.8rem;font-size:0.8rem;font-weight:600;color:var(--vp-video-text);background-color:var(--vp-accent);border:none;border-radius:0.375rem;cursor:pointer;transition:all 0.2s ease;box-shadow:0 1px 3px rgba(0, 0, 0, 0.1)}.quiz-content .submit-btn:hover:not(:disabled){background-color:var(--vp-video-text);color:var(--vp-accent);transform:translateY(-1px);box-shadow:0 4px 6px rgba(0, 0, 0, 0.1)}.quiz-content .submit-btn:active:not(:disabled){color:var(--vp-video-text);background-color:var(--vp-accent);transform:translateY(0)}.quiz-content .submit-btn:disabled{background-color:#9ca3af;cursor:not-allowed;opacity:0.7}.quiz-content .submit-btn:focus{outline:none;box-shadow:0 0 0 3px rgba(59, 130, 246, 0.5)}";const St=".poll-overlay{position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(0, 0, 0, 0.45);display:flex;align-items:start;z-index:300}.poll-modal{border-radius:12px;margin:10px;max-width:90%;min-width:30%;min-height:30%;max-height:95%;overflow-y:auto}.poll-header{display:flex;justify-content:space-between;align-items:center;padding:8px;border-bottom:1px solid var(--vp-controls-bg)}.poll-header h3{margin:0;color:var(--vp-text);font-size:18px}.close-btn{background:none;border:none;font-size:24px;cursor:pointer;color:var(--vp-text);padding:0;width:30px;height:30px;display:flex;align-items:center;justify-content:center}.poll-content{padding:2px 10px}.poll-question{font-size:16px;font-weight:500;margin-bottom:8px;color:var(--vp-text);line-height:1.5}.submit-text{color:var(--vp-text)}.poll-options{display:flex;flex-direction:column;gap:4px}.poll-option{background:var(--vp-controls-bg);color:var(--vp-video-text);padding:15px;border-radius:8px;cursor:pointer;transition:all 0.2s;text-align:left;font-size:14px}.poll-notification-container{position:absolute;top:16px;z-index:10;display:flex;align-items:center;gap:4px}.poll-info-icon{width:24px;height:24px;background-color:var(--vp-controls-bg);color:var(--vp-video-text);border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:bold;font-size:14px;cursor:pointer;border:2px solid var(--vp-video-text)}.poll-info-icon:hover{transform:scale(1.1)}.poll-alert-strip{position:absolute;white-space:nowrap;background-color:var(--vp-controls-bg);color:var(--vp-video-text);padding:6px 16px;border-radius:4px;animation:slideIn 0.5s forwards, fadeOut 0.5s 6s forwards;transform:translateX(100%);opacity:0;cursor:pointer}.poll-option-full{position:relative;width:100%;padding:12px 16px;margin-bottom:8px;border:none;text-align:left;font-weight:500;border-radius:6px;border:1px solid var(--vp-accent);color:var(--vp-video-text);cursor:pointer;display:flex;justify-content:space-between;align-items:center;transition:background 0.3s ease}.poll-option-full.voted{cursor:default;border:none;color:var(--vp-video-text);background-color:var(--vp-controls-bg)}.poll-option-full.selected{font-weight:bold;opacity:0.7}.percentage-text{font-size:0.875rem;opacity:0.93;font-weight:600}@media (max-width: 768px){.poll-modal{width:95%;margin:20px}.poll-content{padding:15px}}.poll-content .submit-btn{display:block;margin:0% auto;padding:0.4rem 0.8rem;font-size:0.8rem;font-weight:600;color:var(--vp-video-text);background-color:var(--vp-accent);border:none;border-radius:0.375rem;cursor:pointer;transition:all 0.2s ease;box-shadow:0 1px 3px rgba(0, 0, 0, 0.1)}.poll-content .submit-btn:hover:not(:disabled){background-color:var(--vp-video-text);color:var(--vp-accent);transform:translateY(-1px);box-shadow:0 4px 6px rgba(0, 0, 0, 0.1)}.poll-content .submit-btn:active:not(:disabled){color:var(--vp-video-text);background-color:var(--vp-accent);transform:translateY(0)}.poll-content .submit-btn:disabled{background-color:#9ca3af;cursor:not-allowed;opacity:0.7}.poll-content .submit-btn:focus{outline:none;box-shadow:0 0 0 3px rgba(59, 130, 246, 0.5)}";const At=".stats-overlay{position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(0, 0, 0, 0.45);display:flex;align-items:start;z-index:300}.stats-modal{border-radius:12px;margin:10px;max-width:90%;min-width:30%;min-height:30%;max-height:95%;overflow-y:auto}.stats-header{display:flex;justify-content:space-between;align-items:center;padding:8px;border-bottom:1px solid var(--vp-controls-bg)}.stats-header h3{margin:0;color:var(--vp-text);font-size:18px}.close-btn{background:none;border:none;font-size:24px;cursor:pointer;color:var(--vp-text);padding:0;width:30px;height:30px;display:flex;align-items:center;justify-content:center}.stats-content{padding:2px 10px}.stats-notification-container{position:absolute;top:16px;z-index:10;display:flex;align-items:center;gap:4px}.stats-info-icon{width:24px;height:24px;background-color:var(--vp-controls-bg);color:var(--vp-video-text);border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:bold;font-size:14px;cursor:pointer;border:2px solid var(--vp-video-text)}.stats-info-icon:hover{transform:scale(1.1)}.stats-alert-strip{position:absolute;white-space:nowrap;background-color:var(--vp-controls-bg);color:var(--vp-video-text);padding:6px 16px;border-radius:4px;animation:slideIn 0.5s forwards, fadeOut 0.5s 6s forwards;transform:translateX(100%);opacity:0;cursor:pointer}@media (max-width: 768px){.stats-modal{width:95%;margin:20px}.stats-content{padding:15px}}";const It=class{constructor(n){t(this,n);this.quizTriggered=i(this,"quizTriggered");this.pollTriggered=i(this,"pollTriggered");this.playVideo=i(this,"playVideo");this.pauseVideo=i(this,"pauseVideo");this.videoCompleted=i(this,"videoCompleted");this.videoError=i(this,"videoError")}get hostElement(){return n(this)}videoId;nextVideoId;clientId;userId;baseUrl;autoPlay;captureReaction;setVideoId;tempVideoId;src;token="";isLive=false;isDvrEnabled=true;quizzes;polls;statistics=[];scheduleTime="";showStartStream=false;timelineEvents=[];videoTitle;videoDescription;createdAt;isLiked=false;isDisliked=false;totalLikes=102e3;totalViews=0;poster;isPlaying=false;currentTime=0;duration=0;volume=1;isMuted=false;isFullscreen=false;showControls=true;showSettings=false;showQuiz=false;showPoll=false;showStatistics=false;showFullDescription=false;currentQuiz=null;currentPoll=null;currentStatistics=null;qualities=[];currentQuality=-1;audioTracks=[];currentAudioTrack=0;isLoading=false;showMainSettings=false;showQualityOptions=false;showAudioOptions=false;hasVideoStarted=false;quizAnswered=[];pollAnswered=[];quizTriggered;pollTriggered;playVideo;pauseVideo;videoCompleted;videoError;player;videoElement;videoContainer;controlsTimeout;progressUpdateInterval;livePollingInterval;reactionPollingInterval;scheduleTimer;async componentDidLoad(){if(this.autoPlay){this.videoElement.muted=true;this.isMuted=true}if(V.Player.isBrowserSupported()){if(this.player){this.player.detach();this.player.destroy()}V.polyfill.installAll();this.player=new V.Player;await this.player.attach(this.videoElement);gt(this)}else{console.error("Browser not supported by Shaka Player");this.videoError.emit("Browser not supported by Shaka Player")}pt(this);this.videoContainer.addEventListener("click",(t=>E(this,t)))}disconnectedCallback(){if(this.player){this.player.detach();this.player.destroy()}this.videoContainer.removeEventListener("click",(t=>E(this,t)));clearTimeout(this.controlsTimeout);clearInterval(this.progressUpdateInterval);clearInterval(this.livePollingInterval);clearInterval(this.reactionPollingInterval)}handleVideoIdChange(t){if(t){P(this);gt(this)}}render(){const t=getComputedStyle(document.documentElement).getPropertyValue("--vp-accent").trim();const n=getComputedStyle(document.documentElement).getPropertyValue("--vp-video-text").trim();return e(r,{key:"7040e26374f5d71983474a5ff92fb5d41c8fac5f"},e("div",{key:"187496dd6ca0b45623b3f6e29e4df682dd18cdf6",id:"spectart-video-player",class:"video-container",ref:t=>this.videoContainer=t},e("video",{key:"a7c92cb74eda5a53423017eeb6b061e257a203d1",ref:t=>this.videoElement=t,poster:this.poster,autoPlay:this.autoPlay,preload:"metadata"}),e("div",{key:"e17810b83c695638b93a3e4f3f04eb910960fef2",class:`buffering-loader ${this.isLoading&&!this.scheduleTime?"active":""}`},e("div",{key:"fa9ead7027e6d15812dd22312b9e8e38e9d67ef4",class:"spinner"})),this.showStartStream||this.scheduleTime&&new Date(this.scheduleTime)>new Date?e("div",{class:"scheduled-message"},this.showStartStream?e("button",{class:"big-play-pause",onClick:()=>bt(this)},e("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none"},e("path",{d:"M5.33282 16.0005V11.2538C5.33282 5.36051 9.50616 2.94718 14.6128 5.89384L18.7328 8.26718L22.8528 10.6405C27.9595 13.5872 27.9595 18.4138 22.8528 21.3605L18.7328 23.7338L14.6128 26.1072C9.50616 29.0538 5.33282 26.6405 5.33282 20.7472V16.0005Z",fill:n}))):e("p",null,"Video is scheduled for ",vt(this.scheduleTime))):e(e.Fragment,null,e("div",{class:`center-controls ${this.showControls&&!this.showQuiz&&!this.showPoll&&!this.isLoading?"visible":""}`,onMouseMove:()=>dt(this)},e("div",{class:"controls-container"},this.isDvrEnabled&&this.hasVideoStarted&&e("button",{class:"skip-btn",onClick:()=>p(this)},e("svg",{width:"42",height:"42",viewBox:"0 0 42 42",fill:"none"},e("path",{d:"M17.0682 29.0064C16.3654 29.0064 15.7825 28.4235 15.7825 27.7207V21.9093L15.4568 22.2692C14.9768 22.8007 14.1711 22.8349 13.6396 22.3721C13.1082 21.8921 13.0739 21.0864 13.5368 20.555L16.1082 17.6921C16.4682 17.2978 17.0339 17.1607 17.5311 17.3492C18.0282 17.5378 18.3539 18.0178 18.3539 18.5493V27.7207C18.3539 28.4407 17.7882 29.0064 17.0682 29.0064Z",fill:n}),e("path",{d:"M17.5044 8.59586L17.498 8.59035L17.4915 8.58502C17.2168 8.36185 17.1734 7.95611 17.3849 7.68238L20.7747 3.45377C20.9989 3.17935 21.4056 3.13705 21.6789 3.35051L22.0747 2.84393L21.6789 3.35051C21.9359 3.55131 21.9921 3.96575 21.7758 4.24561L18.3845 8.47616L18.3763 8.48637L18.3686 8.4969C18.2578 8.64724 18.0787 8.73249 17.8918 8.73249C17.7366 8.73249 17.6155 8.69104 17.5044 8.59586Z",fill:n,stroke:n,"stroke-width":"1.28571"}),e("path",{d:"M9.64739 14.1831L9.64552 14.1856C7.71364 16.7614 6.68834 19.7758 6.68834 22.9027C6.68834 30.9549 13.2333 37.4999 21.2855 37.4999C29.3377 37.4999 35.8827 30.9549 35.8827 22.9027C35.8827 14.8505 29.3377 8.30552 21.2855 8.30552C20.2385 8.30552 19.1788 8.43207 18.0392 8.69891C17.6884 8.77653 17.3404 8.55097 17.267 8.22447L16.6735 8.358L17.267 8.22447C17.1879 7.87287 17.4137 7.52348 17.7409 7.44986L17.7419 7.44964C18.9901 7.16672 20.159 7.01981 21.2855 7.01981C30.0338 7.01981 37.1684 14.1382 37.1684 22.9027C37.1684 31.6672 30.0338 38.7856 21.2855 38.7856C12.5373 38.7856 5.40262 31.6672 5.40262 22.9027C5.40262 19.497 6.50379 16.221 8.61553 13.416C8.83469 13.1274 9.2383 13.0745 9.51443 13.2837C9.80364 13.5028 9.85668 13.9068 9.64739 14.1831Z",fill:n,stroke:n,"stroke-width":"1.28571"}),e("path",{d:"M24.7143 28.3617C22.4636 28.3617 20.6429 26.5409 20.6429 24.2902V21.976C20.6429 19.7253 22.4636 17.9046 24.7143 17.9046C26.965 17.9046 28.7857 19.7253 28.7857 21.976V24.2902C28.7857 26.5409 26.965 28.3617 24.7143 28.3617ZM24.7143 19.2074C23.1764 19.2074 21.9286 20.4553 21.9286 21.9932V24.3074C21.9286 25.8453 23.1764 27.0931 24.7143 27.0931C26.2522 27.0931 27.5 25.8453 27.5 24.3074V21.9932C27.5 20.4553 26.2522 19.2074 24.7143 19.2074Z",fill:n,stroke:n,"stroke-width":"1.28571"}))),e("button",{class:"big-play-pause",onClick:()=>c(this)},this.isPlaying?e("svg",{width:"54",height:"54",viewBox:"0 0 54 54",fill:"none"},e("path",{d:"M31.5003 42.752H40.5003V11.252H31.5003M13.5003 42.752H22.5003V11.252H13.5003V42.752Z",fill:n})):e("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none"},e("path",{d:"M5.33282 16.0005V11.2538C5.33282 5.36051 9.50616 2.94718 14.6128 5.89384L18.7328 8.26718L22.8528 10.6405C27.9595 13.5872 27.9595 18.4138 22.8528 21.3605L18.7328 23.7338L14.6128 26.1072C9.50616 29.0538 5.33282 26.6405 5.33282 20.7472V16.0005Z",fill:n}))),this.isDvrEnabled&&this.hasVideoStarted&&e("button",{class:"skip-btn",onClick:()=>v(this)},e("svg",{width:"42",height:"42",viewBox:"0 0 42 42",fill:"none"},e("path",{d:"M24.1081 9.37667C23.731 9.37667 23.3538 9.2053 23.1138 8.89673L19.7195 4.66239C19.2738 4.11382 19.3595 3.29098 19.9253 2.86241C20.4738 2.4167 21.2795 2.5024 21.7252 3.06812L25.1195 7.30246C25.5652 7.85103 25.4795 8.67386 24.9138 9.10244C24.6738 9.27386 24.3824 9.37667 24.1081 9.37667Z",fill:n}),e("path",{d:"M24.2516 7.44824L24.2516 7.44828L24.2587 7.44986C24.6006 7.5268 24.8179 7.88249 24.7361 8.20967L24.7343 8.21705L24.7326 8.22447C24.6552 8.56852 24.3138 8.78506 23.9693 8.70103L23.9693 8.701L23.9636 8.69968C22.8224 8.43221 21.7446 8.30552 20.7141 8.30552C12.6619 8.30552 6.1169 14.8505 6.1169 22.9027C6.1169 30.9549 12.6619 37.4999 20.7141 37.4999C28.7663 37.4999 35.3112 30.9549 35.3112 22.9027C35.3112 19.7758 34.2859 16.7614 32.3541 14.1856L32.3522 14.1831C32.1429 13.9068 32.1959 13.5028 32.4851 13.2837C32.7613 13.0745 33.165 13.1274 33.3841 13.4161C35.4958 16.2211 36.597 19.497 36.597 22.9027C36.597 31.6672 29.4623 38.7856 20.7141 38.7856C11.9658 38.7856 4.83119 31.6672 4.83119 22.9027C4.83119 14.1377 11.9491 7.01981 20.7141 7.01981C21.8449 7.01981 22.9952 7.15067 24.2516 7.44824Z",fill:n,stroke:n,"stroke-width":"1.28571"}),e("path",{d:"M15.8543 21.9093V20.2408L14.7348 21.478L14.4091 21.8379L14.4087 21.8383C14.171 22.1015 13.7692 22.1257 13.4953 21.8911C13.2357 21.6526 13.2133 21.2528 13.4479 20.9803L16.0134 18.124C16.1977 17.9235 16.4847 17.8565 16.7321 17.9503C16.9752 18.0425 17.1401 18.2803 17.1401 18.5493V27.7207C17.1401 28.0856 16.8622 28.3635 16.4972 28.3635C16.1494 28.3635 15.8543 28.0685 15.8543 27.7207V21.9093Z",fill:n,stroke:n,"stroke-width":"1.28571"}),e("path",{d:"M24.1429 28.3617C21.8922 28.3617 20.0714 26.5409 20.0714 24.2902V21.976C20.0714 19.7253 21.8922 17.9046 24.1429 17.9046C26.3935 17.9046 28.2143 19.7253 28.2143 21.976V24.2902C28.2143 26.5409 26.3935 28.3617 24.1429 28.3617ZM24.1429 19.2074C22.605 19.2074 21.3571 20.4553 21.3571 21.9932V24.3074C21.3571 25.8453 22.605 27.0931 24.1429 27.0931C25.6807 27.0931 26.9286 25.8453 26.9286 24.3074V21.9932C26.9286 20.4553 25.6807 19.2074 24.1429 19.2074Z",fill:n,stroke:n,"stroke-width":"1.28571"}))))),(this.hasVideoStarted||!this.poster)&&e(e.Fragment,null,this.isLive&&!this.showControls&&e("div",{class:"live-tag"},"LIVE"),!!this.quizzes&&e(ot,{quizzes:this.quizzes,showQuiz:this.showQuiz,currentTime:this.currentTime,answered:this.quizAnswered,onClick:(t,n)=>{this.currentQuiz=t;this.showQuiz=true;this.quizzes=n},pollPosition:this.currentPoll?.position}),!!this.polls&&e(Z,{showPoll:this.showPoll,polls:this.polls,currentTime:this.currentTime,onClick:(t,n)=>{this.currentPoll=t;this.showPoll=true;this.polls=n},quizPosition:this.currentQuiz?.position}),!!this.statistics.length&&e(yt,{showStats:this.showStatistics,stats:this.statistics,currentTime:this.currentTime,onClick:(t,n)=>{this.currentStatistics=t;this.showStatistics=true;this.statistics=n},quizPosition:this.currentQuiz?.position,pollPosition:this.currentPoll?.position}),e("div",{class:`controls ${this.showControls&&!this.showQuiz&&!this.showPoll?"visible":""}`},e("div",{class:"controls-row"},e("button",{class:"control-btn",onClick:()=>c(this)},this.isPlaying?e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:n},e("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"})):e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:n},e("path",{d:"M8 5v14l11-7z"}))),this.isDvrEnabled&&(this.isLive?e("div",{class:"time-display"},ct(this.currentTime,this.duration)):e("div",{class:"time-display"},ft(this.currentTime)," / ",ft(this.duration))),e("div",{class:"spacer"}),e("div",{class:"volume-control"},e("button",{class:"control-btn",onClick:()=>l(this)},this.isMuted||this.volume===0?e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:n},e("path",{d:"M16.5 12A4.5 4.5 0 0 0 14 7.97v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51A8.796 8.796 0 0 0 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.25A7.003 7.003 0 0 1 14 18.7v2.06A8.99 8.99 0 0 0 17.69 19l2.04 2.04L21 19.73 4.27 3zM12 4L9.91 6.09 12 8.18V4z"})):e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:n},e("path",{d:"M3 9v6h4l5 5V4L7 9H3zm13.5 3A4.5 4.5 0 0 0 14 7.97v8.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"}))),e("input",{type:"range",min:"0",max:"1",step:"0.1",value:this.isMuted?0:this.volume,onInput:t=>h(this,parseFloat(t.target.value)),class:"volume-slider",style:{background:ht(this.isMuted,this.volume)}})),e("button",{class:"control-btn",onClick:t=>k(this,t)},e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},e("path",{d:"M15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15C13.6569 15 15 13.6569 15 12Z",fill:n}),e("path",{d:"M12.8804 22.002H11.1204C10.0804 22.002 9.22043 21.152 9.22043 20.102C9.22043 18.292 7.94043 17.552 6.37043 18.462C5.47043 18.982 4.30042 18.672 3.78042 17.762L2.79042 16.032C2.32042 15.242 2.60042 14.222 3.39042 13.752L3.58042 13.642C5.15043 12.742 5.15043 11.262 3.58042 10.352L3.39042 10.242C2.60042 9.77195 2.32042 8.75195 2.79042 7.96195L3.78042 6.23195C4.30042 5.32195 5.47043 5.01195 6.37043 5.53195C7.94043 6.44195 9.22043 5.70195 9.22043 3.89195C9.22043 2.85195 10.0704 1.99195 11.1204 1.99195H12.8804C13.9204 1.99195 14.7804 2.84195 14.7804 3.89195C14.7804 5.70195 16.0604 6.44195 17.6304 5.53195C18.5404 5.01195 19.7004 5.32195 20.2204 6.23195L21.2104 7.96195C21.6804 8.75195 21.4004 9.77195 20.6104 10.242L20.4204 10.352C18.8504 11.252 18.8504 12.732 20.4204 13.642L20.6104 13.752C21.4004 14.222 21.6804 15.242 21.2104 16.032L20.2204 17.762C19.7004 18.672 18.5304 18.982 17.6304 18.462C16.0604 17.552 14.7804 18.292 14.7804 20.102C14.7804 21.152 13.9204 22.002 12.8804 22.002Z",stroke:n,"stroke-width":"1.8","stroke-miterlimit":"10","stroke-linecap":"round","stroke-linejoin":"round"}))),e("button",{class:"control-btn",onClick:()=>m(this)},e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},e("path",{d:"M0 1.37143C0 0.614011 0.614009 0 1.37143 0H4.57143C5.20261 0 5.71429 0.511675 5.71429 1.14286C5.71429 1.77404 5.20261 2.28571 4.57143 2.28571H2.28571V4.57143C2.28571 5.20261 1.77404 5.71429 1.14286 5.71429C0.511675 5.71429 0 5.20261 0 4.57143V1.37143ZM10.2857 1.14286C10.2857 0.511675 10.7974 0 11.4286 0H14.6286C15.386 0 16 0.614009 16 1.37143V4.57143C16 5.20261 15.4883 5.71429 14.8571 5.71429C14.226 5.71429 13.7143 5.20261 13.7143 4.57143V2.28571H11.4286C10.7974 2.28571 10.2857 1.77404 10.2857 1.14286ZM13.7143 11.4286C13.7143 10.7974 14.226 10.2857 14.8571 10.2857C15.4883 10.2857 16 10.7974 16 11.4286V14.6286C16 15.386 15.386 16 14.6286 16H11.4286C10.7974 16 10.2857 15.4883 10.2857 14.8571C10.2857 14.226 10.7974 13.7143 11.4286 13.7143H13.7143V11.4286ZM4.57143 13.7143C5.20261 13.7143 5.71429 14.226 5.71429 14.8571C5.71429 15.4883 5.20261 16 4.57143 16H1.37143C0.614011 16 0 15.386 0 14.6286V11.4286C0 10.7974 0.511675 10.2857 1.14286 10.2857C1.77404 10.2857 2.28571 10.7974 2.28571 11.4286V13.7143H4.57143Z",fill:n}))),this.isLive&&this.isDvrEnabled&&Math.abs(this.duration-this.currentTime)>5&&e("button",{class:"control-btn go-live-button",onClick:()=>T(this)},"Go Live")),this.isDvrEnabled&&e("div",{class:"progress-row"},e("div",{class:"progress-container"},e("input",{type:"range",min:"0",step:1,max:this.duration,value:this.currentTime,onInput:t=>d(this,parseFloat(t.target.value)),class:"progress-slider",style:{background:lt(this.currentTime,this.duration)}}),e("div",{class:"timeline-markers"},this.timelineEvents.map((t=>e("div",{class:`timeline-marker`,style:{left:`${t.timestamp/this.duration*100}%`},"data-tooltip":`${t.name}`,onClick:()=>d(this,t.timestamp)},!!t.image?e("img",{src:t.image,width:"14",height:"10",alt:"event"}):e("svg",{width:"8",height:"8"},e("circle",{cx:"4",cy:"4",r:"4",fill:n}))))))))),this.showSettings&&e("div",{class:"settings-menu"},!this.showQualityOptions&&!this.showAudioOptions?e("div",{class:"main-settings"},e("button",{class:"settings-item",onClick:t=>{t.stopPropagation();this.showQualityOptions=true;this.showMainSettings=false}},e("span",null,"Quality"),e("span",{class:"selected-option"},this.currentQuality===-1?"Auto":this.qualities[this.currentQuality]?.name||"Auto")),this.audioTracks.length>1&&e("button",{class:"settings-item",onClick:t=>{t.stopPropagation();this.showAudioOptions=true;this.showMainSettings=false}},e("span",null,"Audio Track"),e("span",{class:"selected-option"},this.audioTracks[this.currentAudioTrack]?.label||"Default"))):null,this.showQualityOptions&&e("div",{class:"options-panel"},e("button",{class:"back-button",onClick:t=>{t.stopPropagation();this.showQualityOptions=false;this.showMainSettings=true}},e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"white"},e("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"})),"Quality"),e("div",{class:"options-list"},e("button",{class:`option-item ${this.currentQuality===-1?"active":""}`,onClick:()=>{b(this,-1);this.showSettings=false}},"Auto"),this.qualities.map(((t,n)=>e("button",{class:`option-item ${this.currentQuality===n?"active":""}`,onClick:()=>{b(this,n);this.showSettings=false}},t.name))))),this.showAudioOptions&&e("div",{class:"options-panel"},e("button",{class:"back-button",onClick:t=>{t.stopPropagation();this.showAudioOptions=false;this.showMainSettings=true}},e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"white"},e("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"})),"Audio Track"),e("div",{class:"options-list"},this.audioTracks.map(((t,n)=>e("button",{class:`option-item ${this.currentAudioTrack===n?"active":""}`,onClick:t=>{t.stopPropagation();y(this,n);this.showSettings=false}},t.label||`Track ${n+1}`)))))),this.showQuiz&&st(this,(t=>W(this,t)),(()=>Y(this))),this.showPoll&&it(this,(t=>$(this,t)),(()=>Q(this))),this.showStatistics&&kt(this,(()=>J(this)))))),!!this.videoTitle&&e("div",{key:"44aeff45436a7abae77dc10e65be84bf50f3750b",id:"spectart-player-meta-data",class:"video-info"},e("div",{key:"f5e83029b5c1376e16c9c72f06daf442a22dc696",class:"title-like-container"},e("p",{key:"50f02f827f8eb76d7491c5d95653702fbcca39fc",class:"video-title"},this.videoTitle),this.captureReaction&&e("div",{key:"f368063f1c083d3172c50539909ee267d9c27e0f",class:"rating-container"},e("button",{key:"4bd8d5a162cf419c5ccb2fcc8c88c71627943909",class:`thumb-btn ${this.isLiked?"active":""}`},e("svg",{key:"b25b1c4d52520f0fdfdae5118d36e61945cf7fe2",width:"20",height:"20",viewBox:"0 0 24 24",onClick:()=>I(this)},e("path",{key:"2697250182c7f2b1cf3928886d1af637923f14f0",fill:this.isLiked?t:"currentColor",d:"M1 21h4V9H1v12zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2z"})),e("span",{key:"81caf44c53c6d8e58ad5fc061bb8867879f276f3",class:"count"},N(this.totalLikes))),e("p",{key:"9a044d74de79a522030779cc0546f08f1ea67b45",class:"divider"}),e("button",{key:"592c056c16d50ed6e0bef19b45c11b4e0ce23f15",class:`thumb-btn ${this.isDisliked?"active":""}`},e("svg",{key:"6a7e421d2204def5a950035b8078027d160c870e",width:"20",height:"20",viewBox:"0 0 24 24",onClick:()=>M(this)},e("path",{key:"af073b10a79019e49ccb0619d78c6d30dde0f33f",fill:this.isDisliked?t:"currentColor",d:"M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57-.03.32c0 .41.17.79.44 1.06L9.83 23l6.58-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2zm4 0v12h4V3h-4z"}))))),this.videoDescription&&e("div",{key:"ba3a27d4e5408faf71bf3a42582a2832e1bda59d",class:"description-container"},!this.isLive&&e("div",{key:"399dfe9635c8de31528f10e64d1611790a87cf54",class:"video-metadata"},e("span",{key:"222f353c980370d1ffc6f25bed50c65fca9c059e",class:"views"},this.totalViews," views"),e("span",{key:"7a63b2a10cbb102809b03b933919a3f1e321dab3",class:"divider"},"•"),e("span",{key:"bbba3d9912458ac6249a6b120f8b71dd9555f50a",class:"upload-date"},x(this.createdAt))),e("p",{key:"d7786bddf8b065d5710769a76d68cf4e0ea741b3",class:`video-description ${!this.showFullDescription?"truncated":""}`},this.videoDescription),S(this)&&e("button",{key:"0b593f66557ea7aff4168ec5971445592d40a9ff",class:"show-more-btn",onClick:()=>A(this)},this.showFullDescription?"Show Less":"Show More"))))}static get watchers(){return{videoId:["handleVideoIdChange"]}}};It.style=Tt+(Et+(St+At));const Mt=":host{max-width:30%;display:flex;overflow:auto;padding-right:4px}::-webkit-scrollbar{width:4px;height:8px}::-webkit-scrollbar-thumb{background:var(--vp-text);border-radius:4px}::-webkit-scrollbar-track{background:var(--vp-primary-bg)}.suggestions-container{width:100%;display:flex;flex-direction:column;gap:8px;overflow:hidden}.suggestion-title{color:var(--vp-text);font-size:1rem;font-weight:500;margin:0%;font-family:var(--title-font)}@media (max-width: 768px){:host{min-width:100%;max-width:100%;height:100%;display:block;padding-right:0px}.Suggestion-title{font-size:0.7rem}.suggestions-container{padding-right:0px}}.suggestions-list{display:block;flex:1;gap:6px;overflow-y:auto;font-family:var(--description-font)}.suggestion-card{display:flex;gap:12px;height:77px;cursor:pointer;align-items:flex-start;overflow:hidden;border-radius:2px;padding:4px}.suggestions-list .selected{background:rgba(0, 0, 0, 0.2);opacity:0.9}.thumbnail-container{position:relative;flex-shrink:0;width:130px;height:100%;background:black;border-radius:4px;overflow:hidden}.thumbnail-container img{width:100%;height:100%;object-fit:cover;border-radius:4px}.duration{position:absolute;bottom:4px;right:4px;background-color:rgba(0, 0, 0, 0.8);color:#fff;font-size:11px;padding:2px 4px;border-radius:2px}.suggestion-info{display:flex;flex-direction:column;font-size:14px;flex:1;min-width:0}.suggestion-info .title{font-weight:600;margin-bottom:4px;line-height:1.2;word-break:break-word;color:var(--vp-text);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.suggestion-info .channel{color:var(--vp-text);font-size:13px;font-weight:thin}.suggestion-info .meta{color:#909090;font-size:12px}h4,p{margin:0}.load-more-container{display:flex;justify-content:center;align-items:center}.load-more-btn{padding:0.4rem 0.8rem;font-size:0.8rem;font-weight:600;color:var(--vp-video-text);background-color:var(--vp-accent);border:none;border-radius:0.375rem;cursor:pointer;transition:all 0.2s ease;box-shadow:0 1px 3px rgba(0, 0, 0, 0.1)}";const xt=class{constructor(n){t(this,n)}handlePlaySuggestion;setSuggestions;baseUrl;clientId;videoId;height;suggestions=[];page=1;limit=5;totalData=0;async componentWillLoad(){const t=await s(this,this.page,this.limit);this.suggestions=t.suggestions;this.totalData=t.totalCount;this.setSuggestions(t.suggestions)}handleSuggestions(){this.setSuggestions(this.suggestions)}formatDuration(t){const n=parseInt(t);const e=Math.floor(n/3600);const i=Math.floor(n%3600/60);const r=Math.floor(n%60);const a=Math.round(n%1*100);const u=t=>t.toString().padStart(2,"0");if(e>0){return`${e}:${u(i)}:${u(r)}`}else{return`${i}:${u(r)}${a?`.${a}`:""}`}}async loadMoreSuggestions(){try{this.page=this.page+1;const t=await s(this,this.page,this.limit);this.suggestions=[...this.suggestions,...t.suggestions];this.totalData=t.totalCount;this.setSuggestions(this.suggestions)}catch(t){this.page-=1}}render(){return e(e.Fragment,null,!!this.suggestions.length?e("div",{class:"suggestions-container",style:this.height?{height:`${this.height}px`}:{height:"100%"}},e("p",{class:"suggestion-title"},"Suggestions"),e("div",{class:"suggestions-list"},this.suggestions.map((t=>e("div",{class:`suggestion-card ${this.videoId===t.id?"selected":""}`,onClick:()=>this.handlePlaySuggestion(t.id)},e("div",{class:"thumbnail-container"},!!t.thumbnailPath?e("img",{src:t.thumbnailPath,alt:t.title}):e("video",{src:t.outputFilePath,controls:false,autoPlay:false,preload:"metadata"}),e("span",{class:"duration"},this.formatDuration(t.duration))),e("div",{class:"suggestion-info"},e("h4",{class:"title"},t.title," "),e("p",{class:"meta"},x(t.createdAt)))))),this.suggestions.length<this.totalData&&e("div",{class:"load-more-container"},e("button",{onClick:()=>this.loadMoreSuggestions(),class:"load-more-btn"},"Load More")))):e(e.Fragment,null))}static get watchers(){return{suggestions:["handleSuggestions"]}}};xt.style=Mt;export{L as spectatr_player_sdk,It as video_player,xt as video_suggestions};
//# sourceMappingURL=p-62e32bac.entry.js.map