@vyonio/player 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +273 -2
- package/THIRD_PARTY_NOTICES.txt +682 -0
- package/dist/index.d.ts +63 -0
- package/dist/index.js +38 -0
- package/dist/plyr-icons.svg +1 -0
- package/dist/style.css +2 -0
- package/package.json +37 -4
package/dist/index.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=/* @__PURE__ */ ((n,r,a)=>(a=n==null?{}:e(i(n)),s(t(a,`default`,{value:n,enumerable:!0}),n)))((/* @__PURE__ */ o((e=>{(function(){var t=typeof window<`u`?window:global,n={};if((function(e,t,n){var r,i=typeof Object.create==`function`?Object.create:function(e){function t(){}return t.prototype=e,new t},a=typeof Object.defineProperties==`function`?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e};function o(n){n=[typeof globalThis==`object`&&globalThis,n,typeof e==`object`&&e,typeof self==`object`&&self,typeof t==`object`&&t];for(var r=0;r<n.length;++r){var i=n[r];if(i&&i.Math==Math)return i}throw Error(`Cannot find global object`)}var s=o(this);function c(e,t){if(t)a:{var n=s;e=e.split(`.`);for(var r=0;r<e.length-1;r++){var i=e[r];if(!(i in n))break a;n=n[i]}e=e[e.length-1],r=n[e],t=t(r),t!=r&&t!=null&&a(n,e,{configurable:!0,writable:!0,value:t})}}var l;if(typeof Object.setPrototypeOf==`function`)l=Object.setPrototypeOf;else{var u;a:{var d={a:!0},f={};try{f.__proto__=d,u=f.a;break a}catch{}u=!1}l=u?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw TypeError(e+` is not extensible`);return e}:null}var p=l;function m(e,t){if(e.prototype=i(t.prototype),e.prototype.constructor=e,p)p(e,t);else for(var n in t)if(n!=`prototype`){if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n]}e.Im=t.prototype}function h(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}function g(e){var t=typeof Symbol<`u`&&Symbol.iterator&&e[Symbol.iterator];if(t)return t.call(e);if(typeof e.length==`number`)return{next:h(e)};throw Error(String(e)+` is not an iterable or ArrayLike`)}function _(e){if(!(e instanceof Array)){e=g(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}function v(e){if(!(e instanceof Object))throw TypeError(`Iterator result `+e+` is not an object`)}function y(){this.J=!1,this.H=null,this.i=void 0,this.h=1,this.G=this.I=0,this.M=this.C=null}function b(e){if(e.J)throw TypeError(`Generator is already running`);e.J=!0}y.prototype.K=function(e){this.i=e};function x(e,t){e.C={Zh:t,oi:!0},e.h=e.I||e.G}y.prototype.getNextAddressJsc=function(){return this.h},y.prototype.getYieldResultJsc=function(){return this.i},y.prototype.return=function(e){this.C={return:e},this.h=this.G},y.prototype.return=y.prototype.return,y.prototype.O=function(e){this.C={A:e},this.h=this.G},y.prototype.jumpThroughFinallyBlocks=y.prototype.O,y.prototype.g=function(e,t){return this.h=t,{value:e}},y.prototype.yield=y.prototype.g,y.prototype.R=function(e,t){e=g(e);var n=e.next();if(v(n),n.done)this.i=n.value,this.h=t;else return this.H=e,this.g(n.value,t)},y.prototype.yieldAll=y.prototype.R,y.prototype.A=function(e){this.h=e},y.prototype.jumpTo=y.prototype.A,y.prototype.j=function(){this.h=0},y.prototype.jumpToEnd=y.prototype.j,y.prototype.m=function(e,t){this.I=e,t!=null&&(this.G=t)},y.prototype.setCatchFinallyBlocks=y.prototype.m,y.prototype.D=function(e){this.I=0,this.G=e||0},y.prototype.setFinallyBlock=y.prototype.D,y.prototype.o=function(e,t){this.h=e,this.I=t||0},y.prototype.leaveTryBlock=y.prototype.o,y.prototype.l=function(e){return this.I=e||0,e=this.C.Zh,this.C=null,e},y.prototype.enterCatchBlock=y.prototype.l,y.prototype.u=function(e,t,n){n?this.M[n]=this.C:this.M=[this.C],this.I=e||0,this.G=t||0},y.prototype.enterFinallyBlock=y.prototype.u,y.prototype.B=function(e,t){t=this.M.splice(t||0)[0],(t=this.C=this.C||t)?t.oi?this.h=this.I||this.G:t.A!=null&&this.G<t.A?(this.h=t.A,this.C=null):this.h=this.G:this.h=e},y.prototype.leaveFinallyBlock=y.prototype.B,y.prototype.N=function(e){return new S(e)},y.prototype.forIn=y.prototype.N;function S(e){for(var t in this.i=e,this.g=[],e)this.g.push(t);this.g.reverse()}S.prototype.h=function(){for(;this.g.length>0;){var e=this.g.pop();if(e in this.i)return e}return null},S.prototype.getNext=S.prototype.h;function C(e){this.g=new y,this.h=e}function w(e,t){b(e.g);var n=e.g.H;return n?T(e,`return`in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),E(e))}function T(e,t,n,r){try{var i=t.call(e.g.H,n);if(v(i),!i.done)return e.g.J=!1,i;var a=i.value}catch(t){return e.g.H=null,x(e.g,t),E(e)}return e.g.H=null,r.call(e.g,a),E(e)}function E(e){for(;e.g.h;)try{var t=e.h(e.g);if(t)return e.g.J=!1,{value:t.value,done:!1}}catch(t){e.g.i=void 0,x(e.g,t)}if(e.g.J=!1,e.g.C){if(t=e.g.C,e.g.C=null,t.oi)throw t.Zh;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function D(e){this.next=function(t){return b(e.g),e.g.H?t=T(e,e.g.H.next,t,e.g.K):(e.g.K(t),t=E(e)),t},this.throw=function(t){return b(e.g),e.g.H?t=T(e,e.g.H.throw,t,e.g.K):(x(e.g,t),t=E(e)),t},this.return=function(t){return w(e,t)},this[Symbol.iterator]=function(){return this}}function O(e){function t(t){return e.next(t)}function n(t){return e.throw(t)}return new Promise(function(r,i){function a(e){e.done?r(e.value):Promise.resolve(e.value).then(t,n).then(a,i)}a(e.next())})}function k(e){return O(new D(new C(e)))}function A(){for(var e=Number(this),t=[],n=e;n<arguments.length;n++)t[n-e]=arguments[n];return t}c(`Symbol`,function(e){function t(e){if(this instanceof t)throw TypeError(`Symbol is not a constructor`);return new n(r+(e||``)+`_`+i++,e)}function n(e,t){this.g=e,a(this,`description`,{configurable:!0,writable:!0,value:t})}if(e)return e;n.prototype.toString=function(){return this.g};var r=`jscomp_symbol_`+(Math.random()*1e9>>>0)+`_`,i=0;return t}),c(`Symbol.iterator`,function(e){return e||(e=Symbol(`Symbol.iterator`),a(Array.prototype,e,{configurable:!0,writable:!0,value:function(){return j(h(this))}}),e)});function j(e){return e={next:e},e[Symbol.iterator]=function(){return this},e}c(`Promise`,function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.o=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function r(e){return e instanceof t?e:new t(function(t){t(e)})}if(e)return e;n.prototype.h=function(e){if(this.g==null){this.g=[];var t=this;this.i(function(){t.l()})}this.g.push(e)};var i=s.setTimeout;n.prototype.i=function(e){i(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i(function(){throw e})},t.prototype.j=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.G),reject:e(this.l)}},t.prototype.G=function(e){if(e===this)this.l(/* @__PURE__ */ TypeError(`A Promise cannot resolve to itself`));else if(e instanceof t)this.I(e);else{a:switch(typeof e){case`object`:var n=e!=null;break a;case`function`:n=!0;break a;default:n=!1}n?this.D(e):this.m(e)}},t.prototype.D=function(e){var t=void 0;try{t=e.then}catch(e){this.l(e);return}typeof t==`function`?this.J(t,e):this.m(e)},t.prototype.l=function(e){this.u(2,e)},t.prototype.m=function(e){this.u(1,e)},t.prototype.u=function(e,t){if(this.h!=0)throw Error(`Cannot settle(`+e+`, `+t+`): Promise already settled in state`+this.h);this.h=e,this.i=t,this.h===2&&this.H(),this.B()},t.prototype.H=function(){var e=this;i(function(){if(e.C()){var t=s.console;t!==void 0&&t.error(e.i)}},1)},t.prototype.C=function(){if(this.o)return!1;var e=s.CustomEvent,t=s.Event,n=s.dispatchEvent;return n===void 0||(typeof e==`function`?e=new e(`unhandledrejection`,{cancelable:!0}):typeof t==`function`?e=new t(`unhandledrejection`,{cancelable:!0}):(e=s.document.createEvent(`CustomEvent`),e.initCustomEvent(`unhandledrejection`,!1,!0,e)),e.promise=this,e.reason=this.i,n(e))},t.prototype.B=function(){if(this.g!=null){for(var e=0;e<this.g.length;++e)a.h(this.g[e]);this.g=null}};var a=new n;return t.prototype.I=function(e){var t=this.j();e.Ne(t.resolve,t.reject)},t.prototype.J=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function r(e,t){return typeof e==`function`?function(t){try{i(e(t))}catch(e){a(e)}}:t}var i,a,o=new t(function(e,t){i=e,a=t});return this.Ne(r(e,i),r(n,a)),o},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.Ne=function(e,t){function n(){switch(r.h){case 1:e(r.i);break;case 2:t(r.i);break;default:throw Error(`Unexpected state: `+r.h)}}var r=this;this.g==null?a.h(n):this.g.push(n),this.o=!0},t.resolve=r,t.reject=function(e){return new t(function(t,n){n(e)})},t.race=function(e){return new t(function(t,n){for(var i=g(e),a=i.next();!a.done;a=i.next())r(a.value).Ne(t,n)})},t.all=function(e){var n=g(e),i=n.next();return i.done?r([]):new t(function(e,t){function a(t){return function(n){o[t]=n,s--,s==0&&e(o)}}var o=[],s=0;do o.push(void 0),s++,r(i.value).Ne(a(o.length-1),t),i=n.next();while(!i.done)})},t});function M(e,t){return Object.prototype.hasOwnProperty.call(e,t)}c(`WeakMap`,function(e){function t(e){if(this.g=(c+=Math.random()+1).toString(),e){e=g(e);for(var t;!(t=e.next()).done;)t=t.value,this.set(t[0],t[1])}}function n(){}function r(e){var t=typeof e;return t===`object`&&e!==null||t===`function`}function i(e){M(e,s)||a(e,s,{value:new n})}function o(e){var t=Object[e];t&&(Object[e]=function(e){return e instanceof n?e:(Object.isExtensible(e)&&i(e),t(e))})}if(function(){if(!e||!Object.seal)return!1;try{var t=Object.seal({}),n=Object.seal({}),r=new e([[t,2],[n,3]]);return r.get(t)!=2||r.get(n)!=3?!1:(r.delete(t),r.set(n,4),!r.has(t)&&r.get(n)==4)}catch{return!1}}())return e;var s=`$jscomp_hidden_`+Math.random();o(`freeze`),o(`preventExtensions`),o(`seal`);var c=0;return t.prototype.set=function(e,t){if(!r(e))throw Error(`Invalid WeakMap key`);if(i(e),!M(e,s))throw Error(`WeakMap key fail: `+e);return e[s][this.g]=t,this},t.prototype.get=function(e){return r(e)&&M(e,s)?e[s][this.g]:void 0},t.prototype.has=function(e){return r(e)&&M(e,s)&&M(e[s],this.g)},t.prototype.delete=function(e){return r(e)&&M(e,s)&&M(e[s],this.g)?delete e[s][this.g]:!1},t}),c(`Map`,function(e){function t(){var e={};return e.tc=e.next=e.head=e}function n(e,t){var n=e[1];return j(function(){if(n){for(;n.head!=e[1];)n=n.tc;for(;n.next!=n.head;)return n=n.next,{done:!1,value:t(n)};n=null}return{done:!0,value:void 0}})}function r(e,t){var n=t&&typeof t;n==`object`||n==`function`?a.has(t)?n=a.get(t):(n=``+ ++o,a.set(t,n)):n=`p_`+t;var r=e[0][n];if(r&&M(e[0],n))for(e=0;e<r.length;e++){var i=r[e];if(t!==t&&i.key!==i.key||t===i.key)return{id:n,list:r,index:e,entry:i}}return{id:n,list:r,index:-1,entry:void 0}}function i(e){if(this[0]={},this[1]=t(),this.size=0,e){e=g(e);for(var n;!(n=e.next()).done;)n=n.value,this.set(n[0],n[1])}}if(function(){if(!e||typeof e!=`function`||!e.prototype.entries||typeof Object.seal!=`function`)return!1;try{var t=Object.seal({x:4}),n=new e(g([[t,`s`]]));if(n.get(t)!=`s`||n.size!=1||n.get({x:4})||n.set({x:4},`t`)!=n||n.size!=2)return!1;var r=n.entries(),i=r.next();return i.done||i.value[0]!=t||i.value[1]!=`s`?!1:(i=r.next(),!(i.done||i.value[0].x!=4||i.value[1]!=`t`||!r.next().done))}catch{return!1}}())return e;var a=/* @__PURE__ */ new WeakMap;i.prototype.set=function(e,t){e=e===0?0:e;var n=r(this,e);return n.list||(n.list=this[0][n.id]=[]),n.entry?n.entry.value=t:(n.entry={next:this[1],tc:this[1].tc,head:this[1],key:e,value:t},n.list.push(n.entry),this[1].tc.next=n.entry,this[1].tc=n.entry,this.size++),this},i.prototype.delete=function(e){return e=r(this,e),e.entry&&e.list?(e.list.splice(e.index,1),e.list.length||delete this[0][e.id],e.entry.tc.next=e.entry.next,e.entry.next.tc=e.entry.tc,e.entry.head=null,this.size--,!0):!1},i.prototype.clear=function(){this[0]={},this[1]=this[1].tc=t(),this.size=0},i.prototype.has=function(e){return!!r(this,e).entry},i.prototype.get=function(e){return(e=r(this,e).entry)&&e.value},i.prototype.entries=function(){return n(this,function(e){return[e.key,e.value]})},i.prototype.keys=function(){return n(this,function(e){return e.key})},i.prototype.values=function(){return n(this,function(e){return e.value})},i.prototype.forEach=function(e,t){for(var n=this.entries(),r;!(r=n.next()).done;)r=r.value,e.call(t,r[1],r[0],this)},i.prototype[Symbol.iterator]=i.prototype.entries;var o=0;return i}),c(`Set`,function(e){function t(e){if(this.g=/* @__PURE__ */ new Map,e){e=g(e);for(var t;!(t=e.next()).done;)this.add(t.value)}this.size=this.g.size}return function(){if(!e||typeof e!=`function`||!e.prototype.entries||typeof Object.seal!=`function`)return!1;try{var t=Object.seal({x:4}),n=new e(g([t]));if(!n.has(t)||n.size!=1||n.add(t)!=n||n.size!=1||n.add({x:4})!=n||n.size!=2)return!1;var r=n.entries(),i=r.next();return i.done||i.value[0]!=t||i.value[1]!=t?!1:(i=r.next(),i.done||i.value[0]==t||i.value[0].x!=4||i.value[1]!=i.value[0]?!1:r.next().done)}catch{return!1}}()?e:(t.prototype.add=function(e){return e=e===0?0:e,this.g.set(e,e),this.size=this.g.size,this},t.prototype.delete=function(e){return e=this.g.delete(e),this.size=this.g.size,e},t.prototype.clear=function(){this.g.clear(),this.size=0},t.prototype.has=function(e){return this.g.has(e)},t.prototype.entries=function(){return this.g.entries()},t.prototype.values=function(){return this.g.values()},t.prototype.keys=t.prototype.values,t.prototype[Symbol.iterator]=t.prototype.values,t.prototype.forEach=function(e,t){var n=this;this.g.forEach(function(r){return e.call(t,r,r,n)})},t)});function ee(e,t,n){e instanceof String&&(e=String(e));for(var r=e.length,i=0;i<r;i++){var a=e[i];if(t.call(n,a,i,e))return{ki:i,v:a}}return{ki:-1,v:void 0}}c(`Array.prototype.findIndex`,function(e){return e||function(e,t){return ee(this,e,t).ki}});function te(e,t){e instanceof String&&(e+=``);var n=0,r=!1,i={next:function(){if(!r&&n<e.length){var i=n++;return{value:t(i,e[i]),done:!1}}return r=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}c(`Array.prototype.values`,function(e){return e||function(){return te(this,function(e,t){return t})}}),c(`Array.from`,function(e){return e||function(e,t,n){t=t??function(e){return e};var r=[],i=typeof Symbol<`u`&&Symbol.iterator&&e[Symbol.iterator];if(typeof i==`function`){e=i.call(e);for(var a=0;!(i=e.next()).done;)r.push(t.call(n,i.value,a++))}else for(i=e.length,a=0;a<i;a++)r.push(t.call(n,e[a],a));return r}}),c(`Array.prototype.keys`,function(e){return e||function(){return te(this,function(e){return e})}});function N(e,t,n){if(e==null)throw TypeError(`The 'this' value for String.prototype.`+n+` must not be null or undefined`);if(t instanceof RegExp)throw TypeError(`First argument to String.prototype.`+n+` must not be a regular expression`);return e+``}c(`String.prototype.startsWith`,function(e){return e||function(e,t){var n=N(this,e,`startsWith`),r=n.length,i=e.length;t=Math.max(0,Math.min(t|0,n.length));for(var a=0;a<i&&t<r;)if(n[t++]!=e[a++])return!1;return a>=i}}),c(`Object.is`,function(e){return e||function(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}}),c(`Array.prototype.includes`,function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var r=n.length;for(t=t||0,t<0&&(t=Math.max(t+r,0));t<r;t++){var i=n[t];if(i===e||Object.is(i,e))return!0}return!1}}),c(`String.prototype.includes`,function(e){return e||function(e,t){return N(this,e,`includes`).indexOf(e,t||0)!==-1}}),c(`String.fromCodePoint`,function(e){return e||function(e){for(var t=``,n=0;n<arguments.length;n++){var r=Number(arguments[n]);if(r<0||r>1114111||r!==Math.floor(r))throw RangeError(`invalid_code_point `+r);r<=65535?t+=String.fromCharCode(r):(r-=65536,t+=String.fromCharCode(r>>>10&1023|55296),t+=String.fromCharCode(r&1023|56320))}return t}}),c(`WeakSet`,function(e){function t(e){if(this.g=/* @__PURE__ */ new WeakMap,e){e=g(e);for(var t;!(t=e.next()).done;)this.add(t.value)}}return function(){if(!e||!Object.seal)return!1;try{var t=Object.seal({}),n=Object.seal({}),r=new e([t]);return!r.has(t)||r.has(n)?!1:(r.delete(t),r.add(n),!r.has(t)&&r.has(n))}catch{return!1}}()?e:(t.prototype.add=function(e){return this.g.set(e,!0),this},t.prototype.has=function(e){return this.g.has(e)},t.prototype.delete=function(e){return this.g.delete(e)},t)}),c(`Array.prototype.find`,function(e){return e||function(e,t){return ee(this,e,t).v}}),c(`Object.entries`,function(e){return e||function(e){var t=[],n;for(n in e)M(e,n)&&t.push([n,e[n]]);return t}});var ne=typeof Object.assign==`function`?Object.assign:function(e,t){if(e==null)throw TypeError(`No nullish arg`);e=Object(e);for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)M(r,i)&&(e[i]=r[i])}return e};c(`Object.assign`,function(e){return e||ne}),c(`Promise.prototype.finally`,function(e){return e||function(e){return this.then(function(t){return Promise.resolve(e()).then(function(){return t})},function(t){return Promise.resolve(e()).then(function(){throw t})})}}),c(`Array.prototype.entries`,function(e){return e||function(){return te(this,function(e,t){return[e,t]})}}),c(`Number.EPSILON`,function(){return 2220446049250313e-31}),c(`Number.MAX_SAFE_INTEGER`,function(){return 9007199254740991}),c(`Math.clz32`,function(e){return e||function(e){if(e=Number(e)>>>0,e===0)return 32;var t=0;return!(e&4294901760)&&(e<<=16,t+=16),!(e&4278190080)&&(e<<=8,t+=8),!(e&4026531840)&&(e<<=4,t+=4),!(e&3221225472)&&(e<<=2,t+=2),!(e&2147483648)&&t++,t}}),c(`Number.isNaN`,function(e){return e||function(e){return typeof e==`number`&&isNaN(e)}}),c(`String.prototype.repeat`,function(e){return e||function(e){var t=N(this,null,`repeat`);if(e<0||e>1342177279)throw RangeError(`Invalid count value`);e|=0;for(var n=``;e;)e&1&&(n+=t),(e>>>=1)&&(t+=t);return n}}),c(`Number.isFinite`,function(e){return e||function(e){return typeof e==`number`&&!isNaN(e)&&e!==1/0&&e!==-1/0}}),c(`Object.values`,function(e){return e||function(e){var t=[],n;for(n in e)M(e,n)&&t.push(e[n]);return t}}),c(`Math.log2`,function(e){return e||function(e){return Math.log(e)/Math.LN2}}),c(`String.prototype.endsWith`,function(e){return e||function(e,t){var n=N(this,e,`endsWith`);t===void 0&&(t=n.length),t=Math.max(0,Math.min(t|0,n.length));for(var r=e.length;r>0&&t>0;)if(n[--t]!=e[--r])return!1;return r<=0}}),c(`Math.trunc`,function(e){return e||function(e){if(e=Number(e),isNaN(e)||e===1/0||e===-1/0||e===0)return e;var t=Math.floor(Math.abs(e));return e<0?-t:t}});var re=this||self;function P(e,t){e=e.split(`.`);var n=re;e[0]in n||n.execScript===void 0||n.execScript(`var `+e[0]);for(var r;e.length&&(r=e.shift());)e.length||t===void 0?n=n[r]&&n[r]!==Object.prototype[r]?n[r]:n[r]={}:n[r]=t}function ie(e){this.i=Math.log(.5),this.g=Math.exp(this.i/e),this.j=this.h=0}ie.prototype.sample=function(e,t){var n=this.g**+e;t=t*(1-n)+n*this.h,isNaN(t)||(this.h=t,this.j+=e)};function ae(e){return e.h/(1-e.g**+e.j)}function oe(){this.h=new ie(2),this.j=new ie(5),this.g=0,this.i=128e3,this.l=16e3}oe.prototype.configure=function(e){this.i=e.minTotalBytes,this.l=e.minBytes;var t=this.h;t.g=Math.exp(t.i/e.fastHalfLife),t=this.j,t.g=Math.exp(t.i/e.slowHalfLife)},oe.prototype.sample=function(e,t){if(!(t<this.l)){var n=8e3*t/e;e/=1e3,this.g+=t,this.h.sample(e,n),this.j.sample(e,n)}},oe.prototype.getBandwidthEstimate=function(e){return this.g<this.i?e:Math.min(ae(this.h),ae(this.j))};function se(){}function ce(){}function F(){}function le(e){var t=A.apply(1,arguments);de.has(e)||(de.add(e),F.apply(se,_(t)))}function ue(){}var de=/* @__PURE__ */ new Set;e.console&&((/* @__PURE__ */ new Map()).set(1,function(){return console.error.apply(console,_(A.apply(0,arguments)))}).set(2,function(){return console.warn.apply(console,_(A.apply(0,arguments)))}).set(3,function(){return console.info.apply(console,_(A.apply(0,arguments)))}).set(4,function(){return console.log.apply(console,_(A.apply(0,arguments)))}).set(5,function(){return console.debug.apply(console,_(A.apply(0,arguments)))}).set(6,function(){return console.debug.apply(console,_(A.apply(0,arguments)))}),F=function(){return console.warn.apply(console,_(A.apply(0,arguments)))},ce=function(){console.error.apply(console,_(A.apply(0,arguments)))});function fe(e,t){return typeof e==`number`&&typeof t==`number`&&isNaN(e)&&isNaN(t)?!0:e===t}function pe(e,t){t=e.indexOf(t),t>-1&&e.splice(t,1)}function me(e,t,n){if(n||(n=fe),e.length!=t.length)return!1;t=t.slice(),e=g(e);for(var r=e.next(),i={};!r.done;i={ri:void 0},r=e.next()){if(i.ri=r.value,r=t.findIndex(function(e){return function(t){return n(e.ri,t)}}(i)),r==-1)return!1;t[r]=t[t.length-1],t.pop()}return t.length==0}function he(e,t){var n=[],r=[];e=g(e);for(var i=e.next();!i.done;i=e.next())i=i.value,t(i)?n.push(i):r.push(i);return[n,r]}function ge(e,t){for(var n=0,r=e.length;n<r;){var i=n+r>>>1;t(e[i])?n=i+1:r=i}return n}function _e(e,t,n){if(e===t)return!0;if(!e||!t)return e==t;if(n||(n=fe),e.length!=t.length)return!1;for(var r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function ve(){this.g=/* @__PURE__ */ new Map}r=ve.prototype,r.push=function(e,t){this.g.has(e)?this.g.get(e).push(t):this.g.set(e,[t])},r.get=function(e){return this.g.has(e)?this.g.get(e).slice():null},r.remove=function(e,t){if(this.g.has(e)){var n=this.g.get(e).filter(function(e){return e!=t});this.g.set(e,n),n.length||this.g.delete(e)}},r.forEach=function(e){this.g.forEach(function(t,n){e(n,t)})},r.size=function(){return this.g.size},r.keys=function(){return Array.from(this.g.keys())};function I(){this.g=new ve}r=I.prototype,r.release=function(){this.Sa(),this.g=null},r.F=function(e,t,n,r){this.g&&(e=new ye(e,t,n,r),this.g.push(t,e))},r.Ba=function(e,t,n,r){function i(r){a.Oa(e,t,i),n(r)}var a=this;this.F(e,t,i,r)},r.Oa=function(e,t,n){if(this.g){var r=this.g.get(t)||[];r=g(r);for(var i=r.next();!i.done;i=r.next())i=i.value,i.target!=e||n!=i.listener&&n||(i.Oa(),this.g.remove(t,i))}},r.Sa=function(){if(this.g){for(var e=[],t=g(this.g.g.values()),n=t.next();!n.done;n=t.next())e.push.apply(e,_(n.value));for(e=g(e),t=e.next();!t.done;t=e.next())t.value.Oa();this.g.g.clear()}},P(`shaka.util.EventManager`,I),I.prototype.removeAll=I.prototype.Sa,I.prototype.unlisten=I.prototype.Oa,I.prototype.listenOnce=I.prototype.Ba,I.prototype.listen=I.prototype.F,I.prototype.release=I.prototype.release;function ye(e,t,n,r){this.target=e,this.type=t,this.listener=n,this.g=be(e,r),this.target.addEventListener(t,n,this.g)}ye.prototype.Oa=function(){this.target.removeEventListener(this.type,this.listener,this.g),this.listener=this.target=null,this.g=!1};function be(e,t){if(t==null)return!1;if(typeof t==`boolean`)return t;var n=/* @__PURE__ */ new Set([`passive`,`capture`]);return Object.keys(t).filter(function(e){return!n.has(e)}),xe(e)?t:t.capture||!1}function xe(e){var t=Se;if(t==null){t=!1;try{var n={},r={get:function(){return t=!0,!1}};Object.defineProperty(n,"passive",r),Object.defineProperty(n,"capture",r),r=function(){},e.addEventListener(`test`,r,n),e.removeEventListener(`test`,r,n)}catch{t=!1}Se=t}return t||!1}var Se=void 0;P(`shaka.config.AutoShowText`,{NEVER:0,ALWAYS:1,IF_PREFERRED_TEXT_LANGUAGE:2,IF_SUBTITLES_MAY_BE_NEEDED:3});function Ce(e){this.h=e,this.g=void 0}Ce.prototype.value=function(){return this.g===void 0&&(this.g=this.h()),this.g};function we(){return De.value()}var Te=null,Ee=null,De=new Ce(function(){var e=void 0;return Te&&(e=Te()),!e&&Ee&&(e=Ee()),e});function Oe(e,t){this.g=e,this.h=t}Oe.prototype.toString=function(){return`v`+this.g+`.`+this.h};function L(e,t){var n=new Oe(5,0),r=je,i=r.g,a=n.h-i.h;((n.g-i.g||a)>0?r.i:r.h)(r.g,n,e,t)}function ke(e,t,n,r){F([n,`has been deprecated and will be removed in`,t,`. We are currently at version`,e,`. Additional information:`,r].join(` `))}function Ae(e,t,n,r){ce([n,`has been deprecated and has been removed in`,t,`. We are now at version`,e,`. Additional information:`,r].join(` `))}var je=null,Me=RegExp(`^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$`);function Ne(e){var t;e instanceof Ne?(Pe(this,e.cc),this.$c=e.$c,Fe(this,e.Bb),Ie(this,e.xd),this.ac=e.ac,Le(this,e.g.clone()),this.Mc=e.Mc):e&&(t=String(e).match(Me))?(Pe(this,t[1]||``,!0),this.$c=Re(t[2]||``),Fe(this,t[3]||``,!0),Ie(this,t[4]),this.ac=Re(t[5]||``,!0),Le(this,t[6]||``,!0),this.Mc=Re(t[7]||``)):this.g=new Ke(null)}r=Ne.prototype,r.cc=``,r.$c=``,r.Bb=``,r.xd=null,r.ac=``,r.Mc=``,r.toString=function(){var e=[],t=this.cc;if(t&&e.push(ze(t,Ve,!0),`:`),t=this.Bb){e.push(`//`);var n=this.$c;n&&e.push(ze(n,Ve,!0),`@`),e.push(encodeURIComponent(t).replace(/%25([0-9a-fA-F]{2})/g,`%$1`)),t=this.xd,t!=null&&e.push(`:`,String(t))}return(t=this.ac)&&(this.Bb&&t.charAt(0)!=`/`&&e.push(`/`),e.push(ze(t,t.charAt(0)==`/`?Ue:He,!0))),(t=this.g.toString())&&e.push(`?`,t),(t=this.Mc)&&e.push(`#`,ze(t,Ge)),e.join(``)},r.resolve=function(e){var t=this.clone();t.cc===`data`&&(t=new Ne);var n=!!e.cc;n?Pe(t,e.cc):n=!!e.$c,n?t.$c=e.$c:n=!!e.Bb,n?Fe(t,e.Bb):n=e.xd!=null;var r=e.ac;if(n)Ie(t,e.xd);else if(n=!!e.ac){if(r.charAt(0)!=`/`){if(this.Bb&&!this.ac)r=`/`+r;else{var i=t.ac.lastIndexOf(`/`);i!=-1&&(r=t.ac.substr(0,i+1)+r)}}if(i=r,i==`..`||i==`.`)r=``;else if(i.indexOf(`./`)==-1&&i.indexOf(`/.`)==-1)r=i;else{r=i.lastIndexOf(`/`,0)==0,i=i.split(`/`);for(var a=[],o=0;o<i.length;){var s=i[o++];s==`.`?r&&o==i.length&&a.push(``):s==`..`?((a.length>1||a.length==1&&a[0]!=``)&&a.pop(),r&&o==i.length&&a.push(``)):(a.push(s),r=!0)}r=a.join(`/`)}}return n?t.ac=r:n=e.g.toString()!==``,n?Le(t,e.g.clone()):n=!!e.Mc,n&&(t.Mc=e.Mc),t},r.clone=function(){return new Ne(this)};function Pe(e,t,n){e.cc=n?Re(t,!0):t,e.cc&&(e.cc=e.cc.replace(/:$/,``))}function Fe(e,t,n){e.Bb=n?Re(t,!0):t}function Ie(e,t){if(t){if(t=Number(t),isNaN(t)||t<0)throw Error(`Bad port number `+t);e.xd=t}else e.xd=null}function Le(e,t,n){t instanceof Ke?e.g=t:(n||(t=ze(t,We)),e.g=new Ke(t))}function Re(e,t){return e?t?decodeURI(e):decodeURIComponent(e):``}function ze(e,t,n){return e==null?null:(e=encodeURI(e).replace(t,Be),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,`%$1`)),e)}function Be(e){return e=e.charCodeAt(0),`%`+(e>>4&15).toString(16)+(e&15).toString(16)}var Ve=/[#\/\?@]/g,He=/[#\?:]/g,Ue=/[#\?]/g,We=/[#\?@]/g,Ge=/#/g;function Ke(e){this.g=e||null}function qe(e){if(!e.fb&&(e.fb=/* @__PURE__ */ new Map,e.Qd=0,e.g))for(var t=e.g.split(`&`),n=0;n<t.length;n++){var r=t[n].indexOf(`=`),i=null;if(r>=0){var a=t[n].substring(0,r);i=t[n].substring(r+1)}else a=t[n];a=decodeURIComponent(a),i=i||``,e.add(a,decodeURIComponent(i))}}r=Ke.prototype,r.fb=null,r.Qd=null,r.add=function(e,t){qe(this),this.g=null;var n=this.fb.has(e)?this.fb.get(e):null;return n||this.fb.set(e,n=[]),n.push(t),this.Qd++,this},r.set=function(e,t){return qe(this),this.g=null,this.fb.has(e)?this.fb.set(e,[t]):this.add(e,t),this},r.get=function(e){return qe(this),this.fb.get(e)||[]},r.toString=function(){if(this.g)return this.g;if(!this.fb||!this.fb.size)return``;for(var e=[],t=g(this.fb.keys()),n=t.next();!n.done;n=t.next()){var r=n.value;n=encodeURIComponent(r),r=this.fb.get(r);for(var i=0;i<r.length;i++){var a=n;r[i]!==``&&(a+=`=`+encodeURIComponent(r[i])),e.push(a)}}return this.g=e.join(`&`)},r.clone=function(){var e=new Ke;if(e.g=this.g,this.fb){for(var t=/* @__PURE__ */ new Map,n=g(this.fb),r=n.next();!r.done;r=n.next()){var i=g(r.value);r=i.next().value,i=i.next().value,t.set(r,i.concat())}e.fb=t,e.Qd=this.Qd}return e};function Je(){}function Ye(e,t){if(!e&&!t)return!0;if(!e||!t||e.byteLength!=t.byteLength)return!1;if((ArrayBuffer.isView(e)?e.buffer:e)==(ArrayBuffer.isView(t)?t.buffer:t)&&(e.byteOffset||0)==(t.byteOffset||0))return!0;var n=Ze(e);t=Ze(t);for(var r=0;r<e.byteLength;r++)if(n[r]!=t[r])return!1;return!0}function Xe(e){return ArrayBuffer.isView(e)?e.byteOffset==0&&e.byteLength==e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer:e}function Ze(e,t,n){return n=n===void 0?1/0:n,et(e,t===void 0?0:t,n,Uint8Array)}function Qe(e,t,n){return n=n===void 0?1/0:n,et(e,t===void 0?0:t,n,Uint16Array)}function $e(e,t,n){return n=n===void 0?1/0:n,et(e,t===void 0?0:t,n,DataView)}function et(e,t,n,r){var i=ArrayBuffer.isView(e)?e.buffer:e,a=1;`BYTES_PER_ELEMENT`in r&&(a=r.BYTES_PER_ELEMENT);var o=((e.byteOffset||0)+e.byteLength)/a;return e=Math.floor(Math.max(0,Math.min(((e.byteOffset||0)+t)/a,o))),new r(i,e,Math.floor(Math.min(e+Math.max(n,0),o))-e)}P(`shaka.util.BufferUtils`,Je),Je.toDataView=$e,Je.toUint16=Qe,Je.toUint8=Ze,Je.toArrayBuffer=Xe,Je.equal=Ye;function tt(e,t){if(e===t||!e.length||!t.length)return!0;e=g(e);for(var n=e.next();!n.done;n=e.next()){if(n=n.value,st(n))return!0;for(var r=g(t),i=r.next();!i.done;i=r.next())if(i=i.value,n.keySystem===i.keySystem||st(i))return!0}return!1}function nt(e,t){if(!e.length)return t;if(!t.length)return e;var n=[];e=g(e);for(var r=e.next();!r.done;r=e.next()){r=r.value;for(var i=g(t),a=i.next();!a.done;a=i.next())if(a=a.value,r.keySystem==a.keySystem){i=/* @__PURE__ */ new Map;for(var o=g((r.initData||[]).concat(a.initData||[])),s=o.next();!s.done;s=o.next())s=s.value,i.set(s.keyId,s);i=Array.from(i.values()),o=r.keyIds&&a.keyIds?new Set([].concat(_(r.keyIds),_(a.keyIds))):r.keyIds||a.keyIds,n.push({keySystem:r.keySystem,licenseServerUri:r.licenseServerUri||a.licenseServerUri,distinctiveIdentifierRequired:r.distinctiveIdentifierRequired||a.distinctiveIdentifierRequired,persistentStateRequired:r.persistentStateRequired||a.persistentStateRequired,videoRobustness:r.videoRobustness||a.videoRobustness,audioRobustness:r.audioRobustness||a.audioRobustness,serverCertificate:r.serverCertificate||a.serverCertificate,serverCertificateUri:r.serverCertificateUri||a.serverCertificateUri,initData:i,keyIds:o});break}else st(r)?n.push(r):st(a)&&n.push(a)}return n}function rt(e){return e===`org.w3.clearkey`}function it(e){return e?!!e.match(/^com\.widevine\.alpha/):!1}function at(e){return e?!!e.match(/^com\.(microsoft|chromecast)\.playready/):!1}function ot(e){return e?!!e.match(/^com\.apple\.fps/):!1}function st(e){return(e=e.licenseServerUri)?e.startsWith(`data:application/json;base64,`):!1}function ct(e,t,n,r){return r=[].concat(_(new Set(r))).sort().join(`#`),e+`#`+t+`#`+n+`#`+r}var lt=new Ce(function(){return Xe(new Uint8Array([0]))}),ut=/* @__PURE__ */ new Map;function R(e,t,n){var r=A.apply(3,arguments);if(this.severity=e,this.category=t,this.code=n,this.data=r,this.handled=!1,this.message=`Shaka Error `+this.code,dt)try{throw Error(this.message||`Shaka Error`)}catch(e){this.stack=e.stack}}R.prototype.toString=function(){return`shaka.util.Error `+JSON.stringify(this,null,` `)},P(`shaka.util.Error`,R);var dt=!0;R.Severity={RECOVERABLE:1,CRITICAL:2},R.Category={NETWORK:1,TEXT:2,MEDIA:3,MANIFEST:4,STREAMING:5,DRM:6,PLAYER:7,CAST:8,STORAGE:9,ADS:10},R.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:4055,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 ft(){}function pt(t){if(!t)return``;if(t=Ze(t),t[0]==239&&t[1]==187&&t[2]==191&&(t=t.subarray(3)),e.TextDecoder&&!we().uh())return t=new TextDecoder().decode(t),t.includes(`�`)&&ce(`Decoded string contains an "unknown character" codepoint. That probably means the UTF8 encoding was incorrect!`),t;for(var n=``,r=0;r<t.length;++r){var i=65533;if(t[r]&128?t.length>=r+2&&(t[r]&224)==192&&(t[r+1]&192)==128?(i=(t[r]&31)<<6|t[r+1]&63,r+=1):t.length>=r+3&&(t[r]&240)==224&&(t[r+1]&192)==128&&(t[r+2]&192)==128?(i=(t[r]&15)<<12|(t[r+1]&63)<<6|t[r+2]&63,r+=2):t.length>=r+4&&(t[r]&241)==240&&(t[r+1]&192)==128&&(t[r+2]&192)==128&&(t[r+3]&192)==128&&(i=(t[r]&7)<<18|(t[r+1]&63)<<12|(t[r+2]&63)<<6|t[r+3]&63,r+=3):i=t[r],i<=65535)n+=String.fromCharCode(i);else{i-=65536;var a=i&1023;n+=String.fromCharCode(55296+(i>>10)),n+=String.fromCharCode(56320+a)}}return n}function mt(e,t,n){if(!e)return``;if(!n&&e.byteLength%2!=0)throw new R(2,2,2004);n=Math.floor(e.byteLength/2);var r=new Uint16Array(n);e=$e(e);for(var i=0;i<n;i++)r[i]=e.getUint16(i*2,t);return yt.value()(r)}function ht(e){function t(e){return n.byteLength<=e||n[e]>=9&&n[e]<=126}if(!e)return``;var n=Ze(e);if(n[0]==239&&n[1]==187&&n[2]==191)return pt(n);if(n[0]==254&&n[1]==255)return mt(n.subarray(2),!1);if(n[0]==255&&n[1]==254)return mt(n.subarray(2),!0);if(n[0]==0&&n[2]==0)return mt(e,!1);if(n[1]==0&&n[3]==0)return mt(e,!0);if(t(0)&&t(1)&&t(2)&&t(3))return pt(e);throw new R(2,2,2003)}function gt(t){if(e.TextEncoder&&!we().uh()){var n=new TextEncoder;return Xe(n.encode(t))}t=encodeURIComponent(t),t=unescape(t),n=new Uint8Array(t.length);for(var r=0;r<t.length;r++)n[r]=t[r].charCodeAt(0);return Xe(n)}function _t(e,t){for(var n=/* @__PURE__ */ new ArrayBuffer(e.length*2),r=new DataView(n),i=0;i<e.length;++i)r.setUint16(i*2,e.charCodeAt(i),t);return n}function vt(e){var t={"&":`&`,"<":`<`,">":`>`,""":`"`,"'":`'`," ":`\xA0`,"‎":``,"‏":``},n=/&(?:amp|lt|gt|quot|apos|nbsp|lrm|rlm|#[xX]?[0-9a-fA-F]+);/g,r=RegExp(n.source);return e&&r.test(e)?e.replace(n,function(e){return e[1]==`#`?(e=e[2]==`x`||e[2]==`X`?parseInt(e.substring(3),16):parseInt(e.substring(2),10),e>=0&&e<=1114111?String.fromCodePoint(e):``):t[e]||`'`}):e||``}P(`shaka.util.StringUtils`,ft),ft.resetFromCharCode=function(){yt.g=void 0},ft.toUTF16=_t,ft.toUTF8=gt,ft.fromBytesAutoDetect=ht,ft.fromUTF16=mt,ft.fromUTF8=pt;var yt=new Ce(function(){function e(e){try{var t=new Uint8Array(e);return String.fromCharCode.apply(null,t).length>0}catch{return!1}}for(var t={Kc:65536};t.Kc>0;t={Kc:t.Kc},t.Kc/=2)if(e(t.Kc))return function(e){return function(t){for(var n=``,r=0;r<t.length;r+=e.Kc)n+=String.fromCharCode.apply(null,t.subarray(r,r+e.Kc));return n}}(t);return null});function bt(){}function xt(e){return e=Ze(e),Uint8Array.prototype.toBase64?e.toBase64({alphabet:`base64`,omitPadding:!1}):(e=yt.value()(e),btoa(e))}function St(e,t){return t=t??!0,Uint8Array.prototype.toBase64?Ze(e).toBase64({alphabet:`base64url`,omitPadding:!t}):(e=xt(e).replace(/\+/g,`-`).replace(/\//g,`_`),t?e:e.replace(/[=]*$/,``))}function Ct(t){if(!(`fromBase64`in Uint8Array)){t=e.atob(t.replace(/-/g,`+`).replace(/_/g,`/`));for(var n=new Uint8Array(t.length),r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}return t=t.replace(/\s+/g,``),Uint8Array.fromBase64(t,{alphabet:/[-_]/.test(t)?`base64url`:`base64`})}function wt(t){if(!(`fromHex`in Uint8Array)){for(var n=t.length/2,r=new Uint8Array(n),i=0;i<n;i++)r[i]=e.parseInt(t.substr(i*2,2),16);return r}return Uint8Array.fromHex(t)}function Tt(e){var t=Ze(e);if(!Uint8Array.prototype.toHex){e=``,t=g(t);for(var n=t.next();!n.done;n=t.next())n=n.value,n=n.toString(16),n.length==1&&(n=`0`+n),e+=n;return e}return t.toHex()}function z(){var e=A.apply(0,arguments);return Et(e,0,e.length)}function Et(e,t,n){t=t===void 0?0:t,n=n===void 0?e.length:n;for(var r=0,i=t;i<n;++i)r+=e[i].byteLength;for(r=new Uint8Array(r),i=0;t<n;++t){var a=e[t];ArrayBuffer.isView(a)&&a.BYTES_PER_ELEMENT===1?r.set(a,i):r.set(Ze(a),i),i+=a.byteLength}return r}P(`shaka.util.Uint8ArrayUtils`,bt),bt.concat=z,bt.toHex=Tt,bt.fromHex=wt,bt.fromBase64=Ct,bt.toBase64=St,bt.toStandardBase64=xt;function Dt(e,t,n){if(n=n===void 0?``:n,t.length==0)return e;if(e.length==1&&t.length==1){var r=new Ne(e[0]);return t=new Ne(t[0]),t=r.resolve(t),n&&Le(t,n),[t.toString()]}t=t.map(function(e){return new Ne(e)}),r=[],e=g(e);for(var i=e.next();!i.done;i=e.next()){i=new Ne(i.value);for(var a=g(t),o=a.next();!o.done;o=a.next())o=i.resolve(o.value),n&&Le(o,n),r.push(o.toString())}return r}function Ot(e,t,n,r,i){return t={keySystem:e,encryptionScheme:t,licenseServerUri:``,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:``,videoRobustness:``,serverCertificate:null,serverCertificateUri:``,sessionType:``,initData:n||[],keyIds:/* @__PURE__ */ new Set,mediaTypes:i},r&&(t.keySystemUris=/* @__PURE__ */ new Set([r])),!n&&ot(e)&&t.initData.push({initDataType:`sinf`,initData:/* @__PURE__ */ new Uint8Array,keyId:null}),t}function kt(t,n){n=n===void 0?`cenc`:n;var r=[],i=[],a=[];t.forEach(function(e,t){var n=t;n.length!=22&&(n=St(wt(t),!1));var o=e;o.length!=22&&(o=St(wt(e),!1)),e={kty:`oct`,kid:n,k:o},r.push(e),i.push(e.kid),a.push(t)}),t=JSON.stringify({keys:r});var o=JSON.stringify({kids:i});return o=[{initData:Ze(gt(o)),initDataType:`keyids`}],{keySystem:`org.w3.clearkey`,encryptionScheme:n,licenseServerUri:`data:application/json;base64,`+e.btoa(t),distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:``,videoRobustness:``,serverCertificate:null,serverCertificateUri:``,sessionType:``,initData:o,keyIds:new Set(a)}}function At(e,t){if(t.length==1)return t[0];if(e=jt(e,t),e!=null)return e;throw new R(2,4,4025,t)}function jt(e,t){var n=It.get(e);n=g(n);for(var r=n.next();!r.done;r=n.next()){r=r.value;for(var i=g(t),a=i.next();!a.done;a=i.next())if(a=a.value,r.test(a.trim()))return a.trim()}return e==Nt?``:null}function Mt(e,t){var n=[];e=It.get(e),e=g(e);for(var r=e.next();!r.done;r=e.next()){r=r.value;for(var i=g(t),a=i.next();!a.done;a=i.next())a=a.value,r.test(a.trim())&&n.push(a.trim())}return n}var Nt=`text`,Pt={wa:`video`,$:`audio`,Pa:Nt,Uf:`image`,ul:`application`},Ft=1/15,It=(/* @__PURE__ */ new Map()).set(`audio`,[/^vorbis$/,/^Opus$/,/^opus$/,/^fLaC$/,/^flac$/,/^mp4a/,/^[ae]c-3$/,/^ac-4/,/^dts[cehx]?$/,/^iamf/,/^mhm[12]/,/^ac3$/,/^eac3$/,/^apac$/]).set(`video`,[/^avc/,/^hev/,/^hvc/,/^vvc/,/^vvi/,/^vp0?[89]/,/^av01/,/^mp2v/,/^dvh/,/^dva/,/^dav/]).set(`text`,[/^vtt$/,/^wvtt/,/^stpp/]);function Lt(e,t,n,r){this.g=null,this.l=e,this.i=t,this.m=n,this.o=r,this.j=!1;a:{if(typeof libDPIModule>`u`&&F(`Could not find LCEVC Library dependencies on this page`),typeof LCEVCdec<`u`)this.h=LCEVCdec;else if(typeof LcevcDil<`u`)this.h=LcevcDil,this.j=!0,L(`LcevcDil`,`lcevc_dil.js is deprecated, please use lcevc_dec.js instead`);else{F(`Could not find LCEVC Library on this page`),e=!1;break a}this.h.SupportObject===void 0?(F(`Could not find LCEVC Library on this page`),e=!1):(this.h.SupportObject.SupportStatus||F(this.h.SupportObject.SupportError),e=this.h!==void 0&&typeof libDPIModule<`u`&&this.i instanceof HTMLCanvasElement&&this.h.SupportObject.SupportStatus)}e&&!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 Rt(e,t,n,r){r.type!==`video`||e.o&&!r.baseOriginalId||e.g&&e.g.appendBuffer(t,`video`,r.id,-n,!e.o)}function zt(e){e.g&&e.i.classList.add(`shaka-hidden`)}Lt.prototype.release=function(){this.g&&(this.g.close(),this.g=null)};function Bt(e){return e&&typeof LCEVCdec<`u`?e.codecs==`lvc1`:!1}P(`shaka.lcevc.Dec`,Lt),Lt.prototype.release=Lt.prototype.release;function Vt(){}function Ht(e,t){Gt.set(e,t)}function Ut(){var e={};if(we(),$x())for(var t=g(Gt.keys()),n=t.next();!n.done;n=t.next())e[n.value]=!0;for(t=g([`application/dash+xml`,`application/x-mpegurl`,`application/vnd.apple.mpegurl`,`audio/x-mpegurl`,`application/vnd.ms-sstr+xml`]),n=t.next();!n.done;n=t.next())n=n.value,e[n]=$x()?Gt.has(n):cc().canPlayType(n)!=``;return e}function Wt(e,t){if(t){var n=Gt.get(t);if(n)return n}throw new R(2,4,4e3,e,t)}P(`shaka.media.ManifestParser`,Vt),Vt.unregisterParserByMime=function(e){Gt.delete(e)},Vt.registerParserByMime=Ht,Vt.registerParserByExtension=function(){L(`ManifestParser.registerParserByExtension`,`Please use an ManifestParser with registerParserByMime function.`)},Vt.AccessibilityPurpose={Cm:`visually impaired`,Nl:`hard of hearing`,jm:`spoken subtitles`};var Gt=/* @__PURE__ */ new Map;function Kt(){}Kt.prototype.extract=function(){},Kt.prototype.decode=function(){return[]},Kt.prototype.clear=function(){},Kt.prototype.getStreams=function(){return[]};function qt(){}qt.prototype.init=function(){},qt.prototype.parse=function(){return[]};function Jt(e){this.h=/* @__PURE__ */ new Map,this.i=0,this.j=new qt,(e=Zt(e.toLowerCase()))&&(this.j=e()),this.g=new Kt,(e=$t)&&(this.g=e(),this.h.set(this.i,this.g))}Jt.prototype.init=function(e,t,n){if(t=t!==void 0&&t,n=n===void 0?-1:n,n!=-1&&this.i!=n){t=n;var r=this.h.get(t);this.h.set(this.i,this.g),r?this.g=r:((r=$t)&&(this.g=r()),this.h.set(t,this.g))}else t||this.g.clear();this.j.init(e),n!=-1&&(this.i=n)};function Yt(e,t){t=e.j.parse(t),t=g(t);for(var n=t.next();!n.done;n=t.next()){n=n.value;var r=Ze(n.packet);r.length>0&&e.g.extract(r,n.pts)}return e.g.decode()}Jt.prototype.remove=function(e){e=e===void 0?[]:e,e=new Set(e);for(var t=g(this.h.keys()),n=t.next();!n.done;n=t.next())if(n=n.value,!e.has(n)){var r=this.h.get(n);r&&r.clear(),this.h.delete(n)}};function Xt(e,t){Qt.set(e,t)}function Zt(e){return Qt.get(e)}P(`shaka.media.ClosedCaptionParser`,Jt),Jt.findDecoder=function(){return $t},Jt.unregisterDecoder=function(){$t=null},Jt.registerDecoder=function(e){$t=e},Jt.findParser=Zt,Jt.unregisterParser=function(e){Qt.delete(e)},Jt.registerParser=Xt;var Qt=/* @__PURE__ */ new Map,$t=null;function en(){this.id=``,this.regionAnchorY=this.regionAnchorX=this.viewportAnchorY=this.viewportAnchorX=0,this.height=this.width=100,this.viewportAnchorUnits=this.widthUnits=this.heightUnits=tn,this.scroll=nn}P(`shaka.text.CueRegion`,en);var tn=1;en.units={PX:0,PERCENTAGE:tn,LINES:2};var nn=``;en.scrollMode={NONE:nn,UP:`up`};function rn(e){this.h=e||``,this.g=0}function an(e){on(e,/[ \t]+/gm)}function on(e,t){return t.lastIndex=e.g,t=t.exec(e.h),t=t==null?null:{position:t.index,length:t[0].length,results:t},e.g==e.h.length||t==null||t.position!=e.g?null:(e.g+=t.length,t.results)}function sn(e){return e.g==e.h.length?null:(e=on(e,/[^ \t\n]*/gm))?e[0]:null}function cn(e){if(e=on(e,un),e==null)return null;var t=Number(e[2]),n=Number(e[3]);return t>59||n>59?null:(Number(e[6])||0)/1e3+n+t*60+(Number(e[1])||0)*3600}function ln(e){return e?cn(new rn(e)):null}var un=/(?:(\d{1,}):)?(\d{2}):(\d{2})((\.(\d{1,3})))?/g;function dn(){}function fn(e){function t(e){switch(typeof e){case`undefined`:case`boolean`:case`number`:case`string`:case`symbol`:case`function`:return e;default:if(!e||ArrayBuffer.isView(e))return e;if(n.has(e))return null;var r=Array.isArray(e);if(e.constructor!=Object&&!r)return null;n.add(e);var i=r?[]:{},a;for(a in e)i[a]=t(e[a]);return r&&(i.length=e.length),i}}var n=/* @__PURE__ */ new WeakSet;return t(e)}function pn(e){var t={},n;for(n in e)t[n]=e[n];return t}function mn(e){if(Array.isArray(e)){for(var t=[],n=0;n<e.length;n++){var r=n.toString(),i=e[n];i!==void 0&&(i=mn(i))&&t.push(r+`:`+i)}e=`[`+t.join(`,`)+`]`}else if(typeof e==`function`)e=``;else if(e instanceof Object){for(n=Object.keys(e),n.sort(),t=[],n=g(n),r=n.next();!r.done;r=n.next())i=r.value,r=JSON.stringify(i),i=e[i],i!==void 0&&(i=mn(i))&&t.push(r+`:`+i);e=`{`+t.join(`,`)+`}`}else e=JSON.stringify(e);return e}P(`shaka.util.ObjectUtils`,dn),dn.alphabeticalKeyOrderStringify=mn,dn.shallowCloneObject=pn,dn.cloneObject=fn;function hn(e,t){var n=n!==void 0&&n;return e=ht(e),gn(e,t,n)}function gn(e,t,n){if(e=vn(e,n!==void 0&&n),!t&&e.length)return e[0];var r=t.split(`,`);return(t=e.find(function(e){return r.includes(e.tagName)}))?t:null}function _n(e){return Gn.has(e)?Gn.get(e):``}function vn(e,t){function n(o,s){s=s!==void 0&&s;for(var c=[];e[i];)if(e.charCodeAt(i)==60){if(e.charCodeAt(i+1)===47){s=i+2,i=e.indexOf(`>`,i),s=e.substring(s,i);var l=s.indexOf(o);if(l==-1){var u=o.indexOf(`.`);u>0&&(l=s.indexOf(o.substring(0,u)))}if(l==-1)throw o=e.substring(0,i).split(`
|
|
2
|
+
`),Error(`Unexpected close tag
|
|
3
|
+
Line: `+(o.length-1)+`
|
|
4
|
+
Column: `+(o[o.length-1].length+1)+`
|
|
5
|
+
Char: `+e[i]);i+1&&(i+=1);break}if(e.charCodeAt(i+1)===33){if(e.charCodeAt(i+2)==45){for(;i!==-1&&(e.charCodeAt(i)!==62||e.charCodeAt(i-1)!=45||e.charCodeAt(i-2)!=45||i==-1);)i=e.indexOf(`>`,i+1);i===-1&&(i=e.length)}else if(e.charCodeAt(i+2)===91&&e.charCodeAt(i+8)===91&&e.substr(i+3,5).toLowerCase()===`cdata`){l=e.indexOf(`]]>`,i),l==-1?(c.push(e.substr(i+9)),i=e.length):(c.push(e.substring(i+9,l)),i=l+3);continue}i++;continue}if(a>512)throw Error(`XML is too deeply nested`);a++;a:{u=s,i++;var d=r(),f={};for(l=[];e.charCodeAt(i)!==62&&e[i];){var p=e.charCodeAt(i);if(p>64&&p<91||p>96&&p<123){p=r();for(var m=e.charCodeAt(i);m&&m!==39&&m!==34&&!(m>64&&m<91||m>96&&m<123)&&m!==62;)i++,m=e.charCodeAt(i);var h=i+1;if(i=e.indexOf(e[i],h),h=(` `+e.slice(h,i)).slice(1),m===39||m===34){if(i===-1){if(u={tagName:d,attributes:f,children:l,parent:null},t)for(d=0;d<l.length;d++)typeof l[d]!=`string`&&(l[d].parent=u);l=u;break a}}else h=null,i--;if(p.startsWith(`xmlns:`)){m=h;var g=p.split(`:`)[1];Gn.set(m,g),Kn.set(g,m)}d===`tt`&&p===`xml:space`&&h===`preserve`&&(u=!0),f[p]=h}i++}for(e.charCodeAt(i-1)===47?i++:(i++,l=n(d,u)),u={tagName:d,attributes:f,children:l,parent:null},d=l.length,f=0;f<d;f++)p=l[f],typeof p==`string`?f==d-1&&p==`
|
|
6
|
+
`&&l.pop():t&&(p.parent=u);l=u}if(a--,c.push(l),typeof l==`string`)break;l.tagName[0]===`?`&&l.children&&(c.push.apply(c,_(l.children)),l.children=[])}else l=i,i=e.indexOf(`<`,i)-1,i===-2&&(i=e.length),l=(` `+e.slice(l,i+1)).slice(1),s?l.length>0&&c.push(l):(c.length&&l.length==1&&l[0]==`
|
|
7
|
+
`||l.trim().length>0)&&c.push(l),i++;return c}function r(){for(var t=i;`\r
|
|
8
|
+
>/= `.indexOf(e[i])===-1&&e[i];)i++;return(` `+e.slice(t,i)).slice(1)}var i=0,a=0;return n(``)}function yn(e){return typeof e==`string`}function bn(e){var t=[];if(!e.children)return[];e=g(e.children);for(var n=e.next();!n.done;n=e.next())n=n.value,typeof n!=`string`&&t.push(n);return t}function xn(e,t){var n=[];if(!e.children)return[];e=g(e.children);for(var r=e.next();!r.done;r=e.next())r=r.value,r.tagName===t&&n.push(r);return n}function Sn(e){if(typeof e==`string`)return vt(e);var t=[];e=g(e.children);for(var n=e.next();!n.done;n=e.next())n=n.value,typeof n==`string`&&t.push(n);return t=t.join(``),t===``?null:vt(t)}function Cn(e){for(var t=g(e.children),n=t.next();!n.done;n=t.next())if(typeof n.value!=`string`)return null;return(e=Sn(e))&&(e=e.trim()),e}function wn(e,t,n){if(n=n===void 0?[]:n,e.tagName===t&&n.push(e),e.children){e=g(e.children);for(var r=e.next();!r.done;r=e.next())wn(r.value,t,n)}return n}function Tn(e,t){return e=xn(e,t),e.length==1?e[0]:null}function En(e,t,n){return e=On(e,t,n),e.length==1?e[0]:null}function B(e,t,n,r){r=r===void 0?null:r;var i=null;return e=e.attributes[t],e==null||e===``&&r!==null||(i=n(e)),i??r}function Dn(e,t,n){return t=_n(t),e.attributes[t+`:`+n]||null}function On(e,t,n){var r=_n(t);if(t=[],e.children)for(n=r?r+`:`+n:n,e=g(e.children),r=e.next();!r.done;r=e.next())(r=r.value)&&r.tagName===n&&t.push(r);return t}function kn(e,t,n){t=g(t);for(var r=t.next();!r.done;r=t.next())if(r=Dn(e,r.value,n))return r;return null}function An(e){return e?(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e)&&(e+=`Z`),e=Date.parse(e),isNaN(e)?null:e/1e3):null}function jn(e){return!e||(e=RegExp(`^P(?:([0-9]*)Y)?(?:([0-9]*)M)?(?:([0-9]*)D)?(?:T(?:([0-9]*)H)?(?:([0-9]*)M)?(?:([0-9.]*)S)?)?$`,`i`).exec(e),!e)?null:(e=31536e3*Number(e[1]||null)+2592e3*Number(e[2]||null)+86400*Number(e[3]||null)+3600*Number(e[4]||null)+60*Number(e[5]||null)+Number(e[6]||null),isFinite(e)?e:null)}function Mn(e){var t=/([0-9]+)-([0-9]+)/.exec(e);return!t||(e=Number(t[1]),!isFinite(e))?null:(t=Number(t[2]),isFinite(t)?{start:e,end:t}:null)}function Nn(e){return e=Number(e),e%1==0?e:null}function Pn(e){return e=Number(e),e%1==0&&e>0?e:null}function Fn(e){return e=Number(e),e%1==0&&e>=0?e:null}function In(e){return e=Number(e),isNaN(e)?null:e}function Ln(e){return e?e.toLowerCase()===`true`:!1}function Rn(e){var t,n=(t=e.match(/^(\d+)\/(\d+)$/))?Number(t[1])/Number(t[2]):Number(e);return isNaN(n)?null:n}function zn(e){var t=[];e=vt(e).split(/\/+(?=(?:[^'"]*['"][^'"]*['"])*[^'"]*$)/),e=g(e);for(var n=e.next();!n.done;n=e.next()){n=n.value;var r=n.match(/^([\w]+)/);if(r){var i=n.match(/(@id='(.*?)')/),a=n.match(/(@t='(\d+)')/),o=n.match(/(@n='(\d+)')/),s=n.match(/\[(\d+)\]/);t.push({name:r[0],id:i?i[0].match(/'(.*?)'/)[0].replace(/'/gm,``):null,t:a?Number(a[0].match(/'(.*?)'/)[0].replace(/'/gm,``)):null,n:o?Number(o[0].match(/'(.*?)'/)[0].replace(/'/gm,``)):null,position:s?Number(s[1])-1:null,zc:n.split(`/@`)[1]||null})}else n.startsWith(`@`)&&t.length&&(t[t.length-1].zc=n.slice(1))}return t}function Bn(e,t){var n=zn(t.attributes.sel||``);if(n.length){var r=n[n.length-1],i=t.attributes.pos||null;n=r.position,n??(r.t!==null&&(n=Vn(e,`t`,r.t)),r.n!==null&&(n=Vn(e,`n`,r.n))),n===null?n=i===`prepend`?0:e.length:i===`prepend`?--n:i===`after`&&++n,i=t.tagName,(r=r.zc)&&e[n]?Hn(e[n],i,r,Cn(t)||``):(i!==`remove`&&i!==`replace`||e.splice(n,1),i!==`add`&&i!==`replace`||e.splice.apply(e,[n,0].concat(_(t.children))))}}function Vn(e,t,n){var r=0;e=g(e);for(var i=e.next();!i.done;i=e.next()){if(Number(i.value.attributes[t])===n)return r;r++}return null}function Hn(e,t,n,r){t===`remove`?delete e.attributes[n]:(t===`add`||t===`replace`)&&(e.attributes[n]=r)}function Un(e){var t=``,n=e.tagName.split(`:`);for(var r in n.length>0&&(t=n[0],t=Kn.has(t)?Kn.get(t):``),t=document.createElementNS(t,e.tagName),e.attributes)t.setAttribute(r,e.attributes[r]);for(e=g(e.children),r=e.next();!r.done;r=e.next())r=r.value,n=void 0,n=typeof r==`string`?new Text(r):Un(r),t.appendChild(n);return t}function Wn(e){if(!e)return null;var t={tagName:e.tagName,attributes:pn(e.attributes),children:[],parent:null};e=g(e.children);for(var n=e.next();!n.done;n=e.next())n=n.value,typeof n==`string`||(n=Wn(n),n.parent=t),t.children.push(n);return t}var Gn=/* @__PURE__ */ new Map,Kn=/* @__PURE__ */ new Map;function qn(e,t,n){this.startTime=e,this.endTime=t,this.payload=n,this.region=new en,this.position=null,this.positionAlign=tr,this.size=0,this.textAlign=nr,this.direction=or,this.writingMode=sr,this.lineInterpretation=cr,this.line=null,this.lineHeight=``,this.lineAlign=lr,this.displayAlign=ir,this.fontSize=this.border=this.backgroundImage=this.backgroundColor=this.color=``,this.fontWeight=pr,this.fontStyle=hr,this.linePadding=this.letterSpacing=this.fontFamily=``,this.opacity=1,this.textCombineUpright=``,this.textDecoration=[],this.textStrokeWidth=this.textStrokeColor=this.textShadow=``,this.wrapLine=!0,this.id=``,this.nestedCues=[],this.lineBreak=this.isContainer=!1,this.rubyTag=null,this.cellResolution={columns:32,rows:15}}function Jn(e,t){return e=new qn(e,t,``),e.lineBreak=!0,e}qn.prototype.clone=function(){var e=new qn(0,0,``),t;for(t in this)e[t]=this[t],Array.isArray(e[t])&&(e[t]=e[t].slice());return e};function Yn(e,t){if(e.payload!=t.payload||!(Math.abs(e.startTime-t.startTime)<.001&&Math.abs(e.endTime-t.endTime)<.001))return!1;for(var n in e)if(n!=`startTime`&&n!=`endTime`&&n!=`payload`){if(n==`nestedCues`){if(!_e(e.nestedCues,t.nestedCues,Yn))return!1}else if(n==`region`||n==`cellResolution`){for(var r in e[n])if(e[n][r]!=t[n][r])return!1}else if(Array.isArray(e[n])){if(!_e(e[n],t[n]))return!1}else if(e[n]!=t[n])return!1}return!0}function Xn(e,t){t=t===void 0?/* @__PURE__ */ new Map:t;var n=e.payload;if(n.includes(`<`)){t.size===0&&Zn(t);var r=n;n=[];for(var i=-1,a=0;a<r.length;a++)r[a]===`<`?i=a+1:r[a]===`>`&&i>0&&(i=r.substr(i,a-i),i.match(yr)&&n.push(i),i=-1);for(n=g(n),a=n.next();!a.done;a=n.next())a=a.value,r=r.replace(`<`+a+`>`,`<div time="`+a+`">`),r+=`</div>`;a:{a=r,i=[];var o=-1;n=``,r=!1;for(var s=0;s<a.length;s++)if(a[s]===`/`){var c=a.indexOf(`>`,s);if(c===-1){n=a;break a}if((c=a.substring(s+1,c))&&c==`v`){r=!0;var l=null;if(i.length&&(l=i[i.length-1]),l){if(l===c)n+=`/`+c+`>`;else{if(!l.startsWith(`v`)){n+=a[s];continue}n+=`/`+l+`>`}s+=c.length+1}else n+=a[s]}else n+=a[s]}else a[s]===`<`?(o=s+1,a[o]!=`v`&&(o=-1)):a[s]===`>`&&o>0&&(i.push(a.substr(o,s-o)),o=-1),n+=a[s];for(a=g(i),i=a.next();!i.done;i=a.next())i=i.value,o=i.replace(` `,`.voice-`),n=n.replace(`<`+i+`>`,`<`+o+`>`),n=n.replace(`</`+i+`>`,`</`+o+`>`),r||(n+=`</`+o+`>`)}n=Qn(n),e.payload=``,r=`<span>`+n.replace(/\n/g,`<br />`)+`</span>`;try{var u=gn(r,`span`)}catch{}if(u){if(u=u.children,u.length!=1||u[0].tagName)for(u=g(u),n=u.next();!n.done;n=u.next())$n(n.value,e,t);else e.payload=vt(n)}else e.payload=vt(n)}else e.payload=vt(n)}function Zn(e){for(var t=g(Object.entries(dr)),n=t.next();!n.done;n=t.next()){var r=g(n.value);n=r.next().value,r=r.next().value;var i=new qn(0,0,``);i.color=r,e.set(`.`+n,i)}for(t=g(Object.entries(fr)),n=t.next();!n.done;n=t.next())r=g(n.value),n=r.next().value,r=r.next().value,i=new qn(0,0,``),i.backgroundColor=r,e.set(`.`+n,i)}function Qn(e){var t={"< ":``," >":` >`},n=/(< +>|<\s|\s>)/g,r=RegExp(n.source);return e&&r.test(e)?e.replace(n,function(e){return t[e]||``}):e||``}function $n(e,t,n){var r=t.clone();if(r.nestedCues=[],r.payload=``,r.rubyTag=``,r.line=null,r.region=new en,r.position=null,r.size=0,r.textAlign=nr,e.tagName)for(var i=g(e.tagName.split(/(?=[ .])+/g)),a=i.next();!a.done;a=i.next()){var o=a=a.value;if(o.startsWith(`.voice-`)){var s=o.split(`-`).pop();o=`v[voice="`+s+`"]`,n.has(o)||(o=`v[voice=`+s+`]`)}switch(n.has(o)&&(s=r,o=n.get(o))&&(s.backgroundColor=er(o.backgroundColor,s.backgroundColor),s.color=er(o.color,s.color),s.fontFamily=er(o.fontFamily,s.fontFamily),s.fontSize=er(o.fontSize,s.fontSize),s.textShadow=er(o.textShadow,s.textShadow),s.fontWeight=o.fontWeight,s.fontStyle=o.fontStyle,s.opacity=o.opacity,s.rubyTag=o.rubyTag,s.textCombineUpright=o.textCombineUpright,s.wrapLine=o.wrapLine),a){case`br`:r=Jn(r.startTime,r.endTime),t.nestedCues.push(r);return;case`b`:r.fontWeight=mr;break;case`i`:r.fontStyle=gr;break;case`u`:r.textDecoration.push(vr);break;case`font`:(a=e.attributes.color)&&(r.color=a);break;case`div`:if(a=e.attributes.time,!a)break;(a=ln(a))&&(r.startTime=a);break;case`ruby`:case`rp`:case`rt`:r.rubyTag=a}}if(i=e.children,yn(e)||i.length==1&&yn(i[0]))for(n=Sn(e).split(`
|
|
9
|
+
`),e=!0,n=g(n),i=n.next();!i.done;i=n.next())i=i.value,e||(e=Jn(r.startTime,r.endTime),t.nestedCues.push(e)),i.length>0&&(e=r.clone(),e.payload=vt(i),t.nestedCues.push(e)),e=!1;else for(t.nestedCues.push(r),t=g(i),e=t.next();!e.done;e=t.next())$n(e.value,r,n)}function er(e,t){return e&&e.length>0?e:t}P(`shaka.text.Cue`,qn),qn.parseCuePayload=Xn,qn.equal=Yn,qn.prototype.clone=qn.prototype.clone;var tr=`auto`;qn.positionAlign={LEFT:`line-left`,RIGHT:`line-right`,CENTER:`center`,AUTO:tr};var nr=`center`,rr={LEFT:`left`,RIGHT:`right`,CENTER:nr,START:`start`,END:`end`};qn.textAlign=rr;var ir=`after`,ar={BEFORE:`before`,CENTER:`center`,AFTER:ir};qn.displayAlign=ar;var or=`ltr`;qn.direction={HORIZONTAL_LEFT_TO_RIGHT:or,HORIZONTAL_RIGHT_TO_LEFT:`rtl`};var sr=`horizontal-tb`;qn.writingMode={HORIZONTAL_TOP_TO_BOTTOM:sr,VERTICAL_LEFT_TO_RIGHT:`vertical-lr`,VERTICAL_RIGHT_TO_LEFT:`vertical-rl`};var cr=0;qn.lineInterpretation={LINE_NUMBER:cr,PERCENTAGE:1};var lr=`start`,ur={CENTER:`center`,START:lr,END:`end`};qn.lineAlign=ur;var dr={white:`white`,lime:`lime`,cyan:`cyan`,red:`red`,yellow:`yellow`,magenta:`magenta`,blue:`blue`,black:`black`};qn.defaultTextColor=dr;var fr={bg_white:`white`,bg_lime:`lime`,bg_cyan:`cyan`,bg_red:`red`,bg_yellow:`yellow`,bg_magenta:`magenta`,bg_blue:`blue`,bg_black:`black`};qn.defaultTextBackgroundColor=fr;var pr=400,mr=700;qn.fontWeight={NORMAL:pr,BOLD:mr};var hr=`normal`,gr=`italic`,_r={NORMAL:hr,ITALIC:gr,OBLIQUE:`oblique`};qn.fontStyle=_r;var vr=`underline`;qn.textDecoration={UNDERLINE:vr,LINE_THROUGH:`line-through`,OVERLINE:`overline`};var yr=/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g;function br(){}br.prototype.destroy=function(){};function xr(e,t,n){Cr.set(e.toLowerCase().split(`;`)[0]+`-`+n,{priority:n,xf:t})}function Sr(e,t){for(var n=e.toLowerCase().split(`;`)[0],r=g([Dr,Er,Tr,wr]),i=r.next();!i.done;i=r.next())if(i=Cr.get(n+`-`+i.value)){var a=i.xf(),o=a.isSupported(e,t);if(a.destroy(),o)return i.xf}return null}P(`shaka.transmuxer.TransmuxerEngine`,br),br.findTransmuxer=Sr,br.unregisterTransmuxer=function(e,t){Cr.delete(e.toLowerCase().split(`;`)[0]+`-`+t)},br.registerTransmuxer=xr,br.prototype.destroy=br.prototype.destroy;var Cr=/* @__PURE__ */ new Map,wr=1,Tr=2,Er=3,Dr=4;br.PluginPriority={FALLBACK:wr,PREFERRED_SECONDARY:Tr,PREFERRED:Er,APPLICATION:Dr};function Or(){}function kr(e,t){var n=e;return t&&!zr.includes(e)&&(n+=`; codecs="`+t+`"`),n}function Ar(e,t){return t&&(e+=`; codecs="`+t+`"`),e}function jr(e,t,n){var r=kr(e,t);return t=Ar(e,t),Sr(t)?(e=Sr(t))?(e=e(),n=e.convertCodecs(n,t),e.destroy()):n=t:n=e!=`video/mp2t`&&n==`audio`?r.replace(`video`,`audio`):r,n}function Mr(e){return e.split(`;`)[0].split(`/`)[1]}function Nr(e){var t=Rr(e);switch(e=t[0].toLowerCase(),t=t[1].toLowerCase(),!0){case e===`mp4a`&&t===`69`:case e===`mp4a`&&t===`6b`:case e===`mp4a`&&t===`40.34`:return`mp3`;case e===`mp4a`&&t===`66`:case e===`mp4a`&&t===`67`:case e===`mp4a`&&t===`68`:case e===`mp4a`&&t===`40.2`:case e===`mp4a`&&t===`40.02`:case e===`mp4a`&&t===`40.5`:case e===`mp4a`&&t===`40.05`:case e===`mp4a`&&t===`40.29`:case e===`mp4a`&&t===`40.42`:return`aac`;case e===`mp4a`&&t===`a5`:case e===`ac3`:case e===`ac-3`:return`ac-3`;case e===`mp4a`&&t===`a6`:case e===`eac3`:case e===`ec-3`:return`ec-3`;case e===`ac-4`:return`ac-4`;case e===`mp4a`&&t===`b2`:return`dtsx`;case e===`mp4a`&&t===`a9`:return`dtsc`;case e===`vp09`:case e===`vp9`:return`vp9`;case e===`avc1`:case e===`avc3`:return`avc`;case e===`hvc1`:case e===`hev1`:return`hevc`;case e===`vvc1`:case e===`vvi1`:return`vvc`;case e===`dvh1`:case e===`dvhe`:return t&&t.startsWith(`05`)?`dovi-p5`:`dovi-hevc`;case e===`dvav`:case e===`dva1`:return`dovi-avc`;case e===`dav1`:return`dovi-av1`;case e===`dvc1`:case e===`dvi1`:return`dovi-vvc`;case e===`lvc1`:return`lcevc`}return e}function Pr(e){var t=[];e=g(e.split(`,`));for(var n=e.next();!n.done;n=e.next())n=Rr(n.value),t.push(n[0]);return t.sort().join(`,`)}function Fr(e){return e.split(`;`)[0]}function Ir(e){return e=e.split(/ *; */),e.shift(),(e=e.find(function(e){return e.startsWith(`codecs=`)}))?e.split(`=`)[1].replace(/^"|"$/g,``):``}function Lr(e){return e===`application/x-mpegurl`||e===`application/vnd.apple.mpegurl`||e===`audio/x-mpegurl`}function Rr(e){e=e.split(`.`);var t=e[0];return e.shift(),[t,e.join(`.`)]}P(`shaka.util.MimeUtils`,Or),Or.getFullTypeWithAllCodecs=Ar,Or.getFullType=kr,(/* @__PURE__ */ new Map()).set(`codecs`,`codecs`).set(`frameRate`,`framerate`).set(`bandwidth`,`bitrate`).set(`width`,`width`).set(`height`,`height`).set(`channelsCount`,`channels`);var zr=[`audio/aac`,`audio/ac3`,`audio/ec3`,`audio/mpeg`];function Br(e){this.i=null,this.l=e,this.B=this.G=!1,this.m=this.u=0,this.o=1/0,this.h=this.g=null,this.D=``,this.C=function(){},this.j=/* @__PURE__ */ new Map}function Vr(e,t){Zr.set(e,t)}function Hr(e){return Zr.get(e)}function Ur(e){return Zr.has(e)?!0:e==`application/cea-608`||e==`application/cea-708`?!!$t:!1}Br.prototype.destroy=function(){return this.l=this.i=null,this.j.clear(),Promise.resolve()};function Wr(e,t,n,r,i){var a,o,s,c,l,u,d,f;return k(function(p){if(p.h==1)return p.g(Promise.resolve(),2);if(!e.i||!e.l)return p.return();if(n==null||r==null)return e.i.parseInit(Ze(t)),p.return();for(a=e.B?0:e.u,o=e.G||e.B?n:e.u,s={periodStart:a,segmentStart:n,segmentEnd:r,vttOffset:o},c=e.i.parseMedia(Ze(t),s,i,[]),l=g(c),u=l.next();!u.done;u=l.next())d=u.value,e.C(d,i||null,s);f=c.filter(function(t){return t.startTime>=e.m&&t.startTime<e.o}),e.l.append(f),e.g??(e.g=Math.max(n,e.m)),e.h=Math.min(r,e.o),p.j()})}Br.prototype.remove=function(e,t,n){n=n!==void 0&&n;var r=this;return k(function(i){if(i.h==1)return i.g(Promise.resolve(),2);if(e>=t||n&&(Yr(r,e,t),r.D===``))return i.return();r.l&&r.l.remove(e,t)&&r.g!=null&&(t<=r.g||e>=r.h||(e<=r.g&&t>=r.h?r.g=r.h=null:e<=r.g&&t<r.h?r.g=t:e>r.g&&t>=r.h&&(r.h=e)),Xr(r)),i.j()})};function Gr(e,t,n){e.m=t,e.o=n}function Kr(e,t,n){e.D=t,(t=e.j.get(t))&&(t=t.filter(function(e){return e.endTime<=n}),t.length&&e.l.append(t))}function qr(e,t,n){t.startTime+=n,t.endTime+=n,t=g(t.nestedCues);for(var r=t.next();!r.done;r=t.next())qr(e,r.value,n)}function Jr(e,t,n){var r=/* @__PURE__ */ new Map;t=g(t);for(var i=t.next();!i.done;i=t.next()){var a=i.value;i=a.stream,a=a.cue,r.has(i)||r.set(i,[]),qr(e,a,n),a.startTime>=e.m&&a.startTime<e.o&&(r.get(i).push(a),i==e.D&&e.l.append([a]))}for(n=g(r.keys()),t=n.next();!t.done;t=n.next())for(t=t.value,e.j.has(t)||e.j.set(t,[]),i=g(r.get(t)),a=i.next();!a.done;a=i.next())a=a.value,e.j.get(t).push(a);Xr(e)}function Yr(e,t,n){for(var r=g(e.j.keys()),i=r.next();!i.done;i=r.next()){i=i.value;var a=e.j.get(i);a=a.filter(function(e){return e.startTime<t||e.endTime>=n}),e.j.set(i,a)}}function Xr(e){for(var t=1/0,n=-1/0,r=g(e.j.values()),i=r.next();!i.done;i=r.next()){i=g(i.value);for(var a=i.next();!a.done;a=i.next())a=a.value,t=Math.min(t,a.startTime),n=Math.max(n,a.endTime)}t!==1/0&&n!==-1/0&&(e.g=e.g==null?Math.max(t,e.m):Math.min(e.g,Math.max(t,e.m)),e.h=Math.max(e.h,Math.min(n,e.o)))}P(`shaka.text.TextEngine`,Br),Br.prototype.destroy=Br.prototype.destroy,Br.findParser=Hr,Br.unregisterParser=function(e){Zr.delete(e)},Br.registerParser=Vr;var Zr=/* @__PURE__ */ new Map;function Qr(e){this.g=e,this.h=null}Qr.prototype.yb=function(){return this.stop(),this.g(),this},Qr.prototype.na=function(e){var t=this;return this.stop(),$r(this,function(){t.g()},e),this},Qr.prototype.Fa=function(e){return this.stop(),ei(this,e),this},Qr.prototype.stop=function(){var e;(e=this.h)==null||e.call(this),this.h=null};function $r(e,t,n){var r=!0,i=null;e.h=function(){clearTimeout(i),r=!1},i=setTimeout(function(){r&&t()},n*1e3)}function ei(e,t){$r(e,function(){ei(e,t),e.g()},t)}P(`shaka.util.Timer`,Qr),Qr.prototype.stop=Qr.prototype.stop,Qr.prototype.tickEvery=Qr.prototype.Fa,Qr.prototype.tickAfter=Qr.prototype.na,Qr.prototype.tickNow=Qr.prototype.yb;function ti(e,t){return e.concat(t)}function ni(){}function ri(e){return e!=null}function ii(e,t){return Promise.race([t,new Promise(function(t,n){new Qr(n).na(e)})])}function ai(){}function oi(e,t){return e=li(e),t=li(t),e.split(`-`)[0]==t.split(`-`)[0]}function si(e,t){return e=li(e),t=li(t),e=e.split(`-`),t=t.split(`-`),e[0]==t[0]&&e.length==1&&t.length==2}function ci(e,t){return e=li(e),t=li(t),e=e.split(`-`),t=t.split(`-`),e.length==2&&t.length==2&&e[0]==t[0]}function li(e){e=g(e.split(`-x-`));var t=e.next().value;t=t===void 0?``:t,e=e.next().value,e=e===void 0?``:e;var n=g(t.split(`-`));return t=n.next().value,t=t===void 0?``:t,n=n.next().value,n=n===void 0?``:n,e=e?`x-`+e:``,t=t.toLowerCase(),t=mi.get(t)||t,n=n.toUpperCase(),(n?t+`-`+n:t)+(e?`-`+e:``)}function ui(e,t){return e=li(e),t=li(t),t==e?4:si(t,e)?3:ci(t,e)?2:+!!si(e,t)}function di(e){var t=e.indexOf(`-`);return e=t>=0?e.substring(0,t):e,e=e.toLowerCase(),e=mi.get(e)||e}function fi(e){return e.language?li(e.language):e.audio&&e.audio.language?li(e.audio.language):e.video&&e.video.language?li(e.video.language):`und`}function pi(e,t){e=li(e);var n=/* @__PURE__ */ new Set;t=g(t);for(var r=t.next();!r.done;r=t.next())n.add(li(r.value));for(t=g(n),r=t.next();!r.done;r=t.next())if(r=r.value,r==e)return r;for(t=g(n),r=t.next();!r.done;r=t.next())if(r=r.value,si(r,e))return r;for(t=g(n),r=t.next();!r.done;r=t.next())if(r=r.value,ci(r,e))return r;for(n=g(n),t=n.next();!t.done;t=n.next())if(t=t.value,si(e,t))return t;return null}P(`shaka.util.LanguageUtils`,ai),ai.findClosestLocale=pi,ai.getLocaleForVariant=fi,ai.getLocaleForText=function(e){return li(e.language||`und`)},ai.getBase=di,ai.relatedness=ui,ai.areSiblings=function(e,t){var n=di(e),r=di(t);return e!=n&&t!=r&&n==r},ai.normalize=li,ai.isSiblingOf=ci,ai.isParentOf=si,ai.areLanguageCompatible=oi,ai.areLocaleCompatible=function(e,t){return e=li(e),t=li(t),e==t};var mi=/* @__PURE__ */ 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 hi(){}function gi(e,t,n,r,i){if(i.length){var a=e.textStreams;i=g(i);for(var o=i.next(),s={};!o.done;s={Dh:void 0},o=i.next())if(s.Dh=o.value,o=a.filter(function(e){return function(t){return!!(t.codecs.startsWith(e.Dh)||t.mimeType.startsWith(e.Dh))}}(s)),o.length){a=o;break}e.textStreams=a}if(a=e.variants,(t.length||n.length)&&(a=_i(a,t,n)),r.length){for(t=new ve,a=g(a),n=a.next();!n.done;n=a.next())n=n.value,t.push(String(n.video.width||0),n);var c=[];t.forEach(function(e,t){e=0;var n=[];t=g(t);for(var i=t.next(),a={};!i.done;a={Tf:void 0},i=t.next())a.Tf=i.value,i=r.filter(function(e){return function(t){return e.Tf.decodingInfos[0][t]}}(a)).length,i>e?(e=i,n=[a.Tf]):i==e&&n.push(a.Tf);c.push.apply(c,_(n))}),a=c}for(t=/* @__PURE__ */ new Set,n=g(a),i=n.next();!i.done;i=n.next())i=i.value,i.video&&t.add(i.video);if(t.size){var l={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};i=Array.from(t).sort(function(e,t){return e.bandwidth&&t.bandwidth&&e.bandwidth!=t.bandwidth?e.bandwidth-t.bandwidth:e.width==t.width?e.codecs&&t.codecs?(e=Nr(e.codecs),t=Nr(t.codecs),(l[e]||1)-(l[t]||1)):0:e.width-t.width});var u=[];for(t=/* @__PURE__ */ new Map,n=function(e){var t=[String(e.width||``),String(e.height||``),String(Math.round(e.frameRate||0)),e.hdr||``,e.fastSwitching];return e.dependencyStream&&t.push(e.dependencyStream.baseOriginalId||``),e.roles&&t.push(e.roles.sort().join(`_`)),t.join(`;`)},i=g(i),o=i.next();!o.done;o=i.next()){o=o.value,s=n(o);var d=t.get(s)||[];d.length?Nr(d[d.length-1].codecs)==Nr(o.codecs)&&(d.push(o),u.push(o.id)):(d.push(o),u.push(o.id)),t.set(s,d)}e.variants=a.filter(function(e){return!((e=e.video)&&!u.includes(e.id))})}else e.variants=a}function _i(e,t,n){t=g(t);for(var r=t.next(),i={};!r.done;i={jj:void 0},r=t.next())if(i.jj=r.value,r=e.filter(function(e){return function(t){return t.video&&t.video.codecs.startsWith(e.jj)}}(i)),r.length){e=r;break}for(n=g(n),t=n.next(),r={};!t.done;r={Oh:void 0},t=n.next())if(r.Oh=t.value,t=e.filter(function(e){return function(t){return t.audio&&t.audio.codecs.startsWith(e.Oh)}}(r)),t.length){e=t;break}return e}function vi(e,t,n){e.variants=e.variants.filter(function(e){return yi(e,t,n)})}function yi(e,t,n){function r(e,t,n){return e>=t&&e<=n}if(e&&e.video&&e.video.width&&e.video.height){var i=e.video.width,a=e.video.height;if(a>i&&(a=g([a,i]),i=a.next().value,a=a.next().value),!r(i,t.minWidth,Math.min(t.maxWidth,n.width))||!r(a,t.minHeight,Math.min(t.maxHeight,n.height))||!r(i*a,t.minPixels,t.maxPixels))return!1}return!(e&&e.video&&e.video.frameRate&&!r(e.video.frameRate,t.minFrameRate,t.maxFrameRate)||e&&e.audio&&e.audio.channelsCount&&!r(e.audio.channelsCount,t.minChannelsCount,t.maxChannelsCount)||!r(e.bandwidth,t.minBandwidth,t.maxBandwidth))}function bi(e,t,n,r){return n=n===void 0?[]:n,r=r===void 0?{}:r,k(function(i){return i.h==1?i.g(xi(e,t,t.offlineSessionIds.length>0,n,r),2):(Ai(t),i.g(ji(t),0))})}function xi(e,t,n,r,i){var a,o;return k(function(s){if(s.h==1)return we().Xi()&&Si(t.variants),s.g(Ei(t.variants,n,!1,r),2);a=null,e&&(o=e.g)&&(a=o.keySystem),t.variants=t.variants.filter(function(e){var t=Ci(e,a,i);if(!t){var n=[];e.audio&&n.push(Gi(e.audio)),e.video&&n.push(Gi(e.video))}return t}),s.j()})}function Si(e){var t=(/* @__PURE__ */ new Map()).set(`dvav`,`avc3`).set(`dva1`,`avc1`).set(`dvhe`,`hev1`).set(`dvh1`,`hvc1`).set(`dvc1`,`vvc1`).set(`dvi1`,`vvi1`),n=/* @__PURE__ */ new Set;e=g(e);for(var r=e.next();!r.done;r=e.next())r=r.value,r.video&&n.add(r.video);for(n=g(n),e=n.next();!e.done;e=n.next()){e=e.value,r=g(t);for(var i=r.next();!i.done;i=r.next()){var a=g(i.value);if(i=a.next().value,a=a.next().value,e.codecs.includes(i)){e.codecs=e.codecs.replace(i,a);break}}}}function Ci(e,t,n){if(!e.decodingInfos.some(function(e){return!(!e.supported||t&&(e=e.keySystemAccess)&&(n[e.keySystem]||e.keySystem)!=t)}))return!1;var r=we(),i=r.Jb()===`Xbox`;r=r.Qa()===`MOBILE`&&r.Ia()===`GECKO`;var a=e.video,o=a&&a.width||0,s=a&&a.height||0;return i&&a&&(o>1920||s>1080)&&(a.codecs.includes(`avc1.`)||a.codecs.includes(`avc3.`))||(i=a&&a.dependencyStream)&&!Bt(i)?!1:(e=e.audio,!(r&&e&&e.encrypted&&e.codecs.toLowerCase().includes(`opus`)||e&&e.dependencyStream))}function wi(e,t){var n,r,i,a,o,s,c;return k(function(l){if(l.h==1){for(n=function(e,t){if(e){var n=pn(e);return n.supported=e.supported&&t.supported,n.powerEfficient=e.powerEfficient&&t.powerEfficient,n.smooth=e.smooth&&t.smooth,t.keySystemAccess&&!n.keySystemAccess&&(n.keySystemAccess=t.keySystemAccess),n}return t},r=null,i=[],a=g(t),o=a.next(),s={};!o.done;s={cache:void 0,Me:void 0},o=a.next())c=o.value,s.Me=mn(c),s.cache=Ji,s.cache.has(s.Me)?r=n(r,s.cache.get(s.Me)):i.push(Ti(c).then(function(e){return function(t){var i=null;t=g(t||[]);for(var a=t.next();!a.done;a=t.next())i=n(i,a.value);i&&(e.cache.set(e.Me,i),r=n(r,i))}}(s)));return l.g(Promise.all(i),2)}r&&e.decodingInfos.push(r),l.j()})}function Ti(e){var t=[``];e.video&&(t=Ir(e.video.contentType).split(`,`));var n=[``];e.audio&&(n=Ir(e.audio.contentType).split(`,`));var r=[];t=g(t);for(var i=t.next();!i.done;i=t.next()){i=i.value;for(var a=g(n),o=a.next(),s={};!o.done;s={Lc:void 0},o=a.next())o=o.value,s.Lc=fn(e),e.video&&(s.Lc.video.contentType=kr(Fr(s.Lc.video.contentType),i)),e.audio&&(s.Lc.audio.contentType=kr(Fr(s.Lc.audio.contentType),o)),r.push(new Promise(function(e){return function(t,n){(we().Qa()==`MOBILE`?ii(5,navigator.mediaCapabilities.decodingInfo(e.Lc)):navigator.mediaCapabilities.decodingInfo(e.Lc)).then(function(e){t(e)}).catch(n)}}(s)))}return Promise.all(r).catch(function(){return JSON.stringify(e),null})}function Ei(e,t,n,r){var i,a,o,s,c,l,u,d,f,p,m,h,_,v,y,b,x,S;return k(function(C){switch(C.h){case 1:if(e.some(function(e){return e.decodingInfos.length}))return C.return();i=g(r),a=i.next(),o={};case 2:if(a.done){C.A(4);break}o.Fi=a.value,s=!1,c=g(e),l=c.next();case 5:if(l.done){C.A(7);break}u=l.value,d=Di(u,t,n).filter(function(e){return function(t){return t=t[0],t=t.keySystemConfiguration&&t.keySystemConfiguration.keySystem,!t||t===e.Fi}}(o)),f=g(d),p=f.next();case 8:if(p.done){C.A(10);break}return m=p.value,C.g(wi(u,m),9);case 9:p=f.next(),C.A(8);break;case 10:u.decodingInfos.some(function(e){return e.supported})&&(s=!0),l=c.next(),C.A(5);break;case 7:if(s)return C.return();o={Fi:void 0},a=i.next(),C.A(2);break;case 4:h=g(e),_=h.next();case 12:if(_.done){C.A(0);break}v=_.value,y=Di(v,t,n).filter(function(e){return e=e[0],e=e.keySystemConfiguration&&e.keySystemConfiguration.keySystem,!e||!r.includes(e)}),b=g(y),x=b.next();case 15:if(x.done){_=h.next(),C.A(12);break}return S=x.value,C.g(wi(v,S),16);case 16:x=b.next(),C.A(15)}})}function Di(e,t,n){var r=e.audio,i=e.video,a=[],o=[];if(i)for(var s=g(i.fullMimeTypes),c=s.next();!c.done;c=s.next()){c=c.value;var l=Ir(c);if(l.includes(`,`)&&!r){var u=l.split(`,`),d=Fr(c);l=At(`video`,u),u=At(`audio`,u),u=Oi(u,d),d=jr(d,u,`audio`),o.push({contentType:d,channels:2,bitrate:e.bandwidth||1,samplerate:1,spatialRendering:!1})}if(l=ki(l),c={contentType:jr(Fr(c),l,`video`),width:i.width||64,height:i.height||64,bitrate:i.bandwidth||e.bandwidth||1,framerate:i.frameRate||30},i.hdr)switch(i.hdr){case`PQ`:c.transferFunction=`pq`;break;case`HLG`:c.transferFunction=`hlg`}i.colorGamut&&(c.colorGamut=i.colorGamut),a.push(c)}if(r)for(s=g(r.fullMimeTypes),c=s.next();!c.done;c=s.next())l=c.value,c=Fr(l),l=Oi(Ir(l),c),c=jr(c,l,`audio`),o.push({contentType:c,channels:r.channelsCount||2,bitrate:r.bandwidth||e.bandwidth||1,samplerate:r.audioSamplingRate||1,spatialRendering:r.spatialAudio});for(s=[],a.length==0&&a.push(null),o.length==0&&o.push(null),a=g(a),c=a.next();!c.done;c=a.next())for(c=c.value,l=g(o),d=l.next();!d.done;d=l.next())d=d.value,u={type:n?`file`:`media-source`},c&&(u.video=c),d&&(u.audio=d),s.push(u);if(o=(e.video?e.video.drmInfos:[]).concat(e.audio?e.audio.drmInfos:[]),!o.length)return[s];for(e=[],n=/* @__PURE__ */ new Map,o=g(o),a=o.next();!a.done;a=o.next())a=a.value,n.get(a.keySystem)||n.set(a.keySystem,[]),n.get(a.keySystem).push(a);for(o=t?`required`:`optional`,t=t?[`persistent-license`]:[`temporary`],a=g(n.keys()),c=a.next();!c.done;c=a.next()){for(c=c.value,d=n.get(c),l=/* @__PURE__ */ new Map,d=g(d),u=d.next();!u.done;u=d.next()){u=u.value;var f=u.videoRobustness+`,`+u.audioRobustness;l.get(f)||l.set(f,[]),l.get(f).push(u)}for(l=g(l.values()),d=l.next();!d.done;d=l.next()){d=d.value,u=[],f=g(s);for(var p=f.next();!p.done;p=f.next()){p=Object.assign({},p.value);for(var m={keySystem:c,initDataType:`cenc`,persistentState:o,distinctiveIdentifier:`optional`,sessionTypes:t},h=g(d),_=h.next();!_.done;_=h.next()){if(_=_.value,_.initData&&_.initData.length){for(var v=/* @__PURE__ */ new Set,y=g(_.initData),b=y.next();!b.done;b=y.next())v.add(b.value.initDataType);m.initDataType=_.initData[0].initDataType}_.distinctiveIdentifierRequired&&(m.distinctiveIdentifier=`required`),_.persistentStateRequired&&(m.persistentState=`required`),_.sessionType&&(m.sessionTypes=[_.sessionType]),r&&(m.audio?(_.encryptionScheme&&(m.audio.encryptionScheme=m.audio.encryptionScheme||_.encryptionScheme),m.audio.robustness=m.audio.robustness||_.audioRobustness):(m.audio={robustness:_.audioRobustness},_.encryptionScheme&&(m.audio.encryptionScheme=_.encryptionScheme)),m.audio.robustness==``&&delete m.audio.robustness),i&&(m.video?(_.encryptionScheme&&(m.video.encryptionScheme=m.video.encryptionScheme||_.encryptionScheme),m.video.robustness=m.video.robustness||_.videoRobustness):(m.video={robustness:_.videoRobustness},_.encryptionScheme&&(m.video.encryptionScheme=_.encryptionScheme)),m.video.robustness==``&&delete m.video.robustness)}p.keySystemConfiguration=m,u.push(p)}e.push(u)}}return e}function Oi(e,t){var n=we();return e.toLowerCase()==`flac`?n.Ia()==`WEBKIT`?`fLaC`:`flac`:e.toLowerCase()===`opus`?n.Ia()==`WEBKIT`&&Mr(t)==`mp4`?`Opus`:`opus`:e.toLowerCase()==`ac-3`&&n.le()?`ec-3`:e}function ki(e){if(e.includes(`avc1`)){var t=e.split(`.`);if(t.length==3)return e=t.shift()+`.`,e+=parseInt(t.shift(),10).toString(16),e+=(`000`+parseInt(t.shift(),10).toString(16)).slice(-4)}else if(e==`vp9`)return`vp09.00.41.08`;return e}function Ai(e){e.textStreams=e.textStreams.filter(function(e){return e=kr(e.mimeType,e.codecs),Ur(e)})}function ji(e){var t,n,r,i,a,o,s;return k(function(c){switch(c.h){case 1:t=[],n=g(e.imageStreams),r=n.next();case 2:if(r.done){c.A(4);break}if(i=r.value,a=i.mimeType,a==`application/mp4`&&i.codecs==`mjpg`&&(a=`image/jpg`),Xi.has(a)){c.A(5);break}if(o=Zi.get(a),!o){Xi.set(a,!1),c.A(5);break}return c.g(Mi(o),7);case 7:s=c.i,Xi.set(a,s);case 5:Xi.get(a)&&t.push(i),r=n.next(),c.A(2);break;case 4:e.imageStreams=t,c.j()}})}function Mi(e){return new Promise(function(t){var n=new Image;n.src=e,`decode`in n?n.decode().then(function(){t(!0)}).catch(function(){t(!1)}):n.onload=n.onerror=function(){t(n.height===2)}})}function Ni(e){var t=e.audio,n=e.video,r=t?t.mimeType:null,i=n?n.mimeType:null,a=t?t.codecs:null,o=n?n.codecs:null,s=t?t.groupId:null,c=[];n&&c.push(n.mimeType),t&&c.push(t.mimeType),c=c[0]||null;var l=[];t&&l.push(t.kind),n&&l.push(n.kind),l=l[0]||null;var u=/* @__PURE__ */ new Set;if(t)for(var d=g(t.roles),f=d.next();!f.done;f=d.next())u.add(f.value);if(n)for(d=g(n.roles),f=d.next();!f.done;f=d.next())u.add(f.value);if(e={id:e.id,active:!1,type:`variant`,bandwidth:e.bandwidth,language:e.language,label:null,videoLabel:null,kind:l,width:null,height:null,frameRate:null,pixelAspectRatio:null,hdr:null,colorGamut:null,videoLayout:null,mimeType:c,audioMimeType:r,videoMimeType:i,codecs:``,audioCodec:a,videoCodec:o,primary:e.primary,roles:Array.from(u),audioRoles:null,videoRoles:null,forced:!1,videoId:null,audioId:null,audioGroupId:s,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,originalImageId:null,accessibilityPurpose:null,originalLanguage:null},n&&(e.videoId=n.id,e.originalVideoId=n.originalId,e.width=n.width||null,e.height=n.height||null,e.frameRate=n.frameRate||null,e.pixelAspectRatio=n.pixelAspectRatio||null,e.videoBandwidth=n.bandwidth||null,e.hdr=n.hdr||null,e.colorGamut=n.colorGamut||null,e.videoLayout=n.videoLayout||null,e.videoRoles=n.roles,e.videoLabel=n.label,(r=n.dependencyStream)&&(e.width=r.width||e.width,e.height=r.height||e.height,e.videoCodec=r.codecs||e.videoCodec,e.pixelAspectRatio=r.pixelAspectRatio||e.pixelAspectRatio,e.videoBandwidth&&r.bandwidth&&(e.videoBandwidth+=r.bandwidth)),o.includes(`,`))){e.channelsCount=n.channelsCount,e.audioSamplingRate=n.audioSamplingRate,e.spatialAudio=n.spatialAudio,e.originalLanguage=n.originalLanguage,e.audioMimeType=i,i=o.split(`,`);try{e.videoCodec=At(`video`,i),e.audioCodec=At(`audio`,i)}catch{}}return t&&(e.audioId=t.id,e.originalAudioId=t.originalId,e.channelsCount=t.channelsCount,e.audioSamplingRate=t.audioSamplingRate,e.audioBandwidth=t.bandwidth||null,e.spatialAudio=t.spatialAudio,e.label=t.label,e.audioRoles=t.roles,e.accessibilityPurpose=t.accessibilityPurpose,e.originalLanguage=t.originalLanguage,i=t.dependencyStream)&&(e.audioCodec=i.codecs||e.audioCodec,e.audioBandwidth&&i.bandwidth&&(e.audioBandwidth+=i.bandwidth)),n&&!e.videoBandwidth&&(t?e.audioBandwidth&&(e.videoBandwidth=e.bandwidth-e.audioBandwidth):e.videoBandwidth=e.bandwidth),t&&!e.audioBandwidth&&(n?e.videoBandwidth&&(e.audioBandwidth=e.bandwidth-e.videoBandwidth):e.audioBandwidth=e.bandwidth),t=[],e.videoCodec&&t.push(e.videoCodec),e.audioCodec&&t.push(e.audioCodec),e.codecs=t.join(`, `),e}function Pi(e){return{id:e.id,active:!1,type:Nt,bandwidth:e.bandwidth||0,language:e.language,label:e.label,kind:e.kind||null,mimeType:e.mimeType,codecs:e.codecs||null,primary:e.primary,roles:e.roles,accessibilityPurpose:e.accessibilityPurpose,forced:e.forced,originalTextId:e.originalId,originalLanguage:e.originalLanguage}}function Fi(e){var t=e.width||null,n=e.height||null,r=null;e.segmentIndex&&(r=e.segmentIndex.Cb());var i=e.tilesLayout;return r&&(i=r.tilesLayout||i),i&&t!=null&&(t/=Number(i.split(`x`)[0])),i&&n!=null&&(n/=Number(i.split(`x`)[1])),{id:e.id,type:`image`,bandwidth:e.bandwidth||0,width:t,height:n,mimeType:e.mimeType,codecs:e.codecs||null,tilesLayout:i||null,originalImageId:e.originalId}}function Ii(e){return e.__shaka_id||(e.__shaka_id=Yi++),e.__shaka_id}function Li(e){var t={id:Ii(e),active:e.mode!=`disabled`,type:Nt,bandwidth:0,language:li(e.language||`und`),label:e.label,kind:e.kind,mimeType:null,codecs:null,primary:!1,roles:[],accessibilityPurpose:null,forced:e.kind==`forced`,originalTextId:e.id,originalLanguage:e.language};return e.kind==`captions`&&(t.mimeType=`unknown`),e.kind==`subtitles`&&(t.mimeType=`text/vtt`),e.kind&&(t.roles=[e.kind]),t}function Ri(e,t){var n=e?e.language:null;if(n={id:Ii(e||t),active:e?e.enabled:t.selected,type:`variant`,bandwidth:0,language:li(n||`und`),label:e?e.label:null,videoLabel:null,kind:e?e.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:e?e.kind==`main`:!1,roles:[],forced:!1,audioRoles:null,videoRoles:null,videoId:null,audioId:null,audioGroupId:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,tilesLayout:null,audioBandwidth:null,videoBandwidth:null,originalVideoId:t?t.id:null,originalAudioId:e?e.id:null,originalTextId:null,originalImageId:null,accessibilityPurpose:null,originalLanguage:n},e&&e.kind&&(n.roles=[e.kind],n.audioRoles=[e.kind]),e&&e.configuration&&(e.configuration.codec&&(n.audioCodec=e.configuration.codec,n.codecs=n.audioCodec),e.configuration.bitrate&&(n.audioBandwidth=e.configuration.bitrate,n.bandwidth+=n.audioBandwidth),e.configuration.sampleRate&&(n.audioSamplingRate=e.configuration.sampleRate),e.configuration.numberOfChannels&&(n.channelsCount=e.configuration.numberOfChannels)),t&&t.configuration&&(t.configuration.codec&&(n.videoCodec=t.configuration.codec,n.codecs=n.codecs?n.codecs+(`,`+n.videoCodec):n.videoCodec),t.configuration.bitrate&&(n.videoBandwidth=t.configuration.bitrate,n.bandwidth+=n.videoBandwidth),t.configuration.framerate&&(n.frameRate=t.configuration.framerate),t.configuration.width&&(n.width=t.configuration.width),t.configuration.height&&(n.height=t.configuration.height),t.configuration.colorSpace&&t.configuration.colorSpace.transfer))switch(t.configuration.colorSpace.transfer){case`pq`:n.hdr=`PQ`;break;case`hlg`:n.hdr=`HLG`;break;case`bt709`:n.hdr=`SDR`}return n}function zi(e){return e.allowedByApplication&&e.allowedByKeySystem&&e.disabledUntilTime==0}function Bi(e){return e.filter(function(e){return zi(e)})}function Vi(e,t,n,r){var i=e,a=e.filter(function(e){return e.primary});a.length&&(i=a);var o=i.length?i[0].language:``;if(i=i.filter(function(e){return e.language==o}),t){var s=pi(li(t),e.map(function(e){return e.language}));s&&(i=e.filter(function(e){return li(e.language)==s}))}if(i=i.filter(function(e){return e.forced==r}),n){if(e=Hi(i,n),e.length)return e}else if(e=i.filter(function(e){return e.roles.length==0}),e.length)return e;return e=i.map(function(e){return e.roles}).reduce(ti,[]),e.length?Hi(i,e[0]):i}function Hi(e,t){return e.filter(function(e){return e.roles.includes(t)})}function Ui(e){var t=[];return e.audio&&t.push(e.audio),e.video&&t.push(e.video),t}function Wi(e,t){t.length&&(t=t.filter(function(t){return Nr(e.codecs)==Nr(t.codecs)}).sort(function(e,t){return e.bandwidth&&t.bandwidth&&e.bandwidth!=t.bandwidth?e.bandwidth-t.bandwidth:(e.width||0)-(t.width||0)}),e.trickModeVideo=t[0],t.length>1&&(t=t.find(function(t){return e.width==t.width&&e.height==t.height})))&&(e.trickModeVideo=t)}function Gi(e){return e.type==`audio`?`type=audio codecs=`+e.codecs+` bandwidth=`+e.bandwidth+` channelsCount=`+e.channelsCount+` audioSamplingRate=`+e.audioSamplingRate:e.type==`video`?`type=video codecs=`+e.codecs+` bandwidth=`+e.bandwidth+` frameRate=`+e.frameRate+` width=`+e.width+` height=`+e.height:`unexpected stream type`}function Ki(e,t,n){if(n.autoShowText==0)return!1;if(n.autoShowText==1)return!0;var r=li(n.preferredTextLanguage);return t=li(t.language),n.autoShowText==2?oi(t,r):n.autoShowText==3?e?(e=li(e.language),oi(t,r)&&!oi(e,t)):!1:(F(`Invalid autoShowText setting!`),!1)}function qi(e){var t={id:0,language:`und`,disabledUntilTime:0,primary:!1,audio:null,video:null,bandwidth:100,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]};e=g(e);for(var n=e.next();!n.done;n=e.next()){n=n.value;var r={id:0,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:n?Fr(n):``,codecs:n?Ir(n):``,encrypted:!0,drmInfos:[],keyIds:/* @__PURE__ */ new Set,language:`und`,originalLanguage:null,label:null,type:`video`,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!1,fastSwitching:!1,fullMimeTypes:/* @__PURE__ */ new Set,isAudioMuxedInVideo:!1,baseOriginalId:null};r.fullMimeTypes.add(kr(r.mimeType,r.codecs)),n.startsWith(`audio/`)?(r.type=`audio`,t.audio=r):t.video=r}return t}P(`shaka.util.StreamUtils`,hi),hi.meetsRestrictions=yi;var Ji=/* @__PURE__ */ new Map,Yi=0,Xi=(/* @__PURE__ */ new Map()).set(`image/svg+xml`,!0).set(`image/png`,!0).set(`image/jpeg`,!0).set(`image/jpg`,!0),Zi=(/* @__PURE__ */ new Map()).set(`image/webp`,`data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA`).set(`image/avif`,`data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=`);function Qi(){var t=this;this.G=null,this.H=!1,this.u=new oe,this.j=new I,navigator.connection&&navigator.connection.addEventListener&&this.j.F(navigator.connection,`change`,function(){t.g.useNetworkInformation&&navigator.onLine&&(t.u=new oe,t.g&&t.u.configure(t.g.advanced),t.trySuggestStreams())}),this.l=[],this.I=1,this.J=!1,this.h=this.o=this.g=this.B=null,this.m=new Qr(function(){if(t.H&&(t.g.restrictToElementSize||t.g.restrictToScreenSize)){var e=t.chooseVariant();e&&t.G&&t.G(e,t.g.clearBufferSwitch,t.g.safeMarginSwitch)}}),this.C=e,`documentPictureInPicture`in e&&this.j.F(e.documentPictureInPicture,`enter`,function(){t.C=e.documentPictureInPicture.window,t.m&&t.m.yb(),t.j.Ba(t.C,`pagehide`,function(){t.C=e,t.m&&t.m.yb()})}),this.D=this.i=null}r=Qi.prototype,r.stop=function(){this.G=null,this.H=!1,this.l=[],this.I=1,this.o=this.B=null,this.h&&(this.h.disconnect(),this.h=null),this.m&&this.m.stop(),this.D=this.i=null},r.release=function(){this.stop(),this.j.release(),this.m=null},r.init=function(e){this.G=e},r.chooseVariant=function(e){e=e!==void 0&&e;var t=1/0,n=1/0;if(this.g.restrictToScreenSize&&(n=this.g.ignoreDevicePixelRatio?1:this.C.devicePixelRatio,t=this.C.screen.height*n,n*=this.C.screen.width),this.h&&this.g.restrictToElementSize){var r=this.g.ignoreDevicePixelRatio?1:this.C.devicePixelRatio,i=this.o.clientHeight,a=this.o.clientWidth;this.i&&document.pictureInPictureElement&&document.pictureInPictureElement==this.o&&(i=this.i.height,a=this.i.width),t=Math.min(t,i*r),n=Math.min(n,a*r)}if(i=this.l.filter(function(e){return e&&!(e.audio&&e.audio.fastSwitching||e.video&&e.video.fastSwitching)}),i.length||(i=this.l),r=i,e&&i.length!=this.l.length&&(r=this.l.filter(function(e){return e&&!!(e.audio&&e.audio.fastSwitching||e.video&&e.video.fastSwitching)})),e=ea(this,this.g.restrictions,r,1/0,1/0),t!=1/0||n!=1/0){for(e=ta(e),e=g(e),i=e.next();!i.done;i=e.next())if(i=i.value,i.height>=t&&i.width>=n){t=i.height,n=i.width;break}e=ea(this,this.g.restrictions,r,t,n)}for(t=this.getBandwidthEstimate(),r.length&&!e.length&&(e=ea(this,null,r,1/0,1/0),e=[e[0]]),n=e[0]||null,r=0;r<e.length;r++){i=e[r];var o=isNaN(this.I)?1:Math.abs(this.I);a=o*i.bandwidth/this.g.bandwidthDowngradeTarget;for(var s={bandwidth:1/0},c=r+1;c<e.length;c++)if(i.bandwidth!=e[c].bandwidth){s=e[c];break}o=o*s.bandwidth/this.g.bandwidthUpgradeTarget,n&&i&&t>=a&&t<=o&&(n.bandwidth!=i.bandwidth||n.bandwidth==i.bandwidth&&n.video&&i.video&&(n.video.width<i.video.width||n.video.height<i.video.height))&&(n=i)}return this.B=Date.now(),n},r.enable=function(){this.H=!0,this.l.length&&this.trySuggestStreams()},r.disable=function(){this.H=!1},r.segmentDownloaded=function(e,t,n,r){var i=e;this.g.removeLatencyFromFirstPacketTime&&r&&r.packetNumber===1&&r.timeToFirstByte&&(i=e-r.timeToFirstByte),i>=this.g.cacheLoadThreshold&&this.u.sample(i,t),n&&this.B!=null&&this.H&&$i(this)},r.trySuggestStreams=function(){this.H&&(this.B=Date.now(),$i(this,!0))},r.getBandwidthEstimate=function(){var e=this.g.defaultBandwidthEstimate;return navigator.connection&&navigator.connection.downlink&&this.g.useNetworkInformation&&(e=navigator.connection.downlink*1e6),navigator.connection&&navigator.connection.downlink&&this.g.useNetworkInformation&&this.g.preferNetworkInformationBandwidth?e:(e=this.u.getBandwidthEstimate(e),this.D?this.D.getBandwidthEstimate(e):e)},r.setVariants=function(e){return!me(e,this.l)&&(this.l=e,!0)},r.playbackRateChanged=function(e){this.I=e},r.setMediaElement=function(t){function n(){r.m.na(na)}var r=this;this.o=t,this.h&&(this.h.disconnect(),this.h=null),this.o&&`ResizeObserver`in e&&(this.h=new ResizeObserver(n),this.h.observe(this.o)),this.j.F(t,`enterpictureinpicture`,function(e){e.pictureInPictureWindow&&(r.i=e.pictureInPictureWindow,r.j.F(r.i,`resize`,n))}),this.j.F(t,`leavepictureinpicture`,function(){r.i&&r.j.Oa(r.i,`resize`,n),r.i=null})},r.setCmsdManager=function(e){this.D=e},r.configure=function(e){this.g=e,this.u&&this.g&&this.u.configure(this.g.advanced)};function $i(e,t){if(t===void 0||!t){if(!e.J){if(t=e.u,!(t.g>=t.i))return;e.J=!0,e.B-=(e.g.switchInterval-e.g.minTimeToSwitch)*1e3}if(Date.now()-e.B<e.g.switchInterval*1e3)return}t=e.chooseVariant(),e.getBandwidthEstimate(),t&&e.G&&e.G(t,e.g.clearBufferSwitch,e.g.safeMarginSwitch)}function ea(e,t,n,r,i){if(e.D){var a=e.D.ei();a&&(n=n.filter(function(e){return e.bandwidth&&a?e.bandwidth<=a:!0}))}return t&&(n=n.filter(function(e){return yi(e,t,{width:i,height:r})})),n.sort(function(e,t){return e.bandwidth-t.bandwidth})}function ta(e){var t=[];e=g(e);for(var n=e.next();!n.done;n=e.next())(n=n.value)&&(n=n.video)&&n.height&&n.width&&t.push({height:n.height,width:n.width});return t.sort(function(e,t){return e.width-t.width})}P(`shaka.abr.SimpleAbrManager`,Qi),Qi.prototype.configure=Qi.prototype.configure,Qi.prototype.setCmsdManager=Qi.prototype.setCmsdManager,Qi.prototype.setMediaElement=Qi.prototype.setMediaElement,Qi.prototype.playbackRateChanged=Qi.prototype.playbackRateChanged,Qi.prototype.setVariants=Qi.prototype.setVariants,Qi.prototype.getBandwidthEstimate=Qi.prototype.getBandwidthEstimate,Qi.prototype.trySuggestStreams=Qi.prototype.trySuggestStreams,Qi.prototype.segmentDownloaded=Qi.prototype.segmentDownloaded,Qi.prototype.disable=Qi.prototype.disable,Qi.prototype.enable=Qi.prototype.enable,Qi.prototype.chooseVariant=Qi.prototype.chooseVariant,Qi.prototype.init=Qi.prototype.init,Qi.prototype.release=Qi.prototype.release,Qi.prototype.stop=Qi.prototype.stop;var na=1;function ra(e,t){var n=aa();this.l=e.maxAttempts==null?n.maxAttempts:e.maxAttempts,this.j=e.baseDelay==null?n.baseDelay:e.baseDelay,this.o=e.fuzzFactor==null?n.fuzzFactor:e.fuzzFactor,this.m=e.backoffFactor==null?n.backoffFactor:e.backoffFactor,this.g=0,this.h=this.j,(this.i=t!==void 0&&t)&&(this.g=1)}function ia(e){var t,n;return k(function(r){if(r.h==1){if(e.g>=e.l){if(e.i)e.g=1,e.h=e.j;else throw new R(2,7,1010)}return t=e.g,e.g++,t==0?r.return():(n=e.h*(1+(Math.random()*2-1)*e.o),r.g(new Promise(function(e){new Qr(e).na(n/1e3)}),2))}e.h*=e.m,r.j()})}function aa(){return{maxAttempts:2,baseDelay:1e3,backoffFactor:2,fuzzFactor:.5,timeout:3e4,stallTimeout:5e3,connectionTimeout:1e4}}function oa(){var e,t,n=new Promise(function(n,r){e=n,t=r});return n.resolve=e,n.reject=t,n}oa.prototype.resolve=function(){},oa.prototype.reject=function(){};function sa(e,t){this.promise=e,this.i=t,this.g=null}function ca(e){return new sa(Promise.reject(e),function(){return Promise.resolve()})}function la(){var e=Promise.reject(new R(2,7,7001));return e.catch(function(){}),new sa(e,function(){return Promise.resolve()})}function ua(e){return new sa(Promise.resolve(e),function(){return Promise.resolve()})}function da(e){return new sa(e,function(){return e.catch(function(){})})}sa.prototype.abort=function(){return this.g||(this.g=this.i()),this.g};function fa(e){return new sa(Promise.all(e.map(function(e){return e.promise})),function(){return Promise.all(e.map(function(e){return e.abort()}))})}sa.prototype.finally=function(e){return this.promise.then(function(){return e(!0)},function(){return e(!1)}),this},sa.prototype.Ya=function(e,t){function n(n){return function(s){if(i.g&&n)a.reject(o);else{var c=n?e:t;c?r=pa(c,s,a):(n?a.resolve:a.reject)(s)}}}function r(){return a.reject(o),i.abort()}var i=this,a=new oa;a.catch(function(){});var o=new R(2,7,7001);return this.promise.then(n(!0),n(!1)),new sa(a,function(){return r()})};function pa(e,t,n){try{var r=e(t);return r&&r.promise&&r.abort?(n.resolve(r.promise),function(){return r.abort()}):(n.resolve(r),function(){return Promise.resolve(r).then(function(){},function(){})})}catch(e){return n.reject(e),function(){return Promise.resolve()}}}s.Object.defineProperties(sa.prototype,{aborted:{configurable:!0,enumerable:!0,get:function(){return this.g!==null}}}),P(`shaka.util.AbortableOperation`,sa),sa.prototype.chain=sa.prototype.Ya,sa.prototype.finally=sa.prototype.finally,sa.all=fa,sa.prototype.abort=sa.prototype.abort,sa.notAbortable=da,sa.completed=ua,sa.aborted=la,sa.failed=ca;function V(t,n){if(n){if(n instanceof Map)for(var r=g(n.keys()),i=r.next();!i.done;i=r.next())i=i.value,Object.defineProperty(this,i,{value:n.get(i),writable:!0,enumerable:!0});else for(r in n)Object.defineProperty(this,r,{value:n[r],writable:!0,enumerable:!0})}this.defaultPrevented=this.cancelable=this.bubbles=!1,this.timeStamp=e.performance&&e.performance.now?e.performance.now():Date.now(),this.type=t,this.isTrusted=!1,this.target=this.currentTarget=null,this.g=!1}function ma(e){var t=new V(e.type),n;for(n in e)Object.defineProperty(t,n,{value:e[n],writable:!0,enumerable:!0});return t}V.prototype.preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)},V.prototype.stopImmediatePropagation=function(){this.g=!0},V.prototype.stopPropagation=function(){},P(`shaka.util.FakeEvent`,V);var ha={wl:`abrstatuschanged`,xl:`adaptation`,yl:`audiotrackchanged`,zl:`audiotrackschanged`,Al:`boundarycrossed`,Bl:`buffering`,Cl:`canupdatestarttime`,Dl:`complete`,El:`currentitemchanged`,Fl:`downloadcompleted`,Gl:`downloadfailed`,Hl:`downloadheadersreceived`,Il:`drmsessionupdate`,Jl:`emsg`,Pl:`itemsinserted`,Ql:`itemsremoved`,gm:`prft`,Error:`error`,Kl:`expirationupdated`,Ll:`firstquartile`,Ml:`gapjumped`,Rl:`keystatuschanged`,Ul:`loaded`,Vl:`loading`,Xl:`manifestparsed`,Yl:`manifestupdated`,Zl:`mediaqualitychanged`,$l:`mediasourcerecovered`,am:`metadataadded`,Metadata:`metadata`,bm:`midpoint`,dm:`nospatialvideoinfo`,fm:`onstatechange`,hm:`ratechange`,lm:`segmentappended`,nm:`sessiondata`,om:`spatialvideoinfo`,pm:`stalldetected`,qm:`started`,rm:`statechanged`,sm:`streaming`,tm:`textchanged`,um:`texttrackvisibility`,vm:`thirdquartile`,wm:`timelineregionadded`,xm:`timelineregionenter`,ym:`timelineregionexit`,zm:`trackschanged`,Bm:`unloading`,Dm:`variantchanged`};function ga(){this.ab=new ve,this.De=this}ga.prototype.addEventListener=function(e,t){this.ab&&this.ab.push(e,t)},ga.prototype.removeEventListener=function(e,t){this.ab&&this.ab.remove(e,t)},ga.prototype.dispatchEvent=function(e){if(!this.ab)return!0;var t=this.ab.get(e.type)||[],n=this.ab.get(`All`);for(n&&(t=t.concat(n)),t=g(t),n=t.next();!n.done;n=t.next()){n=n.value,e.target=this.De,e.currentTarget=this.De;try{n.handleEvent?n.handleEvent(e):n.call(this,e)}catch{}if(e.g)break}return e.defaultPrevented},ga.prototype.release=function(){this.ab=null};function _a(){this.g=[]}function va(e,t){e.g.push(t.finally(function(){pe(e.g,t)}))}_a.prototype.destroy=function(){for(var e=[],t=g(this.g),n=t.next();!n.done;n=t.next())n=n.value,n.promise.catch(function(){}),e.push(n.abort());return this.g=[],Promise.all(e)};function ya(e,t,n,r,i,a,o){ga.call(this),this.i=null,this.j=!1,this.u=new _a,this.g=/* @__PURE__ */ new Set,this.h=/* @__PURE__ */ new Set,this.o=e||null,this.m=t||null,this.B=n||null,this.C=r||null,this.D=i||null,this.H=a||null,this.G=o||null,this.l=/* @__PURE__ */ new Map}m(ya,ga),r=ya.prototype,r.configure=function(e){this.i=e};function ba(e,t,n,r){r=r!==void 0&&r,n=n||Aa;var i=ja.get(e);(!i||n>=i.priority)&&ja.set(e,{priority:n,xf:t,Ik:r})}function xa(e,t){for(var n=g(e.g),r=n.next();!r.done;r=n.next())t.g.add(r.value);for(e=g(e.h),n=e.next();!n.done;n=e.next())t.h.add(n.value)}r.Lk=function(e){this.g.add(e)},r.kl=function(e){this.g.delete(e)},r.tj=function(){this.g.clear()},r.Mk=function(e){this.h.add(e)},r.ll=function(e){this.h.delete(e)},r.uj=function(){this.h.clear()},r.Th=function(){this.l.clear()};function Sa(e,t,n){return{uris:e,method:`GET`,body:null,headers:{},allowCrossSiteCredentials:!1,retryParameters:t,licenseRequestType:null,sessionId:null,drmInfo:null,initData:null,initDataType:null,streamDataCallback:n===void 0?null:n}}r.destroy=function(){return this.j=!0,this.g.clear(),this.h.clear(),this.l.clear(),ga.prototype.release.call(this),this.u.destroy()},r.request=function(e,t,n){var r=this,i=new Da;if(this.j){var a=Promise.reject(new R(2,7,7001));return a.catch(function(){}),new Oa(a,function(){return Promise.resolve()},i)}t.method=t.method||`GET`,t.headers=t.headers||{},t.retryParameters=t.retryParameters?fn(t.retryParameters):aa(),t.uris=fn(t.uris),a=Ca(this,e,t,n);var o=a.Ya(function(){return wa(r,e,t,n,new ra(t.retryParameters,!1),0,null,i)}),s=o.Ya(function(t){return Ta(r,e,t,n)}),c=Date.now(),l=0;a.promise.then(function(){l=Date.now()-c},function(){});var u=0;o.promise.then(function(){u=Date.now()},function(){});var d=s.Ya(function(i){var a=Date.now()-u,o=i.response;return o.timeMs+=l,o.timeMs+=a,i.hk||!r.o||o.fromCache||t.method==`HEAD`||e!=ka||r.o(o.timeMs,o.data.byteLength,Ea(n),t,n),r.G&&r.G(e,o,n),o},function(e){throw e&&(e.severity=2),e});return a=new Oa(d.promise,function(){return d.abort()},i),va(this.u,a),a};function Ca(e,t,n,r){function i(e){a=a.Ya(function(){return n.body&&(n.body=Xe(n.body)),e(t,n,r)})}var a=ua(void 0);e.D&&i(e.D),e=g(e.g);for(var o=e.next();!o.done;o=e.next())i(o.value);return a.Ya(void 0,function(e){throw e instanceof R&&e.code==7001?e:new R(2,1,1006,e)})}function wa(e,t,n,r,i,a,o,s){e.i.forceHTTP&&(n.uris[a]=n.uris[a].replace(`https://`,`http://`)),e.i.forceHTTPS&&(n.uris[a]=n.uris[a].replace(`http://`,`https://`)),a>0&&e.H&&e.H(t,r,n.uris[a],n.uris[a-1]);var c=new Ne(n.uris[a]),l=c.cc,u=!1;l||(l=location.protocol,l=l.slice(0,-1),Pe(c,l),n.uris[a]=c.toString()),l=l.toLowerCase();var d=(l=ja.get(l))?l.xf:null;if(!d)return ca(new R(2,1,1e3,c));var f=l.Ik;(c=e.l.get(c.Bb))&&(n.headers[`common-access-token`]=c);var p=null,m=null,h=!1,g=!1,_;return da(ia(i)).Ya(function(){if(e.j)return la();_=Date.now();var i=0;n.requestStartTime=Date.now();var o=d(n.uris[a],n,t,function(a,o,c){p&&p.stop(),m&&m.na(l/1e3),e.o&&t==ka&&(i++,n.packetNumber=i,e.o(a,o,Ea(r),n,r),u=!0,s.g=c)},function(r){g=!0,n.timeToFirstByte=Date.now()-n.requestStartTime,e.m&&e.m(r,n,t)},{minBytesForProgressEvents:e.i.minBytesForProgressEvents});if(!f)return o;var c=n.retryParameters.connectionTimeout;c&&(p=new Qr(function(){h=!0,o.abort()}),p.na(c/1e3));var l=n.retryParameters.stallTimeout;return l&&(m=new Qr(function(){h=!0,o.abort()})),o}).Ya(function(r){p&&p.stop(),m&&m.stop(),r.timeMs??(r.timeMs=Date.now()-_);var i=r.headers[`common-access-token`];if(i){var a=new Ne(r.uri);e.l.set(a.Bb,i)}return i={response:r,hk:u},!g&&e.m&&e.m(r.headers,n,t),e.B&&e.B(n,r),i},function(c){if(p&&p.stop(),m&&m.stop(),e.C){var l=null,u=0;c instanceof R&&(l=c,c.code==1001&&(u=c.data[1])),e.C(n,l,u,h)}if(e.j)return la();if(h&&(c=new R(1,1,1003,n.uris[a],t)),c instanceof R){if(c.code==7001)throw c;if(c.code==1010)throw o;if(c.severity==1){if(l=(/* @__PURE__ */ new Map()).set(`error`,c),l=new V(`retry`,l),l.cancelable=!0,e.dispatchEvent(l),l.defaultPrevented)throw c;return a=(a+1)%n.uris.length,wa(e,t,n,r,i,a,c,s)}}throw c})}function Ta(e,t,n,r){var i=ua(void 0);e=g(e.h);for(var a=e.next(),o={};!a.done;o={Li:void 0},a=e.next())o.Li=a.value,i=i.Ya(function(e){return function(){var i=n.response;return i.data&&(i.data=Xe(i.data)),(0,e.Li)(t,i,r)}}(o));return i.Ya(function(){return n},function(e){var t=2;if(e instanceof R){if(e.code==7001)throw e;t=e.severity}throw new R(t,1,1007,e)})}function Ea(e){if(e){var t=e.segment;if(e=e.stream,t&&e&&e.fastSwitching&&t.Rc)return!1}return!0}P(`shaka.net.NetworkingEngine`,ya),ya.prototype.request=ya.prototype.request,ya.prototype.destroy=ya.prototype.destroy,ya.makeRequest=Sa,ya.defaultRetryParameters=function(){return aa()},ya.prototype.clearCommonAccessTokenMap=ya.prototype.Th,ya.prototype.clearAllResponseFilters=ya.prototype.uj,ya.prototype.unregisterResponseFilter=ya.prototype.ll,ya.prototype.registerResponseFilter=ya.prototype.Mk,ya.prototype.clearAllRequestFilters=ya.prototype.tj,ya.prototype.unregisterRequestFilter=ya.prototype.kl,ya.prototype.registerRequestFilter=ya.prototype.Lk,ya.unregisterScheme=function(e){ja.delete(e)},ya.registerScheme=ba,ya.prototype.configure=ya.prototype.configure;function Da(){this.g=0}ya.NumBytesRemainingClass=Da;function Oa(e,t,n){sa.call(this,e,t),this.h=n}m(Oa,sa),ya.PendingRequest=Oa;var ka=1;ya.RequestType={MANIFEST:0,SEGMENT:ka,LICENSE:2,APP:3,TIMING:4,SERVER_CERTIFICATE:5,KEY:6,ADS:7,CONTENT_STEERING:8,CMCD:9},ya.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 Aa=3;ya.PluginPriority={FALLBACK:1,PREFERRED:2,APPLICATION:Aa};var ja=/* @__PURE__ */ new Map;function Ma(e){this.g=!1,this.h=new oa,this.i=e}Ma.prototype.destroy=function(){var e=this;return this.g?this.h:(this.g=!0,this.i().then(function(){e.h.resolve()},function(){e.h.resolve()}))};function Na(e,t){if(e.g)throw t instanceof R&&t.code==7003?t:new R(2,7,7003,t)}function Pa(e,t){var n=[];e=g(e);for(var r=e.next();!r.done;r=e.next())n.push(t(r.value));return n}function Fa(e,t){e=g(e);for(var n=e.next();!n.done;n=e.next())if(!t(n.value))return!1;return!0}function Ia(e){for(var t=/* @__PURE__ */ new Map,n=g(Object.keys(e)),r=n.next();!r.done;r=n.next())r=r.value,t.set(r,e[r]);return t}function La(e){var t={};return e.forEach(function(e,n){t[n]=e}),t}function Ra(e,t){this.h=$e(e),this.i=t==Ba,this.g=0}r=Ra.prototype,r.La=function(){return this.g<this.h.byteLength},r.Ra=function(){return this.g},r.getLength=function(){return this.h.byteLength},r.Y=function(){try{var e=this.h.getUint8(this.g);return this.g+=1,e}catch{throw za()}},r.Ea=function(){try{var e=this.h.getUint16(this.g,this.i);return this.g+=2,e}catch{throw za()}},r.V=function(){try{var e=this.h.getUint32(this.g,this.i);return this.g+=4,e}catch{throw za()}},r.ah=function(){try{var e=this.h.getInt32(this.g,this.i);return this.g+=4,e}catch{throw za()}},r.zd=function(){try{if(this.i)var e=this.h.getUint32(this.g,!0),t=this.h.getUint32(this.g+4,!0);else t=this.h.getUint32(this.g,!1),e=this.h.getUint32(this.g+4,!1)}catch{throw za()}if(t>2097151)throw new R(2,3,3001);return this.g+=8,t*4294967296+e},r.Nb=function(e,t){if(this.g+e>this.h.byteLength)throw za();var n=Ze(this.h,this.g,e);return this.g+=e,t?new Uint8Array(n):n},r.skip=function(e){if(this.g+e>this.h.byteLength)throw za();this.g+=e},r.Mi=function(e){if(this.g<e)throw za();this.g-=e},r.seek=function(e){if(e<0||e>this.h.byteLength)throw za();this.g=e},r.yd=function(){for(var e=this.g;this.La()&&this.h.getUint8(this.g)!=0;)this.g+=1;return e=Ze(this.h,e,this.g-e),this.g+=1,pt(e)};function za(){return new R(2,3,3e3)}P(`shaka.util.DataViewReader`,Ra),Ra.prototype.readTerminatedString=Ra.prototype.yd,Ra.prototype.seek=Ra.prototype.seek,Ra.prototype.rewind=Ra.prototype.Mi,Ra.prototype.skip=Ra.prototype.skip,Ra.prototype.readBytes=Ra.prototype.Nb,Ra.prototype.readUint64=Ra.prototype.zd,Ra.prototype.readInt32=Ra.prototype.ah,Ra.prototype.readUint32=Ra.prototype.V,Ra.prototype.readUint16=Ra.prototype.Ea,Ra.prototype.readUint8=Ra.prototype.Y,Ra.prototype.getLength=Ra.prototype.getLength,Ra.prototype.getPosition=Ra.prototype.Ra,Ra.prototype.hasMoreData=Ra.prototype.La;var Ba=1;Ra.Endianness={BIG_ENDIAN:0,LITTLE_ENDIAN:Ba};function Va(){this.i=/* @__PURE__ */ new Map,this.h=/* @__PURE__ */ new Map,this.g=!1}r=Va.prototype,r.box=function(e,t){return e=qa(e),this.i.set(e,Xa),this.h.set(e,t),this},r.boxes=function(e,t){e=g(e);for(var n=e.next();!n.done;n=e.next())this.box(n.value,t);return this},r.ma=function(e,t){return e=qa(e),this.i.set(e,Za),this.h.set(e,t),this},r.stop=function(){this.g=!0},r.parse=function(e,t,n){for(e=new Ra(e,0),this.g=!1;e.La()&&!this.g;)this.vd(0,e,t,n)},r.vd=function(e,t,n,r){var i=t.Ra();if(r&&i+8>t.getLength())this.g=!0;else{var a=t.V(),o=t.V(),s=Ja(o),c=!1;switch(a){case 0:a=t.getLength()-i;break;case 1:if(r&&t.Ra()+8>t.getLength()){this.g=!0;return}a=t.zd(),c=!0}var l=this.h.get(o);if(l){var u=null,d=null;if(this.i.get(o)==Za){if(r&&t.Ra()+4>t.getLength()){this.g=!0;return}d=t.V(),u=d>>>24,d&=16777215}o=i+a,n&&o>t.getLength()&&(o=t.getLength()),r&&o>t.getLength()?this.g=!0:(o-=t.Ra(),t=o>0?t.Nb(o,!1):/* @__PURE__ */ new Uint8Array,t=new Ra(t,0),l({name:s,parser:this,partialOkay:n||!1,stopOnPartial:r||!1,version:u,flags:d,reader:t,size:a,start:i+e,has64BitSize:c}))}else t.skip(Math.min(i+a-t.Ra(),t.getLength()-t.Ra()))}};function Ha(e){for(var t=Ya(e);e.reader.La()&&!e.parser.g;)e.parser.vd(e.start+t,e.reader,e.partialOkay,e.stopOnPartial)}function Ua(e){for(var t=Ya(e),n=e.reader.V(),r=0;r<n&&(e.parser.vd(e.start+t,e.reader,e.partialOkay,e.stopOnPartial),!e.parser.g);r++);}function Wa(e){var t=Ya(e);for(e.reader.skip(78);e.reader.La()&&!e.parser.g;)e.parser.vd(e.start+t,e.reader,e.partialOkay,e.stopOnPartial)}function Ga(e){var t=Ya(e);e.reader.skip(8);var n=e.reader.Ea();for(e.reader.skip(6),n==2?e.reader.skip(48):e.reader.skip(12),n==1&&e.reader.skip(16);e.reader.La()&&!e.parser.g;)e.parser.vd(e.start+t,e.reader,e.partialOkay,e.stopOnPartial)}function Ka(e,t){return function(n){e(n.reader.Nb(n.reader.getLength()-n.reader.Ra(),t))}}function qa(e){var t=0;e=g(e);for(var n=e.next();!n.done;n=e.next())t=t<<8|n.value.charCodeAt(0);return t}function Ja(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,e&255)}function Ya(e){return 8+(e.has64BitSize?8:0)+(e.flags==null?0:4)}P(`shaka.util.Mp4Parser`,Va),Va.headerSize=Ya,Va.typeToString=Ja,Va.allData=Ka,Va.audioSampleEntry=Ga,Va.visualSampleEntry=Wa,Va.sampleDescription=Ua,Va.children=Ha,Va.prototype.parseNext=Va.prototype.vd,Va.prototype.parse=Va.prototype.parse,Va.prototype.stop=Va.prototype.stop,Va.prototype.fullBox=Va.prototype.ma,Va.prototype.boxes=Va.prototype.boxes,Va.prototype.box=Va.prototype.box;var Xa=0,Za=1;function Qa(e){var t=this;this.g=[],this.data=[],new Va().boxes([`moov`,`moof`],Ha).ma(`pssh`,function(e){if(!(e.version>1)){var n=Ze(e.reader.h,-12,e.size);t.data.push(n),e=e.reader.Nb(16,!1),t.g.push(Tt(e))}}).parse(e)}function $a(e,t,n,r){var i=e.length,a=12+t.length+4+i;r>0&&(a+=4+16*n.size);var o=new Uint8Array(a),s=$e(o),c=0;if(s.setUint32(c,a),c+=4,s.setUint32(c,1886614376),c+=4,r<1?s.setUint32(c,0):s.setUint32(c,16777216),c+=4,o.set(t,c),c+=t.length,r>0)for(s.setUint32(c,n.size),c+=4,t=g(n),n=t.next();!n.done;n=t.next())n=wt(n.value),o.set(n,c),c+=n.length;return s.setUint32(c,i),o.set(e,c+4),o}function eo(e){var t=this;this.D=e,this.l=this.B=null,this.Z=this.S=!1,this.J=0,this.g=null,this.o=new I,this.i=/* @__PURE__ */ new Map,this.W=[],this.C=/* @__PURE__ */ new Map,this.K=!1,this.m=new oa,this.h=null,this.u=function(n){n.severity==2&&t.m.reject(n),e.onError(n)},this.aa=/* @__PURE__ */ new Map,this.ia=/* @__PURE__ */ new Map,this.M=new Qr(function(){return To(t)}),this.R=!1,this.N=[],this.qa=!1,this.G=new Qr(function(){Ao(t)}),this.m.catch(function(){}),this.j=new Ma(function(){return to(t)}),this.O=!1,this.H=this.I=null,this.U=function(){return!1}}r=eo.prototype,r.destroy=function(){return this.j.destroy()};function to(e){var t;return k(function(n){switch(n.h){case 1:return e.o.release(),e.o=null,e.m.reject(),e.G.stop(),e.G=null,e.M.stop(),e.M=null,n.g(Oo(e),2);case 2:if(!e.l){n.A(3);break}return n.m(4),n.g(e.l.setMediaKeys(null),6);case 6:n.o(5);break;case 4:t=n.l(),F(`DrmEngine.destroyNow_ exception`,t);case 5:e.l=null;case 3:e.g=null,e.B=null,e.C=/* @__PURE__ */ new Map,e.h=null,e.u=function(){},e.D=null,e.O=!1,e.I=null,n.j()}})}r.configure=function(e,t){this.h=e,t&&(this.U=t),this.G&&this.S&&this.g&&this.G.Fa(this.h.updateExpirationTime)};function no(e,t,n){return e.Z=!0,e.C=/* @__PURE__ */ new Map,e.R=n,ao(e,t,!1)}function ro(e,t,n,r){r=r===void 0||r,e.C=/* @__PURE__ */ new Map,n=g(n);for(var i=n.next();!i.done;i=n.next())e.C.set(i.value,{initData:null,initDataType:null});for(n=g(e.h.persistentSessionsMetadata),i=n.next();!i.done;i=n.next())i=i.value,e.C.set(i.sessionId,{initData:i.initData,initDataType:i.initDataType});return e.R=e.C.size>0,ao(e,t,r)}function io(e,t,n,r,i,a){var o,s,c,l,u;return k(function(d){return d.h==1?(o=[],a.length&&o.push(a[0].contentType),i.length&&o.push(i[0].contentType),s=function(e){return e=Ot(t,e,null),e.licenseServerUri=n,e.serverCertificate=r,e.persistentStateRequired=!0,e.sessionType=`persistent-license`,e},c=qi(o),c.video&&(l=s(a[0].encryptionScheme||``),c.video.drmInfos.push(l)),c.audio&&(u=s(i[0].encryptionScheme||``),c.audio.drmInfos.push(u)),d.g(Ei([c],!0,e.O,[]),2)):(Na(e.j),d.return(ho(e,[c])))})}function ao(e,t,n){var r,i,a,o,s,c,l,u,d,f,p,m,h,_,v,y,b,x;return k(function(S){if(S.h==1){for(Lo(e.h.clearKeys,t),r=t.some(function(e){return!!(e.video&&e.video.drmInfos.length||e.audio&&e.audio.drmInfos.length)}),i=Ia(e.h.servers),a=Ia(e.h.advanced||{}),!r&&n&&No(t,i),o=/* @__PURE__ */ new WeakSet,s=g(t),c=s.next();!c.done;c=s.next())for(l=c.value,u=ko(l),d=g(u),f=d.next();!f.done;f=d.next())p=f.value,o.has(p)||(o.add(p),Io(p,i,a,e.h.keySystemsMapping));for(m=function(t,n){var r=[];t=g(t);for(var i=t.next();!i.done;i=t.next()){i=i.value;var o=i[n]||a.has(i.keySystem)&&a.get(i.keySystem)[n]||``;if(o==``&&it(i.keySystem)&&(n==`audioRobustness`?o=[e.h.defaultAudioRobustnessForWidevine]:n==`videoRobustness`&&(o=[e.h.defaultVideoRobustnessForWidevine])),typeof o==`string`)r.push(i);else if(Array.isArray(o)){o.length===0&&(o=[``]),o=g(o);for(var s=o.next();!s.done;s=o.next()){var c={};r.push(Object.assign({},i,(c[n]=s.value,c)))}}}return r},h=/* @__PURE__ */ new WeakSet,_=g(t),v=_.next();!v.done;v=_.next())y=v.value,y.video&&!h.has(y.video)&&(y.video.drmInfos=m(y.video.drmInfos,`videoRobustness`),y.video.drmInfos=m(y.video.drmInfos,`audioRobustness`),h.add(y.video)),y.audio&&!h.has(y.audio)&&(y.audio.drmInfos=m(y.audio.drmInfos,`videoRobustness`),y.audio.drmInfos=m(y.audio.drmInfos,`audioRobustness`),h.add(y.audio));return S.g(Ei(t,e.R,e.O,e.h.preferredKeySystems),2)}return Na(e.j),b=r||i.size>0,b?(x=ho(e,t),S.return(r?x:x.catch(function(){}))):(e.S=!0,S.return(Promise.resolve()))})}function oo(e){var t;return k(function(n){switch(n.h){case 1:if(e.l.mediaKeys)return n.return();if(!e.I){n.A(2);break}return n.g(e.I,3);case 3:return Na(e.j),n.return();case 2:return n.m(4),e.I=e.l.setMediaKeys(e.B),n.g(e.I,6);case 6:n.o(5);break;case 4:t=n.l(),e.u(new R(2,6,6003,t.message));case 5:Na(e.j),n.j()}})}function so(e,t){return k(function(n){if(n.h==1)return n.g(oo(e),2);fo(e,t.initDataType,Ze(t.initData)),n.j()})}r.Pb=function(e){var t=this,n,r;return k(function(i){if(i.h==1)return t.l===e?i.return():t.B?(t.l=e,t.h.delayLicenseRequestUntilPlayed&&t.o.Ba(t.l,`play`,function(){for(var e=g(t.N),n=e.next();!n.done;n=e.next())Co(t,n.value);t.qa=!0,t.N=[]}),t.l.remote?(t.o.F(t.l.remote,`connect`,function(){return Oo(t)}),t.o.F(t.l.remote,`connecting`,function(){return Oo(t)}),t.o.F(t.l.remote,`disconnect`,function(){return Oo(t)})):`webkitCurrentPlaybackTargetIsWireless`in t.l&&t.o.F(t.l,`webkitcurrentplaybacktargetiswirelesschanged`,function(){return Oo(t)}),t.H=t.g&&t.g.initData.find(function(e){return e.initData.length>0})||null,n=t.g.keySystem,(r=we().Tg(n))||!t.H&&t.g.keySystem===`com.apple.fps`&&!t.C.size?i.A(2):i.g(oo(t),2)):(t.o.Ba(e,`encrypted`,function(){t.u(new R(2,6,6010))}),i.return());uo(t).catch(function(){}),!r&&(t.H||t.C.size||t.h.parseInbandPsshEnabled)||t.o.F(t.l,`encrypted`,function(e){return so(t,e)}),i.j()})};function co(e){var t,n,r,i,a;return k(function(o){switch(o.h){case 1:if(!e.B||!e.g)return o.return();if(!e.g.serverCertificateUri||e.g.serverCertificate&&e.g.serverCertificate.length){o.A(2);break}return t=Sa([e.g.serverCertificateUri],e.h.retryParameters),o.m(3),n=e.D.qc.request(5,t,{isPreload:e.U()}),o.g(n.promise,5);case 5:r=o.i,e.g.serverCertificate=Ze(r.data),o.o(4);break;case 3:throw i=o.l(),new R(2,6,6017,i);case 4:if(e.j.g)return o.return();case 2:return!e.g.serverCertificate||!e.g.serverCertificate.length?o.return():(o.m(6),o.g(e.B.setServerCertificate(e.g.serverCertificate),8));case 8:o.o(0);break;case 6:throw a=o.l(),new R(2,6,6004,a.message)}})}function lo(e,t){var n,r,i;return k(function(a){if(a.h==1)return a.g(yo(e,t,{initData:null,initDataType:null}),2);if(a.h!=3)return n=a.i,n?(r=[],(i=e.i.get(n))&&(i.Gb=new oa,r.push(i.Gb)),r.push(n.remove()),a.g(Promise.all(r),3)):a.return();e.i.delete(n),a.j()})}function uo(e){var t,n,r,i,a;return k(function(o){if(o.h==1)return e.C.size?(e.C.forEach(function(t,n){yo(e,n,t)}),o.g(e.m,3)):o.A(2);if(o.h!=2){if(t=e.g&&e.g.keyIds||/* @__PURE__ */ new Set([]),t.size>0&&Mo(e))return o.return(e.m);e.K=!1,e.m=new oa,e.m.catch(function(){})}for(n=(e.g?e.g.initData:[])||[],r=g(n),i=r.next();!i.done;i=r.next())a=i.value,fo(e,a.initDataType,a.initData);return jo(e)&&e.m.resolve(),o.return(e.m)})}function fo(e,t,n){if(n.length){try{n=e.h.initDataTransform(n,t,e.g)}catch(n){t=n,n instanceof R||(t=new R(2,6,6016,n)),e.u(t);return}if(e.h.ignoreDuplicateInitData){var r=e.i.values();r=g(r);for(var i=r.next();!i.done;i=r.next())if(Ye(n,i.value.initData))return;var a=!1;if(e.C.forEach(function(e){!a&&Ye(n,e.initData)&&(a=!0)}),a)return}e.K=!0,e.i.size>0&&jo(e)&&(e.m.resolve(),e.K=!1,e.m=new oa,e.m.catch(function(){})),bo(e,t,n,e.g.sessionType)}}function po(e){return e=e.i.keys(),e=Pa(e,function(e){return e.sessionId}),Array.from(e)}r.Fg=function(){var e=this,t=this.i.keys();return t=Pa(t,function(t){var n=e.i.get(t);return{sessionId:t.sessionId,sessionType:n.type,initData:n.initData,initDataType:n.initDataType}}),Array.from(t)},r.Ud=function(){var e=1/0,t=this.i.keys();t=g(t);for(var n=t.next();!n.done;n=t.next())n=n.value,isNaN(n.expiration)||(e=Math.min(e,n.expiration));return e};function mo(e){return e.J?e.J:NaN}r.We=function(){return La(this.ia)};function ho(e,t){var n,r,i,a,o,s,c;return k(function(l){switch(l.h){case 1:if(n=/* @__PURE__ */ new Map,r=go(e,t,n),!r)throw navigator.requestMediaKeySystemAccess?new R(2,6,6001):new R(2,6,6020);if(Na(e.j),l.m(2),r.getConfiguration(),i=e.h.keySystemsMapping[r.keySystem]||r.keySystem,e.g=Po(e,i,n.get(i)),!e.g.licenseServerUri)throw new R(2,6,6012,e.g.keySystem);return l.g(r.createMediaKeys(),4);case 4:if(a=l.i,Na(e.j),e.B=a,!(e.h.minHdcpVersion!=``&&`getStatusForPolicy`in e.B)){l.A(5);break}return l.m(6),l.g(e.B.getStatusForPolicy({minHdcpVersion:e.h.minHdcpVersion}),8);case 8:if(o=l.i,o!=`usable`)throw new R(2,6,6018);Na(e.j),l.o(5,2);break;case 6:throw s=l.l(2),s instanceof R?s:new R(2,6,6019,s.message);case 5:return e.S=!0,e.G.Fa(e.h.updateExpirationTime),l.g(co(e),9);case 9:Na(e.j),l.o(0);break;case 2:throw c=l.l(),Na(e.j,c),e.g=null,c instanceof R?c:new R(2,6,6002,c.message)}})}function go(e,t,n){for(var r=g(t),i=r.next();!i.done;i=r.next()){i=g(ko(i.value));for(var a=i.next();!a.done;a=i.next())a=a.value,n.has(a.keySystem)||n.set(a.keySystem,[]),n.get(a.keySystem).push(a)}if(n.size==1&&n.has(``))throw new R(2,6,6e3);r=e.h.preferredKeySystems,r.length||(i=Ia(e.h.servers),i.size==1&&(r=Array.from(i.keys()))),i=g(r);var o=i.next();for(a={};!o.done;a={Gi:void 0},o=i.next()){a.Gi=o.value,o=g(t);for(var s=o.next();!s.done;s=o.next())if(s=s.value.decodingInfos.find(function(e){return function(t){return t.supported&&t.keySystemAccess!=null&&t.keySystemAccess.keySystem==e.Gi}}(a)))return s.keySystemAccess}for(i=g([!0,!1]),a=i.next();!a.done;a=i.next())for(a=a.value,o=g(t),s=o.next();!s.done;s=o.next()){s=g(s.value.decodingInfos);for(var c=s.next();!c.done;c=s.next())if(c=c.value,c.supported&&c.keySystemAccess){var l=c.keySystemAccess.keySystem;if(!r.includes(l)){var u=n.get(l);for(!u&&e.h.keySystemsMapping[l]&&(u=n.get(e.h.keySystemsMapping[l])),l=g(u),u=l.next();!u.done;u=l.next())if(!!u.value.licenseServerUri==a)return c.keySystemAccess}}}return null}function _o(e){jo(e)&&e.m.resolve()}function vo(e,t){new Qr(function(){t.loaded=!0,_o(e)}).na(zo)}function yo(e,t,n){var r,i,a,o,s,c,l;return k(function(u){switch(u.h){case 1:try{r=e.B.createSession(`persistent-license`)}catch(t){return i=new R(2,6,6005,t.message),e.u(i),u.return(Promise.reject(i))}return e.o.F(r,`message`,function(t){xo(e)?e.N.push(t):Co(e,t)}),e.o.F(r,`keystatuseschange`,function(t){return wo(e,t)}),a={initData:n.initData,initDataType:n.initDataType,loaded:!1,Wg:1/0,Gb:null,type:`persistent-license`},e.i.set(r,a),u.m(2),u.g(r.load(t),4);case 4:return o=u.i,Na(e.j),o||(e.i.delete(r),s=e.h.persistentSessionOnlinePlayback?1:2,e.u(new R(s,6,6013)),a.loaded=!0),vo(e,a),_o(e),u.return(r);case 2:c=u.l(),Na(e.j,c),e.i.delete(r),l=e.h.persistentSessionOnlinePlayback?1:2,e.u(new R(l,6,6005,c.message)),a.loaded=!0,_o(e);case 3:return u.return(Promise.resolve())}})}function bo(e,t,n,r){try{var i=e.B.createSession(r)}catch(t){e.u(new R(2,6,6005,t.message));return}e.o.F(i,`message`,function(t){xo(e)?e.N.push(t):Co(e,t)}),e.o.F(i,`keystatuseschange`,function(t){return wo(e,t)}),e.i.set(i,{initData:n,initDataType:t,loaded:!1,Wg:1/0,Gb:null,type:r}),e.h.logLicenseExchange&&St(n),i.generateRequest(t,n).catch(function(t){if(!e.j.g){e.i.delete(i);var n=t.errorCode;if(n&&n.systemCode){var r=n.systemCode;r<0&&(r+=4294967296),r=`0x`+r.toString(16)}e.u(new R(2,6,6006,t.message,t,r))}})}function xo(e){return e.l?e.h.delayLicenseRequestUntilPlayed&&e.l.paused&&!e.qa:!e.Z&&e.h.delayLicenseRequestUntilPlayed}function So(e){return k(function(t){return t.h==1?!e.K||xo(e)?t.A(0):t.g(e.m,3):t.g(Promise.all(e.W.map(function(e){return e.promise})),0)})}function Co(e,t){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,_,v;k(function(y){switch(y.h){case 1:if(n=t.target,e.h.logLicenseExchange&&St(t.message),r=e.i.get(n),i=e.g.licenseServerUri,a=e.h.advanced[e.g.keySystem],t.messageType==`individualization-request`&&a&&a.individualizationServer&&(i=a.individualizationServer),o=Sa([i],e.h.retryParameters),o.body=t.message,o.method=`POST`,o.licenseRequestType=t.messageType,o.sessionId=n.sessionId,o.drmInfo=e.g,r&&(o.initData=r.initData,o.initDataType=r.initDataType),a&&a.headers)for(s in a.headers)o.headers[s]=a.headers[s];if(rt(e.g.keySystem)){var b=o,x=e.g;try{var S=ht(b.body);if(S){var C=JSON.parse(S);C.type||(C.type=x.sessionType,b.body=gt(JSON.stringify(C)))}}catch{}}if(at(e.g.keySystem)){if(b=mt(o.body,!0,!0),b.includes(`PlayReadyKeyMessage`)){for(b=gn(b,`PlayReadyKeyMessage`),x=wn(b,`HttpHeader`),x=g(x),S=x.next();!S.done;S=x.next())C=S.value,S=wn(C,`name`)[0],C=wn(C,`value`)[0],o.headers[Sn(S)]=Sn(C);b=wn(b,`Challenge`)[0],o.body=Ct(Sn(b))}else o.headers[`Content-Type`]=`text/xml; charset=utf-8`}return c=Date.now(),y.m(2),u=e.D.qc.request(2,o,{isPreload:e.U()}),e.W.push(u),y.g(u.promise,4);case 4:l=y.i,pe(e.W,u),y.o(3);break;case 2:return d=y.l(),e.j.g||(f={sessionId:n.sessionId,sessionType:r.type,initData:r.initData,initDataType:r.initDataType},p=new R(2,6,6007,d,f),e.i.size==1?(e.u(p),r&&r.Gb&&r.Gb.reject(p)):(r&&r.Gb&&r.Gb.reject(p),e.i.delete(n),jo(e)&&(e.m.resolve(),e.M.na(.1)))),y.return();case 3:return e.j.g?y.return():(e.J+=(Date.now()-c)/1e3,e.h.logLicenseExchange&&St(l.data),y.m(5),y.g(n.update(l.data),7));case 7:y.o(6);break;case 5:return h=(m=y.l())&&m.message||String(m),_=new R(2,6,6008,h),e.u(_),r&&r.Gb&&r.Gb.reject(_),y.return();case 6:if(e.j.g)return y.return();v=new V(`drmsessionupdate`),e.D.onEvent(v),r&&(r.Gb&&r.Gb.resolve(),vo(e,r)),y.j()}})}function wo(e,t){t=t.target;var n=e.i.get(t),r=!1;t.keyStatuses.forEach(function(t,i){if(typeof i==`string`){var a=i;i=t,t=a}if(a=we(),at(e.g.keySystem)&&i.byteLength==16&&a.Bf()){a=$e(i);var o=a.getUint32(0,!0),s=a.getUint16(4,!0),c=a.getUint16(6,!0);a.setUint32(0,o,!1),a.setUint16(4,s,!1),a.setUint16(6,c,!1)}t!=`status-pending`&&(n.loaded=!0),t==`expired`&&(r=!0),i=Tt(i).slice(0,32),e.aa.set(i,t)});var i=t.expiration-Date.now();(i<0||r&&i<1e3)&&n&&!n.Gb&&(e.i.delete(t),Do(t)),jo(e)&&(e.m.resolve(),e.M.na(Bo))}function To(e){var t=e.aa,n=e.ia;n.clear(),t.forEach(function(e,t){return n.set(t,e)}),t=Array.from(n.values()),t.length&&t.every(function(e){return e==`expired`})&&e.u(new R(2,6,6014)),e.D.wf(La(n))}function Eo(){var t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,_,v,y,b,x,S,C,w,T,E,D,O,A,j;return k(function(M){if(M.h==1){if(t=`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(` `),!(e.MediaKeys&&e.navigator&&e.navigator.requestMediaKeySystemAccess&&e.MediaKeySystemAccess&&e.MediaKeySystemAccess.prototype.getConfiguration)){for(n={},r=g(t),i=r.next();!i.done;i=r.next())a=i.value,n[a]=null;return M.return(n)}for(o=`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`],c=[`150`,`2000`,`3000`],l={"com.widevine.alpha":s,"com.widevine.alpha.experiment":s,"com.microsoft.playready.recommendation":c},u=[{contentType:`video/mp4; codecs="avc1.42E01E"`},{contentType:`video/webm; codecs="vp8"`}],d=[{contentType:`audio/mp4; codecs="mp4a.40.2"`},{contentType:`audio/webm; codecs="opus"`}],f={videoCapabilities:u,audioCapabilities:d,initDataTypes:[`cenc`,`sinf`,`skd`,`keyids`]},p=[null,`cenc`,`cbcs`],m=/* @__PURE__ */ new Map,h=we(),_=function(e,t,n){var r,i,a,s,c,l,u,d,f,p,_,v,y;return k(function(b){switch(b.h){case 1:return b.m(2),b.g(t.createMediaKeys(),5);case 5:r=b.i;case 4:b.o(3);break;case 2:return b.l(),b.return();case 3:if(a=(i=t.getConfiguration().sessionTypes)?i.includes(`persistent-license`):!1,h.zi()&&(a=!1),s=t.getConfiguration().videoCapabilities,c=t.getConfiguration().audioCapabilities,l={persistentState:a,encryptionSchemes:[],videoRobustnessLevels:[],audioRobustnessLevels:[],minHdcpVersions:[]},m.get(e)?l=m.get(e):m.set(e,l),(u=s[0].encryptionScheme)&&!l.encryptionSchemes.includes(u)&&l.encryptionSchemes.push(u),(d=s[0].robustness)&&!l.videoRobustnessLevels.includes(d)&&l.videoRobustnessLevels.push(d),(f=c[0].robustness)&&!l.audioRobustnessLevels.includes(f)&&l.audioRobustnessLevels.push(f),!(n&&`getStatusForPolicy`in r)){b.A(0);break}p=g(o),_=p.next();case 7:if(_.done){b.A(0);break}if(v=_.value,l.minHdcpVersions.includes(v)){b.A(8);break}return b.g(r.getStatusForPolicy({minHdcpVersion:v}),10);case 10:if(y=b.i,y==`usable`)l.minHdcpVersions.includes(v)||l.minHdcpVersions.push(v);else{b.A(0);break}case 8:_=p.next(),b.A(7)}})},v=function(e,t,n,r,i){i=i!==void 0&&i;var a,o,s,c,l,u,d,p,m,h,v;return k(function(y){switch(y.h){case 1:for(y.m(2),a=fn(f),o=g(a.videoCapabilities),s=o.next();!s.done;s=o.next())c=s.value,c.encryptionScheme=t,c.robustness=n;for(l=g(a.audioCapabilities),u=l.next();!u.done;u=l.next())d=u.value,d.encryptionScheme=t,d.robustness=r;return p=fn(a),p.persistentState=`required`,p.sessionTypes=[`persistent-license`],m=[p,a],v=we(),v.Qa()==`MOBILE`?y.g(ii(5,navigator.requestMediaKeySystemAccess(e,m)),7):y.g(navigator.requestMediaKeySystemAccess(e,m),6);case 6:h=y.i,y.A(5);break;case 7:h=y.i;case 5:return y.g(_(e,h,i),8);case 8:y.o(0);break;case 2:y.l(),y.j()}})},y=function(e){return!(we().Ia()===`WEBKIT`&&rt(e))},b=[],x=g(t),S=x.next();!S.done;S=x.next())if(C=S.value,m.set(C,null),y(C)){for(w=!0,T=g(p),E=T.next();!E.done;E=T.next())D=E.value,b.push(v(C,D,``,``,w)),w=!1;for(O=g(l[C]||[]),A=O.next();!A.done;A=O.next())j=A.value,b.push(v(C,null,j,``)),b.push(v(C,null,``,j))}return M.g(Promise.all(b),2)}return M.return(La(m))})}function Do(e){return k(function(t){if(t.h==1)return t.m(2),t.g(ii(Ro,Promise.all([e.close().catch(function(){}),e.closed])),4);if(t.h!=2)return t.o(0);t.l(),t.j()})}function Oo(e){var t;return k(function(n){return t=Array.from(e.i.entries()),e.i.clear(),n.g(Promise.all(t.map(function(t){t=g(t);var n=t.next().value,r=t.next().value;return k(function(t){if(t.h==1)return t.m(2),e.Z||e.C.has(n.sessionId)||r.type!==`persistent-license`||e.h.persistentSessionOnlinePlayback?t.g(Do(n),5):t.g(n.remove(),5);if(t.h!=2)return t.o(0);t.l(),t.j()})})),0)})}function ko(e){return(e.video?e.video.drmInfos:[]).concat(e.audio?e.audio.drmInfos:[])}function Ao(e){e.i.forEach(function(t,n){var r=t.Wg,i=n.expiration;isNaN(i)&&(i=1/0),i!=r&&(e.D.onExpirationUpdated(n.sessionId,i),t.Wg=i)})}function jo(e){return e=e.i.values(),Fa(e,function(e){return e.loaded})}function Mo(e){for(var t=g(e.g&&e.g.keyIds||/* @__PURE__ */ new Set([])),n=t.next();!n.done;n=t.next())if(e.aa.get(n.value)!==`usable`)return!1;return!0}function No(e,t){var n=[];for(t.forEach(function(e,t){n.push({keySystem:t,licenseServerUri:e,distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:``,videoRobustness:``,serverCertificate:null,serverCertificateUri:``,initData:[],keyIds:/* @__PURE__ */ new Set})}),e=g(e),t=e.next();!t.done;t=e.next())t=t.value,t.video&&(t.video.drmInfos=n),t.audio&&(t.audio.drmInfos=n)}function Po(e,t,n){var r=[],i=[],a=[],o=[],s=[],c=/* @__PURE__ */ new Set,l=/* @__PURE__ */ new Set;for(Fo(n,r,i,o,a,s,c,l),e=e.R?`persistent-license`:`temporary`,t={keySystem:t,encryptionScheme:r[0],licenseServerUri:i[0],distinctiveIdentifierRequired:n[0].distinctiveIdentifierRequired,persistentStateRequired:n[0].persistentStateRequired,sessionType:n[0].sessionType||e,audioRobustness:n[0].audioRobustness||``,videoRobustness:n[0].videoRobustness||``,serverCertificate:o[0],serverCertificateUri:a[0],initData:s,keyIds:c,mediaTypes:n[0].mediaTypes},l.size>0&&(t.keySystemUris=l),n=g(n),l=n.next();!l.done;l=n.next())l=l.value,l.distinctiveIdentifierRequired&&(t.distinctiveIdentifierRequired=l.distinctiveIdentifierRequired),l.persistentStateRequired&&(t.persistentStateRequired=l.persistentStateRequired);return t}function Fo(t,n,r,i,a,o,s,c){var l=[];t=g(t);for(var u=t.next(),d={};!u.done;d={Ma:void 0},u=t.next()){if(d.Ma=u.value,n.includes(d.Ma.encryptionScheme)||n.push(d.Ma.encryptionScheme),rt(d.Ma.keySystem)&&d.Ma.licenseServerUri.startsWith(`data:application/json;base64,`)?l.includes(d.Ma.licenseServerUri)||l.push(d.Ma.licenseServerUri):r.includes(d.Ma.licenseServerUri)||r.push(d.Ma.licenseServerUri),a.includes(d.Ma.serverCertificateUri)||a.push(d.Ma.serverCertificateUri),d.Ma.serverCertificate&&(i.some(function(e){return function(t){return Ye(t,e.Ma.serverCertificate)}}(d))||i.push(d.Ma.serverCertificate)),d.Ma.initData){u=g(d.Ma.initData);for(var f=u.next(),p={};!f.done;p={Lg:void 0},f=u.next())p.Lg=f.value,o.some(function(e){return function(t){var n=e.Lg;return t.keyId&&t.keyId==n.keyId?!0:t.initDataType==n.initDataType&&Ye(t.initData,n.initData)}}(p))||o.push(p.Lg)}if(d.Ma.keyIds)for(u=g(d.Ma.keyIds),f=u.next();!f.done;f=u.next())s.add(f.value);if(d.Ma.keySystemUris&&c)for(d=g(d.Ma.keySystemUris),u=d.next();!u.done;u=d.next())c.add(u.value)}if(l.length==1)r.push(l[0]);else if(l.length>0){for(n=[],l=g(l),i=l.next();!i.done;i=l.next())i=e.atob(i.value.split(`data:application/json;base64,`).pop()),i=JSON.parse(i),n.push.apply(n,_(i.keys));l=JSON.stringify({keys:n}),r.push(`data:application/json;base64,`+e.btoa(l))}}function Io(t,n,r,i){var a=t.keySystem;a&&(!rt(a)||!t.licenseServerUri)&&(n.size&&n.get(a)&&(n=n.get(a),t.licenseServerUri=n),t.keyIds||(t.keyIds=/* @__PURE__ */ new Set),(r=r.get(a))&&(t.distinctiveIdentifierRequired||(t.distinctiveIdentifierRequired=r.distinctiveIdentifierRequired),t.persistentStateRequired||(t.persistentStateRequired=r.persistentStateRequired),t.serverCertificate||(t.serverCertificate=r.serverCertificate),r.sessionType&&(t.sessionType=r.sessionType),t.serverCertificateUri||(t.serverCertificateUri=r.serverCertificateUri)),i[a]&&(t.keySystem=i[a]),e.cast&&e.cast.__platform__&&a==`com.microsoft.playready`&&(t.keySystem=`com.chromecast.playready`))}function Lo(e,t){if(e=Ia(e),e.size!=0){e=kt(e),t=g(t);for(var n=t.next();!n.done;n=t.next())n=n.value,n.video&&(n.video.drmInfos=[e]),n.audio&&(n.audio.drmInfos=[e])}}var Ro=1,zo=5,Bo=.5;function Vo(){this.g=Wo,this.j=(/* @__PURE__ */ new Map()).set(Wo,2).set(Uo,1),this.i=0,this.h=-1}function Ho(e,t){var n=e.g!==t;return e.g=t,n&&t===Wo&&(e.i=Date.now()),n}var Uo=0,Wo=1;function Go(e,t,n){this.h=e,this.i=t,this.g=n}function Ko(e,t){return k(function(n){if(n.h==1)return n.g(bi(e.g,t,e.h.drm.preferredKeySystems,e.h.drm.keySystemsMapping),2);if(e.h.streaming.dontChooseCodecs||gi(t,e.h.preferredVideoCodecs,e.h.preferredAudioCodecs,e.h.preferredDecodingAttributes,e.h.preferredTextFormats),!t.variants.some(zi))throw new R(2,4,4032);return n.return(Jo(e,t))})}function qo(e,t){var n=e.h.restrictions;e=e.i;var r=!1;t=g(t.variants);for(var i=t.next();!i.done;i=t.next()){i=i.value;var a=i.allowedByApplication;i.allowedByApplication=yi(i,n,e),a!=i.allowedByApplication&&(r=!0)}return r}function Jo(e,t){var n=qo(e,t);if(t){var r=e.g?e.g.g:null;if(r&&e.g.B){for(var i=/* @__PURE__ */ new Set,a=g(t.variants),o=a.next();!o.done;o=a.next())o=o.value,o.audio&&i.add(o.audio),o.video&&i.add(o.video);for(i=g(i),a=i.next();!a.done;a=i.next())Yo(e,r.keySystem,a.value)}Xo(e,t)}return n}function Yo(e,t,n){n=g(n.drmInfos);for(var r=n.next();!r.done;r=n.next())if(r=r.value,r.keySystem==t){for(var i=g(r.initData||[]),a=i.next();!a.done;a=i.next())a=a.value,fo(e.g,a.initDataType,a.initData);i=e.g,i.g&&(i.g.mediaTypes!==r.mediaTypes&&(i.g.mediaTypes=r.mediaTypes),st(r)&&(i.g=Po(i,i.g.keySystem,[i.g,r])))}}function Xo(e,t){function n(e){if(e&&!s.has(e)&&(s.add(e),e.keyIds.size)){e=g(e.keyIds);for(var t=e.next();!t.done;t=e.next()){t=t.value;var n=r[i?`00`:t];n?Zo.includes(n)&&o.add(n):a.add(t)}}}var r=e.g?e.g.We():{};e=Object.keys(r);var i=e.length&&e[0]==`00`;e=!1;var a=/* @__PURE__ */ new Set,o=/* @__PURE__ */ new Set,s=/* @__PURE__ */ new WeakSet;t=g(t.variants);for(var c=t.next();!c.done;c=t.next()){if(c=c.value,!c.allowedByApplication)e=!0;else if(c.allowedByKeySystem)return;n(c.audio),n(c.video)}throw e={hasAppRestrictions:e,missingKeys:Array.from(a),restrictedKeyStatuses:Array.from(o)},new R(2,4,4012,e)}var Zo=[`output-restricted`,`internal-error`];P(`shaka.config.CodecSwitchingStrategy`,{RELOAD:`reload`,SMOOTH:`smooth`});function Qo(t){if(es.has(t))return es.get(t);var n=e.ManagedMediaSource||e.MediaSource;return n?(n=n.isTypeSupported(t),es.set(t,n),n):!1}function $o(){var t=e.ManagedMediaSource||e.MediaSource;return t&&t.prototype?!!t.prototype.setLiveSeekableRange&&!!t.prototype.clearLiveSeekableRange:!1}var es=/* @__PURE__ */ new Map;function ts(e,t){var n=null,r=null,i=null,a=null,o=e.V();return t&1&&(i=e.zd()),t&2&&(a=e.V()),t&8&&(n=e.V()),t&16&&(r=e.V()),{trackId:o,Rd:n,Sd:r,pj:i,Ni:a}}function ns(e,t){return t==1?(t=e.V(),e=e.V(),{baseMediaDecodeTime:t*4294967296+e}):{baseMediaDecodeTime:e.V()}}function rs(e,t){return t==1?(e.skip(8),e.skip(8)):(e.skip(4),e.skip(4)),t=e.V(),e.skip(4),e=e.Ea(),{timescale:t,language:String.fromCharCode((e>>10)+96)+String.fromCharCode(((e&960)>>5)+96)+String.fromCharCode((e&31)+96)}}function is(e,t,n){var r=e.V(),i=[],a=null;n&1&&(a=e.ah()),n&4&&e.skip(4);for(var o=0;o<r;o++){var s={mh:null,sampleSize:null,Cf:null};n&256&&(s.mh=e.V()),n&512&&(s.sampleSize=e.V()),n&1024&&e.skip(4),n&2048&&(s.Cf=t==0?e.V():e.ah()),i.push(s)}return{Hm:r,kh:i,lg:a}}function as(e){e.skip(6),e.skip(2),e.skip(8);var t=e.Ea();return e.skip(2),e.skip(2),e.skip(2),e=e.Ea()+e.Ea()/65536,{channelCount:t,sampleRate:e}}function os(e){return e=e.V(),{codec:Ja(e)}}function ss(e){var t=null,n=null,r=e.Nb(4,!1),i=String.fromCharCode(r[0]);if(i+=String.fromCharCode(r[1]),i+=String.fromCharCode(r[2]),i+=String.fromCharCode(r[3]),i===`nclx`){switch(e.Ea()){case 1:case 5:case 6:case 7:t=`srgb`;break;case 9:t=`rec2020`;break;case 11:case 12:t=`p3`}switch(r=e.Ea(),e.Ea(),r){case 1:case 6:case 13:case 14:case 15:n=`SDR`;break;case 16:n=`PQ`;break;case 18:n=`HLG`}}return{colorGamut:t,se:n}}function cs(e,t){return t=t!==void 0&&t,e=e.toString(16).toUpperCase(),t?e:(`0`+e).slice(-2)}function ls(e){return(e<10?`0`:``)+e}function us(e){this.g=e=e===void 0?[]:e}function ds(e){if(e.g.length===0)throw Error(`StreamInfos must have elements`);for(var t=[],n=g(e.g),r=n.next();!r.done;r=n.next()){var i=t,a=i.push,o=r.value;r=Ss;var s=o.id+1,c=o.stream.width||0,l=o.stream.height||0;o.type==`audio`&&(l=c=0);var u=o.duration*o.timescale,d=Math.floor(u/(ws+1));switch(u=Math.floor(u%(ws+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(_(ys(s,4)),[0,0,0,0],_(ys(d,4)),_(ys(u,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],_(ys(c,2)),[0,0],_(ys(l,2)),[0,0])),s=Ss(`tkhd`,s),c=Ss,d=o.duration*o.timescale,l=Math.floor(d/(ws+1)),d=Math.floor(d%(ws+1)),u=o.stream.language,u=u.charCodeAt(0)-96<<10|u.charCodeAt(1)-96<<5|u.charCodeAt(2)-96,l=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3].concat(_(ys(o.timescale,4)),_(ys(l,4)),_(ys(d,4)),_(ys(u,2)),[0,0])),l=Ss(`mdhd`,l),d=o,u=new Uint8Array([]),d.type){case`video`:u=Es.value();break;case`audio`:u=Ds.value()}d=Ss(`hdlr`,u);a:{switch(o.type){case`video`:o=Ss(`minf`,Ss(`vmhd`,Ms.value()),Is.value(),fs(o));break a;case`audio`:o=Ss(`minf`,Ss(`smhd`,Ns.value()),Is.value(),fs(o));break a}o=new Uint8Array([])}o=c(`mdia`,l,d,o),r=r(`trak`,s,o),a.call(i,r)}for(n=e.g[0],i=Ss,a=i.apply,o=n.duration*n.timescale,r=Math.floor(o/(ws+1)),o=Math.floor(o%(ws+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(_(ys(n.timescale,4)),_(ys(r,4)),_(ys(o,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=[`moov`,Ss(`mvhd`,r)],o=r.concat,t=_(t),s=[],e=g(e.g),d=e.next();!d.done;d=e.next())c=s,l=c.push,d=new Uint8Array([0,0,0,0].concat(_(ys(d.value.id+1,4)),[0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),d=Ss(`trex`,d),l.call(c,d);return e=Ss.apply(us,[`mvex`].concat(_(s))),e=a.call(i,us,o.call(r,t,[e,hs(n.stream)])),t=Fs.value(),n=new Uint8Array(t.byteLength+e.byteLength),n.set(t),n.set(e,t.byteLength),n}function fs(e){var t=Ss,n=`aac`;e.codecs.includes(`mp3`)?n=`mp3`:e.codecs.includes(`ac-3`)?n=we().le()?`ec-3`:`ac-3`:e.codecs.includes(`ec-3`)?n=`ec-3`:e.codecs.includes(`opus`)&&(n=`opus`);var r=new Uint8Array([]);switch(e.type){case`video`:if(e.codecs.includes(`avc1`)){if(n=e.stream.width||0,r=e.stream.height||0,e.Ta.byteLength>0)var i=Ss(`avcC`,e.Ta);else{i=Ss;for(var a=7,o=[],s=[],c=0,l=0,u=0,d=0;d<e.zb.length;d++){var f=bs(e.zb[d]);switch(f[0]&31){case 7:o.push(f),a+=f.length+2;break;case 8:s.push(f),a+=f.length+2}}for(o.length>0&&(c=o[0][1],u=o[0][2],l=o[0][3]),a=new Uint8Array(a),d=0,a[d++]=1,a[d++]=c,a[d++]=u,a[d++]=l,a[d++]=255,a[d++]=224|o.length,c=0;c<o.length;c++)a[d++]=(o[c].length&65280)>>8,a[d++]=o[c].length&255,a.set(o[c],d),d+=o[c].length;for(a[d++]=s.length,o=0;o<s.length;o++)a[d++]=(s[o].length&65280)>>8,a[d++]=s[o].length&255,a.set(s[o],d),d+=s[o].length;i=i(`avcC`,a)}n=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(_(ys(n,2)),_(ys(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=`avc1`,s=ps(e),o=new Uint8Array([]),Cs(e.stream)&&(o=gs(e.stream,e.codecs),r=`encv`),r=Ss(r,n,i,s,o)}else e.codecs.includes(`hvc1`)&&(r=e.stream.width||0,i=e.stream.height||0,n=new Uint8Array([]),e.Ta.byteLength>0&&(n=Ss(`hvcC`,e.Ta)),r=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(_(ys(r,2)),_(ys(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=`hvc1`,s=ps(e),o=new Uint8Array([]),Cs(e.stream)&&(o=gs(e.stream,e.codecs),i=`encv`),r=Ss(i,r,n,s,o));break;case`audio`:n==`mp3`?e=Ss(`.mp3`,ms(e)):n==`ac-3`?(n=Ss(`dac3`,e.Aa),r=`ac-3`,i=new Uint8Array([]),Cs(e.stream)&&(i=gs(e.stream,e.codecs),r=`enca`),e=Ss(r,ms(e),n,i)):n==`ec-3`?(n=Ss(`dec3`,e.Aa),r=`ec-3`,i=new Uint8Array([]),Cs(e.stream)&&(i=gs(e.stream,e.codecs),r=`enca`),e=Ss(r,ms(e),n,i)):n==`opus`?(n=Ss(`dOps`,e.Aa),r=`Opus`,i=new Uint8Array([]),Cs(e.stream)&&(i=gs(e.stream,e.codecs),r=`enca`),e=Ss(r,ms(e),n,i)):(e.Aa.byteLength>0?n=Ss(`esds`,e.Aa):(n=Ss,r=e.id+1,i=e.stream.channelsCount||2,o=e.stream.audioSamplingRate||44100,c=At(`audio`,e.codecs.split(`,`)),l={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=l[o],(c===`mp4a.40.5`||c===`mp4a.40.29`)&&(s=l[o*2]),o=parseInt(c.split(`.`).pop(),10),r=new Uint8Array([0,0,0,0,3,25].concat(_(ys(r,2)),[0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,0,5,2,o<<3|s>>>1,s<<7|i<<3,6,1,2])),n=n(`esds`,r)),r=`mp4a`,i=new Uint8Array([]),Cs(e.stream)&&(i=gs(e.stream,e.codecs),r=`enca`),e=Ss(r,ms(e),n,i)),r=e}return e=Ss(`stsd`,Ps.value(),r),t(`stbl`,e,Ss(`stts`,Os.value()),Ss(`stsc`,ks.value()),Ss(`stsz`,js.value()),Ss(`stco`,As.value()))}function ps(e){if(!e.Za&&!e.$a)return new Uint8Array([]);var t=e.$a;return e=new Uint8Array([].concat(_(ys(e.Za,4)),_(ys(t,4)))),Ss(`pasp`,e)}function ms(e){return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.stream.channelsCount||2,0,16,0,0,0,0].concat(_(ys(e.stream.audioSamplingRate||44100,2)),[0,0]))}function hs(e){var t=[];if(!Cs(e))return new Uint8Array([]);e=g(e.drmInfos);for(var n=e.next();!n.done;n=e.next())if(n=n.value,n.initData){n=g(n.initData);for(var r=n.next();!r.done;r=n.next())t.push(r.value.initData)}return z.apply(bt,_(t))}function gs(e,t){var n=Ss;t=new Uint8Array([].concat(_(ys(xs(t.split(`.`)[0]),4)))),t=Ss(`frma`,t);var r=`cenc`,i=e.drmInfos[0];i&&i.encryptionScheme&&(r=i.encryptionScheme),r=new Uint8Array([0,0,0,0].concat(_(ys(xs(r),4)),[0,1,0,0])),r=Ss(`schm`,r),i=Ss;var a=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);e=g(e.drmInfos);for(var o=e.next();!o.done;o=e.next())if((o=o.value)&&o.keyIds&&o.keyIds.size){o=g(o.keyIds);for(var s=o.next();!s.done;s=o.next())a=bs(s.value)}return e=new Uint8Array([0,0,0,0,0,0,1,8]),a=Ss(`tenc`,e,a),n(`sinf`,t,r,i(`schi`,a))}function _s(e){var t=[];e=g(e.g);for(var n=e.next();!n.done;n=e.next()){n=n.value;var r=t,i=r.push,a=Ss,o=new Uint8Array([0,0,0,0].concat(_(ys(n.data?n.data.sequenceNumber:0,4))));o=Ss(`mfhd`,o);var s,c=n.data?n.data.ub:[],l=new Uint8Array(4+c.length);for(s=0;s<c.length;s++){var u=c[s].flags;l[s+4]=u.Te<<4|u.ef<<2|u.$e}c=Ss(`sdtp`,l);var d=c.length+32+20+8+16+8+8;l=Ss,s=new Uint8Array([0,0,0,58].concat(_(ys(n.id+1,4)),[0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),s=Ss(`tfhd`,s),u=n.data?n.data.baseMediaDecodeTime:0;var f=Math.floor(u%(ws+1));u=new Uint8Array([1,0,0,0].concat(_(ys(Math.floor(u/(ws+1)),4)),_(ys(f,4)))),u=Ss(`tfdt`,u);var p=d;d=n.data?n.data.ub:[],f=d.length;var m=12+16*f,h=new Uint8Array(m);for(p+=8+m,h.set([+(n.type===`video`),0,15,1].concat(_(ys(f,4)),_(ys(p,4))),0),p=0;p<f;p++){var v=d[p];m=ys(v.duration,4);var y=ys(v.size,4),b=v.flags;v=ys(v.ob,4),h.set([].concat(_(m),_(y),[b.Og<<2|b.Te,b.ef<<6|b.$e<<4|b.Pg,b.Se&61440,b.Se&15],_(v)),12+16*p)}d=Ss(`trun`,h),c=l(`traf`,s,u,d,c),a=a(`moof`,o,c),i.call(r,a,vs(n))}return z.apply(bt,_(t))}function vs(e){return e=(e.data?e.data.ub:[]).map(function(e){return e.data}),Ss.apply(us,[`mdat`].concat(_(e)))}function ys(e,t){var n=[];for(--t;t>=0;t--)n.push(e>>8*t&255);return n}function bs(e){for(var t=new Uint8Array(e.length/2),n=0;n<e.length/2;n+=1)t[n]=parseInt(String(e[n*2]+e[n*2+1]),16);return t}function xs(e){for(var t=0,n=0;n<e.length;n+=1)t|=e.charCodeAt(n)<<(e.length-n-1)*8;return t}function Ss(e){var t=A.apply(1,arguments),n=Ts.get(e);n||(n=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)],Ts.set(e,n));for(var r=8,i=t.length-1;i>=0;i--)r+=t[i].byteLength;for(i=new Uint8Array(r),i[0]=r>>24&255,i[1]=r>>16&255,i[2]=r>>8&255,i[3]=r&255,i.set(n,4),n=0,r=8;n<t.length;n++)i.set(t[n],r),r+=t[n].byteLength;return i}function Cs(e){return e.encrypted&&e.drmInfos.length>0}var ws=4294967295,Ts=/* @__PURE__ */ new Map,Es=new Ce(function(){return 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])}),Ds=new Ce(function(){return 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])}),Os=new Ce(function(){return new Uint8Array([0,0,0,0,0,0,0,0])}),ks=new Ce(function(){return new Uint8Array([0,0,0,0,0,0,0,0])}),As=new Ce(function(){return new Uint8Array([0,0,0,0,0,0,0,0])}),js=new Ce(function(){return new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0])}),Ms=new Ce(function(){return new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}),Ns=new Ce(function(){return new Uint8Array([0,0,0,0,0,0,0,0])}),Ps=new Ce(function(){return new Uint8Array([0,0,0,0,0,0,0,1])}),Fs=new Ce(function(){var e=new Uint8Array([105,115,111,109]),t=new Uint8Array([97,118,99,49]);return Ss(`ftyp`,e,new Uint8Array([0,0,0,1]),e,t)}),Is=new Ce(function(){var e=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]);return e=Ss(`dref`,e),Ss(`dinf`,e)});function Ls(e){e=Ze(e);var t=null;return new Va().boxes([`moov`,`trak`,`mdia`,`minf`,`stbl`],Ha).ma(`stsd`,Ua).box(`enca`,function(e){return t=e.reader.h,Ga(e)}).box(`sinf`,Ha).box(`frma`,function(e){e.parser.stop(),os(e.reader).codec===`ec-3`&&t&&t.getUint16(16)!==2&&t.setUint16(16,2)}).parse(e),e}function Rs(e,t,n){var r=t=Ze(t),i=!1,a,o=[],s=[];if(new Va().boxes([`moov`,`trak`,`mdia`,`minf`,`stbl`],function(e){o.push(e),Ha(e)}).ma(`stsd`,function(e){a=e,o.push(e),Ua(e)}).boxes([`encv`,`enca`],function(e){i=!0,e.parser.stop()}).boxes(`dvav dva1 dvh1 dvhe dvc1 dvi1 hev1 hvc1 avc1 avc3`.split(` `),function(e){s.push({box:e,Ai:1701733238})}).boxes(`ac-3 ec-3 ac-4 Opus fLaC mp4a`.split(` `),function(e){s.push({box:e,Ai:1701733217})}).parse(t),i)return t;if(s.length==0||!a)throw Tt(t),new R(2,3,3019,n);s.reverse(),n=g(s);for(var c=n.next();!c.done;c=n.next())c=c.value,r=Vs(e,r,a,c.box,o,c.Ai);return r=Hs(e,r),we().hh()?(e=new Uint8Array(t.byteLength+r.byteLength),e.set(r),e.set(t,r.byteLength),e):r}function zs(e){e=Ze(e);var t=[];new Va().box(`mdat`,function(e){t.push(e)}).parse(e);for(var n=[],r=0;r<t.length;r++){var i=t[r-1],a=t[r];n.push(Bs(e.subarray(i?i.start+i.size:0,a.start+a.size)))}return z.apply(bt,_(n))}function Bs(e){var t,n,r,i,a=[];if(new Va().boxes([`moof`,`traf`],function(e){a.push(e),Ha(e)}).ma(`tfhd`,function(e){t=e,r=ts(e.reader,e.flags)}).ma(`trun`,function(e){n=e,i=is(e.reader,e.version,e.flags)}).parse(e),r&&r.Ni!==2){var o=t.start+Ya(t)+4+(r.pj===null?0:8),s=$e(e);if(r.Ni!==null)s.setUint32(o,2);else{Us(e,t.start,t.size+4);var c=s.getUint32(t.start+8);s.setUint32(t.start+8,c|2),i&&i.lg!==null&&s.setInt32(n.start+Ya(n)+4,i.lg+4),c=e.subarray(0,o),s=e.subarray(o),e=new Uint8Array(e.byteLength+4),e.set(c),c=[];for(var l=3;l>=0;l--)c.push(2>>8*l&255);for(e.set(new Uint8Array(c),o),e.set(s,o+4),o=g(a),s=o.next();!s.done;s=o.next())s=s.value,Us(e,s.start,s.size+4)}}return e}function Vs(e,t,n,r,i,a){var o=gs(e,r.name),s=t.subarray(r.start,r.start+r.size);for(e=new Uint8Array(r.size+o.byteLength),e.set(s,0),$e(e).setUint32(4,a),e.set(o,r.size),Us(e,0,e.byteLength),a=new Uint8Array(t.byteLength+e.byteLength),r=we().df()?r.start:r.start+r.size,o=t.subarray(r),a.set(t.subarray(0,r)),a.set(e,r),a.set(o,r+e.byteLength),t=g(i),i=t.next();!i.done;i=t.next())i=i.value,Us(a,i.start,i.size+e.byteLength);return e=$e(a,n.start),n=Ya(n),t=e.getUint32(n),e.setUint32(n,t+1),a}function Hs(e,t){if(e=hs(e),e.byteLength===0)return t;var n=0,r=0;new Va().box(`moov`,function(e){n=e.start,r=e.size,e.parser.stop()}).parse(t);var i=n+r;Us(t,n,r+e.byteLength);var a=new Uint8Array(t.byteLength+e.byteLength),o=t.subarray(i);return a.set(t.subarray(0,i)),a.set(e,i),a.set(o,i+e.byteLength),a}function Us(e,t,n){e=$e(e,t),t=e.getUint32(0),t!=0&&(t==1?(e.setUint32(8,n>>32),e.setUint32(12,n|0)):e.setUint32(0,n))}function Ws(e){var t=Ze(e),n=[];return new Va().boxes([`moov`,`trak`,`mdia`,`minf`,`stbl`],function(e){n.push({start:e.start,size:e.size}),Ha(e)}).box(`stsd`,function(e){n.push({start:e.start,size:e.size});for(var r=$e(t,e.start),i=0;i<e.size-3;i++){var a=r.getUint32(i);a==1633889587?r.setUint32(i,1700998451):a==1684103987&&r.setUint32(i,1684366131)}}).parse(t),t}function Gs(e,t,n,r,i,a,o,s){this.P=e,this.startByte=t,this.endByte=n,this.sd=r===void 0?null:r,this.timescale=i===void 0?null:i,this.h=a===void 0?null:a,this.aesKey=o===void 0?null:o,this.g=this.mimeType=this.codecs=null,this.encrypted=s!==void 0&&s}Gs.prototype.Fc=function(){return this.startByte},Gs.prototype.Dc=function(){return this.endByte},Gs.prototype.me=function(e){this.h=e},Gs.prototype.Vb=function(){return this.h};function Ks(e,t){return e===t?!0:e&&t?e.Fc()==t.Fc()&&e.Dc()==t.Dc()&&_e(e.P().sort(),t.P().sort())&&Ye(e.Vb(),t.Vb()):e==t}P(`shaka.media.InitSegmentReference`,Gs),Gs.prototype.getEndByte=Gs.prototype.Dc,Gs.prototype.getStartByte=Gs.prototype.Fc;function H(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){for(l=l===void 0?[]:l,p=p===void 0?Ys:p,this.startTime=e,this.j=this.endTime=t,this.C=n,this.startByte=r,this.endByte=i,this.ba=a,this.timestampOffset=o,this.appendWindowStart=s,this.appendWindowEnd=c,this.g=l,this.tilesLayout=u===void 0?``:u,this.B=d===void 0?null:d,this.h=f===void 0?null:f,this.status=p,this.preload=!1,this.l=!0,this.o=!1,this.aesKey=m===void 0?null:m,this.thumbnailSprite=null,this.i=-1,this.m=h!==void 0&&h,this.be=this.Rc=!1,e=g(this.g),t=e.next();!t.done;t=e.next())t.value.wi();this.m&&this.g.length&&this.g[this.g.length-1].ui(),this.u=this.bandwidth=this.mimeType=this.codecs=null,this.D=!1}r=H.prototype,r.P=function(){return this.C()},r.getStartTime=function(){return this.startTime},r.Ij=function(){return this.endTime},r.Fc=function(){return this.startByte},r.Dc=function(){return this.endByte};function qs(e){if(e.endByte)return e.endByte+1-e.startByte;if(e.bandwidth){var t=e.bandwidth*(e.endTime-e.startTime);if(!isNaN(t)&&t>0)return t}if(e.g.length>0&&e.m)for(e=g(e.g),e=e.next();!e.done;e=e.next()){qs(e.value);break}return null}r.ck=function(){return this.tilesLayout},r.bk=function(){return this.B},r.Wb=function(){return this.status},r.yk=function(){this.status=Xs},r.Sg=function(){this.preload=!0},r.isPreload=function(){return this.preload},r.rd=function(){this.l=!1},r.nk=function(){return this.l},r.wi=function(){this.Rc=!0},r.qk=function(){return this.Rc},r.ui=function(){this.be=!0},r.pk=function(){return this.be},r.ti=function(){this.o=!0},r.ik=function(){return this.o},r.If=function(e){this.thumbnailSprite=e},r.Zj=function(){return this.thumbnailSprite},r.offset=function(e){this.startTime+=e,this.endTime+=e,this.j+=e;for(var t=g(this.g),n=t.next();!n.done;n=t.next())n=n.value,n.startTime+=e,n.endTime+=e,n.j+=e},r.Bh=function(e){this.h==null?ce(`Sync attempted without sync time!`):(e=this.h-e-this.startTime,Math.abs(e)>=.001&&this.offset(e))},r.me=function(e,t){this.u=e,this.D=t!==void 0&&t},r.Vb=function(e){var t=this.u;return(e===void 0||e)&&this.D&&(this.u=null),t};function Js(e,t){e.ba=t,e=g(e.g);for(var n=e.next();!n.done;n=e.next())Js(n.value,t)}P(`shaka.media.SegmentReference`,H),H.prototype.getSegmentData=H.prototype.Vb,H.prototype.setSegmentData=H.prototype.me,H.prototype.syncAgainst=H.prototype.Bh,H.prototype.offset=H.prototype.offset,H.prototype.getThumbnailSprite=H.prototype.Zj,H.prototype.setThumbnailSprite=H.prototype.If,H.prototype.hasByterangeOptimization=H.prototype.ik,H.prototype.markAsByterangeOptimization=H.prototype.ti,H.prototype.isLastPartial=H.prototype.pk,H.prototype.markAsLastPartial=H.prototype.ui,H.prototype.isPartial=H.prototype.qk,H.prototype.markAsPartial=H.prototype.wi,H.prototype.isIndependent=H.prototype.nk,H.prototype.markAsNonIndependent=H.prototype.rd,H.prototype.isPreload=H.prototype.isPreload,H.prototype.markAsPreload=H.prototype.Sg,H.prototype.markAsUnavailable=H.prototype.yk,H.prototype.getStatus=H.prototype.Wb,H.prototype.getTileDuration=H.prototype.bk,H.prototype.getTilesLayout=H.prototype.ck,H.prototype.getEndByte=H.prototype.Dc,H.prototype.getStartByte=H.prototype.Fc,H.prototype.getEndTime=H.prototype.Ij,H.prototype.getStartTime=H.prototype.getStartTime,H.prototype.getUris=H.prototype.P;var Ys=0,Xs=1;H.Status={vl:Ys,Am:Xs,Wl:2};function Zs(e){return e.length==1&&e.end(0)-e.start(0)<1e-4}function Qs(e){return!e||Zs(e)?null:e.length==1&&e.start(0)<0?0:e.length?e.start(0):null}function $s(e){return!e||Zs(e)?null:e.length?e.end(e.length-1):null}function ec(e,t){return!e||!e.length||Zs(e)||t>e.end(e.length-1)?!1:t>=e.start(0)}function tc(e,t){if(!e||!e.length||Zs(e))return 0;var n=0;e=g(rc(e));for(var r=e.next();!r.done;r=e.next()){var i=r.value;r=i.start,i=i.end,i>t&&(n+=i-Math.max(r,t))}return n}function nc(e,t,n){return!e||!e.length||Zs(e)?null:(e=rc(e).findIndex(function(e,r,i){return e.start>t&&(r==0||i[r-1].end-t<=n)}),e>=0?e:null)}function rc(e){if(!e)return[];for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}function ic(){}function ac(e,t){var n=document.createElement(`source`);return n.src=e,n.type=t===void 0?``:t,n}function oc(e){for(var t=!1,n=e.getElementsByTagName(`source`),r=n.length-1;r>=0;--r)e.removeChild(n[r]),t=!0;return e.src&&(e.removeAttribute(`src`),t=!0),t}function sc(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function cc(){return dc||(uc||(uc=new Qr(function(){dc=null})),(dc=document.getElementsByTagName(`video`)[0]||document.getElementsByTagName(`audio`)[0])||(dc=document.createElement(`video`)),uc.na(1),dc)}function lc(t,n){var r,i,a,o,s;return k(function(c){if(c.h==1)return`fonts`in document&&`FontFace`in e?c.g(document.fonts.ready,2):c.return();if(!(`entries`in document.fonts))return c.return();for(r=function(e){e=e.entries();for(var t=[],n=e.next();n.done===!1;)t.push(n.value),n=e.next();return t},i=g(r(document.fonts)),a=i.next();!a.done;a=i.next())if(o=a.value,o.family===t&&o.display===`swap`)return c.return();s=new FontFace(t,`url(`+n+`)`,{display:`swap`}),document.fonts.add(s),c.j()})}P(`shaka.util.Dom`,ic),ic.removeAllChildren=sc,ic.clearSourceFromVideo=oc;var uc=null,dc=null;function fc(){}function pc(e,t){return t+10<=e.length&&e[t]===73&&e[t+1]===68&&e[t+2]===51&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128}function mc(e,t){return t+10<=e.length&&e[t]===51&&e[t+1]===68&&e[t+2]===73&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128}function hc(e,t){var n=(e[t]&127)<<21;return n|=(e[t+1]&127)<<14,n|=(e[t+2]&127)<<7,n|=e[t+3]&127}function gc(e){var t={key:e.type,description:``,data:``,mimeType:null,pictureType:null};if(e.type===`APIC`){if(e.size<2||e.data[0]!==3)return null;var n=e.data.subarray(1).indexOf(0);if(n===-1)return null;var r=pt(Ze(e.data,1,n)),i=e.data[2+n],a=e.data.subarray(3+n).indexOf(0);if(a===-1)return null;var o=pt(Ze(e.data,3+n,a)),s=r===`-->`?pt(Ze(e.data,4+n+a)):Xe(e.data.subarray(4+n+a));return t.mimeType=r,t.pictureType=i,t.description=o,t.data=s,t}return e.type===`TXXX`||e.type===`WXXX`?e.size<2||e.data[0]!==3||(r=e.data.subarray(1).indexOf(0),r===-1)?null:(n=pt(Ze(e.data,1,r)),e=pt(Ze(e.data,2+r)).replace(/\0*$/,``),t.description=n,t.data=e,t):e.type===`PRIV`?e.size<2||(n=e.data.indexOf(0),n===-1)?null:(n=pt(Ze(e.data,0,n)),t.description=n,n==`com.apple.streaming.transportStreamTimestamp`?(n=e.data.subarray(n.length+1),e=n[3]&1,n=(n[4]<<23)+(n[5]<<15)+(n[6]<<7)+n[7],n/=45,e&&(n+=47721858.84),t.data=n):(e=Xe(e.data.subarray(n.length+1)),t.data=e),t):e.type[0]===`T`?e.size<2||e.data[0]!==3?null:(e=pt(e.data.subarray(1)).replace(/\0*$/,``),t.data=e,t):e.type[0]===`W`?(e=pt(e.data).replace(/\0*$/,``),t.data=e,t):e.data?(t.data=Xe(e.data),t):null}function _c(e){for(var t=0,n=[];pc(e,t);){var r=hc(e,t+6);for(e[t+5]>>6&1&&(t+=10),t+=10,r=t+r;t+10<r;){var i=e.subarray(t),a=hc(i,4);i={type:String.fromCharCode(i[0],i[1],i[2],i[3]),size:a,data:i.subarray(10,10+a)},(a=gc(i))&&n.push(a),t+=i.size+10}mc(e,t)&&(t+=10)}return n}function vc(e,t){for(var n=t=t===void 0?0:t,r=0;pc(e,t);)e[t+5]>>6&1&&(r+=10),r+=10,r+=hc(e,t+6),mc(e,t+10)&&(r+=10),t+=r;return r>0?e.subarray(n,n+r):new Uint8Array([])}P(`shaka.util.Id3Utils`,fc),fc.getID3Data=vc,fc.getID3Frames=_c;function yc(e,t,n){return n=n===void 0?2**-52:n,e===t||(e=Math.abs(e-t),e<=n||n!==2**-52&&Math.abs(e-n)<=2**-52)}function bc(e){return new Date(Date.UTC(1900,0,1,0,0,0,0)+e).getTime()}function xc(e,t){if(this.j=e,t!==void 0&&t){t=new Uint8Array(e.byteLength);for(var n=0,r=0;r<e.byteLength;r++)r>=2&&e[r]==3&&e[r-1]==0&&e[r-2]==0||(t[n]=e[r],n++);this.j=Ze(t,0,n)}this.i=this.j.byteLength,this.g=this.h=0}function Sc(e){var t=e.j.byteLength-e.i,n=Math.min(4,e.i);if(n!==0){for(var r=0,i=0;i<n;i++)r=r<<8|e.j[t+i];e.h=r<<(4-n)*8,e.g=n*8,e.i-=n}}function Cc(e,t){if(e.g<=t){t-=e.g;var n=Math.floor(t/8);t-=n*8,e.g-=n,Sc(e)}e.h<<=t,e.g-=t}function wc(e,t){var n=Math.min(e.g,t),r=e.h>>>32-n;return e.g-=n,e.g>0?e.h<<=n:e.i>0&&Sc(e),n=t-n,n>0?r<<n|wc(e,n):r}function Tc(e){for(var t=0;e.g===0;){if(e.i===0)return t;Sc(e)}for(;;){var n=Math.clz32(e.h);if(n>e.g&&(n=e.g),t+=n,e.h<<=n,e.g-=n,e.g>0||e.i===0)break;Sc(e)}return t}function Ec(e){Cc(e,1+Tc(e))}function U(e){return wc(e,Tc(e)+1)-1}function Dc(e){return e=U(e),1&e?1+e>>>1:-1*(e>>>1)}function W(e){return wc(e,1)===1}function Oc(e){return wc(e,8)}function kc(e,t){for(var n=8,r=8,i=0;i<t;i++)r!==0&&(r=Dc(e),r=(n+r+256)%256),n=r===0?n:r}function Ac(e){return Oc(e),U(e),U(e)}P(`shaka.util.ExpGolomb`,xc);function jc(){this.K=null,this.M=!1,this.C=this.N=null,this.m=[],this.j=[],this.g=[],this.G=this.H=null,this.l=[],this.i=[],this.h=[],this.I=null,this.u=[],this.o=[],this.D=this.J=this.B=null}r=jc.prototype,r.clearData=function(){this.m=[],this.j=[],this.g=[],this.l=[],this.i=[],this.h=[],this.u=[],this.o=[]},r.Gf=function(e){this.D!=null&&this.D!=e&&(this.B=null),this.D=e},r.parse=function(e){if(e.length<564)return this;for(var t=Math.max(0,Uc(e)),n=e.length-(e.length+t)%188,r=!1,i=t;i<n;i+=188)if(e[i]==71){var a=!!(e[i+1]&64),o=((e[i+1]&31)<<8)+e[i+2];if((e[i+3]&48)>>4>1){var s=i+5+e[i+4];if(s==i+188)continue}else s=i+4;switch(o){case 0:a&&(s+=e[s]+1),this.K=(e[s+10]&31)<<8|e[s+11];break;case 17:case 8191:break;case this.K:a&&(s+=e[s]+1),a=e,o={audio:-1,video:-1,bf:-1,audioCodec:``,videoCodec:``};var c=s+3+((a[s+1]&15)<<8|a[s+2])-4;for(s+=12+((a[s+10]&15)<<8|a[s+11]);s<c;){var l=(a[s+1]&31)<<8|a[s+2],u=(a[s+3]&15)<<8|a[s+4];switch(a[s]){case 6:if(u>0)for(var d=s+5,f=u;f>2;){var p=a[d+1]+2;switch(a[d]){case 5:var m=d+2;m=a[m]<<24|a[m+1]<<16|a[m+2]<<8|a[m+3],o.audio==-1&&m===1332770163?(o.audio=l,o.audioCodec=`opus`):o.video==-1&&m===1096167473&&(o.video=l,o.videoCodec=`av1`);break;case 106:o.audio==-1&&(o.audio=l,o.audioCodec=`ac3`);break;case 122:o.audio==-1&&(o.audio=l,o.audioCodec=`ec3`);break;case 124:o.audio==-1&&(o.audio=l,o.audioCodec=`aac`);break;case 127:o.audioCodec==`opus`&&(m=null,a[d+2]===128&&(m=a[d+3]),m!=null&&(this.J={channelCount:m&15?m&15:2,sj:m,sampleRate:48e3}))}d+=p,f-=p}break;case 15:o.audio==-1&&(o.audio=l,o.audioCodec=`aac`);break;case 17:o.audio==-1&&(o.audio=l,o.audioCodec=`aac-loas`);break;case 21:o.bf==-1&&(o.bf=l);break;case 27:o.video==-1&&(o.video=l,o.videoCodec=`avc`);break;case 3:case 4:o.audio==-1&&(o.audio=l,o.audioCodec=`mp3`);break;case 36:o.video==-1&&(o.video=l,o.videoCodec=`hvc`);break;case 129:o.audio==-1&&(o.audio=l,o.audioCodec=`ac3`);break;case 132:case 135:o.audio==-1&&(o.audio=l,o.audioCodec=`ec3`)}s+=u+5}a=o,a.video!=-1&&(this.N=a.video,this.C=a.videoCodec),a.audio!=-1&&(this.H=a.audio,this.G=a.audioCodec),a.bf!=-1&&(this.I=a.bf),r&&!this.M&&(r=!1,i=t-188),this.M=!0;break;case this.N:s=e.subarray(s,i+188),a?(this.j.push(this.m.length),this.m.push(s)):this.j.length&&this.m.push(s);break;case this.H:s=e.subarray(s,i+188),a?(this.i.push(this.l.length),this.l.push(s)):this.i.length&&this.l.push(s);break;case this.I:s=e.subarray(s,i+188),a?(this.o.push(this.u.length),this.u.push(s)):this.o.length&&this.u.push(s);break;default:r=!0}}return this};function Mc(e,t,n){return Et(e,t[n],n+1<t.length?t[n+1]:e.length)}function Nc(e,t,n){if(t.byteLength<9||(t[0]<<16|t[1]<<8|t[2])!=1)return null;var r=t[4]<<8|t[5];if(r&&r>n-6)return null;var i=null,a=null,o=t[7];if(t.byteLength<Ic(t))return null;if(o&192){i=(t[9]&14)*536870912+(t[10]&255)*4194304+(t[11]&254)*16384+(t[12]&255)*128+(t[13]&254)/2;var s=null;o&64&&(s=(t[14]&14)*536870912+(t[15]&255)*4194304+(t[16]&254)*16384+(t[17]&255)*128+(t[18]&254)/2,i=Vc(i,s)),e.B??(e.B=i),i=Vc(i,e.B),a=e.B=i,s!=null&&(a=Vc(s,i))}return e=t[8]+9,n<=e?null:{packetLength:r,Hk:e,pts:i,dts:a}}function Pc(e,t){return(e=Nc(e,t,t.byteLength))?{data:t.subarray(e.Hk),packetLength:e.packetLength,pts:e.pts,dts:e.dts,nalus:[]}:null}r.Gk=function(e){return L(`TsParser.parseAvcNalus`,`Please use parseNalus function instead.`),this.Yg(e,{ee:null,state:null})},r.Yg=function(e,t){var n=e.pts?e.pts/9e4:null;e=e.data;var r=e.byteLength,i=1;this.C==`hvc`&&(i=2);var a=t.state||0,o=a,s=0,c=[],l=-1,u=0,d=this.C===`hvc`;for(a==-1&&(l=0,u=d?e[0]>>1&63:e[0]&31,a=0,s=1);s<r;){var f=e[s++];a?a===1?a=f?0:2:f?f==1?(f=s-a-1,l>=0?c.push({data:e.subarray(l+i,f),fullData:e.subarray(l,f),type:u,time:n,state:null}):(a=c.length?c[c.length-1]:t.ee)&&(o&&s<=4-o&&a.state&&(a.data=a.data.subarray(0,a.data.byteLength-o),a.fullData=a.fullData.subarray(0,a.fullData.byteLength-o)),f>0&&(f=e.subarray(0,f),a.data=z(a.data,f),a.fullData=z(a.fullData,f),a.state=0)),s<r?(u=d?e[s]>>1&63:e[s]&31,l=s,a=0):a=-1):a=0:a=3:a=+!f}return l>=0&&a>=0&&c.push({data:e.subarray(l+i,r),fullData:e.subarray(l,r),type:u,time:n,state:a}),!c.length&&t.ee&&(n=c.length?c[c.length-1]:t.ee)&&(n.data=z(n.data,e),n.fullData=z(n.fullData,e)),t.state=a,c},r.getMetadata=function(){for(var e=[],t=0;t<this.o.length;t++){var n=Mc(this.u,this.o,t);(n=Pc(this,n))&&e.push({cueTime:n.pts?n.pts/9e4:null,data:n.data,frames:_c(n.data),dts:n.dts,pts:n.pts})}return e},r.rb=function(){if(this.i.length&&!this.h.length)for(var e=0;e<this.i.length;e++){var t=Mc(this.l,this.i,e),n=Pc(this,t),r=this.h.length?this.h[this.h.length-1]:null;n&&n.pts!=null&&n.dts!=null&&(!r||r.pts!=n.pts&&r.dts!=n.dts)?this.h.push(n):this.h.length&&(t=n?n.data:t)&&(r=this.h[this.h.length-1],r.data=z(r.data,t))}return this.h},r.od=function(e){if(e=e===void 0||e,this.j.length&&!this.g.length){for(var t=0;t<this.j.length;t++){var n=Mc(this.m,this.j,t),r=Pc(this,n),i=this.g.length?this.g[this.g.length-1]:null;r&&r.pts!=null&&r.dts!=null&&(!i||i.pts!=r.pts&&i.dts!=r.dts)?this.g.push(r):this.g.length&&(n=r?r.data:n)&&(i=this.g[this.g.length-1],i.data=z(i.data,n))}if(e){for(t={ee:null,state:null},i=[],n=g(this.g),r=n.next();!r.done;r=n.next())r=r.value,r.nalus=this.Yg(r,t),r.nalus.length&&(i.push(r),t.ee=r.nalus[r.nalus.length-1]);this.g=i}}return e?this.g:(e=this.g,this.g=[],e)};function Fc(e,t){if(t==`audio`){t=e.l;var n=e.i}else if(t==`video`)t=e.m,n=e.j;else return null;for(var r=0;r<n.length;r++){var i=n[r],a=r+1<n.length?n[r+1]:t.length,o=t[i];if(o){for(var s=0,c=i;c<a;c++)s+=t[c].byteLength;if(i=o.byteLength>=9&&o.byteLength>=Ic(o)?o:Et(t,i,a),(s=Nc(e,i,s))&&(s=Lc(s),s!=null))return s}}return null}function Ic(e){return e=e[7],e&64?19:e&192?14:9}function Lc(e){return e.pts==null||e.dts==null?null:Math.min(e.dts,e.pts)/9e4}r.getStartTime=function(e){if(e==`audio`)e=this.rb();else if(e==`video`)e=this.od(!1);else return null;return e.length?Lc(e[0]):null},r.Td=function(){return{audio:this.G,video:this.C}},r.Ze=function(){for(var e=[],t=g(this.od()),n=t.next();!n.done;n=t.next())e.push.apply(e,_(n.value.nalus));return e},r.fk=function(){L(`TsParser.getVideoResolution`,`Please use getVideoInfo function instead.`);var e=this.Jg();return{height:e.height,width:e.width}},r.Jg=function(){return this.C==`hvc`?Bc(this):zc(this)};function Rc(e){var t=e.od();return t.length>1&&(e=t[0].pts,t=t[1].pts,!isNaN(t-e))?String(Math.abs(1/(t-e)*9e4)):null}function zc(e){var t={height:null,width:null,codec:null,frameRate:null},n=e.Ze();if(!n.length||(n=n.find(function(e){return e.type==7}),!n))return t;n=new xc(n.data);var r=Oc(n),i=Oc(n),a=Oc(n);if(Ec(n),Wc.includes(r)){var o=U(n);if(o===3&&Cc(n,1),Ec(n),Ec(n),Cc(n,1),W(n)){o=o===3?12:8;for(var s=0;s<o;s++)W(n)&&(s<6?kc(n,16):kc(n,64))}}if(Ec(n),o=U(n),o===0)U(n);else if(o===1)for(Cc(n,1),Ec(n),Ec(n),o=U(n),s=0;s<o;s++)Ec(n);Ec(n),Cc(n,1),o=U(n),s=U(n);var c=wc(n,1);c===0&&Cc(n,1),Cc(n,1);var l=0,u=0,d=0,f=0;return W(n)&&(l=U(n),u=U(n),d=U(n),f=U(n)),t.height=String((2-c)*(s+1)*16-d*2-f*2),t.width=String((o+1)*16-l*2-u*2),t.codec=`avc1.`+(`0`+r.toString(16).toUpperCase()).slice(-2)+(`0`+i.toString(16).toUpperCase()).slice(-2)+(`0`+a.toString(16).toUpperCase()).slice(-2),t.frameRate=Rc(e),t}function Bc(e){var t={height:null,width:null,codec:null,frameRate:null},n=e.Ze();if(!n.length||(n=n.find(function(e){return e.type==33}),!n))return t;var r=new xc(n.fullData,!0);Oc(r),Oc(r),wc(r,4);var i=wc(r,3);W(r);var a=wc(r,2),o=wc(r,1),s=wc(r,5),c=wc(r,32);n=Oc(r);for(var l=Oc(r),u=Oc(r),d=Oc(r),f=Oc(r),p=Oc(r),m=Oc(r),h=[],g=[],_=0;_<i;_++)h.push(W(r)),g.push(W(r));if(i>0)for(_=i;_<8;_++)wc(r,2);for(_=0;_<i;_++)h[_]&&wc(r,88),g[_]&&Oc(r);U(r),i=U(r),i==3&&wc(r,1),h=U(r),g=U(r);var v=_=0,y=0,b=0;return W(r)&&(_+=U(r),v+=U(r),y+=U(r),b+=U(r)),t.width=String(h-(_+v)*(i===1||i===2?2:1)),t.height=String(g-(y+b)*(i===1?2:1)),r=function(e){for(var t=0,n=0;n<32;n++)t|=(e>>n&1)<<31-n;return t>>>0}(c),o=o==1?`H`:`L`,a=`hvc1`+(`.`+[``,`A`,`B`,`C`][a]+s),a+=`.`+r.toString(16).toUpperCase(),a+=`.`+o+m,p&&(a+=`.`+p.toString(16).toUpperCase()),f&&(a+=`.`+f.toString(16).toUpperCase()),d&&(a+=`.`+d.toString(16).toUpperCase()),u&&(a+=`.`+u.toString(16).toUpperCase()),l&&(a+=`.`+l.toString(16).toUpperCase()),n&&(a+=`.`+n.toString(16).toUpperCase()),t.codec=a,t.frameRate=Rc(e),t}function Vc(e,t){var n=1;for(e>t&&(n=-1);Math.abs(t-e)>4294967296;)e+=n*8589934592;return e}function Hc(e){return!(Uc(e)<0)}function Uc(e){for(var t=Math.min(1e3,e.length-564),n=0;n<t;){if(e[n]==71&&e[n+188]==71&&e[n+376]==71)return n;var r=e.indexOf(71,n+1);n=r>=0&&r<t?r:n+1}return-1}P(`shaka.util.TsParser`,jc),jc.syncOffset=Uc,jc.probe=Hc,jc.prototype.getVideoInfo=jc.prototype.Jg,jc.prototype.getVideoResolution=jc.prototype.fk,jc.prototype.getVideoNalus=jc.prototype.Ze,jc.prototype.getCodecs=jc.prototype.Td,jc.prototype.getStartTime=jc.prototype.getStartTime,jc.prototype.getVideoData=jc.prototype.od,jc.prototype.getAudioData=jc.prototype.rb,jc.prototype.getMetadata=jc.prototype.getMetadata,jc.prototype.parseNalus=jc.prototype.Yg,jc.prototype.parseAvcNalus=jc.prototype.Gk,jc.prototype.parse=jc.prototype.parse,jc.prototype.setDiscontinuitySequence=jc.prototype.Gf,jc.prototype.clearData=jc.prototype.clearData,jc.Timescale=9e4;var Wc=[100,110,122,244,44,83,86,118,128,138,139,134];function Gc(e,t,n,r,i){var a=this;this.g=e,this.O=n,this.B=r,this.aa=t,this.l=/* @__PURE__ */ new Map,this.D=/* @__PURE__ */ new Map,this.Ka=/* @__PURE__ */ new Map,this.h=null,this.Ha=!1,this.C=i||null,this.m=/* @__PURE__ */ new Map,this.u=new I,this.j=/* @__PURE__ */ new Map,this.J=null,this.M=new oa,this.Ca=``,this.ib=!1,this.za=!0,this.N=!1,this.K=this.W=null,this.i=Kc(this,this.M),this.Ua=this.H=!1,this.G=new Ma(function(){return Yc(a)}),this.I=!1,this.R=`UNKNOWN`,this.eb=this.hb=!1,this.ab=new oa,this.o=!1,this.ya=null,this.Z=/* @__PURE__ */ new Map,this.qa=this.S=this.ua=this.U=null,this.ia=new oa,this.g.remote&&(this.N=this.g.remote.state!=`disconnected`,this.u.F(this.g.remote,`connect`,function(){a.N=a.g.remote.state!=`disconnected`}),this.u.F(this.g.remote,`connecting`,function(){a.N=a.g.remote.state!=`disconnected`}),this.u.F(this.g.remote,`disconnect`,function(){a.N=a.g.remote.state!=`disconnected`}))}function Kc(t,n){if(t.za=!0,e.ManagedMediaSource){t.K||(t.g.disableRemotePlayback=!0);var r=new ManagedMediaSource;t.u.F(r,`startstreaming`,function(){t.za=!0}),t.u.F(r,`endstreaming`,function(){t.za=!1})}else r=new MediaSource;return t.u.Ba(r,`sourceopen`,function(){URL.revokeObjectURL(t.Ca),n.resolve()}),t.u.Ba(t.g,`playing`,function(){t.ib=!0}),t.Ca=Pl(r),Xc(t),t.B.useSourceElements?(t.W=ac(t.Ca),t.g.appendChild(t.W),t.K&&t.g.appendChild(t.K),t.g.load()):t.g.src=t.Ca,r}function qc(t,n,r){t.g&&e.ManagedMediaSource&&t.i&&t.B.useSourceElements&&(t.K?.parentElement===t.g&&t.g.removeChild(t.K),t.K=ac(n,r),t.g.appendChild(t.K),t.g.disableRemotePlayback=!1)}function Jc(){var e=`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="hvc1.2.20000000.L153.B0",video/mp4; codecs="hvc1.2.4.L120.b0",video/mp4; codecs="hvc1.2.4.L123.b0",video/mp4; codecs="vp9",video/mp4; codecs="vp09.00.10.08",video/mp4; codecs="av01.0.01M.08",video/mp4; codecs="av01.0.31M.10.0.111.09.16.09.0",video/mp4; codecs="av01.0.31M.10.0.112.09.18.09.0",video/mp4; codecs="dvh1.05.01",video/mp4; codecs="dvh1.08.01",video/mp4; codecs="dav1.10.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.03",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(_(zr)),t={};we(),e=g(e);for(var n=e.next();!n.done;n=e.next()){if(n=n.value,Ur(n))t[n]=!0;else if($x()){var r=Fr(n),i=Oi(Ir(n),r);r=kr(r,i),t[n]=Qo(r)||!!Sr(r)}else t[n]=cc().canPlayType(n)!=``;r=n.split(`;`)[0],t[r]=t[r]||t[n]}return t}r=Gc.prototype,r.destroy=function(){return this.G.destroy()};function Yc(e){var t,n,r,i,a,o,s,c,l,u,d,f,p,m,h;return k(function(_){if(_.h==1){for(t=[],n=g(e.m),r=n.next();!r.done;r=n.next())for(i=r.value,a=g(i),o=a.next().value,s=a.next().value,c=s[0],l=o,e.m.set(l,s.slice(0,1)),c&&t.push(c.p.catch(ni)),u=g(s.slice(1)),d=u.next();!d.done;d=u.next())f=d.value,f.p.reject(new R(2,7,7003,void 0));return e.h&&t.push(e.h.destroy()),_.g(Promise.all(t),2)}for(p=g(e.j.values()),m=p.next();!m.done;m=p.next())h=m.value,h.destroy();e.u&&(e.u.release(),e.u=null),e.g&&(Xc(e),e.g.load(),e.g.disableRemotePlayback=!1),e.g=null,e.W=null,e.K=null,e.B=null,e.i=null,e.h=null,e.aa=null,e.l.clear(),e.Ka.clear(),e.j.clear(),e.J=null,e.m.clear(),e.C=null,e.Z.clear(),e.O=null,_.j()})}function Xc(e){e.g&&(e.g.removeAttribute(`src`),e.W?.parentElement===e.g&&e.g.removeChild(e.W),e.K?.parentElement===e.g&&e.g.removeChild(e.K))}r.init=function(e,t,n,r){t=t!==void 0&&t,n=n===void 0?`UNKNOWN`:n,r=r!==void 0&&r;var i=this,a,o,s,c,l,u;return k(function(d){if(d.h==1)return a=Pt,d.g(i.M,2);if(d.h!=3)return!el(i)&&!tl(i)?d.A(3):(ce(`Expected MediaSource to be open during init(); reopening the media source.`),i.M=new oa,i.i=Kc(i,i.M),d.g(i.M,3));for(i.I=t,i.R=n,i.hb=r,i.eb=!i.I&&i.R==`HLS`&&!i.hb,i.Z.clear(),i.U=null,i.ua=null,i.S=null,i.qa=null,i.ia=new oa,o=g(e.keys()),s=o.next();!s.done;s=o.next())c=s.value,l=e.get(c),Zc(i,c,l,l.codecs),i.o?(i.m.set(a.$,[]),i.m.set(a.wa,[])):i.m.set(c,[]);(u=e.get(a.$))&&u.isAudioMuxedInVideo&&(i.o=!0),d.j()})};function Zc(e,t,n,r){t==`audio`&&r&&(r=Oi(r,n.mimeType)),t==`video`&&r&&n.mimeType==`video/mp4`&&(r=ki(r));var i=kr(n.mimeType,r);if(t==Nt)$c(e,i,e.I,n.external);else{var a=e.B.forceTransmux;(!Qo(i)||!e.I&&zr.includes(i))&&(a=!0);var o=Ar(n.mimeType,r);if(a){if(a=jt(`audio`,(r||``).split(`,`)),r=jt(`video`,(r||``).split(`,`)),a&&r){e.o=!0,Zc(e,`audio`,n,a),Zc(e,`video`,n,r);return}(r=Sr(o))&&(i=r(),e.j.set(t,i),i=i.convertCodecs(t,o))}o=i+e.B.addExtraFeaturesToSourceBuffer(i),Na(e.G);try{var s=e.i.addSourceBuffer(o)}catch(t){throw new R(2,3,3015,t,`The mediaSource_ status was `+e.i.readyState+` expected 'open'`,null)}e.I&&(s.mode=Fl),e.u.F(s,`error`,function(){var n=e.m.get(t)[0];n.p.reject(new R(2,3,3014,e.g.error?e.g.error.code:0,n.uri))}),e.u.F(s,`updateend`,function(){return bl(e,t)}),e.l.set(t,s),e.D.set(t,i),e.Ka.set(t,!!n.drmInfos.length)}}r.configure=function(e){this.B=e,this.h&&(this.h.C=e.modifyCueCallback)};function Qc(e){return e.za&&!e.N&&!e.H}function $c(e,t,n,r){e.h||(e.h=new Br(e.aa),e.h&&(e.h.C=e.B.modifyCueCallback));var i=e.h,a=e.Ha;e=e.R,t==`application/cea-608`||t==`application/cea-708`?i.i=null:(i.i=Zr.get(t)(),i.i.setSequenceMode?i.i.setSequenceMode(n):L(`Text parsers w/ setSequenceMode`,`Text parsers should have a "setSequenceMode" method!`),i.i.setManifestType?i.i.setManifestType(e):L(`Text parsers w/ setManifestType`,`Text parsers should have a "setManifestType" method!`),i.G=a,i.B=r)}function el(e){return e.H?!1:!e.i||e.i.readyState==`ended`}function tl(e){return e.H?!1:!e.i||e.i.readyState==`closed`}function nl(e,t){return e.l.size?t==Nt?e.h.g:Qs(al(e,t)):null}function rl(e,t){return e.l.size?t==Nt?e.h.h:$s(al(e,t)):null}function il(e,t,n){return t==Nt?(e=e.h,e.h==null||e.h<n?0:e.h-Math.max(n,e.g)):(e=al(e,t),tc(e,n))}r.Cc=function(){var e={total:this.H?[]:rc(this.g.buffered),audio:rc(al(this,`audio`)),video:rc(al(this,`video`)),text:[]};if(this.h){var t=this.h.g,n=this.h.h;t!=null&&n!=null&&e.text.push({start:t,end:n})}return e};function al(e,t){if(e.H||e.N||tl(e))return null;try{return e.l.get(t).buffered}catch{return e.l.has(t),null}}function ol(e,t,n,r,i,a,o){o=o!==void 0&&o;var s=null,c=[],l=Ze(n);if(zr.includes(a))n=_c(l),n.length&&r&&((o=n.find(function(e){return e.description===`com.apple.streaming.transportStreamTimestamp`}))&&typeof o.data==`number`&&(s=Math.round(o.data)/1e3),e.O.onMetadata([{cueTime:r.startTime,data:l,frames:n,dts:r.startTime,pts:r.startTime}],0,r.endTime));else if(a.includes(`/mp4`)&&r&&r.ba){l=new Va;var u=i.emsgSchemeIdUris!=null&&i.emsgSchemeIdUris.length>0||e.B.dispatchAllEmsgBoxes,d=[];u&&l.ma(`emsg`,function(t){a:{var n=i.emsgSchemeIdUris;if(t.version===0)var a=t.reader.yd(),o=t.reader.yd(),s=t.reader.V(),c=t.reader.V(),l=t.reader.V(),u=t.reader.V(),f=r.startTime+c/s;else s=t.reader.V(),f=t.reader.zd()/s+r.timestampOffset,c=f-r.startTime,l=t.reader.V(),u=t.reader.V(),a=t.reader.yd(),o=t.reader.yd();if(t=t.reader.Nb(t.reader.getLength()-t.reader.Ra(),!0),n&&n.includes(a)||e.B.dispatchAllEmsgBoxes){if(a==`urn:mpeg:dash:event:2012`)e.O.Fk();else{n=f,(a!==`https://aomedia.org/emsg/ID3`||l!==4294967295)&&(n+=l/s),s={startTime:f,endTime:n,schemeIdUri:a,value:o,timescale:s,presentationTimeDelta:c,eventDuration:l,id:u,messageData:t};break a}}s=null}s&&d.push(s)});var f=r.ba.timescale;t=f&&!isNaN(f);var p=0,m=!1;for(t&&l.ma(`prft`,function(t){var n=t.reader,r=t.version;n.V(),t=n.V();var i=n.V();t=t*1e3+i/4294967296*1e3,r===0?n=n.V():(r=n.V(),n=n.V(),n=r*4294967296+n),t=bc(t),n=(/* @__PURE__ */ new Map()).set(`detail`,{wallClockTime:t,programStartDate:/* @__PURE__ */ new Date(t-n/f*1e3)}),n=new V(`prft`,n),e.O.onEvent(n)}).boxes([`moof`,`traf`],Ha).ma(`tfdt`,function(e){m||(p=ns(e.reader,e.version).baseMediaDecodeTime/f,m=!0,u||e.parser.stop())}),(u||t)&&l.parse(n,!1,o),m&&r.timestampOffset==0&&(s=p),l=g(d),n=l.next();!n.done;n=l.next())sl(e,n.value,r,s)}else a.includes(`/mp4`)||a.includes(`/webm`)||!Hc(l)||(e.Z.has(t)||e.Z.set(t,new jc),c=e.Z.get(t),c.clearData(),c.Gf(r.i),c.parse(l),l=Fc(c,t),l!=null&&(s=l),c=c.getMetadata());return{timestamp:s,metadata:c}}function sl(e,t,n,r){var i=yc(t.startTime,n.startTime+t.presentationTimeDelta/t.timescale);r&&e.R==`HLS`&&!i&&(n=-r+n.startTime,t.startTime+=n,t.endTime+=n),e.O.Dk(t),!t.messageData||t.schemeIdUri!=`https://aomedia.org/emsg/ID3`&&t.schemeIdUri!=`https://developer.apple.com/streaming/emsg-id3`||(n=_c(t.messageData),n.length&&(r=t.startTime,e.O.onMetadata([{cueTime:r,data:t.messageData,frames:n,dts:r,pts:r}],0,t.endTime)))}function cl(e,t,n,r,i,a,o,s,c,l,u){o=o!==void 0&&o,s=s!==void 0&&s,c=c!==void 0&&c,l=l!==void 0&&l;var d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,A,j;return k(function(k){switch(k.h){case 1:if(d=Pt,t!=d.Pa){k.A(2);break}if(e.R!=`HLS`){k.A(3);break}return k.g(e.ab,4);case 4:f=k.i,e.h.u=f;case 3:return k.g(Wr(e.h,n,r?r.startTime:null,r?r.endTime:null,r?r.P()[0]:null),5);case 5:return k.return();case 2:if(l||!e.o){k.A(6);break}return k.g(cl(e,d.$,n,r,i,a,o,s,c,!0),7);case 7:return k.g(cl(e,d.wa,n,r,i,a,o,s,c,!0),8);case 8:return k.return();case 6:if(!e.l.has(t))return k.return();if(p=e.l.get(t).timestampOffset,m=e.D.get(t),e.j.has(t)&&(m=e.j.get(t).getOriginalMimeType()),r&&(h=ol(e,t,n,r,i,m,c),g=h.timestamp,_=h.metadata,g!=null&&(e.U==null&&t==d.wa&&(e.U=g,e.ua=r.startTime,e.S!=null&&(v=0,e.ua==e.qa&&(v=e.U-e.S),e.ia.resolve(v))),e.S==null&&t==d.$&&(e.S=g,e.qa=r.startTime,e.U!=null&&(y=0,e.ua==e.qa&&(y=e.U-e.S),e.ia.resolve(y))),b=g,x=zr,!e.I&&x.includes(e.D.get(t))&&(b=0),S=r.startTime-b,C=Math.abs(p-S),(C>=.001||o||s)&&(!c||S>0||!p)&&(p=S,e.eb&&(xl(e,t,function(){return _l(e,t)},null),xl(e,t,function(){return vl(e,t,p)},null))),(t==d.wa||!e.l.has(d.wa))&&e.ab.resolve(p)),_.length)&&e.O.onMetadata(_,p,r?r.endTime:null),a&&t==d.wa&&(e.h||$c(e,`application/cea-608`,e.I,!1),e.J||(w=m.split(`;`,1)[0],e.J=new Jt(w)),r?(T=Yt(e.J,n),T.length&&Jr(e.h,T,p)):e.J.init(n,s,u)),!e.j.has(t)){k.A(9);break}return k.g(e.j.get(t).transmux(n,i,r,e.i.duration,t),10);case 10:E=k.i,ArrayBuffer.isView(E)?n=E:(D=E,D.init!=null&&(O=D.init,xl(e,t,function(){e.C&&Rt(e.C,O,p,i),e.l.get(t).appendBuffer(O)},r?r.P()[0]:null)),n=D.data);case 9:if(n=El(e,i,n,r,t),!r||!e.I||t==d.Pa||!o&&!s){k.A(11);break}if(A=r.startTime,e.R!=`HLS`||e.o||t!=d.$||!e.l.has(d.wa)){k.A(13);break}return k.g(e.ia,14);case 14:j=k.i,Math.abs(j)>.15&&(A-=j);case 13:xl(e,t,function(){return _l(e,t)},null),xl(e,t,function(){return vl(e,t,A)},null);case 11:return k.g(xl(e,t,function(){var r=n;e.C&&Rt(e.C,r,p,i),e.l.get(t).appendBuffer(r)},r?r.P()[0]:null),15);case 15:k.j()}})}function ll(e,t){var n=rl(e,`video`)||0;Kr(e.h,t,n)}function ul(e){e.h&&Kr(e.h,``,0)}r.remove=function(e,t,n,r){var i=this,a,o;return k(function(s){return s.h==1?(a=Pt,e==a.wa&&i.J&&(i.J.remove(r),o=i.h.g||0,i.h.remove(o,n,!0)),e==a.Pa?s.g(i.h.remove(t,n),0):n>t?s.g(xl(i,e,function(){return gl(i,e,t,n)},null),5):s.A(0)):i.o?s.g(xl(i,a.$,function(){return gl(i,a.$,t,n)},null),0):s.A(0)})};function dl(e,t){var n;return k(function(r){return r.h==1?(n=Pt,t==n.Pa?e.h?r.g(e.h.remove(0,1/0),0):r.return():t===n.wa&&e.J&&e.h?r.g(e.h.remove(0,1/0,!0),4):r.A(4)):r.h==6?e.o?r.g(xl(e,n.$,function(){return gl(e,n.$,0,e.i.duration)},null),0):r.A(0):r.g(xl(e,t,function(){return gl(e,t,0,e.i.duration)},null),6)})}r.flush=function(e){var t=this,n;return k(function(r){return r.h==1?(n=Pt,e==n.Pa?r.return():r.g(xl(t,e,function(){t.g.currentTime-=.001,bl(t,e)},null),2)):t.o?r.g(xl(t,n.$,function(){var e=n.$;t.g.currentTime-=.001,bl(t,e)},null),0):r.A(0)})};function fl(e,t,n,r,i,a,o,s,c){var l,u,d;return k(function(f){return f.h==1?(l=Pt,t==l.Pa?(a||(e.h.u=n),Gr(e.h,r,i),f.return()):(u=[],f.g(Ml(e,t,o,s,c),2))):(d=f.i,d||(u.push(xl(e,t,function(){return _l(e,t)},null)),e.o&&u.push(xl(e,l.$,function(){return _l(e,l.$)},null))),a||(u.push(xl(e,t,function(){return vl(e,t,n)},null)),e.o&&u.push(xl(e,l.$,function(){return vl(e,l.$,n)},null))),(r!=0||i!=1/0)&&(u.push(xl(e,t,function(){return yl(e,t,r,i)},null)),e.o&&u.push(xl(e,l.$,function(){return yl(e,l.$,r,i)},null))),u.length?f.g(Promise.all(u),0):f.A(0))})}function pl(e,t,n){var r,i;return k(function(a){return a.h==1?(r=Pt,t==r.Pa||(t==r.wa&&(e.ab=new oa),!e.I||(i=rl(e,t))&&Math.abs(i-n)<.15)?a.return():(xl(e,t,function(){return _l(e,t)},null),e.o&&xl(e,r.$,function(){return _l(e,r.$)},null),a.g(xl(e,t,function(){return vl(e,t,n)},null),2))):e.o?a.g(xl(e,r.$,function(){return vl(e,r.$,n)},null),0):a.A(0)})}r.endOfStream=function(e){var t=this;return k(function(n){return n.g(Sl(t,function(){el(t)||tl(t)||(e?t.i.endOfStream(e):t.i.endOfStream())}),0)})},r.wb=function(e){var t=this;return k(function(n){return n.g(Sl(t,function(){if(t.B.durationReductionEmitsUpdateEnd&&e<t.i.duration)for(var n=g(t.l.keys()),r=n.next();!r.done;r=n.next()){r=r.value;var i={start:function(){},p:new oa,uri:null};t.m.get(r).unshift(i)}t.i.duration=e,t.ya=e}),0)})},r.getDuration=function(){return this.i.duration};function ml(e,t,n){k(function(r){return e.G.g||e.g.error||e.N||e.H||el(e)||tl(e)?r.return():r.g(Sl(e,function(){el(e)||tl(e)||e.i.setLiveSeekableRange(t,n)}),0)})}function hl(e){k(function(t){return e.G.g||e.g.error||e.N||e.H||el(e)||tl(e)?t.return():t.g(Sl(e,function(){el(e)||tl(e)||e.i.clearLiveSeekableRange()}),0)})}function gl(e,t,n,r){if(r<=n)bl(e,t);else{if(e.C){var i=e.C;t===`video`&&i.g&&i.g.flushBuffer(n,r)}e.l.get(t).remove(n,r)}}function _l(e,t){var n=e.l.get(t),r=n.appendWindowStart,i=n.appendWindowEnd;n.abort(),n.appendWindowStart=r,n.appendWindowEnd=i,bl(e,t)}function vl(e,t,n){n<0&&(n+=.001),e.l.get(t).timestampOffset=n,bl(e,t)}function yl(e,t,n,r){var i=e.l.get(t);(i.appendWindowEnd!==r||i.appendWindowStart!==n)&&(i.appendWindowStart=0,i.appendWindowEnd=r,i.appendWindowStart=n),bl(e,t)}function bl(e,t){if(e.H||e.G.g){var n=e.m.get(t);n&&n.length&&((n=n[0])&&n.p&&n.p.resolve(),e.m.set(t,[]))}else(n=e.m.get(t)[0])&&(n.p.resolve(),Cl(e,t))}function xl(e,t,n,r){return Na(e.G),n={start:n,p:new oa,uri:r},e.m.get(t).push(n),e.m.get(t).length==1&&wl(e,t),n.p}function Sl(e,t){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,_,v,y,b;return k(function(x){switch(x.h){case 1:for(Na(e.G),n=[],r=Array.from(e.l.keys()),i=/* @__PURE__ */ new Map,a=g(r),o=a.next(),s={};!o.done;s={ready:void 0},o=a.next())c=o.value,s.ready=new oa,l={start:function(e){return function(){return e.ready.resolve()}}(s),p:s.ready,uri:null},u=e.m.get(c),u.push(l),n.push(s.ready),i.set(c,l),u.length==1&&l.start();return x.m(2),x.g(Promise.all(n),4);case 4:x.o(3);break;case 2:if(d=x.l(),e.G.g){for(f=g(r),p=f.next();!p.done;p=f.next())m=p.value,h=e.m.get(m),i.has(m)&&pe(h,i.get(m));return x.return()}throw d;case 3:return x.m(5,6),x.g(t(),6);case 6:for(x.u(),_=g(r),v=_.next();!v.done;v=_.next())y=v.value,Cl(e,y);x.B(0);break;case 5:throw b=x.l(),new R(2,3,3015,b,e.g.error||`No error in the media element`,null)}})}function Cl(e,t){e.m.get(t).shift(),wl(e,t)}function wl(e,t){var n=e.m.get(t)[0];if(n)try{n.start()}catch(r){r.name==`QuotaExceededError`?n.p.reject(new R(2,3,3017,t)):Qc(e)?n.p.reject(new R(2,3,3015,r,e.g.error||`No error in the media element`,n.uri)):n.p.reject(new R(2,3,3024,t)),Cl(e,t)}}function Tl(e,t){e.aa=t,e.h&&(e.h.l=t)}function El(e,t,n,r,i){if(Mr(e.D.get(i))!=`mp4`)return n;var a=r===null,o=e.Ka.get(i),s=e.O.Nj(),c=!1;r&&r.ba&&(c=r.ba.encrypted),r=r?r.P()[0]:null;var l=we();return e.B.correctEc3Enca&&a&&i===`audio`&&(n=Ls(n)),e.B.insertFakeEncryptionInInit&&o&&l.Bd(s,i)&&(a?n=Rs(t,n,r):!c&&l.Ji(i)&&(n=zs(n))),a&&l.le()&&(n=Ws(n)),n}function Dl(e,t,n,r){return xl(e,t,function(){if(t!==Nt){if(e.D.get(t),we().xb()){e.j.has(t)&&(e.j.get(t).destroy(),e.j.delete(t)),r&&e.j.set(t,r);var i=n+e.B.addExtraFeaturesToSourceBuffer(n);e.l.get(t).changeType(i),e.D.set(t,n)}bl(e,t)}},null)}function Ol(e,t){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,_,v,y,b,x,S;return k(function(C){if(C.h==1){if(e.H||e.N)return C.return();for(n=Pt,e.H=!0,e.o=!1,r=e.g.currentTime,i=e.g.autoplay,e.g.paused||(e.Ua=!0),e.ib&&(e.g.autoplay=!1),C.D(2),e.u.Sa(),a=g(e.j.values()),o=a.next();!o.done;o=a.next())s=o.value,s.destroy();for(c=g(e.l.values()),l=c.next();!l.done;l=c.next()){u=l.value;try{e.i.removeSourceBuffer(u)}catch{}}return e.j.clear(),e.l.clear(),d=e.i.duration,e.M=new oa,e.i=Kc(e,e.M),C.g(e.M,4)}if(C.h!=2){for(!isNaN(d)&&d?e.i.duration=d:!isNaN(e.ya)&&e.ya&&(e.i.duration=e.ya),f=new oa,p=e.i.sourceBuffers,m=t.size,h=0,_=function(){h++,h===m&&(f.resolve(),e.u.Oa(p,`addsourcebuffer`,_))},e.u.F(p,`addsourcebuffer`,_),v=g(t.keys()),y=v.next();!y.done;y=v.next())b=y.value,x=t.get(b),Zc(e,b,x,x.codecs);return(S=t.get(n.$))&&S.isAudioMuxedInVideo&&(e.o=!0),e.o&&!e.m.has(n.$)&&e.m.set(n.$,[]),C.g(f,2)}return C.u(),e.H=!1,Na(e.G),e.u.Ba(e.g,`loadedmetadata`,function(){e.G.g||(e.g.currentTime=r)}),e.u.Ba(e.g,`canplaythrough`,function(){e.G.g||(e.g.autoplay=i,e.Ua&&(e.Ua=!1,e.g.play()))}),C.B(0)})}function kl(e,t){return Sl(e,function(){return Ol(e,t)})}function Al(e,t,n,r){var i=!1,a=jt(`audio`,(r||``).split(`,`)),o=jt(`video`,(r||``).split(`,`)),s=o;t==`audio`&&(s=a),s||(s=r);var c=kr(n,s),l=Fr(e.D.get(t)),u=e.B.forceTransmux;if(!Qo(c)||!e.I&&zr.includes(c)?u=!0:u||n==l||(u=!we().Jf()&&zr.includes(n)),u&&(e=Ar(n,s),s=Sr(e))){var d=s();a&&o&&(i=!0),c=d.convertCodecs(t,e)}return!d&&t===`video`&&a&&(c=kr(n,r)),t=Nr(Ir(c)),{ec:d,jl:i,Qh:Fr(c),codec:t,mimeType:c}}function jl(e,t,n,r,i){if(t==Nt)return{type:Il,tf:n,ec:null};var a=Nr(Ir(e.D.get(t))),o=Fr(e.D.get(t)),s=Al(e,t,n,r),c=s.ec,l=s.jl,u=s.Qh,d=s.codec;s=s.mimeType;var f=!0;return l&&e.D.has(`audio`)&&(n=Al(e,`audio`,n,r),r=Nr(Ir(e.D.get(`audio`))),f=Fr(e.D.get(`audio`)),f=r==n.codec&&f==n.Qh,n.ec&&n.ec.destroy()),a===d&&o===u&&f?{type:Il,tf:s,ec:c}:(a=!0,(e.o&&!i.has(`audio`)||l&&c&&!e.j.has(t))&&(a=!1),t=we(),a&&e.B.codecSwitchingStrategy===`smooth`&&t.xb()?{type:Rl,tf:s,ec:c}:(c&&c.destroy(),{type:Ll,tf:s,ec:null}))}function Ml(e,t,n,r,i){var a,o,s,c,l,u;return k(function(d){return d.h==1?(a=Pt,o=jl(e,t,n,r,i),s=o.type,c=o.ec,l=o.tf,(u=i.get(a.$))&&(e.o=u.isAudioMuxedInVideo),s==Il?(e.j.has(t)&&!c?(e.j.get(t).destroy(),e.j.delete(t)):!e.j.has(t)&&c?e.j.set(t,c):c&&(e.j.has(t)&&e.j.get(t).transmux!==c.transmux?(e.j.get(t).destroy(),e.j.set(t,c)):c.destroy()),d.return(!1)):s==Rl?d.g(Dl(e,t,l,c),3):s==Ll?(c&&c.destroy(),d.g(kl(e,i),3)):d.A(3)):d.return(!0)})}function Nl(e,t,n,r,i){return e=jl(e,t,n,r,i),e.ec&&e.ec.destroy(),e.type==Ll}var Pl=e.URL.createObjectURL,Fl=`sequence`,Il=`none`,Ll=`reset`,Rl=`changeType`;function G(e,t,n){this.i=e,this.D=t,this.u=this.l=1/0,this.h=1,this.g=this.j=null,this.B=0,this.C=!0,this.J=!1,this.I=0,this.G=n===void 0||n,this.H=0,this.o=!1,this.m=e}r=G.prototype,r.getDuration=function(){return this.l},r.Pj=function(){return this.h},r.Si=function(e){this.i=e},r.wb=function(e){this.l=e},r.Uj=function(){return this.i},r.Ri=function(e){this.B=e},r.Vc=function(e){e&&!this.C&&(this.J=!0),this.C=e},r.Hf=function(e){this.u=e},r.Ye=function(){return this.u},r.qh=function(e){this.D=e},r.Hj=function(){return this.D},r.Di=function(e,t){if(e.length!=0){var n=(Date.now()+this.B)/1e3;if(e=e.filter(function(e){return e.start+t<n}),e.length!=0){var r=e[e.length-1].end+t;this.uf(e[0].start+t),this.h=e.reduce(function(e,t){return Math.max(e,t.end-t.start)},this.h),this.g=Math.max(this.g,r),this.i!=null&&this.G&&!this.o&&(this.i=n-this.g-this.h)}}},r.fe=function(e){if(e.length!=0){var t=e[0].startTime,n=e[0].endTime,r=(Date.now()+this.B)/1e3;e=g(e);for(var i=e.next();!i.done;i=e.next())i=i.value,r<i.startTime||(t=Math.min(t,i.startTime),n=Math.max(n,i.endTime),this.h=Math.max(this.h,i.endTime-i.startTime));this.uf(t),this.g=Math.max(this.g,n),this.i!=null&&this.G&&!this.o&&(this.i=r-this.g-this.h)}},r.Ci=function(e,t){this.uf(e),t==1/0||this.T()||(this.g=Math.max(this.g,t))},r.Qj=function(){return this.g},r.mf=function(){this.o=!0},r.rk=function(){return this.o},r.rh=function(e){this.m=e},r.Mj=function(){return this.m},r.uf=function(e){this.j==null?this.j=e:this.J||(this.j=Math.min(this.j,e))},r.Ug=function(e){this.h=Math.max(this.h,e)},r.offset=function(e){this.j!=null&&(this.j+=e),this.g!=null&&(this.g+=e)},r.T=function(){return this.l==1/0&&!this.C},r.Pc=function(){return this.l!=1/0&&!this.C},r.Fb=function(){return Math.max(this.I,this.Ec()-this.u)},r.Vi=function(e){this.I=e},r.Ec=function(){return this.T()||this.Pc()?Math.min(Math.max(0,(Date.now()+this.B)/1e3-this.h-this.i)+this.H,this.l):this.g?Math.min(this.g,this.l):this.l},r.Wd=function(e){var t=Math.max(this.j,this.I);return this.u==1/0?Math.ceil(t*1e3)/1e3:Math.max(t,Math.min(this.Ec()-this.u+e,this.Eb()))},r.Ub=function(){return this.Wd(0)},r.Eb=function(){return Math.max(0,this.Ec()-(this.T()||this.Pc()?this.D:0))},r.ij=function(){return!(this.i==null||this.g!=null&&this.G)},r.Qi=function(e){this.H=e},r.Cj=function(){return this.H},P(`shaka.media.PresentationTimeline`,G),G.prototype.getAvailabilityTimeOffset=G.prototype.Cj,G.prototype.setAvailabilityTimeOffset=G.prototype.Qi,G.prototype.usingPresentationStartTime=G.prototype.ij,G.prototype.getSeekRangeEnd=G.prototype.Eb,G.prototype.getSeekRangeStart=G.prototype.Ub,G.prototype.getSafeSeekRangeStart=G.prototype.Wd,G.prototype.getSegmentAvailabilityEnd=G.prototype.Ec,G.prototype.setUserSeekStart=G.prototype.Vi,G.prototype.getSegmentAvailabilityStart=G.prototype.Fb,G.prototype.isInProgress=G.prototype.Pc,G.prototype.isLive=G.prototype.T,G.prototype.offset=G.prototype.offset,G.prototype.notifyMaxSegmentDuration=G.prototype.Ug,G.prototype.notifyMinSegmentStartTime=G.prototype.uf,G.prototype.getInitialProgramDateTime=G.prototype.Mj,G.prototype.setInitialProgramDateTime=G.prototype.rh,G.prototype.isStartTimeLocked=G.prototype.rk,G.prototype.lockStartTime=G.prototype.mf,G.prototype.getMaxSegmentEndTime=G.prototype.Qj,G.prototype.notifyPeriodDuration=G.prototype.Ci,G.prototype.notifySegments=G.prototype.fe,G.prototype.notifyTimeRange=G.prototype.Di,G.prototype.getDelay=G.prototype.Hj,G.prototype.setDelay=G.prototype.qh,G.prototype.getSegmentAvailabilityDuration=G.prototype.Ye,G.prototype.setSegmentAvailabilityDuration=G.prototype.Hf,G.prototype.setStatic=G.prototype.Vc,G.prototype.setClockOffset=G.prototype.Ri,G.prototype.getPresentationStartTime=G.prototype.Uj,G.prototype.setDuration=G.prototype.wb,G.prototype.setPresentationStartTime=G.prototype.Si,G.prototype.getMaxSegmentDuration=G.prototype.Pj,G.prototype.getDuration=G.prototype.getDuration;function zl(e,t,n,r){var i=this;this.u=r,this.g=e,this.D=t,this.h=n,this.l=new I,this.o=!1,this.m=0,this.C=!1,this.H=this.G=0,this.j=Hl(this),this.B=!1,this.l.F(e,`waiting`,function(){return Bl(i)}),this.i=new Qr(function(){Bl(i)}).Fa(this.h.gapJumpTimerTime)}zl.prototype.release=function(){this.l&&(this.l.release(),this.l=null),this.i!=null&&(this.i.stop(),this.i=null),this.j&&(this.j.release(),this.j=null),this.g=this.D=this.u=null},zl.prototype.ud=function(){this.B=!0,this.i&&this.i.Fa(this.h.gapJumpTimerTime),Bl(this)};function Bl(e){if(e.g.readyState!=0){if(e.g.seeking){if(!e.o)return}else e.o=!1;if((!e.g.paused||e.g.currentTime==e.m&&(e.g.autoplay||e.g.currentTime!=e.m))&&(!e.j||!Wl(e.j))){var t=e.g.currentTime,n=e.g.buffered,r=nc(n,t,e.h.gapDetectionThreshold);if(r==null&&e.j&&!Wl(e.j)){for(var i=rc(n),a=0;a<i.length-1;a++)if(Math.abs(t-i[a].end)<.1&&i[a+1].start>i[a].end){r=a+1;break}}r==null||r==0&&!e.B||(i=n.start(r),(a=e.h.gapPadding)&&(i=Math.ceil((i+a)*100)/100),i>=e.D.Eb()||i-t<.001||(r!=0&&n.end(r-1),Vl(e,i),t==e.m&&(e.m=i),e.G++,e.u(new V(`gapjumped`))))}}}function Vl(e,t){e.C=!0,e.l.Ba(e.g,`seeked`,function(){e.C=!1}),e.g.currentTime=t}function Hl(e){if(!e.h.stallEnabled)return null;var t=e.h.stallThreshold,n=e.h.stallSkip;return new Ul(new Gl(e.g),t,function(t,r,i){var a;return k(function(t){if(t.h==1)return a=rc(e.g.buffered),a.length?n?(e.g.currentTime+=n,t.A(2)):t.g(e.g.play(),3):t.return();if(t.h!=2){if(!e.g)return t.return();e.g.pause(),e.g.play()}i==0&&(e.H++,e.u(new V(`stalldetected`))),t.j()})})}function Ul(e,t,n){this.i=e,this.u=Kl(e),this.h=e.g.currentTime,this.m=Date.now()/1e3,this.l=this.g=0,this.o=t,this.j=n}Ul.prototype.release=function(){this.i&&this.i.release(),this.j=this.i=null};function Wl(e){var t=e.i,n=Kl(t),r=t.g.currentTime,i=Date.now()/1e3;return(e.h!=r||e.u!=n)&&(e.m=i,e.h=r,e.u=n,e.g=0),r=i-e.m,(n=r>=e.o&&n&&e.g<3&&(e.g==0||i-e.l>=e.o))&&(e.j&&e.j(e.h,r,e.g),e.g++,e.l=i,e.h=t.g.currentTime),n}function Gl(e){var t=this;this.g=e,this.h=new I,this.i=!1,this.h.F(this.g,`audiofocuspaused`,function(){t.i=!0}),this.h.F(this.g,`audiofocusgranted`,function(){t.i=!1}),this.h.F(this.g,`audiofocuslost`,function(){t.i=!0})}function Kl(e){if(e.g.paused||e.g.playbackRate==0||e.i||e.g.buffered.length==0)var t=!1;else a:{t=e.g.currentTime,e=g(rc(e.g.buffered));for(var n=e.next();!n.done;n=e.next())if(n=n.value,!(t<n.start-.1||t>n.end-.5)){t=!0;break a}t=!1}return t}Gl.prototype.release=function(){this.h&&this.h.release(),this.h=null};function ql(e,t,n,r){t==HTMLMediaElement.HAVE_NOTHING||e.readyState>=t?r():(t=Jl.value().get(t),n.Ba(e,t,r))}var Jl=new Ce(function(){return/* @__PURE__ */ new Map([[HTMLMediaElement.HAVE_METADATA,`loadedmetadata`],[HTMLMediaElement.HAVE_CURRENT_DATA,`loadeddata`],[HTMLMediaElement.HAVE_FUTURE_DATA,`canplay`],[HTMLMediaElement.HAVE_ENOUGH_DATA,`canplaythrough`]])});function Yl(e,t,n,r){var i=this;this.g=e,this.m=t,this.u=n,this.l=null,this.j=function(){return i.l??(i.l=r()),i.l},this.o=!1,this.h=new I,this.i=new eu(e),ql(this.g,HTMLMediaElement.HAVE_METADATA,this.h,function(){Ql(i,i.j())})}Yl.prototype.release=function(){this.h&&(this.h.release(),this.h=null),this.i!=null&&(this.i.release(),this.i=null),this.m=function(){},this.g=null};function Xl(e){return e.o?e.g.currentTime:e.j()}function Zl(e,t){e.g.readyState>0?tu(e.i,t):ql(e.g,HTMLMediaElement.HAVE_METADATA,e.h,function(){Ql(e,e.j())})}function Ql(e,t){Math.abs(e.g.currentTime-t)<.001?$l(e):(e.h.Ba(e.g,`seeking`,function(){$l(e)}),tu(e.i,e.g.currentTime&&e.g.currentTime!=0?e.g.currentTime:t))}function $l(e){e.o=!0,e.h.F(e.g,`seeking`,function(){return e.m()}),e.u(e.g.currentTime)}function eu(e){var t=this;this.g=e,this.m=10,this.j=this.l=this.i=0,this.h=new Qr(function(){t.i<=0||t.g.currentTime!=t.l||t.g.currentTime===t.j?t.h.stop():(t.g.currentTime=t.j,t.i--)})}eu.prototype.release=function(){this.h&&(this.h.stop(),this.h=null),this.g=null};function tu(e,t){e.l=e.g.currentTime,e.j=t,e.i=e.m,e.g.currentTime=t,e.h.Fa(.1)}function nu(e){this.g=e,this.i=!1,this.h=null,this.j=new I}r=nu.prototype,r.ready=function(){function e(){if(t.h==null||t.h==0&&t.g.duration!=1/0)t.i=!0;else{var e=t.g.currentTime,n=null;if(typeof t.h==`number`)n=t.h;else if(t.h instanceof Date){var r=ru(t);r!==null&&(n=t.h.getTime()/1e3-r,n=iu(t,n))}n==null?t.i=!0:(n<0&&(n=Math.max(0,e+n)),e==n?t.i=!0:(t.j.Ba(t.g,`seeking`,function(){t.i=!0}),t.g.currentTime=n))}}var t=this;ql(this.g,HTMLMediaElement.HAVE_FUTURE_DATA,this.j,function(){e()})},r.release=function(){this.j&&(this.j.release(),this.j=null),this.g=null},r.Vf=function(e){this.h=this.i?this.h:e},r.Ld=function(){var e=this.i?this.g.currentTime:this.h;return e instanceof Date&&(e=e.getTime()/1e3-(ru(this)||0),e=iu(this,e)),e||0},r.Kh=function(){return 0},r.Ih=function(){return 0},r.Jh=function(){return!1},r.Bi=function(){},r.ni=function(){var e=$s(this.g.buffered);return e!=null&&e>=this.g.duration-1};function ru(e){return e.g.getStartDate&&(e=e.g.getStartDate().getTime(),!isNaN(e))?e/1e3:null}function iu(e,t){return e=e.g.seekable,e.length>0&&(t=Math.max(e.start(0),t),t=Math.min(e.end(e.length-1),t)),t}function au(e,t,n,r,i,a){var o=this;this.h=e,this.g=t.presentationTimeline,this.l=n,this.u=i,this.o=null,this.i=new zl(e,t.presentationTimeline,n,a),this.j=new Yl(e,function(){a:{var e=o.i;e.o=!0,e.B=!1,e.i&&e.i.Fa(e.h.gapJumpTimerTime),Bl(e);var t=Xl(o.j);if(e=cu(o,t),!$o()&&Math.abs(e-t)>.001){t=!1;var n=we().Oi();if(n){var r=Date.now()/1e3;(!o.o||o.o<r-n)&&(o.o=r,t=!0)}else t=!0;if(t){Zl(o.j,e),e=void 0;break a}}o.u(),e=void 0}return e},function(e){var t=o.i;t.g.seeking&&!t.o&&(t.o=!0,t.m=e),t.i&&t.i.Fa(t.h.gapJumpTimerTime),Bl(t)},function(){return ou(o,r)}),this.m=new Qr(function(){if(o.h.readyState!=0&&!o.h.paused){var e=Xl(o.j),t=o.g.Ub(),n=o.g.Eb();n-t<3&&(t=n-3),e<t&&(e=cu(o,e),o.h.currentTime=e)}})}r=au.prototype,r.ready=function(){this.m.Fa(.25)},r.release=function(){this.j&&(this.j.release(),this.j=null),this.i&&(this.i.release(),this.i=null),this.m&&(this.m.stop(),this.m=null),this.h=this.j=this.g=this.l=null,this.u=function(){}},r.Vf=function(e){Zl(this.j,ou(this,e))},r.Ld=function(){var e=Xl(this.j);return this.h.readyState>0&&!this.h.paused?lu(this,e):e},r.Kh=function(){return this.i.H},r.Ih=function(){return this.i.G},r.Jh=function(){return this.i.C};function ou(e,t){return t==null?t=e.g.getDuration()<1/0?e.g.Ub():e.g.Eb():t instanceof Date?t=t.getTime()/1e3-(e.g.m||e.g.i):t<0&&(t=e.g.Eb()+t),su(e,lu(e,t))}r.Bi=function(){this.i.ud()},r.ni=function(){if(this.g.T()){var e=this.g.Ec(),t=$s(this.h.buffered);if(t!=null&&t>=e)return!0}return!1};function su(e,t){var n=e.g.getDuration();return t>=n?n-e.l.durationBackoff:t}function cu(e,t){var n=e.l.rebufferingGoal,r=e.l.safeSeekOffset,i=e.g.Ub(),a=e.g.Eb(),o=e.g.getDuration();a-i<3&&(i=a-3);var s=e.g.Wd(n),c=e.g.Wd(r);return n=e.g.Wd(n+r),t>=o?su(e,t):t>a?a-e.l.safeSeekEndOffset:t<i?e.g.T()&&e.l.returnToEndOfLiveWindowWhenOutside?a-e.l.safeSeekEndOffset:ec(e.h.buffered,c)?c:n:t>=s||ec(e.h.buffered,t)?t:n}function lu(e,t){var n=e.g.Ub();return t<n?n:(e=e.g.Eb(),t>e?e:t)}function uu(e){this.g=e,this.m=null,this.i=0,this.o=!1}r=uu.prototype,r.getNumReferences=function(){return this.g.length},r.getNumEvicted=function(){return this.i},r.release=function(){this.o||(this.g=[],this.m&&this.m.stop(),this.m=null)},r.zk=function(){this.o=!0},r.qb=function(e){for(var t=g(this.g),n=t.next();!n.done;n=t.next())e(n.value)},r.Cb=function(){return this.g[0]||null},r.find=function(e){var t=this.g.length-1;if(t<0)return null;if(e<this.g[0].startTime)return this.i;var n=ge(this.g,function(t){return t.startTime<=e})-1;if(n<0)return null;var r=this.g[n];return t=n<t?this.g[n+1].startTime:r.endTime,e>=r.startTime&&e<t?n+this.i:null},r.get=function(e){return this.g.length==0?null:(e-=this.i,e<0||e>=this.g.length?null:this.g[e])},r.offset=function(e){if(!this.o)for(var t=g(this.g),n=t.next();!n.done;n=t.next())n.value.offset(e)},r.pf=function(e){if(!this.o&&e.length){var t=Math.round(e[0].startTime*1e3)/1e3,n=ge(this.g,function(e){return Math.round(e.startTime*1e3)/1e3<t});this.g.length=n,this.g.push.apply(this.g,_(e))}},r.ce=function(e,t){for(var n=Math.max(t,this.g.length>0?this.g[0].startTime:-1/0),r=0;r<e.length&&e[r].endTime<=n;)r++;r>0&&(e=e.slice(r)),this.pf(e),this.Va(t)},r.Va=function(e){if(!this.o){var t=ge(this.g,function(t){return t.endTime<=e});t>0&&(this.i+=t,this.g=this.g.slice(t))}},r.hd=function(e,t,n){if(n=n!==void 0&&n,!this.o){for(;this.g.length&&this.g[this.g.length-1].startTime>=t;)this.g.pop();var r=ge(this.g,function(t){return t.endTime<=e});r>0&&(n||(this.i+=r),this.g=this.g.slice(r)),this.g.length!=0&&(n=this.g[this.g.length-1],t=new H(n.startTime,t,n.C,n.startByte,n.endByte,n.ba,n.timestampOffset,n.appendWindowStart,n.appendWindowEnd,n.g,n.tilesLayout,n.B,n.h,n.status,n.aesKey),t.mimeType=n.mimeType,t.codecs=n.codecs,t.i=n.i,this.g[this.g.length-1]=t)}},r.Nf=function(e,t){var n=this;this.o||(this.m&&this.m.stop(),this.m=new Qr(function(){var e=t();e?n.g.push.apply(n.g,_(e)):(n.m.stop(),n.m=null)}),this.m.Fa(e))},uu.prototype[Symbol.iterator]=function(){return this.Rb(0)},uu.prototype.Rb=function(e,t,n){t=t!==void 0&&t,n=n!==void 0&&n;var r=this.find(e);if(r==null)return null;var i=this.get(r);n?r++:r--;var a=-1;if(i&&i.g.length>0)for(var o=i.g.length-1;o>=0;--o){var s=i.g[o];if(e>=s.startTime&&e<s.endTime){if(!t){for(;o&&!s.l;)o--,s=i.g[o];if(!s.l)return ce(`No independent partial segment found!`),null}n?r--:r++,a=o-1;break}}return new fu(this,r,a,n)},uu.prototype.Qe=function(){return-1};function du(e,t,n){return e=new H(e,e+t,function(){return n},0,null,null,e,e,e+t),new uu([e])}P(`shaka.media.SegmentIndex`,uu),uu.forSingleSegment=du,uu.prototype.getIteratorForTime=uu.prototype.Rb,uu.prototype.updateEvery=uu.prototype.Nf,uu.prototype.fit=uu.prototype.hd,uu.prototype.evict=uu.prototype.Va,uu.prototype.mergeAndEvict=uu.prototype.ce,uu.prototype.offset=uu.prototype.offset,uu.prototype.get=uu.prototype.get,uu.prototype.find=uu.prototype.find,uu.prototype.markImmutable=uu.prototype.zk,uu.prototype.release=uu.prototype.release,uu.prototype.getNumEvicted=uu.prototype.getNumEvicted,uu.prototype.getNumReferences=uu.prototype.getNumReferences;function fu(e,t,n,r){this.i=e,this.h=t,this.g=n,this.reverse=r}r=fu.prototype,r.Fd=function(e){this.reverse=e},r.xj=function(){return this.h},r.current=function(){var e=this.i.get(this.h);return e&&e.g.length>0&&e.m&&this.g>=e.g.length&&(this.h++,this.g=0,e=this.i.get(this.h)),e&&e.g.length>0?e.g[this.g]:e},r.next=function(){var e=this.i.get(this.h);return this.reverse?e&&e.g.length>0?(this.g--,this.g<0&&(this.h--,this.g=(e=this.i.get(this.h))&&e.g.length>0?e.g.length-1:0)):(this.h--,this.g=0):e&&e.g.length>0?(this.g++,e.m&&this.g==e.g.length&&(this.h++,this.g=0)):(this.h++,this.g=0),e=this.current(),{value:e,done:!e}},r.ih=function(){var e=this.current();if(e&&e.Rc&&!e.l&&(e=this.i.get(this.h))&&e.g.length>0)for(var t=e.g[this.g];t.l&&!(this.g<=0);)this.g--,t=e.g[this.g]},P(`shaka.media.SegmentIterator`,fu),fu.prototype.resetToLastIndependent=fu.prototype.ih,fu.prototype.next=fu.prototype.next,fu.prototype.current=fu.prototype.current,fu.prototype.currentPosition=fu.prototype.xj,fu.prototype.setReverse=fu.prototype.Fd;function pu(){uu.call(this,[]),this.h=[]}m(pu,uu),r=pu.prototype,r.clone=function(){var e=new pu;return e.h=this.h.slice(),e.i=this.i,e},r.release=function(){this.h=[]},r.qb=function(e){for(var t=g(this.h),n=t.next();!n.done;n=t.next())n.value.qb(e)};function mu(e,t){e=g(e.h);for(var n=e.next();!n.done;n=e.next())t(n.value)}r.find=function(e){for(var t=this.i,n=g(this.h),r=n.next();!r.done;r=n.next()){r=r.value;var i=r.find(e);if(i!=null)return i+t;t+=r.getNumEvicted()+r.getNumReferences()}return null};function hu(e,t){e=g(e.h);for(var n=e.next();!n.done;n=e.next())if(n=n.value,n.find(t)!=null)return n.Qe();return-1}r.get=function(e){for(var t=this.i,n=g(this.h),r=n.next();!r.done;r=n.next()){r=r.value;var i=r.get(e-t);if(i)return i;i=r.getNumReferences(),t+=r.getNumEvicted()+i}return null},r.offset=function(){},r.pf=function(){},r.Va=function(e){if(this.h.length){var t=this.h[0];t.Va(e),t.getNumReferences()==0&&(this.h.shift(),this.i+=t.getNumEvicted(),t.release(),this.Va(e))}},r.ce=function(){},r.hd=function(){},r.Nf=function(){},P(`shaka.media.MetaSegmentIndex`,pu),pu.prototype.updateEvery=pu.prototype.Nf,pu.prototype.fit=pu.prototype.hd,pu.prototype.mergeAndEvict=pu.prototype.ce,pu.prototype.evict=pu.prototype.Va,pu.prototype.merge=pu.prototype.pf,pu.prototype.offset=pu.prototype.offset,pu.prototype.get=pu.prototype.get,pu.prototype.find=pu.prototype.find,pu.prototype.forEachTopLevelReference=pu.prototype.qb,pu.prototype.release=pu.prototype.release;function gu(e){var t=this;this.g=e,this.j=!1,this.h=this.g.Hg(),this.i=new Qr(function(){t.g.isPaused()||t.g.Bk(t.h*.25)})}gu.prototype.release=function(){this.set(this.ld()),this.i&&(this.i.stop(),this.i=null),this.g=null},gu.prototype.set=function(e){this.h=e,_u(this)},gu.prototype.ld=function(){return this.g.ld()};function _u(e){e.i.stop();var t=e.j?0:e.h;if(t>=0&&t<=16)try{e.g.Hg()!=t&&e.g.Ti(t);return}catch{}e.i.Fa(.25),e.g.Hg()!=0&&e.g.Ti(0)}function vu(e){var t=this;this.j=e,this.h=new I,this.g=/* @__PURE__ */ new Set,this.i=new Qr(function(){yu(t,!1)}).yb(),e.paused||this.i.Fa(.25),this.h.F(e,`playing`,function(){t.i.yb().Fa(.25)}),this.h.F(e,`pause`,function(){t.i.stop()}),this.h.F(e,`seeked`,function(){t.i.yb(),e.paused||t.i.Fa(.25)})}vu.prototype.release=function(){this.h&&(this.h.release(),this.h=null),this.i.stop();for(var e=g(this.g),t=e.next();!t.done;t=e.next())t.value.release();this.g.clear()};function yu(e,t){var n=e.j.currentTime;e=g(e.g);for(var r=e.next();!r.done;r=e.next())r.value.j(n,t)}function bu(e){ga.call(this),this.g=/* @__PURE__ */ new Map,this.h=e}m(bu,ga),bu.prototype.release=function(){this.g.clear(),ga.prototype.release.call(this)};function xu(e,t){var n=e.g.get(t);return n||(n={ke:[],kg:null,contentType:t},e.g.set(t,n)),n}function Su(e,t,n){var r=xu(e,t.contentType);wu(e,r),e={sd:t,position:n},r=r.ke,t=r.findIndex(function(e){return e.position>=n}),t>=0?r.splice(t,+(r[t].position==n),e):r.push(e)}bu.prototype.j=function(e){for(var t=g(this.g.values()),n=t.next();!n.done;n=t.next()){n=n.value;var r=n.kg;a:{for(var i=n.ke,a=i.length-1;a>=0;a--){var o=i[a];if(o.position<=e){i=o.sd;break a}}i=null}a=i&&!(r===i||r&&i&&r.bandwidth==i.bandwidth&&r.audioSamplingRate==i.audioSamplingRate&&r.codecs==i.codecs&&r.contentType==i.contentType&&r.frameRate==i.frameRate&&r.height==i.height&&r.mimeType==i.mimeType&&r.channelsCount==i.channelsCount&&r.pixelAspectRatio==i.pixelAspectRatio&&r.width==i.width),o=i&&r&&i.label&&r.label&&r.label!==i.label;var s=i&&r&&i.language&&r.language&&r.language!==i.language;r=i&&r&&i.roles&&r.roles&&!_e(r.roles,i.roles),(o||s||r)&&Cu(this,e,i.contentType)&&(n.kg=i,r=new V(`audiotrackchange`,/* @__PURE__ */ new Map([[`quality`,i],[`position`,e]])),this.dispatchEvent(r)),a&&Cu(this,e,i.contentType)&&(n.kg=i,JSON.stringify(i),n=new V(`qualitychange`,/* @__PURE__ */ new Map([[`quality`,i],[`position`,e]])),this.dispatchEvent(n))}};function Cu(e,t,n){return!!((e=e.h()[n])&&e.length>0&&(n=e[e.length-1].end,t>=e[0].start&&t<n))}function wu(e,t){if((e=e.h()[t.contentType])&&e.length>0){var n=e[0].start,r=e[e.length-1].end,i=t.ke;t.ke=i.filter(function(e,t){return!(e.position<=n&&t+1<i.length&&i[t+1].position<=n||e.position>=r)})}else t.ke=[]}function Tu(e){var t={bandwidth:e.bandwidth||0,audioSamplingRate:null,codecs:e.codecs,contentType:e.type,frameRate:null,height:null,mimeType:e.mimeType,channelsCount:null,pixelAspectRatio:null,width:null,label:null,roles:e.roles,language:null};return e.type==`video`&&(t.frameRate=e.frameRate||null,t.height=e.height||null,t.pixelAspectRatio=e.pixelAspectRatio||null,t.width=e.width||null),e.type==`audio`&&(t.audioSamplingRate=e.audioSamplingRate,t.channelsCount=e.channelsCount,t.label=e.label||null,t.language=e.language),t}function Eu(e){ga.call(this),this.h=/* @__PURE__ */ new Map,this.i=e,this.g=null}m(Eu,ga),Eu.prototype.release=function(){this.h.clear(),this.g&&(this.g.stop(),this.g=null),ga.prototype.release.call(this)};function Du(e,t){var n=t.schemeIdUri+`_`+t.id+`_`+(t.startTime.toFixed(1)+`_`+t.endTime.toFixed(1));e.h.has(n)||(e.h.set(n,t),t=new V(`regionadd`,/* @__PURE__ */ new Map([[`region`,t]])),e.dispatchEvent(t),Ou(e))}function Ou(e){e.g||(e.g=new Qr(function(){for(var t=e.i(),n=g(e.h),r=n.next();!r.done;r=n.next()){var i=g(r.value);r=i.next().value,i=i.next().value,i.endTime<t.start&&(e.h.delete(r),r=new V(`regionremove`,/* @__PURE__ */ new Map([[`region`,i]])),e.dispatchEvent(r))}!e.h.size&&e.g&&(e.g.stop(),e.g=null)}).Fa(2))}function ku(e,t,n,r,i){function a(e,t){return!(t.fastSwitching&&e.Rc&&e.be)}this.m=e,this.i=t,this.l=n,this.g=/* @__PURE__ */ new Map,this.j=/* @__PURE__ */ new Map,this.h=null,this.o=r,this.u=i||a}function Au(e,t){e.l=t,e=g(e.g.values());for(var n=e.next();!n.done;n=e.next())n.value.g=t}function ju(e,t,n){if(n=n!==void 0&&n,!e.i.segmentIndex||(e.h||(e.h=e.i.segmentIndex.Rb(t,!0,e.o)),!e.h))return Promise.resolve();for(n&&e.h.next(),t=[];e.g.size<e.m&&(n=e.h.next().value,n);){var r=!0;if(n.isPreload()&&n.endByte!=null&&(r=!1),n.Wb()==2&&(r=!1),n.Vb(!1)&&(r=!1),r&&n.ba&&t.push(Mu(e,n.ba)),r&&!e.g.has(n)&&(r=new zu(e.l),t.push(Bu(r,n,e.i)),e.g.set(n,r)),!e.u(n,e.i))break}return Fu(e),Promise.all(t)}function Mu(e,t){if(!e.i.segmentIndex||t.Vb()||Array.from(e.j.keys()).some(function(e){return Ks(e,t)}))return Promise.resolve();var n=new zu(e.l),r=Bu(n,t,e.i);return e.j.set(t,n),r}function Nu(e,t){t=g(t.keys());for(var n=t.next();!n.done;n=t.next())(n=n.value)&&Ru(e,n)}function Pu(e){Nu(e,e.g),Nu(e,e.j),e.h=null}ku.prototype.Va=function(e,t){t=t!==void 0&&t;for(var n=g(this.g.keys()),r=n.next();!r.done;r=n.next())r=r.value,e>r.endTime&&Ru(this,r);t&&Fu(this)},ku.prototype.Fd=function(e){this.o=e,this.h&&this.h.Fd(e)};function Fu(e){if(e.g.size)for(var t=Array.from(e.g.keys()),n=g(e.j.keys()),r=n.next(),i={};!r.done;i={Mg:void 0},r=n.next())i.Mg=r.value,t.some(function(e){return function(t){return Ks(t.ba,e.Mg)}}(i))||Ru(e,i.Mg)}function Iu(e,t){e.m=t;for(var n=Array.from(e.g.keys());n.length>t;){var r=n.pop();r&&Ru(e,r)}Fu(e)}function Lu(e,t){t&&t!==e.i&&(Pu(e),e.i=t)}function Ru(e,t){var n=e.g;t instanceof Gs&&(n=e.j),e=n.get(t),n.delete(t),e&&e.abort()}function zu(e){this.g=e,this.ge=this.yh=null}function Bu(e,t,n){var r=/* @__PURE__ */ new Uint8Array;return e.ge=e.g(t,n,function(t){return k(function(n){if(n.h==1)return r=r.byteLength>0?z(r,t):t,e.yh?n.g(e.yh(r),3):n.A(0);r=/* @__PURE__ */ new Uint8Array,n.j()})}),e.ge.promise.catch(function(e){return e instanceof R&&e.code==7001?Promise.resolve():Promise.reject(e)})}zu.prototype.abort=function(){this.ge&&this.ge.abort()},P(`shaka.config.CrossBoundaryStrategy`,{KEEP:`keep`,RESET:`reset`,RESET_TO_ENCRYPTED:`reset_to_encrypted`,RESET_ON_ENCRYPTION_CHANGE:`RESET_ON_ENCRYPTION_CHANGE`});function Vu(e){var t=Fr(e),n=t.split(`/`)[0];return e=Ir(e),{type:n,mimeType:t,codecs:e,language:null,height:null,width:null,channelCount:null,sampleRate:null,closedCaptions:/* @__PURE__ */ new Map,se:null,colorGamut:null,frameRate:null,timescale:null}}function Hu(e,t,n){function r(e){y=e.name;var t=e.reader;t.skip(24);var n=t.Ea(),r=t.Ea();t.skip(50),f=String(n),d=String(r),e.reader.La()&&Ha(e)}function i(e){var t=as(e.reader);p=t.channelCount,m=t.sampleRate,a(e.name)}function a(e){switch(e=e.toLowerCase(),e){case`avc1`:case`avc3`:s.push(e+`.42E01E`),l=!0;break;case`hev1`:case`hvc1`:s.push(e+`.1.6.L93.90`),l=!0;break;case`dvh1`:case`dvhe`:s.push(e+`.05.04`),l=!0;break;case`vp09`:s.push(e+`.00.10.08`),l=!0;break;case`av01`:s.push(e+`.0.01M.08`),l=!0;break;case`mp4a`:o.push(`mp4a.40.2`),c=!0;break;case`ac-3`:case`ec-3`:case`ac-4`:case`opus`:case`flac`:o.push(e),c=!0;break;case`apac`:o.push(`apac.31.00`),c=!0}}var o=[],s=[],c=!1,l=!1,u=null,d=null,f=null,p=null,m=null,h=null,_=null,v=null,y;if(new Va().box(`moov`,Ha).box(`trak`,Ha).box(`mdia`,Ha).ma(`mdhd`,function(e){e=rs(e.reader,e.version),u=e.language,v=e.timescale}).box(`minf`,Ha).box(`stbl`,Ha).ma(`stsd`,Ua).box(`mp4a`,function(e){var t=as(e.reader);p=t.channelCount,m=t.sampleRate,e.reader.La()?Ha(e):a(e.name)}).box(`esds`,function(e){e=e.reader;for(var t=`mp4a`,n,r;e.La();){n=e.Y();for(var i=e.Y();i&128;)i=e.Y();if(n==3)e.Ea(),i=e.Y(),i&128&&e.Ea(),i&64&&e.skip(e.Y()),i&32&&e.Ea();else if(n==4)r=e.Y(),e.skip(12);else if(n==5)break}r&&(t+=`.`+cs(r),n==5&&e.La()&&(n=e.Y(),r=(n&248)>>3,r===31&&e.La()&&(r=32+((n&7)<<3)+((e.Y()&224)>>5)),t+=`.`+r)),o.push(t),c=!0}).box(`ac-3`,i).box(`ec-3`,i).box(`ac-4`,i).box(`Opus`,i).box(`fLaC`,i).box(`apac`,i).box(`avc1`,r).box(`avc3`,r).box(`hev1`,r).box(`hvc1`,r).box(`dva1`,r).box(`dvav`,r).box(`dvh1`,r).box(`dvhe`,r).box(`vp09`,r).box(`av01`,r).box(`avcC`,function(e){var t=y||``;switch(y){case`dvav`:t=`avc3`;break;case`dva1`:t=`avc1`}e=e.reader,e.skip(1),e=t+`.`+cs(e.Y())+cs(e.Y())+cs(e.Y()),s.push(e),l=!0}).box(`hvcC`,function(e){var t=y||``;switch(y){case`dvh1`:t=`hvc1`;break;case`dvhe`:t=`hev1`}var n=e.reader;n.skip(1),e=n.Y();var r=[``,`A`,`B`,`C`][e>>6],i=e&31,a=n.V(),o=(e&32)>>5?`H`:`L`;e=[n.Y(),n.Y(),n.Y(),n.Y(),n.Y(),n.Y()],n=n.Y();for(var c=0,u=0;u<32&&(c|=a&1,u!=31);u++)c<<=1,a>>=1;for(t=t+(`.`+r+i)+(`.`+cs(c,!0)),t+=`.`+o+n,r=``,i=e.length;i--;)((o=e[i])||r)&&(r=`.`+o.toString(16).toUpperCase()+r);t+=r,s.push(t),l=!0}).box(`dvcC`,function(e){var t=y||``;switch(y){case`hvc1`:t=`dvh1`;break;case`hev1`:t=`dvhe`;break;case`avc1`:t=`dva1`;break;case`avc3`:t=`dvav`;break;case`av01`:t=`dav1`}var n=e.reader;n.skip(2),e=n.Y(),n=n.Y(),s.push(t+`.`+ls(e>>1&127)+`.`+ls(e<<5&32|n>>3&31)),l=!0}).box(`dvvC`,function(e){var t=y||``;switch(y){case`hvc1`:t=`dvh1`;break;case`hev1`:t=`dvhe`;break;case`avc1`:t=`dva1`;break;case`avc3`:t=`dvav`;break;case`av01`:t=`dav1`}var n=e.reader;n.skip(2),e=n.Y(),n=n.Y(),s.push(t+`.`+ls(e>>1&127)+`.`+ls(e<<5&32|n>>3&31)),l=!0}).ma(`vpcC`,function(e){var t=y||``,n=e.reader;e=n.Y();var r=n.Y();n=n.Y()>>4&15,s.push(t+`.`+ls(e)+`.`+ls(r)+`.`+ls(n)),l=!0}).box(`av1C`,function(e){var t=y||``;y===`dav1`&&(t=`av01`);var n=e.reader;n.skip(1),e=n.Y(),n=n.Y();var r=e>>>5,i=(n&64)>>6;s.push(t+`.`+r+`.`+ls(e&31)+(n>>>7?`H`:`M`)+`.`+ls(r===2&&i?(n&32)>>5?12:10:i?10:8)+`.`+((n&16)>>4)+`.`+((n&8)>>3)+((n&4)>>2)+(n&3)+`.`+ls(1)+`.`+ls(1)+`.`+ls(1)+`.0`),l=!0}).box(`enca`,Ga).box(`encv`,Wa).box(`sinf`,Ha).box(`frma`,function(e){e=os(e.reader).codec,a(e)}).box(`colr`,function(e){s=s.map(function(t){if(t.startsWith(`av01.`)){var n=e.reader,r=n.Ra(),i=n.Nb(4,!1),a=String.fromCharCode(i[0]);if(a+=String.fromCharCode(i[1]),a+=String.fromCharCode(i[2]),a+=String.fromCharCode(i[3]),a===`nclx`){i=n.Ea(),a=n.Ea();var o=n.Ea(),s=n.Y()>>7,c=t.split(`.`);c.length==10&&(c[6]=ls(i),c[7]=ls(a),c[8]=ls(o),c[9]=String(s),t=c.join(`.`))}n.seek(r)}return t});var t=ss(e.reader),n=t.colorGamut;h=t.se,_=n}).parse(e||t,!0,!0),!o.length&&!s.length)return null;var b=c&&!l,x=/* @__PURE__ */ new Map;if(l&&!n){n=new Jt(`video/mp4`),e&&n.init(e);try{Yt(n,t);for(var S=g(n.g.getStreams()),C=S.next();!C.done;C=S.next()){var w=C.value;x.set(w,w)}}catch{}n.g.clear()}return{type:b?`audio`:`video`,mimeType:b?`audio/mp4`:`video/mp4`,codecs:Uu(o.concat(s)).join(`, `),language:u,height:d,width:f,channelCount:p,sampleRate:m,closedCaptions:x,se:h,colorGamut:_,frameRate:null,timescale:v}}function Uu(e){var t=/* @__PURE__ */ new Set,n=[];e=g(e);for(var r=e.next();!r.done;r=e.next()){r=r.value;var i=Pr(r);t.has(i)||(n.push(r),t.add(i))}return t=Mt(`audio`,n),r=Mt(`video`,n),e=Mt(Nt,n),r=Wu(r),t=t.concat(r).concat(e),n.length&&!t.length?n:t}function Wu(e){if(e.length<=1)return e;var t=e.find(function(e){return e.startsWith(`dvav.`)||e.startsWith(`dva1.`)||e.startsWith(`dvh1.`)||e.startsWith(`dvhe.`)||e.startsWith(`dav1.`)||e.startsWith(`dvc1.`)||e.startsWith(`dvi1.`)});return t?Qo(`video/mp4; codecs="`+t+`"`)?[t]:e.filter(function(e){return e!=t}):e}function Gu(e){var t=null;return new Va().box(`moov`,Ha).box(`trak`,Ha).box(`mdia`,Ha).box(`minf`,Ha).box(`stbl`,Ha).ma(`stsd`,Ua).box(`encv`,Wa).box(`enca`,Ga).box(`sinf`,Ha).box(`schi`,Ha).ma(`tenc`,function(e){e=e.reader,e.Y(),e.Y(),e.Y(),e.Y(),e=e.Nb(16,!1),t=Tt(e)}).parse(e,!0),t}function Ku(t,n,r){var i,a,o,s,c;return k(function(l){if(l.h==1)return i=n,i.cryptoKey?l.A(2):l.g(i.fetchKey(),3);if(a=i.iv,!a)for(a=Ze(/* @__PURE__ */ new ArrayBuffer(16)),o=i.firstMediaSequenceNumber+r,s=a.byteLength-1;s>=0;s--)a[s]=o&255,o>>=8;return c=n.blockCipherMode==`CBC`?{name:`AES-CBC`,iv:a}:{name:`AES-CTR`,counter:a,length:64},l.return(e.crypto.subtle.decrypt(c,i.cryptoKey,t))})}function qu(e,t,n){var r,i,a,o,s,c,l;return k(function(u){switch(u.h){case 1:return r=Ju(e),(i=Xu.get(r))?u.return(i):(a=0,o=Sa([e],n),u.m(2),o.method=`HEAD`,u.g(t.request(a,o).promise,4));case 4:s=u.i,i=s.headers[`content-type`],u.o(3);break;case 2:if(c=u.l(),!c||c.code!=1002&&c.code!=1001){u.A(3);break}return o.method=`GET`,u.g(t.request(a,o).promise,6);case 6:l=u.i,i=l.headers[`content-type`];case 3:return u.return(i?i.toLowerCase().split(`;`).shift():``)}})}function Ju(e){for(var t=e.length,n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r===63||r===35){t=n;break}}for(n=t-1;n>=0;n--){if(r=e.charCodeAt(n),r===46){if(n+1<t)return e.slice(n+1,t).toLowerCase();break}if(r===47)break}return``}function Yu(e,t,n,r,i){return e=Sa(e,r,i),(t!=0||n!=null)&&(e.headers.Range=n?`bytes=`+t+`-`+n:`bytes=`+t+`-`),e}var Xu=(/* @__PURE__ */ 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`);function Zu(e,t){var n=this;this.g=t,this.j=e,this.i=null,this.M=/* @__PURE__ */ new Map,this.C=1,this.B=this.o=null,this.U=0,this.h=/* @__PURE__ */ new Map,this.N=!1,this.W=null,this.D=!1,this.l=new Ma(function(){return Qu(n)}),this.R=Date.now()/1e3,this.m=/* @__PURE__ */ new Map,this.S={projection:null,hfov:null},this.aa=0,this.Z=1/0,this.H=null,this.O=[],this.u=new Qr(function(){if(n.j&&n.g){if(n.j.presentationTimeline.T()){var e=n.j.presentationTimeline.Ub(),t=n.j.presentationTimeline.Eb();t-e>1?ml(n.g.X,e,t):hl(n.g.X)}else hl(n.g.X),n.u&&n.u.stop()}else n.u&&n.u.stop()}),this.I=null,this.J=!1,this.K=new Qr(function(){var e=n.g.video;!e.ended&&n.I&&(n.J=!0,e.currentTime=n.I,n.I=null)}),this.G=new I}r=Zu.prototype,r.destroy=function(){return this.l.destroy()};function Qu(e){var t,n,r,i,a,o,s;return k(function(c){if(c.h==1){for(e.u&&e.u.stop(),e.u=null,e.K&&e.K.stop(),e.K=null,e.G&&(e.G.release(),e.G=null),t=[],n=g(e.h.values()),r=n.next();!r.done;r=n.next())i=r.value,kd(i),t.push(Ad(i)),i.ha&&(Pu(i.ha),i.ha=null);for(a=g(e.m.values()),o=a.next();!o.done;o=a.next())s=o.value,Pu(s);return c.g(Promise.all(t),2)}e.h.clear(),e.m.clear(),e.g=null,e.j=null,e.i=null,e.I=null,c.j()})}r.configure=function(e){if(this.i=e,this.W=new ra({maxAttempts:Math.max(e.retryParameters.maxAttempts,2),baseDelay:e.retryParameters.baseDelay,backoffFactor:e.retryParameters.backoffFactor,fuzzFactor:e.retryParameters.fuzzFactor,timeout:0,stallTimeout:0,connectionTimeout:0},!0),e.disableAudioPrefetch){var t=this.h.get(`audio`);t&&t.ha&&(Pu(t.ha),t.ha=null),t=g(this.m.keys());for(var n=t.next();!n.done;n=t.next())n=n.value,Pu(this.m.get(n)),this.m.delete(n)}for(e.disableTextPrefetch&&(t=this.h.get(Nt))&&t.ha&&(Pu(t.ha),t.ha=null),e.disableVideoPrefetch&&(t=this.h.get(`video`))&&t.ha&&(Pu(t.ha),t.ha=null),t=g(this.h.keys()),n=t.next();!n.done;n=t.next())n=this.h.get(n.value),n.ha?(Iu(n.ha,e.segmentPrefetchLimit),e.segmentPrefetchLimit>0||(Pu(n.ha),n.ha=null)):e.segmentPrefetchLimit>0&&(n.ha=fd(this,n.stream));e.disableAudioPrefetch||pd(this)};function $u(e,t,n){e.j.presentationTimeline.T()||(e.aa=t,e.Z=n)}r.start=function(e){var t=this;return k(function(n){if(n.h==1)return n.g(ud(t,e||/* @__PURE__ */ new Map),2);Na(t.l),t.N=!0,n.j()})};function ed(e,t){var n,r,i,a,o,s;k(function(c){switch(c.h){case 1:return n=Pt,e.U++,r=e.U,c.m(2),c.g(dl(e.g.X,n.Pa),4);case 4:c.o(3);break;case 2:i=c.l(),e.g&&e.g.onError(i);case 3:a=kr(t.mimeType,t.codecs),$c(e.g.X,a,e.j.sequenceMode,t.external),o=e.g.X.aa,(o.isTextVisible()||e.i.alwaysStreamText)&&e.U==r&&(s=dd(e,t),e.h.set(n.Pa,s),Od(e,s,0)),c.j()}})}function td(e){var t=e.h.get(Nt);t&&(kd(t),Ad(t).catch(function(){}),e.H=e.h.get(Nt),e.h.delete(Nt),t.stream&&t.stream.closeSegmentIndex&&t.stream.closeSegmentIndex()),e.B=null}function nd(e,t){for(var n=e.g.Db()<0,r=g(e.h.values()),i=r.next();!i.done;i=r.next())i=i.value,i.sa&&i.sa.Fd(n),i.ha&&i.ha.Fd(n);for(r=g(e.m.values()),i=r.next();!i.done;i=r.next())i.value.Fd(n);(n=e.h.get(`video`))&&(r=n.stream)&&(t?(t=r.trickModeVideo)&&!n.Ic&&(sd(e,t,!1,0,!1),n.Ic=r):(t=n.Ic)&&(n.Ic=null,sd(e,t,!0,0,!1)))}function rd(e,t,n,r,i,a){n=n!==void 0&&n,r=r===void 0?0:r,i=i!==void 0&&i,a=a!==void 0&&a,e.o=t,e.N&&(t.video&&sd(e,t.video,n,r,i,a),t.audio&&sd(e,t.audio,n,r,i,a))}function id(e,t){k(function(n){if(n.h==1)return e.H=null,e.B=t,e.N?t.segmentIndex?n.A(2):n.g(t.createSegmentIndex(),2):n.return();sd(e,t,!0,0,!1),n.j()})}function ad(e){var t=e.h.get(Nt);t&&sd(e,t.stream,!0,0,!0)}function od(e,t){for(var n=g(e.M.entries()),r=n.next();!r.done;r=n.next()){var i=g(r.value);r=i.next().value,i=i.next().value,r.includes(t.type)&&(i(),e.M.delete(r))}}function sd(e,t,n,r,i,a){var o=e.h.get(t.type);o||t.type!=Nt?o&&(o.Ic&&(t.trickModeVideo?(o.Ic=t,t=t.trickModeVideo):o.Ic=null),o.stream!=t||i)&&(e.m.has(t)?o.ha=e.m.get(t):o.ha&&Lu(o.ha,t),t.type==Nt&&o.stream!=t&&(i=kr(t.mimeType,t.codecs),$c(e.g.X,i,e.j.sequenceMode,t.external)),!e.m.has(o.stream)&&o.stream.closeSegmentIndex&&(o.Ja?(i=`(`+o.type+`:`+o.stream.id+`)`,e.M.has(i)||e.M.set(i,o.stream.closeSegmentIndex)):o.stream.closeSegmentIndex()),i=o.stream.isAudioMuxedInVideo!=t.isAudioMuxedInVideo,o.stream=t,o.sa=null,o.ag=!!a,o.Bc=t.dependencyStream?dd(e,t.dependencyStream):null,Id(e),i&&(o.jb=null,o.mc=null,o.lc=null,t.isAudioMuxedInVideo&&(t=null,o.type===`video`?t=e.h.get(`audio`):o.type===`audio`&&(t=e.h.get(`video`)),t&&(Ad(t).catch(function(){}),t.jb=null,t.mc=null,t.lc=null,ld(e,t),cd(e,t).catch(function(t){e.g&&e.g.onError(t)})))),n?o.Qb?o.Id=!0:o.Ja?(o.Ob=!0,o.dd=r,o.Id=!0):(kd(o),Dd(e,o,!0,r).catch(function(t){e.g&&e.g.onError(t)})):o.Ja||o.kb||Od(e,o,0),cd(e,o).catch(function(t){e.g&&e.g.onError(t)})):ed(e,t)}function cd(e,t){var n,r,i;return k(function(a){if(a.h==1)return t.Wa?(n=t.stream,r=t.Wa,n.segmentIndex?a.A(2):a.g(n.createSegmentIndex(),2)):a.return();if(a.h!=4)return i=n.dependencyStream,!i||i.segmentIndex?a.A(4):a.g(i.createSegmentIndex(),4);if(t.Wa!=r||t.stream!=n)return a.return();var o=e.g.Tb(),s=rl(e.g.X,t.type),c=t.stream.segmentIndex.find(t.Ga?t.Ga.endTime:o),l=c==null?null:t.stream.segmentIndex.get(c);c=l?qs(l):null,l&&!c&&(c=(l.endTime-l.getStartTime())*(t.stream.bandwidth||e.o.bandwidth)/8),c?((l=l.ba)&&(c+=(l.endByte?l.endByte+1-l.startByte:null)||0),l=e.g.getBandwidthEstimate(),o=c*8/l<(s||0)-o-e.i.rebufferingGoal||t.Wa.h.g>c):o=!0,o&&t.Wa.abort(),a.j()})}r.Uc=function(){if(this.g){for(var e=this.g.Tb(),t=g(this.h.keys()),n=t.next();!n.done;n=t.next()){var r=n.value;n=this.h.get(r);var i;if((i=!this.J)&&(i=this.g.X,r==Nt?(i=i.h,i=i.g==null||i.h==null?!1:e>=i.g&&e<i.h):(i=al(i,r),i=ec(i,e)),i=!i),i){if(this.R=0,n.ha&&(n.ha.h=null),n.type===`audio`){i=g(this.m.values());for(var a=i.next();!a.done;a=i.next())a.value.h=null}n.sa=null,(rl(this.g.X,r)!=null||n.Ja)&&ld(this,n),n.Wa&&(n.Wa.abort(),n.Wa=null),r===Nt&&(r=this.g.X,r.J&&r.J.g.clear()),n.Uc=!0}!this.J||n.Qb||n.Ja||n.kb||Od(this,n,0)}Fd(this)&&Ld(this)}};function ld(e,t){t.Qb||t.Ob||(t.Ja?(t.Ob=!0,t.dd=0):nl(e.g.X,t.type)==null?t.kb??Od(e,t,0):(kd(t),Dd(e,t,!1,0).catch(function(t){e.g&&e.g.onError(t)})))}function ud(e,t){var n,r,i,a,o,s,c,l;return k(function(u){if(u.h==1){if(!e.o)throw new R(2,5,5006);return n=zd(e,!0),r=e.g.X,u.g(r.init(n,e.j.sequenceMode,e.j.type,e.j.ignoreManifestTimestampsInSegmentsMode),2)}for(Na(e.l),e.updateDuration(),i=g(n.keys()),a=i.next();!a.done;a=i.next())o=a.value,s=n.get(o),e.h.has(o)||(c=dd(e,s),t.has(s.id)&&(l=t.get(s.id),Au(l,function(t,n,r){return Ed(t,n,r||null,e.i.retryParameters,e.g.qc)}),c.ha=l),e.h.set(o,c),Od(e,c,0));Id(e),u.j()})}function dd(e,t){var n={stream:t,type:t.type,sa:null,ha:fd(e,t),Ga:null,jb:null,lf:null,mc:null,lc:null,jf:null,kf:null,Ic:null,endOfStream:!1,Ja:!1,kb:null,Ob:!1,dd:0,Id:!1,Qb:!1,Uc:!0,ag:!1,dh:!1,pd:!1,Wa:null,Bc:null};return t.dependencyStream&&(n.Bc=dd(e,t.dependencyStream)),n}function fd(e,t){if(t.type===`video`&&e.i.disableVideoPrefetch||t.type===`audio`&&e.i.disableAudioPrefetch||t.type===Nt&&(t.mimeType==`application/cea-608`||t.mimeType==`application/cea-708`)||t.type===Nt&&e.i.disableTextPrefetch)return null;if(e.m.has(t))return e.m.get(t);var n=e.h.get(t.type);return(n=n&&n.ha)&&t===n.i?n:e.i.segmentPrefetchLimit>0?new ku(e.i.segmentPrefetchLimit,t,function(t,n,r){return Ed(t,n,r||null,e.i.retryParameters,e.g.qc)},e.g.Db()<0,e.g.hl):null}function pd(e){for(var t=e.i.segmentPrefetchLimit,n=e.i.prefetchAudioLanguages,r=g(e.j.variants),i=r.next(),a={};!i.done;a={Ib:void 0},i=r.next())if(a.Ib=i.value,a.Ib.audio){if(e.m.has(a.Ib.audio)){if(i=e.m.get(a.Ib.audio),Iu(i,t),!(t>0&&n.some(function(e){return function(t){return oi(e.Ib.audio.language,t)}}(a)))){var o=e.h.get(a.Ib.audio.type);i!==(o&&o.ha)&&Pu(i),e.m.delete(a.Ib.audio)}}else t<=0||!n.some(function(e){return function(t){return oi(e.Ib.audio.language,t)}}(a))||!(i=fd(e,a.Ib.audio))||(a.Ib.audio.segmentIndex||a.Ib.audio.createSegmentIndex(),e.m.set(a.Ib.audio,i))}}r.updateDuration=function(){var e=$o(),t=this.j.presentationTimeline.getDuration();t<1/0?(e&&(this.u&&this.u.stop(),hl(this.g.X)),this.g.X.wb(t)):e?(this.u&&this.u.Fa(.5),this.g.X.wb(1/0)):this.g.X.wb(4294967296)};function md(e,t){var n,r,i,a,o,s,c,l,u;return k(function(d){switch(d.h){case 1:if(Na(e.l),n=Pt,t.Ja||t.kb==null||t.Qb)return d.return();if(t.kb=null,!t.Ob){d.A(2);break}return d.g(Dd(e,t,t.Id,t.dd),3);case 3:return d.return();case 2:if(od(e,t),t.stream.segmentIndex){d.A(4);break}return r=t.stream,d.m(5),d.g(t.stream.createSegmentIndex(),7);case 7:d.o(6);break;case 5:return i=d.l(),d.g(jd(e,t,i),8);case 8:return d.return();case 6:if(r!=t.stream)return r.closeSegmentIndex&&r.closeSegmentIndex(),t.Ja||t.kb||Od(e,t,0),d.return();case 4:if(!t.Bc||t.Bc.stream.segmentIndex){d.A(9);break}return d.m(11),d.g(t.Bc.stream.createSegmentIndex(),13);case 13:d.o(9);break;case 11:d.l();case 9:d.m(14),a=hd(e,t),a!=null&&(Od(e,t,a),t.pd=!1),d.o(15);break;case 14:return o=d.l(),d.g(jd(e,t,o),16);case 16:return d.return();case 15:if(t.type===n.Pa)return d.return();if(s=[],t.stream&&!t.stream.isAudioMuxedInVideo&&s.push(t),c=t.type===n.$?n.wa:n.$,(l=e.h.get(c))&&l.stream&&!l.stream.isAudioMuxedInVideo&&s.push(l),!e.N||!s.every(function(e){return e.endOfStream})){d.A(0);break}return d.g(e.g.X.endOfStream(),18);case 18:Na(e.l),u=e.g.X.getDuration(),u!=0&&u<e.j.presentationTimeline.getDuration()&&e.j.presentationTimeline.wb(u),d.j()}})}function hd(e,t){if(wd(t))return ll(e.g.X,t.stream.originalId||``),null;if(t.type==Nt&&ul(e.g.X),t.stream.isAudioMuxedInVideo&&t.type==`audio`)return null;if(t.type!=Nt&&tl(e.g.X))return Nd(e,!0),null;var n=e.i.updateIntervalSeconds/Math.max(1,Math.abs(e.g.Db()));if(!Qc(e.g.X)&&t.type!=Nt)return n/2;var r=e.g.Tb();if(t.type===`audio`)for(var i=g(e.m.keys()),a=i.next();!a.done;a=i.next())a=e.m.get(a.value),a.Va(r,!0),ju(a,r);i=t.Ga?t.Ga.endTime:r;var o=il(e.g.X,t.type,r);a=Math.max(1,Math.max(e.i.rebufferingGoal,e.i.bufferingGoal)*e.C);var s=e.j.presentationTimeline.getDuration()-i,c=rl(e.g.X,t.type);if(s<1e-6&&c)return t.endOfStream=!0,t.type==`video`&&((n=e.h.get(Nt))&&wd(n)&&(n.endOfStream=!0),(n=e.h.get(`audio`))&&n.stream.isAudioMuxedInVideo&&(n.endOfStream=!0)),null;if(t.endOfStream=!1,o>=a)return n/2;if(s=!t.sa,c=gd(e,t,r,c),!c)return e=1/0,(t=t.Ga)&&(e=t.endTime-t.startTime),Math.min(e/2,n);o=t.jb;var l=c.ba;o&&l&&Ks(l,o)&&(o.g=l.g),o=!1,s&&t.ag&&(o=!0,t.ag=!1),s=1/0,l=g(e.h.values());for(var u=l.next();!u.done;u=l.next())u=u.value,wd(u)||u.stream.isAudioMuxedInVideo||u.sa&&!u.sa.current()||(s=Math.min(s,u.Ga?u.Ga.endTime:r));return i>=s+e.j.presentationTimeline.h?n:(t.ha&&t.sa&&!e.m.has(t.stream)&&(t.ha.Va(c.startTime+.001),ju(t.ha,c.startTime).catch(function(){})),Fd(e)&&Rd(e,t,c)||(_d(e,t,r,c,o).catch(function(){}),t.Bc&&vd(e,t.Bc,r,a)),null)}function gd(e,t,n,r){if(t.sa){var i=t.sa.current();return i&&t.Ga&&(n=t.Ga.endTime,yc(t.Ga.startTime,i.startTime,.002)&&yc(n,i.endTime,.002)&&(i=t.sa.next().value)),i}if(t.Ga||r)return i=t.Ga?t.Ga.endTime:r,n=e.g.Db()<0,t.stream.segmentIndex&&(t.sa=t.stream.segmentIndex.Rb(i,!1,n)),t.sa&&t.sa.next().value;r=e.j.sequenceMode||Fd(e)?0:e.i.inaccurateManifestTolerance;var a=Math.max(n-r,0),o=e.g.X.getDuration();for(Math.abs(a-o)<1&&(r=1,a=Math.max(n-r,0)),o=e.g.Db()<0,e=null,r&&(t.stream.segmentIndex&&(t.sa=t.stream.segmentIndex.Rb(a,!1,o)),e=t.sa&&t.sa.next().value),e||(t.stream.segmentIndex&&(t.sa=t.stream.segmentIndex.Rb(n,!1,o)),e=t.sa&&t.sa.next().value);(i=e)?.Wb()===2;)r=n=void 0,e=(r=(n=t.sa)?.next().value)??null;return e}function _d(t,n,r,i,a){var o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S;return k(function(C){switch(C.h){case 1:if(o=Pt,s=n.stream,c=n.sa,n.Ja=!0,C.m(2),i.Wb()==2)throw new R(1,1,1011);return C.g(bd(t,n,i,a),4);case 4:return Na(t.l),t.D?C.return():(l=s.mimeType==`video/mp4`||s.mimeType==`audio/mp4`,u=e.ReadableStream,t.i.lowLatencyMode&&t.j.isLowLatency&&u&&l&&(t.j.type!=`HLS`||i.o)?(p=/* @__PURE__ */ new Uint8Array,h=m=!1,_=function(e){var o,c,l;return k(function(u){switch(u.h){case 1:if(m||(h=!0,Na(t.l),t.D))return u.return();if(u.m(2),p=z(p,e),o=!1,c=0,new Va().box(`mdat`,function(e){c=e.size+e.start,o=!0}).parse(p,!1,!0),!o){u.A(4);break}return l=p.subarray(0,c),p=p.subarray(c),u.g(Sd(t,n,r,s,i,l,!0,a),5);case 5:n.ha&&n.sa&&ju(n.ha,i.startTime,!0);case 4:u.o(0);break;case 2:g=u.l(),u.j()}})},C.g(Td(t,n,i,_),9)):(d=Td(t,n,i),C.g(d,7)));case 7:return f=C.i,Na(t.l),t.D?C.return():(Na(t.l),n.Ob?(n.Ja=!1,Od(t,n,0),C.return()):C.g(Sd(t,n,r,s,i,f,!1,a),6));case 9:if(v=C.i,g)throw g;if(h){C.A(10);break}return m=!0,Na(t.l),t.D?C.return():n.Ob?(n.Ja=!1,Od(t,n,0),C.return()):C.g(Sd(t,n,r,s,i,v,!1,a),10);case 10:n.ha&&n.sa&&ju(n.ha,i.startTime,!0);case 6:if(Na(t.l),t.D)return C.return();n.Ga=i,c.next(),n.Ja=!1,n.dh=!1,y=t.g.X.Cc(),b=y[n.type],JSON.stringify(b),n.Ob||(x=null,n.type===o.wa?x=t.h.get(o.$):n.type===o.$&&(x=t.h.get(o.wa)),x&&x.type==o.$?t.g.ud(i,n.stream,x.stream.isAudioMuxedInVideo,!1):t.g.ud(i,n.stream,n.stream.codecs.includes(`,`),!1)),kd(n),Od(t,n,0),C.o(0);break;case 2:if(S=C.l(),Na(t.l,S),t.D)return C.return();if(n.Ja=!1,S.code==7001)n.Ja=!1,kd(n),Od(t,n,0),C.A(0);else if(n.type==o.Pa&&t.i.ignoreTextStreamFailures)t.h.delete(o.Pa),C.A(0);else return S.code==3017?C.g(yd(t,n,S),0):(n.pd=!0,S.category==1&&n.ha&&Ru(n.ha,i),S.severity=2,C.g(jd(t,n,S),0))}})}function vd(e,t,n,r){var i,a,o,s,c,l,u,d,f,p,m,h,g;return k(function(v){switch(v.h){case 1:for(i=Pt,a=t.stream,c=(s=(o=a.segmentIndex)&&o.Rb(n))&&s.next().value;c&&e.O.includes(c.startTime);)c=s&&s.next().value;if(!c){v.A(0);break}if(l=c.ba,!l||Ks(l,t.jb)){v.A(3);break}return t.jb=l,v.m(4),v.g(Td(e,t,l),6);case 6:if(u=v.i,!e.g)return v.return();var y=e.g.X;y.C&&Rt(y.C,u,0,a),e.O=[],v.o(3);break;case 4:throw d=v.l(),t.jb=null,d;case 3:if(t.Ga&&t.Ga==c){v.A(0);break}return t.Ga=c,v.m(8),v.g(Td(e,t,c),10);case 10:if(f=v.i,!e.g)return v.return();y=e.g.X,y.C&&Rt(y.C,f,0,a),e.O.push(c.startTime),v.o(9);break;case 8:throw p=v.l(),t.Ga=null,p;case 9:if(!e.g)return v.return();if(t.Ob||(m=null,t.type===i.wa?m=e.h.get(i.$):t.type===i.$&&(m=e.h.get(i.wa)),m&&m.type==i.$?e.g.ud(c,t.stream,m.stream.isAudioMuxedInVideo,!0):e.g.ud(c,t.stream,t.stream.codecs.includes(`,`),!0)),h=Math.max.apply(Math,[0].concat(_(e.O))),g=e.g.Tb(),g+r>h)return v.g(vd(e,t,c.startTime,r),0);v.A(0)}})}function yd(e,t,n){var r,i,a,o,s,c,l,u,d,f;return k(function(p){switch(p.h){case 1:for(r=!1,i=g(e.h.values()),a=i.next();!a.done;a=i.next())if(o=a.value,o!=t&&o.dh){r=!0;break}if(r){p.A(2);break}if(e.i.avoidEvictionOnQuotaExceededError)return s=Md(e,n),e.g.disableStream(t.stream,s)||Od(e,t,4),p.return();if(c=Math.round(100*e.C),c>20){e.C-=.2,p.A(3);break}if(c>4){e.C-=.04,p.A(3);break}if(l=Md(e,n),u=e.g.disableStream(t.stream,l),!u){t.pd=!0,e.D=!0,e.g.onError(n),p.A(5);break}return e.C=1,d=e.g.Tb(),p.g(Cd(e,t,d),5);case 5:return p.return();case 3:return t.dh=!0,f=e.g.Tb(),p.g(Cd(e,t,f),2);case 2:Od(e,t,4),p.j()}})}function bd(e,t,n,r){var i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y;return k(function(b){switch(b.h){case 1:if(i=Pt,a=t.Ga==null,o=[],s=Math.max(0,Math.max(n.appendWindowStart,e.aa)-.1),c=Math.min(n.appendWindowEnd,e.Z)+.1,l=n.codecs||t.stream.codecs,u=Pr(l),d=Fr(n.mimeType||t.stream.mimeType),f=n.timestampOffset,f==t.lf&&s==t.mc&&c==t.lc&&u==t.jf&&d==t.kf){b.A(2);break}if(p=t.jf&&t.kf&&Nl(e.g.X,t.type,d,l,zd(e)),!p||(m=null,t.type===i.wa?m=e.h.get(i.$):t.type===i.$&&(m=e.h.get(i.wa)),!m)){b.A(3);break}return b.g(Ad(m).catch(function(){}),5);case 5:m.jb=null,m.mc=null,m.lc=null,ld(e,m);case 3:return b.g(xd(e,t,f,s,c,n,u,d),2);case 2:return Ks(n.ba,t.jb)||(t.jb=n.ba,n.l&&n.ba&&(h=Td(e,t,n.ba),g=function(){var a,o,s,c,l,u,d,f,p,m,g;return k(function(_){switch(_.h){case 1:return _.m(2),_.g(h,4);case 4:return a=_.i,Na(e.l),o=null,s=/* @__PURE__ */ new Map,c={projection:null,hfov:null},t.stream&&(l=t.stream.videoLayout)&&(u=l.split(`/`),u.includes(`PROJ-RECT`)?c.projection=`rect`:u.includes(`PROJ-EQUI`)?c.projection=`equi`:u.includes(`PROJ-HEQU`)?c.projection=`hequ`:u.includes(`PROJ-PRIM`)?c.projection=`prim`:u.includes(`PROJ-AIV`)&&(c.projection=`hequ`)),d=new Va,d.box(`moov`,Ha).box(`trak`,Ha).box(`mdia`,Ha).ma(`mdhd`,function(e){o=rs(e.reader,e.version).timescale}).ma(`hdlr`,function(e){switch(e=e.reader,e.skip(4),e=e.Nb(4,!1),String.fromCharCode(e[0],e[1],e[2],e[3])){case`soun`:s.set(i.$,o);break;case`vide`:s.set(i.wa,o)}o=null}),t.type!==i.wa||c.projection||d.box(`minf`,Ha).box(`stbl`,Ha).ma(`stsd`,Ua).boxes(`encv avc1 avc3 hev1 hvc1 dvav dva1 dvh1 dvhe dvc1 dvi1`.split(` `),Wa).box(`vexu`,Ha).box(`proj`,Ha).ma(`prji`,function(e){e=e.reader.yd(),c.projection=e}).box(`hfov`,function(e){e=e.reader.V()/1e3,c.hfov=e}),d.parse(a,!0,!0),t.type===i.wa&&Pd(e,c),s.has(t.type)?n.ba.timescale=s.get(t.type):o!=null&&(n.ba.timescale=o),f=t.stream.segmentIndex,f instanceof pu&&(p=hu(f,n.startTime)),m=t.stream.closedCaptions&&t.stream.closedCaptions.size>0,_.g(e.g.Rh(t.type,a),5);case 5:return _.g(cl(e.g.X,t.type,a,null,t.stream,m,t.Uc,r,!1,!1,p),6);case 6:_.o(0);break;case 2:throw g=_.l(),t.jb=null,g}})},_=n.startTime,a&&(v=rl(e.g.X,t.type),v!=null&&(_=v)),e.g.Ek(_,n.ba),o.push(g()))),y=t.Ga?t.Ga.i:-1,n.i!=y&&o.push(pl(e.g.X,t.type,n.startTime)),b.g(Promise.all(o),0)}})}function xd(e,t,n,r,i,a,o,s){var c,l,u,d,f;return k(function(p){switch(p.h){case 1:if(c=Pt,l=zd(e),p.m(2),t.mc=r,t.lc=i,o&&(t.jf=o),s&&(t.kf=s),t.lf=n,u=e.j.sequenceMode||e.j.type==`HLS`,d=null,t.type===c.wa?d=e.h.get(c.$):t.type===c.$&&(d=e.h.get(c.wa)),!(d&&d.stream&&d.stream.isAudioMuxedInVideo)){p.A(4);break}return p.g(fl(e.g.X,d.type,n,r,i,u,d.stream.mimeType,d.stream.codecs,l),4);case 4:return p.g(fl(e.g.X,t.type,n,r,i,u,a.mimeType||t.stream.mimeType,a.codecs||t.stream.codecs,l),6);case 6:p.o(0);break;case 2:throw f=p.l(),t.mc=null,t.lc=null,t.jf=null,t.kf=null,t.lf=null,f}})}function Sd(e,t,n,r,i,a,o,s){o=o!==void 0&&o,s=s!==void 0&&s;var c,l,u,d;return k(function(f){switch(f.h){case 1:return c=r.closedCaptions&&r.closedCaptions.size>0,e.i.shouldFixTimestampOffset&&(l=r.mimeType==`video/mp4`||r.mimeType==`audio/mp4`,u=null,i.ba&&(u=i.ba.timescale),l&&u&&r.type===`video`&&e.j.type==`DASH`&&new Va().box(`moof`,Ha).box(`traf`,Ha).ma(`tfdt`,function(n){var r,a,o,s,c,l;return k(function(d){return r=ns(n.reader,n.version),a=r.baseMediaDecodeTime,a?(o=-a/u,s=Number(t.lf)||0,s<o?(c=t.mc,l=t.lc,d.g(xd(e,t,o,c,l,i),0)):d.A(0)):d.return()})}).parse(a,!1,o)),f.g(Cd(e,t,n),2);case 2:return Na(e.l),d=t.Uc,t.Uc=!1,f.g(e.g.Rh(t.type,a),3);case 3:return f.g(cl(e.g.X,t.type,a,i,r,c,d,s,o),4);case 4:Na(e.l),f.j()}})}function Cd(e,t,n){var r,i,a,o,s,c,l,u,d;return k(function(f){if(f.h==1)return e.H==t&&(e.H=null),r=t.stream.segmentIndex,r instanceof pu&&(r.Va(e.j.presentationTimeline.Fb()),i=[],mu(r,function(e){i.push(e.Qe())})),a=Math.max(e.i.bufferBehind*e.C,e.j.presentationTimeline.h),o=nl(e.g.X,t.type),o==null?f.return():(s=n-o,c=e.i.evictionGoal,l=e.j.presentationTimeline.Ub(),u=e.j.presentationTimeline.Eb(),d=s-a,u-l>c&&(d=Math.max(s-a,l-c-o)),d<=c?f.return():f.g(e.g.X.remove(t.type,o,o+d,i),2));if(f.h!=4)return Na(e.l),e.H?f.g(Cd(e,e.H,n),4):f.A(0);Na(e.l),f.j()})}function wd(e){return e&&e.type==Nt&&(e.stream.mimeType==`application/cea-608`||e.stream.mimeType==`application/cea-708`)}function Td(e,t,n,r){var i,a,o,s,c;return k(function(l){switch(l.h){case 1:if(i=n.Vb())return l.return(i);if(a=null,t.ha){var u=t.ha,d=u.g;n instanceof Gs&&(d=u.j),d.has(n)?(u=d.get(n),r&&(u.yh=r),a=u.ge):a=null}return a||(a=Ed(n,t.stream,r||null,e.i.retryParameters,e.g.qc)),o=0,t.sa&&(o=t.sa.h),t.Wa=a,l.g(a.promise,2);case 2:if(s=l.i,t.Wa=null,c=s.data,!n.aesKey){l.A(3);break}return l.g(Ku(c,n.aesKey,o),4);case 4:c=l.i;case 3:return l.return(c)}})}function Ed(e,t,n,r,i,a){a=a!==void 0&&a;var o=e instanceof H?e:void 0,s=+!!o;return e=Yu(e.P(),e.startByte,e.endByte,r,n),e.contentType=t.type,i.request(ka,e,{type:s,stream:t,segment:o,isPreload:a})}function Dd(e,t,n,r){var i,a;return k(function(o){if(o.h==1)return t.Ob=!1,t.Id=!1,t.dd=0,t.Qb=!0,t.Ga=null,t.sa=null,t.ha&&!e.m.has(t.stream)&&Pu(t.ha),r?(i=e.g.Tb(),a=e.g.X.getDuration(),o.g(e.g.X.remove(t.type,i+r,a),3)):o.g(dl(e.g.X,t.type),4);if(o.h!=3)return Na(e.l),n?o.g(e.g.X.flush(t.type),3):o.A(3);Na(e.l),t.Qb=!1,t.endOfStream=!1,t.Ja||t.kb||Od(e,t,0),o.j()})}function Od(e,t,n){var r=t.type;(r!=Nt||e.h.has(r))&&(t.kb=new Qr(function(){var n;return k(function(r){if(r.h==1)return r.m(2),r.g(md(e,t),4);if(r.h!=2)return r.o(0);n=r.l(),e.g&&e.g.onError(n),r.j()})}).na(n))}function kd(e){e.kb!=null&&(e.kb.stop(),e.kb=null)}function Ad(e){return k(function(t){return e.Wa?t.g(e.Wa.abort(),0):t.A(0)})}function jd(e,t,n){var r,i,a,o;return k(function(s){switch(s.h){case 1:return n.code==3024?(t.Ja=!1,kd(t),Od(e,t,0),s.return()):s.g(ia(e.W),2);case 2:if(Na(e.l),n.category===1&&n.code!=1003){if(t.Ic)return nd(e,!1),s.return();r=Md(e,n),n.handled=e.g.disableStream(t.stream,r),n.handled&&(n.severity=1)}if(n.handled||n.code!=1011){s.A(3);break}for(i=e.g.Tb(),a=rl(e.g.X,t.type),o=gd(e,t,i,a);o?.Wb()===2;)t.Ga=o,o=gd(e,t,i,a);if(!o){s.A(3);break}return s.g(pl(e.g.X,t.type,o.startTime),5);case 5:return t.Ja=!1,t.pd=!1,kd(t),Od(e,t,0),s.return();case 3:(!n.handled||n.code!=1011)&&e.g.onError(n),n.handled||e.i.failureCallback(n),s.j()}})}function Md(e,t){return e.i.maxDisabledTime===0&&t.code==1011?1:e.i.maxDisabledTime}function Nd(e,t){t=t!==void 0&&t;var n,r,i,a,o,s;return k(function(c){return c.h==1?(n=Date.now()/1e3,r=e.i.minTimeBetweenRecoveries,!t&&(!e.i.allowMediaSourceRecoveries||n-e.R<r)?c.return(!1):(e.R=n,i=Pt,(a=e.h.get(i.$))&&(kd(a),a.Wa&&(a.Wa.abort(),a.Wa=null),a.jb=null,a.mc=null,a.lc=null,a.Ja=!1,a.Ob=!1,a.dd=0,a.Id=!1,a.Qb=!1,a.sa&&a.sa.ih()),(o=e.h.get(i.wa))&&(kd(o),o.Wa&&(o.Wa.abort(),o.Wa=null),o.jb=null,o.mc=null,o.lc=null,o.Ja=!1,o.Ob=!1,o.dd=0,o.Id=!1,o.Qb=!1,o.sa&&o.sa.ih()),s=e.g.video.paused,c.g(kl(e.g.X,zd(e)),2))):(!o||o.Qb||o.Ja||o.kb||Od(e,o,0),!a||a.Qb||a.Ja||a.kb||Od(e,a,0),s||e.g.video.play(),c.return(!0))})}function Pd(e,t){if(e.S.projection!=t.projection||e.S.hfov!=t.hfov){if(t.projection!=null||t.hfov!=null){var n=(/* @__PURE__ */ new Map()).set(`detail`,t);n=new V(`spatialvideoinfo`,n)}else n=new V(`nospatialvideoinfo`);n.cancelable=!0,e.g.onEvent(n),e.S=t}}function Fd(e){if(e.i.crossBoundaryStrategy!==`keep`)return!0;var t=we();if(!t.xb()){t=g(e.h.keys());for(var n=t.next();!n.done;n=t.next())if(n=e.h.get(n.value),n.type!==Pt.Pa&&(n=n.stream)&&n.fullMimeTypes&&n.fullMimeTypes.size>1)return!0}else if(!t.Jf()){for(t=g(e.h.keys()),n=t.next();!n.done;n=t.next())if(n=e.h.get(n.value),n.type!==Pt.Pa&&(n=n.stream)&&n.fullMimeTypes&&n.fullMimeTypes.size>1){for(e=/* @__PURE__ */ new Set,t=g(n.fullMimeTypes),n=t.next();!n.done;n=t.next())e.add(Mr(n.value));return e.size>1}}return!1}function Id(e){e.G.Sa(),Fd(e)&&(e.G.F(e.g.video,`waiting`,function(){return Ld(e)}),e.G.F(e.g.video,`timeupdate`,function(){return Ld(e)}))}function Ld(e){if(Fd(e)){e.K.stop();var t=e.g.Tb(),n=e.h.get(`video`)||e.h.get(`audio`);n&&(n=n.jb)&&n.g!==null&&(t=n.g-t,t<0||t>1||(e.I=n.g+.1,e.K.na(t)))}}function Rd(e,t,n){if(t.type===Nt)return!1;var r=t.jb;if(!r)return!1;var i=n.ba;if(n=r.g!==i.g,e.i.crossBoundaryStrategy===`reset_to_encrypted`&&(r.encrypted||i.encrypted||(n=!1),r.encrypted&&(e.i.crossBoundaryStrategy=`keep`)),e.i.crossBoundaryStrategy===`RESET_ON_ENCRYPTION_CHANGE`&&r.encrypted==i.encrypted&&(n=!1),e.i.crossBoundaryStrategy===`keep`&&r.mimeType&&i.mimeType){var a=Nr(Ir(r.mimeType)),o=Nr(Ir(i.mimeType));r.mimeType==i.mimeType&&a==o&&(n=!1)}return(e.h.get(`video`)||e.h.get(`audio`))===t&&n&&(e.J||t.Uc)&&(e.J=!1,Nd(e,!0).then(function(){var t=(/* @__PURE__ */ new Map()).set(`oldEncrypted`,r.encrypted).set(`newEncrypted`,i.encrypted);e.g.onEvent(new V(`boundarycrossed`,t))})),n}function zd(e,t){function n(t){if(t.fullMimeTypes&&t.fullMimeTypes.size>1&&e.h.has(t.type)){var n=e.h.get(t.type),r=rl(e.g.X,n.type),i=e.g.Tb();(n=gd(e,n,i,r))&&n.codecs&&n.mimeType&&(t.codecs=n.codecs,t.mimeType=n.mimeType)}}t=t!==void 0&&t;var r=/* @__PURE__ */ new Map,i=e.o.audio;return i&&(n(i),r.set(`audio`,i)),(i=e.o.video)&&(n(i),r.set(`video`,i)),t&&e.B&&r.set(Nt,e.B),r}function Bd(){}function Vd(e,t,n,r,i){for(var a=(i in r),o=/* @__PURE__ */ new Set([`__proto__`,`constructor`,`prototype`]),s=a?n.constructor==Object&&Object.keys(r).length==0:n.constructor==Object&&Object.keys(n).length==0,c=a||s,l=!0,u=g(Object.keys(t)),d=u.next();!d.done;d=u.next()){d=d.value;var f=i+`.`+d,p=a?r[i]:n[d];o.has(d)?(ce(`Invalid config, dangerous key `+f),l=!1):c||d in n?t[d]===void 0?p===void 0||c?delete e[d]:e[d]=fn(p):s?e[d]=t[d]:p.constructor==Object&&t[d]&&t[d].constructor==Object?(e[d]||(e[d]=fn(p)),d=Vd(e[d],t[d],p,r,f),l=l&&d):typeof t[d]!=typeof p||t[d]==null||typeof t[d]!=`function`&&t[d].constructor!=p.constructor?(ce(`Invalid config, wrong type for `+f),l=!1):typeof n[d]==`function`&&n[d].length!=t[d].length?(F(`Unexpected number of arguments for `+f),e[d]=t[d]):e[d]=Array.isArray(e[d])?t[d].slice():t[d]:(ce(`Invalid config, unrecognized key `+f),l=!1)}return l}function Hd(e,t){for(var n={},r=n,i=0,a=0;i=e.indexOf(`.`,i),!(i<0);)(i==0||e[i-1]!=`\\`)&&(a=e.substring(a,i).replace(/\\\./g,`.`),r[a]={},r=r[a],a=i+1),i+=1;return r[e.substring(a).replace(/\\\./g,`.`)]=t,n}function Ud(e,t){return e&&t}function Wd(e,t){function n(e){for(var t=g(Object.keys(e)),r=t.next();!r.done;r=t.next())if(r=r.value,!(e[r]instanceof HTMLElement)){if(i(e[r])&&Object.keys(e[r]).length===0)delete e[r];else{var a=e[r];Array.isArray(a)&&a.length===0||typeof e[r]==`function`?delete e[r]:i(e[r])&&(n(e[r]),Object.keys(e[r]).length===0&&delete e[r])}}}function r(e,t){return Object.keys(e).reduce(function(n,a){var o=e[a];return t.hasOwnProperty(a)?o instanceof HTMLElement&&t[a]instanceof HTMLElement?o.isEqualNode(t[a])||(n[a]=o):i(o)&&i(t[a])?(o=r(o,t[a]),(Object.keys(o).length>0||!i(o))&&(n[a]=o)):Array.isArray(o)&&Array.isArray(t[a])?me(o,t[a])||(n[a]=o):Number.isNaN(o)&&Number.isNaN(t[a])||o!==t[a]&&(n[a]=o):n[a]=o,n},{})}function i(e){return e&&typeof e==`object`&&!Array.isArray(e)}return e=r(e,t),n(e),e}P(`shaka.util.ConfigUtils`,Bd),Bd.getDifferenceFromConfigObjects=Wd,Bd.convertToConfigObject=Hd,Bd.mergeConfigObjects=Vd,P(`shaka.config.RepeatMode`,{OFF:0,ALL:1,SINGLE:2});function Gd(){}function Kd(e){return e=ht(e),new Ne(e).Bb}function qd(e,t,n){function r(e){$e(a).setUint32(o,e.byteLength,!0),o+=4,a.set(Ze(e),o),o+=e.byteLength}if(!n||!n.byteLength)throw new R(2,6,6015);var i=typeof t==`string`?_t(t,!0):t;e=ht(e),e=_t(e,!0);var a=new Uint8Array(12+e.byteLength+i.byteLength+n.byteLength),o=0;return r(e),r(i),r(n),a}function Jd(e,t,n){return t===`skd`?(t=n.serverCertificate,n=ht(e).split(`skd://`).pop(),qd(e,n,t)):e}function Yd(e,t){e===2&&(e=t.drmInfo)&&ot(e.keySystem)&&(t.headers[`Content-Type`]=`application/octet-stream`)}P(`shaka.drm.FairPlay`,Gd),Gd.commonFairPlayResponse=function(e,t){if(e===2&&(e=t.originalRequest.drmInfo)&&ot(e.keySystem)){try{var n=pt(t.data)}catch{return}if(e=!1,n=n.trim(),n.substr(0,5)===`<ckc>`&&n.substr(-6)===`</ckc>`&&(n=n.slice(5,-6),e=!0),!e)try{var r=JSON.parse(n);r.ckc&&(n=r.ckc,e=!0),r.CkcMessage&&(n=r.CkcMessage,e=!0),r.License&&(n=r.License,e=!0)}catch{}e&&(t.data=Xe(Ct(n)))}},Gd.muxFairPlayRequest=function(e,t){Yd(e,t)},Gd.expressplayFairPlayRequest=function(e,t){if(e===2){var n=t.drmInfo;n&&ot(n.keySystem)&&Yd(e,t)}},Gd.conaxFairPlayRequest=function(e,t){Yd(e,t)},Gd.ezdrmFairPlayRequest=function(e,t){Yd(e,t)},Gd.verimatrixFairPlayRequest=function(e,t){e===2&&(e=t.drmInfo)&&ot(e.keySystem)&&(e=Ze(t.body),e=St(e),t.headers[`Content-Type`]=`application/x-www-form-urlencoded`,t.body=gt(`spc=`+e))},Gd.muxInitDataTransform=function(e,t,n){return Jd(e,t,n)},Gd.expressplayInitDataTransform=function(e,t,n){return Jd(e,t,n)},Gd.conaxInitDataTransform=function(t,n,r){if(n!==`skd`)return t;n=r.serverCertificate,r=ht(t).split(`skd://`).pop().split(`?`).shift(),r=e.atob(r);var i=/* @__PURE__ */ new ArrayBuffer(r.length*2);i=Qe(i);for(var a=0,o=r.length;a<o;a++)i[a]=r.charCodeAt(a);return qd(t,i,n)},Gd.ezdrmInitDataTransform=function(e,t,n){return t===`skd`?(t=n.serverCertificate,n=ht(e).split(`;`).pop(),qd(e,n,t)):e},Gd.verimatrixInitDataTransform=function(e,t,n){return Jd(e,t,n)},Gd.initDataTransform=qd,Gd.defaultGetContentId=Kd,Gd.isFairPlaySupported=function(){var e;return k(function(t){return t.h==1?(e={initDataTypes:[`cenc`,`sinf`,`skd`],videoCapabilities:[{contentType:`video/mp4; codecs="avc1.42E01E"`}]},t.m(2),t.g(navigator.requestMediaKeySystemAccess(`com.apple.fps`,[e]),4)):t.h==2?(t.l(),t.return(!1)):t.return(!0)})};function Xd(e,t,n){for(n=n===void 0||n,this.h=e,this.g=/* @__PURE__ */ new Set([e]),t=t||[],e=g(t),t=e.next();!t.done;t=e.next())this.add(t.value,n)}Xd.prototype.add=function(e,t){var n=this.h;t=t===void 0||t;var r;if(!(r=!!n.audio!=!!e.audio||!!n.video!=!!e.video||n.language!=e.language)&&(r=n.audio&&e.audio)){r=n.audio;var i=e.audio;r=!(!((!r.channelsCount||!i.channelsCount||r.channelsCount>2||i.channelsCount>2)&&r.channelsCount!=i.channelsCount||r.spatialAudio!==i.spatialAudio||t&&!Zd(r,i))&&me(r.roles,i.roles)&&r.groupId===i.groupId)}return!r&&(r=n.video&&e.video)&&(n=n.video,r=e.video,r=!((!t||Zd(n,r))&&me(n.roles,r.roles))),!r&&(this.g.add(e),!0)},Xd.prototype.values=function(){return this.g.values()};function Zd(e,t){return e.mimeType==t.mimeType&&(e=e.codecs.split(`,`).map(function(e){return Pr(e)}),t=t.codecs.split(`,`).map(function(e){return Pr(e)}),me(e,t))}P(`shaka.media.AdaptationSet`,Xd);function Qd(){this.h=this.g=null}Qd.prototype.configure=function(e){this.g=e},Qd.prototype.getConfiguration=function(){return this.g},Qd.prototype.create=function(e){var t;if(this.g.language){var n=$d(e,this.g.language);n.length&&(t=n)}t||(t=e.filter(function(e){return e.primary}),t=t.length?t:e),e=ef(t,this.g.role),e.length&&(t=e),e=tf(t,this.g.videoRole),e.length&&(t=e),this.g.videoLayout&&(e=sf(t,this.g.videoLayout),e.length&&(t=e)),this.g.hdrLevel&&(e=of(t,this.g.hdrLevel),e.length&&(t=e));var r=[this.g.channelCount,this.g.preferredAudioChannelCount];if(e=r.filter(function(e,t){return e&&r.indexOf(e)===t}),e.length){for(e=g(e),n=e.next();!n.done;n=e.next())if(n=af(t,n.value),n.length){t=n;break}}this.g.audioLabel&&(e=nf(t,this.g.audioLabel),e.length&&(t=e)),this.g.videoLabel&&(e=rf(t,this.g.videoLabel),e.length&&(t=e)),e=cf(t,this.g.spatialAudio),e.length&&(t=e);var i=[this.g.audioCodec,this.g.activeAudioCodec].concat(_(this.g.preferredAudioCodecs));if(e=i.filter(function(e,t){return e&&i.indexOf(e)===t}),e.length){for(e=g(e),n=e.next();!n.done;n=e.next())if(n=lf(t,n.value),n.length){t=n;break}}return e=we(),e=this.g.codecSwitchingStrategy==`smooth`&&e.xb(),this.h=new Xd(t[0],t,!e)},Qd.prototype.getLastAdaptationSet=function(){return this.h};function $d(e,t){t=li(t);var n=pi(t,e.map(function(e){return fi(e)}));return n?e.filter(function(e){return n==fi(e)}):[]}function ef(e,t){return e.filter(function(e){return e.audio?t?e.audio.roles.includes(t):e.audio.roles.length==0:!1})}function tf(e,t){return e.filter(function(e){return e.video?t?e.video.roles.includes(t):e.video.roles.length==0:!1})}function nf(e,t){return e.filter(function(e){return e.audio&&e.audio.label?e.audio.label.toLowerCase()==t.toLowerCase():!1})}function rf(e,t){return e.filter(function(e){return e.video&&e.video.label?e.video.label.toLowerCase()==t.toLowerCase():!1})}function af(e,t){return e.filter(function(e){return!(e.audio&&e.audio.channelsCount&&e.audio.channelsCount>t)}).sort(function(e,t){return e.audio||t.audio?e.audio?t.audio?(t.audio.channelsCount||0)-(e.audio.channelsCount||0):1:-1:0})}function of(e,t){if(t==`AUTO`){var n=e.some(function(e){return!!(e.video&&e.video.hdr&&e.video.hdr==`HLG`)});t=we().md(n)}return e.filter(function(e){return!(e.video&&e.video.hdr&&e.video.hdr!=t)})}function sf(e,t){return e.filter(function(e){return!(e.video&&e.video.videoLayout&&e.video.videoLayout!=t)})}function cf(e,t){return e.filter(function(e){return!(e.audio&&e.audio.spatialAudio!=t)})}function lf(e,t){return e.filter(function(e){return!(e.audio&&e.audio.codecs!=t)})}function uf(){}function df(){var t=1/0,n=we();navigator.connection&&navigator.connection.saveData&&(t=360);var r={retryParameters:aa(),servers:{},clearKeys:{},advanced:{},delayLicenseRequestUntilPlayed:!1,persistentSessionOnlinePlayback:!1,persistentSessionsMetadata:[],initDataTransform:function(t,n,r){return e.shakaMediaKeysPolyfill===`apple`&&n==`skd`&&(n=r.serverCertificate,r=Kd(t),t=qd(t,r,n)),t},logLicenseExchange:!1,updateExpirationTime:1,preferredKeySystems:[],keySystemsMapping:{},parseInbandPsshEnabled:!1,minHdcpVersion:``,ignoreDuplicateInitData:!0,defaultAudioRobustnessForWidevine:`SW_SECURE_CRYPTO`,defaultVideoRobustnessForWidevine:`SW_SECURE_DECODE`},i=`reload`;n.xb()&&(i=`smooth`);var a={retryParameters:aa(),availabilityWindowOverride:NaN,disableAudio:!1,disableVideo:!1,disableText:!1,disableThumbnails:!1,disableIFrames:!1,defaultPresentationDelay:0,segmentRelativeVttTiming:!1,raiseFatalErrorOnManifestUpdateRequestFailure:!1,continueLoadingWhenPaused:!0,ignoreSupplementalCodecs:!1,updatePeriod:-1,ignoreDrmInfo:!1,enableAudioGroups:!0,dash:{clockSyncUri:``,disableXlinkProcessing:!0,xlinkFailGracefully:!1,ignoreMinBufferTime:!1,autoCorrectDrift:!0,initialSegmentLimit:1e3,ignoreSuggestedPresentationDelay:!1,ignoreEmptyAdaptationSet:!1,ignoreMaxSegmentDuration:!1,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:hf,manifestPreprocessorTXml:gf,sequenceMode:!1,useStreamOnceInPeriodFlattening:!1,enableFastSwitching:!0},hls:{ignoreTextStreamFailures:!1,ignoreImageStreamFailures:!1,defaultAudioCodec:`mp4a.40.2`,defaultVideoCodec:`avc1.42E01E`,ignoreManifestProgramDateTime:!1,ignoreManifestProgramDateTimeForTypes:[],mediaPlaylistFullMimeType:`video/mp2t; codecs="avc1.42E01E, mp4a.40.2"`,liveSegmentsDelay:3,sequenceMode:n.Yc(),ignoreManifestTimestampsInSegmentsMode:!1,disableCodecGuessing:!1,disableClosedCaptionsDetection:!1,allowLowLatencyByteRangeOptimization:!0,allowRangeRequestsToGuessMimeType:!1},mss:{manifestPreprocessor:hf,manifestPreprocessorTXml:gf,sequenceMode:!1,keySystemsBySystemId:{"9a04f079-9840-4286-ab92-e65be0885f95":`com.microsoft.playready`,"79f0049a-4098-8642-ab92-e65be0885f95":`com.microsoft.playready`}}},o={trackSelectionCallback:function(e){return k(function(t){return t.return(e)})},downloadSizeCallback:function(e){var t;return k(function(n){return n.h==1?navigator.storage&&navigator.storage.estimate?n.g(navigator.storage.estimate(),3):n.return(!0):(t=n.i,n.return(t.usage+e<t.quota*.95))})},progressCallback:function(e,t){return Ud([e,t])},usePersistentLicense:!0,numberOfParallelDownloads:5},s={drm:r,manifest:a,streaming:{retryParameters:aa(),failureCallback:function(e){return Ud([e])},rebufferingGoal:0,bufferingGoal:10,bufferBehind:30,evictionGoal:1,ignoreTextStreamFailures:!1,alwaysStreamText:!1,startAtSegmentBoundary:!1,gapDetectionThreshold:.5,gapPadding:0,gapJumpTimerTime:.25,durationBackoff:1,safeSeekOffset:5,safeSeekEndOffset:0,stallEnabled:!0,stallThreshold:1,stallSkip:.1,useNativeHlsForFairPlay:!0,inaccurateManifestTolerance:2,lowLatencyMode:!0,preferNativeDash:!1,preferNativeHls:!1,updateIntervalSeconds:1,observeQualityChanges:!1,maxDisabledTime:30,segmentPrefetchLimit:1,prefetchAudioLanguages:[],disableAudioPrefetch:!1,disableTextPrefetch:!1,disableVideoPrefetch:!1,liveSync:{enabled:!1,targetLatency:.5,targetLatencyTolerance:.5,maxPlaybackRate:1.1,minPlaybackRate:.95,panicMode:!1,panicThreshold:60,dynamicTargetLatency:{enabled:!1,stabilityThreshold:60,rebufferIncrement:.5,maxAttempts:10,maxLatency:4,minLatency:1}},allowMediaSourceRecoveries:!0,minTimeBetweenRecoveries:5,vodDynamicPlaybackRate:!1,vodDynamicPlaybackRateLowBufferRate:.95,vodDynamicPlaybackRateBufferRatio:.5,preloadNextUrlWindow:30,loadTimeout:30,clearDecodingCache:!1,dontChooseCodecs:!1,shouldFixTimestampOffset:!1,avoidEvictionOnQuotaExceededError:!1,crossBoundaryStrategy:`keep`,returnToEndOfLiveWindowWhenOutside:!1},networking:{forceHTTP:!1,forceHTTPS:!1,minBytesForProgressEvents:16e3},mediaSource:{codecSwitchingStrategy:i,addExtraFeaturesToSourceBuffer:function(e){return Ud([e],``)},forceTransmux:!1,insertFakeEncryptionInInit:!0,correctEc3Enca:!1,modifyCueCallback:function(e,t,n){return Ud([e,t,n])},dispatchAllEmsgBoxes:!1,useSourceElements:!0,durationReductionEmitsUpdateEnd:!0},offline:o,abrFactory:function(){return new Qi},adaptationSetCriteriaFactory:function(){return new(Function.prototype.bind.apply(Qd,[null].concat(_(A.apply(0,arguments)))))},abr:{enabled:!0,useNetworkInformation:!0,defaultBandwidthEstimate:1e6,switchInterval:8,bandwidthUpgradeTarget:.85,bandwidthDowngradeTarget:.95,restrictions:{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:t,minPixels:0,maxPixels:1/0,minFrameRate:0,maxFrameRate:1/0,minBandwidth:0,maxBandwidth:1/0,minChannelsCount:0,maxChannelsCount:1/0},advanced:{minTotalBytes:128e3,minBytes:16e3,fastHalfLife:2,slowHalfLife:5},restrictToElementSize:!1,restrictToScreenSize:!1,ignoreDevicePixelRatio:!1,clearBufferSwitch:!1,safeMarginSwitch:0,cacheLoadThreshold:5,minTimeToSwitch:0,preferNetworkInformationBandwidth:!1,removeLatencyFromFirstPacketTime:!1},autoShowText:3,preferredAudioLanguage:``,preferredAudioLabel:``,preferredTextLanguage:``,preferredAudioRole:``,preferredVideoRole:``,preferredTextRole:``,preferredAudioChannelCount:2,preferredVideoHdrLevel:`AUTO`,preferredVideoLayout:``,preferredVideoLabel:``,preferredVideoCodecs:[],preferredAudioCodecs:[],preferredTextFormats:[],preferForcedSubs:!1,preferSpatialAudio:!1,preferredDecodingAttributes:[],restrictions:{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:1/0,minPixels:0,maxPixels:1/0,minFrameRate:0,maxFrameRate:1/0,minBandwidth:0,maxBandwidth:1/0,minChannelsCount:0,maxChannelsCount:1/0},playRangeStart:0,playRangeEnd:1/0,textDisplayer:{captionsUpdatePeriod:.25,fontScaleFactor:1},textDisplayFactory:function(){return null},cmcd:{enabled:!1,sessionId:``,contentId:``,rtpSafetyFactor:5,useHeaders:!1,includeKeys:[],version:1,targets:[]},cmsd:{enabled:!0,applyMaximumSuggestedBitrate:!0,estimatedThroughputWeightRatio:.5},lcevc:{enabled:!1,dynamicPerformanceScaling:!0,logLevel:0,drawLogo:!1,poster:!0},ads:{customPlayheadTracker:!1,skipPlayDetection:!1,supportsMultipleMediaElements:!0,disableHLSInterstitial:!1,disableDASHInterstitial:!1,allowPreloadOnDomElements:!0,allowStartInMiddleOfInterstitial:!0},ignoreHardwareResolution:!1,queue:{preloadNextUrlWindow:1/0,preloadPrevItem:!0,repeatMode:0}};return o.trackSelectionCallback=function(e){return k(function(t){return t.return(mf(e,s.preferredAudioLanguage,s.preferredVideoHdrLevel))})},n.Xa(s)}function ff(){return{streaming:{inaccurateManifestTolerance:0,segmentPrefetchLimit:2,updateIntervalSeconds:.1,maxDisabledTime:1,retryParameters:{baseDelay:100}},manifest:{dash:{autoCorrectDrift:!1},retryParameters:{baseDelay:100}},drm:{retryParameters:{baseDelay:100}}}}function pf(e,t,n){var r={".drm.keySystemsMapping":``,".drm.servers":``,".drm.clearKeys":``,".drm.advanced":{distinctiveIdentifierRequired:!1,persistentStateRequired:!1,videoRobustness:[],audioRobustness:[],sessionType:``,serverCertificate:/* @__PURE__ */ new Uint8Array,serverCertificateUri:``,individualizationServer:``,headers:{}}};return Vd(e,t,n||df(),r,``)}function mf(e,t,n){var r=n;r==`AUTO`&&(n=e.some(function(e){return!!(e.hdr&&e.hdr==`HLG`)}),r=we().md(n));var i=e.filter(function(e){return!(e.type!=`variant`||e.hdr&&e.hdr!=r)});n=[];var a=pi(t,i.map(function(e){return e.language}));a&&(n=i.filter(function(e){return li(e.language)==a})),n.length==0&&(n=i.filter(function(e){return e.primary})),n.length==0&&(i.map(function(e){return e.language}),n=i);var o=n.filter(function(e){return e.height&&e.height<=480});for(o.length&&(o.sort(function(e,t){return t.height-e.height}),n=o.filter(function(e){return e.height==o[0].height})),t=[],n.length&&(i=Math.floor(n.length/2),n.sort(function(e,t){return e.bandwidth-t.bandwidth}),t.push(n[i])),e=g(e),n=e.next();!n.done;n=e.next())n=n.value,n.type!=Nt&&n.type!=`image`||t.push(n);return t}function hf(e){return Ud([e],e)}function gf(e){return Ud([e],e)}P(`shaka.util.PlayerConfiguration`,uf),uf.mergeConfigObjects=pf,uf.createDefaultForLL=ff,uf.createDefault=df;function _f(){this.g=null,this.h=[]}function vf(e,t){var n=0;e.g&&e.g.state==t&&(n+=e.g.duration),e=g(e.h);for(var r=e.next();!r.done;r=e.next())r=r.value,n+=r.state==t?r.duration:0;return n}function yf(e){function t(e){return{timestamp:e.timestamp,state:e.state,duration:e.duration}}for(var n=[],r=g(e.h),i=r.next();!i.done;i=r.next())n.push(t(i.value));return e.g&&n.push(t(e.g)),n}function bf(){this.i=this.h=null,this.g=[]}function xf(e,t,n){e.i!=t&&(e.i=t,e.g.push({timestamp:Date.now()/1e3,id:t.id,type:`text`,fromAdaptation:n,bandwidth:null}))}function Sf(){this.C=this.W=NaN,this.l=``,this.j=this.si=this.u=this.B=this.K=this.D=this.o=this.m=this.J=this.G=this.i=this.S=this.U=this.N=this.O=this.R=NaN,this.M=0,this.H=this.I=NaN,this.g=new _f,this.h=new bf}function Cf(e,t,n){e.R=t,e.O=n}function wf(e,t,n){e.W=t,e.C=n}function Tf(e,t){e.i=isNaN(e.i)?t:Math.max(e.i,t)}function Ef(e,t){t>=0&&(e.o=t)}function Df(e,t){t>=0&&(e.D=t)}function Of(e,t){t>=0&&(e.K=t)}function kf(e,t){e.j=isNaN(e.j)?t:e.j+t}function Af(e){var t=e.W,n=e.C,r=e.l,i=e.B,a=e.O,o=e.R,s=e.N,c=e.U,l=e.S,u=e.u,d=e.i,f=e.G,p=e.J,m=e.m,h=vf(e.g,`playing`),_=vf(e.g,`paused`),v=vf(e.g,`buffering`),y=e.o,b=e.D,x=e.K,S=e.si,C=e.j,w=e.M,T=e.I,E=e.H,D=yf(e.g),O=[];e=g(e.h.g);for(var k=e.next();!k.done;k=e.next())k=k.value,O.push({timestamp:k.timestamp,id:k.id,type:k.type,fromAdaptation:k.fromAdaptation,bandwidth:k.bandwidth});return{width:t,height:n,currentCodecs:r,streamBandwidth:i,decodedFrames:a,droppedFrames:o,corruptedFrames:s,stallsDetected:c,gapsJumped:l,estimatedBandwidth:u,completionPercent:d,loadLatency:f,manifestTimeSeconds:p,drmTimeSeconds:m,playTime:h,pauseTime:_,bufferingTime:v,licenseTime:y,liveLatency:b,maxSegmentDuration:x,manifestSizeBytes:S,bytesDownloaded:C,nonFatalErrorCount:w,manifestPeriodCount:T,manifestGapCount:E,stateHistory:D,switchHistory:O}}function jf(e,t,n,r){ga.call(this),this.N=e,this.U=t,this.Ca=r.networkingEngine,this.o=n,this.C=null,this.za=0,this.Ka=r.ed,this.G=r.wk,this.Ua=r.xk,this.g=r.config,this.m=this.H=this.h=null,this.qa=!1,this.I=r.Kk,this.ua=!1,this.j=null,this.aa=!1,this.u=null,this.M=/* @__PURE__ */ new Map,this.ya=!1,this.Ha=r.Jk,this.W=new Sf,this.ia=new oa,this.B=new oa,this.O=null,this.l=!1,this.Z=r.nj,this.S=this.i=null,this.R=!1,this.K=[],this.J=[],this.D=!0}m(jf,ga);function Mf(e,t,n){(e=t?e.J:e.K)?e.push(n):n()}function Nf(e){if(e.J)for(var t=g(e.J),n=t.next();!n.done;n=t.next())n=n.value,n();e.J=null}function Pf(e,t){if(e.O=t,e.R=!0,e.K){t=g(e.K);for(var n=t.next();!n.done;n=t.next())n=n.value,n()}e.K=null}r=jf.prototype,r.getStartTime=function(){return this.o},r.kd=function(){return this.N},r.Gg=function(){return this.h};function Ff(e){return e.ua=!0,e.I}r.getStats=function(){return this.W};function If(e){return e.aa=!0,e.j}r.Tj=function(){return this.i?Ni(this.i):null},r.Sj=function(){return this.S?Pi(this.S):null};function Lf(e){return e.ya=!0,e.M}r.start=function(){var t=this;(function(){var n;return k(function(r){switch(r.h){case 1:return r.g(Promise.resolve(),2);case 2:return r.m(3),r.g(Bf(t),5);case 5:if(Rf(t),e.shakaMediaKeysPolyfill===`webkit`){r.A(6);break}return r.g(Vf(t),7);case 7:Rf(t);case 6:return r.g(Uf(t),8);case 8:if(Rf(t),!t.Z){r.A(9);break}return r.g(Wf(t),10);case 10:Rf(t);case 9:if(!t.Z||!t.j){r.A(11);break}return r.g(So(t.j),12);case 12:Rf(t);case 11:t.B.resolve(),r.o(0);break;case 3:n=r.l(),n instanceof R&&(n.code==7001||n.code==7003)||t.B.reject(n),r.j()}})})()},r.dispatchEvent=function(e){return this.O?this.O.dispatchEvent(e):ga.prototype.dispatchEvent.call(this,e)},r.onError=function(e){e.severity===2&&(this.B.reject(e),this.destroy());var t=(/* @__PURE__ */ new Map()).set(`detail`,e);t=new V(`error`,t),this.dispatchEvent(t),t.defaultPrevented&&(e.handled=!0)};function Rf(e){if(e.l)throw new R(2,7,7003)}function zf(e,t){e.dispatchEvent(new V(`onstatechange`,(/* @__PURE__ */ new Map()).set(`state`,t)))}function Bf(e){var t,n,r,i,a,o;return k(function(s){switch(s.h){case 1:if(zf(e,`manifest-parser`),e.m||(e.H=Wt(e.N,e.U),e.m=e.H(),e.m.configure(e.g.manifest,function(){return e.D})),t=Date.now()/1e3,zf(e,`manifest`),e.h){s.A(2);break}return s.g(e.m.start(e.N,e.Ua),3);case 3:return e.h=s.i,Yf(e.h),s.g(Hf(e),2);case 2:return e.ia.resolve(),n=new V(`manifestparsed`,void 0),s.g(Promise.resolve(),5);case 5:if(e.dispatchEvent(n),e.h.variants.length==0)throw new R(2,4,4036);if(Yf(e.h),r=qo(e.G,e.h),!r){s.A(6);break}return i=new V(`trackschanged`,void 0),s.g(Promise.resolve(),7);case 7:Rf(e),e.dispatchEvent(i);case 6:a=Date.now()/1e3,o=a-t,o>=0&&(e.W.J=o),s.j()}})}function Vf(e,t){var n,r,i,a;return k(function(o){switch(o.h){case 1:return!e.h||e.j?o.return():(zf(e,`drm-engine`),e.za=Date.now()/1e3,e.j=e.Ka(),e.G.g=e.j,e.j.configure(e.g.drm,function(){return e.D}),n=Bi(e.h.variants),r=!0,e.h&&e.h.presentationTimeline&&(r=e.h.presentationTimeline.T()),o.g(ro(e.j,n,e.h.offlineSessionIds,r),2));case 2:if(Rf(e),!t){o.A(3);break}return o.g(e.j.Pb(t),4);case 4:Rf(e);case 3:return o.g(Ko(e.G,e.h),5);case 5:if(i=o.i,!i){o.A(0);break}return a=new V(`trackschanged`,void 0),o.g(Promise.resolve(),7);case 7:e.dispatchEvent(a),o.j()}})}r.configure=function(e,t){e=Hd(e,t),pf(this.g,e)},r.getConfiguration=function(){return fn(this.g)};function Hf(e){return k(function(t){return e.C||(e.C=e.g.adaptationSetCriteriaFactory(),e.C.configure({language:e.g.preferredAudioLanguage,role:e.g.preferredAudioRole,videoRole:e.g.preferredVideoRole,channelCount:0,hdrLevel:e.g.preferredVideoHdrLevel,spatialAudio:e.g.preferSpatialAudio,videoLayout:e.g.preferredVideoLayout,audioLabel:e.g.preferredAudioLabel,videoLabel:e.g.preferredVideoLabel,codecSwitchingStrategy:e.g.mediaSource.codecSwitchingStrategy,audioCodec:``,activeAudioCodec:``,activeAudioChannelCount:0,preferredAudioCodecs:e.g.preferredAudioCodecs,preferredAudioChannelCount:e.g.preferredAudioChannelCount})),e.i||!e.h.variants.length||e.h.variants.length!=1&&e.h.type!=`HLS`?t.A(0):(e.i=Gf(e),e.i?t.g(qf(e.i),0):t.A(0))})}function Uf(e){return k(function(t){return t.h==1?!e.i||e.h.variants.includes(e.i)?t.A(0):t.g(Jf(e.i),3):(e.i=Gf(e),e.i?t.g(qf(e.i),0):t.A(0))})}function Wf(e){var t,n,r,i,a;return k(function(o){return!e.i&&(t=Gf(e))&&(e.i=t),e.i?(n=e.h.presentationTimeline.T(),r=[],i=e.i,i.video&&r.push(Kf(e,i.video,n)),i.audio&&r.push(Kf(e,i.audio,n)),(a=Vi(e.h.textStreams,e.g.preferredTextLanguage,e.g.preferredTextRole,e.g.preferForcedSubs)[0]||null)&&Ki(i.audio,a,e.g)&&(r.push(Kf(e,a,n)),e.S=a),o.g(Promise.all(r),0)):o.A(0)})}function Gf(e){if(!e.u){var t=e.g.abrFactory;e.u=t(),e.u.configure(e.g.abr)}return t=Bi(e.h.variants),t=e.C.create(t),e.u.setVariants(Array.from(t.values())),e.u.chooseVariant(!0)}function Kf(e,t,n){var r,i,a,o,s;return k(function(c){return c.h==1?(r=e.g.streaming.segmentPrefetchLimit||2,i=new ku(r,t,function(t,n,r){return Ed(t,n,r||null,e.g.streaming.retryParameters,e.Ca,e.D)},!1),e.M.set(t.id,i),t.segmentIndex?c.A(2):c.g(t.createSegmentIndex(),2)):(a=typeof e.o==`number`?e.o:0,o=t.segmentIndex.Rb(a),s=null,o&&(s=o.current(),s||(s=o.next().value)),s||(s=t.segmentIndex.Cb()),s?n?s.ba?c.g(Mu(i,s.ba),0):c.A(0):c.g(ju(i,s.startTime),0):c.A(0))})}function qf(e){var t,n,r,i;return k(function(a){for(t=[],n=g([e.video,e.audio]),r=n.next();!r.done;r=n.next())(i=r.value)&&!i.segmentIndex&&t.push(i.createSegmentIndex());return t.length>0?a.g(Promise.all(t),0):a.A(0)})}function Jf(e){var t,n,r,i;return k(function(a){for(t=[],n=g([e.video,e.audio]),r=n.next();!r.done;r=n.next())(i=r.value)&&i.segmentIndex&&i.closeSegmentIndex&&t.push(i.closeSegmentIndex());return t.length>0?a.g(Promise.all(t),0):a.A(0)})}r.rl=function(){return this.B},r.destroy=function(){var e=this,t,n,r;return k(function(i){if(i.h==1)return e.l=!0,!e.m||e.qa?i.A(2):i.g(e.m.stop(),2);if(i.h!=4)return e.u&&e.u.release(),e.I&&!e.ua&&e.I.release(),!e.j||e.aa?i.A(4):i.g(e.j.destroy(),4);if(e.M.size>0&&!e.ya)for(t=g(e.M.values()),n=t.next();!n.done;n=t.next())r=n.value,Pu(r);i.j()})};function Yf(e){function t(e){return e.video&&e.audio||e.video&&e.video.codecs.includes(`,`)}e.variants.some(t)&&(e.variants=e.variants.filter(t))}P(`shaka.media.PreloadManager`,jf),jf.prototype.destroy=jf.prototype.destroy,jf.prototype.waitForFinish=jf.prototype.rl,jf.prototype.getPrefetchedTextTrack=jf.prototype.Sj,jf.prototype.getPrefetchedVariantTrack=jf.prototype.Tj;function Xf(e,t){ga.call(this);var n=this;this.i=e,this.l=t,this.g=/* @__PURE__ */ new Map,this.m=[{cd:null,bd:$f,Oc:function(e,t){return Zf(n,`enter`,e,t)}},{cd:Qf,bd:$f,Oc:function(e,t){return Zf(n,`enter`,e,t)}},{cd:ep,bd:$f,Oc:function(e,t){return Zf(n,`enter`,e,t)}},{cd:$f,bd:Qf,Oc:function(e,t){return Zf(n,`exit`,e,t)}},{cd:$f,bd:ep,Oc:function(e,t){return Zf(n,`exit`,e,t)}},{cd:Qf,bd:ep,Oc:function(e,t){t?Zf(n,`skip`,e,t):(Zf(n,`enter`,e,t),Zf(n,`exit`,e,t))}},{cd:ep,bd:Qf,Oc:function(e,t){return Zf(n,`skip`,e,t)}}],this.h=new I,this.h.F(this.i,`regionremove`,function(e){n.g.delete(e.region)})}m(Xf,ga),Xf.prototype.release=function(){this.i=null,this.g.clear(),this.h.release(),this.h=null,ga.prototype.release.call(this)},Xf.prototype.j=function(e,t){if(!this.l||e!=0){this.l=!1;for(var n=g(this.i.h.values()),r=n.next();!r.done;r=n.next()){r=r.value;var i=this.g.get(r),a=e<r.startTime?Qf:e>r.endTime?ep:$f;this.g.set(r,a);for(var o=g(this.m),s=o.next();!s.done;s=o.next())s=s.value,s.cd==i&&s.bd==a&&s.Oc(r,t)}}};function Zf(e,t,n,r){t=new V(t,/* @__PURE__ */ new Map([[`region`,n],[`seeking`,r]])),e.dispatchEvent(t)}for(var Qf=1,$f=2,ep=3,tp={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`},np=g(Object.keys(tp)),rp=np.next();!rp.done;rp=np.next()){var ip=rp.value;tp[ip.toLowerCase()]=tp[ip]}function ap(e,t){if(e.lineBreak)return`
|
|
10
|
+
`;if(e.nestedCues.length)return e.nestedCues.map(function(t){return ap(t,e)}).join(``);if(!e.payload)return e.payload;var n=[],r=e.fontWeight>=mr,i=e.fontStyle==gr,a=e.textDecoration.includes(vr);return r&&n.push([`b`]),i&&n.push([`i`]),a&&n.push([`u`]),i=e.color,i==``&&t&&(i=t.color),r=``,(i=op(i))&&(r+=`.`+i),i=e.backgroundColor,i==``&&t&&(i=t.backgroundColor),(t=op(i))&&(r+=`.bg_`+t),r&&n.push([`c`,r]),n.reduceRight(function(e,t){var n=g(t);return t=n.next().value,n=n.next().value,`<`+t+(n===void 0?``:n)+`>`+e+`</`+t+`>`},e.payload)}function op(e){e=e.toLowerCase();var t=e.replace(/\s/g,``).match(/^rgba?\((\d+),(\d+),(\d+),?([^,\s)]+)?/i);switch(t?e=`#`+(parseInt(t[1],10)|256).toString(16).slice(1)+(parseInt(t[2],10)|256).toString(16).slice(1)+(parseInt(t[3],10)|256).toString(16).slice(1):e.startsWith(`#`)&&e.length>7&&(e=e.slice(0,7)),e){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 sp(e,t){var n=[];e=g(cp(e));for(var r=e.next();!r.done;r=e.next())if(r=r.value,r.isContainer)n.push.apply(n,_(sp(r.nestedCues,r)));else{var i=r.clone();i.nestedCues=[],i.payload=ap(r,t),n.push(i)}return n}function cp(e){var t=[];e=g(e);for(var n=e.next(),r={};!n.done;r={hg:void 0},n=e.next())r.hg=n.value,t.some(function(e){return function(t){return Yn(e.hg,t)}}(r))||t.push(r.hg);return t}function lp(e){function t(e){for(var t=5381,n=e.length;n;)t=t*33^e.charCodeAt(--n);return(t>>>0).toString()}if(e.startTime>=e.endTime)return null;var n=new VTTCue(e.startTime,e.endTime,e.payload);n.id=t(e.startTime.toString())+t(e.endTime.toString())+t(e.payload),n.lineAlign=e.lineAlign,n.positionAlign=e.positionAlign,e.size&&(n.size=e.size);try{n.align=e.textAlign}catch{}return e.textAlign==`center`&&n.align!=`center`&&(n.align=`middle`),e.writingMode==`vertical-lr`?n.vertical=`lr`:e.writingMode==`vertical-rl`&&(n.vertical=`rl`),e.lineInterpretation==1&&(n.snapToLines=!1),e.line!=null&&(n.line=e.line),e.position!=null&&(n.position=e.position),n}function up(e,t){var n=sp(t),r=[];t=e.cues?Array.from(e.cues):[],n=g(n);for(var i=n.next(),a={};!i.done;a={qd:void 0},i=n.next())a.qd=i.value,!t.some(function(e){return function(t){return t.startTime==e.qd.startTime&&t.endTime==e.qd.endTime&&t.text==e.qd.payload}}(a))&&a.qd.payload&&(i=lp(a.qd))&&r.push(i);for(t=r.slice().sort(function(e,t){return e.startTime==t.startTime?e.endTime==t.endTime?`line`in VTTCue.prototype?r.indexOf(t)-r.indexOf(e):r.indexOf(e)-r.indexOf(t):e.endTime-t.startTime:e.startTime-t.startTime}),t=g(t),n=t.next();!n.done;n=t.next())e.addCue(n.value)}function dp(e,t){var n=!1;e.mode===`disabled`&&(n=!0,e.mode=`hidden`);for(var r=0;r<e.cues.length;){var i=e.cues[r];t(i)?e.removeCue(i):r++}n&&(e.mode=`disabled`)}function fp(e){var t=this;this.i=e,this.l=new I,this.j=null,this.h=/* @__PURE__ */ new Map,this.g=-1,this.u=!1,this.m=null,this.C=function(){var e;(e=t.m)==null||e.stop(),t.m=null,t.l.Oa(t.i,`textchanged`,t.o),t.l.Oa(t.j.textTracks,`change`,t.B),e=g(t.h.values());for(var n=e.next();!n.done;n=e.next())n.value.remove();t.h.clear(),t.g=-1,t.j=null},this.o=function(){var e=/* @__PURE__ */ new Map,n=t.i.Gc();n=g(n);for(var r=n.next();!r.done;r=n.next()){if(r=r.value,t.h.has(r.id)){var i=t.h.get(r.id);r.active||i.track.mode===`disabled`||(i.track.mode=`disabled`),t.h.delete(r.id)}else{var a=i=t.j.ownerDocument.createElement(`track`),o=we();if(o=r.forced&&o.Ia()===`WEBKIT`?`forced`:r.kind===`caption`?`captions`:`subtitles`,a.kind=o,a=i,o=void 0,r.label)o=r.label;else if(r.language){if(r.language in tp)o=tp[r.language];else{var s=di(r.language);s in tp&&(o=tp[s]+` (`+r.language+`)`)}}o||(o=r.originalTextId,r.language&&r.language!==r.originalTextId&&(o+=` (`+r.language+`)`)),a.label=o,r.language?r.language in tp?i.srclang=r.language:(a=di(r.language),o=void 0,i.srclang=(o=a)??`und`):i.srclang=`und`,i.src=`data:,WEBVTT`,i.track.mode=`disabled`,t.j.appendChild(i)}e.set(r.id,i),r.active&&(t.g=r.id)}for(n=g(t.h.values()),r=n.next();!r.done;r=n.next())r.value.remove();t.g>-1&&(e.has(t.g)?(n=e.get(t.g).track,n.mode===`disabled`&&(n.mode=t.u?`showing`:`hidden`)):t.g=-1),t.h=e},this.B=function(){if(!t.m){var e=t.j;t.m=new Qr(function(){if(t.m=null,t.j===e){var n=-1,r=!1;if(t.h.has(t.g)){var i=t.h.get(t.g);i.track.mode===`showing`?(n=t.g,r=!0):i.track.mode===`hidden`&&(n=t.g)}if(!r)for(r=g(t.h),i=r.next();!i.done;i=r.next()){var a=g(i.value);if(i=a.next().value,a=a.next().value,a.track.mode===`showing`){n=i;break}n<0&&a.track.mode===`hidden`&&(n=i)}for(r=g(t.h),i=r.next();!i.done;i=r.next())a=g(i.value),i=a.next().value,a=a.next().value,i!==n&&a.track.mode!==`disabled`&&(a.track.mode=`disabled`);t.g!==n&&(t.g=n,n>-1&&t.i.oh({id:n})),t.i.sh(n>-1&&t.h.get(n).track.mode===`showing`)}}).na(0)}},this.l.F(e,`loaded`,function(){return t.enableTextDisplayer()}),this.enableTextDisplayer()}r=fp.prototype,r.configure=function(){},r.remove=function(e,t){if(this.i)this.h.has(this.g)&&dp(this.h.get(this.g).track,function(n){return n.startTime<t&&n.endTime>e});else return!1;return!0},r.append=function(e){this.h.has(this.g)&&up(this.h.get(this.g).track,e)},r.destroy=function(){this.i&&(this.j&&this.C(),this.i=null);var e;(e=this.m)==null||e.stop(),this.m=null;var t;return(t=this.l)==null||t.release(),this.l=null,Promise.resolve()},r.isTextVisible=function(){return this.u},r.setTextVisibility=function(e){if(this.u=e,this.h.has(this.g)){var t=this.h.get(this.g).track;t.mode!==`disabled`&&(e=e?`showing`:`hidden`,t.mode!==e&&(t.mode=e))}else if(this.i&&this.i.Vd()===3){if(t=Array.from(this.i.Xe().textTracks).filter(function(e){return[`captions`,`subtitles`,`forced`].includes(e.kind)}),e){e=null,t=g(t);for(var n=t.next();!n.done;n=t.next())if(n=n.value,n.mode===`showing`){e=null;break}else e||n.mode!==`hidden`||(e=n);e&&(e.mode=`showing`)}else for(e=g(t),t=e.next();!t.done;t=e.next())t=t.value,t.mode===`showing`&&(t.mode=`hidden`)}},r.setTextLanguage=function(){},r.enableTextDisplayer=function(){!this.j&&this.i&&this.i.Vd()===2&&(this.j=this.i.Xe(),this.l.Ba(this.i,`unloading`,this.C),this.l.F(this.i,`textchanged`,this.o),this.l.F(this.j.textTracks,`change`,this.B),this.o())},P(`shaka.text.NativeTextDisplayer`,fp),fp.prototype.enableTextDisplayer=fp.prototype.enableTextDisplayer,fp.prototype.setTextLanguage=fp.prototype.setTextLanguage,fp.prototype.setTextVisibility=fp.prototype.setTextVisibility,fp.prototype.isTextVisible=fp.prototype.isTextVisible,fp.prototype.destroy=fp.prototype.destroy,fp.prototype.append=fp.prototype.append,fp.prototype.remove=fp.prototype.remove,fp.prototype.configure=fp.prototype.configure;function pp(e,t){for(L(`SimpleTextDisplayer`,`Please migrate to NativeTextDisplayer`),this.h=e,this.i=t,this.g=null,e=g(Array.from(this.h.textTracks)),t=e.next();!t.done;t=e.next())t=t.value,t.kind!==`metadata`&&t.kind!==`chapters`&&(t.mode=`disabled`,t.label==this.i&&(this.g=t));this.g&&(this.g.mode=`hidden`)}r=pp.prototype,r.configure=function(){},r.remove=function(e,t){return this.g?(dp(this.g,function(n){return n.startTime<t&&n.endTime>e}),!0):!1},r.append=function(e){this.g&&up(this.g,e)},r.destroy=function(){return this.g&&(dp(this.g,function(){return!0}),this.g.mode=`disabled`),this.g=this.h=null,Promise.resolve()},r.isTextVisible=function(){return this.g?this.g.mode==`showing`:!1},r.setTextVisibility=function(e){e&&!this.g&&mp(this),this.g&&(this.g.mode=e?`showing`:`hidden`)},r.setTextLanguage=function(){},r.enableTextDisplayer=function(){mp(this)};function mp(e){e.h&&!e.g&&(e.g=e.h.addTextTrack(`subtitles`,e.i),e.g.mode=`hidden`)}P(`shaka.text.SimpleTextDisplayer`,pp),pp.prototype.enableTextDisplayer=pp.prototype.enableTextDisplayer,pp.prototype.setTextLanguage=pp.prototype.setTextLanguage,pp.prototype.setTextVisibility=pp.prototype.setTextVisibility,pp.prototype.isTextVisible=pp.prototype.isTextVisible,pp.prototype.destroy=pp.prototype.destroy,pp.prototype.append=pp.prototype.append,pp.prototype.remove=pp.prototype.remove,pp.prototype.configure=pp.prototype.configure;function hp(){}r=hp.prototype,r.configure=function(){},r.remove=function(){},r.append=function(){},r.destroy=function(){},r.isTextVisible=function(){return!1},r.setTextVisibility=function(){},r.setTextLanguage=function(){},r.enableTextDisplayer=function(){},P(`shaka.text.StubTextDisplayer`,hp),hp.prototype.enableTextDisplayer=hp.prototype.enableTextDisplayer,hp.prototype.setTextLanguage=hp.prototype.setTextLanguage,hp.prototype.setTextVisibility=hp.prototype.setTextVisibility,hp.prototype.isTextVisible=hp.prototype.isTextVisible,hp.prototype.destroy=hp.prototype.destroy,hp.prototype.append=hp.prototype.append,hp.prototype.remove=hp.prototype.remove,hp.prototype.configure=hp.prototype.configure;function gp(t,n){var r=this;this.j=!1,this.h=[],this.m=t,this.l=n,this.C=this.u=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.B=new Qr(function(){r.m.paused||bp(r)}),_p(this),this.o=/* @__PURE__ */ new Map,this.i=new I,this.i.F(document,`fullscreenchange`,function(){bp(r,!0)}),this.i.F(this.m,`seeking`,function(){bp(r,!0)}),this.i.F(this.m,`ratechange`,function(){_p(r)}),this.i.F(this.m,`resize`,function(){var e=r.m,t=e.videoWidth;e=e.videoHeight,r.u=t&&e?t/e:null}),this.H=!1,this.D=null,`ResizeObserver`in e&&(this.D=new ResizeObserver(function(){r.H||(r.H=!0,requestAnimationFrame(function(){r.H=!1,r.g&&r.g.parentElement&&r.j&&bp(r,!0)}))}),this.D.observe(this.l)),this.G=/* @__PURE__ */ new Map}r=gp.prototype,r.configure=function(e){this.C=e,_p(this),bp(this,!0)},r.append=function(e){var t=[].concat(_(this.h));e=g(cp(e));for(var n=e.next(),r={};!n.done;r={ig:void 0},n=e.next())r.ig=n.value,t.some(function(e){return function(t){return Yn(t,e.ig)}}(r))||this.h.push(r.ig);this.h.length&&_p(this),bp(this)},r.destroy=function(){return this.g&&(this.g.parentElement&&this.l.removeChild(this.g),this.g=null,this.j=!1,this.h=[],this.B&&(this.B.stop(),this.B=null),this.o.clear(),this.i&&(this.i.release(),this.i=null),this.D&&(this.D.disconnect(),this.D=null)),Promise.resolve()},r.remove=function(e,t){if(!this.g)return!1;var n=this.h.length;return this.h=this.h.filter(function(n){return n.startTime<e||n.endTime>=t}),bp(this,n>this.h.length),this.h.length||_p(this),!0},r.isTextVisible=function(){return this.j},r.setTextVisibility=function(e){(this.j=e)?(this.g.parentElement||this.l.appendChild(this.g),bp(this,!0)):this.g.parentElement&&this.l.removeChild(this.g)},r.setTextLanguage=function(e){e&&e!=`und`?this.g.setAttribute(`lang`,e):this.g.setAttribute(`lang`,``)},r.enableTextDisplayer=function(){};function _p(e){e.B&&(e.h.length?e.B.Fa((e.C?e.C.captionsUpdatePeriod:.25)/Math.max(1,Math.abs(e.m.playbackRate))):e.B.stop())}function vp(e,t){for(;t!=null;){if(t==e.g)return!0;t=t.parentElement}return!1}function yp(e,t,n,r,i){var a=!1,o=[],s=[];t=g(t);for(var c=t.next();!c.done;c=t.next()){c=c.value,i.push(c);var l=e.o.get(c),u=c.startTime<=r&&c.endTime>r,d=l?l.lj:null;l&&(o.push(l.jg),l.Tc&&o.push(l.Tc),u||(a=!0,e.o.delete(c),l=null)),u&&(s.push(c),l?vp(e,d)||(a=!0):(xp(e,c,i),l=e.o.get(c),d=l.lj,a=!0)),c.nestedCues.length>0&&d&&yp(e,c.nestedCues,d,r,i),i.pop()}if(a){for(r=g(o),i=r.next();!i.done;i=r.next())i=i.value,i.parentElement&&i.parentElement.removeChild(i);for(s.sort(function(e,t){return e.startTime==t.startTime?e.endTime-t.endTime:e.startTime-t.startTime}),s=g(s),r=s.next();!r.done;r=s.next())r=e.o.get(r.value),r.Tc?(r.Tc.contains(n)&&r.Tc.removeChild(n),n.appendChild(r.Tc),r.Tc.appendChild(r.jg)):n.appendChild(r.jg)}}function bp(e,t){if(e.g){var n=e.m.currentTime;if(!e.j||t!==void 0&&t){t=g(e.G.values());for(var r=t.next();!r.done;r=t.next())sc(r.value);sc(e.g),e.o.clear(),e.G.clear()}e.j&&yp(e,e.h,e.g,n,[])}}function xp(e,t,n){var r=n.length>1,i=r?`span`:`div`;t.lineBreak&&(i=`br`),t.rubyTag&&(i=t.rubyTag),r=!r&&t.nestedCues.length>0;var a=document.createElement(i);if(i!=`br`&&Cp(e,a,t,n,r),n=null,t.region&&t.region.id){var o=t.region,s=e.u===4/3?2.5:1.9;if(n=o.id+`_`+o.width+`x`+o.height+(o.heightUnits==tn?`%`:`px`)+`-`+o.viewportAnchorX+`x`+o.viewportAnchorY+(o.viewportAnchorUnits==tn?`%`:`px`)+`-`+o.regionAnchorX+`x`+o.regionAnchorY,e.G.has(n))n=e.G.get(n);else{i=document.createElement(`span`);var c=o.heightUnits==tn?`%`:`px`,l=o.widthUnits==tn?`%`:`px`,u=o.viewportAnchorUnits==tn?`%`:`px`;i.id=`shaka-text-region---`+n,i.classList.add(`shaka-text-region`),i.style.position=`absolute`;var d=o.height,f=o.width;o.heightUnits===2&&(d=o.height*5.33,c=`%`),o.widthUnits===2&&(f=o.width*s,l=`%`),i.style.height=d+c,i.style.width=f+l,o.viewportAnchorUnits===2?(s=o.viewportAnchorY/75*100,c=o.viewportAnchorX/(e.u===4/3?160:210)*100,s-=o.regionAnchorY*d/100,c-=o.regionAnchorX*f/100,i.style.top=s+`%`,i.style.left=c+`%`):(i.style.top=o.viewportAnchorY-o.regionAnchorY*d/100+u,i.style.left=o.viewportAnchorX-o.regionAnchorX*f/100+u),o.heightUnits!==0&&o.widthUnits!==0&&o.viewportAnchorUnits!==0&&(o=Math.max(0,Math.min(100-(parseInt(i.style.width.slice(0,-1),10)||0),parseInt(i.style.left.slice(0,-1),10)||0)),i.style.top=Math.max(0,Math.min(100-(parseInt(i.style.height.slice(0,-1),10)||0),parseInt(i.style.top.slice(0,-1),10)||0))+`%`,i.style.left=o+`%`),i.style.display=`flex`,i.style.flexDirection=`column`,i.style.alignItems=`center`,i.style.justifyContent=t.displayAlign==`before`?`flex-start`:t.displayAlign==`center`?`center`:`flex-end`,e.G.set(n,i),n=i}}i=a,r&&(i=document.createElement(`span`),i.classList.add(`shaka-text-wrapper`),i.style.backgroundColor=t.backgroundColor,i.style.lineHeight=`normal`,a.appendChild(i)),e.o.set(t,{jg:a,lj:i,Tc:n})}function Sp(e){var t=e.direction,n=e.positionAlign;return e=e.textAlign,n===tr?e===`left`||e===`start`&&t===or||e===`end`&&t===`rtl`?`line-left`:e===`right`||e===`start`&&t===`rtl`||e===`end`&&t===or?`line-right`:`center`:n}function Cp(e,t,n,r,i){var a=t.style,o=n.nestedCues.length==0,s=r.length>1;a.whiteSpace=`pre-wrap`;var c=n.payload.replace(/\s+$/g,function(e){return`\xA0`.repeat(e.length)});if(a.webkitTextStrokeColor=n.textStrokeColor,a.webkitTextStrokeWidth=n.textStrokeWidth,a.color=n.color,a.direction=n.direction,a.opacity=n.opacity,a.paddingLeft=wp(n.linePadding,n,e.l),a.paddingRight=wp(n.linePadding,n,e.l),a.textCombineUpright=n.textCombineUpright,a.textShadow=n.textShadow,n.backgroundImage)a.backgroundImage=`url('`+n.backgroundImage.replace(/['"()\\]/g,``)+`')`,a.backgroundRepeat=`no-repeat`,a.backgroundSize=`contain`,a.backgroundPosition=`center`,n.backgroundColor&&(a.backgroundColor=n.backgroundColor),a.width=`100%`,a.height=`100%`;else{if(n.nestedCues.length)var l=t;else l=document.createElement(`span`),t.appendChild(l);n.border&&(l.style.border=n.border),i||((t=Tp(r,function(e){return e.backgroundColor}))?l.style.backgroundColor=t:c&&(l.style.backgroundColor=`rgba(0, 0, 0, 0.8)`)),c&&(l.setAttribute(`translate`,`no`),l.textContent=c)}s&&!r[r.length-1].isContainer?a.display=`inline`:(a.display=`flex`,a.flexDirection=`column`,a.alignItems=`center`,n.textAlign==`left`||n.textAlign==`start`?(a.width=`100%`,a.alignItems=`flex-start`):(n.textAlign==`right`||n.textAlign==`end`)&&(a.width=`100%`,a.alignItems=`flex-end`),a.justifyContent=n.displayAlign==`before`?`flex-start`:n.displayAlign==`center`?`center`:`flex-end`),o||(a.margin=`0`),a.fontFamily=n.fontFamily,a.fontWeight=n.fontWeight.toString(),a.fontStyle=n.fontStyle,a.letterSpacing=n.letterSpacing,r=e.C?e.C.fontScaleFactor:1,(r!==1||n.fontSize)&&(a.fontSize=wp(n.fontSize||`1em`,n,e.l,r)),r=n.line,r!=null&&(o=n.lineInterpretation,o==cr&&(o=1,s=16,e.u&&e.u<1&&(s=32),r=r<0?100+r/s*100:r/s*100),o==1&&(a.position=`absolute`,n.writingMode==sr?(a.width=`100%`,n.lineAlign==lr?a.top=r+`%`:n.lineAlign==`end`&&(a.bottom=100-r+`%`)):n.writingMode==`vertical-lr`?(a.height=`100%`,n.lineAlign==lr?a.left=r+`%`:n.lineAlign==`end`&&(a.right=100-r+`%`)):(a.height=`100%`,n.lineAlign==lr?a.right=r+`%`:n.lineAlign==`end`&&(a.left=100-r+`%`)))),a.lineHeight=n.lineHeight,e=Sp(n),e==`line-left`?(a.cssFloat=`left`,n.position!==null&&(a.position=`absolute`,n.writingMode==sr?(a.left=n.position+`%`,a.width=`auto`):a.top=n.position+`%`)):e==`line-right`?(a.cssFloat=`right`,n.position!==null&&(a.position=`absolute`,n.writingMode==sr?(a.right=100-n.position+`%`,a.width=`auto`):a.bottom=n.position+`%`)):n.position!==null&&n.position!=50&&(a.position=`absolute`,n.writingMode==sr?(a.left=n.position+`%`,a.width=`auto`):a.top=n.position+`%`,n.size&&(a.transform=`translateX(-50%)`)),a.textAlign=n.textAlign,a.textDecoration=n.textDecoration.join(` `),a.writingMode=n.writingMode,`writingMode`in document.documentElement.style&&a.writingMode==n.writingMode||(a.webkitWritingMode=n.writingMode),n.size&&(n.writingMode==sr?a.width=n.size+`%`:a.height=n.size+`%`)}function wp(e,t,n,r){r=r===void 0?1:r;var i=(i=(/* @__PURE__ */ new RegExp(/(\d*\.?\d+)([a-z]+|%+)/)).exec(e))?{value:Number(i[1]),unit:i[2]}:null;if(!i)return e;switch(e=i.unit,r*=i.value,e){case`%`:return r/100*n.clientHeight/t.cellResolution.rows+`px`;case`c`:return n.clientHeight*r/t.cellResolution.rows+`px`;default:return r+e}}function Tp(e,t){for(var n=e.length-1;n>=0;n--){var r=t(e[n]);if(r||r===0)return r}return null}P(`shaka.text.UITextDisplayer`,gp),gp.prototype.enableTextDisplayer=gp.prototype.enableTextDisplayer,gp.prototype.setTextLanguage=gp.prototype.setTextLanguage,gp.prototype.setTextVisibility=gp.prototype.setTextVisibility,gp.prototype.isTextVisible=gp.prototype.isTextVisible,gp.prototype.remove=gp.prototype.remove,gp.prototype.destroy=gp.prototype.destroy,gp.prototype.append=gp.prototype.append,gp.prototype.configure=gp.prototype.configure;function Ep(e,t){function n(e){for(var n=e,r=g(t),i=r.next();!i.done;i=r.next())i=i.value,i.end&&i.start<e&&(n+=i.end-i.start);return e=Math.floor(n/3600),r=Math.floor(n/60%60),i=Math.floor(n%60),n=Math.floor(n*1e3%1e3),(e<10?`0`:``)+e+`:`+(r<10?`0`:``)+r+`:`+(i<10?`0`:``)+i+`.`+(n<100?n<10?`00`:`0`:``)+n}var r=sp(e);e=`WEBVTT
|
|
11
|
+
|
|
12
|
+
`,r=g(r);for(var i=r.next();!i.done;i=r.next())i=i.value,e+=n(i.startTime)+` --> `+n(i.endTime)+function(e){var t=[];switch(e.textAlign){case`left`:t.push(`align:left`);break;case`right`:t.push(`align:right`);break;case nr:t.push(`align:middle`);break;case`start`:t.push(`align:start`);break;case`end`:t.push(`align:end`)}switch(e.writingMode){case`vertical-lr`:t.push(`vertical:lr`);break;case`vertical-rl`:t.push(`vertical:rl`)}return t.length?` `+t.join(` `):``}(i)+`
|
|
13
|
+
`,e+=i.payload+`
|
|
14
|
+
|
|
15
|
+
`;return e}P(`shaka.text.WebVttGenerator`,function(){});function Dp(e,t){this.g=t,this.j=e,this.m=/* @__PURE__ */ new Map,this.l=void 0,this.D=!1,this.J=!0,this.u=this.I=!1,this.C=this.B=void 0,this.H=0,this.K={request:!1,response:!1,event:!1},this.o={},this.i=new I,this.G=[],this.h=null}Dp.prototype.setMediaElement=function(e){this.h=e,Mp(this)},Dp.prototype.configure=function(e){this.g=e,Np(this)};function Op(e){e.m.clear(),e.D=!1,e.J=!0,e.I=!1,e.u=!1,e.B=0,e.C=0,e.H=0,e.K={request:!1,response:!1,event:!1},Pp(e),e.o={},e.h=null,e.i.Sa()}function kp(e,t){e.u=t,e.u?e.l==um?e.l=dm:e.l==fm&&(e.l=pm):e.l==dm?e.l=um:e.l==pm&&(e.l=fm)}function Ap(e,t){if(e.g&&e.g.enabled&&(Rp(e,`ps`,{Wc:`d`}),e.h&&e.h.autoplay)){var n=e.h.play();n&&n.then(function(){e.H=t}).catch(function(){e.H=0})}}function jp(e,t,n){try{if(!e.g.enabled)return t;var r=Lp(e);a:{switch(n.toLowerCase()){case`audio/mp4`:case`audio/webm`:case`audio/ogg`:case`audio/mpeg`:case`audio/aac`:case`audio/flac`:case`audio/wav`:var i=tm;break a;case`video/webm`:case`video/mp4`:case`video/mpeg`:case`video/mp2t`:i=rm;break a;case`application/x-mpegurl`:case`application/vnd.apple.mpegurl`:case`audio/x-mpegurl`:case`application/dash+xml`:case`video/vnd.mpeg.dash.mpd`:case`application/vnd.ms-sstr+xml`:i=em;break a}i=void 0}return r.ot=i,r.su=!0,$p(t,Zp(r))}catch(e){return le(`CMCD_SRC_ERROR`,`Could not generate src CMCD data.`,e),t}}function Mp(t){t.i.F(t.h,`playing`,function(){t.C||(t.C=Date.now()),Rp(t,`ps`,{Wc:`p`})}),t.i.F(t.h,`volumechange`,function(){Rp(t,t.h.muted?`m`:`um`)}),t.i.F(t.h,`play`,function(){t.B||(t.B=Date.now(),Rp(t,`ps`,{Wc:`s`}))}),t.i.F(t.h,`pause`,function(){Rp(t,`ps`,{Wc:`a`})}),t.i.F(t.j,`buffering`,function(){Rp(t,`ps`,{Wc:`w`})}),t.i.F(t.h,`seeking`,function(){return Rp(t,`ps`,{Wc:`k`})}),t.i.F(document,`fullscreenchange`,function(){Rp(t,document.fullscreenElement?`pe`:`pc`)});var n=t.h;(n.webkitPresentationMode||n.webkitSupportsFullscreen)&&t.i.F(n,`webkitpresentationmodechanged`,function(){n.webkitPresentationMode?Rp(t,n.webkitPresentationMode===`inline`?`pc`:`pe`):n.webkitSupportsFullscreen&&Rp(t,n.webkitDisplayingFullscreen?`pe`:`pc`)}),t.i.F(t.h,`enterpictureinpicture`,function(){Rp(t,`pe`)}),t.i.F(t.h,`leavepictureinpicture`,function(){Rp(t,`pc`)}),`documentPictureInPicture`in e&&t.i.F(e.documentPictureInPicture,`enter`,function(e){Rp(t,`pe`),t.i.Ba(e.window,`pagehide`,function(){Rp(t,`pc`)})}),t.i.F(document,`visibilitychange`,function(){document.hidden?Rp(t,`b`,{bg:!0}):Rp(t,`b`)}),t.i.F(t.j,`complete`,function(){Rp(t,`ps`,{Wc:`e`})})}function Np(e){Pp(e);var t=Fp(e);t=g(t);for(var n=t.next();!n.done;n=t.next())if(n=n.value.timeInterval,n===void 0&&(n=xm),n>=1){var r=new Qr(function(){return Rp(e,Cm)});r.Fa(n),e.G.push(r)}}function Pp(e){if(e.G)for(var t=g(e.G),n=t.next();!n.done;n=t.next())n.value.stop();e.G=[]}function Fp(e){return(e=e.g.targets)?e.filter(function(e){return e.mode===Em&&e.enabled}):[]}function Ip(e){return(e=e.g.targets)?e.filter(function(e){return e.mode===Tm&&e.enabled===!0}):[]}function Lp(t){return t.g.sessionId||(t.g.sessionId=e.crypto.randomUUID()),{v:t.g.version,sf:t.l,sid:t.g.sessionId,cid:t.g.contentId,mtp:t.j.getBandwidthEstimate()/1e3}}function Rp(e,t,n){if(n=n===void 0?{}:n,t=Object.assign({e:t,ts:Date.now()},n),t=Xp(e,t,Em),n=e.g.targets,!(e.g.version<sm)&&n){var r=Fp(e);n=Array.from(new Set([].concat(_(hm),_(vm)))),r=g(r);for(var i=r.next();!i.done;i=r.next()){i=i.value;var a=Hp(i.includeKeys||[],n);a.includes(Sm)||a.push(Sm),a=Up(t,a);var o=i.events||[],s=a.e,c=a.sta;s&&(!ym.includes(s)||!(s!==`ps`||c&&bm.includes(c))||o&&o.length>0&&!o.includes(s))||Bp(e,a,i)}}}function zp(e,t,n){if(e.g.enabled){n=Xp(e,n,wm);var r=Gp({mode:wm,useHeaders:e.g.useHeaders,includeKeys:e.g.includeKeys||[]});e.o[r]||(e.o[r]={request:1,response:1}),n.sn=e.o[r].request++,r=e.g.includeKeys||[];var i=e.g.version==sm?Array.from(new Set([].concat(_(hm),_(gm)))):mm;r=Hp(r,i),n=Up(n,r),Vp(e,n,t,e.g.useHeaders)}}function Bp(e,t,n,r){var i=aa(),a=n.url;if(n.useHeaders){if(t=Qp(t),!Object.keys(t).length)return;r&&Object.assign(r.headers,t),r=Sa([a],i),Object.assign(r.headers,t)}else{if(t=Zp(t),!t)return;a=$p(a,t),r&&(r.uri=a),r=Sa([a],i)}e.j.Sb().request(9,r)}function Vp(e,t,n,r){if(r){if(t=Qp(t),!Object.keys(t).length)return;Object.assign(n.headers,t)}else{var i=Zp(t);if(!i)return;n.uris=n.uris.map(function(e){return $p(e,i)})}Ip(e).length>0||!e.m.has(n)||e.m.delete(n)}function Hp(e,t){if(!e||e.length===0)return t;for(var n=g(e),r=n.next();!r.done;r=n.next())t.includes(r.value);return e=e.filter(function(e){return t.includes(e)})}function Up(e,t){return Object.keys(e).reduce(function(n,r){return t.includes(r)&&(n[r]=e[r]),n},{})}function Wp(e){if(e.type===0)return im;if(e=e.stream){var t=e.type;if(t==`video`)return e.codecs&&e.codecs.includes(`,`)?rm:nm;if(t==`audio`)return tm;if(t==`text`)return e.mimeType===`application/mp4`?om:am}}function Gp(e){var t=Object.keys(e).sort().reduce(function(t,n){return n!==`enabled`&&(t[n]=e[n]),t},{});return JSON.stringify(t)}function Kp(e,t){if(t=e.j.Cc()[t],!t.length)return NaN;var n=e.h?e.h.currentTime:0;return(e=t.find(function(e){return e.start<=n&&e.end>=n}))?(e.end-n)*1e3:NaN}function qp(e,t){if(t=e.j.Cc()[t],!t.length)return 0;var n=e.h?e.h.currentTime:0;return(e=t.find(function(e){return e.start<=n&&e.end>=n}))?(e.end-n)*1e3:0}function Jp(e,t){var n=e.j.kc();if(!n.length)return NaN;e=n[0],n=g(n);for(var r=n.next();!r.done;r=n.next())r=r.value,r.type===`variant`&&r.bandwidth>e.bandwidth&&(e=r);switch(t){case nm:return e.videoBandwidth||NaN;case tm:return e.audioBandwidth||NaN;default:return e.bandwidth}}function Yp(e,t,n){var r=t.segment,i=0;r&&(i=r.endTime-r.startTime),i={d:i*1e3,st:e.j.T()?lm:cm},i.ot=Wp(t);var a=i.ot===nm||i.ot===tm||i.ot===rm||i.ot===om;if(t=t.stream){var o=e.j.Db();if(a&&(i.bl=Kp(e,t.type),i.ot!==om)){var s=qp(e,t.type);i.dl=o?s/Math.abs(o):s}if(t.bandwidth&&(i.br=t.bandwidth/1e3),t.segmentIndex&&r){if((o=t.segmentIndex.Rb(r.endTime,!0,o<0))&&(o=o.next().value)&&o!=r){if(n&&!_e(r.P(),o.P())){var c=o.P()[0];s=new URL(c);var l=new URL(n);if(s.origin!==l.origin)n=c;else{n=s.pathname.split(`/`).slice(1),c=l.pathname.split(`/`).slice(1,-1),l=Math.min(n.length,c.length);for(var u=0;u<l&&n[u]===c[u];u++)n.shift(),c.shift();for(;c.length;)c.shift(),n.unshift(`..`);n=n.join(`/`)+s.search+s.hash}i.nor=n}!o.startByte&&!o.endByte||r.startByte==o.startByte&&r.endByte==o.endByte||(n=o.startByte+`-`,o.endByte&&(n+=o.endByte),i.nrr=n)}o=e.j.Db()||1,n=qp(e,t.type)||500,r=(t=t.bandwidth)?t*(r.endTime-r.startTime)/1e3/(n/o/1e3)*e.g.rtpSafetyFactor:NaN,isNaN(r)||(i.rtp=r)}}return a&&i.ot!==om&&(i.tb=Jp(e,i.ot)/1e3),i}function Xp(e,t,n){Object.assign(t,Lp(e)),t.pr=e.j.Db();var r=t.ot===nm||t.ot===rm;return e.I&&r&&(t.bs=!0,t.su=!0,e.I=!1),t.su??(t.su=e.J),e.j.T()&&(r=Ch(e.j),t.ltc=r||void 0),document.hidden&&(t.bg=!0),r=e.C&&e.B?e.C-(e.H||e.B):void 0,r==null||e.K[n]||(t.msd=r,e.K[n]=!0),t}function Zp(e){function t(e){return n(e/100)*100}function n(e){return Math.round(e)}function r(e){return!Number.isNaN(e)&&e!=null&&e!==``&&e!==!1}var i=[],a={br:n,d:n,bl:t,dl:t,mtp:t,nor:function(e){return encodeURIComponent(e)},rtp:t,tb:n,ttfb:n,ttlb:n},o=Object.keys(e||{}).sort();o=g(o);for(var s=o.next();!s.done;s=o.next()){s=s.value;var c=e[s];if(r(c)&&(s!==`v`||c!==1)&&(s!=`pr`||c!==1)){var l=a[s];l&&(c=l(c)),l=typeof c;var u=void 0;u=l===`string`&&s!==`ot`&&s!==`sf`&&s!==`st`?s+`=`+JSON.stringify(c):l===`boolean`?s:l===`symbol`?s+`=`+c.description:s+`=`+c,i.push(u)}}return i.join(`,`)}function Qp(e){var t=Object.keys(e),n={},r=[`Object`,`Request`,`Session`,`Status`],i=[{},{},{},{}],a={br:0,d:0,ot:0,tb:0,url:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,ltc:1,ttfb:1,ttlb:1,ts:1,rc:1,cmsdd:1,cmsds:1,sn:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,msd:2,bs:3,rtp:3,bg:3};t=g(t);for(var o=t.next();!o.done;o=t.next())o=o.value,i[a[o]==null?1:a[o]][o]=e[o];for(e=0;e<i.length;e++)(a=Zp(i[e]))&&(n[`CMCD-`+r[e]]=a);return n}function $p(e,t){return!t||e.includes(`offline:`)?e:(e=new Ne(e),e.g.set(`CMCD`,t),e.toString())}var em=`m`,tm=`a`,nm=`v`,rm=`av`,im=`i`,am=`c`,om=`tt`,sm=2,cm=`v`,lm=`l`,um=`d`,dm=`ld`,fm=`h`,pm=`lh`;P(`shaka.util.CmcdManager.StreamingFormat`,{DASH:um,Sl:dm,HLS:fm,Tl:pm,im:`s`,OTHER:`o`});var mm=`br bl bs cid d dl mtp nor nrr ot pr rtp sf sid st su tb v`.split(` `),hm=`br ab bl tbl bs cdn cid ltc mtp pr sf sid bg sta st ts tpb tb lb tab lab pt ec msd v sn`.split(` `),gm=`ab bl tbl bs cdn cid d dl ltc mtp nor ot pr rtp sf sid bg sta st su ts tpb tb lb tab lab pt ec msd v`.split(` `),_m=`d dl nor ot rtp rc su ttfb ttfbb ttlb url cmsdd cmsds`.split(` `),vm=[`e`,`sta`],ym=`ps e t c b m um pe pc`.split(` `),bm=`spawkrfeqd`.split(``),xm=10,Sm=`ts`,Cm=`t`,wm=`request`,Tm=`response`,Em=`event`;function Dm(e){this.h=e,this.g=null}r=Dm.prototype,r.configure=function(e){this.h=e},r.ei=function(){return this.h.enabled&&this.h.applyMaximumSuggestedBitrate&&this.g&&this.g.has(Am)?this.g.get(Am)*1e3:null},r.ci=function(){return this.h.enabled&&this.g&&this.g.has(km)?this.g.get(km)*1e3:null},r.Vj=function(){return this.h.enabled&&this.g&&this.g.has(jm)?this.g.get(jm):null},r.Wj=function(){return this.h.enabled&&this.g&&this.g.has(Mm)?this.g.get(Mm):null},r.getBandwidthEstimate=function(e){var t=this.ci();if(!t)return e;var n=this.h.estimatedThroughputWeightRatio;return n>0&&n<=1?e*(1-n)+t*n:e};function Om(e){return e?e.toLowerCase()===`false`?!1:/^[-0-9]/.test(e)?parseInt(e,10):e.replace(/["]+/g,``):!0}P(`shaka.util.CmsdManager`,Dm),Dm.prototype.getBandwidthEstimate=Dm.prototype.getBandwidthEstimate,Dm.prototype.getRoundTripTime=Dm.prototype.Wj,Dm.prototype.getResponseDelay=Dm.prototype.Vj,Dm.prototype.getEstimatedThroughput=Dm.prototype.ci,Dm.prototype.getMaxBitrate=Dm.prototype.ei;var km=`etp`,Am=`mb`,jm=`rd`,Mm=`rtt`;function Nm(){this.g=null,this.h=[]}function Pm(e,t){return k(function(n){if(n.h==1)return e.g?n.g(new Promise(function(t){return e.h.push(t)}),2):n.A(2);e.g=t,n.j()})}Nm.prototype.release=function(){this.h.length>0?this.h.shift()():this.g=null};function K(t,n,r){n=n===void 0?null:n,ga.call(this);var i=this;this.m=lg,this.h=null,this.ve=n,this.Z=!1,this.Fe=new I,this.we=new I,this.j=new I,this.$b=new I,this.Cd=new I,this.G=this.H=this.D=this.N=null,this.Ge=0,this.aa=new Nm,this.O=this.Ha=this.W=this.i=this.vc=this.I=this.l=this.re=this.S=this.Mh=this.ua=this.K=this.hb=this.za=this.ue=this.R=this.Ka=this.M=this.Xb=null,this.Ua=!1,this.Ae=this.o=null,this.ze=1e9,this.Ee=[],this.uc=/* @__PURE__ */ new Map,this.ib=[],this.Wf=-1,this.g=Oh(this),this.Yf=ff(),this.U=null,this.He=-1,this.Zb=null,this.ya={width:1/0,height:1/0},this.ye=new Go(this.g,this.ya,null),this.Ce=[],this.B=null,this.J=this.g.adaptationSetCriteriaFactory(),this.J.configure({language:this.g.preferredAudioLanguage,role:this.g.preferredAudioRole,videoRole:this.g.preferredVideoRole,channelCount:0,hdrLevel:this.g.preferredVideoHdrLevel,spatialAudio:this.g.preferSpatialAudio,videoLayout:this.g.preferredVideoLayout,audioLabel:this.g.preferredAudioLabel,videoLabel:this.g.preferredVideoLabel,codecSwitchingStrategy:this.g.mediaSource.codecSwitchingStrategy,audioCodec:``,activeAudioCodec:``,activeAudioChannelCount:0,preferredAudioCodecs:this.g.preferredAudioCodecs,preferredAudioChannelCount:this.g.preferredAudioChannelCount}),this.Gd=this.g.preferredTextLanguage,this.Kd=this.g.preferredTextRole,this.Jd=this.g.preferForcedSubs,this.xe=[],r&&r(this),this.K=new Dp(this,this.g.cmcd),this.ua=new Dm(this.g.cmsd),this.N=oh(this),this.ia=this.qa=this.Ca=this.C=null,this.$f=!1,this.Xf=[],this.Zf=new Qr(function(){return k(function(e){if(e.h==1)return i.qa?e.g(i.Pb(i.ia,!0),3):e.A(0);if(e.h!=4)return e.g(i.load(i.qa),4);i.$f?i.ia.pause():i.ia.play(),i.qa=null,i.$f=!1,e.j()})}),mg&&(this.C=mg(),this.C.configure(this.g.ads),this.Cd.F(this.C,`ad-content-pause-requested`,function(e){var t,n;return k(function(r){if(r.h==1)return i.Zf.stop(),i.qa?r.A(0):(i.ia=i.h,i.$f=i.$d(),t=e.saveLivePosition||!1,n=!0,i.T()&&(n=t),r.g(i.Xh(!0,n),3));i.qa=r.i,r.j()})}),this.Cd.F(this.C,`ad-content-resume-requested`,function(e){if(e=e.offset||0,i.qa){var t=i.qa;t.o&&e&&(typeof t.o==`number`?t.o+=e:t.o.setTime(t.o.getTime()+e*1e3))}i.Zf.na(.1)}),this.Cd.F(this.C,`ad-content-attach-requested`,function(){return k(function(e){if(e.h==1)return i.h||!i.ia?e.A(0):e.g(i.Pb(i.ia,!0),3);i.ia=null,e.j()})})),hg&&(this.Ca=hg(this),this.Ca.configure(this.g.queue)),this.Fe.F(e,`online`,function(){Qh(i),i.jh()}),this.Be=new Qr(function(){for(var e=Date.now()/1e3,t=!1,n=!0,r=g(i.i.variants),a=r.next();!a.done;a=r.next())a=a.value,a.disabledUntilTime>0&&a.disabledUntilTime<=e&&(a.disabledUntilTime=0,t=!0),a.disabledUntilTime>0&&(n=!1);n&&i.Be.stop(),t&&Bh(i,!1,void 0,!1,!1)}),this.eb=null,t&&(L(`Player w/ mediaElement`,`Please migrate from initializing Player with a mediaElement; use the attach method instead.`),this.Pb(t,!0)),this.u=null}m(K,ga);function Fm(e){e.S!=null&&(zt(e.S),e.S.release(),e.S=null)}function Im(e,t,n){n||t.lcevc.enabled?(Fm(e),e.S??(e.S=new Lt(e.h,e.Mh,t.lcevc,n),e.H&&(e.H.C=e.S))):Fm(e)}function Lm(e,t){return new V(e,t)}r=K.prototype,r.destroy=function(){var e=this,t;return k(function(n){switch(n.h){case 1:return e.m==cg?n.return():(Fm(e),t=e.detach(),e.m=cg,n.g(t,2));case 2:return n.g(e.mg(),3);case 3:if(e.Fe&&(e.Fe.release(),e.Fe=null),e.we&&(e.we.release(),e.we=null),e.j&&(e.j.release(),e.j=null),e.$b&&(e.$b.release(),e.$b=null),e.Cd&&(e.Cd.release(),e.Cd=null),e.Ae=null,e.g=null,e.B=null,e.ve=null,e.K=null,e.ua=null,!e.N){n.A(4);break}return n.g(e.N.destroy(),5);case 5:e.N=null;case 4:e.o&&(e.o.release(),e.o=null),e.Ca&&(e.Ca.destroy(),e.Ca=null),ga.prototype.release.call(e),n.j()}})};function Rm(e,t){pg.set(e,t)}function zm(e,t){e.dispatchEvent(Lm(`onstatechange`,(/* @__PURE__ */ new Map()).set(`state`,t)))}r.Pb=function(e,t){t=t===void 0||t;var n=this,r,i,a;return k(function(o){switch(o.h){case 1:if(n.m==cg)throw new R(2,7,7e3);if(r=n.h&&n.h==e,!n.h||n.h==e){o.A(2);break}return o.g(n.detach(),2);case 2:return o.g(Bm(n,`attach`),4);case 4:if(o.i)return o.return();if(o.m(5,6),r||(zm(n,`attach`),i=function(){var e=ng(n,!1);e&&$h(n,e)},n.we.F(e,`error`,i),n.h=e,n.K&&n.K.setMediaElement(e)),we(),!t||!$x()||n.H){o.A(6);break}return o.g(Jm(n),6);case 6:o.u(),n.aa.release(),o.B(0);break;case 5:return a=o.l(),o.g(n.detach(),10);case 10:throw a}})},r.oj=function(e){this.Mh=e},r.detach=function(e){e=e!==void 0&&e;var t=this;return k(function(n){if(n.h==1){if(t.m==cg)throw new R(2,7,7e3);return n.g(t.yc(!1,e),2)}if(n.h!=3)return n.g(Bm(t,`detach`),3);if(n.i)return n.return();try{t.h&&(t.we.Sa(),t.h=null),zm(t,`detach`),t.C&&!e&&t.C.release()}finally{t.aa.release()}n.j()})};function Bm(e,t){var n;return k(function(r){return r.h==1?(n=++e.Ge,r.g(Pm(e.aa,t),2)):n==e.Ge?r.return(!1):(e.aa.release(),r.return(!0))})}r.yc=function(t,n){t=t===void 0||t,n=n!==void 0&&n;var r=this,i,a,o,s,c,l,u,d,f,p,m,h,_,v,y,b;return k(function(x){switch(x.h){case 1:return r.m!=cg&&(r.m=lg),x.g(Bm(r,`unload`),2);case 2:return x.i?x.return():(x.D(3),r.Ua=!1,zm(r,`unload`),Fm(r),i=r.xe.map(function(e){return e()}),r.xe=[],x.g(Promise.all(i),5));case 5:if(r.dispatchEvent(Lm(`unloading`)),r.ue&&(r.ue.release(),r.ue=null),r.za&&(r.za.release(),r.za=null),r.hb&&(r.hb.release(),r.hb=null),r.h&&(r.j.Sa(),r.$b.Sa()),r.Be.stop(),r.Xb&&(r.Xb.release(),r.Xb=null),r.Ka&&(r.Ka.stop(),r.Ka=null),!r.I){x.A(6);break}return x.g(r.I.stop(),7);case 7:r.I=null,r.vc=null;case 6:if(r.o&&r.o.stop(),!r.l){x.A(8);break}return x.g(r.l.destroy(),9);case 9:r.l=null;case 8:if(r.M&&(r.M.release(),r.M=null),r.G&&(r.G.release(),r.G=null),e.shakaMediaKeysPolyfill!==`webkit`||!r.D){x.A(10);break}return x.g(r.D.destroy(),11);case 11:r.D=null;case 10:if(!r.H){x.A(12);break}return x.g(r.H.destroy(),13);case 13:r.H=null;case 12:if(r.C&&!n&&r.C.onAssetUnload(),r.qa&&!n&&(r.qa.destroy(),r.qa=null),n||r.Zf.stop(),r.K&&Op(r.K),r.ua&&(r.ua.g=null),!r.u){x.A(14);break}return x.g(r.u.destroy(),15);case 15:r.u=null;case 14:if(r.Z=!1,r.h){for(a=g(r.Xf),o=a.next();!o.done;o=a.next())s=o.value,s.src.startsWith(`blob:`)&&URL.revokeObjectURL(s.src),s.remove();r.Xf=[],oc(r.h)&&r.h.load()}if(!r.D){x.A(16);break}return x.g(r.D.destroy(),17);case 17:r.D=null;case 16:if(r.eb&&r.W!=r.eb.kd()&&(r.eb.l||r.eb.destroy(),r.eb=null),r.W=null,r.Ha=null,r.R=null,r.i){for(c=g(r.i.variants),l=c.next();!l.done;l=c.next())for(u=l.value,d=g([u.audio,u.video]),f=d.next();!f.done;f=d.next())(p=f.value)&&p.segmentIndex&&p.segmentIndex.release();for(m=g(r.i.textStreams),h=m.next();!h.done;h=m.next())_=h.value,_.segmentIndex&&_.segmentIndex.release()}for(r.g&&r.g.streaming.clearDecodingCache&&(Ji.clear(),ut.clear()),r.i=null,r.B=new Sf,r.Lh=null,r.Zb=null,r.U=null,r.He=-1,r.Ee=[],v=g(r.uc.values()),y=v.next();!y.done;y=v.next())b=y.value,b.stop();r.uc.clear(),r.ib=[],r.Wf=-1,r.N&&r.N.Th(),jh(r);case 3:x.u(),r.aa.release(),x.B(4);break;case 4:if(we(),t&&$x()&&!r.H&&r.h)return x.g(Jm(r),0);x.A(0)}})},r.ql=function(e){this.O=e},r.load=function(e,t,n){t=t===void 0?null:t;var r=this,i,a,o,s,c,l,u,d,f,p,m,h,g,_;return k(function(v){switch(v.h){case 1:if(r.m==cg)throw new R(2,7,7e3);if(r.h||!r.ia){v.A(2);break}return v.g(r.Pb(r.ia,!0),3);case 3:r.ia=null;case 2:if(i=null,a=``,n=n?.toLowerCase(),e instanceof jf){if(e.l)throw new R(2,7,7006);i=e,a=i.kd()||``}else a=e||``;return v.g(Pm(r.aa,`load`),4);case 4:if(r.aa.release(),!r.h)throw new R(2,7,7002);if(!r.W){v.A(5);break}return r.W=a,v.g(r.yc(!1),5);case 5:if(o=++r.Ge,s=function(){return k(function(e){if(e.h==1)return r.Ge==o?e.A(0):i?e.g(i.destroy(),3):e.A(3);throw new R(2,7,7e3)})},c=function(e,t){return k(function(n){switch(n.h){case 1:return n.D(2),n.g(Pm(r.aa,t),4);case 4:return n.g(s(),5);case 5:return n.g(e(),6);case 6:return n.g(s(),7);case 7:i&&r.g&&(i.g=r.g);case 2:n.u(),r.aa.release(),n.B(0)}})},v.m(7,8),t==null&&i&&(t=i.getStartTime()),r.O=t,r.Ua=!1,r.dispatchEvent(Lm(`loading`)),i){n=i.U,v.A(10);break}if(n){v.A(10);break}return v.g(c(function(){return k(function(e){if(e.h==1)return e.g(Gm(r,a),2);n=e.i,e.j()})},`guessMimeType_`),10);case 10:if(l=!!i,i){Pf(i,r),r.B=i.getStats(),v.A(13);break}return v.g(Um(r,a,t,n,!0,r.g),14);case 14:(i=v.i)?(i.D=!1,Pf(i,r),r.B=i.getStats(),i.start(),i.B.catch(function(){})):r.B=new Sf;case 13:return u=!i,d=Date.now()/1e3,r.B=i?i.getStats():new Sf,r.W=a,r.Ha=n||null,jh(r),f=function(){var e=r.h?r.h.buffered:null;return{start:Qs(e)||0,end:$s(e)||0}},r.za=new Eu(f),r.za.addEventListener(`regionadd`,function(e){rh(r,e.region,`metadataadded`)}),u?v.g(c(function(){return k(function(e){return e.g(Qm(r,n),0)})},`initializeSrcEqualsDrmInner_`),25):(r.hb=new Eu(f),v.g(c(function(){return k(function(e){if(e.h==1)return e.g(Promise.race([i.ia,i.B]),2);r.vc=i.H;var t=i;t.qa=!0,r.I=t.m,r.i=i.Gg(),e.j()})},`waitForFinish`),17));case 17:if(r.H){v.A(18);break}return v.g(c(function(){return k(function(e){return e.g(Jm(r),0)})},`initializeMediaSourceEngineInner_`),18);case 18:return r.i&&r.i.textStreams.length&&(r.u.enableTextDisplayer?r.u.enableTextDisplayer():L(`Text displayer w/ enableTextDisplayer`,`Text displayer should have a "enableTextDisplayer" method!`)),v.g(c(function(){return k(function(e){return e.g(i.B,0)})},`waitForFinish`),20);case 20:if(r.g=i.getConfiguration(),r.ye=i.G,r.I&&r.I.setMediaElement&&r.h&&r.I.setMediaElement(r.h),r.ue=Ff(i),r.re=i.Ha,(p=i.C)&&(r.J=p),l&&r.h&&r.h.nodeName===`AUDIO`&&(Vm(r),r.configure(`manifest.disableVideo`,!0)),i.j){v.A(21);break}return v.g(c(function(){return k(function(e){return e.g(Vf(i,r.h),0)})},`drmEngine_.init`),21);case 21:return r.D=If(i),v.g(c(function(){return k(function(e){return e.g(r.D.Pb(r.h),0)})},`drmEngine_.attach`),23);case 23:return m=r.g.abrFactory,r.o&&r.Ae==m||(r.Ae=m,r.o&&r.o.release(),r.o=m(),typeof r.o.setMediaElement!=`function`&&(L(`AbrManager w/o setMediaElement`,`Please use an AbrManager with setMediaElement function.`),r.o.setMediaElement=function(){}),typeof r.o.setCmsdManager!=`function`&&(L(`AbrManager w/o setCmsdManager`,`Please use an AbrManager with setCmsdManager function.`),r.o.setCmsdManager=function(){}),typeof r.o.trySuggestStreams!=`function`&&(L(`AbrManager w/o trySuggestStreams`,`Please use an AbrManager with trySuggestStreams function.`),r.o.trySuggestStreams=function(){}),r.o.configure(r.g.abr)),h=Lf(i),g=i.i,v.g(c(function(){return k(function(e){return e.g(Zm(r,d,g,h),0)})},`loadInner_`),24);case 24:Nf(i),r.Ha&&we().dj()&&Lr(r.Ha)&&qc(r.H,r.W,r.Ha),v.A(16);break;case 25:return v.g(c(function(){return k(function(e){return e.g($m(r,d,n),0)})},`srcEqualsInner_`),16);case 16:r.dispatchEvent(Lm(`loaded`));case 8:if(v.u(),!i){v.A(27);break}return v.g(i.destroy(),27);case 27:r.eb=null,v.B(0);break;case 7:if(_=v.l(),!_||_.code==7e3){v.A(29);break}return v.g(r.yc(!1),29);case 29:throw _}})};function Vm(e){for(var t=g(e.i.variants),n=t.next();!n.done;n=t.next())n=n.value,n.video&&(n.video.closeSegmentIndex(),n.video=null),n.bandwidth=n.audio&&n.audio.bandwidth?n.audio.bandwidth:0;e.i.variants=e.i.variants.filter(function(e){return e.audio})}r.hj=function(e,t,n){e=e===void 0||e,t=t!==void 0&&t,n=n!==void 0&&n;var r=this,i;return k(function(a){return a.h==1?a.g(Hm(r,n),2):a.h==3?a.return(i):(i=a.i,a.g(r.yc(e,t),3))})},r.Xh=function(e,t){e=e!==void 0&&e,t=t!==void 0&&t;var n=this,r;return k(function(i){return i.h==1?i.g(Hm(n,t),2):i.h==3?i.return(r):(r=i.i,i.g(n.detach(e),3))})};function Hm(e,t){t=t!==void 0&&t;var n,r,i;return k(function(a){if(a.h==1)return n=null,e.i&&e.I&&e.vc&&e.W&&e.g?(r=e.h.currentTime,t||(r=null),a.g(Wm(e,e.W,r,e.Ha,e.g,!0,!1),3)):a.A(2);if(a.h!=2){n=a.i,e.Ce.push(n),e.I&&e.I.setMediaElement&&e.I.setMediaElement(null),(i=e.l?e.l.o:null)&&(n.i=i);var o=n,s=e.I,c=e.vc;o.h=e.i,o.m=s,o.H=c,n.C=e.J,n.start(),e.i=null,e.I=null,e.vc=null,e.o=null,e.Ae=null}return a.return(n)})}r.preload=function(e,t,n,r){t=t===void 0?null:t;var i=this,a,o;return k(function(s){return s.h==1?(n=n?.toLowerCase(),a=Oh(i),pf(a,r||i.g,Oh(i)),s.g(Um(i,e,t,n,!1,a),2)):((o=s.i)?o.start():$h(i,new R(2,7,7005)),s.return(o))})},r.mg=function(){var e=this,t,n,r,i;return k(function(a){for(t=[],n=g(e.Ce),r=n.next();!r.done;r=n.next())i=r.value,i.l||t.push(i.destroy());return e.Ce=[],a.g(Promise.all(t),0)})};function Um(e,t,n,r,i,a){i=i!==void 0&&i;var o,s,c;return k(function(l){return l.h==1?r?l.A(2):l.g(Gm(e,t),3):(l.h!=2&&(r=l.i),Km(e,r)?l.return(null):(o=a||e.g,s=!1,i&&e.h&&e.h.nodeName===`AUDIO`&&(s=!0),c=Wm(e,t,n,r||null,o,!i,s),c=i?c.then(function(e){return e.D=!1,e}):c.then(function(t){return e.Ce.push(t),t}),l.return(c)))})}function Wm(e,t,n,r,i,a,o){a=a===void 0||a,o=o!==void 0&&o;var s,c,l,u,d,f,p,m,h,_,v,y,b,x,S;return k(function(C){return C.h==1?(s=null,c=fn(i),o&&(c.manifest.disableVideo=!0),l=function(){return s.R&&s.l?null:s},u=function(){return l()?l().getConfiguration():e.g},e.ya.width!=1/0||e.ya.height!=1/0||e.g.ignoreHardwareResolution?C.A(2):(d=we(),C.g(d.hc(),3))):(C.h!=2&&(f=C.i,e.ya.width=f.width,e.ya.height=f.height),p=new Go(c,e.ya,null),m={networkingEngine:e.N,filter:function(e){var t,n;return k(function(r){if(r.h==1)return r.g(Ko(p,e),2);if(r.h!=4)return t=r.i,t?(n=Lm(`trackschanged`),r.g(Promise.resolve(),4)):r.A(0);s.dispatchEvent(n),r.j()})},makeTextStreamsForClosedCaptions:function(t){return kh(e,t)},onTimelineRegionAdded:function(e){Du(s.I,e)},onEvent:function(e){return s.dispatchEvent(e)},onError:function(e){return s.onError(e)},isLowLatencyMode:function(){return u().streaming.lowLatencyMode},updateDuration:function(){e.l&&s.R&&e.l.updateDuration()},newDrmInfo:function(e){var t=s.j,n=t?t.g:null;n&&t.B&&Yo(p,n.keySystem,e)},onManifestUpdated:function(){var t=(/* @__PURE__ */ new Map()).set(`isLive`,e.T());s.dispatchEvent(Lm(`manifestupdated`,t)),Mf(s,!1,function(){e.C&&e.C.onManifestUpdated(e.T())})},getBandwidthEstimate:function(){return e.o.getBandwidthEstimate()},onMetadata:function(t,n,r,i){var a=t;(t==`com.apple.hls.interstitial`||t==`com.apple.hls.overlay`)&&(a=`com.apple.quicktime.HLS`,t={startTime:n,endTime:r,values:i},e.C&&e.C.onHLSInterstitialMetadata(e,e.h,t)),i=g(i),t=i.next();for(var o={};!t.done;o={$g:void 0},t=i.next())o.$g=t.value,o.$g.name!=`ID`&&Mf(s,!1,function(t){return function(){ih(e,n,r,a,t.$g)}}(o))},disableStream:function(t){return e.disableStream(t,e.g.streaming.maxDisabledTime)},addFont:function(t,n){return e.addFont(t,n)}},h=new Eu(function(){return e.Na()}),h.addEventListener(`regionadd`,function(t){var n=t.region;eg(e,`timelineregionadded`,n,s),Mf(s,!1,function(){e.C&&(e.C.onDashTimedMetadata(n),e.C.onDASHInterstitialMetadata(e,e.h,n))})}),_=null,c.streaming.observeQualityChanges&&(_=new bu(function(){return e.Cc()}),_.addEventListener(`qualitychange`,function(t){tg(e,t.quality,t.position)}),_.addEventListener(`audiotrackchange`,function(t){tg(e,t.quality,t.position,!0)})),v=!0,y={qc:e.N,onError:function(e){return s.onError(e)},wf:function(t){Mf(s,!0,function(){e.D&&rg(e,t)})},onExpirationUpdated:function(e,t){var n=Lm(`expirationupdated`);s.dispatchEvent(n),(n=s.m)&&n.onExpirationUpdated&&n.onExpirationUpdated(e,t)},onEvent:function(t){if(s.dispatchEvent(t),t.type==`drmsessionupdate`&&v){v=!1,t=Date.now()/1e3-s.za;var n=e.B||s.getStats();t>=0&&(n.m=t),e.S&&zt(e.S)}}},b=oh(e,l),xa(e.N,b),x=function(){return e.ed(y)},S={config:c,xk:m,Kk:h,Jk:_,ed:x,wk:p,networkingEngine:b,nj:a},s=new jf(t,r,n,S),C.return(s))})}function Gm(e,t){var n,r,i,a;return k(function(o){return o.h==1?(n=e.g.manifest.retryParameters,o.g(qu(t,e.N,n),2)):(r=o.i,Lr(r)?(i=we(),i.Ia()===`WEBKIT`&&(r=`application/vnd.apple.mpegurl`)):r===`video/quicktime`&&(a=we(),a.Ia()===`CHROMIUM`&&(r=`video/mp4`)),o.return(r))})}function Km(e,t){if(!$x(we()))return!0;if(t){if((e.h||cc()).canPlayType(t)==``)return!1;if(!$x(we())||!Gt.has(t))return!0;if(Lr(t))return we().Ia()===`WEBKIT`&&(e.g.drm.servers[`com.apple.fps`]||e.g.drm.servers[`com.apple.fps.1_0`])?e.g.streaming.useNativeHlsForFairPlay:e.g.streaming.preferNativeHls;if(t===`application/dash+xml`||t===`video/vnd.mpeg.dash.mpd`)return e.g.streaming.preferNativeDash}return!1}function qm(e,t){var n=e.g.textDisplayFactory;e.Lh!==n||t!==void 0&&t?(t=e.u,e.u=n(),e.u.configure?e.u.configure(e.g.textDisplayer):L(`Text displayer w/ configure`,`Text displayer should have a "configure" method!`),e.u.setTextLanguage||L(`Text displayer w/ setTextLanguage`,`Text displayer should have a "setTextLanguage" method!`),t?(e.u.setTextVisibility(t.isTextVisible()),t.destroy().catch(function(){})):e.u.setTextVisibility(e.Z),e.H&&Tl(e.H,e.u),e.Lh=n,e.l&&ad(e.l)):e.u&&e.u.configure&&e.u.configure(e.g.textDisplayer)}function Jm(e){var t,n,r;return k(function(i){if(i.h==1)return we(),zm(e,`media-source`),e.g.mediaSource.useSourceElements&&oc(e.h),qm(e),t=ph(e.h,e.u,{Nj:function(){return e.keySystem()},onMetadata:function(t,n,r){t=g(t);for(var i=t.next();!i.done;i=t.next())if(i=i.value,i.data&&typeof i.cueTime==`number`&&i.frames){var a=i.cueTime+n,o=r;o&&a>o&&(o=a);for(var s=g(i.frames),c=s.next();!c.done;c=s.next())ih(e,a,o,`org.id3`,c.value);e.C&&e.C.onHlsTimedMetadata(i,a)}},Dk:function(t){e.hb&&Du(e.hb,{schemeIdUri:t.schemeIdUri,startTime:t.startTime,endTime:t.endTime,id:String(t.id),emsg:t})},onEvent:function(t){return e.dispatchEvent(t)},Fk:function(){e.I&&e.I.update&&e.I.update()}},e.S,e.g.mediaSource),n=e.g.manifest,r=n.segmentRelativeVttTiming,t.Ha=r,i.g(t.M,2);e.H=t,i.j()})}function Ym(e,t){e.M=new gu({Hg:function(){return t.playbackRate},ld:function(){return t.defaultPlaybackRate},Ti:function(e){t.playbackRate=e},Bk:function(n){var r=t.currentTime;if(ec(t.buffered,r)&&!(t.readyState<=HTMLMediaElement.HAVE_CURRENT_DATA)){n=r+n;var i=e.Na();n<i.start?r!==i.start&&(t.currentTime=i.start):n>i.end?r!==i.end&&(t.currentTime=i.end):t.currentTime=n}},isPaused:function(){return t.paused}})}function Xm(e,t,n){function r(){return Ph(e)}if(e.j.F(t,`playing`,r),e.j.F(t,`pause`,r),e.j.F(t,`ended`,r),e.j.F(t,`ratechange`,function(){return Mh(e)}),t.remote&&(e.j.F(t.remote,`connect`,function(){e.l&&t.remote.state==`connected`&&Jh(e),Wh(e)}),e.j.F(t.remote,`connecting`,function(){return Wh(e)}),e.j.F(t.remote,`disconnect`,function(){return k(function(n){if(n.h==1)return e.l&&t.remote.state==`disconnected`?n.g(Nd(e.l),3):n.A(2);n.h!=2&&Jh(e),Wh(e),n.j()})})),t.audioTracks&&(e.j.F(t.audioTracks,`addtrack`,function(){return Wh(e)}),e.j.F(t.audioTracks,`removetrack`,function(){return Wh(e)}),e.j.F(t.audioTracks,`change`,function(){return Wh(e)})),t.videoTracks&&(e.j.F(t.videoTracks,`addtrack`,function(){return Wh(e)}),e.j.F(t.videoTracks,`removetrack`,function(){return Wh(e)}),e.j.F(t.videoTracks,`change`,function(){return Wh(e)})),(t.webkitPresentationMode||t.webkitSupportsFullscreen)&&e.j.F(t,`webkitpresentationmodechanged`,function(){e.ve&&qm(e,!0)}),t.textTracks){var i=function(){e.m===dg&&e.u instanceof fp&&Jh(e),Wh(e)};e.j.F(t.textTracks,`addtrack`,function(t){if(t.track)switch(t=t.track,t.kind){case`metadata`:nh(e,t);break;case`chapters`:ah(e,t);break;default:i()}}),e.j.F(t.textTracks,`removetrack`,i),e.j.F(t.textTracks,`change`,i)}t.preload!=`none`&&e.j.Ba(t,`loadedmetadata`,function(){var t=e.B,r=Date.now()/1e3-n;r>=0&&(t.G=r)})}function Zm(t,n,r,i){var a,o,s,c,l,u,d,f,p,m,h,_,v,y,b,x,S,C,w,T,E,D,O,A,j,M,ee,te,N;return k(function(ne){switch(ne.h){case 1:for(zm(t,`load`),a=t.h,Ym(t,a),Xm(t,a,n),(`onchange`in e.screen)&&t.j.F(e.screen,`change`,function(){if(t.J.getConfiguration){var e=t.J.getConfiguration();e.hdrLevel==`AUTO`?Rh(t):t.g.preferredVideoHdrLevel==`AUTO`&&t.g.abr.enabled&&(e.hdrLevel=`AUTO`,t.J.configure(e),Rh(t))}}),o=!1,s=g(t.i.variants),c=s.next();!c.done;c=s.next())l=c.value,(u=l.video&&l.video.dependencyStream)&&(o=Bt(u));Im(t,t.g,o),t.Gd=t.g.preferredTextLanguage,t.Kd=t.g.preferredTextRole,t.Jd=t.g.preferForcedSubs,ig(t.i.presentationTimeline,t.g.playRangeStart,t.g.playRangeEnd),t.o.init(function(e,n,r){t.i&&t.l&&e!=t.l.o&&Vh(t,e,!0,n!==void 0&&n,r===void 0?0:r)}),t.o.setMediaElement(a),t.o.setCmsdManager(t.ua),t.l=mh(t),t.l.configure(t.g.streaming),t.m=ug,t.dispatchEvent(Lm(`streaming`)),d=r;case 2:for(p=t.l.o,p||(m=zh(t,!0),r||(d=m)),h=[],f=p||d,_=g([f.video,f.audio]),v=_.next();!v.done;v=_.next())(y=v.value)&&!y.segmentIndex&&(h.push(y.createSegmentIndex()),y.dependencyStream&&h.push(y.dependencyStream.createSegmentIndex()));if(!(h.length>0)){ne.A(4);break}return ne.g(Promise.all(h),4);case 4:if(!f||f.disabledUntilTime!=0){ne.A(2);break}if(Rh(t),t.I&&t.I.onInitialVariantChosen&&t.I.onInitialVariantChosen(f),t.i.isLowLatency&&(t.g.streaming.lowLatencyMode?t.configure(t.Yf):F(`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.`)),t.K&&(kp(t.K,t.i.isLowLatency&&t.g.streaming.lowLatencyMode),Ap(t.K,n*1e3)),ig(t.i.presentationTimeline,t.g.playRangeStart,t.g.playRangeEnd),$u(t.l,t.g.playRangeStart,t.g.playRangeEnd),t.Ua=!0,t.dispatchEvent(Lm(`canupdatestarttime`)),b=function(e){t.G=sh(t,e),t.Xb=ch(t,e),uh(t,a,!1)},t.g.streaming.startAtSegmentBoundary||(x=t.O,x==null&&t.i.startTime&&(x=t.i.startTime),b(x)),p){ne.A(7);break}if(!t.g.streaming.startAtSegmentBoundary){ne.A(8);break}return S=t.i.presentationTimeline,t.O instanceof Date&&(w=S.m||S.i,T=t.O.getTime()/1e3-w,T!=null&&(C=T)),C??(C=typeof t.O==`number`?t.O:t.T()?1/0:t.h.currentTime),t.O==null&&t.i.startTime&&(C=t.i.startTime),E=S.Ub(),D=S.Eb(),C<E?C=E:C>D&&(C=D),ne.g(Ah(d,C),9);case 9:O=ne.i,b(O);case 8:Vh(t,d,!0,!1,0);case 7:return t.G.ready(),A=t.Gc().find(function(e){return e.active}),A||((j=Vi(t.i.textStreams,t.Gd,t.Kd,t.Jd)[0]||null)&&xf(t.B.h,j,!0),d&&(j?(Ki(d.audio,j,t.g)&&(t.Z=!0),t.Z&&t.u.setTextVisibility(!0)):(t.Z=!1,t.u.setTextVisibility(!1)),Yh(t)),j&&(t.g.streaming.alwaysStreamText||t.Qg())&&(id(t.l,j),Zh(t))),ne.g(t.l.start(i),10);case 10:t.g.abr.enabled&&(t.o.enable(),Xh(t)),Wh(t),t.i.variants.some(function(e){return e.primary}),((M=t.T())&&(t.g.streaming.liveSync&&t.g.streaming.liveSync.enabled||t.i.serviceDescription||t.g.streaming.liveSync.panicMode)||t.g.streaming.vodDynamicPlaybackRate)&&(ee=function(){return Fh(t)},t.j.F(a,`timeupdate`,ee)),M||(te=function(){return Lh(t)},t.j.F(a,`timeupdate`,te),Lh(t),t.i.nextUrl&&(t.g.streaming.preloadNextUrlWindow>0&&(N=function(){var e;return k(function(n){if(n.h==1)return e=t.Na().end-t.h.currentTime,isNaN(e)||!(e<=t.g.streaming.preloadNextUrlWindow)?n.A(0):(t.j.Oa(a,`timeupdate`,N),n.g(t.preload(t.i.nextUrl),4));t.eb=n.i,n.j()})},t.j.F(a,`timeupdate`,N)),t.j.F(a,`ended`,function(){t.load(t.eb||t.i.nextUrl)}))),t.C&&t.C.onManifestUpdated(M),ne.j()}})}function Qm(e,t){var n,r,i;return k(function(a){return a.h==1?(n=Date.now()/1e3,r=!0,e.D=e.ed({qc:e.N,onError:function(t){$h(e,t)},wf:function(){},onExpirationUpdated:function(){var t=Lm(`expirationupdated`);e.dispatchEvent(t)},onEvent:function(t){if(e.dispatchEvent(t),t.type==`drmsessionupdate`&&r){r=!1,t=e.B;var i=Date.now()/1e3-n;i>=0&&(t.m=i)}}}),e.D.configure(e.g.drm),i=qi([t]),e.D.O=!0,a.g(ro(e.D,[i],[]),2)):a.g(e.D.Pb(e.h),0)})}function $m(e,t,n){var r,i,a,o,s,c,l,u,d,f,p,m;return k(function(h){switch(h.h){case 1:if(zm(e,`src-equals`),r=e.h,e.G=new nu(r),i=!1,e.xe.push(function(){i=!0}),e.dispatchEvent(Lm(`canupdatestarttime`)),e.O!=null&&e.G.Vf(e.O),e.Xb=lh(e,e.O||0),Ym(e,r),uh(e,r,!0),r.textTracks&&(qm(e),a=function(t){if(!(e.u instanceof fp)){var n=bh(e).find(function(e){return e.mode!==`disabled`});n&&(n.mode=t?`showing`:`hidden`),e.u instanceof pp&&(n=xh(e))&&(n.mode=!t&&e.u.isTextVisible()?`showing`:`hidden`)}},e.j.F(r,`enterpictureinpicture`,function(){return a(!0)}),e.j.F(r,`leavepictureinpicture`,function(){return a(!1)}),r.remote?(e.j.F(r.remote,`connect`,function(){return a(!1)}),e.j.F(r.remote,`connecting`,function(){return a(!1)}),e.j.F(r.remote,`disconnect`,function(){return a(!1)})):`webkitCurrentPlaybackTargetIsWireless`in r&&e.j.F(r,`webkitcurrentplaybacktargetiswirelesschanged`,function(){return a(!1)}),o=r,(o.webkitPresentationMode||o.webkitSupportsFullscreen)&&e.j.F(o,`webkitpresentationmodechanged`,function(){o.webkitPresentationMode?a(o.webkitPresentationMode!==`inline`):o.webkitSupportsFullscreen&&a(o.webkitDisplayingFullscreen)})),Xm(e,r,t),s=jp(e.K,e.W,n),!s.includes(`#t=`)&&(e.g.playRangeStart>0||isFinite(e.g.playRangeEnd))&&(s+=`#t=`,e.g.playRangeStart>0&&(s+=e.g.playRangeStart),isFinite(e.g.playRangeEnd)&&(s+=`,`+e.g.playRangeEnd)),!e.H){h.A(2);break}return h.g(e.H.destroy(),3);case 3:e.H=null;case 2:return oc(r),r.src=s,c=we(),c.Qa()==`TV`&&r.load(),r.preload!=`none`&&!r.autoplay&&Lr(n)&&c.Ia()===`WEBKIT`&&r.load(),e.m=dg,e.dispatchEvent(Lm(`streaming`)),l=function(){return new Promise(function(t){var n=new Qr(t);e.j.F(r.textTracks,`change`,function(){return n.na(.5)}),n.na(.5)})},u=new oa,ql(r,HTMLMediaElement.HAVE_METADATA,e.j,function(){return k(function(t){if(t.h==1)return e.G.ready(),e.Ha&&Lr(e.Ha)?t.g(l(),3):(u.resolve(),t.A(0));u.resolve(),t.j()})}),ql(r,HTMLMediaElement.HAVE_CURRENT_DATA,e.j,function(){var t,n,r,a,o;return k(function(s){if(s.h==1)return s.g(l(),2);if(i)return s.return();if(eh(e),t=bh(e),t.some(function(e){return e.mode===`showing`})&&(e.Z=!0,e.u.setTextVisibility(!0)),!(e.u instanceof fp))for(t.length&&(e.u.enableTextDisplayer?e.u.enableTextDisplayer():L(`Text displayer w/ enableTextDisplayer`,`Text displayer should have a "enableTextDisplayer" method`)),n=!1,r=g(t),a=r.next();!a.done;a=r.next())o=a.value,o.mode!==`disabled`&&(n?(o.mode=`disabled`,F(`Found more than one enabled text track, disabling it`,o)):(yh(e,o),n=!0));th(e),s.j()})}),r.error?u.reject(ng(e)):r.preload==`none`&&(F(`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.`),u.resolve()),e.j.Ba(r,`error`,function(){u.reject(ng(e))}),h.g(ii(e.g.streaming.loadTimeout,u),4);case 4:((d=e.T())&&(e.g.streaming.liveSync&&e.g.streaming.liveSync.enabled||e.g.streaming.liveSync.panicMode)||e.g.streaming.vodDynamicPlaybackRate)&&(f=function(){return Fh(e)},e.j.F(r,`timeupdate`,f)),d||(p=function(){return Lh(e)},e.j.F(r,`timeupdate`,p),Lh(e)),e.C&&(e.C.onManifestUpdated(d),d&&(m=e.Na().end,e.j.F(r,`progress`,function(){var t=e.Na().end;m!=t&&(e.C.onManifestUpdated(e.T()),m=t)}))),e.Ua=!0,h.j()}})}function eh(e){var t=e.g.preferredAudioLanguage;t!=``&&e.Pi(t,e.g.preferredAudioRole)}function th(e){var t=e.g.preferredTextLanguage;t!=``&&e.nh(t,e.g.preferredTextRole,e.g.preferForcedSubs)}function nh(e,t){if(t.kind==`metadata`){t.mode=`hidden`,e.j.F(t,`cuechange`,function(){if(t.activeCues)for(var n=g(t.activeCues),r=n.next();!r.done;r=n.next())r=r.value,ih(e,r.startTime,r.endTime,r.type,r.value),e.C&&e.C.onCueMetadataChange(r.value);if(t.cues){n=[],r=g(t.cues);for(var i=r.next(),a={};!i.done;a={Ac:void 0},i=r.next())a.Ac=i.value,a.Ac.type==`com.apple.quicktime.HLS`&&a.Ac.startTime!=null&&(i=n.find(function(e){return function(t){return t.startTime==e.Ac.startTime&&t.endTime==e.Ac.endTime}}(a)),i||(i={startTime:a.Ac.startTime,endTime:a.Ac.endTime,values:[]},n.push(i)),i.values.push(a.Ac.value));for(n=g(n),r=n.next();!r.done;r=n.next())r=r.value,r.values.some(function(e){return e.key==`X-ASSET-URI`||e.key==`X-ASSET-LIST`})&&e.C&&(r.values.push({key:`CUE`,description:``,data:r.startTime!=0||e.T()?`ONCE`:`ONCE,PRE`,mimeType:null,pictureType:null}),e.C.onHLSInterstitialMetadata(e,e.h,r))}});var n=new Qr(function(){var t=Sh(e);t=g(t);for(var n=t.next();!n.done;n=t.next())n.value.mode=`hidden`}).yb().na(.5);e.xe.push(function(){n.stop()})}}function rh(e,t,n){t=(/* @__PURE__ */ new Map()).set(`startTime`,t.startTime).set(`endTime`,t.endTime).set(`metadataType`,t.schemeIdUri).set(`payload`,t.payload),e.dispatchEvent(Lm(n,t))}function ih(e,t,n,r,i){e.za&&(t={schemeIdUri:r,startTime:t,endTime:n||1/0,id:``,payload:i},t.id=JSON.stringify(t),Du(e.za,t))}function ah(e,t){if(t&&t.kind==`chapters`){t.mode=`hidden`;var n=new Qr(function(){t.mode=`hidden`}).yb().na(.5);e.xe.push(function(){n.stop()})}}r.Ok=function(){for(var e=this.aa;e.g;)e.release()},r.ed=function(e){return new eo(e)};function oh(e,t){function n(n){t()?t().dispatchEvent(n):e.dispatchEvent(n)}function r(e){t()?Mf(t(),!0,e):e()}t||(t=function(){return null});var i=new ya(function(t,n,i,a,o){r(function(){e.o&&e.o.segmentDownloaded(t,n,i,a,o)})},function(t,i,a){i=(/* @__PURE__ */ new Map()).set(`headers`,t).set(`request`,i).set(`requestType`,a),n(Lm(`downloadheadersreceived`,i)),r(function(){if(e.ua){var n=e.ua;if(n.h.enabled){var r=t[`cmsd-static`];if(r)try{var i=/* @__PURE__ */ new Map,a=r.split(`,`);for(r=0;r<a.length;r++){var o=a[r].split(`=`);i.set(o[0],Om(o[1]))}}catch{}if(i=t[`cmsd-dynamic`]){a:try{var s=/* @__PURE__ */ new Map,c=i.split(`;`);for(i=1;i<c.length;i++){var l=c[i].split(`=`);s.set(l[0],Om(l[1]))}var u=s;break a}catch{u=null;break a}u&&(n.g=u)}}}})},function(e,t){e=(/* @__PURE__ */ new Map()).set(`request`,e).set(`response`,t),n(Lm(`downloadcompleted`,e))},function(e,t,r,i){e=(/* @__PURE__ */ new Map()).set(`request`,e).set(`error`,t).set(`httpResponseCode`,r).set(`aborted`,i),n(Lm(`downloadfailed`,e))},function(t,n,i){r(function(){if(e.K){var r=e.K,a=i;if(a=a===void 0?{}:a,r.g.enabled){if(n.method===`HEAD`)zp(r,n,{});else switch(t){case 0:try{if(r.g.enabled){if(a.type){a:{switch(a.type){case 4:var o=r.u?dm:um;break a;case 3:case 2:o=r.u?pm:fm;break a;case 5:o=`s`;break a}o=void 0}r.l=o}zp(r,n,{ot:em,su:!r.D})}}catch(e){le(`CMCD_MANIFEST_ERROR`,`Could not generate manifest CMCD data.`,e)}break;case ka:try{if(r.g.enabled){var s=Yp(r,a,n.uris[0]);s.ts=Date.now(),r.m.has(n)&&r.m.delete(n),r.m.set(n,s.ts),zp(r,n,s)}}catch(e){le(`CMCD_SEGMENT_ERROR`,`Could not generate segment CMCD data.`,e)}break;case 2:case 5:case 6:zp(r,n,{ot:`k`});break;case 4:zp(r,n,{ot:`o`})}}}})},function(n,r,i,a){(n=t()?t().m:e.I)&&n.banLocation&&n.banLocation(a)},function(n,r,i){if(r.data){var a=r.data.byteLength,o=t()?t().getStats():e.B;if(o&&(kf(o,a),n===0&&(o.si=a)),a=e.K,i=i===void 0?{}:i,Ip(a).length!==0)switch(n){case ka:try{var s=Yp(a,i,r.uri);r.originalRequest&&r.originalRequest.timeToFirstByte!=null&&(s.ttfb=r.originalRequest.timeToFirstByte),r.timeMs!=null&&(s.ttlb=r.timeMs);var c=r.originalUri||r.uri;if(c.includes(`CMCD=`))try{var l=new URL(c);l.searchParams.delete(`CMCD`);var u=l.toString()}catch{u=c}else u=c;s.url=u,a.m.has(r.originalRequest)?(s.ts=a.m.get(r.originalRequest),a.m.delete(r.originalRequest)):s.ts||(s.ts=Date.now());var d=Ip(a);if(d.length!==0){var f=a.g.version==sm?Array.from(new Set([].concat(_(hm),_(_m)))):mm;s.rc=r.status||0;var p=Xp(a,s,Tm);r.headers&&r.headers[`CMSD-Static`]&&(p.cmsds=btoa(r.headers[`CMSD-Static`])),r.headers&&r.headers[`CMSD-Dynamic`]&&(p.cmsdd=btoa(r.headers[`CMSD-Dynamic`]));for(var m=g(d),h=m.next();!h.done;h=m.next()){var v=h.value,y=Hp(v.includeKeys||[],f),b=Gp(v);a.o[b]||(a.o[b]={request:1,response:1}),p.sn=a.o[b].response++;var x=Up(p,y);Bp(a,x,v,r)}}}catch(e){le(`CMCD_SEGMENT_ERROR`,`Could not generate response segment CMCD data.`,e)}}}});return i.configure(e.g.networking),i}function sh(e,t){return new au(e.h,e.i,e.g.streaming,t,function(){e.Xb&&yu(e.Xb,!e.G.Jh()),e.l&&e.l.Uc(),e.R&&fh(e,`seeking`)},function(t){return e.dispatchEvent(t)})}function ch(e,t){var n=e.T()||typeof t==`number`&&t>0;t=new Xf(e.ue,n),t.addEventListener(`enter`,function(t){eg(e,`timelineregionenter`,t.region)}),t.addEventListener(`exit`,function(t){eg(e,`timelineregionexit`,t.region)}),t.addEventListener(`skip`,function(t){var n=t.region;t.seeking||(eg(e,`timelineregionenter`,n),eg(e,`timelineregionexit`,n))});var r=new Xf(e.za,n);r.addEventListener(`enter`,function(t){rh(e,t.region,`metadata`)}),n=new Xf(e.hb,n),n.addEventListener(`enter`,function(t){t=(/* @__PURE__ */ new Map()).set(`detail`,t.region.emsg),e.dispatchEvent(Lm(`emsg`,t))});var i=new vu(e.h);return i.g.add(t),i.g.add(r),i.g.add(n),e.re&&i.g.add(e.re),i}function lh(e,t){t=new Xf(e.za,t instanceof Date||t>0),t.addEventListener(`enter`,function(t){rh(e,t.region,`metadata`)});var n=new vu(e.h);return n.g.add(t),n}function uh(e,t,n){e.R=new Vo,Ho(e.R,Uo),dh(e),jh(e),e.Ka=new Qr(function(){fh(e)}),e.g.streaming.rebufferingGoal&&e.Ka.Fa(.25),e.j.F(t,`waiting`,function(){return fh(e,`waiting`)}),e.j.F(t,`canplaythrough`,function(){return fh(e,`canplaythrough`)}),e.j.F(t,`playing`,function(){return fh(e,`playing`)}),e.j.F(t,`seeked`,function(){return fh(e,`seeked`)}),e.j.F(t,`timeupdate`,function(){return fh(e,`timeupdate`)}),n&&(e.j.F(t,`progress`,function(){return fh(e,`progress`)}),e.j.F(t,`stalled`,function(){return fh(e,`stalled`)}))}function dh(e){var t=e.g.streaming.rebufferingGoal;e.R.j.set(Wo,Math.min(.5,t/2)).set(Uo,t)}function fh(e,t){if(e.g.streaming.rebufferingGoal){t=e.H?el(e.H):!1,t=e.$d()||t||e.G.ni();var n=tc(e.h.buffered,e.h.currentTime),r=e.R,i=r.j.get(r.g);Ho(r,t||n>=i&&n>0?Wo:Uo)&&jh(e)}else if(t){n=e.R,r=e.h.currentTime,i=n.h,n.h=r;var a=void 0;switch(t){case`seeking`:case`waiting`:n.h=-1,a=Uo;break;case`canplaythrough`:case`playing`:case`seeked`:a=Wo;break;case`timeupdate`:i>=0&&r-i>.01&&(a=Wo)}a!==void 0&&Ho(n,a)&&jh(e)}}function ph(e,t,n,r,i){return new Gc(e,t,n,i,r)}function mh(e){return new Zu(e.i,{Tb:function(){return e.G?e.G.Ld():0},getBandwidthEstimate:function(){return e.o.getBandwidthEstimate()},Db:function(){return e.Db()},video:e.h,X:e.H,qc:e.N,onError:function(t){return $h(e,t)},onEvent:function(t){return e.dispatchEvent(t)},ud:function(t,n,r,i){var a=t.startTime,o=t.endTime,s=n.type;if(s!=Nt){if(e.G){e.G.Bi();var c=nl(e.H,s);!e.T()&&e.h.paused&&!e.h.seeking&&c!=null&&c>0&&e.G.Ld()<c&&!yc(e.G.Ld(),c,.001)&&e.G.Vf(c)}fh(e)}r=(/* @__PURE__ */ new Map()).set(`start`,a).set(`end`,o).set(`contentType`,s).set(`isMuxed`,r).set(`isDependency`,i),e.dispatchEvent(Lm(`segmentappended`,r)),e.o&&n.fastSwitching&&t.Rc&&t.be&&e.o.trySuggestStreams()},Ek:function(t,n){(n=n.sd)&&e.re&&Su(e.re,n,t)},Rh:function(t,n){var r=e.D;if(r.h.parseInbandPsshEnabled&&!r.H&&[`audio`,`video`].includes(t)){t=new Qa(Ze(n)),n=0;for(var i=g(t.data),a=i.next();!a.done;a=i.next())n+=a.value.length;if(n==0)r=Promise.resolve();else{for(n=new Uint8Array(n),i=0,t=g(t.data),a=t.next();!a.done;a=t.next())a=a.value,n.set(a,i),i+=a.length;fo(r,`cenc`,n),r=r.m}}else r=Promise.resolve();return r},disableStream:function(t,n){return e.disableStream(t,n)},hl:function(t,n){return!(e.g.abr.enabled&&n.fastSwitching&&t.Rc&&t.be)}})}r.configure=function(e,t){var n=this.getConfiguration();if(arguments.length==2&&typeof e==`string`&&(e=Hd(e,t)),`preferredVariantRole`in e&&(L(`preferredVariantRole configuration`,`Please Use preferredAudioRole instead.`),e.preferredAudioRole=e.preferredVariantRole,delete e.preferredVariantRole),e.streaming&&`forceTransmuxTS`in e.streaming&&(L(`streaming.forceTransmuxTS configuration`,`Please Use mediaSource.forceTransmux instead.`),e.mediaSource=e.mediaSource||{},e.mediaSource.mediaSource=e.streaming.forceTransmuxTS,delete e.streaming.forceTransmuxTS),e.streaming&&`forceTransmux`in e.streaming&&(L(`streaming.forceTransmux configuration`,`Please Use mediaSource.forceTransmux instead.`),e.mediaSource=e.mediaSource||{},e.mediaSource.mediaSource=e.streaming.forceTransmux,delete e.streaming.forceTransmux),e.streaming&&`useNativeHlsOnSafari`in e.streaming){L(`streaming.useNativeHlsOnSafari configuration`,`Please Use streaming.useNativeHlsForFairPlay or streaming.preferNativeHls instead.`);var r=we();e.streaming.preferNativeHls=e.streaming.useNativeHlsOnSafari&&r.Ia()===`WEBKIT`,delete e.streaming.useNativeHlsOnSafari}if(e.streaming&&typeof e.streaming.liveSync==`boolean`&&(L(`streaming.liveSync`,`Please Use streaming.liveSync.enabled instead.`),r=e.streaming.liveSync,e.streaming.liveSync={},e.streaming.liveSync.enabled=r),e.streaming&&!(e.streaming.liveSync&&`targetLatency`in e.streaming.liveSync)&&(`liveSyncMinLatency`in e.streaming||`liveSyncMaxLatency`in e.streaming)){r=e.streaming.liveSyncMinLatency||0;var i=Math.abs((e.streaming.liveSyncMaxLatency||1)-r)/2;e.streaming.liveSync=e.streaming.liveSync||{},e.streaming.liveSync.targetLatency=r+i,e.streaming.liveSync.targetLatencyTolerance=i}if(e.streaming&&`liveSyncMaxLatency`in e.streaming&&(L(`streaming.liveSyncMaxLatency`,`Please Use streaming.liveSync.targetLatency and streaming.liveSync.targetLatencyTolerance instead. Or, set the values in your DASH manifest`),delete e.streaming.liveSyncMaxLatency),e.streaming&&`liveSyncMinLatency`in e.streaming&&(L(`streaming.liveSyncMinLatency`,`Please Use streaming.liveSync.targetLatency and streaming.liveSync.targetLatencyTolerance instead. Or, set the values in your DASH manifest`),delete e.streaming.liveSyncMinLatency),e.streaming&&`liveSyncTargetLatency`in e.streaming&&(L(`streaming.liveSyncTargetLatency`,`Please Use streaming.liveSync.targetLatency instead.`),e.streaming.liveSync=e.streaming.liveSync||{},e.streaming.liveSync.targetLatency=e.streaming.liveSyncTargetLatency,delete e.streaming.liveSyncTargetLatency),e.streaming&&`liveSyncTargetLatencyTolerance`in e.streaming&&(L(`streaming.liveSyncTargetLatencyTolerance`,`Please Use streaming.liveSync.targetLatencyTolerance instead.`),e.streaming.liveSync=e.streaming.liveSync||{},e.streaming.liveSync.targetLatencyTolerance=e.streaming.liveSyncTargetLatencyTolerance,delete e.streaming.liveSyncTargetLatencyTolerance),e.streaming&&`liveSyncPlaybackRate`in e.streaming&&(L(`streaming.liveSyncPlaybackRate`,`Please Use streaming.liveSync.maxPlaybackRate instead.`),e.streaming.liveSync=e.streaming.liveSync||{},e.streaming.liveSync.maxPlaybackRate=e.streaming.liveSyncPlaybackRate,delete e.streaming.liveSyncPlaybackRate),e.streaming&&`liveSyncMinPlaybackRate`in e.streaming&&(L(`streaming.liveSyncMinPlaybackRate`,`Please Use streaming.liveSync.minPlaybackRate instead.`),e.streaming.liveSync=e.streaming.liveSync||{},e.streaming.liveSync.minPlaybackRate=e.streaming.liveSyncMinPlaybackRate,delete e.streaming.liveSyncMinPlaybackRate),e.streaming&&`liveSyncPanicMode`in e.streaming&&(L(`streaming.liveSyncPanicMode`,`Please Use streaming.liveSync.panicMode instead.`),e.streaming.liveSync=e.streaming.liveSync||{},e.streaming.liveSync.panicMode=e.streaming.liveSyncPanicMode,delete e.streaming.liveSyncPanicMode),e.streaming&&`liveSyncPanicThreshold`in e.streaming&&(L(`streaming.liveSyncPanicThreshold`,`Please Use streaming.liveSync.panicThreshold instead.`),e.streaming.liveSync=e.streaming.liveSync||{},e.streaming.liveSync.panicThreshold=e.streaming.liveSyncPanicThreshold,delete e.streaming.liveSyncPanicThreshold),e.mediaSource&&`sourceBufferExtraFeatures`in e.mediaSource){L(`mediaSource.sourceBufferExtraFeatures configuration`,`Please Use mediaSource.addExtraFeaturesToSourceBuffer() instead.`);var a=e.mediaSource.sourceBufferExtraFeatures;e.mediaSource.addExtraFeaturesToSourceBuffer=function(){return a},delete e.mediaSource.sourceBufferExtraFeatures}if(e.manifest&&e.manifest.hls&&`useSafariBehaviorForLive`in e.manifest.hls&&(L(`manifest.hls.useSafariBehaviorForLive configuration`,`Please Use liveSync config to keep on live Edge instead.`),delete e.manifest.hls.useSafariBehaviorForLive),e.streaming&&`parsePrftBox`in e.streaming&&(L(`streaming.parsePrftBox configuration`,`Now fired without needing a configuration.`),delete e.streaming.parsePrftBox),e.manifest&&e.manifest.dash&&`enableAudioGroups`in e.manifest.dash&&(L(`manifest.dash.enableAudioGroups configuration`,`Please Use manifest.enableAudioGroups instead.`),e.manifest.enableAudioGroups=e.manifest.dash.enableAudioGroups,delete e.manifest.dash.enableAudioGroups),e.streaming&&`dispatchAllEmsgBoxes`in e.streaming&&(L(`streaming.dispatchAllEmsgBoxes configuration`,`Please Use mediaSource.dispatchAllEmsgBoxes instead.`),e.mediaSource=e.mediaSource||{},e.mediaSource.dispatchAllEmsgBoxes=e.streaming.dispatchAllEmsgBoxes,delete e.streaming.dispatchAllEmsgBoxes),e.streaming&&`autoLowLatencyMode`in e.streaming&&(L(`streaming.autoLowLatencyMode configuration`,`Please Use streaming.lowLatencyMode instead.`),e.streaming.lowLatencyMode=e.streaming.autoLowLatencyMode,delete e.streaming.autoLowLatencyMode),e.manifest&&e.manifest.dash&&`ignoreSupplementalCodecs`in e.manifest.dash&&(L(`manifest.dash.ignoreSupplementalCodecs configuration`,`Please Use manifest.ignoreSupplementalCodecs instead.`),e.manifest.ignoreSupplementalCodecs=e.manifest.dash.ignoreSupplementalCodecs,delete e.manifest.dash.ignoreSupplementalCodecs),e.manifest&&e.manifest.hls&&`ignoreSupplementalCodecs`in e.manifest.hls&&(L(`manifest.hls.ignoreSupplementalCodecs configuration`,`Please Use manifest.ignoreSupplementalCodecs instead.`),e.manifest.ignoreSupplementalCodecs=e.manifest.hls.ignoreSupplementalCodecs,delete e.manifest.hls.ignoreSupplementalCodecs),e.manifest&&e.manifest.dash&&`updatePeriod`in e.manifest.dash&&(L(`manifest.dash.updatePeriod configuration`,`Please Use manifest.updatePeriod instead.`),e.manifest.updatePeriod=e.manifest.dash.updatePeriod,delete e.manifest.dash.updatePeriod),e.manifest&&e.manifest.hls&&`updatePeriod`in e.manifest.hls&&(L(`manifest.hls.updatePeriod configuration`,`Please Use manifest.updatePeriod instead.`),e.manifest.updatePeriod=e.manifest.hls.updatePeriod,delete e.manifest.hls.updatePeriod),e.manifest&&e.manifest.dash&&`ignoreDrmInfo`in e.manifest.dash&&(L(`manifest.dash.ignoreDrmInfo configuration`,`Please Use manifest.ignoreDrmInfo instead.`),e.manifest.ignoreDrmInfo=e.manifest.dash.ignoreDrmInfo,delete e.manifest.dash.ignoreDrmInfo),e.drm&&e.drm.advanced){for(var o in r=!1,e.drm.advanced){var s=e.drm.advanced[o];i=s.videoRobustness,s=s.audioRobustness,`videoRobustness`in e.drm.advanced[o]&&!Array.isArray(e.drm.advanced[o].videoRobustness)&&(e.drm.advanced[o].videoRobustness=[i],r=!0),`audioRobustness`in e.drm.advanced[o]&&!Array.isArray(e.drm.advanced[o].audioRobustness)&&(e.drm.advanced[o].audioRobustness=[s],r=!0)}r&&L(`AdvancedDrmConfiguration's videoRobustness and audioRobustness`,`These properties are no longer strings but array of strings, please update your usage of these properties.`)}return e.streaming&&`forceHTTP`in e.streaming&&(L(`streaming.forceHTTP configuration`,`Please Use networking.forceHTTP instead.`),e.networking=e.networking||{},e.networking.forceHTTP=e.streaming.forceHTTP,delete e.streaming.forceHTTP),e.streaming&&`forceHTTPS`in e.streaming&&(L(`streaming.forceHTTPS configuration`,`Please Use networking.forceHTTP instead.`),e.networking=e.networking||{},e.networking.forceHTTPS=e.streaming.forceHTTPS,delete e.streaming.forceHTTPS),e.streaming&&`minBytesForProgressEvents`in e.streaming&&(L(`streaming.minBytesForProgressEvents configuration`,`Please Use networking.minBytesForProgressEvents instead.`),e.networking=e.networking||{},e.networking.minBytesForProgressEvents=e.streaming.minBytesForProgressEvents,delete e.streaming.minBytesForProgressEvents),o=pf(this.g,e,Oh(this)),hh(this,n),o},r.wj=function(e){this.Yf=e};function hh(e,t){if(e.ye=new Go(e.g,e.ya,e.D),e.I){var n=fn(e.g.manifest);e.h&&e.h.nodeName===`AUDIO`&&(n.disableVideo=!0),e.I.configure(n)}if(e.D&&e.D.configure(e.g.drm),e.l){e.l.configure(e.g.streaming);try{e.m!=cg&&Jo(e.ye,e.i)&&Wh(e)}catch(t){$h(e,t)}e.o&&Rh(e),n=e.l.o,!n||n.allowedByApplication&&n.allowedByKeySystem||Bh(e)}if(e.N&&e.N.configure(e.g.networking),e.H&&(e.H.configure(e.g.mediaSource),e.H.Ha=e.g.manifest.segmentRelativeVttTiming),e.u&&qm(e),e.o&&(e.o.configure(e.g.abr),e.g.abr.enabled?e.o.enable():e.o.disable(),Xh(e)),e.R&&dh(e),e.Ka&&(e.g.streaming.rebufferingGoal?e.Ka.Fa(.25):e.Ka.stop()),e.i&&ig(e.i.presentationTimeline,e.g.playRangeStart,e.g.playRangeEnd),e.C&&e.C.configure(e.g.ads),e.K&&e.K.configure(e.g.cmcd),e.ua&&e.ua.configure(e.g.cmsd),e.Ca&&e.Ca.configure(e.g.queue),e.m==ug&&e.J.getConfiguration){n=e.J.getConfiguration();var r=!1;t.preferredVideoHdrLevel!=e.g.preferredVideoHdrLevel&&n.hdrLevel!=e.g.preferredVideoHdrLevel&&(n.hdrLevel=e.g.preferredVideoHdrLevel,r=!0),t.preferredVideoLayout!=e.g.preferredVideoLayout&&n.videoLayout!=e.g.preferredVideoLayout&&(n.videoLayout=e.g.preferredVideoLayout,r=!0),t.preferSpatialAudio!=e.g.preferSpatialAudio&&n.spatialAudio!=e.g.preferSpatialAudio&&(n.spatialAudio=e.g.preferSpatialAudio,r=!0),t.preferredVideoRole!=e.g.preferredVideoRole&&n.videoRole!=e.g.preferredVideoRole&&(n.videoRole=e.g.preferredVideoRole,r=!0),r&&(e.J.configure(n),Bh(e))}}r.getConfiguration=function(){var e=Oh(this);return pf(e,this.g,Oh(this)),e},r.Gj=function(){return this.Yf},r.gi=function(){return pf(Oh(this),this.g,Oh(this)),Wd(this.g,Oh(this))},r.bi=function(){if(this.h){var e=this.h.buffered.length;e=e?this.h.buffered.end(e-1):0;var t=Math.min(this.h.currentTime+this.g.streaming.bufferingGoal,this.Na().end);if(e>=t)return 1;if(!(e<=this.h.currentTime)&&e<t)return(e-this.h.currentTime)/(t-this.h.currentTime)}return 0},r.Ki=function(){var e=this.getConfiguration(),t;for(t in this.g)delete this.g[t];pf(this.g,Oh(this),Oh(this)),hh(this,e)},r.Vd=function(){return this.m},r.di=function(){return this.i?this.i.type:null},r.Xe=function(){return this.h},r.Sb=function(){return this.N},r.kd=function(){return this.W},r.ai=function(){return this.C?this.C:null},r.ji=function(){return this.Ca?this.Ca:null},r.T=function(){return this.i&&!this.xa()?this.i.presentationTimeline.T():this.h&&(this.h.src||this.xa())?this.h.duration==1/0:!1},r.Pc=function(){return this.i?this.i.presentationTimeline.Pc():!1},r.jk=function(){if(this.i&&!this.xa()){var e=this.i.variants;return e.length?!e[0].video:!1}return this.h&&(this.h.src||this.xa())?this.h.videoTracks?this.h.videoTracks.length==0:this.h.videoHeight==0:!1},r.pi=function(){if(this.i&&!this.xa()){var e=this.i.variants;return e.length?(e=e[0],e.audio||!e.video?!1:!e.video.codecs.includes(`,`)):!1}return this.h&&(this.h.src||this.xa())&&this.h.audioTracks?this.h.audioTracks.length==0:!1},r.Na=function(){if(this.i&&!this.xa()){if(!this.Ua&&this.i.type==`HLS`)return{start:0,end:0};var e=this.i.presentationTimeline;return{start:e.Ub(),end:e.Eb()}}if(this.h&&(this.h.src||this.xa())&&(e=this.h.seekable)&&e.length){var t=this.g?this.g.playRangeStart:0;t=Math.max(e.start(0),t);var n=this.g?this.g.playRangeEnd:1/0;return e=Math.min(e.end(e.length-1),n),{start:t,end:e}}return{start:0,end:0}},r.gk=function(){this.T()&&(this.h.currentTime=this.Na().end)},r.kk=function(){return this.Ua},r.keySystem=function(){var e=this.drmInfo();return e?e.keySystem:``},r.drmInfo=function(){return this.D?this.D.g:null},r.Ud=function(){return this.D?this.D.Ud():1/0},r.Fg=function(){return this.D?this.D.Fg():[]},r.We=function(){return this.D?this.D.We():{}},r.Ng=function(){return this.R?this.R.g==Uo:!!this.W},r.Db=function(){return this.h?this.M?this.M.h:1:0},r.Hh=function(e){this.m==ug&&this.l&&nd(this.l,e)},r.qe=function(e,t){if(t=t===void 0||t,e==0)F(`A trick play rate of 0 is unsupported!`);else{var n=this.h.playbackRate,r=this.M.h;this.M.set(e),this.m==ug&&(this.o.playbackRateChanged(e),this.Hh(t&&e!=1)),Nh(this,e),n===0&&this.h.playbackRate===0&&e!=r&&Mh(this)}},r.Nd=function(){var e=this.M.ld();this.m==dg&&this.M.set(e),this.m==ug&&(this.M.set(e),this.o.playbackRateChanged(e),this.Hh(!1)),this.$b.Sa()},r.kc=function(){if(this.i&&!this.xa()){for(var e=this.l?this.l.o:null,t=[],n=0,r=g(this.i.variants),i=r.next();!i.done;i=r.next())if(i=i.value,zi(i)){var a=Ni(i);a.active=i==e,a.active||n==1||e==null||i.video!=e.video||i.audio!=e.audio||(a.active=!0),a.active&&n++,t.push(a)}return t}if(this.h&&this.h.audioTracks){var o=Uh(this);return e=Array.from(this.h.audioTracks),e.length?e.map(function(e){return Ri(e,o)}):o?[Ri(null,o)]:[]}return[]},r.Gc=function(){if(this.i){if(this.xa())return[];for(var e=this.l?this.l.B:null,t=[],n=g(this.i.textStreams),r=n.next();!r.done;r=n.next()){r=r.value;var i=Pi(r);i.active=r==e,t.push(i)}return t}return this.h&&this.h.src&&this.h.textTracks?bh(this).map(function(e){return Li(e)}):[]},r.Lj=function(){var e=this.Ee;return this.i&&(e=this.i.imageStreams),e.map(function(e){return Fi(e)})},r.zj=function(e){var t=this,n,r;return k(function(i){return i.h==1?i.g(_h(t,e),2):(n=i.i,n?(r=[],n.segmentIndex.qb(function(e){var t=gh(e.tilesLayout||n.tilesLayout);if(t)for(var i=t.rows*t.columns,a=(e.j-e.startTime)/i,o=0;o<i;o++){var s=vh(e,n,e.startTime+o*a,t);if(!s)break;r.push(s)}}),i.return(r)):i.return(null))})};function gh(e){return e&&(e=/(\d+)x(\d+)/.exec(e))?{columns:parseInt(e[1],10),rows:parseInt(e[2],10)}:null}r.$j=function(e,t){var n=this,r,i,a,o;return k(function(s){return s.h==1?s.g(_h(n,e),2):(r=s.i,!r||(i=r.segmentIndex.find(t),i==null)?s.return(null):(a=r.segmentIndex.get(i),(o=gh(a.tilesLayout||r.tilesLayout))?s.return(vh(a,r,t,o)):s.return(null)))})};function _h(e,t){var n,r,i;return k(function(a){return a.h==1?e.m!=ug&&e.m!=dg||(n=e.Ee,e.i&&(n=e.i.imageStreams),r=n[0],!r)?a.return(null):(t!=null&&(r=n.find(function(e){return e.id==t})),r?r.segmentIndex?a.A(2):a.g(r.createSegmentIndex(),2):a.return(null)):(r.closeSegmentIndex&&(e.uc.has(r)||(i=new Qr(function(){r&&(r.closeSegmentIndex(),e.uc.delete(r))}),e.uc.set(r,i)),e.uc.get(r).na(5)),a.return(r))})}function vh(e,t,n,r){var i=t.width||0,a=t.height||0,o=i/r.columns,s=a/r.rows,c=r.columns*r.rows,l=e.j-e.startTime;l=e.B||l/c;var u=e.startTime,d=0,f=0;return c>1&&(f=Math.floor((n-e.startTime)/l+1e-4),u=e.startTime+f*l,d=f%r.columns*o,f=Math.floor(f/r.columns)*s),u>=e.endTime||yc(u,e.endTime,1e-4)?null:(r=!1,(n=e.thumbnailSprite)&&(r=!0,s=n.height,d=n.positionX,f=n.positionY,o=n.width),{segment:e,imageHeight:a,imageWidth:i,height:s,positionX:d,positionY:f,startTime:u,duration:l,uris:e.P(),startByte:e.Fc(),endByte:e.Dc(),width:o,sprite:r,mimeType:e.mimeType||t.mimeType,codecs:e.codecs||t.codecs})}r.oh=function(e){function t(){var t=n.i.textStreams.find(function(t){return t.id==e.id});t&&t!=n.l.B&&(xf(n.B.h,t,!1),id(n.l,t),Jh(n),Zh(n),n.Gd=t.language)}var n=this;this.i&&this.G&&(t(),!this.xa())||(function(){if(n.h&&n.h.textTracks){var t=bh(n),r=t.find(function(t){return Ii(t)===e.id});if(r){if(n.u instanceof fp){t=g(t);for(var i=t.next();!i.done;i=t.next()){i=i.value;var a=i===r?n.Z?`showing`:`hidden`:`disabled`;i.mode!==a&&(i.mode=a)}}else t=t.find(function(e){return e.mode!==`disabled`}),t!==r&&(t&&(t.mode=`disabled`,n.j.Oa(t,`cuechange`),n.u.remove(0,1/0)),r&&yh(n,r));Jh(n),Zh(n)}}})()};function yh(e,t){e.j.F(t,`cuechange`,function(){e.u.remove(0,Math.max(0,e.h.currentTime-e.g.streaming.bufferBehind));var n={periodStart:0,segmentStart:0,segmentEnd:e.h.duration,vttOffset:0},r=[],i=Array.from(t.activeCues||[]);i=g(i);for(var a=i.next();!a.done;a=i.next()){if(a=a.value,a.endTime===1/0||a.endTime<a.startTime)a=null;else{var o=new qn(a.startTime,a.endTime,a.text);o.line=typeof a.line==`number`?a.line:null,a.lineAlign&&(o.lineAlign=a.lineAlign),o.lineInterpretation=a.snapToLines?cr:1,o.position=typeof a.position==`number`?a.position:null,a.positionAlign&&(o.positionAlign=a.positionAlign),o.size=a.size,o.textAlign=a.align,a.vertical===`lr`?o.writingMode=`vertical-lr`:a.vertical===`rl`&&(o.writingMode=`vertical-rl`),a.region&&(o.region.id=a.region.id,o.region.height=a.region.lines,o.region.heightUnits=2,o.region.regionAnchorX=a.region.regionAnchorX,o.region.regionAnchorY=a.region.regionAnchorY,o.region.scroll=a.region.scroll,o.region.viewportAnchorX=a.region.viewportAnchorX,o.region.viewportAnchorY=a.region.viewportAnchorY,o.region.viewportAnchorUnits=tn,o.region.width=a.region.width,o.region.widthUnits=tn),Xn(o),a=o}a&&((o=e.g.mediaSource.modifyCueCallback)&&o(a,null,n),r.push(a))}e.u.append(r)}),t.mode=document.pictureInPictureElement?`showing`:`hidden`}r.Ff=function(e,t,n){function r(){var r=i.i.variants.find(function(t){return t.id==e.id});if(r&&zi(r)){var a=i.l.o;i.g.abr.enabled&&(a.video!=r.video||a.audio&&r.audio&&a.audio.language==r.audio.language&&a.audio.channelsCount==r.audio.channelsCount&&a.audio.label==r.audio.label)&&F(`Changing tracks while abr manager is enabled will likely result in the selected track being overridden. Consider disabling abr before calling selectVariantTrack().`),i.xa()?Vh(i,r,!1,!1,0):Vh(i,r,!1,t||!1,n||0),i.J.configure({language:r.language,role:r.audio&&r.audio.roles&&r.audio.roles[0]||``,videoRole:r.video&&r.video.roles&&r.video.roles[0]||``,channelCount:r.audio&&r.audio.channelsCount?r.audio.channelsCount:0,hdrLevel:r.video&&r.video.hdr?r.video.hdr:``,spatialAudio:r.audio&&r.audio.spatialAudio?r.audio.spatialAudio:!1,videoLayout:r.video&&r.video.videoLayout?r.video.videoLayout:``,audioLabel:r.audio&&r.audio.label?r.audio.label:``,videoLabel:r.video&&r.video.label?r.video.label:``,codecSwitchingStrategy:i.g.mediaSource.codecSwitchingStrategy,audioCodec:r.audio&&r.audio.codecs?r.audio.codecs:``,activeAudioCodec:a.audio&&a.audio.codecs?a.audio.codecs:``,activeAudioChannelCount:a.audio&&a.audio.channelsCount?a.audio.channelsCount:0,preferredAudioCodecs:i.g.preferredAudioCodecs,preferredAudioChannelCount:i.g.preferredAudioChannelCount}),Rh(i)}}var i=this;t=t!==void 0&&t,n=n===void 0?0:n,!(this.i&&this.G&&(r(),!this.xa()))&&(function(){if(e.originalAudioId&&i.h&&i.h.audioTracks){var t=Array.from(i.h.audioTracks);t=g(t);for(var n=t.next();!n.done;n=t.next())if(n=n.value,Ii(n)==e.id){Hh(i,n);break}}})()},r.Wk=function(e,t){function n(){var n=r.J.getConfiguration();n.audioCodec=e.codecs||``,n.audioLabel=e.label||``,n.channelCount=e.channelsCount||0,n.language=e.language,n.role=e.roles[0]||``,n.spatialAudio=e.spatialAudio;var i=r.l.o;(i=i&&i.audio)&&(n.activeAudioCodec=i.codecs||``,n.activeAudioChannelCount=i.channelsCount||0),r.J.configure(n),Bh(r,!0,t,!1,!1)}var r=this;t=t===void 0?0:t,!(this.i&&this.G&&(n(),!this.xa()))&&(function(){if(r.h&&r.h.audioTracks){var t=li(e.language),n=Array.from(r.h.audioTracks),i=null;n=g(n);for(var a=n.next();!a.done;a=n.next()){a=a.value;var o=a.language||`und`;if(a.label==e.label&&li(o)==t&&a.kind==e.roles[0]){i=a;break}}i&&Hh(r,i)}})()},r.getAudioTracks=function(){if(this.i&&!this.xa()){var e=this.kc();if(!e.length)return[];var t=e.find(function(e){return e.active});if(!t)return[];var n=e;if(this.m!=ug||this.xa()||(n=e.filter(function(e){return e.originalVideoId===t.originalVideoId&&(e.audioCodec||zr.includes(e.audioMimeType||``))})),!n.length)return[];e=/* @__PURE__ */ new Map,n=g(n);for(var r=n.next();!r.done;r=n.next()){var i=r.value;r=[i.language,i.originalLanguage,i.label||``,(i.audioRoles||[]).join(`,`),i.channelsCount,i.spatialAudio,i.audioCodec||``,i.accessibilityPurpose||``].join(`_`),i={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},e.has(r)?!e.get(r).active&&i.active&&e.set(r,i):e.set(r,i)}return Array.from(e.values())}return this.h&&this.h.audioTracks?Array.from(this.h.audioTracks).map(function(e){var t=e.language;return t={active:e.enabled,language:li(t||`und`),label:e.label,mimeType:null,codecs:null,primary:e.kind==`main`,roles:[],accessibilityPurpose:null,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,originalLanguage:t},e.kind&&(e.kind==`description`&&(t.accessibilityPurpose=`visually impaired`),t.roles.push(e.kind)),e.configuration&&(e.configuration.codec&&(t.codecs=e.configuration.codec),e.configuration.sampleRate&&(t.audioSamplingRate=e.configuration.sampleRate),e.configuration.numberOfChannels&&(t.channelsCount=e.configuration.numberOfChannels)),t}):[]},r.Yk=function(e,t,n){t=t!==void 0&&t,n=n===void 0?0:n;var r=this.kc();if(r.length){var i=r.find(function(e){return e.active});if(i){r=r.filter(function(t){return(t.videoBandwidth||t.bandwidth)==e.bandwidth&&t.width==e.width&&t.height==e.height&&t.frameRate==e.frameRate&&t.pixelAspectRatio==e.pixelAspectRatio&&t.hdr==e.hdr&&t.colorGamut==e.colorGamut&&t.videoLayout==e.videoLayout&&t.videoMimeType==e.mimeType&&t.videoCodec==e.codecs&&_e(t.videoRoles,e.roles)&&t.videoLabel==e.label});var a=r.length==1?r[0]:r.find(function(e){return e.audioId===i.audioId});a||(a=r.find(function(e){return e.language==i.language&&e.label===i.label&&e.channelsCount===i.channelsCount&&e.spatialAudio===i.spatialAudio&&e.audioMimeType===i.audioMimeType&&Nr(e.audioCodec||``)===Nr(i.audioCodec||``)&&_e(e.audioRoles,i.audioRoles)})),a&&!a.active&&this.Ff(a,t,n)}}},r.getVideoTracks=function(){if(this.m==dg||this.xa())return[];var e=this.kc();if(!e.length)return[];var t=e.find(function(e){return e.active});if(!t)return[];var n=e;if(this.pi()||(n=e.filter(function(e){return e.videoCodec&&e.audioGroupId===t.audioGroupId&&e.originalAudioId===t.originalAudioId?e.audioId===t.audioId||e.language===t.language&&e.label===t.label&&e.channelsCount===t.channelsCount&&e.spatialAudio===t.spatialAudio&&e.audioMimeType===t.audioMimeType&&Nr(e.audioCodec||``)===Nr(t.audioCodec||``)&&_e(e.audioRoles,t.audioRoles):!1})),!n.length)return[];e=/* @__PURE__ */ new Map,n=g(n);for(var r=n.next();!r.done;r=n.next()){r=r.value;var i=r.originalVideoId;i||r.videoId==null||(i=String(r.videoId)),i&&e.set(i,{active:r.active,bandwidth:r.videoBandwidth||r.bandwidth,width:r.width,height:r.height,frameRate:r.frameRate,pixelAspectRatio:r.pixelAspectRatio,hdr:r.hdr,colorGamut:r.colorGamut,videoLayout:r.videoLayout,mimeType:r.videoMimeType,codecs:r.videoCodec,roles:r.videoRoles||[],label:r.videoLabel})}return Array.from(e.values())},r.Bj=function(){return sg(this.kc())},r.Yj=function(){return sg(this.Gc())},r.Aj=function(){return Array.from(og(this.kc()))},r.Xj=function(){return Array.from(og(this.Gc()))},r.Pi=function(e,t,n,r,i,a,o){function s(){function s(e,t){return e.video||t.video?e.video&&t.video?Math.abs((e.video.height||0)-(t.video.height||0))+Math.abs((e.video.width||0)-(t.video.width||0)):1/0:0}var l=c.l.o;c.J=c.g.adaptationSetCriteriaFactory(),c.J.configure({language:e,role:t||``,videoRole:l.video&&l.video.roles&&l.video.roles[0]||``,channelCount:n||0,hdrLevel:``,spatialAudio:a||!1,videoLayout:``,audioLabel:o||``,videoLabel:``,codecSwitchingStrategy:c.g.mediaSource.codecSwitchingStrategy,audioCodec:i||``,activeAudioCodec:l.audio&&l.audio.codecs?l.audio.codecs:``,activeAudioChannelCount:l.audio&&l.audio.channelsCount?l.audio.channelsCount:0,preferredAudioCodecs:c.g.preferredAudioCodecs,preferredAudioChannelCount:c.g.preferredAudioChannelCount});var u=c.J.create(c.i.variants),d=null;u=g(u.values());for(var f=u.next();!f.done;f=u.next())f=f.value,zi(f)&&(!d||s(d,l)>s(f,l))&&(d=f);d!=l&&(d?(l=Ni(d),c.Ff(l,!0,r||0)):Bh(c))}var c=this;n=n===void 0?0:n,r=r===void 0?0:r,i=i===void 0?``:i,a=a!==void 0&&a,o=o===void 0?``:o,!(this.i&&this.G&&(s(),!this.xa()))&&(function(){if(c.h&&c.h.audioTracks){var n=Vi(c.kc(),e,t||``,!1)[0];n&&c.Ff(n)}})()},r.nh=function(e,t,n){function r(){i.Gd=e,i.Kd=t||``,i.Jd=n||!1;var r=Vi(i.i.textStreams,i.Gd,i.Kd,i.Jd)[0]||null;r&&r!=i.l.B&&(xf(i.B.h,r,!1),i.g.streaming.alwaysStreamText||i.Qg())&&(id(i.l,r),Jh(i),Zh(i))}var i=this;n=n!==void 0&&n,!(this.i&&this.G&&(r(),!this.xa()))&&(function(){var r=Vi(i.Gc(),e,t||``,n||!1)[0];r&&i.oh(r)})()},r.Xk=function(e,t,n){function r(){for(var r=null,a=g(i.i.variants),o=a.next();!o.done;o=a.next())if(o=o.value,o.audio.label==e){r=o;break}r!=null&&(i.J=i.g.adaptationSetCriteriaFactory(),i.J.configure({language:r.language,role:``,videoRole:``,channelCount:0,hdrLevel:``,spatialAudio:!1,videoLayout:``,videoLabel:``,audioLabel:e,codecSwitchingStrategy:i.g.mediaSource.codecSwitchingStrategy,audioCodec:``,activeAudioCodec:``,activeAudioChannelCount:0,preferredAudioCodecs:i.g.preferredAudioCodecs,preferredAudioChannelCount:i.g.preferredAudioChannelCount}),Bh(i,t,n))}var i=this;t=t===void 0||t,n=n===void 0?0:n,!(this.i&&this.G&&(r(),!this.xa()))&&(function(){if(i.h&&i.h.audioTracks){var t=Array.from(i.h.audioTracks),n=null;t=g(t);for(var r=t.next();!r.done;r=t.next())r=r.value,r.label==e&&(n=r);n&&Hh(i,n)}})()},r.Qg=function(){var e=this.Z;return this.u?this.u.isTextVisible():e},r.Fj=function(){return this.ib.map(function(e){return Pi(e)})},r.Dj=function(e){if(L(`getChapters`,`Please use an getChaptersAsync.`),!this.ib.length)return[];var t=li(e);if(e=this.ib.filter(function(e){return li(e.language)==t}),!e.length)return[];var n=[],r=/* @__PURE__ */ new Set;e=g(e);for(var i=e.next();!i.done;i=e.next())i=i.value,i.segmentIndex&&i.segmentIndex.qb(function(e){var t=e.P()[0],i=e.startTime+`-`+e.endTime+`-`+t;e={id:i,title:t,startTime:e.startTime,endTime:e.endTime},r.has(i)||(n.push(e),r.add(i))});return n},r.Ej=function(e){var t=this,n,r,i,a,o,s,c;return k(function(l){switch(l.h){case 1:if(!t.ib.length||(n=li(e),r=t.ib.filter(function(e){return li(e.language)==n}),!r.length))return l.return([]);i=[],a=/* @__PURE__ */ new Set,o=g(r),s=o.next();case 2:if(s.done){l.A(4);break}if(c=s.value,c.segmentIndex){l.A(5);break}return l.g(c.createSegmentIndex(),5);case 5:c.segmentIndex.qb(function(e){var t=e.P()[0],n=e.startTime+`-`+e.endTime+`-`+t;e={id:n,title:t,startTime:e.startTime,endTime:e.endTime},a.has(n)||(i.push(e),a.add(n))}),s=o.next(),l.A(2);break;case 4:return l.return(i)}})};function bh(e){return Array.from(e.h.textTracks).filter(function(e){return e.kind!=`metadata`&&e.kind!=`chapters`&&e.label!=`Shaka Player TextTrack`})}function xh(e){return Array.from(e.h.textTracks).find(function(e){return e.label==`Shaka Player TextTrack`})}function Sh(e){return Array.from(e.h.textTracks).filter(function(e){return e.kind==`metadata`})}r.sh=function(e){e=!!e,this.Z!=e&&(this.Z=e,this.m==ug?(this.u.setTextVisibility(e),this.g.streaming.alwaysStreamText||(e?this.l.B||(e=Vi(this.i.textStreams,this.Gd,this.Kd,this.Jd),e.length>0&&(id(this.l,e[0]),Jh(this),Zh(this))):td(this.l))):this.h&&this.h.src&&this.h.textTracks&&this.u.setTextVisibility(e),Yh(this))},r.Rj=function(){if(this.G)var e=this.G.Ld();else{if(this.O==null)return/* @__PURE__ */ new Date;if(this.O instanceof Date)return this.O;e=this.O}if(this.i&&!this.xa()){var t=this.i.presentationTimeline;return/* @__PURE__ */ new Date(((t.m||t.i)+e)*1e3)}return this.h&&this.h.getStartDate?(t=this.h.getStartDate(),t instanceof Date&&!isNaN(t.getTime())?new Date(t.getTime()+e*1e3):null):null},r.ii=function(){if(this.i&&!this.xa()){var e=this.i.presentationTimeline;return e=e.m||e.i,e===null?null:/* @__PURE__ */ new Date(e*1e3)}return this.h&&this.h.getStartDate?(e=this.h.getStartDate(),e instanceof Date&&!isNaN(e.getTime())?e:null):null},r.Ye=function(){return this.T()&&this.i?this.i.presentationTimeline.Ye():null},r.Cc=function(){if(this.m==ug)return this.H.Cc();var e={total:[],audio:[],video:[],text:[]};return this.m==dg&&(e.total=rc(this.h.buffered)),e};function Ch(e){if(!e.h||!e.h.currentTime)return null;var t=e.ii();return t?Math.floor(Date.now()-(t.getTime()+e.h.currentTime*1e3)):null}r.getBandwidthEstimate=function(){return this.o?this.o.getBandwidthEstimate():NaN},r.getStats=function(){if(this.m!=ug&&this.m!=dg)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:[]};Ph(this);var e=this.h,t=e.currentTime/e.duration;if(isNaN(t)||this.T()||Tf(this.B,Math.round(100*t)),this.G&&(this.B.S=this.G.Ih(),this.B.U=this.G.Kh()),e.getVideoPlaybackQuality&&(t=e.getVideoPlaybackQuality(),Cf(this.B,Number(t.droppedVideoFrames),Number(t.totalVideoFrames)),this.B.N=Number(t.corruptedVideoFrames)),Ef(this.B,this.D?mo(this.D):NaN),wf(this.B,e.videoWidth||NaN,e.videoHeight||NaN),this.B.l=``,this.T()&&(e=Ch(this),e!=null&&Df(this.B,e/1e3)),t=this.kc().find(function(e){return e.active}),e=this.Gc().find(function(e){return e.active}),t){if(t.bandwidth){var n=this.M?this.M.h:1,r=n*t.bandwidth;e&&e.bandwidth&&(r+=n*e.bandwidth),this.B.B=r}t.width&&t.height&&wf(this.B,t.width||NaN,t.height||NaN),t=t.codecs,e&&(t+=`,`+(e.codecs||e.mimeType)),t&&(this.B.l=t)}return this.m!=ug||this.xa()||(this.i&&(this.B.I=this.i.periodCount,this.B.H=this.i.gapCount,this.i.presentationTimeline&&Of(this.B,this.i.presentationTimeline.h)),e=this.o.getBandwidthEstimate(),this.B.u=e),this.m==dg&&kf(this.B,NaN),Af(this.B)},r.Md=function(e,t,n,r,i,a,o){o=o!==void 0&&o;var s=this,c,l,u,d,f,p,m,h,g,_,v,y;return k(function(b){switch(b.h){case 1:if(s.m!=ug&&s.m!=dg)throw new R(1,7,7004);if(n!=`subtitles`&&n!=`captions`&&F("Using a kind value different of `subtitles` or `captions` can cause unwanted issues."),r){b.A(2);break}return b.g(wh(s,e),3);case 3:r=b.i;case 2:if(c=[],s.C&&(c=s.C.getCuePoints()),s.m!=dg){b.A(4);break}return l=we(),o&&l.Ia()===`WEBKIT`&&(n=`forced`),b.g(Th(s,e,t,n,r,a||``,c),5);case 5:if(u=b.i,u.track)return Wh(s),Jh(s),b.return(Li(u.track));throw new R(1,2,2012);case 4:if(d=Pt,f=s.Na(),p=f.end-f.start,s.i&&(p=s.i.presentationTimeline.getDuration()),p==1/0)throw new R(1,4,4033);if(!c.length){b.A(6);break}return b.g(Eh(s,e),7);case 7:m=b.i,h=Dh(s,m,r,c),g=new Blob([h],{type:`text/vtt`}),e=Pl(g),r=`text/vtt`;case 6:if(_={id:s.ze++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:du(0,p,[e]),mimeType:r||``,codecs:i||``,kind:n,encrypted:!1,drmInfos:[],keyIds:/* @__PURE__ */ new Set,language:t,originalLanguage:t,label:a||null,type:d.Pa,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!!o,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:/* @__PURE__ */ new Set([kr(r||``,i||``)]),isAudioMuxedInVideo:!1,baseOriginalId:null},v=kr(_.mimeType,_.codecs),y=Ur(v),!y)throw new R(2,2,2014,r);return s.i.textStreams.push(_),Wh(s),Jh(s),b.return(Pi(_))}})},r.Je=function(e,t){var n=this,r,i,a,o,s,c,l,u,d,f,p,m,h,_,v,y,b,x;return k(function(S){switch(S.h){case 1:if(n.m!=ug&&n.m!=dg)throw new R(1,7,7004);if(t){S.A(2);break}return S.g(wh(n,e),3);case 3:t=S.i;case 2:if(t!=`text/vtt`)throw new R(1,2,2017,e);if(r=Pt,i=n.Na(),a=i.end-i.start,n.i&&(a=n.i.presentationTimeline.getDuration()),a==1/0)throw new R(1,4,4045);return S.g(Eh(n,e),4);case 4:if(o=S.i,s=Hr(t),!s)throw new R(2,2,2014,t);for(c=s(),l={periodStart:0,segmentStart:0,segmentEnd:a,vttOffset:0},u=Ze(o),d=c.parseMedia(u,l,e,[]),f=[],p=g(d),m=p.next(),h={};!m.done;h={Sf:void 0,fd:void 0},m=p.next())h.fd=m.value,h.Sf=null,_=function(t){return function(){return t.Sf??(t.Sf=Dt([e],[t.fd.payload])),t.Sf||[]}}(h),v=new H(h.fd.startTime,h.fd.endTime,_,0,null,null,0,0,1/0),h.fd.payload.includes(`#xywh`)&&(y=h.fd.payload.split(`#xywh=`)[1].split(`,`),y.length===4&&v.If({height:parseInt(y[3],10),positionX:parseInt(y[0],10),positionY:parseInt(y[1],10),width:parseInt(y[2],10)})),f.push(v);if(b=t,!f.length){S.A(5);break}return S.g(wh(n,f[0].P()[0]),6);case 6:b=S.i;case 5:return x={id:n.ze++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new uu(f),mimeType:b||``,codecs:``,kind:``,encrypted:!1,drmInfos:[],keyIds:/* @__PURE__ */ new Set,language:`und`,originalLanguage:null,label:null,type:r.Uf,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,tilesLayout:`1x1`,accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:/* @__PURE__ */ new Set([kr(b||``,``)]),isAudioMuxedInVideo:!1,baseOriginalId:null},n.m==dg?n.Ee.push(x):n.i.imageStreams.push(x),Wh(n),S.return(Fi(x))}})},r.Ie=function(e,t,n){var r=this,i,a,o,s,c,l,u,d,f,p,m,h,_,v,y;return k(function(b){switch(b.h){case 1:if(r.m!=ug&&r.m!=dg)throw new R(1,7,7004);if(n){b.A(2);break}return b.g(wh(r,e),3);case 3:n=b.i;case 2:if(i=Pt,a=r.Na(),o=a.end-a.start,r.i&&(o=r.i.presentationTimeline.getDuration()),o==1/0)throw new R(1,4,4055);if(s=Hr(n),!s)throw new R(2,2,2014,n);return b.g(Eh(r,e),4);case 4:for(c=b.i,l=s(),u={periodStart:0,segmentStart:0,segmentEnd:o,vttOffset:0},d=Ze(c),f=l.parseMedia(d,u,e,[]),p=[],m=g(f),h=m.next(),_={};!h.done;_={Re:void 0},h=m.next())_.Re=h.value,v=new H(_.Re.startTime,_.Re.endTime,function(e){return function(){return[e.Re.payload]}}(_),0,null,null,0,0,1/0),p.push(v);return y={id:r.ze++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new uu(p),mimeType:`text/plain`,codecs:``,kind:``,encrypted:!1,drmInfos:[],keyIds:/* @__PURE__ */ new Set,language:t,originalLanguage:t,label:null,type:i.Pa,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:/* @__PURE__ */ new Set([kr(`text/plain`,``)]),isAudioMuxedInVideo:!1,baseOriginalId:null},r.ib.push(y),Wh(r),b.return(Pi(y))}})};function wh(e,t){var n;return k(function(r){switch(r.h){case 1:return r.m(2),r.g(qu(t,e.N,e.g.streaming.retryParameters),4);case 4:n=r.i,r.o(3);break;case 2:r.l();case 3:if(n)return r.return(n);throw new R(1,2,2011,t)}})}function Th(e,t,n,r,i,a,o){var s,c,l,u;return k(function(d){if(d.h==1)return i!=`text/vtt`||o.length?d.g(Eh(e,t),3):d.A(2);d.h!=2&&(s=d.i,c=Dh(e,s,i,o),l=new Blob([c],{type:`text/vtt`}),t=Pl(l),i=`text/vtt`),u=document.createElement(`track`);a:{var f=e.K,p=t;try{if(!f.g.enabled){var m=p;break a}var h=Lp(f);h.ot=am,h.su=!0,m=$p(p,Zp(h));break a}catch(e){le(`CMCD_TEXT_TRACK_ERROR`,`Could not generate text track CMCD data.`,e),m=p;break a}}return u.src=m,u.label=a,u.kind=r,u.srclang=n,e.h.getAttribute(`crossorigin`)||e.h.setAttribute(`crossorigin`,`anonymous`),e.h.appendChild(u),e.Xf.push(u),d.return(u)})}function Eh(e,t){var n,r,i,a;return k(function(o){if(o.h==1){n=ka,r=e.g.streaming.retryParameters,i=Sa([t],r),i.method=`GET`;var s=e.K;try{s.g.enabled&&zp(s,i,{ot:am,su:!0})}catch(e){le(`CMCD_TEXT_ERROR`,`Could not generate text CMCD data.`,e)}return o.g(e.N.request(n,i).promise,2)}return a=o.i,o.return(a.data)})}function Dh(e,t,n,r){var i=Hr(n);if(i)return n=i(),e={periodStart:0,segmentStart:0,segmentEnd:e.h.duration,vttOffset:0},t=Ze(t),t=n.parseMedia(t,e,null,[]),Ep(t,r);throw new R(2,2,2014,n)}r.fl=function(e,t){this.ya.width=e,this.ya.height=t},r.jh=function(e){if(this.m==ug){var t=this.l;if(e=e===void 0?.1:e,t.l.g)t=!1;else if(t.D)t=!1;else{for(var n=g(t.h.values()),r=n.next();!r.done;r=n.next())r=r.value,!r.pd||r.Ja||r.kb||(r.pd=!1,Od(t,r,e));t=!0}}else t=!1;return t},r.Gg=function(){return F(`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.`),this.i},r.Oj=function(){return this.vc},r.Jj=function(){var e={video:null,audio:null,text:null};if(this.m!=ug)return e;var t=this.l.o,n=this.h.currentTime;t=g([t.video,t.audio,this.l.B]);for(var r=t.next();!r.done;r=t.next())if((r=r.value)&&r.segmentIndex){var i=r.segmentIndex.find(n);i=r.segmentIndex.get(i),i={codecs:i.codecs||r.codecs,mimeType:i.mimeType||r.mimeType,bandwidth:i.bandwidth||r.bandwidth},r.type==`video`?(i.width=r.width,i.height=r.height,e.video=i):r.type==`audio`?e.audio=i:r.type==Nt&&(e.text=i)}return e};function Oh(e){var t=df();return t.streaming.failureCallback=function(t){if(e.T()){var n=null;t.code==1001||t.code==1002?(n=1,e.g.streaming.lowLatencyMode&&(n=.1)):t.code==1003&&(n=.1),n!=null&&(t.severity=1,e.jh(n))}},t.textDisplayFactory=function(){if(e.ve){var t=e.h;t=!(t.webkitDisplayingFullscreen||t.webkitPresentationMode&&t.webkitPresentationMode!=`inline`)}else t=!1;return t?new gp(e.h,e.ve):`track`in document.createElement(`track`)?new fp(e):new hp},t}r.Wi=function(e){this.ve=e};function kh(e,t){for(var n=/* @__PURE__ */ new Set,r=g(t.textStreams),i=r.next();!i.done;i=r.next())i=i.value,i.mimeType!=`application/cea-608`&&i.mimeType!=`application/cea-708`||n.add(i.originalId);for(r=g(t.variants),i=r.next();!i.done;i=r.next())if((i=i.value.video)&&i.closedCaptions){for(var a=g(i.closedCaptions.keys()),o=a.next();!o.done;o=a.next())if(o=o.value,!n.has(o)){var s=o.startsWith(`CC`)?`application/cea-608`:`application/cea-708`,c=new pu,l=i.closedCaptions.get(o);s={id:e.ze++,originalId:o,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:c,mimeType:s,codecs:``,kind:`caption`,encrypted:!1,drmInfos:[],keyIds:/* @__PURE__ */ new Set,language:l,originalLanguage:l,label:null,type:Nt,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:i.roles,forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!1,fastSwitching:!1,fullMimeTypes:/* @__PURE__ */ new Set([kr(s,``)]),isAudioMuxedInVideo:!1,baseOriginalId:null},t.textStreams.push(s),n.add(o)}}}function Ah(e,t){var n,r,i,a,o;return k(function(s){return s.h==1?(n=e.audio,r=e.video,i=function(e,t){var n,r,i;return k(function(a){return a.h==1?e?e.segmentIndex?a.A(2):a.g(e.createSegmentIndex(),2):a.return(null):(r=(n=e.segmentIndex.Rb(t))?n.next().value:null,r?(i=r.startTime,a.return(i)):a.return(null))})},s.g(i(n,t),2)):s.h==3?(o=s.i,o!=null&&a!=null?s.return(Math.max(o,a)):o==null?a==null?s.return(t):s.return(a):s.return(o)):(a=s.i,s.g(i(r,t),3))})}function jh(e){var t=e.Ng();if(e.B&&e.R&&e.G){if(e.g.streaming.rebufferingGoal==0){var n=e.M;n.j=!1,_u(n)}else n=e.M,n.j=t,_u(n);if(e.K&&(n=e.K,t||n.D||(n.D=!0),n.D&&t&&(n.I=!0,Rp(n,`ps`,{Wc:`r`})),n.J=t),Ph(e),n=e.g.streaming.liveSync.dynamicTargetLatency.maxAttempts,e.g.streaming.liveSync.dynamicTargetLatency.enabled&&t&&e.He<n){n=e.g.streaming.liveSync.dynamicTargetLatency.maxLatency;var r=e.g.streaming.liveSync.targetLatencyTolerance,i=e.g.streaming.liveSync.dynamicTargetLatency.rebufferIncrement;e.U&&(e.U=Math.min(e.U+ ++e.He*i,n-r))}}t=(/* @__PURE__ */ new Map()).set(`buffering`,t),e.dispatchEvent(Lm(`buffering`,t))}function Mh(e){var t=e.h.playbackRate;t==0?(t=e.Db(),t!==0&&t!==1&&(t=Lm(`ratechange`),e.dispatchEvent(t))):(e.M&&(e.M.set(t),e.m==ug&&e.o.playbackRateChanged(t),Nh(e,t)),t=Lm(`ratechange`),e.dispatchEvent(t))}function Nh(e,t){e.$b.Sa(),e.$b.F(e.h,`timeupdate`,function(){var n=e.h.currentTime,r=e.Na(),i=e.T(),a=i?e.g.streaming.safeSeekOffset:0;t>0?i&&t>1&&Math.floor(n)>=Math.floor(r.end)&&e.Nd():Math.floor(n)<=Math.floor(r.start+a)&&e.Nd()})}function Ph(e){if(e.B&&e.R){var t=e.B.g,n=`playing`;e.R.g==Uo?n=`buffering`:e.$d()?n=`ended`:e.h.paused&&(n=`paused`);var r=n;if(t.g==null)t.g={timestamp:Date.now()/1e3,state:r,duration:0},t=!0;else{var i=Date.now()/1e3;t.g.duration=i-t.g.timestamp,t.g.state==r?t=!1:(t.h.push(t.g),t.g={timestamp:i,state:r,duration:0},t=!0)}t&&(n=(/* @__PURE__ */ new Map()).set(`newstate`,n),e.dispatchEvent(Lm(`statechanged`,n)))}}function Fh(e){var t=e.h.playbackRate,n=e.T();if(e.g.streaming.vodDynamicPlaybackRate&&!n){var r=e.g.streaming.vodDynamicPlaybackRateLowBufferRate,i=e.bi();i<=e.g.streaming.vodDynamicPlaybackRateBufferRatio?t!=r&&e.qe(r,!1):i==1&&t!==e.M.ld()&&e.Nd()}if(n&&(n=e.Na(),Number.isFinite(n.end)&&!(e.h.currentTime<n.start||e.h.paused))){r=e.g.streaming.liveSync.targetLatencyTolerance,i=e.g.streaming.liveSync.dynamicTargetLatency.enabled;var a=e.g.streaming.liveSync.dynamicTargetLatency.stabilityThreshold;if(e.g.streaming.liveSync&&e.g.streaming.liveSync.enabled)var o=e.g.streaming.liveSync.targetLatency,s=o+r,c=Math.max(0,o-r),l=e.g.streaming.liveSync.maxPlaybackRate,u=e.g.streaming.liveSync.minPlaybackRate;else e.i&&e.i.serviceDescription&&(o=e.i.serviceDescription.targetLatency,e.i.serviceDescription.targetLatency==null?e.i.serviceDescription.maxLatency!=null&&(s=e.i.serviceDescription.maxLatency):s=e.i.serviceDescription.targetLatency+r,e.i.serviceDescription.targetLatency==null?e.i.serviceDescription.minLatency!=null&&(c=e.i.serviceDescription.minLatency):c=Math.max(0,e.i.serviceDescription.targetLatency-r),l=e.i.serviceDescription.maxPlaybackRate||e.g.streaming.liveSync.maxPlaybackRate,u=e.i.serviceDescription.minPlaybackRate||e.g.streaming.liveSync.minPlaybackRate);e.U||typeof o!=`number`||(e.U=o);var d=e.g.streaming.liveSync.dynamicTargetLatency.maxAttempts;i&&e.Zb&&e.U!==null&&typeof o==`number`&&e.He<d&&Date.now()-e.Zb>a*1e3&&(a=e.g.streaming.liveSync.dynamicTargetLatency.minLatency,e.U=Math.max(e.U-(o-a)/2,a+r),e.Zb=Date.now()),i&&e.U!==null&&(s=e.U+r,c=e.U-r),o=n.end-e.h.currentTime,r=0,e.m==dg&&(i=e.h.buffered,i.length>0&&(r=i.end(i.length-1),r=Math.max(l,r-n.end))),n=e.g.streaming.liveSync.panicMode,i=e.g.streaming.liveSync.panicThreshold*1e3,a=Date.now()-e.R.i,n&&!u&&(u=e.g.streaming.liveSync.minPlaybackRate),n&&u&&a<=i?t!=u&&e.qe(u,!1):s!=null&&l&&o-r>s?(t!=l&&e.qe(l,!1),e.Zb=null):c!=null&&u&&o-r<c?(t!=u&&e.qe(u,!1),e.Zb=null):t!==e.M.ld()&&(e.Nd(),e.Zb=Date.now())}}function Ih(e,t,n){return(yc(t,n,.01)||n>t)&&e.Wf<t?(e.Wf=t,!0):!1}function Lh(e){if(e.h){var t=e.Na();if(t=t.end-t.start,t=t>0?e.h.currentTime/t:0,!isNaN(t)){if(t*=100,Ih(e,0,t))var n=Lm(`started`);else Ih(e,25,t)?n=Lm(`firstquartile`):Ih(e,50,t)?n=Lm(`midpoint`):Ih(e,75,t)?n=Lm(`thirdquartile`):((Ih(e,100,t)||t>100)&&(n=Lm(`complete`)),e.g&&e.g.playRangeEnd!=1/0&&e.$d()&&e.h.pause());n&&e.dispatchEvent(n)}}}function Rh(e){try{Xo(e.ye,e.i)}catch(t){return $h(e,t),!1}var t=Bi(e.i.variants);return t=e.J.create(t),e=e.o.setVariants(Array.from(t.values())),typeof e!=`boolean`||e}function zh(e,t){if(t=t!==void 0&&t,Rh(e)){if(!e.g.abr.enabled){var n=e.J;if(typeof n.getLastAdaptationSet!=`function`&&(L(`AdaptationSetCriteria w/o getLastAdaptationSet`,`Please use an AdaptationSetCriteria with getLastAdaptationSet.`),n.getLastAdaptationSet=function(){return null}),(n=n.getLastAdaptationSet())&&(n=Array.from(n.values()),n.length)){var r=e.l.o;if(r&&r.video&&(n=n.find(function(e){return e.video==r.video})))return n}}return e.o.chooseVariant(t)}return null}function Bh(e,t,n,r,i){t=t===void 0||t,n=n===void 0?0:n,r=r!==void 0&&r,i=i===void 0||i;var a=zh(e);a&&Vh(e,a,i,t,n,r)}function Vh(e,t,n,r,i,a){a=a!==void 0&&a;var o=e.l.o;if(t==o)r&&rd(e.l,t,r,i,!0);else{var s=e.B.h;if(s.h!=t&&(s.h=t,s.g.push({timestamp:Date.now()/1e3,id:t.id,type:`variant`,fromAdaptation:n,bandwidth:t.bandwidth})),rd(e.l,t,r,i,a,n),r=null,o&&(r=Ni(o)),o=Ni(t),o.active=!0,e.S&&(i=e.S,t=t.video)){switch(t.dependencyStream&&(t=t.dependencyStream),a=0,s=-1,t.mimeType){case`video/webm`:a=1;break;case`video/mp4`:a=2}switch(e.di()){case`DASH`:s=1;break;case`HLS`:s=0}i.g&&(i.g.setLevelSwitching(t.id,!0),i.g.setContainerFormat(a),i.j||i.g.setStreamingFormat(s))}n?(n=(/* @__PURE__ */ new Map()).set(`oldTrack`,r).set(`newTrack`,o),n=Lm(`adaptation`,n),ag(e,n)):Gh(e,r,o),Kh(e,r,o)}}function Hh(e,t){var n=Array.from(e.h.audioTracks).find(function(e){return e.enabled});if(t.enabled=!0,n){t.id!==n.id&&(n.enabled=!1);var r=Uh(e);n=Ri(n,r),t=Ri(t,r),Gh(e,n,t),Kh(e,n,t)}}function Uh(e){return e.h&&e.h.videoTracks?Array.from(e.h.videoTracks).find(function(e){return e.selected}):null}function Wh(e){ag(e,Lm(`trackschanged`)),qh(e)}function Gh(e,t,n){t=(/* @__PURE__ */ new Map()).set(`oldTrack`,t).set(`newTrack`,n),t=Lm(`variantchanged`,t),ag(e,t)}function Kh(e,t,n){var r=!1;t&&t.audioId==n.audioId&&t.audioGroupId==n.audioGroupId||(r=!0),r&&qh(e)}function qh(e){ag(e,Lm(`audiotrackschanged`))}function Jh(e){ag(e,Lm(`textchanged`))}function Yh(e){ag(e,Lm(`texttrackvisibility`))}function Xh(e){e.g.abr.enabled||Qh(e),ag(e,Lm(`abrstatuschanged`,(/* @__PURE__ */ new Map()).set(`newStatus`,e.g.abr.enabled)))}function Zh(e){var t=e.Gc().find(function(e){return e.active});t&&e.u&&e.u.setTextLanguage&&e.u.setTextLanguage(t.language)}function Qh(e,t){if(t=t===void 0||t,e.m==ug){e.Be.stop();for(var n=g(e.i.variants),r=n.next();!r.done;r=n.next())r.value.disabledUntilTime=0;t&&Rh(e)}}r.disableStream=function(e,t){if(!this.g.abr.enabled||this.m===cg||!navigator.onLine||t==0||!this.i)return!1;if(this.i.variants.some(function(t){var n=t[e.type];return n&&n.id!==e.id&&!t.disabledUntilTime?e.type!=`audio`||e.language===n.language:!1})){for(var n=!1,r=!1,i=g(this.i.variants),a=i.next();!a.done;a=i.next()){a=a.value;var o=a[e.type];o&&(o.id===e.id?(a.disabledUntilTime=Date.now()/1e3+t,n=!0):o.trickModeVideo&&o.trickModeVideo.id==e.id&&(r=!0))}return!n&&r?!1:(this.Be.Fa(1),t=this.Cc().video.reduce(function(e,t){return e+t.end-t.start},0),Bh(this,!1,t,!0,!1),!0)}return!1};function $h(e,t){var n,r,i,a,o;return k(function(s){switch(s.h){case 1:if(e.m==cg)return s.return();if(t.severity===1&&e.B.M++,n=!0,!(e.Ua&&e.i&&e.l)||t.code!=3016&&t.code!=3014&&t.code!=3015&&t.code!=3024&&t.code!=3018){s.A(2);break}return r=we(),r.Ia()===`WEBKIT`&&t.code==3016?s.return():(s.m(3),s.g(Nd(e.l),5));case 5:i=s.i,n=!i,i&&(a=Lm(`mediasourcerecovered`),e.dispatchEvent(a)),s.o(2);break;case 3:s.l(),n=!0;case 2:if(!n)return s.return();t.severity===2&&Qh(e,!1),o=Lm(`error`,(/* @__PURE__ */ new Map()).set(`detail`,t)),e.dispatchEvent(o),o.defaultPrevented&&(t.handled=!0),s.j()}})}r.addFont=function(e,t){return lc(e,t)};function eg(e,t,n,r){r=r===void 0?e:r,e=(/* @__PURE__ */ new Map()).set(`detail`,{schemeIdUri:n.schemeIdUri,value:n.value,startTime:n.startTime,endTime:n.endTime,id:n.id,timescale:n.timescale,eventElement:n.eventElement,eventNode:n.eventNode}),r.dispatchEvent(Lm(t,e))}function tg(e,t,n,r){r=r!==void 0&&r,t=(/* @__PURE__ */ new Map()).set(`mediaQuality`,{bandwidth:t.bandwidth,audioSamplingRate:t.audioSamplingRate,codecs:t.codecs,contentType:t.contentType,frameRate:t.frameRate,height:t.height,mimeType:t.mimeType,channelsCount:t.channelsCount,pixelAspectRatio:t.pixelAspectRatio,width:t.width,label:t.label,roles:t.roles,language:t.language}).set(`position`,n),e.dispatchEvent(Lm(r?`audiotrackchanged`:`mediaqualitychanged`,t))}function ng(e,t){if(t=t===void 0||t,!e.h.error)return t?new R(2,3,3016):null;var n=e.h.error.code;return!t&&n==1?null:((t=e.h.error.msExtendedCode)&&(t<0&&(t+=4294967296),t=t.toString(16)),new R(2,3,3016,n,t,e.h.error.message))}function rg(e,t){if(e.l){var n=Lm(`keystatuschanged`);e.dispatchEvent(n);var r=Object.keys(t);r.length==1&&r[0]==``&&(r=[`00`],t={"00":t[``]});var i=r.length==1&&r[0]==`00`;if(n=!1,r.length){r=e.keySystem();for(var a=Ia(e.g.drm.clearKeys),o=function(n,r){n.allowedByKeySystem=!0,r=g(r);for(var a=r.next();!a.done;a=r.next())a=a.value,((a=t[i?`00`:a])||e.D.H)&&(n.allowedByKeySystem=n.allowedByKeySystem&&!!a&&!Zo.includes(a))},s=g(e.i.variants),c=s.next();!c.done;c=s.next()){c=c.value;var l=Ui(c);l=g(l);for(var u=l.next();!u.done;u=l.next()){u=u.value;var d=c.allowedByKeySystem;if(u.keyIds.size){if(u.drmInfos.length&&!a.size&&e.i.type==`HLS`)for(var f=g(u.drmInfos),p=f.next();!p.done;p=f.next())p=p.value,p.keySystem==r&&(p.keyIds.size?o(c,p.keyIds):o(c,u.keyIds));else o(c,u.keyIds)}d!=c.allowedByKeySystem&&(n=!0)}}}n&&(Wh(e),(n=e.l.o)&&!n.allowedByKeySystem?Bh(e):Rh(e))}}function ig(e,t,n){t>0&&(e.T()||e.Vi(t)),t=e.getDuration(),n<t&&(e.T()||e.wb(n))}function ag(e,t){k(function(n){if(n.h==1)return n.g(Promise.resolve(),2);e.m!=cg&&e.dispatchEvent(t),n.j()})}function og(e){var t=/* @__PURE__ */ new Set;e=g(e);for(var n=e.next();!n.done;n=e.next())n=n.value,n.language?t.add(li(n.language)):t.add(`und`);return t}function sg(e){for(var t=/* @__PURE__ */ new Map,n=/* @__PURE__ */ new Map,r=0;r<e.length;r++){var i=e[r],a=`und`,o=[];i.language&&(a=li(i.language)),o=i.type==`variant`?i.audioRoles:i.roles,o&&o.length||(o=[``]),t.has(a)||t.set(a,/* @__PURE__ */ new Set),o=g(o);for(var s=o.next();!s.done;s=o.next())s=s.value,t.get(a).add(s),i.label&&(n.has(a)||n.set(a,/* @__PURE__ */ new Map),n.get(a).set(s,i.label))}var c=[];return t.forEach(function(e,t){e=g(e);for(var r=e.next();!r.done;r=e.next()){r=r.value;var i=null;n.has(t)&&n.get(t).has(r)&&(i=n.get(t).get(r)),c.push({language:t,role:r,label:i})}}),c}r.xa=function(){return this.h&&this.h.remote?this.h.remote.state!=`disconnected`:!1},r.$d=function(){return!this.h||this.h.ended?!0:this.Ua&&!this.T()&&this.h.currentTime>=this.Na().end},P(`shaka.Player`,K),K.prototype.isEnded=K.prototype.$d,K.prototype.isRemotePlayback=K.prototype.xa,K.prototype.addFont=K.prototype.addFont,K.prototype.setVideoContainer=K.prototype.Wi,K.prototype.getFetchedPlaybackInfo=K.prototype.Jj,K.prototype.getManifestParserFactory=K.prototype.Oj,K.prototype.getManifest=K.prototype.Gg,K.prototype.retryStreaming=K.prototype.jh,K.prototype.setMaxHardwareResolution=K.prototype.fl,K.prototype.addChaptersTrack=K.prototype.Ie,K.prototype.addThumbnailsTrack=K.prototype.Je,K.prototype.addTextTrackAsync=K.prototype.Md,K.prototype.getStats=K.prototype.getStats,K.prototype.getBufferedInfo=K.prototype.Cc,K.prototype.getSegmentAvailabilityDuration=K.prototype.Ye,K.prototype.getPresentationStartTimeAsDate=K.prototype.ii,K.prototype.getPlayheadTimeAsDate=K.prototype.Rj,K.prototype.setTextTrackVisibility=K.prototype.sh,K.prototype.getChaptersAsync=K.prototype.Ej,K.prototype.getChapters=K.prototype.Dj,K.prototype.getChaptersTracks=K.prototype.Fj,K.prototype.isTextTrackVisible=K.prototype.Qg,K.prototype.selectVariantsByLabel=K.prototype.Xk,K.prototype.selectTextLanguage=K.prototype.nh,K.prototype.selectAudioLanguage=K.prototype.Pi,K.prototype.getTextLanguages=K.prototype.Xj,K.prototype.getAudioLanguages=K.prototype.Aj,K.prototype.getTextLanguagesAndRoles=K.prototype.Yj,K.prototype.getAudioLanguagesAndRoles=K.prototype.Bj,K.prototype.getVideoTracks=K.prototype.getVideoTracks,K.prototype.selectVideoTrack=K.prototype.Yk,K.prototype.getAudioTracks=K.prototype.getAudioTracks,K.prototype.selectAudioTrack=K.prototype.Wk,K.prototype.selectVariantTrack=K.prototype.Ff,K.prototype.selectTextTrack=K.prototype.oh,K.prototype.getThumbnails=K.prototype.$j,K.prototype.getAllThumbnails=K.prototype.zj,K.prototype.getImageTracks=K.prototype.Lj,K.prototype.getTextTracks=K.prototype.Gc,K.prototype.getVariantTracks=K.prototype.kc,K.prototype.cancelTrickPlay=K.prototype.Nd,K.prototype.trickPlay=K.prototype.qe,K.prototype.useTrickPlayTrackIfAvailable=K.prototype.Hh,K.prototype.getPlaybackRate=K.prototype.Db,K.prototype.isBuffering=K.prototype.Ng,K.prototype.getKeyStatuses=K.prototype.We,K.prototype.getActiveSessionsMetadata=K.prototype.Fg,K.prototype.getExpiration=K.prototype.Ud,K.prototype.drmInfo=K.prototype.drmInfo,K.prototype.keySystem=K.prototype.keySystem,K.prototype.isFullyLoaded=K.prototype.kk,K.prototype.goToLive=K.prototype.gk,K.prototype.seekRange=K.prototype.Na,K.prototype.isVideoOnly=K.prototype.pi,K.prototype.isAudioOnly=K.prototype.jk,K.prototype.isInProgress=K.prototype.Pc,K.prototype.isLive=K.prototype.T,K.prototype.getQueueManager=K.prototype.ji,K.prototype.getAdManager=K.prototype.ai,K.prototype.getAssetUri=K.prototype.kd,K.prototype.getNetworkingEngine=K.prototype.Sb,K.prototype.getMediaElement=K.prototype.Xe,K.prototype.getManifestType=K.prototype.di,K.prototype.getLoadMode=K.prototype.Vd,K.prototype.resetConfiguration=K.prototype.Ki,K.prototype.getBufferFullness=K.prototype.bi,K.prototype.getNonDefaultConfiguration=K.prototype.gi,K.prototype.getConfigurationForLowLatency=K.prototype.Gj,K.prototype.getConfiguration=K.prototype.getConfiguration,K.prototype.configurationForLowLatency=K.prototype.wj,K.prototype.configure=K.prototype.configure,K.prototype.releaseAllMutexes=K.prototype.Ok,K.prototype.destroyAllPreloads=K.prototype.mg,K.prototype.preload=K.prototype.preload,K.prototype.detachAndSavePreload=K.prototype.Xh,K.prototype.unloadAndSavePreload=K.prototype.hj,K.prototype.load=K.prototype.load,K.prototype.updateStartTime=K.prototype.ql,K.prototype.unload=K.prototype.yc,K.prototype.detach=K.prototype.detach,K.prototype.attachCanvas=K.prototype.oj,K.prototype.attach=K.prototype.Pb,K.probeSupport=function(e){e=e===void 0||e;var t,n,r,i,a,o,s;return k(function(c){switch(c.h){case 1:if(t={},!e){c.A(2);break}return c.g(Eo(),3);case 3:t=c.i;case 2:return n=Ut(),r=Jc(),i=we(),c.g(i.hc(),4);case 4:return a=c.i,o={manifest:n,media:r,drm:t,hardwareResolution:a},s=pg,s.forEach(function(e,t){o[t]=e()}),c.return(o)}})},K.isBrowserSupported=function(){return e.Promise||F(`A Promise implementation or polyfill is required`),!(e.Promise&&e.Uint8Array&&Array.prototype.forEach)||(navigator.userAgent||``).includes(`Trident/`)?!1:(we(),$x()?!0:cc().canPlayType(`application/x-mpegurl`)!=``)},K.setQueueManagerFactory=function(e){hg=e},K.setAdManagerFactory=function(e){mg=e},K.registerSupportPlugin=Rm,K.prototype.destroy=K.prototype.destroy;var cg=0,lg=1,ug=2,dg=3;K.LoadMode={DESTROYED:cg,NOT_LOADED:lg,MEDIA_SOURCE:ug,SRC_EQUALS:dg},K.version=`v4.16.42`;var fg=[`4`,`16`];je=new function(e){this.g=e,this.i=ke,this.h=Ae}(new Oe(Number(fg[0]),Number(fg[1])));var pg=/* @__PURE__ */ new Map,mg=null,hg=null;function gg(){this.g=[],this.i=this.m=this.l=this.j=this.h=0}function _g(e){return e.g.length?e.g.reduce(function(e,t){return e+t},0)/e.g.length:0}function q(e,t,n){var r=this;this.g=e,this.h=t,this.m=n,this.i=!1,this.j=this.h.getVolume(),this.l=new I,this.l.F(this.h,google.ima.AdEvent.Type.PAUSED,function(){r.i=!0}),this.l.F(this.h,google.ima.AdEvent.Type.RESUMED,function(){r.i=!1})}r=q.prototype,r.needsSkipUI=function(){return!1},r.isClientRendering=function(){return!0},r.hasCustomClick=function(){return!0},r.isUsingAnotherMediaElement=function(){return!0},r.getDuration=function(){return this.g.getDuration()},r.getMinSuggestedDuration=function(){return this.g.getMinSuggestedDuration()},r.getRemainingTime=function(){return this.h.getRemainingTime()},r.isPaused=function(){return this.i},r.isSkippable=function(){return this.g.getSkipTimeOffset()>=0},r.getTimeUntilSkippable=function(){var e=this.g.getSkipTimeOffset();return e=this.getRemainingTime()-e,Math.max(e,0)},r.canSkipNow=function(){return this.h.getAdSkippableState()},r.skip=function(){return this.h.skip()},r.pause=function(){return this.h.pause()},r.play=function(){return this.h.resume()},r.getVolume=function(){return this.h.getVolume()},r.setVolume=function(e){return this.m.volume=e,this.h.setVolume(e)},r.isMuted=function(){return this.h.getVolume()==0},r.isLinear=function(){return this.g.isLinear()},r.resize=function(e,t){this.h.resize(e,t)},r.setMuted=function(e){(this.m.muted=e)?(this.j=this.getVolume(),this.h.setVolume(0)):this.h.setVolume(this.j)},r.getSequenceLength=function(){var e=this.g.getAdPodInfo();return e==null?1:e.getTotalAds()},r.getPositionInSequence=function(){var e=this.g.getAdPodInfo();return e==null?1:e.getAdPosition()},r.getTitle=function(){return this.g.getTitle()},r.getDescription=function(){return this.g.getDescription()},r.getVastMediaBitrate=function(){return this.g.getVastMediaBitrate()},r.getVastMediaHeight=function(){return this.g.getVastMediaHeight()},r.getVastMediaWidth=function(){return this.g.getVastMediaWidth()},r.getVastAdId=function(){return``},r.getAdId=function(){return this.g.getAdId()},r.getCreativeAdId=function(){return this.g.getCreativeAdId()},r.getAdvertiserName=function(){return this.g.getAdvertiserName()},r.getMediaUrl=function(){return this.g.getMediaUrl()},r.getTimeOffset=function(){var e=this.g.getAdPodInfo();return e==null?0:e.getTimeOffset()},r.getPodIndex=function(){var e=this.g.getAdPodInfo();return e==null?0:e.getPodIndex()},r.release=function(){this.h=this.g=null},P(`shaka.ads.ClientSideAd`,q),q.prototype.release=q.prototype.release,q.prototype.getPodIndex=q.prototype.getPodIndex,q.prototype.getTimeOffset=q.prototype.getTimeOffset,q.prototype.getMediaUrl=q.prototype.getMediaUrl,q.prototype.getAdvertiserName=q.prototype.getAdvertiserName,q.prototype.getCreativeAdId=q.prototype.getCreativeAdId,q.prototype.getAdId=q.prototype.getAdId,q.prototype.getVastAdId=q.prototype.getVastAdId,q.prototype.getVastMediaWidth=q.prototype.getVastMediaWidth,q.prototype.getVastMediaHeight=q.prototype.getVastMediaHeight,q.prototype.getVastMediaBitrate=q.prototype.getVastMediaBitrate,q.prototype.getDescription=q.prototype.getDescription,q.prototype.getTitle=q.prototype.getTitle,q.prototype.getPositionInSequence=q.prototype.getPositionInSequence,q.prototype.getSequenceLength=q.prototype.getSequenceLength,q.prototype.setMuted=q.prototype.setMuted,q.prototype.resize=q.prototype.resize,q.prototype.isLinear=q.prototype.isLinear,q.prototype.isMuted=q.prototype.isMuted,q.prototype.setVolume=q.prototype.setVolume,q.prototype.getVolume=q.prototype.getVolume,q.prototype.play=q.prototype.play,q.prototype.pause=q.prototype.pause,q.prototype.skip=q.prototype.skip,q.prototype.canSkipNow=q.prototype.canSkipNow,q.prototype.getTimeUntilSkippable=q.prototype.getTimeUntilSkippable,q.prototype.isSkippable=q.prototype.isSkippable,q.prototype.isPaused=q.prototype.isPaused,q.prototype.getRemainingTime=q.prototype.getRemainingTime,q.prototype.getMinSuggestedDuration=q.prototype.getMinSuggestedDuration,q.prototype.getDuration=q.prototype.getDuration,q.prototype.isUsingAnotherMediaElement=q.prototype.isUsingAnotherMediaElement,q.prototype.hasCustomClick=q.prototype.hasCustomClick,q.prototype.isClientRendering=q.prototype.isClientRendering,q.prototype.needsSkipUI=q.prototype.needsSkipUI;function vg(){}function yg(e,t){var n=[];e=g(xn(e,`Ad`));for(var r=e.next();!r.done;r=e.next())if((r=Tn(r.value,`InLine`))&&(r=Tn(r,`Creatives`))){r=g(xn(r,`Creative`));for(var i=r.next();!i.done;i=r.next()){i=i.value;var a=Tn(i,`Linear`);if(a&&bg(n,t,a),i=Tn(i,`NonLinearAds`)){i=xn(i,`NonLinear`),i=g(i);for(var o=i.next();!o.done;o=i.next())a:{a=n;var s=t,c=o.value,l=Tn(c,`StaticResource`);if(l)o=l.attributes.creativeType;else{if(l=Tn(c,`HTMLResource`),!l)break a;o=`text/html`}if(l=Cn(l)){o===`text/html`&&(l=`data:text/html;charset=UTF-8,`+encodeURIComponent(l));var u=B(c,`width`,Nn)||B(c,`expandedWidth`,Nn),d=B(c,`height`,Nn)||B(c,`expandedHeight`,Nn);if(u||d){var f=null,p=Tn(c,`NonLinearClickThrough`);p&&(p=Cn(p))&&(f=p),p=null,(c=c.attributes.minSuggestedDuration)&&(p=ln(c)),c=0,s!=null&&(c=s),a.push({id:null,groupId:null,startTime:c,endTime:null,uri:l,mimeType:o,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!1,resumeOffset:0,playoutLimit:p,once:!0,pre:s==null,post:s==1/0,timelineRange:!1,loop:!1,overlay:{viewport:{x:0,y:0},topLeft:{x:0,y:0},size:{x:u||0,y:d||0}},displayOnBackground:!1,currentVideo:null,background:null,clickThroughUrl:f})}}}}}}return n}function bg(e,t,n){var r=0;t!=null&&(r=t);var i=null;n.attributes.skipoffset&&(i=ln(n.attributes.skipoffset),isNaN(i)&&(i=null));var a=Tn(n,`MediaFiles`);if(a){var o=null;for((n=Tn(n,`VideoClicks`))&&(n=Tn(n,`ClickThrough`))&&(n=Cn(n))&&(o=n),a=n=xn(a,`MediaFile`),n=n.filter(function(e){return e.attributes.delivery==`streaming`}),n.length&&(a=n),a=a.sort(function(e,t){return(parseInt(t.attributes.height,10)||0)-(parseInt(e.attributes.height,10)||0)}),a=g(a),n=a.next();!n.done;n=a.next())if(n=n.value,!n.attributes.apiFramework){var s=Cn(n);if(s){e.push({id:null,groupId:null,startTime:r,endTime:null,uri:s,mimeType:n.attributes.type||null,isSkippable:i!=null,skipOffset:i,skipFor:null,canJump:!1,resumeOffset:0,playoutLimit:null,once:!0,pre:t==null,post:t==1/0,timelineRange:!1,loop:!1,overlay:null,displayOnBackground:!1,currentVideo:null,background:null,clickThroughUrl:o});break}}}}function xg(e){var t=[];e=g(xn(e,`vmap:AdBreak`));for(var n=e.next();!n.done;n=e.next()){var r=n.value,i=r.attributes.timeOffset;i&&(n=null,n=i==`start`?null:i==`end`?1/0:ln(i),(r=Tn(r,`vmap:AdSource`))&&(r=Tn(r,`vmap:AdTagURI`))&&(r=Sn(r))&&t.push({time:n,uri:r}))}return t}P(`shaka.ads.Utils`,vg),vg.ADS_LOADED=`ads-loaded`,vg.AD_STARTED=`ad-started`,vg.AD_FIRST_QUARTILE=`ad-first-quartile`,vg.AD_MIDPOINT=`ad-midpoint`,vg.AD_THIRD_QUARTILE=`ad-third-quartile`,vg.AD_COMPLETE=`ad-complete`,vg.AD_STOPPED=`ad-stopped`,vg.AD_SKIPPED=`ad-skipped`,vg.AD_VOLUME_CHANGED=`ad-volume-changed`,vg.AD_MUTED=`ad-muted`,vg.AD_PAUSED=`ad-paused`,vg.AD_RESUMED=`ad-resumed`,vg.AD_SKIP_STATE_CHANGED=`ad-skip-state-changed`,vg.CUEPOINTS_CHANGED=`ad-cue-points-changed`,vg.IMA_AD_MANAGER_LOADED=`ima-ad-manager-loaded`,vg.IMA_STREAM_MANAGER_LOADED=`ima-stream-manager-loaded`,vg.AD_CLICKED=`ad-clicked`,vg.AD_PROGRESS=`ad-progress`,vg.AD_BUFFERING=`ad-buffering`,vg.AD_IMPRESSION=`ad-impression`,vg.AD_DURATION_CHANGED=`ad-duration-changed`,vg.AD_CLOSED=`ad-closed`,vg.AD_LOADED=`ad-loaded`,vg.ALL_ADS_COMPLETED=`all-ads-completed`,vg.AD_LINEAR_CHANGED=`ad-linear-changed`,vg.AD_METADATA=`ad-metadata`,vg.AD_RECOVERABLE_ERROR=`ad-recoverable-error`,vg.AD_ERROR=`ad-error`,vg.AD_BREAK_READY=`ad-break-ready`,vg.AD_INTERACTION=`ad-interaction`,vg.AD_CONTENT_PAUSE_REQUESTED=`ad-content-pause-requested`,vg.AD_CONTENT_RESUME_REQUESTED=`ad-content-resume-requested`,vg.AD_CONTENT_ATTACH_REQUESTED=`ad-content-attach-requested`;function Sg(e,t,n,r,i){var a=this;this.u=e,this.i=t,this.G=!1,this.B=this.o=null,this.H=NaN,this.l=i,this.j=null,this.h=new I,google.ima.settings.setLocale(n),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(!0),this.D=new google.ima.AdDisplayContainer(this.u,this.i),this.D.initialize(),this.m=new google.ima.AdsLoader(this.D),this.m.getSettings().setPlayerType(`shaka-player`),this.m.getSettings().setPlayerVersion(`v4.16.42`),this.g=null,this.C=r||new google.ima.AdsRenderingSettings,this.h.F(this.m,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,function(e){wg(a,e)}),this.h.F(this.m,google.ima.AdErrorEvent.Type.AD_ERROR,function(e){Cg(a,e)}),this.h.F(this.i,`ended`,function(){a.m.contentComplete()}),this.h.Ba(this.i,`play`,function(){a.G=!0})}Sg.prototype.configure=function(e){this.o=e},Sg.prototype.stop=function(){this.g&&this.g.stop(),this.u&&sc(this.u)},Sg.prototype.release=function(){this.stop(),this.B&&this.B.disconnect(),this.h&&this.h.release(),this.g&&this.g.destroy(),this.m.destroy(),this.D.destroy()};function Cg(e,t){t.getError(),t=(/* @__PURE__ */ new Map()).set(`originalEvent`,t),e.l(new V(`ad-error`,t)),Dg(e,null),e.l(new V(`ad-cue-points-changed`,(/* @__PURE__ */ new Map()).set(`cuepoints`,[])))}function wg(t,n){if(t.l(new V(`ads-loaded`,(/* @__PURE__ */ new Map()).set(`loadTime`,Date.now()/1e3-t.H))),t.o.customPlayheadTracker){var r={currentTime:t.i.currentTime};t.g=n.getAdsManager(r,t.C),t.i.muted?t.g.setVolume(0):t.g.setVolume(t.i.volume),t.h.F(t.i,`timeupdate`,function(){t.i.duration&&(r.currentTime=t.i.currentTime)}),t.h.F(t.i,`volumechange`,function(){t.j&&(t.j.setVolume(t.i.volume),t.i.muted&&t.j.setMuted(!0))})}else t.g=n.getAdsManager(t.i,t.C);t.l(new V(`ima-ad-manager-loaded`,(/* @__PURE__ */ new Map()).set(`imaAdManager`,t.g)));var i=t.g.getCuePoints();if(i.length){n=[],i=g(i);for(var a=i.next();!a.done;a=i.next())n.push({start:a.value,end:null});t.l(new V(`ad-cue-points-changed`,(/* @__PURE__ */ new Map()).set(`cuepoints`,n)))}Tg(t);try{t.g.init(t.i.offsetWidth,t.i.offsetHeight),t.h.F(t.i,`loadeddata`,function(){t.g.resize(t.i.offsetWidth,t.i.offsetHeight)}),`ResizeObserver`in e?(t.B=new ResizeObserver(function(){t.g.resize(t.i.offsetWidth,t.i.offsetHeight)}),t.B.observe(t.i)):t.h.F(document,`fullscreenchange`,function(){t.g.resize(t.i.offsetWidth,t.i.offsetHeight)}),t.G||t.o.skipPlayDetection?t.g.start():t.h.Ba(t.i,`play`,function(){t.G=!0,t.g.start()})}catch{Dg(t,null)}}function Tg(e){function t(t,n){t=(/* @__PURE__ */ new Map()).set(`originalEvent`,t),e.l(new V(n,t))}e.h.F(e.g,google.ima.AdErrorEvent.Type.AD_ERROR,function(t){Cg(e,t)}),e.h.F(e.g,google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,function(t){Eg(e,t)}),e.h.F(e.g,google.ima.AdEvent.Type.STARTED,function(t){Eg(e,t)}),e.h.F(e.g,google.ima.AdEvent.Type.FIRST_QUARTILE,function(e){t(e,`ad-first-quartile`)}),e.h.F(e.g,google.ima.AdEvent.Type.MIDPOINT,function(e){t(e,`ad-midpoint`)}),e.h.F(e.g,google.ima.AdEvent.Type.THIRD_QUARTILE,function(e){t(e,`ad-third-quartile`)}),e.h.F(e.g,google.ima.AdEvent.Type.COMPLETE,function(e){t(e,`ad-complete`)}),e.h.F(e.g,google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,function(t){Dg(e,t)}),e.h.F(e.g,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(n){t(n,`all-ads-completed`),Dg(e,n)}),e.h.F(e.g,google.ima.AdEvent.Type.SKIPPED,function(e){t(e,`ad-skipped`)}),e.h.F(e.g,google.ima.AdEvent.Type.VOLUME_CHANGED,function(e){t(e,`ad-volume-changed`)}),e.h.F(e.g,google.ima.AdEvent.Type.VOLUME_MUTED,function(e){t(e,`ad-muted`)}),e.h.F(e.g,google.ima.AdEvent.Type.PAUSED,function(n){e.j&&(e.j.i=!0,t(n,`ad-paused`))}),e.h.F(e.g,google.ima.AdEvent.Type.RESUMED,function(n){e.j&&(e.j.i=!1,t(n,`ad-resumed`))}),e.h.F(e.g,google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,function(n){e.j&&t(n,`ad-skip-state-changed`)}),e.h.F(e.g,google.ima.AdEvent.Type.CLICK,function(e){t(e,`ad-clicked`)}),e.h.F(e.g,google.ima.AdEvent.Type.AD_PROGRESS,function(e){t(e,`ad-progress`)}),e.h.F(e.g,google.ima.AdEvent.Type.AD_BUFFERING,function(e){t(e,`ad-buffering`)}),e.h.F(e.g,google.ima.AdEvent.Type.IMPRESSION,function(e){t(e,`ad-impression`)}),e.h.F(e.g,google.ima.AdEvent.Type.DURATION_CHANGE,function(e){t(e,`ad-duration-changed`)}),e.h.F(e.g,google.ima.AdEvent.Type.USER_CLOSE,function(e){t(e,`ad-closed`)}),e.h.F(e.g,google.ima.AdEvent.Type.LOADED,function(e){t(e,`ad-loaded`)}),e.h.F(e.g,google.ima.AdEvent.Type.LINEAR_CHANGED,function(e){t(e,`ad-linear-changed`)}),e.h.F(e.g,google.ima.AdEvent.Type.AD_METADATA,function(e){t(e,`ad-metadata`)}),e.h.F(e.g,google.ima.AdEvent.Type.LOG,function(e){t(e,`ad-recoverable-error`)}),e.h.F(e.g,google.ima.AdEvent.Type.AD_BREAK_READY,function(e){t(e,`ad-break-ready`)}),e.h.F(e.g,google.ima.AdEvent.Type.INTERACTION,function(e){t(e,`ad-interaction`)})}function Eg(e,t){var n=t.getAd();n?(e.j=new q(n,e.g,e.i),t.type!=google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED||e.o.supportsMultipleMediaElements||e.l(new V(`ad-content-pause-requested`)),t=(/* @__PURE__ */ new Map()).set(`ad`,e.j).set(`sdkAdObject`,n).set(`originalEvent`,t),e.l(new V(`ad-started`,t)),e.j.isLinear()&&(e.u.setAttribute(`ad-active`,`true`),e.o.customPlayheadTracker||e.i.pause(),e.i.muted?(t=e.j,t.j=e.i.volume,t.h.setVolume(0)):e.j.setVolume(e.i.volume))):F(`The IMA SDK fired a `+t.type+` event with no associated ad. Unable to play ad!`)}function Dg(e,t){t&&t.type==google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED&&!e.o.supportsMultipleMediaElements&&e.l(new V(`ad-content-resume-requested`)),e.l(new V(`ad-stopped`,(/* @__PURE__ */ new Map()).set(`originalEvent`,t))),e.j&&e.j.isLinear()&&(e.u.removeAttribute(`ad-active`),e.o.customPlayheadTracker||e.i.ended||e.i.play())}function J(e,t,n,r,i,a){this.g=e,this.h=t,this.j=(this.i=t.isSkippable)?t.skipOffset||0:t.skipOffset,this.l=t.skipFor,this.B=n,this.o=r,this.m=i,this.u=a,this.C=t.overlay}r=J.prototype,r.needsSkipUI=function(){return!0},r.isClientRendering=function(){return!0},r.hasCustomClick=function(){return this.h.clickThroughUrl!=null},r.isUsingAnotherMediaElement=function(){return this.u},r.getDuration=function(){var e=this.g.duration;return isNaN(e)?-1:e},r.getMinSuggestedDuration=function(){return this.getDuration()},r.getRemainingTime=function(){var e=this.g.duration;return isNaN(e)?-1:e-this.g.currentTime},r.isPaused=function(){return this.g.paused},r.isSkippable=function(){return this.i&&this.l!=null?this.getDuration()-this.getRemainingTime()<this.j+this.l:this.i},r.getTimeUntilSkippable=function(){if(this.isSkippable()){var e=this.getRemainingTime()+this.j-this.getDuration();return Math.max(e,0)}return Math.max(this.getRemainingTime(),0)},r.canSkipNow=function(){return this.i&&this.getTimeUntilSkippable()==0},r.skip=function(){this.canSkipNow()&&this.B()},r.pause=function(){return this.g.pause()},r.play=function(){return this.g.play()},r.getVolume=function(){return this.g.volume},r.setVolume=function(e){this.g.volume=e},r.isMuted=function(){return this.g.muted},r.isLinear=function(){return this.C==null},r.resize=function(){},r.setMuted=function(e){this.g.muted=e},r.getSequenceLength=function(){return this.o},r.getPositionInSequence=function(){return this.m},r.getTitle=function(){return``},r.getDescription=function(){return``},r.getVastMediaBitrate=function(){return 0},r.getVastMediaHeight=function(){return 0},r.getVastMediaWidth=function(){return 0},r.getVastAdId=function(){return``},r.getAdId=function(){return this.h.id||``},r.getCreativeAdId=function(){return``},r.getAdvertiserName=function(){return``},r.getMediaUrl=function(){return this.h.uri},r.getTimeOffset=function(){return this.h.pre?0:this.h.post?-1:this.h.startTime},r.getPodIndex=function(){return 0},r.release=function(){this.g=null},P(`shaka.ads.InterstitialAd`,J),J.prototype.release=J.prototype.release,J.prototype.getPodIndex=J.prototype.getPodIndex,J.prototype.getTimeOffset=J.prototype.getTimeOffset,J.prototype.getMediaUrl=J.prototype.getMediaUrl,J.prototype.getAdvertiserName=J.prototype.getAdvertiserName,J.prototype.getCreativeAdId=J.prototype.getCreativeAdId,J.prototype.getAdId=J.prototype.getAdId,J.prototype.getVastAdId=J.prototype.getVastAdId,J.prototype.getVastMediaWidth=J.prototype.getVastMediaWidth,J.prototype.getVastMediaHeight=J.prototype.getVastMediaHeight,J.prototype.getVastMediaBitrate=J.prototype.getVastMediaBitrate,J.prototype.getDescription=J.prototype.getDescription,J.prototype.getTitle=J.prototype.getTitle,J.prototype.getPositionInSequence=J.prototype.getPositionInSequence,J.prototype.getSequenceLength=J.prototype.getSequenceLength,J.prototype.setMuted=J.prototype.setMuted,J.prototype.resize=J.prototype.resize,J.prototype.isLinear=J.prototype.isLinear,J.prototype.isMuted=J.prototype.isMuted,J.prototype.setVolume=J.prototype.setVolume,J.prototype.getVolume=J.prototype.getVolume,J.prototype.play=J.prototype.play,J.prototype.pause=J.prototype.pause,J.prototype.skip=J.prototype.skip,J.prototype.canSkipNow=J.prototype.canSkipNow,J.prototype.getTimeUntilSkippable=J.prototype.getTimeUntilSkippable,J.prototype.isSkippable=J.prototype.isSkippable,J.prototype.isPaused=J.prototype.isPaused,J.prototype.getRemainingTime=J.prototype.getRemainingTime,J.prototype.getMinSuggestedDuration=J.prototype.getMinSuggestedDuration,J.prototype.getDuration=J.prototype.getDuration,J.prototype.isUsingAnotherMediaElement=J.prototype.isUsingAnotherMediaElement,J.prototype.hasCustomClick=J.prototype.hasCustomClick,J.prototype.isClientRendering=J.prototype.isClientRendering,J.prototype.needsSkipUI=J.prototype.needsSkipUI;function Y(e,t,n){this.g=e,this.j=t,this.h=n,this.i=e.overlay==null}r=Y.prototype,r.needsSkipUI=function(){return!0},r.isClientRendering=function(){return!0},r.hasCustomClick=function(){return this.g.clickThroughUrl!=null},r.isUsingAnotherMediaElement=function(){return!1},r.getDuration=function(){return-1},r.getMinSuggestedDuration=function(){return this.getDuration()},r.getRemainingTime=function(){return-1},r.isPaused=function(){return!1},r.isSkippable=function(){return!1},r.getTimeUntilSkippable=function(){return 0},r.canSkipNow=function(){return!1},r.skip=function(){},r.pause=function(){},r.play=function(){},r.getVolume=function(){return 1},r.setVolume=function(){},r.isMuted=function(){return!1},r.isLinear=function(){return this.i},r.resize=function(){},r.setMuted=function(){},r.getSequenceLength=function(){return this.j},r.getPositionInSequence=function(){return this.h},r.getTitle=function(){return``},r.getDescription=function(){return``},r.getVastMediaBitrate=function(){return 0},r.getVastMediaHeight=function(){return 0},r.getVastMediaWidth=function(){return 0},r.getVastAdId=function(){return``},r.getAdId=function(){return this.g.id||``},r.getCreativeAdId=function(){return``},r.getAdvertiserName=function(){return``},r.getMediaUrl=function(){return this.g.uri},r.getTimeOffset=function(){return this.g.pre?0:this.g.post?-1:this.g.startTime},r.getPodIndex=function(){return 0},r.release=function(){},P(`shaka.ads.InterstitialStaticAd`,Y),Y.prototype.release=Y.prototype.release,Y.prototype.getPodIndex=Y.prototype.getPodIndex,Y.prototype.getTimeOffset=Y.prototype.getTimeOffset,Y.prototype.getMediaUrl=Y.prototype.getMediaUrl,Y.prototype.getAdvertiserName=Y.prototype.getAdvertiserName,Y.prototype.getCreativeAdId=Y.prototype.getCreativeAdId,Y.prototype.getAdId=Y.prototype.getAdId,Y.prototype.getVastAdId=Y.prototype.getVastAdId,Y.prototype.getVastMediaWidth=Y.prototype.getVastMediaWidth,Y.prototype.getVastMediaHeight=Y.prototype.getVastMediaHeight,Y.prototype.getVastMediaBitrate=Y.prototype.getVastMediaBitrate,Y.prototype.getDescription=Y.prototype.getDescription,Y.prototype.getTitle=Y.prototype.getTitle,Y.prototype.getPositionInSequence=Y.prototype.getPositionInSequence,Y.prototype.getSequenceLength=Y.prototype.getSequenceLength,Y.prototype.setMuted=Y.prototype.setMuted,Y.prototype.resize=Y.prototype.resize,Y.prototype.isLinear=Y.prototype.isLinear,Y.prototype.isMuted=Y.prototype.isMuted,Y.prototype.setVolume=Y.prototype.setVolume,Y.prototype.getVolume=Y.prototype.getVolume,Y.prototype.play=Y.prototype.play,Y.prototype.pause=Y.prototype.pause,Y.prototype.skip=Y.prototype.skip,Y.prototype.canSkipNow=Y.prototype.canSkipNow,Y.prototype.getTimeUntilSkippable=Y.prototype.getTimeUntilSkippable,Y.prototype.isSkippable=Y.prototype.isSkippable,Y.prototype.isPaused=Y.prototype.isPaused,Y.prototype.getRemainingTime=Y.prototype.getRemainingTime,Y.prototype.getMinSuggestedDuration=Y.prototype.getMinSuggestedDuration,Y.prototype.getDuration=Y.prototype.getDuration,Y.prototype.isUsingAnotherMediaElement=Y.prototype.isUsingAnotherMediaElement,Y.prototype.hasCustomClick=Y.prototype.hasCustomClick,Y.prototype.isClientRendering=Y.prototype.isClientRendering,Y.prototype.needsSkipUI=Y.prototype.needsSkipUI;function Og(e,t,n,r){function i(e){return e?e.overlay?!0:a.g.ended?e.post:!a.g.paused:!1}var a=this;this.M=null,this.m=e,this.C=t,this.g=n,this.G=null,this.u=!0,this.h=this.g,this.ua=r,this.ia=/* @__PURE__ */ new Set,this.S=/* @__PURE__ */ new Set,this.H=/* @__PURE__ */ new Set,this.D=/* @__PURE__ */ new Map,this.K=/* @__PURE__ */ new Map,this.i=new K,Wg(this),this.I=new I,this.j=new I,this.J=!1,this.Z=this.o=this.B=this.l=null,this.aa=!1,this.O=-1,this.W=function(){if(!a.J&&a.l&&!a.C.xa()){a.l=a.g.currentTime;var e=Fg(a);e&&i(e)&&Ig(a,e,1,1,Date.now())}},this.U=function(){if(!(a.J||a.l||a.C.xa())){a.g.paused||(a.l=a.g.currentTime);var e;a.B||(e=Fg(a,!0)),e||(e=Fg(a)),e&&i(e)&&Ig(a,e,1,1,Date.now())}},this.qa=function(){if(!a.J&&a.l&&!a.C.xa()){var e=a.g.currentTime;a.B&&!a.B.pre&&!a.B.post&&e<(a.B.endTime||a.B.startTime)&&(a.B=null)}},this.R=new Qr(this.W),this.N=new Qr(function(){var e,t,n,r,i,o,s,c,l,u,d;return k(function(f){switch(f.h){case 1:if(!a.H.size||a.l==null){f.A(0);break}if(e=a.C.Vd(),e==cg||e==lg)return f.return();t=!1,n=Array.from(a.H),r=a.C.Na(),i=g(n),o=i.next();case 3:if(o.done){f.A(5);break}if(s=o.value,s==a.B){f.A(4);break}if(c=s.endTime||s.startTime,!(r.start-c>=1)){l=s.startTime-a.l,l>0&&l<=10&&(!a.D.has(s)&&Kg(s)&&a.D.set(s,a.i.preload(s.uri,null,s.mimeType||void 0)),Jg(a,s)),f.A(4);break}if(!a.D.has(s)){f.A(7);break}return f.g(a.D.get(s),8);case 8:(u=f.i)&&u.destroy(),a.D.delete(s);case 7:Yg(a,s),d=s.id||JSON.stringify(s),a.S.has(d)&&a.S.delete(d),a.H.delete(s),Ag(a),s.overlay||(t=!0);case 4:o=i.next(),f.A(3);break;case 5:t&&Ug(a),f.j()}})}),this.configure(this.C.getConfiguration().ads)}r=Og.prototype,r.configure=function(e){this.M=e,this.J||jg(this)};function kg(e){if(!e.aa&&e.H.size){if(e.I.F(e.g,`playing`,e.U),e.I.F(e.g,`timeupdate`,e.U),e.I.F(e.g,`seeked`,e.qa),e.I.F(e.g,`ended`,e.W),`requestVideoFrameCallback`in e.g&&!qg()){var t=e.g,n=function(){e.O!=-1&&(e.W(),e.O!=-1&&(e.O=t.requestVideoFrameCallback(n)))};e.O=t.requestVideoFrameCallback(n)}else e.R.Fa(.025);e.N&&e.N.Fa(1),e.aa=!0}}function Ag(e){e.aa&&!e.H.size&&(e.I.Oa(e.g,`playing`,e.U),e.I.Oa(e.g,`timeupdate`,e.U),e.I.Oa(e.g,`seeked`,e.qa),e.I.Oa(e.g,`ended`,e.W),e.O!=-1&&(e.g.cancelVideoFrameCallback(e.O),e.O=-1),e.R&&e.R.stop(),e.N&&e.N.stop(),e.aa=!1)}function jg(e){if(e.m&&e.M){var t=e.M.supportsMultipleMediaElements,n=e.g;(n.controls||n.webkitPresentationMode&&n.webkitPresentationMode!==`inline`||n.webkitDisplayingFullscreen)&&(t=!1),e.u==t&&(e.u=!t,e.u?(e.h=e.g,e.G&&(e.G.parentElement&&e.m.removeChild(e.G),e.G=null)):(e.G||(t=document.createElement(e.g.tagName),t.autoplay=!0,t.style.position=`absolute`,t.style.top=`0`,t.style.left=`0`,t.style.width=`100%`,t.style.height=`100%`,t.style.display=`none`,t.setAttribute(`playsinline`,``),e.G=t),e.h=e.G))}else e.u=!0}r.stop=function(){if(this.j&&this.j.Sa(),this.ia.clear(),this.S.clear(),this.H.clear(),this.i.mg(),this.D.size){var e=Array.from(this.D.values());e=g(e);for(var t=e.next();!t.done;t=e.next())(t=t.value)&&t.then(function(e){e&&e.destroy()})}if(this.D.clear(),this.K.size)for(e=Array.from(this.K.keys()),e=g(e),t=e.next();!t.done;t=e.next())Yg(this,t.value);this.K.clear(),this.i.detach(),this.J=!1,this.B=this.l=null,this.u=!0,this.h=this.g,this.G=null,Bg(this),Ag(this),this.m&&sc(this.m),this.o&&(this.o.stop(),this.o=null)},r.release=function(){this.stop(),this.I&&this.I.release(),this.j&&this.j.release(),this.R&&(this.R.stop(),this.R=null),this.N&&(this.N.stop(),this.N=null),this.i.destroy()},r.nd=function(){return this.i};function Mg(e,t){var n,r,i;k(function(a){if(a.h==1){if(n=null,(r=t.values.find(function(e){return e.key==`ID`}))&&(n=r.data),n){if(e.ia.has(n))return a.return();e.ia.add(n)}return Wg(e),i=[],t&&t.values.find(function(e){return e.key==`X-OVERLAY-ID`})?(i=Hg(t),a.A(2)):a.g(Vg(e,t),3)}a.h!=2&&(i=a.i),i.length?Pg(e,i):F(`Unsupported HLS interstitial`,t),a.j()})}function Ng(e,t){var n=Tn(t.eventNode,`OverlayEvent`),r=n.attributes.uri,i=n.attributes.mimeType,a=n.attributes.loop==`true`,o=B(n,`z`,Nn);if(r&&o!=0){var s=null,c=Tn(n,`Background`);if(c){var l=c.attributes.uri;s=l?`center / contain no-repeat url('`+l+`')`:Cn(c)}c=1920,l=1080;var u=Tn(n,`Viewport`);if(u&&(c=B(u,`x`,Nn),c==null||(l=B(u,`y`,Nn),l==null)))return;var d={viewport:{x:c,y:l},topLeft:{x:0,y:0},size:{x:c,y:l}},f=Tn(n,`Overlay`);if(u&&f){var p=Tn(f,`TopLeft`),m=Tn(f,`Size`);if(p&&m){if(f=B(p,`x`,Nn),f==null||(p=B(p,`y`,Nn),p==null))return;var h=B(m,`x`,Nn);if(h==null||(m=B(m,`y`,Nn),m==null))return;d.topLeft.x=f,d.topLeft.y=p,d.size.x=h,d.size.y=m}}if(f=null,n=Tn(n,`Squeeze`),u&&n&&(m=Tn(n,`TopLeft`),n=Tn(n,`Size`),m&&n)){if(u=B(m,`x`,Nn),u==null||(f=B(m,`y`,Nn),f==null)||(m=B(n,`x`,Nn),m==null)||(n=B(n,`y`,Nn),n==null))return;f={viewport:{x:c,y:l},topLeft:{x:u,y:f},size:{x:m,y:n}}}Pg(e,[{id:t.id,groupId:null,startTime:t.startTime,endTime:t.endTime,uri:r,mimeType:i,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!0,resumeOffset:null,playoutLimit:null,once:!1,pre:!1,post:!1,timelineRange:!0,loop:a,overlay:d,displayOnBackground:o==-1,currentVideo:f,background:s,clickThroughUrl:null}])}}r.addAdUrlInterstitial=function(e){var t=this,n,r,i,a,o,s,c,l,u;return k(function(d){if(d.h==1)return n={type:12},d.g(Gg(t,e,n),2);if(d.h!=3){if(r=d.i,i=hn(r,`VAST,vmap:VMAP`),!i)throw new R(2,10,10007);if(a=[],i.tagName==`VAST`)return a=yg(i,t.l),d.A(3);if(i.tagName!=`vmap:VMAP`)return d.A(3);for(o=function(e){var r,i;return k(function(o){if(o.h==1)return o.g(Gg(t,e.uri,n),2);if(r=o.i,i=hn(r,`VAST`),!i)throw new R(2,10,10007);a.push.apply(a,_(yg(i,e.time))),o.j()})},s=[],c=g(xg(i)),l=c.next();!l.done;l=c.next())u=l.value,s.push(o(u));return s.length?d.g(Promise.all(s),3):d.A(3)}Pg(t,a),d.j()})};function Pg(e,t){var n,r,i,a,o,s,c,l;k(function(u){switch(u.h){case 1:n=!1,r=g(t),i=r.next();case 2:if(i.done){u.A(4);break}if(a=i.value,!a.uri){F(`Missing URL in interstitial`,a),u.A(3);break}if(a.mimeType){u.A(5);break}return u.m(6),o=e.i.Sb(),u.g(qu(a.uri,o,e.C.getConfiguration().streaming.retryParameters),8);case 8:a.mimeType=u.i,u.o(5);break;case 6:u.l();case 5:if(s=a.id||JSON.stringify(a),e.S.has(s)){u.A(3);break}a.loop&&!a.overlay&&F(`Loop is only supported in overlay interstitials`,a),a.overlay||(n=!0),e.S.add(s),e.H.add(a),c=!1,a.pre&&e.l==null?c=!0:a.startTime!=0||a.canJump?e.l!=null&&(l=a.startTime-e.l,l>0&&l<=10&&(c=!0)):c=!0,c&&(!e.D.has(a)&&Kg(a)&&e.D.set(a,e.i.preload(a.uri,null,a.mimeType||void 0)),Jg(e,a));case 3:i=r.next(),u.A(2);break;case 4:n&&Ug(e),kg(e),u.j()}})}function Fg(e,t,n){t=t!==void 0&&t,n=n===void 0?null:n;var r=0,i=null;if(e.H.size&&e.l!=null){var a=e.g.ended,o=Array.from(e.H).sort(function(e,t){return t.startTime-e.startTime}),s=o;for(s=t?o.filter(function(e){return e.pre}):a?o.filter(function(e){return e.post}):o.filter(function(e){return!e.pre&&!e.post}),o=g(s),s=o.next();!s.done;s=o.next()){s=s.value;var c=!1;if(t)c=s.pre;else if(a)c=s.post;else if(!s.pre&&!s.post){var l=e.l-Math.round(s.startTime*1e3)/1e3,u=1;e.M.allowStartInMiddleOfInterstitial&&s.endTime&&s.endTime!=1/0&&(u=s.endTime-s.startTime),(l>0||l==0&&e.l==0)&&(l<=u||!s.canJump)&&(c=!(n==null&&e.B&&!e.B.pre&&!e.B.post&&e.B.startTime>=s.startTime))}c&&(!e.B||s.startTime>=e.B.startTime)&&(r==(n||0)?i=s:i&&!s.canJump&&Math.round(s.startTime*1e3)/1e3-Math.round(i.startTime*1e3)/1e3>.001&&(i=s,r=0),r++)}}return i}function Ig(e,t,n,r,i,a){a=a===void 0?0:a,e.B=t,jg(e),e.u||!e.m||e.h.parentElement||e.m.appendChild(e.h),r==1&&n==1&&(n=Array.from(e.H).filter(function(e){return t.pre?e.pre==t.pre:t.post?e.post==t.post:Math.abs(e.startTime-t.startTime)<.001}).length),t.once&&(a++,e.H.delete(t),Ag(e),t.overlay||Ug(e)),t.mimeType&&(t.mimeType.startsWith(`image/`)||t.mimeType===`text/html`)?t.overlay?Lg(e,t,n,r,a):F(`Unsupported interstitial`,t):e.u&&t.overlay?F(`Unsupported interstitial`,t):Rg(e,t,n,r,i,a)}function Lg(t,n,r,i,a){function o(){t.o&&(t.o.stop(),t.o=null),t.m.removeChild(l),Bg(t,n),Xg(t,`ad-stopped`),t.j.Sa();var e=Fg(t,n.pre,i-a);e?Ig(t,e,r,++i,Date.now(),a):t.J=!1}t.J=!0;var s=n.overlay,c=n.mimeType==`text/html`?`iframe`:`img`,l=document.createElement(c);l.style.objectFit=`contain`,l.style.position=`absolute`,l.style.border=`none`,zg(t,n);var u=new Y(n,r,i);Xg(t,`ad-impression`),Xg(t,`ad-started`,(/* @__PURE__ */ new Map()).set(`ad`,u)),c==`iframe`?l.src=n.uri:(l.src=n.uri,l.onerror=function(e){Xg(t,`ad-error`,(/* @__PURE__ */ new Map()).set(`originalEvent`,e)),o()}),u=s.viewport;var d=s.topLeft;s=s.size,u.x==0&&u.y==0?(l.width=n.overlay.size.x,l.height=n.overlay.size.y,l.style.bottom=`10%`,l.style.left=`0`,l.style.right=`0`,l.style.width=`100%`,n.overlay.size.y||c!=`iframe`||(l.style.height=`auto`)):(l.style.height=s.y/u.y*100+`%`,l.style.left=d.x/u.x*100+`%`,l.style.top=d.y/u.y*100+`%`,l.style.width=s.x/u.x*100+`%`),t.m.appendChild(l);var f=Date.now();t.o&&t.o.stop(),t.o=new Qr(function(){n.playoutLimit&&(Date.now()-f)/1e3>n.playoutLimit||n.endTime&&t.g.currentTime>n.endTime?(Xg(t,`ad-complete`),o()):t.g.currentTime<n.startTime&&(Xg(t,`ad-skipped`),o())}),n.playoutLimit&&!n.endTime?t.o.na(n.playoutLimit):n.endTime&&t.o.Fa(.025),t.j.F(t.g,`seeked`,function(){var e=t.g.currentTime;(e<n.startTime||n.endTime&&e>n.endTime)&&(t.o&&t.o.stop(),Xg(t,`ad-skipped`),o())}),n.clickThroughUrl&&t.j.F(l,`click`,function(){n.clickThroughUrl&&e.open(n.clickThroughUrl,`_blank`)})}function Rg(t,n,r,i,a,o){var s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D;k(function(O){switch(O.h){case 1:if(s=Date.now(),t.J=!0,c=!1,l=function(){if(!t.u&&!n.overlay&&n.resumeOffset==null){if(n.timelineRange&&n.endTime&&n.endTime!=1/0)t.g.currentTime!=n.endTime&&(t.g.currentTime=n.endTime);else{var e=Date.now();t.g.currentTime+=(e-a)/1e3,a=e}}},u=function(e){var s,c;return k(function(u){if(u.h==1){if(l(),s=Fg(t,n.pre,i-o),e&&n.groupId)for(;s&&s.groupId==n.groupId;)i++,s=Fg(t,n.pre,i-o);return t.o&&(!n.groupId||s&&s.groupId!=n.groupId)&&(t.o.stop(),t.o=null),Bg(t,n),s&&!s.overlay?u.A(2):(n.post&&(t.l=null,t.B=null),t.u?u.g(t.i.detach(),4):u.g(t.i.yc(),4))}u.h!=2&&(t.u&&(c=n.resumeOffset,c??(c=n.timelineRange&&n.endTime&&n.endTime!=1/0?n.endTime-(t.l||0):(Date.now()-a)/1e3),Xg(t,`ad-content-resume-requested`,(/* @__PURE__ */ new Map()).set(`offset`,c))),Xg(t,`ad-stopped`),t.j.Sa(),t.J=!1,t.u?Ug(t):(t.h.style.display=`none`,l(),t.g.ended||t.g.play())),jg(t),s&&(Xg(t,`ad-stopped`),t.j.Sa(),Ig(t,s,r,++i,a,o)),u.j()})},d=function(e){return k(function(n){return c?n.return():(c=!0,Xg(t,`ad-error`,(/* @__PURE__ */ new Map()).set(`originalEvent`,e)),n.g(u(!1),0))})},f=function(){return k(function(e){if(e.h==1)return c?e.return():(c=!0,e.g(u(!1),2));Xg(t,`ad-complete`),e.j()})},t.Z=function(){return k(function(e){return c?e.return():(c=!0,Xg(t,`ad-skipped`),e.g(u(!0),0))})},p=new J(t.h,n,t.Z,r,i,!t.u),t.u||(p.setMuted(t.g.muted),p.setVolume(t.g.volume)),Xg(t,`ad-started`,(/* @__PURE__ */ new Map()).set(`ad`,p)),(m=p.canSkipNow())&&Xg(t,`ad-skip-state-changed`),t.j.Ba(t.i,`error`,d),t.j.F(t.h,`timeupdate`,function(){if(t.h.duration){var e=p.canSkipNow();m!=e&&p.getRemainingTime()>0&&p.getDuration()>0&&Xg(t,`ad-skip-state-changed`),m=e,!t.u&&!n.overlay&&n.resumeOffset==null&&n.timelineRange&&n.endTime&&n.endTime!=1/0&&t.g.currentTime!=n.endTime&&t.C.Na().end>=n.endTime&&(t.g.currentTime=n.endTime)}}),t.j.Ba(t.i,`firstquartile`,function(){l(),Xg(t,`ad-first-quartile`)}),t.j.Ba(t.i,`midpoint`,function(){l(),Xg(t,`ad-midpoint`)}),t.j.Ba(t.i,`thirdquartile`,function(){l(),Xg(t,`ad-third-quartile`)}),t.j.Ba(t.i,`complete`,f),t.j.F(t.h,`play`,function(){Xg(t,`ad-resumed`)}),t.j.F(t.h,`pause`,function(){var e=t.i.getConfiguration();t.h.currentTime>=e.playRangeEnd?f():Xg(t,`ad-paused`)}),t.j.F(t.h,`volumechange`,function(){t.h.muted?Xg(t,`ad-muted`):Xg(t,`ad-volume-changed`),t.u||(t.g.volume=t.h.volume,t.g.muted=t.h.muted)}),n.clickThroughUrl&&(h=t.m||t.h,t.j.F(h,`click`,function(){n.clickThroughUrl&&(p.isPaused()||p.pause(),e.open(n.clickThroughUrl,`_blank`))})),!t.u||i!=1){O.A(2);break}return Xg(t,`ad-content-pause-requested`,(/* @__PURE__ */ new Map()).set(`saveLivePosition`,!0)),g=new oa,_=function(e){return k(function(n){if(n.h==1)return e.state==`detach`?qg()?n.g(new Promise(function(e){return new Qr(e).na(.1)}),3):n.A(3):n.A(0);g.resolve(),t.j.Oa(t.C,`onstatechange`,_),n.j()})},t.j.F(t.C,`onstatechange`,_),O.g(g,2);case 2:return zg(t,n),t.u||(t.h.style.display=``,n.overlay?(t.h.loop=n.loop,v=n.overlay.viewport,y=n.overlay.topLeft,b=n.overlay.size,t.h.style.height=b.y/v.y*100+`%`,t.h.style.left=y.x/v.x*100+`%`,t.h.style.top=y.y/v.y*100+`%`,t.h.style.width=b.x/v.x*100+`%`):(t.g.pause(),n.resumeOffset!=null&&n.resumeOffset!=0&&(t.g.currentTime+=n.resumeOffset),t.h.loop=!1,t.h.style.height=`100%`,t.h.style.left=`0`,t.h.style.top=`0`,t.h.style.width=`100%`)),O.m(4),Wg(t),n.startTime&&n.endTime&&n.endTime!=1/0&&n.startTime!=n.endTime&&(x=n.endTime-n.startTime,x>0&&t.i.configure(`playRangeEnd`,x)),n.playoutLimit&&!t.o&&(t.o=new Qr(function(){t.Z()}).na(n.playoutLimit),t.i.configure(`playRangeEnd`,n.playoutLimit)),O.g(t.i.Pb(t.h),6);case 6:return S=null,n.pre||n.post||!t.M.allowStartInMiddleOfInterstitial||t.l==null||(C=t.l-n.startTime,Math.abs(C)>.25&&(S=C)),t.D.has(n)?O.g(t.D.get(n),10):O.g(t.i.load(n.uri,S,n.mimeType||void 0),8);case 10:return w=O.i,t.D.delete(n),w?O.g(t.i.load(w),8):O.g(t.i.load(n.uri,S,n.mimeType||void 0),8);case 8:n.overlay&&t.g.paused?t.h.pause():t.h.play(),T=(Date.now()-s)/1e3,Xg(t,`ads-loaded`,(/* @__PURE__ */ new Map()).set(`loadTime`,T)),t.u&&t.g.play(),n.overlay&&(n.pre||n.post||t.C.T()&&!(n.startTime>0)||(E=function(){var e=t.g.currentTime-n.startTime;Math.abs(e-t.h.currentTime)>.1&&(t.h.currentTime=e)},t.j.Ba(t.h,`playing`,E),t.j.F(t.g,`seeking`,E)),t.j.F(t.g,`seeked`,function(){var e=t.g.currentTime;(e<n.startTime||n.endTime&&e>n.endTime)&&t.Z()})),O.o(0);break;case 4:if(D=O.l(),!t.J)return O.return();d(D),O.j()}})}function zg(e,t){if(t.displayOnBackground&&(e.g.style.zIndex=`1`),t.currentVideo!=null){var n=t.currentVideo;e.g.style.transformOrigin=`top left`;var r=!0,i=[],a=n.topLeft.x/n.viewport.x*100;a>0&&a<=100&&(i.push(`translateX(`+a+`%)`),r=!1),a=n.topLeft.y/n.viewport.y*100,a>0&&a<=100&&(i.push(`translateY(`+a+`%)`),r=!1),a=n.size.x/n.viewport.x,a<1&&i.push(`scaleX(`+a+`)`),n=n.size.y/n.viewport.y,a<1&&i.push(`scaleY(`+n+`)`),i.length&&(e.g.style.transform=i.join(` `)),r&&(e.g.style.transition=`transform 250ms`)}e.m&&(t.clickThroughUrl?(e.m.setAttribute(`ad-active`,`true`),e.m.style.pointerEvents=``):e.m.style.pointerEvents=`none`,t.background&&(e.m.style.background=t.background)),e.G&&(e.G.style.background=t.overlay?``:`rgb(0, 0, 0)`)}function Bg(e,t){(!t||t.displayOnBackground)&&(e.g.style.zIndex=``),t&&t.currentVideo==null||(e.g.style.transformOrigin=``,e.g.style.transition=``,e.g.style.transform=``),e.m&&(e.m.removeAttribute(`ad-active`),e.m.style.pointerEvents=``,!t||t.background)&&(e.m.style.background=``),e.G&&(e.G.style.background=``)}function Vg(e,t){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,A,j,M,ee,te,N,ne,re,P,ie,ae,oe,se,ce,F;return k(function(k){switch(k.h){case 1:if(n=[],!t||(r=t.values.find(function(e){return e.key==`X-ASSET-URI`}),i=t.values.find(function(e){return e.key==`X-ASSET-LIST`}),!r&&!i))return k.return(n);if(a=null,(o=t.values.find(function(e){return e.key==`ID`}))&&(a=o.data),s=a==null?Math.floor(t.startTime*10)/10:t.startTime,(c=t.endTime)&&t.endTime!=1/0&&typeof t.endTime==`number`&&(c=a==null?Math.floor(t.endTime*10)/10:t.endTime),l=t.values.find(function(e){return e.key==`X-RESTRICT`}),d=u=!0,l&&l.data&&(f=l.data,u=!f.includes(`SKIP`),d=!f.includes(`JUMP`)),p=u?0:null,(m=t.values.find(function(e){return e.key==`X-ENABLE-SKIP-AFTER`}))&&(h=m.data,p=parseFloat(h),isNaN(p)&&(p=u?0:null)),g=null,(_=t.values.find(function(e){return e.key==`X-ENABLE-SKIP-FOR`}))&&(v=_.data,g=parseFloat(v),isNaN(p)&&(g=null)),y=null,(b=t.values.find(function(e){return e.key==`X-RESUME-OFFSET`}))&&(x=b.data,y=parseFloat(x),isNaN(y)&&(y=null)),S=null,(C=t.values.find(function(e){return e.key==`X-PLAYOUT-LIMIT`}))&&(w=C.data,S=parseFloat(w),isNaN(S)&&(S=null)),D=E=T=!1,(O=t.values.find(function(e){return e.key==`CUE`}))&&(A=O.data,T=A.includes(`ONCE`),E=A.includes(`PRE`),D=A.includes(`POST`)),j=!1,(M=t.values.find(function(e){return e.key==`X-TIMELINE-OCCUPIES`}))?(ee=M.data,j=ee.includes(`RANGE`)):!b&&e.C.T()&&(j=!E&&!D),r){if(te=r.data,!te)return k.return(n);n.push({id:a,groupId:null,startTime:s,endTime:c,uri:te,mimeType:null,isSkippable:u,skipOffset:p,skipFor:g,canJump:d,resumeOffset:y,playoutLimit:S,once:T,pre:E,post:D,timelineRange:j,loop:!1,overlay:null,displayOnBackground:!1,currentVideo:null,background:null,clickThroughUrl:null}),k.A(2);break}if(!i){k.A(2);break}return N=i.data,N?(k.m(4),ne={type:11},k.g(Gg(e,N,ne),6)):k.return(n);case 6:for(re=k.i,P=pt(re),ie=JSON.parse(P),(ae=ie[`SKIP-CONTROL`])&&(oe=ae[`ENABLE-SKIP-AFTER`],typeof oe==`number`&&(p=parseFloat(oe),isNaN(oe)&&(p=u?0:null)),se=ae[`ENABLE-SKIP-FOR`],typeof se==`number`&&(g=parseFloat(se),isNaN(se)&&(g=null))),ce=0;ce<ie.ASSETS.length;ce++)F=ie.ASSETS[ce],F.URI&&n.push({id:a+`_shaka_asset_`+ce,groupId:a,startTime:s,endTime:c,uri:F.URI,mimeType:null,isSkippable:u,skipOffset:p,skipFor:g,canJump:d,resumeOffset:y,playoutLimit:S,once:T,pre:E,post:D,timelineRange:j,loop:!1,overlay:null,displayOnBackground:!1,currentVideo:null,background:null,clickThroughUrl:null});k.o(2);break;case 4:k.l();case 2:return k.return(n)}})}function Hg(e){var t=[];if(!e)return t;var n=e.values.find(function(e){return e.key==`X-ASSET-URI`});if(!n||(n=n.data,!n))return t;var r=null,i=e.values.find(function(e){return e.key==`X-OVERLAY-ID`});i&&(r=i.data),i=r==null?Math.floor(e.startTime*10)/10:e.startTime;var a=e.endTime;e.endTime&&e.endTime!=1/0&&typeof e.endTime==`number`&&(a=r==null?Math.floor(e.endTime*10)/10:e.endTime);var o=!1,s=!1,c=!1,l=e.values.find(function(e){return e.key==`CUE`});l&&(c=l.data,o=c.includes(`ONCE`),s=c.includes(`PRE`),c=c.includes(`POST`)),l=null;var u=e.values.find(function(e){return e.key==`X-ASSET-MIMETYPE`});u&&(l=u.data),u=!1;var d=e.values.find(function(e){return e.key==`X-LOOP`});d&&(u=d.data==`YES`),d=1;var f=e.values.find(function(e){return e.key==`X-DEPTH`});f&&(d=parseFloat(f.data),isNaN(d)&&(d=1)),f=null;var p=e.values.find(function(e){return e.key==`X-BACKGROUND`});p&&(f=p.data),p=1920;var m=1080,h=e.values.find(function(e){return e.key==`X-VIEWPORT`});if(h){if(m=h.data.split(`x`),m.length!=2)return t;p=parseFloat(m[0]),m=parseFloat(m[1])}if(p={viewport:{x:p,y:m},topLeft:{x:0,y:0},size:{x:p,y:m}},m=e.values.find(function(e){return e.key==`X-OVERLAY-POSITION`})){if(m=m.data.split(`x`),m.length!=2)return t;p.topLeft.x=parseFloat(m[0]),p.topLeft.y=parseFloat(m[1])}if(m=e.values.find(function(e){return e.key==`X-OVERLAY-SIZE`})){if(m=m.data.split(`x`),m.length!=2)return t;p.size.x=parseFloat(m[0]),p.size.y=parseFloat(m[1])}if(m=null,(h=e.values.find(function(e){return e.key==`X-SQUEEZECURRENT`}))&&(m=parseFloat(h.data),isNaN(m)&&(m=1),m={viewport:{x:1920,y:1080},topLeft:{x:0,y:0},size:{x:1920*m,y:1080*m}},e=e.values.find(function(e){return e.key==`X-SQUEEZECURRENT-POSITION`}))){if(e=e.data.split(`x`),e.length!=2)return t;m.topLeft.x=parseFloat(e[0]),m.topLeft.y=parseFloat(e[1])}return t.push({id:r,groupId:null,startTime:i,endTime:a,uri:n,mimeType:l,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!0,resumeOffset:null,playoutLimit:null,once:o,pre:s,post:c,timelineRange:!0,loop:u,overlay:p,displayOnBackground:d==-1,currentVideo:m,background:f,clickThroughUrl:null}),t}function Ug(e){for(var t=[],n=g(e.H),r=n.next(),i={};!r.done;i={xc:void 0},r=n.next())r=r.value,r.overlay||(i.xc={start:r.startTime,end:null},r.pre?(i.xc.start=0,i.xc.end=null):r.post?(i.xc.start=-1,i.xc.end=null):r.timelineRange&&(i.xc.end=r.endTime),t.find(function(e){return function(t){return e.xc.start==t.start&&e.xc.end==t.end}}(i))||t.push(i.xc));Xg(e,`ad-cue-points-changed`,(/* @__PURE__ */ new Map()).set(`cuepoints`,t))}function Wg(e){e.i.configure(e.C.gi()),e.i.configure(`ads.disableHLSInterstitial`,!0),e.i.configure(`ads.disableDASHInterstitial`,!0),e.i.configure(`playRangeEnd`,1/0),xa(e.C.Sb(),e.i.Sb())}function Gg(e,t,n){var r,i,a;return k(function(o){return o.h==1?(r=Sa([t],aa()),i=e.C.Sb().request(7,r,n),o.g(i.promise,2)):(a=o.i,o.return(a.data))})}function Kg(e){return!(e=e.mimeType)||!e.startsWith(`image/`)&&e!==`text/html`}function qg(){var e=we().Qa();return e==`TV`||e==`CONSOLE`||e==`CAST`}function Jg(e,t){if(!(e.K.has(t)||e.M&&!e.M.allowPreloadOnDomElements)){var n=function(e){var t=document.createElement(`link`);return t.rel=`preload`,t.href=e,t.as=`image`,document.head.appendChild(t),t},r=[];if(t.background){var i=t.background.match(/url\(('|")?([^'"()]+)('|")\)?/);i&&r.push(n(i[2]))}t.mimeType&&t.mimeType.startsWith(`image/`)&&r.push(n(t.uri)),e.K.set(t,r)}}function Yg(e,t){if(e.K.has(t)){var n=e.K.get(t);n=g(n);for(var r=n.next();!r.done;r=n.next())r=r.value,r.parentNode.removeChild(r);e.K.delete(t)}}function Xg(e,t,n){e.ua(new V(t,n))}function X(e,t,n,r,i){this.h=e,this.j=ln(this.h.skipOffset),this.g=i,this.i=t,this.l=n,this.o=r,this.m=!1}r=X.prototype,r.needsSkipUI=function(){return!0},r.isClientRendering=function(){return!1},r.hasCustomClick=function(){return!1},r.isUsingAnotherMediaElement=function(){return!1},r.getDuration=function(){return this.h.durationInSeconds},r.getMinSuggestedDuration=function(){return this.getDuration()},r.getRemainingTime=function(){return this.h.startTimeInSeconds+this.h.durationInSeconds-this.g.currentTime},r.isPaused=function(){return this.g.paused},r.isSkippable=function(){return typeof this.j==`number`},r.getTimeUntilSkippable=function(){if(typeof this.j!=`number`)return this.getRemainingTime();var e=this.getRemainingTime()+this.j-this.getDuration();return Math.max(e,0)},r.canSkipNow=function(){return this.getTimeUntilSkippable()==0},r.skip=function(){this.m=!0,this.g.currentTime+=this.getRemainingTime()},r.pause=function(){return this.g.pause()},r.play=function(){return this.g.play()},r.getVolume=function(){return this.g.volume},r.setVolume=function(e){this.g.volume=e},r.isMuted=function(){return this.g.muted},r.isLinear=function(){return this.o},r.resize=function(){},r.setMuted=function(e){this.g.muted=e},r.getSequenceLength=function(){return this.l?this.l:1},r.getPositionInSequence=function(){return this.i?this.i:1},r.getTitle=function(){return this.h.adTitle},r.getDescription=function(){return``},r.getVastMediaBitrate=function(){return 0},r.getVastMediaHeight=function(){return 0},r.getVastMediaWidth=function(){return 0},r.getVastAdId=function(){return this.h.vastAdId||``},r.getAdId=function(){return this.h.adId},r.getCreativeAdId=function(){return this.h.creativeId},r.getAdvertiserName=function(){return``},r.getMediaUrl=function(){return null},r.getTimeOffset=function(){return 0},r.getPodIndex=function(){return 0},r.release=function(){this.l=this.i=this.g=this.h=null},P(`shaka.ads.MediaTailorAd`,X),X.prototype.release=X.prototype.release,X.prototype.getPodIndex=X.prototype.getPodIndex,X.prototype.getTimeOffset=X.prototype.getTimeOffset,X.prototype.getMediaUrl=X.prototype.getMediaUrl,X.prototype.getAdvertiserName=X.prototype.getAdvertiserName,X.prototype.getCreativeAdId=X.prototype.getCreativeAdId,X.prototype.getAdId=X.prototype.getAdId,X.prototype.getVastAdId=X.prototype.getVastAdId,X.prototype.getVastMediaWidth=X.prototype.getVastMediaWidth,X.prototype.getVastMediaHeight=X.prototype.getVastMediaHeight,X.prototype.getVastMediaBitrate=X.prototype.getVastMediaBitrate,X.prototype.getDescription=X.prototype.getDescription,X.prototype.getTitle=X.prototype.getTitle,X.prototype.getPositionInSequence=X.prototype.getPositionInSequence,X.prototype.getSequenceLength=X.prototype.getSequenceLength,X.prototype.setMuted=X.prototype.setMuted,X.prototype.resize=X.prototype.resize,X.prototype.isLinear=X.prototype.isLinear,X.prototype.isMuted=X.prototype.isMuted,X.prototype.setVolume=X.prototype.setVolume,X.prototype.getVolume=X.prototype.getVolume,X.prototype.play=X.prototype.play,X.prototype.pause=X.prototype.pause,X.prototype.skip=X.prototype.skip,X.prototype.canSkipNow=X.prototype.canSkipNow,X.prototype.getTimeUntilSkippable=X.prototype.getTimeUntilSkippable,X.prototype.isSkippable=X.prototype.isSkippable,X.prototype.isPaused=X.prototype.isPaused,X.prototype.getRemainingTime=X.prototype.getRemainingTime,X.prototype.getMinSuggestedDuration=X.prototype.getMinSuggestedDuration,X.prototype.getDuration=X.prototype.getDuration,X.prototype.isUsingAnotherMediaElement=X.prototype.isUsingAnotherMediaElement,X.prototype.hasCustomClick=X.prototype.hasCustomClick,X.prototype.isClientRendering=X.prototype.isClientRendering,X.prototype.needsSkipUI=X.prototype.needsSkipUI;function Zg(e,t,n,r){this.C=e,this.K=t,this.h=n,this.l=null,this.R=NaN,this.i=r,this.J=!1,this.B=null,this.j=[],this.N=[],this.M=this.D=this.g=null,this.G=/* @__PURE__ */ new Map,this.m=[],this.u=[],this.H=``,this.O=!0,this.I=``,this.o=new I}Zg.prototype.stop=function(){for(var e=g(this.m),t=e.next();!t.done;t=e.next())t=t.value,this.o.Oa(t.target,t.type,t.listener);a_(this),this.m=[],this.u=[],this.H=``,this.O=!0,this.I=``,this.B=null,this.j=[],this.N=[],this.G.clear()},Zg.prototype.release=function(){this.stop(),this.o&&this.o.release()},Zg.prototype.onManifestUpdated=function(e){this.J=e,this.H!=``&&($g(this,this.H,this.O),this.O=!1)},Zg.prototype.getCuePoints=function(){for(var e=[],t=g(this.j),n=t.next();!n.done;n=t.next()){n=g(n.value.ads);for(var r=n.next();!r.done;r=n.next())r=r.value,e.push({start:r.startTimeInSeconds,end:r.startTimeInSeconds+r.durationInSeconds})}return e};function Qg(e,t,n){var r,i,a,o,s,c,l,u,d,f,p,m;k(function(h){if(h.h==1)return r={type:7},i=Sa([t],aa()),i.method=`POST`,n&&(a=JSON.stringify(n),i.body=gt(a)),o=e.K.request(7,i,r),h.m(2),h.g(o.promise,4);if(h.h!=2){if(s=h.i,c=pt(s.data),l=JSON.parse(c),l.manifestUrl&&l.trackingUrl)u=new Ne(t),d=new Ne(l.trackingUrl),e.H=u.resolve(d).toString(),f=Date.now()/1e3,p=f-e.R,e.i(new V(`ads-loaded`,(/* @__PURE__ */ new Map()).set(`loadTime`,p))),m=new Ne(l.manifestUrl),e.l.resolve(u.resolve(m).toString()),e.l=null;else throw Error(`Insufficient data from MediaTailor.`);return h.o(0)}if(h.l(),!e.I.length)return e.l.reject(`MediaTailor request returned an error and there was no backup asset uri provided.`),e.l=null,h.return();e.l.resolve(e.I),e.l=null,h.j()})}function $g(e,t,n){var r,i,a,o,s,c,l,u,d,f,p,m,h,_,v,y;k(function(b){if(b.h==1)return r={type:8},i=Sa([t],aa()),a=e.K.request(7,i,r),b.m(2),b.g(a.promise,4);if(b.h!=2){if(o=b.i,s=[],c=pt(o.data),l=JSON.parse(c),l.avails.length>0){if(JSON.stringify(e.j)!=JSON.stringify(l.avails)){for(e.j=l.avails,u=g(e.j),d=u.next();!d.done;d=u.next())for(f=d.value,p=g(f.nonLinearAdsList),m=p.next();!m.done;m=p.next())for(h=m.value,_=g(h.nonLinearAdList),v=_.next();!v.done;v=_.next())y=v.value,e_(e,y);s=e.getCuePoints(),e.i(new V(`ad-cue-points-changed`,(/* @__PURE__ */ new Map()).set(`cuepoints`,s)))}}else e.j.length&&e.i(new V(`ad-cue-points-changed`,(/* @__PURE__ */ new Map()).set(`cuepoints`,s))),a_(e),e.j=[];return n&&(e.J||s.length>0)&&n_(e),b.o(0)}b.l(),b.j()})}function e_(e,t){var n,r,i,a,o,s,c,l;k(function(u){if(u.h==1)return!t.staticResource||(n=t_(t),e.G.get(n))?u.return():(r={type:9},i=Sa([t.staticResource],aa()),a=e.K.request(7,i,r),u.m(2),e.G.set(n,[]),u.g(a.promise,4));if(u.h!=2)return o=u.i,s=pt(o.data),c=JSON.parse(s),l=c.apps,e.G.set(n,l),u.o(0);u.l(),e.G.delete(n),u.j()})}function t_(e){return[e.adId,e.adParameters,e.adSystem,e.adTitle,e.creativeAdId,e.creativeId,e.creativeSequence,e.height,e.width,e.staticResource].join(``)}function n_(e){i_(e),e.J||(r_(e),e.o.F(e.h,`seeked`,function(){r_(e)}),e.o.F(e.h,`ended`,function(){a_(e)})),e.o.F(e.h,`timeupdate`,function(){i_(e)})}function r_(e){var t=e.h.currentTime;if(t!=0&&e.B==null){for(var n,r,i=g(e.j),a=i.next();!a.done;a=i.next()){a=a.value;for(var o=g(a.ads),s=o.next();!s.done;s=o.next())if(s=s.value,!r)s.startTimeInSeconds<t&&(r=s,n=a);else if(s.startTimeInSeconds<t&&s.startTimeInSeconds>r.startTimeInSeconds+r.durationInSeconds){r=s,n=a;break}}n&&r&&!e.N.includes(r.adId)&&(e.B=t,e.h.currentTime=n.startTimeInSeconds)}}function i_(e){if(e.h.duration&&(e.g||e.j.length)){var t=e.h.currentTime,n=!1;if(e.g){n=!0;var r=e.D,i=r.startTimeInSeconds+.5*r.durationInSeconds,a=r.startTimeInSeconds+.75*r.durationInSeconds;t>=r.startTimeInSeconds+.25*r.durationInSeconds&&!e.u.includes(`firstQuartile`)?(e.u.push(`firstQuartile`),s_(e,`firstQuartile`)):t>=i&&!e.u.includes(`midpoint`)?(e.u.push(`midpoint`),s_(e,`midpoint`)):t>=a&&!e.u.includes(`thirdQuartile`)&&(e.u.push(`thirdQuartile`),s_(e,`thirdQuartile`)),r=e.g.getRemainingTime(),i=e.g.getDuration(),e.g.canSkipNow()&&r>0&&i>0&&s_(e,`skipStateChanged`),i>0&&(r<=0||r>i)&&a_(e)}if(!e.g||!e.g.isLinear()){a:for(r=g(e.j),i=r.next();!i.done&&(i=i.value,!(e.g&&e.g.isLinear()));i=r.next())for(a=0;a<i.ads.length;a++){var o=i.ads[a],s=o.startTimeInSeconds+o.durationInSeconds;if(o.startTimeInSeconds<=t&&s>t){if(e.N.includes(o.adId)){if(e.h.ended)continue;e.h.currentTime=s;break a}a_(e),e.M=i,e.g=new X(o,a+1,i.ads.length,!0,e.h),e.D=o,a===0&&s_(e,`breakStart`),o_(e);break}}if(!e.g){for(r=g(e.j),i=r.next();!i.done&&(i=i.value,!e.g);i=r.next())for(a=0;a<i.nonLinearAdsList.length;a++)if(o=i.nonLinearAdsList[a],o.nonLinearAdList.length){s=i.startTimeInSeconds;var c=e.G.get(t_(o.nonLinearAdList[0]));if(s<=t&&c&&c.length){a_(e),s=e,c=g(c);for(var l=c.next();!l.done;l=c.next())if(l=l.value,l.data.source.length){var u=document.createElement(`img`);u.src=l.data.source[0].url,u.style.top=(l.placeholder.top||0)+`%`,u.style.height=100-(l.placeholder.top||0)+`%`,u.style.left=(l.placeholder.left||0)+`%`,u.style.maxWidth=100-(l.placeholder.left||0)+`%`,u.style.objectFit=`contain`,u.style.position=`absolute`,s.C.appendChild(u)}e.M=i,e.g=new X(o,a+1,i.ads.length,!1,e.h),e.D=o,a===0&&s_(e,`breakStart`),o_(e);break}}}n&&!e.g&&(t=e.h.currentTime,e.B&&e.B>t&&(e.h.currentTime=e.B),e.B=null)}}}function a_(e){if(e.g){for(;e.C.lastChild;)e.C.removeChild(e.C.firstChild);e.J||e.N.push(e.D.adId);var t=e.g.m;t!==void 0&&t?s_(e,`skip`):s_(e,`complete`),t=g(e.m);for(var n=t.next();!n.done;n=t.next())n=n.value,e.o.Oa(n.target,n.type,n.listener);e.m=[],e.u=[],t=e.g.getPositionInSequence(),n=e.g.getSequenceLength(),t===n&&s_(e,`breakEnd`),e.g=null,e.D=null,e.M=null}}function o_(e){var t=!1;e.h.paused?t=!0:(s_(e,`impression`),s_(e,`start`)),e.m.push({target:e.h,type:`volumechange`,listener:function(){e.h.muted&&s_(e,`mute`)}}),e.m.push({target:e.h,type:`volumechange`,listener:function(){e.h.muted||s_(e,`unmute`)}}),e.m.push({target:e.h,type:`play`,listener:function(){t?(s_(e,`impression`),s_(e,`start`),t=!1):s_(e,`resume`)}}),e.m.push({target:e.h,type:`pause`,listener:function(){s_(e,`pause`)}});for(var n=g(e.m),r=n.next();!r.done;r=n.next())r=r.value,e.o.F(r.target,r.type,r.listener)}function s_(e,t){var n=e.D.trackingEvents.find(function(e){return e.eventType==t});if(n||(n=e.M.adBreakTrackingEvents.find(function(e){return e.eventType==t})),n){var r={type:10};n=g(n.beaconUrls);for(var i=n.next();!i.done;i=n.next())(i=i.value)&&i!=``&&(i=Sa([i],aa()),i.method=`POST`,e.K.request(7,i,r))}switch(t){case`impression`:e.i(new V(`ad-impression`));break;case`start`:e.i(new V(`ad-started`,(/* @__PURE__ */ new Map()).set(`ad`,e.g)));break;case`mute`:e.i(new V(`ad-muted`));break;case`unmute`:e.i(new V(`ad-volume-changed`));break;case`resume`:e.i(new V(`ad-resumed`));break;case`pause`:e.i(new V(`ad-paused`));break;case`firstQuartile`:e.i(new V(`ad-first-quartile`));break;case`midpoint`:e.i(new V(`ad-midpoint`));break;case`thirdQuartile`:e.i(new V(`ad-third-quartile`));break;case`complete`:e.i(new V(`ad-complete`)),e.i(new V(`ad-stopped`));break;case`skip`:e.i(new V(`ad-skipped`)),e.i(new V(`ad-stopped`));break;case`breakStart`:e.C.setAttribute(`ad-active`,`true`);break;case`breakEnd`:e.C.removeAttribute(`ad-active`);break;case`skipStateChanged`:e.i(new V(`ad-skip-state-changed`))}}function Z(e,t){this.g=e,this.i=null,this.h=t}r=Z.prototype,r.needsSkipUI=function(){return!0},r.isClientRendering=function(){return!1},r.hasCustomClick=function(){return!0},r.isUsingAnotherMediaElement=function(){return!1},r.getDuration=function(){return this.i?this.i.duration:-1},r.getMinSuggestedDuration=function(){return this.getDuration()},r.getRemainingTime=function(){return this.i?this.i.duration-this.i.currentTime:-1},r.isPaused=function(){return this.h.paused},r.isSkippable=function(){return this.g.isSkippable()},r.getTimeUntilSkippable=function(){var e=this.g.getSkipTimeOffset();return e=this.getRemainingTime()-e,Math.max(e,0)},r.canSkipNow=function(){return this.getTimeUntilSkippable()==0},r.skip=function(){this.h.currentTime+=this.getRemainingTime()},r.pause=function(){return this.h.pause()},r.play=function(){return this.h.play()},r.getVolume=function(){return this.h.volume},r.setVolume=function(e){this.h.volume=e},r.isMuted=function(){return this.h.muted},r.isLinear=function(){return!0},r.resize=function(){},r.setMuted=function(e){this.h.muted=e},r.getSequenceLength=function(){var e=this.g.getAdPodInfo();return e==null?1:e.getTotalAds()},r.getPositionInSequence=function(){var e=this.g.getAdPodInfo();return e==null?1:e.getAdPosition()},r.getTitle=function(){return this.g.getTitle()},r.getDescription=function(){return this.g.getDescription()},r.getVastMediaBitrate=function(){return 0},r.getVastMediaHeight=function(){return this.g.getVastMediaHeight()},r.getVastMediaWidth=function(){return this.g.getVastMediaWidth()},r.getVastAdId=function(){return``},r.getAdId=function(){return this.g.getAdId()},r.getCreativeAdId=function(){return this.g.getCreativeAdId()},r.getAdvertiserName=function(){return this.g.getAdvertiserName()},r.getMediaUrl=function(){return null},r.getTimeOffset=function(){var e=this.g.getAdPodInfo();return e==null?0:e.getTimeOffset()},r.getPodIndex=function(){var e=this.g.getAdPodInfo();return e==null?0:e.getPodIndex()},r.release=function(){this.h=this.i=this.g=null},P(`shaka.ads.ServerSideAd`,Z),Z.prototype.release=Z.prototype.release,Z.prototype.getPodIndex=Z.prototype.getPodIndex,Z.prototype.getTimeOffset=Z.prototype.getTimeOffset,Z.prototype.getMediaUrl=Z.prototype.getMediaUrl,Z.prototype.getAdvertiserName=Z.prototype.getAdvertiserName,Z.prototype.getCreativeAdId=Z.prototype.getCreativeAdId,Z.prototype.getAdId=Z.prototype.getAdId,Z.prototype.getVastAdId=Z.prototype.getVastAdId,Z.prototype.getVastMediaWidth=Z.prototype.getVastMediaWidth,Z.prototype.getVastMediaHeight=Z.prototype.getVastMediaHeight,Z.prototype.getVastMediaBitrate=Z.prototype.getVastMediaBitrate,Z.prototype.getDescription=Z.prototype.getDescription,Z.prototype.getTitle=Z.prototype.getTitle,Z.prototype.getPositionInSequence=Z.prototype.getPositionInSequence,Z.prototype.getSequenceLength=Z.prototype.getSequenceLength,Z.prototype.setMuted=Z.prototype.setMuted,Z.prototype.resize=Z.prototype.resize,Z.prototype.isLinear=Z.prototype.isLinear,Z.prototype.isMuted=Z.prototype.isMuted,Z.prototype.setVolume=Z.prototype.setVolume,Z.prototype.getVolume=Z.prototype.getVolume,Z.prototype.play=Z.prototype.play,Z.prototype.pause=Z.prototype.pause,Z.prototype.skip=Z.prototype.skip,Z.prototype.canSkipNow=Z.prototype.canSkipNow,Z.prototype.getTimeUntilSkippable=Z.prototype.getTimeUntilSkippable,Z.prototype.isSkippable=Z.prototype.isSkippable,Z.prototype.isPaused=Z.prototype.isPaused,Z.prototype.getRemainingTime=Z.prototype.getRemainingTime,Z.prototype.getMinSuggestedDuration=Z.prototype.getMinSuggestedDuration,Z.prototype.getDuration=Z.prototype.getDuration,Z.prototype.isUsingAnotherMediaElement=Z.prototype.isUsingAnotherMediaElement,Z.prototype.hasCustomClick=Z.prototype.hasCustomClick,Z.prototype.isClientRendering=Z.prototype.isClientRendering,Z.prototype.needsSkipUI=Z.prototype.needsSkipUI;function c_(e,t,n,r){var i=this;this.u=e,this.l=t,this.j=null,this.G=NaN,this.i=r,this.H=!1,this.B=this.m=this.o=null,this.C=``,this.D=[],this.h=new I,e=new google.ima.dai.api.UiSettings,e.setLocale(n),this.g=new google.ima.dai.api.StreamManager(this.l,this.u,e),this.i(new V(`ima-stream-manager-loaded`,(/* @__PURE__ */ new Map()).set(`imaStreamManager`,this.g))),this.h.F(this.g,google.ima.dai.api.StreamEvent.Type.LOADED,function(e){l_(i,e)}),this.h.F(this.g,google.ima.dai.api.StreamEvent.Type.ERROR,function(){i.C.length?i.j.resolve(i.C):i.j.reject(`IMA Stream request returned an error and there was no backup asset uri provided.`),i.j=null}),this.h.F(this.g,google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED,function(){}),this.h.F(this.g,google.ima.dai.api.StreamEvent.Type.STARTED,function(e){e=e.getAd(),i.m=new Z(e,i.l),i.B&&(i.m.i=i.B),i.i(new V(`ad-started`,(/* @__PURE__ */ new Map()).set(`ad`,i.m))),i.u.setAttribute(`ad-active`,`true`)}),this.h.F(this.g,google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED,function(){i.u.removeAttribute(`ad-active`);var e=i.l.currentTime;i.o&&i.o>e&&(i.l.currentTime=i.o,i.o=null)}),this.h.F(this.g,google.ima.dai.api.StreamEvent.Type.AD_PROGRESS,function(e){i.B=e.getStreamData().adProgressData,i.m&&(i.m.i=i.B)}),this.h.F(this.g,google.ima.dai.api.StreamEvent.Type.FIRST_QUARTILE,function(){i.i(new V(`ad-first-quartile`))}),this.h.F(this.g,google.ima.dai.api.StreamEvent.Type.MIDPOINT,function(){i.i(new V(`ad-midpoint`))}),this.h.F(this.g,google.ima.dai.api.StreamEvent.Type.THIRD_QUARTILE,function(){i.i(new V(`ad-third-quartile`))}),this.h.F(this.g,google.ima.dai.api.StreamEvent.Type.COMPLETE,function(){i.i(new V(`ad-complete`)),i.i(new V(`ad-stopped`)),i.u.removeAttribute(`ad-active`),i.m=null}),this.h.F(this.g,google.ima.dai.api.StreamEvent.Type.SKIPPED,function(){i.i(new V(`ad-skipped`)),i.i(new V(`ad-stopped`))}),this.h.F(this.g,google.ima.dai.api.StreamEvent.Type.CUEPOINTS_CHANGED,function(e){var t=e.getStreamData();e=[],t=g(t.cuepoints);for(var n=t.next();!n.done;n=t.next())n=n.value,e.push({start:n.start,end:n.end});i.D=e,i.i(new V(`ad-cue-points-changed`,(/* @__PURE__ */ new Map()).set(`cuepoints`,e)))})}r=c_.prototype,r.configure=function(){},r.stop=function(){this.C=``,this.o=null,this.D=[]},r.release=function(){this.stop(),this.h&&this.h.release()},r.onCueMetadataChange=function(e){if(e.key&&e.data){var t={};t[e.key]=e.data,this.g.onTimedMetadata(t)}},r.getCuePoints=function(){return this.D};function l_(e,t){e.i(new V(`ads-loaded`,(/* @__PURE__ */ new Map()).set(`loadTime`,Date.now()/1e3-e.G))),t=t.getStreamData().url,e.j.resolve(t),e.j=null,e.H||e.h.F(e.l,`seeked`,function(){var t=e.l.currentTime;if(t!=0){e.g.streamTimeForContentTime(t);var n=e.g.previousCuePointForStreamTime(t);n&&!n.played&&(e.o=t,e.l.currentTime=n.start)}})}function Q(){ga.call(this),this.h=this.i=this.j=this.g=null,this.m=new gg,this.o=navigator.language,this.l=null}m(Q,ga),r=Q.prototype,r.setLocale=function(e){this.o=e},r.configure=function(e){this.l=e,this.g&&this.g.configure(this.l),this.j&&this.j.configure(this.l),this.h&&this.h.configure(this.l)},r.initInterstitial=function(e,t,n){var r=this;this.g&&this.g.release(),this.g=new Og(e,t,n,function(e){return u_(r,e)}),this.g.configure(this.l)},r.initClientSide=function(t,n,r){var i=this;if(!e.google||!google.ima||!google.ima.AdsLoader)throw new R(2,10,1e4);this.j&&this.j.release(),this.j=new Sg(t,n,this.o,r,function(e){return u_(i,e)}),this.j.configure(this.l)},r.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),ga.prototype.release.call(this)},r.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 V(`ad-stopped`)),this.dispatchEvent(new V(`ad-content-attach-requested`)),this.m=new gg},r.requestClientSideAds=function(e){if(!this.j)throw new R(1,10,10001);var t=this.j;t.g&&t.g.destroy(),t.m&&t.m.contentComplete(),t.H=Date.now()/1e3,t.m.requestAds(e)},r.updateClientSideAdsRenderingSettings=function(e){if(!this.j)throw new R(1,10,10001);var t=this.j;t.C=e,t.g&&t.g.updateAdsRenderingSettings(t.C)},r.initMediaTailor=function(e,t,n){var r=this;this.i&&this.i.release(),this.i=new Zg(e,t,n,function(e){return u_(r,e)})},r.requestMediaTailorStream=function(e,t,n){if(!this.i)throw new R(1,10,10005);var r=this.i;return n=n===void 0?``:n,r.l?e=Promise.reject(new R(1,10,10004)):(r.l=new oa,Qg(r,e,t),r.I=n||``,r.R=Date.now()/1e3,e=r.l),e},r.addMediaTailorTrackingUrl=function(e){if(!this.i)throw new R(1,10,10005);var t=this.i;t.H=e,t.i(new V(`ads-loaded`,(/* @__PURE__ */ new Map()).set(`loadTime`,0)))},r.initServerSide=function(t,n){var r=this;if(!e.google||!google.ima||!google.ima.dai)throw new R(2,10,10002);this.h&&this.h.release(),this.h=new c_(t,n,this.o,function(e){return u_(r,e)}),this.h.configure(this.l)},r.requestServerSideStream=function(e,t){if(t=t===void 0?``:t,!this.h)throw new R(1,10,10003);e.adTagParameters||(e.adTagParameters={});var n=e.adTagParameters;return(n.mpt||n.mpv)&&F(`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.`),e.adTagParameters.mpt=`shaka-player`,e.adTagParameters.mpv=`v4.16.42`,n=this.h,n.j?e=Promise.reject(new R(1,10,10004)):(e instanceof google.ima.dai.api.LiveStreamRequest&&(n.H=!0),n.j=new oa,n.g.requestStream(e),n.C=t||``,n.G=Date.now()/1e3,e=n.j),e},r.replaceServerSideAdTagParameters=function(e){if(!this.h)throw new R(1,10,10003);(e.mpt||e.mpv)&&F(`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.`),e.mpt=`Shaka Player`,e.mpv=`v4.16.42`,this.h.g.replaceAdTagParameters(e)},r.getServerSideCuePoints=function(){return L(`AdManager.getServerSideCuePoints`,`Please use getCuePoints function.`),this.getCuePoints()},r.getCuePoints=function(){var e=[];return this.h&&(e=e.concat(this.h.getCuePoints())),this.i&&(e=e.concat(this.i.getCuePoints())),e},r.getStats=function(){var e=this.m;return{loadTimes:e.g,averageLoadTime:_g(e),started:e.h,overlayAds:e.j,playedCompletely:e.l,skipped:e.m,errors:e.i}},r.onManifestUpdated=function(e){this.i&&this.i.onManifestUpdated(e)},r.onDashTimedMetadata=function(e){this.h&&e.schemeIdUri==`urn:google:dai:2018`&&this.h.g.processMetadata(e.schemeIdUri,e.eventNode?e.eventNode.attributes.messageData:null,e.startTime)},r.onHlsTimedMetadata=function(e,t){this.h&&this.h.g.processMetadata(`ID3`,e.data,t)},r.onCueMetadataChange=function(e){this.h&&this.h.onCueMetadataChange(e)},r.onHLSInterstitialMetadata=function(e,t,n){this.l&&this.l.disableHLSInterstitial||(this.g||this.initInterstitial(null,e,t),this.g&&Mg(this.g,n))},r.onDASHInterstitialMetadata=function(e,t,n){if(!this.l||!this.l.disableDASHInterstitial){var r=n.schemeIdUri;if(r==`urn:mpeg:dash:event:alternativeMPD:insert:2025`||r==`urn:mpeg:dash:event:alternativeMPD:replace:2025`){if(this.g||this.initInterstitial(null,e,t),this.g&&(e=this.g,t=n.schemeIdUri==`urn:mpeg:dash:event:alternativeMPD:replace:2025`,r=n.schemeIdUri==`urn:mpeg:dash:event:alternativeMPD:insert:2025`,t||r)){for(var i=n.startTime,a=n.endTime,o=null,s=0,c,l=g(n.eventNode.children),u=l.next();!u.done;u=l.next())if(u=u.value,u.tagName==`AlternativeMPD`){if(u=u.attributes.uri){c=u;break}}else if(u.tagName==`InsertPresentation`||u.tagName==`ReplacePresentation`){var d=u.attributes.uri||u.attributes.url;if(d){c=vt(d),(l=B(u,`maxDuration`,Nn))&&(o=l/n.timescale),(l=B(u,`returnOffset`,Nn))&&(s=l/n.timescale),t&&s&&(a=i+s);break}}c&&Pg(e,[{id:n.id,groupId:null,startTime:i,endTime:a,uri:c,mimeType:null,isSkippable:!1,skipOffset:null,skipFor:null,canJump:!0,resumeOffset:r?s:null,playoutLimit:o,once:!1,pre:!1,post:!1,timelineRange:t&&!r,loop:!1,overlay:null,displayOnBackground:!1,currentVideo:null,background:null,clickThroughUrl:null}])}}else(r==`urn:mpeg:dash:event:2012`||r==`urn:scte:dash:scte214-events`)&&n.eventNode&&Tn(n.eventNode,`OverlayEvent`)&&(this.g||this.initInterstitial(null,e,t),this.g&&Ng(this.g,n))}},r.addCustomInterstitial=function(e){if(!this.g)throw new R(1,10,10006);Pg(this.g,[e])},r.addAdUrlInterstitial=function(e){if(!this.g)throw new R(1,10,10006);return this.g.addAdUrlInterstitial(e)},r.getInterstitialPlayer=function(){if(!this.g)throw new R(1,10,10006);return this.g.nd()};function u_(e,t){if(t&&t.type)switch(t.type){case`ads-loaded`:e.m.g.push(t.loadTime);break;case`ad-started`:e.m.h++;var n=t.ad;n&&!n.isLinear()&&e.m.j++;break;case`ad-complete`:e.m.l++;break;case`ad-skipped`:e.m.m++;break;case`ad-error`:e.m.i++}e.dispatchEvent(t)}P(`shaka.ads.AdManager`,Q),Q.prototype.getInterstitialPlayer=Q.prototype.getInterstitialPlayer,Q.prototype.addAdUrlInterstitial=Q.prototype.addAdUrlInterstitial,Q.prototype.addCustomInterstitial=Q.prototype.addCustomInterstitial,Q.prototype.onDASHInterstitialMetadata=Q.prototype.onDASHInterstitialMetadata,Q.prototype.onHLSInterstitialMetadata=Q.prototype.onHLSInterstitialMetadata,Q.prototype.onCueMetadataChange=Q.prototype.onCueMetadataChange,Q.prototype.onHlsTimedMetadata=Q.prototype.onHlsTimedMetadata,Q.prototype.onDashTimedMetadata=Q.prototype.onDashTimedMetadata,Q.prototype.onManifestUpdated=Q.prototype.onManifestUpdated,Q.prototype.getStats=Q.prototype.getStats,Q.prototype.getCuePoints=Q.prototype.getCuePoints,Q.prototype.getServerSideCuePoints=Q.prototype.getServerSideCuePoints,Q.prototype.replaceServerSideAdTagParameters=Q.prototype.replaceServerSideAdTagParameters,Q.prototype.requestServerSideStream=Q.prototype.requestServerSideStream,Q.prototype.initServerSide=Q.prototype.initServerSide,Q.prototype.addMediaTailorTrackingUrl=Q.prototype.addMediaTailorTrackingUrl,Q.prototype.requestMediaTailorStream=Q.prototype.requestMediaTailorStream,Q.prototype.initMediaTailor=Q.prototype.initMediaTailor,Q.prototype.updateClientSideAdsRenderingSettings=Q.prototype.updateClientSideAdsRenderingSettings,Q.prototype.requestClientSideAds=Q.prototype.requestClientSideAds,Q.prototype.onAssetUnload=Q.prototype.onAssetUnload,Q.prototype.release=Q.prototype.release,Q.prototype.initClientSide=Q.prototype.initClientSide,Q.prototype.initInterstitial=Q.prototype.initInterstitial,Q.prototype.configure=Q.prototype.configure,Q.prototype.setLocale=Q.prototype.setLocale,Q.ADS_LOADED=`ads-loaded`,Q.AD_STARTED=`ad-started`,Q.AD_FIRST_QUARTILE=`ad-first-quartile`,Q.AD_MIDPOINT=`ad-midpoint`,Q.AD_THIRD_QUARTILE=`ad-third-quartile`,Q.AD_COMPLETE=`ad-complete`,Q.AD_STOPPED=`ad-stopped`,Q.AD_SKIPPED=`ad-skipped`,Q.AD_VOLUME_CHANGED=`ad-volume-changed`,Q.AD_MUTED=`ad-muted`,Q.AD_PAUSED=`ad-paused`,Q.AD_RESUMED=`ad-resumed`,Q.AD_SKIP_STATE_CHANGED=`ad-skip-state-changed`,Q.CUEPOINTS_CHANGED=`ad-cue-points-changed`,Q.IMA_AD_MANAGER_LOADED=`ima-ad-manager-loaded`,Q.IMA_STREAM_MANAGER_LOADED=`ima-stream-manager-loaded`,Q.AD_CLICKED=`ad-clicked`,Q.AD_PROGRESS=`ad-progress`,Q.AD_BUFFERING=`ad-buffering`,Q.AD_IMPRESSION=`ad-impression`,Q.AD_DURATION_CHANGED=`ad-duration-changed`,Q.AD_CLOSED=`ad-closed`,Q.AD_LOADED=`ad-loaded`,Q.ALL_ADS_COMPLETED=`all-ads-completed`,Q.AD_LINEAR_CHANGED=`ad-linear-changed`,Q.AD_METADATA=`ad-metadata`,Q.AD_RECOVERABLE_ERROR=`ad-recoverable-error`,Q.AD_ERROR=`ad-error`,Q.AD_BREAK_READY=`ad-break-ready`,Q.AD_INTERACTION=`ad-interaction`,Q.AD_CONTENT_PAUSE_REQUESTED=`ad-content-pause-requested`,Q.AD_CONTENT_RESUME_REQUESTED=`ad-content-resume-requested`,Q.AD_CONTENT_ATTACH_REQUESTED=`ad-content-attach-requested`,mg=function(){return new Q};function d_(e){return JSON.stringify(e,function(e,t){if(typeof t!=`function`){if(e=t instanceof V,t instanceof Event||e){var n={};for(i in t){var r=t[i];r&&typeof r==`object`?i==`detail`?n[i]=r:r instanceof Event||r instanceof V?n[i]={__type__:`Event`,event:d_(r)}:e&&Array.isArray(r)&&(n[i]=r):i in Event||(n[i]=r)}return n}if(t instanceof Error){var i=/* @__PURE__ */ new Set([`name`,`message`,`stack`]);for(n in t)i.add(n);for(e=g(Object.getOwnPropertyNames(t)),n=e.next();!n.done;n=e.next())i.add(n.value);for(e={},i=g(i),n=i.next();!n.done;n=i.next())n=n.value,e[n]=t[n];t={__type__:`Error`,contents:e}}else if(t instanceof TimeRanges){for(i={__type__:`TimeRanges`,length:t.length,start:[],end:[]},t=g(rc(t)),e=t.next();!e.done;e=t.next())e=e.value,n=e.end,i.start.push(e.start),i.end.push(n);t=i}else t=ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1?{__type__:`Uint8Array`,entries:Array.from(t)}:typeof t==`number`?isNaN(t)?`NaN`:isFinite(t)?t:t<0?`-Infinity`:`Infinity`:t;return t}})}function f_(e){return JSON.parse(e,function(e,t){if(t==`NaN`)var n=NaN;else if(t==`-Infinity`)n=-1/0;else if(t==`Infinity`)n=1/0;else if(t&&typeof t==`object`&&t.__type__==`TimeRanges`)n=p_(t);else if(t&&typeof t==`object`&&t.__type__==`Uint8Array`)n=new Uint8Array(t.entries);else if(t&&typeof t==`object`&&t.__type__==`Error`){for(n in e=t.contents,t=Error(e.message),e)t[n]=e[n];n=t}else n=t&&typeof t==`object`&&t.__type__==`Event`?f_(t.event):t;return n})}function p_(e){return{length:e.length,start:function(t){return e.start[t]},end:function(t){return e.end[t]}}}var m_=`ended play playing pause pausing ratechange seeked seeking timeupdate volumechange`.split(` `),h_=`buffered currentTime duration ended loop muted paused playbackRate seeking videoHeight videoWidth volume`.split(` `),g_=[`loop`,`playbackRate`],__=[`pause`,`play`],v_=(/* @__PURE__ */ 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).set(`getBandwidthEstimate`,1).set(`isRemotePlayback`,1),y_=(/* @__PURE__ */ 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),b_=(/* @__PURE__ */ new Map()).set(`getPlayheadTimeAsDate`,1).set(`getPresentationStartTimeAsDate`,20).set(`getSegmentAvailabilityDuration`,20),x_=[[`getConfiguration`,`configure`,`getConfigurationForLowLatency`,`configurationForLowLatency`]],S_=[[`isTextTrackVisible`,`setTextTrackVisibility`]],C_=`cancelTrickPlay configure configurationForLowLatency getChapters resetConfiguration retryStreaming selectAudioLanguage selectAudioTrack selectTextLanguage selectTextTrack selectVariantTrack selectVariantsByLabel selectVideoTrack setTextTrackVisibility trickPlay updateStartTime goToLive useTrickPlayTrackIfAvailable`.split(` `),w_=`addChaptersTrack addTextTrackAsync addThumbnailsTrack getAllThumbnails getChaptersAsync getThumbnails attach attachCanvas detach load unload`.split(` `);function T_(e,t,n,r,i,a,o){var s=this;this.H=e,this.K=o,this.l=new Qr(t),this.M=n,this.u=!1,this.B=r,this.G=i,this.N=a,this.i=this.m=!1,this.J=``,this.o=null,this.C=function(){return A_(s)},this.D=function(e,t){switch(e=f_(t),e.type){case`event`:var n=e.targetName,r=ma(e.event);s.B(n,r);break;case`update`:for(r in n=e.update,n)for(var i in e=s.g[r]||{},n[r])e[i]=n[r][i];s.u&&(s.M(),s.u=!1);break;case`asyncComplete`:if(i=e.id,r=e.error,t=e.res,e=s.h.get(i),s.h.delete(i),e){if(r){for(n in i=new R(r.severity,r.category,r.code),r)i[n]=r[n];e.reject(i)}else e.resolve(t)}}},this.g={video:{},player:{}},this.I=0,this.h=/* @__PURE__ */ new Map,this.j=null,L_.add(this)}r=T_.prototype,r.destroy=function(){return L_.delete(this),j_(this),F_&&k_(this),this.l&&(this.l.stop(),this.l=null),this.G=this.B=null,this.i=this.m=!1,this.D=this.C=this.j=this.h=this.g=this.o=null,Promise.resolve()},r.sb=function(){return this.i},r.bh=function(){return this.J},r.init=function(){if(this.H.length){if(e.chrome&&chrome.cast&&chrome.cast.isAvailable){this.m=!0,this.l.yb();var t=new chrome.cast.SessionRequest(this.H,[],null,this.K,null);t=new chrome.cast.ApiConfig(t,function(e){for(var t=g(L_),n=t.next();!n.done;n=t.next()){n=n.value;var r=e;n.j=new oa,n.u=!0,D_(n,r)}},function(e){for(var t=g(L_),n=t.next();!n.done;n=t.next())n=n.value,P_=e==`available`,n.l.yb()},`origin_scoped`),chrome.cast.initialize(t,function(){},function(){}),P_&&this.l.na(N_),(t=F_)&&t.status!=chrome.cast.SessionStatus.STOPPED?(this.j=new oa,this.u=!0,D_(this,t)):F_=null}else e.__onGCastApiAvailable!==R_&&(I_=e.__onGCastApiAvailable||null,e.__onGCastApiAvailable=R_)}},r.ph=function(e){this.o=e,this.i&&M_(this,{type:`appData`,appData:this.o})},r.cast=function(){var e=this;return k(function(t){if(!e.m)throw new R(1,8,8e3);if(!P_)throw new R(1,8,8001);if(e.i)throw new R(1,8,8002);return e.j=new oa,chrome.cast.requestSession(function(t){return D_(e,t)},function(t){return O_(e,t)}),t.g(e.j,0)})};function E_(e){e.i&&chrome.cast.requestSession(function(t){return D_(e,t)},function(t){return O_(e,t)})}r.jd=function(){if(this.i){if(j_(this),F_){k_(this);try{F_.stop(function(){},function(){})}catch{}F_=null}A_(this)}},r.get=function(e,t){var n=this;if(e==`video`){if(__.includes(t))return function(){return n.Ii.apply(n,[e,t].concat(_(A.apply(0,arguments))))}}else if(e==`player`){if(b_.has(t)&&!this.get(`player`,`isLive`)())return function(){};if(C_.includes(t))return function(){return n.Ii.apply(n,[e,t].concat(_(A.apply(0,arguments))))};if(w_.includes(t))return function(){return n.Pk.apply(n,[e,t].concat(_(A.apply(0,arguments))))};if(v_.has(t)||y_.has(t))return function(){return n.g[e][t]}}return this.g[e][t]},r.set=function(e,t,n){this.g[e][t]=n,M_(this,{type:`set`,targetName:e,property:t,value:n})};function D_(e,t){var n=e.N();F_=t,t.addUpdateListener(e.C),t.addMessageListener(`urn:x-cast:com.google.shaka.v2`,e.D),A_(e),M_(e,{type:`init`,initState:n,appData:e.o}),e.j.resolve()}function O_(e,t){var n=8003;switch(t.code){case`cancel`:n=8004;break;case`timeout`:n=8005;break;case`receiver_unavailable`:n=8006}e.j.reject(new R(2,8,n,t))}r.Ii=function(e,t){M_(this,{type:`call`,targetName:e,methodName:t,args:A.apply(2,arguments)})},r.Pk=function(e,t){var n=A.apply(2,arguments),r=new oa,i=this.I.toString();this.I++,this.h.set(i,r);try{M_(this,{type:`asyncCall`,targetName:e,methodName:t,args:n,id:i})}catch(e){r.reject(e)}return r};function k_(e){var t=F_;t.removeUpdateListener(e.C),t.removeMessageListener(`urn:x-cast:com.google.shaka.v2`,e.D)}function A_(e){var t=F_?F_.status==`connected`:!1;if(e.i&&!t){for(var n in e.G(),e.g)e.g[n]={};j_(e)}e.i=t,e.J=t?F_.receiver.friendlyName:``,e.l.yb()}function j_(e){if(e.h)for(var t=g(e.h.keys()),n=t.next();!n.done;n=t.next()){n=n.value;var r=e.h.get(n);e.h.delete(n),r.reject(new R(1,7,7e3))}}function M_(e,t){t=d_(t);var n=F_;try{n.sendMessage(`urn:x-cast:com.google.shaka.v2`,t,function(){},ue)}catch(r){throw t=new R(2,8,8005,r),n=new V(`error`,(/* @__PURE__ */ new Map()).set(`detail`,t)),e.B(`player`,n),e.jd(),t}}var N_=.02,P_=!1,F_=null,I_=null,L_=/* @__PURE__ */ new Set;function R_(t){if(I_?e.__onGCastApiAvailable=I_:delete e.__onGCastApiAvailable,I_=null,t)for(var n=g(L_),r=n.next();!r.done;r=n.next())r.value.init();typeof e.__onGCastApiAvailable==`function`&&e.__onGCastApiAvailable(t)}function z_(t,n,r,i){i=i!==void 0&&i,ga.call(this);var a=this;this.i=t,this.h=n,this.l=this.o=this.m=this.u=this.j=null,this.I=r,this.H=i,this.D=[],this.C=[],this.B=[],this.G=/* @__PURE__ */ new Map,this.g=null,e.chrome&&we().Qa()!=`CAST`?(this.g=new T_(r,function(){return W_(a)},function(){return G_(a)},function(e,t){return Y_(a,e,t)},function(){return K_(a)},function(){return U_(a)},i),B_(this)):(this.j=this.i,this.u=this.h)}m(z_,ga),r=z_.prototype,r.destroy=function(e){return this.g&&e!==void 0&&e&&this.g.jd(),this.l&&(this.l.release(),this.l=null),e=[],this.h&&(e.push(this.h.destroy()),this.h=null),this.g&&(e.push(this.g.destroy()),this.g=null),this.u=this.j=this.i=null,ga.prototype.release.call(this),Promise.all(e)},r.ek=function(){return this.j},r.nd=function(){return this.u},r.qj=function(){return this.g?this.g.m&&P_:!1},r.sb=function(){return this.g?this.g.sb():!1},r.bh=function(){return this.g?this.g.bh():``},r.cast=function(){var e=this;return k(function(t){return t.h==1?e.g?t.g(e.g.cast(),2):t.return():e.h?t.g(e.h.yc(),0):t.return()})},r.ph=function(e){this.g&&this.g.ph(e)},r.il=function(){this.g&&E_(this.g)},r.jd=function(){this.g&&this.g.jd()},r.rj=function(e,t){t=t!==void 0&&t;var n=this;return k(function(r){if(r.h==1)return e==n.I&&t==n.H||(n.I=e,n.H=t,!n.g)?r.return():(n.g.jd(),r.g(n.g.destroy(),2));n.g=null,n.g=new T_(e,function(){return W_(n)},function(){return G_(n)},function(e,t){return Y_(n,e,t)},function(){return K_(n)},function(){return U_(n)},t),n.g.init(),r.j()})};function B_(e){e.g.init(),e.l=new I;for(var t=g(m_),n=t.next();!n.done;n=t.next())e.l.F(e.i,n.value,function(t){e.g.sb()||(t=ma(t),e.m.dispatchEvent(t))});for(var r in ha)e.l.F(e.h,ha[r],function(t){e.g.sb()||e.o.dispatchEvent(t)});for(var i in e.j={},t={},e.i)t={ae:t.ae},t.ae=i,Object.defineProperty(e.j,t.ae,{configurable:!1,enumerable:!0,get:function(t){return function(){return q_(e,t.ae)}}(t),set:function(t){return function(n){var r=t.ae;e.g.sb()?e.g.set(`video`,r,n):e.i[r]=n}}(t)});e.u={},H_(e,function(t){Object.defineProperty(e.u,t,{configurable:!1,enumerable:!0,get:function(){return J_(e,t)}})}),V_(e),e.m=new ga,e.m.De=e.j,e.o=new ga,e.o.De=e.u,e.l.F(e.h,`unloading`,function(){e.g&&e.g.sb()||X_(e)})}function V_(e){var t=/* @__PURE__ */ new Map;H_(e,function(n,r){t.has(r)?(r=t.get(r),n.length<r.length?e.G.set(n,r):e.G.set(r,n)):t.set(r,n)})}function H_(e,t){function n(e){return e==`constructor`||typeof r[e]!=`function`?!1:!i.has(e)}var r=e.h,i=/* @__PURE__ */ new Set,a;for(a in r)n(a)&&(i.add(a),t(a,r[a]));for(e=Object.getPrototypeOf(r),a=Object.getPrototypeOf({});e&&e!=a;){for(var o=g(Object.getOwnPropertyNames(e)),s=o.next();!s.done;s=o.next())s=s.value,n(s)&&(i.add(s),t(s,r[s]));e=Object.getPrototypeOf(e)}}function U_(e){var t={video:{},player:{},playerAfterLoad:{},manifest:e.h.kd(),startTime:null,addThumbnailsTrackCalls:e.D,addTextTrackAsyncCalls:e.C,addChaptersTrackCalls:e.B};e.i.pause();for(var n=g(g_),r=n.next();!r.done;r=n.next())r=r.value,t.video[r]=e.i[r];for(e.i.ended||(t.startTime=e.i.currentTime),n=g(x_),r=n.next();!r.done;r=n.next()){var i=r.value;r=i[1],i=e.h[i[0]](),t.player[r]=i}for(n=g(S_),r=n.next();!r.done;r=n.next())i=r.value,r=i[1],i=e.h[i[0]](),t.playerAfterLoad[r]=i;return t}function W_(e){var t=new V(`caststatuschanged`);e.dispatchEvent(t)}function G_(e){var t=new V(e.j.paused?`pause`:`play`);e.m.dispatchEvent(t)}function K_(e){for(var t=g(x_),n=t.next();!n.done;n=t.next()){var r=n.value;n=r[1],r=e.g.get(`player`,r[0])(),e.h[n](r)}var i=e.D,a=e.C,o=e.B;X_(e);var s=e.g.get(`player`,`getAssetUri`)();r=e.g.get(`video`,`ended`),t=Promise.resolve();var c=e.i.autoplay;n=null,r||(n=e.g.get(`video`,`currentTime`));var l;(r=e.g.get(`player`,`getTextTracks`)())&&r.length&&(l=r.find(function(e){return e.active}));var u=e.g.get(`player`,`isTextTrackVisible`)();s&&(e.i.autoplay=!1,t=e.h.load(s,n));var d={};for(n=g(g_),r=n.next();!r.done;r=n.next())r=r.value,d[r]=e.g.get(`video`,r);t.then(function(){if(e.i){for(var t=g(i),n=t.next();!n.done;n=t.next()){n=n.value;var r;(r=e.nd()).Je.apply(r,_(n))}for(t=g(a),r=t.next();!r.done;r=t.next()){r=r.value;var f;(f=e.nd()).Md.apply(f,_(r))}for(f=g(o),t=f.next();!t.done;t=f.next()){t=t.value;var p;(p=e.nd()).Ie.apply(p,_(t))}for(p=g(g_),f=p.next();!f.done;f=p.next())f=f.value,e.i[f]=d[f];for(p=g(S_),f=p.next();!f.done;f=p.next())t=f.value,f=t[1],t=e.g.get(`player`,t[0])(),e.h[f](t);e.h.sh(u),l&&e.h.nh(l.language,l.roles,l.forced),e.i.autoplay=c,s&&e.i.play()}},function(t){t=(/* @__PURE__ */ new Map()).set(`detail`,t),t=new V(`error`,t),e.h.dispatchEvent(t)})}function q_(e,t){if(t==`addEventListener`)return function(t,n,r){return e.m.addEventListener(t,n,r)};if(t==`removeEventListener`)return function(t,n,r){return e.m.removeEventListener(t,n,r)};if(e.g.sb()&&Object.keys(e.g.g.video).length==0){var n=e.i[t];if(typeof n!=`function`)return n}return e.g.sb()?e.g.get(`video`,t):(t=e.i[t],typeof t==`function`&&(t=t.bind(e.i)),t)}function J_(e,t,n){if(n=n!==void 0&&n,e.G.has(t)&&(t=e.G.get(t)),t==`addEventListener`)return function(t,n,r){return e.o.addEventListener(t,n,r)};if(t==`removeEventListener`)return function(t,n,r){return e.o.removeEventListener(t,n,r)};if(t==`getMediaElement`)return function(){return e.j};if(t==`getSharedConfiguration`)return e.g.get(`player`,`getConfiguration`);if(t==`getNetworkingEngine`)return function(){return e.h.Sb()};if(t==`getDrmEngine`)return function(){return e.h.D};if(t==`getAdManager`)return function(){return e.h.ai()};if(t==`getQueueManager`)return function(){return e.h.ji()};if(t==`setVideoContainer`)return function(t){return e.h.Wi(t)};if(!n){if(t==`addThumbnailsTrack`)return function(){var n=A.apply(0,arguments);return e.D.push(n),J_(e,t,!0).apply(null,_(n))};if(t==`addTextTrackAsync`)return function(){var n=A.apply(0,arguments);return e.C.push(n),J_(e,t,!0).apply(null,_(n))};if(t==`addChaptersTrack`)return function(){var n=A.apply(0,arguments);return e.B.push(n),J_(e,t,!0).apply(null,_(n))}}if(e.g.sb()){if(t==`getManifest`||t==`drmInfo`)return function(){return F(t+`() does not work while casting!`),null};if(t==`attach`||t==`detach`)return function(){return F(t+`() does not work while casting!`),Promise.resolve()};if(t==`getChapters`)return function(){return F(t+`() does not work while casting!`),[]}}return e.g.sb()&&Object.keys(e.g.g.video).length==0&&(v_.has(t)||y_.has(t))||!e.g.sb()?e.h[t].bind(e.h):e.g.get(`player`,t)}function Y_(e,t,n){e.g.sb()&&(t==`video`?e.m.dispatchEvent(n):t==`player`&&(n.type==`unloading`&&X_(e),e.o.dispatchEvent(n)))}function X_(e){e.D=[],e.C=[],e.B=[]}P(`shaka.cast.CastProxy`,z_),z_.prototype.changeReceiverId=z_.prototype.rj,z_.prototype.forceDisconnect=z_.prototype.jd,z_.prototype.suggestDisconnect=z_.prototype.il,z_.prototype.setAppData=z_.prototype.ph,z_.prototype.cast=z_.prototype.cast,z_.prototype.receiverName=z_.prototype.bh,z_.prototype.isCasting=z_.prototype.sb,z_.prototype.canCast=z_.prototype.qj,z_.prototype.getPlayer=z_.prototype.nd,z_.prototype.getVideo=z_.prototype.ek,z_.prototype.destroy=z_.prototype.destroy;function Z_(e,t,n,r){ga.call(this);var i=this;this.h=e,this.g=t,this.j=new I,this.I={video:e,player:t},this.G=n||function(){},this.J=r||function(e){return e},this.i=null,this.H=!1,this.o=!0,this.m=0,this.C=!1,this.B=!0,this.u=this.l=null,this.D=new Qr(function(){rv(i)}),Q_(this)}m(Z_,ga),r=Z_.prototype,r.isConnected=function(){return this.H},r.lk=function(){return this.o},r.al=function(e){this.i=e},r.vj=function(){this.i=null},r.cl=function(e){this.i||(this.i={metadataType:cast.receiver.media.MetadataType.GENERIC}),this.i.title=e},r.$k=function(e){this.i||(this.i={metadataType:cast.receiver.media.MetadataType.GENERIC}),this.i.images=[{url:e}]},r.Zk=function(e){this.i||(this.i={}),this.i.artist=e,this.i.metadataType=cast.receiver.media.MetadataType.MUSIC_TRACK},r.destroy=function(){var e=this,t,n;return k(function(r){if(r.h==1)return e.j&&(e.j.release(),e.j=null),t=[],e.g&&(t.push(e.g.destroy()),e.g=null),e.D&&(e.D.stop(),e.D=null),e.h=null,e.I=null,e.G=null,e.H=!1,e.o=!0,e.l=null,e.u=null,ga.prototype.release.call(e),r.g(Promise.all(t),2);n=cast.receiver.CastReceiverManager.getInstance(),n.stop(),r.j()})};function Q_(e){var t=cast.receiver.CastReceiverManager.getInstance();t.onSenderConnected=function(){return $_(e)},t.onSenderDisconnected=function(){return $_(e)},t.onSystemVolumeChanged=function(){var t=cast.receiver.CastReceiverManager.getInstance().getSystemVolume();t&&lv(e,{type:`update`,update:{video:{volume:t.level,muted:t.muted}}},e.l),lv(e,{type:`event`,targetName:`video`,event:{type:`volumechange`}},e.l)},e.u=t.getCastMessageBus(`urn:x-cast:com.google.cast.media`),e.u.onMessage=function(t){return sv(e,t)},e.l=t.getCastMessageBus(`urn:x-cast:com.google.shaka.v2`),e.l.onMessage=function(t){return ov(e,t)},t.start(),t=g(m_);for(var n=t.next();!n.done;n=t.next())e.j.F(e.h,n.value,function(t){return nv(e,`video`,t)});for(var r in ha)e.j.F(e.g,ha[r],function(t){return nv(e,`player`,t)});e.j.F(e.h,`loadeddata`,function(){e.C=!0}),e.j.F(e.g,`loading`,function(){e.o=!1,ev(e)}),e.j.F(e.h,`playing`,function(){e.o=!1,ev(e)}),e.j.F(e.h,`pause`,function(){ev(e)}),e.j.F(e.g,`unloading`,function(){e.o=!0,ev(e)}),e.j.F(e.h,`ended`,function(){new Qr(function(){e.h&&e.h.ended&&(e.o=!0,ev(e))}).na(fv)})}function $_(e){e.m=0,e.B=!0,e.H=cast.receiver.CastReceiverManager.getInstance().getSenders().length!=0,ev(e)}function ev(e){var t;k(function(n){if(n.h==1)return n.g(Promise.resolve(),2);if(!e.g)return n.return();t=new V(`caststatuschanged`),e.dispatchEvent(t),iv(e)||uv(e),n.j()})}function tv(e,t,n){var r,i,a,o,s,c,l,u,d,f,p,m,h,v,y,b,x,S,C;k(function(w){switch(w.h){case 1:for(r in t.player)i=t.player[r],e.g[r](i);return e.G(n),a=e.h.autoplay,t.manifest?(e.h.autoplay=!1,w.m(5),w.g(e.g.load(t.manifest,t.startTime),7)):w.g(Promise.resolve(),3);case 7:if(t.addThumbnailsTrackCalls)for(o=g(t.addThumbnailsTrackCalls),s=o.next();!s.done;s=o.next())c=s.value,e.g.Je.apply(e.g,_(c));if(t.addTextTrackAsyncCalls)for(l=g(t.addTextTrackAsyncCalls),u=l.next();!u.done;u=l.next())d=u.value,e.g.Md.apply(e.g,_(d));if(t.addChaptersTrackCalls)for(f=g(t.addChaptersTrackCalls),p=f.next();!p.done;p=f.next())m=p.value,e.g.Ie.apply(e.g,_(m));w.o(3);break;case 5:return h=w.l(),v=(/* @__PURE__ */ new Map()).set(`detail`,h),y=new V(`error`,v),e.g&&e.g.dispatchEvent(y),w.return();case 3:if(!e.g)return w.return();for(b in t.video)x=t.video[b],e.h[b]=x;for(S in t.playerAfterLoad)C=t.playerAfterLoad[S],e.g[S](C);e.h.autoplay=a,t.manifest&&(e.h.play(),uv(e)),w.j()}})}function nv(e,t,n){e.g&&(rv(e),lv(e,{type:`event`,targetName:t,event:n},e.l))}function rv(e){e.D.na(dv);for(var t={video:{},player:{}},n=g(h_),r=n.next();!r.done;r=n.next())r=r.value,t.video[r]=e.h[r];e.g.T()&&b_.forEach(function(n,r){e.m%n==0&&(t.player[r]=e.g[r]())}),v_.forEach(function(n,r){e.m%n==0&&(t.player[r]=e.g[r]())}),(n=cast.receiver.CastReceiverManager.getInstance().getSystemVolume())&&(t.video.volume=n.level,t.video.muted=n.muted),lv(e,{type:`update`,update:t},e.l),y_.forEach(function(t,n){e.m%t==0&&(t={player:{}},t.player[n]=e.g[n](),lv(e,{type:`update`,update:t},e.l))}),e.C&&(e.m+=1),iv(e)}function iv(e){return e.B&&(e.h.duration||e.g.T())?(av(e),e.B=!1,!0):!1}function av(e,t){var n={contentId:e.g.kd(),streamType:e.g.T()?`LIVE`:`BUFFERED`,contentType:``};e.g.T()||(n.duration=e.h.duration),e.i&&(n.metadata=e.i),uv(e,t===void 0?0:t,n)}function ov(e,t){var n=f_(t.data);switch(n.type){case`init`:e.m=0,e.C=!1,e.B=!0,tv(e,n.initState,n.appData),rv(e);break;case`appData`:e.G(n.appData);break;case`set`:var r=n.targetName,i=n.property;if(n=n.value,r==`video`){if(t=cast.receiver.CastReceiverManager.getInstance(),i==`volume`){t.setSystemVolumeLevel(n);break}if(i==`muted`){t.setSystemVolumeMuted(n);break}}e.I[r][i]=n;break;case`call`:r=e.I[n.targetName],r[n.methodName].apply(r,n.args);break;case`asyncCall`:r=n.targetName,i=n.methodName,r==`player`&&i==`load`&&(e.m=0,e.C=!1);var a=n.id,o=t.senderId;t=e.I[r],n=t[i].apply(t,n.args),r==`player`&&i==`load`&&(n=n.then(function(){e.B=!0})),n.then(function(t){return cv(e,o,a,null,t)},function(t){return cv(e,o,a,t,null)})}}function sv(e,t){var n=f_(t.data);switch(n.type){case`PLAY`:e.h.play(),uv(e);break;case`PAUSE`:e.h.pause(),uv(e);break;case`SEEK`:t=n.currentTime;var r=n.resumeState;t!=null&&(e.h.currentTime=Number(t)),r&&r==`PLAYBACK_START`?(e.h.play(),uv(e)):r&&r==`PLAYBACK_PAUSE`&&(e.h.pause(),uv(e));break;case`STOP`:e.g.yc().then(function(){e.g&&uv(e)});break;case`GET_STATUS`:av(e,Number(n.requestId));break;case`VOLUME`:r=n.volume,t=r.level,r=r.muted;var i=e.h.volume,a=e.h.muted;t!=null&&(e.h.volume=Number(t)),r!=null&&(e.h.muted=r),i==e.h.volume&&a==e.h.muted||uv(e);break;case`LOAD`:e.m=0,e.C=!1,e.B=!1,t=n.media,r=n.currentTime,i=e.J(t.contentId),a=n.autoplay||!0,e.G(t.customData),a&&(e.h.autoplay=!0),e.g.load(i,r).then(function(){e.g&&av(e)}).catch(function(t){var r=`LOAD_FAILED`;t.category==7&&t.code==7e3&&(r=`LOAD_CANCELLED`),lv(e,{requestId:Number(n.requestId),type:r},e.u)});break;default:lv(e,{requestId:Number(n.requestId),type:`INVALID_REQUEST`,reason:`INVALID_COMMAND`},e.u)}}function cv(e,t,n,r,i){e.g&&lv(e,{type:`asyncComplete`,id:n,error:r,res:i},e.l,t)}function lv(e,t,n,r){e.H&&(e=d_(t),r?n.getCastChannel(r).send(e):n.broadcast(e))}function uv(e,t,n){n=n===void 0?null:n;var r={mediaSessionId:0,playbackRate:e.h.playbackRate,playerState:e.o?pv:e.g.Ng()?hv:e.h.paused?gv:mv,currentTime:e.h.currentTime,supportedMediaCommands:63,volume:{level:e.h.volume,muted:e.h.muted}};n&&(r.media=n),lv(e,{requestId:t===void 0?0:t,type:`MEDIA_STATUS`,status:[r]},e.u)}P(`shaka.cast.CastReceiver`,Z_),Z_.prototype.destroy=Z_.prototype.destroy,Z_.prototype.setContentArtist=Z_.prototype.Zk,Z_.prototype.setContentImage=Z_.prototype.$k,Z_.prototype.setContentTitle=Z_.prototype.cl,Z_.prototype.clearContentMetadata=Z_.prototype.vj,Z_.prototype.setContentMetadata=Z_.prototype.al,Z_.prototype.isIdle=Z_.prototype.lk,Z_.prototype.isConnected=Z_.prototype.isConnected;var dv=.5,fv=5,pv=`IDLE`,mv=`PLAYING`,hv=`BUFFERING`,gv=`PAUSED`;function _v(e,t,n,r,i){if(r>=i)return null;for(var a=-1,o=-1,s=0;s<n.length;s++)if(n[s].some(function(e){return e!=null&&e.g.trim()!=``})){a=s;break}for(s=n.length-1;s>=0;s--)if(n[s].some(function(e){return e!=null&&e.g.trim()!=``})){o=s;break}if(a===-1||o===-1)return null;for(var c=s=!1,l=`white`,u=`black`,d=vv(r,i,s,c,l,u);a<=o;a++){for(var f=n[a],p=-1,m=-1,h=0;h<f.length;h++)if(f[h]!=null&&f[h].g.trim()!==``){p=h;break}for(h=f.length-1;h>=0;h--)if(f[h]!=null&&f[h].g.trim()!==``){m=h;break}if(p===-1||m===-1)f=yv(r,i),e.nestedCues.push(f);else{for(;p<=m;p++)if(h=f[p]){var g=h.l,_=h.i,v=h.j,y=h.h;(g!=s||_!=c||v!=l||y!=u)&&(d.payload&&e.nestedCues.push(d),d=vv(r,i,g,_,v,y),s=g,c=_,l=v,u=y),d.payload+=h.g}else d.payload+=` `;d.payload&&e.nestedCues.push(d),a!==o&&(d=yv(r,i),e.nestedCues.push(d)),d=vv(r,i,s,c,l,u)}}return e.nestedCues.length?{cue:e,stream:t}:null}function vv(e,t,n,r,i,a){return e=new qn(e,t,``),n&&e.textDecoration.push(vr),r&&(e.fontStyle=gr),e.color=i,e.backgroundColor=a,e}function yv(e,t){return e=new qn(e,t,``),e.lineBreak=!0,e}function bv(e,t,n,r,i){this.g=e,this.l=t,this.i=n,this.h=r,this.j=i}function xv(e,t){this.i=[],this.g=1,this.h=0,this.D=e,this.C=t,this.j=this.m=!1,this.l=`white`,this.o=`black`,this.u=this.B=null,Cv(this)}function Sv(e,t,n){var r=`CC`+((e.D<<1|e.C)+1),i=new qn(t,n,``);i.lineInterpretation=1;var a=jv.get(e.g);return a&&(i.line=a),e.u!=null&&e.B!=null&&(i.position=10+Math.min(70,e.u*10)+e.B*2.5),(t=_v(i,r,e.i,t,n))&&e.g+t.cue.nestedCues.length-3>15&&(a=jv.get(e.g+3-t.cue.nestedCues.length))&&(i.line=a),t}function Cv(e){Ev(e,0,15),e.g=1}function wv(e,t,n){if(!(n<32||n>127)){var r=``;switch(t){case 0:r=Dv.has(n)?Dv.get(n):String.fromCharCode(n);break;case 1:r=Ov.get(n);break;case 2:e.i[e.g].pop(),r=kv.get(n);break;case 3:e.i[e.g].pop(),r=Av.get(n)}r&&e.i[e.g].push(new bv(r,e.m,e.j,e.o,e.l))}}function Tv(e,t,n,r){if(!(n<0||t<0)){if(t>=n)for(--r;r>=0;r--)e.i[t+r]=e.i[n+r].map(function(e){return e});else for(var i=0;i<r;i++)e.i[t+i]=e.i[n+i].map(function(e){return e})}}function Ev(e,t,n){for(var r=0;r<=n;r++)e.i[t+r]=[]}var Dv=/* @__PURE__ */ new Map([[39,`’`],[42,`á`],[92,`é`],[92,`é`],[94,`í`],[95,`ó`],[96,`ú`],[123,`ç`],[124,`÷`],[125,`Ñ`],[126,`ñ`],[127,`█`]]),Ov=/* @__PURE__ */ new Map([[48,`®`],[49,`°`],[50,`½`],[51,`¿`],[52,`™`],[53,`¢`],[54,`£`],[55,`♪`],[56,`à`],[57,` `],[58,`è`],[59,`â`],[60,`ê`],[61,`î`],[62,`ô`],[63,`û`]]),kv=/* @__PURE__ */ 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,`»`]]),Av=/* @__PURE__ */ 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,`┘`]]),jv=/* @__PURE__ */ 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 Mv(e,t){this.h=0,this.o=new xv(e,t),this.i=new xv(e,t),this.g=this.j=new xv(e,t),this.l=0,this.m=null}function Nv(e,t,n){e.g=e.i;var r=e.g,i=null;return e.h!==3&&e.h!==4&&(i=Sv(r,e.l,n),n=e.i,n.g=n.h>0?n.h:0,Ev(n,0,15),n=e.j,n.g=n.h>0?n.h:0,Ev(n,0,15),r.g=15),e.h=3,r.h=t,i}function Pv(e){e.h=1,e.g=e.j,e.g.h=0}function Fv(e){le(`Cea608DataChannel`,`CEA-608 text mode entered, but is unsupported`),e.g=e.o,e.h=4}var Iv=`black green blue cyan red yellow magenta black`.split(` `),Lv=`white green blue cyan red yellow magenta white_italics`.split(` `);function Rv(e,t){this.J=t,this.N=e,this.K=this.l=!1,this.m=this.o=this.H=this.M=this.I=0,this.G=2,this.i=[],this.g=this.h=this.j=0,this.D=this.B=!1,this.C=`white`,this.u=`black`,zv(this)}function zv(e){e.i=[];for(var t=0;t<16;t++)e.i.push(Bv())}function Bv(){for(var e=[],t=0;t<42;t++)e.push(null);return e}function Vv(e,t){Hv(e)&&(e.i[e.h][e.g]=new bv(t,e.D,e.B,e.u,e.C),e.g++)}function Hv(e){var t=e.g<e.m&&e.g>=0;return e.h<e.o&&e.h>=0&&t}Rv.prototype.isVisible=function(){return this.l};function Uv(e){for(var t=0,n=1;n<16;n++,t++)e.i[t]=e.i[n];for(n=0;n<1;n++,t++)e.i[t]=Bv()}function Wv(e,t,n){var r=new qn(e.j,t,``);r.textAlign=e.G===0?`left`:e.G===1?`right`:nr;var i=r.region;switch(e.J&&(i.id+=`svc`+e.J),i.id+=`win`+e.N,i.height=e.o,i.width=e.m,i.heightUnits=2,i.widthUnits=2,i.viewportAnchorX=e.I,i.viewportAnchorY=e.M,i.viewportAnchorUnits=e.K?tn:2,e.H){case 0:i.regionAnchorX=0,i.regionAnchorY=0;break;case 1:i.regionAnchorX=50,i.regionAnchorY=0;break;case 2:i.regionAnchorX=100,i.regionAnchorY=0;break;case 3:i.regionAnchorX=0,i.regionAnchorY=50;break;case 4:i.regionAnchorX=50,i.regionAnchorY=50;break;case 5:i.regionAnchorX=100,i.regionAnchorY=50;break;case 6:i.regionAnchorX=0,i.regionAnchorY=100;break;case 7:i.regionAnchorX=50,i.regionAnchorY=100;break;case 8:i.regionAnchorX=100,i.regionAnchorY=100}return(n=_v(r,`svc`+n,e.i,e.j,t))&&(e.j=t),n}Rv.prototype.display=function(){this.l=!0};function Gv(){this.i=[],this.h=null,this.g=0}function Kv(e,t){t.type===3?(e.g=(t.value&63)*2-1,e.h=[]):e.h&&(e.g>0&&(e.h.push(t),e.g--),e.g===0&&(e.i.push(new qv(e.h)),e.h=null,e.g=0))}function qv(e){this.g=0,this.h=e}qv.prototype.La=function(){return this.g<this.h.length},qv.prototype.Ra=function(){return this.g};function Jv(e){if(!e.La())throw new R(2,2,3e3);return e.h[e.g++]}qv.prototype.skip=function(e){if(this.g+e>this.h.length)throw new R(2,2,3e3);this.g+=e},qv.prototype.Mi=function(e){if(this.g-e<0)throw new R(2,2,3e3);this.g-=e};function Yv(e){this.i=e,this.h=[null,null,null,null,null,null,null,null],this.g=null}function Xv(e,t,n,r){if(!e.g)return[];if(n==24)return n=Jv(t).value,r=Jv(t).value,n=function(e){return e.map(function(e){return(`0`+(e&255).toString(16)).slice(-2)}).join(``)}([n,r]),Vv(e.g,String.fromCharCode(parseInt(n,16))),[];t=e.g;var i=null;switch(n){case 8:!Hv(t)||t.g<=0&&t.h<=0||(t.g<=0?(t.g=t.m-1,t.h--):t.g--,t.i[t.h][t.g]=null);break;case 13:t.isVisible()&&(i=Wv(t,r,e.i)),t.h+1>=t.o?Uv(t):t.h++,t.g=0;break;case 14:t.isVisible()&&(i=Wv(t,r,e.i)),t.i[t.h]=Bv(),t.g=0;break;case 12:t.isVisible()&&(i=Wv(t,r,e.i)),zv(t),t.h=0,t.g=0}return i?[i]:[]}function Zv(e,t,n,r){if(n>=128&&n<=135)r=n&7,e.h[r]&&(e.g=e.h[r]);else{if(n===136){n=Jv(t).value,t=[],n=g(Qv(e,n));for(var i=n.next();!i.done;i=n.next()){if(i=e.h[i.value],i.isVisible()){var a=Wv(i,r,e.i);a&&t.push(a)}zv(i)}return t}if(n===137)for(t=Jv(t).value,t=g(Qv(e,t)),n=t.next();!n.done;n=t.next())n=e.h[n.value],n.isVisible()||(n.j=r),n.display();else{if(n===138){for(n=Jv(t).value,t=null,n=g(Qv(e,n)),i=n.next();!i.done;i=n.next())i=e.h[i.value],i.isVisible()&&(t=Wv(i,r,e.i)),i.l=!1;return t?[t]:[]}if(n===139){for(n=Jv(t).value,t=null,n=g(Qv(e,n)),i=n.next();!i.done;i=n.next())i=e.h[i.value],i.isVisible()?t=Wv(i,r,e.i):i.j=r,i.l=!i.l;return t?[t]:[]}if(n===140)return t=Jv(t).value,$v(e,t,r);if(n===143)return r=$v(e,255,r),ey(e),r;if(n===144)t.skip(1),r=Jv(t).value,e.g&&(e.g.B=(r&128)>0,e.g.D=(r&64)>0);else if(n===145)r=Jv(t).value,n=Jv(t).value,t.skip(1),e.g&&(t=ty((n&48)>>4,(n&12)>>2,n&3),e.g.C=ty((r&48)>>4,(r&12)>>2,r&3),e.g.u=t);else if(n===146)r=Jv(t).value,t=Jv(t).value,e.g&&(e=e.g,e.h=r&15,e.g=t&63);else if(n===151)t.skip(1),t.skip(1),r=Jv(t).value,t.skip(1),e.g&&(e.g.G=r&3);else if(n>=152&&n<=159){n=(n&15)-8,i=e.h[n]!==null,i||(a=new Rv(n,e.i),a.j=r,e.h[n]=a),r=Jv(t).value,a=Jv(t).value;var o=Jv(t).value,s=Jv(t).value,c=Jv(t).value;t=Jv(t).value,i&&!(t&7)||(t=e.h[n],t.h=0,t.g=0,t.D=!1,t.B=!1,t.C=`white`,t.u=`black`),t=e.h[n],t.l=(r&32)>0,t.M=a&127,t.I=o,t.H=(s&240)>>4,t.K=(a&128)>0,t.o=(s&15)+1,t.m=(c&63)+1,e.g=e.h[n]}}}return[]}function Qv(e,t){for(var n=[],r=0;r<8;r++)(t&1)==1&&e.h[r]&&n.push(r),t>>=1;return n}function $v(e,t,n){var r=[];t=g(Qv(e,t));for(var i=t.next();!i.done;i=t.next()){i=i.value;var a=e.h[i];a.isVisible()&&(a=Wv(a,n,e.i))&&r.push(a),e.h[i]=null}return r}function ey(e){e.g=null,e.h=[null,null,null,null,null,null,null,null]}function ty(e,t,n){var r={0:0,1:0,2:1,3:1};return e=r[e],t=r[t],n=r[n],ry[e<<2|t<<1|n]}var ny=/* @__PURE__ */ new Map([[32,` `],[33,`\xA0`],[37,`…`],[42,`Š`],[44,`Œ`],[48,`█`],[49,`‘`],[50,`’`],[51,`“`],[52,`”`],[53,`•`],[57,`™`],[58,`š`],[60,`œ`],[61,`℠`],[63,`Ÿ`],[118,`⅛`],[119,`⅜`],[120,`⅝`],[121,`⅞`],[122,`│`],[123,`┐`],[124,`└`],[125,`─`],[126,`┘`],[127,`┌`]]),ry=`black blue green cyan red magenta yellow white`.split(` `);function iy(){this.h=[],this.g=[],this.i=new Gv,this.l=0,this.m=/* @__PURE__ */ new Map([[`CC1`,new Mv(0,0)],[`CC2`,new Mv(0,1)],[`CC3`,new Mv(1,0)],[`CC4`,new Mv(1,1)]]),this.u=this.o=0,this.j=/* @__PURE__ */ new Map,this.C=!0,this.B=/* @__PURE__ */ new Set,ay(this)}iy.prototype.clear=function(){this.l=0,this.h=[],this.g=[];var e=this.i;e.i=[],e.h=[],e.g=0,ay(this),e=g(this.j.values());for(var t=e.next();!t.done;t=e.next())ey(t.value)};function ay(e){e.o=0,e.u=0;for(var t=g(e.m.values()),n=t.next();!n.done;n=t.next())n=n.value,n.h=0,n.g=n.j,n.m=null,Cv(n.i),Cv(n.j),Cv(n.o);e.C=!0}iy.prototype.extract=function(e,t){if(this.C){for(var n=g(this.m.values()),r=n.next();!r.done;r=n.next())r.value.l=t;this.C=!1}if(e=new Ra(e,0),!(e.getLength()<8)&&e.Y()===181&&e.Ea()===49&&e.V()===1195456820&&e.Y()===3&&(n=e.Y(),n&64))for(n&=31,e.skip(1),r=0;r<n;r++){var i=e.Y(),a=(i&4)>>2,o=e.Y(),s=e.Y();a&&(i&=3,i===0||i===1?this.h.push({pts:t,type:i,Ab:o,fc:s,order:this.h.length}):(this.g.push({pts:t,type:i,value:o,order:this.g.length}),this.g.push({pts:t,type:2,value:s,order:this.g.length})))}},iy.prototype.decode=function(){function e(e,t){return e.pts-t.pts||e.order-t.order}var t=[];this.h.sort(e),this.g.sort(e);for(var n=g(this.h),r=n.next();!r.done;r=n.next())(r=oy(this,r.value))&&t.push(r);for(n=g(this.g),r=n.next();!r.done;r=n.next())Kv(this.i,r.value);for(n=g(this.i.i),r=n.next();!r.done;r=n.next())r=sy(this,r.value),t.push.apply(t,_(r));return this.i.i=[],this.h=[],this.g=[],t};function oy(e,t){var n=t.type;if((t.Ab&112)==16){var r=t.Ab>>3&1;n===0?e.o=r:e.u=r}if(r=`CC`+((n<<1|(n?e.u:e.o))+1),n=e.m.get(r),t.Ab===255&&t.fc===255||!t.Ab&&!t.fc||!cy(t.Ab)||!cy(t.fc))return++e.l>=45&&ay(e),null;e.l=0,t.Ab&=127,t.fc&=127;var i=t.Ab;if(i>=1&&i<=15||!t.Ab&&!t.fc)return null;if(i=null,(t.Ab&112)==16)a:{if(e.B.add(r),r=t.Ab,e=t.fc,n.m===(r<<8|e))n.m=null;else if(n.m=r<<8|e,(r&240)==16&&(e&192)==64){t=[11,11,1,2,3,4,12,13,14,15,5,6,7,8,9,10][(r&7)<<1|e>>5&1],r=`white`,i=!1;var a=null,o=e>95?e-96:e-64;o<=13?r=Lv[Math.floor(o/2)]:o<=15?i=!0:a=Math.floor((o-16)/2),e=(e&1)==1,n.h!==4&&(o=n.g,n.h===3&&t!==o.g&&(n=1+t-o.h,Tv(o,n,1+o.g-o.h,o.h),Ev(o,0,n-1),Ev(o,t+1,15-t)),o.g=t,o.m=e,o.j=i,o.l=r,o.u=a,o.o=`black`)}else if((r&247)==17&&(e&240)==32)n.g.m=!1,n.g.j=!1,n.g.l=`white`,wv(n.g,0,32),r=!1,t=Lv[(e&14)>>1],t===`white_italics`&&(t=`white`,r=!0),n.g.m=(e&1)==1,n.g.j=r,n.g.l=t;else if((r&247)==16&&(e&240)==32||(r&247)==23&&(e&255)==45)t=`black`,!(r&7)&&(t=Iv[(e&14)>>1]),n.g.o=t;else if((r&247)==17&&(e&240)==48)wv(n.g,1,e);else if((r&246)==18&&(e&224)==32)wv(n.g,r&1?3:2,e);else{if((r&246)==20&&(e&240)==32){switch(e=t.pts,r=null,t.fc){case 32:Pv(n);break;case 33:n=n.g,n.i[n.g].pop();break;case 37:r=Nv(n,2,e);break;case 38:r=Nv(n,3,e);break;case 39:r=Nv(n,4,e);break;case 40:wv(n.g,0,32);break;case 41:n.h=2,n.g=n.i,n.g.h=0,n.l=e;break;case 42:Cv(n.o),Fv(n);break;case 43:Fv(n);break;case 44:t=n.i,r=null,n.h!==4&&(r=Sv(t,n.l,e)),Ev(t,0,15);break;case 45:t=n.g,n.h===3?(r=Sv(t,n.l,e),i=t.g-t.h+1,Tv(t,i-1,i,t.h),Ev(t,0,i-1),Ev(t,t.g,15-t.g),n.l=e):r=null;break;case 46:Ev(n.j,0,15);break;case 47:t=null,n.h!==4&&(t=Sv(n.i,n.l,e)),r=n.j,n.j=n.i,n.i=r,Pv(n),n.l=e,r=t}i=r;break a}(r==23||r==31)&&e>=33&&e<=35&&(n.g.B=e-32)}i=null}else e=t.fc,wv(n.g,0,t.Ab),wv(n.g,0,e);return i}function sy(e,t){var n=[];try{for(;t.La();){var r=Jv(t).value,i=(r&224)>>5,a=r&31;if(i===7&&a!=0&&(i=Jv(t).value&63),i!=0){e.B.add(`svc`+i),e.j.has(i)||e.j.set(i,new Yv(i));for(var o=e.j.get(i),s=t.Ra();t.Ra()-s<a;){i=o;var c=t,l=Jv(c),u=l.value,d=l.pts;if(u===16){var f=Jv(c);u=u<<16|f.value}if(u>=0&&u<=31)var p=Xv(i,c,u,d);else if(u>=128&&u<=159)p=Zv(i,c,u,d);else{if(u>=4096&&u<=4127)i=c,c=u&255,c>=8&&c<=15?i.skip(1):c>=16&&c<=23?i.skip(2):c>=24&&c<=31&&i.skip(3);else if(u>=4224&&u<=4255)i=c,c=u&255,c>=128&&c<=135?i.skip(4):c>=136&&c<=143&&i.skip(5);else if(u>=32&&u<=127)c=u,i.g&&(c===127?Vv(i.g,`♪`):Vv(i.g,String.fromCharCode(c)));else if(u>=160&&u<=255)i.g&&Vv(i.g,String.fromCharCode(u));else if(u>=4128&&u<=4223){if(c=u&255,i.g){if(ny.has(c)){var m=ny.get(c);Vv(i.g,m)}else Vv(i.g,`_`)}}else u>=4256&&u<=4351&&i.g&&((u&255)==160?Vv(i.g,`[CC]`):Vv(i.g,`_`));p=[]}n.push.apply(n,_(p))}}}}catch(e){if(e instanceof R&&e.code===3e3)le(`CEA708_INVALID_DATA`,`Buffer read out of bounds / invalid CEA-708 Data.`);else throw e}return n}function cy(e){for(var t=0;e;)t^=e&1,e>>=1;return t===1}iy.prototype.getStreams=function(){return Array.from(this.B)},P(`shaka.cea.CeaDecoder`,iy),$t=function(){return new iy};function ly(e){for(var t=[],n=e,r=e=0;r<n.length;)e==2&&n[r]==3?(e=0,n=[].concat(_(n)),n.splice(r,1),n=new Uint8Array(n)):n[r]==0?e++:e=0,r++;for(e=n,r=0;r<e.length;){for(n=0;e[r]==255;)n+=255,r++;n+=e[r++];for(var i=0;e[r]==255;)i+=255,r++;i+=e[r++],n==4&&t.push(e.subarray(r,r+i)),r+=i}return t}function uy(){this.j=/* @__PURE__ */ new Map,this.i=this.h=0,this.g=fy}uy.prototype.init=function(e){var t=this,n=[],r=[];if(new Va().boxes(`moov trak mdia minf stbl mvex`.split(` `),Ha).ma(`trex`,function(e){var n=e.reader;n.skip(4),n.skip(4),e=n.V(),n=n.V(),t.h=e,t.i=n}).ma(`tkhd`,function(e){var t=e.reader;e=e.version,e==1?(t.skip(8),t.skip(8)):(t.skip(4),t.skip(4));var r=t.V();e==1?t.skip(8):t.skip(4),t.skip(4),t.skip(8),t.skip(2),t.skip(2),t.skip(2),t.skip(2),t.skip(36),t.Ea(),t.Ea(),t.Ea(),t.Ea(),n.push(r)}).ma(`mdhd`,function(e){e=rs(e.reader,e.version),r.push(e.timescale)}).ma(`stsd`,Ua).boxes(`avc1 avc3 dvav dva1 hev1 hvc1 dvh1 dvhe vvc1 vvi1 dvc1 dvi1`.split(` `),function(e){e=e.name,gy.has(e)&&(t.g=gy.get(e))}).box(`encv`,Wa).box(`sinf`,Ha).box(`frma`,function(e){e=os(e.reader).codec,gy.has(e)&&(t.g=gy.get(e))}).parse(e,!0,!0),!n.length||!r.length||n.length!=r.length)throw new R(2,2,2010);this.g==fy&&F(`Unable to determine bitstream format for CEA parsing!`),n.forEach(function(e,n){t.j.set(e,r[n])})},uy.prototype.parse=function(e){var t=this;if(this.g==fy)return[];var n=[],r=0,i=[];return new Va().box(`moof`,function(e){r=e.start,i=[],Ha(e)}).box(`traf`,function(e){i.push({baseMediaDecodeTime:null,Rd:t.h,Sd:t.i,Ei:[],timescale:9e4}),Ha(e)}).ma(`trun`,function(e){var t=i[i.length-1];e=is(e.reader,e.version,e.flags),t.Ei.push(e)}).ma(`tfhd`,function(e){var n=i[i.length-1];e=ts(e.reader,e.flags),n.Rd=e.Rd||t.h,n.Sd=e.Sd||t.i,e=e.trackId,t.j.has(e)&&(n.timescale=t.j.get(e))}).ma(`tfdt`,function(e){var t=i[i.length-1];e=ns(e.reader,e.version),t.baseMediaDecodeTime=e.baseMediaDecodeTime}).box(`mdat`,function(e){for(var a=r-e.start-8,o=e.reader.Ra(),s=g(i),c=s.next();!c.done;c=s.next())c=c.value,c.baseMediaDecodeTime===null?F(`Unable to find base media decode time for CEA captions!`):(e.reader.seek(o),dy(t,e.reader,c.baseMediaDecodeTime,c.timescale,c.Rd,c.Sd,a,c.Ei,n))}).parse(e,!1,!0),n};function dy(e,t,n,r,i,a,o,s,c){var l=0,u=a,d=s.map(function(e){return e.kh});for(d=[].concat.apply([],_(d)),d.length&&(u=d[0].sampleSize||a),t.skip(o+s[0].lg);t.La();){o=t.V();var f=t.Y(),p=null;switch(p=!1,s=1,e.g){case py:p=f&31,p=p==6;break;case my:s=2,t.skip(1),p=f>>1&63,p=p==39||p==40;break;case hy:s=2,t.skip(1),p=f>>1&63,p=p==23||p==24;break;default:return}if(p)for(f=0,l<d.length&&(f=d[l].Cf||0),f=(n+f)/r,s=t.Nb(o-s,!1),s=g(ly(s)),p=s.next();!p.done;p=s.next())c.push({packet:p.value,pts:f});else try{t.skip(o-s)}catch{break}u-=o+4,u==0&&(n=l<d.length?n+(d[l].mh||i):n+i,l++,u=l<d.length&&d[l].sampleSize||a)}}P(`shaka.cea.Mp4CeaParser`,uy);var fy=0,py=1,my=2,hy=3,gy=(/* @__PURE__ */ new Map()).set(`avc1`,py).set(`avc3`,py).set(`dvav`,py).set(`dva1`,py).set(`hev1`,my).set(`hvc1`,my).set(`dvh1`,my).set(`dvhe`,my).set(`vvc1`,hy).set(`vvi1`,hy).set(`dvc1`,hy).set(`dvi1`,hy);Xt(`video/mp4`,function(){return new uy});function _y(){this.g=null}_y.prototype.init=function(){},_y.prototype.parse=function(e){this.g?this.g.clearData():this.g=new jc;var t=[];if(e=Ze(e),!Hc(e))return t;e=this.g.parse(e);var n=e.Td(),r=e.Ze();switch(e=[],n.video){case`avc`:e.push(6);break;case`hvc`:e.push(39),e.push(40)}if(!e.length)return t;for(n=g(r),r=n.next();!r.done;r=n.next())if(r=r.value,e.includes(r.type)&&r.time!=null)for(var i=g(ly(r.data)),a=i.next();!a.done;a=i.next())t.push({packet:a.value,pts:r.time});return t},P(`shaka.cea.TsCeaParser`,_y),Xt(`video/mp2t`,function(){return new _y});function vy(e){var t=0,n=$e(e),r=n.getUint32(t,!0);if(r!=e.byteLength)return[];a:{for(e=t+4+2,t=[];e<n.byteLength-1;){r=n.getUint16(e,!0),e+=2;var i=n.getUint16(e,!0);if(e+=2,i&1||i+e>n.byteLength){n=[];break a}var a=Ze(n,e,i);t.push({type:r,value:a}),e+=i}n=t}return n}function yy(e){return e=Ct(Sn(e)),e=vy(e).filter(function(e){return e.type===xy})[0],e?(e=mt(e.value,!0),(e=gn(e,`WRMHEADER`))?e:null):null}function by(e){try{var t=yy(e);if(t)a:{for(var n=g(wn(t,`DATA`)),r=n.next();!r.done;r=n.next()){var i=r.value;if(i.children)for(var a=g(i.children),o=a.next();!o.done;o=a.next()){var s=o.value;if(s.tagName==`LA_URL`){var c=Sn(s);break a}}}c=``}else c=``;return c}catch{return``}}var xy=1;function Sy(){this.g=/* @__PURE__ */ new Map}Sy.prototype.release=function(){this.g.clear()};function Cy(e,t,n,r){var i=Dy(e,t),a=null;e=[];var o=[];t=null;var s=new Set(i.map(function(e){return e.keyId}));s.delete(null);var c=`cenc`;if(s.size>1)throw new R(2,4,4010);if(!n){if(o=i.filter(function(e){return e.Dd==`urn:mpeg:dash:sea:2012`}),o.length>1)throw new R(2,4,4050);o.length&&(t=ky(o[0])),(o=i.find(function(e){return e.Dd==`urn:mpeg:dash:mp4protection:2011`}))&&o.encryptionScheme&&(c=o.encryptionScheme),o=i.filter(function(e){return e.Dd==`urn:mpeg:dash:mp4protection:2011`?(a=e.init||a,!1):e.Dd!=`urn:mpeg:dash:sea:2012`}),o.length&&(e=Ey(a,c,o,r,s),e.length==0&&(e=[Ot(``,c,a)]))}if(i.length&&!t&&(n||!o.length))for(e=[],n=g(Object.values(r)),r=n.next();!r.done;r=n.next())r=r.value,rt(r)||(r=Ot(r,c,a),e.push(r));if(s=Array.from(s)[0]||null)for(c=g(e),n=c.next();!n.done;n=c.next())for(n=g(n.value.initData),r=n.next();!r.done;r=n.next())r.value.keyId=s;return{Vh:s,Em:a,drmInfos:e,cg:t,$h:!0}}function wy(e,t,n,r,i){var a=Cy(e,t,r,i);if(n.$h)e=n.drmInfos.length==1&&!n.drmInfos[0].keySystem,t=a.drmInfos.length==0,(n.drmInfos.length==0||e&&!t)&&(n.drmInfos=a.drmInfos),n.$h=!1;else if(a.drmInfos.length>0&&(n.drmInfos=n.drmInfos.filter(function(e){return a.drmInfos.some(function(t){return t.keySystem==e.keySystem})}),n.drmInfos.length==0))throw new R(2,4,4008);return a.Vh||n.Vh}function Ty(e){var t=En(e.node,`https://dashif.org/CPS`,`Laurl`);if(t&&(t=Sn(t)))return t;if((t=En(e.node,`urn:microsoft:playready`,`pro`))&&Sn(t))return by(t);if((e=En(e.node,`urn:mpeg:cenc:2013`,`pssh`))&&(e=Sn(e))){t=Ct(e),e=8,t=$e(t);var n=t.getUint8(e);return e+=20,n>0&&(e+=4+16*t.getUint32(e)),e=Ze(t,e+4),e=xt(e),e=gn(`<pro>`+e+`</pro>`),by(e)}return``}function Ey(e,t,n,r,i){var a=[];n=g(n);for(var o=n.next();!o.done;o=n.next()){o=o.value;var s=r[o.Dd];if(s){var c;if((c=En(o.node,`urn:microsoft:playready`,`pro`))&&Sn(c)){c=Sn(c),c=Ct(c);var l=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);c=[{initData:$a(c,l,/* @__PURE__ */ new Set,0),initDataType:`cenc`,keyId:o.keyId}]}else c=null;if(l=null,o.Dd===`urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e`){l=o;var u=i;if(u.size==0)l=null;else{var d=new Uint8Array([16,119,239,236,192,178,77,2,172,227,60,30,82,226,251,75]);l=[{initData:$a(new Uint8Array([]),d,u,1),initDataType:`cenc`,keyId:l.keyId}]}}c=Ot(s,t,o.init||e||c||l),(s=Ay.get(s))&&(c.licenseServerUri=s(o));a:{if((o=En(o.node,`https://dashif.org/CPS`,`Certurl`))&&(o=Sn(o)))break a;o=``}c.serverCertificateUri=o,a.push(c)}}return a}function Dy(e,t){var n=[];t=g(t);for(var r=t.next();!r.done;r=t.next())(r=Oy(e,r.value))&&n.push(r);return n}function Oy(e,t){var n=t.attributes.schemeIdUri,r=Dn(t,`urn:mpeg:cenc:2013`,`default_KID`),i=On(t,`urn:mpeg:cenc:2013`,`pssh`).map(Cn),a=t.attributes.value;if(!n)return null;if(n=n.toLowerCase(),r&&(r=r.replace(/-/g,``).toLowerCase(),r.includes(` `)))throw new R(2,4,4009);var o=[];try{o=i.map(function(t){if(!e.g.has(t)){var n=Ct(t);e.g.set(t,n)}return{initDataType:`cenc`,initData:e.g.get(t),keyId:null}})}catch{throw new R(2,4,4007)}return{node:t,Dd:n,keyId:r,init:o.length>0?o:null,encryptionScheme:a}}function ky(t){if(!e.crypto||!e.crypto.subtle)throw F(`Web Crypto API is not available to decrypt AES-128. (Web Crypto only exists in secure origins like https)`),new R(2,4,4042);var n=En(t.node,`urn:mpeg:dash:schema:sea:2012`,`SegmentEncryption`);if(!n||n.attributes.schemeIdUri!=`urn:mpeg:dash:sea:aes128-cbc:2013`||(n=En(t.node,`urn:mpeg:dash:schema:sea:2012`,`CryptoPeriod`),!n)||(t=n.attributes.IV,n=vt(n.attributes.keyUriTemplate),!t||!n))throw new R(2,4,4051);if(t=wt(t.substr(2)),t.byteLength!=16)throw new R(2,4,4048);return{tk:n,iv:t}}var Ay=(/* @__PURE__ */ new Map()).set(`com.apple.fps`,function(t){if(e.shakaMediaKeysPolyfill===`apple`)throw new R(2,4,4054);return(t=En(t.node,`https://dashif.org/CPS`,`Laurl`))&&(t=Sn(t))?t:``}).set(`com.widevine.alpha`,function(e){var t=En(e.node,`https://dashif.org/CPS`,`Laurl`);return t&&(t=Sn(t))?t:(e=En(e.node,`urn:microsoft`,`laurl`))&&vt(e.attributes.licenseUrl)||``}).set(`com.microsoft.playready`,Ty).set(`com.microsoft.playready.recommendation`,Ty).set(`com.microsoft.playready.software`,Ty).set(`com.microsoft.playready.hardware`,Ty).set(`org.w3.clearkey`,function(e){var t=En(e.node,`https://dashif.org/CPS`,`Laurl`);return t&&(t=Sn(t))?t:(e=En(e.node,`http://dashif.org/guidelines/clearKey`,`Laurl`))&&e.attributes.Lic_type===`EME-1.0`&&e&&(e=Sn(e))?e:``});function jy(t,n,r,i,a,o){var s=(/* @__PURE__ */ new Map()).set(`RepresentationID`,n).set(`Number`,r).set(`SubNumber`,i).set(`Bandwidth`,a).set(`Time`,o);return t.replace(/\$(RepresentationID|Number|SubNumber|Bandwidth|Time)?(?:%0([0-9]+)([diouxX]))?\$/g,function(t,n,r,i){if(t==`$$`)return`$`;var a=s.get(n);if(a==null)return t;switch(n==`RepresentationID`&&r&&(r=void 0),n==`Time`&&typeof a!=`bigint`&&(Math.abs(a-Math.round(a))>=.2&&F(`Calculated $Time$ values must be close to integers`),a=Math.round(a)),i){case void 0:case`d`:case`i`:case`u`:t=a.toString();break;case`o`:t=a.toString(8);break;case`x`:t=a.toString(16);break;case`X`:t=a.toString(16).toUpperCase();break;default:t=a.toString()}return r=e.parseInt(r,10)||1,Array(Math.max(0,r-t.length)+1).join(`0`)+t})}function My(e,t){var n=Py(e,t,`timescale`),r=1;n&&(r=Pn(n)||1),n=Py(e,t,`duration`);var i=(n=Pn(n||``))?n/r:null,a=Py(e,t,`startNumber`),o=Number(Py(e,t,`presentationTimeOffset`))||0,s=Fn(a||``);if((a==null||s==null)&&(s=1),a=null,t=Fy(e,t,`SegmentTimeline`)){t=xn(t,`S`),a=r,e=e.oa.duration||1/0;for(var c=s,l=[],u=-o,d=0;d<t.length;++d){var f=t[d],p=t[d+1],m=B(f,`t`,Fn),h=B(f,`d`,Fn),g=B(f,`r`,Nn);if(f=B(f,`k`,Nn)||0,m!=null&&(m-=o),h){if(m=m??u,g=g||0,g<0){if(p){if(p=B(p,`t`,Fn),p==null||m>=p)break;g=Math.ceil((p-m)/h)-1}else{if(e==1/0||m/a>=e)break;g=Math.ceil((e*a-m)/h)-1}}for(l.length>0&&m!=u&&(l[l.length-1].end=m/a),p=0;p<=g;++p)u=m+h,l.push({start:m/a,Hd:m,end:u/a,Gh:u,sc:f,Vk:l.length+c}),m=u}}a=l}return{timescale:r,Mf:n,gb:i,oe:s,bc:o/r||0,Zc:o,timeline:a}}function Ny(e,t){return[t(e.L),t(e.ra),t(e.va)].filter(ri)}function Py(e,t,n){t=Ny(e,t),e=null,t=g(t);for(var r=t.next();!r.done&&!(e=r.value.attributes[n]);r=t.next());return e}function Fy(e,t,n){t=Ny(e,t),e=null,t=g(t);for(var r=t.next();!r.done&&!(e=Tn(r.value,n));r=t.next());return e}function Iy(e,t,n,r,i,a){for(var o=Dn(e,`http://www.w3.org/1999/xlink`,`href`),s=Dn(e,`http://www.w3.org/1999/xlink`,`actuate`)||`onRequest`,c=g(Object.keys(e.attributes)),l=c.next();!l.done;l=c.next()){l=l.value;var u=l.split(`:`),d=_n(`http://www.w3.org/1999/xlink`);u[0]==d&&delete e.attributes[l]}if(a>=5)return ca(new R(2,4,4028));if(s!=`onLoad`)return ca(new R(2,4,4027));var f=Dt([r],[o]);return i.request(0,Sa(f,t)).Ya(function(r){if(r=hn(r.data,e.tagName),!r)return ca(new R(2,4,4001,o));for(e.children=[];r.children.length;){var s=r.children.shift();e.children.push(s)}s=g(Object.keys(r.attributes));for(var c=s.next();!c.done;c=s.next())c=c.value,e.attributes[c]=r.attributes[c];return Ly(e,t,n,f[0],i,a+1)})}function Ly(e,t,n,r,i,a){if(a=a===void 0?0:a,Dn(e,`http://www.w3.org/1999/xlink`,`href`)){var o=Iy(e,t,n,r,i,a);return n&&(o=o.Ya(void 0,function(){return Ly(e,t,n,r,i,a)})),o}o=[];for(var s=g(bn(e)),c=s.next(),l={};!c.done;l={Od:void 0},c=s.next())l.Od=c.value,Dn(l.Od,`http://www.w3.org/1999/xlink`,`href`)==`urn:mpeg:dash:resolve-to-zero:2013`?e.children=e.children.filter(function(e){return function(t){return t!==e.Od}}(l)):l.Od.tagName!=`SegmentTimeline`&&o.push(Ly(l.Od,t,n,r,i,a));return fa(o).Ya(function(){return e})}function Ry(e,t,n,r,i,a,o,s){var c,l=new Va().ma(`sidx`,function(e){c=zy(t,r,i,a,o,n,e,s)});if(e&&l.parse(e),c)return c;throw new R(2,3,3004)}function zy(e,t,n,r,i,a,o,s){s=s!==void 0&&s;var c=[];o.reader.skip(4);var l=o.reader.V();if(l==0)throw new R(2,3,3005);if(o.version==0)var u=o.reader.V(),d=o.reader.V();else u=o.reader.zd(),d=o.reader.zd();o.reader.skip(2);var f=o.reader.Ea();for(e=(s?-o.size:e)+o.size+d,s=0;s<f;s++){var p=o.reader.V();d=(p&2147483648)>>>31,p&=2147483647;var m=o.reader.V();if(o.reader.skip(4),d==1)throw new R(2,3,3006);c.push(new H(u/l+n,(u+m)/l+n,function(){return a},e,e+p-1,t,n,r,i)),u+=m,e+=p}return o.parser.stop(),c}function By(e){this.h=$e(e),this.g=new Ra(this.h,0)}By.prototype.La=function(){return this.g.La()};function Vy(e){var t=Hy(e);if(t.length>7)throw new R(2,3,3002);var n=0;t=g(t);for(var r=t.next();!r.done;r=t.next())n=256*n+r.value;t=Hy(e);a:{r=g(Uy);for(var i=r.next();!i.done;i=r.next())if(Ye(t,new Uint8Array(i.value))){r=!0;break a}r=!1}if(r)t=e.h.byteLength-e.g.Ra();else{if(t.length==8&&t[1]&224)throw new R(2,3,3001);for(i=r=0;i<t.length;i++){var a=t[i];r=i==0?a&(1<<8-t.length)-1:256*r+a}t=r}return t=e.g.Ra()+t<=e.h.byteLength?t:e.h.byteLength-e.g.Ra(),r=$e(e.h,e.g.Ra(),t),e.g.skip(t),new Wy(n,r)}function Hy(e){var t=e.g.Ra(),n=e.g.Y();if(n==0)throw new R(2,3,3002);return n=8-Math.floor(Math.log2(n)),e.g.skip(n-1),Ze(e.h,t,n)}var Uy=[[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 Wy(e,t){this.id=e,this.g=t}function Gy(e){if(e.g.byteLength>8)throw new R(2,3,3002);if(e.g.byteLength==8&&e.g.getUint8(0)&224)throw new R(2,3,3001);for(var t=0,n=0;n<e.g.byteLength;n++){var r=e.g.getUint8(n);t=256*t+r}return t}function Ky(e,t,n,r,i,a,o){if(t=new By(t),Vy(t).id!=440786851)throw new R(2,3,3008);var s=Vy(t);if(s.id!=408125543)throw new R(2,3,3009);t=s.g.byteOffset,s=new By(s.g);for(var c=null;s.La();){var l=Vy(s);if(l.id==357149030){c=l;break}}if(!c)throw new R(2,3,3010);for(c=new By(c.g),l=1e6,s=null;c.La();){var u=Vy(c);if(u.id==2807729)l=Gy(u);else if(u.id==17545){if(u.g.byteLength==4)s=u.g.getFloat32(0);else if(u.g.byteLength==8)s=u.g.getFloat64(0);else throw new R(2,3,3003)}}if(s==null)throw new R(2,3,3011);if(c=l/1e9,s*=c,e=Vy(new By(e)),e.id!=475249515)throw new R(2,3,3007);return qy(e,t,c,s,n,r,i,a,o)}function qy(e,t,n,r,i,a,o,s,c){function l(){return i}var u=[];e=new By(e.g);for(var d=null,f=null;e.La();){var p=Vy(e);if(p.id==187){var m=Jy(p);m&&(p=n*m.ol,m=t+m.Nk,d!=null&&u.push(new H(d+o,p+o,l,f,m-1,a,o,s,c)),d=p,f=m)}}return d!=null&&u.push(new H(d+o,r+o,l,f,null,a,o,s,c)),u}function Jy(e){var t=new By(e.g);if(e=Vy(t),e.id!=179)throw new R(2,3,3013);if(e=Gy(e),t=Vy(t),t.id!=183)throw new R(2,3,3012);t=new By(t.g);for(var n=0;t.La();){var r=Vy(t);if(r.id==241){n=Gy(r);break}}return{ol:e,Nk:n}}function Yy(e,t,n){if(t=Fy(e,t,`Initialization`),!t)return null;var r=e.L.bb(),i=t.attributes.sourceURL;i&&(r=Dt(r,[vt(i)],e.Hb())),i=0;var a=null;return(t=B(t,`range`,Mn))&&(i=t.start,a=t.end),n=new Gs(function(){return r},i,a,nb(e),null,null,n,e.ra.encrypted),n.codecs=e.L.codecs,n.mimeType=e.L.mimeType,e.oa&&!e.oa.gf&&(n.g=e.oa.start+e.oa.duration),n}function Xy(e,t,n){var r=Number(Py(e,Qy,`presentationTimeOffset`))||0,i=Py(e,Qy,`timescale`),a=1;i&&(a=Pn(i)||1);var o=r/a||0,s=Yy(e,Qy,n);eb(e,s);var c=pn(e);return{endTime:-1,timeline:-1,Nc:function(){var e=Fy(c,Qy,`RepresentationIndex`),n=c.L.bb();return e&&(e=vt(e.attributes.sourceURL))&&(n=Dt(n,[e],c.Hb())),e=$y(c),Zy(c,t,s,n,e.start,e.end,o)},timescale:a}}function Zy(e,t,n,r,i,a,o){var s,c,l,u,d,f,p,m,h,_,v,y,b,x,S,C,w,T,E,D;return k(function(O){if(O.h==1)return s=e.presentationTimeline,c=!e.pb||!e.oa.gf,l=e.oa.start,u=e.oa.duration,d=e.L.mimeType.split(`/`)[1],f=t,p=null,m=[f(r,i,a,!1),d==`webm`?f(n.P(),n.startByte,n.endByte,!0):null],f=null,O.g(Promise.all(m),2);for(h=O.i,_=h[0],v=h[1]||null,y=null,b=l-o,x=l,S=u?l+u:1/0,C=e.L.bb(),w=C.length!=r.length||C.some(function(e,t){return e!=r[t]}),y=d==`mp4`?Ry(_,i,C,n,b,x,S,w):Ky(_,v,C,n,b,x,S),T=g(y),E=T.next();!E.done;E=T.next())D=E.value,D.codecs=e.L.codecs,D.mimeType=e.L.mimeType,D.bandwidth=e.bandwidth;return s.fe(y),p=new uu(y),c&&p.hd(x,S,!0),O.return(p)})}function Qy(e){return e.Ed}function $y(e){var t=Fy(e,Qy,`RepresentationIndex`);return e=Py(e,Qy,`indexRange`),e=Mn(e||``),t&&(e=B(t,`range`,Mn,e)),e}function eb(e,t){if(tb(e,t),!$y(e))throw new R(2,4,4002)}function tb(e,t){var n=e.L.mimeType.split(`/`)[1];if(e.L.contentType!=Nt&&n!=`mp4`&&n!=`webm`)throw new R(2,4,4006);if(n==`webm`&&!t)throw new R(2,4,4005)}function nb(e){var t=e.L;return{bandwidth:e.bandwidth,audioSamplingRate:t.audioSamplingRate,codecs:t.codecs,contentType:t.contentType,frameRate:t.frameRate||null,height:t.height||null,mimeType:t.mimeType,channelsCount:t.vf,pixelAspectRatio:t.pixelAspectRatio||null,width:t.width||null,label:e.ra.label||null,roles:e.roles||null,language:e.ra.language||null}}function rb(e,t,n){var r=Yy(e,ib,n),i=ab(e);if(!i.gb&&!i.timeline&&i.td.length>1||!i.gb&&!e.oa.duration&&!i.timeline&&i.td.length==1||i.timeline&&i.timeline.length==0)throw new R(2,4,4002);var a=null,o=null;e.va.id&&e.L.id&&(o=t.get(e.va.id+`,`+e.L.id))&&(a=o.segmentIndex);var s=ob(e.oa.start,e.oa.duration,e.L.bb,i,r,n,e.L.mimeType,e.L.codecs,e.bandwidth,e.Hb);return t=!a,a?a.ce(s,e.presentationTimeline.Fb()):a=new uu(s),e.presentationTimeline.fe(s),e.pb&&e.oa.gf||a.hd(e.oa.start,e.oa.duration?e.oa.start+e.oa.duration:1/0,t),o&&(o.segmentIndex=a),{endTime:-1,timeline:-1,Nc:function(){return a&&a.getNumReferences()!=0||a.pf(s),Promise.resolve(a)},timescale:i.timescale}}function ib(e){return e.wc}function ab(e){var t=sb(e);e=My(e,ib);var n=e.oe;n==0&&(n=1);var r=0;return e.gb?r=e.gb*(n-1):e.timeline&&e.timeline.length>0&&(r=e.timeline[0].start),{gb:e.gb,startTime:r,oe:n,bc:e.bc,timescale:e.timescale,timeline:e.timeline,td:t}}function ob(e,t,n,r,i,a,o,s,c,l){var u=r.td.length;r.timeline&&r.timeline.length!=r.td.length&&(u=Math.min(r.timeline.length,r.td.length));for(var d=e-r.bc,f=t?e+t:1/0,p=[],m=r.startTime,h={},g=0;g<u;h={Of:void 0,Df:void 0},g++){h.Df=r.td[g];var _=m;m=void 0,m=r.gb==null?r.timeline?r.timeline[g].end:_+t:_+r.gb,h.Of=null,h=new H(e+_,e+m,function(e){return function(){return e.Of??(e.Of=Dt(n(),[e.Df.Ak],l())),e.Of}}(h),h.Df.start,h.Df.end,i,d,e,f,[],``,null,null,Ys,a),h.codecs=s,h.mimeType=o,h.bandwidth=c,p.push(h)}return p}function sb(e){return[e.L.wc,e.ra.wc,e.va.wc].filter(ri).map(function(e){return xn(e,`SegmentURL`)}).reduce(function(e,t){return e.length>0?e:t}).map(function(t){t.attributes.indexRange&&!e.Kg&&(e.Kg=!0);var n=vt(t.attributes.media);return t=B(t,`mediaRange`,Mn,{start:0,end:null}),{Ak:n,start:t.start,end:t.end}})}function cb(e,t,n,r,i,a,o,s,c,l){c||e.L.cf||(e.L.cf=Py(e,lb,`initialization`));var u=e.L.cf?pb(e,o):null,d=ub(e);db(d);var f=pn(e);if(d.Zd)return tb(e,u),{endTime:-1,timeline:-1,Nc:function(){var e=jy(d.Zd,f.L.originalId,null,null,f.bandwidth||null,null);return e=Dt(f.L.bb(),[e]),Zy(f,t,u,e,0,null,d.bc)},timescale:d.timescale};if(d.gb)return r||e.ra.contentType===`image`||e.ra.contentType===`text`||(r=e.oa.start,l=e.va.id,n=e.oa.duration,l=(l=l!=null&&a.get(l)||n)?r+l:1/0,e.presentationTimeline.Ug(d.gb),e.presentationTimeline.Ci(r,l)),{endTime:-1,timeline:-1,Nc:function(){return fb(f,d,i,u,a,o,s,e.L.Ef)},timescale:d.timescale};var p=null;r=r=null,e.va.id&&e.L.id&&(r=e.va.id+`,`+e.L.id,r=n.get(r))&&(p=r.segmentIndex);var m=e.oa.start,h=e.oa.duration?m+e.oa.duration:1/0;if(p)l=p,gb(l,d,m,h,u,e.pb),l.Va(e.presentationTimeline.Fb());else{if(n=0,c=-1,e.va.id!=null&&e.L.id!=null){var _=l.get(e.va.id);if(_)c=_.timeline;else for(l=g(l.values()),_=l.next();!_.done;_=l.next())if(_=_.value,Math.abs(d.bc-_.endTime)<=Ft&&_.fh.includes(e.L.id)){c=_.timeline;break}else _.timeline>=n&&(n=_.timeline+1)}c==-1&&(c=n),p=new hb(e.pb,d,e.L.originalId,e.bandwidth,e.L.bb,e.Hb,m,h,u,o,e.L.Ef,c)}return d.timeline&&e.ra.contentType!==`image`&&e.ra.contentType!==`text`&&e.presentationTimeline.Di(p.h?p.h.timeline:[],m),r&&e.pb&&(r.segmentIndex=p),r=(r=(r=d.timeline)&&r[r.length-1])?r.end+d.bc:-1,l=-1,p instanceof hb&&(l=p.Qe()),{endTime:r,timeline:l,Nc:function(){return p instanceof hb&&p.getNumReferences()==0&&gb(p,d,m,h,u,e.pb),Promise.resolve(p)},timescale:d.timescale}}function lb(e){return e.Jc}function ub(e){var t=My(e,lb),n=Py(e,lb,`media`),r=Py(e,lb,`index`),i=Py(e,lb,`k`),a=0;return i&&(a=parseInt(i,10)),{Mf:t.Mf,gb:t.gb,timescale:t.timescale,oe:t.oe,bc:t.bc,Zc:t.Zc,timeline:t.timeline,Yb:n&&vt(n),Zd:r,mimeType:e.L.mimeType,codecs:e.L.codecs,bandwidth:e.bandwidth,Ck:a}}function db(e){var t=+!!e.Zd;if(t+=+!!e.timeline,t+=+!!e.gb,t==0||(t!=1&&(e.Zd&&(e.timeline=null),e.Mf=null,e.gb=null),!e.Zd&&!e.Yb))throw new R(2,4,4002)}function fb(t,n,r,i,a,o,s,c){function l(r){var a=r-v,s=a*_,l=n.Mf,u=a*l;`BigInt`in e&&u>2**53-1&&(u=BigInt(a)*BigInt(l)),s+=p,a=s+_,l=Math.min(a,d());var f=[],m=n.Ck;if(m)for(var h=(l-s)/m,g={},T=0;T<m;g={Zi:void 0},T++){var E=s+h*T,D=E+h;g.Zi=T,g=new H(E,D,function(e){return function(){var t=jy(y,x,r,e.Zi,b,u);return Dt(S(),[t],C())}}(g),0,null,i,w,p,d(),[],``,null,null,Ys,o),g.codecs=t.L.codecs,g.mimeType=t.L.mimeType,c==0?T>0&&g.rd():T%c!=0&&g.rd(),f.push(g)}return s=new H(s,l,function(){if(m)return[];var e=jy(y,x,r,null,b,u);return Dt(S(),[e],C())},0,null,i,w,p,d(),f,``,null,null,Ys,o,f.length>0),s.codecs=t.L.codecs,s.mimeType=t.L.mimeType,s.bandwidth=t.bandwidth,s.j=a,s}function u(){var e=[Math.max(f.Fb(),p),Math.min(f.Ec(),d())].map(function(e){return e-p});return e=[Math.ceil(e[0]/_),Math.ceil(e[1]/_)-1],t.L.mb&&e[1]++,e.map(function(e){return e+v})}function d(){var e=m!=null&&a.get(m)||h;return e?p+e:1/0}var f=t.presentationTimeline,p=t.oa.start,m=t.va.id,h=t.oa.duration,_=n.gb,v=n.oe,y=n.Yb,b=t.bandwidth||null,x=t.L.originalId,S=t.L.bb,C=t.Hb,w=p-n.bc,T=u();r=t.pb?Math.max(T[0],T[1]-r+1):T[0],s=s||T[1];var E=new mb(r,s,v,p,_,l);T=f.Ec()<d();var D=f.T();if(T||D){var O=Math.max(r,s+1);r=_,t.L.mb&&(r=.1),E.Nf(r,function(){var e=f.Fb();E.Va(e);var t=g(u());t.next(),t=t.next().value;for(var n=[];O<=t;){var r=l(O);n.push(r),O++}return e>d()&&!n.length?null:n})}return Promise.resolve(E)}function pb(e,t){var n=e.L.cf;if(n||(n=Py(e,lb,`initialization`)),!n)return null;n=vt(n);var r=e.L.originalId,i=e.bandwidth||null,a=e.L.bb,o=e.Hb;return t=new Gs(function(){var e=jy(n,r,null,null,i,null);return Dt(a(),[e],o())},0,null,nb(e),null,null,t,e.ra.encrypted),t.codecs=e.L.codecs,t.mimeType=e.L.mimeType,e.oa&&!e.oa.gf&&(t.g=e.oa.start+e.oa.duration),t}function mb(e,t,n,r,i,a){uu.call(this,Array(Math.max(0,t-e+1))),this.h=e,this.u=n,this.j=r,this.l=i,this.B=a}m(mb,uu),r=mb.prototype,r.find=function(e){var t=this.g.length-1;if(t<0)return null;var n=this.get(this.i);if(!n)return null;if(e<n.startTime)return this.i;if(n=Math.floor((e-this.j)/this.l)+this.u-this.h,n<this.i)return null;var r=this.get(n);return r?(t=(t=n-this.i<t?this.get(n+1):null)?t.startTime:r.endTime,e>=r.startTime&&e<t?n:null):null},r.get=function(e){var t=e-this.i;if(t<0||t>=this.g.length)return null;var n=this.g[t];return n||(n=this.B(this.h+e),this.g[t]=n),n},r.Cb=function(){return this.get(this.i)},r.qb=function(e){for(var t=0;t<this.g.length;t++){var n=this.get(t+this.i);n&&e(n)}},r.Va=function(e){if(!this.o){var t=this.g.length-1;if(!(t<0)){var n=this.get(this.i);!n||n.endTime>e||(e=(t=this.get(this.i+t))&&t.endTime<=e?this.g.length:Math.max(0,Math.min(this.g.length,Math.floor((e-this.j)/this.l+this.u-1)-(this.h+this.i)+1)),e>0&&(this.i+=e,this.g=this.g.slice(e)))}}};function hb(e,t,n,r,i,a,o,s,c,l,u,d){uu.call(this,[]),this.D=e,this.h=t,this.H=n,this.C=r,this.G=i,this.J=a,this.j=o,this.l=s,this.u=c,this.B=l,this.I=u,this.K=d,vb(this)}m(hb,uu),r=hb.prototype,r.getNumReferences=function(){return this.h?this.h.timeline.length:0},r.release=function(){uu.prototype.release.call(this),this.h=null},r.Va=function(e){if(this.h){var t=this.h.timeline;if(t){for(var n=0;n<t.length&&t[n].end+this.j<=e;)n++;n>0&&(this.h.timeline=t.slice(n),this.g.length>=n&&(this.g=this.g.slice(n)),this.i+=n,this.getNumReferences()===0&&this.release())}}};function gb(e,t,n,r,i,a){if(_b(e,i),e.D=a,e.h){if(e.h.Zc!==t.Zc)for(n=t.Zc-e.h.Zc,i=0;i<t.timeline.length;i++)a=t.timeline[i],a.Hd+=n,a.Gh+=n,a.start=(a.Hd+n)/t.timescale,a.end=(a.Gh+n)/t.timescale;if(e.h.Yb!==t.Yb&&(e.h.Yb=t.Yb),n=e.h.timeline,n.length){var o=n[n.length-1];t=t.timeline.filter(function(e){return e.end>o.end})}else t=t.timeline.slice();t.length>0&&e.h.timeline.push.apply(e.h.timeline,_(t)),e.l!==r&&(e.l=r)}else e.h=t,e.j=n,e.l=r;vb(e)}function _b(e,t){if(e.u!==t){e.u=t,e=g(e.g);for(var n=e.next();!n.done;n=e.next())(n=n.value)&&Js(n,t)}}function vb(e){if(e.h&&!e.o){for(var t=[],n=g(e.h.timeline),r=n.next();!r.done;r=n.next())r=r.value,r.start>=e.l||r.end<=0||t.push(r);e.h.timeline=t,e.Va(e.j)}}r.find=function(e){var t=this;if(this.h&&this.h.timeline&&this.h.timeline.length&&e<this.h.timeline[0].start+this.j)return this.i;if(!this.h)return null;var n=this.h.timeline;if(e<this.j||e>=this.l)return null;var r=n.length-1,i=ge(n,function(n){return n.start+t.j<=e})-1;if(i<0)return null;var a=n[i],o=a.start+this.j;return n=i<r?n[i+1].start+this.j:this.l===1/0?a.end+this.j:this.l,e>=o&&e<n?i+this.i:null},r.get=function(e){var t=this;if(e-=this.i,e<0||e>=this.getNumReferences()||!this.h)return null;var n=this.g[e];if(!n){n=this.h.timeline[e];var r=n.Vk,i=n.Hd+this.h.Zc,a=this.j-this.h.bc,o=this.j+n.end,s=o;e===this.getNumReferences()-1&&this.l!==1/0&&(s=this.D&&Math.abs(s-this.l)>.1?Math.min(s,this.l):this.l);var c=this.h.codecs,l=this.h.mimeType,u=this.h.bandwidth,d=[],f=!1;if(n.sc&&this.h&&this.h.Yb&&(f=this.h.Yb.includes(`$SubNumber$`)),f){f=(n.end-n.start)/n.sc;for(var p={},m=0;m<n.sc;p={Pf:void 0,$i:void 0},m++){var h=n.start+f*m,g=h+f;p.$i=m,p.Pf=null,p=new H(this.j+h,this.j+g,function(e){return function(){return t.h?(e.Pf??(e.Pf=yb(t.h.Yb,t.H,r,t.C,i,e.$i,t.G,t.J)),e.Pf):[]}}(p),0,null,this.u,a,this.j,this.l,[],``,null,null,Ys,this.B),p.codecs=c,p.mimeType=l,p.bandwidth=u,this.I==0?m>0&&p.rd():m%this.I!=0&&p.rd(),d.push(p)}}n=new H(this.j+n.start,s,function(){return d.length>0||!t.h?[]:yb(t.h.Yb,t.H,r,t.C,i,null,t.G,t.J)},0,null,this.u,a,this.j,this.l,d,``,null,null,Ys,this.B,d.length>0),n.codecs=c,n.mimeType=l,n.j=o,n.bandwidth=u,this.g[e]=n}return n},r.qb=function(e){vb(this);for(var t=0;t<this.getNumReferences();t++){var n=this.get(t+this.i);n&&e(n)}};function yb(e,t,n,r,i,a,o,s){return e=jy(e,t,n,a,r||null,i),Dt(o(),[e],s()).map(function(e){return e.toString()})}r.Qe=function(){return this.K};function bb(e){this.o=null,this.B=e,this.H=new _a,this.i=[],this.h=null,this.m=[],this.C=null,this.G=[],this.D=300,this.l=/* @__PURE__ */ new Map,this.j=/* @__PURE__ */ new Map,this.g=null,this.u=`UNKNOWN`}bb.prototype.configure=function(e){this.o=e},bb.prototype.destroy=function(){return this.B=this.o=null,this.i=[],this.h=null,this.m=[],this.G=[],this.l.clear(),this.g!=null&&(this.g.stop(),this.g=null),this.H.destroy()},bb.prototype.setManifestType=function(e){this.u=e};function xb(e,t){var n,r,i,a,o,s,c;return k(function(l){if(l.h==1)return n=Dt(e.i,[Sb(e,t)]),r=Sa(n,e.o.retryParameters),i=e.B.networkingEngine.request(8,r),va(e.H,i),l.m(2),l.g(i.promise,4);if(l.h!=2)return a=l.i,o=pt(a.data),s=JSON.parse(o),s.VERSION==1&&Cb(e,s,a.uri),l.o(0);if((c=l.l())&&c.code==7001)return l.return();e.g!=null&&(e.g.stop(),e.g=null),e.g=new Qr(function(){xb(e,t)}),e.g.na(e.D),l.j()})}function Sb(e,t){if(!e.m.length)return t;t=new Ne(t);var n=e.C||e.m[0],r=Math.round(e.B.getBandwidthEstimate()),i=t.g;return e.u==`DASH`?(i.add(`_DASH_pathway`,n),i.add(`_DASH_throughput`,String(r))):e.u==`HLS`&&(i.add(`_HLS_pathway`,n),i.add(`_HLS_throughput`,String(r))),qe(i),i.Qd&&Le(t,i),t.toString()}function Cb(e,t,n){e.g!=null&&(e.g.stop(),e.g=null);var r=t[`RELOAD-URI`]||n;e.g=new Qr(function(){xb(e,r)}),(n=t.TTL)&&(e.D=n),e.g.na(e.D),e.m=t[`PATHWAY-PRIORITY`]||[],e.G=t[`PATHWAY-CLONES`]||[]}function wb(e,t,n,r){var i=e.l.get(t);i||(i=/* @__PURE__ */ new Map),i.set(n,r),e.l.set(t,i)}bb.prototype.banLocation=function(e){this.j.set(e,Date.now()+6e4)};function Tb(e,t,n){n=n!==void 0&&n,t=e.l.get(t)||/* @__PURE__ */ new Map;for(var r=[],i=g(e.m),a=i.next(),o={};!a.done;o={wd:void 0},a=i.next())if(o.wd=a.value,a=t.get(o.wd))r.push({Zg:o.wd,location:a});else if(a=e.G.find(function(e){return function(t){return t.Ol==e.wd}}(o))){var s=t.get(a[`BASE-ID`]);s&&(a[`URI-REPLACEMENT`].mj?(s=new Ne(s),Fe(s,a[`URI-REPLACEMENT`].mj),r.push({Zg:o.wd,location:s.toString()})):r.push({Zg:o.wd,location:s}))}for(i=Date.now(),o=g(e.j.keys()),a=o.next();!a.done;a=o.next())a=a.value,s=e.j.get(a),i>s&&e.j.delete(a);if(r=r.filter(function(t){for(var n=g(e.j.keys()),r=n.next();!r.done;r=n.next())if(r.value.includes(new Ne(t.location).Bb))return!1;return!0}),r.length&&(e.C=r[0].Zg),r=r.map(function(e){return e.location}),!r.length&&e.h)for(i=g(e.h.split(`,`)),o=i.next();!o.done;o=i.next())(o=t.get(o.value))&&(e.C=e.h,r.push(o));if(!r.length)for(t=g(t.values()),i=t.next();!i.done;i=t.next())r.push(i.value);return n?r:Dt(e.i,r)}function Eb(){this.l=[],this.h=[],this.g=[],this.j=[],this.i=[],this.o=!1,this.m=/* @__PURE__ */ new Set}r=Eb.prototype,r.release=function(){for(var e=g(this.h.concat(this.g,this.j,this.i)),t=e.next();!t.done;t=e.next())t=t.value,t.segmentIndex&&t.segmentIndex.release();this.h=[],this.g=[],this.j=[],this.i=[],this.l=[],this.o=!1,this.m.clear()},r.dk=function(){return this.l},r.Ig=function(){return this.j.slice()},r.Kj=function(){return this.i},r.Wh=function(e,t){if(e){if(e.type==`audio`)for(var n=g(this.h),r=n.next();!r.done;r=n.next())r=r.value,r.matchedStreams=r.matchedStreams.filter(function(t){return t!==e});else if(e.type==`video`)for(n=g(this.g),r=n.next();!r.done;r=n.next())r=r.value,r.matchedStreams=r.matchedStreams.filter(function(t){return t!==e}),r.trickModeVideo&&(r.trickModeVideo.matchedStreams=r.trickModeVideo.matchedStreams.filter(function(t){return t!==e})),r.dependencyStream&&(r.dependencyStream.matchedStreams=r.dependencyStream.matchedStreams.filter(function(t){return t!==e}));else if(e.type==Nt)for(n=g(this.j),r=n.next();!r.done;r=n.next())r=r.value,r.matchedStreams=r.matchedStreams.filter(function(t){return t!==e});else if(e.type==`image`)for(n=g(this.i),r=n.next();!r.done;r=n.next())r=r.value,r.matchedStreams=r.matchedStreams.filter(function(t){return t!==e});e.segmentIndex&&e.closeSegmentIndex(),this.m.delete(t)}};function Db(e,t){var n=[],r=[],i=[],a=[];e=g(e);for(var o=e.next();!o.done;o=e.next()){var s=o.value;o=new Map(s.audioStreams.map(function(e){return[tx(e),e]}));var c=new Map(s.videoStreams.map(function(e){return[ex(e),e]})),l=new Map(s.textStreams.map(function(e){return[nx(e),e]}));if(s=new Map(s.imageStreams.map(function(e){return[rx(e),e]})),t){var u=Yb(Nt);l.set(nx(u),u),u=Yb(`image`),s.set(rx(u),u)}n.push(o),r.push(c),i.push(l),a.push(s)}return{Ph:n,kj:r,ej:i,mi:a}}r.gg=function(e,t,n){n=n!==void 0&&n;var r=this,i,a,o,s,c,l,u,d,f,p,m,h,_,v,y,b,x,S,C,w,T,E,D,O,A,j,M,ee,te,N,ne,re;return k(function(k){if(k.h==1){if(i=Pt,!t&&e.length==1)return a=Db(e,!1),o=a.Ph,s=a.kj,c=a.ej,l=a.mi,r.h=Array.from(o[0].values()),r.g=Array.from(s[0].values()),r.j=Array.from(c[0].values()),r.i=Array.from(l[0].values()),k.A(2);for(u=n?r.m.size:0,d=-1,f=0;f<e.length;f++)p=e[f],r.m.has(p.id)||(r.m.add(p.id),d==-1&&(d=f));return d==-1?k.return():(m=Db(e,!0),h=m.Ph,_=m.kj,v=m.ej,y=m.mi,k.g(Promise.all([kb(r,r.h,h,d,Pb,Ib,u),kb(r,r.g,_,d,Pb,Ib,u),kb(r,r.j,v,d,Pb,Ib,u),kb(r,r.i,y,d,Pb,Ib,u)]),2))}if(b=0,x=[],r.g.length&&r.h.length)for(O=g(r.h),A=O.next();!A.done;A=O.next())for(j=A.value,M=g(r.g),ee=M.next();!ee.done;ee=M.next())te=ee.value,N=nt(j.drmInfos,te.drmInfos),j.drmInfos.length&&te.drmInfos.length&&!N.length||(ne=(j.bandwidth||0)+(te.bandwidth||0),j.dependencyStream&&(ne+=j.dependencyStream.bandwidth||0),te.dependencyStream&&(ne+=te.dependencyStream.bandwidth||0),re=b++,x.push({id:re,language:j.language,disabledUntilTime:0,primary:j.primary,audio:j,video:te,bandwidth:ne,drmInfos:N,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]}));else for(S=r.g.length?r.g:r.h,C=g(S),w=C.next();!w.done;w=C.next())T=w.value,E=b++,D=T.bandwidth||0,T.dependencyStream&&(D+=T.dependencyStream.bandwidth||0),x.push({id:E,language:T.language,disabledUntilTime:0,primary:T.primary,audio:T.type==i.$?T:null,video:T.type==i.wa?T:null,bandwidth:D,drmInfos:T.drmInfos,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});r.l=x,k.j()})};function Ob(e){var t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,_,v,y,b,x,S,C,w,T,E,D,O,A,j,M;return k(function(k){switch(k.h){case 1:if(t=Pt,e.length==1)return k.return(e[0]);for(n=e.map(function(e){return new Map(e.filter(function(e){return e.type===t.$}).map(function(e){return[tx(e),e]}))}),r=e.map(function(e){return new Map(e.filter(function(e){return e.type===t.wa}).map(function(e){return[ex(e),e]}))}),i=e.map(function(e){return new Map(e.filter(function(e){return e.type===t.Pa}).map(function(e){return[nx(e),e]}))}),a=e.map(function(e){return new Map(e.filter(function(e){return e.type===t.Uf}).map(function(e){return[rx(e),e]}))}),o=g(i),s=o.next();!s.done;s=o.next())c=s.value,l=Jb(t.Pa),c.set(nx(l),l);for(u=g(a),d=u.next();!d.done;d=u.next())f=d.value,p=Jb(t.Uf),f.set(rx(p),p);return m=new Eb,k.g(kb(m,[],n,0,Fb,Lb,0),2);case 2:return h=k.i,k.g(kb(m,[],r,0,Fb,Lb,0),3);case 3:return _=k.i,k.g(kb(m,[],i,0,Fb,Lb,0),4);case 4:return v=k.i,k.g(kb(m,[],a,0,Fb,Lb,0),5);case 5:if(y=k.i,b=0,_.length&&h.length)for(T=g(h),E=T.next();!E.done;E=T.next())for(D=E.value,O=g(_),A=O.next();!A.done;A=O.next())j=A.value,M=b++,j.variantIds.push(M),D.variantIds.push(M);else for(x=_.concat(h),S=g(x),C=S.next();!C.done;C=S.next())w=C.value,w.variantIds=[b++];return k.return(_.concat(h).concat(v).concat(y))}})}function kb(e,t,n,r,i,a,o){var s,c,l,u,d,f,p,m,h,_,v,y,b,x,S,C,w,T,E;return k(function(D){switch(D.h){case 1:for(s=[],c=0;c<n.length;c++)c>=r?s.push(new Set(n[c].values())):s.push(/* @__PURE__ */ new Set);l=g(t),u=l.next();case 2:if(u.done){D.A(4);break}return d=u.value,D.g(Ab(e,d,n,r,a,s,o),5);case 5:if(f=D.i,!f)throw new R(2,4,4037);u=l.next(),D.A(2);break;case 4:for(p=g(s),m=p.next();!m.done;m=p.next())for(h=m.value,_=g(h),v=_.next();!v.done;v=_.next())y=v.value,(b=Mb(e,t,y,n,i,a,s))&&t.push(b);for(x=g(s),S=x.next();!S.done;S=x.next())for(C=S.value,w=g(C),T=w.next(),E={};!T.done;E={wh:void 0},T=w.next())if(E.wh=T.value,!$b(E.wh)&&t.some(function(e){return function(t){return Vb(e.wh,t)}}(E)))throw new R(2,4,4037);return D.return(t)}})}function Ab(e,t,n,r,i,a,o){return k(function(s){return s.h==1?(Rb(e,n,t,o>0),t.matchedStreams?t.segmentIndex?s.g(jb(t,r+o),2):s.A(2):s.return(!1)):(Nb(t,r,i,a,o),s.return(!0))})}function jb(e,t){var n,r,i,a,o,s;return k(function(c){if(c.h==1){for(n=[],r=e.matchedStreams,i=t;i<r.length;i++)a=r[i],n.push(a.createSegmentIndex()),a.trickModeVideo&&!a.trickModeVideo.segmentIndex&&n.push(a.trickModeVideo.createSegmentIndex()),a.dependencyStream&&!a.dependencyStream.segmentIndex&&n.push(a.dependencyStream.createSegmentIndex());return c.g(Promise.all(n),2)}if(e.segmentIndex instanceof pu)for(o=t;o<r.length;o++)s=r[o],s.segmentIndex&&e.segmentIndex.h.push(s.segmentIndex);c.j()})}function Mb(e,t,n,r,i,a,o){if($b(n))return null;var s=i(n);return Rb(e,r,s),s.createSegmentIndex&&(s.createSegmentIndex=function(){return k(function(e){return s.segmentIndex?e.A(0):(s.segmentIndex=new pu,e.g(jb(s,0),0))})},s.closeSegmentIndex=function(){if(s.segmentIndex&&(s.segmentIndex.release(),s.segmentIndex=null),s.matchedStreams)for(var e=g(s.matchedStreams),n=e.next();!n.done;n=e.next()){n=n.value;var r;if(r=n.segmentIndex){a:{r=g(t);for(var i=r.next();!i.done;i=r.next())if(i=i.value,i!==s&&i.segmentIndex&&i.matchedStreams&&i.matchedStreams.includes(n)){r=!0;break a}r=!1}r=!r}r&&(n.segmentIndex.release(),n.segmentIndex=null)}}),!s.matchedStreams||!s.matchedStreams.length?null:(Nb(s,0,a,o,0),s)}function Nb(e,t,n,r,i){var a=e.matchedStreams;for(t+=i;t<a.length;t++){var o=a[t];n(e,o);var s=!0;if(e.type==`audio`&&ui(e.language,o.language)==0&&(s=!1),s&&((s=r[t-i])&&s.delete(o),o.fullMimeTypes))for(o=g(o.fullMimeTypes.values()),s=o.next();!s.done;s=o.next())e.fullMimeTypes.add(s.value)}}function Pb(e){var t=Object.assign({},e);return t.originalId=null,t.createSegmentIndex=function(){return Promise.resolve()},t.closeSegmentIndex=function(){},t.roles=t.roles.slice(),t.segmentIndex=null,t.emsgSchemeIdUris=[],t.keyIds=new Set(e.keyIds),t.closedCaptions=e.closedCaptions?new Map(e.closedCaptions):null,t.trickModeVideo=null,t.dependencyStream=null,t}function Fb(e){var t=Object.assign({},e);return t.roles=t.roles.slice(),t.keyIds=new Set(e.keyIds),t.segments=[],t.variantIds=[],t.closedCaptions=e.closedCaptions?new Map(e.closedCaptions):null,t}function Ib(e,t){function n(e,t){e||(e=[]),t=g(t);for(var n=t.next();!n.done;n=t.next())n=n.value,e.includes(n)||e.push(n);return e}e.roles=n(e.roles,t.roles),t.emsgSchemeIdUris&&(e.emsgSchemeIdUris=n(e.emsgSchemeIdUris,t.emsgSchemeIdUris));for(var r=g(t.keyIds),i=r.next();!i.done;i=r.next())e.keyIds.add(i.value);if(e.originalId==null?e.originalId=t.originalId:(r=t.originalId||``)&&!e.originalId.endsWith(r)&&(e.originalId+=`,`+r),r=nt(e.drmInfos,t.drmInfos),t.drmInfos.length&&e.drmInfos.length&&!r.length)throw new R(2,4,4038);if(e.drmInfos=r,e.encrypted=e.encrypted||t.encrypted,t.closedCaptions)for(e.closedCaptions||(e.closedCaptions=/* @__PURE__ */ new Map),r=g(t.closedCaptions),i=r.next();!i.done;i=r.next()){var a=g(i.value);i=a.next().value,a=a.next().value,e.closedCaptions.set(i,a)}e.bandwidth&&t.bandwidth&&(e.bandwidth=Math.max(e.bandwidth,t.bandwidth)),t.trickModeVideo?(e.trickModeVideo||(e.trickModeVideo=Pb(t.trickModeVideo),e.trickModeVideo.matchedStreams=[],e.trickModeVideo.createSegmentIndex=function(){if(e.trickModeVideo.segmentIndex)return Promise.resolve();for(var t=new pu,n=g(e.trickModeVideo.matchedStreams),r=n.next();!r.done;r=n.next())t.h.push(r.value.segmentIndex);return e.trickModeVideo.segmentIndex=t,Promise.resolve()}),e.trickModeVideo.matchedStreams.push(t.trickModeVideo),Ib(e.trickModeVideo,t.trickModeVideo)):e.trickModeVideo&&(e.trickModeVideo.matchedStreams.push(t),Ib(e.trickModeVideo,t)),t.dependencyStream?(e.dependencyStream||(e.dependencyStream=Pb(t.dependencyStream),e.dependencyStream.matchedStreams=[],e.dependencyStream.createSegmentIndex=function(){if(e.dependencyStream.segmentIndex)return Promise.resolve();for(var t=new pu,n=g(e.dependencyStream.matchedStreams),r=n.next();!r.done;r=n.next())t.h.push(r.value.segmentIndex);return e.dependencyStream.segmentIndex=t,Promise.resolve()}),e.dependencyStream.matchedStreams.push(t.dependencyStream),Ib(e.dependencyStream,t.dependencyStream)):e.dependencyStream&&(e.dependencyStream.matchedStreams.push(t),Ib(e.dependencyStream,t))}function Lb(e,t){var n=e.roles;n||(n=[]);for(var r=g(t.roles),i=r.next();!i.done;i=r.next())i=i.value,n.includes(i)||n.push(i);for(e.roles=n,n=g(t.keyIds),r=n.next();!r.done;r=n.next())e.keyIds.add(r.value);if(e.encrypted=e.encrypted&&t.encrypted,e.segments.push.apply(e.segments,_(t.segments)),t.closedCaptions)for(e.closedCaptions||(e.closedCaptions=/* @__PURE__ */ new Map),t=g(t.closedCaptions),n=t.next();!n.done;n=t.next())r=g(n.value),n=r.next().value,r=r.next().value,e.closedCaptions.set(n,r)}function Rb(e,t,n,r){r=r!==void 0&&r?n.matchedStreams:[],t=g(t);for(var i=t.next();!i.done;i=t.next()){if(i=zb(e,i.value,n),!i)return;r.push(i)}n.matchedStreams=r}function zb(e,t,n){var r={audio:tx,video:ex,text:nx,image:rx}[n.type],i=null,a=r(n);if(t.has(a))i=t.get(a);else{a={audio:function(e,t){return Vb(e,t)},video:function(e,t){return Vb(e,t)},text:Hb,image:Ub}[n.type];for(var o={audio:Wb,video:Gb,text:Kb,image:qb}[n.type],s=g(t.values()),c=s.next();!c.done;c=s.next())c=c.value,!a(n,c)||n.fastSwitching!=c.fastSwitching||i&&!o(n,i,c)||(i=c)}return e.o&&!$b(i)&&t.delete(r(i)),i}function Bb(e,t){return e.mimeType==t.mimeType&&ax(e.codecs)===ax(t.codecs)}r.Ui=function(e){this.o=e};function Vb(e,t){return!(e.drmInfos&&!tt(e.drmInfos,t.drmInfos))}function Hb(e,t){return!t.language||e.forced===t.forced&&ui(e.language,t.language)!=0&&t.kind==e.kind}function Ub(){return!0}function Wb(e,t,n){var r=Zb(e,t,n);if(r===ox)return!0;if(r===cx)return!1;r=ui(e.language,t.language);var i=ui(e.language,n.language);if(i>r)return!0;if(i<r)return!1;if(t.label!==n.label){if(e.label===t.label)return!1;if(e.label===n.label)return!0}if(e.roles.length){if(r=t.roles.filter(function(t){return e.roles.includes(t)}),i=n.roles.filter(function(t){return e.roles.includes(t)}),i.length>r.length)return!0;if(i.length<r.length)return!1;if(n.roles.length!==t.roles.length)return n.roles.length<t.roles.length}else{if(!n.roles.length&&t.roles.length)return!0;if(n.roles.length&&!t.roles.length)return!1}return!t.primary&&n.primary?!0:t.primary&&!n.primary?!1:(r=Xb(e.channelsCount,t.channelsCount,n.channelsCount),r==ox||r!=cx&&(r=Xb(e.audioSamplingRate,t.audioSamplingRate,n.audioSamplingRate),r==ox||r!=cx&&!!(e.bandwidth&&Qb(e.bandwidth,t.bandwidth,n.bandwidth)==ox)))}function Gb(e,t,n){var r=Zb(e,t,n);if(r===ox)return!0;if(r===cx)return!1;if(r=Xb(e.width*e.height,t.width*t.height,n.width*n.height),r==ox)return!0;if(r==cx)return!1;if(e.frameRate){if(r=Xb(e.frameRate,t.frameRate,n.frameRate),r==ox)return!0;if(r==cx)return!1}return!!(e.bandwidth&&Qb(e.bandwidth,t.bandwidth,n.bandwidth)==ox)}function Kb(e,t,n){var r=ui(e.language,t.language),i=ui(e.language,n.language);if(i>r)return!0;if(i<r)return!1;if(!t.primary&&n.primary)return!0;if(t.primary&&!n.primary)return!1;if(t.label!==n.label){if(e.label===t.label)return!1;if(e.label===n.label)return!0}if(e.roles.length){if(r=t.roles.filter(function(t){return e.roles.includes(t)}),i=n.roles.filter(function(t){return e.roles.includes(t)}),i.length>r.length)return!0;if(i.length<r.length)return!1}else{if(!n.roles.length&&t.roles.length)return!0;if(n.roles.length&&!t.roles.length)return!1}return!(n.mimeType!=e.mimeType||n.codecs!=e.codecs||t.mimeType==e.mimeType&&t.codecs==e.codecs)}function qb(e,t,n){return Xb(e.width*e.height,t.width*t.height,n.width*n.height)==ox}function Jb(e){return{id:0,originalId:``,groupId:null,primary:!1,type:e,mimeType:``,codecs:``,language:``,originalLanguage:null,label:null,width:null,height:null,encrypted:!1,keyIds:/* @__PURE__ */ new Set,segments:[],variantIds:[],roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,external:!1,fastSwitching:!1,isAudioMuxedInVideo:!1,baseOriginalId:null}}function Yb(e){return{id:0,originalId:``,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new uu([]),mimeType:``,codecs:``,encrypted:!1,drmInfos:[],keyIds:/* @__PURE__ */ new Set,language:``,originalLanguage:null,label:null,type:e,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!1,fastSwitching:!1,fullMimeTypes:/* @__PURE__ */ new Set,isAudioMuxedInVideo:!1,baseOriginalId:null}}function Xb(e,t,n){if(t==e&&e!=n)return cx;if(n==e&&e!=t)return ox;if(t>e){if(n<=e||n-e<t-e)return ox;if(n-e>t-e)return cx}else{if(n>e)return cx;if(e-n<e-t)return ox;if(e-n>e-t)return cx}return sx}function Zb(e,t,n){var r=e.mimeType===t.mimeType&&e.codecs===t.codecs,i=e.mimeType===n.mimeType&&e.codecs===n.codecs;return r&&!i?cx:!r&&i?ox:(t=Bb(e,t),e=Bb(e,n),t&&!e?cx:!t&&e?ox:sx)}function Qb(e,t,n){return t=Math.abs(e-t),e=Math.abs(e-n),e<t?ox:t<e?cx:sx}function $b(e){switch(e.type){case Nt:return!e.language;case`image`:return!e.tilesLayout;default:return!1}}function ex(e){return ix([e.fastSwitching,e.width,e.frameRate,e.codecs,e.mimeType,e.label,e.roles,e.closedCaptions?Array.from(e.closedCaptions.entries()):null,e.bandwidth,e.dependencyStream?e.dependencyStream.baseOriginalId:null,Array.from(e.keyIds)])}function tx(e){return ix([e.fastSwitching,e.channelsCount,e.language,e.bandwidth,e.label,e.codecs,e.mimeType,e.roles,e.audioSamplingRate,e.primary,e.dependencyStream?e.dependencyStream.baseOriginalId:null,Array.from(e.keyIds)])}function nx(e){return ix([e.language,e.label,e.codecs,e.mimeType,e.bandwidth,e.roles])}function rx(e){return ix([e.width,e.codecs,e.mimeType])}function ix(e){return JSON.stringify(e)}function ax(e){if(!lx.has(e)){var t=Nr(e);lx.set(e,t)}return lx.get(e)}P(`shaka.util.PeriodCombiner`,Eb),Eb.prototype.setUseStreamOnce=Eb.prototype.Ui,Eb.prototype.combinePeriods=Eb.prototype.gg,Eb.prototype.deleteStream=Eb.prototype.Wh,Eb.prototype.getImageStreams=Eb.prototype.Kj,Eb.prototype.getTextStreams=Eb.prototype.Ig,Eb.prototype.getVariants=Eb.prototype.dk;var ox=1,sx=0,cx=-1,lx=/* @__PURE__ */ new Map;function ux(e,t){var n=new DOMParser,r=fx.value()(e);e=null;try{e=n.parseFromString(r,`text/xml`)}catch{return null}if(n=e.documentElement,!n||n.getElementsByTagName(`parsererror`).length||n.tagName!=t)return null;if(!(`createNodeIterator`in document))return n;for(t=document.createNodeIterator(e,NodeFilter.SHOW_ALL);e=t.nextNode();)if(e instanceof HTMLElement||e instanceof SVGElement)return null;return n}function dx(e,t){try{return ux(ht(e),t)}catch{return null}}var fx=new Ce(function(){if(typeof trustedTypes<`u`){var e=trustedTypes.createPolicy(`shaka-player#xml`,{createHTML:function(e){return e}});return function(t){return e.createHTML(t)}}return function(e){return e}});function px(){var e=this;this.j=this.g=null,this.B=[],this.h=null,this.Ka=1,this.I=[],this.l={rf:``,type:``,profiles:[],nc:null,mb:0,bb:null,je:0},this.u=/* @__PURE__ */ new Map,this.C=/* @__PURE__ */ new Map,this.H=/* @__PURE__ */ new Map,this.o=/* @__PURE__ */ new Map,this.G=/* @__PURE__ */ new Map,this.Ca=/* @__PURE__ */ new Map,this.m=new Eb,this.M=0,this.Ha=new ie(5),this.N=new Qr(function(){e.K&&!e.g.continueLoadingWhenPaused&&(e.J.Oa(e.K,`timeupdate`),e.K.paused)?e.J.Ba(e.K,`timeupdate`,function(){return Nx(e)}):Nx(e)}),this.S=new _a,this.R=null,this.D=[],this.ia=1/0,this.ya=!1,this.i=null,this.O=0,this.U=!1,this.J=new I,this.K=null,this.W=!1,this.aa=``,this.ua=function(){return!1},this.Z=[],this.qa=/* @__PURE__ */ new Set,this.za=new Sy}r=px.prototype,r.configure=function(e,t){var n=this.j&&e.updatePeriod!=this.g.updatePeriod&&e.updatePeriod>=0;this.g=e,t&&(this.ua=t),n&&this.h&&this.h.presentationTimeline.T()&&this.N.yb(),this.i&&this.i.configure(this.g),this.m&&this.m.Ui(this.g.dash.useStreamOnceInPeriodFlattening)},r.start=function(e,t){var n=this,r;return k(function(i){if(i.h==1)return n.ya=t.isLowLatencyMode(),n.B=[e],n.j=t,i.g(mx(n),2);if(r=i.i,n.j&&Px(n,r),!n.j)throw new R(2,7,7001);return i.return(n.h)})},r.stop=function(){for(var e=g(this.o.values()),t=e.next();!t.done;t=e.next())t=t.value,t.segmentIndex&&t.segmentIndex.release();return this.m&&this.m.release(),this.g=this.j=null,this.B=[],this.h=null,this.o.clear(),this.G.clear(),this.u.clear(),this.C.clear(),this.H.clear(),this.l={rf:``,type:``,profiles:[],nc:null,mb:0,bb:null,je:0},this.m=null,this.N!=null&&(this.N.stop(),this.N=null),this.i&&this.i.destroy(),this.J&&(this.J.release(),this.J=null),this.qa.clear(),this.za.release(),this.S.destroy()},r.update=function(){var e=this,t;return k(function(n){if(n.h==1)return n.m(2),n.g(mx(e),4);if(n.h!=2)return n.o(0);if(t=n.l(),!e.j||!t)return n.return();e.j.onError(t),n.j()})},r.onExpirationUpdated=function(){},r.onInitialVariantChosen=function(e){if(this.h&&this.h.presentationTimeline.T()){var t=e.video||e.audio;if(t&&t.segmentIndex){e=this.h.presentationTimeline.Ec();var n=t.segmentIndex.find(e);n!=null&&(t=t.segmentIndex.get(n))&&(this.M=t.endTime-e,Px(this,0))}}},r.banLocation=function(e){this.i&&this.i.banLocation(e)},r.setMediaElement=function(e){this.K=e};function mx(e){var t,n,r,i,a,o,s,c,l,u,d;return k(function(f){return f.h==1?(t=4,n=`MPD`,r=Gx(e),i=e.B,r.length?(i=r,n=`Patch`,t=6):e.B.length>1&&e.i&&(a=Tb(e.i,`Location`,!0),a.length&&(i=a)),o=Sa(i,e.g.retryParameters),s=Date.now(),f.g(Wx(e,o,0,{type:t}),2)):f.h==3?(u=Date.now(),d=(u-s)/1e3,e.Ha.sample(1,d),e.qa.clear(),f.return(d)):(c=f.i,e.j?(c.uri&&c.uri!=c.originalUri&&!e.B.includes(c.uri)&&e.B.unshift(c.uri),l=new Ne(c.uri),e.aa=l.g.toString(),f.g(hx(e,c.data,c.uri,n),3)):f.return(0))})}function hx(e,t,n,r){var i,a,o,s,c,l,u,d,f,p;return k(function(m){if(m.h==1){if(i=t,a=e.g.dash.manifestPreprocessor,o=hf,a!=o){if(L(`manifest.dash.manifestPreprocessor configuration`,`Please Use manifest.dash.manifestPreprocessorTXml instead.`),s=dx(i,r),!s)throw new R(2,4,4001,n);a(s),i=gt(s.outerHTML)}if(c=hn(i,r),!c)throw new R(2,4,4001,n);return l=e.g.dash.manifestPreprocessorTXml,u=gf,l!=u&&l(c),r===`Patch`?m.return(vx(e,c)):e.g.dash.disableXlinkProcessing?m.return(gx(e,c,n)):(d=e.g.dash.xlinkFailGracefully,f=Ly(c,e.g.retryParameters,d,n,e.j.networkingEngine),va(e.S,f),m.g(f.promise,2))}return p=m.i,m.return(gx(e,p,n))})}function gx(e,t,n){var r,i,a,o,s,c,l,u,d,f,p,m,h,v,y,b,x,S,C,w,T,E,D,O,A,j,M,ee,te,N,ne,re,P,ie,ae,oe,se,ce,F,le,ue,de,fe,pe,me,he,ge,_e,ve,I,ye,be,xe,Se,Ce;return k(function(k){switch(k.h){case 1:for(e.i&&e.i.l.clear(),r=[n],i=[],a=/* @__PURE__ */ new Map,o=xn(t,`Location`),s=g(o),c=s.next();!c.done;c=s.next())l=c.value,u=l.attributes.serviceLocation,(d=Cn(l))&&(f=Dt(r,[d])[0],u&&(e.i?wb(e.i,`Location`,u,f):a.set(u,f)),i.push(f));if(e.i?(p=Tb(e.i,`Location`,!0),p.length>0&&(r=e.B=p)):i.length&&(r=e.B=i),e.l.rf=t.attributes.id||``,e.l.je=B(t,`publishTime`,An)||0,e.I=xn(t,`PatchLocation`),m=Promise.resolve(),(h=Tn(t,`ContentSteering`))&&e.j)for(v=h.attributes.defaultServiceLocation,e.i?(e.i.i=r,e.i.h=v):(e.i=new bb(e.j),e.i.configure(e.g),e.i.setManifestType(`DASH`),e.i.i=r,e.i.h=v,(y=Cn(h))&&(B(h,`queryBeforeStart`,Ln,!1)?m=xb(e.i,y):xb(e.i,y))),b=g(a.keys()),x=b.next();!x.done;x=b.next())S=x.value,C=a.get(S),wb(e.i,`Location`,S,C);if(w=xn(t,`BaseURL`),T=!1,e.i)for(E=g(w),D=E.next();!D.done;D=E.next())O=D.value,A=O.attributes.serviceLocation,j=Cn(O),A&&j&&(wb(e.i,`BaseURL`,A,j),T=!0);if(e.Z.splice(0),T&&e.i||(M=w.map(Cn),e.Z.push.apply(e.Z,_(Dt(r,M)))),ee=e.i,te=e.Z,N=qx,ne=N.call(px,ee,T,te),e.l.bb=ne,re=0,w&&w.length&&(re=B(w[0],`availabilityTimeOffset`,In)||0),e.l.mb=re,e.M=B(t,`minimumUpdatePeriod`,jn,-1),P=B(t,`availabilityStartTime`,An),ie=B(t,`timeShiftBufferDepth`,jn),ae=e.g.dash.ignoreSuggestedPresentationDelay,oe=null,ae||(oe=B(t,`suggestedPresentationDelay`,jn)),se=e.g.dash.ignoreMaxSegmentDuration,ce=null,se||(ce=B(t,`maxSegmentDuration`,jn)),F=t.attributes.type||`static`,e.h&&e.h.presentationTimeline&&(e.W=e.h.presentationTimeline.T()&&F==`static`),e.l.type=F,e.h)for(le=e.h.presentationTimeline,ue=le.Fb(),de=g(e.o.values()),fe=de.next();!fe.done;fe=de.next())pe=fe.value,pe.segmentIndex&&pe.segmentIndex.Va(ue);else me=e.g.dash.ignoreMinBufferTime,he=0,me||(he=B(t,`minBufferTime`,jn)||0),ge=0,ge=oe==null?e.g.defaultPresentationDelay>0?e.g.defaultPresentationDelay:Math.min(he*1.5,ie||1/0):Math.min(oe,ie||1/0),le=new G(P,ge,e.g.dash.autoCorrectDrift);return le.Vc(F==`static`),le.T()&&!isNaN(e.g.availabilityWindowOverride)&&(ie=e.g.availabilityWindowOverride),ie??(ie=1/0),le.Hf(ie),_e=t.attributes.profiles||``,e.l.profiles=_e.split(`,`),ve={pb:F!=`static`,presentationTimeline:le,va:null,oa:null,ra:null,L:null,bandwidth:0,Kg:!1,mb:re,nc:null,profiles:_e.split(`,`),roles:null,Hb:Kx},k.g(m,2);case 2:return e.O=0,I=Sx(e,ve,ne,t,!1),ye=I.duration,be=I.periods,(F!=`static`||e.W)&&I.Yh||le.wb(ye||1/0),e.U&&e.ya&&le.Qi(e.ia),le.Ug(ce||1),e.U&&e.ya&&(xe=oe??e.g.defaultPresentationDelay,le.qh(xe)),e.h?(e.h.periodCount=be.length,e.h.gapCount=e.O,k.g(_x(e,be,!1),4)):k.g(e.m.gg(be,ve.pb),6);case 6:var we=le,Te=e.m.l,Ee=e.m.Ig(),De=e.m.i,Oe=e.g.dash.sequenceMode,L=Tn(t,`ServiceDescription`);if(L){var ke=Tn(L,`Latency`);if(L=Tn(L,`PlaybackRate`),ke||L){var Ae={};ke&&(`target`in ke.attributes&&(Ae.targetLatency=parseInt(ke.attributes.target,10)/1e3),`max`in ke.attributes&&(Ae.maxLatency=parseInt(ke.attributes.max,10)/1e3),`min`in ke.attributes&&(Ae.minLatency=parseInt(ke.attributes.min,10)/1e3)),L&&(`max`in L.attributes&&(Ae.maxPlaybackRate=parseFloat(L.attributes.max)),`min`in L.attributes&&(Ae.minPlaybackRate=parseFloat(L.attributes.min))),ke=Ae}else ke=null}else ke=null;a:{if(L=xn(t,`SupplementalProperty`),L.length){for(L=g(L),Ae=L.next();!Ae.done;Ae=L.next())if(Ae=Ae.value,Ae.attributes.schemeIdUri==`urn:mpeg:dash:chaining:2016`){L=Ae.attributes.value;break a}}L=null}if(e.h={presentationTimeline:we,variants:Te,textStreams:Ee,imageStreams:De,offlineSessionIds:[],sequenceMode:Oe,ignoreManifestTimestampsInSegmentsMode:!1,type:`DASH`,serviceDescription:ke,nextUrl:L,periodCount:be.length,gapCount:e.O,isLowLatency:e.U,startTime:null},!le.ij()){k.A(7);break}return Se=xn(t,`UTCTiming`),k.g(Bx(e,ne,Se),8);case 8:if(Ce=k.i,!e.j)return k.return();le.Ri(Ce);case 7:le.mf(),e.m&&!e.h.presentationTimeline.T()&&e.m.release();case 4:e.j.makeTextStreamsForClosedCaptions(e.h),wx(e),Tx(e,be),k.j()}})}function _x(e,t,n){var r;return k(function(i){if(i.h==1)return i.g(e.m.gg(t,!0,n),2);e.h.variants=e.m.l,r=e.m.Ig(),r.length>0&&(e.h.textStreams=r),e.h.imageStreams=e.m.i,e.j.filter(e.h),i.j()})}function vx(e,t){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,v,y,b,x,S,C,w,T,E,D,O,A,j;return k(function(k){if(k.h==1){if(n=t.attributes.mpdId,r=B(t,`originalPublishTime`,An),!n||n!==e.l.rf||r!==e.l.je)throw e.I=[],new R(1,4,4052);for(i=[],a=[],o=/* @__PURE__ */ new Set,s=g(bn(t)),c=s.next();!c.done;c=s.next())if(l=c.value,u=zn(l.attributes.sel||``),d=u[u.length-1],f=Cn(l)||``,d.name===`MPD`){if(d.zc===`mediaPresentationDuration`){p=Cn(l)||``;var M=jn(p);if(M!=null){e.l.nc=M;for(var ee=g(e.u.values()),te=ee.next();!te.done;te=ee.next())te.value.nc=M}}else if(d.zc===`type`){for(e.h.presentationTimeline.Vc(f==`static`),e.l.type=f,M=g(e.u.values()),ee=M.next();!ee.done;ee=M.next())ee.value.pb=f==`dynamic`;f==`static`&&(e.M=-1)}else d.zc===`publishTime`?e.l.je=An(f)||0:d.zc===null&&l.tagName===`add`&&a.push(l)}else if(d.name===`PatchLocation`)Bn(e.I,l);else if(d.name===`Period`)l.tagName===`add`?a.push(l):l.tagName===`remove`&&d.id&&yx(e,d.id);else if(d.name===`SegmentTemplate`){if(ee=zn(l.attributes.sel||``),M=ee[ee.length-1],M.zc){ee=bx(e,ee),te=Cn(l)||``;for(var N=g(ee),ne=N.next();!ne.done;ne=N.next())ne=e.u.get(ne.value),Hn(ne.L.Jc,l.tagName,M.zc,te);M=ee}else M=[];for(m=M,h=g(m),v=h.next();!v.done;v=h.next())y=v.value,o.add(y)}else if(d.name===`SegmentTimeline`||d.name===`S`){for(M=zn(l.attributes.sel||``),M=bx(e,M),ee=g(M),te=ee.next();!te.done;te=ee.next())te=e.u.get(te.value),te=Fy(te,lb,`SegmentTimeline`),N=xn(te,`S`),Bn(N,l),te.children=N;for(b=M,x=g(b),S=x.next();!S.done;S=x.next())C=S.value,o.add(C)}for(w=g(o),T=w.next();!T.done;T=w.next())E=T.value,xx(e,E);for(D=g(a),O=D.next();!O.done;O=D.next())A=O.value,i.push.apply(i,_(Sx(e,{pb:e.l.type==`dynamic`,presentationTimeline:e.h.presentationTimeline,va:null,oa:null,ra:null,L:null,bandwidth:0,Kg:!1,mb:e.l.mb,profiles:e.l.profiles,nc:e.l.nc,roles:null,Hb:Kx},e.l.bb,A,!0).periods));return i.length?(e.h.periodCount+=i.length,e.h.gapCount=e.O,k.g(_x(e,i,!0),2)):k.A(2)}e.l.type==`static`&&(j=e.l.nc,e.h.presentationTimeline.wb(j||1/0)),k.j()})}function yx(e,t){e.h.periodCount--;for(var n=g(e.u.keys()),r=n.next();!r.done;r=n.next())if(r=r.value,r.startsWith(t)){var i=e.u.get(r);Fy(i,lb,`SegmentTimeline`).children=[],xx(e,r),e.u.delete(r)}e.D=e.D.filter(function(e){return e!==t}),e.H.delete(t)}function bx(e,t){var n=``,r=``,i=-1,a=``;t=g(t);for(var o=t.next();!o.done;o=t.next())o=o.value,o.name===`Period`?n=o.id:o.name===`AdaptationSet`?(r=o.id,o.position!==null&&(i=o.position)):o.name===`Representation`&&(a=o.id);if(t=[],a)t.push(n+`,`+a);else if(r)for(i=g(e.u.values()),e=i.next();!e.done;e=i.next())e=e.value,e.va.id===n&&e.ra.id===r&&e.L.id&&t.push(n+`,`+e.L.id);else if(i>-1)for(r=g(e.u.values()),e=r.next();!e.done;e=r.next())e=e.value,e.va.id===n&&e.ra.position===i&&e.L.id&&t.push(n+`,`+e.L.id);return t}function xx(e,t){var n=e.u.get(t),r=e.o.get(t);r.segmentIndex&&r.segmentIndex.Va(e.h.presentationTimeline.Fb());try{var i=cb(n,function(t,n,r,i){return Hx(e,t,n,r,i)},e.o,!0,e.g.dash.initialSegmentLimit,e.Ca,n.L.aesKey,null,!0,e.C);r.createSegmentIndex=function(){return k(function(e){if(e.h==1)return r.segmentIndex?e.A(0):e.g(i.Nc(),3);r.segmentIndex=e.i,e.j()})}}catch(e){if(t=n.L.contentType,t!=Nt&&t!=`application`&&t!=`image`||e.code!=4002)throw e}}function Sx(e,t,n,r,i){var a=t.nc;a||(a=B(r,`mediaPresentationDuration`,jn),e.l.nc=a);var o=0;e.h&&e.h.presentationTimeline&&e.W&&(o=e.h.presentationTimeline.Ub());var s=[],c=o;r=xn(r,`Period`);var l=t.pb;l||e.H.clear();for(var u=l&&!i?new Set(e.D.slice(1,-1)):null,d=0;d<r.length;d++){var f=r[d],p=r[d+1],m=B(f,`start`,jn,c),h=f.attributes.id,_=B(f,`duration`,jn);m=d==0&&m==0&&e.W?o:m;var v=null;if(p){var y=B(p,`start`,jn);y!=null&&(v=y-m+o)}else a!=null&&(v=a-m+o);if(y=Ft,v&&_&&Math.abs(v-_)>y&&v>_&&e.O++,v??(v=_),!(e.R!==null&&h!=null&&m!==null&&m<e.R)||e.D.includes(h)||d+1==r.length){if(m!==null&&(e.R===null||m>e.R)&&(e.R=m),c={start:m,duration:v,node:f,gf:v==null||!p},f=null,p=d>0&&d<r.length-1,l&&u&&p&&!i&&(h??(h=`__shaka_period_`+m),u.has(h)&&(h=e.H.get(h))&&(f=h)),f||(f=Ex(e,t,n,c),l&&f.id&&e.H.set(f.id,f)),s.push(f),f.id&&v&&e.Ca.set(f.id,v),v==null){c=null;break}c=m+v}}if(l&&!i&&Cx(e,s),i)for(t=g(s),n=t.next();!n.done;n=t.next())n=n.value.id,e.D.includes(n)||e.D.push(n);else e.D=s.map(function(e){return e.id});return a==null?{periods:s,duration:c,Yh:!0}:{periods:s,duration:a+o,Yh:!1}}function Cx(e,t){t=new Set(t.map(function(e){return e.id}));for(var n=g(Array.from(e.H.keys())),r=n.next();!r.done;r=n.next())r=r.value,t.has(r)||e.H.delete(r)}function wx(e){var t=Array.from(e.G.keys()).filter(function(t){return!e.D.includes(t)});t=g(t);for(var n=t.next();!n.done;n=t.next()){n=n.value;for(var r=!0,i=g(e.G.get(n)),a=i.next();!a.done;a=i.next()){a=a.value;var o=e.o.get(a);o&&(o.segmentIndex&&o.segmentIndex.getNumReferences()!=0?r=!1:(e.m&&e.m.Wh(o,n),e.o.delete(a)))}r&&e.G.delete(n)}}function Tx(e,t){t=new Set(t.map(function(e){return e.id}));for(var n=g(e.C.keys()),r=n.next();!r.done;r=n.next())r=r.value,t.has(r)||e.C.delete(r)}function Ex(e,t,n,r){t.va=Fx(e,r.node,null,n),t.oa=r,t.va.mb=t.mb,t.va.id||(t.va.id=`__shaka_period_`+r.start);var i=xn(r.node,`EventStream`);n=t.presentationTimeline.Fb(),i=g(i);for(var a=i.next();!a.done;a=i.next())Vx(e,r.start,r.duration,a.value,n);for(n=xn(r.node,`SupplementalProperty`),n=g(n),i=n.next();!i.done;i=n.next())i=i.value,i.attributes.schemeIdUri==`urn:mpeg:dash:urlparam:2014`&&(i=kx(e,i))&&(t.Hb=i);if(n=xn(r.node,`AdaptationSet`).map(function(n,r){return Ox(e,t,r,n)}).filter(ri),t.pb){i=[],a=g(n);for(var o=a.next();!o.done;o=a.next()){o=g(o.value.Rk);for(var s=o.next();!s.done;s=o.next())i.push(s.value)}if(i.length!=new Set(i).size)throw new R(2,4,4018)}for(i=/* @__PURE__ */ new Map,a=g(n),o=a.next();!o.done;o=a.next())for(o=g(o.value.yj),s=o.next();!s.done;s=o.next()){var c=g(s.value);s=c.next().value,c=c.next().value,i.set(s,c)}if(i.size)for(a=null,o=g(n),s=o.next();!s.done;s=o.next()){s=s.value,c=[];for(var l=g(s.streams),u=l.next(),d={};!u.done;d={xh:void 0},u=l.next())if(d.xh=u.value,i.has(d.xh.originalId)){a||(a=xn(r.node,`AdaptationSet`).map(function(n,r){return Ox(e,t,r,n)}).filter(ri)),u=g(a);for(var f=u.next();!f.done;f=u.next())(f=f.value.streams.find(function(e){return function(t){return t.originalId==e.xh.originalId}}(d)))&&(f.dependencyStream=i.get(f.originalId),f.originalId+=f.dependencyStream.originalId,c.push(f))}c.length&&s.streams.push.apply(s.streams,_(c))}if(r=g(he(n,function(e){return!!e.gj})),n=r.next().value,r=r.next().value,!e.g.disableIFrames){for(n=g(n),i=n.next();!i.done;i=n.next())for(i=i.value,a=i.gj.split(` `),o=g(r),s=o.next();!s.done;s=o.next())if(s=s.value,a.includes(s.id))for(s=g(s.streams),c=s.next();!c.done;c=s.next())Wi(c.value,i.streams)}if(n=Dx(e.g.disableAudio,r,`audio`),i=Dx(e.g.disableVideo,r,`video`),a=Dx(e.g.disableText,r,Nt),r=Dx(e.g.disableThumbnails,r,`image`),i.length===0&&n.length===0)throw new R(2,4,4004);return{id:t.va.id,audioStreams:n,videoStreams:i,textStreams:a,imageStreams:r}}function Dx(e,t,n){return e||!t.length?[]:t.reduce(function(e,t){return t.contentType==n&&e.push.apply(e,_(t.streams)),e},[])}function Ox(e,t,n,r){function i(n){var r=n.attributes[`dvb:fontFamily`];n=n.attributes[`dvb:url`],r&&n&&(n=Dt(t.ra.bb(),[n],t.Hb()),e.j.addFont(r,n[0]))}function a(e){switch(e){case 1:case 5:case 6:case 7:return`srgb`;case 9:return`rec2020`;case 11:case 12:return`p3`}}function o(e){switch(e){case 1:case 6:case 13:case 14:case 15:return`SDR`;case 16:return`PQ`;case 18:return`HLG`}}t.ra=Fx(e,r,t.va,null),t.ra.position=n;var s=!1;n=xn(r,`Role`);var c=n.map(function(e){return e.attributes.value}).filter(ri),l=void 0,u=t.ra.contentType==Nt;u&&(l=`subtitle`),n=g(n);for(var d=n.next();!d.done;d=n.next()){d=d.value;var f=d.attributes.schemeIdUri;if(f==null||f==`urn:mpeg:dash:role:2011`)switch(d=d.attributes.value,d){case`main`:s=!0;break;case`caption`:case`subtitle`:l=d}}var p=xn(r,`EssentialProperty`);n=null;var m=!1;d=null,f=!1,p=g(p);for(var h=p.next();!h.done;h=p.next()){h=h.value;var v=h.attributes.schemeIdUri;if(v==`http://dashif.org/guidelines/trickmode`)n=h.attributes.value;else if(v==`urn:mpeg:mpegB:cicp:TransferCharacteristics`)var y=o(parseInt(h.attributes.value,10));else if(v==`urn:mpeg:mpegB:cicp:ColourPrimaries`)var b=a(parseInt(h.attributes.value,10));else v!=`urn:mpeg:mpegB:cicp:MatrixCoefficients`&&(v==`urn:mpeg:dash:ssr:2023`&&e.g.dash.enableFastSwitching?m=!0:v==`urn:dvb:dash:fontdownload:2014`?i(h):v==`urn:mpeg:dash:urlparam:2014`&&(d=kx(e,h))||(f=!0))}if(f)return null;var x=null;for(f=xn(r,`SupplementalProperty`),f=g(f),p=f.next();!p.done;p=f.next())p=p.value,h=p.attributes.schemeIdUri,h==`http://dashif.org/guidelines/last-segment-number`?x=parseInt(p.attributes.value,10)-1:h==`urn:mpeg:mpegB:cicp:TransferCharacteristics`?y=o(parseInt(p.attributes.value,10)):h==`urn:mpeg:mpegB:cicp:ColourPrimaries`?b=a(parseInt(p.attributes.value,10)):h==`urn:dvb:dash:fontdownload:2014`?i(p):h==`urn:mpeg:dash:urlparam:2014`&&(d=kx(e,p));d&&(t.Hb=d),d=xn(r,`Accessibility`);var S=/* @__PURE__ */ new Map,C;for(d=g(d),f=d.next();!f.done;f=d.next())if(p=f.value,f=p.attributes.schemeIdUri,p=p.attributes.value,f!=`urn:scte:dash:cc:cea-608:2015`||e.g.disableText){if(f!=`urn:scte:dash:cc:cea-708:2015`||e.g.disableText)f==`urn:mpeg:dash:role:2011`?p!=null&&(c.push(p),p==`captions`&&(l=`caption`)):f==`urn:tva:metadata:cs:AudioPurposeCS:2007`&&(p==`1`?C=`visually impaired`:p==`2`?C=`hard of hearing`:p==`9`&&(C=`spoken subtitles`));else if(f=1,p!=null)for(p=g(p.split(`;`)),h=p.next();!h.done;h=p.next()){v=h.value;var w=h=void 0;v.includes(`=`)?(v=v.split(`=`),h=`svc`+v[0],w=v[1].split(`,`)[0].split(`:`).pop()):(h=`svc`+f,f++,w=v),S.set(h,li(w))}else S.set(`svc1`,`und`)}else if(f=1,p!=null)for(p=p.split(`;`),h=g(p),v=h.next();!v.done;v=h.next()){w=v.value;var T=v=void 0;w.includes(`=`)?(w=w.split(`=`),v=w[0].startsWith(`CC`)?w[0]:`CC`+w[0],T=w[1]||`und`):(v=`CC`+f,p.length==2?f+=2:f++,T=w),S.set(v,li(T))}else S.set(`CC1`,`und`);d=xn(r,`ContentProtection`);var E=Cy(e.za,d,e.g.ignoreDrmInfo,e.g.dash.keySystemsByURI);t.ra.encrypted=d.length>0;var D=li(t.ra.language||`und`),O=t.ra.label,k=/* @__PURE__ */ new Map;if(r=xn(r,`Representation`),!e.g.ignoreSupplementalCodecs){for(d=[],f=g(r),p=f.next();!p.done;p=f.next())h=p.value,(p=Dn(h,`urn:scte:dash:scte214-extensions`,`supplementalCodecs`))&&(h=fn(h),h.attributes.codecs=p.split(` `).join(`,`),h.attributes.id&&(h.attributes.supplementalId=h.attributes.id+`_supplementalCodecs`),d.push(h));r.push.apply(r,_(d))}if(d=r.map(function(n){var r=Ax(e,t,E,l,D,O,s,c,S,n,C,x);return r&&(r.hdr=r.hdr||y,r.colorGamut=r.colorGamut||b,r.fastSwitching=m,n=n.attributes.dependencyId)?(r.baseOriginalId=n,k.set(n,r),null):r}).filter(function(e){return!!e}),d.length==0&&k.size==0){if(n=t.ra.contentType==`image`,e.g.dash.ignoreEmptyAdaptationSet||u||n)return null;throw new R(2,4,4003)}if(!t.ra.contentType||t.ra.contentType==`application`)for(t.ra.contentType=Ux(d[0].mimeType,d[0].codecs),u=g(d),f=u.next();!f.done;f=u.next())f.value.type=t.ra.contentType;for(u=t.ra.id||`__fake__`+e.Ka++,f=g(d),p=f.next();!p.done;p=f.next()){for(p=p.value,h=g(E.drmInfos),v=h.next();!v.done;v=h.next())v=v.value,v.keyIds=v.keyIds&&p.keyIds?new Set([].concat(_(v.keyIds),_(p.keyIds))):v.keyIds||p.keyIds;e.g.enableAudioGroups&&(p.groupId=u)}return r=r.map(function(e){return e.attributes.supplementalId||e.attributes.id}).filter(ri),{id:u,contentType:t.ra.contentType,language:D,Fm:s,streams:d,drmInfos:E.drmInfos,gj:n,Rk:r,yj:k}}function kx(e,t){if((t=En(t,`urn:mpeg:dash:schema:urlparam:2014`,`UrlQueryInfo`))&&B(t,`useMPDUrlQuery`,Ln,!1)){var n=t.attributes.queryTemplate;if(n)return function(){return n==`$querypart$`?e.aa:n.split(`&`).map(function(t){if(t==`$querypart$`)return e.aa;var n=/\$query:(.*?)\$/g.exec(t);if(n&&n.length==2){n=n[1];var r=new Ke(e.aa).get(n);if(r.length)return n+`=`+r[0]}return t}).join(`&`)}}return null}function Ax(t,n,r,i,a,o,s,c,l,u,d,f){n.L=Fx(t,u,n.ra,null);var p=n.L.id;if(t.ia=Math.min(t.ia,n.L.mb),t.U=t.ia>0,!Rx(n.L))return null;var m=n.oa.start;n.bandwidth=B(u,`bandwidth`,Pn)||0,n.roles=c;var h=xn(u,`SupplementalProperty`),g=xn(u,`EssentialProperty`),_=xn(u,`ContentProtection`);u=null;var v=g.find(function(e){return e.attributes.schemeIdUri==`urn:mpeg:dash:urlparam:2014`});(v||(v=h.find(function(e){return e.attributes.schemeIdUri==`urn:mpeg:dash:urlparam:2014`})))&&(u=kx(t,v)),u&&(n.Hb=u),v=n.L.contentType,u=v==Nt||v==`application`,v=v==`image`,_.length&&(n.ra.encrypted=!0);try{var y=void 0;if(r.cg){var b=n.L.bb,x=n.Hb,S=Sa(Dt(b(),[r.cg.tk],x()),t.g.retryParameters);y={bitsKey:128,blockCipherMode:`CBC`,iv:r.cg.iv,firstMediaSequenceNumber:0,fetchKey:function(){var n,r,i;return k(function(a){if(a.h==1)return a.g(Wx(t,S,6),2);if(a.h!=3){if(n=a.i,!n.data||n.data.byteLength!=16)throw new R(2,4,4049);return r={name:`AES-CBC`},i=y,a.g(e.crypto.subtle.importKey(`raw`,n.data,r,!0,[`decrypt`]),3)}i.cryptoKey=a.i,y.fetchKey=void 0,a.j()})}}}if(n.L.aesKey=y,b=function(e,n,r,i){return Hx(t,e,n,r,i)},n.L.Ed)var C=Xy(n,b,y);else if(n.L.wc)C=rb(n,t.o,y);else if(n.L.Jc)C=cb(n,b,t.o,!!t.h,t.g.dash.initialSegmentLimit,t.Ca,y,f,!1,t.C);else{var w=n.oa.duration||0,T=n.L.bb,E=n.L.mimeType,D=n.L.codecs;C={endTime:-1,timeline:-1,Nc:function(){var e=du(m,w,T());return e.qb(function(e){e.mimeType=E,e.codecs=D}),Promise.resolve(e)},timescale:1}}}catch(e){if((u||v)&&e.code==4002)return null;throw e}f=wy(t.za,_,r,t.g.ignoreDrmInfo,t.g.dash.keySystemsByURI),f=new Set(f?[f]:[]),_=h.some(function(e){return e.attributes.schemeIdUri==`tag:dolby.com,2018:dash:EC3_ExtensionType:2018`&&e.attributes.value==`JOC`}),h=h.some(function(e){return e.attributes.schemeIdUri==`tag:dolby.com,2016:dash:virtualized_content:2016`&&e.attributes.value==`1`}),h=_||h,_=!1,u&&(_=c.includes(`forced_subtitle`)||c.includes(`forced-subtitle`));var O;if(v&&((g=g.find(function(e){return[`http://dashif.org/thumbnail_tile`,`http://dashif.org/guidelines/thumbnail_tile`].includes(e.attributes.schemeIdUri)}))&&(O=g.attributes.value),!O))return null;var A;u=n.L.codecs,n.profiles.includes(`http://dashif.org/guidelines/dash-if-uhd#hevc-hdr-pq10`)&&(u.includes(`hvc1.2.4.L153.B0`)||u.includes(`hev1.2.4.L153.B0`))&&(A=`PQ`),g=n.L.id?n.va.id+`,`+n.L.id:``,t.I.length&&p&&t.u.set(n.va.id+`,`+p,Mx(n)),n.L.yf&&jx(t,n.L.yf,C,n.presentationTimeline),C.endTime!=-1&&n.va.id!=null&&n.L.id!=null&&((p=t.C.get(n.va.id))?(p.endTime=C.endTime,p.fh.includes(n.L.id)||p.fh.push(n.L.id),t.C.set(n.va.id,p)):t.C.set(n.va.id,{endTime:C.endTime,timeline:C.timeline,fh:[n.L.id]}));var j=g&&t.o.has(g)?t.o.get(g):{id:t.Ka++,originalId:n.L.id,groupId:null,createSegmentIndex:function(){return Promise.resolve()},closeSegmentIndex:function(){j.segmentIndex&&(j.segmentIndex.release(),j.segmentIndex=null)},segmentIndex:null,mimeType:n.L.mimeType,codecs:u,frameRate:n.L.frameRate,pixelAspectRatio:n.L.pixelAspectRatio,bandwidth:n.bandwidth,width:n.L.width,height:n.L.height,kind:i,encrypted:r.drmInfos.length>0,drmInfos:r.drmInfos,keyIds:f,language:a,originalLanguage:n.ra.language,label:o,type:n.ra.contentType,primary:s,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:n.L.emsgSchemeIdUris,roles:c,forced:_,channelsCount:n.L.vf,audioSamplingRate:n.L.audioSamplingRate,spatialAudio:h,closedCaptions:l,hdr:A,colorGamut:void 0,videoLayout:void 0,tilesLayout:O,accessibilityPurpose:d,external:!1,fastSwitching:!1,fullMimeTypes:/* @__PURE__ */ new Set([kr(n.L.mimeType,n.L.codecs)]),isAudioMuxedInVideo:!1,baseOriginalId:null};return j.createSegmentIndex=function(){var e;return k(function(t){if(t.h==1)return j.segmentIndex?t.A(0):(e=j,t.g(C.Nc(),3));e.segmentIndex=t.i,t.j()})},g&&n.pb&&!t.o.has(g)&&(n=n.va.id||``,t.G.has(n)||t.G.set(n,[]),t.o.set(g,j),t.G.get(n).push(g)),j}function jx(e,t,n,r){if(!e.qa.has(t)){e.qa.add(t);var i=B(t,`presentationTime`,Fn)||0,a=Tn(t,`UTCTiming`),o;(o=a&&a.attributes.schemeIdUri)&&(a=a.attributes.schemeIdUri,o=a!==`urn:mpeg:dash:utc:http-ntp:2014`&&a!==`urn:mpeg:dash:utc:ntp:2014`&&a!==`urn:mpeg:dash:utc:sntp:2014`),o?t=(B(t,`wallClockTime`,An)||0)*1e3:(t=B(t,`wallClockTime`,Fn)||0,t=bc(t)),n=/* @__PURE__ */ new Date(t-i/n.timescale*1e3),i=n.getTime()/1e3,isNaN(i)||(r.o||r.rh(i),r=(/* @__PURE__ */ new Map()).set(`detail`,{wallClockTime:t,programStartDate:n}),r=new V(`prft`,r),e.j.onEvent(r))}}function Mx(e){function t(e){return e?(e=pn(e),e.Ed=null,e.wc=null,e.Jc=Wn(e.Jc),e.yf=null,e):null}return e=pn(e),e.va=t(e.va),e.ra=t(e.ra),e.L=t(e.L),e.oa&&(e.oa=pn(e.oa),e.oa.node=null),e}function Nx(e){var t,n;return k(function(r){switch(r.h){case 1:return t=0,r.m(2),r.g(mx(e),4);case 4:t=r.i,r.o(3);break;case 2:if(n=r.l(),e.j){if(e.g.raiseFatalErrorOnManifestUpdateRequestFailure)return e.j.onError(n),r.return();n.severity=1,e.j.onError(n)}case 3:if(!e.j)return r.return();e.j.onManifestUpdated(),Px(e,t),r.j()}})}function Px(e,t){if(!(e.M<0)){var n=e.M;e.g.updatePeriod>=0&&(n=e.g.updatePeriod),e.N.na(Math.max(n-t,ae(e.Ha)))}}function Fx(e,t,n,r){n=n||{contentType:``,mimeType:``,codecs:``,emsgSchemeIdUris:[],frameRate:void 0,pixelAspectRatio:void 0,vf:null,audioSamplingRate:null,mb:0,Ef:1,encrypted:!1},r=r||n.bb;var i=t.attributes.id,a=t.attributes.supplementalId,o=xn(t,`BaseURL`),s,c=!1;if(e.i)for(var l=g(o),u=l.next();!u.done;u=l.next()){var d=u.value;u=d.attributes.serviceLocation,d=Cn(d),u&&d&&(wb(e.i,i,u,d),c=!0)}c&&e.i||(s=o.map(Cn));var f=e.i;e=t.attributes.contentType||n.contentType,l=t.attributes.mimeType||n.mimeType,u=Uu([t.attributes.codecs||n.codecs]).join(`,`),d=B(t,`frameRate`,Rn)||n.frameRate;var p=t.attributes.sar||n.pixelAspectRatio,m=Ix(xn(t,`InbandEventStream`),n.emsgSchemeIdUris),h=xn(t,`AudioChannelConfiguration`);h=Lx(h)||n.vf;var _=B(t,`audioSamplingRate`,Fn)||n.audioSamplingRate;e||(e=Ux(l,u));var v=Tn(t,`SegmentBase`),y=Tn(t,`SegmentTemplate`),b=v&&B(v,`availabilityTimeOffset`,In)||0,x=y&&B(y,`availabilityTimeOffset`,In)||0,S=o&&o.length&&B(o[0],`availabilityTimeOffset`,In)||0;b=n.mb+S+b+x,x=null,(S=Tn(t,`SegmentSequenceProperties`))&&(S=B(S,`cadence`,Pn))&&(x=S),S=t.attributes.label;var C=xn(t,`Label`);return C&&C.length&&(C=C[0],Sn(C)&&(S=Sn(C))),{bb:function(){return Dt(r(),o.length?f&&c?Tb(f,i):s||[]:[])},Ed:v||n.Ed,wc:Tn(t,`SegmentList`)||n.wc,Jc:y||n.Jc,yf:Tn(t,`ProducerReferenceTime`)||n.yf,width:B(t,`width`,Fn)||n.width,height:B(t,`height`,Fn)||n.height,contentType:e,mimeType:l,codecs:u,frameRate:d,pixelAspectRatio:p,emsgSchemeIdUris:m,id:a||i,originalId:i,language:t.attributes.lang,vf:h,audioSamplingRate:_,mb:b,cf:null,Ef:x||n.Ef,label:S||null,encrypted:!1}}function Ix(e,t){t=t.slice(),e=g(e);for(var n=e.next();!n.done;n=e.next())n=n.value.attributes.schemeIdUri,t.includes(n)||t.push(n);return t}function Lx(e){e=g(e);for(var t=e.next();!t.done;t=e.next()){t=t.value;var n=t.attributes.schemeIdUri;if(n&&(t=t.attributes.value))switch(n){case`urn:mpeg:dash:outputChannelPositionList:2012`:return t.trim().split(/ +/).length;case`urn:mpeg:dash:23003:3:audio_channel_configuration:2011`:case`urn:dts:dash:audio_channel_configuration:2012`:if(t=parseInt(t,10),!t)continue;return t;case`tag:dolby.com,2015:dash:audio_channel_configuration:2015`:if(n=[2,1,2,2,2,2,1,2,2,1,1,1,1,2,1,1,2,2],t=parseInt(t,16),!t)continue;for(var r=0,i=0;i<n.length;i++)t&1<<i&&(r+=n[i]);if(r)return r;continue;case`tag:dolby.com,2014:dash:audio_channel_configuration:2011`:case`urn:dolby:dash:audio_channel_configuration:2011`:if(n=[1,1,1,1,1,2,2,1,1,2,2,2,1,2,1,1].reverse(),t=parseInt(t,16),!t)continue;for(i=r=0;i<n.length;i++)t&1<<i&&(r+=n[i]);if(r)return r;continue;case`urn:mpeg:mpegB:cicp:ChannelConfiguration`:if(n=[0,1,2,3,4,5,6,8,2,3,4,7,8,24,8,12,10,12,14,12,14],(t=parseInt(t,10))&&t>0&&t<n.length)return n[t]}}return null}function Rx(e){var t=+!!e.Ed;return t+=+!!e.wc,t+=+!!e.Jc,t==0?e.contentType==Nt||e.contentType==`application`:(t!=1&&(e.Ed&&(e.wc=null),e.Jc=null),!0)}function zx(e,t,n,r){var i,a,o,s,c,l,u;return k(function(d){if(d.h==1)return i=[vt(n)],a=Dt(t(),i),o=Sa(a,e.g.retryParameters),o.method=r,s=e.j.networkingEngine.request(4,o,{isPreload:e.ua()}),va(e.S,s),d.g(s.promise,2);if(c=d.i,r==`HEAD`){if(!c.headers||!c.headers.date)return d.return(0);l=c.headers.date}else l=pt(c.data);return u=Date.parse(l),isNaN(u)?d.return(0):d.return(u-Date.now())})}function Bx(e,t,n){var r,i,a,o,s,c,l,u;return k(function(d){switch(d.h){case 1:r=n.map(function(e){return{scheme:e.attributes.schemeIdUri,value:e.attributes.value}}),i=e.g.dash.clockSyncUri,!r.length&&i&&r.push({scheme:`urn:mpeg:dash:utc:http-head:2014`,value:i}),a=g(r),o=a.next();case 2:if(o.done){d.A(4);break}switch(s=o.value,d.m(5),c=s.scheme,l=s.value,c){case`urn:mpeg:dash:utc:http-head:2014`:case`urn:mpeg:dash:utc:http-head:2012`:return d.A(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 d.A(8);case`urn:mpeg:dash:utc:direct:2014`:case`urn:mpeg:dash:utc:direct:2012`:return u=Date.parse(l),d.return(isNaN(u)?0:u-Date.now());case`urn:mpeg:dash:utc:http-ntp:2014`:case`urn:mpeg:dash:utc:ntp:2014`:case`urn:mpeg:dash:utc:sntp:2014`:F(`NTP UTCTiming scheme is not supported`);break;default:F(`Unrecognized scheme in UTCTiming element`,c)}d.A(9);break;case 7:return d.g(zx(e,t,l,`HEAD`),10);case 10:return d.return(d.i);case 8:return d.g(zx(e,t,l,`GET`),11);case 11:return d.return(d.i);case 9:d.o(3);break;case 5:d.l();case 3:o=a.next(),d.A(2);break;case 4:return F(`A UTCTiming element should always be given in live manifests! This content may not play on clients with bad clocks!`),d.return(0)}})}function Vx(e,t,n,r,i){var a=r.attributes.schemeIdUri||``,o=r.attributes.value||``,s=B(r,`timescale`,Fn)||1,c=B(r,`presentationTimeOffset`,Fn)||0;r=g(xn(r,`Event`));for(var l=r.next();!l.done;l=r.next()){l=l.value;var u=B(l,`presentationTime`,Fn)||0,d=B(l,`duration`,Fn)||0;u=Math.max((u-c)/s+t,t),d=u+d/s,n!=null&&(u=Math.min(u,t+n),d=Math.min(d,t+n)),d<i||(l={schemeIdUri:a,value:o,startTime:u,endTime:d,id:l.attributes.id||``,timescale:s,eventElement:Un(l),eventNode:Wn(l)},e.j.onTimelineRegionAdded(l))}}function Hx(e,t,n,r,i){var a,o,s,c;return k(function(l){return l.h==1?(a=ka,o=+!i,s=Yu(t,n,r,e.g.retryParameters),l.g(Wx(e,s,a,{type:o}),2)):(c=l.i,l.return(c.data))})}function Ux(e,t){return t=kr(e,t),Ur(t)?Nt:e.split(`/`)[0]}function Wx(e,t,n,r){return r||(r={}),r.isPreload=e.ua(),t=e.j.networkingEngine.request(n,t,r),va(e.S,t),t.promise}function Gx(e){var t=e.l.je;if(!e.l.rf||!t||!e.I.length)return[];var n=Date.now()/1e3,r=e.I.filter(function(e){return e=Fn(e.attributes.ttl),!e||t+e>n}).map(Cn).filter(ri);return r.length?Dt(e.B,r):[]}function Kx(){return``}function qx(e,t,n){return function(){return e&&t?Tb(e,`BaseURL`):n.slice()}}P(`shaka.dash.DashParser`,px),Ht(`application/dash+xml`,function(){return new px}),Ht(`video/vnd.mpeg.dash.mpd`,function(){return new px});function Jx(){}P(`shaka.dependencies`,Jx),Jx.has=function(e){return Zx.has(e)},Jx.add=function(e,t){if(!Xx[e])throw Error(e+` is not supported`);e==Yx?L(`mux.js`,`mux.js is no longer used in Shaka Player.`):Zx.set(e,function(){return t})};var Yx=`muxjs`,Xx={Gm:Yx,ISOBoxer:`ISOBoxer`};Jx.Allowed=Xx;var Zx=/* @__PURE__ */ new Map([[`ISOBoxer`,function(){return e.ISOBoxer}]]);function Qx(){this.j=new Ce(function(){for(var e=navigator.userAgent.toLowerCase(),t=g([{type:`VR`,eh:/oculus|quest/},{type:`TV`,eh:/smart[ _]?tv|android ?tv/},{type:`MOBILE`,eh:/iphone|ipad|ipod|android/}]),n=t.next();!n.done;n=t.next())if(n=n.value,n.eh.test(e))return n.type;if(e=navigator.userAgentData,t=e?.platform?.toLowerCase()||``,e){if(e.mobile)return`MOBILE`;if(t.includes(`android`))return`TV`}return`DESKTOP`}),this.l=new Ce(function(){var e=navigator.userAgent;return navigator.vendor.includes(`Apple`)&&(e.includes(`Version/`)||e.includes(`OS/`))?`WEBKIT`:e.includes(`Edge/`)?`EDGE`:e.includes(`Chrome/`)?`CHROMIUM`:e.includes(`Firefox/`)?`GECKO`:`UNKNOWN`})}function $x(){var t=e.ManagedMediaSource||e.MediaSource;return!!(t&&t.isTypeSupported)}r=Qx.prototype,r.dc=function(){return!!navigator.mediaCapabilities},r.Qa=function(){return this.j.value()},r.Ia=function(){return this.l.value()},r.Bd=function(){return!1},r.hh=function(){return!1},r.df=function(){return!1},r.Ji=function(){return!1},r.le=function(){return!1},r.Yc=function(){return!0},r.xb=function(){var t=e.ManagedSourceBuffer||e.SourceBuffer;return!!t&&!!t.prototype&&!!t.prototype.changeType},r.pe=function(){return!0},r.Oi=function(){return 0},r.hc=function(){return Promise.resolve({width:1/0,height:1/0})},r.Xi=function(){return!1},r.uh=function(){return!1},r.Xa=function(e){var t=this.Qa();return(t===`TV`||t===`CONSOLE`||t===`CAST`)&&(e.ads.customPlayheadTracker=!0,e.ads.skipPlayDetection=!0,e.ads.supportsMultipleMediaElements=!1),e},r.Ah=function(){return!!e.indexedDB},r.Hi=function(){return[]},r.md=function(t){return e.matchMedia!==void 0&&(e.matchMedia(`(color-gamut: p3)`).matches||e.matchMedia(`(dynamic-range: high)`).matches)?t?`HLG`:`PQ`:`SDR`},r.dj=function(){return!1},r.xi=function(){return!1},r.Bf=function(){return!1},r.Kf=function(){return!0},r.zi=function(){return!1},r.cj=function(){return!0},r.Xc=function(){return!1},r.Tg=function(e){return e===`com.apple.fps`},r.Jf=function(){return!0},r.toString=function(){return`Device: `+this.Jb()+` v`+this.Da()+`; Type: `+this.Qa()};function eS(){Qx.call(this),this.g=new Ce(function(){var e=navigator.userAgent.match(/Version\/(\d+)(?:\.(\d+))?/);return e||(e=navigator.userAgent.match(/OS (\d+)(?:_(\d+))?/)),e?[parseInt(e[1],10),parseInt(e[2]||`0`,10)]:[0,0]}),this.h=new Ce(function(){return/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||navigator.maxTouchPoints>1?`xr`in navigator?`APPLE_VR`:`MOBILE`:`xr`in navigator?`APPLE_VR`:`DESKTOP`})}m(eS,Qx),r=eS.prototype,r.Da=function(){return this.g.value()[0]},r.Jb=function(){return`Apple Browser`},r.Qa=function(){return this.h.value()},r.Ia=function(){return`WEBKIT`},r.dc=function(){return!1},r.Bd=function(e,t){return!tS(this)&&t===`audio`},r.df=function(){return!tS(this)},r.Ji=function(e){return!tS(this)&&e===`audio`},r.Xa=function(e){return Qx.prototype.Xa.call(this,e),e.abr.minTimeToSwitch=.5,e},r.dj=function(){return!0},r.Jf=function(){return!1};function tS(e){return e=e.g.value(),e[0]>=27||e[0]===26&&e[1]>=4}(navigator.vendor||``).includes(`Apple`)&&(/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||navigator.maxTouchPoints>1||navigator.userAgentData&&navigator.userAgentData.platform&&navigator.userAgentData.platform.toLowerCase()==`macos`||navigator.platform&&navigator.platform.toLowerCase().includes(`mac`))&&(Te=function(){return new eS});function nS(){if(!rS())throw Error(`Not a Chromecast device!`);Qx.call(this),this.h=new Ce(function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/);return e?parseInt(e[1],10):null}),this.g=new Ce(function(){var e=navigator.userAgentData&&navigator.userAgentData.platform||navigator.userAgent;return e=e.toLowerCase(),e.includes(`android`)?iS:e.includes(`fuchsia`)?aS:oS})}m(nS,Qx),r=nS.prototype,r.Da=function(){return this.h.value()},r.Jb=function(){return`Chromecast with `+this.g.value()},r.Qa=function(){return`CAST`},r.Ia=function(){return`CHROMIUM`},r.dc=function(){return Qx.prototype.dc.call(this)&&this.g.value()!==oS},r.xb=function(){return Qx.prototype.xb.call(this)&&this.g.value()!==oS},r.Oi=function(){switch(this.g.value()){case iS:return 0;case aS:return 3;default:return 1}},r.hc=function(){var t,n,r,i,a;return k(function(o){switch(o.h){case 1:if(t=e.cast&&cast.__platform__&&cast.__platform__.canDisplayType,n={width:1280,height:720},o.m(2),!(r=t)){o.A(4);break}return o.g(cast.__platform__.canDisplayType(`video/mp4; codecs="avc1.640028"; width=3840; height=2160`),5);case 5:r=o.i;case 4:if(r){n.width=3840,n.height=2160,o.A(6);break}if(!(i=t)){o.A(7);break}return o.g(cast.__platform__.canDisplayType(`video/mp4; codecs="avc1.640028"; width=1920; height=1080`),8);case 8:i=o.i;case 7:i&&(n.width=1920,n.height=1080);case 6:o.o(3);break;case 2:a=o.l(),ce(`Failed to check canDisplayType:`,a);case 3:return o.return(n)}})},r.Xa=function(e){return Qx.prototype.Xa.call(this,e),e.streaming.stallSkip=0,e},r.Ah=function(){return!1},r.Xc=function(){return!0};function rS(){return navigator.userAgent.includes(`CrKey`)&&!navigator.userAgent.includes(`VIZIO SmartCast`)}var iS=`Android`,aS=`Fuchsia`,oS=`Linux`;rS()&&(Te=function(){return new nS});function sS(){Qx.call(this);var e=this;this.i=new Ce(function(){var e=navigator.userAgent.match(/(Chrome|Firefox)\/(\d+)/);return e?parseInt(e[2],10):null}),this.g=new Ce(function(){return navigator.userAgent.match(/Edge?\//)?`Edge`:navigator.userAgent.includes(`Chrome`)?`Chrome`:navigator.userAgent.includes(`Firefox`)?`Firefox`:`Unknown`}),this.h=new Ce(function(){return navigator.userAgentData&&navigator.userAgentData.platform?navigator.userAgentData.platform.toLowerCase()==`windows`:navigator.platform?navigator.platform.toLowerCase().includes(`win32`):!1}),this.u=new Ce(function(){return Qx.prototype.xb.call(e)?!navigator.userAgent.match(/Edge?\//)||!e.h.value():!1}),this.o=new Ce(function(){return navigator.userAgent.includes(`sony.hbbtv.tv`)}),this.m=new Ce(function(){return navigator.userAgentData&&navigator.userAgentData.platform?navigator.userAgentData.platform.toLowerCase()==`android`:!!navigator.userAgent.includes(`Android`)})}m(sS,Qx),r=sS.prototype,r.Da=function(){return this.i.value()},r.Jb=function(){return this.g.value()},r.Bd=function(e){return at(e)?this.g.value()===`Edge`&&this.h.value():!1},r.hh=function(){return this.g.value()===`Edge`&&this.h.value()},r.df=function(){return this.g.value()===`Edge`&&this.h.value()},r.xb=function(){return this.u.value()},r.Xa=function(e){if(Qx.prototype.Xa.call(this,e),this.h.value())switch(this.g.value()){case`Firefox`:e.drm.keySystemsMapping={"com.microsoft.playready":`com.microsoft.playready.recommendation`};break;case`Chrome`:e.drm.keySystemsMapping={"com.microsoft.playready":`com.microsoft.playready.recommendation.3000`,"com.microsoft.playready.recommendation":`com.microsoft.playready.recommendation.3000`}}return this.m.value()&&(e.drm.defaultAudioRobustnessForWidevine=`SW_SECURE_CRYPTO`,e.drm.defaultVideoRobustnessForWidevine=`SW_SECURE_CRYPTO`),e},r.Bf=function(){return this.g.value()===`Edge`||this.o.value()},r.Xc=function(){if(this.Ia()===`GECKO`){var e=this.Da();return e===null?Qx.prototype.Xc.call(this):e>=100}return Qx.prototype.Xc.call(this)},r.Tg=function(e){return this.Ia()===`GECKO`?e.startsWith(`com.microsoft.playready.recommendation`):Qx.prototype.Tg.call(this,e)},Ee=function(){return new sS};function cS(){Qx.apply(this,arguments)}m(cS,Qx),r=cS.prototype,r.Da=function(){return null},r.Jb=function(){return`Hisense`},r.Qa=function(){return`TV`},r.dc=function(){return!1},r.xb=function(){return!1},r.hc=function(){var t={width:1920,height:1080},n=null;if(e.Hisense_Get4KSupportState)try{n=e.Hisense_Get4KSupportState()}catch{}return n??(n=navigator.userAgent.includes(`UHD`)),n&&(t.width=3840,t.height=2160),Promise.resolve(t)},r.Xa=function(e){return Qx.prototype.Xa.call(this,e),e.streaming.stallSkip=0,e},(navigator.userAgent.includes(`Hisense`)||navigator.userAgent.includes(`VIDAA`))&&(Te=function(){return new cS});function lS(){Qx.call(this),this.g=new Ce(function(){var e=navigator.userAgent.match(/PlayStation (\d+)/);return e?parseInt(e[1],10):null})}m(lS,Qx),r=lS.prototype,r.Jb=function(){return`PlayStation`},r.Qa=function(){return`CONSOLE`},r.Ia=function(){return`WEBKIT`},r.Da=function(){return this.g.value()},r.dc=function(){return!1},r.Yc=function(){return!1},r.xb=function(){return!1},r.uh=function(){return this.Da()===4},r.hc=function(){var t,n,r,i,a;return k(function(o){switch(o.h){case 1:return t={width:1920,height:1080},n=!1,o.m(2),o.g(e.msdk.device.getDisplayInfo(),4);case 4:r=o.i,n=r.resolution===`4K`,o.o(3);break;case 2:return o.l(),o.m(5),o.g(e.msdk.device.getDisplayInfoImmediate(),7);case 7:i=o.i,n=i.resolution===`4K`,o.o(3);break;case 5:a=o.l(),F(`PlayStation: Failed to get the display info:`,a);case 3:return n&&(t.width=3840,t.height=2160),o.return(t)}})},r.Xa=function(e){return Qx.prototype.Xa.call(this,e),this.Da()===4&&e.drm.preferredKeySystems.push(`com.microsoft.playready`),e.streaming.clearDecodingCache=!0,e},r.Bf=function(){return this.Da()===4},r.Kf=function(){return this.Da()!==4},navigator.userAgent.includes(`PlayStation`)&&(Te=function(){return new lS});function uS(){Qx.call(this);var e=navigator.userAgent.match(/Tizen (\d+).(\d+)/);this.g=e?parseInt(e[1],10):null,this.h=e?parseInt(e[2],10):null}m(uS,Qx),r=uS.prototype,r.Da=function(){return this.g},r.Jb=function(){return`Tizen`},r.Ia=function(){return`CHROMIUM`},r.Qa=function(){return`TV`},r.Bd=function(){return!0},r.le=function(){return this.Da()===3},r.dc=function(){return!1},r.Yc=function(){var e=this.Da();return e===null?Qx.prototype.Yc.call(this):e>=4},r.xb=function(){return!1},r.pe=function(){return this.g&&this.h?this.g===5?this.h>=5:this.g>5:Qx.prototype.pe.call(this)},r.hc=function(){var t=e.devicePixelRatio;t={width:e.screen.width*t>1920?3840:1920,height:e.screen.height*t>1080?2160:1080};try{if(webapis.systeminfo&&webapis.systeminfo.getMaxVideoResolution){var n=webapis.systeminfo.getMaxVideoResolution();t.width=n.width,t.height=n.height}else webapis.productinfo.is8KPanelSupported&&webapis.productinfo.is8KPanelSupported()?(t.width=7680,t.height=4320):webapis.productinfo.isUdPanelSupported&&webapis.productinfo.isUdPanelSupported()&&(t.width=3840,t.height=2160)}catch{F(`Tizen: Error detecting screen size, default screen size 1920x1080.`)}return Promise.resolve(t)},r.Xa=function(e){return Qx.prototype.Xa.call(this,e),e.drm.ignoreDuplicateInitData=this.Da()!==2,this.Da()===3&&(e.streaming.crossBoundaryStrategy=`reset_to_encrypted`),e.streaming.shouldFixTimestampOffset=!0,e.streaming.stallSkip=0,e.streaming.gapPadding=2,e},r.Hi=function(){var e=[];return this.g!==null&&this.g<5&&e.push(`opus`),e},r.md=function(e){try{if(webapis.avinfo.isHdrTvSupport())return e?`HLG`:`PQ`}catch{return Qx.prototype.md.call(this,e)}return`SDR`},r.xi=function(){return!0},r.zi=function(){return this.Da()===3},navigator.userAgent.includes(`Tizen`)&&(Te=function(){return new uS});function dS(){Qx.apply(this,arguments)}m(dS,Qx),dS.prototype.Da=function(){return null},dS.prototype.Jb=function(){return`Vizio`},dS.prototype.Qa=function(){return`TV`},dS.prototype.dc=function(){return!1},navigator.userAgent.includes(`VIZIO SmartCast`)&&(Te=function(){return new dS});function fS(){Qx.call(this),this.i=new Ce(function(){return navigator.userAgent.includes(`DT_STB_BCM`)||navigator.userAgent.includes(`Sky_STB`)}),this.h=new Ce(function(){return navigator.userAgent.includes(`SOPOpenBrowser`)}),this.g=new Ce(function(){if(navigator.userAgent.includes(`DT_STB_BCM`))return 11;var e=navigator.userAgent.match(/Version\/(\d+)/);return e||(e=navigator.userAgent.match(/OS (\d+)(?:_\d+)?/))?parseInt(e[1],10):null})}m(fS,Qx),r=fS.prototype,r.Da=function(){return this.g.value()},r.Jb=function(){return`WebKit STB`},r.Qa=function(){return`TV`},r.Ia=function(){return`WEBKIT`},r.dc=function(){return!1},r.Yc=function(){var e=this.g.value();return e===null||e>=15},r.Bd=function(){return this.h.value()},r.hc=function(){return Promise.resolve({width:e.screen.width*e.devicePixelRatio,height:e.screen.height*e.devicePixelRatio})},r.Kf=function(){return!this.i.value()},r.Jf=function(){return!1},!navigator.userAgent.includes(`PlayStation`)&&(navigator.userAgent.includes(`SOPOpenBrowser`)||navigator.userAgent.includes(`DT_STB_BCM`)||navigator.userAgent.includes(`Sky_STB`)||!(!(navigator.vendor||``).includes(`Apple`)||/(?:iPhone|iPad|iPod)/.test(navigator.userAgent)||navigator.maxTouchPoints>1||navigator.userAgentData&&navigator.userAgentData.platform&&navigator.userAgentData.platform.toLowerCase()==`macos`||navigator.platform&&navigator.platform.toLowerCase().includes(`mac`)))&&(Te=function(){return new fS});function pS(){Qx.call(this);var e=this;this.h=mS(),this.g=null;try{var t=new PalmServiceBridge;t.onservicecallback=function(t){t=JSON.parse(t),e.g=t.configs?.[`tv.model.supportHDR`]??t.configs?.[`tv.config.supportDolbyHDRContents`]??!1},t.call(`luna://com.webos.service.config/getConfigs`,JSON.stringify({configNames:[`tv.model.supportHDR`,`tv.config.supportDolbyHDRContents`]}))}catch(e){F(`WebOS: getConfigs call failed`,e)}}m(pS,Qx),r=pS.prototype,r.Da=function(){return this.h},r.Jb=function(){return`WebOS`},r.Qa=function(){return`TV`},r.Ia=function(){return`CHROMIUM`},r.dc=function(){return!1},r.Yc=function(){var e=this.Da();return e===null?Qx.prototype.Yc.call(this):e>3},r.xb=function(){return!1},r.pe=function(){var e=this.Da();return e===null?Qx.prototype.pe.call(this):e>3},r.hc=function(){var t={width:1920,height:1080};try{var n=JSON.parse(e.PalmSystem.deviceInfo);t.width=Math.max(1920,n.screenWidth),t.height=Math.max(1080,n.screenHeight)}catch{F(`WebOS: Error detecting screen size, default screen size 1920x1080.`)}return Promise.resolve(t)},r.Xa=function(e){return Qx.prototype.Xa.call(this,e),this.Da()===3&&(e.streaming.crossBoundaryStrategy=`reset`),e.streaming.shouldFixTimestampOffset=!0,e.streaming.stallSkip=0,e},r.md=function(e){return this.g==null?(F(`WebOS: getConfigs call haven't finished`),Qx.prototype.md.call(this,e)):this.g?e?`HLG`:`PQ`:`SDR`};function mS(){var e=null,t=navigator.userAgent.match(/Chrome\/(\d+)/);switch(t&&(e=parseInt(t[1],10)),e){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;case 132:return 26;default:return null}}if(r.cj=function(){return!1},r.Xc=function(){var e=this.Da();return e===null?Qx.prototype.Xc.call(this):e>=6},navigator.userAgent.includes(`Web0S`)){var hS=new pS;Te=function(){return hS}}function gS(){Qx.call(this),this.g=navigator.userAgent.includes(`Edge/`);var e=navigator.userAgent.match(/Edge?\/(\d+)/);this.h=e?parseInt(e[1],10):null}m(gS,Qx),r=gS.prototype,r.Da=function(){return this.h},r.Jb=function(){return`Xbox`},r.Qa=function(){return`CONSOLE`},r.Ia=function(){return this.g?`EDGE`:`CHROMIUM`},r.Bd=function(){return!0},r.hh=function(){return!0},r.df=function(){return!0},r.Xi=function(){return this.g},r.hc=function(){var e={width:1920,height:1080},t=_S();if(t)try{var n=new t.Media.Protection.ProtectionCapabilities,r=t.Media.Protection.ProtectionCapabilityResult;t=null;do t=n.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(t===r.maybe);t===r.probably&&(e.width=3840,e.height=2160)}catch{F(`Xbox: Error detecting screen size, default screen size 1920x1080.`)}return Promise.resolve(e)},r.Xa=function(e){return Qx.prototype.Xa.call(this,e),e.drm.parseInbandPsshEnabled=this.g,e.drm.preferredKeySystems.push(`com.microsoft.playready`),this.g&&(e.streaming.gapPadding=.01),e},r.Bf=function(){return!0},r.Ah=function(){return!1};function _S(){var e=null;try{e=typeof Windows<`u`?Windows:chrome.webview.hostObjects.sync.Windows}catch{}return e}(navigator.userAgent.includes(`Xbox One`)||_S()!==null)&&(Te=function(){return new gS});function vS(e,t,n){this.type=e,this.ea=t,this.segments=n||null}function yS(e,t,n,r){this.id=e,this.name=t,this.attributes=n,this.value=r===void 0?null:r}yS.prototype.toString=function(e){function t(e){return e.name+`=`+(isNaN(Number(e.value))?`"`+e.value+`"`:e.value)}var n=`#`+this.name,r=this.attributes?this.attributes.filter(function(t){return!e||!e.has(t.name)}).map(t):[];return this.value&&r.unshift(this.value),r.length>0&&(n+=`:`+r.join(`,`)),n};function bS(e,t){return t?e.toString():(t=(/* @__PURE__ */ new Set()).add(`AUDIO`).add(`VIDEO`).add(`SUBTITLES`).add(`PATHWAY-ID`).add(`GROUP-ID`).add(`URI`),e.toString(t))}function xS(e,t){return e.attributes.find(function(e){return e.name===t})||null}function $(e,t,n){return(e=xS(e,t))?e.value:n||null}function SS(e,t){if(e=xS(e,t),!e)throw new R(2,4,4023,t);return e.value}function CS(e,t,n){n=n===void 0?[]:n,this.ea=t,this.g=e,this.sc=n}function wS(e,t){this.name=e,this.value=t}function TS(e,t){return e.filter(function(e){return e.name==t})}function ES(e,t){return e.filter(function(e){return SS(e,`TYPE`)==t})}function DS(e,t){e=g(e);for(var n=e.next();!n.done;n=e.next())if(n=n.value,n.name===t)return n;return null}function OS(e,t,n){return n=n===void 0?0:n,(e=DS(e,t))?Number(e.value):n}function kS(e,t,n){return t?AS(e,[t],n):[]}function AS(e,t,n){if(!t.length)return[];var r=t;return n&&n.size&&(r=t.map(function(e){return jS(e,n)})),Dt(e,r)}function jS(e,t){if(!t||!t.size)return e;e=String(e).replace(/%7B/g,`{`).replace(/%7D/g,`}`);var n=e.match(/{\$\w*}/g);if(n){n=g(n);for(var r=n.next();!r.done;r=n.next()){r=r.value;var i=r.slice(2,r.length-1),a=t.get(i);if(a)e=e.replace(r,a);else throw new R(2,4,4039,i)}}return e}function MS(e){e=e.value;var t=e.indexOf(`,`);return Number(t===-1?e:e.substring(0,t))}function NS(){this.g=0}function PS(e,t){var n=pt(t).trim().split(/[\r\n]+/);if(!n[0].startsWith(`#EXTM3U`))throw new R(2,4,4015);t=0;for(var r=!1,i=[],a=!0,o=0;o<n.length;o++){var s=n[o],c=n[o+1];if(s.startsWith(`#`)&&!s.startsWith(`#EXT`)||a)a=!1;else{if(s=FS(e,s),r||(IS.has(s.name)?(t=1,r=!0):s.name==`EXT-X-STREAM-INF`||s.name==`EXT-X-MEDIA`?r=!0:LS.has(s.name)&&(t=1,r=!0)),LS.has(s.name)){if(t!=1)throw new R(2,4,4017);a=e,e=Array(Math.max(100,Math.floor((n.length-o)/2))),r=0,s=[];var l=[];for(c=null;o<n.length;o++){var u=n[o];u.startsWith(`#EXT`)?(u=FS(a,u),IS.has(u.name)?i.push(u):u.name==`EXT-X-MAP`?c=u:u.name==`EXT-X-PART`?l.push(u):u.name==`EXT-X-PRELOAD-HINT`?$(u,`TYPE`)==`PART`?l.push(u):$(u,`TYPE`)==`MAP`&&(u.name=`EXT-X-MAP`,c=u):s.push(u)):(!u.startsWith(`#`)||u.startsWith(`#EXT`))&&(u=u.trim(),c&&s.push(c),s=new CS(u,s,l),r<e.length?e[r++]=s:(e.push(s),r++),s=[],l=[])}return l.length&&(c&&s.push(c),n=new CS(``,s,l),r<e.length?e[r++]=n:(e.push(n),r++)),new vS(t,i,r<e.length?e.slice(0,r):e)}i.push(s),s.name==`EXT-X-STREAM-INF`&&(s.attributes.push(new wS(`URI`,c)),a=!0)}}return new vS(t,i)}function FS(e,t){e=e.g++;var n=t.indexOf(`:`),r=n===-1?t.substring(1):t.substring(1,n);if(!r.startsWith(`EXT`))throw new R(2,4,4016,t);if(t=n===-1?null:t.substring(n+1),t===null)e=new yS(e,r,[]);else if(t.indexOf(`=`)===-1)e=new yS(e,r,[],t);else{n=[];var i=null,a=0,o=t.indexOf(`,`),s=t.indexOf(`=`);for(o!==-1&&o<s&&(i=t.substring(0,o),a=o+1);a<t.length;){for(;t[a]===` `;)a++;if(s=t.indexOf(`=`,a),s===-1)break;if(o=t.substring(a,s),a=s+1,t[a]===`"`){a++;var c=t.indexOf(`"`,a);s=c===-1?t.substring(a):t.substring(a,c),a=c===-1?t.length:c+1}else c=t.indexOf(`,`,a),s=c===-1?t.substring(a):t.substring(a,c),a=c===-1?t.length:c;a<t.length&&t[a]===`,`&&a++,n.push(new wS(o,s))}e=new yS(e,r,n,i)}return e}var IS=new Set(`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(` `)),LS=new Set(`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 RS(){}function zS(e,t){try{var n=BS(e);return ua({uri:e,originalUri:e,data:n.data,headers:{"content-type":n.contentType},originalRequest:t})}catch(e){return ca(e)}}function BS(e){if(!e.startsWith(`data:`))throw new R(2,1,1004,e);var t=e.substring(5),n=t.indexOf(`,`);if(n<0)throw new R(2,1,1004,e);e=t.substring(0,n),t=decodeURIComponent(t.substring(n+1)),n=e.split(`;`),e=n[0];var r=!1;return n.length>1&&n[n.length-1].toLowerCase()==`base64`&&(r=!0,n.pop()),{data:r?Ct(t):gt(t),contentType:e,Fh:n}}P(`shaka.net.DataUriPlugin`,RS),RS.parse=zS,ba(`data`,zS);function VS(){var e=this;this.g=this.h=null,this.G=1,this.C=/* @__PURE__ */ new Map,this.M=/* @__PURE__ */ new Map,this.D=/* @__PURE__ */ new Map,this.D.set(`video`,/* @__PURE__ */ new Map),this.D.set(`audio`,/* @__PURE__ */ new Map),this.D.set(Nt,/* @__PURE__ */ new Map),this.D.set(`image`,/* @__PURE__ */ new Map),this.$b=(/* @__PURE__ */ new Map()).set(`com.apple.streamingkeydelivery`,function(t,n,r){return QC(e,t,n,r)}).set(`urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed`,function(t){var n=SS(t,`METHOD`);if([`SAMPLE-AES`,`SAMPLE-AES-CTR`].includes(n)){var r=`cenc`;n==`SAMPLE-AES`&&(r=`cbcs`);var i=SS(t,`URI`);if(n=BS(i.split(`?`)[0]),i=i.split(`?`)[0],!e.I.has(i)){var a=Ze(n.data);e.I.set(i,a)}r=Ot(`com.widevine.alpha`,r,[{initDataType:`cenc`,initData:e.I.get(i)}],void 0,n.Fh),(t=$(t,`KEYID`))&&r.keyIds.add(t.toLowerCase().substr(2)),t=Promise.resolve(r)}else t=Promise.resolve(null);return t}).set(`com.microsoft.playready`,function(e){var t=SS(e,`METHOD`);if([`SAMPLE-AES`,`SAMPLE-AES-CTR`].includes(t)){var n=`cenc`;t==`SAMPLE-AES`&&(n=`cbcs`),e=SS(e,`URI`),t=BS(e.split(`?`)[0]),e=Ze(t.data);var r=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);r=$a(e,r,/* @__PURE__ */ new Set,0),n=Ot(`com.microsoft.playready`,n,[{initDataType:`cenc`,initData:r}],void 0,t.Fh),(e=gn([`<PLAYREADY>`,St(e),`</PLAYREADY>`].join(`
|
|
16
|
+
`)))&&(n.licenseServerUri=by(e)),n=Promise.resolve(n)}else n=Promise.resolve(null);return n}).set(`urn:uuid:3d5e6d35-9b9a-41e8-b843-dd3c6e72c42c`,function(t){var n=SS(t,`METHOD`);if([`SAMPLE-AES`,`SAMPLE-AES-CTR`].includes(n)){var r=`cenc`;n==`SAMPLE-AES`&&(r=`cbcs`);var i=SS(t,`URI`);if(n=BS(i.split(`?`)[0]),i=i.split(`?`)[0],!e.I.has(i)){var a=Ze(n.data);e.I.set(i,a)}r=Ot(`com.huawei.wiseplay`,r,[{initDataType:`cenc`,initData:e.I.get(i)}],void 0,n.Fh),(t=$(t,`KEYID`))&&r.keyIds.add(t.toLowerCase().substr(2)),t=Promise.resolve(r)}else t=Promise.resolve(null);return t}),this.ib=/* @__PURE__ */ new Set,this.j=/* @__PURE__ */ new Map,this.m=null,this.H=``,this.ab=new NS,this.N=-1,this.ia=1/0,this.aa=this.vc=this.hb=!1,this.B=new Qr(function(){e.W&&!e.g.continueLoadingWhenPaused&&(e.U.Oa(e.W,`timeupdate`),e.W.paused)?e.U.Ba(e.W,`timeupdate`,function(){return qC(e)}):qC(e)}),this.Ha=lw,this.i=null,this.eb=0,this.u=1/0,this.Ua=this.Ka=this.S=0,this.Z=new _a,this.J=/* @__PURE__ */ new Map,this.K=/* @__PURE__ */ new Map,this.Ca=/* @__PURE__ */ new Map,this.ua=/* @__PURE__ */ new Map,this.O=/* @__PURE__ */ new Map,this.ya=/* @__PURE__ */ new Map,this.za=/* @__PURE__ */ new Map,this.uc=this.qa=!1,this.Xb=new ie(5),this.l=null,this.R=!0,this.U=new I,this.o=this.W=null,this.Zb=function(){return!1},this.I=/* @__PURE__ */ new Map}r=VS.prototype,r.configure=function(e,t){var n=this.h&&e.updatePeriod!=this.g.updatePeriod&&e.updatePeriod>=0;this.g=e,t&&(this.Zb=t),this.l&&this.l.configure(this.g),n&&this.i&&this.i.presentationTimeline.T()&&this.B.yb()},r.start=function(e,t){var n=this,r;return k(function(i){return i.h==1?(n.h=t,n.qa=t.isLowLatencyMode(),i.g(KC(n,[e]).promise,2)):i.h==3?i.return(n.i):(r=i.i,n.H=r.uri,i.g(qS(n,r.data),3))})},r.stop=function(){this.B&&(this.B.stop(),this.B=null);var e=[];return this.Z&&(e.push(this.Z.destroy()),this.Z=null),this.g=this.h=null,this.ib.clear(),this.i=null,this.j.clear(),this.M.clear(),this.K.clear(),this.C.clear(),this.Ca.clear(),this.ua.clear(),this.O.clear(),this.ya.clear(),this.za.clear(),this.I.clear(),this.l&&this.l.destroy(),this.U&&(this.U.release(),this.U=null),Promise.all(e)},r.update=function(){var e=this,t,n,r,i,a,o,s,c,l,u;return k(function(d){if(d.h==1){if(!JC(e)||(t=[],n=Array.from(e.j.values()),r=n.filter(function(e){return!e.stream.isAudioMuxedInVideo&&e.stream.segmentIndex}),r.length===0))return d.return();for(e.u=1/0,e.i.gapCount=0,i=g(r),a=i.next();!a.done;a=i.next())o=a.value,t.push(US(e,o));return d.g(Promise.all(t),2)}for(SC(e,r.map(function(e){return e.stream})),s=r.some(function(e){return e.Xd==0}),r.length&&!s&&(YC(e,lw),XS(e)),s&&XS(e),c=g(r),l=c.next();!l.done;l=c.next())u=l.value,u.stream.isAudioMuxedInVideo||!u.stream.segmentIndex||u.stream.segmentIndex.Cb()||e.h.disableStream(u.stream);d.j()})};function HS(e,t){return JC(e)?e.D.get(t.type):t.nf}function US(e,t){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,v,y,b,x,S,C,w,T,E,D,O,A,j,M,ee,te,N,ne,re,P,ie,ae;return k(function(k){switch(k.h){case 1:if(t.stream.isAudioMuxedInVideo)return k.return();for(n=[],r=g(t.P()),i=r.next();!i.done;i=r.next())a=i.value,o=new Ne(a),s=o.g,t.Oe&&(t.Lb>=0&&s.add(`_HLS_msn`,String(t.Lb)),t.Mb>=0&&s.add(`_HLS_part`,String(t.Mb))),t.Pe&&s.add(`_HLS_skip`,`YES`),n.push(o.toString());return k.m(2),k.g(KC(e,n,!0).promise,4);case 4:c=k.i,k.o(3);break;case 2:throw l=k.l(),e.h&&e.h.disableStream(t.stream),l;case 3:if(!t.stream.segmentIndex)return k.return();if(u=PS(e.ab,c.data),u.type!=1)throw new R(2,4,4017);return d=c.uri,d==c.originalUri||t.P().includes(d)||t.zf.push(d),f=TS(u.ea,`EXT-X-DEFINE`),p=QS(e,f,d),m=t.stream,h=HS(e,t),k.g(kC(e,u,m.mimeType,t.P,p),5);case 5:for(v=k.i,y=v.keyIds,b=v.drmInfos,x=v.encrypted,S=v.Nh,m.encrypted||!x||S||(m.encrypted=!0),C=function(e,t){return e.size===t.size&&[].concat(_(e)).every(function(e){return t.has(e)})},C(m.keyIds,y)||(m.keyIds=y,m.drmInfos=b,e.h.newDrmInfo(m)),w=BC(e,u,h,p,t.P,t.type),T=w.segments,(E=w.bandwidth)&&(m.bandwidth=E),D=Tu(m),O=g(T),A=O.next();!A.done;A=O.next())j=A.value,j.ba&&(j.ba.sd=D);m.segmentIndex.ce(T,e.m.Fb()),T.length&&(M=OS(u.ea,`EXT-X-MEDIA-SEQUENCE`,0),te=(ee=DS(u.ea,`EXT-X-SKIP`))?Number($(ee,`SKIPPED-SEGMENTS`)):0,N=DC(M,T),ne=N.Lb,re=N.Mb,t.Lb=ne+te,t.Mb=re,P=h.get(M),m.segmentIndex.Va(P)),(ie=m.segmentIndex.Cb())&&(t.Qc=ie.startTime,ae=T[T.length-1],t.Hc=ae.endTime),DS(u.ea,`EXT-X-ENDLIST`)&&(t.Xd=!0),NC(e,u),zC(e,u.ea,m.type,p,t.P),k.j()}})}r.onExpirationUpdated=function(){},r.onInitialVariantChosen=function(){},r.banLocation=function(e){this.l&&this.l.banLocation(e)},r.setMediaElement=function(e){this.W=e};function WS(e,t,n){n=n!==void 0&&n;for(var r=e.N==-1,i=g(t),a=i.next();!a.done;a=i.next()){a=a.value;var o=a.stream.segmentIndex,s=HS(e,a);if(o=o.Cb()){s=g(s);for(var c=s.next();!c.done;c=s.next()){c=g(c.value);var l=c.next().value;if(c.next().value==o.startTime){r&&(e.N=Math.max(e.N,l)),a.ng=l;break}}}}if(!(e.N<0))for(t=g(t),r=t.next();!r.done;r=t.next())r=r.value,(wC(e,r.type)||n)&&(i=r.stream.segmentIndex)&&(a=e.N-r.ng,a>0&&(i.g.splice(0,a),i=i.Cb())&&(i=-i.startTime,r.stream.segmentIndex.offset(i),KS(e,r,i)))}function GS(e,t){if(e.ia==1/0){t=g(t);for(var n=t.next();!n.done;n=t.next())n=n.value.stream.segmentIndex.Cb(),n!=null&&n.h!=null&&(e.ia=Math.min(e.ia,n.h))}if(t=e.ia,t!=1/0){n=g(e.j.values());for(var r=n.next();!r.done;r=n.next())if(r=r.value,!wC(e,r.type)){var i=r.stream.segmentIndex;if(i!=null){var a=i.Cb();if(a){if(a.h==null)ce(`Missing EXT-X-PROGRAM-DATE-TIME for stream`,r.P(),`Expect AV sync issues!`);else for(KS(e,r,a.h-t-a.startTime),r=g(i),i=r.next();!i.done;i=r.next())i.value.Bh(t)}}}}}function KS(e,t,n){if(!(Math.abs(n)<.001)){t.Qc+=n,t.Hc+=n,e=HS(e,t);for(var r=g(e),i=r.next();!i.done;i=r.next()){var a=g(i.value);i=a.next().value,a=a.next().value,e.set(i,a+n)}t.P()}}function qS(e,t){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,v,y,b,x,S,C,w,T,E,D,O,A,j,M,ee,te,N,ne,re,P,ie,ae,oe,se,ce,F,le,ue,de;return k(function(k){switch(k.h){case 1:return n=Pt,r=PS(e.ab,t),i=TS(r.ea,`EXT-X-DEFINE`),a=[],o=[],s=[],e.m=new G(null,0),e.m.Vc(!0),c=function(){return[e.H]},l=null,u=/* @__PURE__ */ new Map,e.i={presentationTimeline:e.m,variants:a,textStreams:o,imageStreams:s,offlineSessionIds:[],sequenceMode:e.g.hls.sequenceMode,ignoreManifestTimestampsInSegmentsMode:e.g.hls.ignoreManifestTimestampsInSegmentsMode,type:`HLS`,serviceDescription:null,nextUrl:null,periodCount:1,gapCount:0,isLowLatency:!1,startTime:e.o},r.type==1?(e.R=!1,ne=TS(r.ea,`EXT-X-DEFINE`),u=QS(e,ne,e.H),l=n.wa,re=``,P=/* @__PURE__ */ new Map,k.g(EC(e,e.G++,u,r,c,``,l,re,!0,`Media Playlist`,null,P,null,!1,null,!1),7)):(ZS(e,i),d=TS(r.ea,`EXT-X-MEDIA`),f=TS(r.ea,`EXT-X-STREAM-INF`),p=TS(r.ea,`EXT-X-IMAGE-STREAM-INF`),m=TS(r.ea,`EXT-X-I-FRAME-STREAM-INF`),h=TS(r.ea,`EXT-X-SESSION-KEY`),v=TS(r.ea,`EXT-X-SESSION-DATA`),y=TS(r.ea,`EXT-X-CONTENT-STEERING`),eC(e,v),k.g(tC(e,y),4));case 4:if(!e.g.ignoreSupplementalCodecs){for(b=[],x=g(f),S=x.next(),C={};!S.done;C={aj:void 0},S=x.next())w=S.value,(T=$(w,`SUPPLEMENTAL-CODECS`))&&(C.aj=T.split(/\s*,\s*/).map(function(e){return e.split(`/`)[0]}),E=w.attributes.map(function(e){return function(t){var n=t.name,r=t.value;return n==`CODECS`&&(r=e.aj.join(`,`),t=t.value.split(`,`),t.length>1&&(t=jt(`audio`,t))&&(r+=`,`+t)),new wS(n,r)}}(C)),b.push(new yS(w.id,w.name,E,null)));for(f.push.apply(f,_(b)),D=[],O=g(m),A=O.next(),j={};!A.done;j={bj:void 0},A=O.next())M=A.value,(ee=$(M,`SUPPLEMENTAL-CODECS`))&&(j.bj=ee.split(/\s*,\s*/).map(function(e){return e.split(`/`)[0]}),te=M.attributes.map(function(e){return function(t){var n=t.name;return t=t.value,n==`CODECS`&&(t=e.bj.join(`,`)),new wS(n,t)}}(j)),D.push(new yS(M.id,M.name,te,null)));m.push.apply(m,_(D))}return $S(e,f),hC(e,d),N=oC(e,m),k.g(sC(e,f,h,d,c,e.C,N),5);case 5:return a=k.i,o=nC(e,d),k.g(iC(e,p,m),6);case 6:s=k.i,k.A(3);break;case 7:ie=k.i,e.j.set(e.H,ie),ie.stream&&(ae=Tu(ie.stream),ie.stream.segmentIndex.qb(function(e){e.ba&&(e.ba.sd=ae)})),l=ie.stream.type,oe=!0,(e.g.disableAudio&&ie.type==`audio`||e.g.disableVideo&&ie.type==`video`&&!ie.stream.codecs.includes(`,`))&&(oe=!1),oe&&a.push({id:0,language:li(re||`und`),disabledUntilTime:0,primary:!0,audio:ie.type==`audio`?ie.stream:null,video:ie.type==`video`?ie.stream:null,bandwidth:ie.stream.bandwidth||0,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});case 3:if(!e.h)throw new R(2,7,7001);if(jC(e,r),r.type==1&&(JC(e)&&(PC(e,r),se=e.u,e.B.na(se)),ce=Array.from(e.j.values()),CC(e,ce),XS(e),zC(e,r.ea,l,u,c)),e.i.variants=a,e.i.textStreams=o,e.i.imageStreams=s,e.i.startTime=e.o,e.aa||!e.g.hls.disableCodecGuessing){k.A(8);break}for(F=[],le=g(e.i.variants),ue=le.next();!ue.done;ue=le.next())de=ue.value,de.audio&&de.audio.codecs===``&&F.push(de.audio.createSegmentIndex()),de.video&&de.video.codecs===``&&F.push(de.video.createSegmentIndex());return k.g(Promise.all(F),8);case 8:e.h.makeTextStreamsForClosedCaptions(e.i),k.j()}})}function JS(e,t){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,_,v;return k(function(y){if(y.h==1)return n=Vu(e.g.hls.mediaPlaylistFullMimeType),t.length?(r=UC(e,t),i=r.segment,a=r.segmentIndex,o=i.P(),(s=Ju(o[0]))&&(c=tw.get(s))?y.return(Vu(c)):y.g(Promise.all([YS(e,i.ba,0),YS(e,i,a)]),2)):y.return(n);if(l=y.i,u=l[1].mimeType,d=l[0].data,f=l[1].data,p=`mp4 mp4a m4s m4i m4a m4f cmfa mp4v m4v cmfv fmp4`.split(` `),m=[`audio/mp4`,`video/mp4`,`video/iso.segment`],h=i.ba||m.includes(u),!h&&Hc(Ze(f))){var b=f,x=e.g.disableAudio,S=e.g.disableVideo,C=e.g.disableText,w=Ze(b),T=new jc().parse(w),E=T.Td();w=T.Jg();var D=[],O=!1,k=!1;if(!x)switch(E.audio){case`aac`:case`aac-loas`:T.rb().length&&(D.push(`mp4a.40.2`),O=!0);break;case`mp3`:T.rb().length&&(D.push(`mp4a.40.34`),O=!0);break;case`ac3`:T.rb().length&&(D.push(`ac-3`),O=!0);break;case`ec3`:T.rb().length&&(D.push(`ec-3`),O=!0);break;case`opus`:T.rb().length&&(D.push(`opus`),O=!0)}if(!S)switch(E.video){case`avc`:w.codec?D.push(w.codec):D.push(`avc1.42E01E`),k=!0;break;case`hvc`:w.codec?D.push(w.codec):D.push(`hvc1.1.6.L93.90`),k=!0;break;case`av1`:D.push(`av01.0.01M.08`),k=!0}if(D.length){if(x=O&&!k,S=/* @__PURE__ */ new Map,k&&!C){for(C=new Jt(`video/mp2t`),Yt(C,b),b=g(C.g.getStreams()),k=b.next();!k.done;k=b.next())k=k.value,S.set(k,k);C.g.clear()}w={type:x?`audio`:`video`,mimeType:`video/mp2t`,codecs:D.join(`, `),language:null,height:w.height,width:w.width,channelCount:null,sampleRate:null,closedCaptions:S,se:null,colorGamut:null,frameRate:w.frameRate,timescale:null}}else w=null;if(_=w)return y.return(_)}else if((h||p.includes(s))&&(v=Hu(d,f,e.g.disableText)))return y.return(v);return u?y.return(Vu(u)):y.return(n)})}function YS(e,t,n){var r,i,a,o,s,c;return k(function(l){switch(l.h){case 1:return t?(r=ka,i=Yu(t.P(),t.Fc(),t.Dc(),e.g.retryParameters),a=+(t instanceof H),l.g(XC(e,i,r,{type:a}).promise,2)):l.return({mimeType:null,data:null});case 2:if(o=l.i,s=o.data,!t.aesKey){l.A(3);break}return l.g(Ku(s,t.aesKey,n),4);case 4:s=l.i;case 3:return t instanceof H?t.me(s,!0):t.me(s),(c=o.headers[`content-type`])&&(c=c.split(`;`)[0].toLowerCase()),l.return({mimeType:c,data:s})}})}function XS(e){if(JC(e)){if(e.Ha==dw){for(var t=1/0,n=1/0,r=g(e.j.values()),i=r.next();!i.done;i=r.next())i=i.value,i.stream.segmentIndex&&i.stream.type!=`text`&&!i.stream.isAudioMuxedInVideo&&(t=Math.min(t,i.Hc),n=Math.min(n,i.Qc));t=t-n||0,isNaN(e.g.availabilityWindowOverride)||(t=e.g.availabilityWindowOverride),e.m.Hf(t)}}else e.m.wb(xC(e));if(!e.m.o)for(t=g(e.j.values()),n=t.next();!n.done;n=t.next())n=n.value,!n.stream.segmentIndex||n.type!=`audio`&&n.type!=`video`||(n=n.stream.segmentIndex.Cb())&&n.h!=null&&e.m.rh(n.h);e.m.mf()}function ZS(e,t){var n=new Ne(e.H).g;t=g(t);for(var r=t.next();!r.done;r=t.next()){var i=r.value;r=$(i,`NAME`);var a=$(i,`VALUE`);i=$(i,`QUERYPARAM`),r&&a&&(e.C.has(r)||e.C.set(r,a)),i&&(r=n.get(i)[0])&&!e.C.has(r)&&e.C.set(i,r)}}function QS(e,t,n){n=new Ne(n).g;var r=/* @__PURE__ */ new Map;t=g(t);for(var i=t.next();!i.done;i=t.next()){var a=i.value,o=$(a,`NAME`),s=$(a,`VALUE`);i=$(a,`QUERYPARAM`),a=$(a,`IMPORT`),o&&s&&(r.has(o)||r.set(o,s)),i&&(o=n.get(i)[0])&&!r.has(o)&&r.set(i,o),a&&(i=e.C.get(a))&&r.set(a,i)}return r}function $S(e,t){t=g(t);for(var n=t.next();!n.done;n=t.next()){var r=n.value,i=$(r,`AUDIO`);n=$(r,`VIDEO`);var a=$(r,`SUBTITLES`);if(r=lC(e,r),a){var o=jt(Nt,r);e.K.set(a,o),pe(r,o)}i&&(a=jt(`audio`,r),a||(a=e.g.hls.defaultAudioCodec),e.K.set(i,a)),n&&(i=jt(`video`,r),i||(i=e.g.hls.defaultVideoCodec),e.K.set(n,i))}}function eC(e,t){t=g(t);for(var n=t.next();!n.done;n=t.next()){var r=n.value,i=$(r,`DATA-ID`);n=$(r,`URI`);var a=$(r,`LANGUAGE`);r=$(r,`VALUE`),i=(/* @__PURE__ */ new Map()).set(`id`,i),n&&i.set(`uri`,kS([e.H],n,e.C)[0]),a&&i.set(`language`,a),r&&i.set(`value`,r),n=new V(`sessiondata`,i),e.h&&e.h.onEvent(n)}}function tC(e,t){var n,r,i,a,o,s;return k(function(c){if(!e.h||!e.g)return c.return();for(r=g(t),i=r.next();!i.done;i=r.next())if(a=i.value,o=$(a,`PATHWAY-ID`),s=$(a,`SERVER-URI`),o&&s){e.l=new bb(e.h),e.l.configure(e.g),e.l.i=[e.H],e.l.setManifestType(`HLS`),e.l.h=o,n=xb(e.l,s);break}return c.g(n,0)})}function nC(e,t){var n=ES(t,`SUBTITLES`),r={};t=g(n);for(var i=t.next();!i.done;i=t.next()){i=i.value;var a=bS(i,!e.l);r[a]?r[a].push(i):r[a]=[i]}if(t=[],!e.g.disableText)for(var o in r)try{t.push(gC(e,r[o],/* @__PURE__ */ new Map).stream)}catch(t){if(!e.g.hls.ignoreTextStreamFailures)throw t}for(o=g(n),n=o.next();!n.done;n=o.next())if(r=SS(n.value,`GROUP-ID`),(n=e.K.get(r))&&(r=e.M.get(r)))for(r=g(r),i=r.next();!i.done;i=r.next())i=i.value,i.stream.codecs=n,i.stream.mimeType=VC(Nt,n)||HC(Nt),rC(i.stream);return t.filter(function(e){return e})}function rC(e){var t=/* @__PURE__ */ new Set([kr(e.mimeType,e.codecs)]);e.segmentIndex&&e.segmentIndex.qb(function(n){n.mimeType&&t.add(kr(n.mimeType,e.codecs))}),e.fullMimeTypes=t}function iC(e,t,n){var r,i;return k(function(a){return a.h==1?(r=t.map(function(t){var n,r;return k(function(i){if(i.h==1)return e.g.disableThumbnails?i.return(null):(i.m(2),i.g(_C(e,t),4));if(i.h!=2)return n=i.i,i.return(n.stream);if(r=i.l(),e.g.hls.ignoreImageStreamFailures)return i.return(null);throw r})}).concat(n.map(function(t){if(e.g.disableThumbnails)return null;try{var n=vC(e,t);return n.stream.type===`image`?n.stream:null}catch(t){if(e.g.hls.ignoreImageStreamFailures)return null;throw t}})),a.g(Promise.all(r),2)):(i=a.i,a.return(i.filter(function(e){return e})))})}function aC(e,t,n){t=t.filter(function(e){var t=$(e,`URI`)||``;return e=$(e,`TYPE`),e!=`SUBTITLES`&&(t!=``||e==`AUDIO`)});var r={};t=g(t);for(var i=t.next();!i.done;i=t.next()){i=i.value;var a=bS(i,!e.l);r[a]?r[a].push(i):r[a]=[i]}for(var o in r)gC(e,r[o],n,!1)}function oC(e,t){return t.map(function(t){return t=vC(e,t),t.stream.type===`video`?t.stream:null}).filter(function(e){return e})}function sC(e,t,n,r,i,a,o){var s,c,l,u,d,f,p,m,h,v,y,b,x,S,C,w,T,E,D,O,A,j,M,ee,te,N,ne,re,P,ie,ae,oe,se,ce,F,le;return k(function(k){switch(k.h){case 1:if(s=[],c=/* @__PURE__ */ new Set,e.g.ignoreDrmInfo||!(n.length>0)){k.A(2);break}l=g(n),u=l.next();case 3:if(u.done){k.A(2);break}if(d=u.value,f=SS(d,`METHOD`),p=$(d,`KEYFORMAT`)||`identity`,m=null,f==`NONE`){k.A(4);break}if(ZC(f)){h=kS(i(),SS(d,`URI`),a),v=h.sort().join(``),e.O.has(v)||(y=Sa(h,e.g.retryParameters),b=XC(e,y,6).promise,e.O.set(v,b)),k.A(4);break}if(p==`identity`)return k.g($C(e,d,``,i,null,a),12);if(x=e.$b.get(p),!x){S=null,k.A(10);break}return k.g(x(d,``,null),11);case 11:S=k.i;case 10:m=S,k.A(6);break;case 12:m=k.i;case 6:if(m){if(m.keyIds)for(C=g(m.keyIds),w=C.next();!w.done;w=C.next())T=w.value,c.add(T);s.push(m)}case 4:u=l.next(),k.A(3);break;case 2:for(E={},D=g(t),O=D.next();!O.done;O=D.next())A=O.value,j=bS(A,!e.l),E[j]?E[j].push(A):E[j]=[A];for(ee in M=[],E)te=E[ee],N=te[0],ne=$(N,`FRAME-RATE`),re=Number(SS(N,`BANDWIDTH`))||Number($(N,`AVERAGE-BANDWIDTH`)),P=$(N,`RESOLUTION`),ie=g(P?P.split(`x`):[null,null]),ae=ie.next().value,oe=ie.next().value,se=$(N,`VIDEO-RANGE`),(ce=$(N,`REQ-VIDEO-LAYOUT`))&&ce.includes(`,`)&&(F=ce.split(`,`).filter(function(e){return e==`CH-STEREO`||e==`CH-MONO`}),ce=F[0]),ce=ce||`CH-MONO`,le=cC(e,te,r),M.push.apply(M,_(mC(e,le.audio,le.video,re,ae,oe,ne,se,ce,s,c,o)));return k.return(M.filter(function(e){return e!=null}))}})}function cC(e,t,n){for(var r={audio:[],video:[]},i=/* @__PURE__ */ new Map,a=[],o=!1,s=!1,c=g(t),l=c.next();!l.done;l=c.next()){var u=l.value;l=$(u,`AUDIO`);var d=$(u,`VIDEO`),f=l||d;f&&(a.includes(f)||a.push(f),(u=$(u,`PATHWAY-ID`))&&i.set(f,u),l?o=!0:d&&(s=!0))}a.length&&n.length&&(n=n.filter(function(e){return a.includes(SS(e,`GROUP-ID`))}),aC(e,n,i)),n=(i=a.sort().join(`,`))&&e.M.has(i)?e.M.get(i):[],o?r.audio.push.apply(r.audio,_(n)):s&&r.video.push.apply(r.video,_(n)),s=!1;var p=t.map(function(e){return SS(e,`URI`)});return o=r.audio.find(function(e){return e&&e.P().find(function(e){return p.includes(e)})}),n=lC(e,t[0]),c=jt(`video`,n),(l=jt(`audio`,n))&&!c?(o=`audio`,s=r.audio.length>0&&!r.audio.some(function(e){return e.stream.isAudioMuxedInVideo})):!r.audio.length&&!r.video.length&&l&&c?(o=`video`,n=[[c,l].join()]):r.audio.length&&o?(o=`audio`,s=!0):o=r.video.length&&!r.audio.length?`audio`:`video`,s||(t=yC(e,t,n,o),i&&e.g.enableAudioGroups&&(t.stream.groupId=i),t.stream.type==`audio`&&o===`audio`&&r.audio.some(function(e){return e.stream.isAudioMuxedInVideo})&&(e=r.audio[0].stream,t.stream.language=e.language,t.stream.channelsCount=e.channelsCount,t.stream.label=e.label,t.stream.audioSamplingRate=e.audioSamplingRate,t.stream.originalId=e.originalId,t.stream.originalLanguage=e.originalLanguage),r[t.stream.type]=[t]),r}function lC(e,t){return t=$(t,`CODECS`)||``,e.aa=t.length>0,e.aa||e.g.hls.disableCodecGuessing||(t=[],e.g.disableVideo||t.push(e.g.hls.defaultVideoCodec),e.g.disableAudio||t.push(e.g.hls.defaultAudioCodec),t=t.join(`,`)),Uu(t.split(/\s*,\s*/))}function uC(e){return(e=$(e,`CHANNELS`))?parseInt(e.split(`/`)[0],10):null}function dC(e){return(e=$(e,`SAMPLE-RATE`))?parseInt(e,10):null}function fC(e){return e=$(e,`CHANNELS`),e?(e=e.split(`/`),e.length==2?e[1]===`JOC`||e[1].includes(`ATMOS`)||e[1].includes(`IMSA`):!1):!1}function pC(e){return e=SS(e,`TYPE`).toLowerCase(),e==`subtitles`&&(e=Nt),e}function mC(e,t,n,r,i,a,o,s,c,l,u,d){for(var f=g(n),p=f.next();!p.done;p=f.next())GC(p.value.stream,i,a,o,s,c,null);for(i=e.g.disableVideo,(!n.length||i)&&(n=[null]),i&&(t=t.filter(function(e){return!e.stream.isAudioMuxedInVideo})),i=e.g.disableAudio,(!t.length||i)&&(t=[null]),i=[],t=g(t),a=t.next();!a.done;a=t.next())for(a=a.value,o=g(n),s=o.next();!s.done;s=o.next()){var m=s.value;(s=a?a.stream:null)&&(s.drmInfos=l,s.keyIds=u),(c=m?m.stream:null)&&(c.drmInfos=l,c.keyIds=u,e.g.disableIFrames||Wi(c,d)),c&&!s&&(c.bandwidth=r),!c&&s&&(s.bandwidth=r),f=a?a.stream.drmInfos:null,p=m?m.stream.drmInfos:null,m=m?m.P().sort().join(`,`):``;var h=a?a.P().sort().join(`,`):``,_=[];s&&s.codecs&&_.push(s.codecs),c&&c.codecs&&_.push(c.codecs),m=[m,h,_.sort()].join(`-`),s&&c&&!tt(f,p)||e.ib.has(m)||(s={id:e.G++,language:s?s.language:`und`,disabledUntilTime:0,primary:!!s&&s.primary||!!c&&c.primary,audio:s,video:c,bandwidth:r,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},i.push(s),e.ib.add(m))}return i}function hC(e,t){t=ES(t,`CLOSED-CAPTIONS`),e.R=t.length==0,t=g(t);for(var n=t.next();!n.done;n=t.next()){var r=n.value,i=$(r,`LANGUAGE`);n=li(i||`und`),i||(i=$(r,`NAME`))&&(n=i),i=SS(r,`GROUP-ID`),r=SS(r,`INSTREAM-ID`).replace(`SERVICE`,`svc`),e.J.get(i)||e.J.set(i,/* @__PURE__ */ new Map),e.J.get(i).set(r,n)}}function gC(e,t,n,r){r=r===void 0||r;for(var i=[],a=[],o=/* @__PURE__ */ new Map,s=g(t),c=s.next(),l={};!c.done;l={li:void 0},c=s.next()){c=c.value,l.li=++e.G,l=function(e){return function(){return`shaka://hls-muxed`+e.li}}(l);var u=r?SS(c,`URI`):$(c,`URI`)||l();l=SS(c,`GROUP-ID`),i.push(u),a.push(l),o.set(l,u),(c=$(c,`PATHWAY-ID`))&&n.set(l,c)}if(r=a.sort().join(`,`),c=t[0],t=``,s=pC(c),s==Nt)t=$(c,`CODECS`)||``;else for(a=g(a),l=a.next();!l.done;l=a.next())if(l=l.value,e.K.has(l)){t=e.K.get(l);break}if(a=i.sort().join(`,`),s==`audio`&&r&&(a+=r),e.j.has(a))return e.j.get(a);if(l=e.G++,e.l)for(o=g(o),u=o.next();!u.done;u=o.next()){var d=g(u.value);u=d.next().value,d=d.next().value,(u=n.get(u))&&wb(e.l,l,u,d)}n=$(c,`LANGUAGE`),o=$(c,`NAME`),u=$(c,`DEFAULT`)==`YES`,d=s==`audio`?uC(c):null;var f=s==`audio`&&fC(c),p=$(c,`CHARACTERISTICS`),m=$(c,`FORCED`)==`YES`;return c=s==`audio`?dC(c):null,i=bC(e,l,i,t,s,n,u,o,d,null,p,m,c,f),i.stream&&e.g.enableAudioGroups&&(i.stream.groupId=r),e.M.has(r)?e.M.get(r).push(i):e.M.set(r,[i]),e.j.set(a,i),i}function _C(e,t){var n,r,i,a,o,s,c,l,u,d;return k(function(f){return f.h==1?(n=SS(t,`URI`),r=$(t,`CODECS`,`jpeg`)||``,e.j.has(n)?f.return(e.j.get(n)):(i=$(t,`LANGUAGE`),a=$(t,`NAME`),o=$(t,`CHARACTERISTICS`),s=bC(e,e.G++,[n],r,`image`,i,!1,a,null,null,o,!1,null,!1),(c=$(t,`RESOLUTION`))?f.g(s.stream.createSegmentIndex(),3):f.A(2))):(f.h!=2&&(l=s.stream.segmentIndex.Cb(),(u=l.tilesLayout)&&(s.stream.width=Number(c.split(`x`)[0])*Number(u.split(`x`)[0]),s.stream.height=Number(c.split(`x`)[1])*Number(u.split(`x`)[1])),s.stream.closeSegmentIndex()),(d=$(t,`BANDWIDTH`))&&(s.stream.bandwidth=Number(d)),e.j.set(n,s),f.return(s))})}function vC(e,t){var n=`video`,r=SS(t,`URI`),i=$(t,`CODECS`)||``;if(i==`mjpg`&&(n=`image`),e.j.has(r))return e.j.get(r);var a=$(t,`LANGUAGE`),o=$(t,`NAME`),s=$(t,`CHARACTERISTICS`);return n=bC(e,e.G++,[r],i,n,a,!1,o,null,null,s,!1,null,!1),i=$(t,`RESOLUTION`),a=g(i?i.split(`x`):[null,null]),i=a.next().value,a=a.next().value,n.stream.width=Number(i)||void 0,n.stream.height=Number(a)||void 0,(t=$(t,`BANDWIDTH`))&&(n.stream.bandwidth=Number(t)),e.j.set(r,n),n}function yC(e,t,n,r){for(var i=e.G++,a=[],o=g(t),s=o.next();!s.done;s=o.next()){var c=s.value;s=SS(c,`URI`),c=$(c,`PATHWAY-ID`),e.l&&c&&wb(e.l,i,c,s),a.push(s)}if(o=a.sort().join(`,`)+n.sort().join(`,`),e.j.has(o))return e.j.get(o);s=a.join(`,`);a:{if(t=$(t[0],`CLOSED-CAPTIONS`),r==`video`){if(e.g.disableText){e.R=!1,t=null;break a}if(t){if(t!=`NONE`){t=e.J.get(t);break a}e.R=!1}else if(!t&&e.J.size)for(t=g(e.J.keys()),t=t.next();!t.done;t=t.next()){t=e.J.get(t.value);break a}}t=null}return n=At(r,n),r=bC(e,i,a,n,r,null,!1,s,null,t,null,!1,null,!1),e.j.set(o,r),r}function bC(e,t,n,r,i,a,o,s,c,l,u,d,f,p){function m(t){var n,m,v,y,b,x,S,C,w,T,E,D,O,A,j,M,ee,te,N,ne;return k(function(k){switch(k.h){case 1:return n=Pt,k.m(2),k.g(t.promise,4);case 4:if(m=k.i,t.aborted)return k.return();if(v=m.uri,v!=m.originalUri&&(y=_.P(),y.includes(v)||_.zf.push(v)),b=PS(e.ab,m.data),b.type!=1)throw new R(2,4,4017);return x=TS(b.ea,`EXT-X-DEFINE`),S=QS(e,x,v),C=!1,(!e.aa&&e.g.hls.disableCodecGuessing||e.R&&i==n.wa&&!e.g.hls.disableClosedCaptionsDetection)&&b.segments.length>0&&(e.R=!1,C=!0),w=!e.aa&&e.g.hls.disableCodecGuessing,T=JC(e),k.g(EC(e,0,S,b,h,r,i,a,o,s,c,l,u,d,f,p,void 0,C,w),5);case 5:if(E=k.i,t.aborted)return k.return();D=E.stream,jC(e,b),JC(e)&&!T&&PC(e,b),_.Qc=E.Qc,_.Hc=E.Hc,_.Pe=E.Pe,_.Oe=E.Oe,_.Xd=E.Xd,_.nf=E.nf,_.Lb=E.Lb,_.Mb=E.Mb,g.segmentIndex=D.segmentIndex,g.encrypted=D.encrypted,g.drmInfos=D.drmInfos,g.keyIds=D.keyIds,g.mimeType=D.mimeType,g.bandwidth=g.bandwidth||D.bandwidth,g.codecs=g.codecs||D.codecs,g.closedCaptions=g.closedCaptions||D.closedCaptions,g.width=g.width||D.width,g.height=g.height||D.height,g.hdr=g.hdr||D.hdr,g.colorGamut=g.colorGamut||D.colorGamut,g.frameRate=g.frameRate||D.frameRate,g.language==`und`&&D.language!=`und`&&(g.language=D.language),g.language=g.language||D.language,g.channelsCount=g.channelsCount||D.channelsCount,g.audioSamplingRate=g.audioSamplingRate||D.audioSamplingRate,rC(g),g.drmInfos.length&&e.h.newDrmInfo(g),O=!1,(!l&&g.closedCaptions||l&&g.closedCaptions&&l.size!=g.closedCaptions.size)&&(O=!0),e.i&&O&&e.h.makeTextStreamsForClosedCaptions(e.i),i==n.Pa&&(A=D.segmentIndex.Cb())&&A.ba&&(g.mimeType=`application/mp4`,rC(g)),j=Tu(g),g.segmentIndex.qb(function(e){e.ba&&(e.ba.sd=j)}),TC(e)&&(e.vc?CC(e,[_]):(e.vc=!0,M=Array.from(e.j.values()),ee=M.filter(function(e){return e.stream.segmentIndex}),CC(e,ee),XS(e),te=e.u,te>0&&e.B.na(te))),zC(e,b.ea,g.type,S,h),e.i&&(e.i.startTime=e.o),k.o(0);break;case 2:if(N=k.l(),g.closeSegmentIndex(),N.code===7001)return k.return();if(ne=e.h.disableStream(g),!ne)throw N;k.j()}})}function h(){return e.l&&n.length>1?Tb(e.l,t):_.zf.concat(AS([e.H],n,e.C))}var g=OC(e,r,i,a,o,s,c,l,u,d,f,p);n.some(function(e){return e.startsWith(`shaka://hls-muxed`)})&&(g.isAudioMuxedInVideo=!0,g.mimeType=`video/mp2t`,rC(g));var _={stream:g,type:i,zf:[],Qc:0,Hc:0,nf:/* @__PURE__ */ new Map,Pe:!1,Oe:!1,Xd:!1,ng:-1,Lb:-1,Mb:-1,P:h},v=null,y;return g.createSegmentIndex=function(){return v||(g.isAudioMuxedInVideo?(g.segmentIndex=new uu([]),Promise.resolve()):(y=KC(e,_.P(),!0),v=new Promise(function(e){e(m(y))})))},g.closeSegmentIndex=function(){v&&!g.segmentIndex&&y.abort(),g.segmentIndex&&(g.segmentIndex.release(),g.segmentIndex=null),v=null},_}function xC(e){var t=1/0;e=g(e.j.values());for(var n=e.next();!n.done;n=e.next())n=n.value,n.stream.segmentIndex&&n.stream.type!=`text`&&!n.stream.isAudioMuxedInVideo&&(t=Math.min(t,n.Hc));return t}function SC(e,t){var n=[];t=g(t);for(var r=t.next();!r.done;r=t.next())r=r.value,r.segmentIndex&&r.segmentIndex.qb(function(e){n.push(e)});e.m.fe(n)}function CC(e,t){if(!JC(e))for(var n=xC(e),r=g(t),i=r.next();!i.done;i=r.next())i.value.stream.segmentIndex.hd(0,n);SC(e,t.map(function(e){return e.stream})),r=Array.from(e.j.values()).filter(function(e){return e.stream.segmentIndex}),n=r.some(function(e){return e.stream.type==`audio`}),i=r.some(function(e){return e.stream.type==`video`}),r=JC(e)&&!e.hb,n=!JC(e)&&e.hb&&!(n&&i),e.g.hls.ignoreManifestProgramDateTime||r||n?WS(e,t,r):(GS(e,t),e.g.hls.ignoreManifestProgramDateTimeForTypes.length>0&&WS(e,t))}function wC(e,t){return e.g.hls.ignoreManifestProgramDateTime?!0:e.g.hls.ignoreManifestProgramDateTimeForTypes.includes(t)}function TC(e){if(!e.i||!e.i.variants.length)return!1;var t=[],n=[];e=g(e.i.variants);for(var r=e.next();!r.done;r=e.next())r=r.value,r.video&&t.push(r.video),r.audio&&n.push(r.audio);return!(t.length>0&&!t.some(function(e){return e.segmentIndex})||n.length>0&&!n.some(function(e){return e.segmentIndex}))}function EC(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){_=_===void 0||_,v=v===void 0||v;var y,b,x,S,C,w,T,E,D,O,A,j,M,ee,te,N,ne,re,P,ie,ae,oe,se,ce,F,le,ue,de,fe;return k(function(t){switch(t.h){case 1:if(y=r.segments||[],b=y.every(function(e){return!!DS(e.ea,`EXT-X-GAP`)}),!y.length||b)throw new R(2,4,4053);if(MC(e,r),JC(e)&&NC(e,r),x=JC(e)?e.D.get(o):/* @__PURE__ */ new Map,S=BC(e,r,x,n,i,o),C=S.segments,w=S.bandwidth,A=O=D=E=T=null,!(C.length>0&&_)){t.A(2);break}return t.g(JS(e,C),3);case 3:j=t.i,o!=j.type&&JC(e)&&(e.D.set(j.type,e.D.get(o)),e.D.set(o,/* @__PURE__ */ new Map)),o=j.type,s=j.language,u=j.channelCount,m=j.sampleRate,e.g.disableText||(d=j.closedCaptions),E=j.height,T=j.width,D=j.se,O=j.colorGamut,A=j.frameRate,v&&(g=j.mimeType,a=j.codecs);case 2:if(g){t.A(4);break}return t.g(WC(e,o,a,C),5);case 5:g=t.i,o!=Nt||a||g!=`application/mp4`||!C[0]||C[0].ba||(g=`text/vtt`);case 4:return t.g(kC(e,r,g,i,n),6);case 6:if(M=t.i,ee=M.drmInfos,te=M.keyIds,N=M.encrypted,ne=M.Nh,N&&!ee.length&&!ne)throw new R(2,4,4026);return re=OC(e,a,o,s,c,l,u,d,f,p,m,h),re.encrypted=N&&!ne,re.drmInfos=ee,re.keyIds=te,re.mimeType=g,w&&(re.bandwidth=w),rC(re),o==`video`&&(T||E||D||O)&&GC(re,T,E,A,D,null,O),JC(e)&&NC(e,r),P=C[0].startTime,ie=C[C.length-1],ae=ie.endTime,oe=new uu(C),re.segmentIndex=oe,ce=(se=DS(r.ea,`EXT-X-SERVER-CONTROL`))?xS(se,`CAN-SKIP-UNTIL`)!=null:!1,F=se?xS(se,`CAN-BLOCK-RELOAD`)!=null:!1,le=OS(r.ea,`EXT-X-MEDIA-SEQUENCE`,0),ue=DC(le,C),de=ue.Lb,fe=ue.Mb,t.return({stream:re,type:o,zf:[],P:i,Qc:P,Hc:ae,Pe:ce,Oe:F,Xd:!1,ng:-1,Lb:de,Mb:fe,nf:x})}})}function DC(e,t){e=e+t.length-1;var n=-1;if(!t.length)return e++,{Lb:e,Mb:n};t=t[t.length-1];var r=t.g;return t.g.length?(n=r.length-1,r[r.length-1].isPreload()||(e++,n=0),{Lb:e,Mb:n}):(e++,t.o&&(n=0),{Lb:e,Mb:n})}function OC(e,t,n,r,i,a,o,s,c,l,u,d){var f=VC(n,t)||HC(n),p=[];if(c){c=g(c.split(`,`));for(var m=c.next();!m.done;m=c.next())p.push(m.value)}return m=void 0,c=null,n==Nt?m=p.includes(`public.accessibility.transcribes-spoken-dialog`)&&p.includes(`public.accessibility.describes-music-and-sound`)?`caption`:`subtitle`:p.includes(`public.accessibility.describes-video`)&&(c=`visually impaired`),p.length||m!==`subtitle`||p.push(`subtitle`),m=null,n!=`video`&&(m=a),e={id:e.G++,originalId:a,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:f,codecs:t,kind:n==Nt?`subtitle`:void 0,encrypted:!1,drmInfos:[],keyIds:/* @__PURE__ */ new Set,language:li(r||`und`),originalLanguage:r,label:m,type:n,primary:i,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,frameRate:void 0,pixelAspectRatio:void 0,width:void 0,height:void 0,bandwidth:void 0,roles:p,forced:l,channelsCount:o,audioSamplingRate:u,spatialAudio:d,closedCaptions:s,hdr:void 0,colorGamut:void 0,videoLayout:void 0,tilesLayout:void 0,accessibilityPurpose:c,external:!1,fastSwitching:!1,fullMimeTypes:/* @__PURE__ */ new Set,isAudioMuxedInVideo:!1,baseOriginalId:null},rC(e),e}function kC(e,t,n,r,i){var a,o,s,c,l,u,d,f,p,m,h,_,v,y,b,x,S,C,w,T,E,D,O,A,j,M,ee,te,N;return k(function(k){switch(k.h){case 1:if(a=/* @__PURE__ */ new Map,!e.g.ignoreDrmInfo&&t.segments){for(o=g(t.segments),s=o.next();!s.done;s=o.next())if(c=s.value,l=TS(c.ea,`EXT-X-KEY`),u=null,l.length)for(u=FC(e,t,c.ea,r,i),d=g(l),f=d.next();!f.done;f=d.next())p=f.value,a.set(p,u)}h=m=!1,_=[],v=/* @__PURE__ */ new Set,y=g(a),b=y.next();case 2:if(b.done){k.A(4);break}if(x=b.value,S=g(x),C=S.next().value,w=S.next().value,T=C,E=w,D=SS(T,`METHOD`),D==`NONE`){k.A(3);break}if(m=!0,O=$(T,`KEYFORMAT`)||`identity`,A=null,ZC(D)){h=!0,k.A(3);break}if(O==`identity`)return k.g($C(e,T,n,r,E,i),11);if(j=e.$b.get(O),!j){M=null,k.A(9);break}return k.g(j(T,n,E),10);case 10:M=k.i;case 9:A=M,k.A(6);break;case 11:A=k.i;case 6:if(A){if(A.keyIds)for(ee=g(A.keyIds),te=ee.next();!te.done;te=ee.next())N=te.value,v.add(N);_.push(A)}case 3:b=y.next(),k.A(2);break;case 4:return k.return({drmInfos:_,keyIds:v,encrypted:m,Nh:h})}})}function AC(t,n,r,i,a){if(!e.crypto||!e.crypto.subtle)throw F(`Web Crypto API is not available to decrypt AES. (Web Crypto only exists in secure origins like https)`),new R(2,4,4042);var o=0,s=$(n,`IV`,``);if(s){var c=wt(s.substr(2));if(c.byteLength!=16)throw new R(2,4,4048)}else o=OS(r.ea,`EXT-X-MEDIA-SEQUENCE`,0);var l=kS(i(),SS(n,`URI`),a),u=l.sort().join(``);if(r=n.toString()+`-`+o+`-`+u,!t.ua.has(r)){var d={bitsKey:128,blockCipherMode:`CBC`,iv:c,firstMediaSequenceNumber:o};switch(SS(n,`METHOD`)){case`AES-256`:d.bitsKey=256;break;case`AES-256-CTR`:d.bitsKey=256,d.blockCipherMode=`CTR`}d.fetchKey=function(){var n,r,i,a;return k(function(o){if(o.h==1)return t.O.has(u)||(n=Sa(l,t.g.retryParameters),r=XC(t,n,6).promise,t.O.set(u,r)),o.g(t.O.get(u),2);if(o.h!=3){if(i=o.i,!i.data||i.data.byteLength!=d.bitsKey/8)throw new R(2,4,4049);return a={name:d.blockCipherMode==`CTR`?`AES-CTR`:`AES-CBC`,length:d.bitsKey},o.g(e.crypto.subtle.importKey(`raw`,i.data,a,!0,[`decrypt`]),3)}d.cryptoKey=o.i,d.fetchKey=void 0,o.j()})},t.ua.set(r,d)}return t.ua.get(r)}function jC(e,t){e.o==null&&(t=DS(t.ea,`EXT-X-START`))&&(e.o=Number(SS(t,`TIME-OFFSET`)))}function MC(e,t){var n=DS(t.ea,`EXT-X-PLAYLIST-TYPE`);t=DS(t.ea,`EXT-X-ENDLIST`),t=n&&n.value==`VOD`||t,n=n&&n.value==`EVENT`&&!t,n=!t&&!n,t?YC(e,lw):n?YC(e,dw):YC(e,uw)}function NC(e,t){var n=1/0,r=t.segments;if(r.length)for(var i=r.length-1;i>=0;){var a=DS(r[i].ea,`EXTINF`);if(a){n=MS(a);break}i--}if(r=DS(t.ea,`EXT-X-TARGETDURATION`),!r)throw new R(2,4,4024,`EXT-X-TARGETDURATION`);r=Number(r.value),(i=DS(t.ea,`EXT-X-PART-INF`))&&(e.S=Number(SS(i,`PART-TARGET`))),t=DS(t.ea,`EXT-X-SERVER-CONTROL`),e.qa&&e.S?(e.u=e.uc?e.S*5<=n?Math.min(e.S,e.u):Math.min(n,e.u):Math.min(e.S,e.u),e.Ua=t?Number(SS(t,`PART-HOLD-BACK`)):0):(e.u=Math.min(n,e.u),n=t?xS(t,`HOLD-BACK`):null,e.Ka=n?Number(n.value):0),e.eb=Math.max(r,e.eb)}function PC(e,t){var n=0;if(e.g.defaultPresentationDelay)n=e.g.defaultPresentationDelay;else if(e.Ua)n=e.Ua;else if(e.Ka)n=e.Ka;else for(var r=t.segments.length,i=r-Math.min(r,e.g.hls.liveSegmentsDelay);i<r;i++){var a=DS(t.segments[i].ea,`EXTINF`);n=a?n+MS(a):n+e.eb}e.o&&e.o<0&&(n=Math.min(-e.o,n),e.o+=n),e.m.Si(0),e.m.qh(n),e.m.Vc(!1)}function FC(e,t,n,r,i){var a=DS(n,`EXT-X-MAP`);if(!a)return null;var o=SS(a,`URI`),s=kS(r(),o,i);if(o=[s.toString(),$(a,`BYTERANGE`,``)].join(`-`),!e.Ca.has(o)){var c=void 0,l=null,u=!1;n=g(n);for(var d=n.next();!d.done;d=n.next())d=d.value,d.name==`EXT-X-KEY`?(u=SS(d,`METHOD`),ZC(u)&&d.id<a.id?(u=!1,c=AC(e,d,t,r,i)):u=u!=`NONE`):d.name==`EXT-X-BYTERANGE`&&d.id<a.id&&(l=d);t=IC(s,a,l,c,u),e.Ca.set(o,t)}return e.Ca.get(o)}function IC(e,t,n,r,i){var a=0,o=null;return t=$(t,`BYTERANGE`),!t&&n&&(t=n.value),t&&(a=t.split(`@`),o=Number(a[0]),a=Number(a[1]),o=a+o-1,r&&(n=o+1-a,n%16&&(o+=16-n%16))),new Gs(function(){return e},a,o,null,null,null,r,i)}function LC(t,n,r,i,a,o,s,c,l,u){var d=i.ea,f=DS(d,`EXTINF`),p=0,m=0,h=null;i.sc.length&&(t.i.isLowLatency=!0);var _=null;if(!t.g.hls.ignoreManifestProgramDateTime){var v=DS(d,`EXT-X-PROGRAM-DATE-TIME`);v&&v.value&&(_=An(v.value),t.hb=!0)}var y=Ys;if(DS(d,`EXT-X-GAP`)&&(t.i.gapCount++,y=2),!f){if(i.sc.length==0)throw new R(2,4,4024,`EXTINF`);if(!t.qa)return null}var b=[];v=!1;var x=null,S=!1,C=!1;if(t.qa&&i.sc.length){p=n&&e.ReadableStream&&t.g.hls.allowLowLatencyByteRangeOptimization;for(var w=_,T={},E=0;E<i.sc.length;T={Qf:void 0,ie:void 0},E++){var D=i.sc[E],O=E==0?r:b[b.length-1],k=E==0?a:O.endTime,A=Number($(D,`DURATION`))||t.S;if(A){var j=k+A,M=0,ee=null;if(D.name==`EXT-X-PRELOAD-HINT`?(M=(M=$(D,`BYTERANGE-START`))?Number(M):0,(O=$(D,`BYTERANGE-LENGTH`))?ee=M+Number(O)-1:M&&(ee=2**53-1)):(M=$(D,`BYTERANGE`),ee=g(RC(O,M)),M=ee.next().value,ee=ee.next().value),T.ie=$(D,`URI`),T.ie){O=Ys,$(D,`GAP`)==`YES`&&(t.i.gapCount++,O=2,S=!0),T.Qf=null;var te=function(e){return function(){return e.Qf??(e.Qf=kS(c(),e.ie,o)),e.Qf}}(T);p&&M>=0&&ee!=null&&(x=te,v=!0),k=new H(k,j,te,M,ee,n,0,0,1/0,[],``,null,w,O,u),D.name==`EXT-X-PRELOAD-HINT`&&(k.Sg(),C=!0),$(D,`INDEPENDENT`)!=`YES`&&E>0&&k.rd(),D=l,D||(b.length&&b[0].mimeType?D=b[0].mimeType:T.ie&&(T=Ju(T.ie),D=ow.get(s).get(T)||null)),D&&(k.mimeType=D,sw.has(D)&&(k.ba=null)),b.push(k),w&&(w+=A)}}}}if(f){if(f=MS(f),f==0)return null;p=a+f}else if(b.length)p=b[b.length-1].endTime;else return null;v&&(S||b[0].startByte!=0?(v=!1,x=null):b=[]),(f=DS(d,`EXT-X-BYTERANGE`))?(h=g(RC(r,f.value)),m=h.next().value,h=h.next().value):b.length&&(m=b[0].startByte,h=b[b.length-1].endByte),r=``,f=null,s==`image`&&(r=`1x1`,s=DS(d,`EXT-X-TILES`))&&(r=SS(s,`LAYOUT`),(s=$(s,`DURATION`))&&(f=Number(s)));var N=null;return n=new H(a,p,function(){return x?x():(N??(N=kS(c(),i.g,o)),N||[])},m,h,n,0,0,1/0,b,r,f,_,y,u,b.length>0&&!!i.g),l&&(n.mimeType=l,sw.has(l)&&(n.ba=null)),v&&(t.uc=!0,n.ti(),C&&n.Sg()),n}function RC(e,t){var n=0,r=null;return t&&(n=t.split(`@`),t=Number(n[0]),n=n[1]?Number(n[1]):e.endByte+1,r=n+t-1),[n,r]}function zC(e,t,n,r,i){if(n==`video`||n==`audio`){var a=e.m.m;if(a!=null&&!wC(e,n))for(t=TS(t,`EXT-X-DATERANGE`),t=t.filter(function(e){return xS(e,`START-DATE`)!=null}).sort(function(e,t){return e=SS(e,`START-DATE`),t=SS(t,`START-DATE`),e<t?-1:+(e>t)}),n=0;n<t.length;n++){var o=t[n];try{var s=An(SS(o,`START-DATE`));if(!isNaN(s)){var c=Math.max(0,s-a),l=null,u=$(o,`END-DATE`);if(u){var d=An(u);if(!isNaN(d)&&(l=d-a,l<0))continue}if(l==null){var f=$(o,`DURATION`)||$(o,`PLANNED-DURATION`);if(f){var p=parseFloat(f);if(isNaN(p)||(l=c+p),s-a+p<0)continue}}var m=$(o,`CLASS`)||`com.apple.quicktime.HLS`,h=$(o,`END-ON-NEXT`)==`YES`;if(l==null&&h){for(var _=n+1;_<t.length;_++)if(m==($(t[_],`CLASS`)||`com.apple.quicktime.HLS`)){var v=An(SS(t[_],`START-DATE`));if(!isNaN(v)&&v&&v>s){l=Math.max(0,v-a);break}}if(l==null)continue}_=[`CLASS`,`START-DATE`,`END-DATE`,`DURATION`,`END-ON-NEXT`];for(var y=[],b=g(o.attributes),x=b.next();!x.done;x=b.next()){var S=x.value;if(!_.includes(S.name)){var C=jS(S.value,r);(S.name==`X-ASSET-URI`||S.name==`X-ASSET-LIST`)&&(C=kS(i(),S.value,r)[0]),y.push({key:S.name,description:``,data:C,mimeType:null,pictureType:null})}}y.length>1&&e.h.onMetadata(m,c,l,y)}}catch{}}}}function BC(e,t,n,r,i,a){function o(e){if(e=Ju(e),!e)return null;var t=ow.get(a).get(e);return t||(t=tw.get(e)),t}var s=t.segments,c=null,l=null,u=null,d=null,f=void 0,p=OS(t.ea,`EXT-X-DISCONTINUITY-SEQUENCE`,-1),m=OS(t.ea,`EXT-X-MEDIA-SEQUENCE`,0),h=DS(t.ea,`EXT-X-SKIP`),_=h?Number($(h,`SKIPPED-SEGMENTS`)):0,v=m+_,y=0;JC(e)&&n.has(v)&&(y=n.get(v)),y===0&&e.Ha==dw&&n.size>0&&!n.has(v)&&e.m.i!=null&&(y=e.m.Fb());var b=[],x=null;h=[];for(var S=0;S<s.length;S++){var C=s[S];(v=DS(C.ea,`EXT-X-MAP`))&&v.id!==l&&(c=FC(e,t,C.ea,i,r),l=v.id),v=C.g;var w=``;v&&(w=Ju(v)),w!==d&&(u=o(v),d=w),w=S==0?y:x.endTime,v=m+_+S,DS(C.ea,`EXT-X-DISCONTINUITY`)&&(p++,x&&x.ba&&(x.ba.g=w));for(var T=g(C.ea),E=T.next();!E.done;E=T.next())E=E.value,E.name==`EXT-X-KEY`&&(f=ZC(SS(E,`METHOD`))?AC(e,E,t,i,r):void 0);if(n.set(v,w),w=LC(e,c,x,C,w,r,a,i,u,f)){if((x=OS(C.ea,`EXT-X-BITRATE`))?(h.push({bitrate:x,duration:w.endTime-w.startTime}),w.bandwidth=x):w.endByte?(C=qs(w))&&(x=w.endTime-w.startTime,C=C*8/x/1e3,h.push({bitrate:C,duration:x}),w.bandwidth=C):h.length&&(x=h[h.length-1],x.duration+=w.endTime-w.startTime,w.bandwidth=x.bitrate),w.bandwidth)for(x=g(w.g),C=x.next();!C.done;C=x.next())C.value.bandwidth=w.bandwidth;x=w,w.i=p,wC(e,a)&&e.N!=null&&v<e.N||b.push(w)}}if(t=void 0,h.length&&(t=h.reduce(function(e,t){return e+t.duration},0),t=Math.round(h.reduce(function(e,t){return e+t.bitrate*t.duration},0)/t*1e3)),h=b.some(function(e){return e.h!=null})){for(n={},r=0;r<b.length;n={Ve:void 0,Ue:void 0,Le:void 0,Sc:void 0,Ke:void 0},r++)if(n.Sc=b[r],n.Sc.h==null)for(n.Ue=0,n.Ve=r,i=function(e){return function(){var t=b[e.Ve];if(t){if(t.h!=null)return t.h+e.Ue;e.Ue-=t.endTime-t.startTime,e.Ve+=1}return null}}(n),n.Ke=0,n.Le=r,s=function(e){return function(){var t=b[e.Le];if(t){if(t!=e.Sc&&(e.Ke+=t.endTime-t.startTime),t.h!=null)return t.h+e.Ke;--e.Le}return null}}(n);n.Sc.h==null;)n.Sc.h=s(),n.Sc.h??(n.Sc.h=i())}if(h)for(n=g(b),r=n.next();!r.done;r=n.next())for(i=r.value,r=i.h,i=g(i.g),s=i.next();!s.done;s=i.next())s=s.value,s.h=r,r+=s.endTime-s.startTime;if(n=e.ia,h&&n!=1/0&&!wC(e,a))for(e=g(b),h=e.next();!h.done;h=e.next())h.value.Bh(n);return{segments:b,bandwidth:t}}function VC(e,t){if(e==Nt){if(t==`vtt`||t==`wvtt`)return`text/vtt`;if(t&&t!==``)return`application/mp4`}return e!=`image`||t&&t!=`jpeg`?e==`audio`&&t==`mp4a.40.34`?`audio/mpeg`:t==`mjpg`?`application/mp4`:null:`image/jpeg`}function HC(e){return e==Nt?`text/vtt`:ow.get(e).get(`mp4`)}function UC(e,t){e=JC(e)?Math.trunc((t.length-1)/2):0;for(var n=t[e];n.Wb()==2&&e+1<t.length;)e++,n=t[e];return{segment:n,segmentIndex:e}}function WC(e,t,n,r){var i,a,o,s,c,l,u,d,f,p,m,h,g;return k(function(_){switch(_.h){case 1:return i=ka,a=UC(e,r),o=a.segment,o.status==2?_.return(HC(t)):(c=o.P(),(l=Ju(c[0]))&&(u=ow.get(t),(d=u.get(l))||(d=tw.get(l)))?_.return(d):(s=VC(t,n))?_.return(s):(p=1,m=Sa(c,e.g.retryParameters),_.m(2),m.method=`HEAD`,_.g(XC(e,m,i,{type:p}).promise,4)));case 4:h=_.i,f=h.headers[`content-type`],_.o(3);break;case 2:if(g=_.l(),!g||g.code!=1002&&g.code!=1001){_.A(3);break}return m.method=`GET`,e.g.hls.allowRangeRequestsToGuessMimeType&&(m.headers.Range=`bytes=0-0`),_.g(XC(e,m,i,{type:p}).promise,6);case 6:h=_.i,f=h.headers[`content-type`];case 3:if(!f){_.A(7);break}if(s=f.toLowerCase().split(`;`)[0],!cw.includes(s)){_.A(8);break}if(h.data.byteLength){_.A(9);break}return m.method=`GET`,_.g(XC(e,m,i,{type:p}).promise,10);case 10:h=_.i;case 9:Hc(Ze(h.data))&&(s=`video/mp2t`);case 8:if(!cw.includes(s))return _.return(s);case 7:return _.return(HC(t))}})}function GC(e,t,n,r,i,a,o){e&&(e.width=Number(t)||void 0,e.height=Number(n)||void 0,e.frameRate=Number(r)||void 0,e.hdr=i||void 0,e.videoLayout=a||void 0,e.colorGamut=o||void 0)}function KC(e,t,n){return XC(e,Sa(t,e.g.retryParameters),0,{type:n?2:3})}function qC(e){var t,n,r,i,a,o;return k(function(s){switch(s.h){case 1:return e.h?(s.m(2),t=Date.now(),s.g(e.update(),4)):s.return();case 4:n=Date.now(),JC(e)&&(r=(n-t)/1e3,e.Xb.sample(1,r),i=e.g.updatePeriod>0?e.g.updatePeriod:e.u,a=Math.max(0,i-ae(e.Xb)),isFinite(a)?e.B.na(a):e.B.na(1)),s.o(3);break;case 2:if(o=s.l(),!e.h)return s.return();if(e.g.raiseFatalErrorOnManifestUpdateRequestFailure)return e.h.onError(o),s.return();o.severity=1,e.h.onError(o),e.B.na(.1);case 3:if(!e.h)return s.return();e.h.onManifestUpdated(),s.j()}})}function JC(e){return e.Ha!=lw}function YC(e,t){e.Ha=t,e.m&&e.m.Vc(!JC(e)),JC(e)||e.B.stop()}function XC(e,t,n,r){if(!e.Z)throw new R(2,7,7001);return r||(r={}),r.isPreload=e.Zb(),t=e.h.networkingEngine.request(n,t,r),va(e.Z,t),t}function ZC(e){return e==`AES-128`||e==`AES-256`||e==`AES-256-CTR`}function QC(t,n,r,i){var a,o,s,c,l,u;return k(function(d){if(d.h==1){if(r==`video/mp2t`)throw new R(2,4,4040);if(e.shakaMediaKeysPolyfill===`apple`)throw new R(2,4,4041);if(a=SS(n,`METHOD`),o=[`SAMPLE-AES`,`SAMPLE-AES-CTR`],!o.includes(a))return d.return(null);s=`cenc`,a==`SAMPLE-AES`&&(s=`cbcs`),c=SS(n,`URI`),l=Ot(`com.apple.fps`,s,null,c);var f=new Ne(c).Bb.replace(/-/g,``).toLowerCase();return(u=f.length===32&&/^[0-9a-f]+$/.test(f)?f:null)||!i?d.A(2):d.g(ew(t,i),3)}return d.h!=2&&(u=d.i),u&&l.keyIds.add(u),d.return(l)})}function $C(t,n,r,i,a,o){var s,c,l,u,d,f,p,m,h,g,_,v;return k(function(y){switch(y.h){case 1:if(r==`video/mp2t`)throw new R(2,4,4040);if(e.shakaMediaKeysPolyfill===`apple`)throw new R(2,4,4041);if(s=SS(n,`METHOD`),c=[`SAMPLE-AES`,`SAMPLE-AES-CTR`],!c.includes(s))return y.return(null);if(l=kS(i(),SS(n,`URI`),o),l[0].startsWith(`data:text/plain;base64,`)){u=Tt(Ct(l[0].split(`data:text/plain;base64,`).pop())),y.A(2);break}return d=l.sort().join(``),t.ya.has(d)||(f=Sa(l,t.g.retryParameters),p=XC(t,f,6).promise,t.ya.set(d,p)),y.g(t.ya.get(d),3);case 3:m=y.i,u=Tt(m.data);case 2:if(h=`00000000000000000000000000000000`,!a){y.A(4);break}return y.g(ew(t,a),5);case 5:(g=y.i)&&(h=g);case 4:return _=/* @__PURE__ */ new Map,_.set(h,u),v=`cenc`,s==`SAMPLE-AES`&&(v=`cbcs`),y.return(kt(_,v))}})}function ew(e,t){var n,r,i,a;return k(function(o){return o.h==1?(n=null,e.za.has(t)?(n=e.za.get(t),o.A(2)):(r=Yu(t.P(),t.Fc(),t.Dc(),e.g.retryParameters),i=ka,o.g(XC(e,r,i,{type:0}).promise,3))):(o.h!=2&&(a=o.i,t.me(a.data),n=Gu(a.data),e.za.set(t,n)),o.return(n))})}P(`shaka.hls.HlsParser`,VS);var tw=(/* @__PURE__ */ new Map()).set(`aac`,`audio/aac`).set(`ac3`,`audio/ac3`).set(`ec3`,`audio/ec3`).set(`mp3`,`audio/mpeg`),nw=(/* @__PURE__ */ 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`),rw=(/* @__PURE__ */ 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`),iw=(/* @__PURE__ */ 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`),aw=(/* @__PURE__ */ new Map()).set(`jpg`,`image/jpeg`).set(`png`,`image/png`).set(`svg`,`image/svg+xml`).set(`webp`,`image/webp`).set(`avif`,`image/avif`),ow=(/* @__PURE__ */ new Map()).set(`audio`,nw).set(`video`,rw).set(`text`,iw).set(`image`,aw),sw=new Set([`video/mp2t`].concat(_(zr))),cw=[`application/octet-stream`,`binary/octet-stream`],lw=`VOD`,uw=`EVENT`,dw=`LIVE`;Ht(`application/x-mpegurl`,function(){return new VS}),Ht(`application/vnd.apple.mpegurl`,function(){return new VS}),Ht(`audio/x-mpegurl`,function(){return new VS});function fw(e){return by(e)}var pw=(/* @__PURE__ */ new Map()).set(`com.microsoft.playready`,fw).set(`com.microsoft.playready.recommendation`,fw).set(`com.microsoft.playready.software`,fw).set(`com.microsoft.playready.hardware`,fw);function mw(){var e=this;this.h=this.g=null,this.l=[],this.j=null,this.u=1,this.i=null,this.D=new ie(5),this.o=new Qr(function(){hw(e)}),this.C=new _a,this.m=/* @__PURE__ */ new Map,this.B=function(){return!1}}r=mw.prototype,r.configure=function(e,t){this.g=e,t&&(this.B=t)},r.start=function(e,t){var n=this;return k(function(r){if(r.h==1)return n.l=[e],n.h=t,r.g(gw(n),2);if(!n.h)throw new R(2,7,7001);return r.return(n.j)})};function hw(e){var t;k(function(n){switch(n.h){case 1:return n.m(2),n.g(gw(e),4);case 4:n.o(3);break;case 2:t=n.l(),e.h&&(t.severity=1,e.h.onError(t));case 3:if(!e.h)return n.return();n.j()}})}r.stop=function(){return this.g=this.h=null,this.l=[],this.j=null,this.o!=null&&(this.o.stop(),this.o=null),this.m.clear(),this.C.destroy()},r.update=function(){var e=this,t;return k(function(n){if(n.h==1)return n.m(2),n.g(gw(e),4);if(n.h!=2)return n.o(0);if(t=n.l(),!e.h||!t)return n.return();e.h.onError(t),n.j()})},r.onExpirationUpdated=function(){},r.onInitialVariantChosen=function(){},r.banLocation=function(){},r.setMediaElement=function(){};function gw(e){var t,n,r,i,a,o,s;return k(function(c){if(c.h==1)return t=Sa(e.l,e.g.retryParameters),n=e.h.networkingEngine,r=Date.now(),i=n.request(0,t,{type:5,isPreload:e.B()}),va(e.C,i),c.g(i.promise,2);if(a=c.i,!e.h)return c.return();a.uri&&!e.l.includes(a.uri)&&e.l.unshift(a.uri);var l=a.uri,u=a.data,d=e.g.mss.manifestPreprocessor;if(d!=hf){if(L(`manifest.mss.manifestPreprocessor configuration`,`Please Use manifest.mss.manifestPreprocessorTXml instead.`),u=dx(u,`SmoothStreamingMedia`),!u)throw new R(2,4,4046,l);d(u),u=gt(u.outerHTML)}var f=hn(u,`SmoothStreamingMedia`);if(!f)throw new R(2,4,4046,l);if(l=e.g.mss.manifestPreprocessorTXml,l!=gf&&l(f),e.i||(e.i=new G(null,0)),l=B(f,`IsLive`,Ln,!1))throw new R(2,4,4047);e.i.Vc(!l),d=B(f,`TimeScale`,Fn,1e7),u=B(f,`DVRWindowLength`,Fn),l&&(u===0||isNaN(u))&&(u=1/0);var p=B(f,`CanSeek`,Ln,!1);u===0&&p&&(u=1/0),p=null,u&&u>0&&(p=u/d),l&&!isNaN(e.g.availabilityWindowOverride)&&(p=e.g.availabilityWindowOverride),p??(p=1/0),e.i.Hf(p),u=B(f,`Duration`,Fn,1/0),l||e.i.wb(u/d),l={variants:[],textStreams:[],timescale:d,duration:u/d};var m;for(p=xn(f,`Protection`),d=e.g.mss.keySystemsBySystemId,u=[],p=g(p),m=p.next();!m.done;m=p.next())u=u.concat(xn(m.value,`ProtectionHeader`));if(u.length){for(p=[],m=0;m<u.length;m++){var h=u[m],v=h.attributes.SystemID.toLowerCase(),y=d[v];if(y){var b;a:{if(b=yy(h)){b=g(wn(b,`DATA`));for(var x=b.next();!x.done;x=b.next())if(x=Tn(x.value,`KID`)){b=Ct(Sn(x)),b=new Uint8Array([b[3],b[2],b[1],b[0],b[5],b[4],b[7],b[6]].concat(_(b.slice(8)))),b=Tt(b);break a}}b=null}x=Ct(Sn(h)),v=wt(v.replace(/-/g,``)),v=[{initData:$a(x,v,/* @__PURE__ */ new Set,0),initDataType:`cenc`,keyId:b}],v=Ot(y,`cenc`,v),b&&v.keyIds.add(b),(y=pw.get(y))&&(v.licenseServerUri=y(h)),p.push(v)}}d=p}else d=[];for(m=d,p=[],d=[],u=[],f=xn(f,`StreamIndex`),f=g(f),h=f.next();!h.done;h=f.next()){h=h.value,y=xn(h,`QualityLevel`),v=l.timescale,b=l.duration,x=xn(h,`c`);for(var S=[],C=0,w=0;w<x.length;++w){var T=x[w],E=x[w+1],D=B(T,`t`,Fn),O=B(T,`d`,Fn);if(T=B(T,`r`,Nn),!O)break;if(D=D??C,(T=T||0)&&T--,T<0){if(E){if(E=B(E,`t`,Fn),E==null||D>=E)break;T=Math.ceil((E-D)/O)-1}else{if(b==1/0||D/v>=b)break;T=Math.ceil((b*v-D)/O)-1}}for(E=0;E<=T;++E)C=D+O,S.push({start:D/v,end:C/v,Hd:D}),D=C}for(v=S,y=g(y),b=y.next();!b.done;b=y.next())(b=_w(e,h,b.value,v,m,l))&&(b.type!=`audio`||e.g.disableAudio?b.type!=`video`||e.g.disableVideo?b.type!=Nt||e.g.disableText||u.push(b):d.push(b):p.push(b))}for(f=[],p=g(p.length>0?p:[null]),m=p.next();!m.done;m=p.next())for(m=m.value,h=g(d.length>0?d:[null]),S=h.next();!S.done;S=h.next())y=f,v=y.push,b=e,x=m,S=S.value,w=0,x&&x.bandwidth&&x.bandwidth>0&&(w+=x.bandwidth),S&&S.bandwidth&&S.bandwidth>0&&(w+=S.bandwidth),b={id:b.u++,language:x?x.language:`und`,disabledUntilTime:0,primary:!!x&&x.primary||!!S&&S.primary,audio:x,video:S,bandwidth:w,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]},v.call(y,b);l.variants=f,l.textStreams=u,e.j?(e.j.variants=l.variants,e.j.textStreams=l.textStreams,e.h.filter(e.j)):(e.j={presentationTimeline:e.i,variants:l.variants,textStreams:l.textStreams,imageStreams:[],offlineSessionIds:[],sequenceMode:e.g.mss.sequenceMode,ignoreManifestTimestampsInSegmentsMode:!1,type:`MSS`,serviceDescription:null,nextUrl:null,periodCount:1,gapCount:0,isLowLatency:!1,startTime:null},e.i.mf()),Promise.resolve(),o=Date.now(),s=(o-r)/1e3,e.D.sample(1,s),c.j()})}function _w(e,t,n,r,i,a){var o=t.attributes.Type;if(o!==`audio`&&o!==`video`&&o!==`text`)return F(`Ignoring unrecognized type:`,o),null;var s=t.attributes.Language,c=e.u++,l=B(n,`Bitrate`,Pn),u=B(n,`MaxWidth`,Pn),d=B(n,`MaxHeight`,Pn),f=B(n,`Channels`,Pn),p=B(n,`SamplingRate`,Pn),m=a.duration;r.length&&(m=r[r.length-1].end-r[0].start);var h=e.i.getDuration();e.i.wb(Math.min(m,h)),(h=t.attributes.Name)&&(h+=n.attributes.Index),h||(h=String(c));var g={id:c,originalId:h,groupId:null,createSegmentIndex:function(){return Promise.resolve()},closeSegmentIndex:function(){return Promise.resolve()},segmentIndex:null,mimeType:``,codecs:``,frameRate:void 0,pixelAspectRatio:void 0,bandwidth:l||0,width:u||void 0,height:d||void 0,kind:``,encrypted:i.length>0,drmInfos:i,keyIds:/* @__PURE__ */ new Set,language:li(s||`und`),originalLanguage:s,label:``,type:``,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:[],roles:[],forced:!1,channelsCount:f,audioSamplingRate:p,spatialAudio:!1,closedCaptions:null,hdr:void 0,colorGamut:void 0,videoLayout:void 0,tilesLayout:void 0,matchedStreams:[],mssPrivateData:{duration:m,timescale:a.timescale,codecPrivateData:null},accessibilityPurpose:null,external:!1,fastSwitching:!1,fullMimeTypes:/* @__PURE__ */ new Set,isAudioMuxedInVideo:!1,baseOriginalId:null};if((i=t.attributes.Subtype)&&((i=Cw.get(i))&&g.roles.push(i),i===`main`&&(g.primary=!0)),i=n.attributes.FourCC,(i===null||i===``)&&(i=t.attributes.FourCC),!i){if(o===`audio`)i=`AAC`;else if(o===`video`)return F(`FourCC is not defined whereas it is required for a QualityLevel element for a StreamIndex of type "video"`),null}if(!Sw.includes(i.toUpperCase()))return F(`Codec not supported:`,i),null;switch(n=vw(n,o,i,g),g.mssPrivateData.codecPrivateData=n,o){case`audio`:if(!n)return F(`Quality unsupported without CodecPrivateData`,o),null;g.type=`audio`,g.mimeType=`mss/audio/mp4`,g.codecs=yw(i,n);break;case`video`:if(!n)return F(`Quality unsupported without CodecPrivateData`,o),null;g.type=`video`,g.mimeType=`mss/video/mp4`,g.codecs=bw(n);break;case`text`:g.type=Nt,g.mimeType=`application/mp4`,(i===`TTML`||i===`DFXP`)&&(g.codecs=`stpp`)}return g.fullMimeTypes.add(kr(g.mimeType,g.codecs)),g.createSegmentIndex=function(){if(g.segmentIndex)return Promise.resolve();if(e.m.has(g.id))var n=e.m.get(g.id);else n=[],g.type==`video`&&(n=g.mssPrivateData.codecPrivateData.split(`00000001`).slice(1)),n={id:g.id,type:g.type,codecs:g.codecs,encrypted:g.encrypted,timescale:g.mssPrivateData.timescale,duration:g.mssPrivateData.duration,zb:n,Aa:new Uint8Array([]),Ta:new Uint8Array([]),Za:0,$a:0,data:null,stream:g},n=ds(new us([n])),e.m.set(g.id,n);return n=xw(e,new Gs(function(){return[]},0,null,Tu(g),g.mssPrivateData.timescale,n,null,g.encrypted),g,t,r),g.segmentIndex=new uu(n),Promise.resolve()},g.closeSegmentIndex=function(){g.segmentIndex&&(g.segmentIndex.release(),g.segmentIndex=null)},g}function vw(e,t,n,r){if(e=e.attributes.CodecPrivateData)return e;if(t!==`audio`)return null;t=r.channelsCount||2,e=r.audioSamplingRate||44100;var i={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};return r=i[e],n===`AACH`?(n=/* @__PURE__ */ new Uint8Array(4),e=i[e*2],n[0]=40|r>>1,n[1]=r<<7|t<<3|e>>1,n[2]=e<<7|8,n[3]=0,t=/* @__PURE__ */ new Uint16Array(2),t[0]=(n[0]<<8)+n[1],t[1]=(n[2]<<8)+n[3],t[0].toString(16)+t[1].toString(16)):(n=/* @__PURE__ */ new Uint8Array(2),n[0]=16|r>>1,n[1]=r<<7|t<<3,t=/* @__PURE__ */ new Uint16Array(1),t[0]=(n[0]<<8)+n[1],t[0].toString(16))}function yw(e,t){var n=0;return e===`AACH`&&(n=5),t?n===0&&(n=(parseInt(t.substr(0,2),16)&248)>>3):(n=2,e===`AACH`&&(n=5)),`mp4a.40.`+n}function bw(e){var t=/00000001[0-9]7/.exec(e);return t.length&&e?`avc1.`+e.substr(e.indexOf(t[0])+10,6):``}function xw(e,t,n,r,i){var a=r.attributes.Url.replace(`{bitrate}`,String(n.bandwidth));r=[],i=g(i);for(var o=i.next(),s={};!o.done;s={Lf:void 0},o=i.next())s.Lf=o.value,r.push(new H(s.Lf.start,s.Lf.end,function(t){return function(){return Dt(e.l,[a.replace(`{start time}`,String(t.Lf.Hd))])}}(s),0,null,t,0,0,n.mssPrivateData.duration));return r}P(`shaka.mss.MssParser`,mw);var Sw=`AAC AACL AACH AACP AVC1 H264 TTML DFXP`.split(` `),Cw=(/* @__PURE__ */ new Map()).set(`CAPT`,`main`).set(`SUBT`,`alternate`).set(`DESC`,`main`);Ht(`application/vnd.ms-sstr+xml`,function(){return new mw});function ww(e,t,n,r,i,a,o){if(n>=200&&n<=299&&n!=202||n==304)return{uri:i||r,originalUri:r,data:t,status:n,headers:e,fromCache:!!e[`x-shaka-from-cache`],originalRequest:a};a=null;try{a=ht(t)}catch{}throw new R(n==401||n==403?2:1,1,1001,r,n,a,e,o,i||r)}function Tw(){}function Ew(e,t,n,r,i,a){var o=new Nw;try{Ia(t.headers).forEach(function(e,t){o.append(t,e)})}catch(t){return ca(new R(1,1,1002,e,t,n))}var s=new jw,c={Sh:!1,fj:!1};if(e=Dw(e,t,n,{body:t.body||void 0,headers:o,method:t.method,signal:s.signal,credentials:t.allowCrossSiteCredentials?`include`:void 0},c,r,i,t.streamDataCallback,a.minBytesForProgressEvents||0),e=new sa(e,function(){return c.Sh=!0,s.abort(),Promise.resolve()}),t=t.retryParameters.timeout){var l=new Qr(function(){c.fj=!0,s.abort()});l.na(t/1e3),e.finally(function(){l.stop()})}return e}function Dw(e,t,n,r,i,a,o,s,c){var l,u,d,f,p,m,h,g,_,v,y,b,x,S,C;return k(function(w){switch(w.h){case 1:return l=Aw,u=Mw,f=/* @__PURE__ */ new ArrayBuffer(0),m=p=0,h={},g=Date.now(),w.m(2),w.g(l(e,r),4);case 4:if(d=w.i,h=Ow(d.headers),o(h),r.method==`HEAD`){w.A(5);break}return v=(_=d.headers.get(`Content-Length`))?parseInt(_,10):0,d.body?(y=d.clone().body.getReader(),b=function(e){function t(){var n,r,i,o;return k(function(l){switch(l.h){case 1:return l.m(2),l.g(y.read(),4);case 4:n=l.i,l.o(3);break;case 2:return l.l(),l.return();case 3:if(n.done||(p+=n.value.byteLength,!s)){l.A(5);break}return l.g(s(n.value),5);case 5:r=Date.now(),i=p-m,(r-g>100&&i>=c||n.done)&&(o=n.done?0:v-p,a(r-g,i,o),m=p,g=r),n.done?e.close():(e.enqueue(n.value),t()),l.j()}})}t()},new u({start:b}),w.g(d.arrayBuffer(),8)):w.g(d.arrayBuffer(),9);case 8:f=w.i,w.A(5);break;case 9:f=w.i,x=Date.now(),a(x-g,f.byteLength,0);case 5:t.headers.Range&&(S=t.headers.Range.replace(`bytes=`,``).split(`-`).filter(function(e){return e}).map(function(e){return parseInt(e,10)}),S.length==2&&f.byteLength!=S[1]-S[0]+1&&F(`Payload length does not match range requested bytes`,t,d)),w.o(3);break;case 2:throw C=w.l(),i.Sh?new R(1,1,7001,e,n):i.fj?new R(1,1,1003,e,n):new R(1,1,1002,e,C,n);case 3:return w.return(ww(h,f,d.status,e,d.url,t,n))}})}function Ow(e){var t={};return e.forEach(function(e,n){t[n.trim()]=e}),t}function kw(){if(e.ReadableStream)try{new ReadableStream({})}catch{return!1}else return!1;if(e.Response){if(!new Response(``).body)return!1}else return!1;return!(!e.fetch||`polyfill`in e.fetch||!e.AbortController)}P(`shaka.net.HttpFetchPlugin`,Tw),Tw.isSupported=kw,Tw.parse=Ew;var Aw=e.fetch,jw=e.AbortController,Mw=e.ReadableStream,Nw=e.Headers;kw()&&(ba(`http`,Ew,2,!0),ba(`https`,Ew,2,!0),ba(`blob`,Ew,2,!0));function Pw(){}function Fw(e,t,n,r,i,a){var o=new Iw,s=Date.now(),c=0;return new sa(new Promise(function(l,u){o.open(t.method,e,!0),o.responseType=`arraybuffer`,o.timeout=t.retryParameters.timeout,o.withCredentials=t.allowCrossSiteCredentials;var d={};for(var f in o.onabort=function(){u(new R(1,1,7001,e,n))},o.onreadystatechange=function(){if(o.readyState===XMLHttpRequest.HEADERS_RECEIVED){var e=o.getAllResponseHeaders().trim().split(`\r
|
|
17
|
+
`),t={};e=g(e);for(var n=e.next();!n.done;n=e.next()){n=n.value;var r=n.indexOf(`: `);r!==-1&&(t[n.slice(0,r).toLowerCase()]=n.slice(r+2))}d=t,i(d)}},o.onload=function(){var r=o.response;try{l(ww(d,r,o.status,e,o.responseURL,t,n))}catch(e){u(e)}},o.onerror=function(t){u(new R(1,1,1002,e,t,n))},o.ontimeout=function(){u(new R(1,1,1003,e,n))},o.onprogress=function(e){var t=Date.now(),n=a.minBytesForProgressEvents||0,i=e.loaded-c;(t-s>100&&i>=n||e.lengthComputable&&e.loaded==e.total)&&(r(t-s,i,o.readyState==4?0:e.total-e.loaded),c=e.loaded,s=t)},t.headers)try{o.setRequestHeader(f.toLowerCase(),t.headers[f])}catch(t){throw new R(1,1,1002,e,t,n)}o.send(t.body)}),function(){return o.abort(),Promise.resolve()})}P(`shaka.net.HttpXHRPlugin`,Pw),Pw.parse=Fw;var Iw=e.XMLHttpRequest;ba(`http`,Fw,1,!0),ba(`https`,Fw,1,!0),ba(`blob`,Fw,1,!0);function Lw(e,t,n,r,i){this.g=e,this.i=t,this.groupId=n,this.h=r,this.j=i}function Rw(e){var t=e.Vb(!1);return t?St(t):e.P().map(function(e){return`{`+encodeURI(e.split(`#xywh=`)[0])+`}`}).join(``)+`:`+e.startByte+`:`+e.endByte}function zw(e,t){return Yu(e.g.P(),e.g.startByte,e.g.endByte,t.streaming.retryParameters)}function Bw(){this.g=this.j=this.i=0,this.h=/* @__PURE__ */ new Map,this.l=0}function Vw(e,t){e.i+=t;var n=e.l;return e.l++,e.h.set(n,t),n}Bw.prototype.close=function(e,t){if(this.h.has(e)){var n=this.h.get(e);this.h.delete(e),this.j+=n,this.g+=t}};function Hw(e){return e.i==0?0:e.j/e.i}function Uw(e){var t=this;this.u=e,this.i=/* @__PURE__ */ new Map,this.h=new Ma(function(){return Gw(t).catch(function(){})}),this.j=[],this.o=function(){},this.m=function(){},this.g=new Bw,this.l=!1}Uw.prototype.destroy=function(){return this.h.destroy()};function Ww(e,t,n){e.o=t,e.m=n}function Gw(e){e.l=!0;var t=e.j.map(function(e){return e()});return e.j=[],Promise.all(t)}Uw.prototype.queue=function(e,t,n,r,i){var a=this;Na(this.h);var o=(this.i.get(e)||Promise.resolve()).then(function(){var e,o,s,c,l,u,d;return k(function(f){if(f.h==1)return f.g(Jw(a,t),2);if(e=f.i,a.h.g)throw new R(2,9,7001);if(r)for(c in o=Ze(e),s=new Qa(o),s.data)l=Number(c),u=s.data[l],d=s.g[l],a.m(u,d);return a.g.close(n,e.byteLength),a.o(Hw(a.g),a.g.g),f.return(i(e))})});return this.i.set(e,o),o};function Kw(e,t,n,r,i,a){Na(e.h);var o=(e.i.get(t)||Promise.resolve()).then(function(){if(e.h.g)throw new R(2,9,7001);if(i){var t=Ze(n);for(var o in t=new Qa(t),t.data){var s=Number(o);e.m(t.data[s],t.g[s])}}return e.g.close(r,n.byteLength),e.o(Hw(e.g),e.g.g),a(n)});e.i.set(t,o)}function qw(e){return k(function(t){return t.h==1?t.g(Promise.all(e.i.values()),2):t.return(e.g.g)})}function Jw(e,t){var n,r,i,a;return k(function(o){return o.h==1?(n=ka,r=e.u.request(n,t),i=function(){return r.abort()},e.j.push(i),o.g(r.promise,2)):(a=o.i,pe(e.j,i),o.return(a.data))})}function Yw(e,t){var n=this;this.i=e,this.h=e.objectStore(t),this.g=new oa,e.onabort=function(e){e.preventDefault(),n.g.reject()},e.onerror=function(e){e.preventDefault(),n.g.reject()},e.oncomplete=function(){n.g.resolve()}}Yw.prototype.abort=function(){var e=this;return k(function(t){if(t.h==1){try{e.i.abort()}catch{}return t.m(2),t.g(e.g,4)}if(t.h!=2)return t.o(0);t.l(),t.j()})};function Xw(e,t){return new Promise(function(n,r){var i=e.h.openCursor();i.onerror=r,i.onsuccess=function(){var e;return k(function(r){if(r.h==1)return i.result==null?(n(),r.return()):(e=i.result,r.g(t(e.key,e.value,e),2));e.continue(),r.j()})}})}Yw.prototype.store=function(){return this.h},Yw.prototype.promise=function(){return this.g};function Zw(e){this.h=e,this.g=[]}Zw.prototype.destroy=function(){return Promise.all(this.g.map(function(e){return e.abort()}))};function Qw(e,t){return $w(e,t,`readwrite`)}function $w(e,t,n){n=e.h.transaction([t],n);var r=new Yw(n,t);return e.g.push(r),r.promise().then(function(){pe(e.g,r)},function(){pe(e.g,r)}),r}function eT(e,t,n){this.h=new Zw(e),this.i=t,this.g=n}r=eT.prototype,r.destroy=function(){return this.h.destroy()},r.hasFixedKeySpace=function(){return!0},r.addSegments=function(){return nT(this.i)},r.removeSegments=function(e,t){return rT(this,this.i,e,t)},r.getSegments=function(e){var t=this,n;return k(function(r){return r.h==1?r.g(iT(t,t.i,e),2):(n=r.i,r.return(n.map(function(e){return t.Uh(e)})))})},r.addManifests=function(){return nT(this.g)},r.updateManifest=function(){return Promise.reject(new R(2,9,9016,`Cannot modify values in `+this.g))};function tT(e,t,n){e=Qw(e.h,e.g);var r=e.store();return r.get(t).onsuccess=function(){r.put(n,t)},e.promise()}r.updateManifestExpiration=function(e,t){var n=Qw(this.h,this.g),r=n.store();return r.get(e).onsuccess=function(n){(n=n.target.result)&&(n.expiration=t,r.put(n,e))},n.promise()},r.removeManifests=function(e,t){return rT(this,this.g,e,t)},r.getManifests=function(e){var t=this,n;return k(function(r){return r.h==1?r.g(iT(t,t.g,e),2):(n=r.i,r.return(Promise.all(n.map(function(e){return t.Pd(e)}))))})},r.getAllManifests=function(){var e=this,t,n;return k(function(r){return r.h==1?(t=$w(e.h,e.g,`readonly`),n=/* @__PURE__ */ new Map,r.g(Xw(t,function(t,r){var i;return k(function(a){if(a.h==1)return a.g(e.Pd(r),2);i=a.i,n.set(t,i),a.j()})}),2)):r.h==3?r.return(n):r.g(t.promise(),3)})},r.Uh=function(e){return e},r.Pd=function(e){return Promise.resolve(e)};function nT(e){return Promise.reject(new R(2,9,9011,`Cannot add new value to `+e))}r.add=function(e,t){var n=this,r,i,a,o,s,c,l;return k(function(u){if(u.h==1){for(r=Qw(n.h,e),i=r.store(),a=[],o=g(t),s=o.next(),c={};!s.done;c={gh:void 0},s=o.next())l=s.value,c.gh=i.add(l),c.gh.onsuccess=function(e){return function(){a.push(e.gh.result)}}(c);return u.g(r.promise(),2)}return u.return(a)})};function rT(e,t,n,r){e=Qw(e.h,t),t=e.store(),n=g(n);for(var i=n.next(),a={};!i.done;a={Rg:void 0},i=n.next())a.Rg=i.value,t.delete(a.Rg).onsuccess=function(e){return function(){return r(e.Rg)}}(a);return e.promise()}function iT(e,t,n){var r,i,a,o,s,c,l;return k(function(u){if(u.h==1){for(r=$w(e.h,t,`readonly`),i=r.store(),a={},o=[],s=g(n),c=s.next(),l={};!c.done;l={Af:void 0,hf:void 0},c=s.next())l.hf=c.value,l.Af=i.get(l.hf),l.Af.onsuccess=function(e){return function(){e.Af.result??o.push(e.hf),a[e.hf]=e.Af.result}}(l);return u.g(r.promise(),2)}if(o.length)throw new R(2,9,9012,`Could not find values for `+o);return u.return(n.map(function(e){return a[e]}))})}function aT(e){this.g=new Zw(e)}aT.prototype.destroy=function(){return this.g.destroy()},aT.prototype.getAll=function(){var e=this,t,n;return k(function(r){return r.h==1?(t=$w(e.g,`session-ids`,`readonly`),n=[],r.g(Xw(t,function(e,t){n.push(t)}),2)):r.h==3?r.return(n):r.g(t.promise(),3)})},aT.prototype.add=function(e){var t=Qw(this.g,`session-ids`),n=t.store();e=g(e);for(var r=e.next();!r.done;r=e.next())n.add(r.value);return t.promise()},aT.prototype.remove=function(e){var t=this,n;return k(function(r){return r.h==1?(n=Qw(t.g,`session-ids`),r.g(Xw(n,function(t,n,r){e.includes(n.sessionId)&&r.delete()}),2)):r.g(n.promise(),0)})};function oT(){this.g=/* @__PURE__ */ new Map}oT.prototype.destroy=function(){for(var e=[],t=g(this.g.values()),n=t.next();!n.done;n=t.next())e.push(n.value.destroy());return this.g.clear(),Promise.all(e)},oT.prototype.init=function(){var e=this;mT.forEach(function(t,n){(t=t())&&e.g.set(n,t)});for(var t=[],n=g(this.g.values()),r=n.next();!r.done;r=n.next())t.push(r.value.init());return Promise.all(t)};function sT(e){var t=null;if(e.g.forEach(function(e,n){e.getCells().forEach(function(e,r){e.hasFixedKeySpace()||t||(t={path:{Kb:n,cb:r},cb:e})})}),t)return t;throw new R(2,9,9013,`Could not find a cell that supports add-operations`)}function cT(e,t){e.g.forEach(function(e,n){e.getCells().forEach(function(e,r){t({Kb:n,cb:r},e)})})}function lT(e,t,n){if(e=e.g.get(t),!e)throw new R(2,9,9013,`Could not find mechanism with name `+t);if(t=e.getCells().get(n),!t)throw new R(2,9,9013,`Could not find cell with name `+n);return t}function uT(e,t){e.g.forEach(function(e){t(e.getEmeSessionCell())})}function dT(e){var t=Array.from(e.g.keys());if(!t.length)throw new R(2,9,9e3,`No supported storage mechanisms found`);return e.g.get(t[0]).getEmeSessionCell()}function fT(e){var t,n,r;return k(function(i){return i.h==1?(t=Array.from(e.g.values()),n=t.length>0,n||(r=mT,r.forEach(function(e){(e=e())&&t.push(e)})),i.g(Promise.all(t.map(function(e){return e.erase()})),2)):n?i.A(0):i.g(Promise.all(t.map(function(e){return e.destroy()})),0)})}function pT(e,t){mT.set(e,t)}P(`shaka.offline.StorageMuxer`,oT),oT.unregister=function(e){mT.delete(e)},oT.register=pT,oT.prototype.destroy=oT.prototype.destroy;var mT=/* @__PURE__ */ new Map;function hT(){eT.apply(this,arguments)}m(hT,eT),hT.prototype.updateManifestExpiration=function(e,t){var n=this,r,i,a;return k(function(o){return r=Qw(n.h,n.g),i=r.store(),a=new oa,i.get(e).onsuccess=function(n){(n=n.target.result)?(n.expiration=t,i.put(n),a.resolve()):a.reject(new R(2,9,9012,`Could not find values for `+e))},o.g(Promise.all([r.promise(),a]),0)})},hT.prototype.Pd=function(e){var t,n,r,i,a,o;return k(function(s){if(s.h==1){for(t=[],n=0;n<e.periods.length;++n)r=n==e.periods.length-1?e.duration:e.periods[n+1].startTime,i=r-e.periods[n].startTime,a=gT(e.periods[n],i),t.push(a);return s.g(Ob(t),2)}return o=s.i,s.return({creationTime:0,originalManifestUri:e.originalManifestUri,duration:e.duration,size:e.size,expiration:e.expiration==null?1/0:e.expiration,streams:o,sessionIds:e.sessionIds,drmInfo:e.drmInfo,appMetadata:e.appMetadata,sequenceMode:!1})})};function gT(e,t){yT(e);for(var n=g(e.streams),r=n.next();!r.done;r=n.next());return e.streams.map(function(n){return _T(n,e.startTime,t)})}function _T(e,t,n){var r=e.initSegmentUri?vT(e.initSegmentUri):null,i=t+e.presentationTimeOffset,a=t+n;return{id:e.id,originalId:null,groupId:null,primary:e.primary,type:e.contentType,mimeType:e.mimeType,codecs:e.codecs,frameRate:e.frameRate,pixelAspectRatio:void 0,hdr:void 0,colorGamut:void 0,videoLayout:void 0,kind:e.kind,language:e.language,originalLanguage:e.language||null,label:e.label,width:e.width,height:e.height,initSegmentKey:r,encrypted:e.encrypted,keyIds:/* @__PURE__ */ new Set([e.keyId]),segments:e.segments.map(function(e){var n=vT(e.uri);return{startTime:t+e.startTime,endTime:t+e.endTime,dataKey:n,initSegmentKey:r,appendWindowStart:t,appendWindowEnd:a,timestampOffset:i,tilesLayout:``,mimeType:null,codecs:null,thumbnailSprite:null}}),variantIds:e.variantIds,roles:[],forced:!1,audioSamplingRate:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,tilesLayout:void 0,external:!1,fastSwitching:!1,isAudioMuxedInVideo:!1}}hT.prototype.Uh=function(e){return{data:e.data}};function vT(e){var t;if((t=/^offline:[0-9]+\/[0-9]+\/([0-9]+)$/.exec(e))||(t=/^offline:segment\/([0-9]+)$/.exec(e)))return Number(t[1]);throw new R(2,9,9004,`Could not parse uri `+e)}function yT(e){var t=e.streams.filter(function(e){return e.contentType==`audio`});if(e=e.streams.filter(function(e){return e.contentType==`video`}),!t.every(function(e){return e.variantIds})||!e.every(function(e){return e.variantIds})){for(var n=g(t),r=n.next();!r.done;r=n.next())r.value.variantIds=[];for(n=g(e),r=n.next();!r.done;r=n.next())r.value.variantIds=[];if(n=0,e.length&&!t.length){r=n++;for(var i=g(e),a=i.next();!a.done;a=i.next())a.value.variantIds.push(r)}if(!e.length&&t.length)for(r=n++,i=g(t),a=i.next();!a.done;a=i.next())a.value.variantIds.push(r);if(e.length&&t.length)for(t=g(t),r=t.next();!r.done;r=t.next())for(r=r.value,i=g(e),a=i.next();!a.done;a=i.next()){a=a.value;var o=n++;r.variantIds.push(o),a.variantIds.push(o)}}}function bT(){eT.apply(this,arguments)}m(bT,eT),bT.prototype.Pd=function(e){var t,n,r,i,a,o;return k(function(s){if(s.h==1){for(t=[],n=0;n<e.periods.length;++n){r=n==e.periods.length-1?e.duration:e.periods[n+1].startTime,i=r-e.periods[n].startTime;for(var c=e.periods[n],l=[],u=g(c.streams),d=u.next();!d.done;d=u.next())d=d.value,d.variantIds.length!=0&&l.push(xT(d,c.startTime,c.startTime+i));a=l,t.push(a)}return s.g(Ob(t),2)}return o=s.i,s.return({appMetadata:e.appMetadata,creationTime:0,drmInfo:e.drmInfo,duration:e.duration,expiration:e.expiration==null?1/0:e.expiration,originalManifestUri:e.originalManifestUri,sessionIds:e.sessionIds,size:e.size,streams:o,sequenceMode:!1})})};function xT(e,t,n){return{id:e.id,originalId:e.originalId,groupId:null,primary:e.primary,type:e.contentType,mimeType:e.mimeType,codecs:e.codecs,frameRate:e.frameRate,pixelAspectRatio:e.pixelAspectRatio,hdr:void 0,colorGamut:void 0,videoLayout:void 0,kind:e.kind,language:e.language,originalLanguage:e.language||null,label:e.label,width:e.width,height:e.height,encrypted:e.encrypted,keyIds:/* @__PURE__ */ new Set([e.keyId]),segments:e.segments.map(function(r){return{startTime:t+r.startTime,endTime:t+r.endTime,initSegmentKey:e.initSegmentKey,appendWindowStart:t,appendWindowEnd:n,timestampOffset:t-e.presentationTimeOffset,dataKey:r.dataKey,tilesLayout:``,mimeType:null,codecs:null,thumbnailSprite:null}}),variantIds:e.variantIds,roles:[],forced:!1,audioSamplingRate:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,tilesLayout:void 0,external:!1,fastSwitching:!1,isAudioMuxedInVideo:!1}}function ST(){eT.apply(this,arguments)}m(ST,eT),r=ST.prototype,r.hasFixedKeySpace=function(){return!1},r.addSegments=function(e){return this.add(this.i,e)},r.addManifests=function(e){return this.add(this.g,e)},r.updateManifest=function(e,t){return tT(this,e,t)},r.Pd=function(e){return e.expiration??(e.expiration=1/0),Promise.resolve(e)};function CT(){this.m=this.j=this.i=this.h=this.g=this.l=null}r=CT.prototype,r.init=function(){var t=this,n=new oa,r=!1,i=new Qr(function(){r=!0,n.reject(new R(2,9,9017))});typeof TT==`number`&&TT>0&&i.na(TT);var a=e.indexedDB.open(`shaka_offline_db`,5);return a.onsuccess=function(){if(!r){i.stop();var e=a.result;t.l=e;var o=e.objectStoreNames;o=o.contains(`manifest`)&&o.contains(`segment`)?new hT(e,`segment`,`manifest`):null,t.g=o,o=e.objectStoreNames,o=o.contains(`manifest-v2`)&&o.contains(`segment-v2`)?new bT(e,`segment-v2`,`manifest-v2`):null,t.h=o,o=e.objectStoreNames,o=o.contains(`manifest-v3`)&&o.contains(`segment-v3`)?new bT(e,`segment-v3`,`manifest-v3`):null,t.i=o,o=e.objectStoreNames,o=o.contains(`manifest-v5`)&&o.contains(`segment-v5`)?new ST(e,`segment-v5`,`manifest-v5`):null,t.j=o,e=e.objectStoreNames.contains(`session-ids`)?new aT(e):null,t.m=e,n.resolve()}},a.onupgradeneeded=function(){for(var e=a.result,t=g([`segment-v5`,`manifest-v5`,`session-ids`]),n=t.next();!n.done;n=t.next())n=n.value,e.objectStoreNames.contains(n)||e.createObjectStore(n,{autoIncrement:!0})},a.onerror=function(e){r||(i.stop(),n.reject(new R(2,9,9001,a.error)),e.preventDefault())},n},r.destroy=function(){var e=this;return k(function(t){switch(t.h){case 1:if(!e.g){t.A(2);break}return t.g(e.g.destroy(),2);case 2:if(!e.h){t.A(4);break}return t.g(e.h.destroy(),4);case 4:if(!e.i){t.A(6);break}return t.g(e.i.destroy(),6);case 6:if(!e.j){t.A(8);break}return t.g(e.j.destroy(),8);case 8:if(!e.m){t.A(10);break}return t.g(e.m.destroy(),10);case 10:e.l&&e.l.close(),t.j()}})},r.getCells=function(){var e=/* @__PURE__ */ new Map;return this.g&&e.set(`v1`,this.g),this.h&&e.set(`v2`,this.h),this.i&&e.set(`v3`,this.i),this.j&&e.set(`v5`,this.j),e},r.getEmeSessionCell=function(){return this.m},r.erase=function(){var e=this;return k(function(t){switch(t.h){case 1:if(!e.g){t.A(2);break}return t.g(e.g.destroy(),2);case 2:if(!e.h){t.A(4);break}return t.g(e.h.destroy(),4);case 4:if(!e.i){t.A(6);break}return t.g(e.i.destroy(),6);case 6:if(!e.j){t.A(8);break}return t.g(e.j.destroy(),8);case 8:return e.l&&e.l.close(),t.g(wT(),10);case 10:return e.l=null,e.g=null,e.h=null,e.i=null,e.j=null,t.g(e.init(),0)}})};function wT(){var t=new oa,n=e.indexedDB.deleteDatabase(`shaka_offline_db`);return n.onblocked=function(){},n.onsuccess=function(){t.resolve()},n.onerror=function(e){t.reject(new R(2,9,9001,n.error)),e.preventDefault()},t}var TT=5;P(`shaka.offline.indexeddb.StorageMechanismOpenTimeout`,TT),pT(`idb`,function(){return we().Ah()?new CT:null});function ET(e,t,n,r){this.g=e,this.i=t,this.h=n,this.l=r,this.j=[`offline:`,e,`/`,t,`/`,n,`/`,r].join(``)}ET.prototype.Kb=function(){return this.i},ET.prototype.cb=function(){return this.h},ET.prototype.key=function(){return this.l},ET.prototype.toString=function(){return this.j};function DT(e){if(e=/^offline:([a-z]+)\/([^/]+)\/([^/]+)\/([0-9]+)$/.exec(e),e==null)return null;var t=e[1];if(t!=`manifest`&&t!=`segment`)return null;var n=e[2];if(!n)return null;var r=e[3];return r&&t!=null?new ET(t,n,r,Number(e[4])):null}function OT(e,t){this.h=e,this.g=t}function kT(e,t){var n=new G(null,0);n.wb(t.duration);var r=t.streams.filter(function(e){return e.type==`audio`}),i=t.streams.filter(function(e){return e.type==`video`});r=AT(e,r,i,n),i=t.streams.filter(function(e){return e.type==Nt}).map(function(t){return jT(e,t,n)});var a=t.streams.filter(function(e){return e.type==`image`}).map(function(t){return jT(e,t,n)}),o=t.drmInfo?[t.drmInfo]:[];if(t.drmInfo)for(var s=g(r.values()),c=s.next();!c.done;c=s.next())c=c.value,c.audio&&c.audio.encrypted&&(c.audio.drmInfos=o),c.video&&c.video.encrypted&&(c.video.drmInfos=o);return{presentationTimeline:n,offlineSessionIds:t.sessionIds,variants:Array.from(r.values()),textStreams:i,imageStreams:a,sequenceMode:t.sequenceMode||!1,ignoreManifestTimestampsInSegmentsMode:!1,type:t.type||`UNKNOWN`,serviceDescription:null,nextUrl:null,periodCount:1,gapCount:0,isLowLatency:!1,startTime:null}}function AT(e,t,n,r){for(var i=/* @__PURE__ */ new Set,a=g(t),o=a.next();!o.done;o=a.next()){o=g(o.value.variantIds);for(var s=o.next();!s.done;s=o.next())i.add(s.value)}for(a=g(n),o=a.next();!o.done;o=a.next())for(o=g(o.value.variantIds),s=o.next();!s.done;s=o.next())i.add(s.value);for(a=/* @__PURE__ */ new Map,i=g(i),o=i.next();!o.done;o=i.next())o=o.value,a.set(o,{id:o,language:``,disabledUntilTime:0,primary:!1,audio:null,video:null,bandwidth:0,allowedByApplication:!0,allowedByKeySystem:!0,decodingInfos:[]});for(t=g(t),i=t.next();!i.done;i=t.next())for(o=i.value,i=jT(e,o,r),o=g(o.variantIds),s=o.next();!s.done;s=o.next())s=a.get(s.value),s.language=i.language,s.primary=s.primary||i.primary,s.audio=i;for(n=g(n),t=n.next();!t.done;t=n.next())for(i=t.value,t=jT(e,i,r),i=g(i.variantIds),o=i.next();!o.done;o=i.next())o=a.get(o.value),o.primary=o.primary||t.primary,o.video=t;return a}function jT(e,t,n){var r=t.segments.map(function(n){return MT(e,n,t)});return n.fe(r),{id:t.id,originalId:t.originalId,groupId:t.groupId,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new uu(r),mimeType:t.mimeType,codecs:t.codecs,width:t.width||void 0,height:t.height||void 0,frameRate:t.frameRate,pixelAspectRatio:t.pixelAspectRatio,hdr:t.hdr,colorGamut:t.colorGamut,videoLayout:t.videoLayout,kind:t.kind,encrypted:t.encrypted,drmInfos:[],keyIds:t.keyIds,language:t.language,originalLanguage:t.originalLanguage||null,label:t.label,type:t.type,primary:t.primary,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:t.roles,forced:t.forced,channelsCount:t.channelsCount,audioSamplingRate:t.audioSamplingRate,spatialAudio:t.spatialAudio,closedCaptions:t.closedCaptions,tilesLayout:t.tilesLayout,mssPrivateData:t.mssPrivateData,accessibilityPurpose:null,external:t.external,fastSwitching:t.fastSwitching,fullMimeTypes:/* @__PURE__ */ new Set([kr(t.mimeType,t.codecs)]),isAudioMuxedInVideo:t.isAudioMuxedInVideo||!1,baseOriginalId:null}}function MT(e,t,n){var r=new ET(`segment`,e.h,e.g,t.dataKey);return e=new H(t.startTime,t.endTime,function(){return[r.toString()]},0,null,t.initSegmentKey==null?null:NT(e,t.initSegmentKey),t.timestampOffset,t.appendWindowStart,t.appendWindowEnd,[],t.tilesLayout||``),e.mimeType=t.mimeType||n.mimeType||``,e.codecs=t.codecs||n.codecs||``,t.thumbnailSprite&&e.If(t.thumbnailSprite),e}function NT(e,t){var n=new ET(`segment`,e.h,e.g,t);return new Gs(function(){return[n.toString()]},0,null)}function PT(){this.g=null}r=PT.prototype,r.configure=function(){},r.start=function(e,t){var n=this,r,i,a,o,s,c,l;return k(function(u){switch(u.h){case 1:if(r=DT(e),n.g=r,r==null||r.g!=`manifest`)throw new R(2,1,9004,e);return i=new oT,u.D(2),u.g(i.init(),4);case 4:return u.g(lT(i,r.Kb(),r.cb()),5);case 5:return a=u.i,u.g(a.getManifests([r.key()]),6);case 6:return o=u.i,s=o[0],c=new OT(r.Kb(),r.cb()),l=kT(c,s),t.makeTextStreamsForClosedCaptions(l),u.return(l);case 2:return u.u(),u.g(i.destroy(),7);case 7:u.B(0)}})},r.stop=function(){return Promise.resolve()},r.update=function(){},r.onExpirationUpdated=function(e,t){var n=this,r,i,a,o,s,c,l;return k(function(u){switch(u.h){case 1:return r=n.g,i=new oT,u.m(2,3),u.g(i.init(),5);case 5:return u.g(lT(i,r.Kb(),r.cb()),6);case 6:return a=u.i,u.g(a.getManifests([r.key()]),7);case 7:if(o=u.i,s=o[0],c=s.sessionIds.includes(e),l=s.expiration==null||s.expiration>t,!c||!l){u.A(3);break}return u.g(a.updateManifestExpiration(r.key(),t),3);case 3:return u.u(),u.g(i.destroy(),10);case 10:u.B(0);break;case 2:u.l(),u.A(3)}})},r.onInitialVariantChosen=function(){},r.banLocation=function(){},r.setMediaElement=function(){},Ht(`application/x-offline-manifest`,function(){return new PT});function FT(){}function IT(e,t){var n=DT(e);return n&&n.g==`manifest`?(e={uri:e,originalUri:e,data:/* @__PURE__ */ new ArrayBuffer(0),headers:{"content-type":`application/x-offline-manifest`},originalRequest:t},e=ua(e)):e=n&&n.g==`segment`?LT(n.key(),n,t):ca(new R(2,1,9004,e)),e}function LT(e,t,n){var r=new oT;return ua(void 0).Ya(function(){return r.init()}).Ya(function(){return lT(r,t.Kb(),t.cb())}).Ya(function(e){return e.getSegments([t.key()])}).Ya(function(e){return{uri:t,data:e[0].data,headers:{},originalRequest:n}}).finally(function(){return r.destroy()})}P(`shaka.offline.OfflineScheme`,FT),FT.plugin=IT,ba(`offline`,IT);function RT(e,t,n){var r,i,a,o,s,c;return k(function(l){switch(l.h){case 1:r=[];for(var u=[],d=g(n),f=d.next();!f.done;f=d.next()){f=f.value;for(var p=!1,m=g(u),h=m.next();!h.done;h=m.next())if(h=h.value,BT(h.info,f)){h.sessionIds.push(f.sessionId),p=!0;break}p||u.push({info:f,sessionIds:[f.sessionId]})}i=g(u),a=i.next();case 2:if(a.done){l.A(4);break}return o=a.value,s=zT(e,t,o),l.g(s,5);case 5:c=l.i,r=r.concat(c),a=i.next(),l.A(2);break;case 4:return l.return(r)}})}function zT(e,t,n){var r,i;return k(function(a){switch(a.h){case 1:return r=new eo({qc:t,onError:function(){},wf:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),a.m(2),r.configure(e),a.g(io(r,n.info.keySystem,n.info.licenseUri,n.info.serverCertificate,n.info.audioCapabilities,n.info.videoCapabilities),4);case 4:a.o(3);break;case 2:return a.l(),a.g(r.destroy(),5);case 5:return a.return([]);case 3:return i=[],a.g(Promise.all(n.sessionIds.map(function(e){return k(function(t){if(t.h==1)return t.m(2),t.g(lo(r,e),4);if(t.h!=2)return i.push(e),t.o(0);t.l(),t.j()})})),6);case 6:return a.g(r.destroy(),7);case 7:return a.return(i)}})}function BT(e,t){function n(e,t){return e.robustness==t.robustness&&e.contentType==t.contentType}return e.keySystem==t.keySystem&&e.licenseUri==t.licenseUri&&me(e.audioCapabilities,t.audioCapabilities,n)&&me(e.videoCapabilities,t.videoCapabilities,n)}function VT(e,t,n){var r=t.presentationTimeline.getDuration();return t=UT(t),{offlineUri:null,originalManifestUri:e,duration:r,size:0,expiration:1/0,tracks:t,appMetadata:n,isIncomplete:!1}}function HT(e,t){var n=kT(new OT(e.Kb(),e.cb()),t),r=t.appMetadata||{};return n=UT(n),{offlineUri:e.toString(),originalManifestUri:t.originalManifestUri,duration:t.duration,size:t.size,expiration:t.expiration,tracks:n,appMetadata:r,isIncomplete:t.isIncomplete||!1}}function UT(e){var t=[],n=Bi(e.variants);n=g(n);for(var r=n.next();!r.done;r=n.next())t.push(Ni(r.value));for(e=g(e.textStreams),n=e.next();!n.done;n=e.next())t.push(Pi(n.value));return t}function WT(){this.g=/* @__PURE__ */ new Map}function GT(e,t){var n=t.audio,r=t.video;if(n&&!r&&e.g.set(n.id,n.bandwidth||t.bandwidth),!n&&r&&e.g.set(r.id,r.bandwidth||t.bandwidth),n&&r){var i=n.bandwidth||393216,a=r.bandwidth||t.bandwidth-i;a<=0&&(a=t.bandwidth),e.g.set(n.id,i),e.g.set(r.id,a)}}function KT(e,t){e.g.set(t.id,t.bandwidth||2048)}function qT(e,t){return e=e.g.get(t),e??(e=0),e}function JT(e){var t=this;if(e&&e.constructor!=K)throw new R(2,9,9008);this.g=this.h=null,e?(this.h=e.g,this.g=e.Sb()):(this.h=df(),this.g=new ya,this.g.configure(this.h.networking)),this.i=[],this.l=[];var n=!e;this.j=new Ma(function(){var e,r,i,a,o;return k(function(s){switch(s.h){case 1:return s.g(Promise.all(t.l.map(function(e){return Gw(e)})),2);case 2:for(e=function(){},r=[],i=g(t.i),a=i.next();!a.done;a=i.next())o=a.value,r.push(o.then(e,e));return s.g(Promise.all(r),3);case 3:if(!n){s.A(4);break}return s.g(t.g.destroy(),4);case 4:t.h=null,t.g=null,s.j()}})}),this.m=1e9}function YT(){if($x(we()))a:{for(var e=g(mT.values()),t=e.next();!t.done;t=e.next())if(t=t.value,t=t()){t.destroy(),e=!0;break a}e=!1}else e=!1;return e}r=JT.prototype,r.destroy=function(){return this.j.destroy()},r.configure=function(e,t){return arguments.length==2&&typeof e==`string`&&(e=Hd(e,t)),pf(this.h,e)},r.getConfiguration=function(){var e=df();return pf(e,this.h,df()),e},r.Sb=function(){return this.g},r.store=function(e,t,n,r,i){var a=this,o=this.getConfiguration(),s=new Uw(this.g);return this.l.push(s),t=XT(this,e,t||{},r||[],i||[],function(){var t;return k(function(r){return r.h==1?n?r.A(2):r.g(qu(e,a.g,o.manifest.retryParameters),3):(r.h!=2&&(n=r.i),t=Wt(e,n||null),r.return(t()))})},o,s),t=new sa(t,function(){return Gw(s)}),t.finally(function(){pe(a.l,s)}),SE(this,t)};function XT(e,t,n,r,i,a,o,s){var c,l,u,d,f,p,m,h,_,v,y,b,x,S,C,w,T,E,D,O,A,j,M,ee;return k(function(k){switch(k.h){case 1:return bE(),l=c=null,u=new oT,p=f=d=null,k.m(2,3),k.g(a(),5);case 5:return c=k.i,k.g(dE(e,t,c,o),6);case 6:if(m=k.i,yE(e),h=!m.presentationTimeline.T()&&!m.presentationTimeline.Pc(),!h)throw new R(2,9,9005,t);_=g(r),v=_.next();case 7:if(v.done){k.A(9);break}return y=v.value,k.g(fE(e,y,m),10);case 10:b=k.i,m.imageStreams.push(b),yE(e),v=_.next(),k.A(7);break;case 9:x=g(i),S=x.next();case 11:return S.done?(Lo(o.drm.clearKeys,m.variants),T=m.variants.some(function(e){if(e.audio){for(var t=g(e.audio.drmInfos),n=t.next();!n.done;n=t.next())if(n.value.licenseServerUri.startsWith(`data:`))return!0}if(e.video){for(e=g(e.video.drmInfos),t=e.next();!t.done;t=e.next())if(t.value.licenseServerUri.startsWith(`data:`))return!0}return!1}),E=o.offline.usePersistentLicense,T&&(E=!1),k.g(e.ed(m,function(e){p=p||e},o,E),15)):(C=S.value,k.g(pE(e,m,C.uri,C.language,C.kind,C.mime,C.codecs),14));case 14:w=k.i,m.textStreams.push(w),yE(e),S=x.next(),k.A(11);break;case 15:if(l=k.i,yE(e),p)throw p;return k.g(eE(m,l,o,E),16);case 16:return k.g(u.init(),17);case 17:return yE(e),k.g(sT(u),18);case 18:return d=k.i,yE(e),D=tE(l,m,t,n,o,s,E),O=D.vk,A=D.Eh,k.g(d.cb.addManifests([O]),19);case 19:if(j=k.i,yE(e),f=j[0],yE(e),p)throw p;return k.g(ZT(e,A,f,O,s,o,d.cb,m,l,E),20);case 20:return yE(e),iE(m,O,l,E),k.g(d.cb.updateManifest(f,O),21);case 21:return yE(e),M=new ET(`manifest`,d.path.Kb,d.path.cb,f),k.return(HT(M,O));case 3:return k.u(),k.g(u.destroy(),22);case 22:if(!c){k.A(23);break}return k.g(c.stop(),23);case 23:if(!l){k.A(25);break}return k.g(l.destroy(),25);case 25:k.B(0);break;case 2:if(ee=k.l(),f==null){k.A(27);break}return k.g(QT(f),27);case 27:throw p||ee}})}function ZT(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,_,v,y,b,x;return k(function(S){switch(S.h){case 1:if(u={},d=0,f=function(){if(e.j.g||i.l)throw new R(2,9,7001)},p=function(e,t){var p,m,h,_,v,y,b,x,S;return k(function(C){if(C.h==1){for(p=g(e),m=p.next(),h={};!m.done;h={jc:void 0},m=p.next())h.jc=m.value,f(),_=zw(h.jc,a),v=h.jc.i,y=h.jc.h,b=function(e){return function(t){var n,r,i,a;return k(function(s){switch(s.h){case 1:if(n=e.jc.g,r=n.Vb(!1),!n.aesKey||r){s.A(2);break}return s.g(Ku(t,n.aesKey,e.jc.j),3);case 3:t=s.i;case 2:return i=Rw(n),s.g(o.addSegments([{data:t}]),4);case 4:a=s.i,f(),u[i]=a[0],d+=t.byteLength,s.j()}})}}(h),x=h.jc.g,(S=x.Vb(!1))?Kw(i,h.jc.groupId,S,v,y,b):i.queue(h.jc.groupId,_,v,y,b);return C.g(qw(i),2)}return f(),!t||i.l?C.A(0):(iE(s,r,c,l),C.g(o.updateManifest(n,r),0))})},m=!1,S.m(2),!nE(s)||!m||rE(s)){S.A(4);break}return S.g(p(t.filter(function(e){return e.h}),!0),5);case 5:return f(),t=t.filter(function(e){return!e.h}),h=u,_=d,u={},d=0,S.g($T(o,n,r,h,_,function(){return yE(e)}),6);case 6:f();case 4:if(m){S.A(7);break}return S.g(p(t,!1),8);case 8:return f(),v=u,y=d,u={},d=0,S.g($T(o,n,r,v,y,function(){return f()}),9);case 9:f();case 7:S.o(0);break;case 2:return b=S.l(),x=Object.values(u),S.g(o.removeSegments(x,function(){}),10);case 10:throw b}})}function QT(e){var t,n,r,i;return k(function(a){switch(a.h){case 1:return t=new oT,a.g(t.init(),2);case 2:return a.g(sT(t),3);case 3:return n=a.i,r=new ET(`manifest`,n.path.Kb,n.path.cb,e),a.g(t.destroy(),4);case 4:return i=new JT,a.g(i.remove(r.toString()),0)}})}function $T(e,t,n,r,i,a){var o,s,c,l,u,d,f,p,m,h,_;return k(function(v){switch(v.h){case 1:for(o=!1,v.m(2),s=!0,c=g(n.streams),l=c.next();!l.done;l=c.next())for(u=l.value,d=g(u.segments),f=d.next();!f.done;f=d.next())p=f.value,m=p.pendingSegmentRefId?r[p.pendingSegmentRefId]:null,m!=null&&(p.dataKey=m,p.pendingSegmentRefId=void 0),m=p.pendingInitSegmentRefId?r[p.pendingInitSegmentRefId]:null,m!=null&&(p.initSegmentKey=m,p.pendingInitSegmentRefId=void 0),p.pendingSegmentRefId&&(s=!1),p.pendingInitSegmentRefId&&(s=!1);return n.size+=i,s&&(n.isIncomplete=!1),v.g(e.updateManifest(t,n),4);case 4:o=!0,a(),v.o(0);break;case 2:return h=v.l(),v.g(QT(t),5);case 5:if(o){v.A(6);break}return _=Object.values(r),v.g(e.removeSegments(_,function(){}),6);case 6:throw h}})}function eE(e,t,n,r){var i,a,o,s,c,l,u,d,f,p,m,h,_,v,y,b,x,S,C,w,T,E,D,O,A,j,M,ee,te,N;return k(function(k){switch(k.h){case 1:return i={width:1/0,height:1/0},vi(e,n.restrictions,i),k.g(xi(t,e,r,n.drm.preferredKeySystems,n.drm.keySystemsMapping),2);case 2:for(a=[],o=n.preferredDecodingAttributes,s=n.preferredVideoCodecs,c=n.preferredAudioCodecs,l=n.preferredTextFormats,gi(e,s,c,o,l),u=g(e.variants),d=u.next();!d.done;d=u.next())f=d.value,a.push(Ni(f));for(p=g(e.textStreams),m=p.next();!m.done;m=p.next())h=m.value,a.push(Pi(h));for(_=g(e.imageStreams),v=_.next();!v.done;v=_.next())y=v.value,a.push(Fi(y));return k.g(n.offline.trackSelectionCallback(a),3);case 3:for(b=k.i,x=e.presentationTimeline.getDuration(),S=0,C=g(b),w=C.next();!w.done;w=C.next())T=w.value,E=T.bandwidth*x/8,S+=E;return k.m(4),k.g(n.offline.downloadSizeCallback(S),6);case 6:if(D=k.i,!D)throw new R(2,9,9014);k.o(5);break;case 4:throw O=k.l(),O instanceof R?O:new R(2,9,9015);case 5:for(A=/* @__PURE__ */ new Set,j=/* @__PURE__ */ new Set,M=/* @__PURE__ */ new Set,ee=g(b),te=ee.next();!te.done;te=ee.next())N=te.value,N.type==`variant`&&A.add(N.id),N.type==`text`&&j.add(N.id),N.type==`image`&&M.add(N.id);e.variants=e.variants.filter(function(e){return A.has(e.id)}),e.textStreams=e.textStreams.filter(function(e){return j.has(e.id)}),e.imageStreams=e.imageStreams.filter(function(e){return M.has(e.id)}),EE(e),k.j()}})}function tE(e,t,n,r,i,a,o){var s=VT(n,t,r),c=i.offline.progressCallback;Ww(a,function(e,t){s.size=t,c(s,e)},function(t,n){l&&o&&u==n&&fo(e,`cenc`,t)});var l=nE(t)&&!rE(t),u=null;l&&(u=DE.get(e.g.keySystem));for(var d=new WT,f=g(t.textStreams),p=f.next();!p.done;p=f.next())d.g.set(p.value.id,52);for(f=g(t.imageStreams),p=f.next();!p.done;p=f.next())KT(d,p.value);for(f=g(t.variants),p=f.next();!p.done;p=f.next())GT(d,p.value);return a=gE(a,d,t,i),i=a.streams,a=a.Eh,(d=e.g)&&o&&(d.initData=[]),{vk:{creationTime:Date.now(),originalManifestUri:n,duration:t.presentationTimeline.getDuration(),size:0,expiration:e.Ud(),streams:i,sessionIds:o?po(e):[],drmInfo:d,appMetadata:r,isIncomplete:!0,sequenceMode:t.sequenceMode,type:t.type},Eh:a}}function nE(e){return e.variants.some(function(e){var t=e.audio&&e.audio.encrypted;return e.video&&e.video.encrypted||t})}function rE(e){return e.variants.some(function(e){return(e.video?e.video.drmInfos:[]).concat(e.audio?e.audio.drmInfos:[]).some(function(e){return e.initData&&e.initData.length})})}function iE(e,t,n,r){if(t.expiration=n.Ud(),n=po(n),t.sessionIds=r?n:[],nE(e)&&r&&!n.length)throw new R(2,9,9007)}r.remove=function(e){return xE(this,aE(this,e))};function aE(e,t){var n,r,i,a,o,s;return k(function(c){switch(c.h){case 1:if(bE(),n=DT(t),n==null||n.g!=`manifest`)throw new R(2,9,9004,t);return r=n,i=new oT,c.D(2),c.g(i.init(),4);case 4:return c.g(lT(i,r.Kb(),r.cb()),5);case 5:return a=c.i,c.g(a.getManifests([r.key()]),6);case 6:return o=c.i,s=o[0],c.g(Promise.all([sE(e,s,i),cE(a,r,s)]),2);case 2:return c.u(),c.g(i.destroy(),8);case 8:c.B(0)}})}function oE(e,t){for(var n=[],r=g(e.streams),i=r.next();!i.done;i=r.next())i=i.value,t&&i.type==`video`?n.push({contentType:kr(i.mimeType,i.codecs),robustness:e.drmInfo.videoRobustness}):t||i.type!=`audio`||n.push({contentType:kr(i.mimeType,i.codecs),robustness:e.drmInfo.audioRobustness});return n}function sE(e,t,n){return k(function(r){return r.g(wE(e.g,e.h.drm,n,t),0)})}function cE(e,t,n){function r(){}var i=CE(n);return HT(t,n),Promise.all([e.removeSegments(i,r),e.removeManifests([t.key()],r)])}r.Qk=function(){return xE(this,lE(this))};function lE(e){var t,n,r,i,a,o,s,c,l,u;return k(function(d){switch(d.h){case 1:return bE(),t=e.g,n=e.h.drm,r=new oT,i=!1,d.D(2),d.g(r.init(),4);case 4:a=[],uT(r,function(e){return a.push(e)}),o=g(a),s=o.next();case 5:if(s.done){d.A(2);break}return c=s.value,d.g(c.getAll(),8);case 8:return l=d.i,d.g(RT(n,t,l),9);case 9:return u=d.i,d.g(c.remove(u),10);case 10:u.length!=l.length&&(i=!0),s=o.next(),d.A(5);break;case 2:return d.u(),d.g(r.destroy(),11);case 11:d.B(3);break;case 3:return d.return(!i)}})}r.list=function(){return xE(this,uE())};function uE(){var e,t,n;return k(function(r){switch(r.h){case 1:return bE(),e=[],t=new oT,r.D(2),r.g(t.init(),4);case 4:return n=Promise.resolve(),cT(t,function(t,r){n=n.then(function(){var n;return k(function(i){if(i.h==1)return i.g(r.getAllManifests(),2);n=i.i,n.forEach(function(n,r){n=HT(new ET(`manifest`,t.Kb,t.cb,r),n),e.push(n)}),i.j()})})}),r.g(n,2);case 2:return r.u(),r.g(t.destroy(),6);case 6:r.B(3);break;case 3:return r.return(e)}})}function dE(e,t,n,r){var i,a,o,s,c;return k(function(l){if(l.h==1)return i=null,a=e.g,o={networkingEngine:a,filter:function(){return Promise.resolve()},makeTextStreamsForClosedCaptions:function(){},onTimelineRegionAdded:function(){},onEvent:function(){},onError:function(e){i=e},isLowLatencyMode:function(){return!1},updateDuration:function(){},newDrmInfo:function(){},onManifestUpdated:function(){},getBandwidthEstimate:function(){return r.abr.defaultBandwidthEstimate},onMetadata:function(){},disableStream:function(){},addFont:function(){}},n.configure(r.manifest),yE(e),l.g(n.start(t,o),2);if(l.h!=3)return s=l.i,yE(e),c=TE(s),l.g(Promise.all(Pa(c,function(e){return e.createSegmentIndex()})),3);if(yE(e),i)throw i;return l.return(s)})}function fE(e,t,n){var r,i,a,o,s,c,l,u,d,f,p,m,h,_,v;return k(function(y){switch(y.h){case 1:return y.g(mE(e,t),2);case 2:if(r=y.i,r!=`text/vtt`)throw new R(1,2,2017,t);return y.g(hE(t,e.g,e.h.streaming.retryParameters),3);case 3:if(i=y.i,a=Hr(r),!a)throw new R(2,2,2014,r);for(o=a(),s={periodStart:0,segmentStart:0,segmentEnd:n.presentationTimeline.getDuration(),vttOffset:0},c=Ze(i),l=o.parseMedia(c,s,t,[]),u=[],d=g(l),f=d.next(),p={};!f.done;p={Rf:void 0,gd:void 0},f=d.next())p.gd=f.value,p.Rf=null,m=function(e){return function(){return e.Rf??(e.Rf=Dt([t],[e.gd.payload])),e.Rf||[]}}(p),h=new H(p.gd.startTime,p.gd.endTime,m,0,null,null,0,0,1/0),p.gd.payload.includes(`#xywh`)&&(_=p.gd.payload.split(`#xywh=`)[1].split(`,`),_.length===4&&h.If({height:parseInt(_[3],10),positionX:parseInt(_[0],10),positionY:parseInt(_[1],10),width:parseInt(_[2],10)})),u.push(h);if(v=r,!u.length){y.A(4);break}return y.g(qu(u[0].P()[0],e.g,e.h.manifest.retryParameters),5);case 5:v=y.i;case 4:return y.return({id:e.m++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:new uu(u),mimeType:v||``,codecs:``,kind:``,encrypted:!1,drmInfos:[],keyIds:/* @__PURE__ */ new Set,language:`und`,originalLanguage:null,label:null,type:`image`,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,tilesLayout:`1x1`,accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:/* @__PURE__ */ new Set([kr(v||``,``)]),isAudioMuxedInVideo:!1,baseOriginalId:null})}})}function pE(e,t,n,r,i,a,o){var s,c,l;return k(function(u){if(u.h==1)return a?u.A(2):u.g(mE(e,n),3);if(u.h!=2&&(a=u.i),s={id:e.m++,originalId:null,groupId:null,createSegmentIndex:function(){return Promise.resolve()},segmentIndex:du(0,t.presentationTimeline.getDuration(),[n]),mimeType:a||``,codecs:o||``,kind:i,encrypted:!1,drmInfos:[],keyIds:/* @__PURE__ */ new Set,language:r,originalLanguage:r,label:null,type:Nt,primary:!1,trickModeVideo:null,dependencyStream:null,emsgSchemeIdUris:null,roles:[],forced:!1,channelsCount:null,audioSamplingRate:null,spatialAudio:!1,closedCaptions:null,accessibilityPurpose:null,external:!0,fastSwitching:!1,fullMimeTypes:/* @__PURE__ */ new Set([kr(a||``,o||``)]),isAudioMuxedInVideo:!1,baseOriginalId:null},c=kr(s.mimeType,s.codecs),l=Ur(c),!l)throw new R(2,2,2014,a);return u.return(s)})}function mE(e,t){var n;return k(function(r){switch(r.h){case 1:return r.m(2),r.g(qu(t,e.g,e.h.streaming.retryParameters),4);case 4:n=r.i,r.o(3);break;case 2:r.l();case 3:if(n)return r.return(n);throw new R(1,2,2011,t)}})}function hE(e,t,n){var r,i,a;return k(function(o){return o.h==1?(r=ka,i=Sa([e],n),i.method=`GET`,o.g(t.request(r,i).promise,2)):(a=o.i,o.return(a.data))})}r.ed=function(e,t,n,r){var i=this,a;return k(function(o){return o.h==1?(a=new eo({qc:i.g,onError:t,wf:function(){},onExpirationUpdated:function(){},onEvent:function(){}}),a.configure(n.drm),o.g(no(a,e.variants,r),2)):o.h==3?o.return(a):r?o.g(uo(a),3):o.A(3)})};function gE(e,t,n,r){var i=/* @__PURE__ */ new Map,a=TE(n),o=/* @__PURE__ */ new Map;a=g(a);for(var s=a.next();!s.done;s=a.next()){s=s.value;var c=_E(e,t,n,s,r,i);o.set(s.id,c)}for(e=g(n.variants),t=e.next();!t.done;t=e.next())t=t.value,t.audio&&o.get(t.audio.id).variantIds.push(t.id),t.video&&o.get(t.video.id).variantIds.push(t.id);return{streams:Array.from(o.values()),Eh:Array.from(i.values())}}function _E(e,t,n,r,i,a){var o={id:r.id,originalId:r.originalId,groupId:r.groupId,primary:r.primary,type:r.type,mimeType:r.mimeType,codecs:r.codecs,frameRate:r.frameRate,pixelAspectRatio:r.pixelAspectRatio,hdr:r.hdr,colorGamut:r.colorGamut,videoLayout:r.videoLayout,kind:r.kind,language:r.language,originalLanguage:r.originalLanguage,label:r.label,width:r.width||null,height:r.height||null,encrypted:r.encrypted,keyIds:r.keyIds,segments:[],variantIds:[],roles:r.roles,forced:r.forced,channelsCount:r.channelsCount,audioSamplingRate:r.audioSamplingRate,spatialAudio:r.spatialAudio,closedCaptions:r.closedCaptions,tilesLayout:r.tilesLayout,mssPrivateData:r.mssPrivateData,external:r.external,fastSwitching:r.fastSwitching,isAudioMuxedInVideo:r.isAudioMuxedInVideo},s=i.offline.numberOfParallelDownloads,c=s===0?r.id:0;return vE(r,n.presentationTimeline.Fb(),function(n,i){var l=Rw(n),u=void 0;if(!a.has(l)){var d=n.endTime-n.startTime;d=qT(t,r.id)*d,d=Vw(e.g,d),a.set(l,new Lw(n,d,c,!1,i))}n.ba&&(u=Rw(n.ba),a.has(u)||(d=qT(t,r.id)*.5,d=Vw(e.g,d),a.set(u,new Lw(n.ba,d,c,!0,i)))),o.segments.push({pendingInitSegmentRefId:u,initSegmentKey:u?0:null,startTime:n.startTime,endTime:n.endTime,appendWindowStart:n.appendWindowStart,appendWindowEnd:n.appendWindowEnd,timestampOffset:n.timestampOffset,tilesLayout:n.tilesLayout,pendingSegmentRefId:l,dataKey:0,mimeType:n.mimeType,codecs:n.codecs,thumbnailSprite:n.thumbnailSprite}),s!==0&&(c=(c+1)%s)}),o}function vE(e,t,n){if(t=e.segmentIndex.find(t),t!=null)for(var r=e.segmentIndex.get(t);r;)n(r,t),r=e.segmentIndex.get(++t)}function yE(e){if(e.j.g)throw new R(2,9,7001)}function bE(){if(!YT())throw new R(2,9,9e3)}function xE(e,t){return k(function(n){return n.h==1?(e.i.push(t),n.D(2),n.g(t,4)):n.h==2?(n.u(),pe(e.i,t),n.B(0)):n.return(n.i)})}function SE(e,t){var n=t.promise;return e.i.push(n),t.finally(function(){pe(e.i,n)})}function CE(e){var t=/* @__PURE__ */ new Set;e=g(e.streams);for(var n=e.next();!n.done;n=e.next()){n=g(n.value.segments);for(var r=n.next();!r.done;r=n.next())r=r.value,r.initSegmentKey!=null&&t.add(r.initSegmentKey),t.add(r.dataKey)}return Array.from(t)}function wE(e,t,n,r){var i,a,o;return k(function(s){return s.h==1?r.drmInfo?(i=dT(n),a=r.sessionIds.map(function(e){return{sessionId:e,keySystem:r.drmInfo.keySystem,licenseUri:r.drmInfo.licenseServerUri,serverCertificate:r.drmInfo.serverCertificate,audioCapabilities:oE(r,!1),videoCapabilities:oE(r,!0)}}),s.g(RT(t,e,a),2)):s.return():s.h==3?s.g(i.add(a.filter(function(e){return!o.includes(e.sessionId)})),0):(o=s.i,s.g(i.remove(o),3))})}function TE(e){for(var t=/* @__PURE__ */ new Set,n=g(e.variants),r=n.next();!r.done;r=n.next())r=r.value,r.audio&&t.add(r.audio),r.video&&t.add(r.video);for(n=g(e.textStreams),r=n.next();!r.done;r=n.next())t.add(r.value);for(e=g(e.imageStreams),n=e.next();!n.done;n=e.next())t.add(n.value);return t}function EE(e){e.variants.map(function(e){return e.video});var t=new Set(e.variants.map(function(e){return e.audio}));e=e.textStreams;for(var n=g(t),r=n.next();!r.done;r=n.next()){r=g(t);for(var i=r.next();!i.done;i=r.next());}for(t=g(e),n=t.next();!n.done;n=t.next())for(n=g(e),r=n.next();!r.done;r=n.next());}P(`shaka.offline.Storage`,JT),JT.deleteAll=function(){var e;return k(function(t){return t.h==1?(e=new oT,t.D(2),t.g(fT(e),2)):t.h==5?t.B(0):(t.u(),t.g(e.destroy(),5))})},JT.prototype.list=JT.prototype.list,JT.prototype.removeEmeSessions=JT.prototype.Qk,JT.prototype.remove=JT.prototype.remove,JT.prototype.store=JT.prototype.store,JT.prototype.getNetworkingEngine=JT.prototype.Sb,JT.prototype.getConfiguration=JT.prototype.getConfiguration,JT.prototype.configure=JT.prototype.configure,JT.prototype.destroy=JT.prototype.destroy,JT.support=YT;var DE=(/* @__PURE__ */ 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`);Rm(`offline`,YT);function OE(){}function kE(e,t){for(e={priority:t||0,callback:e},t=0;t<AE.length;t++)if(AE[t].priority<e.priority){AE.splice(t,0,e);return}AE.push(e)}P(`shaka.polyfill`,OE),OE.register=kE,OE.installAll=function(){for(var e=g(AE),t=e.next();!t.done;t=e.next()){t=t.value;try{t.callback()}catch(e){F(`Error installing polyfill!`,e)}}};var AE=[];function jE(e,t,n){this.g=e,this.i=t||null,this.h=n||null,this.keySystem=e.keySystem}jE.prototype.getConfiguration=function(){var e=this.g.getConfiguration();if(e.videoCapabilities)for(var t=g(e.videoCapabilities),n=t.next();!n.done;n=t.next())n.value.encryptionScheme=this.i;if(e.audioCapabilities)for(t=g(e.audioCapabilities),n=t.next();!n.done;n=t.next())n.value.encryptionScheme=this.h;return e},jE.prototype.createMediaKeys=function(){return this.g.createMediaKeys()};function ME(e){return ot(e)?`cbcs`:it(e)||at(e)||rt(e)||e===`com.huawei.wiseplay`?`cenc`:(F(`EmeEncryptionSchemePolyfill: Unknown key system:`,e,`Please contribute!`),null)}function NE(e){if(!e)return!1;e=e.getConfiguration();var t=e.audioCapabilities&&e.audioCapabilities[0];return!!((e=e.videoCapabilities&&e.videoCapabilities[0]||t)&&e.encryptionScheme!==void 0)}function PE(e,t){return!(e&&e!=t&&(e!=`cbcs`&&e!=`cbcs-1-9`||!we().Xc()))}function FE(){}var IE;function LE(){we().Kf()&&!IE&&!navigator.emeEncryptionSchemePolyfilled&&navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration&&(IE=navigator.requestMediaKeySystemAccess,navigator.requestMediaKeySystemAccess=RE,navigator.emeEncryptionSchemePolyfilled=!0)}function RE(e,t){var n=this,r;return k(function(i){return i.h==1?i.g(IE.call(n,e,t),2):(r=i.i,NE(r)?(navigator.requestMediaKeySystemAccess=IE,i.return(r)):(navigator.requestMediaKeySystemAccess=zE,i.return(zE.call(n,e,t))))})}function zE(e,t){var n=this,r,i,a,o,s,c,l,u,d,f,p,m;return k(function(h){if(h.h==1){for(r=ME(e),i=[],a=g(t),o=a.next();!o.done;o=a.next())s=o.value,c=BE(s.videoCapabilities,r),l=BE(s.audioCapabilities,r),s.videoCapabilities&&s.videoCapabilities.length&&!c.length||s.audioCapabilities&&s.audioCapabilities.length&&!l.length||(u=Object.assign({},s),u.videoCapabilities=c,u.audioCapabilities=l,i.push(u));if(!i.length)throw d=Error(`Unsupported keySystem or supportedConfigurations.`),d.name=`NotSupportedError`,d.code=DOMException.NOT_SUPPORTED_ERR,d;return h.g(IE.call(n,e,i),2)}return f=h.i,m=p=null,i[0]&&(i[0].videoCapabilities&&(p=i[0].videoCapabilities[0].encryptionScheme),i[0].audioCapabilities&&(m=i[0].audioCapabilities[0].encryptionScheme)),h.return(new jE(f,p,m))})}function BE(e,t){return e&&e.filter(function(e){return PE(e.encryptionScheme,t)})}OE.EmeEncryptionScheme=FE,FE.install=LE,kE(LE);function VE(){}var HE;function UE(){we().Kf()&&!HE&&!navigator.mediaCapabilitiesEncryptionSchemePolyfilled&&navigator.mediaCapabilities&&(HE=navigator.mediaCapabilities.decodingInfo,navigator.mediaCapabilities.decodingInfo=WE,navigator.mediaCapabilitiesEncryptionSchemePolyfilled=!0)}function WE(e){var t=this,n,r;return k(function(i){switch(i.h){case 1:return i.g(HE.call(t,e),2);case 2:if(n=i.i,!n.supported||!e.keySystemConfiguration)return i.return(n);if(r=n.keySystemAccess,NE(r))return navigator.mediaCapabilities.decodingInfo=HE,i.return(n);if(navigator.mediaCapabilities.decodingInfo=GE,r){i.A(3);break}return i.g(KE(e),4);case 4:return n.keySystemAccess=i.i,i.return(n);case 3:return i.return(GE.call(t,e))}})}function GE(e){var t=this,n,r,i,a,o,s,c;return k(function(l){switch(l.h){case 1:return r=n=null,!e.keySystemConfiguration||(i=e.keySystemConfiguration,a=i.keySystem,r=i.audio&&i.audio.encryptionScheme,n=i.video&&i.video.encryptionScheme,o=ME(a),s={powerEfficient:!1,smooth:!1,supported:!1,keySystemAccess:null,configuration:e},PE(r,o)&&PE(n,o))?l.g(HE.call(t,e),2):l.return(s);case 2:if(c=l.i,c.keySystemAccess){c.keySystemAccess=new jE(c.keySystemAccess,n,r),l.A(3);break}if(!e.keySystemConfiguration){l.A(3);break}return l.g(KE(e),5);case 5:c.keySystemAccess=l.i;case 3:return l.return(c)}})}function KE(e){var t,n;return k(function(r){if(r.h==1){var i=e.keySystemConfiguration,a=[],o=[];return i.audio&&a.push({robustness:i.audio.robustness||``,contentType:e.audio.contentType,encryptionScheme:i.audio.encryptionScheme}),i.video&&o.push({robustness:i.video.robustness||``,contentType:e.video.contentType,encryptionScheme:i.video.encryptionScheme}),i={initDataTypes:i.initDataType?[i.initDataType]:[],distinctiveIdentifier:i.distinctiveIdentifier,persistentState:i.persistentState,sessionTypes:i.sessionTypes},a.length&&(i.audioCapabilities=a),o.length&&(i.videoCapabilities=o),t=i,r.g(navigator.requestMediaKeySystemAccess(e.keySystemConfiguration.keySystem,[t]),2)}return n=r.i,r.return(n)})}OE.MCapEncryptionScheme=VE,VE.install=UE,kE(UE,-2);function qE(){}function JE(){we().dc()||(navigator.mediaCapabilities||(navigator.mediaCapabilities={}),qE.originalMcap=navigator.mediaCapabilities,navigator.mediaCapabilities.decodingInfo=YE)}function YE(e){var t,n,r,i,a,o,s,c,l,u,d;return k(function(f){switch(f.h){case 1:if(t={supported:!1,powerEfficient:!0,smooth:!0,keySystemAccess:null,configuration:e},we(),n=e.video,r=e.audio,e.type!=`media-source`){if(e.type==`file`){if(n&&(i=n.contentType,a=cc().canPlayType(i)!=``,!a)||r&&(o=r.contentType,s=cc().canPlayType(o)!=``,!s))return f.return(t)}else return f.return(t);f.A(2);break}if(!$x())return f.return(t);if(!n){f.A(3);break}return f.g(XE(n),4);case 4:if(c=f.i,!c)return f.return(t);case 3:if(!r){f.A(2);break}return f.g(ZE(r),6);case 6:if(l=f.i,!l)return f.return(t);case 2:return e.keySystemConfiguration?(u=e.keySystemConfiguration,f.g(QE(n,r,u),8)):(t.supported=!0,f.return(t));case 8:(d=f.i)&&(t.supported=!0,t.keySystemAccess=d);case 7:return f.return(t)}})}function XE(e){var t,n,r;return k(function(i){return i.h==1?(t=we(),n=t.Qa(),n===`CAST`?i.g($E(e),3):i.A(2)):i.h==2?i.return(Qo(e.contentType)):(r=i.i,i.return(r))})}function ZE(t){var n,r,i,a,o;return k(function(s){switch(s.h){case 1:if(n=we(),r=n.Qa(),i=t.contentType,r!==`CAST`||!t.spatialRendering||(i+=`; spatialRendering=true`,!(e.cast&&cast.__platform__&&cast.__platform__.canDisplayType))){s.A(2);break}if(a=!1,o=eD,o.has(i)){a=o.get(i),s.A(4);break}return s.g(cast.__platform__.canDisplayType(i),5);case 5:a=s.i,o.set(i,a);case 4:return s.return(a);case 2:return s.return(Qo(i))}})}function QE(e,t,n){var r,i,a,o,s,c,l,u,d,f,p,m;return k(function(h){switch(h.h){case 1:r=[],i=[],a=[],n.audio&&(o={robustness:n.audio.robustness||``,contentType:t.contentType},we().xi()&&t.contentType.includes(`codecs="ac-3"`)&&(o.contentType=`audio/mp4; codecs="ec-3"`),n.audio.encryptionScheme&&(o.encryptionScheme=n.audio.encryptionScheme,a.push(n.audio.encryptionScheme)),r.push(o)),n.video&&(s={robustness:n.video.robustness||``,contentType:e.contentType},n.video.encryptionScheme&&(s.encryptionScheme=n.video.encryptionScheme,a.push(n.video.encryptionScheme)),i.push(s)),c={initDataTypes:[n.initDataType],distinctiveIdentifier:n.distinctiveIdentifier,persistentState:n.persistentState,sessionTypes:n.sessionTypes},r.length&&(c.audioCapabilities=r),i.length&&(c.videoCapabilities=i),l=e?e.contentType:``,u=t?t.contentType:``,d=Fr(l)+`;`+Pr(l),f=Fr(u)+`;`+Pr(u),p=n.keySystem,m=null,h.m(2);var g=ct(d,f,p,a);if(ut.has(g)){g=ct(d,f,p,a),m=ut.get(g)||null,h.A(4);break}return h.g(navigator.requestMediaKeySystemAccess(n.keySystem,[c]),5);case 5:g=m=h.i;var _=ct(d,f,p,a);ut.set(_,g);case 4:h.o(3);break;case 2:h.l();case 3:return h.return(m)}})}function $E(t){var n,r,i,a,o;return k(function(s){if(s.h==1){if(!(e.cast&&cast.__platform__&&cast.__platform__.canDisplayType))return s.return(Qo(t.contentType));switch(n=t.contentType,t.width&&t.height&&t.width>1280&&t.height>720&&(n+=`; width=`+t.width+`; height=`+t.height),t.framerate&&(r=Math.round(t.framerate),r<24||r>30)&&(n+=`; framerate=`+t.framerate),i=t.transferFunction||``,i){case``:case`srgb`:break;case`pq`:n+=`; eotf=smpte2084`;break;case`hlg`:n+=`; eotf=arib-std-b67`;break;default:return s.return(!1)}return a=!1,o=eD,o.has(n)?(a=o.get(n),s.A(2)):s.g(cast.__platform__.canDisplayType(n),3)}return s.h!=2&&(a=s.i,o.set(n,a)),s.return(a)})}OE.MediaCapabilities=qE,qE.install=JE,qE.originalMcap=null;var eD=/* @__PURE__ */ new Map;kE(JE,-1);function tD(){}function nD(){var t=we(),n=t.Ia()===`WEBKIT`?t.Da():null;for((e.MediaSource||e.ManagedMediaSource)&&n&&e.MediaSource&&(n<=12?(rD(),iD()):n<=15&&rD()),t=g(t.Hi()),n=t.next();!n.done;n=t.next())oD(n.value);(e.MediaSource||e.ManagedMediaSource)&&aD(),e.MediaSource&&MediaSource.isTypeSupported(`video/webm; codecs="vp9"`)&&!MediaSource.isTypeSupported(`video/webm; codecs="vp09.00.10.08"`)&&sD()}function rD(){var e=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(){var t=e.apply(this,A.apply(0,arguments));return t.abort=function(){},t}}function iD(){var e=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(t,n){return e.call(this,t,n-.001)}}function aD(){if(e.MediaSource){var t=MediaSource.isTypeSupported.bind(MediaSource);MediaSource.isTypeSupported=function(e){return Mr(e)!=`mp2t`&&t(e)}}if(e.ManagedMediaSource){var n=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);e.ManagedMediaSource.isTypeSupported=function(e){return Mr(e)!=`mp2t`&&n(e)}}}function oD(t){var n=MediaSource.isTypeSupported.bind(MediaSource);if(MediaSource.isTypeSupported=function(e){return Pr(e)!=t&&n(e)},e.ManagedMediaSource){var r=ManagedMediaSource.isTypeSupported.bind(ManagedMediaSource);e.ManagedMediaSource.isTypeSupported=function(e){return Pr(e)!=t&&r(e)}}}function sD(){var e=MediaSource.isTypeSupported;we().cj()&&(MediaSource.isTypeSupported=function(t){var n=t.split(/ *; */),r=n.findIndex(function(e){return e.startsWith(`codecs=`)});if(r<0)return e(t);var i=n[r].replace(`codecs=`,``).replace(/"/g,``).split(/\s*,\s*/),a=i.findIndex(function(e){return e.startsWith(`vp09`)});return a>=0&&(i[a]=`vp9`,n[r]=`codecs="`+i.join(`,`)+`"`,t=n.join(`; `)),e(t)})}OE.MediaSource=tD,tD.install=nD,kE(nD);function cD(){}var lD,uD,dD,fD,pD,mD;function hD(t){e.HTMLVideoElement&&e.WebKitMediaKeys&&e.shakaMediaKeysPolyfill!=TD&&(t!==void 0&&t&&(lD=!0,uD=Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,`mediaKeys`),dD=HTMLMediaElement.prototype.setMediaKeys,fD=e.MediaKeys,pD=e.MediaKeySystemAccess,mD=navigator.requestMediaKeySystemAccess),delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=_D,e.MediaKeys=bD,e.MediaKeySystemAccess=yD,navigator.requestMediaKeySystemAccess=gD,e.shakaMediaKeysPolyfill=TD,Ji.clear(),ut.clear())}function gD(e,t){try{var n=new yD(e,t);return Promise.resolve(n)}catch(e){return Promise.reject(e)}}function _D(e){var t=this.mediaKeys;return t&&t!=e&&xD(t,null),delete this.mediaKeys,(this.mediaKeys=e)?xD(e,this):Promise.resolve()}function vD(e){if(e=Ze(e.initData),$e(e).getUint32(0,!0)+4!=e.byteLength)throw RangeError(`Malformed FairPlay init data`);e=mt(e.subarray(4),!0),e=gt(e);var t=new Event(`encrypted`);t.initDataType=`skd`,t.initData=Xe(e),this.dispatchEvent(t)}OE.PatchedMediaKeysApple=cD,cD.uninstall=function(){e.shakaMediaKeysPolyfill==TD&&lD&&(lD=!1,Object.defineProperty(HTMLMediaElement.prototype,"mediaKeys",uD),HTMLMediaElement.prototype.setMediaKeys=dD,e.MediaKeys=fD,e.MediaKeySystemAccess=pD,navigator.requestMediaKeySystemAccess=mD,uD=mD=dD=pD=fD=null,e.shakaMediaKeysPolyfill=``,Ji.clear(),ut.clear())},cD.install=hD;function yD(e,t){if(this.keySystem=e,e.startsWith(`com.apple.fps`))for(e=g(t),t=e.next();!t.done;t=e.next()){var n=t.value;if(n.persistentState==`required`)t=null;else{t={audioCapabilities:[],videoCapabilities:[],persistentState:`optional`,distinctiveIdentifier:`optional`,initDataTypes:n.initDataTypes,sessionTypes:[`temporary`],label:n.label};var r=!1,i=!1;if(n.audioCapabilities)for(var a=g(n.audioCapabilities),o=a.next();!o.done;o=a.next())o=o.value,o.contentType&&(r=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,o.contentType.split(`;`)[0])&&(t.audioCapabilities.push(o),i=!0));if(n.videoCapabilities)for(n=g(n.videoCapabilities),a=n.next();!a.done;a=n.next())a=a.value,a.contentType&&(r=!0,WebKitMediaKeys.isTypeSupported(this.keySystem,a.contentType.split(`;`)[0])&&(t.videoCapabilities.push(a),i=!0));r||(i=WebKitMediaKeys.isTypeSupported(this.keySystem,`video/mp4`)),t=i?t:null}if(t){this.g=t;return}}throw e=Error(`Unsupported keySystem`),e.name=`NotSupportedError`,e.code=DOMException.NOT_SUPPORTED_ERR,e}yD.prototype.createMediaKeys=function(){var e=new bD(this.keySystem);return Promise.resolve(e)},yD.prototype.getConfiguration=function(){return this.g};function bD(e){this.h=new WebKitMediaKeys(e),this.g=new I}bD.prototype.createSession=function(e){if(e=e||`temporary`,e!=`temporary`)throw TypeError(`Session type `+e+` is unsupported on this platform.`);return new SD(this.h,e)},bD.prototype.setServerCertificate=function(){return Promise.resolve(!1)};function xD(e,t){if(e.g.Sa(),!t)return Promise.resolve();e.g.F(t,`webkitneedkey`,vD);try{return ql(t,HTMLMediaElement.HAVE_METADATA,e.g,function(){t.webkitSetMediaKeys(e.h)}),Promise.resolve()}catch(e){return Promise.reject(e)}}bD.prototype.getStatusForPolicy=function(){return Promise.resolve(`usable`)};function SD(e){ga.call(this),this.i=null,this.l=e,this.g=this.h=null,this.j=new I,this.sessionId=``,this.expiration=NaN,this.closed=new oa,this.keyStatuses=new wD,this.onkeystatuseschange=null}m(SD,ga),r=SD.prototype,r.generateRequest=function(e,t){var n=this;this.h=new oa;try{var r=this.l.createSession(`video/mp4`,Ze(t));this.i=r,this.sessionId=r.sessionId||``,this.j.F(this.i,`webkitkeymessage`,function(e){n.h&&(n.h.resolve(),n.h=null),e=(/* @__PURE__ */ new Map()).set(`messageType`,n.keyStatuses.Wb()==null?`license-request`:`license-renewal`).set(`message`,Xe(e.message)),e=new V(`message`,e),n.dispatchEvent(e)}),this.j.F(r,`webkitkeyadded`,function(){n.g&&(CD(n,`usable`),n.g.resolve(),n.g=null)}),this.j.F(r,`webkitkeyerror`,function(){var e=Error(`EME PatchedMediaKeysApple key error`);if(e.errorCode=n.i.error,n.h!=null)n.h.reject(e),n.h=null;else if(n.g!=null)n.g.reject(e),n.g=null;else switch(n.i.error.code){case WebKitMediaKeyError.MEDIA_KEYERR_OUTPUT:case WebKitMediaKeyError.MEDIA_KEYERR_HARDWARECHANGE:CD(n,`output-not-allowed`);break;default:CD(n,`internal-error`)}}),CD(this,`status-pending`)}catch(e){this.h.reject(e)}return this.h},r.load=function(){return Promise.reject(Error(`MediaKeySession.load not yet supported`))},r.update=function(e){this.g=new oa;try{this.i.update(Ze(e))}catch(e){this.g.reject(e)}return this.g},r.close=function(){try{this.i.close(),this.closed.resolve(),this.j.Sa()}catch(e){this.closed.reject(e)}return this.closed},r.remove=function(){return Promise.reject(Error(`MediaKeySession.remove is only applicable for persistent licenses, which are not supported on this platform`))};function CD(e,t){var n=e.keyStatuses;n.size=t==null?0:1,n.g=t,t=new V(`keystatuseschange`),e.dispatchEvent(t),e.onkeystatuseschange&&e.onkeystatuseschange(t)}function wD(){this.size=0,this.g=void 0}r=wD.prototype,r.Wb=function(){return this.g},r.forEach=function(e){this.g&&e(this.g,lt.value())},r.get=function(e){if(this.has(e))return this.g},r.has=function(e){var t=lt.value();return!!(this.g&&Ye(e,t))},r.entries=function(){},r.keys=function(){},r.values=function(){};var TD=`apple`;kE(function(){e.HTMLVideoElement&&e.WebKitMediaKeys&&(navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration||hD())});function ED(){}function DD(){if(e.MediaKeys){var t=we();MediaKeys.prototype.setServerCertificate&&t.pe()||(MediaKeys.prototype.setServerCertificate=OD)}}function OD(){return Promise.resolve(!1)}OE.PatchedMediaKeysCert=ED,ED.install=DD,kE(DD);function kD(){}function AD(){if(!(!e.HTMLVideoElement||navigator.requestMediaKeySystemAccess&&MediaKeySystemAccess.prototype.getConfiguration)){if(HTMLMediaElement.prototype.webkitGenerateKeyRequest)UD=`webkit`;else if(!HTMLMediaElement.prototype.generateKeyRequest)return;navigator.requestMediaKeySystemAccess=MD,delete HTMLMediaElement.prototype.mediaKeys,HTMLMediaElement.prototype.mediaKeys=null,HTMLMediaElement.prototype.setMediaKeys=ND,e.MediaKeys=FD,e.MediaKeySystemAccess=PD,e.shakaMediaKeysPolyfill=WD}}function jD(e){var t=UD;return t?t+e.charAt(0).toUpperCase()+e.slice(1):e}function MD(e,t){try{var n=new PD(e,t);return Promise.resolve(n)}catch(e){return Promise.reject(e)}}function ND(e){var t=this.mediaKeys;return t&&t!=e&&ID(t,null),delete this.mediaKeys,(this.mediaKeys=e)&&ID(e,this),Promise.resolve()}OE.PatchedMediaKeysWebkit=kD,kD.install=AD;function PD(e,t){this.g=this.keySystem=e;var n=!1;e==`org.w3.clearkey`&&(this.g=`webkit-org.w3.clearkey`,n=!1);var r=!1,i=document.getElementsByTagName(`video`);i=i.length?i[0]:document.createElement(`video`),t=g(t);for(var a=t.next();!a.done;a=t.next()){a=a.value;var o={audioCapabilities:[],videoCapabilities:[],persistentState:`optional`,distinctiveIdentifier:`optional`,initDataTypes:a.initDataTypes,sessionTypes:[`temporary`],label:a.label},s=!1;if(a.audioCapabilities)for(var c=g(a.audioCapabilities),l=c.next();!l.done;l=c.next())l=l.value,l.contentType&&(s=!0,i.canPlayType(l.contentType.split(`;`)[0],this.g)&&(o.audioCapabilities.push(l),r=!0));if(a.videoCapabilities)for(c=g(a.videoCapabilities),l=c.next();!l.done;l=c.next())l=l.value,l.contentType&&(s=!0,i.canPlayType(l.contentType,this.g)&&(o.videoCapabilities.push(l),r=!0));if(s||(r=i.canPlayType(`video/mp4`,this.g)||i.canPlayType(`video/webm`,this.g)),a.persistentState==`required`&&(n?(o.persistentState=`required`,o.sessionTypes=[`persistent-license`]):r=!1),r){this.h=o;return}}throw n=`Unsupported keySystem`,(e==`org.w3.clearkey`||e==`com.widevine.alpha`)&&(n=`None of the requested configurations were supported.`),e=Error(n),e.name=`NotSupportedError`,e.code=DOMException.NOT_SUPPORTED_ERR,e}PD.prototype.createMediaKeys=function(){var e=new FD(this.g);return Promise.resolve(e)},PD.prototype.getConfiguration=function(){return this.h};function FD(e){this.l=e,this.h=null,this.g=new I,this.i=[],this.j=/* @__PURE__ */ new Map}function ID(e,t){e.h=t,e.g.Sa();var n=UD;t&&(e.g.F(t,n+`needkey`,function(t){var n=new CustomEvent(`encrypted`);n.initDataType=`cenc`,n.initData=Xe(t.initData),e.h.dispatchEvent(n)}),e.g.F(t,n+`keymessage`,function(t){var n=LD(e,t.sessionId);n&&(t=(/* @__PURE__ */ new Map()).set(`messageType`,n.keyStatuses.Wb()==null?`licenserequest`:`licenserenewal`).set(`message`,t.message),t=new V(`message`,t),n.h&&(n.h.resolve(),n.h=null),n.dispatchEvent(t))}),e.g.F(t,n+`keyadded`,function(t){(t=LD(e,t.sessionId))&&t.ready()}),e.g.F(t,n+`keyerror`,function(t){var n=LD(e,t.sessionId);if(n){var r=Error(`EME v0.1b key error`),i=t.errorCode;i.systemCode=t.systemCode,r.errorCode=i,!t.sessionId&&n.h?(t.systemCode==45&&(r.message=`Unsupported session type.`),n.h.reject(r),n.h=null):t.sessionId&&n.g?(n.g.reject(r),n.g=null):(r=t.systemCode,t.errorCode.code==MediaKeyError.MEDIA_KEYERR_OUTPUT?VD(n,`output-restricted`):r==1?VD(n,`expired`):VD(n,`internal-error`))}}))}FD.prototype.createSession=function(e){if(e=e||`temporary`,e!=`temporary`&&e!=`persistent-license`)throw TypeError(`Session type `+e+` is unsupported on this platform.`);var t=this.h||document.createElement(`video`);return t.src||(t.src=`about:blank`),e=new RD(t,this.l,e),this.i.push(e),e},FD.prototype.setServerCertificate=function(){return Promise.resolve(!1)},FD.prototype.getStatusForPolicy=function(){return Promise.resolve(`usable`)};function LD(e,t){var n=e.j.get(t);return n||((n=e.i.shift())?(n.sessionId=t,e.j.set(t,n),n):null)}function RD(e,t,n){ga.call(this),this.j=e,this.m=!1,this.g=this.h=null,this.i=t,this.l=n,this.sessionId=``,this.expiration=NaN,this.closed=new oa,this.keyStatuses=new HD,this.onkeystatuseschange=null}m(RD,ga),r=RD.prototype,r.ready=function(){VD(this,`usable`),this.g&&this.g.resolve(),this.g=null};function zD(e,t,n){if(e.m)return Promise.reject(Error(`The session is already initialized.`));e.m=!0;try{if(e.l==`persistent-license`){if(n)var r=Ze(gt(`LOAD_SESSION|`+n));else r=z(gt(`PERSISTENT|`),t)}else r=Ze(t)}catch(e){return Promise.reject(e)}e.h=new oa;var i=jD(`generateKeyRequest`);try{e.j[i](e.i,r)}catch(t){if(t.name!=`InvalidStateError`)return e.h=null,Promise.reject(t);new Qr(function(){try{e.j[i](e.i,r)}catch(t){e.h.reject(t),e.h=null}}).na(.01)}return e.h}function BD(e,t,n){if(e.g)e.g.then(function(){return BD(e,t,n)}).catch(function(){return BD(e,t,n)});else{if(e.g=t,e.i==`webkit-org.w3.clearkey`){var r=pt(n),i=JSON.parse(r);i.keys[0].kty!=`oct`&&(e.g.reject(Error(`Response is not a valid JSON Web Key Set.`)),e.g=null),r=Ct(i.keys[0].k),i=Ct(i.keys[0].kid)}else r=Ze(n),i=null;var a=jD(`addKey`);try{e.j[a](e.i,r,i,e.sessionId)}catch(t){e.g.reject(t),e.g=null}}}function VD(e,t){var n=e.keyStatuses;n.size=t==null?0:1,n.g=t,t=new V(`keystatuseschange`),e.dispatchEvent(t),e.onkeystatuseschange&&e.onkeystatuseschange(t)}r.generateRequest=function(e,t){return zD(this,t,null)},r.load=function(e){return this.l==`persistent-license`?zD(this,null,e):Promise.reject(Error(`Not a persistent session.`))},r.update=function(e){var t=new oa;return BD(this,t,e),t},r.close=function(){if(this.l!=`persistent-license`){if(!this.sessionId)return this.closed.reject(Error(`The session is not callable.`)),this.closed;var e=jD(`cancelKeyRequest`);try{this.j[e](this.i,this.sessionId)}catch{}}return this.closed.resolve(),this.closed},r.remove=function(){return this.l==`persistent-license`?this.close():Promise.reject(Error(`Not a persistent session.`))};function HD(){this.size=0,this.g=void 0}r=HD.prototype,r.Wb=function(){return this.g},r.forEach=function(e){this.g&&e(this.g,lt.value())},r.get=function(e){if(this.has(e))return this.g},r.has=function(e){var t=lt.value();return!!(this.g&&Ye(e,t))},r.entries=function(){},r.keys=function(){},r.values=function(){};var UD=``,WD=`webkit`;kE(AD);function GD(){}function KD(){e.crypto&&(`randomUUID`in e.crypto||(e.crypto.randomUUID=qD))}function qD(){var e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.substr(t.lastIndexOf(`/`)+1)}OE.RandomUUID=GD,GD.install=KD,kE(KD);function JD(){}function YD(){var e=Symbol.prototype;`description`in e||Object.defineProperty(e,"description",{get:XD})}function XD(){var e=/\((.*)\)/.exec(this.toString());return e?e[1]:void 0}OE.Symbol=JD,JD.install=YD,kE(YD);function ZD(){}function QD(){for(var e=g([Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,Int8Array,Int16Array,Int32Array,Float32Array,Float64Array]),t=e.next();!t.done;t=e.next()){t=t.value;var n=void 0;(n=t.prototype).indexOf??(n.indexOf=Array.prototype.indexOf),n=void 0,(n=t.prototype).lastIndexOf??(n.lastIndexOf=Array.prototype.lastIndexOf),n=void 0,(n=t.prototype).includes??(n.includes=Array.prototype.includes)}}OE.TypedArray=ZD,ZD.install=QD,kE(QD);function $D(){}function eO(){if(e.HTMLMediaElement){var t=HTMLMediaElement.prototype.play;HTMLMediaElement.prototype.play=function(){var e=t.apply(this);return e&&e.catch(function(){}),e}}}OE.VideoPlayPromise=$D,$D.install=eO,kE(eO);function tO(){}function nO(){if(e.HTMLVideoElement){var t=HTMLVideoElement.prototype;!t.getVideoPlaybackQuality&&(`webkitDroppedFrameCount`in t||typeof cc().webkitDroppedFrameCount==`number`)&&(t.getVideoPlaybackQuality=rO)}}function rO(){return{droppedVideoFrames:this.webkitDroppedFrameCount,totalVideoFrames:this.webkitDecodedFrameCount,corruptedVideoFrames:0,creationTime:NaN,totalFrameDelay:0}}OE.VideoPlaybackQuality=tO,tO.install=nO,kE(nO);function iO(){}function aO(){if(!e.VTTCue&&e.TextTrackCue){var t=null,n=TextTrackCue.length;if(n==3)t=oO;else if(n==6)t=sO;else{try{var r=!!oO(1,2,``)}catch{r=!1}r&&(t=oO)}t&&(e.VTTCue=function(e,n,r){return t(e,n,r)})}}function oO(t,n,r){return new e.TextTrackCue(t,n,r)}function sO(t,n,r){return new e.TextTrackCue(t+`-`+n+`-`+r,t,n,r)}OE.VTTCue=iO,iO.install=aO,kE(aO);function cO(e){ga.call(this),this.g=e,this.m=null,this.h=[],this.j=-1,this.i=this.l=null,this.o=new I}m(cO,ga),r=cO.prototype,r.destroy=function(){var e=this;return k(function(t){if(t.h==1)return t.g(e.removeAllItems(),2);e.g=null,e.o&&(e.o.release(),e.o=null),ga.prototype.release.call(e),t.j()})},r.configure=function(e){this.m=e},r.getConfiguration=function(){return this.m},r.getCurrentItem=function(){return this.h.length&&this.j>=0&&this.j<this.h.length?this.h[this.j]:null},r.getCurrentItemIndex=function(){return this.j},r.getItems=function(){return this.h.slice()},r.insertItems=function(e){this.h.push.apply(this.h,_(e)),this.dispatchEvent(new V(`itemsinserted`))},r.removeAllItems=function(){var e=this,t,n,r,i;return k(function(a){if(a.h==1)return e.o.Sa(),e.h.length&&e.j>=0?a.g(e.g.yc(),2):a.A(2);if(a.h!=4){for(t=[],e.i&&(e.i.preloadManager.l||t.push(e.i.preloadManager.destroy()),e.i=null),e.l&&(e.l.preloadManager.l||t.push(e.l.preloadManager.destroy()),e.l=null),n=g(e.h),r=n.next();!r.done;r=n.next())i=r.value,i.preloadManager&&!i.preloadManager.l&&t.push(i.preloadManager.destroy());return t.length?a.g(Promise.all(t),4):a.A(4)}e.h=[],e.j=-1,e.dispatchEvent(new V(`itemsremoved`)),a.j()})},r.playItem=function(e){var t=this,n,r,i,a,o,s,c,l,u,d,f,p,m,h,_,v,y;return k(function(b){switch(b.h){case 1:if(t.o.Sa(),!t.h.length||e>=t.h.length)throw new R(2,7,7007);if(n=t.getCurrentItem(),r=t.h[e],t.j!=e&&(t.j=e,t.dispatchEvent(new V(`currentitemchanged`))),i=t.g.Xe(),a=t.m?t.m.preloadNextUrlWindow:0,a>0&&(o=!1,t.o.F(i,`timeupdate`,function(){var e,n,r,s;return k(function(c){switch(c.h){case 1:if(t.l||t.h.length<=1||o||t.g.T()||!i.duration)return c.return();if(e=t.g.Na().end-i.currentTime,isNaN(e)||!(e<=a)||(n=t.m&&t.m.repeatMode,r=null,t.j+1<t.h.length?r=t.h[t.j+1]:n==1&&(r=t.h[0]),!r||r.preloadManager&&!r.preloadManager.l)){c.A(0);break}return o=!0,s=null,c.m(5),c.g(t.g.preload(r.manifestUri,r.startTime,r.mimeType,r.config),7);case 7:s=c.i,c.o(6);break;case 5:c.l(),s=null;case 6:t.l={item:r,preloadManager:s},o=!1,c.j()}})})),t.o.F(t.g,`complete`,function(){var e=t.m&&t.m.repeatMode,n=!1;if(e==2)n=!0;else{var r=t.j+1;r<t.h.length?t.playItem(r):e==1&&(t.h.length==1?n=!0:t.playItem(0))}n&&(i.paused?(i.currentTime=t.g.Na().start,i.play()):t.o.F(i,`paused`,function(){i.currentTime=t.g.Na().start,i.play()}))}),s=r.manifestUri,r.preloadManager&&!r.preloadManager.l&&(s=r.preloadManager),c=!1,t.l&&t.l.item==r&&t.l.preloadManager?s=t.l.preloadManager:t.i&&t.i.item==r&&t.i.preloadManager&&(s=t.i.preloadManager,c=!0),!t.i){b.A(2);break}if(c||t.i.preloadManager.l){b.A(3);break}return b.g(t.i.preloadManager.destroy(),3);case 3:t.i=null;case 2:if(!(t.m&&t.m.preloadPrevItem&&n&&t.g.Vd()===ug)){b.A(5);break}return l=null,b.m(6),b.g(t.g.hj(),8);case 8:l=b.i,b.o(7);break;case 6:b.l(),l=null;case 7:t.i={item:n,preloadManager:l};case 5:return r.config&&(t.g.Ki(),t.g.configure(r.config)),b.g(t.g.load(s,r.startTime,r.mimeType),9);case 9:if(t.l=null,r.extraText)for(u=g(r.extraText),d=u.next();!d.done;d=u.next())f=d.value,f.mime?t.g.Md(f.uri,f.language,f.kind,f.mime,f.codecs):t.g.Md(f.uri,f.language,f.kind);if(r.extraThumbnail)for(p=g(r.extraThumbnail),m=p.next();!m.done;m=p.next())h=m.value,t.g.Je(h);if(r.extraChapter)for(_=g(r.extraChapter),v=_.next();!v.done;v=_.next())y=v.value,t.g.Ie(y.uri,y.language,y.mime);b.j()}})},P(`shaka.queue.QueueManager`,cO),cO.prototype.playItem=cO.prototype.playItem,cO.prototype.removeAllItems=cO.prototype.removeAllItems,cO.prototype.insertItems=cO.prototype.insertItems,cO.prototype.getItems=cO.prototype.getItems,cO.prototype.getCurrentItemIndex=cO.prototype.getCurrentItemIndex,cO.prototype.getCurrentItem=cO.prototype.getCurrentItem,cO.prototype.getConfiguration=cO.prototype.getConfiguration,cO.prototype.configure=cO.prototype.configure,cO.prototype.destroy=cO.prototype.destroy,hg=function(e){return new cO(e)};function lO(){}lO.prototype.parseInit=function(){},lO.prototype.setSequenceMode=function(){},lO.prototype.setManifestType=function(){},lO.prototype.parseMedia=function(e,t){var n=null,r=[];e=pt(e).split(/\r?\n/),e=g(e);for(var i=e.next();!i.done;i=e.next())if((i=i.value)&&!/^\s+$/.test(i)&&(i=uO.exec(i))){var a=dO.exec(i[1]);a=parseInt(a[1],10)*60+parseFloat(a[2].replace(`,`,`.`)),i=new qn(a,t.segmentEnd?t.segmentEnd:a+2,i[2]),n&&(n.endTime=a,r.push(n)),n=i}return n&&r.push(n),r},P(`shaka.text.LrcTextParser`,lO),lO.prototype.parseMedia=lO.prototype.parseMedia,lO.prototype.setManifestType=lO.prototype.setManifestType,lO.prototype.setSequenceMode=lO.prototype.setSequenceMode,lO.prototype.parseInit=lO.prototype.parseInit;var uO=/^\[(\d{1,2}:\d{1,2}(?:[.,]\d{1,3})?)\](.*)/,dO=/^(\d+):(\d{1,2}(?:[.,]\d{1,3})?)$/;Vr(`application/x-subtitle-lrc`,function(){return new lO});function fO(){this.g=`UNKNOWN`}fO.prototype.parseInit=function(){},fO.prototype.setSequenceMode=function(){},fO.prototype.setManifestType=function(e){this.g=e},fO.prototype.parseMedia=function(e,t,n,r){var i=pt(e);if(e=[],i==``)return e;var a=gn(i,`tt`,!0);if(!a)throw new R(2,2,2005,`Failed to parse TTML.`);if(i=wn(a,`body`)[0],!i)return[];var o=kn(a,VO,`frameRate`),s=kn(a,VO,`subFrameRate`),c=kn(a,VO,`frameRateMultiplier`),l=kn(a,VO,`tickRate`),u=kn(a,VO,`cellResolution`),d=a.attributes[`xml:space`]||`default`,f=kn(a,HO,`extent`);if(d!="default"&&d!=`preserve`)throw new R(2,2,2005,`Invalid xml:space value: `+d);d=d=="default",o=new OO(o,s,c,l),u=DO(u),s=wn(a,`metadata`)[0],s=(s?s.children:[]).filter(function(e){return e!=`
|
|
18
|
+
`}),c=wn(a,`style`),a=wn(a,`region`),l=[];for(var p=g(a),m=p.next();!m.done;m=p.next())(m=mO(this,m.value,c,f))&&l.push(m);if(xn(i,`p`).length)throw new R(2,2,2001,`<p> can only be inside <div> in TTML`);for(f=g(xn(i,`div`)),p=f.next();!p.done;p=f.next())if(xn(p.value,`span`).length)throw new R(2,2,2001,`<span> can only be inside <p> in TTML`);return(t=pO(this,i,t,o,s,c,a,l,d,u,null,!1,n,r))&&(t.backgroundColor||(t.backgroundColor=`transparent`),e.push(t)),e};function pO(e,t,n,r,i,a,o,s,c,l,u,d,f,p){var m=u;if(yn(t)){if(!d)return null;var h={tagName:`span`,children:[Sn(t)],attributes:{},parent:null}}else h=t;for(var _=null,v=g(UO),y=v.next();!y.done&&!(_=SO(h,`backgroundImage`,i,`#`,y.value)[0]);y=v.next());v=null,y=kn(h,UO,`backgroundImage`);var b=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/;if(y&&b.test(y)){if(v=parseInt(y.split(`:`).pop(),10)-1,v>=p.length)return null;v=p[v]}else f&&y&&!y.startsWith(`#`)&&(b=new Ne(f),y=new Ne(y),(y=b.resolve(y).toString())&&(v=y));if((t.tagName==`p`||_||v)&&(d=!0),t=d,y=(h.attributes[`xml:space`]||(c?`default`:`preserve`))=="default",b=h.children.every(yn),c=[],!b)for(var x=g(h.children),S=x.next();!S.done;S=x.next())(S=pO(e,S.value,n,r,i,a,o,s,y,l,h,d,f,p))&&c.push(S);if(i=u!=null,f=Sn(h),f=h.children.length&&f&&/\S/.test(f),x=h.attributes.begin||h.attributes.end||h.attributes.dur,!(x||f||h.tagName==`br`||c.length!=0||i&&!y))return null;for(p=wO(h,r),f=p.start,p=p.end;m&&m.tagName&&m.tagName!=`tt`;)p=CO(m,r,f,p),f=p.start,p=p.end,m=m.parent;if(f??(f=0),f+=n.periodStart,p=p==null?1/0:p+n.periodStart,e.g!==`HLS`&&(f=Math.max(f,n.segmentStart),p=Math.min(p,n.segmentEnd)),!x&&c.length>0)for(f=1/0,p=0,n=g(c),r=n.next();!r.done;r=n.next())r=r.value,f=Math.min(f,r.startTime),p=Math.max(p,r.endTime);if(h.tagName==`br`)return e=new qn(f,p,``),e.lineBreak=!0,e;if(n=``,b&&(n=vt(Sn(h)||``),y&&(n=n.replace(/\s+/g,` `))),n=new qn(f,p,n),n.nestedCues=c,d||(n.isContainer=!0),l&&(n.cellResolution=l),l=SO(h,`region`,o,``)[0],h.attributes.region&&l&&l.attributes[`xml:id`]){var C=l.attributes[`xml:id`];n.region=s.filter(function(e){return e.id==C})[0]}return s=l,u&&i&&!h.attributes.region&&!h.attributes.style&&(s=SO(u,`region`,o,``)[0]),gO(e,n,h,s,_,v,a,t,c.length==0),n}function mO(e,t,n,r){var i=new en,a=t.attributes[`xml:id`];if(!a)return null;i.id=a,a=null,r&&(a=kO.exec(r)||MO.exec(r)),r=a?Number(a[1]):null,a=a?Number(a[2]):null;var o,s=yO(e,t,n,`extent`);if(s){var c=(o=kO.exec(s))||MO.exec(s);c!=null&&(i.width=Number(c[1]),i.height=Number(c[2]),o||(r!=null&&(i.width=i.width*100/r),a!=null&&(i.height=i.height*100/a)),i.widthUnits=o||r!=null?tn:0,i.heightUnits=o||a!=null?tn:0)}return(e=yO(e,t,n,`origin`))&&(c=(o=kO.exec(e))||MO.exec(e),c!=null&&(i.viewportAnchorX=Number(c[1]),i.viewportAnchorY=Number(c[2]),o?s||(i.width=100-i.viewportAnchorX,i.widthUnits=tn,i.height=100-i.viewportAnchorY,i.heightUnits=tn):(a!=null&&(i.viewportAnchorY=i.viewportAnchorY*100/a),r!=null&&(i.viewportAnchorX=i.viewportAnchorX*100/r)),i.viewportAnchorUnits=o||r!=null?tn:0)),i}function hO(e){var t=e.match(/rgba\(([^)]+)\)/);return t&&(t=t[1].split(`,`),t.length==4)?(t[3]=String(Number(t[3])/255),`rgba(`+t.join(`,`)+`)`):e}function gO(e,t,n,r,i,a,o,s,c){if(s=s||c,vO(e,n,r,o,`direction`,s)==`rtl`&&(t.direction=`rtl`),c=vO(e,n,r,o,`writingMode`,s),c==`tb`||c==`tblr`?t.writingMode=`vertical-lr`:c==`tbrl`?t.writingMode=`vertical-rl`:c==`rltb`||c==`rl`?t.direction=`rtl`:c&&(t.direction=or),(c=vO(e,n,r,o,`textAlign`,!0))?(t.positionAlign=BO.get(c),t.lineAlign=zO.get(c),t.textAlign=rr[c.toUpperCase()]):t.textAlign=nr,(c=vO(e,n,r,o,`displayAlign`,!0))&&(t.displayAlign=ar[c.toUpperCase()]),(c=vO(e,n,r,o,`color`,s))&&(t.color=hO(c)),(c=vO(e,n,r,o,`backgroundColor`,s))&&(t.backgroundColor=hO(c)),(c=vO(e,n,r,o,`border`,s))&&(t.border=c),c=vO(e,n,r,o,`fontFamily`,s))switch(c){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=c.split(`,`).filter(function(e){return e!="default"}).join(`,`)}switch((c=vO(e,n,r,o,`fontWeight`,s))&&c==`bold`&&(t.fontWeight=mr),c=vO(e,n,r,o,`wrapOption`,s),t.wrapLine=!(c&&c==`noWrap`),(c=vO(e,n,r,o,`lineHeight`,s))&&c.match(jO)&&(t.lineHeight=c),(c=vO(e,n,r,o,`fontSize`,s))&&(c.match(jO)||c.match(AO))&&(t.fontSize=c),(c=vO(e,n,r,o,`fontStyle`,s))&&(t.fontStyle=_r[c.toUpperCase()]),i?(a=i.attributes.imageType||i.attributes.imagetype,c=i.attributes.encoding,i=Sn(i).trim(),a==`PNG`&&c==`Base64`&&i&&(t.backgroundImage=`data:image/png;base64,`+i)):a&&(t.backgroundImage=a),(i=vO(e,n,r,o,`textOutline`,s))&&(i=i.split(` `),i[0].match(jO)?t.textStrokeColor=t.color:(t.textStrokeColor=hO(i[0]),i.shift()),i[0]&&i[0].match(jO)?t.textStrokeWidth=i[0]:t.textStrokeColor=``),(i=vO(e,n,r,o,`letterSpacing`,s))&&i.match(jO)&&(t.letterSpacing=i),(i=vO(e,n,r,o,`linePadding`,s))&&i.match(jO)&&(t.linePadding=i),(i=vO(e,n,r,o,`opacity`,s))&&(t.opacity=parseFloat(i)),(i=yO(e,r,o,`textDecoration`))&&_O(t,i),(i=bO(e,n,o,`textDecoration`))&&_O(t,i),(i=vO(e,n,r,o,`textCombine`,s))&&(t.textCombineUpright=i),vO(e,n,r,o,`ruby`,s)){case`container`:t.rubyTag=`ruby`;break;case`text`:t.rubyTag=`rt`}}function _O(e,t){t=g(t.split(` `));for(var n=t.next();!n.done;n=t.next())switch(n.value){case`underline`:e.textDecoration.includes(vr)||e.textDecoration.push(vr);break;case`noUnderline`:e.textDecoration.includes(vr)&&pe(e.textDecoration,vr);break;case`lineThrough`:e.textDecoration.includes(`line-through`)||e.textDecoration.push(`line-through`);break;case`noLineThrough`:e.textDecoration.includes(`line-through`)&&pe(e.textDecoration,`line-through`);break;case`overline`:e.textDecoration.includes(`overline`)||e.textDecoration.push(`overline`);break;case`noOverline`:e.textDecoration.includes(`overline`)&&pe(e.textDecoration,`overline`)}}function vO(e,t,n,r,i,a){return a=a===void 0||a,(t=bO(e,t,r,i))?t:a?yO(e,n,r,i):null}function yO(e,t,n,r){return t?kn(t,HO,r)||xO(e,t,n,r):null}function bO(e,t,n,r){return kn(t,HO,r)||xO(e,t,n,r)}function xO(e,t,n,r){t=SO(t,`style`,n,``);for(var i=null,a=0;a<t.length;a++){var o=Dn(t[a],`urn:ebu:tt:style`,r);o||(o=kn(t[a],HO,r)),o||(o=bO(e,t[a],n,r)),o&&(i=o)}return i}function SO(e,t,n,r,i){var a=[];if(!e||n.length<1)return a;var o=e;for(e=null;!e&&!(e=i?Dn(o,i,t):o.attributes[t])&&(o=o.parent,o););if(t=e){for(t=g(t.split(` `)),i=t.next();!i.done;i=t.next())for(i=i.value,e=g(n),o=e.next();!o.done;o=e.next())if(o=o.value,r+o.attributes[`xml:id`]==i){a.push(o);break}}return a}function CO(e,t,n,r){return e=wO(e,t),n==null?n=e.start:e.start!=null&&(n+=e.start),r==null?r=e.end:e.start!=null&&(r+=e.start),{start:n,end:r}}function wO(e,t){var n=TO(e.attributes.begin,t),r=TO(e.attributes.end,t);return e=TO(e.attributes.dur,t),r==null&&e!=null&&(r=n+e),{start:n,end:r}}function TO(e,t){var n=null;if(NO.test(e)){e=NO.exec(e),n=Number(e[1]);var r=Number(e[2]),i=Number(e[3]),a=Number(e[4]);a+=(Number(e[5])||0)/t.h,i+=a/t.frameRate,n=i+r*60+n*3600}else if(PO.test(e))n=EO(PO,e);else if(FO.test(e))n=EO(FO,e);else if(IO.test(e))e=IO.exec(e),n=Number(e[1])/t.frameRate;else if(LO.test(e))e=LO.exec(e),n=Number(e[1])/t.g;else if(RO.test(e))n=EO(RO,e);else if(e)throw new R(2,2,2001,`Could not parse cue time range in TTML`);return n}function EO(e,t){return e=e.exec(t),e==null||e[0]==``?null:(Number(e[4])||0)/1e3+(Number(e[3])||0)+(Number(e[2])||0)*60+(Number(e[1])||0)*3600}function DO(e){return e&&(e=/^(\d+) (\d+)$/.exec(e))?{columns:parseInt(e[1],10),rows:parseInt(e[2],10)}:null}P(`shaka.text.TtmlTextParser`,fO),fO.prototype.parseMedia=fO.prototype.parseMedia,fO.prototype.setManifestType=fO.prototype.setManifestType,fO.prototype.setSequenceMode=fO.prototype.setSequenceMode,fO.prototype.parseInit=fO.prototype.parseInit;function OO(e,t,n,r){this.frameRate=Number(e)||30,this.h=Number(t)||1,this.g=Number(r),this.g==0&&(this.g=e?this.frameRate*this.h:1),n&&(e=/^(\d+) (\d+)$/g.exec(n))&&(this.frameRate*=Number(e[1])/Number(e[2]))}var kO=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,AO=/^(\d{1,4}(?:\.\d+)?|100)%$/,jO=/^(\d+px|\d+em|\d*\.?\d+c)$/,MO=/^(\d+)px (\d+)px$/,NO=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,PO=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,FO=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,IO=/^(\d*(?:\.\d*)?)f$/,LO=/^(\d*(?:\.\d*)?)t$/,RO=RegExp(`^(?:(\\d*(?:\\.\\d*)?)h)?(?:(\\d*(?:\\.\\d*)?)m)?(?:(\\d*(?:\\.\\d*)?)s)?(?:(\\d*(?:\\.\\d*)?)ms)?$`),zO=(/* @__PURE__ */ new Map()).set(`left`,lr).set(`center`,`center`).set(`right`,`end`).set(`start`,lr).set(`end`,`end`),BO=(/* @__PURE__ */ new Map()).set(`left`,`line-left`).set(`center`,`center`).set(`right`,`line-right`).set(`start`,`line-left`).set(`end`,`line-right`),VO=[`http://www.w3.org/ns/ttml#parameter`,`http://www.w3.org/2006/10/ttaf1#parameter`],HO=[`http://www.w3.org/ns/ttml#styling`,`http://www.w3.org/2006/10/ttaf1#styling`],UO=[`http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt`,`http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt`];Vr(`application/ttml+xml`,function(){return new fO});function WO(){this.g=new fO}WO.prototype.parseInit=function(e){var t=!1;if(new Va().boxes([`moov`,`trak`,`mdia`,`minf`,`stbl`],Ha).ma(`stsd`,Ua).box(`stpp`,function(e){t=!0,e.parser.stop()}).parse(e),!t)throw new R(2,2,2007)},WO.prototype.setSequenceMode=function(e){this.g.setSequenceMode(e)},WO.prototype.setManifestType=function(e){this.g.setManifestType(e)},WO.prototype.parseMedia=function(e,t,n){var r=[],i=null,a=[],o=/* @__PURE__ */ new Map,s=[];if(new Va().boxes([`moof`,`traf`],Ha).ma(`tfhd`,function(e){i=ts(e.reader,e.flags).Sd}).ma(`trun`,function(e){e=is(e.reader,e.version,e.flags),e=g(e.kh);for(var t=e.next();!t.done;t=e.next())s.push(t.value.sampleSize||i||0)}).ma(`subs`,function(e){for(var t=e.reader,n=t.V(),r=-1,i=0;i<n;i++){var a=t.V();r+=a,a=t.Ea();for(var s=[],c=0;c<a;c++)e.version==1?s.push(t.V()):s.push(t.Ea()),t.Y(),t.Y(),t.V();o.set(r,s)}}).box(`mdat`,Ka(function(e){a.push(e)},!1)).parse(e,!1),a.length==0)throw new R(2,2,2007);e=z.apply(bt,_(a));for(var c=0,l=0;l<s.length;l++){var u=Ze(e,c,s[l]);c+=s[l];var d=o.get(l);if(d&&d.length){for(var f=Ze(u,0,d[0]),p=[],m=d[0],h=1;h<d.length;h++){var v=Ze(u,m,d[h]);v=xt(v),p.push(`data:image/png;base64,`+v),m+=d[h]}r=r.concat(this.g.parseMedia(f,t,n,p))}else r=r.concat(this.g.parseMedia(u,t,n,[]))}return r},P(`shaka.text.Mp4TtmlParser`,WO),WO.prototype.parseMedia=WO.prototype.parseMedia,WO.prototype.setManifestType=WO.prototype.setManifestType,WO.prototype.setSequenceMode=WO.prototype.setSequenceMode,WO.prototype.parseInit=WO.prototype.parseInit,Vr(`application/mp4; codecs="stpp"`,function(){return new WO}),Vr(`application/mp4; codecs="stpp.ttml"`,function(){return new WO}),Vr(`application/mp4; codecs="stpp.ttml.im1i"`,function(){return new WO}),Vr(`application/mp4; codecs="stpp.ttml.im1t"`,function(){return new WO}),Vr(`application/mp4; codecs="stpp.ttml.im2i"`,function(){return new WO}),Vr(`application/mp4; codecs="stpp.ttml.im2t"`,function(){return new WO}),Vr(`application/mp4; codecs="stpp.ttml.etd1"`,function(){return new WO}),Vr(`application/mp4; codecs="stpp.ttml.etd1|im1t"`,function(){return new WO}),Vr(`application/mp4; codecs="stpp.ttml.im1t|etd1"`,function(){return new WO}),Vr(`application/mp4; codecs="stpp.TTML.im1t"`,function(){return new WO});function GO(){this.g=`UNKNOWN`}GO.prototype.parseInit=function(){},GO.prototype.setSequenceMode=function(){},GO.prototype.setManifestType=function(e){this.g=e},GO.prototype.parseMedia=function(e,t){e=pt(e),e=e.replace(/\r\n|\r(?=[^\n]|$)/gm,`
|
|
19
|
+
`);var n=e.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(n[0]))throw new R(2,2,2e3);if(e=t.vttOffset,this.g==`HLS`&&n[0].includes(`X-TIMESTAMP-MAP`)){var r=n[0];if(e=r.match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),r=r.match(/MPEGTS:(\d+)/m),!e||!r||(e=ln(e[1]),e==null))throw new R(2,2,2e3);r=Number(r[1]);for(var i=t.segmentStart-t.periodStart;i>=95443.7176888889;)i-=95443.7176888889,r+=8589934592;e=t.periodStart+r/9e4-e}for(t=[],r=g(n[0].split(`
|
|
20
|
+
`)),i=r.next();!i.done;i=r.next())if(i=i.value,/^Region:/.test(i)){i=new rn(i);var a=new en;sn(i),an(i);for(var o=sn(i);o;){var s=a,c=o;(o=/^id=(.*)$/.exec(c))?s.id=o[1]:(o=/^width=(\d{1,2}|100)%$/.exec(c))?s.width=Number(o[1]):(o=/^lines=(\d+)$/.exec(c))?(s.height=Number(o[1]),s.heightUnits=2):(o=/^regionanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(c))?(s.regionAnchorX=Number(o[1]),s.regionAnchorY=Number(o[2])):(o=/^viewportanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(c))?(s.viewportAnchorX=Number(o[1]),s.viewportAnchorY=Number(o[2])):/^scroll=up$/.exec(c)&&(s.scroll=`up`),an(i),o=sn(i)}t.push(a)}for(r=/* @__PURE__ */ new Map,Zn(r),i=[],n=g(n.slice(1)),a=n.next();!a.done;a=n.next()){if(a=a.value.split(`
|
|
21
|
+
`),(a.length!=1||a[0])&&!JO.test(a[0])&&a[0]==`STYLE`){for(s=[],o=-1,c=1;c<a.length;c++)a[c].includes(`::cue`)&&(s.push([]),o=s.length-1),o!=-1&&(s[o].push(a[c]),a[c].includes(`}`)&&(o=-1));for(s=g(s),o=s.next();!o.done;o=s.next()){var l=o.value;o=`global`,(c=l[0].match(/\((.*)\)/))&&(o=c.pop()),c=l.slice(1,-1),l[0].includes(`}`)&&(l=/\{(.*?)\}/.exec(l[0]))&&(c=l[1].split(`;`)),(l=r.get(o))||(l=new qn(0,0,``));for(var u=!1,d=0;d<c.length;d++){var f=/^\s*([^:]+):\s*(.*)/.exec(c[d]);if(f){var p=f[2].trim().replace(`;`,``);switch(f[1].trim()){case`background-color`:case`background`:u=!0,l.backgroundColor=p;break;case`color`:u=!0,l.color=p;break;case`font-family`:u=!0,l.fontFamily=p;break;case`font-size`:u=!0,l.fontSize=p;break;case`font-weight`:(parseInt(p,10)>=700||p==`bold`)&&(u=!0,l.fontWeight=mr);break;case`font-style`:switch(p){case`normal`:u=!0,l.fontStyle=hr;break;case`italic`:u=!0,l.fontStyle=gr;break;case`oblique`:u=!0,l.fontStyle=`oblique`}break;case`opacity`:u=!0,l.opacity=parseFloat(p);break;case`text-combine-upright`:u=!0,l.textCombineUpright=p;break;case`text-shadow`:u=!0,l.textShadow=p;break;case`white-space`:u=!0,l.wrapLine=p!=`noWrap`}}}u&&r.set(o,l)}}if(l=a,d=e,l.length==1&&!l[0]||JO.test(l[0])||l[0]==`STYLE`||l[0]==`REGION`)a=null;else if(a=null,u=0,l[0].includes(`-->`)||(a=l[0],u=1),s=new rn(l[u]),o=cn(s),f=on(s,/[ \t]+--\x3e[ \t]+/g),c=cn(s),o==null||f==null||c==null)F(`Failed to parse VTT time code. Cue skipped:`,a,l),a=null;else{for(o+=d,c+=d,o<0&&(o=0),d=``,f=u+1;f<l.length;f++)f>u+1&&(d+=`
|
|
22
|
+
`),d+=l[f];for(d=d.trim(),r.has(`global`)?(l=r.get(`global`).clone(),l.startTime=o,l.endTime=c,l.payload=d):l=new qn(o,c,d),an(s),o=sn(s);o;)KO(l,o,t),an(s),o=sn(s);Xn(l,r),a!=null&&(l.id=a),a=l}a&&i.push(a)}return i};function KO(e,t,n){var r;(r=YO.exec(t))?(t=r[1],e.textAlign=t==`middle`?nr:rr[t.toUpperCase()]):(r=XO.exec(t))?e.writingMode=r[1]==`lr`?`vertical-lr`:`vertical-rl`:(r=ZO.exec(t))?e.size=Number(r[1]):(r=QO.exec(t))?(e.position=Number(r[1]),r[2]&&(t=r[2],e.positionAlign=t==`line-left`||t==`start`?`line-left`:t==`line-right`||t==`end`?`line-right`:t==`center`||t==`middle`?`center`:tr)):(r=$O.exec(t))?(t=qO(n,r[1]))&&(e.region=t):(n=ek.exec(t))?(e.lineInterpretation=1,e.line=Number(n[1]),n[2]&&(e.lineAlign=ur[n[2].toUpperCase()])):(n=tk.exec(t))&&(e.lineInterpretation=cr,e.line=Number(n[1]),n[2]&&(e.lineAlign=ur[n[2].toUpperCase()]))}function qO(e,t){return e=e.filter(function(e){return e.id==t}),e.length?e[0]:null}P(`shaka.text.VttTextParser`,GO),GO.prototype.parseMedia=GO.prototype.parseMedia,GO.prototype.setManifestType=GO.prototype.setManifestType,GO.prototype.setSequenceMode=GO.prototype.setSequenceMode,GO.prototype.parseInit=GO.prototype.parseInit;var JO=/^NOTE($|[ \t])/,YO=/^align:(start|middle|center|end|left|right)$/,XO=/^vertical:(lr|rl)$/,ZO=/^size:([\d.]+)%$/,QO=/^position:([\d.]+)%(?:,(line-left|line-right|middle|center|start|end|auto))?$/,$O=/^region:(.*)$/,ek=/^line:([\d.]+)%(?:,(start|end|center))?$/,tk=/^line:(-?\d+)(?:,(start|end|center))?$/;Vr(`text/vtt`,function(){return new GO}),Vr(`text/vtt; codecs="vtt"`,function(){return new GO}),Vr(`text/vtt; codecs="wvtt"`,function(){return new GO});function nk(){this.g=null}nk.prototype.parseInit=function(e){var t=this,n=!1;if(new Va().boxes([`moov`,`trak`,`mdia`,`minf`,`stbl`],Ha).ma(`mdhd`,function(e){e=rs(e.reader,e.version),t.g=e.timescale}).ma(`stsd`,Ua).box(`wvtt`,function(){n=!0}).parse(e),!this.g||!n)throw new R(2,2,2008)},nk.prototype.setSequenceMode=function(){},nk.prototype.setManifestType=function(){},nk.prototype.parseMedia=function(e,t){if(!e.length)return[];if(!this.g)throw new R(2,2,2008);var n=0,r=[],i,a=[],o=!1,s=!1,c=!1,l=null;if(new Va().boxes([`moof`,`traf`],Ha).ma(`tfdt`,function(e){o=!0,n=ns(e.reader,e.version).baseMediaDecodeTime}).ma(`tfhd`,function(e){l=ts(e.reader,e.flags).Rd}).ma(`trun`,function(e){s=!0,r=is(e.reader,e.version,e.flags).kh}).box(`mdat`,Ka(function(e){c=!0,i=e},!1)).parse(e,!1),!c&&!o&&!s)throw new R(2,2,2008);e=n;for(var u=new Ra(i,0),d=g(r),f=d.next();!f.done;f=d.next()){f=f.value;var p=f.mh||l,m=f.Cf?n+f.Cf:e;e=m+(p||0);var h=0;do{var _=u.V();h+=_;var v=u.V(),y=null;Ja(v)==`vttc`?_>8&&(y=u.Nb(_-8,!1)):u.skip(_-8),p&&y&&(_=rk(y,t.periodStart+m/this.g,t.periodStart+e/this.g),a.push(_))}while(f.sampleSize&&h<f.sampleSize)}return a.filter(ri)};function rk(e,t,n){var r,i,a;return new Va().box(`payl`,Ka(function(e){r=pt(e)},!1)).box(`iden`,Ka(function(e){i=pt(e)},!1)).box(`sttg`,Ka(function(e){a=pt(e)},!1)).parse(e),r?ik(r,i,a,t,n):null}function ik(e,t,n,r,i){if(e=new qn(r,i,e),Xn(e),t&&(e.id=t),n)for(t=new rn(n),n=sn(t);n;)KO(e,n,[]),an(t),n=sn(t);return e}P(`shaka.text.Mp4VttParser`,nk),nk.prototype.parseMedia=nk.prototype.parseMedia,nk.prototype.setManifestType=nk.prototype.setManifestType,nk.prototype.setSequenceMode=nk.prototype.setSequenceMode,nk.prototype.parseInit=nk.prototype.parseInit,Vr(`application/mp4; codecs="wvtt"`,function(){return new nk});function ak(){}ak.prototype.parseInit=function(){},ak.prototype.setSequenceMode=function(){},ak.prototype.setManifestType=function(){},ak.prototype.parseMedia=function(e){var t=pt(e).replace(/\r+/g,``);if(t=t.trim(),e=[],t==``)return e;t=g(t.split(`
|
|
23
|
+
|
|
24
|
+
`));for(var n=t.next();!n.done;n=t.next()){n=n.value.split(`
|
|
25
|
+
`);var r=new rn(n[0]),i=cn(r),a=on(r,/,/g);if(r=cn(r),i==null||a==null||r==null)throw new R(2,2,2001,`Could not parse cue time range in SubViewer`);e.push(new qn(i,r,n.slice(1).join(`
|
|
26
|
+
`).trim()))}return e},P(`shaka.text.SbvTextParser`,ak),ak.prototype.parseMedia=ak.prototype.parseMedia,ak.prototype.setManifestType=ak.prototype.setManifestType,ak.prototype.setSequenceMode=ak.prototype.setSequenceMode,ak.prototype.parseInit=ak.prototype.parseInit,Vr(`text/x-subviewer`,function(){return new ak});function ok(){this.g=new GO}ok.prototype.parseInit=function(){},ok.prototype.setSequenceMode=function(){},ok.prototype.setManifestType=function(){},ok.prototype.parseMedia=function(e,t,n){var r=pt(e);if(e=`WEBVTT
|
|
27
|
+
|
|
28
|
+
`,r!=``){r=r.replace(/\r+/g,``),r=r.trim(),r=g(r.split(`
|
|
29
|
+
|
|
30
|
+
`));for(var i=r.next();!i.done;i=r.next())i=i.value.split(/\n/),i[0].match(/\d+/)&&i.shift(),i[0]=i[0].replace(/,/g,`.`),e+=i.join(`
|
|
31
|
+
`).replace(/{b}/g,`<b>`).replace(/{\/b}/g,`</b>`).replace(/{i}/g,`<i>`).replace(/{\/i}/g,`</i>`).replace(/{u}/g,`<u>`).replace(/{\/u}/g,`</u>`)+`
|
|
32
|
+
|
|
33
|
+
`}return e=Ze(gt(e)),this.g.parseMedia(e,t,n,[])},P(`shaka.text.SrtTextParser`,ok),ok.prototype.parseMedia=ok.prototype.parseMedia,ok.prototype.setManifestType=ok.prototype.setManifestType,ok.prototype.setSequenceMode=ok.prototype.setSequenceMode,ok.prototype.parseInit=ok.prototype.parseInit,Vr(`text/srt`,function(){return new ok});function sk(){}sk.prototype.parseInit=function(){},sk.prototype.setSequenceMode=function(){},sk.prototype.setManifestType=function(){},sk.prototype.parseMedia=function(e){var t=``,n=``,r=null,i=null;for(i=pt(e).split(/\r?\n\s*\r?\n/),e=g(i),i=e.next();!i.done;i=e.next()){var a=i.value;i=a,(a=dk.exec(a))&&(r=a[1],i=a[2]),r==`V4 Styles`||r==`V4+ Styles`?(t=i,t=n?t+(`
|
|
34
|
+
`+i):i):r==`Events`&&(n=n?n+(`
|
|
35
|
+
`+i):i)}for(r=[],i=null,t=g(t.split(/\r?\n/)),e=t.next();!e.done;e=t.next())if(e=e.value,!/^\s*;/.test(e)&&(a=fk.exec(e))){if(e=a[1].trim(),a=a[2].trim(),e==`Format`)i=a.split(pk);else if(e==`Style`){e=a.split(pk),a={};for(var o=0;o<i.length&&o<e.length;o++)a[i[o]]=e[o];r.push(a)}}for(i=[],t=null,n=g(n.split(/\r?\n/)),a=n.next(),e={};!a.done;e={Yi:void 0},a=n.next())if(a=a.value,!/^\s*;/.test(a)&&(o=fk.exec(a))){if(a=o[1].trim(),o=o[2].trim(),a==`Format`)t=o.split(pk);else if(a==`Dialogue`){o=o.split(pk),a={};for(var s=0;s<t.length&&s<o.length;s++)a[t[s]]=o[s];s=uk(a.Start);var c=uk(a.End);o=new qn(s,c,o.slice(t.length-1).join(`,`).replace(/\\N/g,`
|
|
36
|
+
`).replace(/\{[^}]+\}/g,``)),e.Yi=a.Style,(e=r.find(function(e){return function(t){return t.Name==e.Yi}}(e)))&&ck(o,e),i.push(o)}}return i};function ck(e,t){var n=t.Fontname;if(n&&(e.fontFamily=n),(n=t.Fontsize)&&(e.fontSize=n+`px`),(n=t.PrimaryColour)&&(n=lk(n))&&(e.color=n),(n=t.BackColour)&&(n=lk(n))&&(e.backgroundColor=n),t.Bold&&(e.fontWeight=mr),t.Italic&&(e.fontStyle=gr),t.Underline&&e.textDecoration.push(vr),(n=t.Spacing)&&(e.letterSpacing=n+`px`),n=t.Alignment)switch(parseInt(n,10)){case 1:e.displayAlign=ir,e.textAlign=`start`;break;case 2:e.displayAlign=ir,e.textAlign=nr;break;case 3:e.displayAlign=ir,e.textAlign=`end`;break;case 5:e.displayAlign=`before`,e.textAlign=`start`;break;case 6:e.displayAlign=`before`,e.textAlign=nr;break;case 7:e.displayAlign=`before`,e.textAlign=`end`;break;case 9:e.displayAlign=`center`,e.textAlign=`start`;break;case 10:e.displayAlign=`center`,e.textAlign=nr;break;case 11:e.displayAlign=`center`,e.textAlign=`end`}(t=t.AlphaLevel)&&(e.opacity=parseFloat(t))}function lk(e){return e=parseInt(e.replace(`&H`,``),16),e>=0?`rgba(`+(e&255)+`,`+(e>>8&255)+`,`+(e>>16&255)+`,`+(e>>24&255^255)/255+`)`:null}function uk(e){return e=mk.exec(e),(e[1]?parseInt(e[1].replace(`:`,``),10):0)*3600+parseInt(e[2],10)*60+parseFloat(e[3])}P(`shaka.text.SsaTextParser`,sk),sk.prototype.parseMedia=sk.prototype.parseMedia,sk.prototype.setManifestType=sk.prototype.setManifestType,sk.prototype.setSequenceMode=sk.prototype.setSequenceMode,sk.prototype.parseInit=sk.prototype.parseInit;var dk=/^\s*\[([^\]]+)\]\r?\n([\s\S]*)/,fk=/^\s*([^:]+):\s*(.*)/,pk=/\s*,\s*/,mk=/^(\d+:)?(\d{1,2}):(\d{1,2}(?:[.]\d{1,3})?)?$/;Vr(`text/x-ssa`,function(){return new sk});function hk(e,t){var n=e[t+1]&1?7:9;return t+n<=e.length&&(e=((e[t+3]&3)<<11|e[t+4]<<3|(e[t+5]&224)>>>5)-n,e>0)?{Yd:n,ka:e}:null}function gk(e,t){var n=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],r=(e[t+2]&60)>>>2;if(r>n.length-1)return null;var i=((e[t+2]&192)>>>6)+1,a=(e[t+2]&1)<<2;return a|=(e[t+3]&192)>>>6,{sampleRate:n[r],channelCount:a,codec:`mp4a.40.`+i}}function _k(e,t){if(t+1<e.length&&e[t]===255&&(e[t+1]&246)==240){var n=e[t+1]&1?7:9;if(t+n>=e.length)return!1;var r=(e[t+3]&3)<<11|e[t+4]<<3|(e[t+5]&224)>>>5;return r<=n?!1:(t+=r,t===e.length||t+1<e.length&&e[t]===255&&(e[t+1]&246)==240)}return!1}function vk(e,t){switch(e){case`mp4a.40.2`:if(t===1)return new Uint8Array([0,200,0,128,35,128]);if(t===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(t===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(t===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(t===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(t===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(t===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(t===2||t===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null}var yk=Object.freeze({Og:0,ef:0,$e:0,Se:0,Te:2,Pg:0}),bk=Object.freeze({Og:0,ef:0,$e:0,Se:0,Te:2,Pg:0}),xk=Object.freeze({Og:0,ef:0,$e:0,Se:0,Te:1,Pg:1});function Sk(e){this.j=e,this.h=0,this.g=/* @__PURE__ */ new Map,this.i=null}r=Sk.prototype,r.destroy=function(){this.g.clear()},r.isSupported=function(e){return e.toLowerCase().split(`;`)[0]==`audio/aac`&&Qo(this.convertCodecs(`audio`,e))},r.convertCodecs=function(e,t){return t.toLowerCase().split(`;`)[0]==`audio/aac`?`audio/mp4; codecs="`+(Ir(t)||`mp4a.40.2`)+`"`:t},r.getOriginalMimeType=function(){return this.j},r.transmux=function(e,t,n,r){for(var i=Ze(e),a=vc(i),o=a.length;o<i.length&&!_k(i,o);o++);if(e=n.endTime*1e3,a=_c(a),a.length&&n&&(a=a.find(function(e){return e.description===`com.apple.streaming.transportStreamTimestamp`}))&&(e=a.data),a=gk(i,o),!a)return Promise.reject(new R(2,3,3018,n?n.P()[0]:null));t.audioSamplingRate=a.sampleRate,t.channelsCount=a.channelCount;for(var s=[];o<i.length;){var c=hk(i,o);if(!c)return Promise.reject(new R(2,3,3018,n?n.P()[0]:null));var l=c.Yd+c.ka;o+l<=i.length&&s.push({data:i.subarray(o+c.Yd,o+l),size:c.ka,duration:1024,ob:0,flags:yk}),o+=l}return i=a.sampleRate,e=Math.floor(e*i/1e3),r={id:t.id,type:`audio`,codecs:a.codec,timescale:i,duration:r,zb:[],Aa:new Uint8Array([]),Ta:new Uint8Array([]),Za:0,$a:0,data:{sequenceNumber:this.h,baseMediaDecodeTime:e,ub:s},stream:t},r=new us([r]),n=t.id+`_`+n.i,this.g.has(n)?t=this.g.get(n):(t=ds(r),this.g.set(n,t)),n=this.i!==t,r=_s(r),this.i=t,this.h++,Promise.resolve({data:r,init:n?t:null})},P(`shaka.transmuxer.AacTransmuxer`,Sk),Sk.prototype.transmux=Sk.prototype.transmux,Sk.prototype.getOriginalMimeType=Sk.prototype.getOriginalMimeType,Sk.prototype.convertCodecs=Sk.prototype.convertCodecs,Sk.prototype.isSupported=Sk.prototype.isSupported,Sk.prototype.destroy=Sk.prototype.destroy,xr(`audio/aac`,function(){return new Sk(`audio/aac`)},wr);function Ck(e,t,n){if(t+8>e.length||e[t]!==11||e[t+1]!==119)return!1;var r=e[t+4]>>6;if(r>=3)return!1;var i=e[t+4]&63,a=[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][i*3+r]*2;if(t+a>e.length)return!1;var o=e[t+6]>>5,s=0;o===2?s+=2:(o&1&&o!==1&&(s+=2),o&4&&(s+=2)),s=(e[t+6]<<8|e[t+7])>>12-s&1;var c=e[t+5]&7;return e=new Uint8Array([r<<6|e[t+5]>>3<<1|c>>2,(c&3)<<6|o<<3|s<<2|i>>4,i<<4&224]),n.sampleRate=[48e3,44100,32e3][r],n.channelCount=[2,1,2,3,3,4,4,5][o]+s,n.Aa=e,n.ka=a,!0}function wk(e,t){if(e[t]===11&&e[t+1]===119){var n=0,r=5;t+=r;for(var i,a;r>0;){a=e[t];var o=Math.min(r,8),s=8-o;i=4278190080>>>24+s<<s,i=(a&i)>>s,n=n?n<<o|i:i,t+=1,r-=o}if(n<16)return!0}return!1}function Tk(e){this.j=e,this.h=0,this.g=/* @__PURE__ */ new Map,this.i=null}r=Tk.prototype,r.destroy=function(){this.g.clear()},r.isSupported=function(e){return e.toLowerCase().split(`;`)[0]==`audio/ac3`&&Qo(this.convertCodecs(`audio`,e))},r.convertCodecs=function(e,t){return t.toLowerCase().split(`;`)[0]==`audio/ac3`?we().le()?`audio/mp4; codecs="ec-3"`:`audio/mp4; codecs="ac-3"`:t},r.getOriginalMimeType=function(){return this.j},r.transmux=function(e,t,n,r){e=Ze(e);for(var i=vc(e),a=i.length;a<e.length&&!wk(e,a);a++);var o=n.endTime*1e3;i=_c(i),i.length&&n&&(i=i.find(function(e){return e.description===`com.apple.streaming.transportStreamTimestamp`}))&&(o=i.data),i=0;for(var s=new Uint8Array([]),c=[],l={sampleRate:0,channelCount:0,Aa:/* @__PURE__ */ new Uint8Array,ka:0};a<e.length;){if(!Ck(e,a,l))return Promise.reject(new R(2,3,3018,n?n.P()[0]:null));t.audioSamplingRate=l.sampleRate,t.channelsCount=l.channelCount,i=l.sampleRate,s=l.Aa,c.push({data:e.subarray(a,a+l.ka),size:l.ka,duration:1536,ob:0,flags:yk}),a+=l.ka}return e=Math.floor(o*i/1e3),r={id:t.id,type:`audio`,codecs:`ac-3`,timescale:i,duration:r,zb:[],Aa:s,Ta:new Uint8Array([]),Za:0,$a:0,data:{sequenceNumber:this.h,baseMediaDecodeTime:e,ub:c},stream:t},r=new us([r]),n=t.id+`_`+n.i,this.g.has(n)?t=this.g.get(n):(t=ds(r),this.g.set(n,t)),n=this.i!==t,r=_s(r),this.i=t,this.h++,Promise.resolve({data:r,init:n?t:null})},P(`shaka.transmuxer.Ac3Transmuxer`,Tk),Tk.prototype.transmux=Tk.prototype.transmux,Tk.prototype.getOriginalMimeType=Tk.prototype.getOriginalMimeType,Tk.prototype.convertCodecs=Tk.prototype.convertCodecs,Tk.prototype.isSupported=Tk.prototype.isSupported,Tk.prototype.destroy=Tk.prototype.destroy,xr(`audio/ac3`,function(){return new Tk(`audio/ac3`)},wr);function Ek(e,t,n){if(t+8>e.length||(e[t]<<8|e[t+1])!=2935)return!1;var r=new xc(e.subarray(t+2));Cc(r,2),Cc(r,3);var i=wc(r,11)+1<<1,a=wc(r,2);if(a==3){a=wc(r,2),a=[24e3,22060,16e3][a];var o=3}else a=[48e3,44100,32e3][a],o=wc(r,2);var s=wc(r,3),c=wc(r,1);return r=wc(r,5),t+i>e.byteLength?!1:(e=Math.floor(i*a/([1,2,3,6][o]*16)),e=new Uint8Array([(e&8160)>>5,(e&31)<<3,a<<6|r<<1,s<<1|c,0]),n.sampleRate=a,n.channelCount=[2,1,2,3,3,4,4,5][s]+c,n.Aa=e,n.ka=i,!0)}function Dk(e){this.j=e,this.h=0,this.g=/* @__PURE__ */ new Map,this.i=null}r=Dk.prototype,r.destroy=function(){this.g.clear()},r.isSupported=function(e){return e.toLowerCase().split(`;`)[0]==`audio/ec3`&&Qo(this.convertCodecs(`audio`,e))},r.convertCodecs=function(e,t){return t.toLowerCase().split(`;`)[0]==`audio/ec3`?`audio/mp4; codecs="ec-3"`:t},r.getOriginalMimeType=function(){return this.j},r.transmux=function(e,t,n,r){e=Ze(e);for(var i=vc(e),a=i.length;a<e.length&&(e[a]<<8|e[a+1])!=2935;a++);var o=n.endTime*1e3;i=_c(i),i.length&&n&&(i=i.find(function(e){return e.description===`com.apple.streaming.transportStreamTimestamp`}))&&(o=i.data),i=0;for(var s=new Uint8Array([]),c=[],l={sampleRate:0,channelCount:0,Aa:/* @__PURE__ */ new Uint8Array,ka:0};a<e.length;){if(!Ek(e,a,l))return Promise.reject(new R(2,3,3018,n?n.P()[0]:null));t.audioSamplingRate=l.sampleRate,t.channelsCount=l.channelCount,i=l.sampleRate,s=l.Aa,c.push({data:e.subarray(a,a+l.ka),size:l.ka,duration:1536,ob:0,flags:yk}),a+=l.ka}return e=Math.floor(o*i/1e3),r={id:t.id,type:`audio`,codecs:`ec-3`,timescale:i,duration:r,zb:[],Aa:s,Ta:new Uint8Array([]),Za:0,$a:0,data:{sequenceNumber:this.h,baseMediaDecodeTime:e,ub:c},stream:t},r=new us([r]),n=t.id+`_`+n.i,this.g.has(n)?t=this.g.get(n):(t=ds(r),this.g.set(n,t)),n=this.i!==t,r=_s(r),this.i=t,this.h++,Promise.resolve({data:r,init:n?t:null})},P(`shaka.transmuxer.Ec3Transmuxer`,Dk),Dk.prototype.transmux=Dk.prototype.transmux,Dk.prototype.getOriginalMimeType=Dk.prototype.getOriginalMimeType,Dk.prototype.convertCodecs=Dk.prototype.convertCodecs,Dk.prototype.isSupported=Dk.prototype.isSupported,Dk.prototype.destroy=Dk.prototype.destroy,xr(`audio/ec3`,function(){return new Dk(`audio/ec3`)},wr);function Ok(e){if(!e.length)return null;var t=e.find(function(e){return e.type==7});if(e=e.find(function(e){return e.type==8}),!t||!e)return null;var n=new xc(t.data),r=Oc(n);if(Oc(n),Oc(n),Ec(n),Ak.includes(r)&&(r=U(n),r===3&&Cc(n,1),Ec(n),Ec(n),Cc(n,1),W(n))){r=r===3?12:8;for(var i=0;i<r;i++)W(n)&&(i<6?kc(n,16):kc(n,64))}if(Ec(n),r=U(n),r===0)U(n);else if(r===1)for(Cc(n,1),Ec(n),Ec(n),r=U(n),i=0;i<r;i++)Ec(n);Ec(n),Cc(n,1);var a=U(n),o=U(n),s=wc(n,1);s===0&&Cc(n,1),Cc(n,1);var c=0,l=0,u=0,d=0;if(W(n)&&(c=U(n),l=U(n),u=U(n),d=U(n)),i=r=1,W(n)&&W(n)){var f=Oc(n);f>0&&f<=16?(r=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][f-1],i=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][f-1]):f===255&&(r=wc(n,16),i=wc(n,16))}return n=(2-s)*(o+1)*16-u*2-d*2,a=(a+1)*16-c*2-l*2,t=t.fullData,c=t.byteLength,e=e.fullData,l=e.byteLength,o=0,s=new Uint8Array(11+c+l),s[o++]=1,s[o++]=t[1],s[o++]=t[2],s[o++]=t[3],s[o++]=255,s[o++]=225,s[o++]=c>>>8&255,s[o++]=c&255,s.set(t,o),o+=c,s[o++]=1,s[o++]=l>>>8&255,s[o++]=l&255,s.set(e,o),{height:n,width:a,Ta:s,Za:r,$a:i}}function kk(e){function t(e){i={data:o,frame:!1,isKeyframe:!1,pts:e.pts,dts:e.dts,nalus:[]}}function n(){if(i&&i.nalus.length&&i.frame){for(var e=i.nalus.length*4,t=g(i.nalus),n=t.next();!n.done;n=t.next())e+=n.value.fullData.byteLength;e=new Uint8Array(e),t=0,n=g(i.nalus);for(var a=n.next();!a.done;a=n.next()){a=a.value;var o=a.fullData.byteLength;e[t]=o>>24&255,e[t+1]=o>>16&255,e[t+2]=o>>8&255,e[t+3]=o&255,e.set(a.fullData,t+4),t+=4+o}i.data=e,r.push(i)}}for(var r=[],i=null,a=!1,o=/* @__PURE__ */ new Uint8Array,s=0;s<e.length;s++){var c=e[s],l=c.nalus,u=!1;i&&l.length&&!a&&(n(),t(c)),l=g(c.nalus);for(var d=l.next();!d.done;d=l.next()){d=d.value;var f=!1;switch(d.type){case 1:var p=!1;f=!0;var m=d.data;u&&m.length>4&&(m=Ac(new xc(m)),m===2||m===4||m===7||m===9)&&(p=!0),p&&i&&i.frame&&!i.isKeyframe&&(n(),i=null),i||t(c),i.frame=!0,i.isKeyframe=p;break;case 5:f=!0,i&&i.frame&&!i.isKeyframe&&(n(),i=null),i||t(c),i.frame=!0,i.isKeyframe=!0;break;case 6:f=!0;break;case 7:u=f=!0;break;case 8:f=!0;break;case 9:a=f=!0,i&&i.frame&&(n(),i=null),i||t(c);break;case 12:f=!0;break;default:f=!1}i&&f&&i.nalus.push(d)}}return n(),r}var Ak=[100,110,122,244,44,83,86,118,128,138,139,134];function jk(e){if(!e.length)return null;var t=e.find(function(e){return e.type==32}),n=e.find(function(e){return e.type==33}),r=e.find(function(e){return e.type==34});if(!t||!n||!r)return null;var i=Mk(t.fullData);e=Nk(n.fullData);var a=Pk(r.fullData);return t=Fk(t.fullData,n.fullData,r.fullData,{Vg:i.Vg,Ch:i.Ch,Dg:e.Dg,Eg:e.Eg,xg:e.xg,Cg:e.Cg,yg:e.yg,zg:e.zg,Ag:e.Ag,Bg:e.Bg,qg:e.qg,rg:e.rg,sg:e.sg,ug:e.ug,vg:e.vg,wg:e.wg,qf:e.qf,fg:e.fg,eg:e.eg,dg:e.dg,Xg:a.Xg,pg:e.pg,og:e.og}),{height:e.height,width:e.width,Ta:t,Za:e.Uk,$a:e.Tk}}function Mk(e){var t=new xc(e,!0);return Oc(t),Oc(t),wc(t,4),wc(t,2),wc(t,6),e=wc(t,3),t=W(t),{Vg:e+1,Ch:t}}function Nk(e){e=new xc(e,!0),Oc(e),Oc(e);var t=0,n=0,r=0,i=0;wc(e,4);var a=wc(e,3);W(e);for(var o=wc(e,2),s=wc(e,1),c=wc(e,5),l=Oc(e),u=Oc(e),d=Oc(e),f=Oc(e),p=Oc(e),m=Oc(e),h=Oc(e),g=Oc(e),_=Oc(e),v=Oc(e),y=Oc(e),b=[],x=[],S=0;S<a;S++)b.push(W(e)),x.push(W(e));if(a>0)for(S=a;S<8;S++)wc(e,2);for(S=0;S<a;S++)b[S]&&wc(e,88),x[S]&&Oc(e);U(e),b=U(e),b==3&&wc(e,1),x=U(e),S=U(e),W(e)&&(t+=U(e),n+=U(e),r+=U(e),i+=U(e));var C=U(e),w=U(e),T=U(e);if(W(e))for(var E=0;E<=a;E++)U(e),U(e),U(e);else U(e),U(e),U(e);if(U(e),U(e),U(e),U(e),U(e),U(e),W(e)&&W(e))for(E=0;E<4;E++)for(var D=0;D<(E===3?2:6);D++)if(W(e)){var O=Math.min(64,1<<4+(E<<1));E>1&&Dc(e);for(var k=0;k<O;k++)Dc(e)}else U(e);for(W(e),W(e),W(e)&&(Oc(e),U(e),U(e),W(e)),E=U(e),O=D=0;O<E;O++)if(k=!1,O!==0&&(k=W(e)),k){O===E&&U(e),W(e),U(e);for(var A=k=0;A<=D;A++){var j=W(e),M=!1;j||(M=W(e)),(j||M)&&k++}D=k}else{for(A=U(e),k=U(e),D=A+k,j=0;j<A;j++)U(e),W(e);for(A=0;A<k;A++)U(e),W(e)}if(W(e))for(E=U(e),D=0;D<E;D++){for(O=0;O<T+4;O++)wc(e,1);wc(e,1)}if(E=T=1,D=!0,O=1,A=k=0,W(e),W(e),W(e)){if(W(e)){j=Oc(e),M=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2];var ee=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];j>0&&j<=16?(T=M[j-1],E=ee[j-1]):j===255&&(T=wc(e,16),E=wc(e,16))}if(W(e)&&W(e),W(e)&&(wc(e,3),W(e),W(e)&&(Oc(e),Oc(e),Oc(e))),W(e)&&(U(e),U(e)),W(e),W(e),W(e),(j=W(e))&&(Ec(e),Ec(e),Ec(e),Ec(e)),W(e)&&(O=wc(e,32),k=wc(e,32),W(e)&&U(e),W(e))){ee=!1,j=W(e),M=W(e),(j||M)&&((ee=W(e))&&(Oc(e),wc(e,5),W(e),wc(e,5)),wc(e,4),wc(e,4),ee&&wc(e,4),wc(e,5),wc(e,5),wc(e,5));for(var te=0;te<=a;te++){D=W(e);var N=!0,ne=1;D||(N=W(e));var re=!1;if(N?U(e):re=W(e),re||(ne=U(e)+1),j){for(N=0;N<ne;N++)U(e),U(e),ee&&(U(e),U(e));W(e)}if(M){for(N=0;N<ne;N++)U(e),U(e),ee&&(U(e),U(e));W(e)}}}W(e)&&(W(e),W(e),W(e),A=U(e),U(e),U(e),U(e),U(e))}return{xg:y,Dg:o,Eg:s,Cg:c,yg:l,zg:u,Ag:d,Bg:f,qg:p,rg:m,sg:h,ug:g,vg:_,wg:v,qf:A,fg:b,eg:C,dg:w,width:x-(t+n)*(b===1||b===2?2:1),height:S-(r+i)*(b===1?2:1),Uk:T,Tk:E,pg:k/O,og:D}}function Pk(e){var t=new xc(e,!0);Oc(t),Oc(t),U(t),U(t),W(t),W(t),wc(t,3),W(t),W(t),U(t),U(t),Dc(t),W(t),W(t),W(t)&&U(t),Dc(t),Dc(t),W(t),W(t),W(t),W(t),e=W(t),t=W(t);var n=1;return t&&e?n=0:t?n=3:e&&(n=2),{Xg:n}}function Fk(e,t,n,r){var i=new Uint8Array(23+(5+e.byteLength)+(5+t.byteLength)+(5+n.byteLength));for(i[0]=1,i[1]=(r.Dg&3)<<6|!!r.Eg<<5|r.Cg&31,i[2]=r.yg,i[3]=r.zg,i[4]=r.Ag,i[5]=r.Bg,i[6]=r.qg,i[7]=r.rg,i[8]=r.sg,i[9]=r.ug,i[10]=r.vg,i[11]=r.wg,i[12]=r.xg,i[13]=240|(r.qf&3840)>>8,i[14]=r.qf&255,i[15]=252|r.Xg&3,i[16]=252|r.fg&3,i[17]=248|r.eg&7,i[18]=248|r.dg&7,i[19]=0,i[20]=parseInt(r.pg,10),i[21]=(!!r.og&3)<<6|(r.Vg&7)<<3|!!r.Ch<<2|3,i[22]=3,e=[e,t,n],t=23,n=e.length-1,r=0;r<e.length;r+=1)i.set(new Uint8Array([32+r|(r===n?128:0),0,1,e[r].byteLength>>8,e[r].byteLength&255]),t),t+=5,i.set(e[r],t),t+=e[r].byteLength;return i}function Ik(e,t){var n=e[t+1]>>3&3,r=e[t+1]>>1&3,i=e[t+2]>>4&15,a=e[t+2]>>2&3;if(n!==1&&i!==0&&i!==15&&a!==3){var o=e[t+3]>>6;i=zk[(n===3?3-r:r===3?3:4)*14+i-1]*1e3,a=Bk[(n===3?0:n===2?1:2)*3+a],n=Vk[n][r];var s=Hk[r],c=Math.floor(n*i/a+(e[t+2]>>1&1))*s,l=(navigator.userAgent||``).match(/Chrome\/(\d+)/i);return(l=l?parseInt(l[1],10):0)&&l<=87&&r===2&&i>=224e3&&o===0&&(e[t+3]|=128),{sampleRate:a,channelCount:o===3?1:2,ka:c,Sk:n*8*s}}return null}function Lk(e,t){return e[t]===255&&(e[t+1]&224)==224&&!!(e[t+1]&6)}function Rk(e,t){if(t+1<e.length&&Lk(e,t)){var n=Ik(e,t),r=4;return n&&n.ka&&(r=n.ka),t+=r,t===e.length||t+1<e.length&&Lk(e,t)}return!1}var zk=[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],Bk=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Vk=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Hk=[0,1,1,4];function Uk(e){this.j=e,this.h=0,this.g=/* @__PURE__ */ new Map,this.i=null}r=Uk.prototype,r.destroy=function(){this.g.clear()},r.isSupported=function(e){return e.toLowerCase().split(`;`)[0]==`audio/mpeg`&&Qo(this.convertCodecs(`audio`,e))},r.convertCodecs=function(e,t){return t.toLowerCase().split(`;`)[0]==`audio/mpeg`?`audio/mp4; codecs="mp3"`:t},r.getOriginalMimeType=function(){return this.j},r.transmux=function(e,t,n,r){for(var i=Ze(e),a=vc(i).length;a<i.length&&!Rk(i,a);a++);var o;for(e=[];a<i.length;){var s=Ik(i,a);if(!s)return Promise.reject(new R(2,3,3018,n?n.P()[0]:null));o||(o=s),a+s.ka<=i.length&&e.push({data:i.subarray(a,a+s.ka),size:s.ka,duration:1152,ob:0,flags:yk}),a+=s.ka}return o?(i=o.Sk*9e4/o.sampleRate*this.h,r={id:t.id,type:`audio`,codecs:`mp3`,timescale:o.sampleRate,duration:r,zb:[],Aa:new Uint8Array([]),Ta:new Uint8Array([]),Za:0,$a:0,data:{sequenceNumber:this.h,baseMediaDecodeTime:i,ub:e},stream:t},r=new us([r]),n=t.id+`_`+n.i,this.g.has(n)?t=this.g.get(n):(t=ds(r),this.g.set(n,t)),n=this.i!==t,r=_s(r),this.i=t,this.h++,Promise.resolve({data:r,init:n?t:null})):Promise.reject(new R(2,3,3018,n?n.P()[0]:null))},P(`shaka.transmuxer.Mp3Transmuxer`,Uk),Uk.prototype.transmux=Uk.prototype.transmux,Uk.prototype.getOriginalMimeType=Uk.prototype.getOriginalMimeType,Uk.prototype.convertCodecs=Uk.prototype.convertCodecs,Uk.prototype.isSupported=Uk.prototype.isSupported,Uk.prototype.destroy=Uk.prototype.destroy,xr(`audio/mpeg`,function(){return new Uk(`audio/mpeg`)},wr);function Wk(e){this.h=e,this.g=null}r=Wk.prototype,r.destroy=function(){},r.isSupported=function(e){if(e.toLowerCase().split(`;`)[0]!=`video/mp2t`)return!1;var t=Ir(e).split(`,`),n=jt(`audio`,t);return t=jt(`video`,t),!n||t||Nr(n)!=`mp3`?!1:Qo(this.convertCodecs(`audio`,e))},r.convertCodecs=function(e,t){return t.toLowerCase().split(`;`)[0]==`video/mp2t`?`audio/mpeg`:t},r.getOriginalMimeType=function(){return this.h},r.transmux=function(e,t,n,r,i){if(this.g?this.g.clearData():this.g=new jc,this.g.Gf(n.i),e=Ze(e),e=this.g.parse(e),e.Td().audio!=`mp3`||i!=`audio`)return Promise.reject(new R(2,3,3018,n?n.P()[0]:null));for(n=new Uint8Array([]),i=g(e.rb()),e=i.next();!e.done;e=i.next())if(e=e.value.data)for(t=0;t<e.length;)(r=Ik(e,t))?(t+r.ka<=e.length&&(n=z(n,e.subarray(t,t+r.ka))),t+=r.ka):t++;return Promise.resolve(n)},P(`shaka.transmuxer.MpegTsTransmuxer`,Wk),Wk.prototype.transmux=Wk.prototype.transmux,Wk.prototype.getOriginalMimeType=Wk.prototype.getOriginalMimeType,Wk.prototype.convertCodecs=Wk.prototype.convertCodecs,Wk.prototype.isSupported=Wk.prototype.isSupported,Wk.prototype.destroy=Wk.prototype.destroy,xr(`video/mp2t`,function(){return new Wk(`video/mp2t`)},Tr);function Gk(e){this.h=e,(this.g=Zx.get(`ISOBoxer`)())&&Kk(this)}function Kk(e){function t(){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(e){this._procEntryField(e,`InitializationVector`,`data`,8),this.flags&2&&(this._procEntryField(e,`NumberOfEntries`,`uint`,16),this._procSubEntries(e,`clearAndCryptedData`,e.NumberOfEntries,function(e){this._procEntryField(e,`BytesOfClearData`,`uint`,16),this._procEntryField(e,`BytesOfEncryptedData`,`uint`,32)}))})}e.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`,this.version===1?64:32)}),e.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),this.default_sample_info_size===0&&this._procFieldArray(`sample_info_size`,this.sample_count,`uint`,8)}),e.g.addBoxProcessor(`senc`,t),e.g.addBoxProcessor(`uuid`,function(){for(var e=!0,n=0;n<16;n++)this.usertype[n]!==Jk[n]&&(e=!1);e&&(this._parsing&&(this.type=`sepiff`),t.call(this))})}r=Gk.prototype,r.destroy=function(){},r.isSupported=function(e,t){var n=e.startsWith(`mss/`);return!this.g||!n?!1:t?Qo(this.convertCodecs(t,e)):(t=this.convertCodecs(`audio`,e),e=this.convertCodecs(`video`,e),Qo(t)||Qo(e))},r.convertCodecs=function(e,t){return t.replace(`mss/`,``)},r.getOriginalMimeType=function(){return this.h},r.transmux=function(e,t,n){if(!n)return Promise.resolve(Ze(e));if(!t.mssPrivateData)return Promise.reject(new R(2,3,3020,n?n.P()[0]:null));try{var r,i=this.g.parseBuffer(e),a=i.fetch(`tfhd`);a.track_ID=t.id+1;var o=i.fetch(`tfdt`),s=i.fetch(`traf`);o===null&&(o=this.g.createFullBox(`tfdt`,s,a),o.version=1,o.flags=0,o.baseMediaDecodeTime=Math.floor(n.startTime*t.mssPrivateData.timescale));var c=i.fetch(`trun`),l=i.fetch(`tfxd`);l&&l._parent.boxes.splice(l._parent.boxes.indexOf(l),1);var u=i.fetch(`tfrf`);u&&u._parent.boxes.splice(u._parent.boxes.indexOf(u),1);var d=i.fetch(`sepiff`);if(d!==null){d.type=`senc`,d.usertype=void 0;var f=i.fetch(`saio`);if(f===null){f=this.g.createFullBox(`saio`,s),f.version=0,f.flags=0,f.entry_count=1,f.offset=[0];var p=this.g.createFullBox(`saiz`,s);if(p.version=0,p.flags=0,p.sample_count=d.sample_count,p.default_sample_info_size=0,p.sample_info_size=[],d.flags&2)for(r=0;r<d.sample_count;r+=1)p.sample_info_size[r]=10+6*d.entry[r].NumberOfEntries;else p.default_sample_info_size=8}}a.flags&=16777214,a.flags|=131072,c.flags|=1;var m=i.fetch(`moof`);c.data_offset=m.getLength()+8;var h=i.fetch(`saio`);h!==null&&(h.offset[0]=qk(m,`traf`)+qk(s,`senc`)+16);var g=Ze(i.write());return Promise.resolve(g)}catch(e){return e instanceof R?Promise.reject(e):Promise.reject(new R(2,3,3022,n?n.P()[0]:null))}};function qk(e,t){for(var n=8,r=0;r<e.boxes.length&&e.boxes[r].type!==t;r++)n+=e.boxes[r].size;return n}P(`shaka.transmuxer.MssTransmuxer`,Gk),Gk.prototype.transmux=Gk.prototype.transmux,Gk.prototype.getOriginalMimeType=Gk.prototype.getOriginalMimeType,Gk.prototype.convertCodecs=Gk.prototype.convertCodecs,Gk.prototype.isSupported=Gk.prototype.isSupported,Gk.prototype.destroy=Gk.prototype.destroy;var Jk=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);xr(`mss/audio/mp4`,function(){return new Gk(`mss/audio/mp4`)},wr),xr(`mss/video/mp4`,function(){return new Gk(`mss/video/mp4`)},wr);function Yk(e){if(e.length<1)return 960;var t=e[0],n=t&3;if(t=Xk[t>>3&31],n===0)e=1;else if(n===1||n===2)e=2;else if(e.length<2||(e=e[1]&63,e===0))return t;return t*e}var Xk=[480,960,1920,2880,480,960,1920,2880,480,960,1920,2880,480,960,480,960,120,240,480,960,120,240,480,960,120,240,480,960,120,240,480,960];function Zk(e){this.m=e,this.g=0,this.j=/* @__PURE__ */ new Map,this.l=this.i=this.h=null}r=Zk.prototype,r.destroy=function(){this.j.clear(),this.i&&this.i.destroy()},r.isSupported=function(e,t){if(e.toLowerCase().split(`;`)[0]!=`video/mp2t`)return!1;var n=e;t&&(n=this.convertCodecs(t,e));var r=Ir(n).split(`,`);return n=jt(`audio`,r),r=jt(`video`,r),n&&(n=Nr(n),!Qk.includes(n))||r&&(n=Nr(r),!$k.includes(n))?!1:t?Qo(this.convertCodecs(t,e)):(t=this.convertCodecs(`audio`,e),e=this.convertCodecs(`video`,e),Qo(t)||Qo(e))},r.convertCodecs=function(e,t){return t.toLowerCase().split(`;`)[0]==`video/mp2t`?(t=Ir(t).replace(`mp4a.40.34`,`mp3`).split(`,`).map(function(e){return Oi(e,`audio/mp4`)}).map(ki).join(`,`),e==`audio`?`audio/mp4; codecs="`+t+`"`:`video/mp4; codecs="`+t+`"`):t},r.getOriginalMimeType=function(){return this.m},r.transmux=function(e,t,n,r,i){var a=Ze(e);if(i==`audio`&&!Hc(a)){for(var o=vc(a),s=o.length;s<a.length;s++)if(Rk(a,s))return Promise.reject(new R(2,3,3018,n?n.P()[0]:null));for(s=o.length;s<a.length;s++)if(_k(a,s))return this.i||(this.i=new Sk(`audio/aac`)),this.i.transmux(e,t,n,r,i);return Promise.reject(new R(2,3,3018,n?n.P()[0]:null))}this.h?this.h.clearData():this.h=new jc,this.h.Gf(n.i);var c=this.h.parse(a),l=[],u=c.Td();try{var d=null;if(i==`video`){switch(u.video){case`avc`:var f=[],p=null,m=c.od(),h=kk(m);if(!h.length)throw new R(2,3,3023,n?n.P()[0]:null);for(var v=0;v<h.length;v++){var y=h[v];p??(p=y.dts);var b=void 0;b=v+1<h.length?(h[v+1].dts||0)-(y.dts||0):h.length>1?(y.dts||0)-(h[v-1].dts||0):(n.endTime-n.startTime)*9e4,f.push({data:y.data,size:y.data.byteLength,duration:b,ob:Math.round((y.pts||0)-(y.dts||0)),flags:y.isKeyframe?bk:xk})}for(var x=[],S=g(m),C=S.next();!C.done;C=S.next())x.push.apply(x,_(C.value.nalus));var w=Ok(x);if(!w||p==null)throw new R(2,3,3018,n?n.P()[0]:null);t.height=t.height||w.height,t.width=t.width||w.width,d={id:t.id,type:`video`,codecs:`avc1`,timescale:9e4,duration:r,zb:[],Aa:new Uint8Array([]),Ta:w.Ta,Za:w.Za,$a:w.$a,data:{sequenceNumber:this.g,baseMediaDecodeTime:p,ub:f},stream:t};break;case`hvc`:var T=[],E=null,D=[],O=c.od(),k=/* @__PURE__ */ new Uint8Array,A=!1;if(!O.length)throw new R(2,3,3023,n?n.P()[0]:null);for(var j=0;j<O.length;j++){var M=O[j],ee=M.nalus;D.push.apply(D,_(ee));for(var te=!1,N=[],ne=0,re=!1,P=g(ee),ie=P.next();!ie.done;ie=P.next()){var ae=ie.value;switch(ae.type){case 1:case 0:var oe=re=!0;break;case 19:case 20:case 21:te=oe=re=!0;break;case 32:case 33:case 34:oe=!0;break;case 35:re=oe=!0;break;case 39:case 40:oe=!0;break;default:oe=!1}re&&oe&&(N.push(ae.fullData),ne+=ae.fullData.byteLength)}if(N.length){ne+=4*N.length;for(var se=new Uint8Array(ne),ce=0,F=g(N),le=F.next();!le.done;le=F.next()){var ue=le.value,de=ue.byteLength;se[ce]=de>>24&255,se[ce+1]=de>>16&255,se[ce+2]=de>>8&255,se[ce+3]=de&255,se.set(ue,ce+4),ce+=de+4}k=se,A=te;var fe=!0}else fe=!1;if(fe){E==null&&M.dts!=null&&(E=M.dts);var pe=void 0;pe=j+1<O.length?(O[j+1].dts||0)-(M.dts||0):O.length>1?(M.dts||0)-(O[j-1].dts||0):(n.endTime-n.startTime)*9e4,T.push({data:k,size:k.byteLength,duration:pe,ob:Math.round((M.pts||0)-(M.dts||0)),flags:A?bk:xk})}}var me=jk(D);if(!me||E==null)throw new R(2,3,3018,n?n.P()[0]:null);t.height=t.height||me.height,t.width=t.width||me.width,d={id:t.id,type:`video`,codecs:`hvc1`,timescale:9e4,duration:r,zb:[],Aa:new Uint8Array([]),Ta:me.Ta,Za:me.Za,$a:me.$a,data:{sequenceNumber:this.g,baseMediaDecodeTime:E,ub:T},stream:t}}d&&(l.push(d),d=null)}if(i==`audio`){switch(u.audio){case`aac`:for(var he=[],ge,_e=null,ve=null,I=null,ye=g(c.rb()),be=ye.next();!be.done;be=ye.next()){var xe=be.value,Se=xe.data;if(Se){var Ce=0;if(ve==-1&&I)Se=z(I,xe.data),ve=null;else if(ve!=null&&I){Ce=Math.max(0,ve);var we=z(I,Se.subarray(0,Ce));he.push({data:we,size:we.byteLength,duration:1024,ob:0,flags:yk}),ve=I=null}if(ge=gk(Se,Ce),!ge)throw new R(2,3,3018,n?n.P()[0]:null);for(t.audioSamplingRate=ge.sampleRate,t.channelsCount=ge.channelCount,_e==null&&xe.pts!==null&&(_e=xe.pts);Ce<Se.length;){var Te=hk(Se,Ce);if(!Te){I=Se.subarray(Ce,Se.length),ve=-1;break}var Ee=Te.Yd+Te.ka;ve=Math.max(0,Ce+Ee-Se.length),ve==0?Ce+Ee<=Se.length&&he.push({data:Se.subarray(Ce+Te.Yd,Ce+Ee),size:Te.ka,duration:1024,ob:0,flags:yk}):I=Se.subarray(Ce+Te.Yd,Ce+Ee),Ce+=Ee}}}if(!ge||_e==null){_e=n.startTime*9e4;var De=jt(`audio`,t.codecs.split(`,`));if(!De||!t.channelsCount||!t.audioSamplingRate)throw new R(2,3,3018,n?n.P()[0]:null);ge={sampleRate:t.audioSamplingRate,channelCount:t.channelsCount,codec:De};var Oe=vk(De,t.channelsCount);if(!Oe)throw new R(2,3,3018,n?n.P()[0]:null);for(var L=_e+(n.endTime-n.startTime)*9e4,ke=_e;ke<L;)he.push({data:Oe,size:Oe.byteLength,duration:1024,ob:0,flags:yk}),ke+=1024/ge.sampleRate*9e4}var Ae=ge.sampleRate,je=_e/9e4*Ae;d={id:t.id,type:`audio`,codecs:ge.codec,timescale:Ae,duration:r,zb:[],Aa:new Uint8Array([]),Ta:new Uint8Array([]),Za:0,$a:0,data:{sequenceNumber:this.g,baseMediaDecodeTime:je,ub:he},stream:t};break;case`ac3`:for(var Me=[],Ne=0,Pe=new Uint8Array([]),Fe=null,Ie={sampleRate:0,channelCount:0,Aa:/* @__PURE__ */ new Uint8Array,ka:0},Le=g(c.rb()),Re=Le.next();!Re.done;Re=Le.next()){var ze=Re.value,Be=ze.data;Fe==null&&ze.pts!==null&&(Fe=ze.pts);for(var Ve=0;Ve<Be.length;)Ck(Be,Ve,Ie)?(t.audioSamplingRate=Ie.sampleRate,t.channelsCount=Ie.channelCount,Ne=Ie.sampleRate,Pe=Ie.Aa,Me.push({data:Be.subarray(Ve,Ve+Ie.ka),size:Ie.ka,duration:1536,ob:0,flags:yk}),Ve+=Ie.ka):Ve++}if(Ne==0||Pe.byteLength==0||Fe==null)throw new R(2,3,3018,n?n.P()[0]:null);var He=Fe/9e4*Ne;d={id:t.id,type:`audio`,codecs:`ac-3`,timescale:Ne,duration:r,zb:[],Aa:Pe,Ta:new Uint8Array([]),Za:0,$a:0,data:{sequenceNumber:this.g,baseMediaDecodeTime:He,ub:Me},stream:t};break;case`ec3`:for(var Ue=[],We=0,Ge=new Uint8Array([]),Ke=null,qe={sampleRate:0,channelCount:0,Aa:/* @__PURE__ */ new Uint8Array,ka:0},Je=g(c.rb()),Ye=Je.next();!Ye.done;Ye=Je.next()){var Xe=Ye.value,Qe=Xe.data;Ke==null&&Xe.pts!==null&&(Ke=Xe.pts);for(var $e=0;$e<Qe.length;)Ek(Qe,$e,qe)?(t.audioSamplingRate=qe.sampleRate,t.channelsCount=qe.channelCount,We=qe.sampleRate,Ge=qe.Aa,Ue.push({data:Qe.subarray($e,$e+qe.ka),size:qe.ka,duration:1536,ob:0,flags:yk}),$e+=qe.ka):$e++}if(We==0||Ge.byteLength==0||Ke==null)throw new R(2,3,3018,n?n.P()[0]:null);var et=Ke/9e4*We;d={id:t.id,type:`audio`,codecs:`ec-3`,timescale:We,duration:r,zb:[],Aa:Ge,Ta:new Uint8Array([]),Za:0,$a:0,data:{sequenceNumber:this.g,baseMediaDecodeTime:et,ub:Ue},stream:t};break;case`mp3`:for(var tt=[],nt,rt=null,it=g(c.rb()),at=it.next();!at.done;at=it.next()){var ot=at.value,st=ot.data;if(st){rt==null&&ot.pts!==null&&(rt=ot.pts);for(var ct=0;ct<st.length;){var lt=Ik(st,ct);lt?(nt||(nt=lt),ct+lt.ka<=st.length&&tt.push({data:st.subarray(ct,ct+lt.ka),size:lt.ka,duration:1152,ob:0,flags:yk}),ct+=lt.ka):ct++}}}if(!nt||rt==null)throw new R(2,3,3018,n?n.P()[0]:null);var ut=nt.sampleRate,dt=rt/9e4*ut;d={id:t.id,type:`audio`,codecs:`mp3`,timescale:ut,duration:r,zb:[],Aa:new Uint8Array([]),Ta:new Uint8Array([]),Za:0,$a:0,data:{sequenceNumber:this.g,baseMediaDecodeTime:dt,ub:tt},stream:t};break;case`opus`:var ft=[],pt=null,mt=c.J;if(!mt)throw new R(2,3,3018,n?n.P()[0]:null);var ht=[];switch(mt.sj){case 1:case 2:ht=[0];break;case 0:ht=[255,1,1,0,1];break;case 128:ht=[255,2,0,0,1];break;case 3:ht=[1,2,1,0,2,1];break;case 4:ht=[1,2,2,0,1,2,3];break;case 5:ht=[1,3,2,0,4,1,2,3];break;case 6:ht=[1,4,2,0,4,1,2,3,5];break;case 7:ht=[1,4,2,0,4,1,2,3,5,6];break;case 8:ht=[1,5,3,0,6,1,2,3,4,5,7];break;case 130:ht=[1,1,2,0,1];break;case 131:ht=[1,1,3,0,1,2];break;case 132:ht=[1,1,4,0,1,2,3];break;case 133:ht=[1,1,5,0,1,2,3,4];break;case 134:ht=[1,1,6,0,1,2,3,4,5];break;case 135:ht=[1,1,7,0,1,2,3,4,5,6];break;case 136:ht=[1,1,8,0,1,2,3,4,5,6,7]}for(var gt=new Uint8Array([0,mt.channelCount,0,0,mt.sampleRate>>>24&255,mt.sampleRate>>>17&255,mt.sampleRate>>>8&255,mt.sampleRate>>>0&255,0,0].concat(_(ht))),_t=mt.sampleRate,vt=g(c.rb()),yt=vt.next();!yt.done;yt=vt.next()){var bt=yt.value,xt=bt.data;pt==null&&bt.pts!==null&&(pt=bt.pts);for(var St=0;St<xt.length;){for(var Ct=!!(xt[St+1]&16),wt=!!(xt[St+1]&8),Tt=St+2,Et=0;xt[Tt]===255;)Et+=255,Tt+=1;Et+=xt[Tt],Tt+=1,Tt+=Ct?2:0,Tt+=wt?2:0;var Dt=xt.slice(Tt,Tt+Et);ft.push({data:Dt,size:Dt.byteLength,duration:Yk(Dt),ob:0,flags:yk}),St=Tt+Et}}if(gt.byteLength==0||pt==null)throw new R(2,3,3018,n?n.P()[0]:null);t.audioSamplingRate=mt.sampleRate,t.channelsCount=mt.channelCount;var Ot=pt/9e4*_t;d={id:t.id,type:`audio`,codecs:`opus`,timescale:_t,duration:r,zb:[],Aa:gt,Ta:new Uint8Array([]),Za:0,$a:0,data:{sequenceNumber:this.g,baseMediaDecodeTime:Ot,ub:ft},stream:t}}d&&(l.push(d),d=null)}}catch(e){return e&&e.code==3023?Promise.resolve(new Uint8Array([])):Promise.reject(e)}if(!l.length)return Promise.reject(new R(2,3,3018,n?n.P()[0]:null));var kt=new us(l),At=t.id+`_`+n.i;if(this.j.has(At))var Mt=this.j.get(At);else Mt=ds(kt),this.j.set(At,Mt);var Nt=this.l!==Mt,Pt=_s(kt);return this.l=Mt,this.g++,Promise.resolve({data:Pt,init:Nt?Mt:null})},P(`shaka.transmuxer.TsTransmuxer`,Zk),Zk.prototype.transmux=Zk.prototype.transmux,Zk.prototype.getOriginalMimeType=Zk.prototype.getOriginalMimeType,Zk.prototype.convertCodecs=Zk.prototype.convertCodecs,Zk.prototype.isSupported=Zk.prototype.isSupported,Zk.prototype.destroy=Zk.prototype.destroy;var Qk=[`aac`,`ac-3`,`ec-3`,`mp3`,`opus`],$k=[`avc`,`hevc`];xr(`video/mp2t`,function(){return new Zk(`video/mp2t`)},Er);function eA(){}m(eA,Gd),P(`shaka.util.FairPlayUtils`,eA)}).call(n,t,t,void 0),e!==void 0)for(var r in n.shaka)e[r]=n.shaka[r];else typeof define==`function`&&define.amd?define(function(){return n.shaka}):t.shaka=n.shaka})()})))(),1);function l(e,t,n){return(t=d(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function d(e){var t=u(e,`string`);return typeof t==`symbol`?t:t+``}function f(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function m(e,t,n){return t&&p(e.prototype,t),n&&p(e,n),e}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?g(Object(n),!0).forEach(function(t){h(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var v={addCSS:!0,thumbWidth:15,watch:!0};function y(e,t){return function(){return Array.from(document.querySelectorAll(t)).includes(this)}.call(e,t)}function b(e,t){if(e&&t){var n=new Event(t,{bubbles:!0});e.dispatchEvent(n)}}var x=function(e){return e==null?null:e.constructor},S=function(e,t){return!!(e&&t&&e instanceof t)},C=function(e){return e==null},w=function(e){return x(e)===Object},T=function(e){return x(e)===Number&&!Number.isNaN(e)},E=function(e){return x(e)===String},D=function(e){return x(e)===Boolean},O=function(e){return x(e)===Function},k=function(e){return Array.isArray(e)},A=function(e){return S(e,NodeList)},j={nullOrUndefined:C,object:w,number:T,string:E,boolean:D,function:O,array:k,nodeList:A,element:function(e){return S(e,Element)},event:function(e){return S(e,Event)},empty:function(e){return C(e)||(E(e)||k(e)||A(e))&&!e.length||w(e)&&!Object.keys(e).length}};function M(e){var t=`${e}`.match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}function ee(e,t){if(1>t){var n=M(t);return parseFloat(e.toFixed(n))}return Math.round(e/t)*t}var te=function(){function e(t,n){f(this,e),j.element(t)?this.element=t:j.string(t)&&(this.element=document.querySelector(t)),j.element(this.element)&&j.empty(this.element.rangeTouch)&&(this.config=_({},v,{},n),this.init())}return m(e,[{key:`init`,value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect=`none`,this.element.style.webKitUserSelect=`none`,this.element.style.touchAction=`manipulation`),this.listeners(!0),this.element.rangeTouch=this)}},{key:`destroy`,value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect=``,this.element.style.webKitUserSelect=``,this.element.style.touchAction=``),this.listeners(!1),this.element.rangeTouch=null)}},{key:`listeners`,value:function(e){var t=this,n=e?`addEventListener`:`removeEventListener`;[`touchstart`,`touchmove`,`touchend`].forEach(function(e){t.element[n](e,function(e){return t.set(e)},!1)})}},{key:`get`,value:function(t){if(!e.enabled||!j.event(t))return null;var n,r=t.target,i=t.changedTouches[0],a=parseFloat(r.getAttribute(`min`))||0,o=parseFloat(r.getAttribute(`max`))||100,s=parseFloat(r.getAttribute(`step`))||1,c=r.getBoundingClientRect(),l=100/c.width*(this.config.thumbWidth/2)/100;return 0>(n=100/c.width*(i.clientX-c.left))?n=0:100<n&&(n=100),50>n?n-=(100-2*n)*l:50<n&&(n+=2*(n-50)*l),a+ee(n/100*(o-a),s)}},{key:`set`,value:function(t){e.enabled&&j.event(t)&&!t.target.disabled&&(t.preventDefault(),t.target.value=this.get(t),b(t.target,t.type===`touchend`?`change`:`input`))}}],[{key:`setup`,value:function(t){var n=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},r=null;if(j.empty(t)||j.string(t)?r=Array.from(document.querySelectorAll(j.string(t)?t:`input[type="range"]`)):j.element(t)?r=[t]:j.nodeList(t)?r=Array.from(t):j.array(t)&&(r=t.filter(j.element)),j.empty(r))return null;var i=_({},v,{},n);return j.string(t)&&i.watch&&new MutationObserver(function(n){Array.from(n).forEach(function(n){Array.from(n.addedNodes).forEach(function(n){j.element(n)&&y(n,t)&&new e(n,i)})})}).observe(document.body,{childList:!0,subtree:!0}),r.map(function(t){return new e(t,n)})}},{key:`enabled`,get:function(){return`ontouchstart`in document.documentElement}}]),e}(),N=e=>e==null?null:e.constructor,ne=(e,t)=>!!(e&&t&&e instanceof t),re=e=>e==null,P=e=>N(e)===Object,ie=e=>N(e)===Number&&!Number.isNaN(e),ae=e=>N(e)===String,oe=e=>N(e)===Boolean,se=e=>typeof e==`function`,ce=e=>Array.isArray(e),F=e=>ne(e,WeakMap),le=e=>ne(e,NodeList),ue=e=>N(e)===Text,de=e=>ne(e,Event),fe=e=>ne(e,KeyboardEvent),pe=e=>ne(e,window.TextTrackCue)||ne(e,window.VTTCue),me=e=>ne(e,TextTrack)||!re(e)&&ae(e.kind),he=e=>ne(e,Promise)&&se(e.then);function ge(e){return typeof e==`object`&&!!e&&e.nodeType===1&&typeof e.style==`object`&&typeof e.ownerDocument==`object`}function _e(e){return re(e)||(ae(e)||ce(e)||le(e))&&!e.length||P(e)&&!Object.keys(e).length}function ve(e){if(ne(e,window.URL))return!0;if(!ae(e))return!1;let t=e;(!e.startsWith(`http://`)||!e.startsWith(`https://`))&&(t=`http://${e}`);try{return!_e(new URL(t).hostname)}catch{return!1}}var I={nullOrUndefined:re,object:P,number:ie,string:ae,boolean:oe,function:se,array:ce,weakMap:F,nodeList:le,element:ge,textNode:ue,event:de,keyboardEvent:fe,cue:pe,track:me,promise:he,url:ve,empty:_e},ye=(()=>{let e=document.createElement(`span`),t={WebkitTransition:`webkitTransitionEnd`,MozTransition:`transitionend`,OTransition:`oTransitionEnd otransitionend`,transition:`transitionend`},n=Object.keys(t).find(t=>e.style[t]!==void 0);return I.string(n)?t[n]:!1})();function be(e,t){setTimeout(()=>{try{e.hidden=!0,e.offsetHeight,e.hidden=!1}catch{}},t)}function xe(e){return JSON.parse(JSON.stringify(e))}function Se(e,t){return t.split(`.`).reduce((e,t)=>e&&e[t],e)}function Ce(e={},...t){if(!t.length)return e;let n=t.shift();return I.object(n)?(Object.keys(n).forEach(t=>{I.object(n[t])?(Object.keys(e).includes(t)||Object.assign(e,{[t]:{}}),Ce(e[t],n[t])):Object.assign(e,{[t]:n[t]})}),Ce(e,...t)):e}function we(e,t){let n=e.length?e:[e];Array.from(n).reverse().forEach((e,n)=>{let r=n>0?t.cloneNode(!0):t,i=e.parentNode,a=e.nextSibling;r.appendChild(e),a?i.insertBefore(r,a):i.appendChild(r)})}function Te(e,t){I.element(e)&&!I.empty(t)&&Object.entries(t).filter(([,e])=>!I.nullOrUndefined(e)).forEach(([t,n])=>e.setAttribute(t,n))}function Ee(e,t,n){let r=document.createElement(e);return I.object(t)&&Te(r,t),I.string(n)&&(r.textContent=n),r}function De(e,t){I.element(e)&&I.element(t)&&t.parentNode.insertBefore(e,t.nextSibling)}function Oe(e,t,n,r){I.element(t)&&t.appendChild(Ee(e,n,r))}function L(e){I.nodeList(e)||I.array(e)?Array.from(e).forEach(L):I.element(e)&&I.element(e.parentNode)&&e.parentNode.removeChild(e)}function ke(e){if(!I.element(e))return;let{length:t}=e.childNodes;for(;t>0;)e.removeChild(e.lastChild),--t}function Ae(e,t){return!I.element(t)||!I.element(t.parentNode)||!I.element(e)?null:(t.parentNode.replaceChild(e,t),e)}function je(e,t){if(!I.string(e)||I.empty(e))return{};let n={},r=Ce({},t);return e.split(`,`).forEach(e=>{let t=e.trim(),i=t.replace(`.`,``),a=t.replace(/[[\]]/g,``).split(`=`),[o]=a,s=a.length>1?a[1].replace(/["']/g,``):``;switch(t.charAt(0)){case`.`:I.string(r.class)?n.class=`${r.class} ${i}`:n.class=i;break;case`#`:n.id=t.replace(`#`,``);break;case`[`:n[o]=s}}),Ce(r,n)}function Me(e,t){if(!I.element(e))return;let n=t;I.boolean(n)||(n=!e.hidden),e.hidden=n}function Ne(e,t,n){if(I.nodeList(e))return Array.from(e).map(e=>Ne(e,t,n));if(I.element(e)){let r=`toggle`;return n!==void 0&&(r=n?`add`:`remove`),e.classList[r](t),e.classList.contains(t)}return!1}function Pe(e,t){return I.element(e)&&e.classList.contains(t)}function Fe(e,t){let{prototype:n}=Element;function r(){return Array.from(document.querySelectorAll(t)).includes(this)}return(n.matches||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector||r).call(e,t)}function Ie(e,t){let{prototype:n}=Element;function r(){let e=this;do{if(Fe.matches(e,t))return e;e=e.parentElement||e.parentNode}while(e!==null&&e.nodeType===1);return null}return(n.closest||r).call(e,t)}function Le(e){return this.elements.container.querySelectorAll(e)}function Re(e){return this.elements.container.querySelector(e)}function ze(e=null,t=!1){I.element(e)&&e.focus({preventScroll:!0,focusVisible:t})}var Be={"audio/ogg":`vorbis`,"audio/wav":`1`,"video/webm":`vp8, vorbis`,"video/mp4":`avc1.42E01E, mp4a.40.2`,"video/ogg":`theora`},Ve={audio:`canPlayType`in document.createElement(`audio`),video:`canPlayType`in document.createElement(`video`),check(e,t){let n=Ve[e]||t!==`html5`;return{api:n,ui:n&&Ve.rangeInput}},pip:document.pictureInPictureEnabled&&!Ee(`video`).disablePictureInPicture,airplay:I.function(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:`playsInline`in document.createElement(`video`),mime(e){if(I.empty(e))return!1;let[t]=e.split(`/`),n=e;if(!this.isHTML5||t!==this.type)return!1;Object.keys(Be).includes(n)&&(n+=`; codecs="${Be[e]}"`);try{return!!(n&&this.media.canPlayType(n).replace(/no/,``))}catch{return!1}},textTracks:`textTracks`in document.createElement(`video`),rangeInput:(()=>{let e=document.createElement(`input`);return e.type=`range`,e.type===`range`})(),touch:`ontouchstart`in document.documentElement,transitions:ye!==!1,reducedMotion:`matchMedia`in window&&window.matchMedia(`(prefers-reduced-motion)`).matches},He=(()=>{let e=!1;try{let t=Object.defineProperty({},"passive",{get(){return e=!0,null}});window.addEventListener(`test`,null,t),window.removeEventListener(`test`,null,t)}catch{}return e})();function Ue(e,t,n,r=!1,i=!0,a=!1){if(!e||!(`addEventListener`in e)||I.empty(t)||!I.function(n))return;let o=t.split(` `),s=a;He&&(s={passive:i,capture:a}),o.forEach(t=>{this&&this.eventListeners&&r&&this.eventListeners.push({element:e,type:t,callback:n,options:s}),e[r?`addEventListener`:`removeEventListener`](t,n,s)})}function We(e,t=``,n,r=!0,i=!1){Ue.call(this,e,t,n,!0,r,i)}function Ge(e,t=``,n,r=!0,i=!1){Ue.call(this,e,t,n,!1,r,i)}function Ke(e,t=``,n,r=!0,i=!1){let a=(...o)=>{Ge(e,t,a,r,i),n.apply(this,o)};Ue.call(this,e,t,a,!0,r,i)}function qe(e,t=``,n=!1,r={}){if(!I.element(e)||I.empty(t))return;let i=new CustomEvent(t,{bubbles:n,detail:{...r,plyr:this}});e.dispatchEvent(i)}function Je(){this&&this.eventListeners&&(this.eventListeners.forEach(e=>{let{element:t,type:n,callback:r,options:i}=e;t.removeEventListener(n,r,i)}),this.eventListeners=[])}function Ye(){return new Promise(e=>this.ready?setTimeout(e,0):We.call(this,this.elements.container,`ready`,e)).then(()=>{})}function Xe(e){I.promise(e)&&e.then(null,()=>{})}function Ze(e){return I.array(e)?e.filter((t,n)=>e.indexOf(t)===n):e}function Qe(e,t){return!I.array(e)||!e.length?null:e.reduce((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)}function $e(e){return!window||!window.CSS?!1:window.CSS.supports(e)}var et=[[1,1],[4,3],[3,4],[5,4],[4,5],[3,2],[2,3],[16,10],[10,16],[16,9],[9,16],[21,9],[9,21],[32,9],[9,32]].reduce((e,[t,n])=>({...e,[t/n]:[t,n]}),{});function tt(e){return!I.array(e)&&(!I.string(e)||!e.includes(`:`))?!1:(I.array(e)?e:e.split(`:`)).map(Number).every(I.number)}function nt(e){if(!I.array(e)||!e.every(I.number))return null;let[t,n]=e,r=(e,t)=>t===0?e:r(t,e%t),i=r(t,n);return[t/i,n/i]}function rt(e){let t=e=>tt(e)?e.split(`:`).map(Number):null,n=t(e);if(n===null&&(n=t(this.config.ratio)),n===null&&!I.empty(this.embed)&&I.array(this.embed.ratio)&&({ratio:n}=this.embed),n===null&&this.isHTML5){let{videoWidth:e,videoHeight:t}=this.media;n=[e,t]}return nt(n)}function it(e){if(!this.isVideo)return{};let{wrapper:t}=this.elements,n=rt.call(this,e);if(!I.array(n))return{};let[r,i]=nt(n),a=$e(`aspect-ratio: ${r}/${i}`),o=100/r*i;if(a?t.style.aspectRatio=`${r}/${i}`:t.style.paddingBottom=`${o}%`,this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){let e=100/this.media.offsetWidth*Number.parseInt(window.getComputedStyle(this.media).paddingBottom,10),n=(e-o)/(e/50);this.fullscreen.active?t.style.paddingBottom=null:this.media.style.transform=`translateY(-${n}%)`}else this.isHTML5&&t.classList.add(this.config.classNames.videoFixedRatio);return{padding:o,ratio:n}}function at(e,t,n=.05){let r=e/t,i=Qe(Object.keys(et),r);return Math.abs(i-r)<=n?et[i]:[e,t]}function ot(){return[Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)]}var st={getSources(){return this.isHTML5?Array.from(this.media.querySelectorAll(`source`)).filter(e=>{let t=e.getAttribute(`type`);return I.empty(t)?!0:Ve.mime.call(this,t)}):[]},getQualityOptions(){return this.config.quality.forced?this.config.quality.options:st.getSources.call(this).map(e=>Number(e.getAttribute(`size`))).filter(Boolean)},setup(){if(!this.isHTML5)return;let e=this;e.options.speed=e.config.speed.options,I.empty(this.config.ratio)||it.call(e),Object.defineProperty(e.media,"quality",{get(){let t=st.getSources.call(e).find(t=>t.getAttribute(`src`)===e.source);return t&&Number(t.getAttribute(`size`))},set(t){if(e.quality!==t){if(e.config.quality.forced&&I.function(e.config.quality.onChange))e.config.quality.onChange(t);else{let n=st.getSources.call(e).find(e=>Number(e.getAttribute(`size`))===t);if(!n)return;let{currentTime:r,paused:i,preload:a,readyState:o,playbackRate:s}=e.media;e.media.src=n.getAttribute(`src`),(a!==`none`||o)&&(e.once(`loadedmetadata`,()=>{e.speed=s,e.currentTime=r,i||Xe(e.play())}),e.media.load())}qe.call(e,e.media,`qualitychange`,!1,{quality:t})}}})},cancelRequests(){this.isHTML5&&(L(st.getSources.call(this)),this.media.setAttribute(`src`,this.config.blankVideo),this.media.load(),this.debug.log(`Cancelled network requests`))}},ct={isIE:!!window.document.documentMode,isEdge:/Edge/.test(navigator.userAgent),isWebKit:`WebkitAppearance`in document.documentElement.style&&!/Edge/.test(navigator.userAgent),isIPadOS:navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1,isIos:/iPad|iPhone|iPod/i.test(navigator.userAgent)&&navigator.maxTouchPoints>1};function lt(e){return`${e}-${Math.floor(Math.random()*1e4)}`}function ut(e,...t){return I.empty(e)?e:e.toString().replace(/\{(\d+)\}/g,(e,n)=>t[n].toString())}function R(e,t){return e===0||t===0||Number.isNaN(e)||Number.isNaN(t)?0:(e/t*100).toFixed(2)}function dt(e=``,t=``,n=``){return e.replace(new RegExp(t.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,`\\$1`),`g`),n.toString())}function ft(e=``){return e.toString().replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase())}function pt(e=``){let t=e.toString();return t=dt(t,`-`,` `),t=dt(t,`_`,` `),t=ft(t),dt(t,` `,``)}function mt(e=``){let t=e.toString();return t=pt(t),t.charAt(0).toLowerCase()+t.slice(1)}function ht(e){let t=document.createDocumentFragment(),n=document.createElement(`div`);return t.appendChild(n),n.innerHTML=e,t.firstChild.textContent}function gt(e){let t=document.createElement(`div`);return t.appendChild(e),t.innerHTML}var _t={pip:`PIP`,airplay:`AirPlay`,html5:`HTML5`,vimeo:`Vimeo`,youtube:`YouTube`},vt={get(e=``,t={}){if(I.empty(e)||I.empty(t))return``;let n=Se(t.i18n,e);if(I.empty(n))return Object.keys(_t).includes(e)?_t[e]:``;let r={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(r).forEach(([e,t])=>{n=dt(n,e,t)}),n}},yt=class e{constructor(t){l(this,`get`,t=>{if(!e.supported||!this.enabled)return null;let n=window.localStorage.getItem(this.key);if(I.empty(n))return null;let r=JSON.parse(n);return I.string(t)&&t.length?r[t]:r}),l(this,`set`,t=>{if(!e.supported||!this.enabled||!I.object(t))return;let n=this.get();I.empty(n)&&(n={}),Ce(n,t);try{window.localStorage.setItem(this.key,JSON.stringify(n))}catch{}}),this.enabled=t.config.storage.enabled,this.key=t.config.storage.key}static get supported(){try{if(!(`localStorage`in window))return!1;let e=`___test`;return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch{return!1}}};function bt(e,t=`text`,n=!1){return new Promise((r,i)=>{try{let i=new XMLHttpRequest;if(!(`withCredentials`in i))return;n&&(i.withCredentials=!0),i.addEventListener(`load`,()=>{if(t===`text`)try{r(JSON.parse(i.responseText))}catch{r(i.responseText)}else r(i.response)}),i.addEventListener(`error`,()=>{throw Error(i.status)}),i.open(`GET`,e,!0),i.responseType=t,i.send()}catch(e){i(e)}})}function xt(e,t){if(!I.string(e))return;let n=`cache`,r=I.string(t),i=!1,a=()=>document.getElementById(t)!==null,o=(e,t)=>{e.innerHTML=t,!(r&&a())&&document.body.insertAdjacentElement(`afterbegin`,e)};if(!r||!a()){let a=yt.supported,s=document.createElement(`div`);if(s.setAttribute(`hidden`,``),r&&s.setAttribute(`id`,t),a){let e=window.localStorage.getItem(`${n}-${t}`);i=e!==null,i&&o(s,JSON.parse(e).content)}bt(e).then(e=>{if(!I.empty(e)){if(a)try{window.localStorage.setItem(`${n}-${t}`,JSON.stringify({content:e}))}catch{}o(s,e)}}).catch(()=>{})}}var St=e=>Math.trunc(e/60/60%60,10),Ct=e=>Math.trunc(e/60%60,10),wt=e=>Math.trunc(e%60,10);function Tt(e=0,t=!1,n=!1){if(!I.number(e))return Tt(void 0,t,n);let r=e=>`0${e}`.slice(-2),i=St(e),a=Ct(e),o=wt(e);return i=t||i>0?`${i}:`:``,`${n&&e>0?`-`:``}${i}${r(a)}:${r(o)}`}var z={getIconUrl(){let e=new URL(this.config.iconUrl,window.location),t=window.location.host?window.location.host:window.top.location.host,n=e.host!==t||ct.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:n}},findElements(){try{return this.elements.controls=Re.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:Le.call(this,this.config.selectors.buttons.play),pause:Re.call(this,this.config.selectors.buttons.pause),restart:Re.call(this,this.config.selectors.buttons.restart),rewind:Re.call(this,this.config.selectors.buttons.rewind),fastForward:Re.call(this,this.config.selectors.buttons.fastForward),mute:Re.call(this,this.config.selectors.buttons.mute),pip:Re.call(this,this.config.selectors.buttons.pip),airplay:Re.call(this,this.config.selectors.buttons.airplay),settings:Re.call(this,this.config.selectors.buttons.settings),captions:Re.call(this,this.config.selectors.buttons.captions),fullscreen:Re.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=Re.call(this,this.config.selectors.progress),this.elements.inputs={seek:Re.call(this,this.config.selectors.inputs.seek),volume:Re.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:Re.call(this,this.config.selectors.display.buffer),currentTime:Re.call(this,this.config.selectors.display.currentTime),duration:Re.call(this,this.config.selectors.display.duration)},I.element(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(`.${this.config.classNames.tooltip}`)),!0}catch(e){return this.debug.warn(`It looks like there is a problem with your custom controls HTML`,e),this.toggleNativeControls(!0),!1}},createIcon(e,t){let n=`http://www.w3.org/2000/svg`,r=z.getIconUrl.call(this),i=`${r.cors?``:r.url}#${this.config.iconPrefix}`,a=document.createElementNS(n,`svg`);Te(a,Ce(t,{"aria-hidden":`true`,focusable:`false`}));let o=document.createElementNS(n,`use`),s=`${i}-${e}`;return`href`in o&&o.setAttributeNS(`http://www.w3.org/1999/xlink`,`href`,s),o.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,s),a.appendChild(o),a},createLabel(e,t={}){let n=vt.get(e,this.config);return Ee(`span`,{...t,class:[t.class,this.config.classNames.hidden].filter(Boolean).join(` `)},n)},createBadge(e){if(I.empty(e))return null;let t=Ee(`span`,{class:this.config.classNames.menu.value});return t.appendChild(Ee(`span`,{class:this.config.classNames.menu.badge},e)),t},createButton(e,t){let n=Ce({},t),r=mt(e),i={element:`button`,toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch([`element`,`icon`,`label`].forEach(e=>{Object.keys(n).includes(e)&&(i[e]=n[e],delete n[e])}),i.element===`button`&&!Object.keys(n).includes(`type`)&&(n.type=`button`),Object.keys(n).includes(`class`)?n.class.split(` `).includes(this.config.classNames.control)||Ce(n,{class:`${n.class} ${this.config.classNames.control}`}):n.class=this.config.classNames.control,e){case`play`:i.toggle=!0,i.label=`play`,i.labelPressed=`pause`,i.icon=`play`,i.iconPressed=`pause`;break;case`mute`:i.toggle=!0,i.label=`mute`,i.labelPressed=`unmute`,i.icon=`volume`,i.iconPressed=`muted`;break;case`captions`:i.toggle=!0,i.label=`enableCaptions`,i.labelPressed=`disableCaptions`,i.icon=`captions-off`,i.iconPressed=`captions-on`;break;case`fullscreen`:i.toggle=!0,i.label=`enterFullscreen`,i.labelPressed=`exitFullscreen`,i.icon=`enter-fullscreen`,i.iconPressed=`exit-fullscreen`;break;case`play-large`:n.class+=` ${this.config.classNames.control}--overlaid`,r=`play`,i.label=`play`,i.icon=`play`;break;default:I.empty(i.label)&&(i.label=r),I.empty(i.icon)&&(i.icon=e)}let a=Ee(i.element);return i.toggle?(a.appendChild(z.createIcon.call(this,i.iconPressed,{class:`icon--pressed`})),a.appendChild(z.createIcon.call(this,i.icon,{class:`icon--not-pressed`})),a.appendChild(z.createLabel.call(this,i.labelPressed,{class:`label--pressed`})),a.appendChild(z.createLabel.call(this,i.label,{class:`label--not-pressed`}))):(a.appendChild(z.createIcon.call(this,i.icon)),a.appendChild(z.createLabel.call(this,i.label))),Ce(n,je(this.config.selectors.buttons[r],n)),Te(a,n),r===`play`?(I.array(this.elements.buttons[r])||(this.elements.buttons[r]=[]),this.elements.buttons[r].push(a)):this.elements.buttons[r]=a,a},createRange(e,t){let n=Ee(`input`,Ce(je(this.config.selectors.inputs[e]),{type:`range`,min:0,max:100,step:.01,value:0,autocomplete:`off`,role:`slider`,"aria-label":vt.get(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=n,z.updateRangeFill.call(this,n),te.setup(n),n},createProgress(e,t){let n=Ee(`progress`,Ce(je(this.config.selectors.display[e]),{min:0,max:100,value:0,role:`progressbar`,"aria-hidden":!0},t));if(e!==`volume`){n.appendChild(Ee(`span`,null,`0`));let t={played:`played`,buffer:`buffered`}[e];n.textContent=`% ${(t?vt.get(t,this.config):``).toLowerCase()}`}return this.elements.display[e]=n,n},createTime(e,t){let n=je(this.config.selectors.display[e],t),r=Ee(`div`,Ce(n,{class:`${n.class?n.class:``} ${this.config.classNames.display.time} `.trim(),"aria-label":vt.get(e,this.config),role:`timer`}),`00:00`);return this.elements.display[e]=r,r},bindMenuItemShortcuts(e,t){We.call(this,e,`keydown keyup`,n=>{if(![` `,`ArrowUp`,`ArrowDown`,`ArrowRight`].includes(n.key)||(n.preventDefault(),n.stopPropagation(),n.type===`keydown`))return;let r=Fe(e,`[role="menuitemradio"]`);if(!r&&[` `,`ArrowRight`].includes(n.key))z.showMenuPanel.call(this,t,!0);else{let t;n.key!==` `&&(n.key===`ArrowDown`||r&&n.key===`ArrowRight`?(t=e.nextElementSibling,I.element(t)||(t=e.parentNode.firstElementChild)):(t=e.previousElementSibling,I.element(t)||(t=e.parentNode.lastElementChild)),ze.call(this,t,!0))}},!1),We.call(this,e,`keyup`,e=>{e.key===`Return`&&z.focusFirstMenuItem.call(this,null,!0)})},createMenuItem({value:e,list:t,type:n,title:r,badge:i=null,checked:a=!1}){let o=je(this.config.selectors.inputs[n]),s=Ee(`button`,Ce(o,{type:`button`,role:`menuitemradio`,class:`${this.config.classNames.control} ${o.class?o.class:``}`.trim(),"aria-checked":a,value:e})),c=Ee(`span`);c.innerHTML=r,I.element(i)&&c.appendChild(i),s.appendChild(c),Object.defineProperty(s,"checked",{enumerable:!0,get(){return s.getAttribute(`aria-checked`)===`true`},set(e){e&&Array.from(s.parentNode.children).filter(e=>Fe(e,`[role="menuitemradio"]`)).forEach(e=>e.setAttribute(`aria-checked`,`false`)),s.setAttribute(`aria-checked`,e?`true`:`false`)}}),this.listeners.bind(s,`click keyup`,t=>{if(!(I.keyboardEvent(t)&&t.key!==` `)){switch(t.preventDefault(),t.stopPropagation(),s.checked=!0,n){case`language`:this.currentTrack=Number(e);break;case`quality`:this.quality=e;break;case`speed`:this.speed=Number.parseFloat(e)}z.showMenuPanel.call(this,`home`,I.keyboardEvent(t))}},n,!1),z.bindMenuItemShortcuts.call(this,s,n),t.appendChild(s)},formatTime(e=0,t=!1){return I.number(e)?Tt(e,St(this.duration)>0,t):e},updateTimeDisplay(e=null,t=0,n=!1){I.element(e)&&I.number(t)&&(e.textContent=z.formatTime(t,n))},updateVolume(){this.supported.ui&&(I.element(this.elements.inputs.volume)&&z.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),I.element(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||this.volume===0))},setRange(e,t=0){I.element(e)&&(e.value=t,z.updateRangeFill.call(this,e))},updateProgress(e){if(!this.supported.ui||!I.event(e))return;let t=0,n=(e,t)=>{let n=I.number(t)?t:0,r=I.element(e)?e:this.elements.display.buffer;if(I.element(r)){r.value=n;let e=r.getElementsByTagName(`span`)[0];I.element(e)&&(e.childNodes[0].nodeValue=n)}};if(e)switch(e.type){case`timeupdate`:case`seeking`:case`seeked`:t=R(this.currentTime,this.duration),e.type===`timeupdate`&&z.setRange.call(this,this.elements.inputs.seek,t);break;case`playing`:case`progress`:n(this.elements.display.buffer,this.buffered*100)}},updateRangeFill(e){let t=I.event(e)?e.target:e;if(I.element(t)&&t.getAttribute(`type`)===`range`){if(Fe(t,this.config.selectors.inputs.seek)){t.setAttribute(`aria-valuenow`,this.currentTime);let e=z.formatTime(this.currentTime),n=z.formatTime(this.duration),r=vt.get(`seekLabel`,this.config);t.setAttribute(`aria-valuetext`,r.replace(`{currentTime}`,e).replace(`{duration}`,n))}else if(Fe(t,this.config.selectors.inputs.volume)){let e=t.value*100;t.setAttribute(`aria-valuenow`,e),t.setAttribute(`aria-valuetext`,`${e.toFixed(1)}%`)}else t.setAttribute(`aria-valuenow`,t.value);(ct.isWebKit||ct.isIPadOS)&&t.style.setProperty(`--value`,`${t.value/t.max*100}%`)}},updateSeekTooltip(e){if(!this.config.tooltips.seek||!I.element(this.elements.inputs.seek)||!I.element(this.elements.display.seekTooltip)||this.duration===0)return;let t=this.elements.display.seekTooltip,n=`${this.config.classNames.tooltip}--visible`,r=e=>Ne(t,n,e);if(this.touch){r(!1);return}let i=0,a=this.elements.progress.getBoundingClientRect();if(I.event(e)){let t=e.pageX-e.clientX;i=100/a.width*(e.pageX-a.left-t)}else if(Pe(t,n))i=Number.parseFloat(t.style.left,10);else return;i<0?i=0:i>100&&(i=100);let o=this.duration/100*i;t.textContent=z.formatTime(o);let s=this.config.markers?.points?.find(({time:e})=>e===Math.round(o));s&&t.insertAdjacentHTML(`afterbegin`,`${s.label}<br>`),t.style.left=`${i}%`,I.event(e)&&[`mouseenter`,`mouseleave`].includes(e.type)&&r(e.type===`mouseenter`)},timeUpdate(e){let t=!I.element(this.elements.display.duration)&&this.config.invertTime;z.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),!(e&&e.type===`timeupdate`&&this.media.seeking)&&z.updateProgress.call(this,e)},durationUpdate(){if(!this.supported.ui||!this.config.invertTime&&this.currentTime)return;if(this.duration>=2**32){Me(this.elements.display.currentTime,!0),Me(this.elements.progress,!0);return}I.element(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute(`aria-valuemax`,this.duration);let e=I.element(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&z.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&z.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),this.config.markers.enabled&&z.setMarkers.call(this),z.updateSeekTooltip.call(this)},toggleMenuButton(e,t){Me(this.elements.settings.buttons[e],!t)},updateSetting(e,t,n){let r=this.elements.settings.panels[e],i=null,a=t;if(e===`captions`)i=this.currentTrack;else{if(i=I.empty(n)?this[e]:n,I.empty(i)&&(i=this.config[e].default),!I.empty(this.options[e])&&!this.options[e].includes(i)){this.debug.warn(`Unsupported value of '${i}' for ${e}`);return}if(!this.config[e].options.includes(i)){this.debug.warn(`Disabled value of '${i}' for ${e}`);return}}if(I.element(a)||(a=r&&r.querySelector(`[role="menu"]`)),!I.element(a))return;let o=this.elements.settings.buttons[e].querySelector(`.${this.config.classNames.menu.value}`);o.innerHTML=z.getLabel.call(this,e,i);let s=a&&a.querySelector(`[value="${i}"]`);I.element(s)&&(s.checked=!0)},getLabel(e,t){switch(e){case`speed`:return t===1?vt.get(`normal`,this.config):`${t}×`;case`quality`:if(I.number(t)){let e=vt.get(`qualityLabel.${t}`,this.config);return e.length?e:`${t}p`}return ft(t);case`captions`:return Ot.getLabel.call(this);default:return null}},setQualityMenu(e){if(!I.element(this.elements.settings.panels.quality))return;let t=`quality`,n=this.elements.settings.panels.quality.querySelector(`[role="menu"]`);I.array(e)&&(this.options.quality=Ze(e).filter(e=>this.config.quality.options.includes(e)));let r=!I.empty(this.options.quality)&&this.options.quality.length>1;if(z.toggleMenuButton.call(this,t,r),ke(n),z.checkMenu.call(this),!r)return;let i=e=>{let t=vt.get(`qualityBadge.${e}`,this.config);return t.length?z.createBadge.call(this,t):null};this.options.quality.sort((e,t)=>{let n=this.config.quality.options;return n.indexOf(e)>n.indexOf(t)?1:-1}).forEach(e=>{z.createMenuItem.call(this,{value:e,list:n,type:t,title:z.getLabel.call(this,`quality`,e),badge:i(e)})}),z.updateSetting.call(this,t,n)},setCaptionsMenu(){if(!I.element(this.elements.settings.panels.captions))return;let e=`captions`,t=this.elements.settings.panels.captions.querySelector(`[role="menu"]`),n=Ot.getTracks.call(this),r=!!n.length;if(z.toggleMenuButton.call(this,e,r),ke(t),z.checkMenu.call(this),!r)return;let i=n.map((e,n)=>({value:n,checked:this.captions.toggled&&this.currentTrack===n,title:Ot.getLabel.call(this,e),badge:e.language&&z.createBadge.call(this,e.language.toUpperCase()),list:t,type:`language`}));i.unshift({value:-1,checked:!this.captions.toggled,title:vt.get(`disabled`,this.config),list:t,type:`language`}),i.forEach(z.createMenuItem.bind(this)),z.updateSetting.call(this,e,t)},setSpeedMenu(){if(!I.element(this.elements.settings.panels.speed))return;let e=`speed`,t=this.elements.settings.panels.speed.querySelector(`[role="menu"]`);this.options.speed=this.options.speed.filter(e=>e>=this.minimumSpeed&&e<=this.maximumSpeed);let n=!I.empty(this.options.speed)&&this.options.speed.length>1;z.toggleMenuButton.call(this,e,n),ke(t),z.checkMenu.call(this),n&&(this.options.speed.forEach(n=>{z.createMenuItem.call(this,{value:n,list:t,type:e,title:z.getLabel.call(this,`speed`,n)})}),z.updateSetting.call(this,e,t))},checkMenu(){let{buttons:e}=this.elements.settings,t=!I.empty(e)&&Object.values(e).some(e=>!e.hidden);Me(this.elements.settings.menu,!t)},focusFirstMenuItem(e,t=!1){if(this.elements.settings.popup.hidden)return;let n=e;I.element(n)||(n=Object.values(this.elements.settings.panels).find(e=>!e.hidden));let r=n.querySelector(`[role^="menuitem"]`);ze.call(this,r,t)},toggleMenu(e){let{popup:t}=this.elements.settings,n=this.elements.buttons.settings;if(!I.element(t)||!I.element(n))return;let{hidden:r}=t,i=r;if(I.boolean(e))i=e;else if(I.keyboardEvent(e)&&e.key===`Escape`)i=!1;else if(I.event(e)){let r=I.function(e.composedPath)?e.composedPath()[0]:e.target,a=t.contains(r);if(a||!a&&e.target!==n&&i)return}n.setAttribute(`aria-expanded`,i),Me(t,!i),Ne(this.elements.container,this.config.classNames.menu.open,i),i&&I.keyboardEvent(e)?z.focusFirstMenuItem.call(this,null,!0):!i&&!r&&ze.call(this,n,I.keyboardEvent(e))},getMenuSize(e){let t=e.cloneNode(!0);t.style.position=`absolute`,t.style.opacity=0,t.removeAttribute(`hidden`),e.parentNode.appendChild(t);let n=t.scrollWidth,r=t.scrollHeight;return L(t),{width:n,height:r}},showMenuPanel(e=``,t=!1){let n=this.elements.container.querySelector(`#plyr-settings-${this.id}-${e}`);if(!I.element(n))return;let r=n.parentNode,i=Array.from(r.children).find(e=>!e.hidden);if(Ve.transitions&&!Ve.reducedMotion){r.style.width=`${i.scrollWidth}px`,r.style.height=`${i.scrollHeight}px`;let e=z.getMenuSize.call(this,n),t=e=>{e.target===r&&[`width`,`height`].includes(e.propertyName)&&(r.style.width=``,r.style.height=``,Ge.call(this,r,ye,t))};We.call(this,r,ye,t),r.style.width=`${e.width}px`,r.style.height=`${e.height}px`}Me(i,!0),Me(n,!1),z.focusFirstMenuItem.call(this,n,t)},setDownloadUrl(){let e=this.elements.buttons.download;I.element(e)&&e.setAttribute(`href`,this.download)},create(e){let{bindMenuItemShortcuts:t,createButton:n,createProgress:r,createRange:i,createTime:a,setQualityMenu:o,setSpeedMenu:s,showMenuPanel:c}=z;this.elements.controls=null,I.array(this.config.controls)&&this.config.controls.includes(`play-large`)&&this.elements.container.appendChild(n.call(this,`play-large`));let l=Ee(`div`,je(this.config.selectors.controls.wrapper));this.elements.controls=l;let u={class:`plyr__controls__item`};return Ze(I.array(this.config.controls)?this.config.controls:[]).forEach(o=>{if(o===`restart`&&l.appendChild(n.call(this,`restart`,u)),o===`rewind`&&l.appendChild(n.call(this,`rewind`,u)),o===`play`&&l.appendChild(n.call(this,`play`,u)),o===`fast-forward`&&l.appendChild(n.call(this,`fast-forward`,u)),o===`progress`){let t=Ee(`div`,{class:`${u.class} plyr__progress__container`}),n=Ee(`div`,je(this.config.selectors.progress));if(n.appendChild(i.call(this,`seek`,{id:`plyr-seek-${e.id}`})),n.appendChild(r.call(this,`buffer`)),this.config.tooltips.seek){let e=Ee(`span`,{class:this.config.classNames.tooltip},`00:00`);n.appendChild(e),this.elements.display.seekTooltip=e}this.elements.progress=n,t.appendChild(this.elements.progress),l.appendChild(t)}if(o===`current-time`&&l.appendChild(a.call(this,`currentTime`,u)),o===`duration`&&l.appendChild(a.call(this,`duration`,u)),o===`mute`||o===`volume`){let{volume:t}=this.elements;if((!I.element(t)||!l.contains(t))&&(t=Ee(`div`,Ce({},u,{class:`${u.class} plyr__volume`.trim()})),this.elements.volume=t,l.appendChild(t)),o===`mute`&&t.appendChild(n.call(this,`mute`)),o===`volume`&&!ct.isIos&&!ct.isIPadOS){let n={max:1,step:.05,value:this.config.volume};t.appendChild(i.call(this,`volume`,Ce(n,{id:`plyr-volume-${e.id}`})))}}if(o===`captions`&&l.appendChild(n.call(this,`captions`,u)),o===`settings`&&!I.empty(this.config.settings)){let r=Ee(`div`,Ce({},u,{class:`${u.class} plyr__menu`.trim(),hidden:``}));r.appendChild(n.call(this,`settings`,{"aria-haspopup":!0,"aria-controls":`plyr-settings-${e.id}`,"aria-expanded":!1}));let i=Ee(`div`,{class:`plyr__menu__container`,id:`plyr-settings-${e.id}`,hidden:``}),a=Ee(`div`),o=Ee(`div`,{id:`plyr-settings-${e.id}-home`}),s=Ee(`div`,{role:`menu`});o.appendChild(s),a.appendChild(o),this.elements.settings.panels.home=o,this.config.settings.forEach(n=>{let r=Ee(`button`,Ce(je(this.config.selectors.buttons.settings),{type:`button`,class:`${this.config.classNames.control} ${this.config.classNames.control}--forward`,role:`menuitem`,"aria-haspopup":!0,hidden:``}));t.call(this,r,n),We.call(this,r,`click`,()=>{c.call(this,n,!1)});let i=Ee(`span`,null,vt.get(n,this.config)),o=Ee(`span`,{class:this.config.classNames.menu.value});o.innerHTML=e[n],i.appendChild(o),r.appendChild(i),s.appendChild(r);let l=Ee(`div`,{id:`plyr-settings-${e.id}-${n}`,hidden:``}),u=Ee(`button`,{type:`button`,class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});u.appendChild(Ee(`span`,{"aria-hidden":!0},vt.get(n,this.config))),u.appendChild(Ee(`span`,{class:this.config.classNames.hidden},vt.get(`menuBack`,this.config))),We.call(this,l,`keydown`,e=>{e.key===`ArrowLeft`&&(e.preventDefault(),e.stopPropagation(),c.call(this,`home`,!0))},!1),We.call(this,u,`click`,()=>{c.call(this,`home`,!1)}),l.appendChild(u),l.appendChild(Ee(`div`,{role:`menu`})),a.appendChild(l),this.elements.settings.buttons[n]=r,this.elements.settings.panels[n]=l}),i.appendChild(a),r.appendChild(i),l.appendChild(r),this.elements.settings.popup=i,this.elements.settings.menu=r}if(o===`pip`&&Ve.pip&&l.appendChild(n.call(this,`pip`,u)),o===`airplay`&&Ve.airplay&&l.appendChild(n.call(this,`airplay`,u)),o===`download`){let e=Ce({},u,{element:`a`,href:this.download,target:`_blank`});this.isHTML5&&(e.download=``);let{download:t}=this.config.urls;!I.url(t)&&this.isEmbed&&Ce(e,{icon:`logo-${this.provider}`,label:this.provider}),l.appendChild(n.call(this,`download`,e))}o===`fullscreen`&&l.appendChild(n.call(this,`fullscreen`,u))}),this.isHTML5&&o.call(this,st.getQualityOptions.call(this)),s.call(this),l},inject(){if(this.config.loadSprite){let e=z.getIconUrl.call(this);e.cors&&xt(e.url,`sprite-plyr`)}this.id=Math.floor(Math.random()*1e4);let e=null;this.elements.controls=null;let t={id:this.id,seektime:this.config.seekTime,title:this.config.title},n=!0;I.function(this.config.controls)&&(this.config.controls=this.config.controls.call(this,t)),this.config.controls||(this.config.controls=[]),I.element(this.config.controls)||I.string(this.config.controls)?e=this.config.controls:(e=z.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:Ot.getLabel.call(this)}),n=!1),n&&I.string(this.config.controls)&&(e=(e=>{let n=e;return Object.entries(t).forEach(([e,t])=>{n=dt(n,`{${e}}`,t)}),n})(e));let r;I.string(this.config.selectors.controls.container)&&(r=document.querySelector(this.config.selectors.controls.container)),I.element(r)||(r=this.elements.container);let i=I.element(e)?`insertAdjacentElement`:`insertAdjacentHTML`;if(r[i](`afterbegin`,e),I.element(this.elements.controls)||z.findElements.call(this),!I.empty(this.elements.buttons)){let e=e=>{let t=this.config.classNames.controlPressed;e.setAttribute(`aria-pressed`,`false`),Object.defineProperty(e,"pressed",{configurable:!0,enumerable:!0,get(){return Pe(e,t)},set(n=!1){Ne(e,t,n),e.setAttribute(`aria-pressed`,n?`true`:`false`)}})};Object.values(this.elements.buttons).filter(Boolean).forEach(t=>{I.array(t)||I.nodeList(t)?Array.from(t).filter(Boolean).forEach(e):e(t)})}if(ct.isEdge&&be(r),this.config.tooltips.controls){let{classNames:e,selectors:t}=this.config,n=`${t.controls.wrapper} ${t.labels} .${e.hidden}`,r=Le.call(this,n);Array.from(r).forEach(e=>{Ne(e,this.config.classNames.hidden,!1),Ne(e,this.config.classNames.tooltip,!0)})}},setMediaMetadata(){try{`mediaSession`in navigator&&(navigator.mediaSession.metadata=new window.MediaMetadata({title:this.config.mediaMetadata.title,artist:this.config.mediaMetadata.artist,album:this.config.mediaMetadata.album,artwork:this.config.mediaMetadata.artwork}))}catch{}},setMarkers(){if(!this.duration||this.elements.markers)return;let e=this.config.markers?.points?.filter(({time:e})=>e>0&&e<this.duration);if(!(e!=null&&e.length))return;let t=document.createDocumentFragment(),n=document.createDocumentFragment(),r=null,i=`${this.config.classNames.tooltip}--visible`,a=e=>Ne(r,i,e);e.forEach(e=>{let t=Ee(`span`,{class:this.config.classNames.marker},``),i=`${e.time/this.duration*100}%`;r&&(t.addEventListener(`mouseenter`,()=>{e.label||(r.style.left=i,r.innerHTML=e.label,a(!0))}),t.addEventListener(`mouseleave`,()=>{a(!1)})),t.addEventListener(`click`,()=>{this.currentTime=e.time}),t.style.left=i,n.appendChild(t)}),t.appendChild(n),this.config.tooltips.seek||(r=Ee(`span`,{class:this.config.classNames.tooltip},``),t.appendChild(r)),this.elements.markers={points:n,tip:r},this.elements.progress.appendChild(t)}};function Et(e,t=!0){let n=e;if(t){let e=document.createElement(`a`);e.href=n,n=e.href}try{return new URL(n)}catch{return null}}function Dt(e){let t=new URLSearchParams;return I.object(e)&&Object.entries(e).forEach(([e,n])=>{t.set(e,n)}),t}var Ot={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!Ve.textTracks){I.array(this.config.controls)&&this.config.controls.includes(`settings`)&&this.config.settings.includes(`captions`)&&z.setCaptionsMenu.call(this);return}if(I.element(this.elements.captions)||(this.elements.captions=Ee(`div`,je(this.config.selectors.captions)),this.elements.captions.setAttribute(`dir`,`auto`),De(this.elements.captions,this.elements.wrapper)),ct.isIE&&window.URL){let e=this.media.querySelectorAll(`track`);Array.from(e).forEach(e=>{let t=e.getAttribute(`src`),n=Et(t);n!==null&&n.hostname!==window.location.href.hostname&&[`http:`,`https:`].includes(n.protocol)&&bt(t,`blob`).then(t=>{e.setAttribute(`src`,window.URL.createObjectURL(t))}).catch(()=>{L(e)})})}let e=Ze((navigator.languages||[navigator.language||navigator.userLanguage||`en`]).map(e=>e.split(`-`)[0])),t=(this.storage.get(`language`)||this.captions.language||this.config.captions.language||`auto`).toLowerCase();t===`auto`&&([t]=e);let n=this.storage.get(`captions`)||this.captions.active;if(I.boolean(n)||({active:n}=this.config.captions),Object.assign(this.captions,{toggled:!1,active:n,language:t,languages:e}),this.isHTML5){let e=this.config.captions.update?`addtrack removetrack`:`removetrack`;We.call(this,this.media.textTracks,e,Ot.update.bind(this))}setTimeout(Ot.update.bind(this),0)},update(){let e=Ot.getTracks.call(this,!0),{active:t,language:n,meta:r,currentTrackNode:i}=this.captions,a=!!e.find(e=>e.language===n);this.isHTML5&&this.isVideo&&e.filter(e=>!r.get(e)).forEach(e=>{this.debug.log(`Track added`,e),r.set(e,{default:e.mode===`showing`}),e.mode===`showing`&&(e.mode=`hidden`),We.call(this,e,`cuechange`,()=>Ot.updateCues.call(this))}),(a&&this.language!==n||!e.includes(i))&&(Ot.setLanguage.call(this,n),Ot.toggle.call(this,t&&a)),this.elements&&Ne(this.elements.container,this.config.classNames.captions.enabled,!I.empty(e)),I.array(this.config.controls)&&this.config.controls.includes(`settings`)&&this.config.settings.includes(`captions`)&&z.setCaptionsMenu.call(this)},toggle(e,t=!0){if(!this.supported.ui)return;let{toggled:n}=this.captions,r=this.config.classNames.captions.active,i=I.nullOrUndefined(e)?!n:e;if(i!==n){if(t||(this.captions.active=i,this.storage.set({captions:i})),!this.language&&i&&!t){let e=Ot.getTracks.call(this),t=Ot.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);this.captions.language=t.language,Ot.set.call(this,e.indexOf(t));return}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=i),Ne(this.elements.container,r,i),this.captions.toggled=i,z.updateSetting.call(this,`captions`),qe.call(this,this.media,i?`captionsenabled`:`captionsdisabled`)}setTimeout(()=>{i&&this.captions.toggled&&(this.captions.currentTrackNode.mode=`hidden`)})},set(e,t=!0){let n=Ot.getTracks.call(this);if(e===-1)Ot.toggle.call(this,!1,t);else if(!I.number(e))this.debug.warn(`Invalid caption argument`,e);else if(!(e in n))this.debug.warn(`Track not found`,e);else{if(this.captions.currentTrack!==e){this.captions.currentTrack=e;let r=n[e],{language:i}=r||{};this.captions.currentTrackNode=r,z.updateSetting.call(this,`captions`),t||(this.captions.language=i,this.storage.set({language:i})),this.isVimeo&&this.embed.enableTextTrack(i,null,!1),qe.call(this,this.media,`languagechange`)}Ot.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&Ot.updateCues.call(this)}},setLanguage(e,t=!0){if(!I.string(e)){this.debug.warn(`Invalid language argument`,e);return}let n=e.toLowerCase();this.captions.language=n;let r=Ot.getTracks.call(this),i=Ot.findTrack.call(this,[n]);Ot.set.call(this,r.indexOf(i),t)},getTracks(e=!1){return Array.from((this.media||{}).textTracks||[]).filter(t=>!this.isHTML5||e||this.captions.meta.has(t)).filter(e=>[`captions`,`subtitles`].includes(e.kind))},findTrack(e,t=!1){let n=Ot.getTracks.call(this),r=e=>Number((this.captions.meta.get(e)||{}).default),i=Array.from(n).sort((e,t)=>r(t)-r(e)),a;return e.every(e=>(a=i.find(t=>t.language===e),!a)),a||(t?i[0]:void 0)},getCurrentTrack(){return Ot.getTracks.call(this)[this.currentTrack]},getLabel(e){let t=e;return!I.track(t)&&Ve.textTracks&&this.captions.toggled&&(t=Ot.getCurrentTrack.call(this)),I.track(t)?I.empty(t.label)?I.empty(t.language)?vt.get(`enabled`,this.config):e.language.toUpperCase():t.label:vt.get(`disabled`,this.config)},updateCues(e){if(!this.supported.ui)return;if(!I.element(this.elements.captions)){this.debug.warn(`No captions element to render to`);return}if(!I.nullOrUndefined(e)&&!Array.isArray(e)){this.debug.warn(`updateCues: Invalid input`,e);return}let t=e;if(!t){let e=Ot.getCurrentTrack.call(this);t=Array.from((e||{}).activeCues||[]).map(e=>e.getCueAsHTML()).map(gt)}let n=t.map(e=>e.trim()).join(`
|
|
37
|
+
`);if(n!==this.elements.captions.innerHTML){ke(this.elements.captions);let e=Ee(`span`,je(this.config.selectors.caption));e.innerHTML=n,this.elements.captions.appendChild(e),qe.call(this,this.media,`cuechange`)}}},kt={enabled:!0,title:``,debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:`plyr`,iconUrl:`https://cdn.plyr.io/3.8.4/plyr.svg`,blankVideo:`https://cdn.plyr.io/static/blank.mp4`,quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240],forced:!1,onChange:null},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2,4]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:`auto`,update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:`plyr`},controls:[`play-large`,`play`,`progress`,`current-time`,`mute`,`volume`,`captions`,`settings`,`pip`,`airplay`,`fullscreen`],settings:[`captions`,`quality`,`speed`],i18n:{restart:`Restart`,rewind:`Rewind {seektime}s`,play:`Play`,pause:`Pause`,fastForward:`Forward {seektime}s`,seek:`Seek`,seekLabel:`{currentTime} of {duration}`,played:`Played`,buffered:`Buffered`,currentTime:`Current time`,duration:`Duration`,volume:`Volume`,mute:`Mute`,unmute:`Unmute`,enableCaptions:`Enable captions`,disableCaptions:`Disable captions`,download:`Download`,enterFullscreen:`Enter fullscreen`,exitFullscreen:`Exit fullscreen`,frameTitle:`Player for {title}`,captions:`Captions`,settings:`Settings`,pip:`PIP`,menuBack:`Go back to previous menu`,speed:`Speed`,normal:`Normal`,quality:`Quality`,loop:`Loop`,start:`Start`,end:`End`,all:`All`,reset:`Reset`,disabled:`Disabled`,enabled:`Enabled`,advertisement:`Ad`,qualityBadge:{2160:`4K`,1440:`HD`,1080:`HD`,720:`HD`,576:`SD`,480:`SD`}},urls:{download:null,vimeo:{sdk:`https://player.vimeo.com/api/player.js`,iframe:`https://player.vimeo.com/video/{0}?{1}`,api:`https://vimeo.com/api/oembed.json?url={0}`},youtube:{sdk:`https://www.youtube.com/iframe_api`,api:`https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}`},googleIMA:{sdk:`https://imasdk.googleapis.com/js/sdkloader/ima3.js`}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:/* @__PURE__ */ `ended.progress.stalled.playing.waiting.canplay.canplaythrough.loadstart.loadeddata.loadedmetadata.timeupdate.volumechange.play.pause.error.seeking.seeked.emptied.ratechange.cuechange.download.enterfullscreen.exitfullscreen.captionsenabled.captionsdisabled.languagechange.controlshidden.controlsshown.ready.statechange.qualitychange.adsloaded.adscontentpause.adscontentresume.adstarted.adsmidpoint.adscomplete.adsallcomplete.adsimpression.adsclick`.split(`.`),selectors:{editable:`input, textarea, select, [contenteditable]`,container:`.plyr`,controls:{container:null,wrapper:`.plyr__controls`},labels:`[data-plyr]`,buttons:{play:`[data-plyr="play"]`,pause:`[data-plyr="pause"]`,restart:`[data-plyr="restart"]`,rewind:`[data-plyr="rewind"]`,fastForward:`[data-plyr="fast-forward"]`,mute:`[data-plyr="mute"]`,captions:`[data-plyr="captions"]`,download:`[data-plyr="download"]`,fullscreen:`[data-plyr="fullscreen"]`,pip:`[data-plyr="pip"]`,airplay:`[data-plyr="airplay"]`,settings:`[data-plyr="settings"]`,loop:`[data-plyr="loop"]`},inputs:{seek:`[data-plyr="seek"]`,volume:`[data-plyr="volume"]`,speed:`[data-plyr="speed"]`,language:`[data-plyr="language"]`,quality:`[data-plyr="quality"]`},display:{currentTime:`.plyr__time--current`,duration:`.plyr__time--duration`,buffer:`.plyr__progress__buffer`,loop:`.plyr__progress__loop`,volume:`.plyr__volume--display`},progress:`.plyr__progress`,captions:`.plyr__captions`,caption:`.plyr__caption`},classNames:{type:`plyr--{0}`,provider:`plyr--{0}`,video:`plyr__video-wrapper`,embed:`plyr__video-embed`,videoFixedRatio:`plyr__video-wrapper--fixed-ratio`,embedContainer:`plyr__video-embed__container`,poster:`plyr__poster`,posterEnabled:`plyr__poster-enabled`,ads:`plyr__ads`,control:`plyr__control`,controlPressed:`plyr__control--pressed`,playing:`plyr--playing`,paused:`plyr--paused`,stopped:`plyr--stopped`,loading:`plyr--loading`,hover:`plyr--hover`,tooltip:`plyr__tooltip`,cues:`plyr__cues`,marker:`plyr__progress__marker`,hidden:`plyr__sr-only`,hideControls:`plyr--hide-controls`,isTouch:`plyr--is-touch`,uiSupported:`plyr--full-ui`,noTransition:`plyr--no-transition`,display:{time:`plyr__time`},menu:{value:`plyr__menu__value`,badge:`plyr__badge`,open:`plyr--menu-open`},captions:{enabled:`plyr--captions-enabled`,active:`plyr--captions-active`},fullscreen:{enabled:`plyr--fullscreen-enabled`,fallback:`plyr--fullscreen-fallback`},pip:{supported:`plyr--pip-supported`,active:`plyr--pip-active`},airplay:{supported:`plyr--airplay-supported`,active:`plyr--airplay-active`},previewThumbnails:{thumbContainer:`plyr__preview-thumb`,thumbContainerShown:`plyr__preview-thumb--is-shown`,imageContainer:`plyr__preview-thumb__image-container`,timeContainer:`plyr__preview-thumb__time-container`,scrubbingContainer:`plyr__preview-scrubbing`,scrubbingContainerShown:`plyr__preview-scrubbing--is-shown`}},attributes:{embed:{provider:`data-plyr-provider`,id:`data-plyr-embed-id`,hash:`data-plyr-embed-hash`}},ads:{enabled:!1,publisherId:``,tagUrl:``},previewThumbnails:{enabled:!1,src:``,withCredentials:!1},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,referrerPolicy:null,premium:!1},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!1},mediaMetadata:{title:``,artist:``,album:``,artwork:[]},markers:{enabled:!1,points:[]}},At={active:`picture-in-picture`,inactive:`inline`},jt={html5:`html5`,youtube:`youtube`,vimeo:`vimeo`},Mt={audio:`audio`,video:`video`};function Nt(e){return/^(?:https?:\/\/)?(?:www\.)?(?:youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?jt.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?jt.vimeo:null}function Pt(){}var Ft=class{constructor(e=!1){this.enabled=window.console&&e,this.enabled&&this.log(`Debugging enabled`)}get log(){return this.enabled?Function.prototype.bind.call(console.log,console):Pt}get warn(){return this.enabled?Function.prototype.bind.call(console.warn,console):Pt}get error(){return this.enabled?Function.prototype.bind.call(console.error,console):Pt}},It=class e{constructor(t){l(this,`onChange`,()=>{if(!this.supported)return;let e=this.player.elements.buttons.fullscreen;I.element(e)&&(e.pressed=this.active);let t=this.target===this.player.media?this.target:this.player.elements.container;qe.call(this.player,t,this.active?`enterfullscreen`:`exitfullscreen`,!0)}),l(this,`toggleFallback`,(e=!1)=>{if(e?this.scrollPosition={x:window.scrollX??0,y:window.scrollY??0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=e?`hidden`:``,Ne(this.target,this.player.config.classNames.fullscreen.fallback,e),ct.isIos){let t=document.head.querySelector(`meta[name="viewport"]`),n=`viewport-fit=cover`;t||(t=document.createElement(`meta`),t.setAttribute(`name`,`viewport`));let r=I.string(t.content)&&t.content.includes(n);e?(this.cleanupViewport=!r,r||(t.content+=`,${n}`)):this.cleanupViewport&&(t.content=t.content.split(`,`).filter(e=>e.trim()!==n).join(`,`))}this.onChange()}),l(this,`trapFocus`,e=>{if(ct.isIos||ct.isIPadOS||!this.active||e.key!==`Tab`)return;let t=document.activeElement,n=Le.call(this.player,`a[href], button:not(:disabled), input:not(:disabled), [tabindex]`),[r]=n,i=n[n.length-1];t===i&&!e.shiftKey?(r.focus(),e.preventDefault()):t===r&&e.shiftKey&&(i.focus(),e.preventDefault())}),l(this,`update`,()=>{if(this.supported){let t;t=this.forceFallback?`Fallback (forced)`:e.nativeSupported?`Native`:`Fallback`,this.player.debug.log(`${t} fullscreen enabled`)}else this.player.debug.log(`Fullscreen not supported and fallback disabled`);Ne(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.supported)}),l(this,`enter`,()=>{this.supported&&(ct.isIos&&this.player.config.fullscreen.iosNative?this.player.isVimeo?this.player.embed.requestFullscreen():this.target.webkitEnterFullscreen():!e.nativeSupported||this.forceFallback?this.toggleFallback(!0):this.prefix?I.empty(this.prefix)||this.target[`${this.prefix}Request${this.property}`]():this.target.requestFullscreen({navigationUI:`hide`}))}),l(this,`exit`,()=>{if(this.supported){if(ct.isIos&&this.player.config.fullscreen.iosNative)this.player.isVimeo?this.player.embed.exitFullscreen():this.target.webkitEnterFullscreen(),Xe(this.player.play());else if(!e.nativeSupported||this.forceFallback)this.toggleFallback(!1);else if(!this.prefix)(document.cancelFullScreen||document.exitFullscreen).call(document);else if(!I.empty(this.prefix)){let e=this.prefix===`moz`?`Cancel`:`Exit`;document[`${this.prefix}${e}${this.property}`]()}}}),l(this,`toggle`,()=>{this.active?this.exit():this.enter()}),this.player=t,this.prefix=e.prefix,this.property=e.property,this.scrollPosition={x:0,y:0},this.forceFallback=t.config.fullscreen.fallback===`force`,this.player.elements.fullscreen=t.config.fullscreen.container&&Ie(this.player.elements.container,t.config.fullscreen.container),We.call(this.player,document,this.prefix===`ms`?`MSFullscreenChange`:`${this.prefix}fullscreenchange`,()=>{this.onChange()}),We.call(this.player,this.player.elements.container,`dblclick`,e=>{I.element(this.player.elements.controls)&&this.player.elements.controls.contains(e.target)||this.player.listeners.proxy(e,this.toggle,`fullscreen`)}),We.call(this,this.player.elements.container,`keydown`,e=>this.trapFocus(e)),this.update()}static get nativeSupported(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}get useNative(){return e.nativeSupported&&!this.forceFallback}static get prefix(){if(I.function(document.exitFullscreen))return``;let e=``;return[`webkit`,`moz`,`ms`].some(t=>I.function(document[`${t}ExitFullscreen`])||I.function(document[`${t}CancelFullScreen`])?(e=t,!0):!1),e}static get property(){return this.prefix===`moz`?`FullScreen`:`Fullscreen`}get supported(){return[this.player.config.fullscreen.enabled,this.player.isVideo,e.nativeSupported||this.player.config.fullscreen.fallback,!this.player.isYouTube||e.nativeSupported||!ct.isIos||this.player.config.playsinline&&!this.player.config.fullscreen.iosNative].every(Boolean)}get active(){if(!this.supported)return!1;if(!e.nativeSupported||this.forceFallback)return Pe(this.target,this.player.config.classNames.fullscreen.fallback);let t=this.prefix?this.target.getRootNode()[`${this.prefix}${this.property}Element`]:this.target.getRootNode().fullscreenElement;return t&&t.shadowRoot?t===this.target.getRootNode().host:t===this.target}get target(){return ct.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.fullscreen??this.player.elements.container}};function Lt(e,t=1){return new Promise((n,r)=>{let i=new Image,a=()=>{delete i.onload,delete i.onerror,(i.naturalWidth>=t?n:r)(i)};Object.assign(i,{onload:a,onerror:a,src:e})})}var Rt={addStyleHook(){Ne(this.elements.container,this.config.selectors.container.replace(`.`,``),!0),Ne(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls(e=!1){e&&this.isHTML5?this.media.setAttribute(`controls`,``):this.media.removeAttribute(`controls`)},build(){this.listeners.media(),this.supported.ui?(I.element(this.elements.controls)||(z.inject.call(this),this.listeners.controls()),Rt.toggleNativeControls.call(this),this.isHTML5&&Ot.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,z.updateVolume.call(this),z.timeUpdate.call(this),z.durationUpdate.call(this),Rt.checkPlaying.call(this),Ne(this.elements.container,this.config.classNames.pip.supported,Ve.pip&&this.isHTML5&&this.isVideo),Ne(this.elements.container,this.config.classNames.airplay.supported,Ve.airplay&&this.isHTML5),Ne(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout(()=>{qe.call(this,this.media,`ready`)},0),Rt.setTitle.call(this),this.poster&&Rt.setPoster.call(this,this.poster,!1).catch(()=>{}),this.config.duration&&z.durationUpdate.call(this),this.config.mediaMetadata&&z.setMediaMetadata.call(this)):(this.debug.warn(`Basic support only for ${this.provider} ${this.type}`),Rt.toggleNativeControls.call(this,!0))},setTitle(){let e=vt.get(`play`,this.config);if(I.string(this.config.title)&&!I.empty(this.config.title)&&(e+=`, ${this.config.title}`),Array.from(this.elements.buttons.play||[]).forEach(t=>{t.setAttribute(`aria-label`,e)}),this.isEmbed){let e=Re.call(this,`iframe`);if(!I.element(e))return;let t=I.empty(this.config.title)?`video`:this.config.title,n=vt.get(`frameTitle`,this.config);e.setAttribute(`title`,n.replace(`{title}`,t))}},togglePoster(e){Ne(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster(e,t=!0){return t&&this.poster?Promise.reject(/* @__PURE__ */ Error(`Poster already set`)):(this.media.setAttribute(`data-poster`,e),this.elements.poster.removeAttribute(`hidden`),Ye.call(this).then(()=>Lt(e)).catch(t=>{throw e===this.poster&&Rt.togglePoster.call(this,!1),t}).then(()=>{if(e!==this.poster)throw Error(`setPoster cancelled by later call to setPoster`)}).then(()=>(Object.assign(this.elements.poster.style,{backgroundImage:`url('${e}')`,backgroundSize:``}),Rt.togglePoster.call(this,!0),e)))},checkPlaying(e){Ne(this.elements.container,this.config.classNames.playing,this.playing),Ne(this.elements.container,this.config.classNames.paused,this.paused),Ne(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach(e=>{Object.assign(e,{pressed:this.playing}),e.setAttribute(`aria-label`,vt.get(this.playing?`pause`:`play`,this.config))}),!(I.event(e)&&e.type===`timeupdate`)&&Rt.toggleControls.call(this)},checkLoading(e){this.loading=[`stalled`,`waiting`].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout(()=>{Ne(this.elements.container,this.config.classNames.loading,this.loading),Rt.toggleControls.call(this)},this.loading?250:0)},toggleControls(e){let{controls:t}=this.elements;if(t&&this.config.hideControls){let n=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(!!(e||this.loading||this.paused||t.pressed||t.hover||n))}},migrateStyles(){Object.values({...this.media.style}).filter(e=>!I.empty(e)&&I.string(e)&&e.startsWith(`--plyr`)).forEach(e=>{this.elements.container.style.setProperty(e,this.media.style.getPropertyValue(e)),this.media.style.removeProperty(e)}),I.empty(this.media.style)&&this.media.removeAttribute(`style`)}},zt=class{constructor(e){l(this,`firstTouch`,()=>{let{player:e}=this,{elements:t}=e;e.touch=!0,Ne(t.container,e.config.classNames.isTouch,!0)}),l(this,`global`,(e=!0)=>{let{player:t}=this;t.config.keyboard.global&&Ue.call(t,window,`keydown keyup`,this.handleKey,e,!1),Ue.call(t,document.body,`click`,this.toggleMenu,e),Ke.call(t,document.body,`touchstart`,this.firstTouch)}),l(this,`container`,()=>{let{player:e}=this,{config:t,elements:n,timers:r}=e;!t.keyboard.global&&t.keyboard.focused&&We.call(e,n.container,`keydown keyup`,this.handleKey,!1),We.call(e,n.container,`mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen`,t=>{let{controls:i}=n;i&&t.type===`enterfullscreen`&&(i.pressed=!1,i.hover=!1);let a=[`touchstart`,`touchmove`,`mousemove`].includes(t.type),o=0;a&&(Rt.toggleControls.call(e,!0),o=e.touch?3e3:2e3),clearTimeout(r.controls),r.controls=setTimeout(()=>Rt.toggleControls.call(e,!1),o)});let i=()=>{if(!e.isVimeo||e.config.vimeo.premium)return;let t=n.wrapper,{active:r}=e.fullscreen,[i,a]=rt.call(e),o=$e(`aspect-ratio: ${i} / ${a}`);if(!r){o?(t.style.width=null,t.style.height=null):(t.style.maxWidth=null,t.style.margin=null);return}let[s,c]=ot(),l=s/c>i/a;o?(t.style.width=l?`auto`:`100%`,t.style.height=l?`100%`:`auto`):(t.style.maxWidth=l?`${c/a*i}px`:null,t.style.margin=l?`0 auto`:null)},a=()=>{clearTimeout(r.resized),r.resized=setTimeout(i,50)};We.call(e,n.container,`enterfullscreen exitfullscreen`,t=>{let{target:r}=e.fullscreen;r===n.container&&(e.isEmbed||!I.empty(e.config.ratio))&&(i(),(t.type===`enterfullscreen`?We:Ge).call(e,window,`resize`,a))})}),l(this,`media`,()=>{let{player:e}=this,{elements:t}=e;if(We.call(e,e.media,`timeupdate seeking seeked`,t=>z.timeUpdate.call(e,t)),We.call(e,e.media,`durationchange loadeddata loadedmetadata`,t=>z.durationUpdate.call(e,t)),We.call(e,e.media,`ended`,()=>{e.isHTML5&&e.isVideo&&e.config.resetOnEnd&&(e.restart(),e.pause())}),We.call(e,e.media,`progress playing seeking seeked`,t=>z.updateProgress.call(e,t)),We.call(e,e.media,`volumechange`,t=>z.updateVolume.call(e,t)),We.call(e,e.media,`playing play pause ended emptied timeupdate`,t=>Rt.checkPlaying.call(e,t)),We.call(e,e.media,`waiting canplay seeked playing`,t=>Rt.checkLoading.call(e,t)),e.supported.ui&&e.config.clickToPlay&&!e.isAudio){let n=Re.call(e,`.${e.config.classNames.video}`);if(!I.element(n))return;We.call(e,t.container,`click`,r=>{([t.container,n].includes(r.target)||n.contains(r.target))&&(e.touch&&e.config.hideControls||(e.ended?(this.proxy(r,e.restart,`restart`),this.proxy(r,()=>{Xe(e.play())},`play`)):this.proxy(r,()=>{Xe(e.togglePlay())},`play`)))})}e.supported.ui&&e.config.disableContextMenu&&We.call(e,t.wrapper,`contextmenu`,e=>{e.preventDefault()},!1),We.call(e,e.media,`volumechange`,()=>{e.storage.set({volume:e.volume,muted:e.muted})}),We.call(e,e.media,`ratechange`,()=>{z.updateSetting.call(e,`speed`),e.storage.set({speed:e.speed})}),We.call(e,e.media,`qualitychange`,t=>{z.updateSetting.call(e,`quality`,null,t.detail.quality)}),We.call(e,e.media,`ready qualitychange`,()=>{z.setDownloadUrl.call(e)});let n=e.config.events.concat([`keyup`,`keydown`]).join(` `);We.call(e,e.media,n,n=>{let{detail:r={}}=n;n.type===`error`&&(r=e.media.error),qe.call(e,t.container,n.type,!0,r)})}),l(this,`proxy`,(e,t,n)=>{let{player:r}=this,i=r.config.listeners[n],a=I.function(i),o=!0;a&&(o=i.call(r,e)),o!==!1&&I.function(t)&&t.call(r,e)}),l(this,`bind`,(e,t,n,r,i=!0)=>{let{player:a}=this,o=a.config.listeners[r],s=I.function(o);We.call(a,e,t,e=>this.proxy(e,n,r),i&&!s)}),l(this,`controls`,()=>{let{player:e}=this,{elements:t}=e,n=ct.isIE?`change`:`input`;if(t.buttons.play&&Array.from(t.buttons.play).forEach(t=>{this.bind(t,`click`,()=>{Xe(e.togglePlay())},`play`)}),this.bind(t.buttons.restart,`click`,e.restart,`restart`),this.bind(t.buttons.rewind,`click`,()=>{e.lastSeekTime=Date.now(),e.rewind()},`rewind`),this.bind(t.buttons.fastForward,`click`,()=>{e.lastSeekTime=Date.now(),e.forward()},`fastForward`),this.bind(t.buttons.mute,`click`,()=>{e.muted=!e.muted},`mute`),this.bind(t.buttons.captions,`click`,()=>e.toggleCaptions()),this.bind(t.buttons.download,`click`,()=>{qe.call(e,e.media,`download`)},`download`),this.bind(t.buttons.fullscreen,`click`,()=>{e.fullscreen.toggle()},`fullscreen`),this.bind(t.buttons.pip,`click`,()=>{e.pip=`toggle`},`pip`),this.bind(t.buttons.airplay,`click`,e.airplay,`airplay`),this.bind(t.buttons.settings,`click`,t=>{t.stopPropagation(),t.preventDefault(),z.toggleMenu.call(e,t)},null,!1),this.bind(t.buttons.settings,`keyup`,t=>{[` `,`Enter`].includes(t.key)&&(t.key===`Enter`?z.focusFirstMenuItem.call(e,null,!0):(t.preventDefault(),t.stopPropagation(),z.toggleMenu.call(e,t)))},null,!1),this.bind(t.settings.menu,`keydown`,t=>{t.key===`Escape`&&z.toggleMenu.call(e,t)}),this.bind(t.inputs.seek,`mousedown mousemove`,e=>{let n=t.progress.getBoundingClientRect(),r=e.pageX-e.clientX,i=100/n.width*(e.pageX-n.left-r);e.currentTarget.setAttribute(`seek-value`,i)}),this.bind(t.inputs.seek,`mousedown mouseup keydown keyup touchstart touchend`,t=>{let n=t.currentTarget,r=`play-on-seeked`;if(I.keyboardEvent(t)&&![`ArrowLeft`,`ArrowRight`].includes(t.key))return;e.lastSeekTime=Date.now();let i=n.hasAttribute(r),a=[`mouseup`,`touchend`,`keyup`].includes(t.type);i&&a?(n.removeAttribute(r),Xe(e.play())):!a&&e.playing&&(n.setAttribute(r,``),e.pause())}),ct.isIos){let t=Le.call(e,`input[type="range"]`);Array.from(t).forEach(e=>this.bind(e,n,e=>be(e.target)))}this.bind(t.inputs.seek,n,t=>{let n=t.currentTarget,r=n.getAttribute(`seek-value`);I.empty(r)&&(r=n.value),n.removeAttribute(`seek-value`),e.currentTime=r/n.max*e.duration},`seek`),this.bind(t.progress,`mouseenter mouseleave mousemove`,t=>z.updateSeekTooltip.call(e,t)),this.bind(t.progress,`mousemove touchmove`,t=>{let{previewThumbnails:n}=e;n&&n.loaded&&n.startMove(t)}),this.bind(t.progress,`mouseleave touchend click`,()=>{let{previewThumbnails:t}=e;t&&t.loaded&&t.endMove(!1,!0)}),this.bind(t.progress,`mousedown touchstart`,t=>{let{previewThumbnails:n}=e;n&&n.loaded&&n.startScrubbing(t)}),this.bind(t.progress,`mouseup touchend`,t=>{let{previewThumbnails:n}=e;n&&n.loaded&&n.endScrubbing(t)}),ct.isWebKit&&Array.from(Le.call(e,`input[type="range"]`)).forEach(t=>{this.bind(t,`input`,t=>z.updateRangeFill.call(e,t.target))}),e.config.toggleInvert&&!I.element(t.display.duration)&&this.bind(t.display.currentTime,`click`,()=>{e.currentTime!==0&&(e.config.invertTime=!e.config.invertTime,z.timeUpdate.call(e))}),this.bind(t.inputs.volume,n,t=>{e.volume=t.target.value},`volume`),this.bind(t.controls,`mouseenter mouseleave`,n=>{t.controls.hover=!e.touch&&n.type===`mouseenter`}),t.fullscreen&&Array.from(t.fullscreen.children).filter(e=>!e.contains(t.container)).forEach(n=>{this.bind(n,`mouseenter mouseleave`,n=>{t.controls&&(t.controls.hover=!e.touch&&n.type===`mouseenter`)})}),this.bind(t.controls,`mousedown mouseup touchstart touchend touchcancel`,e=>{t.controls.pressed=[`mousedown`,`touchstart`].includes(e.type)}),this.bind(t.controls,`focusin`,()=>{let{config:n,timers:r}=e;Ne(t.controls,n.classNames.noTransition,!0),Rt.toggleControls.call(e,!0),setTimeout(()=>{Ne(t.controls,n.classNames.noTransition,!1)},0);let i=this.touch?3e3:4e3;clearTimeout(r.controls),r.controls=setTimeout(()=>Rt.toggleControls.call(e,!1),i)}),this.bind(t.inputs.volume,`wheel`,t=>{let n=t.webkitDirectionInvertedFromDevice,[r,i]=[t.deltaX,-t.deltaY].map(e=>n?-e:e),a=Math.sign(Math.abs(r)>Math.abs(i)?r:i);e.increaseVolume(a/50);let{volume:o}=e.media;(a===1&&o<1||a===-1&&o>0)&&t.preventDefault()},`volume`,!1)}),this.player=e,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.firstTouch=this.firstTouch.bind(this)}handleKey(e){let{player:t}=this,{elements:n}=t,{key:r,type:i,altKey:a,ctrlKey:o,metaKey:s,shiftKey:c}=e,l=i===`keydown`,u=l&&r===this.lastKey;if(a||o||s||c||!r)return;let d=e=>{t.currentTime=t.duration/10*e};if(l){let i=document.activeElement;if(I.element(i)){let{editable:r}=t.config.selectors,{seek:a}=n.inputs;if(i!==a&&Fe(i,r)||e.key===` `&&Fe(i,`button, [role^="menuitem"]`))return}switch([` `,`ArrowLeft`,`ArrowUp`,`ArrowRight`,`ArrowDown`,`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`,`c`,`f`,`k`,`l`,`m`].includes(r)&&(e.preventDefault(),e.stopPropagation()),r){case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:u||d(Number.parseInt(r,10));break;case` `:case`k`:u||Xe(t.togglePlay());break;case`ArrowUp`:t.increaseVolume(.1);break;case`ArrowDown`:t.decreaseVolume(.1);break;case`m`:u||(t.muted=!t.muted);break;case`ArrowRight`:t.forward();break;case`ArrowLeft`:t.rewind();break;case`f`:t.fullscreen.toggle();break;case`c`:u||t.toggleCaptions();break;case`l`:t.loop=!t.loop}r===`Escape`&&!t.fullscreen.usingNative&&t.fullscreen.active&&t.fullscreen.toggle(),this.lastKey=r}else this.lastKey=null}toggleMenu(e){z.toggleMenu.call(this.player,e)}};function Bt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var Vt={exports:{}},Ht=Vt.exports,Ut;function Wt(){return Ut||(Ut=1,(function(e,t){(function(t,n){e.exports=n()})(Ht,function(){var e=function(){},t={},n={},r={};function i(e,t){e=e.push?e:[e];for(var i=[],a=e.length,o=a,s=function(e,n){n.length&&i.push(e),o--,o||t(i)},c,l,u;a--;)c=e[a],l=n[c],l?s(c,l):(u=r[c]=r[c]||[],u.push(s))}function a(e,t){if(e){var i=r[e];if(n[e]=t,i)for(;i.length;)i[0](e,t),i.splice(0,1)}}function o(t,n){t.call&&(t={success:t}),n.length?(t.error||e)(n):(t.success||e)(t)}function s(t,n,r,i){var a=document,o=r.async,c=(r.numRetries||0)+1,l=r.before||e,u=t.replace(/[\?|#].*$/,``),d=t.replace(/^(css|img|module|nomodule)!/,``),f,p,m;if(i=i||0,/(^css!|\.css$)/.test(u))m=a.createElement(`link`),m.rel=`stylesheet`,m.href=d,f=`hideFocus`in m,f&&m.relList&&(f=0,m.rel=`preload`,m.as=`style`);else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(u))m=a.createElement(`img`),m.src=d;else if(m=a.createElement(`script`),m.src=d,m.async=o===void 0||o,p=`noModule`in m,/^module!/.test(u)){if(!p)return n(t,`l`);m.type=`module`}else if(/^nomodule!/.test(u)&&p)return n(t,`l`);m.onload=m.onerror=m.onbeforeload=function(e){var a=e.type[0];if(f)try{m.sheet.cssText.length||(a=`e`)}catch(e){e.code!=18&&(a=`e`)}if(a==`e`){if(i+=1,i<c)return s(t,n,r,i)}else if(m.rel==`preload`&&m.as==`style`)return m.rel=`stylesheet`;n(t,a,e.defaultPrevented)},l(t,m)!==!1&&a.head.appendChild(m)}function c(e,t,n){e=e.push?e:[e];for(var r=e.length,i=r,a=[],o=function(e,n,i){if(n==`e`&&a.push(e),n==`b`){if(i)a.push(e);else return}r--,r||t(a)},c=0;c<i;c++)s(e[c],o,n)}function l(e,n,r){var i,s;if(n&&n.trim&&(i=n),s=(i?r:n)||{},i){if(i in t)throw`LoadJS`;t[i]=!0}function l(t,n){c(e,function(e){o(s,e),t&&o({success:t,error:n},e),a(i,e)},s)}if(s.returnPromise)return new Promise(l);l()}return l.ready=function(e,t){return i(e,function(e){o(t,e)}),l},l.done=function(e){a(e,[])},l.reset=function(){t={},n={},r={}},l.isDefined=function(e){return e in t},l})})(Vt)),Vt.exports}var Gt=/*@__PURE__*/ Bt(Wt());function Kt(e){return new Promise((t,n)=>{Gt(e,{success:t,error:n})})}function qt(e){if(I.empty(e))return null;if(I.number(Number(e)))return e;let t=e.match(/^.*(vimeo.com\/|video\/)(\d+).*/);return t?t[2]:e}function Jt(e){let t=e.match(/^.*(vimeo.com\/|video\/)(\d+)(\?.*h=|\/)+([\d,a-f]+)/);return t&&t.length===5?t[4]:null}function Yt(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,qe.call(this,this.media,e?`play`:`pause`))}var Xt={setup(){let e=this;Ne(e.elements.wrapper,e.config.classNames.embed,!0),e.options.speed=e.config.speed.options,it.call(e),I.object(window.Vimeo)?Xt.ready.call(e):Kt(e.config.urls.vimeo.sdk).then(()=>{Xt.ready.call(e)}).catch(t=>{e.debug.warn(`Vimeo SDK (player.js) failed to load`,t)})},ready(){let e=this,t=e.config.vimeo,{premium:n,referrerPolicy:r,...i}=t,a=e.media.getAttribute(`src`),o=``;I.empty(a)?(a=e.media.getAttribute(e.config.attributes.embed.id),o=e.media.getAttribute(e.config.attributes.embed.hash)):o=Jt(a);let s=o?{h:o}:{};n&&Object.assign(i,{controls:!1,sidedock:!1});let c=Dt({loop:e.config.loop.active,autoplay:e.autoplay,muted:e.muted,gesture:`media`,playsinline:e.config.playsinline,...s,...i}),l=qt(a),u=Ee(`iframe`),d=ut(e.config.urls.vimeo.iframe,l,c);if(u.setAttribute(`src`,d),u.setAttribute(`allowfullscreen`,``),u.setAttribute(`allow`,[`autoplay`,`fullscreen`,`picture-in-picture`,`encrypted-media`,`accelerometer`,`gyroscope`].join(`; `)),I.empty(r)||u.setAttribute(`referrerPolicy`,r),n||!t.customControls)u.setAttribute(`data-poster`,e.poster),e.media=Ae(u,e.media);else{let t=Ee(`div`,{class:e.config.classNames.embedContainer,"data-poster":e.poster});t.appendChild(u),e.media=Ae(t,e.media)}t.customControls||bt(ut(e.config.urls.vimeo.api,d)).then(t=>{!I.empty(t)&&t.thumbnail_url&&Rt.setPoster.call(e,t.thumbnail_url).catch(()=>{})}),e.embed=new window.Vimeo.Player(u,{autopause:e.config.autopause,muted:e.muted}),e.media.paused=!0,e.media.currentTime=0,e.supported.ui&&e.embed.disableTextTrack(),e.media.play=()=>(Yt.call(e,!0),e.embed.play()),e.media.pause=()=>(Yt.call(e,!1),e.embed.pause()),e.media.stop=()=>{e.pause(),e.currentTime=0};let{currentTime:f}=e.media;Object.defineProperty(e.media,"currentTime",{get(){return f},set(t){let{embed:n,media:r,paused:i,volume:a}=e,o=i&&!n.hasPlayed;r.seeking=!0,qe.call(e,r,`seeking`),Promise.resolve(o&&n.setVolume(0)).then(()=>n.setCurrentTime(t)).then(()=>o&&n.pause()).then(()=>o&&n.setVolume(a)).catch(()=>{})}});let p=e.config.speed.selected;Object.defineProperty(e.media,"playbackRate",{get(){return p},set(t){e.embed.setPlaybackRate(t).then(()=>{p=t,qe.call(e,e.media,`ratechange`)}).catch(()=>{e.options.speed=[1]})}});let{volume:m}=e.config;Object.defineProperty(e.media,"volume",{get(){return m},set(t){e.embed.setVolume(t).then(()=>{m=t,qe.call(e,e.media,`volumechange`)})}});let{muted:h}=e.config;Object.defineProperty(e.media,"muted",{get(){return h},set(t){let n=I.boolean(t)?t:!1;e.embed.setMuted(n?!0:e.config.muted).then(()=>{h=n,qe.call(e,e.media,`volumechange`)})}});let{loop:g}=e.config;Object.defineProperty(e.media,"loop",{get(){return g},set(t){let n=I.boolean(t)?t:e.config.loop.active;e.embed.setLoop(n).then(()=>{g=n})}});let _;e.embed.getVideoUrl().then(t=>{_=t,z.setDownloadUrl.call(e)}).catch(e=>{this.debug.warn(e)}),Object.defineProperty(e.media,"currentSrc",{get(){return _}}),Object.defineProperty(e.media,"ended",{get(){return e.currentTime===e.duration}}),Promise.all([e.embed.getVideoWidth(),e.embed.getVideoHeight()]).then(t=>{let[n,r]=t;e.embed.ratio=at(n,r),it.call(this)}),e.embed.setAutopause(e.config.autopause).then(t=>{e.config.autopause=t}),e.embed.getVideoTitle().then(t=>{e.config.title=t,Rt.setTitle.call(this)}),e.embed.getCurrentTime().then(t=>{f=t,qe.call(e,e.media,`timeupdate`)}),e.embed.getDuration().then(t=>{e.media.duration=t,qe.call(e,e.media,`durationchange`)}),e.embed.getTextTracks().then(t=>{e.media.textTracks=t,Ot.setup.call(e)}),e.embed.on(`cuechange`,({cues:t=[]})=>{let n=t.map(e=>ht(e.text));Ot.updateCues.call(e,n)}),e.embed.on(`loaded`,()=>{e.embed.getPaused().then(t=>{Yt.call(e,!t),t||qe.call(e,e.media,`playing`)}),I.element(e.embed.element)&&e.supported.ui&&e.embed.element.setAttribute(`tabindex`,-1)}),e.embed.on(`bufferstart`,()=>{qe.call(e,e.media,`waiting`)}),e.embed.on(`bufferend`,()=>{qe.call(e,e.media,`playing`)}),e.embed.on(`play`,()=>{Yt.call(e,!0),qe.call(e,e.media,`playing`)}),e.embed.on(`pause`,()=>{Yt.call(e,!1)}),e.embed.on(`timeupdate`,t=>{e.media.seeking=!1,f=t.seconds,qe.call(e,e.media,`timeupdate`)}),e.embed.on(`progress`,t=>{e.media.buffered=t.percent,qe.call(e,e.media,`progress`),Number.parseInt(t.percent,10)===1&&qe.call(e,e.media,`canplaythrough`),e.embed.getDuration().then(t=>{t!==e.media.duration&&(e.media.duration=t,qe.call(e,e.media,`durationchange`))})}),e.embed.on(`seeked`,()=>{e.media.seeking=!1,qe.call(e,e.media,`seeked`)}),e.embed.on(`ended`,()=>{e.media.paused=!0,qe.call(e,e.media,`ended`)}),e.embed.on(`error`,t=>{e.media.error=t,qe.call(e,e.media,`error`)}),t.customControls&&setTimeout(()=>Rt.build.call(e),0)}};function Zt(e){if(I.empty(e))return null;let t=e.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/);return t&&t[2]?t[2]:e}function Qt(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,qe.call(this,this.media,e?`play`:`pause`))}function $t(e){if(e.noCookie)return`https://www.youtube-nocookie.com`;if(window.location.protocol===`http:`)return`http://www.youtube.com`}var en={setup(){if(Ne(this.elements.wrapper,this.config.classNames.embed,!0),I.object(window.YT)&&I.function(window.YT.Player))en.ready.call(this);else{let e=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{I.function(e)&&e(),en.ready.call(this)},Kt(this.config.urls.youtube.sdk).catch(e=>{this.debug.warn(`YouTube API failed to load`,e)})}},getTitle(e){bt(ut(this.config.urls.youtube.api,e)).then(e=>{if(I.object(e)){let{title:t,height:n,width:r}=e;this.config.title=t,Rt.setTitle.call(this),this.embed.ratio=at(r,n)}it.call(this)}).catch(()=>{it.call(this)})},ready(){let e=this,t=e.config.youtube,n=e.media&&e.media.getAttribute(`id`);if(!I.empty(n)&&n.startsWith(`youtube-`))return;let r=e.media.getAttribute(`src`);I.empty(r)&&(r=e.media.getAttribute(this.config.attributes.embed.id));let i=Zt(r);if(e.media=Ae(Ee(`div`,{id:lt(e.provider),"data-poster":t.customControls?e.poster:void 0}),e.media),t.customControls){let t=e=>`https://i.ytimg.com/vi/${i}/${e}default.jpg`;Lt(t(`maxres`),121).catch(()=>Lt(t(`sd`),121)).catch(()=>Lt(t(`hq`))).then(t=>Rt.setPoster.call(e,t.src)).then(t=>{t.includes(`maxres`)||(e.elements.poster.style.backgroundSize=`cover`)}).catch(()=>{})}e.embed=new window.YT.Player(e.media,{videoId:i,host:$t(t),playerVars:Ce({},{autoplay:+!!e.config.autoplay,hl:e.config.hl,controls:e.supported.ui&&t.customControls?0:1,disablekb:1,playsinline:e.config.playsinline&&!e.config.fullscreen.iosNative?1:0,cc_load_policy:+!!e.captions.active,cc_lang_pref:e.config.captions.language,widget_referrer:window?window.location.href:null},t),events:{onError(t){if(!e.media.error){let n=t.data,r={2:`The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.`,5:`The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.`,100:`The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.`,101:`The owner of the requested video does not allow it to be played in embedded players.`,150:`The owner of the requested video does not allow it to be played in embedded players.`}[n]||`An unknown error occurred`;e.media.error={code:n,message:r},qe.call(e,e.media,`error`)}},onPlaybackRateChange(t){let n=t.target;e.media.playbackRate=n.getPlaybackRate(),qe.call(e,e.media,`ratechange`)},onReady(n){if(I.function(e.media.play))return;let r=n.target;en.getTitle.call(e,i),e.media.play=()=>{Qt.call(e,!0),r.playVideo()},e.media.pause=()=>{Qt.call(e,!1),r.pauseVideo()},e.media.stop=()=>{r.stopVideo()},e.media.duration=r.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get(){return Number(r.getCurrentTime())},set(t){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,qe.call(e,e.media,`seeking`),r.seekTo(t)}}),Object.defineProperty(e.media,"playbackRate",{get(){return r.getPlaybackRate()},set(e){r.setPlaybackRate(e)}});let{volume:a}=e.config;Object.defineProperty(e.media,"volume",{get(){return a},set(t){a=t,r.setVolume(a*100),qe.call(e,e.media,`volumechange`)}});let{muted:o}=e.config;Object.defineProperty(e.media,"muted",{get(){return o},set(t){let n=I.boolean(t)?t:o;o=n,r[n?`mute`:`unMute`](),r.setVolume(a*100),qe.call(e,e.media,`volumechange`)}}),Object.defineProperty(e.media,"currentSrc",{get(){return r.getVideoUrl()}}),Object.defineProperty(e.media,"ended",{get(){return e.currentTime===e.duration}});let s=r.getAvailablePlaybackRates();e.options.speed=s.filter(t=>e.config.speed.options.includes(t)),e.supported.ui&&t.customControls&&e.media.setAttribute(`tabindex`,-1),qe.call(e,e.media,`timeupdate`),qe.call(e,e.media,`durationchange`),clearInterval(e.timers.buffering),e.timers.buffering=setInterval(()=>{e.media.buffered=r.getVideoLoadedFraction(),(e.media.lastBuffered===null||e.media.lastBuffered<e.media.buffered)&&qe.call(e,e.media,`progress`),e.media.lastBuffered=e.media.buffered,e.media.buffered===1&&(clearInterval(e.timers.buffering),qe.call(e,e.media,`canplaythrough`))},200),t.customControls&&setTimeout(()=>Rt.build.call(e),50)},onStateChange(n){let r=n.target;switch(clearInterval(e.timers.playing),e.media.seeking&&[1,2].includes(n.data)&&(e.media.seeking=!1,qe.call(e,e.media,`seeked`)),n.data){case-1:qe.call(e,e.media,`timeupdate`),e.media.buffered=r.getVideoLoadedFraction(),qe.call(e,e.media,`progress`);break;case 0:Qt.call(e,!1),e.media.loop?(r.stopVideo(),r.playVideo()):qe.call(e,e.media,`ended`);break;case 1:t.customControls&&!e.config.autoplay&&e.media.paused&&!e.embed.hasPlayed?e.media.pause():(Qt.call(e,!0),qe.call(e,e.media,`playing`),e.timers.playing=setInterval(()=>{qe.call(e,e.media,`timeupdate`)},50),e.media.duration!==r.getDuration()&&(e.media.duration=r.getDuration(),qe.call(e,e.media,`durationchange`)));break;case 2:e.muted||e.embed.unMute(),Qt.call(e,!1);break;case 3:qe.call(e,e.media,`waiting`)}qe.call(e,e.elements.container,`statechange`,!1,{code:n.data})}}})}},tn={setup(){this.media?(Ne(this.elements.container,this.config.classNames.type.replace(`{0}`,this.type),!0),Ne(this.elements.container,this.config.classNames.provider.replace(`{0}`,this.provider),!0),this.isEmbed&&Ne(this.elements.container,this.config.classNames.type.replace(`{0}`,`video`),!0),this.isVideo&&(this.elements.wrapper=Ee(`div`,{class:this.config.classNames.video}),we(this.media,this.elements.wrapper),this.elements.poster=Ee(`div`,{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?st.setup.call(this):this.isYouTube?en.setup.call(this):this.isVimeo&&Xt.setup.call(this)):this.debug.warn(`No media element found!`)}};function nn(e){e.manager&&e.manager.destroy(),e.elements.displayContainer&&e.elements.displayContainer.destroy(),e.elements.container.remove()}var rn=class{constructor(e){l(this,`load`,()=>{this.enabled&&(!I.object(window.google)||!I.object(window.google.ima)?Kt(this.player.config.urls.googleIMA.sdk).then(()=>{this.ready()}).catch(()=>{this.trigger(`error`,/* @__PURE__ */ Error(`Google IMA SDK failed to load`))}):this.ready())}),l(this,`ready`,()=>{this.enabled||nn(this),this.startSafetyTimer(12e3,`ready()`),this.managerPromise.then(()=>{this.clearSafetyTimer(`onAdsManagerLoaded()`)}),this.listeners(),this.setupIMA()}),l(this,`setupIMA`,()=>{this.elements.container=Ee(`div`,{class:this.player.config.classNames.ads}),this.player.elements.container.appendChild(this.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(this.player.config.ads.language),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.player.config.playsinline),this.elements.displayContainer=new google.ima.AdDisplayContainer(this.elements.container,this.player.media),this.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,e=>this.onAdsManagerLoaded(e),!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,e=>this.onAdError(e),!1),this.requestAds()}),l(this,`requestAds`,()=>{let{container:e}=this.player.elements;try{let t=new google.ima.AdsRequest;t.adTagUrl=this.tagUrl,t.linearAdSlotWidth=e.offsetWidth,t.linearAdSlotHeight=e.offsetHeight,t.nonLinearAdSlotWidth=e.offsetWidth,t.nonLinearAdSlotHeight=e.offsetHeight,t.forceNonLinearFullSlot=!1,t.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(t)}catch(e){this.onAdError(e)}}),l(this,`pollCountdown`,(e=!1)=>{if(!e){clearInterval(this.countdownTimer),this.elements.container.removeAttribute(`data-badge-text`);return}let t=()=>{let e=Tt(Math.max(this.manager.getRemainingTime(),0)),t=`${vt.get(`advertisement`,this.player.config)} - ${e}`;this.elements.container.setAttribute(`data-badge-text`,t)};this.countdownTimer=setInterval(t,100)}),l(this,`onAdsManagerLoaded`,e=>{if(!this.enabled)return;let t=new google.ima.AdsRenderingSettings;t.restoreCustomPlaybackStateOnAdBreakComplete=!0,t.enablePreloading=!0,this.manager=e.getAdsManager(this.player,t),this.cuePoints=this.manager.getCuePoints(),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,e=>this.onAdError(e)),Object.keys(google.ima.AdEvent.Type).forEach(e=>{this.manager.addEventListener(google.ima.AdEvent.Type[e],e=>this.onAdEvent(e))}),this.trigger(`loaded`)}),l(this,`addCuePoints`,()=>{I.empty(this.cuePoints)||this.cuePoints.forEach(e=>{if(e!==0&&e!==-1&&e<this.player.duration){let t=this.player.elements.progress;if(I.element(t)){let n=100/this.player.duration*e,r=Ee(`span`,{class:this.player.config.classNames.cues});r.style.left=`${n.toString()}%`,t.appendChild(r)}}})}),l(this,`onAdEvent`,e=>{let{container:t}=this.player.elements,n=e.getAd(),r=e.getAdData();switch((e=>{qe.call(this.player,this.player.media,`ads${e.replace(/_/g,``).toLowerCase()}`)})(e.type),e.type){case google.ima.AdEvent.Type.LOADED:this.trigger(`loaded`),this.pollCountdown(!0),n.isLinear()||(n.width=t.offsetWidth,n.height=t.offsetHeight);break;case google.ima.AdEvent.Type.STARTED:this.manager.setVolume(this.player.volume);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:this.player.ended?this.loadAds():this.loader.contentComplete();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:this.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:this.pollCountdown(),this.resumeContent();break;case google.ima.AdEvent.Type.LOG:r.adError&&this.player.debug.warn(`Non-fatal ad error: ${r.adError.getMessage()}`)}}),l(this,`onAdError`,e=>{this.cancel(),this.player.debug.warn(`Ads error`,e)}),l(this,`listeners`,()=>{let{container:e}=this.player.elements,t;this.player.on(`canplay`,()=>{this.addCuePoints()}),this.player.on(`ended`,()=>{this.loader.contentComplete()}),this.player.on(`timeupdate`,()=>{t=this.player.currentTime}),this.player.on(`seeked`,()=>{let e=this.player.currentTime;I.empty(this.cuePoints)||this.cuePoints.forEach((n,r)=>{t<n&&n<e&&(this.manager.discardAdBreak(),this.cuePoints.splice(r,1))})}),window.addEventListener(`resize`,()=>{this.manager&&this.manager.resize(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL)})}),l(this,`play`,()=>{let{container:e}=this.player.elements;this.managerPromise||this.resumeContent(),this.managerPromise.then(()=>{this.manager.setVolume(this.player.volume),this.elements.displayContainer.initialize();try{this.initialized||(this.manager.init(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL),this.manager.start()),this.initialized=!0}catch(e){this.onAdError(e)}}).catch(()=>{})}),l(this,`resumeContent`,()=>{this.elements.container.style.zIndex=``,this.playing=!1,Xe(this.player.media.play())}),l(this,`pauseContent`,()=>{this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()}),l(this,`cancel`,()=>{this.initialized&&this.resumeContent(),this.trigger(`error`),this.loadAds()}),l(this,`loadAds`,()=>{this.managerPromise.then(()=>{this.manager&&this.manager.destroy(),this.managerPromise=new Promise(e=>{this.on(`loaded`,e),this.player.debug.log(this.manager)}),this.initialized=!1,this.requestAds()}).catch(()=>{})}),l(this,`trigger`,(e,...t)=>{let n=this.events[e];I.array(n)&&n.forEach(e=>{I.function(e)&&e.apply(this,t)})}),l(this,`on`,(e,t)=>(I.array(this.events[e])||(this.events[e]=[]),this.events[e].push(t),this)),l(this,`startSafetyTimer`,(e,t)=>{this.player.debug.log(`Safety timer invoked from: ${t}`),this.safetyTimer=setTimeout(()=>{this.cancel(),this.clearSafetyTimer(`startSafetyTimer()`)},e)}),l(this,`clearSafetyTimer`,e=>{I.nullOrUndefined(this.safetyTimer)||(this.player.debug.log(`Safety timer cleared from: ${e}`),clearTimeout(this.safetyTimer),this.safetyTimer=null)}),this.player=e,this.config=e.config.ads,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise((e,t)=>{this.on(`loaded`,e),this.on(`error`,t)}),this.load()}get enabled(){let{config:e}=this;return this.player.isHTML5&&this.player.isVideo&&e.enabled&&(!I.empty(e.publisherId)||I.url(e.tagUrl))}get tagUrl(){let{config:e}=this;return I.url(e.tagUrl)?e.tagUrl:`https://go.aniview.com/api/adserver6/vast/?${Dt({AV_PUBLISHERID:`58c25bb0073ef448b1087ad6`,AV_CHANNELID:`5a0458dc28a06145e4519d21`,AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:e.publisherId})}`}};function an(e=0,t=0,n=255){return Math.min(Math.max(e,t),n)}function on(e){let t=[];return e.split(/\r\n\r\n|\n\n|\r\r/).forEach(e=>{let n={};e.split(/\r\n|\n|\r/).forEach(e=>{if(!I.number(n.startTime)){let t=e.match(/(\d{2})?:?(\d{2}):(\d{2}).(\d{2,3})( ?--> ?)(\d{2})?:?(\d{2}):(\d{2}).(\d{2,3})/);t&&(n.startTime=Number(t[1]||0)*60*60+Number(t[2])*60+Number(t[3])+Number(`0.${t[4]}`),n.endTime=Number(t[6]||0)*60*60+Number(t[7])*60+Number(t[8])+Number(`0.${t[9]}`))}else if(!I.empty(e.trim())&&I.empty(n.text)){let t=e.trim().split(`#xywh=`);[n.text]=t,t[1]&&([n.x,n.y,n.w,n.h]=t[1].split(`,`))}}),n.text&&t.push(n)}),t}function sn(e,t){let n=t.width/t.height,r={};return e>n?(r.width=t.width,r.height=1/e*t.width):(r.height=t.height,r.width=e*t.height),r}var cn=class{constructor(e){l(this,`load`,()=>{this.player.elements.display.seekTooltip&&(this.player.elements.display.seekTooltip.hidden=this.enabled),this.enabled&&this.getThumbnails().then(()=>{this.enabled&&(this.render(),this.determineContainerAutoSizing(),this.listeners(),this.loaded=!0)})}),l(this,`getThumbnails`,()=>new Promise(e=>{let{src:t}=this.player.config.previewThumbnails;if(I.empty(t))throw Error(`Missing previewThumbnails.src config attribute`);let n=()=>{this.thumbnails.sort((e,t)=>e.height-t.height),this.player.debug.log(`Preview thumbnails`,this.thumbnails),e()};if(I.function(t))t(e=>{this.thumbnails=e,n()});else{let e=(I.string(t)?[t]:t).map(e=>this.getThumbnail(e));Promise.all(e).then(n)}})),l(this,`getThumbnail`,e=>new Promise(t=>{bt(e,void 0,this.player.config.previewThumbnails.withCredentials).then(n=>{let r={frames:on(n),height:null,urlPrefix:``};!r.frames[0].text.startsWith(`/`)&&!r.frames[0].text.startsWith(`http://`)&&!r.frames[0].text.startsWith(`https://`)&&(r.urlPrefix=e.substring(0,e.lastIndexOf(`/`)+1));let i=new Image;i.onload=()=>{r.height=i.naturalHeight,r.width=i.naturalWidth,this.thumbnails.push(r),t()},i.src=r.urlPrefix+r.frames[0].text})})),l(this,`startMove`,e=>{if(this.loaded&&I.event(e)&&[`touchmove`,`mousemove`].includes(e.type)&&this.player.media.duration){if(e.type===`touchmove`)this.seekTime=this.player.media.duration*(this.player.elements.inputs.seek.value/100);else{let t=this.player.elements.progress.getBoundingClientRect(),n=100/t.width*(e.pageX-t.left);this.seekTime=this.player.media.duration*(n/100),this.seekTime<0&&(this.seekTime=0),this.seekTime>this.player.media.duration-1&&(this.seekTime=this.player.media.duration-1),this.mousePosX=e.pageX,this.elements.thumb.time.textContent=Tt(this.seekTime);let r=this.player.config.markers?.points?.find(({time:e})=>e===Math.round(this.seekTime));r&&this.elements.thumb.time.insertAdjacentHTML(`afterbegin`,`${r.label}<br>`)}this.showImageAtCurrentTime()}}),l(this,`endMove`,()=>{this.toggleThumbContainer(!1,!0)}),l(this,`startScrubbing`,e=>{(I.nullOrUndefined(e.button)||e.button===!1||e.button===0)&&(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))}),l(this,`endScrubbing`,()=>{this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):Ke.call(this.player,this.player.media,`timeupdate`,()=>{this.mouseDown||this.toggleScrubbingContainer(!1)})}),l(this,`listeners`,()=>{this.player.on(`play`,()=>{this.toggleThumbContainer(!1,!0)}),this.player.on(`seeked`,()=>{this.toggleThumbContainer(!1)}),this.player.on(`timeupdate`,()=>{this.lastTime=this.player.media.currentTime})}),l(this,`render`,()=>{this.elements.thumb.container=Ee(`div`,{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=Ee(`div`,{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);let e=Ee(`div`,{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=Ee(`span`,{},`00:00`),e.appendChild(this.elements.thumb.time),this.elements.thumb.imageContainer.appendChild(e),I.element(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=Ee(`div`,{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)}),l(this,`destroy`,()=>{this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()}),l(this,`showImageAtCurrentTime`,()=>{this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();let e=this.thumbnails[0].frames.findIndex(e=>this.seekTime>=e.startTime&&this.seekTime<=e.endTime),t=e>=0,n=0;this.mouseDown||this.toggleThumbContainer(t),t&&(this.thumbnails.forEach((t,r)=>{this.loadedImages.includes(t.frames[e].text)&&(n=r)}),e!==this.showingThumb&&(this.showingThumb=e,this.loadImage(n)))}),l(this,`loadImage`,(e=0)=>{let t=this.showingThumb,n=this.thumbnails[e],{urlPrefix:r}=n,i=n.frames[t],a=n.frames[t].text,o=r+a;if(!this.currentImageElement||this.currentImageElement.dataset.filename!==a){this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);let n=new Image;n.src=o,n.dataset.index=t,n.dataset.filename=a,this.showingThumbFilename=a,this.player.debug.log(`Loading image: ${o}`),n.onload=()=>this.showImage(n,i,e,t,a,!0),this.loadingImage=n,this.removeOldImages(n)}else this.showImage(this.currentImageElement,i,e,t,a,!1),this.currentImageElement.dataset.index=t,this.removeOldImages(this.currentImageElement)}),l(this,`showImage`,(e,t,n,r,i,a=!0)=>{this.player.debug.log(`Showing thumb: ${i}. num: ${r}. qual: ${n}. newimg: ${a}`),this.setImageSizeAndOffset(e,t),a&&(this.currentImageContainer.appendChild(e),this.currentImageElement=e,this.loadedImages.includes(i)||this.loadedImages.push(i)),this.preloadNearby(r,!0).then(this.preloadNearby(r,!1)).then(this.getHigherQuality(n,e,t,i))}),l(this,`removeOldImages`,e=>{Array.from(this.currentImageContainer.children).forEach(t=>{if(t.tagName.toLowerCase()!==`img`)return;let n=this.usingSprites?500:1e3;if(t.dataset.index!==e.dataset.index&&!t.dataset.deleting){t.dataset.deleting=!0;let{currentImageContainer:e}=this;setTimeout(()=>{e.removeChild(t),this.player.debug.log(`Removing thumb: ${t.dataset.filename}`)},n)}})}),l(this,`preloadNearby`,(e,t=!0)=>new Promise(n=>{setTimeout(()=>{let r=this.thumbnails[0].frames[e].text;if(this.showingThumbFilename===r){let i;i=t?this.thumbnails[0].frames.slice(e):this.thumbnails[0].frames.slice(0,e).reverse();let a=!1;i.forEach(e=>{let t=e.text;if(t!==r&&!this.loadedImages.includes(t)){a=!0,this.player.debug.log(`Preloading thumb filename: ${t}`);let{urlPrefix:e}=this.thumbnails[0],r=e+t,i=new Image;i.src=r,i.onload=()=>{this.player.debug.log(`Preloaded thumb filename: ${t}`),this.loadedImages.includes(t)||this.loadedImages.push(t),n()}}}),a||n()}},300)})),l(this,`getHigherQuality`,(e,t,n,r)=>{if(e<this.thumbnails.length-1){let i=t.naturalHeight;this.usingSprites&&(i=n.h),i<this.thumbContainerHeight&&setTimeout(()=>{this.showingThumbFilename===r&&(this.player.debug.log(`Showing higher quality thumb for: ${r}`),this.loadImage(e+1))},300)}}),l(this,`toggleThumbContainer`,(e=!1,t=!1)=>{let n=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(n,e),!e&&t&&(this.showingThumb=null,this.showingThumbFilename=null)}),l(this,`toggleScrubbingContainer`,(e=!1)=>{let t=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(t,e),e||(this.showingThumb=null,this.showingThumbFilename=null)}),l(this,`determineContainerAutoSizing`,()=>{(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)}),l(this,`setThumbContainerSizeAndPos`,()=>{let{imageContainer:e}=this.elements.thumb;if(!this.sizeSpecifiedInCSS){let t=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);e.style.height=`${this.thumbContainerHeight}px`,e.style.width=`${t}px`}else if(e.clientHeight>20&&e.clientWidth<20){let t=Math.floor(e.clientHeight*this.thumbAspectRatio);e.style.width=`${t}px`}else if(e.clientHeight<20&&e.clientWidth>20){let t=Math.floor(e.clientWidth/this.thumbAspectRatio);e.style.height=`${t}px`}this.setThumbContainerPos()}),l(this,`setThumbContainerPos`,()=>{let e=this.player.elements.progress.getBoundingClientRect(),t=this.player.elements.container.getBoundingClientRect(),{container:n}=this.elements.thumb,r=t.left-e.left+10,i=t.right-e.left-n.clientWidth-10,a=this.mousePosX-e.left-n.clientWidth/2,o=an(a,r,i);n.style.left=`${o}px`,n.style.setProperty(`--preview-arrow-offset`,`${a-o}px`)}),l(this,`setScrubbingContainerSize`,()=>{let{width:e,height:t}=sn(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});this.elements.scrubbing.container.style.width=`${e}px`,this.elements.scrubbing.container.style.height=`${t}px`}),l(this,`setImageSizeAndOffset`,(e,t)=>{if(!this.usingSprites)return;let n=this.thumbContainerHeight/t.h;e.style.height=`${e.naturalHeight*n}px`,e.style.width=`${e.naturalWidth*n}px`,e.style.left=`-${t.x*n}px`,e.style.top=`-${t.y*n}px`}),this.player=e,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}get enabled(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}get currentImageContainer(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}get usingSprites(){return Object.keys(this.thumbnails[0].frames[0]).includes(`w`)}get thumbAspectRatio(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}get thumbContainerHeight(){if(this.mouseDown){let{height:e}=sn(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});return e}return this.sizeSpecifiedInCSS?this.elements.thumb.imageContainer.clientHeight:Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}get currentImageElement(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement}set currentImageElement(e){this.mouseDown?this.currentScrubbingImageElement=e:this.currentThumbnailImageElement=e}},ln={insertElements(e,t){I.string(t)?Oe(e,this.media,{src:t}):I.array(t)&&t.forEach(t=>{Oe(e,this.media,t)})},change(e){Se(e,`sources.length`)?(st.cancelRequests.call(this),this.destroy(()=>{this.options.quality=[],L(this.media),this.media=null,I.element(this.elements.container)&&this.elements.container.removeAttribute(`class`);let{sources:t,type:n}=e,[{provider:r=jt.html5,src:i}]=t,a=r===`html5`?n:`div`,o=r===`html5`?{}:{src:i};Object.assign(this,{provider:r,type:n,supported:Ve.check(n,r,this.config.playsinline),media:Ee(a,o)}),this.elements.container.appendChild(this.media),I.boolean(e.autoplay)&&(this.config.autoplay=e.autoplay),this.isHTML5&&(this.config.crossorigin&&this.media.setAttribute(`crossorigin`,``),this.config.autoplay&&this.media.setAttribute(`autoplay`,``),I.empty(e.poster)||(this.poster=e.poster),this.config.loop.active&&this.media.setAttribute(`loop`,``),this.config.muted&&this.media.setAttribute(`muted`,``),this.config.playsinline&&this.media.setAttribute(`playsinline`,``)),Rt.addStyleHook.call(this),this.isHTML5&&ln.insertElements.call(this,`source`,t),this.config.title=e.title,tn.setup.call(this),this.isHTML5&&Object.keys(e).includes(`tracks`)&&ln.insertElements.call(this,`track`,e.tracks),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Rt.build.call(this),this.isHTML5&&this.media.load(),I.empty(e.previewThumbnails)||(Object.assign(this.config.previewThumbnails,e.previewThumbnails),this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new cn(this))),this.fullscreen.update()},!0)):this.debug.warn(`Invalid source format`)}},un=class e{constructor(t,n){if(l(this,`play`,()=>I.function(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then(()=>this.ads.play()).catch(()=>Xe(this.media.play())),this.media.play()):null),l(this,`pause`,()=>!this.playing||!I.function(this.media.pause)?null:this.media.pause()),l(this,`togglePlay`,e=>(I.boolean(e)?e:!this.playing)?this.play():this.pause()),l(this,`stop`,()=>{this.isHTML5?(this.pause(),this.restart()):I.function(this.media.stop)&&this.media.stop()}),l(this,`restart`,()=>{this.currentTime=0}),l(this,`rewind`,e=>{this.currentTime-=I.number(e)?e:this.config.seekTime}),l(this,`forward`,e=>{this.currentTime+=I.number(e)?e:this.config.seekTime}),l(this,`increaseVolume`,e=>{let t=this.media.muted?0:this.volume;this.volume=t+(I.number(e)?e:0)}),l(this,`decreaseVolume`,e=>{this.increaseVolume(-e)}),l(this,`airplay`,()=>{Ve.airplay&&this.media.webkitShowPlaybackTargetPicker()}),l(this,`toggleControls`,e=>{if(this.supported.ui&&!this.isAudio){let t=Pe(this.elements.container,this.config.classNames.hideControls),n=e===void 0?void 0:!e,r=Ne(this.elements.container,this.config.classNames.hideControls,n);if(r&&I.array(this.config.controls)&&this.config.controls.includes(`settings`)&&!I.empty(this.config.settings)&&z.toggleMenu.call(this,!1),r!==t){let e=r?`controlshidden`:`controlsshown`;qe.call(this,this.media,e)}return!r}return!1}),l(this,`on`,(e,t)=>{We.call(this,this.elements.container,e,t)}),l(this,`once`,(e,t)=>{Ke.call(this,this.elements.container,e,t)}),l(this,`off`,(e,t)=>{Ge(this.elements.container,e,t)}),l(this,`destroy`,(e,t=!1)=>{if(!this.ready)return;let n=()=>{document.body.style.overflow=``,this.embed=null,t?(Object.keys(this.elements).length&&(L(this.elements.buttons.play),L(this.elements.captions),L(this.elements.controls),L(this.elements.wrapper),this.elements.buttons.play=null,this.elements.captions=null,this.elements.controls=null,this.elements.wrapper=null),I.function(e)&&e()):(Je.call(this),st.cancelRequests.call(this),Ae(this.elements.original,this.elements.container),qe.call(this,this.elements.original,`destroyed`,!0),I.function(e)&&e.call(this.elements.original),this.ready=!1,setTimeout(()=>{this.elements=null,this.media=null},200))};this.stop(),clearTimeout(this.timers.loading),clearTimeout(this.timers.controls),clearTimeout(this.timers.resized),this.isHTML5?(Rt.toggleNativeControls.call(this,!0),n()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),this.embed!==null&&I.function(this.embed.destroy)&&this.embed.destroy(),n()):this.isVimeo&&(this.embed!==null&&this.embed.unload().then(n),setTimeout(n,200))}),l(this,`supports`,e=>Ve.mime.call(this,e)),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=Ve.touch,this.media=t,I.string(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||I.nodeList(this.media)||I.array(this.media))&&(this.media=this.media[0]),this.config=Ce({},kt,e.defaults,n||{},(()=>{try{return JSON.parse(this.media.getAttribute(`data-plyr-config`))}catch{return{}}})()),this.elements={container:null,fullscreen:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:/* @__PURE__ */ new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new Ft(this.config.debug),this.debug.log(`Config`,this.config),this.debug.log(`Support`,Ve),I.nullOrUndefined(this.media)||!I.element(this.media)){this.debug.error(`Setup failed: no suitable element passed`);return}if(this.media.plyr){this.debug.warn(`Target already setup`);return}if(!this.config.enabled){this.debug.error(`Setup failed: disabled by config`);return}if(!Ve.check().api){this.debug.error(`Setup failed: no support`);return}let r=this.media.cloneNode(!0);r.autoplay=!1,this.elements.original=r;let i=this.media.tagName.toLowerCase(),a=null,o=null;switch(i){case`div`:if(a=this.media.querySelector(`iframe`),I.element(a)){if(o=Et(a.getAttribute(`src`)),this.provider=Nt(o.toString()),this.elements.container=this.media,this.media=a,this.elements.container.className=``,o.search.length){let e=[`1`,`true`];e.includes(o.searchParams.get(`autoplay`))&&(this.config.autoplay=!0),e.includes(o.searchParams.get(`loop`))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=e.includes(o.searchParams.get(`playsinline`)),this.config.youtube.hl=o.searchParams.get(`hl`)):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(I.empty(this.provider)||!Object.values(jt).includes(this.provider)){this.debug.error(`Setup failed: Invalid provider`);return}this.type=Mt.video;break;case`video`:case`audio`:this.type=i,this.provider=jt.html5,this.media.hasAttribute(`crossorigin`)&&(this.config.crossorigin=!0),this.media.hasAttribute(`autoplay`)&&(this.config.autoplay=!0),(this.media.hasAttribute(`playsinline`)||this.media.hasAttribute(`webkit-playsinline`))&&(this.config.playsinline=!0),this.media.hasAttribute(`muted`)&&(this.config.muted=!0),this.media.hasAttribute(`loop`)&&(this.config.loop.active=!0);break;default:this.debug.error(`Setup failed: unsupported type`);return}this.supported=Ve.check(this.type,this.provider),this.supported.api?(this.eventListeners=[],this.listeners=new zt(this),this.storage=new yt(this),this.media.plyr=this,I.element(this.elements.container)||(this.elements.container=Ee(`div`),we(this.media,this.elements.container)),Rt.migrateStyles.call(this),Rt.addStyleHook.call(this),tn.setup.call(this),this.config.debug&&We.call(this,this.elements.container,this.config.events.join(` `),e=>{this.debug.log(`event: ${e.type}`)}),this.fullscreen=new It(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Rt.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new rn(this)),this.isHTML5&&this.config.autoplay&&this.once(`canplay`,()=>Xe(this.play())),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new cn(this))):this.debug.error(`Setup failed: no support`)}get isHTML5(){return this.provider===jt.html5}get isEmbed(){return this.isYouTube||this.isVimeo}get isYouTube(){return this.provider===jt.youtube}get isVimeo(){return this.provider===jt.vimeo}get isVideo(){return this.type===Mt.video}get isAudio(){return this.type===Mt.audio}get playing(){return!(!this.ready||this.paused||this.ended)}get paused(){return!!this.media.paused}get stopped(){return!!(this.paused&&this.currentTime===0)}get ended(){return!!this.media.ended}set currentTime(e){if(!this.duration)return;let t=I.number(e)&&e>0;this.media.currentTime=t?Math.min(e,this.duration):0,this.debug.log(`Seeking to ${this.currentTime} seconds`)}get currentTime(){return Number(this.media.currentTime)}get buffered(){let{buffered:e}=this.media;return I.number(e)?e:e&&e.length&&this.duration>0?e.end(0)/this.duration:0}get seeking(){return!!this.media.seeking}get duration(){let e=Number.parseFloat(this.config.duration),t=(this.media||{}).duration,n=!I.number(t)||t===1/0?0:t;return e||n}set volume(e){let t=e;I.string(t)&&(t=Number(t)),I.number(t)||(t=this.storage.get(`volume`)),I.number(t)||({volume:t}=this.config),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!I.empty(e)&&this.muted&&t>0&&(this.muted=!1)}get volume(){return Number(this.media.volume)}set muted(e){let t=e;I.boolean(t)||(t=this.storage.get(`muted`)),I.boolean(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t}get muted(){return!!this.media.muted}get hasAudio(){return!this.isHTML5||this.isAudio?!0:!!this.media.mozHasAudio||!!this.media.webkitAudioDecodedByteCount||!!(this.media.audioTracks&&this.media.audioTracks.length)}set speed(e){let t=null;I.number(e)&&(t=e),I.number(t)||(t=this.storage.get(`speed`)),I.number(t)||(t=this.config.speed.selected);let{minimumSpeed:n,maximumSpeed:r}=this;t=an(t,n,r),this.config.speed.selected=t,setTimeout(()=>{this.media&&(this.media.playbackRate=t)},0)}get speed(){return Number(this.media.playbackRate)}get minimumSpeed(){return this.isYouTube?Math.min(...this.options.speed):this.isVimeo?.5:.0625}get maximumSpeed(){return this.isYouTube?Math.max(...this.options.speed):this.isVimeo?2:16}set quality(e){let t=this.config.quality,n=this.options.quality;if(!n.length)return;let r=[!I.empty(e)&&Number(e),this.storage.get(`quality`),t.selected,t.default].find(I.number),i=!0;if(!n.includes(r)){let e=Qe(n,r);this.debug.warn(`Unsupported quality option: ${r}, using ${e} instead`),r=e,i=!1}t.selected=r,this.media.quality=r,i&&this.storage.set({quality:r})}get quality(){return this.media.quality}set loop(e){let t=I.boolean(e)?e:this.config.loop.active;this.config.loop.active=t,this.media.loop=t}get loop(){return!!this.media.loop}set source(e){ln.change.call(this,e)}get source(){return this.media.currentSrc}get download(){let{download:e}=this.config.urls;return I.url(e)?e:this.source}set download(e){I.url(e)&&(this.config.urls.download=e,z.setDownloadUrl.call(this))}set poster(e){this.isVideo?Rt.setPoster.call(this,e,!1).catch(()=>{}):this.debug.warn(`Poster can only be set for video`)}get poster(){return this.isVideo?this.media.getAttribute(`poster`)||this.media.getAttribute(`data-poster`):null}get ratio(){if(!this.isVideo)return null;let e=nt(rt.call(this));return I.array(e)?e.join(`:`):e}set ratio(e){this.isVideo?!I.string(e)||!tt(e)?this.debug.error(`Invalid aspect ratio specified (${e})`):(this.config.ratio=nt(e),it.call(this)):this.debug.warn(`Aspect ratio can only be set for video`)}set autoplay(e){this.config.autoplay=I.boolean(e)?e:this.config.autoplay}get autoplay(){return!!this.config.autoplay}toggleCaptions(e){Ot.toggle.call(this,e,!1)}set currentTrack(e){Ot.set.call(this,e,!1),Ot.setup.call(this)}get currentTrack(){let{toggled:e,currentTrack:t}=this.captions;return e?t:-1}set language(e){Ot.setLanguage.call(this,e,!1)}get language(){return(Ot.getCurrentTrack.call(this)||{}).language}set pip(e){if(!Ve.pip)return;let t=I.boolean(e)?e:!this.pip;I.function(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?At.active:At.inactive),I.function(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}get pip(){return Ve.pip?I.empty(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===At.active:null}setPreviewThumbnails(e){this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),Object.assign(this.config.previewThumbnails,e),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new cn(this))}static supported(e,t){return Ve.check(e,t)}static loadSprite(e,t){return xt(e,t)}static setup(t,n={}){let r=null;return I.string(t)?r=Array.from(document.querySelectorAll(t)):I.nodeList(t)?r=Array.from(t):I.array(t)&&(r=t.filter(I.element)),I.empty(r)?null:r.map(t=>new e(t,n))}};un.defaults=xe(kt);var dn=new URL(`plyr-icons.svg`,import.meta.url).href,fn=class extends Error{constructor(e=`PLAYBACK_TOKEN_FAILED`){super(e===`PLAYBACK_TOKEN_TIMEOUT`?`Playback token acquisition timed out`:`Playback token acquisition failed`),this.name=`PlaybackTokenError`,this.code=e}};function pn({embedUuid:e,tokenEndpoint:t,getPlaybackToken:n,tokenHeaders:r}={},{fetchImpl:i=globalThis.fetch,origin:a=globalThis.location?.origin,timeoutMs:o=15e3}={}){let s=t!==void 0,c=n!==void 0,l=()=>new fn;if(s&&c||c&&typeof n!=`function`)throw l();let u,d;if(s)try{if(typeof t!=`string`||!t.trim()||(u=new URL(t,a),![`https:`,`http:`].includes(u.protocol)||u.origin!==new URL(a).origin||u.username||u.password||t.includes(`#`))||(d=new Headers(r),d.has(`Authorization`)))throw l();d.set(`Content-Type`,`application/json`)}catch{throw l()}else if(r!==void 0)try{if(new Headers(r).has(`Authorization`))throw l()}catch{throw l()}let f=!1,p=/* @__PURE__ */ new Set;return{getPlaybackToken:s||c?()=>f?Promise.reject(l()):new Promise((t,r)=>{let a=new AbortController,s=!1,f,m=(e,n)=>{s||(s=!0,clearTimeout(f),p.delete(h),e?r(e):t(n))},h=(e=l())=>{m(e),a.abort()};p.add(h),f=setTimeout(()=>h(new fn(`PLAYBACK_TOKEN_TIMEOUT`)),o),(async()=>{if(c)return n();let t=await i(u.href,{method:`POST`,credentials:`same-origin`,redirect:`error`,cache:`no-store`,headers:d,body:JSON.stringify({embedUuid:e}),signal:a.signal});if(!t.ok||!/^application\/(?:[\w.-]+\+)?json(?:\s*;|$)/i.test(t.headers.get(`Content-Type`)||``))throw l();return(await t.json())?.token})().then(e=>{typeof e!=`string`||!e.trim()?m(l()):m(void 0,e)},()=>m(l()))}):void 0,dispose(){f=!0;for(let e of p)e()}}}function mn(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=t+`=`.repeat((4-t.length%4)%4);if(typeof Buffer<`u`)return Buffer.from(n,`base64`).toString(`utf8`);let r=Uint8Array.from(atob(n),e=>e.charCodeAt(0));return new TextDecoder().decode(r)}function hn(e){let t=e.split(`.`)[1];if(!t)throw Error(`Invalid JWT: missing payload`);return JSON.parse(mn(t))}function gn(e,{skewMs:t=12e4,now:n=Date.now()}={}){let{exp:r}=hn(e);if(typeof r!=`number`)throw Error(`Invalid JWT: missing exp`);let i=r*1e3-t;return Math.max(0,i-n)}function _n(e,t,n){e.headers.Authorization=`Bearer ${t}`;let r=new URL(n).origin;e.uris=e.uris.map(e=>{let n=new URL(e);return n.origin===r?(n.searchParams.set(`access_token`,t),n.toString()):e})}function vn(e){let t=Number(e.duration);return Number.isFinite(t)&&t>=0?t:null}function yn(e){let t=Number(e.currentTime);return Number.isFinite(t)&&t>=0?t:0}function bn(e,{beforeSeek:t=()=>{}}={}){return{mediaElement:e,play:async()=>{await e.play()},pause:()=>{e.pause()},seek:n=>{if(!Number.isFinite(n)||n<0)throw TypeError(`Seek time must be a nonnegative finite number`);let r=vn(e),i=r==null?n:Math.min(n,r),a=Number(e.currentTime);t(Number.isFinite(a)&&a>=0?a:void 0),e.currentTime=i},setMuted:t=>{if(typeof t!=`boolean`)throw TypeError(`Muted must be a boolean`);e.muted=t},getState:()=>({currentTime:yn(e),duration:vn(e),paused:!!e.paused,ended:!!e.ended,muted:!!e.muted})}}function xn(e){let t=Number(e);if(!(!Number.isFinite(t)||t<0))return Math.round(t*1e3)}function Sn(e){let t=Number(e);return Number.isFinite(t)&&t>0?t:void 0}function Cn(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>t!==void 0))}function wn({video:e,stats:t,now:n=()=>globalThis.performance?.now?.()??Date.now(),setIntervalFn:r=globalThis.setInterval.bind(globalThis),clearIntervalFn:i=globalThis.clearInterval.bind(globalThis),page:a=globalThis,heartbeatIntervalMs:o=1e4}){let s=[],c,l=!1,u=!1,d,f,p,m=0,h=0,g=!1,_,v=xn(e.currentTime),y,b,x=(e,t,n)=>{e.addEventListener?.(t,n),s.push([e,t,n])},S=()=>Cn({playheadMs:xn(e.currentTime),durationMs:xn(e.duration)}),C=()=>{if(f===void 0)return;let e=n();m+=Math.max(0,e-f),f=e},w=()=>{let e=m;return m=0,e},T=()=>{p!==void 0&&(h+=Math.max(0,n()-p),p=void 0)},E=()=>{let e=h;return h=0,e},D=()=>xn(e.currentTime)??v,O=t=>{let n=Sn(e.playbackRate),r={watchMs:w(),bufferMs:E(),durationMs:xn(e.duration)};return _!==void 0&&t!==void 0&&n!==void 0&&Object.assign(r,{fromPlayheadMs:_,toPlayheadMs:t,playheadMs:t,playbackRate:n}),Cn(r)},k=()=>{c!==void 0&&(i(c),c=void 0)},A=(e,t=D(),{reopen:n=!0}={})=>{C(),e(O(t)),g=n,_=n?t:void 0},j=()=>{c===void 0&&(c=r(()=>A(t.trackHeartbeat),o))},M=()=>{l||(d=n())},ee=()=>{T();let r=xn(e.currentTime);r!==void 0&&(v=r),_??(_=r),g=!0,f=n(),l||(l=!0,t.trackStart(Cn({watchMs:0,bufferMs:0,startupMs:d===void 0?void 0:Math.max(0,n()-d),playheadMs:r,durationMs:xn(e.duration)}))),j()},te=()=>{if(e.seeking)return;let t=xn(e.currentTime);t!==void 0&&(v=t)},N=()=>{k(),!e.ended&&(T(),l&&g&&A(t.trackPause,D(),{reopen:!1}),f=void 0)},ne=()=>{k(),T(),l&&g&&A(t.trackEnd,D(),{reopen:!1}),f=void 0},re=()=>{u||(u=!0,k(),T(),l&&g?A(t.trackLeave,D(),{reopen:!1}):l&&(C(),t.trackLeave(O(D()))),f=void 0)};return x(e,`play`,M),x(e,`playing`,ee),x(e,`timeupdate`,te),x(e,`pause`,N),x(e,`waiting`,()=>{(d!==void 0||l)&&(k(),C(),f=void 0,p===void 0&&(p=n()))}),x(e,`seeking`,()=>{let e=y??v;y=void 0,k(),C(),f=void 0,l&&g&&A(t.trackHeartbeat,e,{reopen:!1}),b=e}),x(e,`seeked`,()=>{let r=xn(e.currentTime),i={watchMs:w(),bufferMs:E(),durationMs:xn(e.duration)};b!==void 0&&r!==void 0&&Object.assign(i,{fromPlayheadMs:b,toPlayheadMs:r,playheadMs:r}),l&&t.trackSeek(Cn(i)),b=void 0,r!==void 0&&(v=r),l&&!e.paused&&!e.ended&&p===void 0&&(_=r,g=!0,f=n(),j())}),x(e,`ended`,ne),x(a,`pagehide`,re),Object.freeze({beforeProgrammaticSeek:e=>{y=xn(e)},snapshot:S,dispose:()=>{re();for(let[e,t,n]of s.splice(0))e.removeEventListener?.(t,n)}})}var Tn={en:{restart:`Restart`,rewind:`Rewind {seektime}s`,play:`Play`,pause:`Pause`,fastForward:`Forward {seektime}s`,seek:`Seek`,seekLabel:`{currentTime} of {duration}`,played:`Played`,buffered:`Buffered`,currentTime:`Current time`,duration:`Duration`,volume:`Volume`,mute:`Mute`,unmute:`Unmute`,enableCaptions:`Enable captions`,disableCaptions:`Disable captions`,download:`Download`,enterFullscreen:`Enter fullscreen`,exitFullscreen:`Exit fullscreen`,frameTitle:`Player for {title}`,captions:`Captions`,settings:`Settings`,pip:`PIP`,menuBack:`Go back to previous menu`,speed:`Speed`,normal:`Normal`,quality:`Quality`,loop:`Loop`,start:`Start`,end:`End`,all:`All`,reset:`Reset`,disabled:`Disabled`,enabled:`Enabled`,advertisement:`Ad`,qualityLabel:{0:`Auto`}},cs:{restart:`Spustit znovu`,rewind:`Přetočit o {seektime} s zpět`,play:`Přehrát`,pause:`Pozastavit`,fastForward:`Přetočit o {seektime} s vpřed`,seek:`Posun`,seekLabel:`{currentTime} z {duration}`,played:`Přehráno`,buffered:`Načteno`,currentTime:`Aktuální čas`,duration:`Délka`,volume:`Hlasitost`,mute:`Ztlumit`,unmute:`Zapnout zvuk`,enableCaptions:`Zapnout titulky`,disableCaptions:`Vypnout titulky`,download:`Stáhnout`,enterFullscreen:`Přejít na celou obrazovku`,exitFullscreen:`Ukončit režim celé obrazovky`,frameTitle:`Přehrávač pro {title}`,captions:`Titulky`,settings:`Nastavení`,pip:`Obraz v obraze`,menuBack:`Zpět do předchozí nabídky`,speed:`Rychlost`,normal:`Normální`,quality:`Kvalita`,loop:`Opakování`,start:`Začátek`,end:`Konec`,all:`Vše`,reset:`Obnovit`,disabled:`Vypnuto`,enabled:`Zapnuto`,advertisement:`Reklama`,qualityLabel:{0:`Automaticky`}}};function En(e){if(typeof e!=`string`)return`en`;let t=e.trim().toLowerCase().split(`-`)[0];return Object.hasOwn(Tn,t)?t:`en`}function B(e){let t=Tn[En(e)];return{...t,qualityLabel:{...t.qualityLabel}}}var Dn=[`play-large`,`play`,`progress`,`current-time`,`mute`,`volume`,`captions`,`settings`,`pip`,`airplay`,`fullscreen`],On=[`quality`,`speed`],kn=new Set(Dn),An=new Set(On),jn=/* @__PURE__ */ new Set([`top-left`,`top-right`,`bottom-left`,`bottom-right`]),Mn=/* @__PURE__ */ new Set([`dark`,`light`,`accent`]),Nn={captions:{active:!0,update:!0,language:`auto`},fullscreen:{enabled:!0},keyboard:{focused:!0,global:!1},controls:Dn};function Pn(e=!0,t){if(!e)return[];if(!Array.isArray(t))return[...Dn];let n=new Set(t.filter(e=>kn.has(e)));return Dn.filter(e=>n.has(e))}function Fn(e){if(!Array.isArray(e))return[`quality`];let t=new Set(e.filter(e=>An.has(e)));return On.filter(e=>t.has(e))}function In(e){if(typeof e!=`string`)return null;let t=e.trim().toLowerCase();return/^#[0-9a-f]{6}$/.test(t)?t:null}function Ln(e){let[t,n,r]=[1,3,5].map(t=>Number.parseInt(e.slice(t,t+2),16)/255).map(e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4),i=.2126*t+.7152*n+.0722*r,a=1.05/(i+.05);return(i+.05)/.05>a?`#000`:`#fff`}function Rn(e){if(!e||typeof e.text!=`string`)return null;let t=Array.from(e.text.trim()).slice(0,64).join(``);return t?{text:t,position:jn.has(e.position)?e.position:`top-right`,style:Mn.has(e.style)?e.style:`dark`}:null}function zn(e,{accentColor:t,badge:n,hasControls:r=!0}={}){let i=e?.elements?.container;if(!i)return()=>{};let a=In(t),o=Rn(n),s=null;return a&&(i.style.setProperty(`--plyr-color-main`,a),i.style.setProperty(`--vyonio-badge-accent-foreground`,Ln(a))),i.classList.toggle(`vyonio-player--has-controls`,r),o&&(s=(i.ownerDocument??globalThis.document)?.createElement?.(`div`)??null,s&&(s.className=[`vyonio-player__badge`,`vyonio-player__badge--${o.position}`,`vyonio-player__badge--${o.style}`].join(` `),s.setAttribute(`role`,`note`),s.textContent=o.text,i.appendChild(s))),()=>{s?.remove(),i.classList.remove(`vyonio-player--has-controls`),a&&(i.style.removeProperty(`--plyr-color-main`),i.style.removeProperty(`--vyonio-badge-accent-foreground`))}}function Bn(e,t){let n=Math.abs(e),r=Math.abs(t);for(;r;){let e=n%r;n=r,r=e}return n||1}function Vn(e){let t=Number(e?.videoWidth),n=Number(e?.videoHeight);if(!Number.isFinite(t)||!Number.isFinite(n)||t<=0||n<=0)return`16:9`;let r=Bn(t,n);return`${t/r}:${n/r}`}async function Hn(e,t,n=async()=>{},r=null){let i,a=async e=>{try{await e()}catch(e){i||(i=e)}};if(await a(n),await a(t),await a(()=>{r?r.parentNode&&r.remove():e.querySelectorAll(`video`).forEach(e=>e.remove())}),i)throw i}function Un(e,{PlyrCtor:t,quality:n,controls:r=!0,controlItems:i,settingsItems:a,language:o,accentColor:s,badge:c,iconUrl:l}={}){let u=Pn(r,i),d=Fn(a),f=u.length>0;if(!t)return e.controls=f,{player:null,destroy:()=>{}};try{e.controls=!1;let r={...Nn,controls:u,settings:d,i18n:B(o),ratio:Vn(e),blankVideo:``};l&&(r.iconUrl=l,r.loadSprite=!1),n?.options?.length>=3&&(r.quality={default:n.default,options:n.options,forced:!0,onChange:null},r.i18n={...r.i18n,qualityLabel:{...r.i18n.qualityLabel,...n.labels}});let i=new t(e,r),a=zn(i,{accentColor:s,badge:c,hasControls:f});return{player:i,destroy:()=>{a(),i.destroy()}}}catch{return e.controls=f,{player:null,destroy:()=>{}}}}var Wn=0;function Gn(e=[],t=`Auto`){let n=/* @__PURE__ */ new Map;for(let t of e){let e=Number(t?.height);if(!Number.isFinite(e)||e<=0)continue;let r=n.get(e);(!r||Number(t.bandwidth||0)>Number(r.bandwidth||0))&&n.set(e,t)}let r=[...n.entries()].sort(([e],[t])=>t-e).map(([e,t])=>({label:`${e}p`,value:e,track:t}));return[{label:t,value:`auto`},...r]}function Kn(e){let t={};return{default:Wn,options:e.map(({label:e,value:n})=>{let r=n===`auto`?Wn:n;return t[r]=e,r}),labels:t}}function qn(e){e?.config?.quality&&(e.config.quality.forced=!1,e.config.quality.options=[],e.config.quality.onChange=null),e?.options&&(e.options.quality=[]);let t=e?.elements?.settings?.buttons?.quality,n=e?.elements?.settings?.panels?.quality,r=n?.querySelector?.(`[role="menu"]`);r&&r.replaceChildren(),t&&(t.hidden=!0),n&&(n.hidden=!0);let i=e?.elements?.settings?.menu,a=e?.elements?.settings?.buttons;i&&a&&(i.hidden=!Object.values(a).some(e=>e&&!e.hidden))}function Jn(e,{default:t,options:n,labels:r}){if(!e||!Array.isArray(n)||n.length<2)return!1;e.config.quality={...e.config.quality||{},default:t,options:[...n],forced:!0,onChange:e.config.quality?.onChange??null},e.config.i18n={...e.config.i18n||{},qualityLabel:r},e.options.quality=[...n];let i=e.elements?.settings?.buttons?.quality,a=e.elements?.settings?.panels?.quality,o=e.elements?.settings?.panels?.home,s=a?.querySelector?.(`[role="menu"]`);if(!i||!a||!s)return!1;i.hidden=!1,o&&(o.hidden=!1),a.hidden=!0,e.elements?.settings?.menu&&(e.elements.settings.menu.hidden=!1),s.replaceChildren();for(let i of n){let n=r?.[i]??(i===Wn?`Auto`:`${i}p`),a=document.createElement(`button`);a.type=`button`,a.setAttribute(`role`,`menuitemradio`),a.setAttribute(`data-plyr`,`quality`),a.setAttribute(`aria-checked`,i===t?`true`:`false`),a.value=String(i),a.className=e.config.classNames?.control||`plyr__control`;let o=document.createElement(`span`);o.textContent=n,a.appendChild(o),a.addEventListener(`click`,t=>{t.preventDefault(),t.stopPropagation(),s.querySelectorAll(`[role="menuitemradio"]`).forEach(e=>{e.setAttribute(`aria-checked`,`false`)}),a.setAttribute(`aria-checked`,`true`),e.quality=i}),s.appendChild(a)}let c=e.config.classNames?.menu?.value||`plyr__menu__value`,l=i.querySelector(`.${c}`),u=r?.[t]??(t===Wn?`Auto`:`${t}p`);return l&&(l.textContent=u),e.config.quality.selected=t,!0}function Yn(e,t){let n=()=>e.configure({abr:{enabled:!0}});try{n();let r=t?.config?.i18n?.qualityLabel?.[Wn]??`Auto`,i=Gn(e.getVariantTracks(),r);if(!t||i.length<3)return qn(t),()=>{};let a=Kn(i),o=new Map(i.filter(({value:e})=>e!==`auto`).map(({value:e,track:t})=>[Number(e),t])),s=r=>{try{let t=Number(r);if(r===`auto`||t===Wn){n();return}let i=o.get(t);if(!i)throw Error(`Unknown quality option: ${r}`);e.configure({abr:{enabled:!1}}),e.selectVariantTrack(i,!0)}catch{n(),qn(t)}};t.config.quality={...t.config.quality||{},onChange:s},Jn(t,a),t.config.quality.onChange=s;try{t.quality=a.default}catch{}return()=>{t?.config?.quality&&(t.config.quality.onChange=null)}}catch{try{n()}catch{}return qn(t),()=>{}}}var Xn=`vyonio-player__popularity-histogram`,Zn=`http://www.w3.org/2000/svg`;function Qn(e){return!Array.isArray(e)||e.length===0?[]:e.map(e=>{let t=Number(e);return!Number.isFinite(t)||t<0?0:t})}function $n(e,t,n){let r=Math.max(...e,0);if(r<=0||t<=0||n<=0)return null;let i=t/e.length,a=e.map((e,t)=>({x:(t+.5)*i,y:n-e/r*n*.92}));return[{x:0,y:a[0].y},...a,{x:t,y:a[a.length-1].y}]}function er(e){if(!e||e.length===0)return``;if(e.length===1){let t=e[0];return`M${t.x.toFixed(2)},${t.y.toFixed(2)}`}if(e.length===2){let[t,n]=e;return`M${t.x.toFixed(2)},${t.y.toFixed(2)} L${n.x.toFixed(2)},${n.y.toFixed(2)}`}let t=e=>`${e.x.toFixed(2)},${e.y.toFixed(2)}`,n=`M${t(e[0])}`;for(let r=0;r<e.length-1;r+=1){let i=e[r===0?r:r-1],a=e[r],o=e[r+1],s=e[r+2]??o,c=a.x+(o.x-i.x)/6,l=a.y+(o.y-i.y)/6,u=o.x-(s.x-a.x)/6,d=o.y-(s.y-a.y)/6;n+=` C${c.toFixed(2)},${l.toFixed(2)} ${u.toFixed(2)},${d.toFixed(2)} ${t(o)}`}return n}function tr(e,t,n){let r=$n(e,t,n);if(!r)return``;let i=er(r);return i?`${i} L${t},${n} L0,${n} Z`:``}function nr(e,t,n){return er($n(e,t,n))}function rr(e){let t=e.querySelector?.(`.${Xn}`);return t||(t=document.createElement(`div`),t.className=Xn,t.setAttribute(`aria-hidden`,`true`),t.style.pointerEvents=`none`,e.appendChild(t),t)}function ir(e,t){let n=tr(t,100,100),r=nr(t,100,100);if(!n||!r){e.replaceChildren?.(),`innerHTML`in e&&(e.innerHTML=``);return}let i=document.createElementNS(Zn,`svg`);i.setAttribute(`viewBox`,`0 0 100 100`),i.setAttribute(`preserveAspectRatio`,`none`),i.setAttribute(`aria-hidden`,`true`),i.setAttribute(`class`,`${Xn}-svg`);let a=`${Xn}-grad-${Math.random().toString(36).slice(2,10)}`,o=document.createElementNS(Zn,`defs`),s=document.createElementNS(Zn,`linearGradient`);s.setAttribute(`id`,a),s.setAttribute(`x1`,`0`),s.setAttribute(`y1`,`0`),s.setAttribute(`x2`,`0`),s.setAttribute(`y2`,`1`);let c=document.createElementNS(Zn,`stop`);c.setAttribute(`offset`,`0%`),c.setAttribute(`stop-color`,`#ffffff`),c.setAttribute(`stop-opacity`,`0.45`);let l=document.createElementNS(Zn,`stop`);l.setAttribute(`offset`,`100%`),l.setAttribute(`stop-color`,`#ffffff`),l.setAttribute(`stop-opacity`,`0`),s.appendChild(c),s.appendChild(l),o.appendChild(s),i.appendChild(o);let u=document.createElementNS(Zn,`path`);u.setAttribute(`d`,n),u.setAttribute(`class`,`${Xn}-area`),u.setAttribute(`fill`,`url(#${a})`),i.appendChild(u);let d=document.createElementNS(Zn,`path`);d.setAttribute(`d`,r),d.setAttribute(`class`,`${Xn}-line`),d.setAttribute(`fill`,`none`),i.appendChild(d),typeof e.replaceChildren==`function`?e.replaceChildren(i):(`innerHTML`in e&&(e.innerHTML=``),e.appendChild(i))}function ar(e,t={}){let n=Qn(t.buckets),r=!1,i=null,a=null,o=()=>{!r&&e?.elements?.progress&&(n.length===0||n.every(e=>e<=0)?(i?.remove?.(),i=null):(i=rr(e.elements.progress),ir(i,n)))},s=()=>{!r&&e&&(e.ready?o():typeof e.on==`function`?a||(a=()=>{typeof e.off==`function`&&e.off(`ready`,a),a=null,o()},e.on(`ready`,a)):o())};return s(),{update(e){r||(n=Qn(e),s())},dispose(){r||(r=!0,a&&typeof e?.off==`function`&&e.off(`ready`,a),a=null,i?.remove?.(),i=null)}}}function or(){try{let e=globalThis.crypto?.randomUUID?.();if(e)return e}catch{}return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.floor(Math.random()*16);return(e===`x`?t:t&3|8).toString(16)})}function sr(){return{setPlaybackProtocol(){},trackStart(){},trackHeartbeat(){},trackPause(){},trackSeek(){},trackEnd(){},trackLeave(){},trackError(){},async dispose(){}}}function cr(e){let t=Number(e);return Number.isFinite(t)?Math.max(0,Math.round(t)):0}function lr(e){if(e==null)return;let t=Number(e);return Number.isFinite(t)&&t>=0?Math.round(t):void 0}function ur(e){if(e==null)return;let t=Number(e);return Number.isFinite(t)&&t>0?t:void 0}function dr({telemetry:e,fetchImpl:t=globalThis.fetch?.bind(globalThis),flushIntervalMs:n=1e4,sessionId:r=or(),uuid:i=or,now:a=()=>Date.now(),platform:o=`web`,playbackProtocol:s=`unknown`,maxQueueSize:c=50}={}){if(!e?.url||!e?.context)return sr();let l=String(e.url),u=String(e.context),d=String(r??or()),f=[],p=/* @__PURE__ */ new Set,m=s,h=0,g=!1,_=e=>{g||(f.unshift(...e),f.length>c&&f.splice(0,f.length-c))},v=async(e,{beacon:n=!1}={})=>{try{let r=JSON.stringify({context:u,events:e});if(n&&globalThis.navigator?.sendBeacon&&globalThis.navigator.sendBeacon(l,r)||!t)return;let i=await t(l,{method:`POST`,headers:{"Content-Type":`application/json`},body:r,keepalive:n}),a=Number(i?.status??0);i?.ok===!1&&(a===0||a>=500)&&_(e)}catch{_(e)}},y=({beacon:e=!1}={})=>{if(f.length===0)return Promise.resolve();let t=f.splice(0,f.length),n=v(t,{beacon:e});return p.add(n),n.finally(()=>p.delete(n)),n},b=(e,t={})=>{if(!g)try{let n={event_id:String(i()),event_at:new Date(a()).toISOString(),event_type:e,session_id:d,sequence:h++,watch_ms:cr(t.watchMs),startup_ms:t.startupMs==null?null:cr(t.startupMs),buffer_ms:t.bufferMs==null?null:cr(t.bufferMs),platform:o,playback_protocol:m,error_code:t.errorCode==null?null:String(t.errorCode).slice(0,128),error_fatal:t.errorFatal==null?null:!!t.errorFatal},r={playhead_ms:lr(t.playheadMs),from_playhead_ms:lr(t.fromPlayheadMs),to_playhead_ms:lr(t.toPlayheadMs),duration_ms:lr(t.durationMs),playback_rate:ur(t.playbackRate)};for(let[e,t]of Object.entries(r))t!==void 0&&(n[e]=t);f.push(n),f.length>c&&f.shift()}catch{}},x=setInterval(()=>{y()},n);return{setPlaybackProtocol(e){m=[`dash`,`hls`].includes(e)?e:`unknown`},trackStart(e){b(`start`,e)},trackHeartbeat(e){b(`heartbeat`,e)},trackPause(e){b(`pause`,e)},trackSeek(e){b(`seek`,e)},trackEnd(e){b(`end`,e)},trackLeave(e){b(`leave`,e),y({beacon:!0})},trackError(e,t=!0,n={}){b(`error`,{...n,errorCode:e,errorFatal:t}),y()},async dispose(){g||(clearInterval(x),await y(),g=!0,await Promise.allSettled([...p]))}}}function fr(e){let t=Math.max(0,Math.round(Number(e)*1e3)),n=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4),i=Math.floor(t%6e4/1e3),a=t%1e3;return[String(n).padStart(2,`0`),String(r).padStart(2,`0`),`${String(i).padStart(2,`0`)}.${String(a).padStart(3,`0`)}`].join(`:`)}function pr(e=[],t){let n=e.map(e=>({title:String(e?.title||``).replaceAll(`-->`,`→`).trim(),start:Number(e?.start_seconds)})).filter(({title:e,start:t})=>e&&Number.isFinite(t)&&t>=0).sort((e,t)=>e.start-t.start),r=[`WEBVTT`,``];return n.forEach((e,i)=>{let a=n[i+1]?.start??Number(t),o=Number.isFinite(a)&&a>e.start?a:e.start+.001;r.push(`${fr(e.start)} --> ${fr(o)}`,e.title,``)}),r.join(`
|
|
38
|
+
`)}function mr(e,t){if(!t)return e;let n=new URL(e);return n.searchParams.set(`access_token`,t),n.toString()}function hr(e=[],t){let n=Number(t);if(!Number.isFinite(n)||n<=0)return[];let r=e.map(e=>({title:String(e?.title||``).trim(),start:Number(e?.start_seconds)})).filter(({title:e,start:t})=>e&&Number.isFinite(t)&&t>=0&&t<n).sort((e,t)=>e.start-t.start);return r.map((e,t)=>{let i=r[t+1]?.start??n;return{title:e.title,start:e.start,end:i,startPercent:e.start/n*100,endPercent:i/n*100}})}function gr(e=[],{gapPx:t=3}={}){if(!Array.isArray(e)||e.length===0)return``;let n=Math.max(0,Number(t)||0)/2,r=e.map(e=>Number(e.startPercent)).filter(e=>Number.isFinite(e)&&e>0&&e<100);if(r.length===0||n<=0)return`linear-gradient(to right, #000 0%, #000 100%)`;let i=[`#000 0%`];return r.forEach(e=>{i.push(`#000 calc(${e}% - ${n}px)`),i.push(`transparent calc(${e}% - ${n}px)`),i.push(`transparent calc(${e}% + ${n}px)`),i.push(`#000 calc(${e}% + ${n}px)`)}),i.push(`#000 100%`),`linear-gradient(to right, ${i.join(`, `)})`}function _r(e,t){let n=e.ownerDocument.createElement(`track`);return Object.entries(t).forEach(([e,t])=>{t!=null&&t!==!1&&n.setAttribute(e,t===!0?``:t)}),e.appendChild(n),n}var vr=`plyr__progress--chapters`,yr=`vyonio-player__seek-thumb-rail`,br=`vyonio-player__seek-thumb`,xr=`--vyonio-chapter-mask`;function Sr(e,t,n){let r=e.ownerDocument,i=null,a=null,o=null,s=()=>t?.elements?.container?.querySelector?.(`.plyr__progress`)||t?.elements?.progress||e.closest?.(`.plyr`)?.querySelector?.(`.plyr__progress`),c=e=>e?.querySelector?.(`input[type="range"]`)||e?.querySelector?.(`input[type=range]`),l=e=>{e&&(e.classList?.remove?.(vr),typeof e.className==`string`&&(e.className=e.className.split(/\s+/).filter(e=>e&&e!==vr).join(` `)),e.style?.removeProperty?.(xr),i?.remove?.(),i=null,a=null,o&&(o.removeEventListener?.(`input`,u),o.removeEventListener?.(`change`,u),o=null))},u=()=>{if(!a||!o)return;let e=o.style?.getPropertyValue?.(`--value`)?.trim();if(e){a.style.left=e;return}let t=Number(o.min||0),n=Number(o.max||100),r=Number(o.value);!Number.isFinite(r)||!Number.isFinite(n)||n===t?a.style.left=`0%`:a.style.left=`${(r-t)/(n-t)*100}%`},d=e=>{if(!r?.createElement)return;(!i||i.parentNode!==e)&&(i?.remove?.(),i=r.createElement(`div`),i.className=yr,i.setAttribute(`aria-hidden`,`true`),a=r.createElement(`div`),a.className=br,i.appendChild(a),e.appendChild(i));let t=c(e);t!==o&&(o?.removeEventListener?.(`input`,u),o?.removeEventListener?.(`change`,u),o=t||null,o?.addEventListener?.(`input`,u),o?.addEventListener?.(`change`,u)),u()},f=()=>{let e=s();e&&(e.classList?.contains?.(vr)||String(e.className||``).split(/\s+/).includes(vr))&&d(e)},p=()=>{let t=s();if(!t)return;let r=hr(n,e.duration);if(r.length===0){l(t);return}let i=gr(r);if(t.classList?.add)t.classList.add(vr);else{let e=String(t.className||``).split(/\s+/).filter(Boolean);e.includes(vr)||(t.className=[...e,vr].join(` `))}t.style?.setProperty?.(xr,i),d(t)};return e.addEventListener?.(`loadedmetadata`,p),e.addEventListener?.(`timeupdate`,f),t?.on?.(`ready`,p),t?.on?.(`timeupdate`,f),e.readyState>=1&&p(),()=>{e.removeEventListener?.(`loadedmetadata`,p),e.removeEventListener?.(`timeupdate`,f),t?.off?.(`ready`,p),t?.off?.(`timeupdate`,f),l(s())}}async function Cr(e,t,n,{token:r,URLImpl:i=globalThis.URL,fetchImpl:a=globalThis.fetch}={}){let o=[],s=[],c=Sr(e,t,n?.chapters||[]),l=!1,u=()=>{l||(l=!0,c(),o.forEach(e=>e.remove()),s.forEach(e=>i.revokeObjectURL(e)))};try{for(let t of n?.captions||[])if(t?.vtt_url)try{let n=await a(mr(t.vtt_url,r),{headers:r?{Authorization:`Bearer ${r}`}:{}});if(!n.ok)continue;let c=i.createObjectURL(await n.blob());s.push(c),o.push(_r(e,{kind:t.kind||`subtitles`,label:t.label||t.language,srclang:t.language,src:c,default:t.default===!0}))}catch{}if(n?.chapters?.length&&i?.createObjectURL){let t=pr(n.chapters,e.duration),r=i.createObjectURL(new Blob([t],{type:`text/vtt`}));s.push(r),o.push(_r(e,{kind:`chapters`,label:`Chapters`,src:r,default:!0}))}}catch(e){throw u(),e}return u}function wr(e){return/^((?!chrome|android).)*safari/i.test(e)}function Tr(e,t){return wr(t)&&e.hls_manifest_url?{manifestUrl:e.hls_manifest_url,playbackProtocol:`hls`,useFairPlay:!!e.drm?.fairplay,useWidevine:!1}:{manifestUrl:e.dash_manifest_url,playbackProtocol:`dash`,useFairPlay:!1,useWidevine:e.drm?.widevine!==!1}}function Er(e,{useFairPlay:t,useWidevine:n}){let r={};return t&&e.fairplay_license_url&&(r[`com.apple.fps`]=e.fairplay_license_url),n&&e.widevine_license_url&&(r[`com.widevine.alpha`]=e.widevine_license_url),Object.keys(r).length===0?null:{drm:{servers:r}}}function Dr(e,t){let n=Tr(e,t);return{manifestUrl:n.manifestUrl,playbackProtocol:n.playbackProtocol,drmConfig:Er(e,n)}}var Or=`vyonio.playback.bandwidth`,kr=5e7,Ar=2e3,jr=null;function Mr(){let e;try{e=globalThis.localStorage}catch{e=void 0}return{connection:globalThis.navigator?.connection,storage:e}}function Nr({connection:e,storage:t}={}){return jr??Ir(e)??Lr(t)??55e5}function Pr(e,{storage:t}={}){let n=Rr(e);if(n==null)return!1;jr=n;try{t?.setItem(Or,String(n))}catch{}return!0}function Fr(e,{connection:t,storage:n,schedule:r=e=>setInterval(e,Ar),cancel:i=clearInterval}={}){let a=Nr({connection:t,storage:n});e.configure({abr:{defaultBandwidthEstimate:a,preferNetworkInformationBandwidth:!1}});let o=()=>{try{let t=Rr(e.getStats()?.estimatedBandwidth);if(t==null||t===Rr(a))return;Pr(t,{storage:n})}catch{}};e.addEventListener(`adaptation`,o);let s=r(o),c=!1;return{estimate:a,dispose(){if(!c){c=!0,o();try{i(s)}catch{}try{e.removeEventListener(`adaptation`,o)}catch{}}}}}function Ir(e){let t=Number(e?.downlink);return!Number.isFinite(t)||t<=0?null:Rr(t*1e6)}function Lr(e){try{return Rr(e?.getItem?.(Or))}catch{return null}}function Rr(e){let t=Number(e);return!Number.isFinite(t)||t<=0?null:Math.min(Math.round(t),kr)}function zr(e,t){let n=t??e?.code;if(n===`PLAYBACK_TOKEN_FAILED`||n===`PLAYBACK_TOKEN_TIMEOUT`)return new fn(n);let r=(typeof n==`number`||typeof n==`string`)&&/^\d{1,6}$/.test(String(n)),i=n===`PLAYBACK_AUTH_REFRESH_FAILED`?n:r?String(n):`PLAYBACK_ERROR`;return Object.assign(/* @__PURE__ */ Error(i===`PLAYBACK_AUTH_REFRESH_FAILED`?`Playback authorization refresh failed. Please sign in and check your access.`:`Protected playback failed${r?` (${i})`:``}. Please try again.`),{code:i})}async function Br(e,{apiBase:t=`https://api.vyonio.com`,embedUuid:n,getPlaybackToken:r,tokenEndpoint:i,tokenHeaders:a,onError:o,autoplay:s=!1,muted:l=!1,loop:u=!1,controls:d=!0,controlItems:f,settingsItems:p,language:m=`en`,accentColor:h,badge:g,startSeconds:_=0,popularityHistogram:v}){let y=pn({embedUuid:n,tokenEndpoint:i,getPlaybackToken:r,tokenHeaders:a}),b=y.getPlaybackToken;try{c.default.polyfill.installAll();let r=b?await b():null,i=r?{Authorization:`Bearer ${r}`}:{},a=await fetch(`${t}/v1/embed/${n}`,{headers:i});if(!a.ok)throw Error(`Video API ${a.status}`);let x=await a.json();if(x.status!==`ready`)throw Error(`Video not ready: ${x.status}`);let S=dr({telemetry:x.telemetry}),C=document.createElement(`video`);C.controls=!!d&&(!Array.isArray(f)||f.length>0),C.autoplay=!1,C.muted=!!l,C.defaultMuted=!!l,C.loop=!!u,C.style.width=`100%`,C.style.height=`100%`,C.setAttribute(`data-testid`,`drm-video`),C.setAttribute(`playsinline`,``),e.classList.add(`vyonio-player-mount`),e.appendChild(C);let w,T,E,D=!1,O=()=>S.dispose(),k=()=>{},A=()=>{},j=()=>{},M=()=>{},ee=()=>{},te=()=>{E!==void 0&&(clearTimeout(E),E=void 0)},N=async()=>{if(D)return;D=!0,y.dispose(),te();let t,n=async e=>{try{await e()}catch(e){t||(t=e)}};if(await n(k),await n(O),await n(A),await n(j),await n(M),await n(()=>Hn(e,ee,()=>w?.destroy(),C)),t)throw t};try{let n=Un(C,{PlyrCtor:un,controls:!!d,controlItems:f,settingsItems:p,language:m,accentColor:h,badge:g,iconUrl:dn}),i=n.player;ee=n.destroy,w=new c.default.Player,await w.attach(C);let{manifestUrl:a,playbackProtocol:l,drmConfig:u}=Dr(x,navigator.userAgent);S.setPlaybackProtocol(l),u&&w.configure(u),k=Fr(w,Mr()).dispose;let y=a;if(r){let e=new URL(y);e.searchParams.set(`access_token`,r),y=e.toString()}let ne=(e,n)=>{e===c.default.net.NetworkingEngine.RequestType.LICENSE&&(n.headers[`Content-Type`]=`application/octet-stream`),r&&_n(n,r,t)};w.getNetworkingEngine().registerRequestFilter(ne);let re=()=>{let t=zr(void 0,`PLAYBACK_AUTH_REFRESH_FAILED`),n={code:t.code,message:t.message,error:t};e.dataset.state=`error`,C.dataset.state=`error`,S.trackError(n.code,!0,T?.snapshot()),e.dispatchEvent(new CustomEvent(`vyonio-player-error`,{detail:n})),o&&o(n)},P=()=>{if(D)return;let e=Math.max(5e3,gn(r));E=setTimeout(async()=>{try{let e=await b();if(D)return;if(r=e,M(),M=await Cr(C,i,x,{token:r}),D){M();return}P()}catch(e){if(D)return;te();try{re(e)}finally{await N()}}},e)},ie=t=>{let n=Array.isArray(t?.data)?t.data:void 0,r=t instanceof Error||typeof t?.message==`string`?t.message:`Playback error${t?.code==null?``:` (${t.code})`}`,i=b?zr(t):void 0,a=i?{code:i.code,message:i.message,error:i}:{code:t?.code==null?`PLAYBACK_ERROR`:String(t.code),message:r,data:n,error:t instanceof Error?t:Error(r)};e.dataset.state=`error`,C.dataset.state=`error`;let s=t?.severity==null||t.severity===c.default.util.Error.Severity.CRITICAL;S.trackError(a.code,s,T?.snapshot()),e.dispatchEvent(new CustomEvent(`vyonio-player-error`,{detail:a})),o&&o(a)};w.addEventListener(`error`,e=>{ie(e?.detail)});let ae=!1;try{let e=Number(_);Number.isFinite(e)&&e>0?await w.load(y,e):await w.load(y),ae=!0}catch(e){throw ie(e),e}finally{ae||(te(),ne&&w.getNetworkingEngine().unregisterRequestFilter(ne))}try{A=Yn(w,i)}catch{w.configure({abr:{enabled:!0}}),A=()=>{}}let oe=v?.buckets??x.popularity_histogram?.buckets??x.popularity_histogram;try{let e=ar(i,{buckets:oe});j=()=>e.dispose()}catch{j=()=>{}}M=await Cr(C,i,x,{token:r}),T=wn({video:C,stats:S});let se=bn(C,{beforeSeek:T.beforeProgrammaticSeek});return O=async()=>{T.dispose(),await S.dispose()},b&&r&&P(),s&&(C.autoplay=!0,C.play().catch(()=>{})),{player:w,...se,destroy:async()=>{try{await N()}catch(e){throw b?zr(e):e}}}}catch(e){try{await N()}catch{}throw e}}catch(e){throw y.dispose(),b?zr(e):e}}var Vr={mount:Br};export{fn as PlaybackTokenError,Vr as VyonioPlayer,Br as mount};
|