1import{K as xo,L as e0,M as Ks,N as Yn,O as Jd,_ as t0,a as i0,u as s0,r as de,G as gs,w as fc,v as pc,c as mc,o as r0,g as Z,e as H,x as Pe,h as L,l as z,m as Q,F as Qe,p as Bt,A as Eo,q as le,k as ht,t as G,z as fe,s as Er,P as n0,E as gc,d as Je,f as W,y as Nn,S as _s,Q as Co,R as Mn,T as a0,b as o0,B as l0,C as _c,D as Bn}from"./index-DYNlRzuP.js";import{_ as u0,a as c0,L as d0,S as h0}from"./SearchDrawer-Cnmaqhpw.js";import{p as yc}from"./productApi-Bj-Ye7QD.js";import{M as f0}from"./vue3-puzzle-vcode.es-BOT1TPrg.js";import{l as p0,a as m0}from"./link_icon_02-DQpfWwg7.js";import{u as g0}from"./media-CMXgZWtP.js";function _0({swiper:i,extendParams:e,on:t,emit:s}){let r;i.autoplay={running:!1,paused:!1},e({autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!0,stopOnLastSlide:!1,reverseDirection:!1,pauseOnMouseEnter:!1}});function n(){if(!i.size){i.autoplay.running=!1,i.autoplay.paused=!1;return}const y=i.slides.eq(i.activeIndex);let w=i.params.autoplay.delay;y.attr("data-swiper-autoplay")&&(w=y.attr("data-swiper-autoplay")||i.params.autoplay.delay),clearTimeout(r),r=e0(()=>{let D;i.params.autoplay.reverseDirection?i.params.loop?(i.loopFix(),D=i.slidePrev(i.params.speed,!0,!0),s("autoplay")):i.isBeginning?i.params.autoplay.stopOnLastSlide?o():(D=i.slideTo(i.slides.length-1,i.params.speed,!0,!0),s("autoplay")):(D=i.slidePrev(i.params.speed,!0,!0),s("autoplay")):i.params.loop?(i.loopFix(),D=i.slideNext(i.params.speed,!0,!0),s("autoplay")):i.isEnd?i.params.autoplay.stopOnLastSlide?o():(D=i.slideTo(0,i.params.speed,!0,!0),s("autoplay")):(D=i.slideNext(i.params.speed,!0,!0),s("autoplay")),(i.params.cssMode&&i.autoplay.running||D===!1)&&n()},w)}function a(){return typeof r<"u"||i.autoplay.running?!1:(i.autoplay.running=!0,s("autoplayStart"),n(),!0)}function o(){return!i.autoplay.running||typeof r>"u"?!1:(r&&(clearTimeout(r),r=void 0),i.autoplay.running=!1,s("autoplayStop"),!0)}function u(y){i.autoplay.running&&(i.autoplay.paused||(r&&clearTimeout(r),i.autoplay.paused=!0,y===0||!i.params.autoplay.waitForTransition?(i.autoplay.paused=!1,n()):["transitionend","webkitTransitionEnd"].forEach(w=>{i.$wrapperEl[0].addEventListener(w,m)})))}function h(){const y=xo();y.visibilityState==="hidden"&&i.autoplay.running&&u(),y.visibilityState==="visible"&&i.autoplay.paused&&(n(),i.autoplay.paused=!1)}function m(y){!i||i.destroyed||!i.$wrapperEl||y.target===i.$wrapperEl[0]&&(["transitionend","webkitTransitionEnd"].forEach(w=>{i.$wrapperEl[0].removeEventListener(w,m)}),i.autoplay.paused=!1,i.autoplay.running?n():o())}function _(){i.params.autoplay.disableOnInteraction?o():(s("autoplayPause"),u()),["transitionend","webkitTransitionEnd"].forEach(y=>{i.$wrapperEl[0].removeEventListener(y,m)})}function T(){i.params.autoplay.disableOnInteraction||(i.autoplay.paused=!1,s("autoplayResume"),n())}function E(){i.params.autoplay.pauseOnMouseEnter&&(i.$el.on("mouseenter",_),i.$el.on("mouseleave",T))}function A(){i.$el.off("mouseenter",_),i.$el.off("mouseleave",T)}t("init",()=>{i.params.autoplay.enabled&&(a(),xo().addEventListener("visibilitychange",h),E())}),t("beforeTransitionStart",(y,w,D)=>{i.autoplay.running&&(D||!i.params.autoplay.disableOnInteraction?i.autoplay.pause(w):o())}),t("sliderFirstMove",()=>{i.autoplay.running&&(i.params.autoplay.disableOnInteraction?o():u())}),t("touchEnd",()=>{i.params.cssMode&&i.autoplay.paused&&!i.params.autoplay.disableOnInteraction&&n()}),t("destroy",()=>{A(),i.autoplay.running&&o(),xo().removeEventListener("visibilitychange",h)}),Object.assign(i.autoplay,{pause:u,run:n,start:a,stop:o})}const y0="/assets/banner_01-CBGOJ_md.jpg",v0="/assets/banner_02-RUR21Dzq.jpg",T0="/assets/banner_03-B9CtoFDZ.jpg",b0="/assets/banner_04-_n5PM3Sf.webp",S0="/assets/DescriptionCN-CBW8bTEU.png",x0="/assets/DescriptionEN-BKJAPp1k.png",E0="/assets/%E7%BB%86%E5%9B%BE-B5FxG5CT.png",Fn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAAXNSR0IArs4c6QAAB3RJREFUaEPdWt1rHNcVP+fOzMqR3NqypGRdBYzrQktp8tCmpZA6SVMCKaYQagzpg4vfHC27tov9XPQH2BBjsQmmYKgLNRiSkoemkDaWFEm2ajnClgxS9e2NrNVqVyNpv+fjnvqsZ9zVWh+zH5JcDxg/6O7M+d1zzu93zr0Hocrn2LFjL/j9/t1SyheFEN8FgJcBoEUI0QgADQCgISISkQEAaSmlDgALAPCNlHJSCBGLRqOp69evZ6sxBSv8MQYCgQZFUV5CxFeJ6BUhhJ+I6
1hBRJSIVEQUAKCXvt4lIIqJFRBYi5qWUUUQcIqJ7tm3Ph8PhNABQuXaVDeT48eMNjY2NBxHxdQD4ESJ+S0rJABQiIt58x5D1jOFvsofYUfy/LYTIE1ESAIaJqFfX9amrV68yIM+PZyDt7e3qwsJCq6IobyPia0S0BxF9bDwA8C6XvYtsJQMCAOGGHyIuE9GAbdtftrS0zLa3t1te0HgCcu7cuQbLsn4qpfw1ALQyADbe+eflO17XcDgKJ59mhRCfq6p6+/z585t6Z1MgZ8+ebbYs610iOoyInMBbAaAUqAtIR8SvVFX9x4ULF+Ib7caGQILB4HcURfmtE0r1AODJzV6338M6Jo2ME2qfdHR0PFzvN+sCYRBCiPcB4McOhdoePlzzJUTEzGcCwNdSymvrgVkTSCgUYh34HRH9bCdBuLtSBKafiK5dunSJdWjV8xSQQCCwW9O09wDgHSLahYg74ok1XMt5kweAL0zT/Fs4HE4Vr1kFhCl2cXHxMAC87yT2dufEZqHJYsuVwbV9+/Z9VUzNq4AEg8GDQogPEPEgC1Wl2rCZNZX+3RFRFt4pKeXHHR0dU+67ngDhkFJVlZP7LS4zvGoEC6Jtc+XxWKoVRSkodqXGevgd6wxHSqdlWdfcEHM/iKdPn34FANgbTWybhxeyKpMQAn0+n1pXV6fk83krnU6bLiAv76hkjVMOJQDg44sXLw5xgVAA4iT47x8l0utsm9eQsixLNjQ0+I4cOfKDQ4cO+ScnJ6NdXV0T8Xg8I6V8XExtgXcc57Mw95qm+Wf2SgFIKBQ69KjG+QMRcSnuOcFN07Sbm5sbgsHgWy0tLY2maZqzs7MLN2/enBgaGoouLy8biqKAEIIZp6aPlJLFMmZZ1ofhcHgcT5w4sWvv3r3vAsB7UsoXyqFbF0hbW9sbfr+/iS3lcMtms9mhoaGZGzdujC8sLKTy+bzcgtxx6fgzIcTfkcUPET8AgB+yIV7DitcykKampvqTJ08ebm1tbSnectu2rfn5ef3OnTsTt2/fnl1aWso5769JuDnhxRs3YhjGR3jq1CnuKdq4qyu3ltoIiAOKvZMfHR2N9PT0jM/MzCzncjkOXcEeqkGsMbvGhRAfsUd+g4is5LvLCavNPFLiHVvX9eTAwMD4rVu3Hui6nuU2ploycEoXVvjP8MyZM21E9HMAqPOqHa6RHjyyatPz+Xx+ampqrq+vb3x0dDSRTqe53S1oT4XecfOkn/Xjj0T0fadLK6vLKxcIGyullMlkMjM4ODjR3d09ubi4mK2Uqp3ukrvTUfbIh0TkL9cb5YTWWrttGIb58OHDWF9f38Tw8PD8ysoKU3UlRMBKH2WP/AkAvl1uolcLxKXqTCaTHR4enuns7Byfm5tLuaVOGaHGCb/ErPUXzg9E5OalrKeS0FrrA5ZlWZFIJH7lypW+RCKR0TSt9BhpI7u4Is48E0D4rCsajS5fvny5MxaLpSsCspOhxdvMuRKJRGI9PT1jd+/ejZqmWagCygiNx6G1U8nO7LWyspK5d+/eZGdn5wSzl6stZYDgpU+SfVvpl7/s6EmUvTA2NlaxnpTS77YJom3brPArAwMDEzVS+P8J4naUKFwUZ7PZ3MjIyGx3d/d/IpHISi6X41a6GlXngpHZ7XGJssVFIzC1zs/PL/b3948NDg7O6bqe5/akRj3KqqJxS8p4ptRkMpm7f//+NPcl8Xg8ZRgGVajeT+V/URk/ahhGuOrGivuRtra2N/fv319orBxKNR48eBDr7e0dGxkZiSeTSaPaMFqDyVY3VrwgEAh8T1XVM5W2uqFQ6JfNzc17mVKXlpZSXBD29vZOs0rbtg218kIxmKdaXQcIny5WdPiwZ8+eXUePHn31wIEDL0aj0URXV9f49PS0nslkqi3R15WTdQ8fuMOt5jiovr5e0zRNNU3TSqVShlv4bcUJCqNb9zjI9crzcEBXcONzcWTKQJ6bQ+yixH/mrhVYxRExR0T/tCzr0w2vFVyaeFYvehDx31LKv3q66HHBPBdXb8Vg/u8vQ10wfD1tmibfr/9iJ66nAaBH07TPq7qedsHwtYPP53ttJwYGDMMYKE3stSTfc2/sjnBomvYrIvpJrUY42CiHkQoTRDzCgYh3TNP8V81HOIp3gMc5DMPY0qEan8835WVso9guzx4pcaeXMSfu3koveKRzyfpkzOnRdV+UiLZ/zKk0Pt3BM0R8iYgOKoryMg+hAUBh8MwZwOHwKQyeAYDOw2a2bX+DiFOGYcQSiUSy2sGz/wJpBnhexKdQaAAAAABJRU5ErkJggg==",C0="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAATCAYAAACQjC21AAAAAXNSR0IArs4c6QAAAnZJREFUOE+tlEmozmEUxn/HnLAgC5lWCgtEipAoYS2RLRa6KUMSGYvMY2JhYUjGSJZSVnaGDTLckiHzcC3IvT73eJ9/5/16fXFZeOvf//u/33mf95znec4x/sNy907ACGCcZTx31+8u/4DfbmY/inM9gInp7BagrwXQQGAsMADweBqxdaH+uwfcNLM2d+8HzAdWAu3AHgFOBtYBQ9O71gGgymoDzgBHgP7ACmAB8AlYDlwV4C2gO7AGeAzUaWhIUfsq9SOgijYAM4G3keEVM6sJ8FUC3KZbzex7Rxy6e2cRD+wGJgAfUvwm4ISZfdNZAT6L7M6LVJVtZgr8Zbm7BJsG7ABGAV9T/EFgl5l9zsECbE7crAWeB3BLKNZsZiKayGxWgI2M0i/EufcCz7ECvJsy3QyMBpYBXYHrQcONODwD2A8MD9FuA4uAYcCgKFnCVCUrw1XAS+AAMD4OPQz1xfGhsJWE0fcSQGJeBF4Di81M4lSAKnUjcCrAxMuYUPtNuuwLMCQybwWOR6m9E5eXkm0eJXGWmplKrwOqZAWKsynAvqBA3qs3BXAfmBfvwcBp4Ik82AiYpa+FABlUamZQcSTvHTWzVndX1n8HLFSdCuwNi6jlriUnLDSzFxHzR0D5UBmelNOLppeJp4cgfYCmxO3lwkq55KdyR1myAFen8XMuBxegask5wKQkylYzkxOq5e5qv7OhepOZvcuiKGgncFgT5Dcd0i21Wq+URUt5obvLkzL3nchQPV6pLPNqDK1Po+gBoFLzgBB3Ul5P3teA6JnG2FxgdnhVg6GakQIUT9tjHMlzAisnTtV+xZ6+1dcarMfUDGUv/wSoLgO7H/R/QwAAAABJRU5ErkJggg==";var Lr;typeof window<"u"?Lr=window:typeof Yn<"u"?Lr=Yn:typeof self<"u"?Lr=self:Lr={};var Ea=Lr;const x=Ks(Ea),A0={},w0=Object.freeze(Object.defineProperty({__proto__:null,default:A0},Symbol.toStringTag,{value:"Module"})),D0=Jd(w0);var vc=typeof Yn<"u"?Yn:typeof window<"u"?window:{},I0=D0,Or;typeof document<"u"?Or=document:(Or=vc["__GLOBAL_DOCUMENT_CACHE@4"],Or||(Or=vc["__GLOBAL_DOCUMENT_CACHE@4"]=I0));var Zd=Or;const V=Ks(Zd);var xl={exports:{}};function Me(){return Me=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var s in t)({}).hasOwnProperty.call(t,s)&&(i[s]=t[s])}return i},Me.apply(null,arguments)}const k0=Object.freeze(Object.defineProperty({__proto__:null,get default(){return Me}},Symbol.toStringTag,{value:"Module"})),P0=Jd(k0);var L0=R0,O0=Object.prototype.toString;function R0(i){if(!i)return!1;var e=O0.call(i);return e==="[object Function]"||typeof i=="function"&&e!=="[object RegExp]"||typeof window<"u"&&(i===window.setTimeout||i===window.alert||i===window.confirm||i===window.prompt)}function N0(i,e){var t=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t)return(t=t.call(i)).next.bind(t);if(Array.isArray(i)||(t=M0(i))||e){t&&(i=t);var s=0;return function(){return s>=i.length?{done:!0}:{done:!1,value:i[s++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 2In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function M0(i,e){if(i){if(typeof i=="string")return Tc(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Tc(i,e)}}function Tc(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,s=new Array(e);t<e;t++)s[t]=i[t];return s}var B0=function(){function i(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var e=i.prototype;return e.getIsEnabled=function(){return this.enabled_},e.enable=function(){this.enabled_=!0},e.disable=function(){this.enabled_=!1},e.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},e.addInterceptor=function(s,r){this.typeToInterceptorsMap_.has(s)||this.typeToInterceptorsMap_.set(s,new Set);var n=this.typeToInterceptorsMap_.get(s);return n.has(r)?!1:(n.add(r),!0)},e.removeInterceptor=function(s,r){var n=this.typeToInterceptorsMap_.get(s);return n&&n.has(r)?(n.delete(r),!0):!1}
2,e.clearInterceptorsByType=function(s){var r=this.typeToInterceptorsMap_.get(s);return r?(this.typeToInterceptorsMap_.delete(s),this.typeToInterceptorsMap_.set(s,new Set),!0):!1},e.clear=function(){return this.typeToInterceptorsMap_.size?(this.typeToInterceptorsMap_=new Map,!0):!1},e.getForType=function(s){return this.typeToInterceptorsMap_.get(s)||new Set},e.execute=function(s,r){for(var n=this.getForType(s),a=N0(n),o;!(o=a()).done;){var u=o.value;try{r=u(r)}catch{}}return r},i}(),F0=B0,U0=function(){function i(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var e=i.prototype;return e.getIsEnabled=function(){return this.enabled_},e.enable=function(){this.enabled_=!0},e.disable=function(){this.enabled_=!1},e.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},e.getMaxAttempts=function(){return this.maxAttempts_},e.setMaxAttempts=function(s){this.maxAttempts_=s},e.getDelayFactor=function(){return this.delayFactor_},e.setDelayFactor=function(s){this.delayFactor_=s},e.getFuzzFactor=function(){return this.fuzzFactor_},e.setFuzzFactor=function(s){this.fuzzFactor_=s},e.getInitialDelay=function(){return this.initialDelay_},e.setInitialDelay=function(s){this.initialDelay_=s},e.createRetry=function(s){var r=s===void 0?{}:s,n=r.maxAttempts,a=r.delayFactor,o=r.fuzzFactor,u=r.initialDelay;return new $0({maxAttempts:n||this.maxAttempts_,delayFactor:a||this.delayFactor_,fuzzFactor:o||this.fuzzFactor_,initialDelay:u||this.initialDelay_})},i}(),$0=function(){function i(t){this.maxAttempts_=t.maxAttempts,this.delayFactor_=t.delayFactor,this.fuzzFactor_=t.fuzzFactor,this.currentDelay_=t.initialDelay,this.currentAttempt_=1}var e=i.prototype;return e.moveToNextAttempt=function(){this.currentAttempt_++;var s=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+s},e.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},e.getCurrentDelay=function(){return this.currentDelay_},e.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},e.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},e.getCurrentFuzzedDelay=function(){var s=this.getCurrentMinPossibleDelay(),r=this.getCurrentMaxPossibleDelay();return s+Math.random()*(r-s)},i}(),q0=U0,j0=Ea,H0=function(e,t){return t===void 0&&(t=!1),function(s,r,n){if(s){e(s);return}if(r.statusCode>=400&&r.statusCode<=599){var a=n;if(t)if(j0.TextDecoder){var o=V0(r.headers&&r.headers["content-type"]);try{a=new TextDecoder(o).decode(n)}catch{}}else a=String.fromCharCode.apply(null,new Uint8Array(n));e({cause:a});return}e(null,n)}};function V0(i){return i===void 0&&(i=""),i.toLowerCase().split(";").reduce(function(e,t){var s=t.split("="),r=s[0],n=s[1];return r.trim()==="charset"?n.trim():e},"utf-8")}var z0=H0,eh=Ea,G0=P0,W0=L0,th=F0,X0=q0;Ue.httpHandler=z0;Ue.requestInterceptorsStorage=new th;Ue.responseInterceptorsStorage=new th;Ue.retryManager=new X0;/** 3 * @license 4 * slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/> 5 * Copyright (c) 2014 David Björklund 6 * Available under the MIT license 7 * <https://github.com/kesla/parse-headers/blob/master/LICENCE> 8 */var K0=function(e){var t={};return e&&e.trim().split(` 9`).forEach(function(s){var r=s.indexOf(":"),n=s.slice(0,r).trim().toLowerCase(),a=s.slice(r+1).trim();typeof t[n]>"u"?t[n]=a:Array.isArray(t[n])?t[n].push(a):t[n]=[t[n],a]}),t};xl.exports=Ue;xl.exports.default=Ue;Ue.XMLHttpRequest=eh.XMLHttpRequest||Z0;Ue.XDomainRequest="withCredentials"in new Ue.XMLHttpRequest?Ue.XMLHttpRequest:eh.XD
vendor: 7,257 bytes, line 9
9omainRequest;Y0(["get","put","post","patch","head","delete"],function(i){Ue[i==="delete"?"del":i]=function(e,t,s){return t=ih(e,t,s),t.method=i.toUpperCase(),El(t)}});function Y0(i,e){for(var t=0;t<i.length;t++)e(i[t])}function Q0(i){for(var e in i)if(i.hasOwnProperty(e))return!1;return!0}function ih(i,e,t){var s=i;return W0(e)?(t=e,typeof i=="string"&&(s={uri:i})):s=G0({},e,{uri:i}),s.callback=t,s}function Ue(i,e,t){return e=ih(i,e,t),El(e)}function El(i){if(typeof i.callback>"u")throw new Error("callback argument missing");if(i.requestType&&Ue.requestInterceptorsStorage.getIsEnabled()){var e={uri:i.uri||i.url,headers:i.headers||{},body:i.body,metadata:i.metadata||{},retry:i.retry,timeout:i.timeout},t=Ue.requestInterceptorsStorage.execute(i.requestType,e);i.uri=t.uri,i.headers=t.headers,i.body=t.body,i.metadata=t.metadata,i.retry=t.retry,i.timeout=t.timeout}var s=!1,r=function(I,$,X){s||(s=!0,i.callback(I,$,X))};function n(){h.readyState===4&&!Ue.responseInterceptorsStorage.getIsEnabled()&&setTimeout(u,0)}function a(){var B=void 0;if(h.response?B=h.response:B=h.responseText||J0(h),D)try{B=JSON.parse(B)}catch{}return B}function o(B){if(clearTimeout(N),clearTimeout(i.retryTimeout),B instanceof Error||(B=new Error(""+(B||"Unknown XMLHttpRequest Error"))),B.statusCode=0,!_&&Ue.retryManager.getIsEnabled()&&i.retry&&i.retry.shouldRetry()){i.retryTimeout=setTimeout(function(){i.retry.moveToNextAttempt(),i.xhr=h,El(i)},i.retry.getCurrentFuzzedDelay());return}if(i.requestType&&Ue.responseInterceptorsStorage.getIsEnabled()){var I={headers:O.headers||{},body:O.body,responseUrl:h.responseURL,responseType:h.responseType},$=Ue.responseInterceptorsStorage.execute(i.requestType,I);O.body=$.body,O.headers=$.headers}return r(B,O)}function u(){if(!_){var B;clearTimeout(N),clearTimeout(i.retryTimeout),i.useXDR&&h.status===void 0?B=200:B=h.status===1223?204:h.status;var I=O,$=null;if(B!==0?(I={body:a(),statusCode:B,method:E,headers:{},url:T,rawRequest:h},h.getAllResponseHeaders&&(I.headers=K0(h.getAllResponseHeaders()))):$=new Error("Internal XMLHttpRequest Error"),i.requestType&&Ue.responseInterceptorsStorage.getIsEnabled()){var X={headers:I.headers||{},body:I.body,responseUrl:h.responseURL,responseType:h.responseType},K=Ue.responseInterceptorsStorage.execute(i.requestType,X);I.body=K.body,I.headers=K.headers}return r($,I,I.body)}}var h=i.xhr||null;h||(i.cors||i.useXDR?h=new Ue.XDomainRequest:h=new Ue.XMLHttpRequest);var m,_,T=h.url=i.uri||i.url,E=h.method=i.method||"GET",A=i.body||i.data,y=h.headers=i.headers||{},w=!!i.sync,D=!1,N,O={body:void 0,headers:{},statusCode:0,method:E,url:T,rawRequest:h};if("json"in i&&i.json!==!1&&(D=!0,y.accept||y.Accept||(y.Accept="application/json"),E!=="GET"&&E!=="HEAD"&&(y["content-type"]||y["Content-Type"]||(y["Content-Type"]="application/json"),A=JSON.stringify(i.json===!0?A:i.json))),h.onreadystatechange=n,h.onload=u,h.onerror=o,h.onprogress=function(){},h.onabort=function(){_=!0,clearTimeout(i.retryTimeout)},h.ontimeout=o,h.open(E,T,!w,i.username,i.password),w||(h.withCredentials=!!i.withCredentials),!w&&i.timeout>0&&(N=setTimeout(function(){if(!_){_=!0,h.abort("timeout");var B=new Error("XMLHttpRequest timeout");B.code="ETIMEDOUT",o(B)}},i.timeout)),h.setRequestHeader)for(m in y)y.hasOwnProperty(m)&&h.setRequestHeader(m,y[m]);else if(i.headers&&!Q0(i.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in i&&(h.responseType=i.responseType),"beforeSend"in i&&typeof i.beforeSend=="function"&&i.beforeSend(h),h.send(A||null),h}function J0(i){try{if(i.responseType==="document")return i.responseXML;var e=i.responseXML&&i.responseXML.documentElement.nodeName==="parsererror";if(i.responseType===""&&!e)return i.responseXML}catch{}return null}function Z0(){}var e_=xl.exports;const sh=Ks(e_);var rh={exports:{}},bc=Zd,Cl=Object.create||function(){function i(){}return function(e){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return i.prototype=e,new i}}();function xt(i,e){this.name="ParsingError",this.code=i.code,this.message=e||i.message}xt.prototype=Cl(Error.prototype);xt.prototype.constructor=xt;xt.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function Al(i){function e(s,r,n,a){return(s|0)*3600+(r|0)*60+(n|0)+(a|0)/1e3}var t=i.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return t?t[3]?e(t[1],t[2],t[3].replace(":",""),t[4]):t[1]>59?e(t[1],t[2],0,t[4]):e(0,t[1],t[2],t[4]):null}function Fr(){this.values=Cl(null)}Fr.prototype={set:function(i,e){!this.get(i)&&e!==""&&(this.values[i]=e)},get:function(i,e,t){return t?this.has(i)?this.values[i]:e[t]:this.has(i)?this.values[i]:e},has:function(i){return i in this.values},alt:function(i,e,t){for(var s=0;s<t.length;++s)if(e===t[s]){this.set(i,e);break}},integer:function(i,e){/^-?\d+$/.test(e)&&this.set(i,parseInt(e,10))},percent:function(i,e){return e.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(e=parseFloat(e),e>=0&&e<=100)?(this.set(i,e),!0):!1}};function Rr(i,e,t,s){var r=s?i.split(s):[i];for(var n in r)if(typeof r[n]=="string"){var a=r[n].split(t);if(a.length===2){var o=a[0].trim(),u=a[1].trim();e(o,u)}}}function t_(i,e,t){var s=i;function r(){var o=Al(i);if(o===null)throw new xt(xt.Errors.BadTimeStamp,"Malformed timestamp: "+s);return i=i.replace(/^[^\sa-zA-Z-]+/,""),o}function n(o,u){var h=new Fr;Rr(o,function(m,_){switch(m){case"region":for(var T=t.length-1;T>=0;T--)if(t[T].id===_){h.set(m,t[T].region);break}break;case"vertical":h.alt(m,_,["rl","lr"]);break;case"line":var E=_.split(","),A=E[0];h.integer(m,A),h.percent(m,A)&&h.set("snapToLines",!1),h.alt(m,A,["auto"]),E.length===2&&h.alt("lineAlign",E[1],["start","center","end"]);break;case"position":E=_.split(","),h.percent(m,E[0]),E.length===2&&h.alt("positionAlign",E[1],["start","center","end"]);break;case"size":h.percent(m,_);break;case"align":h.alt(m,_,["start","center","end","left","right"]);break}},/:/,/\s/),u.region=h.get("region",null),u.vertical=h.get("vertical","");try{u.line=h.get("line","auto")}catch{}u.lineAlign=h.get("lineAlign","start"),u.snapToLines=h.get("snapToLines",!0),u.size=h.get("size",100);try{u.align=h.get("align","center")}catch{u.align=h.get("align","middle")}try{u.position=h.get("position","auto")}catch{u.position=h.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},u.align)}u.positionAlign=h.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},u.align)}function a(){i=i.replace(/^\s+/,"")}if(a(),e.startTime=r(),a(),i.substr(0,3)!=="-->")throw new xt(xt.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+s);i=i.substr(3),a(),e.endTime=r(),a(),n(i,e)}var Ao=bc.createElement&&bc.createElement("textarea"),i_={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},Sc={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},s_={v:"title",lang:"lang"},xc={rt:"ruby"};function nh(i,e){function t(){if(!e)return null;function A(w){return e=e.substr(w.length),w}var y=e.match(/^([^<]*)(<[^>
9]*>?)?/);return A(y[1]?y[1]:y[2])}function s(A){return Ao.innerHTML=A,A=Ao.textContent,Ao.textContent="",A}function r(A,y){return!xc[y.localName]||xc[y.localName]===A.localName}function n(A,y){var w=i_[A];if(!w)return null;var D=i.document.createElement(w),N=s_[A];return N&&y&&(D[N]=y.trim()),D}for(var a=i.document.createElement("div"),o=a,u,h=[];(u=t())!==null;){if(u[0]==="<"){if(u[1]==="/"){h.length&&h[h.length-1]===u.substr(2).replace(">","")&&(h.pop(),o=o.parentNode);continue}var m=Al(u.substr(1,u.length-2)),_;if(m){_=i.document.createProcessingInstruction("timestamp",m),o.appendChild(_);continue}var T=u.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!T||(_=n(T[1],T[3]),!_)||!r(o,_))continue;if(T[2]){var E=T[2].split(".");E.forEach(function(A){var y=/^bg_/.test(A),w=y?A.slice(3):A;if(Sc.hasOwnProperty(w)){var D=y?"background-color":"color",N=Sc[w];_.style[D]=N}}),_.className=E.join(" ")}h.push(T[1]),o.appendChild(_),o=_;continue}o.appendChild(i.document.createTextNode(s(u)))}return a}var Ec=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function r_(i){for(var e=0;e<Ec.length;e++){var t=Ec[e];if(i>=t[0]&&i<=t[1])return!0}return!1}function n_(i){var e=[],t="",s;if(!i||!i.childNodes)return"ltr";function r(o,u){for(var h=u.childNodes.length-1;h>=0;h--)o.push(u.childNodes[h])}function n(o){if(!o||!o.length)return null;var u=o.pop(),h=u.textContent||u.innerText;if(h){var m=h.match(/^.*(\n|\r)/);return m?(o.length=0,m[0]):h}if(u.tagName==="ruby")return n(o);if(u.childNodes)return r(o,u),n(o)}for(r(e,i);t=n(e);)for(var a=0;a<t.length;a++)if(s=t.charCodeAt(a),r_(s))return"rtl";return"ltr"}function a_(i){if(typeof i.line=="number"&&(i.snapToLines||i.line>=0&&i.line<=100))return i.line;if(!i.track||!i.track.textTrackList||!i.track.textTrackList.mediaElement)return-1;for(var e=i.track,t=e.textTrackList,s=0,r=0;r<t.length&&t[r]!==e;r++)t[r].mode==="showing"&&s++;return++s*-1}function Ca(){}Ca.prototype.applyStyles=function(i,e){e=e||this.div;for(var t in i)i.hasOwnProperty(t)&&(e.style[t]=i[t])};Ca.prototype.formatStyle=function(i,e){return i===0?0:i+e};function Qn(i,e,t){Ca.call(this),this.cue=e,this.cueDiv=nh(i,e.text);var s={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:e.vertical===""?"horizontal-tb":e.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(s,this.cueDiv),this.div=i.document.createElement("div"),s={direction:n_(this.cueDiv),writingMode:e.vertical===""?"horizontal-tb":e.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:e.align==="middle"?"center":e.align,font:t.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(s),this.div.appendChild(this.cueDiv);var r=0;switch(e.positionAlign){case"start":case"line-left":r=e.position;break;case"center":r=e.position-e.size/2;break;case"end":case"line-right":r=e.position-e.size;break}e.vertical===""?this.applyStyles({left:this.formatStyle(r,"%"),width:this.formatStyle(e.size,"%")}):this.applyStyles({top:this.formatStyle(r,"%"),height:this.formatStyle(e.size,"%")}),this.move=function(n){this.applyStyles({top:this.formatStyle(n.top,"px"),bottom:this.formatStyle(n.bottom,"px"),left:this.formatStyle(n.left,"px"),right:this.formatStyle(n.right,"px"),height:this.formatStyle(n.height,"px"),width:this.formatStyle(n.width,"px")}
9)}}Qn.prototype=Cl(Ca.prototype);Qn.prototype.constructor=Qn;function ot(i){var e,t,s,r;if(i.div){t=i.div.offsetHeight,s=i.div.offsetWidth,r=i.div.offsetTop;var n=(n=i.div.childNodes)&&(n=n[0])&&n.getClientRects&&n.getClientRects();i=i.div.getBoundingClientRect(),e=n?Math.max(n[0]&&n[0].height||0,i.height/n.length):0}this.left=i.left,this.right=i.right,this.top=i.top||r,this.height=i.height||t,this.bottom=i.bottom||r+(i.height||t),this.width=i.width||s,this.lineHeight=e!==void 0?e:i.lineHeight}ot.prototype.move=function(i,e){switch(e=e!==void 0?e:this.lineHeight,i){case"+x":this.left+=e,this.right+=e;break;case"-x":this.left-=e,this.right-=e;break;case"+y":this.top+=e,this.bottom+=e;break;case"-y":this.top-=e,this.bottom-=e;break}};ot.prototype.overlaps=function(i){return this.left<i.right&&this.right>i.left&&this.top<i.bottom&&this.bottom>i.top};ot.prototype.overlapsAny=function(i){for(var e=0;e<i.length;e++)if(this.overlaps(i[e]))return!0;return!1};ot.prototype.within=function(i){return this.top>=i.top&&this.bottom<=i.bottom&&this.left>=i.left&&this.right<=i.right};ot.prototype.overlapsOppositeAxis=function(i,e){switch(e){case"+x":return this.left<i.left;case"-x":return this.right>i.right;case"+y":return this.top<i.top;case"-y":return this.bottom>i.bottom}};ot.prototype.intersectPercentage=function(i){var e=Math.max(0,Math.min(this.right,i.right)-Math.max(this.left,i.left)),t=Math.max(0,Math.min(this.bottom,i.bottom)-Math.max(this.top,i.top)),s=e*t;return s/(this.height*this.width)};ot.prototype.toCSSCompatValues=function(i){return{top:this.top-i.top,bottom:i.bottom-this.bottom,left:this.left-i.left,right:i.right-this.right,height:this.height,width:this.width}};ot.getSimpleBoxPosition=function(i){var e=i.div?i.div.offsetHeight:i.tagName?i.offsetHeight:0,t=i.div?i.div.offsetWidth:i.tagName?i.offsetWidth:0,s=i.div?i.div.offsetTop:i.tagName?i.offsetTop:0;i=i.div?i.div.getBoundingClientRect():i.tagName?i.getBoundingClientRect():i;var r={left:i.left,right:i.right,top:i.top||s,height:i.height||e,bottom:i.bottom||s+(i.height||e),width:i.width||t};return r};function o_(i,e,t,s){function r(w,D){for(var N,O=new ot(w),B=1,I=0;I<D.length;I++){for(;w.overlapsOppositeAxis(t,D[I])||w.within(t)&&w.overlapsAny(s);)w.move(D[I]);if(w.within(t))return w;var $=w.intersectPercentage(t);B>$&&(N=new ot(w),B=$),w=new ot(O)}return N||O}var n=new ot(e),a=e.cue,o=a_(a),u=[];
vendor: 8,695 bytes, lines 9-16
9if(a.snapToLines){var h;switch(a.vertical){case"":u=["+y","-y"],h="height";break;case"rl":u=["+x","-x"],h="width";break;case"lr":u=["-x","+x"],h="width";break}var m=n.lineHeight,_=m*Math.round(o),T=t[h]+m,E=u[0];Math.abs(_)>T&&(_=_<0?-1:1,_*=Math.ceil(T/m)*m),o<0&&(_+=a.vertical===""?t.height:t.width,u=u.reverse()),n.move(E,_)}else{var A=n.lineHeight/t.height*100;switch(a.lineAlign){case"center":o-=A/2;break;case"end":o-=A;break}switch(a.vertical){case"":e.applyStyles({top:e.formatStyle(o,"%")});break;case"rl":e.applyStyles({left:e.formatStyle(o,"%")});break;case"lr":e.applyStyles({right:e.formatStyle(o,"%")});break}u=["+y","-x","+x","-y"],n=new ot(e)}var y=r(n,u);e.move(y.toCSSCompatValues(t))}function Ys(){}Ys.StringDecoder=function(){return{decode:function(i){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))}}};Ys.convertCueToDOMTree=function(i,e){return!i||!e?null:nh(i,e)};var l_=.05,u_="sans-serif",c_="1.5%";Ys.processCues=function(i,e,t){if(!i||!e||!t)return null;for(;t.firstChild;)t.removeChild(t.firstChild);var s=i.document.createElement("div");s.style.position="absolute",s.style.left="0",s.style.right="0",s.style.top="0",s.style.bottom="0",s.style.margin=c_,t.appendChild(s);function r(m){for(var _=0;_<m.length;_++)if(m[_].hasBeenReset||!m[_].displayState)return!0;return!1}if(!r(e)){for(var n=0;n<e.length;n++)s.appendChild(e[n].displayState);return}var a=[],o=ot.getSimpleBoxPosition(s),u=Math.round(o.height*l_*100)/100,h={font:u+"px "+u_};(function(){for(var m,_,T=0;T<e.length;T++)_=e[T],m=new Qn(i,_,h),s.appendChild(m.div),o_(i,m,o,a),_.displayState=m.div,a.push(ot.getSimpleBoxPosition(m))})()};Ys.Parser=function(i,e,t){t||(t=e,e={}),e||(e={}),this.window=i,this.vttjs=e,this.state="INITIAL",this.buffer="",this.decoder=t||new TextDecoder("utf8"),this.regionList=[]};Ys.Parser.prototype={reportOrThrowError:function(i){if(i instanceof xt)this.onparsingerror&&this.onparsingerror(i);else throw i},parse:function(i){var e=this;i&&(e.buffer+=e.decoder.decode(i,{stream:!0}));function t(){for(var m=e.buffer,_=0;_<m.length&&m[_]!=="\r"&&m[_]!==` 10`;)++_;var T=m.substr(0,_);return m[_]==="\r"&&++_,m[_]===` 11`&&++_,e.buffer=m.substr(_),T}function s(m){var _=new Fr;if(Rr(m,function(E,A){switch(E){case"id":_.set(E,A);break;case"width":_.percent(E,A);break;case"lines":_.integer(E,A);break;case"regionanchor":case"viewportanchor":var y=A.split(",");if(y.length!==2)break;var w=new Fr;if(w.percent("x",y[0]),w.percent("y",y[1]),!w.has("x")||!w.has("y"))break;_.set(E+"X",w.get("x")),_.set(E+"Y",w.get("y"));break;case"scroll":_.alt(E,A,["up"]);break}},/=/,/\s/),_.has("id")){var T=new(e.vttjs.VTTRegion||e.window.VTTRegion);T.width=_.get("width",100),T.lines=_.get("lines",3),T.regionAnchorX=_.get("regionanchorX",0),T.regionAnchorY=_.get("regionanchorY",100),T.viewportAnchorX=_.get("viewportanchorX",0),T.viewportAnchorY=_.get("viewportanchorY",100),T.scroll=_.get("scroll",""),e.onregion&&e.onregion(T),e.regionList.push({id:_.get("id"),region:T})}}function r(m){var _=new Fr;Rr(m,function(T,E){switch(T){case"MPEGT":_.integer(T+"S",E);break;case"LOCA":_.set(T+"L",Al(E));break}},/[^\d]:/,/,/),e.ontimestampmap&&e.ontimestampmap({MPEGTS:_.get("MPEGTS"),LOCAL:_.get("LOCAL")})}function n(m){m.match(/X-TIMESTAMP-MAP/)?Rr(m,function(_,T){switch(_){case"X-TIMESTAMP-MAP":r(T);break}},/=/):Rr(m,function(_,T){switch(_){case"Region":s(T);break}},/:/)}try{var a;if(e.state==="INITIAL"){if(!/\r\n|\n/.test(e.buffer))return this;a=t();var o=a.match(/^WEBVTT([ \t].*)?$/);if(!o||!o[0])throw new xt(xt.Errors.BadSignature);e.state="HEADER"}for(var u=!1;e.buffer;){if(!/\r\n|\n/.test(e.buffer))return this;switch(u?u=!1:a=t(),e.state){case"HEADER":/:/.test(a)?n(a):a||(e.state="ID");continue;case"NOTE":a||(e.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(a)){e.state="NOTE";break}if(!a)continue;e.cue=new(e.vttjs.VTTCue||e.window.VTTCue)(0,0,"");try{e.cue.align="center"}catch{e.cue.align="middle"}if(e.state="CUE",a.indexOf("-->")===-1){e.cue.id=a;continue}case"CUE":try{t_(a,e.cue,e.regionList)}catch(m){e.reportOrThrowError(m),e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":var h=a.indexOf("-->")!==-1;if(!a||h&&(u=!0)){e.oncue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}e.cue.text&&(e.cue.text+=` 12`),e.cue.text+=a.replace(/\u2028/g,` 13`).replace(/u2029/g,` 14`);continue;case"BADCUE":a||(e.state="ID");continue}}}catch(m){e.reportOrThrowError(m),e.state==="CUETEXT"&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state=e.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var i=this;try{if(i.buffer+=i.decoder.decode(),(i.cue||i.state==="HEADER")&&(i.buffer+=` 15 16`,i.parse()),i.state==="INITIAL")throw new xt(xt.Errors.BadSignature)}catch(e){i.reportOrThrowError(e)}return i.onflush&&i.onflush(),this}};var d_=Ys,h_="auto",f_={"":1,lr:1,rl:1},p_={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function m_(i){if(typeof i!="string")return!1;var e=f_[i.toLowerCase()];return e?i.toLowerCase():!1}function wo(i){if(typeof i!="string")return!1;var e=p_[i.toLowerCase()];return e?i.toLowerCase():!1}function ah(i,e,t){this.hasBeenReset=!1;var s="",r=!1,n=i,a=e,o=t,u=null,h="",m=!0,_="auto",T="start",E="auto",A="auto",y=100,w="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return s},set:function(D){s=""+D}},pauseOnExit:{enumerable:!0,get:function(){return r},set:function(D){r=!!D}},startTime:{enumerable:!0,get:function(){return n},set:function(D){if(typeof D!="number")throw new TypeError("Start time must be set to a number.");n=D,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return a},set:function(D){if(typeof D!="number")throw new TypeError("End time must be set to a number.");a=D,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return o},set:function(D){o=""+D,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return u},set:function(D){u=D,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return h},set:function(D){var N=m_(D);if(N===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");h=N,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return m},set:function(D){m=!!D,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return _},set:function(D){if(typeof D!="number"&&D!==h_)throw new SyntaxError("Line: an invalid number or illegal string was specified.");_=D,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return T},set:function(D){var N=wo(D);N?(T=N,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return E},set:function(D){if(D<0||D>100)throw new Error("Position must be between 0 and 100.");E=D,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return A},set:function(D){var N=wo(D);N?(A=N,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return y},set:function(D){if(D<0||D>100)throw new Error("Size must be between 0 and 100.");y=D,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return w},set:function(D){var N=wo(D);if(!N)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");w=N,this.hasBeenReset=!0}}}),this.displayState=void 0}ah.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var g_=ah,__={"":!0,up:!0};function y_(i){if(typeof i!="string")return!1;var e=__[i.toLowerCase()];return e?i.toLowerCase():!1}function Cr(i){return typeof i=="number"&&i>=0&&i<=100}function v_(){var i=100,e=3,t=0,s=100,r=0,n=100,a="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return i},set:function(o){if(!Cr(o))throw new Error("Width must be between 0 and 100.");i=o}},lines:{enumerable:!0,get:function(){return e},set:function(o){if(typeof o!="number")throw new TypeError("Lines must be set to a number.");e=o}},regionAnchorY:{enumerable:!0,get:function(){return s},set:function(o){if(!Cr(o))throw new Error("RegionAnchorX must be between 0 and 100.");s=o}},regionAnchorX:{enumerable:!0,get:function(){return t},set:function(o){if(!Cr(o))throw new Error("RegionAnchorY must be between 0 and 100.");t=o}},viewportAnchorY:{enumerable:!0,get:function(){return n},set:function(o){if(!Cr(o))throw new Error("ViewportAnchorY must be between 0 and 100.");n=o}},viewportAnchorX:{enumerable:!0,get:function(){return r},set:function(o){if(!Cr(o))throw new Error("ViewportAnchorX must be between 0 and 100.");r=o}},scroll:{enumerable:!0,get:function(){return a}
16,set:function(o){var u=y_(o);u===!1?console.warn("Scroll: an invalid or illegal string was specified."):a=u}}})}var T_=v_,hi=Ea,is=rh.exports={WebVTT:d_,VTTCue:g_,VTTRegion:T_};hi.vttjs=is;hi.WebVTT=is.WebVTT;var b_=is.VTTCue,S_=is.VTTRegion,x_=hi.VTTCue,E_=hi.VTTRegion;is.shim=function(){hi.VTTCue=b_,hi.VTTRegion=S_};is.restore=function(){hi.VTTCue=x_,hi.VTTRegion=E_};hi.VTTCue||is.shim();var C_=rh.exports;const Cc=Ks(C_);var Ac="https://example.com",A_=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=x.location&&x.location.href||"");var s=/^\/\//.test(e),r=!x.location&&!/\/\//i.test(e);e=new x.URL(e,x.location||Ac);var n=new URL(t,e);return r?n.href.slice(Ac.length):s?n.href.slice(n.protocol.length):n.href},wl=function(){function i(){this.listeners={}}var e=i.prototype;return e.on=function(s,r){this.listeners[s]||(this.listeners[s]=[]),this.listeners[s].push(r)},e.off=function(s,r){if(!this.listeners[s])return!1;var n=this.listeners[s].indexOf(r);return this.listeners[s]=this.listeners[s].slice(0),this.listeners[s].splice(n,1),n>-1},e.trigger=function(s){var r=this.listeners[s];if(r)if(arguments.length===2)for(var n=r.length,a=0;a<n;++a)r[a].call(this,arguments[1]);else for(var o=Array.prototype.slice.call(arguments,1),u=r.length,h=0;h<u;++h)r[h].apply(this,o)},e.dispose=function(){this.listeners={}},e.pipe=function(s){this.on("data",function(r){s.push(r)})},i}(),w_=function(e){return x.atob?x.atob(e):Buffer.from(e,"base64").toString("binary")};function D_(i){for(var e=w_(i),t=new Uint8Array(e.length),s=0;s<e.length;s++)t[s]=e.charCodeAt(s);return t}/*! @name m3u8-parser @version 7.2.0 @license Apache-2.0 */class I_ extends wl{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf(` 17`);t>-1;t=this.buffer.indexOf(` 18`))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const k_=" ",Do=function(i){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(i||""),t={};return e[1]&&(t.length=parseInt(e[1],10)),e[2]&&(t.offset=parseInt(e[2],10)),t},P_=function(){const t="(?:"+"[^=]*"+")=(?:"+'"[^"]*"|[^,]*'+")";return new RegExp("(?:^|,)("+t+")")},rt=function(i){const e={};if(!i)return e;const t=i.split(P_());let s=t.length,r;for(;s--;)t[s]!==""&&(r=/([^=]*)=(.*)/.exec(t[s]).slice(1),r[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),e[r[0]]=r[1]);return e},wc=i=>{const e=i.split("x"),t={};return e[0]&&(t.width=parseInt(e[0],10)),e[1]&&(t.height=parseInt(e[1],10)),t};class L_ extends wl{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,s;if(e=e.trim(),e.length===0)return;if(e[0]!=="#"){this.trigger("data",{type:"uri",uri:e});return}this.tagMappers.reduce((n,a)=>{const o=a(e);return o===e?n:n.concat([o])},[e]).forEach(n=>{for(let a=0;a<this.customParsers.length;a++)if(this.customParsers[a].call(this,n))return;if(n.indexOf("#EXT")!==0){this.trigger("data",{type:"comment",text:n.slice(1)});return}if(n=n.replace("\r",""),t=/^#EXTM3U/.exec(n),t){this.trigger("data",{type:"tag",tagType:"m3u"});return}if(t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(n),t){s={type:"tag",tagType:"inf"},t[1]&&(s.duration=parseFloat(t[1])),t[2]&&(s.title=t[2]),this.trigger("data",s);return}if(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(n),t){s={type:"tag",tagType:"targetduration"},t[1]&&(s.duration=parseInt(t[1],10)),this.trigger("data",s);return}if(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(n),t){s={type:"tag",tagType:"version"},t[1]&&(s.version=parseInt(t[1],10)),this.trigger("data",s);return}if(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(n),t){s={type:"tag",tagType:"media-sequence"},t[1]&&(s.number=parseInt(t[1],10)),this.trigger("data",s);return}if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(n),t){s={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(s.number=parseInt(t[1],10)),this.trigger("data",s);return}if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(n),t){s={type:"tag",tagType:"playlist-type"},t[1]&&(s.playlistType=t[1]),this.trigger("data",s);return}if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(n),t){s=Me(Do(t[1]),{type:"tag",tagType:"byterange"}),this.trigger("data",s);return}if(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(n),t){s={type:"tag",tagType:"allow-cache"},t[1]&&(s.allowed=!/NO/.test(t[1])),this.trigger("data",s);return}if(t=/^#EXT-X-MAP:(.*)$/.exec(n),t){if(s={type:"tag",tagType:"map"},t[1]){const a=rt(t[1]);a.URI&&(s.uri=a.URI),a.BYTERANGE&&(s.byterange=Do(a.BYTERANGE))}this.trigger("data",s);return}if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(n),t){s={type:"tag",tagType:"stream-inf"},t[1]&&(s.attributes=rt(t[1]),s.attributes.RESOLUTION&&(s.attributes.RESOLUTION=wc(s.attributes.RESOLUTION)),s.attributes.BANDWIDTH&&(s.attributes.BANDWIDTH=parseInt(s.attributes.BANDWIDTH,10)),s.attributes["FRAME-RATE"]&&(s.attributes["FRAME-RATE"]=parseFloat(s.attributes["FRAME-RATE"])),s.attributes["PROGRAM-ID"]&&(s.attributes["PROGRAM-ID"]=parseInt(s.attributes["PROGRAM-ID"],10))),this.trigger("data",s);return}if(t=/^#EXT-X-MEDIA:(.*)$/.exec(n),t){s={type:"tag",tagType:"media"}
vendor: 16,902 bytes, line 18
18,t[1]&&(s.attributes=rt(t[1])),this.trigger("data",s);return}if(t=/^#EXT-X-ENDLIST/.exec(n),t){this.trigger("data",{type:"tag",tagType:"endlist"});return}if(t=/^#EXT-X-DISCONTINUITY/.exec(n),t){this.trigger("data",{type:"tag",tagType:"discontinuity"});return}if(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(n),t){s={type:"tag",tagType:"program-date-time"},t[1]&&(s.dateTimeString=t[1],s.dateTimeObject=new Date(t[1])),this.trigger("data",s);return}if(t=/^#EXT-X-KEY:(.*)$/.exec(n),t){s={type:"tag",tagType:"key"},t[1]&&(s.attributes=rt(t[1]),s.attributes.IV&&(s.attributes.IV.substring(0,2).toLowerCase()==="0x"&&(s.attributes.IV=s.attributes.IV.substring(2)),s.attributes.IV=s.attributes.IV.match(/.{8}/g),s.attributes.IV[0]=parseInt(s.attributes.IV[0],16),s.attributes.IV[1]=parseInt(s.attributes.IV[1],16),s.attributes.IV[2]=parseInt(s.attributes.IV[2],16),s.attributes.IV[3]=parseInt(s.attributes.IV[3],16),s.attributes.IV=new Uint32Array(s.attributes.IV))),this.trigger("data",s);return}if(t=/^#EXT-X-START:(.*)$/.exec(n),t){s={type:"tag",tagType:"start"},t[1]&&(s.attributes=rt(t[1]),s.attributes["TIME-OFFSET"]=parseFloat(s.attributes["TIME-OFFSET"]),s.attributes.PRECISE=/YES/.test(s.attributes.PRECISE)),this.trigger("data",s);return}if(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(n),t){s={type:"tag",tagType:"cue-out-cont"},t[1]?s.data=t[1]:s.data="",this.trigger("data",s);return}if(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(n),t){s={type:"tag",tagType:"cue-out"},t[1]?s.data=t[1]:s.data="",this.trigger("data",s);return}if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(n),t){s={type:"tag",tagType:"cue-in"},t[1]?s.data=t[1]:s.data="",this.trigger("data",s);return}if(t=/^#EXT-X-SKIP:(.*)$/.exec(n),t&&t[1]){s={type:"tag",tagType:"skip"},s.attributes=rt(t[1]),s.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(s.attributes["SKIPPED-SEGMENTS"]=parseInt(s.attributes["SKIPPED-SEGMENTS"],10)),s.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(s.attributes["RECENTLY-REMOVED-DATERANGES"]=s.attributes["RECENTLY-REMOVED-DATERANGES"].split(k_)),this.trigger("data",s);return}if(t=/^#EXT-X-PART:(.*)$/.exec(n),t&&t[1]){s={type:"tag",tagType:"part"},s.attributes=rt(t[1]),["DURATION"].forEach(function(a){s.attributes.hasOwnProperty(a)&&(s.attributes[a]=parseFloat(s.attributes[a]))}),["INDEPENDENT","GAP"].forEach(function(a){s.attributes.hasOwnProperty(a)&&(s.attributes[a]=/YES/.test(s.attributes[a]))}),s.attributes.hasOwnProperty("BYTERANGE")&&(s.attributes.byterange=Do(s.attributes.BYTERANGE)),this.trigger("data",s);return}if(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(n),t&&t[1]){s={type:"tag",tagType:"server-control"},s.attributes=rt(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(a){s.attributes.hasOwnProperty(a)&&(s.attributes[a]=parseFloat(s.attributes[a]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(a){s.attributes.hasOwnProperty(a)&&(s.attributes[a]=/YES/.test(s.attributes[a]))}),this.trigger("data",s);return}if(t=/^#EXT-X-PART-INF:(.*)$/.exec(n),t&&t[1]){s={type:"tag",tagType:"part-inf"},s.attributes=rt(t[1]),["PART-TARGET"].forEach(function(a){s.attributes.hasOwnProperty(a)&&(s.attributes[a]=parseFloat(s.attributes[a]))}),this.trigger("data",s);return}if(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(n),t&&t[1]){s={type:"tag",tagType:"preload-hint"},s.attributes=rt(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(a){if(s.attributes.hasOwnProperty(a)){s.attributes[a]=parseInt(s.attributes[a],10);const o=a==="BYTERANGE-LENGTH"?"length":"offset";s.attributes.byterange=s.attributes.byterange||{},s.attributes.byterange[o]=s.attributes[a],delete s.attributes[a]}}),this.trigger("data",s);return}if(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(n),t&&t[1]){s={type:"tag",tagType:"rendition-report"},s.attributes=rt(t[1]),["LAST-MSN","LAST-PART"].forEach(function(a){s.attributes.hasOwnProperty(a)&&(s.attributes[a]=parseInt(s.attributes[a],10))}),this.trigger("data",s);return}if(t=/^#EXT-X-DATERANGE:(.*)$/.exec(n),t&&t[1]){s={type:"tag",tagType:"daterange"},s.attributes=rt(t[1]),["ID","CLASS"].forEach(function(o){s.attributes.hasOwnProperty(o)&&(s.attributes[o]=String(s.attributes[o]))}),["START-DATE","END-DATE"].forEach(function(o){s.attributes.hasOwnProperty(o)&&(s.attributes[o]=new Date(s.attributes[o]))}),["DURATION","PLANNED-DURATION"].forEach(function(o){s.attributes.hasOwnProperty(o)&&(s.attributes[o]=parseFloat(s.attributes[o]))}),["END-ON-NEXT"].forEach(function(o){s.attributes.hasOwnProperty(o)&&(s.attributes[o]=/YES/i.test(s.attributes[o]))}),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach(function(o){s.attributes.hasOwnProperty(o)&&(s.attributes[o]=s.attributes[o].toString(16))});const a=/^X-([A-Z]+-)+[A-Z]+$/;for(const o in s.attributes){if(!a.test(o))continue;const u=/[0-9A-Fa-f]{6}/g.test(s.attributes[o]),h=/^\d+(\.\d+)?$/.test(s.attributes[o]);s.attributes[o]=u?s.attributes[o].toString(16):h?parseFloat(s.attributes[o]):String(s.attributes[o])}this.trigger("data",s);return}if(t=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(n),t){this.trigger("data",{type:"tag",tagType:"independent-segments"});return}if(t=/^#EXT-X-I-FRAMES-ONLY/.exec(n),t){this.trigger("data",{type:"tag",tagType:"i-frames-only"});return}if(t=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(n),t){s={type:"tag",tagType:"content-steering"},s.attributes=rt(t[1]),this.trigger("data",s);return}if(t=/^#EXT-X-I-FRAME-STREAM-INF:(.*)$/.exec(n),t){s={type:"tag",tagType:"i-frame-playlist"},s.attributes=rt(t[1]),s.attributes.URI&&(s.uri=s.attributes.URI),s.attributes.BANDWIDTH&&(s.attributes.BANDWIDTH=parseInt(s.attributes.BANDWIDTH,10)),s.attributes.RESOLUTION&&(s.attributes.RESOLUTION=wc(s.attributes.RESOLUTION)),s.attributes["AVERAGE-BANDWIDTH"]&&(s.attributes["AVERAGE-BANDWIDTH"]=parseInt(s.attributes["AVERAGE-BANDWIDTH"],10)),s.attributes["FRAME-RATE"]&&(s.attributes["FRAME-RATE"]=parseFloat(s.attributes["FRAME-RATE"])),this.trigger("data",s);return}if(t=/^#EXT-X-DEFINE:(.*)$/.exec(n),t){s={type:"tag",tagType:"define"},s.attributes=rt(t[1]),this.trigger("data",s);return}this.trigger("data",{type:"tag",data:n.slice(4)})})}addParser({expression:e,customType:t,dataParser:s,segment:r}){typeof s!="function"&&(s=n=>n),this.customParsers.push(n=>{if(e.exec(n))return this.trigger("data",{type:"custom",data:s(n),customType:t,segment:r}),!0})}addTagMapper({expression:e,map:t}){const s=r=>e.test(r)?t(r):r;this.tagMappers.push(s)}}const O_=i=>i.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),Si=function(i){const e={};return Object.keys(i).forEach(function(t){e[O_(t)]=i[t]}),e},Io=function(i){const{serverControl:e,targetDuration:t,partTargetDuration:s}=i;if(!e)return;const r="#EXT-X-SERVER-CONTROL",n="holdBack",a="partHoldBack",o=t&&t*3,u=s&&s*2;t&&!e.hasOwnProperty(n)&&(e[n]=o,this.trigger("info",{message:`${r} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})),o&&e[n]<o&&(this.trigger("warn",{message:`${r} clamping HOLD-BACK (${e[n]}) to targetDuration * 3 (${o})`}),e[n]=o),s&&!e.hasOwnProperty(a)&&(e[a]=s*3,this.trigger("info",{message:`${r} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${e[a]}).`})),s&&e[a]<u&&(this.trigger("warn",{message:`${r} clamping PART-HOLD-BACK (${e[a]}) to partTargetDuration * 2 (${u}).`}),e[a]=u)};class R_ extends wl{constructor(e={}){super(),this.lineStream=new I_,this.parseStream=new L_,this.lineStream.pipe(this.parseStream),this.mainDefinitions=e.mainDefinitions||{},this.params=new URL(e.uri,"https://a.com").searchParams,this.lastProgramDateTime=null;const t=this,s=[];let r={},n,a,o=!1;const u=function(){},h={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},m="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";let _=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};let T=0,E=0;const A={};this.on("end",()=>{r.uri||!r.parts&&!r.preloadHints||(!r.map&&n&&(r.map=n),!r.key&&a&&(r.key=a),!r.timeline&&typeof _=="number"&&(r.timeline=_),this.manifest.preloadSegment=r)}),this.parseStream.on("data",function(y){let w,D;if(t.manifest.definitions){for(const N in t.manifest.definitions)if(y.uri&&(y.uri=y.uri.replace(`{$${N}}`,t.manifest.definitions[N])),y.attributes)for(const O in y.attributes)typeof y.attributes[O]=="string"&&(y.attributes[O]=y.attributes[O].replace(`{$${N}}`,t.manifest.definitions[N]))}({tag(){({version(){y.version&&(this.manifest.version=y.version)},"allow-cache"(){this.manifest.allowCache=y.allowed,"allowed"in y||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const N={};"length"in y&&(r.byterange=N,N.length=y.length,"offset"in y||(y.offset=T)),"offset"in y&&(r.byterange=N,N.offset=y.offset),T=N.offset+N.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),y.title&&(r.title=y.title),y.duration>0&&(r.duration=y.duration),y.duration===0&&(r.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=s},key(){if(!y.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(y.attributes.METHOD==="NONE"){a=null;return}if(!y.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(y.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:y.attributes};return}if(y.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:y.attributes.URI};return}if(y.attributes.KEYFORMAT===m){if(["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(y.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(y.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),y.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(y.attributes.KEYID&&y.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:y.attributes.KEYFORMAT,keyId:y.attributes.KEYID.substring(2)},pssh:D_(y.attributes.URI.split(",")[1])};return}y.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),a={method:y.attributes.METHOD||"AES-128",uri:y.attributes.URI},typeof y.attributes.IV<"u"&&(a.iv=y.attributes.IV)},"media-sequence"(){if(!isFinite(y.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+y.number});return}this.manifest.mediaSequence=y.number},"discontinuity-sequence"(){if(!isFinite(y.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+y.number});return}this.manifest.discontinuitySequence=y.number,_=y.number},"playlist-type"(){if(!/VOD|EVENT/.test(y.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+y.playlist});return}this.manifest.playlistType=y.playlistType},map(){n={},y.uri&&(n.uri=y.uri),y.byterange&&(n.byterange=y.byterange),a&&(n.key=a)},"stream-inf"(){if(this.manifest.playlists=s,this.manifest.mediaGroups=this.manifest.mediaGroups||h,!y.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}r.attributes||(r.attributes={}),Me(r.attributes,y.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||h,!(y.attributes&&y.attributes.TYPE&&y.attributes["GROUP-ID"]&&y.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const N=this.manifest.mediaGroups[y.attributes.TYPE];N[y.attributes["GROUP-ID"]]=N[y.attributes["GROUP-ID"]]||{},w=N[y.attributes["GROUP-ID"]],D={default:/yes/i.test(y.attributes.DEFAULT)},D.default?D.autoselect=!0:D.autoselect=/yes/i.test(y.attributes.AUTOSELECT),y.attributes.LANGUAGE&&(D.language=y.attributes.LANGUAGE),y.attributes.URI&&(D.uri=y.attributes.URI),y.attributes["INSTREAM-ID"]&&(D.instreamId=y.attributes["INSTREAM-ID"]),y.attributes.CHARACTERISTICS&&(D.characteristics=y.attributes.CHARACTERISTICS),y.attributes.FORCED&&(D.forced=/yes/i.test(y.attributes.FORCED)),w[y.attributes.NAME]=D},discontinuity(){_+=1,r.discontinuity=!0,this.manifest.discontinuityStarts.push(s.length)},"program-date-time"(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=y.dateTimeString,this.manifest.dateTimeObject=y.dateTimeObject),r.dateTimeString=y.dateTimeString,r.dateTimeObject=y.dateTimeObject;const{lastProgramDateTime:N}=this;this.lastProgramDateTime=new Date(y.dateTimeString).getTime(),N===null&&this.manifest.segments.reduceRight((O,B)=>(B.programDateTime=O-B.duration*1e3,B.programDateTime),this.lastProgramDateTime)},targetduration(){if(!isFinite(y.duration)||y.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+y.duration});return}this.manifest.targetDuration=y.duration,Io.call(this,this.manifest)},start(){if(!y.attributes||isNaN(y.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:y.attributes["TIME-OFFSET"],precise:y.attributes.PRECISE}},"cue-out"(){r.cueOut=y.data},"cue-out-cont"(){r.cueOutCont=y.data},"cue-in"(){r.cueIn=y.data},skip(){this.manifest.skip=Si(y.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",y.attributes,["SKIPPED-SEGMENTS"])},part(){o=!0;const N=this.manifest.segments.length,O=Si(y.attributes);r.parts=r.parts||[],r.parts.push(O),O.byterange&&(O.byterange.hasOwnProperty("offset")||(O.byterange.offset=E),E=O.byterange.offset+O.byterange.length);const B=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${B} for segment #${N}`,y.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((I,$)=>{I.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${$} lacks required attribute(s): LAST-PART`})})},"server-control"(){const N=this.manifest.serverControl=Si(y.attributes);N.hasOwnProperty("canBlockReload")||(N.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),Io.call(this,this.manifest),N.canSkipDateranges&&!N.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const N=this.manifest.segments.length,O=Si(y.attributes),B=O.type&&O.type==="PART";r.preloadHints=r.preloadHints||[],r.preloadHints.push(O),O.byterange&&(O.byterange.hasOwnProperty("offset")||(O.byterange.offset=B?E:0,B&&(E=O.byterange.offset+O.byterange.length)));const I=r.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${I} for segment #${N}`,y.attributes,["TYPE","URI"]),!!O.type)for(let $=0;$<r.preloadHints.length-1;$++){const X=r.preloadHints[$];X.type&&X.type===O.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${I} for segment #${N} has the same TYPE ${O.type} as preload hint #${$}`})}},"rendition-report"(){const N=Si(y.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(N);const O=this.manifest.renditionReports.length-1,B=["LAST-MSN","URI"];o&&B.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${O}`,y.attributes,B)},"part-inf"(){this.manifest.partInf=Si(y.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",y.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),Io.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(Si(y.attributes));const N=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${N}`,y.attributes,["ID","START-DATE"]);const O=this.manifest.dateRanges[N];O.endDate&&O.startDate&&new Date(O.endDate)<new Date(O.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),O.duration&&O.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),O.plannedDuration&&O.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});const B=!!O.endOnNext;if(B&&!O.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT
18=YES attribute must have a CLASS attribute"}),B&&(O.duration||O.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),O.duration&&O.endDate){const $=O.startDate.getTime()+O.duration*1e3;this.manifest.dateRanges[N].endDate=new Date($)}if(!A[O.id])A[O.id]=O;else{for(const $ in A[O.id])if(O[$]&&JSON.stringify(A[O.id][$])!==JSON.stringify(O[$])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}const I=this.manifest.dateRanges.findIndex($=>$.id===O.id);this.manifest.dateRanges[I]=Me(this.manifest.dateRanges[I],O),A[O.id]=Me(A[O.id],O),this.manifest.dateRanges.pop()}},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=Si(y.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",y.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const N=(O,B)=>{if(O in this.manifest.definitions){this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${O}`});return}this.manifest.definitions[O]=B};if("QUERYPARAM"in y.attributes){if("NAME"in y.attributes||"IMPORT"in y.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}const O=this.params.get(y.attributes.QUERYPARAM);if(!O){this.trigger("error",{message:`EXT-X-DEFINE: No query param ${y.attributes.QUERYPARAM}`});return}N(y.attributes.QUERYPARAM,decodeURIComponent(O));return}if("NAME"in y.attributes){if("IMPORT"in y.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}if(!("VALUE"in y.attributes)||typeof y.attributes.VALUE!="string"){this.trigger("error",{message:`EXT-X-DEFINE: No value for ${y.attributes.NAME}`});return}N(y.attributes.NAME,y.attributes.VALUE);return}if("IMPORT"in y.attributes){if(!this.mainDefinitions[y.attributes.IMPORT]){this.trigger("error",{message:`EXT-X-DEFINE: No value ${y.attributes.IMPORT} to import, or IMPORT used on main playlist`});return}N(y.attributes.IMPORT,this.mainDefinitions[y.attributes.IMPORT]);return}this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:y.attributes,uri:y.uri,timeline:_}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",y.attributes,["BANDWIDTH","URI"])}}[y.tagType]||u).call(t)},uri(){r.uri=y.uri,s.push(r),this.manifest.targetDuration&&!("duration"in r)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),r.duration=this.manifest.targetDuration),a&&(r.key=a),r.timeline=_,n&&(r.map=n),E=0,this.lastProgramDateTime!==null&&(r.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=r.duration*1e3),r={}},comment(){},custom(){y.segment?(r.custom=r.custom||{},r.custom[y.customType]=y.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[y.customType]=y.data)}})[y.type].call(t)})}requiredCompatibilityversion(e,t){(e<t||!e)&&this.trigger("warn",{message:`manifest must be at least version ${t}`})}warnOnMissingAttributes_(e,t,s){const r=[];s.forEach(function(n){t.hasOwnProperty(n)||r.push(n)}),r.length&&this.trigger("warn",{message:`${e} lacks required attribute(s): ${r.join(", ")}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push(` 19`),this.manifest.dateRanges.length&&this.lastProgramDateTime===null&&this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"}),this.lastProgramDateTime=null,this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}var Ki={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},N_=["video","audio","text"],Dc=["Video","Audio","Text"],oh=function(e){return e&&e.replace(/avc1\.(\d+)\.(\d+)/i,function(t,s,r){var n=("00"+Number(s).toString(16)).slice(-2),a=("00"+Number(r).toString(16)).slice(-2);return"avc1."+n+"00"+a})},Xt=function(e){e===void 0&&(e="");var t=e.split(","),s=[];return t.forEach(function(r){r=r.trim();var n;N_.forEach(function(a){var o=Ki[a].exec(r.toLowerCase());if(!(!o||o.length<=1)){n=a;var u=r.substring(0,o[1].length),h=r.replace(u,"");s.push({type:u,details:h,mediaType:a})}}),n||s.push({type:r,details:"",mediaType:"unknown"})}),s},M_=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var s=e.mediaGroups.AUDIO[t];if(!s)return null;for(var r in s){var n=s[r];if(n.default&&n.playlists)return Xt(n.playlists[0].attributes.CODECS)}return null},lh=function(e){return e===void 0&&(e=""),Ki.audio.test(e.trim().toLowerCase())},B_=function(e){return e===void 0&&(e=""),Ki.text.test(e.trim().toLowerCase())},Ms=function(e){if(!(!e||typeof e!="string")){var t=e.toLowerCase().split(",").map(function(n){return oh(n.trim())}),s="video";t.length===1&&lh(t[0])?s="audio":t.length===1&&B_(t[0])&&(s="application");var r="mp4";return t.every(function(n){return Ki.mp4.test(n)})?r="mp4":t.every(function(n){return Ki.webm.test(n)})?r="webm":t.every(function(n){return Ki.ogg.test(n)})&&(r="ogg"),s+"/"+r+';codecs="'+e+'"'}},Ur=function(e,t){return e===void 0&&(e=""),t===void 0&&(t=!1),x.MediaSource&&x.MediaSource.isTypeSupp
19orted&&x.MediaSource.isTypeSupported(Ms(e))||t&&x.ManagedMediaSource&&x.ManagedMediaSource.isTypeSupported&&x.ManagedMediaSource.isTypeSupported(Ms(e))||!1},ko=function(e){return e===void 0&&(e=""),e.toLowerCase().split(",").every(function(t){t=t.trim();for(var s=0;s<Dc.length;s++){var r=Dc[s];if(Ki["muxer"+r].test(t))return!0}return!1})},Ic="mp4a.40.2",F_="avc1.4d400d",U_=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,$_=/^application\/dash\+xml/i,uh=function(e){return U_.test(e)?"hls":$_.test(e)?"dash":e==="application/vnd.videojs.vhs+json"?"vhs-json":null},q_=function(e){return e.toString(2).length},j_=function(e){return Math.ceil(q_(e)/8)},ch=function(e){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},H_=function(e){return ch(e)},te=function(e){return e instanceof Uint8Array?e:(!Array.isArray(e)&&!H_(e)&&!(e instanceof ArrayBuffer)&&(typeof e!="number"||typeof e=="number"&&e!==e?e=0:e=[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},We=x.BigInt||Number,Xo=[We("0x1"),We("0x100"),We("0x10000"),We("0x1000000"),We("0x100000000"),We("0x10000000000"),We("0x1000000000000"),We("0x100000000000000"),We("0x10000000000000000")];(function(){var i=new Uint16Array([65484]),e=new Uint8Array(i.buffer,i.byteOffset,i.byteLength);return e[0]===255?"big":e[0]===204?"little":"unknown"})();var V_=function(e,t){var s=t===void 0?{}:t,r=s.signed,n=r===void 0?!1:r,a=s.le,o=a===void 0?!1:a;e=te(e);var u=o?"reduce":"reduceRight",h=e[u]?e[u]:Array.prototype[u],m=h.call(e,function(T,E,A){var y=o?A:Math.abs(A+1-e.length);return T+We(E)*Xo[y]},We(0));if(n){var _=Xo[e.length]/We(2)-We(1);m=We(m),m>_&&(m-=_,m-=_,m-=We(2))}return Number(m)},z_=function(e,t){var s={},r=s.le,n=r===void 0?!1:r;(typeof e!="bigint"&&typeof e!="number"||typeof e=="number"&&e!==e)&&(e=0),e=We(e);for(var a=j_(e),o=new Uint8Array(new ArrayBuffer(a)),u=0;u<a;u++){var h=n?u:Math.abs(u+1-o.length);o[h]=Number(e/Xo[u]&We(255)),e<0&&(o[h]=Math.abs(~o[h]),o[h]-=u===0?1:2)}return o},dh=function(e,t){if(typeof e!="string"&&e&&typeof e.toString=="function"&&(e=e.toString()),typeof e!="string")return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var s=new Uint8Array(e.length),r=0;r<e.length;r++)s[r]=e.charCodeAt(r);return s},G_=function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];if(t=t.filter(function(o){return o&&(o.byteLength||o.length)&&typeof o!="string"}),t.length<=1)return te(t[0]);var r=t.reduce(function(o,u,h){return o+(u.byteLength||u.length)},0),n=new Uint8Array(r),a=0;return t.forEach(function(o){o=te(o),n.set(o,a),a+=o.byteLength}),n},we=function(e,t,s){var r=s===void 0?{}:s,n=r.offset,a=n===void 0?0:n,o=r.mask,u=o===void 0?[]:o;e=te(e),t=te(t);var h=t.every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&h.call(t,function(m,_){var T=u[_]?u[_]&e[a+_]:e[a+_];return m===T})},hh={exports:{}};(function(i,e){(function(t){var s=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,n=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(u,h,m){if(m=m||{},u=u.trim(),h=h.trim(),!h){if(!m.alwaysNormalize)return u;var _=o.parseURL(u);if(!_)throw new Error("Error trying to parse base URL.");return _.path=o.normalizePath(_.path),o.buildURLFromParts(_)}var T=o.parseURL(h);if(!T)throw new Error("Error trying to parse relative URL.");if(T.scheme)return m.alwaysNormalize?(T.path=o.normalizePath(T.path),o.buildURLFromParts(T)):h;var E=o.parseURL(u);if(!E)throw new Error("Error trying to parse base URL.");if(!E.netLoc&&E.path&&E.path[0]!=="/"){var A=r.exec(E.path);E.netLoc=A[1],E.path=A[2]}E.netLoc&&!E.path&&(E.path="/");var y={scheme:E.scheme,netLoc:T.netLoc,path:null,params:T.params,query:T.query,fragment:T.fragment};if(!T.netLoc&&(y.netLoc=E.netLoc,T.path[0]!=="/"))if(!T.path)y.path=E.path,T.params||(y.params=E.params,T.query||(y.query=E.query));else{var w=E.path,D=w.substring(0,w.lastIndexOf("/")+1)+T.path;y.path=o.normalizePath(D)}return y.path===null&&(y.path=m.alwaysNormalize?o.normalizePath(T.path):T.path),o.buildURLFromParts(y)},parseURL:function(u){var h=s.exec(u);return h?{scheme:h[1]||"",netLoc:h[2]||"",path:h[3]||"",params:h[4]||"",query:h[5]||"",fragment:h[6]||""}:null},normalizePath:function(u){for(u=u.split("").reverse().join("").replace(n,"");u.length!==(u=u.replace(a,"")).length;);return u.split("").reverse().join("")},buildURLFromParts:function(u){return u.scheme+u.netLoc+u.path+u.params+u.query+u.fragment}};i.exports=o})()})(hh);var W_=hh.exports;const kc=Ks(W_);var Pc="http://example.com",Dl=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=x.location&&x.location.href||"");var s=typeof x.URL=="function",r=/^\/\//.test(e),n=!x.location&&!/\/\//i.test(e);
19if(s?e=new x.URL(e,x.location||Pc):/\/\//i.test(e)||(e=kc.buildAbsoluteURL(x.location&&x.location.href||"",e)),s){var a=new URL(t,e);return n?a.href.slice(Pc.length):r?a.href.slice(a.protocol.length):a.href}return kc.buildAbsoluteURL(e,t)},X_=function(e,t,s){t.forEach(function(r){for(var n in e.mediaGroups[r])for(var a in e.mediaGroups[r][n]){var o=e.mediaGroups[r][n][a];s(o,r,n,a)}})},K_=function(e){return x.atob?x.atob(e):Buffer.from(e,"base64").toString("binary")};function Y_(i){for(var e=K_(i),t=new Uint8Array(e.length),s=0;s<e.length;s++)t[s]=e.charCodeAt(s);return t}var ki={},gi={};function Q_(i,e,t){if(t===void 0&&(t=Array.prototype),i&&typeof t.find=="function")return t.find.call(i,e);for(var s=0;s<i.length;s++)if(Object.prototype.hasOwnProperty.call(i,s)){var r=i[s];if(e.call(void 0,r,s,i))return r}}function Il(i,e){return e===void 0&&(e=Object),e&&typeof e.freeze=="function"?e.freeze(i):i}function J_(i,e){if(i===null||typeof i!="object")throw new TypeError("target is not an object");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t]);return i}var fh=Il({HTML:"text/html",isHTML:function(i){return i===fh.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),ph=Il({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(i){return i===ph.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});gi.assign=J_;gi.find=Q_;gi.freeze=Il;gi.MIME_TYPE=fh;gi.NAMESPACE=ph;var mh=gi,ei=mh.find,Gr=mh.NAMESPACE;function Z_(i){return i!==""}function ey(i){return i?i.split(/[\t\n\f\r ]+/).filter(Z_):[]}function ty(i,e){return i.hasOwnProperty(e)||(i[e]=!0),i}function Lc(i){if(!i)return[];var e=ey(i);return Object.keys(e.reduce(ty,{}))}function iy(i){return function(e){return i&&i.indexOf(e)!==-1}}function Zr(i,e){for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t])}function yt(i,e){var t=i.prototype;if(!(t instanceof e)){let s=function(){};s.prototype=e.prototype,s=new s,Zr(t,s),i.prototype=t=s}t.constructor!=i&&(typeof i!="function"&&console.error("unknown Class:"+i),t.constructor=i)}var vt={},Ft=vt.ELEMENT_NODE=1,Bs=vt.ATTRIBUTE_NODE=2,Jn=vt.TEXT_NODE=3,gh=vt.CDATA_SECTION_NODE=4,_h=vt.ENTITY_REFERENCE_NODE=5,sy=vt.ENTITY_NODE=6,yh=vt.PROCESSING_INSTRUCTION_NODE=7,vh=vt.COMMENT_NODE=8,Th=vt.DOCUMENT_NODE=9,bh=vt.DOCUMENT_TYPE_NODE=10,fi=vt.DOCUMENT_FRAGMENT_NODE=11,ry=vt.NOTATION_NODE=12,tt={},Ge={};tt.INDEX_SIZE_ERR=(Ge[1]="Index size error",1);tt.DOMSTRING_SIZE_ERR=(Ge[2]="DOMString size error",2);var pt=tt.HIERARCHY_REQUEST_ERR=(Ge[3]="Hierarchy request error",3);tt.WRONG_DOCUMENT_ERR=(Ge[4]="Wrong document",4);tt.INVALID_CHARACTER_ERR=(Ge[5]="Invalid character",5);tt.NO_DATA_ALLOWED_ERR=(Ge[6]="No data allowed",6);tt.NO_MODIFICATION_ALLOWED_ERR=(Ge[7]="No modification allowed",7);var Sh=tt.NOT_FOUND_ERR=(Ge[8]="Not found",8);tt.NOT_SUPPORTED_ERR=(Ge[9]="Not supported",9);var Oc=tt.INUSE_ATTRIBUTE_ERR=(Ge[10]="Attribute in use",10);tt.INVALID_STATE_ERR=(Ge[11]="Invalid state",11);tt.SYNTAX_ERR=(Ge[12]="Syntax error",12);tt.INVALID_MODIFICATION_ERR=(Ge[13]="Invalid modification",13);tt.NAMESPACE_ERR=(Ge[14]="Invalid namespace",14);tt.INVALID_ACCESS_ERR=(Ge[15]="Invalid access",15);function $e(i,e){if(e instanceof Error)var t=e;else t=this,Error.call(this,Ge[i]),this.message=Ge[i],Error.captureStackTrace&&Error.captureStackTrace(this,$e);return t.code=i,e&&(this.message=this.message+": "+e),t}$e.prototype=Error.prototype;Zr(tt,$e);function ci(){}ci.prototype={length:0,item:function(i){return i>=0&&i<this.length?this[i]:null},toString:function(i,e){for(var t=[],s=0;s<this.length;s++)Cs(this[s],t,i,e);return t.join("")},filter:function(i){return Array.prototype.filter.call(this,i)},indexOf:function(i){return Array.prototype.indexOf.call(this,i)}};function Fs(i,e){this._node=i,this._refresh=e,kl(this)}function kl(i){var e=i._node._inc||i._node.ownerDocument._inc;if(i._inc!==e){var t=i._refresh(i._node);if(Rh(i,"length",t.length),!i.$$length||t.length<i.$$length)for(var s=t.length;s in i;s++)Object.prototype.hasOwnProperty.call(i,s)&&delete i[s];Zr(t,i),i._inc=e}}Fs.prototype.item=function(i){return kl(this),this[i]||null};yt(Fs,ci);function Zn(){}function xh(i,e){for(var t=i.length;t--;)if(i[t]===e)return t}function Rc(i,e,t,s){if(s?e[xh(e,s)]=t:e[e.length++]=t,i){t.ownerElement=i;var r=i.ownerDocument;r&&(s&&Ah(r,i,s),ny(r,i,t))}}function Nc(i,e,t){var s=xh(e,t);if(s>=0){for(var r=e.length-1;s<r;)e[s]=e[++s];if(e.length=r,i){var n=i.ownerDocument;n&&(Ah(n,i,t),t.ownerElement=null)}}else throw new $e(Sh,new Error(i.tagName+"@"+t))}Zn.prototype={length:0,item:ci.prototype.item,getNamedItem:function(i){for(var e=this.length;e--;){var t=this[e];
vendor: 4,181 bytes, line 19
19if(t.nodeName==i)return t}},setNamedItem:function(i){var e=i.ownerElement;if(e&&e!=this._ownerElement)throw new $e(Oc);var t=this.getNamedItem(i.nodeName);return Rc(this._ownerElement,this,i,t),t},setNamedItemNS:function(i){var e=i.ownerElement,t;if(e&&e!=this._ownerElement)throw new $e(Oc);return t=this.getNamedItemNS(i.namespaceURI,i.localName),Rc(this._ownerElement,this,i,t),t},removeNamedItem:function(i){var e=this.getNamedItem(i);return Nc(this._ownerElement,this,e),e},removeNamedItemNS:function(i,e){var t=this.getNamedItemNS(i,e);return Nc(this._ownerElement,this,t),t},getNamedItemNS:function(i,e){for(var t=this.length;t--;){var s=this[t];if(s.localName==e&&s.namespaceURI==i)return s}return null}};function Eh(){}Eh.prototype={hasFeature:function(i,e){return!0},createDocument:function(i,e,t){var s=new en;if(s.implementation=this,s.childNodes=new ci,s.doctype=t||null,t&&s.appendChild(t),e){var r=s.createElementNS(i,e);s.appendChild(r)}return s},createDocumentType:function(i,e,t){var s=new Aa;return s.name=i,s.nodeName=i,s.publicId=e||"",s.systemId=t||"",s}};function Se(){}Se.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(i,e){return ea(this,i,e)},replaceChild:function(i,e){ea(this,i,e,Dh),e&&this.removeChild(e)},removeChild:function(i){return wh(this,i)},appendChild:function(i){return this.insertBefore(i,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(i){return Ko(this.ownerDocument||this,this,i)},normalize:function(){for(var i=this.firstChild;i;){var e=i.nextSibling;e&&e.nodeType==Jn&&i.nodeType==Jn?(this.removeChild(e),i.appendData(e.data)):(i.normalize(),i=e)}},isSupported:function(i,e){return this.ownerDocument.implementation.hasFeature(i,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(i){for(var e=this;e;){var t=e._nsMap;if(t){for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&t[s]===i)return s}e=e.nodeType==Bs?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(i){for(var e=this;e;){var t=e._nsMap;if(t&&Object.prototype.hasOwnProperty.call(t,i))return t[i];e=e.nodeType==Bs?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(i){var e=this.lookupPrefix(i);return e==null}};function Ch(i){return i=="<"&&"<"||i==">"&&">"||i=="&"&&"&"||i=='"'&&"""||"&#"+i.charCodeAt()+";"}Zr(vt,Se);Zr(vt,Se.prototype);function Wr(i,e){if(e(i))return!0;if(i=i.firstChild)do if(Wr(i,e))return!0;while(i=i.nextSibling)}function en(){this.ownerDocument=this}function ny(i,e,t){i&&i._inc++;var s=t.namespaceURI;s===Gr.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}function Ah(i,e,t,s){i&&i._inc++;var r=t.namespaceURI;r===Gr.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}function Pl(i,e,t){if(i&&i._inc){i._inc++;var s=e.childNodes;if(t)s[s.length++]=t;else{for(var r=e.firstChild,n=0;r;)s[n++]=r,r=r.nextSibling;s.length=n,delete s[s.length]}}}function wh(i,e){var t=e.previousSibling,s=e.nextSibling;return t?t.nextSibling=s:i.firstChild=s,s?s.previousSibling=t:i.lastChild=t,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,Pl(i.ownerDocument,i),e}function ay(i){return i&&(i.nodeType===Se.DOCUMENT_NODE||i.nodeType===Se.DOCUMENT_FRAGMENT_NODE||i.nodeType===Se.ELEMENT_NODE)}function oy(i){return i&&(ti(i)||Ll(i)||pi(i)||i.nodeType===Se.DOCUMENT_FRAGMENT_NODE||i.nodeType===Se.COMMENT_NODE||i.nodeType===Se.PROCESSING_INSTRUCTION_NODE)}function pi(i){return i&&i.nodeType===Se.DOCUMENT_TYPE_NODE}function ti(i){return i&&i.nodeType===Se.ELEMENT_NODE}function Ll(i){return i&&i.nodeType===Se.TEXT_NODE}function Mc(i,e){var t=i.childNodes||[];if(ei(t,ti)||pi(e))return!1;var s=ei(t,pi);return!(e&&s&&t.indexOf(s)>t.indexOf(e))}function Bc(i,e){var t=i.childNodes||[];function s(n){return ti(n)&&n!==e}if(ei(t,s))return!1;var r=ei(t,pi);return!(e&&r&&t.indexOf(r)>t.indexOf(e))}function ly(i,e,t){if(!ay(i))throw new $e(pt,"Unexpected parent node type "+i.nodeType);if(t&&t.parentNode!==i)throw new $e(Sh,"child not in parent");
vendor: 7,452 bytes, line 19
19if(!oy(e)||pi(e)&&i.nodeType!==Se.DOCUMENT_NODE)throw new $e(pt,"Unexpected node type "+e.nodeType+" for parent node type "+i.nodeType)}function uy(i,e,t){var s=i.childNodes||[],r=e.childNodes||[];if(e.nodeType===Se.DOCUMENT_FRAGMENT_NODE){var n=r.filter(ti);if(n.length>1||ei(r,Ll))throw new $e(pt,"More than one element or text in fragment");if(n.length===1&&!Mc(i,t))throw new $e(pt,"Element in fragment can not be inserted before doctype")}if(ti(e)&&!Mc(i,t))throw new $e(pt,"Only one element can be added and only after doctype");if(pi(e)){if(ei(s,pi))throw new $e(pt,"Only one doctype is allowed");var a=ei(s,ti);if(t&&s.indexOf(a)<s.indexOf(t))throw new $e(pt,"Doctype can only be inserted before an element");if(!t&&a)throw new $e(pt,"Doctype can not be appended since element is present")}}function Dh(i,e,t){var s=i.childNodes||[],r=e.childNodes||[];if(e.nodeType===Se.DOCUMENT_FRAGMENT_NODE){var n=r.filter(ti);if(n.length>1||ei(r,Ll))throw new $e(pt,"More than one element or text in fragment");if(n.length===1&&!Bc(i,t))throw new $e(pt,"Element in fragment can not be inserted before doctype")}if(ti(e)&&!Bc(i,t))throw new $e(pt,"Only one element can be added and only after doctype");if(pi(e)){if(ei(s,function(u){return pi(u)&&u!==t}))throw new $e(pt,"Only one doctype is allowed");var a=ei(s,ti);if(t&&s.indexOf(a)<s.indexOf(t))throw new $e(pt,"Doctype can only be inserted before an element")}}function ea(i,e,t,s){ly(i,e,t),i.nodeType===Se.DOCUMENT_NODE&&(s||uy)(i,e,t);var r=e.parentNode;if(r&&r.removeChild(e),e.nodeType===fi){var n=e.firstChild;if(n==null)return e;var a=e.lastChild}else n=a=e;var o=t?t.previousSibling:i.lastChild;n.previousSibling=o,a.nextSibling=t,o?o.nextSibling=n:i.firstChild=n,t==null?i.lastChild=a:t.previousSibling=a;do n.parentNode=i;while(n!==a&&(n=n.nextSibling));return Pl(i.ownerDocument||i,i),e.nodeType==fi&&(e.firstChild=e.lastChild=null),e}function cy(i,e){return e.parentNode&&e.parentNode.removeChild(e),e.parentNode=i,e.previousSibling=i.lastChild,e.nextSibling=null,e.previousSibling?e.previousSibling.nextSibling=e:i.firstChild=e,i.lastChild=e,Pl(i.ownerDocument,i,e),e}en.prototype={nodeName:"#document",nodeType:Th,doctype:null,documentElement:null,_inc:1,insertBefore:function(i,e){if(i.nodeType==fi){for(var t=i.firstChild;t;){var s=t.nextSibling;this.insertBefore(t,e),t=s}return i}return ea(this,i,e),i.ownerDocument=this,this.documentElement===null&&i.nodeType===Ft&&(this.documentElement=i),i},removeChild:function(i){return this.documentElement==i&&(this.documentElement=null),wh(this,i)},replaceChild:function(i,e){ea(this,i,e,Dh),i.ownerDocument=this,e&&this.removeChild(e),ti(i)&&(this.documentElement=i)},importNode:function(i,e){return Oh(this,i,e)},getElementById:function(i){var e=null;return Wr(this.documentElement,function(t){if(t.nodeType==Ft&&t.getAttribute("id")==i)return e=t,!0}),e},getElementsByClassName:function(i){var e=Lc(i);return new Fs(this,function(t){var s=[];return e.length>0&&Wr(t.documentElement,function(r){if(r!==t&&r.nodeType===Ft){var n=r.getAttribute("class");if(n){var a=i===n;if(!a){var o=Lc(n);a=e.every(iy(o))}a&&s.push(r)}}}),s})},createElement:function(i){var e=new es;e.ownerDocument=this,e.nodeName=i,e.tagName=i,e.localName=i,e.childNodes=new ci;var t=e.attributes=new Zn;return t._ownerElement=e,e},createDocumentFragment:function(){var i=new wa;return i.ownerDocument=this,i.childNodes=new ci,i},createTextNode:function(i){var e=new Ol;return e.ownerDocument=this,e.appendData(i),e},createComment:function(i){var e=new Rl;return e.ownerDocument=this,e.appendData(i),e},createCDATASection:function(i){var e=new Nl;return e.ownerDocument=this,e.appendData(i),e},createProcessingInstruction:function(i,e){var t=new Bl;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=i,t.nodeValue=t.data=e,t},createAttribute:function(i){var e=new ta;return e.ownerDocument=this,e.name=i,e.nodeName=i,e.localName=i,e.specified=!0,e},createEntityReference:function(i){var e=new Ml;return e.ownerDocument=this,e.nodeName=i,e},createElementNS:function(i,e){var t=new es,s=e.split(":"),r=t.attributes=new Zn;return t.childNodes=new ci,t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.namespaceURI=i,s.length==2?(t.prefix=s[0],t.localName=s[1]):t.localName=e,r._ownerElement=t,t},createAttributeNS:function(i,e){var t=new ta,s=e.split(":");return t.ownerDocument=this,t.nodeName=e,t.name=e,t.namespaceURI=i,t.specified=!0,s.length==2?(t.prefix=s[0],t.localName=s[1]):t.localName=e,t}};yt(en,Se);function es(){this._nsMap={}}es.prototype={nodeType:Ft,hasAttribute:function(i){return this.getAttributeNode(i)!=null},getAttribute:function(i){var e=this.getAttributeNode(i);return e&&e.value||""},getAttributeNode:function(i){return this.attributes.getNamedItem(i)},setAttribute:function(i,e){var t=this.ownerDocument.createAttribute(i);t.value=t.nodeValue=""+e,this.setAttributeNode(t)},removeAttribute:function(i){var e=this.getAttributeNode(i);e&&this.removeAttributeNode(e)},appendChild:function(i){return i.nodeType===fi?this.insertBefore(i,null):cy(this,i)},setAttributeNode:function(i){return this.attributes.setNamedItem(i)},setAttributeNodeNS:function(i){return this.attributes.setNamedItemNS(i)},removeAttributeNode:function(i){return this.attributes.removeNamedItem(i.nodeName)},removeAttributeNS:function(i,e){var t=this.getAttributeNodeNS(i,e);t&&this.removeAttributeNode(t)},hasAttributeNS:function(i,e){return this.getAttributeNodeNS(i,e)!=null},getAttributeNS:function(i,e){var t=this.getAttributeNodeNS(i,e);return t&&t.value||""},setAttributeNS:function(i,e,t){var s=this.ownerDocument.createAttributeNS(i,e);s.value=s.nodeValue=""+t,this.setAttributeNode(s)},getAttributeNodeNS:function(i,e){return this.attributes.getNamedItemNS(i,e)},getElementsByTagName:function(i){return new Fs(this,function(e){var t=[];return Wr(e,function(s){s!==e&&s.nodeType==Ft&&(i==="*"||s.tagName==i)&&t.push(s)}),t})},getElementsByTagNameNS:function(i,e){return new Fs(this,function(t){var s=[];return Wr(t,function(r){r!==t&&r.nodeType===Ft&&(i==="*"||r.namespaceURI===i)&&(e==="*"||r.localName==e)&&s.push(r)}),s})}};en.prototype.getElementsByTagName=es.prototype.getElementsByTagName;en.prototype.getElementsByTagNameNS=es.prototype.getElementsByTagNameNS;yt(es,Se);function ta(){}ta.prototype.nodeType=Bs;yt(ta,Se);function tn(){}tn.prototype={data:"",substringData:function(i,e){return this.data.substring(i,i+e)},appendData:function(i){i=this.data+i,this.nodeValue=this.data=i,this.length=i.length},insertData:function(i,e){this.replaceData(i,0,e)},appendChild:function(i){throw new Error(Ge[pt])},deleteData:function(i,e){this.replaceData(i,e,"")},replaceData:function(i,e,t){var s=this.data.substring(0,i),r=this.data.substring(i+e);t=s+t+r,this.nodeValue=this.data=t,this.length=t.length}};yt(tn,Se);function Ol(){}Ol.prototype={nodeName:"#text",nodeType:Jn,splitText:function(i){var e=this.data,t=e.substring(i);e=e.substring(0,i),this.data=this.nodeValue=e,this.length=e.length;var s=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(s,this.nextSibling),s}};yt(Ol,tn);function Rl(){}Rl.prototype={nodeName:"#comment",nodeType:vh};yt(Rl,tn);function Nl(){}Nl.prototype={nodeName:"#cdata-section",nodeType:gh};yt(Nl,tn);function Aa(){}Aa.prototype.nodeType=bh;yt(Aa,Se);function Ih(){}Ih.prototype.nodeType=ry;yt(Ih,Se);function kh(){}kh.prototype.nodeType=sy;yt(kh,Se);function Ml(){}Ml.prototype.nodeType=_h;
vendor: 4,211 bytes, line 19
19yt(Ml,Se);function wa(){}wa.prototype.nodeName="#document-fragment";wa.prototype.nodeType=fi;yt(wa,Se);function Bl(){}Bl.prototype.nodeType=yh;yt(Bl,Se);function Ph(){}Ph.prototype.serializeToString=function(i,e,t){return Lh.call(i,e,t)};Se.prototype.toString=Lh;function Lh(i,e){var t=[],s=this.nodeType==9&&this.documentElement||this,r=s.prefix,n=s.namespaceURI;if(n&&r==null){var r=s.lookupPrefix(n);if(r==null)var a=[{namespace:n,prefix:null}]}return Cs(this,t,i,e,a),t.join("")}function Fc(i,e,t){var s=i.prefix||"",r=i.namespaceURI;if(!r||s==="xml"&&r===Gr.XML||r===Gr.XMLNS)return!1;for(var n=t.length;n--;){var a=t[n];if(a.prefix===s)return a.namespace!==r}return!0}function Po(i,e,t){i.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,Ch),'"')}function Cs(i,e,t,s,r){if(r||(r=[]),s)if(i=s(i),i){if(typeof i=="string"){e.push(i);return}}else return;switch(i.nodeType){case Ft:var n=i.attributes,a=n.length,D=i.firstChild,o=i.tagName;t=Gr.isHTML(i.namespaceURI)||t;var u=o;if(!t&&!i.prefix&&i.namespaceURI){for(var h,m=0;m<n.length;m++)if(n.item(m).name==="xmlns"){h=n.item(m).value;break}if(!h)for(var _=r.length-1;_>=0;_--){var T=r[_];if(T.prefix===""&&T.namespace===i.namespaceURI){h=T.namespace;break}}if(h!==i.namespaceURI)for(var _=r.length-1;_>=0;_--){var T=r[_];if(T.namespace===i.namespaceURI){T.prefix&&(u=T.prefix+":"+o);break}}}e.push("<",u);for(var E=0;E<a;E++){var A=n.item(E);A.prefix=="xmlns"?r.push({prefix:A.localName,namespace:A.value}):A.nodeName=="xmlns"&&r.push({prefix:"",namespace:A.value})}for(var E=0;E<a;E++){var A=n.item(E);if(Fc(A,t,r)){var y=A.prefix||"",w=A.namespaceURI;Po(e,y?"xmlns:"+y:"xmlns",w),r.push({prefix:y,namespace:w})}Cs(A,e,t,s,r)}if(o===u&&Fc(i,t,r)){var y=i.prefix||"",w=i.namespaceURI;Po(e,y?"xmlns:"+y:"xmlns",w),r.push({prefix:y,namespace:w})}if(D||t&&!/^(?:meta|link|img|br|hr|input)$/i.test(o)){if(e.push(">"),t&&/^script$/i.test(o))for(;D;)D.data?e.push(D.data):Cs(D,e,t,s,r.slice()),D=D.nextSibling;else for(;D;)Cs(D,e,t,s,r.slice()),D=D.nextSibling;e.push("</",u,">")}else e.push("/>");return;case Th:case fi:for(var D=i.firstChild;D;)Cs(D,e,t,s,r.slice()),D=D.nextSibling;return;case Bs:return Po(e,i.name,i.value);case Jn:return e.push(i.data.replace(/[<&>]/g,Ch));case gh:return e.push("<![CDATA[",i.data,"]]>");case vh:return e.push("<!--",i.data,"-->");case bh:var N=i.publicId,O=i.systemId;if(e.push("<!DOCTYPE ",i.name),N)e.push(" PUBLIC ",N),O&&O!="."&&e.push(" ",O),e.push(">");else if(O&&O!=".")e.push(" SYSTEM ",O,">");else{var B=i.internalSubset;B&&e.push(" [",B,"]"),e.push(">")}return;case yh:return e.push("<?",i.target," ",i.data,"?>");case _h:return e.push("&",i.nodeName,";");default:e.push("??",i.nodeName)}}function Oh(i,e,t){var s;switch(e.nodeType){case Ft:s=e.cloneNode(!1),s.ownerDocument=i;case fi:break;case Bs:t=!0;break}if(s||(s=e.cloneNode(!1)),s.ownerDocument=i,s.parentNode=null,t)for(var r=e.firstChild;r;)s.appendChild(Oh(i,r,t)),r=r.nextSibling;return s}function Ko(i,e,t){var s=new e.constructor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=e[r];typeof n!="object"&&n!=s[r]&&(s[r]=n)}switch(e.childNodes&&(s.childNodes=new ci),s.ownerDocument=i,s.nodeType){case Ft:var a=e.attributes,o=s.attributes=new Zn,u=a.length;o._ownerElement=s;for(var h=0;h<u;h++)s.setAttributeNode(Ko(i,a.item(h),!0));break;case Bs:t=!0}if(t)for(var m=e.firstChild;m;)s.appendChild(Ko(i,m,t)),m=m.nextSibling;return s}function Rh(i,e,t){i[e]=t}try{if(Object.defineProperty){let i=function(e){switch(e.nodeType){case Ft:case fi:var t=[];for(e=e.firstChild;e;)e.nodeType!==7&&e.nodeType!==8&&t.push(i(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}};Object.defineProperty(Fs.prototype,"length",{get:function(){return kl(this),this.$$length}}),Object.defineProperty(Se.prototype,"textContent",{get:function(){return i(this)},set:function(e){switch(this.nodeType){case Ft:case fi:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),Rh=function(e,t,s){e["$$"+t]=s}}}catch{}ki.DocumentType=Aa;ki.DOMException=$e;ki.DOMImplementation=Eh;ki.Element=es;ki.Node=Se;ki.NodeList=ci;
19ki.XMLSerializer=Ph;var Da={},Nh={};(function(i){var e=gi.freeze;i.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),i.HTML_ENTITIES=e
vendor: 14,815 bytes, line 19
19({Aacute:"Ã",aacute:"á",Abreve:"Ä",abreve:"Ä",ac:"â¾",acd:"â¿",acE:"â¾Ì³",Acirc:"Ã",acirc:"â",acute:"´",Acy:"Ð",acy:"а",AElig:"Ã",aelig:"æ",af:"â¡",Afr:"ð",afr:"ð",Agrave:"Ã",agrave:"à ",alefsym:"âµ",aleph:"âµ",Alpha:"Î",alpha:"α",Amacr:"Ä",amacr:"Ä",amalg:"⨿",AMP:"&",amp:"&",And:"â©",and:"â§",andand:"â©",andd:"â©",andslope:"â©",andv:"â©",ang:"â ",ange:"⦤",angle:"â ",angmsd:"â¡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"â¦",angmsdag:"⦮",angmsdah:"⦯",angrt:"â",angrtvb:"â¾",angrtvbd:"â¦",angsph:"â¢",angst:"Ã
",angzarr:"â¼",Aogon:"Ä",aogon:"Ä
",Aopf:"ð¸",aopf:"ð",ap:"â",apacir:"⩯",apE:"â©°",ape:"â",apid:"â",apos:"'",ApplyFunction:"â¡",approx:"â",approxeq:"â",Aring:"Ã
",aring:"Ã¥",Ascr:"ð",ascr:"ð¶",Assign:"â",ast:"*",asymp:"â",asympeq:"â",Atilde:"Ã",atilde:"ã",Auml:"Ã",auml:"ä",awconint:"â³",awint:"â¨",backcong:"â",backepsilon:"϶",backprime:"âµ",backsim:"â½",backsimeq:"â",Backslash:"â",Barv:"â«§",barvee:"â½",Barwed:"â",barwed:"â
",barwedge:"â
",bbrk:"âµ",bbrktbrk:"â¶",bcong:"â",Bcy:"Ð",bcy:"б",bdquo:"â",becaus:"âµ",Because:"âµ",because:"âµ",bemptyv:"⦰",bepsi:"϶",bernou:"â¬",Bernoullis:"â¬",Beta:"Î",beta:"β",beth:"â¶",between:"â¬",Bfr:"ð
",bfr:"ð",bigcap:"â",bigcirc:"â¯",bigcup:"â",bigodot:"â¨",bigoplus:"â¨",bigotimes:"â¨",bigsqcup:"â¨",bigstar:"â
",bigtriangledown:"â½",bigtriangleup:"â³",biguplus:"â¨",bigvee:"â",bigwedge:"â",bkarow:"â¤",blacklozenge:"â§«",blacksquare:"âª",blacktriangle:"â´",blacktriangledown:"â¾",blacktriangleleft:"â",blacktriangleright:"â¸",blank:"â£",blk12:"â",blk14:"â",blk34:"â",block:"â",bne:"=â¥",bnequiv:"â¡â¥",bNot:"â«",bnot:"â",Bopf:"ð¹",bopf:"ð",bot:"â¥",bottom:"â¥",bowtie:"â",boxbox:"â§",boxDL:"â",boxDl:"â",boxdL:"â",boxdl:"â",boxDR:"â",boxDr:"â",boxdR:"â",boxdr:"â",boxH:"â",boxh:"â",boxHD:"â¦",boxHd:"â¤",boxhD:"â¥",boxhd:"â¬",boxHU:"â©",boxHu:"â§",boxhU:"â¨",boxhu:"â´",boxminus:"â",boxplus:"â",boxtimes:"â ",boxUL:"â",boxUl:"â",boxuL:"â",boxul:"â",boxUR:"â",boxUr:"â",boxuR:"â",boxur:"â",boxV:"â",boxv:"â",boxVH:"â¬",boxVh:"â«",boxvH:"âª",boxvh:"â¼",boxVL:"â£",boxVl:"â¢",boxvL:"â¡",boxvl:"â¤",boxVR:"â ",boxVr:"â",boxvR:"â",boxvr:"â",bprime:"âµ",Breve:"Ë",breve:"Ë",brvbar:"¦",Bscr:"â¬",bscr:"ð·",bsemi:"â",bsim:"â½",bsime:"â",bsol:"\\",bsolb:"â§
",bsolhsub:"â",bull:"â¢",bullet:"â¢",bump:"â",bumpE:"⪮",bumpe:"â",Bumpeq:"â",bumpeq:"â",Cacute:"Ä",cacute:"Ä",Cap:"â",cap:"â©",capand:"â©",capbrcup:"â©",capcap:"â©",capcup:"â©",capdot:"â©",CapitalDifferentialD:"â
",caps:"â©ï¸",caret:"â",caron:"Ë",Cayleys:"â",ccaps:"â©",Ccaron:"Ä",ccaron:"Ä",Ccedil:"Ã",ccedil:"ç",Ccirc:"Ä",ccirc:"Ä",Cconint:"â°",ccups:"â©",ccupssm:"â©",Cdot:"Ä",cdot:"Ä",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"â",cfr:"ð ",CHcy:"Ч",chcy:"Ñ",check:"â",checkmark:"â",Chi:"Χ",chi:"Ï",cir:"â",circ:"Ë",circeq:"â",circlearrowleft:"âº",circlearrowright:"â»",circledast:"â",circledcirc:"â",circleddash:"â",CircleDot:"â",circledR:"®",circledS:"â",CircleMinus:"â",CirclePlus:"â",CircleTimes:"â",cirE:"â§",cire:"â",cirfnint:"â¨",cirmid:"⫯",cirscir:"â§",ClockwiseContourIntegral:"â²",CloseCurlyDoubleQuote:"â",CloseCurlyQuote:"â",clubs:"â£",clubsuit:"â£",Colon:"â·",colon:":",Colone:"â©´",colone:"â",coloneq:"â",comma:",",commat:"@",comp:"â",compfn:"â",complement:"â",complexes:"â",cong:"â
",congdot:"â©",Congruent:"â¡",Conint:"â¯",conint:"â®",ContourIntegral:"â®",Copf:"â",copf:"ð",coprod:"â",Coproduct:"â",COPY:"©",copy:"©",copysr:"â",CounterClockwiseContourIntegral:"â³",crarr:"âµ",Cross:"⨯",cross:"â",Cscr:"ð",cscr:"ð¸",csub:"â«",csube:"â«",csup:"â«",csupe:"â«",ctdot:"â¯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"â",cuesc:"â",cularr:"â¶",cularrp:"⤽",Cup:"â",cup:"âª",cupbrcap:"â©",CupCap:"â",cupcap:"â©",cupcup:"â©",cupdot:"â",cupor:"â©
",cups:"âªï¸",curarr:"â·",curarrm:"⤼",curlyeqprec:"â",curlyeqsucc:"â",curlyvee:"â",curlywedge:"â",curren:"¤",curvearrowleft:"â¶",curvearrowright:"â·",cuvee:"â",cuwed:"â",cwconint:"â²",cwint:"â±",cylcty:"â",Dagger:"â¡",dagger:"â ",daleth:"â¸",Darr:"â¡",dArr:"â",darr:"â",dash:"â",Dashv:"⫤",dashv:"â£",dbkarow:"â¤",dblac:"Ë",Dcaron:"Ä",dcaron:"Ä",Dcy:"Ð",dcy:"д",DD:"â
",dd:"â
",ddagger:"â¡",ddarr:"â",DDotrahd:"â¤",ddotseq:"â©·",deg:"°",Del:"â",Delta:"Î",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"ð",dfr:"ð¡",dHar:"⥥",dharl:"â",dharr:"â",DiacriticalAcute:"´",DiacriticalDot:"Ë",DiacriticalDoubleAcute:"Ë",DiacriticalGrave:"`",DiacriticalTilde:"Ë",diam:"â",Diamond:"â",diamond:"â",diamondsuit:"â¦",diams:"â¦",die:"¨",DifferentialD:"â
",digamma:"Ï",disin:"â²",div:"÷",divide:"÷",divideontimes:"â",divonx:"â",DJcy:"Ð",djcy:"Ñ",dlcorn:"â",dlcrop:"â",dollar:"$",Dopf:"ð»",dopf:"ð",Dot:"¨",dot:"Ë",DotDot:"â",doteq:"â",doteqdot:"â",DotEqual:"â",dotminus:"â¸",dotplus:"â",dotsquare:"â¡",doublebarwedge:"â",DoubleContourIntegral:"â¯",DoubleDot:"¨",DoubleDownArrow:"â",DoubleLeftArrow:"â",DoubleLeftRightArrow:"â",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"â¸",DoubleLongLeftRightArrow:"âº",DoubleLongRightArrow:"â¹",DoubleRightArrow:"â",DoubleRightTee:"â¨",DoubleUpArrow:"â",DoubleUpDownArrow:"â",DoubleVerticalBar:"â¥",DownArrow:"â",Downarrow:"â",downarrow:"â",DownArrowBar:"â¤",DownArrowUpArrow:"âµ",DownBreve:"Ì",downdownarrows:"â",downharpoonleft:"â",downharpoonright:"â",DownLeftRightVector:"â¥",DownLeftTeeVector:"â¥",DownLeftVector:"â½",DownLeftVectorBar:"â¥",DownRightTeeVector:"â¥",DownRightVector:"â",DownRightVectorBar:"â¥",DownTee:"â¤",DownTeeArrow:"â§",drbkarow:"â¤",drcorn:"â",drcrop:"â",Dscr:"ð",dscr:"ð¹",DScy:"Ð
",dscy:"Ñ",dsol:"â§¶",Dstrok:"Ä",dstrok:"Ä",dtdot:"â±",dtri:"â¿",dtrif:"â¾",duarr:"âµ",duhar:"⥯",dwangle:"⦦",DZcy:"Ð",dzcy:"Ñ",dzigrarr:"â¿",Eacute:"Ã",eacute:"é",easter:"â©®",Ecaron:"Ä",ecaron:"Ä",ecir:"â",Ecirc:"Ã",ecirc:"ê",ecolon:"â",Ecy:"Ð",ecy:"Ñ",eDDot:"â©·",Edot:"Ä",eDot:"â",edot:"Ä",ee:"â
",efDot:"â",Efr:"ð",efr:"ð¢",eg:"âª",Egrave:"Ã",egrave:"è",egs:"âª",egsdot:"âª",el:"âª",Element:"â",elinters:"â§",ell:"â",els:"âª",elsdot:"âª",Emacr:"Ä",emacr:"Ä",empty:"â
",emptyset:"â
",EmptySmallSquare:"â»",emptyv:"â
",EmptyVerySmallSquare:"â«",emsp:"â",emsp13:"â",emsp14:"â
",ENG:"Å",eng:"Å",ensp:"â",Eogon:"Ä",eogon:"Ä",Eopf:"ð¼",eopf:"ð",epar:"â",eparsl:"â§£",eplus:"⩱",epsi:"ε",Epsilon:"Î",epsilon:"ε",epsiv:"ϵ",eqcirc:"â",eqcolon:"â",eqsim:"â",eqslantgtr:"âª",eqslantless:"âª",Equal:"⩵",equals:"=",EqualTilde:"â",equest:"â",Equilibrium:"â",equiv:"â¡",equivDD:"⩸",eqvparsl:"â§¥",erarr:"⥱",erDot:"â",Escr:"â°",escr:"â¯",esdot:"â",Esim:"⩳",esim:"â",Eta:"Î",eta:"η",ETH:"Ã",eth:"ð",Euml:"Ã",euml:"ë",euro:"â¬",excl:"!",exist:"â",Exists:"â",expectation:"â°",ExponentialE:"â
",exponentiale:"â
",fallingdotseq:"â",Fcy:"Ф",fcy:"Ñ",female:"â",ffilig:"ï¬",fflig:"ï¬",ffllig:"ï¬",Ffr:"ð",ffr:"ð£",filig:"ï¬",FilledSmallSquare:"â¼",FilledVerySmallSquare:"âª",fjlig:"fj",flat:"â",fllig:"ï¬",fltns:"â±",fnof:"Æ",Fopf:"ð½",fopf:"ð",ForAll:"â",forall:"â",fork:"â",forkv:"â«",Fouriertrf:"â±",fpartint:"â¨",frac12:"½",frac13:"â
",frac14:"¼",frac15:"â
",frac16:"â
",frac18:"â
",frac23:"â
",frac25:"â
",frac34:"¾",frac35:"â
",frac38:"â
",frac45:"â
",frac56:"â
",frac58:"â
",frac78:"â
",frasl:"â",frown:"â¢",Fscr:"â±",fscr:"ð»",gacute:"ǵ",Gamma:"Î",gamma:"γ",Gammad:"Ï",gammad:"Ï",gap:"âª",Gbreve:"Ä",gbreve:"Ä",Gcedil:"Ä¢",Gcirc:"Ä",gcirc:"Ä",Gcy:"Ð",gcy:"г",Gdot:"Ä ",gdot:"Ä¡",gE:"â§",ge:"â¥",gEl:"âª",gel:"â",geq:"â¥",geqq:"â§",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"âª",gesdoto:"âª",gesdotol:"âª",gesl:"âï¸",gesles:"âª",Gfr:"ð",gfr:"ð¤",Gg:"â",gg:"â«",ggg:"â",gimel:"â·",GJcy:"Ð",gjcy:"Ñ",gl:"â·",gla:"⪥",glE:"âª",glj:"⪤",gnap:"âª",gnapprox:"âª",gnE:"â©",gne:"âª",gneq:"âª",gneqq:"â©",gnsim:"â§",Gopf:"ð¾",gopf:"ð",grave:"`",GreaterEqual:"â¥",GreaterEqualLess:"â",GreaterFullEqual:"â§",GreaterGreater:"⪢",GreaterLess:"â·",GreaterSlantEqual:"⩾",GreaterTilde:"â³",Gscr:"ð¢",gscr:"â",gsim:"â³",gsime:"âª",gsiml:"âª",Gt:"â«",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"â",gtlPar:"â¦",gtquest:"⩼",gtrapprox:"âª",gtrarr:"⥸",gtrdot:"â",gtreqless:"â",gtreqqless:"âª",gtrless:"â·",gtrsim:"â³",gvertneqq:"â©ï¸",gvnE:"â©ï¸",Hacek:"Ë",hairsp:"â",half:"½",hamilt:"â",HARDcy:"Ъ",hardcy:"Ñ",hArr:"â",harr:"â",harrcir:"â¥",harrw:"â",Hat:"^",hbar:"â",Hcirc:"Ĥ",hcirc:"Ä¥",hearts:"â¥",heartsuit:"â¥",hellip:"â¦",hercon:"â¹",Hfr:"â",hfr:"ð¥",HilbertSpace:"â",hksearow:"⤥",hkswarow:"⤦",hoarr:"â¿",homtht:"â»",hookleftarrow:"â©",hookrightarrow:"âª",Hopf:"â",hopf:"ð",horbar:"â",HorizontalLine:"â",Hscr:"â",hscr:"ð½",hslash:"â",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"â",HumpEqual:"â",hybull:"â",hyphen:"â",Iacute:"Ã",iacute:"Ã",ic:"â£",Icirc:"Ã",icirc:"î",Icy:"Ð",icy:"и",Idot:"İ",IEcy:"Ð",iecy:"е",iexcl:"¡",iff:"â",Ifr:"â",ifr:"ð¦",Igrave:"Ã",igrave:"ì",ii:"â
",iiiint:"â¨",iiint:"â",iinfin:"â§",iiota:"â©",IJlig:"IJ",ijlig:"ij",Im:"â",Imacr:"Ī",imacr:"Ä«",image:"â",ImaginaryI:"â
",imagline:"â",imagpart:"â",imath:"ı",imof:"â·",imped:"Ƶ",Implies:"â",in:"â",incare:"â
",infin:"â",infintie:"â§",inodot:"ı",Int:"â¬",int:"â«",intcal:"âº",integers:"â¤",Integral:"â«",intercal:"âº",Intersection:"â",intlarhk:"â¨",intprod:"⨼",InvisibleComma:"â£",InvisibleTimes:"â¢",IOcy:"Ð",iocy:"Ñ",Iogon:"Ä®",iogon:"į",Iopf:"ð",iopf:"ð",Iota:"Î",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"â",iscr:"ð¾",isin:"â",isindot:"âµ",isinE:"â¹",isins:"â´",isinsv:"â³",isinv:"â",it:"â¢",Itilde:"Ĩ",itilde:"Ä©",Iukcy:"Ð",iukcy:"Ñ",Iuml:"Ã",iuml:"ï",Jcirc:"Ä´",jcirc:"ĵ",Jcy:"Ð",jcy:"й",Jfr:"ð",jfr:"ð§",jmath:"È·",Jopf:"ð",jopf:"ð",Jscr:"ð¥",jscr:"ð¿",Jsercy:"Ð",jsercy:"Ñ",Jukcy:"Ð",jukcy:"Ñ",Kappa:"Î",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"Ä·",Kcy:"Ð",kcy:"к",Kfr:"ð",kfr:"ð¨",kgreen:"ĸ",KHcy:"Ð¥",khcy:"Ñ
",KJcy:"Ð",kjcy:"Ñ",Kopf:"ð",kopf:"ð",Kscr:"ð¦",kscr:"ð",lAarr:"â",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"â",Lambda:"Î",lambda:"λ",Lang:"âª",lang:"â¨",langd:"â¦",langle:"â¨",lap:"âª
",Laplacetrf:"â",laquo:"«",Larr:"â",lArr:"â",larr:"â",larrb:"â¤",larrbfs:"â¤",larrfs:"â¤",larrhk:"â©",larrlp:"â«",larrpl:"⤹",larrsim:"⥳",larrtl:"â¢",lat:"⪫",lAtail:"â¤",latail:"â¤",late:"âª",lates:"âªï¸",lBarr:"â¤",lbarr:"â¤",lbbrk:"â²",lbrace:"{",lbrack:"[",lbrke:"â¦",lbrksld:"â¦",lbrkslu:"â¦",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ä»",lcedil:"ļ",lceil:"â",lcub:"{",Lcy:"Ð",lcy:"л",ldca:"⤶",ldquo:"â",ldquor:"â",ldrdhar:"⥧",ldrushar:"â¥",ldsh:"â²",lE:"â¦",le:"â¤",LeftAngleBracket:"â¨",LeftArrow:"â",Leftarrow:"â",leftarrow:"â",LeftArrowBar:"â¤",LeftArrowRightArrow:"â",leftarrowtail:"â¢",LeftCeiling:"â",LeftDoubleBracket:"â¦",LeftDownTeeVector:"⥡",LeftDownVector:"â",LeftDownVectorBar:"â¥",LeftFloor:"â",leftharpoondown:"â½",leftharpoonup:"â¼",leftleftarrows:"â",LeftRightArrow:"â",Leftrightarrow:"â",leftrightarrow:"â",leftrightarrows:"â",leftrightharpoons:"â",leftrightsquigarrow:"â",LeftRightVector:"â¥",LeftTee:"â£",LeftTeeArrow:"â¤",LeftTeeVector:"â¥",leftthreetimes:"â",LeftTriangle:"â²",LeftTriangleBar:"â§",LeftTriangleEqual:"â´",LeftUpDownVector:"â¥",LeftUpTeeVector:"⥠",LeftUpVector:"â¿",LeftUpVectorBar:"â¥",LeftVector:"â¼",LeftVectorBar:"â¥",lEg:"âª",leg:"â",leq:"â¤",leqq:"â¦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"â©¿",lesdoto:"âª",lesdotor:"âª",lesg:"âï¸",lesges:"âª",lessapprox:"âª
",lessdot:"â",lesseqgtr:"â",lesseqqgtr:"âª",LessEqualGreater:"â",LessFullEqual:"â¦",LessGreater:"â¶",lessgtr:"â¶",LessLess:"⪡",lesssim:"â²",LessSlantEqual:"⩽",LessTilde:"â²",lfisht:"⥼",lfloor:"â",Lfr:"ð",lfr:"ð©",lg:"â¶",lgE:"âª",lHar:"⥢",lhard:"â½",lharu:"â¼",lharul:"⥪",lhblk:"â",LJcy:"Ð",ljcy:"Ñ",Ll:"â",ll:"âª",llarr:"â",llcorner:"â",Lleftarrow:"â",llhard:"⥫",lltri:"âº",Lmidot:"Ä¿",lmidot:"Å",lmoust:"â°",lmoustache:"â°",lnap:"âª",lnapprox:"âª",lnE:"â¨",lne:"âª",lneq:"âª",lneqq:"â¨",lnsim:"â¦",loang:"â¬",loarr:"â½",lobrk:"â¦",LongLeftArrow:"âµ",Longleftarrow:"â¸",longleftarrow:"âµ",LongLeftRightArrow:"â·",Longleftrightarrow:"âº",longleftrightarrow:"â·",longmapsto:"â¼",LongRightArrow:"â¶",Longrightarrow:"â¹",longrightarrow:"â¶",looparrowleft:"â«",looparrowright:"â¬",lopar:"â¦
",Lopf:"ð",lopf:"ð",loplus:"â¨",lotimes:"⨴",lowast:"â",lowbar:"_",LowerLeftArrow:"â",LowerRightArrow:"â",loz:"â",lozenge:"â",lozf:"â§«",lpar:"(",lparlt:"â¦",lrarr:"â",lrcorner:"â",lrhar:"â",lrhard:"â¥",lrm:"â",lrtri:"â¿",lsaquo:"â¹",Lscr:"â",lscr:"ð",Lsh:"â°",lsh:"â°",lsim:"â²",lsime:"âª",lsimg:"âª",lsqb:"[",lsquo:"â",lsquor:"â",Lstrok:"Å",lstrok:"Å",Lt:"âª",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"â",lthree:"â",ltimes:"â",ltlarr:"⥶",ltquest:"â©»",ltri:"â",ltrie:"â´",ltrif:"â",ltrPar:"â¦",lurdshar:"â¥",luruhar:"⥦",lvertneqq:"â¨ï¸",lvnE:"â¨ï¸",macr:"¯",male:"â",malt:"â ",maltese:"â ",Map:"â¤
",map:"â¦",mapsto:"â¦",mapstodown:"â§",mapstoleft:"â¤",mapstoup:"â¥",marker:"â®",mcomma:"⨩",Mcy:"Ð",mcy:"м",mdash:"â",mDDot:"âº",measuredangle:"â¡",MediumSpace:"â",Mellintrf:"â³",Mfr:"ð",mfr:"ðª",mho:"â§",micro:"µ",mid:"â£",midast:"*",midcir:"â«°",middot:"·",minus:"â",minusb:"â",minusd:"â¸",minusdu:"⨪",MinusPlus:"â",mlcp:"â«",mldr:"â¦",mnplus:"â",models:"â§",Mopf:"ð",mopf:"ð",mp:"â",Mscr:"â³",mscr:"ð",mstpos:"â¾",Mu:"Î",mu:"μ",multimap:"â¸",mumap:"â¸",nabla:"â",Nacute:"Å",nacute:"Å",nang:"â â",nap:"â",napE:"⩰̸",napid:"â̸",napos:"Å",napprox:"â",natur:"â®",natural:"â®",naturals:"â",nbsp:" ",nbump:"â̸",nbumpe:"â̸",ncap:"â©",Ncaron:"Å",ncaron:"Å",Ncedil:"Å
",ncedil:"Å",ncong:"â",ncongdot:"â©Ì¸",ncup:"â©",Ncy:"Ð",ncy:"н",ndash:"â",ne:"â ",nearhk:"⤤",neArr:"â",nearr:"â",nearrow:"â",nedot:"â̸",NegativeMediumSpace:"â",NegativeThickSpace:"â",NegativeThinSpace:"â",NegativeVeryThinSpace:"â",nequiv:"â¢",nesear:"⤨",nesim:"â̸",NestedGreaterGreater:"â«",NestedLessLess:"âª",NewLine:
19` 20`
vendor: 9,925 bytes, line 20
20,nexist:"â",nexists:"â",Nfr:"ð",nfr:"ð«",ngE:"â§Ì¸",nge:"â±",ngeq:"â±",ngeqq:"â§Ì¸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"â̸",ngsim:"âµ",nGt:"â«â",ngt:"â¯",ngtr:"â¯",nGtv:"â«Ì¸",nhArr:"â",nharr:"â®",nhpar:"⫲",ni:"â",nis:"â¼",nisd:"âº",niv:"â",NJcy:"Ð",njcy:"Ñ",nlArr:"â",nlarr:"â",nldr:"â¥",nlE:"â¦Ì¸",nle:"â°",nLeftarrow:"â",nleftarrow:"â",nLeftrightarrow:"â",nleftrightarrow:"â®",nleq:"â°",nleqq:"â¦Ì¸",nleqslant:"⩽̸",nles:"⩽̸",nless:"â®",nLl:"â̸",nlsim:"â´",nLt:"âªâ",nlt:"â®",nltri:"âª",nltrie:"â¬",nLtv:"âªÌ¸",nmid:"â¤",NoBreak:"â ",NonBreakingSpace:" ",Nopf:"â",nopf:"ð",Not:"⫬",not:"¬",NotCongruent:"â¢",NotCupCap:"â",NotDoubleVerticalBar:"â¦",NotElement:"â",NotEqual:"â ",NotEqualTilde:"â̸",NotExists:"â",NotGreater:"â¯",NotGreaterEqual:"â±",NotGreaterFullEqual:"â§Ì¸",NotGreaterGreater:"â«Ì¸",NotGreaterLess:"â¹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"âµ",NotHumpDownHump:"â̸",NotHumpEqual:"â̸",notin:"â",notindot:"âµÌ¸",notinE:"â¹Ì¸",notinva:"â",notinvb:"â·",notinvc:"â¶",NotLeftTriangle:"âª",NotLeftTriangleBar:"â§Ì¸",NotLeftTriangleEqual:"â¬",NotLess:"â®",NotLessEqual:"â°",NotLessGreater:"â¸",NotLessLess:"âªÌ¸",NotLessSlantEqual:"⩽̸",NotLessTilde:"â´",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"â",notniva:"â",notnivb:"â¾",notnivc:"â½",NotPrecedes:"â",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"â ",NotReverseElement:"â",NotRightTriangle:"â«",NotRightTriangleBar:"â§Ì¸",NotRightTriangleEqual:"â",NotSquareSubset:"â̸",NotSquareSubsetEqual:"â¢",NotSquareSuperset:"â̸",NotSquareSupersetEqual:"â£",NotSubset:"ââ",NotSubsetEqual:"â",NotSucceeds:"â",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"â¡",NotSucceedsTilde:"â¿Ì¸",NotSuperset:"ââ",NotSupersetEqual:"â",NotTilde:"â",NotTildeEqual:"â",NotTildeFullEqual:"â",NotTildeTilde:"â",NotVerticalBar:"â¤",npar:"â¦",nparallel:"â¦",nparsl:"⫽â¥",npart:"â̸",npolint:"â¨",npr:"â",nprcue:"â ",npre:"⪯̸",nprec:"â",npreceq:"⪯̸",nrArr:"â",nrarr:"â",nrarrc:"⤳̸",nrarrw:"â̸",nRightarrow:"â",nrightarrow:"â",nrtri:"â«",nrtrie:"â",nsc:"â",nsccue:"â¡",nsce:"⪰̸",Nscr:"ð©",nscr:"ð",nshortmid:"â¤",nshortparallel:"â¦",nsim:"â",nsime:"â",nsimeq:"â",nsmid:"â¤",nspar:"â¦",nsqsube:"â¢",nsqsupe:"â£",nsub:"â",nsubE:"â«
̸",nsube:"â",nsubset:"ââ",nsubseteq:"â",nsubseteqq:"â«
̸",nsucc:"â",nsucceq:"⪰̸",nsup:"â
",nsupE:"â«Ì¸",nsupe:"â",nsupset:"ââ",nsupseteq:"â",nsupseteqq:"â«Ì¸",ntgl:"â¹",Ntilde:"Ã",ntilde:"ñ",ntlg:"â¸",ntriangleleft:"âª",ntrianglelefteq:"â¬",ntriangleright:"â«",ntrianglerighteq:"â",Nu:"Î",nu:"ν",num:"#",numero:"â",numsp:"â",nvap:"ââ",nVDash:"â¯",nVdash:"â®",nvDash:"â",nvdash:"â¬",nvge:"â¥â",nvgt:">â",nvHarr:"â¤",nvinfin:"â§",nvlArr:"â¤",nvle:"â¤â",nvlt:"<â",nvltrie:"â´â",nvrArr:"â¤",nvrtrie:"âµâ",nvsim:"â¼â",nwarhk:"⤣",nwArr:"â",nwarr:"â",nwarrow:"â",nwnear:"⤧",Oacute:"Ã",oacute:"ó",oast:"â",ocir:"â",Ocirc:"Ã",ocirc:"ô",Ocy:"Ð",ocy:"о",odash:"â",Odblac:"Å",odblac:"Å",odiv:"⨸",odot:"â",odsold:"⦼",OElig:"Å",oelig:"Å",ofcir:"⦿",Ofr:"ð",ofr:"ð¬",ogon:"Ë",Ograve:"Ã",ograve:"ò",ogt:"â§",ohbar:"⦵",ohm:"Ω",oint:"â®",olarr:"âº",olcir:"⦾",olcross:"⦻",oline:"â¾",olt:"â§",Omacr:"Å",omacr:"Å",Omega:"Ω",omega:"Ï",Omicron:"Î",omicron:"ο",omid:"⦶",ominus:"â",Oopf:"ð",oopf:"ð ",opar:"⦷",OpenCurlyDoubleQuote:"â",OpenCurlyQuote:"â",operp:"⦹",oplus:"â",Or:"â©",or:"â¨",orarr:"â»",ord:"â©",order:"â´",orderof:"â´",ordf:"ª",ordm:"º",origof:"â¶",oror:"â©",orslope:"â©",orv:"â©",oS:"â",Oscr:"ðª",oscr:"â´",Oslash:"Ã",oslash:"ø",osol:"â",Otilde:"Ã",otilde:"õ",Otimes:"⨷",otimes:"â",otimesas:"⨶",Ouml:"Ã",ouml:"ö",ovbar:"â½",OverBar:"â¾",OverBrace:"â",OverBracket:"â´",OverParenthesis:"â",par:"â¥",para:"¶",parallel:"â¥",parsim:"⫳",parsl:"⫽",part:"â",PartialD:"â",Pcy:"Ð",pcy:"п",percnt:"%",period:".",permil:"â°",perp:"â¥",pertenk:"â±",Pfr:"ð",pfr:"ð",Phi:"Φ",phi:"Ï",phiv:"Ï",phmmat:"â³",phone:"â",Pi:"Î ",pi:"Ï",pitchfork:"â",piv:"Ï",planck:"â",planckh:"â",plankv:"â",plus:"+",plusacir:"⨣",plusb:"â",pluscir:"⨢",plusdo:"â",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"â",pointint:"â¨",Popf:"â",popf:"ð¡",pound:"£",Pr:"⪻",pr:"âº",prap:"⪷",prcue:"â¼",prE:"⪳",pre:"⪯",prec:"âº",precapprox:"⪷",preccurlyeq:"â¼",Precedes:"âº",PrecedesEqual:"⪯",PrecedesSlantEqual:"â¼",PrecedesTilde:"â¾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"â¨",precsim:"â¾",Prime:"â³",prime:"â²",primes:"â",prnap:"⪹",prnE:"⪵",prnsim:"â¨",prod:"â",Product:"â",profalar:"â®",profline:"â",profsurf:"â",prop:"â",Proportion:"â·",Proportional:"â",propto:"â",prsim:"â¾",prurel:"â°",Pscr:"ð«",pscr:"ð
",Psi:"Ψ",psi:"Ï",puncsp:"â",Qfr:"ð",qfr:"ð®",qint:"â¨",Qopf:"â",qopf:"ð¢",qprime:"â",Qscr:"ð¬",qscr:"ð",quaternions:"â",quatint:"â¨",quest:"?",questeq:"â",QUOT:'"',quot:'"',rAarr:"â",race:"â½Ì±",Racute:"Å",racute:"Å",radic:"â",raemptyv:"⦳",Rang:"â«",rang:"â©",rangd:"â¦",range:"⦥",rangle:"â©",raquo:"»",Rarr:"â ",rArr:"â",rarr:"â",rarrap:"⥵",rarrb:"â¥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"â¤",rarrhk:"âª",rarrlp:"â¬",rarrpl:"â¥
",rarrsim:"⥴",Rarrtl:"â¤",rarrtl:"â£",rarrw:"â",rAtail:"â¤",ratail:"â¤",ratio:"â¶",rationals:"â",RBarr:"â¤",rBarr:"â¤",rbarr:"â¤",rbbrk:"â³",rbrace:"}",rbrack:"]",rbrke:"â¦",rbrksld:"â¦",rbrkslu:"â¦",Rcaron:"Å",rcaron:"Å",Rcedil:"Å",rcedil:"Å",rceil:"â",rcub:"}",Rcy:"Ð ",rcy:"Ñ",rdca:"⤷",rdldhar:"⥩",rdquo:"â",rdquor:"â",rdsh:"â³",Re:"â",real:"â",realine:"â",realpart:"â",reals:"â",rect:"â",REG:"®",reg:"®",ReverseElement:"â",ReverseEquilibrium:"â",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"â",Rfr:"â",rfr:"ð¯",rHar:"⥤",rhard:"â",rharu:"â",rharul:"⥬",Rho:"Ρ",rho:"Ï",rhov:"ϱ",RightAngleBracket:"â©",RightArrow:"â",Rightarrow:"â",rightarrow:"â",RightArrowBar:"â¥",RightArrowLeftArrow:"â",rightarrowtail:"â£",RightCeiling:"â",RightDoubleBracket:"â§",RightDownTeeVector:"â¥",RightDownVector:"â",RightDownVectorBar:"â¥",RightFloor:"â",rightharpoondown:"â",rightharpoonup:"â",rightleftarrows:"â",rightleftharpoons:"â",rightrightarrows:"â",rightsquigarrow:"â",RightTee:"â¢",RightTeeArrow:"â¦",RightTeeVector:"â¥",rightthreetimes:"â",RightTriangle:"â³",RightTriangleBar:"â§",RightTriangleEqual:"âµ",RightUpDownVector:"â¥",RightUpTeeVector:"â¥",RightUpVector:"â¾",RightUpVectorBar:"â¥",RightVector:"â",RightVectorBar:"â¥",ring:"Ë",risingdotseq:"â",rlarr:"â",rlhar:"â",rlm:"â",rmoust:"â±",rmoustache:"â±",rnmid:"â«®",roang:"â",roarr:"â¾",robrk:"â§",ropar:"â¦",Ropf:"â",ropf:"ð£",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"â¦",rppolint:"â¨",rrarr:"â",Rrightarrow:"â",rsaquo:"âº",Rscr:"â",rscr:"ð",Rsh:"â±",rsh:"â±",rsqb:"]",rsquo:"â",rsquor:"â",rthree:"â",rtimes:"â",rtri:"â¹",rtrie:"âµ",rtrif:"â¸",rtriltri:"â§",RuleDelayed:"â§´",ruluhar:"⥨",rx:"â",Sacute:"Å",sacute:"Å",sbquo:"â",Sc:"⪼",sc:"â»",scap:"⪸",Scaron:"Å ",scaron:"Å¡",sccue:"â½",scE:"⪴",sce:"⪰",Scedil:"Å",scedil:"Å",Scirc:"Å",scirc:"Å",scnap:"⪺",scnE:"⪶",scnsim:"â©",scpolint:"â¨",scsim:"â¿",Scy:"С",scy:"Ñ",sdot:"â
",sdotb:"â¡",sdote:"⩦",searhk:"⤥",seArr:"â",searr:"â",searrow:"â",sect:"§",semi:";",seswar:"⤩",setminus:"â",setmn:"â",sext:"â¶",Sfr:"ð",sfr:"ð°",sfrown:"â¢",sharp:"â¯",SHCHcy:"Щ",shchcy:"Ñ",SHcy:"Ш",shcy:"Ñ",ShortDownArrow:"â",ShortLeftArrow:"â",shortmid:"â£",shortparallel:"â¥",ShortRightArrow:"â",ShortUpArrow:"â",shy:"Â",Sigma:"Σ",sigma:"Ï",sigmaf:"Ï",sigmav:"Ï",sim:"â¼",simdot:"⩪",sime:"â",simeq:"â",simg:"âª",simgE:"⪠",siml:"âª",simlE:"âª",simne:"â",simplus:"⨤",simrarr:"⥲",slarr:"â",SmallCircle:"â",smallsetminus:"â",smashp:"⨳",smeparsl:"⧤",smid:"â£",smile:"â£",smt:"⪪",smte:"⪬",smtes:"⪬ï¸",SOFTcy:"Ь",softcy:"Ñ",sol:"/",solb:"â§",solbar:"â¿",Sopf:"ð",sopf:"ð¤",spades:"â ",spadesuit:"â ",spar:"â¥",sqcap:"â",sqcaps:"âï¸",sqcup:"â",sqcups:"âï¸",Sqrt:"â",sqsub:"â",sqsube:"â",sqsubset:"â",sqsubseteq:"â",sqsup:"â",sqsupe:"â",sqsupset:"â",sqsupseteq:"â",squ:"â¡",Square:"â¡",square:"â¡",SquareIntersection:"â",SquareSubset:"â",SquareSubsetEqual:"â",SquareSuperset:"â",SquareSupersetEqual:"â",SquareUnion:"â",squarf:"âª",squf:"âª",srarr:"â",Sscr:"ð®",sscr:"ð",ssetmn:"â",ssmile:"â£",sstarf:"â",Star:"â",star:"â",starf:"â
",straightepsilon:"ϵ",straightphi:"Ï",strns:"¯",Sub:"â",sub:"â",subdot:"⪽",subE:"â«
",sube:"â",subedot:"â«",submult:"â«",subnE:"â«",subne:"â",subplus:"⪿",subrarr:"⥹",Subset:"â",subset:"â",subseteq:"â",subseteqq:"â«
",SubsetEqual:"â",subsetneq:"â",subsetneqq:"â«",subsim:"â«",subsub:"â«",subsup:"â«",succ:"â»",succapprox:"⪸",succcurlyeq:"â½",Succeeds:"â»",SucceedsEqual:"⪰",SucceedsSlantEqual:"â½",SucceedsTilde:"â¿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"â©",succsim:"â¿",SuchThat:"â",Sum:"â",sum:"â",sung:"âª",Sup:"â",sup:"â",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"â«",supE:"â«",supe:"â",supedot:"â«",Superset:"â",SupersetEqual:"â",suphsol:"â",suphsub:"â«",suplarr:"⥻",supmult:"â«",supnE:"â«",supne:"â",supplus:"â«",Supset:"â",supset:"â",supseteq:"â",supseteqq:"â«",supsetneq:"â",supsetneqq:"â«",supsim:"â«",supsub:"â«",supsup:"â«",swarhk:"⤦",swArr:"â",swarr:"â",swarrow:"â",swnwar:"⤪",szlig:"Ã",Tab:"
20 ",target:"â",Tau:"Τ",tau:"Ï",tbrk:"â´",Tcaron:"Ť",tcaron:"Å¥",Tcedil:"Å¢",tcedil:"Å£",Tcy:"Т",tcy:"Ñ",tdot:"â",telrec:"â",Tfr:"ð",tfr:"ð±",there4:"â´",Therefore:"â´",therefore:"â´",Theta:"Î",theta:"θ",thetasym:"Ï",thetav:"Ï",thickapprox:"â",thicksim:"â¼",ThickSpace:"ââ",thinsp:"â",ThinSpace:"â",thkap:"â",thksim:"â¼",THORN:"Ã",thorn:"þ",Tilde:"â¼",tilde:"Ë",TildeEqual:"â",TildeFullEqual:"â
",TildeTilde:"â",times:"Ã",timesb:"â ",timesbar:"⨱",timesd:"⨰",tint:"â",toea:"⤨",top:"â¤",topbot:"â¶",topcir:"⫱",Topf:"ð",topf:"ð¥",topfork:"â«",tosa:"⤩",tprime:"â´",TRADE:"â¢",trade:"â¢",triangle:"âµ",triangledown:"â¿",triangleleft:"â",trianglelefteq:"â´",triangleq:"â",triangleright:"â¹",trianglerighteq:"âµ",tridot:"â¬",trie:"â",triminus:"⨺",TripleDot:"â",triplus:"⨹",trisb:"â§",tritime:"⨻",trpezium:"â¢",Tscr:"ð¯",tscr:"ð",TScy:"Ц",tscy:"Ñ",TSHcy:"Ð",tshcy:"Ñ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"â¬",twoheadleftarrow:"â",twoheadrightarrow:"â ",Uacute:"Ã",uacute:"ú",Uarr:"â",uArr:"â",uarr:"â",Uarrocir:"â¥",Ubrcy:"Ð",ubrcy:"Ñ",Ubreve:"Ŭ",ubreve:"Å",Ucirc:"Ã",ucirc:"û",Ucy:"У",ucy:"Ñ",udarr:"â
",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"ð",ufr:"ð²",Ugrave:"Ã",ugrave:"ù",uHar:"⥣",uharl:"â¿",uharr:"â¾",uhblk:"â",ulcorn:"â",ulcorner:"â",ulcrop:"â",ultri:"â¸",Umacr:"Ū",umacr:"Å«",uml:"¨",UnderBar:"_",UnderBrace:"â",UnderBracket:"âµ",UnderParenthesis:"â",Union:"â",UnionPlus:"â",Uogon:"Ų",uogon:"ų",Uopf:"ð",uopf:"ð¦",UpArrow:"â",Uparrow:"â",uparrow:"â",UpArrowBar:"â¤",UpArrowDownArrow:"â
",UpDownArrow:"â",Updownarrow:"â",updownarrow:"â",UpEquilibrium:"⥮",upharpoonleft:"â¿",upharpoonright:"â¾",uplus:"â",UpperLeftArrow:"â",UpperRightArrow:"â",Upsi:"Ï",upsi:"Ï
",upsih:"Ï",Upsilon:"Î¥",upsilon:"Ï
",UpTee:"â¥",UpTeeArrow:"â¥",upuparrows:"â",urcorn:"â",urcorner:"â",urcrop:"â",Uring:"Å®",uring:"ů",urtri:"â¹",Uscr:"ð°",uscr:"ð",utdot:"â°",Utilde:"Ũ",utilde:"Å©",utri:"âµ",utrif:"â´",uuarr:"â",Uuml:"Ã",uuml:"ü",uwangle:"⦧",vangrt:"â¦",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"â
",varphi:"Ï",varpi:"Ï",varpropto:"â",vArr:"â",varr:"â",varrho:"ϱ",varsigma:"Ï",varsubsetneq:"âï¸",varsubsetneqq:"â«ï¸",varsupsetneq:"âï¸",varsupsetneqq:"â«ï¸",vartheta:"Ï",vartriangleleft:"â²",vartriangleright:"â³",Vbar:"â««",vBar:"⫨",vBarv:"â«©",Vcy:"Ð",vcy:"в",VDash:"â«",Vdash:"â©",vDash:"â¨",vdash:"â¢",Vdashl:"⫦",Vee:"â",vee:"â¨",veebar:"â»",veeeq:"â",vellip:"â®",Verbar:"â",verbar:"|",Vert:"â",vert:"|",VerticalBar:"â£",VerticalLine:"|",VerticalSeparator:"â",VerticalTilde:"â",VeryThinSpace:"â",Vfr:"ð",vfr:"ð³",vltri:"â²",vnsub:"ââ",vnsup:"ââ",Vopf:"ð",vopf:"ð§",vprop:"â",vrtri:"â³",Vscr:"ð±",vscr:"ð",vsubnE:"â«ï¸",vsubne:"âï¸",vsupnE:"â«ï¸",vsupne:"âï¸",Vvdash:"âª",vzigzag:"â¦",Wcirc:"Å´",wcirc:"ŵ",wedbar:"â©",Wedge:"â",wedge:"â§",wedgeq:"â",weierp:"â",Wfr:"ð",wfr:"ð´",Wopf:"ð",wopf:"ð¨",wp:"â",wr:"â",wreath:"â",Wscr:"ð²",wscr:"ð",xcap:"â",xcirc:"â¯",xcup:"â",xdtri:"â½",Xfr:"ð",xfr:"ðµ",xhArr:"âº",xharr:"â·",Xi:"Î",xi:"ξ",xlArr:"â¸",xlarr:"âµ",xmap:"â¼",xnis:"â»",xodot:"â¨",Xopf:"ð",xopf:"ð©",xoplus:"â¨",xotime:"â¨",xrArr:"â¹",xrarr:"â¶",Xscr:"ð³",xscr:"ð",xsqcup:"â¨",xuplus:"â¨",xutri:"â³",xvee:"â",xwedge:"â",Yacute:"Ã",yacute:"ý",YAcy:"Я",yacy:"Ñ",Ycirc:"Ŷ",ycirc:"Å·",Ycy:"Ы",ycy:"Ñ",yen:"Â¥",Yfr:"ð",yfr:"ð¶",YIcy:"Ð",yicy:"Ñ",Yopf:"ð",yopf:"ðª",Yscr:"ð´",yscr:"ð",YUcy:"Ю",yucy:"Ñ",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"Ð",zcy:"з",Zdot:"Å»",zdot:"ż",zeetrf:"â¨",ZeroWidthSpace:"â",Zeta:"Î",zeta:"ζ",Zfr:"â¨",zfr:"ð·",ZHcy:"Ð",zhcy:"ж",zigrarr:"â",Zopf:"â¤",zopf:"ð«",Zscr:"ðµ",zscr:"ð",zwj:"â",zwnj:"â"}),i.entityMap=i.HTML_ENTITIES})(Nh);var Fl={},Xr=gi.NAMESPACE,Yo=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,Uc=new RegExp("[\\-\\.0-9"+Yo.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),$c=new RegExp("^"+Yo.source+Uc.source+"*(?::"+Yo.source+Uc.source+"*)?$"),Ar=0,xi=1,ys=2,wr=3,vs=4,Ts=5,Dr=6,Un=7;function Us(i,e){this.message=i,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,Us)}Us.prototype=new Error;Us.prototype.name=Us.name;function Mh(){}Mh.prototype={parse:function(i,e,t){var s=this.domBuilder;s.startDocument(),Bh(e,e={}),dy(i,e,t,s,this.errorHandler),s.endDocument()}};function dy(i,e,t,s,r){function n(ce){if(ce>65535){ce-=65536;var Ie=55296+(ce>>10),Ke=56320+(ce&1023);return String.fromCharCode(Ie,Ke)}else return String.fromCharCode(ce)}function a(ce){var Ie=ce.slice(1,-1);return Object.hasOwnProperty.call(t,Ie)?t[Ie]:Ie.charAt(0)==="#"?n(parseInt(Ie.substr(1).replace("x","0x"))):(r.error("entity n
20ot found:"+ce),ce)}function o(ce){if(ce>y){var Ie=i.substring(y,ce).replace(/&#?\w+;/g,a);T&&u(y),s.characters(Ie,0,ce-y),y=ce}}function u(ce,Ie){for(;ce>=m&&(Ie=_.exec(i));)h=Ie.index,m=h+Ie[0].length,T.lineNumber++;T.columnNumber=ce-h+1}for(var h=0,m=0,_=/.*(?:\r\n?|\n)|.*$/g,T=s.locator,E=[{currentNSMap:e}],A={},y=0;;){try{var w=i.indexOf("<",y);if(w<0){if(!i.substr(y).match(/^\s*$/)){var D=s.doc,N=D.createTextNode(i.substr(y));D.appendChild(N),s.currentElement=N}return}switch(w>y&&o(w),i.charAt(w+1)){case"/":var ue=i.indexOf(">",w+3),O=i.substring(w+2,ue).replace(/[ \t\n\r]+$/g,""),B=E.pop();ue<0?(O=i.substring(w+2).replace(/[\s<].*/,""),r.error("end tag name: "+O+" is not complete:"+B.tagName),ue=w+1+O.length):O.match(/\s</)&&(O=O.replace(/[\s<].*/,""),r.error("end tag name: "+O+" maybe not complete"),ue=w+1+O.length);var I=B.localNSMap,$=B.tagName==O,X=$||B.tagName&&B.tagName.toLowerCase()==O.toLowerCase();if(X){if(s.endElement(B.uri,B.localName,O),I)for(var K in I)Object.prototype.hasOwnProperty.call(I,K)&&s.endPrefixMapping(K);$||r.fatalError("end tag name: "+O+" is not match the current start tagName:"+B.tagName)}else E.push(B);ue++;break;case"?":T&&u(w),ue=gy(i,w,s);break;case"!":T&&u(w),ue=my(i,w,s,r);break;default:T&&u(w);var re=new Fh,xe=E[E.length-1].currentNSMap,ue=hy(i,w,re,xe,a,r),ge=re.length;if(!re.closed&&py(i,ue,re.tagName,A)&&(re.closed=!0,t.nbsp||r.warning("unclosed xml attribute")),T&&ge){for(var ee=qc(T,{}),he=0;he<ge;he++){var Re=re[he];u(Re.offset),Re.locator=qc(T,{})}s.locator=ee,jc(re,s,xe)&&E.push(re),s.locator=T}else jc(re,s,xe)&&E.push(re);Xr.isHTML(re.uri)&&!re.closed?ue=fy(i,ue,re.tagName,a,s):ue++}}catch(ce){if(ce instanceof Us)throw ce;r.error("element parse error: "+ce),ue=-1}ue>y?y=ue:o(Math.max(w,y)+1)}}function qc(i,e){return e.lineNumber=i.lineNumber,e.columnNumber=i.columnNumber,e}function hy(i,e,t,s,r,n){function a(T,E,A){t.attributeNames.hasOwnProperty(T)&&n.fatalError("Attribute "+T+" redefined"),t.addValue(T,E.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,r),A)}for(var o,u,h=++e,m=Ar;;){var _=i.charAt(h);switch(_){case"=":if(m===xi)o=i.slice(e,h),m=wr;else if(m===ys)m=wr;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(m===wr||m===xi)if(m===xi&&(n.warning('attribute value must after "="'),o=i.slice(e,h)),e=h+1,h=i.indexOf(_,e),h>0)u=i.slice(e,h),a(o,u,e-1),m=Ts;else throw new Error("attribute value no end '"+_+"' match");else if(m==vs)u=i.slice(e,h),a(o,u,e),n.warning('attribute "'+o+'" missed start quot('+_+")!!"),e=h+1,m=Ts;else throw new Error('attribute value must after "="');break;case"/":switch(m){case Ar:t.setTagName(i.slice(e,h));case Ts:case Dr:case Un:m=Un,t.closed=!0;case vs:case xi:break;case ys:t.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return n.error("unexpected end of input"),m==Ar&&t.setTagName(i.slice(e,h)),h;case">":switch(m){case Ar:t.setTagName(i.slice(e,h));case Ts:case Dr:case Un:break;case vs:case xi:u=i.slice(e,h),u.slice(-1)==="/"&&(t.closed=!0,u=u.slice(0,-1));case ys:m===ys&&(u=o),m==vs?(n.warning('attribute "'+u+'" missed quot(")!'),a(o,u,e)):((!Xr.isHTML(s[""])||!u.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),a(u,u,e));break;case wr:throw new Error("attribute value missed!!")}return h;case"Â":_=" ";default:if(_<=" ")switch(m){case Ar:t.setTagName(i.slice(e,h)),m=Dr;break;case xi:o=i.slice(e,h),m=ys;break;case vs:var u=i.slice(e,h);n.warning('attribute "'+u+'" missed quot(")!!'),a(o,u,e);case Ts:m=Dr;break}else switch(m){case ys:t.tagName,(!Xr.isHTML(s[""])||!o.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),a(o,o,e),e=h,m=xi;break;case Ts:n.warning('attribute space is required"'+o+'"!!');case Dr:m=xi,e=h;break;case wr:m=vs,e=h;break;case Un:throw new Error("elements closed character '/' and '>' must be connected to")}}h++}}function jc(i,e,t){for(var s=i.tagName,r=null,_=i.length;_--;){var n=i[_],a=n.qName,o=n.value,T=a.indexOf(":");if(T>0)var u=n.prefix=a.slice(0,T),h=a.slice(T+1),m=u==="xmlns"&&h;else h=a,u=null,m=a==="xmlns"&&"";n.localName=h,m!==!1&&(r==null&&(r={},Bh(t,t={})),t[m]=r[m]=o,n.uri=Xr.XMLNS,e.startPrefixMapping(m,o))}for(var _=i.length;_--;){n=i[_];var u=n.prefix;u&&(u==="xml"&&(n.uri=Xr.XML),u!=="xmlns"&&(n.uri=t[u||""]))}var T=s.indexOf(":");T>0?(u=i.prefix=s.slice(0,T),h=i.localName=s.slice(T+1)):(u=null,h=i.localName=s);var E=i.uri=t[u||""];if(e.startElement(E,h,s,i),i.closed){if(e.endElement(E,h,s),r)for(u in r)Object.prototype.hasOwnProperty.call(r,u)&&e.endPrefixMapping(u)}else return i.currentNSMap=t,i.localNSMap=r,!0}function fy(i,e,t,s,r){if(/^(?:script|textarea)$/i.test(t)){var n=i.indexOf("</"+t+">",e),a=i.substring(e+1,n);if(/[&<]/.test(a))return/^script$/i.test(t)?(r.characters(a,0,a.length),n):(a=a.replace(/&#?\w+;/g,s),r.characters(a,0,a.length),n)}return e+1}function py(i,e,t,s){var r=s[t];return r==null&&(r=i.lastIndexOf("</"+t+">"),r<e&&(r=i.lastIndexOf("</"+t)),s[t]=r),r<e}
vendor: 30,843 bytes, lines 20-23
20function Bh(i,e){for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t])}function my(i,e,t,s){var r=i.charAt(e+2);switch(r){case"-":if(i.charAt(e+3)==="-"){var n=i.indexOf("-->",e+4);return n>e?(t.comment(i,e+4,n-e-4),n+3):(s.error("Unclosed comment"),-1)}else return-1;default:if(i.substr(e+3,6)=="CDATA["){var n=i.indexOf("]]>",e+9);return t.startCDATA(),t.characters(i,e+9,n-e-9),t.endCDATA(),n+3}var a=_y(i,e),o=a.length;if(o>1&&/!doctype/i.test(a[0][0])){var u=a[1][0],h=!1,m=!1;o>3&&(/^public$/i.test(a[2][0])?(h=a[3][0],m=o>4&&a[4][0]):/^system$/i.test(a[2][0])&&(m=a[3][0]));var _=a[o-1];return t.startDTD(u,h,m),t.endDTD(),_.index+_[0].length}}return-1}function gy(i,e,t){var s=i.indexOf("?>",e);if(s){var r=i.substring(e,s).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return r?(r[0].length,t.processingInstruction(r[1],r[2]),s+2):-1}return-1}function Fh(){this.attributeNames={}}Fh.prototype={setTagName:function(i){if(!$c.test(i))throw new Error("invalid tagName:"+i);this.tagName=i},addValue:function(i,e,t){if(!$c.test(i))throw new Error("invalid attribute:"+i);this.attributeNames[i]=this.length,this[this.length++]={qName:i,value:e,offset:t}},length:0,getLocalName:function(i){return this[i].localName},getLocator:function(i){return this[i].locator},getQName:function(i){return this[i].qName},getURI:function(i){return this[i].uri},getValue:function(i){return this[i].value}};function _y(i,e){var t,s=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(r.lastIndex=e,r.exec(i);t=r.exec(i);)if(s.push(t),t[1])return s}Fl.XMLReader=Mh;Fl.ParseError=Us;var yy=gi,vy=ki,Hc=Nh,Uh=Fl,Ty=vy.DOMImplementation,Vc=yy.NAMESPACE,by=Uh.ParseError,Sy=Uh.XMLReader;function $h(i){return i.replace(/\r[\n\u0085]/g,` 21`).replace(/[\r\u0085\u2028]/g,` 22`)}function qh(i){this.options=i||{locator:{}}}qh.prototype.parseFromString=function(i,e){var t=this.options,s=new Sy,r=t.domBuilder||new sn,n=t.errorHandler,a=t.locator,o=t.xmlns||{},u=/\/x?html?$/.test(e),h=u?Hc.HTML_ENTITIES:Hc.XML_ENTITIES;a&&r.setDocumentLocator(a),s.errorHandler=xy(n,r,a),s.domBuilder=t.domBuilder||r,u&&(o[""]=Vc.HTML),o.xml=o.xml||Vc.XML;var m=t.normalizeLineEndings||$h;return i&&typeof i=="string"?s.parse(m(i),o,h):s.errorHandler.error("invalid doc source"),r.doc};function xy(i,e,t){if(!i){if(e instanceof sn)return e;i=e}var s={},r=i instanceof Function;t=t||{};function n(a){var o=i[a];!o&&r&&(o=i.length==2?function(u){i(a,u)}:i),s[a]=o&&function(u){o("[xmldom "+a+"] "+u+Qo(t))}||function(){}}return n("warning"),n("error"),n("fatalError"),s}function sn(){this.cdata=!1}function bs(i,e){e.lineNumber=i.lineNumber,e.columnNumber=i.columnNumber}sn.prototype={startDocument:function(){this.doc=new Ty().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(i,e,t,s){var r=this.doc,n=r.createElementNS(i,t||e),a=s.length;$n(this,n),this.currentElement=n,this.locator&&bs(this.locator,n);for(var o=0;o<a;o++){var i=s.getURI(o),u=s.getValue(o),t=s.getQName(o),h=r.createAttributeNS(i,t);this.locator&&bs(s.getLocator(o),h),h.value=h.nodeValue=u,n.setAttributeNode(h)}},endElement:function(i,e,t){var s=this.currentElement;s.tagName,this.currentElement=s.parentNode},startPrefixMapping:function(i,e){},endPrefixMapping:function(i){},processingInstruction:function(i,e){var t=this.doc.createProcessingInstruction(i,e);this.locator&&bs(this.locator,t),$n(this,t)},ignorableWhitespace:function(i,e,t){},characters:function(i,e,t){if(i=zc.apply(this,arguments),i){if(this.cdata)var s=this.doc.createCDATASection(i);else var s=this.doc.createTextNode(i);this.currentElement?this.currentElement.appendChild(s):/^\s*$/.test(i)&&this.doc.appendChild(s),this.locator&&bs(this.locator,s)}},skippedEntity:function(i){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(i){(this.locator=i)&&(i.lineNumber=0)},comment:function(i,e,t){i=zc.apply(this,arguments);var s=this.doc.createComment(i);this.locator&&bs(this.locator,s),$n(this,s)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(i,e,t){var s=this.doc.implementation;if(s&&s.createDocumentType){var r=s.createDocumentType(i,e,t);this.locator&&bs(this.locator,r),$n(this,r),this.doc.doctype=r}},warning:function(i){console.warn("[xmldom warning] "+i,Qo(this.locator))},error:function(i){console.error("[xmldom error] "+i,Qo(this.locator))},fatalError:function(i){throw new by(i,this.locator)}};function Qo(i){if(i)return` 23@`+(i.systemId||"")+"#[line:"+i.lineNumber+",col:"+i.columnNumber+"]"}function zc(i,e,t){return typeof i=="string"?i.substr(e,t):i.length>=e+t||e?new java.lang.String(i,e,t)+"":i}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(i){sn.prototype[i]=function(){return null}});function $n(i,e){i.currentElement?i.currentElement.appendChild(e):i.doc.appendChild(e)}Da.__DOMHandler=sn;Da.normalizeLineEndings=$h;Da.DOMParser=qh;var Ey=Da.DOMParser;/*! @name mpd-parser @version 1.3.1 @license Apache-2.0 */const Gc=i=>!!i&&typeof i=="object",ze=(...i)=>i.reduce((e,t)=>(typeof t!="object"||Object.keys(t).forEach(s=>{Array.isArray(e[s])&&Array.isArray(t[s])?e[s]=e[s].concat(t[s]):Gc(e[s])&&Gc(t[s])?e[s]=ze(e[s],t[s]):e[s]=t[s]}),e),{}),jh=i=>Object.keys(i).map(e=>i[e]),Cy=(i,e)=>{const t=[];for(let s=i;s<e;s++)t.push(s);return t},$s=i=>i.reduce((e,t)=>e.concat(t),[]),Hh=i=>{if(!i.length)return[];const e=[];for(let t=0;t<i.length;t++)e.push(i[t]);return e},Ay=(i,e)=>i.reduce((t,s,r)=>(s[e]&&t.push(r),t),[]),wy=(i,e)=>jh(i.reduce((t,s)=>(s.forEach(r=>{t[e(r)]=r}),t),{}));var qs={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",INVALID_NUMBER_OF_CONTENT_STEERING:"INVALID_NUMBER_OF_CONTENT_STEERING",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",MISSING_SEGMENT_INFORMATION:"MISSING_SEGMENT_INFORMATION",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const Kr=({baseUrl:i="",source:e="",range:t="",indexRange:s=""})=>{const r={uri:e,resolvedUri:Dl(i||"",e)};if(t||s){const a=(t||s).split("-");let o=x.BigInt?x.BigInt(a[0]):parseInt(a[0],10),u=x.BigInt?x.BigInt(a[1]):parseInt(a[1],10);o<Number.MAX_SAFE_INTEGER&&typeof o=="bigint"&&(o=Number(o)),u<Number.MAX_SAFE_INTEGER&&typeof u=="bigint"&&(u=Number(u));let h;typeof u=="bigint"||typeof o=="bigint"?h=x.BigInt(u)-x.BigInt(o)+x.BigInt(1):h=u-o+1,typeof h=="bigint"&&h<Number.MAX_SAFE_INTEGER&&(h=Number(h)),r.byterange={length:h,offset:o}}return r},Dy=i=>{let e;return typeof i.offset=="bigint"||typeof i.length=="bigint"?e=x.BigInt(i.offset)+x.BigInt(i.length)-x.BigInt(1):e=i.offset+i.length-1,`${i.offset}-${e}`},Wc=i=>(i&&typeof i!="number"&&(i=parseInt(i,10)),isNaN(i)?null:i),Iy={static(i){const{duration:e,timescale:t=1,sourceDuration:s,periodDuration:r}=i,n=Wc(i.endNumber),a=e/t;return typeof n=="number"?{start:0,end:n}:typeof r=="number"?{start:0,end:r/a}:{start:0,end:s/a}},dynamic(i){const{NOW:e,clientOffset:t,availabilityStartTime:s,timescale:r=1,duration:n,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:u=1/0}=i,h=Wc(i.endNumber),m=(e+t)/1e3,_=s+a,E=m+o-_,A=Math.ceil(E*r/n),y=Math.floor((m-_-u)*r/n),w=Math.floor((m-_)*r/n);return{start:Math.max(0,y),end:typeof h=="number"?h:Math.min(A,w)}}},ky=i=>e=>{const{duration:t,timescale:s=1,periodStart:r,startNumber:n=1}=i;return{number:n+e,duration:t/s,timeline:r,time:e*t}},Ul=i=>{const{type:e,duration:t,timescale:s=1,periodDuration:r,sourceDuration:n}=i,{start:a,end:o}=Iy[e](i),u=Cy(a,o).map(ky(i));if(e==="static"){const h=u.length-1,m=typeof r=="number"?r:n;u[h].duration=m-t/s*h}return u},Vh=i=>{const{baseUrl:e,initialization:t={},sourceDuration:s,indexRange:r="",periodStart:n,presentationTime:a,number:o=0,duration:u}=i;if(!e)throw new Error(qs.NO_BASE_URL);const h=Kr({baseUrl:e,source:t.sourceURL,range:t.range}),m=Kr({baseUrl:e,source:e,indexRange:r});if(m.map=h,u){const _=Ul(i);_.length&&(m.duration=_[0].duration,m.timeline=_[0].timeline)}else s&&(m.duration=s,m.timeline=n);return m.presentationTime=a||n,m.number=o,[m]},$l=(i,e,t)=>{const s=i.sidx.map?i.sidx.map:null,r=i.sidx.duration,n=i.timeline||0,a=i.sidx.byterange,o=a.offset+a.length,u=e.timescale,h=e.references.filter(w=>w.referenceType!==1),m=[],_=i.endList?"static":"dynamic",T=i.sidx.timeline;let E=T,A=i.mediaSequence||0,y;typeof e.firstOffset=="bigint"?y=x.BigInt(o)+e.firstOffset:y=o+e.firstOffset;for(let w=0;w<h.length;w++){const D=e.references[w],N=D.referencedSize,O=D.subsegmentDuration;let B;typeof y=="bigint"?B=y+x.BigInt(N)-x.BigInt(1):B=y+N-1;const I=`${y}-${B}`,X=Vh({baseUrl:t,timescale:u,timeline:n,periodStart:T,presentationTime:E,number:A,duration:O,sourceDuration:r,indexRange:I,type:_})[0];s&&(X.map=s),m.push(X),typeof y=="bigint"?y+=x.BigInt(N):y+=N,E+=O/u,A++}return i.segments=m,i},Py=["AUDIO","SUBTITLES"],Ly=1/60,zh=i=>wy(i,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),Oy=(i,e)=>{for(let t=0;t<i.length;t++)if(i[t].attributes.NAME===e)return i[t];return null},Xc=i=>{let e=[];return X_(i,Py,(t,s,r,n)=>{e=e.concat(t.playlists||[])}),e},Kc=({playlist:i,mediaSequence:e})=>{i.mediaSequence=e,i.segments.forEach((t,s)=>{t.number=i.mediaSequence+s})},Ry=({oldPlaylists:i,newPlaylists:e,timelineStarts:t})=>{e.forEach(s=>{s.discontinuitySequence=t.findIndex(function({timeline:u}){return u===s.timeline});const r=Oy(i,s.attributes.NAME);if(!r||s.sidx)return;const n=s.segments[0],a=r.segments.findIndex(function(u){return Math.abs(u.presentationTime-n.presentationTime)<Ly});if(a===-1){Kc({playlist:s,mediaSequence:r.mediaSequence+r.segments.length}),s.segments[0].discontinuity=!0,s.discontinuityStarts.unshift(0),(!r.segments.length&&s.timeline>r.timeline||r.segments.length&&s.timeline>r.segments[r.segments.length-1].timeline)&&s.discontinuitySequence--;return}r.segments[a].discontinuity&&!n.discontinuity&&(n.discontinuity=!0,s.discontinuityStarts.unshift(0),s.discontinuitySequence--),Kc({playlist:s,mediaSequence:r.segments[a].number})})},Ny=({oldManifest:i,newManifest:e})=>{const t=i.playlists.concat(Xc(i)),s=e.playlists.concat(Xc(e));return e.timelineStarts=zh([i.timelineStarts,e.timelineStarts]),Ry({oldPlaylists:t,newPlaylists:s,timelineStarts:e.timelineStarts}),e},Ia=i=>i&&i.uri+"-"+Dy(i.byterange),Lo=i=>{const e=i.reduce(function(s,r){return s[r.attributes.baseUrl]||(s[r.attributes.baseUrl]=[]),s[r.attributes.baseUrl].push(r),s},{});let t=[];return Object.values(e).forEach(s=>{const r=jh(s.reduce((n,a)=>{const o=a.attributes.id+(a.attributes.lang||"");return n[o]?(a.segments&&(a.segments[0]&&(a.segments[0].discontinuity=!0),n[o].segments.push(...a.segments)),a.attributes.contentProtection&&(n[o].attributes.contentProtection=a.attributes.contentProtection)):(n[o]=a,n[o].attributes.timelineStarts=[]),n[o].attributes.timelineStarts.push({start:a.attributes.periodStart,timeline:a.attributes.periodStart}),n},{}));t=t.concat(r)}),t.map(s=>(s.discontinuityStarts=Ay(s.segments||[],"discontinuity"),s))},ql=(i,e)=>{const t=Ia(i.sidx),s=t&&e[t]&&e[t].sidx;return s&&$l(i,s,i.sidx.resolvedUri),i},My=(i,e={})=>{if(!Object.keys(e).length)return i;for(const t in i)i[t]=ql(i[t],e);return i},By=({attributes:i,segments:e,sidx:t,mediaSequence:s,discontinuitySequence:r,discontinuityStarts:n},a)=>{const o={attributes:{NAME:i.id,BANDWIDTH:i.bandwidth,CODECS:i.codecs,"PROGRAM-ID":1},uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,discontinuitySequence:r,discontinuityStarts:n,timelineStarts:i.timelineStarts,mediaSequence:s,segments:e};return i.contentProtection&&(o.contentProtection=i.contentProtection),i.serviceLocation&&(o.attributes.serviceLocation=i.serviceLocation),t&&(o.sidx=t),a&&(o.attributes.AUDIO="audio",o.attributes.SUBTITLES="subs"),o},Fy=({attributes:i,segments:e,mediaSequence:t,discontinuityStarts:s,discontinuitySequence:r})=>{typeof e>"u"&&(e=[{uri:i.baseUrl,timeline:i.periodStart,resolvedUri:i.baseUrl||"",duration:i.sourceDuration,number:0}],i.duration=i.sourceDuration);const n={NAME:i.id,BANDWIDTH:i.bandwidth,"PROGRAM-ID":1};i.codecs&&(n.CODECS=i.codecs);const a={attributes:n,uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,timelineStarts:i.timelineStarts,discontinuityStarts:s,discontinuitySequence:r,mediaSequence:t,segments:e};return i.serviceLocation&&(a.attributes.serviceLocation=i.serviceLocation),a},Uy=(i,e={},t=!1)=>{let s;const r=i.reduce((n,a)=>{const o=a.attributes.role&&a.attributes.role.value||"",u=a.attributes.lang||"";let h=a.attributes.label||"main";if(u&&!a.attributes.label){const _=o?` (${o})`:"";h=`${a.attributes.lang}${_}`}n[h]||(n[h]={language:u,autoselect:!0,default:o==="main",playlists:[],uri:""});const m=ql(By(a,t),e);return n[h].playlists.push(m),typeof s>"u"&&o==="main"&&(s=a,s.default=!0),n},{});if(!s){const n=Object.keys(r)[0];r[n].default=!0}return r},$y=(i,e={})=>i.reduce((t,s)=>{const r=s.attributes.label||s.attributes.lang||"text",n=s.attributes.lang||"und";return t[r]||(t[r]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),t[r].playlists.push(ql(Fy(s),e)),t},{}),qy=i=>i.reduce((e,t)=>(t&&t.forEach(s=>{const{channel:r,language:n}=s;e[n]={autoselect:!1,default:!1,instreamId:r,language:n},s.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=s.aspectRatio),s.hasOwnProperty("easyReader")&&(e[n].easyReader=s.easyReader),s.hasOwnProperty("3D")&&(e[n]["3D"]=s["3D"])}),e),{}),jy=({attributes:i,segments:e,sidx:t,discontinuityStarts:s})=>{const r={attributes:{NAME:i.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:i.width,height:i.height},CODECS:i.codecs,BANDWIDTH:i.bandwidth,"PROGRAM-ID":1},uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,discontinuityStarts:s,timelineStarts:i.timelineStarts,segments:e};return i.frameRate&&(r.attributes["FRAME-RATE"]=i.frameRate),i.contentProtection&&(r.contentProtection=i.contentProtection),i.serviceLocation&&(r.attributes.serviceLocation=i.serviceLocation),t&&(r.sidx=t),r},Hy=({attributes:i})=>i.mimeType==="video/mp4"||i.mimeType==="video/webm"||i.contentType==="video",Vy=({attributes:i})=>i.mimeType==="audio/mp4"||i.mimeType==="audio/webm"||i.contentType==="audio",zy=({attributes:i})=>i.mimeType==="text/vtt"||i.contentType==="text",Gy=(i,e)=>{i.forEach(t=>{t.mediaSequence=0,t.discontinuitySequence=e.findIndex(function({timeline:s}){return s===t.timeline}),t.segments&&t.segments.forEach((s,r)=>{s.number=r})})},Yc=i=>i?Object.keys(i).reduce((e,t)=>{const s=i[t];return e.concat(s.playlists)},[]):[],Wy=({dashPlaylists:i,locations:e,contentSteering:t,sidxMapping:s={},previousManifest:r,eventStream:n})=>{if(!i.length)return{};const{sourceDuration:a,type:o,suggestedPresentationDelay:u,minimumUpdatePeriod:h}=i[0].attributes,m=Lo(i.filter(Hy)).map(jy),_=Lo(i.filter(Vy)),T=Lo(i.filter(zy)),E=i.map(B=>B.attributes.captionServices).filter(Boolean),A={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:My(m,s)};h>=0&&(A.minimumUpdatePeriod=h*1e3),e&&(A.locations=e),t&&(A.contentSteering=t),o==="dynamic"&&(A.suggestedPresentationDelay=u),n&&n.length>0&&(A.eventStream=n);const y=A.playlists.length===0,w=_.length?Uy(_,s,y):null,D=T.length?$y(T,s):null,N=m.concat(Yc(w),Yc(D)),O=N.map(({timelineStarts:B})=>B);return A.timelineStarts=zh(O),Gy(N,A.timelineStarts),w&&(A.mediaGroups.AUDIO.audio=w),D&&(A.mediaGroups.SUBTITLES.subs=D),E.length&&(A.mediaGroups["CLOSED-CAPTIONS"].cc=qy(E)),r?Ny({oldManifest:r,newManifest:A}):A},Xy=(i,e,t)=>{const{NOW:s,clientOffset:r,availabilityStartTime:n,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:u=0}=i,h=(s+r)/1e3,m=n+o,T=h+u-m;return Math.ceil((T*a-e)/t)},Gh=(i,e)=>{const{type:t,minimumUpdatePeriod:s=0,media:r="",sourceDuration:n,timescale:a=1,startNumber:o=1,periodStart:u}=i,h=[];let m=-1;for(let _=0;_<e.length;_++){const T=e[_],E=T.d,A=T.r||0,y=T.t||0;m<0&&(m=y),y&&y>m&&(m=y);let w;if(A<0){const O=_+1;O===e.length?t==="dynamic"&&s>0&&r.indexOf("$Number$")>0?w=Xy(i,m,E):w=(n*a-m)/E:w=(e[O].t-m)/E}else w=A+1;const D=o+h.length+w;let N=o+h.length;for(;N<D;)h.push({number:N,duration:E/a,time:m,timeline:u}),m+=E,N++}return h},Ky=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,Yy=i=>(e,t,s,r)=>{if(e==="$$")return"$";if(typeof i[t]>"u")return e;const n=""+i[t];return t==="RepresentationID"||(s?r=parseInt(r,10):r=1,n.length>=r)?n:`${new Array(r-n.length+1).join("0")}${n}`},Qc=(i,e)=>i.replace(Ky,Yy(e)),Qy=(i,e)=>!i.duration&&!e?[{number:i.startNumber||1,duration:i.sourceDuration,time:0,timeline:i.periodStart}]:i.duration?Ul(i):Gh(i,e),Jy=(i,e)=>{const t={RepresentationID:i.id,Bandwidth:i.bandwidth||0},{initialization:s={sourceURL:"",range:""}}=i,r=Kr({baseUrl:i.baseUrl,source:Qc(s.sourceURL,t),range:s.range});return Qy(i,e).map(a=>{t.Number=a.number,t.Time=a.time;const o=Qc(i.media||"",t),u=i.timescale||1,h=i.presentationTimeOffset||0,m=i.periodStart+(a.time-h)/u;return{uri:o,timeline:a.timeline,duration:a.duration,resolvedUri:Dl(i.baseUrl||"",o),map:r,number:a.number,presentationTime:m}})},Zy=(i,e)=>{const{baseUrl:t,initialization:s={}}=i,r=Kr({baseUrl:t,source:s.sourceURL,range:s.range}),n=Kr({baseUrl:t,source:e.media,range:e.mediaRange});return n.map=r,n},ev=(i,e)=>{const{duration:t,segmentUrls:s=[],periodStart:r}=i;if(!t&&!e||t&&e)throw new Error(qs.SEGMENT_TIME_UNSPECIFIED);const n=s.map(u=>Zy(i,u));let a;return t&&(a=Ul(i)),e&&(a=Gh(i,e)),a.map((u,h)=>{if(n[h]){const m=n[h],_=i.timescale||1,T=i.presentationTimeOffset||0;return m.timeline=u.timeline,m.duration=u.duration,m.number=u.number,m.presentationTime=r+(u.time-T)/_,m}}).filter(u=>u)},tv=({attributes:i,segmentInfo:e})=>{let t,s;e.template?(s=Jy,t=ze(i,e.template)):e.base?(s=Vh,t=ze(i,e.base)):e.list&&(s=ev,t=ze(i,e.list));const r={attributes:i};if(!s)return r;const n=s(t,e.segmentTimeline);if(t.duration){const{duration:a,timescale:o=1}=t;t.duration=a/o}else n.length?t.duration=n.reduce((a,o)=>Math.max(a,Math.ceil(o.duration)),0):t.duration=0;return r.attributes=t,r.segments=n,e.base&&t.indexRange&&(r.sidx=n[0],r.segments=[]),r},iv=i=>i.map(tv),De=(i,e)=>Hh(i.childNodes).filter(({tagName:t})=>t===e),rn=i=>i.textContent.trim(),sv=i=>parseFloat(i.split("/").reduce((e,t)=>e/t)),Ss=i=>{const o=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(i);if(!o)return 0;const[u,h,m,_,T,E]=o.slice(1);return parseFloat(u||0)*31536e3+parseFloat(h||0)*2592e3+parseFloat(m||0)*86400+parseFloat(_||0)*3600+parseFloat(T||0)*60+parseFloat(E||0)},rv=i=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(i)&&(i+="Z"),Date.parse(i)),Jc={mediaPresentationDuration(i){return Ss(i)},availabilityStartTime(i){return rv(i)/1e3},minimumUpdatePeriod(i){return Ss(i)},suggestedPresentationDelay(i){return Ss(i)},type(i){return i},timeShiftBufferDepth(i){return Ss(i)},start(i){return Ss(i)},width(i){return parseInt(i,10)},height(i){return parseInt(i,10)},bandwidth(i){return parseInt(i,10)},frameRate(i){return sv(i)},startNumber(i){return parseInt(i,10)},timescale(i){return parseInt(i,10)},presentationTimeOffset(i){return parseInt(i,10)},duration(i){const e=parseInt(i,10);return isNaN(e)?Ss(i):e},d(i){return parseInt(i,10)},t(i){return parseInt(i,10)},r(i){return parseInt(i,10)},presentationTime(i){return parseInt(i,10)},DEFAULT(i){return i}},qe=i=>i&&i.attributes?Hh(i.attributes).reduce((e,t)=>{const s=Jc[t.name]||Jc.DEFAULT;return e[t.name]=s(t.value),e},{}):{},nv={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"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:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},ka=(i,e)=>e.length?$s(i.map(function(t){return e.map(function(s){const r=rn(s),n=Dl(t.baseUrl,r),a=ze(qe(s),{baseUrl:n});return n!==r&&!a.serviceLocation&&t.serviceLocation&&(a.serviceLocation=t.serviceLocation),a})})):i,jl=i=>{const e=De(i,"SegmentTemplate")[0],t=De(i,"SegmentList")[0],s=t&&De(t,"SegmentURL").map(_=>ze({tag:"SegmentURL"},qe(_))),r=De(i,"SegmentBase")[0],n=t||e,a=n&&De(n,"SegmentTimeline")[0],o=t||r||e,u=o&&De(o,"Initialization")[0],h=e&&qe(e);h&&u?h.initialization=u&&qe(u):h&&h.initialization&&(h.initialization={sourceURL:h.initialization});const m={template:h,segmentTimeline:a&&De(a,"S").map(_=>qe(_)),list:t&&ze(qe(t),{segmentUrls:s,initialization:qe(u)}),base:r&&ze(qe(r),{initialization:qe(u)})};return Object.keys(m).forEach(_=>{m[_]||delete m[_]}),m},av=(i,e,t)=>s=>{const r=De(s,"BaseURL"),n=ka(e,r),a=ze(i,qe(s)),o=jl(s);return n.map(u=>({segmentInfo:ze(t,o),attributes:ze(a,u)}))},ov=i=>i.reduce((e,t)=>{const s=qe(t);s.schemeIdUri&&(s.schemeIdUri=s.schemeIdUri.toLowerCase());const r=nv[s.schemeIdUri];if(r){e[r]={attributes:s};const n=De(t,"cenc:pssh")[0];if(n){const a=rn(n);e[r].pssh=a&&Y_(a)}}return e},{}),lv=i=>{if(i.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof i.value!="string"?[]:i.value.split(";")).map(t=>{let s,r;return r=t,/^CC\d=/.test(t)?[s,r]=t.split("="):/^CC\d$/.test(t)&&(s=t),{channel:s,language:r}});if(i.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof i.value!="string"?[]:i.value.split(";")).map(t=>{const s={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(t)){const[r,n=""]=t.split("=");s.channel=r,s.language=t,n.split(",").forEach(a=>{const[o,u]=a.split(":");o==="lang"?s.language=u:o==="er"?s.easyReader=Number(u):o==="war"?s.aspectRatio=Number(u):o==="3D"&&(s["3D"]=Number(u))})}else s.language=t;return s.channel&&(s.channel="SERVICE"+s.channel),s})},uv=i=>$s(De(i.node,"EventStream").map(e=>{const t=qe(e),s=t.schemeIdUri;return De(e,"Event").map(r=>{const n=qe(r),a=n.presentationTime||0,o=t.timescale||1,u=n.duration||0,h=a/o+i.attributes.start;return{schemeIdUri:s,value:t.value,id:n.id,start:h,end:h+u/o,messageData:rn(r)||n.messageData,contentEncoding:t.contentEncoding,presentationTimeOffset:t.presentationTimeOffset||0}})})),cv=(i,e,t)=>s=>{const r=qe(s),n=ka(e,De(s,"BaseURL")),a=De(s,"Role")[0],o={role:qe(a)};let u=ze(i,r,o);const h=De(s,"Accessibility")[0],m=lv(qe(h));m&&(u=ze(u,{captionServices:m}));const _=De(s,"Label")[0];if(_&&_.childNodes.length){const w=_.childNodes[0].nodeValue.trim();u=ze(u,{label:w})}const T=ov(De(s,"ContentProtection"));Object.keys(T).length&&(u=ze(u,{contentProtection:T}));const E=jl(s),A=De(s,"Representation"),y=ze(t,E);return $s(A.map(av(u,n,y)))},dv=(i,e)=>(t,s)=>{const r=ka(e,De(t.node,"BaseURL")),n=ze(i,{periodStart:t.attributes.start});typeof t.attributes.duration=="number"&&(n.periodDuration=t.attributes.duration);const a=De(t.node,"AdaptationSet"),o=jl(t.node);return $s(a.map(cv(n,r,o)))},hv=(i,e)=>{if(i.length>1&&e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!i.length)return null;const t=ze({serverURL:rn(i[0])},qe(i[0]));return t.queryBeforeStart=t.queryBeforeStart==="true",t},fv=({attributes:i,priorPeriodAttributes:e,mpdType:t})=>typeof i.start=="number"?i.start:e&&typeof e.start=="number"&&typeof e.duration=="number"?e.start+e.duration:!e&&t==="static"?0:null,pv=(i,e={})=>{const{manifestUri:t="",NOW:s=Date.now(),clientOffset:r=0,eventHandler:n=function(){}}=e,a=De(i,"Period");if(!a.length)throw new Error(qs.INVALID_NUMBER_OF_PERIOD);const o=De(i,"Location"),u=qe(i),h=ka([{baseUrl:t}],De(i,"BaseURL")),m=De(i,"ContentSteering");u.type=u.type||"static",u.sourceDuration=u.mediaPresentationDuration||0,u.NOW=s,u.clientOffset=r,o.length&&(u.locations=o.map(rn));const _=[];return a.forEach((T,E)=>{const A=qe(T),y=_[E-1];A.start=fv({attributes:A,priorPeriodAttributes:y?y.attributes:null,mpdType:u.type}),_.push({node:T,attributes:A})}),{locations:u.locations,contentSteeringInfo:hv(m,n),representationInfo:$s(_.map(dv(u,h))),eventStream:$s(_.map(uv))}},Wh=i=>{if(i==="")throw new Error(qs.DASH_EMPTY_MANIFEST);const e=new Ey;let t,s;try{t=e.parseFromString(i,"application/xml"),s=t&&t.documentElement.tagName==="MPD"?t.documentElement:null}catch{}if(!s||s&&s.getElementsByTagName("parsererror").length>0)throw new Error(qs.DASH_INVALID_XML);return s},mv=i=>{const e=De(i,"UTCTiming")[0];if(!e)return null;const t=qe(e);switch(t.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":t.method="HEAD";break;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":t.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":t.method="DIRECT",t.value=Date.parse(t.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(qs.UNSUPPORTED_UTC_TIMING_SCHEME)}return t},gv=(i,e={})=>{const t=pv(Wh(i),e),s=iv(t.representationInfo);return Wy({dashPlaylists:s,locations:t.locations,contentSteering:t.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:t.eventStream})},_v=i=>mv(Wh(i));var Xh=Math.pow(2,32),yv=function(i){var e=new DataView(i.buffer,i.byteOffset,i.byteLength),t;return e.getBigUint64?(t=e.getBigUint64(0),t<Number.MAX_SAFE_INTEGER?Number(t):t):e.getUint32(0)*Xh+e.getUint32(4)},vv={getUint64:yv,MAX_UINT32:Xh},Zc=vv.getUint64,Tv=function(i){var e=new DataView(i.buffer,i.byteOffset,i.byteLength),t={version:i[0],flags:new Uint8Array(i.subarray(1,4)),references:[],referenceId:e.getUint32(4),timescale:e.getUint32(8)},s=12;t.version===0?(t.earliestPresentationTime=e.getUint32(s),t.firstOffset=e.getUint32(s+4),s+=8):(t.earliestPresentationTime=Zc(i.subarray(s)),t.firstOffset=Zc(i.subarray(s+8)),s+=16),s+=2;var r=e.getUint16(s);for(s+=2;r>0;s+=12,r--)t.references.push({referenceType:(i[s]&128)>>>7,referencedSize:e.getUint32(s)&2147483647,subsegmentDuration:e.getUint32(s+4),startsWithSap:!!(i[s+8]&128),sapType:(i[s+8]&112)>>>4,sapDeltaTime:e.getUint32(s+8)&268435455});return t},bv=Tv;const Sv=Ks(bv);var xv=te([73,68,51]),Ev=function(e,t){t===void 0&&(t=0),e=te(e);var s=e[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],n=(s&16)>>4;return n?r+20:r+10},Nr=function i(e,t){return t===void 0&&(t=0),e=te(e),e.length-t<10||!we(e,xv,{offset:t})?t:(t+=Ev(e,t),i(e,t))},ed=function(e){return typeof e=="string"?dh(e):e},Cv=function(e){return Array.isArray(e)?e.map(function(t){return ed(t)}):[ed(e)]},Av=function i(e,t,s){s===void 0&&(s=!1),t=Cv(t),e=te(e);var r=[];if(!t.length)return r;for(var n=0;n<e.length;){var a=(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3])>>>0,o=e.subarray(n+4,n+8);if(a===0)break;var u=n+a;if(u>e.length){if(s)break;u=e.length}var h=e.subarray(n+8,u);we(o,t[0])&&(t.length===1?r.push(h):r.push.apply(r,i(h,t.slice(1),s))),n=u}return r},qn={EBML:te([26,69,223,163]),DocType:te([66,130]),Segment:te([24,83,128,103]),SegmentInfo:te([21,73,169,102]),Tracks:te([22,84,174,107]),Track:te([174]),TrackNumber:te([215]),DefaultDuration:te([35,227,131]),TrackEntry:te([174]),TrackType:te([131]),FlagDefault:te([136]),CodecID:te([134]),CodecPrivate:te([99,162]),VideoTrack:te([224]),AudioTrack:te([225]),Cluster:te([31,67,182,117]),Timestamp:te([231]),TimestampScale:te([42,215,177]),BlockGroup:te([160]),BlockDuration:te([155]),Block:te([161]),SimpleBlock:te([163])},Jo=[128,64,32,16,8,4,2,1],wv=function(e){for(var t=1,s=0;s<Jo.length&&!(e&Jo[s]);s++)t++;return t},ia=function(e,t,s,r){s===void 0&&(s=!0),r===void 0&&(r=!1);var n=wv(e[t]),a=e.subarray(t,t+n);return s&&(a=Array.prototype.slice.call(e,t,t+n),a[0]^=Jo[n-1]),{length:n,value:V_(a,{signed:r}),bytes:a}},td=function i(e){return typeof e=="string"?e.match(/.{1,2}/g).map(function(t){return i(t)}):typeof e=="number"?z_(e):e},Dv=function(e){return Array.isArray(e)?e.map(function(t){return td(t)}):[td(e)]},Iv=function i(e,t,s){if(s>=t.length)return t.length;var r=ia(t,s,!1);if(we(e.bytes,r.bytes))return s;var n=ia(t,s+r.length);return i(e,t,s+n.length+n.value+r.length)},id=function i(e,t){t=Dv(t),e=te(e);var s=[];if(!t.length)return s;for(var r=0;r<e.length;){var n=ia(e,r,!1),a=ia(e,r+n.length),o=r+n.length+a.length;a.value===127&&(a.value=Iv(n,e,o),a.value!==e.length&&(a.value-=o));var u=o+a.value>e.length?e.length:o+a.value,h=e.subarray(o,u);we(t[0],n.bytes)&&(t.length===1?s.push(h):s=s.concat(i(h,t.slice(1))));var m=n.length+a.length+h.length;r+=m}return s},kv=te([0,0,0,1]),Pv=te([0,0,1]),Lv=te([0,0,3]),Ov=function(e){for(var t=[],s=1;s<e.length-2;)we(e.subarray(s,s+3),Lv)&&(t.push(s+2),s++),s++;if(t.length===0)return e;var r=e.length-t.length,n=new Uint8Array(r),a=0;for(s=0;s<r;a++,s++)a===t[0]&&(a++,t.shift()),n[s]=e[a];return n},Kh=function(e,t,s,r){e=te(e),s=[].concat(s);for(var n=0,a,o=0;n<e.length&&(o<r||a);){var u=void 0;if(we(e.subarray(n),kv)?u=4:we(e.subarray(n),Pv)&&(u=3),!u){n++;continue}if(o++,a)return Ov(e.subarray(a,n));var h=void 0;t==="h264"?h=e[n+u]&31:t==="h265"&&(h=e[n+u]>>1&63),s.indexOf(h)!==-1&&(a=n+u),n+=u+(t==="h264"?1:2)}return e.subarray(0,0)},Rv=function(e,t,s){return Kh(e,"h264",t,s)},Nv=function(e,t,s){return Kh(e,"h265",t,s)},nt={webm:te([119,101,98,109]),matroska:te([109,97,116,114,111,115,107,97]),flac:te([102,76,97,67]),ogg:te([79,103,103,83]),ac3:te([11,119]),riff:te([82,73,70,70]),avi:te([65,86,73]),wav:te([87,65,86,69]),"3gp":te([102,116,121,112,51,103]),mp4:te([102,116,121,112]),fmp4:te([115,116,121,112]),mov:te([102,116,121,112,113,116]),moov:te([109,111,111,118]),moof:te([109,111,111,102])},js={aac:function(e){var t=Nr(e);return we(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Nr(e);return we(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=id(e,[qn.EBML,qn.DocType])[0];return we(t,nt.webm)},mkv:function(e){var t=id(e,[qn.EBML,qn.DocType])[0];return we(t,nt.matroska)},mp4:function(e){if(js["3gp"](e)||js.mov(e))return!1;if(we(e,nt.mp4,{offset:4})||we(e,nt.fmp4,{offset:4})||we(e,nt.moof,{offset:4})||we(e,nt.moov,{offset:4}))return!0},mov:function(e){return we(e,nt.mov,{offset:4})},"3gp":function(e){return we(e,nt["3gp"],{offset:4})},ac3:function(e){var t=Nr(e);return we(e,nt.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return e[0]===71;for(var t=0;t+188<e.length&&t<188;){if(e[t]===71&&e[t+188]===71)return!0;t+=1}return!1},flac:function(e){var t=Nr(e);return we(e,nt.flac,{offset:t})},ogg:function(e){return we(e,nt.ogg)},avi:function(e){return we(e,nt.riff)&&we(e,nt.avi,{offset:8})},wav:function(e){return we(e,nt.riff)&&we(e,nt.wav,{offset:8})},h264:function(e){return Rv(e,7,3).length},h265:function(e){return Nv(e,[32,33],3).length}},Zo=Object.keys(js).filter(function(i){return i!=="ts"&&i!=="h264"&&i!=="h265"}).concat(["ts","h264","h265"]);
23Zo.forEach(function(i){var e=js[i];js[i]=function(t){return e(te(t))}});var Mv=js,Hl=function(e){e=te(e);for(var t=0;t<Zo.length;t++){var s=Zo[t];if(Mv[s](e))return s}return""},Bv=function(e){return Av(e,["moof"]).length>0},Vl=9e4,zl,Gl,Pa,Wl,Yh,Qh,Jh;zl=function(i){return i*Vl};Gl=function(i,e){return i*e};Pa=function(i){return i/Vl};Wl=function(i,e){return i/e};Yh=function(i,e){return zl(Wl(i,e))};Qh=function(i,e){return Gl(Pa(i),e)};Jh=function(i,e,t){return Pa(t?i:i-e)};var Wi={ONE_SECOND_IN_TS:Vl,secondsToVideoTs:zl,secondsToAudioTs:Gl,videoTsToSeconds:Pa,audioTsToSeconds:Wl,audioTsToVideoTs:Yh,videoTsToAudioTs:Qh,metadataTsToSeconds:Jh};/** 24 * @license 25 * Video.js 8.19.0 <http://videojs.com/> 26 * Copyright Brightcove, Inc. <https://www.brightcove.com/> 27 * Available under Apache License Version 2.0 28 * <https://github.com/videojs/video.js/blob/main/LICENSE> 29 * 30 * Includes vtt.js <https://github.com/mozilla/vtt.js> 31 * Available under Apache License Version 2.0 32 * <https://github.com/mozilla/vtt.js/blob/main/LICENSE> 33 */var el="8.19.0";const li={},Di=function(i,e){return li[i]=li[i]||[],e&&(li[i]=li[i].concat(e)),li[i]},Fv=function(i,e){Di(i,e)},Zh=function(i,e){const t=Di(i).indexOf(e);return t<=-1?!1:(li[i]=li[i].slice(),li[i].splice(t,1),!0)},Uv=function(i,e){Di(i,[].concat(e).map(t=>{const s=(...r)=>(Zh(i,s),t(...r));return s}))},sa={prefixed:!0},Wn=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],sd=Wn[0];let Mr;for(let i=0;i<Wn.length;i++)if(Wn[i][1]in V){Mr=Wn[i];break}if(Mr){for(let i=0;i<Mr.length;i++)sa[sd[i]]=Mr[i];sa.prefixed=Mr[0]!==sd[0]}let ft=[];const $v=(i,e,t)=>(s,r,n)=>{const a=e.levels[r],o=new RegExp(`^(${a})$`);let u=i;if(s!=="log"&&n.unshift(s.toUpperCase()+":"),t&&(u=`%c${i}`,n.unshift(t)),n.unshift(u+":"),ft){ft.push([].concat(n));const m=ft.length-1e3;ft.splice(0,m>0?m:0)}if(!x.console)return;let h=x.console[s];!h&&s==="debug"&&(h=x.console.info||x.console.log),!(!h||!a||!o.test(s))&&h[Array.isArray(n)?"apply":"call"](x.console,n)};function tl(i,e=":",t=""){let s="info",r;function n(...a){r("log",s,a)}return r=$v(i,n,t),n.createLogger=(a,o,u)=>{const h=o!==void 0?o:e,m=u!==void 0?u:t,_=`${i} ${h} ${a}`;return tl(_,h,m)},n.createNewLogger=(a,o,u)=>tl(a,o,u),n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:s},n.level=a=>{if(typeof a=="string"){if(!n.levels.hasOwnProperty(a))throw new Error(`"${a}" in not a valid log level`);s=a}return s},n.history=()=>ft?[].concat(ft):[],n.history.filter=a=>(ft||[]).filter(o=>new RegExp(`.*${a}.*`).test(o[0])),n.history.clear=()=>{ft&&(ft.length=0)},n.history.disable=()=>{ft!==null&&(ft.length=0,ft=null)},n.history.enable=()=>{ft===null&&(ft=[])},n.error=(...a)=>r("error",s,a),n.warn=(...a)=>r("warn",s,a),n.debug=(...a)=>r("debug",s,a),n}const oe=tl("VIDEOJS"),ef=oe.createLogger,qv=Object.prototype.toString,tf=function(i){return ii(i)?Object.keys(i):[]};function Is(i,e){tf(i).forEach(t=>e(i[t],t))}function sf(i,e,t=0){return tf(i).reduce((s,r)=>e(s,i[r],r),t)}function ii(i){return!!i&&typeof i=="object"}function Hs(i){return ii(i)&&qv.call(i)==="[object Object]"&&i.constructor===Object}function Ee(...i){const e={};return i.forEach(t=>{t&&Is(t,(s,r)=>{if(!Hs(s)){e[r]=s;return}Hs(e[r])||(e[r]={}),e[r]=Ee(e[r],s)})}),e}function rf(i={}){const e=[];for(const t in i)if(i.hasOwnProperty(t)){const s=i[t];e.push(s)}return e}function La(i,e,t,s=!0){const r=a=>Object.defineProperty(i,e,{value:a,enumerable:!0,writable:!0}),n={configurable:!0,enumerable:!0,get(){const a=t();return r(a),a}};return s&&(n.set=r),Object.defineProperty(i,e,n)}var jv=Object.freeze({__proto__:null,each:Is,reduce:sf,isObject:ii,isPlain:Hs,merge:Ee,values:rf,defineLazyProperty:La});let Xl=!1,nf=null,si=!1,af,of=!1,ks=!1,Ps=!1,ri=!1,Kl=null,Oa=null;const Hv=!!(x.cast&&x.cast.framework&&x.cast.framework.CastReceiverContext);let lf=null,ra=!1,Ra=!1,na=!1,Na=!1,aa=!1,oa=!1,la=!1;const Yr=!!(Qs()&&("ontouchstart"in x||x.navigator.maxTouchPoints||x.DocumentTouch&&x.document instanceof x.DocumentTouch)),Ei=x.navigator&&x.navigator.userAgentData;Ei&&Ei.platform&&Ei.brands&&(si=Ei.platform==="Android",ks=!!Ei.brands.find(i=>i.brand==="Microsoft Edge"),Ps=!!Ei.brands.find(i=>i.brand==="Chromium"),ri=!ks&&Ps,Kl=Oa=(Ei.brands.find(i=>i.brand==="Chromium")||{}).version||null,Ra=Ei.platform==="Windows");if(!Ps){const i=x.navigator&&x.navigator.userAgent||"";Xl=/iPod/i.test(i),nf=function(){const e=i.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),si=/Android/i.test(i),af=function(){const e=i.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const t=e[1]&&parseFloat(e[1]),s=e[2]&&parseFloat(e[2]);return t&&s?parseFloat(e[1]+"."+e[2]):t||null}(),of=/Firefox/i.test(i),ks=/Edg/i.test(i),Ps=/Chrome/i.test(i)||/CriOS/i.test(i),ri=!ks&&Ps,Kl=Oa=function(){const e=i.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),lf=function(){const e=/MSIE\s(\d+)\.\d/.exec(i);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(i)&&/rv:11.0/.test(i)&&(t=11),t}(),aa=/Tizen/i.test(i),oa=/Web0S/i.test(i),la=aa||oa,ra=/Safari/i.test(i)&&!ri&&!si&&!ks&&!la,Ra=/Windows/i.test(i),na=/iPad/i.test(i)||ra&&Yr&&!/iPhone/i.test(i),Na=/iPhone/i.test(i)&&!na}const ut=Na||na||Xl,Ma=(ra||ut)&&!ri;var uf=Object.freeze({__proto__:null,get IS_IPOD(){return Xl},get IOS_VERSION(){return nf},get IS_ANDROID(){return si}
33,get ANDROID_VERSION(){return af},get IS_FIREFOX(){return of},get IS_EDGE(){return ks},get IS_CHROMIUM(){return Ps},get IS_CHROME(){return ri},get CHROMIUM_VERSION(){return Kl},get CHROME_VERSION(){return Oa},IS_CHROMECAST_RECEIVER:Hv,get IE_VERSION(){return lf},get IS_SAFARI(){return ra},get IS_WINDOWS(){return Ra},get IS_IPAD(){return na},get IS_IPHONE(){return Na},get IS_TIZEN(){return aa},get IS_WEBOS(){return oa},get IS_SMART_TV(){return la},TOUCH_ENABLED:Yr,IS_IOS:ut,IS_ANY_SAFARI:Ma});function rd(i){return typeof i=="string"&&!!i.trim()}function Vv(i){if(i.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function Qs(){return V===x.document}function Js(i){return ii(i)&&i.nodeType===1}function cf(){try{return x.parent!==x.self}catch{return!0}}function df(i){return function(e,t){if(!rd(e))return V[i](null);rd(t)&&(t=V.querySelector(t));const s=Js(t)?t:V;return s[i]&&s[i](e)}}function se(i="div",e={},t={},s){const r=V.createElement(i);return Object.getOwnPropertyNames(e).forEach(function(n){const a=e[n];n==="textContent"?Pi(r,a):(r[n]!==a||n==="tabIndex")&&(r[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){r.setAttribute(n,t[n])}),s&&Yl(r,s),r}function Pi(i,e){return typeof i.textContent>"u"?i.innerText=e:i.textContent=e,i}function il(i,e){e.firstChild?e.insertBefore(i,e.firstChild):e.appendChild(i)}function $r(i,e){return Vv(e),i.classList.contains(e)}function Yi(i,...e){return i.classList.add(...e.reduce((t,s)=>t.concat(s.split(/\s+/)),[])),i}function Ba(i,...e){return i?(i.classList.remove(...e.reduce((t,s)=>t.concat(s.split(/\s+/)),[])),i):(oe.warn("removeClass was called with an element that doesn't exist"),null)}function hf(i,e,t){return typeof t=="function"&&(t=t(i,e)),typeof t!="boolean"&&(t=void 0),e.split(/\s+/).forEach(s=>i.classList.toggle(s,t)),i}function ff(i,e){Object.getOwnPropertyNames(e).forEach(function(t){const s=e[t];s===null||typeof s>"u"||s===!1?i.removeAttribute(t):i.setAttribute(t,s===!0?"":s)})}function Ai(i){const e={},t=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(i&&i.attributes&&i.attributes.length>0){const s=i.attributes;for(let r=s.length-1;r>=0;r--){const n=s[r].name;let a=s[r].value;t.includes(n)&&(a=a!==null),e[n]=a}}return e}function pf(i,e){return i.getAttribute(e)}function Vs(i,e,t){i.setAttribute(e,t)}function Fa(i,e){i.removeAttribute(e)}function mf(){V.body.focus(),V.onselectstart=function(){return!1}}function gf(){V.onselectstart=function(){return!0}}function zs(i){if(i&&i.getBoundingClientRect&&i.parentNode){const e=i.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(s=>{e[s]!==void 0&&(t[s]=e[s])}),t.height||(t.height=parseFloat(Gs(i,"height"))),t.width||(t.width=parseFloat(Gs(i,"width"))),t}}function Qr(i){if(!i||i&&!i.offsetParent)return{left:0,top:0,width:0,height:0};const e=i.offsetWidth,t=i.offsetHeight;let s=0,r=0;for(;i.offsetParent&&i!==V[sa.fullscreenElement];)s+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;return{left:s,top:r,width:e,height:t}}function Ua(i,e){const t={x:0,y:0};if(ut){let m=i;for(;m&&m.nodeName.toLowerCase()!=="html";){const _=Gs(m,"transform");
vendor: 46,194 bytes, line 33
33if(/^matrix/.test(_)){const T=_.slice(7,-1).split(/,\s/).map(Number);t.x+=T[4],t.y+=T[5]}else if(/^matrix3d/.test(_)){const T=_.slice(9,-1).split(/,\s/).map(Number);t.x+=T[12],t.y+=T[13]}if(m.assignedSlot&&m.assignedSlot.parentElement&&x.WebKitCSSMatrix){const T=x.getComputedStyle(m.assignedSlot.parentElement).transform,E=new x.WebKitCSSMatrix(T);t.x+=E.m41,t.y+=E.m42}m=m.parentNode||m.host}}const s={},r=Qr(e.target),n=Qr(i),a=n.width,o=n.height;let u=e.offsetY-(n.top-r.top),h=e.offsetX-(n.left-r.left);return e.changedTouches&&(h=e.changedTouches[0].pageX-n.left,u=e.changedTouches[0].pageY+n.top,ut&&(h-=t.x,u-=t.y)),s.y=1-Math.max(0,Math.min(1,u/o)),s.x=Math.max(0,Math.min(1,h/a)),s}function _f(i){return ii(i)&&i.nodeType===3}function $a(i){for(;i.firstChild;)i.removeChild(i.firstChild);return i}function yf(i){return typeof i=="function"&&(i=i()),(Array.isArray(i)?i:[i]).map(e=>{if(typeof e=="function"&&(e=e()),Js(e)||_f(e))return e;if(typeof e=="string"&&/\S/.test(e))return V.createTextNode(e)}).filter(e=>e)}function Yl(i,e){return yf(e).forEach(t=>i.appendChild(t)),i}function vf(i,e){return Yl($a(i),e)}function Jr(i){return i.button===void 0&&i.buttons===void 0||i.button===0&&i.buttons===void 0||i.type==="mouseup"&&i.button===0&&i.buttons===0||i.type==="mousedown"&&i.button===0&&i.buttons===0?!0:!(i.button!==0||i.buttons!==1)}const Ii=df("querySelector"),Tf=df("querySelectorAll");function Gs(i,e){if(!i||!e)return"";if(typeof x.getComputedStyle=="function"){let t;try{t=x.getComputedStyle(i)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}function bf(i){[...V.styleSheets].forEach(e=>{try{const t=[...e.cssRules].map(r=>r.cssText).join(""),s=V.createElement("style");s.textContent=t,i.document.head.appendChild(s)}catch{const s=V.createElement("link");s.rel="stylesheet",s.type=e.type,s.media=e.media.mediaText,s.href=e.href,i.document.head.appendChild(s)}})}var Sf=Object.freeze({__proto__:null,isReal:Qs,isEl:Js,isInFrame:cf,createEl:se,textContent:Pi,prependTo:il,hasClass:$r,addClass:Yi,removeClass:Ba,toggleClass:hf,setAttributes:ff,getAttributes:Ai,getAttribute:pf,setAttribute:Vs,removeAttribute:Fa,blockTextSelection:mf,unblockTextSelection:gf,getBoundingClientRect:zs,findPosition:Qr,getPointerPosition:Ua,isTextNode:_f,emptyEl:$a,normalizeContent:yf,appendContent:Yl,insertContent:vf,isSingleLeftClick:Jr,$:Ii,$$:Tf,computedStyle:Gs,copyStyleSheetsToWindow:bf});let xf=!1,sl;const zv=function(){if(sl.options.autoSetup===!1)return;const i=Array.prototype.slice.call(V.getElementsByTagName("video")),e=Array.prototype.slice.call(V.getElementsByTagName("audio")),t=Array.prototype.slice.call(V.getElementsByTagName("video-js")),s=i.concat(e,t);if(s&&s.length>0)for(let r=0,n=s.length;r<n;r++){const a=s[r];if(a&&a.getAttribute)a.player===void 0&&a.getAttribute("data-setup")!==null&&sl(a);else{rl(1);break}}else xf||rl(1)};function rl(i,e){Qs()&&(e&&(sl=e),x.setTimeout(zv,i))}function nl(){xf=!0,x.removeEventListener("load",nl)}Qs()&&(V.readyState==="complete"?nl():x.addEventListener("load",nl));const Ef=function(i){const e=V.createElement("style");return e.className=i,e},Cf=function(i,e){i.styleSheet?i.styleSheet.cssText=e:i.textContent=e};var lt=new WeakMap;const Gv=3;let Wv=Gv;function kt(){return Wv++}function nd(i,e){if(!lt.has(i))return;const t=lt.get(i);t.handlers[e].length===0&&(delete t.handlers[e],i.removeEventListener?i.removeEventListener(e,t.dispatcher,!1):i.detachEvent&&i.detachEvent("on"+e,t.dispatcher)),Object.getOwnPropertyNames(t.handlers).length<=0&&(delete t.handlers,delete t.dispatcher,delete t.disabled),Object.getOwnPropertyNames(t).length===0&<.delete(i)}function Ql(i,e,t,s){t.forEach(function(r){i(e,r,s)})}function qa(i){if(i.fixed_)return i;function e(){return!0}function t(){return!1}if(!i||!i.isPropagationStopped||!i.isImmediatePropagationStopped){const s=i||x.event;i={};const r=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(const n in s)r.includes(n)||n==="returnValue"&&s.preventDefault||(i[n]=s[n]);if(i.target||(i.target=i.srcElement||V),i.relatedTarget||(i.relatedTarget=i.fromElement===i.target?i.toElement:i.fromElement),i.preventDefault=function(){s.preventDefault&&s.preventDefault(),i.returnValue=!1,s.returnValue=!1,i.defaultPrevented=!0},i.defaultPrevented=!1,i.stopPropagation=function(){s.stopPropagation&&s.stopPropagation(),i.cancelBubble=!0,s.cancelBubble=!0,i.isPropagationStopped=e},i.isPropagationStopped=t,i.stopImmediatePropagation=function(){s.stopImmediatePropagation&&s.stopImmediatePropagation(),i.isImmediatePropagationStopped=e,i.stopPropagation()},i.isImmediatePropagationStopped=t,i.clientX!==null&&i.clientX!==void 0){const n=V.documentElement,a=V.body;i.pageX=i.clientX+(n&&n.scrollLeft||a&&a.scrollLeft||0)-(n&&n.clientLeft||a&&a.clientLeft||0),i.pageY=i.clientY+(n&&n.scrollTop||a&&a.scrollTop||0)-(n&&n.clientTop||a&&a.clientTop||0)}i.which=i.charCode||i.keyCode,i.button!==null&&i.button!==void 0&&(i.button=i.button&1?0:i.button&4?1:i.button&2?2:0)}return i.fixed_=!0,i}let jn;const Xv=function(){if(typeof jn!="boolean"){jn=!1;try{const i=Object.defineProperty({},"passive",{get(){jn=!0}});x.addEventListener("test",null,i),x.removeEventListener("test",null,i)}catch{}}return jn},Kv=["touchstart","touchmove"];function Et(i,e,t){if(Array.isArray(e))return Ql(Et,i,e,t);lt.has(i)||lt.set(i,{});const s=lt.get(i);if(s.handlers||(s.handlers={}),s.handlers[e]||(s.handlers[e]=[]),t.guid||(t.guid=kt()),s.handlers[e].push(t),s.dispatcher||(s.disabled=!1,s.dispatcher=function(r,n){if(s.disabled)return;r=qa(r);const a=s.handlers[r.type];if(a){const o=a.slice(0);for(let u=0,h=o.length;u<h&&!r.isImmediatePropagationStopped();u++)try{o[u].call(i,r,n)}catch(m){oe.error(m)}}}),s.handlers[e].length===1)if(i.addEventListener){let r=!1;Xv()&&Kv.indexOf(e)>-1&&(r={passive:!0}),i.addEventListener(e,s.dispatcher,r)}else i.attachEvent&&i.attachEvent("on"+e,s.dispatcher)}function Ze(i,e,t){if(!lt.has(i))return;const s=lt.get(i);if(!s.handlers)return;if(Array.isArray(e))return Ql(Ze,i,e,t);const r=function(a,o){s.handlers[o]=[],nd(a,o)};if(e===void 0){for(const a in s.handlers)Object.prototype.hasOwnProperty.call(s.handlers||{},a)&&r(i,a);return}const n=s.handlers[e];if(n){if(!t){r(i,e);return}if(t.guid)for(let a=0;a<n.length;a++)n[a].guid===t.guid&&n.splice(a--,1);nd(i,e)}}function Zs(i,e,t){const s=lt.has(i)?lt.get(i):{},r=i.parentNode||i.ownerDocument;if(typeof e=="string"?e={type:e,target:i}:e.target||(e.target=i),e=qa(e),s.dispatcher&&s.dispatcher.call(i,e,t),r&&!e.isPropagationStopped()&&e.bubbles===!0)Zs.call(null,r,e,t);else if(!r&&!e.defaultPrevented&&e.target&&e.target[e.type]){lt.has(e.target)||lt.set(e.target,{});const n=lt.get(e.target);e.target[e.type]&&(n.disabled=!0,typeof e.target[e.type]=="function"&&e.target[e.type](),n.disabled=!1)}return!e.defaultPrevented}function ja(i,e,t){if(Array.isArray(e))return Ql(ja,i,e,t);const s=function(){Ze(i,e,s),t.apply(this,arguments)};s.guid=t.guid=t.guid||kt(),Et(i,e,s)}function Jl(i,e,t){const s=function(){Ze(i,e,s),t.apply(this,arguments)};s.guid=t.guid=t.guid||kt(),Et(i,e,s)}var Yv=Object.freeze({__proto__:null,fixEvent:qa,on:Et,off:Ze,trigger:Zs,one:ja,any:Jl});const Pt=30,Ce=function(i,e,t){e.guid||(e.guid=kt());const s=e.bind(i);return s.guid=t?t+"_"+e.guid:e.guid,s},ni=function(i,e){let t=x.performance.now();return function(...r){const n=x.performance.now();n-t>=e&&(i(...r),t=n)}},Af=function(i,e,t,s=x){let r;const n=()=>{s.clearTimeout(r),r=null},a=function(){const o=this,u=arguments;let h=function(){r=null,h=null,t||i.apply(o,u)};!r&&t&&i.apply(o,u),s.clearTimeout(r),r=s.setTimeout(h,e)};return a.cancel=n,a};var Qv=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:Pt,bind_:Ce,throttle:ni,debounce:Af});let Ir;class Ct{on(e,t){const s=this.addEventListener;this.addEventListener=()=>{},Et(this,e,t),this.addEventListener=s}off(e,t){Ze(this,e,t)}one(e,t){const s=this.addEventListener;this.addEventListener=()=>{},ja(this,e,t),this.addEventListener=s}any(e,t){const s=this.addEventListener;this.addEventListener=()=>{},Jl(this,e,t),this.addEventListener=s}trigger(e){const t=e.type||e;typeof e=="string"&&(e={type:t}),e=qa(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Zs(this,e)}queueTrigger(e){Ir||(Ir=new Map);const t=e.type||e;let s=Ir.get(this);s||(s=new Map,Ir.set(this,s));const r=s.get(t);s.delete(t),x.clearTimeout(r);const n=x.setTimeout(()=>{s.delete(t),s.size===0&&(s=null,Ir.delete(this)),this.trigger(e)},0);s.set(t,n)}}Ct.prototype.allowedEvents_={};Ct.prototype.addEventListener=Ct.prototype.on;Ct.prototype.removeEventListener=Ct.prototype.off;Ct.prototype.dispatchEvent=Ct.prototype.trigger;const Ha=i=>typeof i.name=="function"?i.name():typeof i.name=="string"?i.name:i.name_?i.name_:i.constructor&&i.constructor.name?i.constructor.name:typeof i,di=i=>i instanceof Ct||!!i.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof i[e]=="function"),Jv=(i,e)=>{di(i)?e():(i.eventedCallbacks||(i.eventedCallbacks=[]),i.eventedCallbacks.push(e))},al=i=>typeof i=="string"&&/\S/.test(i)||Array.isArray(i)&&!!i.length,ua=(i,e,t)=>{if(!i||!i.nodeName&&!di(i))throw new Error(`Invalid target for ${Ha(e)}#${t}; must be a DOM node or evented object.`)},wf=(i,e,t)=>{if(!al(i))throw new Error(`Invalid event type for ${Ha(e)}#${t}; must be a non-empty string or array.`)},Df=(i,e,t)=>{if(typeof i!="function")throw new Error(`Invalid listener for ${Ha(e)}#${t}; must be a function.`)},Oo=(i,e,t)=>{const s=e.length<3||e[0]===i||e[0]===i.eventBusEl_;let r,n,a;return s?(r=i.eventBusEl_,e.length>=3&&e.shift(),[n,a]=e):(r=e[0],n=e[1],a=e[2]),ua(r,i,t),wf(n,i,t),Df(a,i,t),a=Ce(i,a),{isTargetingSelf:s,target:r,type:n,listener:a}},Vi=(i,e,t,s)=>{ua(i,i,e),i.nodeName?Yv[e](i,t,s):i[e](t,s)},Zv={on(...i){const{isTargetingSelf:e,target:t,type:s,listener:r}=Oo(this,i,"on");if(Vi(t,"on",s,r),!e){const n=()=>this.off(t,s,r);n.guid=r.guid;const a=()=>this.off("dispose",n);a.guid=r.guid,Vi(this,"on","dispose",n),Vi(t,"on","dispose",a)}},one(...i){const{isTargetingSelf:e,target:t,type:s,listener:r}=Oo(this,i,"one");if(e)Vi(t,"one",s,r);else{const n=(...a)=>{this.off(t,s,n),r.apply(null,a)};n.guid=r.guid,Vi(t,"one",s,n)}},any(...i){const{isTargetingSelf:e,target:t,type:s,listener:r}=Oo(this,i,"any");if(e)Vi(t,"any",s,r);else{const n=(...a)=>{this.off(t,s,n),r.apply(null,a)};n.guid=r.guid,Vi(t,"any",s,n)}},off(i,e,t){if(!i||al(i))Ze(this.eventBusEl_,i,e);else{const s=i,r=e;ua(s,this,"off"),wf(r,this,"off"),Df(t,this,"off"),t=Ce(this,t),this.off("dispose",t),s.nodeName?(Ze(s,r,t),Ze(s,"dispose",t)):di(s)&&(s.off(r,t),s.off("dispose",t))}},trigger(i,e){ua(this.eventBusEl_,this,"trigger");const t=i&&typeof i!="string"?i.type:i;if(!al(t))throw new Error(`Invalid event type for ${Ha(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return Zs(this.eventBusEl_,i,e)}};function Zl(i,e={}){const{eventBusKey:t}=e;if(t){if(!i[t].nodeName)throw new Error(`The eventBusKey "${t}" does not refer to an element.`);i.eventBusEl_=i[t]}else i.eventBusEl_=se("span",{className:"vjs-event-bus"});return Object.assign(i,Zv),i.eventedCallbacks&&i.eventedCallbacks.forEach(s=>{s()}),i.on("dispose",()=>{i.off(),[i,i.el_,i.eventBusEl_].forEach(function(s){s&<.has(s)&<.delete(s)}),x.setTimeout(()=>{i.eventBusEl_=null},0)}),i}const eT={state:{},setState(i){typeof i=="function"&&(i=i());let e;return Is(i,(t,s)=>{this.state[s]!==t&&(e=e||{},e[s]={from:this.state[s],to:t}),this.state[s]=t}),e&&di(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function If(i,e){return Object.assign(i,eT),i.state=Object.assign({},i.state,e),typeof i.handleStateChanged=="function"&&di(i)&&i.on("statechanged",i.handleStateChanged),i}const qr=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toLowerCase())},Ne=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toUpperCase())},kf=function(i,e){return Ne(i)===Ne(e)};var tT=Object.freeze({__proto__:null,toLowerCase:qr,toTitleCase:Ne,titleCaseEquals:kf});class U{constructor(e,t,s){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=Ee({},this.options_),t=this.options_=Ee(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const r=e&&e.id&&e.id()||"no_player";this.id_=`${r}_component_${kt()}`}this.name_=t.name||null,t.el?this.el_=t.el:t.createEl!==!1&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(r=>this.addClass(r)),["on","off","one","any","trigger"].forEach(r=>{this[r]=void 0}),t.evented!==!1&&(Zl(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),If(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,t.initChildren!==!1&&this.initChildren(),this.ready(s),t.reportTouchActivity!==!1&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let t=this.children_.length-1;t>=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e?(this.options_=Ee(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,s){return se(e,t,s)}localize(e,t,s=e){const r=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),a=n&&n[r],o=r&&r.split("-")[0],u=n&&n[o];let h=s;return a&&a[e]?h=a[e]:u&&u[e]&&(h=u[e]),t&&(h=h.replace(/\{(\d+)\}/g,function(m,_){const T=t[_-1];let E=T;return typeof T>"u"&&(E=m),E})),h}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((s,r)=>s.concat(r),[]);let t=this;for(let s=0;s<e.length;s++)if(t=t.getChild(e[s]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;const s="http://www.w3.org/2000/svg",r=se("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),n=V.createElementNS(s,"svg");n.setAttributeNS(null,"viewBox","0 0 512 512");const a=V.createElementNS(s,"use");return n.appendChild(a),a.setAttributeNS(null,"href",`#vjs-icon-${e}`),r.appendChild(n),this.iconIsSet_?t.replaceChild(r,t.querySelector(".vjs-icon-placeholder")):t.appendChild(r),this.iconIsSet_=!0,r}addChild(e,t={},s=this.children_.length){let r,n;if(typeof e=="string"){n=Ne(e);const a=t.componentClass||n;t.name=n;const o=U.getComponent(a);if(!o)throw new Error(`Component ${a} does not exist`);if(typeof o!="function")return null;r=new o(this.player_||this,t)}else r=e;if(r.parentComponent_&&r.parentComponent_.removeChild(r),this.children_.splice(s,0,r),r.parentComponent_=this,typeof r.id=="function"&&(this.childIndex_[r.id()]=r),n=n||r.name&&Ne(r.name()),n&&(this.childNameIndex_[n]=r,this.childNameIndex_[qr(n)]=r),typeof r.el=="function"&&r.el()){let a=null;this.children_[s+1]&&(this.children_[s+1].el_?a=this.children_[s+1].el_:Js(this.children_[s+1])&&(a=this.children_[s+1])),this.contentEl().insertBefore(r.el(),a)}return r}removeChild(e){if(typeof e=="string"&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let r=this.children_.length-1;r>=0;r--)if(this.children_[r]===e){t=!0,this.children_.splice(r,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[Ne(e.name())]=null,this.childNameIndex_[qr(e.name())]=null;const s=e.el();s&&s.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,s=a=>{const o=a.name;let u=a.opts;if(t[o]!==void 0&&(u=t[o]),u===!1)return;u===!0&&(u={}),u.playerOptions=this.options_.playerOptions;const h=this.addChild(o,u);h&&(this[o]=h)};let r;const n=U.getComponent("Tech");Array.isArray(e)?r=e:r=Object.keys(e),r.concat(Object.keys(this.options_).filter(function(a){return!r.some(function(o){return typeof o=="string"?a===o:a===o.name})})).map(a=>{let o,u;return typeof a=="string"?(o=a,u=e[o]||this.options_[o]||{}):(o=a.name,u=a),{name:o,opts:u}}).filter(a=>{const o=U.getComponent(a.opts.componentClass||Ne(a.name));return o&&!n.isTech(o)}).forEach(s)}}buildCSSClass(){return""}ready(e,t=!1){if(e){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e);return}t?e.call(this):this.setTimeout(e,1)}}triggerReady(){this.isReady_=!0,this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(t){t.call(this)},this),this.trigger("ready")},1)}$(e,t){return Ii(e,t||this.contentEl())}$$(e,t){return Tf(e,t||this.contentEl())}hasClass(e){return $r(this.el_,e)}addClass(...e){Yi(this.el_,...e)}removeClass(...e){Ba(this.el_,...e)}toggleClass(e,t){hf(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return pf(this.el_,e)}setAttribute(e,t){Vs(this.el_,e,t)}removeAttribute(e){Fa(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,s){if(t!==void 0){(t===null||t!==t)&&(t=0),(""+t).indexOf("%")!==-1||(""+t).indexOf("px")!==-1?this.el_.style[e]=t:t==="auto"?this.el_.style[e]="":this.el_.style[e]=t+"px",s||this.trigger("componentresize");return}if(!this.el_)return 0;const r=this.el_.style[e],n=r.indexOf("px");return parseInt(n!==-1?r.slice(0,n):this.el_["offset"+Ne(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(t=Gs(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){const s=`offset${Ne(e)}`;t=this.el_[s]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const e=this.el_.getBoundingClientRect(),t={x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},s={x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2};return{boundingClientRect:t,center:s}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(e.key!=="Tab"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)&&e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null;const s=10,r=200;let n;this.on("touchstart",function(o){o.touches.length===1&&(t={pageX:o.touches[0].pageX,pageY:o.touches[0].pageY},e=x.performance.now(),n=!0)}),this.on("touchmove",function(o){if(o.touches.length>1)n=!1;else if(t){const u=o.touches[0].pageX-t.pageX,h=o.touches[0].pageY-t.pageY;Math.sqrt(u*u+h*h)>s&&(n=!1)}});const a=function(){n=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",function(o){t=null,n===!0&&x.performance.now()-e<r&&(o.preventDefault(),this.trigger("tap"))})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=Ce(this.player(),this.player().reportUserActivity);let t;this.on("touchstart",function(){e(),this.clearInterval(t),t=this.setInterval(e,250)});const s=function(r){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",s),this.on("touchcancel",s)}setTimeout(e,t){var s;return e=Ce(this,e),this.clearTimersOnDispose_(),s=x.setTimeout(()=>{this.setTimeoutIds_.has(s)&&this.setTimeoutIds_.delete(s),e()},t),this.setTimeoutIds_.add(s),s}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),x.clearTimeout(e)),e}setInterval(e,t){e=Ce(this,e),this.clearTimersOnDispose_();const s=x.setInterval(e,t);return this.setIntervalIds_.add(s),s}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),x.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;return e=Ce(this,e),t=x.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=Ce(this,t);const s=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,s),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),x.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,t])=>{this[e].forEach((s,r)=>this[t](r))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return!!this.el_.disabled}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function t(n){const a=x.getComputedStyle(n,null),o=a.getPropertyValue("visibility");return a.getPropertyValue("display")!=="none"&&!["hidden","collapse"].includes(o)}function s(n){return!(!t(n.parentElement)||!t(n)||n.style.opacity==="0"||x.getComputedStyle(n).height==="0px"||x.getComputedStyle(n).width==="0px")}function r(n){if(n.offsetWidth+n.offsetHeight+n.getBoundingClientRect().height+n.getBoundingClientRect().width===0)return!1;const a={x:n.getBoundingClientRect().left+n.offsetWidth/2,y:n.getBoundingClientRect().top+n.offsetHeight/2};if(a.x<0||a.x>(V.documentElement.clientWidth||x.innerWidth)||a.y<0||a.y>(V.documentElement.clientHeight||x.innerHeight))return!1;let o=V.elementFromPoint(a.x,a.y);for(;o;){if(o===n)return!0;if(o.parentNode)o=o.parentNode;else return!1}}return e||(e=this.el()),!!(r(e)&&s(e)&&(!e.parentElement||e.tabIndex>=0))}static registerComponent(e,t){if(typeof e!="string"||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const s=U.getComponent("Tech"),r=s&&s.isTech(t),n=U===t||U.prototype.isPrototypeOf(t.prototype);if(r||!n){let o;throw r?o="techs must be registered using Tech.registerTech()":o="must be a Component subclass",new Error(`Illegal component, "${e}"; ${o}.`)}e=Ne(e),U.components_||(U.components_={});const a=U.getComponent("Player");if(e==="Player"&&a&&a.players){const o=a.players,u=Object.keys(o);if(o&&u.length>0&&u.map(h=>o[h]).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return U.components_[e]=t,U.components_[qr(e)]=t,t}static getComponent(e){if(!(!e||!U.components_))return U.components_[e]}}U.registerComponent("Component",U);function iT(i,e,t){if(typeof e!="number"||e<0||e>t)throw new Error(`Failed to execute '${i}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${t}).`)}function ad(i,e,t,s){return iT(i,s,t.length-1),t[s][e]}function Ro(i){let e;return i===void 0||i.length===0?e={length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:e={length:i.length,start:ad.bind(null,"start",0,i),end:ad.bind(null,"end",1,i)},x.Symbol&&x.Symbol.iterator&&(e[x.Symbol.iterator]=()=>(i||[]).values()),e}function Ut(i,e){return Array.isArray(i)?Ro(i):i===void 0||e===void 0?Ro():Ro([[i,e]])}const Pf=function(i,e){i=i<0?0:i;let t=Math.floor(i%60),s=Math.floor(i/60%60),r=Math.floor(i/3600);const n=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(r=s=t="-"),r=r>0||a>0?r+":":"",s=((r||n>=10)&&s<10?"0"+s:s)+":",t=t<10?"0"+t:t,r+s+t};let eu=Pf;function Lf(i){eu=i}function Of(){eu=Pf}function ts(i,e=i){return eu(i,e)}var sT=Object.freeze({__proto__:null,createTimeRanges:Ut,createTimeRange:Ut,setFormatTime:Lf,resetFormatTime:Of,formatTime:ts});function Rf(i,e){let t=0,s,r;if(!e)return 0;(!i||!i.length)&&(i=Ut(0,0));for(let n=0;n<i.length;n++)s=i.start(n),r=i.end(n),r>e&&(r=e),t+=r-s;return t/e}function Oe(i){if(i instanceof Oe)return i;typeof i=="number"?this.code=i:typeof i=="string"?this.message=i:ii(i)&&(typeof i.code=="number"&&(this.code=i.code),Object.assign(this,i)),this.message||(this.message=Oe.defaultMessages[this.code]||"")}Oe.prototype.code=0;Oe.prototype.message="";Oe.prototype.status=null;Oe.prototype.metadata=null;Oe.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];Oe.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};Oe.MEDIA_ERR_CUSTOM=0;Oe.prototype.MEDIA_ERR_CUSTOM=0;Oe.MEDIA_ERR_ABORTED=1;Oe.prototype.MEDIA_ERR_ABORTED=1;Oe.MEDIA_ERR_NETWORK=2;Oe.prototype.MEDIA_ERR_NETWORK=2;Oe.MEDIA_ERR_DECODE=3;Oe.prototype.MEDIA_ERR_DECODE=3;Oe.MEDIA_ERR_SRC_NOT_SUPPORTED=4;Oe.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4;Oe.MEDIA_ERR_ENCRYPTED=5;Oe.prototype.MEDIA_ERR_ENCRYPTED=5;function jr(i){return i!=null&&typeof i.then=="function"}function Yt(i){jr(i)&&i.then(null,e=>{})}const ol=function(i){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,s,r)=>(i[s]&&(t[s]=i[s]),t),{cues:i.cues&&Array.prototype.map.call(i.cues,function(t){return{startTime:t.startTime,endTime:t.endTime,text:t.text,id:t.id}})})},rT=function(i){const e=i.$$("track"),t=Array.prototype.map.call(e,r=>r.track);return Array.prototype.map.call(e,function(r){const n=ol(r.track);return r.src&&(n.src=r.src),n}).concat(Array.prototype.filter.call(i.textTracks(),function(r){return t.indexOf(r)===-1}).map(ol))},nT=function(i,e){return i.forEach(function(t){const s=e.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach(r=>s.addCue(r))}),e.textTracks()};var od={textTracksToJson:rT,jsonToTextTracks:nT,trackToJson_:ol};const No="vjs-modal-dialog";class er extends U{constructor(e,t){super(e,t),this.handleKeyDown_=s=>this.handleKeyDown(s),this.close_=s=>this.close(s),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=se("div",{className:`${No}-content`},{role:"document"}),this.descEl_=se("p",{className:`${No}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),Pi(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${No} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_){this.options_.fillAlways&&this.fill();return}const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if(typeof e=="boolean"){const t=this.closeable_=!!e;let s=this.getChild("closeButton");if(t&&!s){const r=this.contentEl_;this.contentEl_=this.el_,s=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=r,this.on(s,"close",this.close_)}!t&&s&&(this.off(s,"close",this.close_),this.removeChild(s),s.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),s=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,s.removeChild(t),this.empty(),vf(t,e),this.trigger("modalfill"),r?s.insertBefore(t,r):s.appendChild(t);const n=this.getChild("closeButton");n&&s.appendChild(n.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),$a(this.contentEl()),this.trigger("modalempty")}content(e){return typeof e<"u"&&(this.content_=e),this.content_}conditionalFocus_(){const e=V.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),e.key==="Escape"&&this.closeable()){e.preventDefault(),this.close();return}if(e.key!=="Tab")return;const t=this.focusableEls_(),s=this.el_.querySelector(":focus");let r;for(let n=0;n<t.length;n++)if(s===t[n]){r=n;break}V.activeElement===this.el_&&(r=0),e.shiftKey&&r===0?(t[t.length-1].focus(),e.preventDefault()):!e.shiftKey&&r===t.length-1&&(t[0].focus(),e.preventDefault())}focusableEls_(){const e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,t=>(t instanceof x.HTMLAnchorElement||t instanceof x.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof x.HTMLInputElement||t instanceof x.HTMLSelectElement||t instanceof x.HTMLTextAreaElement||t instanceof x.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof x.HTMLIFrameElement||t instanceof x.HTMLObjectElement||t instanceof x.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable"))}}er.prototype.options_={pauseOnOpen:!0,temporary:!0};U.registerComponent("ModalDialog",er);class Ws extends Ct{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t<e.length;t++)this.addTrack(e[t])}addTrack(e){const t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),this.tracks_.indexOf(e)===-1&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=()=>{this.trigger({track:e,type:"labelchange",target:this})},di(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let s=0,r=this.length;s<r;s++)if(this[s]===e){t=this[s],t.off&&t.off(),this.tracks_.splice(s,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let s=0,r=this.length;s<r;s++){const n=this[s];if(n.id===e){t=n;break}}return t}}Ws.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const i in Ws.prototype.allowedEvents_)Ws.prototype["on"+i]=null;const Mo=function(i,e){for(let t=0;t<i.length;t++)!Object.keys(i[t]).length||e.id===i[t].id||(i[t].enabled=!1)};class aT extends Ws{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){Mo(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&Mo(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,Mo(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}const Bo=function(i,e){for(let t=0;t<i.length;t++)!Object.keys(i[t]).length||e.id===i[t].id||(i[t].selected=!1)};class oT extends Ws{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){Bo(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let t=0;t<this.length;t++)if(this[t].selected)return t;return-1},set(){}})}addTrack(e){e.selected&&Bo(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,Bo(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}}class Nf extends Ws{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}}class lT{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,s=e.length;t<s;t++)this.addTrackElement_(e[t])}addTrackElement_(e){const t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.trackElements_[t]}}),this.trackElements_.indexOf(e)===-1&&this.trackElements_.push(e)}getTrackElementByTrack_(e){let t;for(let s=0,r=this.trackElements_.length;s<r;s++)if(e===this.trackElements_[s].track){t=this.trackElements_[s];break}return t}removeTrackElement_(e){for(let t=0,s=this.trackElements_.length;t<s;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&typeof this.trackElements_[t].track.off=="function"&&this.trackElements_[t].track.off(),typeof this.trackElements_[t].off=="function"&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}}}class ca{constructor(e){ca.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){const t=this.length||0;let s=0;const r=e.length;this.cues_=e,this.length_=e.length;const n=function(a){""+a in this||Object.defineProperty(this,""+a,{get(){return this.cues_[a]}})};if(t<r)for(s=t;s<r;s++)n.call(this,s)}getCueById(e){let t=null;for(let s=0,r=this.length;s<r;s++){const n=this[s];if(n.id===e){t=n;break}}return t}}const uT={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},cT={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},dT={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},ld={disabled:"disabled",hidden:"hidden",showing:"showing"};class tu extends Ct{constructor(e={}){super();const t={id:e.id||"vjs_track_"+kt(),kind:e.kind||"",language:e.language||""};let s=e.label||"";for(const r in t)Object.defineProperty(this,r,{get(){return t[r]},set(){}});Object.defineProperty(this,"label",{get(){return s},set(r){r!==s&&(s=r,this.trigger("labelchange"))}})}}const iu=function(i){return new URL(i,V.baseURI)},Mf=function(i){return new URL(i,V.baseURI).href},su=function(i){if(typeof i=="string"){const t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(i);if(t)return t.pop().toLowerCase()}return""},Va=function(i,e=x.location){return iu(i).origin!==e.origin};var hT=Object.freeze({__proto__:null,parseUrl:iu,getAbsoluteURL:Mf,getFileExtension:su,isCrossOrigin:Va});const ud=function(i,e){const t=new x.WebVTT.Parser(x,x.vttjs,x.WebVTT.StringDecoder()),s=[];t.oncue=function(r){e.addCue(r)},t.onparsingerror=function(r){s.push(r)},t.onflush=function(){e.trigger({type:"loadeddata",target:e})},t.parse(i),s.length>0&&(x.console&&x.console.groupCollapsed&&x.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),s.forEach(r=>oe.error(r)),x.console&&x.console.groupEnd&&x.console.groupEnd()),t.flush()},cd=function(i,e){const t={uri:i},s=Va(i);s&&(t.cors=s);const r=e.tech_.crossOrigin()==="use-credentials";r&&(t.withCredentials=r),sh(t,Ce(this,function(n,a,o){if(n)return oe.error(n,a);e.loaded_=!0,typeof x.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],u=>{if(u.type==="vttjserror"){oe.error(`vttjs failed to load, stopping trying to process ${e.src}`);return}return ud(o,e)}):ud(o,e)}))};class nn extends tu{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=Ee(e,{kind:dT[e.kind]||"subtitles",language:e.language||e.srclang||""});let s=ld[t.mode]||"disabled";const r=t.default;(t.kind==="metadata"||t.kind==="chapters")&&(s="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;const n=new ca(this.cues_),a=new ca(this.activeCues_);let o=!1;this.timeupdateHandler=Ce(this,function(h={}){if(!this.tech_.isDisposed()){if(!this.tech_.isReady_){h.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,o&&(this.trigger("cuechange"),o=!1),h.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});const u=()=>{this.stopTracking()};this.tech_.one("dispose",u),s!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get(){return r},set(){}},mode:{get(){return s},set(h){ld[h]&&s!==h&&(s=h,!this.preload_&&s!=="disabled"&&this.cues.length===0&&cd(this.src,this),this.stopTracking(),s!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?n:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return a;const h=this.tech_.currentTime(),m=[];for(let _=0,T=this.cues.length;_<T;_++){const E=this.cues[_];E.startTime<=h&&E.endTime>=h&&m.push(E)}if(o=!1,m.length!==this.activeCues_.length)o=!0;else for(let _=0;_<m.length;_++)this.activeCues_.indexOf(m[_])===-1&&(o=!0);return this.activeCues_=m,a.setCues_(this.activeCues_),a},set(){}}}),t.src?(this.src=t.src,this.preload_||(this.loaded_=!0),(this.preload_||t.kind!=="subtitles"&&t.kind!=="captions")&&cd(this.src,this)):this.loaded_=!0}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(e){let t=e;if(!("getCueAsHTML"in t)){t=new x.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(const r in e)r in t||(t[r]=e[r]);t.id=e.id,t.originalCue_=e}const s=this.tech_.textTracks();for(let r=0;r<s.length;r++)s[r]!==this&&s[r].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}removeCue(e){let t=this.cues_.length;for(;t--;){const s=this.cues_[t];if(s===e||s.originalCue_&&s.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}}nn.prototype.allowedEvents_={cuechange:"cuechange"};class Bf extends tu{constructor(e={}){const t=Ee(e,{kind:cT[e.kind]||""});super(t);let s=!1;Object.defineProperty(this,"enabled",{get(){return s},set(r){typeof r!="boolean"||r===s||(s=r,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class Ff extends tu{constructor(e={}){const t=Ee(e,{kind:uT[e.kind]||""});super(t);let s=!1;Object.defineProperty(this,"selected",{get(){return s},set(r){typeof r!="boolean"||r===s||(s=r,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class mi extends Ct{constructor(e={}){super();let t;const s=new nn(e);this.kind=s.kind,this.src=s.src,this.srclang=s.language,this.label=s.label,this.default=s.default,Object.defineProperties(this,{readyState:{get(){return t}},track:{get(){return s}}}),t=mi.NONE,s.addEventListener("loadeddata",()=>{t=mi.LOADED,this.trigger({type:"load",target:this})})}}mi.prototype.allowedEvents_={load:"load"};mi.NONE=0;mi.LOADING=1;mi.LOADED=2;mi.ERROR=3;const It={audio:{ListClass:aT,TrackClass:Bf,capitalName:"Audio"},video:{ListClass:oT,TrackClass:Ff,capitalName:"Video"},text:{ListClass:Nf,TrackClass:nn,capitalName:"Text"}};Object.keys(It).forEach(function(i){It[i].getterName=`${i}Tracks`,It[i].privateName=`${i}Tracks_`});const Xs={remoteText:{ListClass:Nf,TrackClass:nn,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:lT,TrackClass:mi,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},at=Object.assign({},It,Xs);Xs.names=Object.keys(Xs);It.names=Object.keys(It);at.names=[].concat(Xs.names).concat(It.names);function fT(i,e,t,s,r={}){const n=i.textTracks();r.kind=e,t&&(r.label=t),s&&(r.language=s),r.tech=i;const a=new at.text.TrackClass(r);return n.addTrack(a),a}class ae extends U{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=s=>this.onDurationChange(s),this.trackProgress_=s=>this.trackProgress(s),this.trackCurrentTime_=s=>this.trackCurrentTime(s),this.stopTrackingCurrentTime_=s=>this.stopTrackingCurrentTime(s),this.disposeSourceHandler_=s=>this.disposeSourceHandler(s),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),at.names.forEach(s=>{const r=at[s];e&&e[r.getterName]&&(this[r.privateName]=e[r.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(s=>{e[`native${s}Tracks`]===!1&&(this[`featuresNative${s}Tracks`]=!1)}),e.nativeCaptions===!1||e.nativeTextTracks===!1?this.featuresNativeTextTracks=!1:(e.nativeCaptions===!0||e.nativeTextTracks===!0)&&(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=e.preloadTextTracks!==!1,this.autoRemoteTextTracks_=new at.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(Ce(this,function(){const t=this.bufferedPercent();this.bufferedPercent_!==t&&this.trigger("progress"),this.bufferedPercent_=t,t===1&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return Ut(0,0)}bufferedPercent(){return Rf(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(It.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){e=[].concat(e),e.forEach(t=>{const s=this[`${t}Tracks`]()||[];let r=s.length;for(;r--;){const n=s[r];t==="text"&&this.removeRemoteTextTrack(n),s.removeTrack(n)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const s=e[t];this.removeRemoteTextTrack(s)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new Oe(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?Ut(0,0):Ut()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}
vendor: 5,860 bytes, line 33
33initTrackListeners(){It.names.forEach(e=>{const t=It[e],s=()=>{this.trigger(`${e}trackchange`)},r=this[t.getterName]();r.addEventListener("removetrack",s),r.addEventListener("addtrack",s),this.on("dispose",()=>{r.removeEventListener("removetrack",s),r.removeEventListener("addtrack",s)})})}addWebVttScript_(){if(!x.WebVTT)if(V.body.contains(this.el())){if(!this.options_["vtt.js"]&&Hs(Cc)&&Object.keys(Cc).length>0){this.trigger("vttjsloaded");return}const e=V.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{e.onload=null,e.onerror=null}),x.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),s=o=>e.addTrack(o.track),r=o=>e.removeTrack(o.track);t.on("addtrack",s),t.on("removetrack",r),this.addWebVttScript_();const n=()=>this.trigger("texttrackchange"),a=()=>{n();for(let o=0;o<e.length;o++){const u=e[o];u.removeEventListener("cuechange",n),u.mode==="showing"&&u.addEventListener("cuechange",n)}};a(),e.addEventListener("change",a),e.addEventListener("addtrack",a),e.addEventListener("removetrack",a),this.on("dispose",function(){t.off("addtrack",s),t.off("removetrack",r),e.removeEventListener("change",a),e.removeEventListener("addtrack",a),e.removeEventListener("removetrack",a);for(let o=0;o<e.length;o++)e[o].removeEventListener("cuechange",n)})}addTextTrack(e,t,s){if(!e)throw new Error("TextTrack kind is required but was not provided");return fT(this,e,t,s)}createRemoteTextTrack(e){const t=Ee(e,{tech:this});return new Xs.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){const s=this.createRemoteTextTrack(e);return typeof t!="boolean"&&(t=!1),this.remoteTextTrackEls().addTrackElement_(s),this.remoteTextTracks().addTrack(s.track),t===!1&&this.ready(()=>this.autoRemoteTextTracks_.addTrack(s.track)),s}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=kt();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return ae.canPlayType(e.type)}static isTech(e){return e.prototype instanceof ae||e instanceof ae||e===ae}static registerTech(e,t){if(ae.techs_||(ae.techs_={}),!ae.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!ae.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!ae.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=Ne(e),ae.techs_[e]=t,ae.techs_[qr(e)]=t,e!=="Tech"&&ae.defaultTechOrder_.push(e),t}static getTech(e){if(e){if(ae.techs_&&ae.techs_[e])return ae.techs_[e];if(e=Ne(e),x&&x.videojs&&x.videojs[e])return oe.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),x.videojs[e]}}}at.names.forEach(function(i){const e=at[i];ae.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}});ae.prototype.featuresVolumeControl=!0;ae.prototype.featuresMuteControl=!0;ae.prototype.featuresFullscreenResize=!1;ae.prototype.featuresPlaybackRate=!1;ae.prototype.featuresProgressEvents=!1;ae.prototype.featuresSourceset=!1;ae.prototype.featuresTimeupdateEvents=!1;ae.prototype.featuresNativeTextTracks=!1;ae.prototype.featuresVideoFrameCallback=!1;ae.withSourceHandlers=function(i){i.registerSourceHandler=function(t,s){let r=i.sourceHandlers;r||(r=i.sourceHandlers=[]),s===void 0&&(s=r.length),r.splice(s,0,t)},i.canPlayType=function(t){const s=i.sourceHandlers||[];let r;for(let n=0;n<s.length;n++)if(r=s[n].canPlayType(t),r)return r;return""},i.selectSourceHandler=function(t,s){const r=i.sourceHandlers||[];let n;for(let a=0;a<r.length;a++)if(n=r[a].canHandleSource(t,s),n)return r[a];return null},i.canPlaySource=function(t,s){const r=i.selectSourceHandler(t,s);return r?r.canHandleSource(t,s):""},["seekable","seeking","duration"].forEach(function(t){const s=this[t];typeof s=="function"&&(this[t]=function(){return this.sourceHandler_&&this.sourceHandler_[t]?this.sourceHandler_[t].apply(this.sourceHandler_,arguments):s.apply(this,arguments)})},i.prototype),i.prototype.setSource=function(t){let s=i.selectSourceHandler(t,this.options_);s||(i.nativeSourceHandler?s=i.nativeSourceHandler:oe.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),s!==i.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=s.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},i.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}};U.registerComponent("Tech",ae);ae.registerTech("Tech",ae);ae.defaultTechOrder_=[];const Qi={},da={},ha={};function pT(i,e){Qi[i]=Qi[i]||[],Qi[i].push(e)}function mT(i,e,t){i.setTimeout(()=>
vendor: 2,298 bytes, line 33
33zi(e,Qi[e.type],t,i),1)}function gT(i,e){i.forEach(t=>t.setTech&&t.setTech(e))}function _T(i,e,t){return i.reduceRight(ru(t),e[t]())}function yT(i,e,t,s){return e[t](i.reduce(ru(t),s))}function dd(i,e,t,s=null){const r="call"+Ne(t),n=i.reduce(ru(r),s),a=n===ha,o=a?null:e[t](n);return bT(i,t,o,a),o}const vT={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},TT={setCurrentTime:1,setMuted:1,setVolume:1},hd={play:1,pause:1};function ru(i){return(e,t)=>e===ha?ha:t[i]?t[i](e):e}function bT(i,e,t,s){for(let r=i.length-1;r>=0;r--){const n=i[r];n[e]&&n[e](s,t)}}function ST(i){da.hasOwnProperty(i.id())&&delete da[i.id()]}function xT(i,e){const t=da[i.id()];let s=null;if(t==null)return s=e(i),da[i.id()]=[[e,s]],s;for(let r=0;r<t.length;r++){const[n,a]=t[r];n===e&&(s=a)}return s===null&&(s=e(i),t.push([e,s])),s}function zi(i={},e=[],t,s,r=[],n=!1){const[a,...o]=e;if(typeof a=="string")zi(i,Qi[a],t,s,r,n);else if(a){const u=xT(s,a);if(!u.setSource)return r.push(u),zi(i,o,t,s,r,n);u.setSource(Object.assign({},i),function(h,m){if(h)return zi(i,o,t,s,r,n);r.push(u),zi(m,i.type===m.type?o:Qi[m.type],t,s,r,n)})}else o.length?zi(i,o,t,s,r,n):n?t(i,r):zi(i,Qi["*"],t,s,r,!0)}const ET={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},fa=function(i=""){const e=su(i);return ET[e.toLowerCase()]||""},CT=(i,e)=>{if(!e)return"";if(i.cache_.source.src===e&&i.cache_.source.type)return i.cache_.source.type;const t=i.cache_.sources.filter(r=>r.src===e);if(t.length)return t[0].type;const s=i.$$("source");for(let r=0;r<s.length;r++){const n=s[r];if(n.type&&n.src&&n.src===e)return n.type}return fa(e)},Uf=function(i){if(Array.isArray(i)){let e=[];i.forEach(function(t){t=Uf(t),Array.isArray(t)?e=e.concat(t):ii(t)&&e.push(t)}),i=e}else typeof i=="string"&&i.trim()?i=[fd({src:i})]:ii(i)&&typeof i.src=="string"&&i.src&&i.src.trim()?i=[fd(i)]:i=[];return i};function fd(i){if(!i.type){const e=fa(i.src);e&&(i.type=e)}return i}var AT
vendor: 17,606 bytes, lines 33-175
33=`<svg xmlns="http://www.w3.org/2000/svg"> 34 <defs> 35 <symbol viewBox="0 0 48 48" id="vjs-icon-play"> 36 <path d="M16 10v28l22-14z"></path> 37 </symbol> 38 <symbol viewBox="0 0 48 48" id="vjs-icon-pause"> 39 <path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path> 40 </symbol> 41 <symbol viewBox="0 0 48 48" id="vjs-icon-audio"> 42 <path d="M24 2C14.06 2 6 10.06 6 20v14c0 3.31 2.69 6 6 6h6V24h-8v-4c0-7.73 6.27-14 14-14s14 6.27 14 14v4h-8v16h6c3.31 0 6-2.69 6-6V20c0-9.94-8.06-18-18-18z"></path> 43 </symbol> 44 <symbol viewBox="0 0 48 48" id="vjs-icon-captions"> 45 <path d="M38 8H10c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM22 22h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2zm14 0h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2z"></path> 46 </symbol> 47 <symbol viewBox="0 0 48 48" id="vjs-icon-subtitles"> 48 <path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"></path> 49 </symbol> 50 <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter"> 51 <path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path> 52 </symbol> 53 <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit"> 54 <path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path> 55 </symbol> 56 <symbol viewBox="0 0 48 48" id="vjs-icon-play-circle"> 57 <path d="M20 33l12-9-12-9v18zm4-29C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path> 58 </symbol> 59 <symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute"> 60 <path d="M33 24c0-3.53-2.04-6.58-5-8.05v4.42l4.91 4.91c.06-.42.09-.85.09-1.28zm5 0c0 1.88-.41 3.65-1.08 5.28l3.03 3.03C41.25 29.82 42 27 42 24c0-8.56-5.99-15.72-14-17.54v4.13c5.78 1.72 10 7.07 10 13.41zM8.55 6L6 8.55 15.45 18H6v12h8l10 10V26.55l8.51 8.51c-1.34 1.03-2.85 1.86-4.51 2.36v4.13a17.94 17.94 0 0 0 7.37-3.62L39.45 42 42 39.45l-18-18L8.55 6zM24 8l-4.18 4.18L24 16.36V8z"></path> 61 </symbol> 62 <symbol viewBox="0 0 48 48" id="vjs-icon-volume-low"> 63 <path d="M14 18v12h8l10 10V8L22 18h-8z"></path> 64 </symbol> 65 <symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium"> 66 <path d="M37 24c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zm-27-6v12h8l10 10V8L18 18h-8z"></path> 67 </symbol> 68 <symbol viewBox="0 0 48 48" id="vjs-icon-volume-high"> 69 <path d="M6 18v12h8l10 10V8L14 18H6zm27 6c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zM28 6.46v4.13c5.78 1.72 10 7.07 10 13.41s-4.22 11.69-10 13.41v4.13c8.01-1.82 14-8.97 14-17.54S36.01 8.28 28 6.46z"></path> 70 </symbol> 71 <symbol viewBox="0 0 48 48" id="vjs-icon-spinner"> 72 <path d="M18.8 21l9.53-16.51C26.94 4.18 25.49 4 24 4c-4.8 0-9.19 1.69-12.64 4.51l7.33 12.69.11-.2zm24.28-3c-1.84-5.85-6.3-10.52-11.99-12.68L23.77 18h19.31zm.52 2H28.62l.58 1 9.53 16.5C41.99 33.94 44 29.21 44 24c0-1.37-.14-2.71-.4-4zm-26.53 4l-7.8-13.5C6.01 14.06 4 18.79 4 24c0 1.37.14 2.71.4 4h14.98l-2.31-4zM4.92 30c1.84 5.85 6.3 10.52 11.99 12.68L24.23 30H4.92zm22.54 0l-7.8 13.51c1.4.31 2.85.49 4.34.49 4.8 0 9.19-1.69 12.64-4.51L29.31 26.8 27.46 30z"></path> 73 </symbol> 74 <symbol viewBox="0 0 24 24" id="vjs-icon-hd"> 75 <path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm2-6h4c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1h-4V9zm1.5 4.5h2v-3h-2v3z"></path> 76 </symbol> 77 <symbol viewBox="0 0 48 48" id="vjs-icon-chapters"> 78 <path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path> 79 </symbol> 80 <symbol viewBox="0 0 40 40" id="vjs-icon-downloading"> 81 <path d="M18.208 36.875q-3.208-.292-5.979-1.729-2.771-1.438-4.812-3.729-2.042-2.292-3.188-5.229-1.146-2.938-1.146-6.23 0-6.583 4.334-11.416 4.333-4.834 10.833-5.5v3.166q-5.167.75-8.583 4.646Q6.25 14.75 6.25 19.958q0 5.209 3.396 9.104 3.396 3.896 8.562 4.646zM20 28.417L11.542 20l2.083-2.083 4.917 4.916v-11.25h2.916v11.25l4.875-4.916L28.417 20zm1.792 8.458v-3.167q1.833-.25 3.541-.958 1.709-.708 3.167-1.875l2.333 2.292q-1.958 1.583-4.25 2.541-2.291.959-4.791 1.167zm6.791-27.792q-1.541-1.125-3.25-1.854-1.708-.729-3.541-1.021V3.042q2.5.25 4.77 1.208 2.271.958 4.271 2.5zm4.584 21.584l-2.25-2.25q1.166-1.5 1.854-3.209.687-1.708.937-3.541h3.209q-.292 2.5-1.229 4.791-.938 2.292-2.521 4.209zm.541-12.417q-.291-1.833-.958-3.562-.667-1.73-1.833-3.188l2.375-2.208q1.541 1.916 2.458 4.208.917 2.292 1.167 4.75z"></path> 82 </symbol> 83 <symbol viewBox="0 0 48 48" id="vjs-icon-file-download"> 84 <path d="M10.8 40.55q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h26.35v-7.7h3.4v7.7q0 1.4-1 2.4t-2.4 1zM24 32.1L13.9 22.05l2.45-2.45 5.95 5.95V7.15h3.4v18.4l5.95-5.95 2.45 2.45z"></path> 85 </symbol> 86 <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done"> 87 <path d="M9.8 40.5v-3.45h28.4v3.45zm9.2-9.05L7.4 19.85l2.45-2.35L19 26.65l19.2-19.2 2.4 2.4z"></path> 88 </symbol> 89 <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off"> 90 <path d="M4.9 4.75L43.25 43.1 41 45.3l-4.75-4.75q-.05.05-.075.025-.025-.025-.075-.025H10.8q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h22.05l-7-7-1.85 1.8L13.9 21.9l1.85-1.85L2.7 7zm26.75 14.7l2.45 2.45-3.75 3.8-2.45-2.5zM25.7 7.15V21.1l-3.4-3.45V7.15z"></path> 91 </symbol> 92 <symbol viewBox="0 0 48 48" id="vjs-icon-share"> 93 <path d="M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31A5.83 5.83 0 1 0 36 32.17z"></path> 94 </symbol> 95 <symbol viewBox="0 0 48 48" id="vjs-icon-cog"> 96 <path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3a14.8 14.8 0 0 0-3.38 1.97L9.9 10.1a1 1 0 0 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3a14.8 14.8 0 0 0 3.38-1.97l4.98 2.01a1 1 0 0 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"></path> 97 </symbol> 98 <symbol viewBox="0 0 48 48" id="vjs-icon-square"> 99 <path d="M36 8H12c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zm0 28H12V12h24v24z"></path> 100 </symbol> 101 <symbol viewBox="0 0 48 48" id="vjs-icon-circle"> 102 <circle cx="24" cy="24" r="20"></circle> 103 </symbol> 104 <symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline"> 105 <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path> 106 </symbol> 107 <symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle"> 108 <path d="M24 4C12.97 4 4 12.97 4 24s8.97 20 20 20 20-8.97 20-20S35.03 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm6-16c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6 6 2.69 6 6z"></path> 109 </symbol> 110 <symbol viewBox="0 0 48 48" id="vjs-icon-cancel"> 111 <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm10 27.17L31.17 34 24 26.83 16.83 34 14 31.17 21.17 24 14 16.83 16.83 14 24 21.17 31.17 14 34 16.83 26.83 24 34 31.17z"></path> 112 </symbol> 113 <symbol viewBox="0 0 48 48" id="vjs-icon-replay"> 114 <path d="M24 10V2L14 12l10 10v-8c6.63 0 12 5.37 12 12s-5.37 12-12 12-12-5.37-12-12H8c0 8.84 7.16 16 16 16s16-7.16 16-16-7.16-16-16-16z"></path> 115 </symbol> 116 <symbol viewBox="0 0 48 48" id="vjs-icon-repeat"> 117 <path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path> 118 </symbol> 119 <symbol viewBox="0 96 48 48" id="vjs-icon-replay-5"> 120 <path d="M17.689 98l-8.697 8.696 8.697 8.697 2.486-2.485-4.32-4.319h1.302c4.93 0 9.071 1.722 12.424 5.165 3.352 3.443 5.029 7.638 5.029 12.584h3.55c0-2.958-.553-5.73-1.658-8.313-1.104-2.583-2.622-4.841-4.555-6.774-1.932-1.932-4.19-3.45-6.773-4.555-2.584-1.104-5.355-1.657-8.313-1.657H15.5l4.615-4.615zm-8.08 21.659v13.861h11.357v5.008H9.609V143h12.7c.834 0 1.55-.298 2.146-.894.596-.597.895-1.31.895-2.145v-7.781c0-.835-.299-1.55-.895-2.147a2.929 2.929 0 0 0-2.147-.894h-8.227v-5.096H25.35v-4.384z"></path> 121 </symbol> 122 <symbol viewBox="0 96 48 48" id="vjs-icon-replay-10"> 123 <path d="M42.315 125.63c0-4.997-1.694-9.235-5.08-12.713-3.388-3.479-7.571-5.218-12.552-5.218h-1.315l4.363 4.363-2.51 2.51-8.787-8.786L25.221 97l2.45 2.45-4.662 4.663h1.375c2.988 0 5.788.557 8.397 1.673 2.61 1.116 4.892 2.65 6.844 4.602 1.953 1.953 3.487 4.234 4.602 6.844 1.116 2.61 1.674 5.41 1.674 8.398zM8.183 142v-19.657H3.176V117.8h9.643V142zm13.63 0c-1.156 0-2.127-.393-2.912-1.178-.778-.778-1.168-1.746-1.168-2.902v-16.04c0-1.156.393-2.127 1.178-2.912.779-.779 1.746-1.168 2.902-1.168h7.696c1.156 0 2.126.392 2.911 1.177.779.78 1.168 1.747 1.168 2.903v16.04c0 1.156-.392 2.127-1.177 2.912-.779.779-1.746 1.168-2.902 1.168zm.556-4.636h6.583v-15.02H22.37z"></path> 124 </symbol> 125 <symbol viewBox="0 96 48 48" id="vjs-icon-replay-30"> 126 <path d="M26.047 97l-8.733 8.732 8.733 8.733 2.496-2.494-4.336-4.338h1.307c4.95 0 9.108 1.73 12.474 5.187 3.367 3.458 5.051 7.668 5.051 12.635h3.565c0-2.97-.556-5.751-1.665-8.346-1.109-2.594-2.633-4.862-4.574-6.802-1.94-1.941-4.208-3.466-6.803-4.575-2.594-1.109-5.375-1.664-8.345-1.664H23.85l4.634-4.634zM2.555 117.531v4.688h10.297v5.25H5.873v4.687h6.979v5.156H2.555V142H13.36c1.061 0 1.95-.395 2.668-1.186.718-.79 1.076-1.772 1.076-2.94v-16.218c0-1.168-.358-2.149-1.076-2.94-.717-.79-1.607-1.185-2.668-1.185zm22.482.14c-1.149 0-2.11.39-2.885 1.165-.78.78-1.172 1.744-1.172 2.893v15.943c0 1.149.388 2.11 1.163 2.885.78.78 1.745 1.172 2.894 1.172h7.649c1.148 0 2.11-.388 2.884-1.163.78-.78 1.17-1.745 1.17-2.894v-15.943c0-1.15-.386-2.111-1.16-2.885-.78-.78-1.746-1.172-2.894-1.172zm.553 4.518h6.545v14.93H25.59z"></path> 127 </symbol> 128 <symbol viewBox="0 96 48 48" id="vjs-icon-forward-5"> 129 <path d="M29.508 97l-2.431 2.43 4.625 4.625h-1.364c-2.965 0-5.742.554-8.332 1.66-2.589 1.107-4.851 2.629-6.788 4.566-1.937 1.937-3.458 4.2-4.565 6.788-1.107 2.59-1.66 5.367-1.66 8.331h3.557c0-4.957 1.68-9.16 5.04-12.611 3.36-3.45 7.51-5.177 12.451-5.177h1.304l-4.326 4.33 2.49 2.49 8.715-8.716zm-9.783 21.61v13.89h11.382v5.018H19.725V142h12.727a2.93 2.93 0 0 0 2.15-.896 2.93 2.93 0 0 0 .896-2.15v-7.798c0-.837-.299-1.554-.896-2.152a2.93 2.93 0 0 0-2.15-.896h-8.245V123h11.29v-4.392z"></path> 130 </symbol> 131 <symbol viewBox="0 96 48 48" id="vjs-icon-forward-10"> 132 <path d="M23.119 97l-2.386 2.383 4.538 4.538h-1.339c-2.908 0-5.633.543-8.173 1.63-2.54 1.085-4.76 2.577-6.66 4.478-1.9 1.9-3.392 4.12-4.478 6.66-1.085 2.54-1.629 5.264-1.629 8.172h3.49c0-4.863 1.648-8.986 4.944-12.372 3.297-3.385 7.368-5.078 12.216-5.078h1.279l-4.245 4.247 2.443 2.442 8.55-8.55zm-9.52 21.45v4.42h4.871V142h4.513v-23.55zm18.136 0c-1.125 0-2.066.377-2.824 1.135-.764.764-1.148 1.709-1.148 2.834v15.612c0 1.124.38 2.066 1.139 2.824.764.764 1.708 1.145 2.833 1.145h7.489c1.125 0 2.066-.378 2.824-1.136.764-.764 1.145-1.709 1.145-2.833v-15.612c0-1.125-.378-2.067-1.136-2.825-.764-.764-1.708-1.145-2.833-1.145zm.54 4.42h6.408v14.617h-6.407z"></path> 133 </symbol> 134 <symbol viewBox="0 96 48 48" id="vjs-icon-forward-30"> 135 <path d="M25.549 97l-2.437 2.434 4.634 4.635H26.38c-2.97 0-5.753.555-8.347 1.664-2.594 1.109-4.861 2.633-6.802 4.574-1.94 1.94-3.465 4.207-4.574 6.802-1.109 2.594-1.664 5.377-1.664 8.347h3.565c0-4.967 1.683-9.178 5.05-12.636 3.366-3.458 7.525-5.187 12.475-5.187h1.307l-4.335 4.338 2.495 2.494 8.732-8.732zm-11.553 20.53v4.689h10.297v5.249h-6.978v4.688h6.978v5.156H13.996V142h10.808c1.06 0 1.948-.395 2.666-1.186.718-.79 1.077-1.771 1.077-2.94v-16.217c0-1.169-.36-2.15-1.077-2.94-.718-.79-1.605-1.186-2.666-1.186zm21.174.168c-1.149 0-2.11.389-2.884 1.163-.78.78-1.172 1.745-1.172 2.894v15.942c0 1.15.388 2.11 1.162 2.885.78.78 1.745 1.17 2.894 1.17h7.649c1.149 0 2.11-.386 2.885-1.16.78-.78 1.17-1.746 1.17-2.895v-15.942c0-1.15-.387-2.11-1.161-2.885-.78-.78-1.745-1.172-2.894-1.172zm.552 4.516h6.542v14.931h-6.542z"></path> 136 </symbol> 137 <symbol viewBox="0 0 512 512" id="vjs-icon-audio-description"> 138 <g fill-rule="evenodd"><path d="M227.29 381.351V162.993c50.38-1.017 89.108-3.028 117.631 17.126 27.374 19.342 48.734 56.965 44.89 105.325-4.067 51.155-41.335 94.139-89.776 98.475-24.085 2.155-71.972 0-71.972 0s-.84-1.352-.773-2.568m48.755-54.804c31.43 1.26 53.208-16.633 56.495-45.386 4.403-38.51-21.188-63.552-58.041-60.796v103.612c-.036 1.466.575 2.22 1.546 2.57"></path><path d="M383.78 381.328c13.336 3.71 17.387-11.06 23.215-21.408 12.722-22.571 22.294-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.226 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M425.154 381.328c13.336 3.71 17.384-11.061 23.215-21.408 12.721-22.571 22.291-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.511c-.586 3.874 2.226 7.315 3.866 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M466.26 381.328c13.337 3.71 17.385-11.061 23.216-21.408 12.722-22.571 22.292-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.225 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894M4.477 383.005H72.58l18.573-28.484 64.169-.135s.065 19.413.065 28.62h48.756V160.307h-58.816c-5.653 9.537-140.85 222.697-140.85 222.697zm152.667-145.282v71.158l-40.453-.27 40.453-70.888z"></path></g> 139 </symbol> 140 <symbol viewBox="0 0 48 48" id="vjs-icon-next-item"> 141 <path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path> 142 </symbol> 143 <symbol viewBox="0 0 48 48" id="vjs-icon-previous-item"> 144 <path d="M12 12h4v24h-4zm7 12l17 12V12z"></path> 145 </symbol> 146 <symbol viewBox="0 0 48 48" id="vjs-icon-shuffle"> 147 <path d="M21.17 18.34L10.83 8 8 10.83l10.34 10.34 2.83-2.83zM29 8l4.09 4.09L8 37.17 10.83 40l25.09-25.09L40 19V8H29zm.66 18.83l-2.83 2.83 6.26 6.26L29 40h11V29l-4.09 4.09-6.25-6.26z"></path> 148 </symbol> 149 <symbol viewBox="0 0 48 48" id="vjs-icon-cast"> 150 <path d="M42 6H6c-2.21 0-4 1.79-4 4v6h4v-6h36v28H28v4h14c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4zM2 36v6h6c0-3.31-2.69-6-6-6zm0-8v4c5.52 0 10 4.48 10 10h4c0-7.73-6.27-14-14-14zm0-8v4c9.94 0 18 8.06 18 18h4c0-12.15-9.85-22-22-22z"></path> 151 </symbol> 152 <symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter"> 153 <path d="M38 22H22v11.99h16V22zm8 16V9.96C46 7.76 44.2 6 42 6H6C3.8 6 2 7.76 2 9.96V38c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4zm-4 .04H6V9.94h36v28.1z"></path> 154 </symbol> 155 <symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit"> 156 <path d="M18 4H4v10h14V4zm4 12V1.98C22 .88 21.1 0 20 0H2C.9 0 0 .88 0 1.98V16c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H2V1.97h18v14.05z"></path> 157 <path fill="none" d="M-1-3h24v24H-1z"></path> 158 </symbol> 159 <symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook"> 160 <path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path> 161 </symbol> 162 <symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin"> 163 <path d="M477 625v991H147V625h330zm21-306q1 73-50.5 122T312 490h-2q-82 0-132-49t-50-122q0-74 51.5-122.5T314 148t133 48.5T498 319zm1166 729v568h-329v-530q0-105-40.5-164.5T1168 862q-63 0-105.5 34.5T999 982q-11 30-11 81v553H659q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52 87-43.5T1285 602q171 0 275 113.5t104 332.5z"></path> 164 </symbol> 165 <symbol viewBox="0 0 1200 1227" id="vjs-icon-twitter"> 166 <path d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z"/> 167 </symbol> 168 <symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr"> 169 <path d="M1328 1329l80 237q-23 35-111 66t-177 32q-104 2-190.5-26T787 1564t-95-106-55.5-120-16.5-118V676H452V461q72-26 129-69.5t91-90 58-102 34-99T779 12q1-5 4.5-8.5T791 0h244v424h333v252h-334v518q0 30 6.5 56t22.5 52.5 49.5 41.5 81.5 14q78-2 134-29z"></path> 170 </symbol> 171 <symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest"> 172 <path d="M1664 896q0 209-103 385.5T1281.5 1561 896 1664q-111 0-218-32 59-93 78-164 9-34 54-211 20 39 73 67.5t114 28.5q121 0 216-68.5t147-188.5 52-270q0-114-59.5-214T1180 449t-255-63q-105 0-196 29t-154.5 77-109 110.5-67 129.5T377 866q0 104 40 183t117 111q30 12 38-20 2-7 8-31t8-30q6-23-11-43-51-61-51-151 0-151 104.5-259.5T904 517q151 0 235.5 82t84.5 213q0 170-68.5 289T980 1220q-61 0-98-43.5T859 1072q8-35 26.5-93.5t30-103T927 800q0-50-27-83t-77-33q-62 0-105 57t-43 142q0 73 25 122l-99 418q-17 70-13 177-206-91-333-281T128 896q0-209 103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z"></path> 173 </symbol> 174 </defs> 175</svg>`
vendor: 10,986 bytes, line 175
175;const pd=aa?10009:oa?461:8,xs={codes:{play:415,pause:19,ff:417,rw:412,back:pd},names:{415:"play",19:"pause",417:"ff",412:"rw",[pd]:"back"},isEventKey(i,e){return e=e.toLowerCase(),!!(this.names[i.keyCode]&&this.names[i.keyCode]===e)},getEventName(i){if(this.names[i.keyCode])return this.names[i.keyCode];if(this.codes[i.code]){const e=this.codes[i.code];return this.names[e]}return null}},md=5;class wT extends Ct{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on("modalclose",()=>{this.refocusComponent()}),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){const t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();const s=t.key.substring(5).toLowerCase();this.move(s)}else if(xs.isEventKey(t,"play")||xs.isEventKey(t,"pause")||xs.isEventKey(t,"ff")||xs.isEventKey(t,"rw")){t.preventDefault();const s=xs.getEventName(t);this.performMediaAction_(s)}else xs.isEventKey(t,"Back")&&e.target&&typeof e.target.closeable=="function"&&e.target.closeable()&&(t.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+md);break;case"rw":this.userSeek_(this.player_.currentTime()-md);break}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){const t=e.relatedTarget;let s=null;const r=this.getCurrentComponent(e.target);t&&(s=!!t.closest(".video-js"),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(!e.currentTarget.contains(e.relatedTarget)&&!s||!t)&&(r&&r.name()==="CloseButton"?this.refocusComponent():(this.pause(),r&&r.el()&&(this.lastFocusedComponent_=r)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){const e=this.player_,t=[];function s(r){for(const n of r)n.hasOwnProperty("el_")&&n.getIsFocusable()&&n.getIsAvailableToBeFocused(n.el())&&t.push(n),n.hasOwnProperty("children_")&&n.children_.length>0&&s(n.children_)}return e.children_.forEach(r=>{if(r.hasOwnProperty("el_"))if(r.getIsFocusable&&r.getIsAvailableToBeFocused&&r.getIsFocusable()&&r.getIsAvailableToBeFocused(r.el())){t.push(r);return}else r.hasOwnProperty("children_")&&r.children_.length>0?s(r.children_):r.hasOwnProperty("items")&&r.items.length>0?s(r.items):this.findSuitableDOMChild(r)&&t.push(r);if(r.name_==="ErrorDisplay"&&r.opened_){const n=r.el_.querySelector(".vjs-errors-ok-button-container");n&&n.querySelectorAll("button").forEach((o,u)=>{t.push({name:()=>"ModalButton"+(u+1),el:()=>o,getPositions:()=>{const h=o.getBoundingClientRect(),m={x:h.x,y:h.y,width:h.width,height:h.height,top:h.top,right:h.right,bottom:h.bottom,left:h.left},_={x:h.left+h.width/2,y:h.top+h.height/2,width:0,height:0,top:h.top+h.height/2,right:h.left+h.width/2,bottom:h.top+h.height/2,left:h.left+h.width/2};return{boundingClientRect:m,center:_}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:h=>!0,focus:()=>o.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){function t(s){if(e.getIsFocusable(s)&&e.getIsAvailableToBeFocused(s))return s;for(let r=0;r<s.children.length;r++){const n=s.children[r],a=t(n);if(a)return a}return null}return e.el()?t(e.el()):null}getCurrentComponent(e){this.updateFocusableComponents();const t=e||document.activeElement;if(this.focusableComponents.length){for(const s of this.focusableComponents)if(s.el()===t)return s}}add(e){const t=[...this.focusableComponents];e.hasOwnProperty("el_")&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el())&&t.push(e),this.focusableComponents=t,this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}remove(e){for(let t=0;t<this.focusableComponents.length;t++)if(this.focusableComponents[t].name()===e.name()){this.focusableComponents.splice(t,1),this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents});return}}clear(){this.focusableComponents.length>0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){const t=this.getCurrentComponent();if(!t)return;const s=t.getPositions(),r=this.focusableComponents.filter(a=>a!==t&&this.isInDirection_(s.boundingClientRect,a.getPositions().boundingClientRect,e)),n=this.findBestCandidate_(s.center,r,e);n?this.focus(n):this.trigger({type:"endOfFocusableComponents",direction:e,focusedComponent:t})}findBestCandidate_(e,t,s){let r=1/0,n=null;for(const a of t){const o=a.getPositions().center,u=this.calculateDistance_(e,o,s);u<r&&(r=u,n=a)}return n}isInDirection_(e,t,s){switch(s){case"right":return t.left>=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;e<this.focusableComponents.length;e++)if(this.focusableComponents[e].name()===this.lastFocusedComponent_.name()){this.focus(this.focusableComponents[e]);return}}else this.focus(this.updateFocusableComponents()[0])}focus(e){typeof e=="object"&&(e.getIsAvailableToBeFocused(e.el())?e.focus():this.findSuitableDOMChild(e)&&this.findSuitableDOMChild(e).focus())}calculateDistance_(e,t,s){const r=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y);let a;switch(s){case"right":case"left":a=r+n*100;break;case"up":a=n*2+r*.5;break;case"down":a=n*5+r;break;default:a=r+n}return a}searchForTrackSelect_(){const e=this;for(const t of e.updateFocusableComponents())if(t.constructor.name==="TextTrackSelect"){e.focus(t);break}}}class DT extends U{constructor(e,t,s){const r=Ee({createEl:!1},t);if(super(e,r,s),!t.playerOptions.sources||t.playerOptions.sources.length===0)for(let n=0,a=t.playerOptions.techOrder;n<a.length;n++){const o=Ne(a[n]);let u=ae.getTech(o);if(o||(u=U.getComponent(o)),u&&u.isSupported()){e.loadTech_(o);break}}else e.src(t.playerOptions.sources)}}U.registerComponent("MediaLoader",DT);class za extends U{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=s=>this.handleMouseOver(s),this.handleMouseOut_=s=>this.handleMouseOut(s),this.handleClick_=s=>this.handleClick(s),this.handleKeyDown_=s=>this.handleKeyDown(s),this.emitTapEvents(),this.enable()}createEl(e="div",t={},s={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),e==="button"&&oe.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),s=Object.assign({role:"button"},s),this.tabIndex_=t.tabIndex;const r=se(e,t,s);return this.player_.options_.experimentalSvgIcons||r.appendChild(se("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=se("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(e===void 0)return this.controlText_||"Need Text";const s=this.localize(e);this.controlText_=e,Pi(this.controlTextEl_,s),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&t.setAttribute("title",s)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),typeof this.tabIndex_<"u"&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),typeof this.tabIndex_<"u"&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){e.key===" "||e.key==="Enter"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}U.registerComponent("ClickableComponent",za);class ll extends za{constructor(e,t){super(e,t),this.update(),this.update_=s=>this.update(s),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return se("div",{className:"vjs-poster"})}crossOrigin(e){if(typeof e>"u")return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.$("img")&&(this.$("img").crossOrigin=e)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){if(!e){this.el_.textContent="";return}this.$("img")||this.el_.appendChild(se("picture",{className:"vjs-poster",tabIndex:-1},{},se("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?Yt(this.player_.play()):this.player_.pause())}}ll.prototype.crossorigin=ll.prototype.crossOrigin;U.registerComponent("PosterImage",ll);const Dt="#222",gd="#ccc",IT={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',
vendor: 5,473 bytes, line 175
175script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Fo(i,e){let t;if(i.length===4)t=i[1]+i[1]+i[2]+i[2]+i[3]+i[3];else if(i.length===7)t=i.slice(1);else throw new Error("Invalid color code provided, "+i+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+e+")"}function Wt(i,e,t){try{i.style[e]=t}catch{return}}function _d(i){return i?`${i}px`:""}class kT extends U{constructor(e,t,s){super(e,t,s);const r=a=>this.updateDisplay(a),n=a=>{this.updateDisplayOverlay(),this.updateDisplay(a)};e.on("loadstart",a=>this.toggleDisplay(a)),e.on("texttrackchange",r),e.on("loadedmetadata",a=>{this.updateDisplayOverlay(),this.preselectTrack(a)}),e.ready(Ce(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on("fullscreenchange",n),e.on("playerresize",n);const a=x.screen.orientation||x,o=x.screen.orientation?"change":"orientationchange";a.addEventListener(o,n),e.on("dispose",()=>a.removeEventListener(o,n));const u=this.options_.playerOptions.tracks||[];for(let h=0;h<u.length;h++)this.player_.addRemoteTextTrack(u[h],!0);this.preselectTrack()}))}preselectTrack(){const e={captions:1,subtitles:1},t=this.player_.textTracks(),s=this.player_.cache_.selectedLanguage;let r,n,a;for(let o=0;o<t.length;o++){const u=t[o];s&&s.enabled&&s.language&&s.language===u.language&&u.kind in e?u.kind===s.kind?a=u:a||(a=u):s&&!s.enabled?(a=null,r=null,n=null):u.default&&(u.kind==="descriptions"&&!r?r=u:u.kind in e&&!n&&(n=u))}a?a.mode="showing":n?n.mode="showing":r&&(r.mode="showing")}toggleDisplay(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){typeof x.WebVTT=="function"&&x.WebVTT.processCues(x,[],this.el_)}updateDisplay(){const e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){const a=[];for(let o=0;o<e.length;++o){const u=e[o];u.mode==="showing"&&a.push(u)}this.updateForTrack(a);return}let s=null,r=null,n=e.length;for(;n--;){const a=e[n];a.mode==="showing"&&(a.kind==="descriptions"?s=a:r=a)}if(r?(this.getAttribute("aria-live")!=="off"&&this.setAttribute("aria-live","off"),this.updateForTrack(r)):s&&(this.getAttribute("aria-live")!=="assertive"&&this.setAttribute("aria-live","assertive"),this.updateForTrack(s)),!x.CSS.supports("inset","10px")){const a=this.el_,o=a.querySelectorAll(".vjs-text-track-cue"),u=this.player_.controlBar.el_.getBoundingClientRect().height,h=this.player_.el_.getBoundingClientRect().height;a.style="",Wt(a,"position","relative"),Wt(a,"height",h-u+"px"),Wt(a,"top","unset"),la?Wt(a,"bottom",h+"px"):Wt(a,"bottom","0px"),o.length>0&&o.forEach(m=>{if(m.style.inset){const _=m.style.inset.split(" ");_.length===3&&Object.assign(m.style,{top:_[0],right:_[1],bottom:_[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!x.CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),s=e/t,r=this.player_.videoWidth()/this.player_.videoHeight();let n=0,a=0;Math.abs(s-r)>.1&&(s>r?n=Math.round((e-t*r)/2):a=Math.round((t-e/r)/2)),Wt(this.el_,"insetInline",_d(n)),Wt(this.el_,"insetBlock",_d(a))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),s=e.activeCues;let r=s.length;for(;r--;){const n=s[r];if(!n)continue;const a=n.displayState;if(t.color&&(a.firstChild.style.color=t.color),t.textOpacity&&Wt(a.firstChild,"color",Fo(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&Wt(a.firstChild,"backgroundColor",Fo(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?Wt(a,"backgroundColor",Fo(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle==="dropshadow"?a.firstChild.style.textShadow=`2px 2px 3px ${Dt}, 2px 2px 4px ${Dt}, 2px 2px 5px ${Dt}`:t.edgeStyle==="raised"?a.firstChild.style.textShadow=`1px 1px ${Dt}, 2px 2px ${Dt}, 3px 3px ${Dt}`:t.edgeStyle==="depressed"?a.firstChild.style.textShadow=`1px 1px ${gd}, 0 1px ${gd}, -1px -1px ${Dt}, 0 -1px ${Dt}`:t.edgeStyle==="uniform"&&(a.firstChild.style.textShadow=`0 0 4px ${Dt}, 0 0 4px ${Dt}, 0 0 4px ${Dt}, 0 0 4px ${Dt}`)),t.fontPercent&&t.fontPercent!==1){const o=x.parseFloat(a.style.fontSize);a.style.fontSize=o*t.fontPercent+"px",a.style.height="auto",a.style.top="auto"}t.fontFamily&&t.fontFamily!=="default"&&(t.fontFamily==="small-caps"?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=IT[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof x.WebVTT!="function"||e.every(s=>!s.activeCues))return;const t=[];for(let s=0;s<e.length;++s){const r=e[s];for(let n=0;n<r.activeCues.length;++n)t.push(r.activeCues[n])}x.WebVTT.processCues(x,t,this.el_);for(let s=0;s<e.length;++s){const r=e[s];for(let n=0;n<r.activeCues.length;++n){const a=r.activeCues[n].displayState;Yi(a,"vjs-text-track-cue","vjs-text-track-cue-"+(r.language?r.language:s)),r.language&&Vs(a,"lang",r.language)}this.player_.textTrackSettings&&this.updateDisplayState(r)}}}U.registerComponent("TextTrackDisplay",kT);class PT extends U{createEl(){const e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"
175Video Player"),s=se("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),r=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return r.appendChild(s),r}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}}U.registerComponent("LoadingSpinner",PT);class et extends za{createEl(e,t={},s={}){e="button",t=Object.assign({className:this.buildCSSClass()},t),s=Object.assign({type:"button"},s);const r=se(e,t,s);return this.player_.options_.experimentalSvgIcons||r.appendChild(se("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}addChild(e,t={}){const s=this.constructor.name;return oe.warn(`Adding an actionable (user controllable) child to a Button (${s}) is not supported; use a ClickableComponent instead.`),U.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){if(e.key===" "||e.key==="Enter"){e.stopPropagation();return}super.handleKeyDown(e)}}U.registerComponent("Button",et);class $f extends et{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",s=>this.handleMouseDown(s))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(this.mouseused_&&"clientX"in e&&"clientY"in e){Yt(t),this.player_.tech(!0)&&this.player_.tech(!0).focus();return}const s=this.player_.getChild("controlBar"),r=s&&s.getChild("playToggle");if(!r){this.player_.tech(!0).focus();return}const n=()=>r.focus();jr(t)?t.then(n,()=>{}):this.setTimeout(n,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}$f.prototype.controlText_="Play Video";U.registerComponent("BigPlayButton",$f);class LT extends et{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){e.key==="Escape"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}U.registerComponent("CloseButton",LT);class qf extends et{constructor(e,t={}){super(e,t),t.replay=t.replay===void 0||t.replay,this.setIcon("play"),this.on(e,"play",s=>this.handlePlay(s)),this.on(e,"pause",s=>this.handlePause(s)),t.replay&&this.on(e,"ended",s=>this.handleEnded(s))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?Yt(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",t=>this.handleSeeked(t))}}qf.prototype.controlText_="Play";U.registerComponent("PlayToggle",qf);class tr extends U{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],s=>this.update(s)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),s=se("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)}Â `},{role:"presentation"});return t.appendChild(s),this.contentEl_=se("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){!this.player_.options_.enableSmoothSeeking&&e.type==="seeking"||this.updateContent(e)}updateTextNode_(e=0){e=ts(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let t=this.textNode_;t&&this.contentEl_.firstChild!==t&&(t=null,oe.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=V.createTextNode(this.formattedTime_),this.textNode_&&(t?this.contentEl_.replaceChild(this.textNode_,t):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}tr.prototype.labelText_="Time";tr.prototype.controlText_="Time";U.registerComponent("TimeDisplay",tr);class nu extends tr{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;this.player_.ended()?t=this.player_.duration():t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}nu.prototype.labelText_="Current Time";nu.prototype.controlText_="Current Time";U.registerComponent("CurrentTimeDisplay",nu);class au extends tr{constructor(e,t){super(e,t);const s=r=>this.updateContent(r);this.on(e,"durationchange",s),this.on(e,"loadstart",s),this.on(e,"loadedmetadata",s)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}au.prototype.labelText_="Duration";au.prototype.controlText_="Duration";U.registerComponent("DurationDisplay",au);class OT extends U{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),s=super.createEl("span",{textContent:"/"});return t.appendChild(s),e.appendChild(t),e}}U.registerComponent("TimeDivider",OT);class ou extends tr{constructor(e,t){super(e,t),this.on(e,"durationchange",s=>this.updateContent(s))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(se("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if(typeof this.player_.duration()!="number")return;let t;this.player_.ended()?t=0:this.player_.remainingTimeDisplay?t=this.player_.remainingTimeDisplay():t=this.player_.remainingTime(),this.updateTextNode_(t)}}ou.prototype.labelText_="Remaining Time";ou.prototype.controlText_="Remaining Time";U.registerComponent("RemainingTimeDisplay",ou);class RT extends U{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",s=>this.updateShowing(s))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=se("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(se("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")}Â `})),this.contentEl_.appendChild(V.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}}U.registerComponent("LiveDisplay",RT);class jf extends et{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=s=>this.updateLiveEdgeStatus(s),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=se("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}jf.prototype.controlText_="Seek to live, currently playing live";U.registerComponent("SeekToLive",jf);function an(i,e,t){return i=Number(i),Math.min(t,Math.max(e,isNaN(i)?e:i))}var NT=Object.freeze({__proto__:null,clamp:an});class lu extends U{constructor(e,t){super(e,t),this.handleMouseDown_=s=>this.handleMouseDown(s),this.handleMouseUp_=s=>this.handleMouseUp(s),this.handleKeyDown_=s=>this.handleKeyDown(s),this.handleClick_=s=>this.handleClick(s),this.handleMouseMove_=s=>this.handleMouseMove(s),this.update_=s=>this.update(s),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},s={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),s=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},s),super.createEl(e,t,s)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!ri&&e.preventDefault(),mf(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;gf(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(e*100).toFixed(2)+"%"})),e}getProgress(){return Number(an(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=Ua(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){const t=this.options_.playerOptions.spatialNavigation,s=t&&t.enabled,r=t&&t.horizontalSeek;s?r&&e.key==="ArrowLeft"||!r&&e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):r&&e.key==="ArrowRight"||!r&&e.key==="ArrowUp"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e):e.ke
vendor: 4,980 bytes, line 175
175y==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):e.key==="ArrowUp"||e.key==="ArrowRight"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}U.registerComponent("Slider",lu);const Uo=(i,e)=>an(i/e*100,0,100).toFixed(2)+"%";class MT extends U{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",s=>this.update(s))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=se("span",{className:"vjs-control-text"}),s=se("span",{textContent:this.localize("Loaded")}),r=V.createTextNode(": ");return this.percentageEl_=se("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(s),t.appendChild(r),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const t=this.player_.liveTracker,s=this.player_.buffered(),r=t&&t.isLive()?t.seekableEnd():this.player_.duration(),n=this.player_.bufferedEnd(),a=this.partEls_,o=Uo(n,r);this.percent_!==o&&(this.el_.style.width=o,Pi(this.percentageEl_,o),this.percent_=o);for(let u=0;u<s.length;u++){const h=s.start(u),m=s.end(u);let _=a[u];_||(_=this.el_.appendChild(se()),a[u]=_),!(_.dataset.start===h&&_.dataset.end===m)&&(_.dataset.start=h,_.dataset.end=m,_.style.left=Uo(h,n),_.style.width=Uo(m-h,n))}for(let u=a.length;u>s.length;u--)this.el_.removeChild(a[u-1]);a.length=s.length})}}U.registerComponent("LoadProgressBar",MT);class BT extends U{constructor(e,t){super(e,t),this.update=ni(Ce(this,this.update),Pt)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,s){const r=Qr(this.el_),n=zs(this.player_.el()),a=e.width*t;if(!n||!r)return;let o=e.left-n.left+a,u=e.width-a+(n.right-e.right);u||(u=e.width-a,o=a);let h=r.width/2;o<h?h+=h-o:u<h&&(h=u),h<0?h=0:h>r.width&&(h=r.width),h=Math.round(h),this.el_.style.right=`-${h}px`,this.write(s)}write(e){Pi(this.el_,e)}updateTime(e,t,s,r){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let n;const a=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const o=this.player_.liveTracker.liveWindow(),u=o-t*o;n=(u<1?"":"-")+ts(u,o)}else n=ts(s,a);this.update(e,t,n),r&&r()})}}U.registerComponent("TimeTooltip",BT);class uu extends U{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=ni(Ce(this,this.update),Pt)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){const s=this.getChild("timeTooltip");if(!s)return;const r=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();s.updateTime(e,t,r)}}uu.prototype.options_={children:[]};!ut&&!si&&uu.prototype.options_.children.push("timeTooltip");U.registerComponent("PlayProgressBar",uu);class Hf extends U{constructor(e,t){super(e,t),this.update=ni(Ce(this,this.update),Pt)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const s=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,s,()=>{this.el_.style.left=`${e.width*t}px`})}}Hf.prototype.options_={children:["timeTooltip"]};U.registerComponent("MouseTimeDisplay",Hf);const Hn=5,yd=12;class cu extends lu{constructor(e,t){super(e,t),this.setEventHandlers_()}setEventHandlers_(){this.update_=Ce(this,this.update),this.update=ni(this.update_,Pt),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in V&&"visibilityState"in V&&this.on(V,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){V.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,Pt))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if(V.visibilityState==="hidden")return;
175const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const s=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),r=this.player_.liveTracker;let n=this.player_.duration();r&&r.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(t*100).toFixed(2)),this.percent_=t),(this.currentTime_!==s||this.duration_!==n)&&(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[ts(s,n),ts(n,n)],"{1} of {2}")),this.currentTime_=s,this.duration_=n),this.bar&&this.bar.update(zs(this.el()),this.getProgress())}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){const e=this.getCurrentTime_();let t;const s=this.player_.liveTracker;return s&&s.isLive()?(t=(e-s.seekableStart())/s.liveWindow(),s.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){Jr(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!Jr(e)||isNaN(this.player_.duration()))return;!t&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let s;const r=this.calculateDistance(e),n=this.player_.liveTracker;if(!n||!n.isLive())s=r*this.player_.duration(),s===this.player_.duration()&&(s=s-.1);else{if(r>=.99){n.seekToLiveEdge();return}const a=n.seekableStart(),o=n.liveCurrentTime();if(s=a+r*n.liveWindow(),s>=o&&(s=o),s<=a&&(s=a+.1),s===1/0)return}this.userSeek_(s),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Yt(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+Hn)}stepBack(){this.userSeek_(this.player_.currentTime()-Hn)}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(e.key===" "||e.key==="Enter")e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(e.key==="Home")e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(e.key==="End")e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();const s=parseInt(e.key,10)*.1;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*s):this.userSeek_(this.player_.duration()*s)}else e.key==="PageDown"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-Hn*yd)):e.key==="PageUp"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+Hn*yd)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in V&&"visibilityState"in V&&this.off(V,"visibilitychange",this.toggleVisibility_),super.dispose()}}cu.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};!ut&&!si&&cu.prototype.options_.children.splice(1,0,"mouseTimeDisplay");U.registerComponent("SeekBar",cu);class Vf extends U{constructor(e,t){super(e,t),this.handleMouseMove=ni(Ce(this,this.handleMouseMove),Pt),this.throttledHandleMouseSeek=ni(Ce(this,this.handleMouseSeek),Pt),this.handleMouseUpHandler_=s=>this.handleMouseUp(s),this.handleMouseDownHandler_=s=>this.handleMouseDown(s),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const s=t.getChild("playProgressBar"),r=t.getChild("mouseTimeDisplay");if(!s&&!r)return;const n=t.el(),a=Qr(n);let o=Ua(n,e).x;o=an(o,0,1),r&&r.update(a,o),s&&s.update(a,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}
175disable(){if(this.children().forEach(e=>e.disable&&e.disable()),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&Yt(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,s=this.getChild("seekBar");s&&s.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}Vf.prototype.options_={children:["seekBar"]};U.registerComponent("ProgressControl",Vf);class zf extends et{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],s=>this.handlePictureInPictureChange(s)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],s=>this.handlePictureInPictureEnabledChange(s)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){if(!(this.player_.currentType().substring(0,5)==="audio"||this.player_.audioPosterMode()||this.player_.audioOnlyMode())){this.show();return}this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()}handlePictureInPictureEnabledChange(){V.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in x?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){typeof V.exitPictureInPicture=="function"&&super.show()}}zf.prototype.controlText_="Picture-in-Picture";U.registerComponent("PictureInPictureToggle",zf);class Gf extends et{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",s=>this.handleFullscreenChange(s)),V[e.fsApi_.fullscreenEnabled]===!1&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}Gf.prototype.controlText_="Fullscreen";U.registerComponent("FullscreenToggle",Gf);const FT=function(i,e){e.tech_&&!e.tech_.featuresVolumeControl&&i.addClass("vjs-hidden"),i.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")})};class UT extends U{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}
vendor: 4,231 bytes, line 175
175U.registerComponent("VolumeLevel",UT);class $T extends U{constructor(e,t){super(e,t),this.update=ni(Ce(this,this.update),Pt)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,s,r){if(!s){const n=zs(this.el_),a=zs(this.player_.el()),o=e.width*t;if(!a||!n)return;const u=e.left-a.left+o,h=e.width-o+(a.right-e.right);let m=n.width/2;u<m?m+=m-u:h<m&&(m=h),m<0?m=0:m>n.width&&(m=n.width),this.el_.style.right=`-${m}px`}this.write(`${r}%`)}write(e){Pi(this.el_,e)}updateVolume(e,t,s,r,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,s,r.toFixed(0)),n&&n()})}}U.registerComponent("VolumeLevelTooltip",$T);class Wf extends U{constructor(e,t){super(e,t),this.update=ni(Ce(this,this.update),Pt)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,s){const r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,s,r,()=>{s?this.el_.style.bottom=`${e.height*t}px`:this.el_.style.left=`${e.width*t}px`})}}Wf.prototype.options_={children:["volumeLevelTooltip"]};U.registerComponent("MouseVolumeLevelDisplay",Wf);class Ga extends lu{constructor(e,t){super(e,t),this.on("slideractive",s=>this.updateLastVolume_(s)),this.on(e,"volumechange",s=>this.updateARIAAttributes(s)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){Jr(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const s=this.el(),r=zs(s),n=this.vertical();let a=Ua(s,e);a=n?a.y:a.x,a=an(a,0,1),t.update(r,a,n)}Jr(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(this.player_.volume()*100)}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}}Ga.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!ut&&!si&&Ga.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");Ga.prototype.playerEvent="volumechange";U.registerComponent("VolumeBar",Ga);class Xf extends U{constructor(e,t={}){t.vertical=t.vertical||!1,(typeof t.volumeBar>"u"||Hs(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),FT(this,e),this.throttledHandleMouseMove=ni(Ce(this,this.handleMouseMove),Pt),this.handleMouseUpHandler_=s=>this.handleMouseUp(s),this.on("mousedown",s=>this.handleMouseDown(s)),this.on("touchstart",s=>this.handleMouseDown(s)),this.on("mousemove",s=>this.handleMouseMove(s)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}Xf.prototype.options_={children:["volumeBar"]};
vendor: 4,298 bytes, line 175
175U.registerComponent("VolumeControl",Xf);const qT=function(i,e){e.tech_&&!e.tech_.featuresMuteControl&&i.addClass("vjs-hidden"),i.on(e,"loadstart",function(){e.tech_.featuresMuteControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")})};class Kf extends et{constructor(e,t){super(e,t),qT(this,e),this.on(e,["loadstart","volumechange"],s=>this.update(s))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),s=this.player_.lastVolume_();if(t===0){const r=s<.1?.1:s;this.player_.volume(r),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),ut&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),Ba(this.el_,[0,1,2,3].reduce((s,r)=>s+`${r?" ":""}vjs-vol-${r}`,"")),Yi(this.el_,`vjs-vol-${t}`)}updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)}}Kf.prototype.controlText_="Mute";U.registerComponent("MuteToggle",Kf);class Yf extends U{constructor(e,t={}){typeof t.inline<"u"?t.inline=t.inline:t.inline=!0,(typeof t.volumeControl>"u"||Hs(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=s=>this.handleKeyPress(s),this.on(e,["loadstart"],s=>this.volumePanelState_(s)),this.on(this.muteToggle,"keyup",s=>this.handleKeyPress(s)),this.on(this.volumeControl,"keyup",s=>this.handleVolumeControlKeyUp(s)),this.on("keydown",s=>this.handleKeyPress(s)),this.on("mouseover",s=>this.handleMouseOver(s)),this.on("mouseout",s=>this.handleMouseOut(s)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){e.key==="Escape"&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),Et(V,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),Ze(V,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){e.key==="Escape"&&this.handleMouseOut()}}Yf.prototype.options_={children:["muteToggle","volumeControl"]};U.registerComponent("VolumePanel",Yf);class Qf extends et{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),s=this.player_.liveTracker,r=s&&s.isLive()?s.seekableEnd():this.player_.duration();let n;t+this.skipTime<=r?n=t+this.skipTime:n=r,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}Qf.prototype.controlText_="Skip Forward";U.registerComponent("SkipForward",Qf);class Jf extends et{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1}
175 seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),s=this.player_.liveTracker,r=s&&s.isLive()&&s.seekableStart();let n;r&&t-this.skipTime<=r?n=r:t>=this.skipTime?n=t-this.skipTime:n=0,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}Jf.prototype.controlText_="Skip Backward";U.registerComponent("SkipBackward",Jf);class Zf extends U{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",s=>this.handleKeyDown(s)),this.boundHandleBlur_=s=>this.handleBlur(s),this.boundHandleTapClick_=s=>this.handleTapClick(s)}addEventListenerForItem(e){e instanceof U&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof U&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=se(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),Et(t,"click",function(s){s.preventDefault(),s.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||V.activeElement;if(!this.children().some(s=>s.el()===t)){const s=this.menuButton_;s&&s.buttonPressed_&&t!==s.el().firstChild&&s.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const s=t.filter(r=>r.el()===e.target)[0];if(!s)return;s.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}}handleKeyDown(e){e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(e.key==="ArrowRight"||e.key==="ArrowUp")&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}U.registerComponent("Menu",Zf);class du extends U{constructor(e,t={}){super(e,t),this.menuButton_=new et(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const s=et.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+s,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const r=n=>this.handleClick(n);this.handleMenuKeyUp_=n=>this.handleMenuKeyUp(n),this.on(this.menuButton_,"tap",r),this.on(this.menuButton_,"click",r),this.on(this.menuButton_,"keydown",n=>this.handleKeyDown(n)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),Et(V,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",n=>this.handleMouseLeave(n)),this.on("keydown",n=>this.handleSubmenuKeyDown(n))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new Zf(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=se("li",{className:"vjs-menu-title",textContent:Ne(this.options_.title),tabIndex:-1}),s=new U(this.player_,{el:t});e.addItem(s)}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}setIcon(e){super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e="vjs-menu-button";this.options_.inline===!0?e+="-inline":e+="-popup";const t=et.prototype.buildCSSClass();return`vjs-menu-button ${e} ${t} ${super.buildCSSClass()}`}buildCSSClass(){let e="vjs-menu-button";return this.options_.inline===!0?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${super.buildCSSClass()}`}controlText(e,t=this.menuButton_.el()){return this.menuButton_.controlText(e,t)}dispose(){this.handleMouseLeave(),super.dispose()}handleClick(e){this.buttonPressed_?this.unpressButton():this.pressButton()}handleMouseLeave(e){this.removeClass("vjs-hover"),Ze(V,"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){e.key==="Esc"||e.key==="Tab"?(this.buttonPressed_&&this.unpressButton(),!e.key==="Tab"&&(e.preventDefault(),this.menuButton_.focus())):(e.key==="Up"||e.key==="Down"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))}handleMenuKeyUp(e){(e.key==="Esc"||e.key==="Tab")&&this.removeClass("vjs-hover")}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){(e.key==="Esc"||e.key==="Tab")&&(this.buttonPressed_&&this.unpressButton(),!e.key==="Tab"&&(e.preventDefault(),this.menuButton_.focus()))}pressButton(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),ut&&cf())return;this.menu.focus()}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","fal
175se"))}disable(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()}}U.registerComponent("MenuButton",du);class hu extends du{constructor(e,t){const s=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!s)return;const r=Ce(this,this.update);s.addEventListener("removetrack",r),s.addEventListener("addtrack",r),s.addEventListener("labelchange",r),this.player_.on("ready",r),this.player_.on("dispose",function(){s.removeEventListener("removetrack",r),s.removeEventListener("addtrack",r),s.removeEventListener("labelchange",r)})}}U.registerComponent("TrackButton",hu);class on extends za{constructor(e,t){super(e,t),this.selectable=t.selectable,this.isSelected_=t.selected||!1,this.multiSelectable=t.multiSelectable,this.selected(this.isSelected_),this.selectable?this.multiSelectable?this.el_.setAttribute("role","menuitemcheckbox"):this.el_.setAttribute("role","menuitemradio"):this.el_.setAttribute("role","menuitem")}createEl(e,t,s){this.nonIconControl=!0;const r=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),s),n=se("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?r.appendChild(n):r.replaceChild(n,r.querySelector(".vjs-icon-placeholder")),r}handleKeyDown(e){["Tab","Escape","ArrowUp","ArrowLeft","ArrowRight","ArrowDown"].includes(e.key)||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))}}U.registerComponent("MenuItem",on);class ln extends on{constructor(e,t){const s=t.track,r=e.textTracks();t.label=s.label||s.language||"Unknown",t.selected=s.mode==="showing",super(e,t),this.track=s,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const n=(...o)=>{this.handleTracksChange.apply(this,o)},a=(...o)=>{this.handleSelectedLanguageChange.apply(this,o)};if(e.on(["loadstart","texttrackchange"],n),r.addEventListener("change",n),r.addEventListener("selectedlanguagechange",a),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],n),r.removeEventListener("change",n),r.removeEventListener("selectedlanguagechange",a)}),r.onchange===void 0){let o;this.on(["tap","click"],function(){if(typeof x.Event!="object")try{o=new x.Event("change")}catch{}o||(o=V.createEvent("Event"),o.initEvent("change",!0,!0)),r.dispatchEvent(o)})}this.handleTracksChange()}handleClick(e){const t=this.track,s=this.player_.textTracks();if(super.handleClick(e),!!s)for(let r=0;r<s.length;r++){const n=s[r];this.kinds.indexOf(n.kind)!==-1&&(n===t?n.mode!=="showing"&&(n.mode="showing"):n.mode!=="disabled"&&(n.mode="disabled"))}}handleTracksChange(e){const t=this.track.mode==="showing";t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){if(this.track.mode==="showing"){const t=this.player_.cache_.selectedLanguage;if(t&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}}dispose(){this.track=null,super.dispose()}}U.registerComponent("TextTrackMenuItem",ln);class ep extends ln{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"disabled"},t.kinds||(t.kinds=[t.kind]),t.label?t.track.label=t.label:t.track.label=t.kinds.join(" and ")+" off",t.selectable=!0,t.multiSelectable=!1,super(e,t)}handleTracksChange(e){const t=this.player().textTracks();let s=!0;for(let r=0,n=t.length;r<n;r++){const a=t[r];if(this.options_.kinds.indexOf(a.kind)>-1&&a.mode==="showing"){s=!1;break}}s!==this.isSelected_&&this.selected(s)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let s=!0;for(let r=0,n=t.length;r<n;r++){const a=t[r];if(["captions","descriptions","subtitles"].indexOf(a.kind)>-1&&a.mode==="showing"){s=!1;break}}s&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}U.registerComponent("OffTextTrackMenuItem",ep);class ir extends hu{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=ln){let s;this.label_&&(s=`${this.label_} off`),e.push(new ep(this.player_,{kinds:this.kinds_,kind:this.kind_,label:s})),this.hideThreshold_+=1;const r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n<r.length;n++){const a=r[n];if(this.kinds_.indexOf(a.kind)>-1){const o=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});o.addClass(`vjs-${a.kind}-menu-item`),e.push(o)}}return e}}U.registerComponent("TextTrackButton",ir);class tp extends on{constructor(e,t){const s=t.track,r=t.cue,n=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=r.text,t.selected=r.startTime<=n&&n<r.endTime,super(e,t),this.track=s,this.cue=r}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}}U.registerComponent("ChaptersTrackMenuItem",tp);class fu extends ir{constructor(e,t,s){super(e,t,s),this.setIcon("chapters"),this.selectCurrentItem_=()=>
vendor: 29,991 bytes, lines 175-176
175{this.items.forEach(r=>{r.selected(this.track_.activeCues[0]===r.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!=="chapters")return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const s=e[t];if(s.kind===this.kind_)return s}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(Ne(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let s=0,r=t.length;s<r;s++){const n=t[s],a=new tp(this.player_,{track:this.track_,cue:n});e.push(a)}return e}}fu.prototype.kind_="chapters";fu.prototype.controlText_="Chapters";U.registerComponent("ChaptersButton",fu);class pu extends ir{constructor(e,t,s){super(e,t,s),this.setIcon("audio-description");const r=e.textTracks(),n=Ce(this,this.handleTracksChange);r.addEventListener("change",n),this.on("dispose",function(){r.removeEventListener("change",n)})}handleTracksChange(e){const t=this.player().textTracks();let s=!1;for(let r=0,n=t.length;r<n;r++){const a=t[r];if(a.kind!==this.kind_&&a.mode==="showing"){s=!0;break}}s?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}pu.prototype.kind_="descriptions";pu.prototype.controlText_="Descriptions";U.registerComponent("DescriptionsButton",pu);class mu extends ir{constructor(e,t,s){super(e,t,s),this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}mu.prototype.kind_="subtitles";mu.prototype.controlText_="Subtitles";U.registerComponent("SubtitlesButton",mu);class gu extends ln{constructor(e,t){t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="CaptionSettingsMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.controlText(", opens "+t.kind+" settings dialog")}handleClick(e){this.player().getChild("textTrackSettings").open()}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.kind+" settings"),super.handleLanguagechange()}}U.registerComponent("CaptionSettingsMenuItem",gu);class _u extends ir{constructor(e,t,s){super(e,t,s),this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){const e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new gu(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}_u.prototype.kind_="captions";_u.prototype.controlText_="Captions";U.registerComponent("CaptionsButton",_u);class ip extends ln{createEl(e,t,s){const r=super.createEl(e,t,s),n=r.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="captions"&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",r):n.appendChild(se("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(se("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),r}}U.registerComponent("SubsCapsMenuItem",ip);class yu extends ir{constructor(e,t={}){super(e,t),this.label_="subtitles",this.setIcon("subtitles"),["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(Ne(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new gu(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,ip),e}}yu.prototype.kinds_=["captions","subtitles"];yu.prototype.controlText_="Subtitles";U.registerComponent("SubsCapsButton",yu);class sp extends on{constructor(e,t){const s=t.track,r=e.audioTracks();t.label=s.label||s.language||"Unknown",t.selected=s.enabled,super(e,t),this.track=s,this.addClass(`vjs-${s.kind}-menu-item`);const n=(...a)=>{this.handleTracksChange.apply(this,a)};r.addEventListener("change",n),this.on("dispose",()=>{r.removeEventListener("change",n)})}createEl(e,t,s){const r=super.createEl(e,t,s),n=r.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(n.appendChild(se("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(se("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const t=this.player_.audioTracks();for(let s=0;s<t.length;s++){const r=t[s];r!==this.track&&(r.enabled=r===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}}U.registerComponent("AudioTrackMenuItem",sp);class rp extends hu{constructor(e,t={}){t.tracks=e.audioTracks(),super(e,t),this.setIcon("audio")}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(e=[]){this.hideThreshold_=1;const t=this.player_.audioTracks();for(let s=0;s<t.length;s++){const r=t[s];e.push(new sp(this.player_,{track:r,selectable:!0,multiSelectable:!1}))}return e}}rp.prototype.controlText_="Audio Track";U.registerComponent("AudioTrackButton",rp);class vu extends on{constructor(e,t){const s=t.rate,r=parseFloat(s,10);t.label=s,t.selected=r===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=s,this.rate=r,this.on(e,"ratechange",n=>this.update(n))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}vu.prototype.contentElType="button";U.registerComponent("PlaybackRateMenuItem",vu);class np extends du{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",s=>this.updateVisibility(s)),this.on(e,"ratechange",s=>this.updateLabel(s)),this.on(e,"playbackrateschange",s=>this.handlePlaybackRateschange(s))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=se("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let s=e.length-1;s>=0;s--)t.push(new vu(this.player(),{rate:e[s]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}np.prototype.controlText_="Playback Rate";U.registerComponent("PlaybackRateMenuButton",np);class ap extends U{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},s={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,s)}}U.registerComponent("Spacer",ap);class jT extends ap{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:"Â "})}}U.registerComponent("CustomControlSpacer",jT);class op extends U{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}op.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]};U.registerComponent("ControlBar",op);class lp extends er{constructor(e,t){super(e,t),this.on(e,"error",s=>{this.open(s)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}lp.prototype.options_=Object.assign({},er.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});U.registerComponent("ErrorDisplay",lp);class up extends U{constructor(e,t={}){super(e,t),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim(),se("select",{id:this.options_.id},{},this.options_.SelectOptions.map(t=>{const s=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${kt()}`)+"-"+t[1].replace(/\W+/g,""),r=se("option",{id:s,value:this.localize(t[0]),textContent:t[1]});return r.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${s}`),r}))}}U.registerComponent("TextTrackSelect",up);class Ji extends U{constructor(e,t={}){super(e,t);const s=se("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(s);const r=this.options_.selects;for(const n of r){const a=this.options_.selectConfigs[n],o=a.className,u=a.id.replace("%s",this.options_.id_);let h=null;const m=`vjs_select_${kt()}`;if(this.options_.type==="colors"){h=se("span",{className:o});const T=se("label",{id:u,className:"vjs-label",textContent:a.label});T.setAttribute("for",m),h.appendChild(T)}const _=new up(e,{SelectOptions:a.options,legendId:this.options_.legendId,id:m,labelId:u});this.addChild(_),this.options_.type==="colors"&&(h.appendChild(_.el()),this.el().appendChild(h))}}createEl(){return se("fieldset",{className:this.options_.className})}}U.registerComponent("TextTrackFieldset",Ji);class cp extends U{constructor(e,t={}){super(e,t);const s=this.options_.textTrackComponentid,r=new Ji(e,{id_:s,legendId:`captions-text-legend-${s}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(r);const n=new Ji(e,{id_:s,legendId:`captions-background-${s}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(n);const a=new Ji(e,{id_:s,legendId:`captions-window-${s}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(a)}createEl(){return se("div",{className:"vjs-track-settings-colors"})}}U.registerComponent("TextTrackSettingsColors",cp);class dp extends U{constructor(e,t={}){super(e,t);const s=this.options_.textTrackComponentid,r=new Ji(e,{id_:s,legendId:`captions-font-size-${s}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(r);const n=new Ji(e,{id_:s,legendId:`captions-edge-style-${s}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(n);const a=new Ji(e,{id_:s,legendId:`captions-font-family-${s}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(a)}createEl(){return se("div",{className:"vjs-track-settings-font"})}}U.registerComponent("TextTrackSettingsFont",dp);class hp extends U{constructor(e,t={}){super(e,t);const s=this.localize("restore all settings to the default values"),r=new et(e,{controlText:s,className:"vjs-default-button"});r.el().classList.remove("vjs-control","vjs-button"),r.el().textContent=this.localize("Reset"),this.addChild(r);const n=new et(e,{controlText:s,className:"vjs-done-button"});n.el().classList.remove("vjs-control","vjs-button"),n.el().textContent=this.localize("Done"),this.addChild(n)}createEl(){return se("div",{className:"vjs-track-settings-controls"})}}U.registerComponent("TrackSettingsControls",hp);const $o="vjs-text-track-settings",vd=["#000","Black"],Td=["#00F","Blue"],bd=["#0FF","Cyan"],Sd=["#0F0","Green"],xd=["#F0F","Magenta"],Ed=["#F00","Red"],Cd=["#FFF","White"],Ad=["#FF0","Yellow"],qo=["1","Opaque"],jo=["0.5","Semi-Transparent"],wd=["0","Transparent"],wi={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[vd,Cd,Ed,Sd,Td,Ad,xd,bd],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[qo,jo,wd],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Cd,vd,Ed,Sd,Td,Ad,xd,bd],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:i=>i==="1.00"?null:Number(i)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[qo,jo],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[wd,jo,qo],className:"vjs-window-opacity vjs-opacity"}};wi.windowColor.options=wi.backgroundColor.options;function fp(i,e){if(e&&(i=e(i)),i&&i!=="none")return i}function HT(i,e){const t=i.options[i.options.selectedIndex].value;return fp(t,e)}function VT(i,e,t){if(e){for(let s=0;s<i.options.length;s++)if(fp(i.options[s].value,t)===e){i.selectedIndex=s;break}}}class zT extends er{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.renderModalComponents(e),this.endDialog=se("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),t.persistTextTrackSettings===void 0&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.bindFunctionsToSelectsAndButtons(),this.options_.persistTextTrackSettings&&this.restoreSettings()}renderModalComponents(e){const t=new cp(e,{textTrackComponentid:this.id_,selectConfigs:wi,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(t);const s=new dp(e,{textTrackComponentid:this.id_,selectConfigs:wi,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(s);const r=new hp(e);this.addChild(r)}bindFunctionsToSelectsAndButtons(){this.on(this.$(".vjs-done-button"),["click","tap"],()=>{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),Is(wi,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return sf(wi,(e,t,s)=>{const r=HT(this.$(t.selector),t.parser);return r!==void 0&&(e[s]=r),e},{})}setValues(e){Is(wi,(t,s)=>{VT(this.$(t.selector),e[s],t.parser)})}setDefaults(){Is(wi,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(x.localStorage.getItem($o))}catch(t){oe.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?x.localStorage.setItem($o,JSON.stringify(e)):x.localStorage.removeItem($o)}catch(t){oe.warn(t)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}U.registerComponent("TextTrackSettings",zT);class GT extends U{constructor(e,t){let s=t.ResizeObserver||x.ResizeObserver;t.ResizeObserver===null&&(s=!1);const r=Ee({createEl:!s,reportTouchActivity:!1},t);super(e,r),this.ResizeObserver=t.ResizeObserver||x.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=Af(()=>{this.resizeHandler()},100,!1,this),s?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const n=this.debouncedHandler_;let a=this.unloadListener_=function(){Ze(this,"resize",n),Ze(this,"unload",a),a=null};Et(this.el_.contentWindow,"unload",a),Et(this.el_.contentWindow,"resize",n)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}}U.registerComponent("ResizeManager",GT);const WT={trackingThreshold:20,liveTolerance:15};class XT extends U{constructor(e,t){const s=Ee(WT,t,{createEl:!1});super(e,s),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=r=>this.handlePlay(r),this.handleFirstTimeupdate_=r=>this.handleFirstTimeupdate(r),this.handleSeeked_=r=>this.handleSeeked(r),this.seekToLiveEdge_=r=>this.seekToLiveEdge(r),this.reset_(),this.on(this.player_,"durationchange",r=>this.handleDurationchange(r)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(x.performance.now().toFixed(4)),s=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+s;const r=this.liveCurrentTime(),n=this.player_.currentTime();let a=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-n)>this.options_.liveTolerance;(!this.timeupdateSeen_||r===1/0)&&(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,Pt),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let s=e?e.length:0;for(;s--;)t.push(e.end(s));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let s=e?e.length:0;for(;s--;)t.push(e.start(s));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_=="number"}seekToLiveEdge(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}U.registerComponent("LiveTracker",XT);class KT extends U{constructor(e,t){super(e,t),this.on("statechanged",s=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:se("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${kt()}`}),description:se("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${kt()}`})},se("div",{className:"vjs-title-bar"},{},rf(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,s={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(r=>{const n=this.state[r],a=this.els[r],o=s[r];$a(a),n&&Pi(a,n),t&&(t.removeAttribute(o),n&&t.setAttribute(o,a.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}}U.registerComponent("TitleBar",KT);const YT={initialDisplay:4e3,position:[],takeFocus:!1};class QT extends et{constructor(e,t){t=Ee(YT,t),super(e,t),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],s=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){const e=se("button",{},{type:"button",class:this.buildCSSClass()},se("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass("force-display")},this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}}U.registerComponent("TransientButton",QT);const ul=i=>{const e=i.el();if(e.hasAttribute("src"))return i.triggerSourceset(e.src),!0;const t=i.$$("source"),s=[];let r="";if(!t.length)return!1;for(let n=0;n<t.length;n++){const a=t[n].src;a&&s.indexOf(a)===-1&&s.push(a)}return s.length?(s.length===1&&(r=s[0]),i.triggerSourceset(r),!0):!1},JT=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(i){const e=V.createElement(this.nodeName.toLowerCase());e.innerHTML=i;const t=V.createDocumentFragment();for(;e.childNodes.length;)t.appendChild(e.childNodes[0]);return this.innerText="",x.Element.prototype.appendChild.call(this,t),this.innerHTML}}),pp=(i,e)=>{let t={};for(let s=0;s<i.length&&(t=Object.getOwnPropertyDescriptor(i[s],e),!(t&&t.set&&t.get));s++);return t.enumerable=!0,t.configurable=!0,t},ZT=i=>pp([i.el(),x.HTMLMediaElement.prototype,x.Element.prototype,JT],"innerHTML"),Dd=function(i){const e=i.el();if(e.resetSourceWatch_)return;const t={},s=ZT(i),r=n=>(...a)=>{const o=n.apply(e,a);return ul(i),o};["append","appendChild","insertAdjacentHTML"].forEach(n=>{e[n]&&(t[n]=e[n],e[n]=r(t[n]))}),Object.defineProperty(e,"innerHTML",Ee(s,{set:r(s.set)})),e.resetSourceWatch_=()=>{e.resetSourceWatch_=null,Object.keys(t).forEach(n=>{e[n]=t[n]}),Object.defineProperty(e,"innerHTML",s)},i.one("sourceset",e.resetSourceWatch_)},e2=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?Mf(x.Element.prototype.getAttribute.call(this,"src")):""},set(i){return x.Element.prototype.setAttribute.call(this,"src",i),i}}),t2=i=>pp([i.el(),x.HTMLMediaElement.prototype,e2],"src"),i2=function(i){if(!i.featuresSourceset)return;const e=i.el();if(e.resetSourceset_)return;const t=t2(i),s=e.setAttribute,r=e.load;Object.defineProperty(e,"src",Ee(t,{set:n=>{const a=t.set.call(e,n);return i.triggerSourceset(e.src),a}})),e.setAttribute=(n,a)=>{const o=s.call(e,n,a);return/src/i.test(n)&&i.triggerSourceset(e.src),o},e.load=()=>{const n=r.call(e);return ul(i)||(i.triggerSourceset(""),Dd(i)),n},e.currentSrc?i.triggerSourceset(e.currentSrc):ul(i)||Dd(i),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=r,e.setAttribute=s,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}};class J extends ae{constructor(e,t){super(e,t);const s=e.source;let r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",s&&(this.el_.currentSrc!==s.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(s):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const n=this.el_.childNodes;let a=n.length;const o=[];for(;a--;){const u=n[a];u.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(u),this.remoteTextTracks().addTrack(u.track),this.textTracks().addTrack(u.track),!r&&!this.el_.hasAttribute("crossorigin")&&Va(u.src)&&(r=!0)):o.push(u))}for(let u=0;u<o.length;u++)this.el_.removeChild(o[u])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&r&&oe.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used. 176This may prevent text tracks from loading.`),this.restoreMetadataTracksInIOSNativePlayer_(),(Yr||Na)&&e.nativeControlsForTouch===!0&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),J.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){i2(this)}restoreMetadataTracksInIOSNativePlayer_(){const e=this.textTracks();let t;const s=()=>{t=[];for(let n=0;n<e.length;n++){const a=e[n];a.kind==="metadata"&&t.push({track:a,storedMode:a.mode})}};s(),e.addEventListener("change",s),this.on("dispose",()=>e.removeEventListener("change",s));const r=()=>{for(let n=0;n<t.length;n++){const a=t[n];a.track.mode==="disabled"&&a.track.mode!==a.storedMode&&(a.track.mode=a.storedMode)}e.removeEventListener("change",r)};this.on("webkitbeginfullscreen",()=>{e.removeEventListener("change",s),e.removeEventListener("change",r),e.addEventListener("change",r)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",s),e.addEventListener("change",s),e.removeEventListener("change",r)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const s=e.toLowerCase();this[`${s}TracksListeners_`]&&Object.keys(this[`${s}
176TracksListeners_`]).forEach(r=>{this.el()[`${s}Tracks`].removeEventListener(r,this[`${s}TracksListeners_`][r])}),this[`featuresNative${e}Tracks`]=!t,this[`${s}TracksListeners_`]=null,this.proxyNativeTracksForType_(s)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=It[e],s=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!s||!s.addEventListener)return;const n={change:o=>{const u={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(u),e==="text"&&this[Xs.remoteText.getterName]().trigger(u)},addtrack(o){r.addTrack(o.track)},removetrack(o){r.removeTrack(o.track)}},a=function(){const o=[];for(let u=0;u<r.length;u++){let h=!1;for(let m=0;m<s.length;m++)if(s[m]===r[u]){h=!0;break}h||o.push(r[u])}for(;o.length;)r.removeTrack(o.shift())};this[t.getterName+"Listeners_"]=n,Object.keys(n).forEach(o=>{const u=n[o];s.addEventListener(o,u),this.on("dispose",h=>s.removeEventListener(o,u))}),this.on("loadstart",a),this.on("dispose",o=>this.off("loadstart",a))}proxyNativeTracks_(){It.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){const s=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(s,e),J.disposeMediaElement(e),e=s}else{e=V.createElement("video");const s=this.options_.tag&&Ai(this.options_.tag),r=Ee({},s);(!Yr||this.options_.nativeControlsForTouch!==!0)&&delete r.controls,ff(e,Object.assign(r,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&Vs(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let s=0;s<t.length;s++){const r=t[s],n=this.options_[r];typeof n<"u"&&(n?Vs(e,r,r):Fa(e,r),e[r]=n)}return e}handleLateInit_(e){if(e.networkState===0||e.networkState===3)return;if(e.readyState===0){let s=!1;const r=function(){s=!0};this.on("loadstart",r);const n=function(){s||this.trigger("loadstart")};this.on("loadedmetadata",n),this.ready(function(){this.off("loadstart",r),this.off("loadedmetadata",n),s||this.trigger("loadstart")});return}const t=["loadstart"];t.push("loadedmetadata"),e.readyState>=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(s){this.trigger(s)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&Ma?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){oe(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&si&&ri&&this.el_.currentTime===0){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen=="function"}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)Yt(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},0);else try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(e===void 0)return this.el_.src;this.setSrc(e)}addSourceElement(e,t){if(!e)return oe.error("Invalid source URL."),!1;const s={src:e};t&&(s.type=t);const r=se("source",{},s);return this.el_.appendChild(r),!0}removeSourceElement(e){if(!e)return oe.error("Source URL is required to remove the source element."),!1;const t=this.el_.querySelectorAll("source");for(const s of t)if(s.src===e)return this.el_.removeChild(s),!0;return oe.warn(`No matching source element found with src: ${e}`),!1}reset(){J.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,s){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,s):super.addTextTrack(e,t,s)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=V.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const s=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(s),s}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let s=t.length;for(;s--;)(e===t[s]||e===t[s].track)&&this.el().removeChild(t[s])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();const e={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),x.performance&&(e.creationTime=x.performance.now()),e}}La(J,"TEST_VID",function(){if(!Qs())return;const i=V.createElement("video"),e=V.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",i.appendChild(e),i});J.isSupported=function(){try{J.TEST_VID.volume=.5}catch{return!1}return!!(J.TEST_VID&&J.TEST_VID.canPlayType)};J.canPlayType=function(i){return J.TEST_VID.canPlayType(i)};J.canPlaySource=function(i,e){return J.canPlayType(i.type)};J.canControlVolume=function(){try{const i=J.TEST_VID.volume;J.TEST_VID.volume=i/2+.1;const e=i!==J.TEST_VID.volume;return e&&ut?(x.setTimeout(()=>{J&&J.prototype&&(J.prototype.featuresVolumeControl=i!==J.TEST_VID.volume)}),!1):e}catch{return!1}};J.canMuteVolume=function(){try{const i=J.TEST_VID.muted;return J.TEST_VID.muted=!i,J.TEST_VID.muted?Vs(J.TEST_VID,"muted","muted"):Fa(J.TEST_VID,"muted","muted"),i!==J.TEST_VID.muted}catch{return!1}};J.canControlPlaybackRate=function(){if(si&&ri&&Oa<58)return!1;try{const i=J.TEST_VID.playbackRate;return J.TEST_VID.playbackRate=i/2+.1,i!==J.TEST_VID.playbackRate}catch{return!1}};J.canOverrideAttributes=function(){try{const i=()=>{};Object.defineProperty(V.createElement("video"),"src",{get:i,set:i}),Object.defineProperty(V.createElement("audio"),"src",{get:i,set:i}),Object.defineProperty(V.createElement("video"),"innerHTML",{get:i,set:i}),Object.defineProperty(V.createElement("audio"),"innerHTML",{get:i,set:i})}catch{return!1}return!0};J.supportsNativeTextTracks=function(){return Ma||ut&&ri};J.supportsNativeVideoTracks=function(){return!!(J.TEST_VID&&J.TEST_VID.videoTracks)};J.supportsNativeAudioTracks=function(){return!!(J.TEST_VID&&J.TEST_VID.audioTracks)};J.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"];[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEac
176h(function([i,e]){La(J.prototype,i,()=>J[e](),!0)});J.prototype.featuresVolumeControl=J.canControlVolume();J.prototype.movingMediaElementInDOM=!ut;J.prototype.featuresFullscreenResize=!0;J.prototype.featuresProgressEvents=!0;J.prototype.featuresTimeupdateEvents=!0;J.prototype.featuresVideoFrameCallback=!!(J.TEST_VID&&J.TEST_VID.requestVideoFrameCallback);J.disposeMediaElement=function(i){if(i){for(i.parentNode&&i.parentNode.removeChild(i);i.hasChildNodes();)i.removeChild(i.firstChild);i.removeAttribute("src"),typeof i.load=="function"&&function(){try{i.load()}catch{}}()}};J.resetMediaElement=function(i){if(!i)return;const e=i.querySelectorAll("source");let t=e.length;for(;t--;)i.removeChild(e[t]);i.removeAttribute("src"),typeof i.load=="function"&&function(){try{i.load()}catch{}}()};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(i){J.prototype[i]=function(){return this.el_[i]||this.el_.hasAttribute(i)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(i){J.prototype["set"+Ne(i)]=function(e){this.el_[i]=e,e?this.el_.setAttribute(i,i):this.el_.removeAttribute(i)}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(i){J.prototype[i]=function(){return this.el_[i]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(i){J.prototype["set"+Ne(i)]=function(e){this.el_[i]=e}});["pause","load","play"].forEach(function(i){J.prototype[i]=function(){return this.el_[i]()}});ae.withSourceHandlers(J);J.nativeSourceHandler={};J.nativeSourceHandler.canPlayType=function(i){try{return J.TEST_VID.canPlayType(i)}catch{return""}};J.nativeSourceHandler.canHandleSource=function(i,e){if(i.type)return J.nativeSourceHandler.canPlayType(i.type);if(i.src){const t=su(i.src);return J.nativeSourceHandler.canPlayType(`video/${t}`)}return""};J.nativeSourceHandler.handleSource=function(i,e,t){e.setSrc(i.src)};J.nativeSourceHandler.dispose=function(){};J.registerSourceHandler(J.nativeSourceHandler);ae.registerTech("Html5",J);const mp=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Ho={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},cl=["tiny","xsmall","small","medium","large","xlarge","huge"],Xn={};cl.forEach(i=>{const e=i.charAt(0)==="x"?`x-${i.substring(1)}`:i;Xn[i]=`vjs-layout-${e}`});const s2={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class Ae extends U{constructor(e,t,s){if(e.id=e.id||t.id||`vjs_video_${kt()}`,t=Object.assign(Ae.getTagSettings(e),t),t.initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const a=e.closest("[lang]");a&&(t.language=a.getAttribute("lang"))}if(super(null,t,s),this.boundDocumentFullscreenChange_=a=>this.documentFullscreenChange_(a),this.boundFullWindowOnEscKey_=a=>this.fullWindowOnEscKey(a),this.boundUpdateStyleEl_=a=>this.updateStyleEl_(a),this.boundApplyInitTime_=a=>this.applyInitTime_(a),this.boundUpdateCurrentBreakpoint_=a=>this.updateCurrentBreakpoint_(a),this.boundHandleTechClick_=a=>this.handleTechClick_(a),this.boundHandleTechDoubleClick_=a=>this.handleTechDoubleClick_(a),this.boundHandleTechTouchStart_=a=>this.handleTechTouchStart_(a),this.boundHandleTechTouchMove_=a=>this.handleTechTouchMove_(a),this.boundHandleTechTouchEnd_=a=>this.handleTechTouchEnd_(a),this.boundHandleTechTap_=a=>this.handleTechTap_(a),this.boundUpdatePlayerHeightOnAudioOnlyMode_=a=>this.updatePlayerHeightOnAudioOnlyMode_(a),this.isFullscreen_=!1,this.log=ef(this.id_),this.fsApi_=sa,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&Ai(e),this.language(this.options_.language),t.languages){const a={};
vendor: 11,017 bytes, lines 176-185
176Object.getOwnPropertyNames(t.languages).forEach(function(o){a[o.toLowerCase()]=t.languages[o]}),this.languages_=a}else this.languages_=Ae.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(a=>{if(typeof this[a]!="function")throw new Error(`plugin "${a}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),Zl(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(Et(V,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const r=Ee(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(a=>{this[a](t.plugins[a])}),t.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const o=new x.DOMParser().parseFromString(AT,"image/svg+xml");if(o.querySelector("parsererror"))oe.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const h=o.documentElement;h.style.display="none",this.el_.appendChild(h),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio(e.nodeName.toLowerCase()==="audio"),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new wT(this),this.addClass("vjs-spatial-navigation-enabled")),Yr&&this.addClass("vjs-touch-enabled"),ut||this.addClass("vjs-workinghover"),Ae.players[this.id_]=this;const n=el.split(".")[0];this.addClass(`vjs-v${n}`),this.userActive(!0),this.reportUserActivity(),this.one("play",a=>this.listenForUserActivity_(a)),this.on("keydown",a=>this.handleKeyDown(a)),this.on("languagechange",a=>this.handleLanguagechange(a)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),Ze(V,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Ze(V,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),Ae.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),ST(this),at.names.forEach(e=>{const t=at[e],s=this[t.getterName]();s&&s.off&&s.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e=this.tag,t,s=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player");const r=this.tag.tagName.toLowerCase()==="video-js";s?t=this.el_=e.parentNode:r||(t=this.el_=super.createEl("div"));const n=Ai(e);if(r){for(t=this.el_=e,e=this.tag=V.createElement("video");t.children.length;)e.appendChild(t.firstChild);$r(t,"video-js")||Yi(t,"video-js"),t.appendChild(e),s=this.playerElIngest_=t,Object.keys(t).forEach(u=>{try{e[u]=t[u]}catch{}})}e.setAttribute("tabindex","-1"),n.tabindex="-1",ri&&Ra&&(e.setAttribute("role","application"),n.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in n&&delete n.width,"height"in n&&delete n.height,Object.getOwnPropertyNames(n).forEach(function(u){r&&u==="class"||t.setAttribute(u,n[u]),r&&e.setAttribute(u,n[u])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=t.player=this,this.addClass("vjs-paused");const a=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(u=>uf[u]).map(u=>"vjs-device-"+u.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...a),x.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=Ef("vjs-styles-dimensions");const u=Ii(".vjs-styles-defaults"),h=Ii("head");h.insertBefore(this.styleEl_,u?u.nextSibling:h.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const o=e.getElementsByTagName("a");for(let u=0;u<o.length;u++){const h=o.item(u);Yi(h,"vjs-hidden"),h.setAttribute("hidden","hidden")}return e.initNetworkState_=e.networkState,e.parentNode&&!s&&e.parentNode.insertBefore(t,e),il(e,t),this.children_.unshift(e),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=t,t}crossOrigin(e){if(typeof e>"u")return this.techGet_("crossOrigin");if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){oe.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const s=e+"_";if(t===void 0)return this[s]||0;if(t===""||t==="auto"){this[s]=void 0,this.updateStyleEl_();return}const r=parseFloat(t);if(isNaN(r)){oe.error(`Improper value "${t}" supplied for for ${e}`);return}this[s]=r,this.updateStyleEl_()}fluid(e){if(e===void 0)return!!this.fluid_;this.fluid_=!!e,di(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),Jv(this,()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(x.VIDEOJS_NO_DYNAMIC_STYLE===!0){const o=typeof this.width_=="number"?this.width_:this.options_.width,u=typeof this.height_=="number"?this.height_:this.options_.height,h=this.tech_&&this.tech_.el();h&&(o>=0&&(h.width=o),u>=0&&(h.height=u));return}let e,t,s,r;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?s=this.aspectRatio_:this.videoWidth()>0?s=this.videoWidth()+":"+this.videoHeight():s="16:9";const n=s.split(":"),a=n[1]/n[0];this.width_!==void 0?e=this.width_:this.height_!==void 0?e=this.height_/a:e=this.videoWidth()||300,this.height_!==void 0?t=this.height_:t=e*a,/^[^a-zA-Z]/.test(this.id())?r="dimensions-"+this.id():r=this.id()+"-dimensions",this.addClass(r),Cf(this.styleEl_,` 177 .${r} { 178 width: ${e}px; 179 height: ${t}px; 180 } 181 182 .${r}.vjs-fluid:not(.vjs-audio-only-mode) { 183 padding-top: ${a*100}%; 184 } 185 `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const s=Ne(e),r=e.charAt(0).toLowerCase()+e.slice(1);s!=="Html5"&&this.tag&&(ae.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=s,this.isReady_=!1;let n=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(n=!1);const a={source:t,autoplay:n,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${r}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};at.names.forEach(u=>{const h=at[u];a[h.getterName]=this[h.privateName]}),Object.assign(a,this.options_[s]),Object.assign(a,this.options_[r]),Object.assign(a,this.options_[e.toLowerCase()]),this.tag&&(a.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);const o=ae.getTech(e);if(!o)throw new Error(`No Tech named '${s}' exists! '${s}' should be registered using videojs.registerTech()'`);this.tech_=new o(a),this.tech_.ready(Ce(this,this.handleTechReady_),!0),od.jsonToTextTracks(this.textTracksJson_||[],this.tech_),mp.forEach(u=>{this.on(this.tech_,u,h=>this[`handleTech${Ne(u)}_`](h))}),Object.keys(Ho).forEach(u=>{this.on(this.tech_,u,h=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${Ho[u]}_`].bind(this),event:h});return}this[`handleTech${Ho[u]}_`](h)})}),this.on(this.tech_,"loadstart",u=>this.handleTechLoadStart_(u)),this.on(this.tech_,"sourceset",u=>this.handleTechSourceset_(u)),this.on(this.tech_,"waiting",u=>this.handleTechWaiting_(u)),this.on(this.tech_,"ended",u=>this.handleTechEnded_(u)),this.on(this.tech_,"seeking",u=>this.handleTechSeeking_(u)),this.on(this.tech_,"play",u=>this.handleTechPlay_(u)),this.on(this.tech_,"pause",u=>this.handleTechPause_(u)),this.on(this.tech_,"durationchange",u=>this.handleTechDurationChange_(u)),this.on(this.tech_,"fullscreenchange",(u,h)=>this.handleTechFullscreenChange_(u,h)),this.on(this.tech_,"fullscreenerror",(u,h)=>this.handleTechFullscreenError_(u,h)),this.on(this.tech_,"enterpictureinpicture",u=>this.handleTechEnterPictureInPicture_(u)),this.on(this.tech_,"leavepictureinpicture",u=>this.handleTechLeavePictureInPicture_(u)),this.on(this.tech_,"error",u=>this.handleTechError_(u)),this.on(this.tech_,"posterchange",u=>this.handleTechPosterChange_(u)),this.on(this.tech_,"textdata",u=>this.handleTechTextData_(u)),this.on(this.tech_,"ratechange",u=>this.handleTechRateChange_(u)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(s!=="Html5"||!this.tag)&&il(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){at.names.forEach(e=>{const t=at[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=od.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return e===void 0&&oe.warn(`Using the tech directly can be dangerous. I hope you know
185what you're doing. 186See https://github.com/videojs/video.js/issues/2617 for more info. 187`),this.tech_}version(){return{"video.js":el}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!="string")return;const t=()=>{const r=this.muted();this.muted(!0);const n=()=>{this.muted(r)};this.playTerminatedQueue_.push(n);const a=this.play();if(jr(a))return a.catch(o=>{throw n(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${o||""}`)})};let s;if(e==="any"&&!this.muted()?(s=this.play(),jr(s)&&(s=s.catch(t))):e==="muted"&&!this.muted()?s=t():s=this.play(),!!jr(s))return s.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let t=e,s="";typeof t!="string"&&(t=e.src,s=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!s&&(s=CT(this,t)),this.cache_.source=Ee({},e,{src:t,type:s});const r=this.cache_.sources.filter(u=>u.src&&u.src===t),n=[],a=this.$$("source"),o=[];for(let u=0;u<a.length;u++){const h=Ai(a[u]);n.push(h),h.src&&h.src===t&&o.push(h.src)}o.length&&!r.length?this.cache_.sources=n:r.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=n=>this.updateSourceCaches_(n);const s=this.currentSource().src,r=e.src;s&&!/^blob:/.test(s)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==s)&&(t=()=>{}),t(r),e.src||this.tech_.any(["sourceset","loadstart"],n=>{if(n.type==="sourceset")return;const a=this.techGet_("currentSrc");this.lastSource_.tech=a,this.updateSourceCaches_(a)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}
vendor: 30,469 bytes, line 187
187handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,e):this.paused()?Yt(this.play()):this.pause())}handleTechDoubleClick_(e){if(!this.controls_)return;Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),s=>s.contains(e.target))||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isInPictureInPicture()&&!V.pictureInPictureElement?this.exitPictureInPicture():this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const s=this.el();let r=V[this.fsApi_.fullscreenElement]===s;!r&&s.matches&&(r=s.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(r)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in TT)return yT(this.middleware_,this.tech_,e,t);if(e in hd)return dd(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(s){throw oe(s),s}},!0)}techGet_(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in vT)return _T(this.middleware_,this.tech_,e);if(e in hd)return dd(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(oe(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name==="TypeError"?(oe(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(oe(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=Yt){this.playCallbacks_.push(e);const t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),s=!!(Ma||ut);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t){this.waitToPlay_=a=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!t&&s&&this.load();return}const r=this.techGet_("play");s&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),r===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(t){t()})}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(s){s(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")!==!1}played(){return this.techGet_("played")||Ut(0,0)}scrubbing(e){if(typeof e>"u")return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){if(e===void 0)return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime;if(e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e),this.cache_.initTime=0,isFinite(e)&&(this.cache_.currentTime=Number(e))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;e=parseFloat(e),e<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return(!e||!e.length)&&(e=Ut(0,0)),e}seekable(){let e=this.techGet_("seekable");return(!e||!e.length)&&(e=Ut(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return Rf(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let s=e.end(e.length-1);return s>t&&(s=t),s}volume(e){let t;if(e!==void 0){t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),t>0&&this.lastVolume_(t);return}return t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t}muted(e){if(e!==void 0){this.techCall_("setMuted",e);return}return this.techGet_("muted")||!1}defaultMuted(e){return e!==void 0&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(e!==void 0&&e!==0){this.cache_.lastVolume=e;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(e!==void 0){const t=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise((s,r)=>{function n(){t.off("fullscreenerror",o),t.off("fullscreenchange",a)}function a(){n(),s()}function o(h,m){n(),r(m)}t.one("fullscreenchange",a),t.one("fullscreenerror",o);const u=t.requestFullscreenHelper_(e);u&&(u.then(n,n),u.then(s,r))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(t=e)),this.fsApi_.requestFullscreen){const s=this.el_[this.fsApi_.requestFullscreen](t);return s&&s.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),s}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,s)=>{function r(){e.off("fullscreenerror",a),e.off("fullscreenchange",n)}function n(){r(),t()}function a(u,h){r(),s(h)}e.one("fullscreenchange",n),e.one("fullscreenerror",a);const o=e.exitFullscreenHelper_();o&&(o.then(r,r),o.then(t,s))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=V[this.fsApi_.exitFullscreen]();return e&&Yt(e.then(()=>this.isFullscreen(!1))),e}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=V.documentElement.style.overflow,Et(V,"keydown",this.boundFullWindowOnEscKey_),V.documentElement.style.overflow="hidden",Yi(V.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){e.key==="Escape"&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,Ze(V,"keydown",this.boundFullWindowOnEscKey_),V.documentElement.style.overflow=this.docOrigOverflow,Ba(V.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){if(e!==void 0){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&x.documentPictureInPicture){const e=V.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(se("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),x.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(bf(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",s=>{const r=s.target.querySelector(".video-js");e.parentNode.replaceChild(r,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in V&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(x.documentPictureInPicture&&x.documentPictureInPicture.window)return x.documentPictureInPicture.window.close(),Promise.resolve();if("pictureInPictureEnabled"in V)return V.exitPictureInPicture()}handleKeyDown(e){const{userActions:t}=this.options_;!t||!t.hotkeys||(r=>{const n=r.tagName.toLowerCase();if(r.isContentEditable)return!0;const a=["button","checkbox","hidden","radio","reset","submit"];return n==="input"?a.indexOf(r.type)===-1:["textarea"].indexOf(n)!==-1})(this.el_.ownerDocument.activeElement)||(typeof t.hotkeys=="function"?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:s=a=>e.key.toLowerCase()==="f",muteKey:r=a=>e.key.toLowerCase()==="m",playPauseKey:n=a=>e.key.toLowerCase()==="k"||e.key.toLowerCase()===" "}=t;if(s.call(this,e)){e.preventDefault(),e.stopPropagation();const a=U.getComponent("FullscreenToggle");V[this.fsApi_.fullscreenEnabled]!==!1&&a.prototype.handleClick.call(this,e)}else r.call(this,e)?(e.preventDefault(),e.stopPropagation(),U.getComponent("MuteToggle").prototype.handleClick.call(this,e)):n.call(this,e)&&(e.preventDefault(),e.stopPropagation(),U.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let s=0,r=this.options_.techOrder;s<r.length;s++){const n=r[s];let a=ae.getTech(n);if(a||(a=U.getComponent(n)),!a){oe.error(`The "${n}" tech is undefined. Skipped browser support check for that tech.`);continue}if(a.isSupported()&&(t=a.canPlayType(e),t))return t}return""}selectSource(e){const t=this.options_.techOrder.map(o=>[o,ae.getTech(o)]).filter(([o,u])=>u?u.isSupported():(oe.error(`The "${o}" tech is undefined. Skipped browser support check for that tech.`),!1)),s=function(o,u,h){let m;return o.some(_=>u.some(T=>{if(m=h(_,T),m)return!0})),m};let r;const n=o=>(u,h)=>o(h,u),a=([o,u],h)=>{if(u.canPlaySource(h,this.options_[o.toLowerCase()]))return{source:h,tech:o}};return this.options_.sourceOrder?r=s(e,t,n(a)):r=s(t,e,a),r||!1}handleSrc_(e,t){if(typeof e>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const s=Uf(e);if(!s.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,t||(this.cache_.sources=s),this.updateSourceCaches_(s[0]),mT(this,s[0],(r,n)=>{if(this.middleware_=n,t||(this.cache_.sources=s),this.updateSourceCaches_(r),this.src_(r)){if(s.length>1)return this.handleSrc_(s.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady();return}gT(n,this.tech_)}),s.length>1){const r=()=>{this.error(null),this.handleSrc_(s.slice(1),!0)},n=()=>{this.off("error",r)};this.one("error",r),this.one("playing",n),this.resetRetryOnError_=()=>{this.off("error",r),this.off("playing",n)}}}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return t?kf(t.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1):!0}addSourceElement(e,t){return this.tech_?this.tech_.addSourceElement(e,t):!1}removeSourceElement(e){return this.tech_?this.tech_.removeSourceElement(e):!1}load(){if(this.tech_&&this.tech_.vhs){this.src(this.currentSource());return}this.techCall_("load")}reset(){if(this.paused())this.doReset_();else{const e=this.play();Yt(e.then(()=>this.doReset_()))}}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),di(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:s,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:n}=s||{};e&&e.updateContent(),t&&t.updateContent(),r&&r.updateContent(),n&&(n.update(),n.loadProgressBar&&n.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return Object.keys(e).length!==0&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){if(e!==void 0){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")}autoplay(e){if(e===void 0)return this.options_.autoplay||!1;let t;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),t=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,t=typeof t>"u"?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return e!==void 0&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){if(e!==void 0){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")}poster(e){if(e===void 0)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(e===void 0)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(e===void 0)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(e===void 0)return this.error_||null;if(Di("beforeerror").forEach(t=>{const s=t(this,e);if(!(ii(s)&&!Array.isArray(s)||typeof s=="string"||typeof s=="number"||s===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=s}),this.options_.suppressNotSupportedError&&e&&e.code===4){const t=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),this.one("loadstart",function(){this.off(["click","touchstart"],t)});return}if(e===null){this.error_=null,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new Oe(e),this.addClass("vjs-error"),oe.error(`(CODE:${this.error_.code} ${Oe.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),Di("error").forEach(t=>t(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(e===void 0)return this.userActive_;if(e=!!e,e!==this.userActive_){if(this.userActive_=e,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(t){t.stopPropagation(),t.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,s;const r=Ce(this,this.reportUserActivity),n=function(_){(_.screenX!==t||_.screenY!==s)&&(t=_.screenX,s=_.screenY,r())},a=function(){r(),this.clearInterval(e),e=this.setInterval(r,250)},o=function(_){r(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",n),this.on("mouseup",o),this.on("mouseleave",o);const u=this.getChild("controlBar");u&&!ut&&!si&&(u.on("mouseenter",function(_){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),u.on("mouseleave",function(_){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r);let h;const m=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(h);const _=this.options_.inactivityTimeout;_<=0||(h=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},_))};this.setInterval(m,250)}playbackRate(e){if(e!==void 0){this.techCall_("setPlaybackRate",e);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1}defaultPlaybackRate(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_}updatePlayerHeightOnAudioOnlyMode_(){const e=this.getChild("ControlBar");!e||this.audioOnlyCache_.controlBarHeight===e.currentHeight()||(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),s=t&&t.currentHeight();e.forEach(r=>{r!==t&&r.el_&&!r.hasClass("vjs-hidden")&&(r.hide(),this.audioOnlyCache_.hiddenChildren.push(r))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=s,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(s),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if(typeof e!="boolean"||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const t=[];return this.isInPictureInPicture()&&t.push(this.exitPictureInPicture()),this.isFullscreen()&&t.push(this.exitFullscreen()),this.audioPosterMode()&&t.push(this.audioPosterMode(!1)),Promise.all(t).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return typeof e!="boolean"||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()}))}addTextTrack(e,t,s){if(this.tech_)return this.tech_.addTextTrack(e,t,s)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),di(this)&&this.trigger("languagechange"))}languages(){return Ee(Ae.prototype.options_.languages,this.languages_)}toJSON(){const e=Ee(this.options_),t=e.tracks;e.tracks=[];for(let s=0;s<t.length;s++){let r=t[s];r=Ee(r),r.player=void 0,e.tracks[s]=r}return e}createModal(e,t){t=t||{},t.content=e||"";const s=new er(this,t);return this.addChild(s),s.on("dispose",()=>{this.removeChild(s)}),s.open(),s}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let s=0;s<cl.length;s++){const r=cl[s],n=this.breakpoints_[r];if(t<=n){if(e===r)return;e&&this.removeClass(Xn[e]),this.addClass(Xn[r]),this.breakpoint_=r;break}}}removeCurrentBreakpoint_(){const e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return e===void 0?Object.assign(this.breakpoints_):(this.breakpoint_="",this.breakpoints_=Object.assign({},s2,e),this.updateCurrentBreakpoint_(),Object.assign(this.breakpoints_))}responsive(e){if(e===void 0)return this.responsive_;e=!!e;const t=this.responsive_;if(e!==t)return this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return Xn[this.breakpoint_]||""}loadMedia(e,t){if(!e||typeof e!="object")return;const s=this.crossOrigin();this.reset(),this.cache_.media=Ee(e);const{artist:r,artwork:n,description:a,poster:o,src:u,textTracks:h,title:m}=this.cache_.media;!n&&o&&(this.cache_.media.artwork=[{src:o,type:fa(o)}]),s&&this.crossOrigin(s),u&&this.src(u),o&&this.poster(o),Array.isArray(h)&&h.forEach(_=>this.addRemoteTextTrack(_,!1)),this.titleBar&&this.titleBar.update({title:m,description:a||r||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t=this.currentSources(),s=Array.prototype.map.call(this.remoteTextTracks(),n=>({kind:n.kind,label:n.label,language:n.language,src:n.src})),r={src:t,textTracks:s};return e&&(r.poster=e,r.artwork=[{src:r.poster,type:fa(r.poster)}]),r}return Ee(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},s=Ai(e),r=s["data-setup"];if($r(e,"vjs-fill")&&(s.fill=!0),$r(e,"vjs-fluid")&&(s.fluid=!0),r!==null)try{Object.assign(s,JSON.parse(r||"{}"))}catch(n){oe.error("data-setup",n)}if(Object.assign(t,s),e.hasChildNodes()){const n=e.childNodes;for(let a=0,o=n.length;a<o;a++){const u=n[a],h=u.nodeName.toLowerCase();h==="source"?t.sources.push(Ai(u)):h==="track"&&t.tracks.push(Ai(u))}}return t}debug(e){if(e===void 0)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)}playbackRates(e){if(e===void 0)return this.cache_.playbackRates;Array.isArray(e)&&e.every(t=>typeof t=="number")&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}at.names.forEach(function(i){const e=at[i];Ae.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}});Ae.prototype.crossorigin=Ae.prototype.crossOrigin;Ae.players={};const kr=x.navigator;Ae.prototype.options_={techOrder:ae.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:kr&&(kr.languages&&kr.languages[0]||kr.userLanguage||kr.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1};mp.forEach(function(i){Ae.prototype[`handleTech${Ne(i)}_`]=function(){return this.trigger(i)}});U.registerComponent("Player",Ae);const pa="plugin",Ls="activePlugins_",As={},ma=i=>As.hasOwnProperty(i),Kn=i=>ma(i)?As[i]:void 0,gp=(i,e)=>{i[Ls]=i[Ls]||{},i[Ls][e]=!0},ga=(i,e,t)=>{const s=(t?"before":"")+"pluginsetup";i.trigger(s,e),i.trigger(s+":"+e.name,e)},r2=function(i,e){const t=function(){ga(this,{name:i,plugin:e,instance:null},!0);const s=e.apply(this,arguments);return gp(this,i),ga(this,{name:i,plugin:e,instance:s}),s};return Object.keys(e).forEach(function(s){t[s]=e[s]}),t},Id=(i,e)=>(e.prototype.name=i,function(...t){ga(this,{name:i,plugin:e,instance:null},!0);const s=new e(this,...t);return this[i]=()=>s,ga(this,s.getEventHash()),s});class _t{constructor(e){if(this.constructor===_t)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),Zl(this),delete this.trigger,If(this,this.constructor.defaultState),gp(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return Zs(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[Ls][e]=!1,this.player=this.state=null,t[e]=Id(e,As[e])}static isBasic(e){const t=typeof e=="string"?Kn(e):e;return typeof t=="function"&&!_t.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if(typeof e!="string")throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(ma(e))oe.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(Ae.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if(typeof t!="function")throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return As[e]=t,e!==pa&&(_t.isBasic(t)?Ae.prototype[e]=r2(e,t):Ae.prototype[e]=Id(e,t)),t}static deregisterPlugin(e){if(e===pa)throw new Error("Cannot de-register base plugin.");ma(e)&&(delete As[e],delete Ae.prototype[e])}static getPlugins(e=Object.keys(As)){let t;return e.forEach(s=>{const r=Kn(s);r&&(t=t||{},t[s]=r)}),t}static getPluginVersion(e){const t=Kn(e);return t&&t.VERSION||""}}_t.getPlugin=Kn;_t.BASE_PLUGIN_NAME=pa;_t.registerPlugin(pa,_t);Ae.prototype.usingPlugin=function(i){return!!this[Ls]&&this[Ls][i]===!0};Ae.prototype.hasPlugin=function(i){return!!ma(i)};function n2(i,e){let t=!1;return function(...s){return t||oe.warn(i),t=!0,e.apply(this,s)}}function $t(i,e,t,s){return n2(`${e} is deprecated and will be removed in ${i}.0; please use ${t} instead.`,s)}var a2={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};const _p=i=>
187i.indexOf("#")===0?i.slice(1):i;function M(i,e,t){let s=M.getPlayer(i);if(s)return e&&oe.warn(`Player "${i}" is already initialised. Options will not be applied.`),t&&s.ready(t),s;const r=typeof i=="string"?Ii("#"+_p(i)):i;if(!Js(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");const a=("getRootNode"in r?r.getRootNode()instanceof x.ShadowRoot:!1)?r.getRootNode():r.ownerDocument.body;(!r.ownerDocument.defaultView||!a.contains(r))&&oe.warn("The element supplied is not included in the DOM"),e=e||{},e.restoreEl===!0&&(e.restoreEl=(r.parentNode&&r.parentNode.hasAttribute&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),Di("beforesetup").forEach(u=>{const h=u(r,Ee(e));if(!ii(h)||Array.isArray(h)){oe.error("please return an object in beforesetup hooks");return}e=Ee(e,h)});const o=U.getComponent("Player");return s=new o(r,e,t),Di("setup").forEach(u=>u(s)),s}M.hooks_=li;M.hooks=Di;M.hook=Fv;M.hookOnce=Uv;M.removeHook=Zh;if(x.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&Qs()){let i=Ii(".vjs-styles-defaults");if(!i){i=Ef("vjs-styles-defaults");const e=Ii("head");e&&e.insertBefore(i,e.firstChild),Cf(i,` 188 .video-js { 189 width: 300px; 190 height: 150px; 191 } 192 193 .vjs-fluid:not(.vjs-audio-only-mode) { 194 padding-top: 56.25% 195 } 196 `)}}rl(1,M);M.VERSION=el;M.options=Ae.prototype.options_;M.getPlayers=()=>Ae.players;M.getPlayer=i=>{const e=Ae.players;let t;if(typeof i=="string"){const s=_p(i),r=e[s];if(r)return r;t=Ii("#"+s)}else t=i;if(Js(t)){const{player:s,playerId:r}=t;if(s||e[r])return s||e[r]}};M.getAllPlayers=()=>Object.keys(Ae.players).map(i=>Ae.players[i]).filter(Boolean);M.players=Ae.players;M.getComponent=U.getComponent;M.registerComponent=(i,e)=>(ae.isTech(e)&&oe.warn(`The ${i} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),U.registerComponent.call(U,i,e));M.getTech=ae.getTech;M.registerTech=ae.registerTech;M.use=pT;Object.defineProperty(M,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(M.middleware,"TERMINATOR",{value:ha,writeable:!1,enumerable:!0});M.browser=uf;M.obj=jv;M.mergeOptions=$t(9,"videojs.mergeOptions","videojs.obj.merge",Ee);M.defineLazyProperty=$t(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",La);M.bind=$t(9,"videojs.bind","native Function.prototype.bind",Ce);M.registerPlugin=_t.registerPlugin;M.deregisterPlugin=_t.deregisterPlugin;M.plugin=(i,e)=>(oe.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),_t.registerPlugin(i,e));M.getPlugins=_t.getPlugins;M.getPlugin=_t.getPlugin;M.getPluginVersion=_t.getPluginVersion;M.addLanguage=function(i,e){return i=(""+i).toLowerCase(),M.options.languages=Ee(M.options.languages,{[i]:e}),M.options.languages[i]};M.log=oe;M.createLogger=ef;M.time=sT;M.createTimeRange=$t(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Ut);M.createTimeRanges=$t(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Ut);M.formatTime=$t(9,"videojs.formatTime","videojs.time.formatTime",ts);M.setFormatTime=$t(9,"videojs.setFormatTime","videojs.time.setFormatTime",Lf);M.resetFormatTime=$t(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",Of);M.parseUrl=$t(9,"videojs.parseUrl","videojs.url.parseUrl",iu);M.isCrossOrigin=$t(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",Va);M.EventTarget=Ct;M.any=Jl;M.on=Et;M.one=ja;M.off=Ze;M.trigger=Zs;M.xhr=sh;M.TextTrack=nn;M.AudioTrack=Bf;M.VideoTrack=Ff;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(i=>{M[i]=function(){return oe.warn(`videojs.${i}() is deprecated; use videojs.dom.${i}() instead`),Sf[i].apply(null,arguments)}});M.computedStyle=$t(9,"videojs.computedStyle","videojs.dom.computedStyle",Gs);M.dom=Sf;M.fn=Qv;M.num=NT;M.str=tT;M.url=hT;M.Error=a2;/*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */class o2{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get(){return t.enabled_()},set(s){t.enabled_(s)}}),t}}class _a extends M.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get(){return e.selectedIndex_}}),Object.defineProperty(e,"length",{get(){return e.levels_.length}}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const s=this.levels_.length;return t=new o2(e),""+s in this||Object.defineProperty(this,s,{get(){return this.levels_[s]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let s=0,r=this.length;s<r;s++)if(this[s]===e){t=this.levels_.splice(s,1)[0],this.selectedIndex_===s?this.selectedIndex_=-1:this.selectedIndex_>s&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,s=this.length;t<s;t++){const r=this[t];if(r.id===e)return r}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}}_a.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const i in _a.prototype.allowedEvents_)_a.prototype["on"+i]=null;var yp="4.1.0";const l2=function(i,e){const t=i.qualityLevels,s=new _a,r=function(){s.dispose(),i.qualityLevels=t,i.off("dispose",r)};return i.on("dispose",r),i.qualityLevels=()=>s,i.qualityLevels.VERSION=yp,s},vp=function(i){return l2(this,M.obj.merge({},i))};M.registerPlugin("qualityLevels",vp);vp.VERSION=yp;/*! @name @videojs/http-streaming @version 3.14.2 @license Apache-2.0 */const mt=A_,ya=(i,e)=>e&&e.responseURL&&i!==e.responseURL?e.responseURL:i,Lt=i=>M.log.debug?M.log.debug.bind(M,"VHS:",`${i} >`):function(){};function Te(...i){const e=M.obj||M;return(e.merge||e.mergeOptions).apply(e,i)}function Xe(...i){const e=M.time||M;return(e.createTimeRanges||e.createTimeRanges).apply(e,i)}function u2(i){if(i.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges: 197`;for(let t=0;t<i.length;t++){const s=i.start(t),r=i.end(t);e+=`${s} --> ${r}. Duration (${r-s}) 198`}return e}const Qt=1/30,Jt=Qt*3,Tp=function(i,e){const t=[];let s;if(i&&i.length)for(s=0;s<i.length;
vendor: 30,919 bytes, lines 198-199
198s++)e(i.start(s),i.end(s))&&t.push([i.start(s),i.end(s)]);return Xe(t)},ws=function(i,e){return Tp(i,function(t,s){return t-Jt<=e&&s+Jt>=e})},Vn=function(i,e){return Tp(i,function(t){return t-Qt>=e})},c2=function(i){if(i.length<2)return Xe();const e=[];for(let t=1;t<i.length;t++){const s=i.end(t-1),r=i.start(t);e.push([s,r])}return Xe(e)},d2=function(i,e){let t=null,s=null,r=0;const n=[],a=[];if(!i||!i.length||!e||!e.length)return Xe();let o=i.length;for(;o--;)n.push({time:i.start(o),type:"start"}),n.push({time:i.end(o),type:"end"});for(o=e.length;o--;)n.push({time:e.start(o),type:"start"}),n.push({time:e.end(o),type:"end"});for(n.sort(function(u,h){return u.time-h.time}),o=0;o<n.length;o++)n[o].type==="start"?(r++,r===2&&(t=n[o].time)):n[o].type==="end"&&(r--,r===1&&(s=n[o].time)),t!==null&&s!==null&&(a.push([t,s]),t=null,s=null);return Xe(a)},bp=i=>{const e=[];if(!i||!i.length)return"";for(let t=0;t<i.length;t++)e.push(i.start(t)+" => "+i.end(t));return e.join(", ")},h2=function(i,e,t=1){return((i.length?i.end(i.length-1):0)-e)/t},Xi=i=>{const e=[];for(let t=0;t<i.length;t++)e.push({start:i.start(t),end:i.end(t)});return e},f2=function(i,e){if(i===e)return!1;if(!i&&e||!e&&i||i.length!==e.length)return!0;for(let t=0;t<i.length;t++)if(i.start(t)!==e.start(t)||i.end(t)!==e.end(t))return!0;return!1},Vo=function(i){if(!(!i||!i.length||!i.end))return i.end(i.length-1)},Tu=function(i,e){let t=0;if(!i||!i.length)return t;for(let s=0;s<i.length;s++){const r=i.start(s),n=i.end(s);if(!(e>n)){if(e>r&&e<=n){t+=n-e;continue}t+=n-r}}return t},bu=(i,e)=>{if(!e.preload)return e.duration;let t=0;return(e.parts||[]).forEach(function(s){t+=s.duration}),(e.preloadHints||[]).forEach(function(s){s.type==="PART"&&(t+=i.partTargetDuration)}),t},dl=i=>(i.segments||[]).reduce((e,t,s)=>(t.parts?t.parts.forEach(function(r,n){e.push({duration:r.duration,segmentIndex:s,partIndex:n,part:r,segment:t})}):e.push({duration:t.duration,segmentIndex:s,partIndex:null,segment:t,part:null}),e),[]),Sp=i=>{const e=i.segments&&i.segments.length&&i.segments[i.segments.length-1];return e&&e.parts||[]},xp=({preloadSegment:i})=>{if(!i)return;const{parts:e,preloadHints:t}=i;let s=(t||[]).reduce((r,n)=>r+(n.type==="PART"?1:0),0);return s+=e&&e.length?e.length:0,s},Ep=(i,e)=>{if(e.endList)return 0;if(i&&i.suggestedPresentationDelay)return i.suggestedPresentationDelay;const t=Sp(e).length>0;return t&&e.serverControl&&e.serverControl.partHoldBack?e.serverControl.partHoldBack:t&&e.partTargetDuration?e.partTargetDuration*3:e.serverControl&&e.serverControl.holdBack?e.serverControl.holdBack:e.targetDuration?e.targetDuration*3:0},p2=function(i,e){let t=0,s=e-i.mediaSequence,r=i.segments[s];if(r){if(typeof r.start<"u")return{result:r.start,precise:!0};if(typeof r.end<"u")return{result:r.end-r.duration,precise:!0}}for(;s--;){if(r=i.segments[s],typeof r.end<"u")return{result:t+r.end,precise:!0};if(t+=bu(i,r),typeof r.start<"u")return{result:t+r.start,precise:!0}}return{result:t,precise:!1}},m2=function(i,e){let t=0,s,r=e-i.mediaSequence;for(;r<i.segments.length;r++){if(s=i.segments[r],typeof s.start<"u")return{result:s.start-t,precise:!0};if(t+=bu(i,s),typeof s.end<"u")return{result:s.end-t,precise:!0}}return{result:-1,precise:!1}},Cp=function(i,e,t){if(typeof e>"u"&&(e=i.mediaSequence+i.segments.length),e<i.mediaSequence)return 0;const s=p2(i,e);if(s.precise)return s.result;const r=m2(i,e);return r.precise?r.result:s.result+t},Ap=function(i,e,t){if(!i)return 0;if(typeof t!="number"&&(t=0),typeof e>"u"){if(i.totalDuration)return i.totalDuration;if(!i.endList)return x.Infinity}return Cp(i,e,t)},Hr=function({defaultDuration:i,durationList:e,startIndex:t,endIndex:s}){let r=0;if(t>s&&([t,s]=[s,t]),t<0){for(let n=t;n<Math.min(0,s);n++)r+=i;t=0}for(let n=t;n<s;n++)r+=e[n].duration;return r},wp=function(i,e,t,s){if(!i||!i.segments)return null;if(i.endList)return Ap(i);if(e===null)return null;e=e||0;let r=Cp(i,i.mediaSequence+i.segments.length,e);return t&&(s=typeof s=="number"?s:Ep(null,i),r-=s),Math.max(0,r)},g2=function(i,e,t){const r=e||0;let n=wp(i,e,!0,t);return n===null?Xe():(n<r&&(n=r),Xe(r,n))},_2=function({playlist:i,currentTime:e,startingSegmentIndex:t,startingPartIndex:s,startTime:r,exactManifestTimings:n}){let a=e-r;const o=dl(i);let u=0;for(let h=0;h<o.length;h++){const m=o[h];if(t===m.segmentIndex&&!(typeof s=="number"&&typeof m.partIndex=="number"&&s!==m.partIndex)){u=h;break}}if(a<0){if(u>0)for(let h=u-1;h>=0;h--){const m=o[h];if(a+=m.duration,n){if(a<0)continue}else if(a+Qt<=0)continue;return{partIndex:m.partIndex,segmentIndex:m.segmentIndex,startTime:r-Hr({defaultDuration:i.targetDuration,durationList:o,startIndex:u,endIndex:h})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:e}}if(u<0){for(let h=u;h<0;h++)if(a-=i.targetDuration,a<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:e};u=0}for(let h=u;h<o.length;h++){const m=o[h];a-=m.duration;const _=m.duration>Qt,T=a===0,E=_&&a+Qt>=0;if(!((T||E)&&h!==o.length-1)){if(n){if(a>0)continue}else if(a-Qt>=0)continue;return{partIndex:m.partIndex,segmentIndex:m.segmentIndex,startTime:r+Hr({defaultDuration:i.targetDuration,durationList:o,startIndex:u,endIndex:h})}}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:e}},Dp=function(i){return i.excludeUntil&&i.excludeUntil>Date.now()},Su=function(i){return i.excludeUntil&&i.excludeUntil===1/0},Wa=function(i){const e=Dp(i);return!i.disabled&&!e},y2=function(i){return i.disabled},v2=function(i){for(let e=0;e<i.segments.length;e++)if(i.segments[e].key)return!0;return!1},Ip=function(i,e){return e.attributes&&e.attributes[i]},T2=function(i,e,t,s=0){return Ip("BANDWIDTH",t)?(i*t.attributes.BANDWIDTH-s*8)/e:NaN},hl=(i,e)=>{if(i.playlists.length===1)return!0;const t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return i.playlists.filter(s=>Wa(s)?(s.attributes.BANDWIDTH||0)<t:!1).length===0},xu=(i,e)=>!i&&!e||!i&&e||i&&!e?!1:!!(i===e||i.id&&e.id&&i.id===e.id||i.resolvedUri&&e.resolvedUri&&i.resolvedUri===e.resolvedUri||i.uri&&e.uri&&i.uri===e.uri),kd=function(i,e){const t=i&&i.mediaGroups&&i.mediaGroups.AUDIO||{};let s=!1;for(const r in t){for(const n in t[r])if(s=e(t[r][n]),s)break;if(s)break}return!!s},un=i=>{if(!i||!i.playlists||!i.playlists.length)return kd(i,t=>t.playlists&&t.playlists.length||t.uri);for(let e=0;e<i.playlists.length;e++){const t=i.playlists[e],s=t.attributes&&t.attributes.CODECS;if(!(s&&s.split(",").every(n=>lh(n))||kd(i,n=>xu(t,n))))return!1}return!0};var gt={liveEdgeDelay:Ep,duration:Ap,seekable:g2,getMediaInfoForTime:_2,isEnabled:Wa,isDisabled:y2,isExcluded:Dp,isIncompatible:Su,playlistEnd:wp,isAes:v2,hasAttribute:Ip,estimateSegmentRequestTime:T2,isLowestEnabledRendition:hl,isAudioOnly:un,playlistMatch:xu,segmentDurationWithParts:bu};const{log:kp}=M,Os=(i,e)=>`${i}-${e}`,Pp=(i,e,t)=>`placeholder-uri-${i}-${e}-${t}`,b2=({onwarn:i,oninfo:e,manifestString:t,customTagParsers:s=[],customTagMappers:r=[],llhls:n})=>{const a=new R_;i&&a.on("warn",i),e&&a.on("info",e),s.forEach(h=>a.addParser(h)),r.forEach(h=>a.addTagMapper(h)),a.push(t),a.end();const o=a.manifest;if(n||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(h){o.hasOwnProperty(h)&&delete o[h]}),o.segments&&o.segments.forEach(function(h){["parts","preloadHints"].forEach(function(m){h.hasOwnProperty(m)&&delete h[m]})})),!o.targetDuration){let h=10;o.segments&&o.segments.length&&(h=o.segments.reduce((m,_)=>Math.max(m,_.duration),0)),i&&i({message:`manifest has no targetDuration defaulting to ${h}`}),o.targetDuration=h}const u=Sp(o);if(u.length&&!o.partTargetDuration){const h=u.reduce((m,_)=>Math.max(m,_.duration),0);i&&(i({message:`manifest has no partTargetDuration defaulting to ${h}`}),kp.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),o.partTargetDuration=h}return o},sr=(i,e)=>{i.mediaGroups&&["AUDIO","SUBTITLES"].forEach(t=>{if(i.mediaGroups[t])for(const s in i.mediaGroups[t])for(const r in i.mediaGroups[t][s]){const n=i.mediaGroups[t][s][r];e(n,t,s,r)}})},Lp=({playlist:i,uri:e,id:t})=>{i.id=t,i.playlistErrors_=0,e&&(i.uri=e),i.attributes=i.attributes||{}},S2=i=>{let e=i.playlists.length;for(;e--;){const t=i.playlists[e];Lp({playlist:t,id:Os(e,t.uri)}),t.resolvedUri=mt(i.uri,t.uri),i.playlists[t.id]=t,i.playlists[t.uri]=t,t.attributes.BANDWIDTH||kp.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},x2=i=>{sr(i,e=>{e.uri&&(e.resolvedUri=mt(i.uri,e.uri))})},E2=(i,e)=>{const t=Os(0,e),s={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:x.location.href,resolvedUri:x.location.href,playlists:[{uri:e,id:t,resolvedUri:e,attributes:{}}]};return s.playlists[t]=s.playlists[0],s.playlists[e]=s.playlists[0],s},Op=(i,e,t=Pp)=>{i.uri=e;for(let r=0;r<i.playlists.length;r++)if(!i.playlists[r].uri){const n=`placeholder-uri-${r}`;i.playlists[r].uri=n}const s=un(i);sr(i,(r,n,a,o)=>{if(!r.playlists||!r.playlists.length){if(s&&n==="AUDIO"&&!r.uri)for(let u=0;u<i.playlists.length;u++){const h=i.playlists[u];if(h.attributes&&h.attributes.AUDIO&&h.attributes.AUDIO===a)return}r.playlists=[Me({},r)]}r.playlists.forEach(function(u,h){const m=t(n,a,o,u),_=Os(h,m);u.uri?u.resolvedUri=u.resolvedUri||mt(i.uri,u.uri):(u.uri=h===0?m:_,u.resolvedUri=u.uri),u.id=u.id||_,u.attributes=u.attributes||{},i.playlists[u.id]=u,i.playlists[u.uri]=u})}),S2(i),x2(i)};class Pd{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(e=[]){if(this.offset_!==null||!e.length)return;const[t]=e;t.programDateTime!==void 0&&(this.offset_=t.programDateTime/1e3)}setPendingDateRanges(e=[]){if(!e.length)return;const[t]=e,s=t.startDate.getTime();this.trimProcessedDateRanges_(s),this.pendingDateRanges_=e.reduce((r,n)=>(r.set(n.id,n),r),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null)return[];const e={},t=[];this.pendingDateRanges_.forEach((s,r)=>{if(!this.processedDateRanges_.has(r)&&(s.startTime=s.startDate.getTime()/1e3-this.offset_,s.processDateRange=()=>this.processDateRange(s),t.push(s),!!s.class))if(e[s.class]){const n=e[s.class].push(s);s.classListIndex=n-1}else e[s.class]=[s],s.classListIndex=0});for(const s of t){const r=e[s.class]||[];s.endDate?s.endTime=s.endDate.getTime()/1e3-this.offset_:s.endOnNext&&r[s.classListIndex+1]?s.endTime=r[s.classListIndex+1].startTime:s.duration?s.endTime=s.startTime+s.duration:s.plannedDuration?s.endTime=s.startTime+s.plannedDuration:s.endTime=s.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((s,r)=>{s.startDate.getTime()<e&&this.processedDateRanges_.delete(r)})}}const Rp=22,Zi=({requestType:i,request:e,error:t,parseFailure:s})=>{const r=e.status<200||e.status>299,n=e.status>=400&&e.status<=499,a={uri:e.uri,requestType:i},o=r&&!n||s;if(t&&n)a.error=Me({},t),a.errorType=M.Error.NetworkRequestFailed;else if(e.aborted)a.errorType=M.Error.NetworkRequestAborted;else if(e.timedout)a.erroType=M.Error.NetworkRequestTimeout;else if(o){const u=s?M.Error.NetworkBodyParserFailed:M.Error.NetworkBadStatus;a.errorType=u,a.status=e.status,a.headers=e.headers}return a},{EventTarget:C2}=M,A2=(i,e)=>{if(e.endList||!e.serverControl)return i;const t={};if(e.serverControl.canBlockReload){const{preloadSegment:s}=e;let r=e.mediaSequence+e.segments.length;if(s){const n=s.parts||[],a=xp(e)-1;a>-1&&a!==n.length-1&&(t._HLS_part=a),(a>-1||n.length)&&r--}t._HLS_msn=r}if(e.serverControl&&e.serverControl.canSkipUntil&&(t._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(t).length){const s=new x.URL(i);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(r){t.hasOwnProperty(r)&&s.searchParams.set(r,t[r])}),i=s.toString()}return i},w2=(i,e)=>{if(!i)return e;const t=Te(i,e);if(i.preloadHints&&!e.preloadHints&&delete t.preloadHints,i.parts&&!e.parts)delete t.parts;else if(i.parts&&e.parts)for(let s=0;s<e.parts.length;s++)i.parts&&i.parts[s]&&(t.parts[s]=Te(i.parts[s],e.parts[s]));return!i.skipped&&e.skipped&&(t.skipped=!1),i.preload&&!e.preload&&(t.preload=!1),t},D2=(i,e,t)=>{const s=i.slice(),r=e.slice();t=t||0;const n=[];let a;for(let o=0;o<r.length;o++){const u=s[o+t],h=r[o];u?(a=u.map||a,n.push(w2(u,h))):(a&&!h.map&&(h.map=a),n.push(h))}return n},Np=(i,e)=>{!i.resolvedUri&&i.uri&&(i.resolvedUri=mt(e,i.uri)),i.key&&!i.key.resolvedUri&&(i.key.resolvedUri=mt(e,i.key.uri)),i.map&&!i.map.resolvedUri&&(i.map.resolvedUri=mt(e,i.map.uri)),i.map&&i.map.key&&!i.map.key.resolvedUri&&(i.map.key.resolvedUri=mt(e,i.map.key.uri)),i.parts&&i.parts.length&&i.parts.forEach(t=>{t.resolvedUri||(t.resolvedUri=mt(e,t.uri))}),i.preloadHints&&i.preloadHints.length&&i.preloadHints.forEach(t=>{t.resolvedUri||(t.resolvedUri=mt(e,t.uri))})},Mp=function(i){const e=i.segments||[],t=i.preloadSegment;if(t&&t.parts&&t.parts.length){if(t.preloadHints){for(let s=0;s<t.preloadHints.length;s++)if(t.preloadHints[s].type==="MAP")return e}t.duration=i.targetDuration,t.preload=!0,e.push(t)}return e},Bp=(i,e)=>i===e||i.segments&&e.segments&&i.segments.length===e.segments.length&&i.endList===e.endList&&i.mediaSequence===e.mediaSequence&&i.preloadSegment===e.preloadSegment,fl=(i,e,t=Bp)=>{const s=Te(i,{}),r=s.playlists[e.id];if(!r||t(r,e))return null;e.segments=Mp(e);const n=Te(r,e);if(n.preloadSegment&&!e.preloadSegment&&delete n.preloadSegment,r.segments){if(e.skip){e.segments=e.segments||[];for(let a=0;a<e.skip.skippedSegments;a++)e.segments.unshift({skipped:!0})}n.segments=D2(r.segments,e.segments,e.mediaSequence-r.mediaSequence)}n.segments.forEach(a=>{Np(a,n.resolvedUri)});for(let a=0;a<s.playlists.length;a++)s.playlists[a].id===e.id&&(s.playlists[a]=n);return s.playlists[e.id]=n,s.playlists[e.uri]=n,sr(i,(a,o,u,h)=>{if(a.playlists)for(let m=0;m<a.playlists.length;m++)e.id===a.playlists[m].id&&(a.playlists[m]=n)}),s},pl=(i,e)=>{const t=i.segments||[],s=t[t.length-1],r=s&&s.parts&&s.parts[s.parts.length-1],n=r&&r.duration||s&&s.duration;return e&&n?n*1e3:(i.partTargetDuration||i.targetDuration||10)*500},Ld=(i,e,t)=>{if(!i)return;const s=[];return i.forEach(r=>{if(!r.attributes)return;const{BANDWIDTH:n,RESOLUTION:a,CODECS:o}=r.attributes;s.push({id:r.id,bandwidth:n,resolution:a,codecs:o})}),{type:e,isLive:t,renditions:s}};class Ds extends C2{constructor(e,t,s={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=Lt("PlaylistLoader");const{withCredentials:r=!1}=s;this.src=e,this.vhs_=t,this.withCredentials=r,this.addDateRangesToTextTrack_=s.addDateRangesToTextTrack;const n=t.options_;this.customTagParsers=n&&n.customTagParsers||[],this.customTagMappers=n&&n.customTagMappers||[],this.llhls=n&&n.llhls,this.dateRangesStorage_=new Pd,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();!t.length||!this.addDateRangesToTextTrack_||this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA")return;const e=this.media();let t=mt(this.main.uri,e.uri);this.llhls&&(t=A2(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(s,r)=>{if(this.request){if(s)return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA");this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}})}playlistRequestError(e,t,s){const{uri:r,id:n}=t;this.request=null,s&&(this.state=s),this.error={playlist:this.main.playlists[n],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:Zi({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{return b2({onwarn:({message:s})=>this.logger_(`m3u8-parser warn for ${e}: ${s}`),oninfo:({message:s})=>this.logger_(`m3u8-parser info for ${e}: ${s}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}catch(s){this.error=s,this.error.metadata={errorType:M.Error.StreamingHlsPlaylistParserError,error:s}}}haveMetadata({playlistString:e,playlistObject:t,url:s,id:r}){this.request=null,this.state="HAVE_METADATA";const n={playlistInfo:{type:"media",uri:s}};this.trigger({type:"playlistparsestart",metadata:n});const a=t||this.parseManifest_({url:s,manifestString:e});a.lastRequest=Date.now(),Lp({playlist:a,uri:s,id:r});const o=fl(this.main,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,o?(this.main=o,this.media_=this.main.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(pl(this.media(),!!o)),n.parsedPlaylist=Ld(this.main.playlists,n.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:n}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),x.clearTimeout(this.mediaUpdateTimeout),x.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new Pd,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(x.clearTimeout(this.finalRenditionTimeout),t){const o=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=x.setTimeout(this.media.bind(this,e,!1),o);return}const s=this.state,r=!this.media_||e.id!==this.media_.id,n=this.main.playlists[e.id];if(n&&n.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,r&&(this.trigger("mediachanging"),s==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(pl(e,!0)),!r)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;const a={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:a}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(o,u)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=ya(e.resolvedUri,u),o)return this.playlistRequestError(this.request,e,s);this.trigger({type:"playlistrequestcomplete",metadata:a}),this.haveMetadata({playlistString:u.responseText,url:e.uri,id:e.id}),s==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const s=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=x.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},s);return}if(!this.started){this.start();return}t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=x.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=x.location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}const e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,s)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:s.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:s.responseText,code:2,metadata:Zi({requestType:s.requestType,request:s,error:t})},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=ya(this.src,s),this.trigger({type:"playlistparsestart",metadata:e});const r=this.parseManifest_({manifestString:s.responseText,url:this.src});e.parsedPlaylist=Ld(r.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(r)})}srcUri(){return typeof this.src=="string"?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists){this.main=e,Op(this.main,this.srcUri()),e.playlists.forEach(s=>{s.segments=Mp(s),s.segments.forEach(r=>{Np(r,s.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}const t=this.srcUri()||x.location.href;this.main=E2(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const s=this.main,r=e.ID;let n=s.playlists.length;for(;n--;){const a=s.playlists[n];if(a.attributes["PATHWAY-ID"]===r){const o=a.resolvedUri,u=a.id;if(t){const h=this.createCloneURI_(a.resolvedUri,e),m=Os(r,h),_=this.createCloneAttributes_(r,a.attributes),T=this.createClonePlaylist_(a,m,e,_);s.playlists[n]=T,s.playlists[m]=T,s.playlists[h]=T}else s.playlists.splice(n,1);delete s.playlists[u],delete s.playlists[o]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const s=this.main,r=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!s.mediaGroups[n]||!s.mediaGroups[n][r])){for(const a in s.mediaGroups[n])if(a===r){for(const o in s.mediaGroups[n][a])s.mediaGroups[n][a][o].playlists.forEach((h,m)=>{const _=s.playlists[h.id],T=_.id,E=_.resolvedUri;delete s.playlists[T],delete s.playlists[E]});delete s.mediaGroups[n][a]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const s=this.main,r=s.playlists.length,n=this.createCloneURI_(t.resolvedUri,e),a=Os(e.ID,n),o=this.createCloneAttributes_(e.ID,t.attributes),u=this.createClonePlaylist_(t,a,e,o);s.playlists[r]=u,s.playlists[a]=u,s.playlists[n]=u,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,s=e["BASE-ID"],r=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!r.mediaGroups[n]||r.mediaGroups[n][t]))for(const a in r.mediaGroups[n]){if(a===s)r.mediaGroups[n][t]={};else continue;for(const o in r.mediaGroups[n][a]){const u=r.mediaGroups[n][a][o];r.mediaGroups[n][t][o]=Me({},u);const h=r.mediaGroups[n][t][o],m=this.createCloneURI_(u.resolvedUri,e);h.resolvedUri=m,h.uri=m,h.playlists=[],u.playlists.forEach((_,T)=>{const E=r.playlists[_.id],A=Pp(n,t,o),y=Os(t,A);if(E&&!r.playlists[y]){const w=this.createClonePlaylist_(E,y,e),D=w.resolvedUri;r.playlists[y]=w,r.playlists[D]=w}h.playlists[T]=this.createClonePlaylist_(_,y,e)})}}})}createClonePlaylist_(e,t,s,r){const n=this.createCloneURI_(e.resolvedUri,s),a={resolvedUri:n,uri:n,id:t};return e.segments&&(a.segments=[]),r&&(a.attributes=r),Te(e,a)}createCloneURI_(e,t){const s=new URL(e);s.hostname=t["URI-REPLACEMENT"].HOST;const r=t["URI-REPLACEMENT"].PARAMS;for(const n of Object.keys(r))s.searchParams.set(n,r[n]);return s.href}createCloneAttributes_(e,t){const s={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{t[r]&&(s[r]=e)}),s}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const s in e.contentProtection){const r=e.contentProtection[s].attributes.keyId;r&&t.add(r.toLowerCase())}return t}}}const ml=function(i,e,t,s){const r=i.responseType==="arraybuffer"?i.response:i.responseText;!e&&r&&(i.responseTime=Date.now(),i.roundTripTime=i.responseTime-i.requestTime,i.bytesReceived=r.byteLength||r.length,i.bandwidth||(i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3))),t.headers&&(i.responseHeaders=t.headers),e&&e.code==="ETIMEDOUT"&&(i.timedout=!0),!e&&!i.aborted&&t.statusCode!==200&&t.statusCode!==206&&t.statusCode!==0&&(e=new Error("XHR Failed with a response of: "+(i&&(r||i.responseText)))),s(e,i)},I2=(i,e)=>{if(!i||!i.size)return;let t=e;return i.forEach(s=>{t=s(t)}),t},k2=(i,e,t,s)=>{!i||!i.size||i.forEach(r=>{r(e,t,s)})},Fp=function(){const i=function e(t,s){t=Te({timeout:45e3},t);const r=e.beforeRequest||M.Vhs.xhr.beforeRequest,n=e._requestCallbackSet||M.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||M.Vhs.xhr._responseCallbackSet;r&&typeof r=="function"&&(M.log.warn("beforeRequest is deprecated, use onRequest instead."),n.add(r));const o=M.Vhs.xhr.original===!0?M.xhr:M.Vhs.xhr,u=I2(n,t);n.delete(r);const h=o(u||t,function(_,T){return k2(a,h,_,T),ml(h,_,T,s)}),m=h.abort;return h.abort=function(){return h.aborted=!0,m.apply(h,arguments)},h.uri=t.uri,h.requestType=t.requestType,h.requestTime=Date.now(),h};return i.original=!0,i},P2=function(i){let e;const t=i.offset;return typeof i.offset=="bigint"||typeof i.length=="bigint"?e=x.BigInt(i.offset)+x.BigInt(i.length)-x.BigInt(1):e=i.offset+i.length-1,"bytes="+t+"-"+e},gl=function(i){const e={};return i.byterange&&(e.Range=P2(i.byterange)),e},L2=function(i,e){return i.start(e)+"-"+i.end(e)},O2=function(i,e){const t=i.toString(16);return"00".substring(0,2-t.length)+t+(e%2?" ":"")},R2=function(i){return i>=32&&i<126?String.fromCharCode(i):"."},Up=function(i){const e={};return Object.keys(i).forEach(t=>{const s=i[t];ch(s)?e[t]={bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}:e[t]=s}),e},va=function(i){const e=i.byterange||{length:1/0,offset:0};return[e.length,e.offset,i.resolvedUri].join(",")},$p=function(i){return i.resolvedUri},qp=i=>{const e=Array.prototype.slice.call(i),t=16;let s="",r,n;for(let a=0;a<e.length/t;a++)r=e.slice(a*t,a*t+t).map(O2).join(""),n=e.slice(a*t,a*t+t).map(R2).join(""),s+=r+" "+n+` 199`;return s},N2=({bytes:i})=>qp(i),M2=i=>{let e="",t;for(t=0;t<i.length;t++)e+=L2(i,t)+" ";return e};var B2=Object.freeze({__proto__:null,createTransferableMessage:Up,initSegmentId:va,segmentKeyId:$p,hexDump:qp,tagDump:N2,textRanges:M2});const jp=.25,F2=(i,e)=>{if(!e.dateTimeObject)return null;const t=e.videoTimingInfo.transmuxerPrependedSeconds,r=e.videoTimingInfo.transmuxedPresentationStart+t,n=i-r;return new Date(e.dateTimeObject.getTime()+n*1e3)},U2=i=>i.transmuxedPresentationEnd-i.transmuxedPresentationStart-i.transmuxerPrependedSeconds,$2=(i,e)=>{let t;try{t=new Date(i)}catch{return null}if(!e||!e.segments||e.segments.length===0)return null;let s=e.segments[0];if(t<new Date(s.dateTimeObject))return null;for(let u=0;u<e.segments.length-1;u++){s=e.segments[u];const h=new Date(e.segments[u+1].dateTimeObject);if(t<h)break}const r=e.segments[e.segments.length-1],n=r.dateTimeObject,a=r.videoTimingInfo?U2(r.videoTimingInfo):r.duration+r.duration*jp,o=new Date(n.getTime()+a*1e3);return t>o?null:(t>new Date(n)&&(s=r),{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:gt.duration(e,e.mediaSequence+e.segments.indexOf(s)),type:s.videoTimingInfo?"accurate":"estimate"})},q2=(i,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let t=0,s;for(let n=0;n<e.segments.length&&(s=e.segments[n],t=s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationEnd:t+s.duration,!(i<=t));n++);const r=e.segments[e.segments.length-1];if(r.videoTimingInfo&&r.videoTimingInfo.transmuxedPresentationEnd<i)return null;if(i>t){if(i>t+r.duration*jp)return null;s=r}return{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:t-s.duration,type:s.videoTimingInfo?"accurate":"estimate"}},j2=(i,e)=>{let t,s;try{t=new Date(i),s=new Date(e)}catch{}const r=t.getTime();return(s.getTime()-r)/1e3},H2=i=>{if(!i.segments||i.segments.length===0)return!1;for(let e=0;e<i.segments.length;e++)if(!i.segments[e].dateTimeObject)return!1;return!0},V2=({playlist:i,time:e=void 0,callback:t})=>{if(!t)throw new Error("getProgramTime: callback must be provided");if(!i||e===void 0)return t({message:"getProgramTime: playlist and time must be provided"});const s=q2(e,i);if(!s)return t({message:"valid programTime was not found"});if(s.type==="estimate")return t({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:s.estimatedStart});const r={mediaSeconds:e},n=F2(e,s.segment);return n&&(r.programDateTime=n.toISOString()),t(null,r)},Hp=({programTime:i,playlist:e,retryCount:t=2,seekTo:s,pauseAfterSeek:r=!0,tech:n,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(typeof i>"u"||!e||!s)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!e.endList&&!n.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!H2(e))return a({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const o=$2(i,e);if(!o)return a({message:`${i} was not found in the stream`});const u=o.segment,h=j2(u.dateTimeObject,i);if(o.type==="estimate"){if(t===0)return a({message:`${i} is not buffered yet. Try again`});s(o.estimatedStart+h),n.one("seeked",()=>{Hp({programTime:i,playlist:e,retryCount:t-1,seekTo:s,pauseAfterSeek:r,tech:n,callback:a})});return}const m=u.start+h,_=()=>a(null,n.currentTime());n.one("seeked",_),r&&n.pause(),s(m)},zo=(i,e)=>{if(i.readyState===4)return e()},z2=(i,e,t,s)=>{let r=[],n,a=!1;const o=function(_,T,E,A){return T.abort(),a=!0,t(_,T,E,A)},u=function(_,T){if(a)return;if(_)return _.metadata=Zi({requestType:s,request:T,error:_}),o(_,T,"",r);const E=T.responseText.substring(r&&r.byteLength||0,T.responseText.length);if(r=G_(r,dh(E,!0)),n=n||Nr(r),r.length<10||n&&r.length<n+2)return zo(T,()=>o(_,T,"",r));const A=Hl(r);return A==="ts"&&r.length<188?zo(T,()=>o(_,T,"",r)):!A&&r.length<376?zo(T,()=>o(_,T,"",r)):o(null,T,A,r)},m=e({uri:i,beforeSend(_){_.overrideMimeType("text/plain;
199 charset=x-user-defined"),_.addEventListener("progress",function({total:T,loaded:E}){return ml(_,null,{statusCode:_.status},u)})}},function(_,T){return ml(m,_,T,u)});return m},{EventTarget:G2}=M,Od=function(i,e){if(!Bp(i,e)||i.sidx&&e.sidx&&(i.sidx.offset!==e.sidx.offset||i.sidx.length!==e.sidx.length))return!1;if(!i.sidx&&e.sidx||i.sidx&&!e.sidx||i.segments&&!e.segments||!i.segments&&e.segments)return!1;if(!i.segments&&!e.segments)return!0;for(let t=0;t<i.segments.length;t++){const s=i.segments[t],r=e.segments[t];if(s.uri!==r.uri)return!1;if(!s.byterange&&!r.byterange)continue;const n=s.byterange,a=r.byterange;if(n&&!a||!n&&a||n.offset!==a.offset||n.length!==a.length)return!1}return!0},W2=(i,e,t,s)=>{const r=s.attributes.NAME||t;return`placeholder-uri-${i}-${e}-${r}`},X2=({mainXml:i,srcUrl:e,clientOffset:t,sidxMapping:s,previousManifest:r})=>{const n=gv(i,{manifestUri:e,clientOffset:t,sidxMapping:s,previousManifest:r});return Op(n,e,W2),n},K2=(i,e)=>{sr(i,(t,s,r,n)=>{(!e.mediaGroups[s][r]||!(n in e.mediaGroups[s][r]))&&delete i.mediaGroups[s][r][n]})},Y2=(i,e,t)=>{let s=!0,r=Te(i,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let n=0;n<e.playlists.length;n++){const a=e.playlists[n];if(a.sidx){const u=Ia(a.sidx);t&&t[u]&&t[u].sidx&&$l(a,t[u].sidx,a.sidx.resolvedUri)}const o=fl(r,a,Od);o&&(r=o,s=!1)}return sr(e,(n,a,o,u)=>{if(n.playlists&&n.playlists.length){const h=n.playlists[0].id,m=fl(r,n.playlists[0],Od);m&&(r=m,u in r.mediaGroups[a][o]||(r.mediaGroups[a][o][u]=n),r.mediaGroups[a][o][u].playlists[0]=r.playlists[h],s=!1)}}),K2(r,e),e.minimumUpdatePeriod!==i.minimumUpdatePeriod&&(s=!1),s?null:r},Q2=(i,e)=>(!i.map&&!e.map||!!(i.map&&e.map&&i.map.byterange.offset===e.map.byterange.offset&&i.map.byterange.length===e.map.byterange.length))&&i.uri===e.uri&&i.byterange.offset===e.byterange.offset&&i.byterange.length===e.byterange.length,Rd=(i,e)=>{const t={};for(const s in i){const n=i[s].sidx;if(n){const a=Ia(n);if(!e[a])break;const o=e[a].sidxInfo;Q2(o,n)&&(t[a]=e[a])}}return t},J2=(i,e)=>{let s=Rd(i.playlists,e);return sr(i,(r,n,a,o)=>{if(r.playlists&&r.playlists.length){const u=r.playlists;s=Te(s,Rd(u,e))}}),s};class _l extends G2{constructor(e,t,s={},r){super(),this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);const{withCredentials:n=!1}=s;if(this.vhs_=t,this.withCredentials=n,this.addMetadataToTextTrack=s.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=Lt("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}requestErrored_(e,t,s){if(!this.request)return!0;if(this.request=null,e)return this.error=typeof e=="object"&&!(e instanceof Error)?e:{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata},s&&(this.state=s),this.trigger("error"),!0}addSidxSegments_(e,t,s){const r=e.sidx&&Ia(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r]){this.mediaRequest_=x.setTimeout(()=>s(!1),0);return}const n=ya(e.sidx.resolvedUri),a=(u,h)=>{if(this.requestErrored_(u,h,t))return;const m=this.mainPlaylistLoader_.sidxMapping_,{requestType:_}=h;let T;try{T=Sv(te(h.response).subarray(8))}catch(E){E.metadata=Zi({requestType:_,request:h,parseFailure:!0}),this.requestErrored_(E,h,t);return}return m[r]={sidxInfo:e.sidx,sidx:T},$l(e,T,e.sidx.resolvedUri),s(!0)},o="dash-sidx";this.request=z2(n,this.vhs_.xhr,(u,h,m,_)=>{if(u)return a(u,h);if(!m||m!=="mp4"){const A=m||"unknown";return a({status:h.status,message:`Unsupported ${A} container type for sidx segment at URL: ${n}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},h)}const{offset:T,length:E}=e.sidx.byterange;if(_.length>=E+T)return a(u,{response:_.subarray(T,T+E),status:h.status,uri:h.uri});this.request=this.vhs_.xhr({uri:n,responseType:"arraybuffer",requestType:"dash-sidx",headers:gl({byterange:e.sidx.byterange})},a)},o)}dispose(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},x.clearTimeout(this.minimumUpdatePeriodTimeout_),x.clearTimeout(this.mediaRequest_),x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if(typeof e=="string"){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const s=!this.media_||e.id!==this.media_.id;if(s&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,s&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}s&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,r=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,this.mediaRequest_=null,this.refreshMedia_(t.id),e==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(x.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const s=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=x.setTimeout(()=>this.load(),s);return}if(!this.started){this.start();return}t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")}
vendor: 51,230 bytes, lines 199-204
199start(){if(this.started=!0,!this.isMain_){this.mediaRequest_=x.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,t)=>{this.haveMain_(),!this.hasPendingRequest()&&!this.media_&&this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){const t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:t}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(s,r)=>{if(s){const{requestType:a}=r;s.metadata=Zi({requestType:a,request:r,error:s})}if(this.requestErrored_(s,r)){this.state==="HAVE_NOTHING"&&(this.started=!1);return}this.trigger({type:"manifestrequestcomplete",metadata:t});const n=r.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=r.responseText,r.responseHeaders&&r.responseHeaders.date?this.mainLoaded_=Date.parse(r.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=ya(this.mainPlaylistLoader_.srcUrl,r),n){this.handleMain_(),this.syncClientServerClock_(()=>e(r,n));return}return e(r,n)})}syncClientServerClock_(e){const t=_v(this.mainPlaylistLoader_.mainXml_);if(t===null)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();if(t.method==="DIRECT")return this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e();this.request=this.vhs_.xhr({uri:mt(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(s,r)=>{if(!this.request)return;if(s){const{requestType:a}=r;return this.error.metadata=Zi({requestType:a,request:r,error:s}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let n;t.method==="HEAD"?!r.responseHeaders||!r.responseHeaders.date?n=this.mainLoaded_:n=Date.parse(r.responseHeaders.date):n=Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=n-Date.now(),e()})}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:t});let s;try{s=X2({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(n){this.error=n,this.error.metadata={errorType:M.Error.StreamingDashManifestParserError,error:n},this.trigger("error")}e&&(s=Y2(e,s,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=s||e;const r=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(r&&r!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=r),(!e||s&&s.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(s),s){const{duration:n,endList:a}=s,o=[];s.playlists.forEach(h=>{o.push({id:h.id,bandwidth:h.attributes.BANDWIDTH,resolution:h.attributes.RESOLUTION,codecs:h.attributes.CODECS})});const u={duration:n,isLive:!a,renditions:o};t.parsedManifest=u,this.trigger({type:"manifestparsecomplete",metadata:t})}return!!s}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(x.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;if(t===0&&(e.media()?t=e.media().targetDuration*1e3:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof t!="number"||t<=0){t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`);return}this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=x.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=J2(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,s=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,s=!this.media_||this.media_!==t[e];if(s?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const r=()=>{this.media().endList||(this.mediaUpdateTimeout=x.setTimeout(()=>{this.trigger("mediaupdatetimeout"),r()},pl(this.media(),!!s)))};r()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map(s=>({cueTime:s.start,frames:[{data:s.messageData}]}));this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const s in e.contentProtection){const r=e.contentProtection[s].attributes["cenc:default_KID"];r&&t.add(r.replace(/-/g,"").toLowerCase())}return t}}}var Ve={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const Z2=i=>{const e=new Uint8Array(new ArrayBuffer(i.length));for(let t=0;t<i.length;t++)e[t]=i.charCodeAt(t);return e.buffer},Vp=function(i){return i.on=i.addEventListener,i.off=i.removeEventListener,i},eb=function(i){try{return URL.createObjectURL(new Blob([i],{type:"application/javascript"}))}catch{const t=new BlobBuilder;return t.append(i),URL.createObjectURL(t.getBlob())}},zp=function(i){return function(){const e=eb(i),t=Vp(new Worker(e));t.objURL=e;const s=t.terminate;return t.on=t.addEventListener,t.off=t.removeEventListener,t.terminate=function(){return URL.revokeObjectURL(e),s.call(this)},t}},Gp=function(i){return`var browserWorkerPolyFill = ${Vp.toString()}; 200browserWorkerPolyFill(self); 201`+i},Wp=function(i){return i.toString().replace(/^function.+?{/,"").slice(0,-1)},tb=Gp(Wp(function(){var i=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=function(){this.init=function(){var l={};this.on=function(c,f){l[c]||(l[c]=[]),l[c]=l[c].concat(f)},this.off=function(c,f){var d;return l[c]?(d=l[c].indexOf(f),l[c]=l[c].slice(),l[c].splice(d,1),d>-1):!1},this.trigger=function(c){var f,d,p,g;if(f=l[c],!!f)if(arguments.length===2)for(p=f.length,d=0;d<p;++d)f[d].call(this,arguments[1]);else{for(g=[],d=arguments.length,d=1;d<arguments.length;++d)g.push(arguments[d]);for(p=f.length,d=0;d<p;++d)f[d].apply(this,g)}},this.dispose=function(){l={}}}};e.prototype.pipe=function(l){return this.on("data",function(c){l.push(c)}),this.on("done",function(c){l.flush(c)}),this.on("partialdone",function(c){l.partialFlush(c)}),this.on("endedtimeline",function(c){l.endTimeline(c)}),this.on("reset",function(c){l.reset(c)}),l},e.prototype.push=function(l){this.trigger("data",l)},e.prototype.flush=function(l){this.trigger("done",l)},e.prototype.partialFlush=function(l){this.trigger("partialdone",l)},e.prototype.endTimeline=function(l){this.trigger("endedtimeline",l)},e.prototype.reset=function(l){this.trigger("reset",l)};var t=e,s=Math.pow(2,32),r=function(l){var c=new DataView(l.buffer,l.byteOffset,l.byteLength),f;return c.getBigUint64?(f=c.getBigUint64(0),f<Number.MAX_SAFE_INTEGER?Number(f):f):c.getUint32(0)*s+c.getUint32(4)},n={getUint64:r,MAX_UINT32:s},a=n.MAX_UINT32,o,u,h,m,_,T,E,A,y,w,D,N,O,B,I,$,X,K,re,xe,ue,ge,ee,he,Re,ce,Ie,Ke,At,it,ct,qt,Li,Oi,ss,_i;(function(){var l;if(ee={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},!(typeof Uint8Array>"u")){for(l in ee)ee.hasOwnProperty(l)&&(ee[l]=[l.charCodeAt(0),l.charCodeAt(1),l.charCodeAt(2),l.charCodeAt(3)]);he=new Uint8Array([105,115,111,109]),ce=new Uint8Array([97,118,99,49]),Re=new Uint8Array([0,0,0,1]),Ie=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]),Ke=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]),At={video:Ie,audio:Ke},qt=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),ct=new Uint8Array([0,0,0,0,0,0,0,0]),Li=new Uint8Array([0,0,0,0,0,0,0,0]),Oi=Li,ss=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),_i=Li,it=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),o=function(l){var c=[],f=0,d,p,g;for(d=1;d<arguments.length;d++)c.push(arguments[d]);for(d=c.length;d--;)f+=c[d].byteLength;for(p=new Uint8Array(f+8),g=new DataView(p.buffer,p.byteOffset,p.byteLength),g.setUint32(0,p.byteLength),p.set(l,4),d=0,f=8;d<c.length;d++)p.set(c[d],f),f+=c[d].byteLength;return p},u=function(){return o(ee.dinf,o(ee.dref,qt))},h=function(l){return o(ee.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,l.audioobjecttype<<3|l.samplingfrequencyindex>>>1,l.samplingfrequencyindex<<7|l.channelcount<<3,6,1,2]))},m=function(){return o(ee.ftyp,he,Re,he,ce)},$=function(l){return o(ee.hdlr,At[l])},_=function(l){return o(ee.mdat,l)},I=function(l){var c=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,l.duration>>>24&255,l.duration>>>16&255,l.duration>>>8&255,l.duration&255,85,196,0,0]);return l.samplerate&&(c[12]=l.samplerate>>>24&255,c[13]=l.samplerate>>>16&255,c[14]=l.samplerate>>>8&255,c[15]=l.samplerate&255),o(ee.mdhd,c)},B=function(l){return o(ee.mdia,I(l),$(l.type),E(l))},T=function(l){return o(ee.mfhd,new Uint8Array([0,0,0,0,(l&4278190080)>>24,(l&16711680)>>16,(l&65280)>>8,l&255]))},E=function(l){return o(ee.minf,l.type==="video"?o(ee.vmhd,it):o(ee.smhd,ct),u(),K(l))},A=function(l,c){for(var f=[],d=c.length;d--;)f[d]=xe(c[d]);return o.apply(null,[ee.moof,T(l)].concat(f))},y=function(l){for(var c=l.length,f=[];c--;)f[c]=N(l[c]);return o.apply(null,[ee.moov,D(4294967295)].concat(f).concat(w(l)))},w=function(l){for(var c=l.length,f=[];c--;)f[c]=ue(l[c]);return o.apply(null,[ee.mvex].concat(f))},D=function(l){var c=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(l&4278190080)>>24,(l&16711680)>>16,(l&65280)>>8,l&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return o(ee.mvhd,c)},X=function(l){var c=l.samples||[],f=new Uint8Array(4+c.length),d,p;for(p=0;p<c.length;p++)d=c[p].flags,f[p+4]=d.dependsOn<<4|d.isDependedOn<<2|d.hasRedundancy;return o(ee.sdtp,f)},K=function(l){return o(ee.stbl,re(l),o(ee.stts,_i),o(ee.stsc,Oi),o(ee.stsz,ss),o(ee.stco,Li))},function(){var l,c;re=function(f){return o(ee.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),f.type==="video"?l(f):c(f))},l=function(f){var d=f.sps||[],p=f.pps||[],g=[],v=[],b,S;for(b=0;b<d.length;b++)g.push((d[b].byteLength&65280)>>>8),g.push(d[b].byteLength&255),g=g.concat(Array.prototype.slice.call(d[b]));for(b=0;b<p.length;b++)v.push((p[b].byteLength&65280)>>>8),v.push(p[b].byteLength&255),v=v.concat(Array.prototype.slice.call(p[b]));if(S=[ee.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(f.width&65280)>>8,f.width&255,(f.height&65280)>>8,f.height&255,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]),o(ee.avcC,new Uint8Array([1,f.profileIdc,f.profileCompatibility,f.levelIdc,255].concat([d.length],g,[p.length],v))),o(ee.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],f.sarRatio){var C=f.sarRatio[0],k=f.sarRatio[1];S.push(o(ee.pasp,new Uint8Array([(C&4278190080)>>24,(C&16711680)>>16,(C&65280)>>8,C&255,(k&4278190080)>>24,(k&16711680)>>16,(k&65280)>>8,k&255])))}return o.apply(null,S)},c=function(f){return o(ee.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(f.channelcount&65280)>>8,f.channelcount&255,(f.samplesize&65280)>>8,f.samplesize&255,0,0,0,0,(f.samplerate&65280)>>8,f.samplerate&255,0,0]),h(f))}}(),O=function(l){var c=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(l.id&4278190080)>>24,(l.id&16711680)>>16,(l.id&65280)>>8,l.id&255,0,0,0,0,(l.duration&4278190080)>>24,(l.duration&16711680)>>16,(l.duration&65280)>>8,l.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(l.width&65280)>>8,l.width&255,0,0,(l.height&65280)>>8,l.height&255,0,0]);return o(ee.tkhd,c)},xe=function(l){var c,f,d,p,g,v,b;return c=o(ee.tfhd,new Uint8Array([0,0,0,58,(l.id&4278190080)>>24,(l.id&16711680)>>16,(l.id&65280)>>8,l.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),v=Math.floor(l.baseMediaDecodeTime/a),b=Math.floor(l.baseMediaDecodeTime%a),f=o(ee.tfdt,new Uint8Array([1,0,0,0,v>>>24&255,v>>>16&255,v>>>8&255,v&255,b>>>24&255,b>>>16&255,b>>>8&255,b&255])),g=92,l.type==="audio"?(d=ge(l,g),o(ee.traf,c,f,d)):(p=X(l),d=ge(l,p.length+g),o(ee.traf,c,f,d,p))},N=function(l){return l.duration=l.duration||4294967295,o(ee.trak,O(l),B(l))},ue=function(l){var c=new Uint8Array([0,0,0,0,(l.id&4278190080)>>24,(l.id&16711680)>>16,(l.id&65280)>>8,l.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return l.type!=="video"&&(c[c.length-1]=0),o(ee.trex,c)},function(){var l,c,f;f=function(d,p){var g=0,v=0,b=0,S=0;return d.length&&(d[0].duration!==void 0&&(g=1),d[0].size!==void 0&&(v=2),d[0].flags!==void 0&&(b=4),d[0].compositionTimeOffset!==void 0&&(S=8)),[0,0,g|v|b|S,1,(d.length&4278190080)>>>24,(d.length&16711680)>>>16,(d.length&65280)>>>8,d.length&255,(p&4278190080)>>>24,(p&16711680)>>>16,(p&65280)>>>8,p&255]},c=function(d,p){var g,v,b,S,C,k;for(S=d.samples||[],p+=20+16*S.length,b=f(S,p),v=new Uint8Array(b.length+S.length*16),v.set(b),g=b.length,k=0;k<S.length;k++)C=S[k],v[g++]=(C.duration&4278190080)>>>24,v[g++]=(C.duration&16711680)>>>16,v[g++]=(C.duration&65280)>>>8,v[g++]=C.duration&255,v[g++]=(C.size&4278190080)>>>24,v[g++]=(C.size&16711680)>>>16,v[g++]=(C.size&65280)>>>8,v[g++]=C.size&255,v[g++]=C.flags.isLeading<<2|C.flags.dependsOn,v[g++]=C.flags.isDependedOn<<6|C.flags.hasRedundancy<<4|C.flags.paddingValue<<1|C.flags.isNonSyncSample,v[g++]=C.flags.degradationPriority&61440,v[g++]=C.flags.degradationPriority&15,v[g++]=(C.compositionTimeOffset&4278190080)>>>24,v[g++]=(C.compositionTimeOffset&16711680)>>>16,v[g++]=(C.compositionTimeOffset&65280)>>>8,v[g++]=C.compositionTimeOffset&255;return o(ee.trun,v)},l=function(d,p){var g,v,b,S,C,k;for(S=d.samples||[],p+=20+8*S.length,b=f(S,p),g=new Uint8Array(b.length+S.length*8),g.set(b),v=b.length,k=0;k<S.length;k++)C=S[k],g[v++]=(C.duration&4278190080)>>>24,g[v++]=(C.duration&16711680)>>>16,g[v++]=(C.duration&65280)>>>8,g[v++]=C.duration&255,g[v++]=(C.size&4278190080)>>>24,g[v++]=(C.size&16711680)>>>16,g[v++]=(C.size&65280)>>>8,g[v++]=C.size&255;return o(ee.trun,g)},ge=function(d,p){return d.type==="audio"?l(d,p):c(d,p)}}();var yi={ftyp:m,mdat:_,moof:A,moov:y,initSegment:function(l){var c=m(),f=y(l),d;return d=new Uint8Array(c.byteLength+f.byteLength),d.set(c),d.set(f,c.byteLength),d}},Xa=function(l){var c,f,d=[],p=[];for(p.byteLength=0,p.nalCount=0,p.duration=0,d.byteLength=0,c=0;c<l.length;c++)f=l[c],f.nalUnitType==="access_unit_delimiter_rbsp"?(d.length&&(d.duration=f.dts-d.dts,p.byteLength+=d.byteLength,p.nalCount+=d.length,p.duration+=d.duration,p.push(d)),d=[f],d.byteLength=f.data.byteLength,d.pts=f.pts,d.dts=f.dts):(f.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(d.keyFrame=!0),d.duration=f.dts-d.dts,d.byteLength+=f.data.byteLength,d.push(f));return p.length&&(!d.duration||d.duration<=0)&&(d.duration=p[p.length-1].duration),p.byteLength+=d.byteLength,p.nalCount+=d.length,p.duration+=d.duration,p.push(d),p},rs=function(l){var c,f,d=[],p=[];for(d.byteLength=0,d.nalCount=0,d.duration=0,d.pts=l[0].pts,d.dts=l[0].dts,p.byteLength=0,p.nalCount=0,p.duration=0,p.pts=l[0].pts,p.dts=l[0].dts,c=0;c<l.length;c++)f=l[c],f.keyFrame?(d.length&&(p.push(d),p.byteLength+=d.byteLength,p.nalCount+=d.nalCount,p.duration+=d.duration),d=[f],d.nalCount=f.length,d.byteLength=f.byteLength,d.pts=f.pts,d.dts=f.dts,d.duration=f.duration):(d.duration+=f.duration,d.nalCount+=f.length,d.byteLength+=f.byteLength,d.push(f));return p.length&&d.duration<=0&&(d.duration=p[p.length-1].duration),p.byteLength+=d.byteLength,p.nalCount+=d.nalCount,p.duration+=d.duration,p.push(d),p},Ka=function(l){var c;return!l[0][0].keyFrame&&l.length>1&&(c=l.shift(),l.byteLength-=c.byteLength,l.nalCount-=c.nalCount,l[0][0].dts=c.dts,l[0][0].pts=c.pts,l[0][0].duration+=c.duration),l},vi=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},cn=function(l,c){var f=vi();return f.dataOffset=c,f.compositionTimeOffset=l.pts-l.dts,f.duration=l.duration,f.size=4*l.length,f.size+=l.byteLength,l.keyFrame&&(f.flags.dependsOn=2,f.flags.isNonSyncSample=0),f},rr=function(l,c){var f,d,p,g,v,b=c||0,S=[];for(f=0;f<l.length;f++)for(g=l[f],d=0;d<g.length;d++)v=g[d],p=cn(v,b),b+=p.size,S.push(p);return S},Ya=function(l){var c,f,d,p,g,v,b=0,S=l.byteLength,C=l.nalCount,k=S+4*C,F=new Uint8Array(k),Y=new DataView(F.buffer);for(c=0;c<l.length;c++)for(p=l[c],f=0;f<p.length;f++)for(g=p[f],d=0;d<g.length;d++)v=g[d],Y.setUint32(b,v.data.byteLength),b+=4,F.set(v.data,b),b+=v.data.byteLength;return F},Qa=function(l,c){var f,d=c||0,p=[];return f=cn(l,d),p.push(f),p},ns=function(l){var c,f,d=0,p=l.byteLength,g=l.length,v=p+4*g,b=new Uint8Array(v),S=new DataView(b.buffer);for(c=0;c<l.length;c++)f=l[c],S.setUint32(d,f.data.byteLength),d+=4,b.set(f.data,d),d+=f.data.byteLength;return b},Ot={groupNalsIntoFrames:Xa,groupFramesIntoGops:rs,extendFirstKeyFrame:Ka,generateSampleTable:rr,concatenateNalData:Ya,generateSampleTableForFrame:Qa,concatenateNalDataForFrame:ns},Rt=[33,16,5,32,164,27],nr=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],me=function(l){for(var c=[];l--;)c.push(0);return c},ar=function(l){return Object.keys(l).reduce(function(c,f){return c[f]=new Uint8Array(l[f].reduce(function(d,p){return d.concat(p)},[])),c},{})},or,ke=function(){if(!or){var l={96e3:[Rt,[227,64],me(154),[56]],88200:[Rt,[231],me(170),[56]],64e3:[Rt,[248,192],me(240),[56]],48e3:[Rt,[255,192],me(268),[55,148,128],me(54),[112]],44100:[Rt,[255,192],me(268),[55,163,128],me(84),[112]],32e3:[Rt,[255,192],me(268),[55,234],me(226),[112]],24e3:[Rt,[255,192],me(268),[55,255,128],me(268),[111,112],me(126),[224]],16e3:[Rt,[255,192],me(268),[55,255,128],me(268),[111,255],me(269),[223,108],me(195),[1,192]],12e3:[nr,me(268),[3,127,248],me(268),[6,255,240],me(268),[13,255,224],me(268),[27,253,128],me(259),[56]],11025:[nr,me(268),[3,127,248],me(268),[6,255,240],me(268),[13,255,224],me(268),[27,255,192],me(268),[55,175,128],me(108),[112]],8e3:[nr,me(268),[3,121,16],me(47),[7]]};or=ar(l)}return or},as=9e4,os,ls,Ri,us,lr,Ni,ur;os=function(l){return l*as},ls=function(l,c){return l*c},Ri=function(l){return l/as},us=function(l,c){return l/c},lr=function(l,c){return os(us(l,c))},Ni=function(l,c){return ls(Ri(l),c)},ur=function(l,c,f){return Ri(f?l:l-c)};var pe={ONE_SECOND_IN_TS:as,secondsToVideoTs:os,secondsToAudioTs:ls,videoTsToSeconds:Ri,audioTsToSeconds:us,audioTsToVideoTs:lr,videoTsToAudioTs:Ni,metadataTsToSeconds:ur},dn=ke,Ti=pe,Ja=function(l){var c,f,d=0;for(c=0;c<l.length;c++)f=l[c],d+=f.data.byteLength;return d},hn=function(l,c,f,d){var p,g=0,v=0,b=0,S=0,C,k,F;if(c.length&&(p=Ti.audioTsToVideoTs(l.baseMediaDecodeTime,l.samplerate),g=Math.ceil(Ti.ONE_SECOND_IN_TS/(l.samplerate/1024)),f&&d&&(v=p-Math.max(f,d),b=Math.floor(v/g),S=b*g),!(b<1||S>Ti.ONE_SECOND_IN_TS/2))){for(C=dn()[l.samplerate],C||(C=c[0].data),k=0;k<b;k++)F=c[0],c.splice(0,0,{data:C,dts:F.dts-g,pts:F.pts-g});return l.baseMediaDecodeTime-=Math.floor(Ti.videoTsToAudioTs(S,l.samplerate)),S}},Za=function(l,c,f){return c.minSegmentDts>=f?l:(c.minSegmentDts=1/0,l.filter(function(d){return d.dts>=f?(c.minSegmentDts=Math.min(c.minSegmentDts,d.dts),c.minSegmentPts=c.minSegmentDts,!0):!1}))},jt=function(l){var c,f,d=[];for(c=0;c<l.length;c++)f=l[c],d.push({size:f.data.byteLength,duration:1024});return d},eo=function(l){var c,f,d=0,p=new Uint8Array(Ja(l));for(c=0;c<l.length;c++)f=l[c],p.set(f.data,d),d+=f.data.byteLength;return p},fn={prefixWithSilence:hn,trimAdtsFramesByEarliestDts:Za,generateSampleTable:jt,concatenateFrameData:eo},to=pe.ONE_SECOND_IN_TS,pn=function(l,c){typeof c.pts=="number"&&(l.timelineStartInfo.pts===void 0&&(l.timelineStartInfo.pts=c.pts),l.minSegmentPts===void 0?l.minSegmentPts=c.pts:l.minSegmentPts=Math.min(l.minSegmentPts,c.pts),l.maxSegmentPts===void 0?l.maxSegmentPts=c.pts:l.maxSegmentPts=Math.max(l.maxSegmentPts,c.pts)),typeof c.dts=="number"&&(l.timelineStartInfo.dts===void 0&&(l.timelineStartInfo.dts=c.dts),l.minSegmentDts===void 0?l.minSegmentDts=c.dts:l.minSegmentDts=Math.min(l.minSegmentDts,c.dts),l.maxSegmentDts===void 0?l.maxSegmentDts=c.dts:l.maxSegmentDts=Math.max(l.maxSegmentDts,c.dts))},io=function(l){delete l.minSegmentDts,delete l.maxSegmentDts,delete l.minSegmentPts,delete l.maxSegmentPts},so=function(l,c){var f,d,p=l.minSegmentDts;return c||(p-=l.timelineStartInfo.dts),f=l.timelineStartInfo.baseMediaDecodeTime,f+=p,f=Math.max(0,f),l.type==="audio"&&(d=l.samplerate/to,f*=d,f=Math.floor(f)),f},P={clearDtsInfo:io,calculateTrackBaseMediaDecodeTime:so,collectDtsInfo:pn},q=4,_e=128,cs=function(l){for(var c=0,f={payloadType:-1,payloadSize:0},d=0,p=0;c<l.byteLength&&l[c]!==_e;){for(;l[c]===255;)d+=255,c++;for(d+=l[c++];l[c]===255;)p+=255,c++;if(p+=l[c++],!f.payload&&d===q){var g=String.fromCharCode(l[c+3],l[c+4],l[c+5],l[c+6]);if(g==="GA94"){f.payloadType=d,f.payloadSize=p,f.payload=l.subarray(c,c+p);break}else f.payload=void 0}c+=p,d=0,p=0}return f},ro=function(l){return l.payload[0]!==181||(l.payload[1]<<8|l.payload[2])!==49||String.fromCharCode(l.payload[3],l.payload[4],l.payload[5],l.payload[6])!=="GA94"||l.payload[7]!==3?null:l.payload.subarray(8,l.payload.length-1)},Ht=function(l,c){var f=[],d,p,g,v;if(!(c[0]&64))return f;for(p=c[0]&31,d=0;d<p;d++)g=d*3,v={type:c[g+2]&3,pts:l},c[g+2]&4&&(v.ccData=c[g+3]<<8|c[g+4],f.push(v));return f},dt=function(l){for(var c=l.byteLength,f=[],d=1,p,g;d<c-2;)l[d]===0&&l[d+1]===0&&l[d+2]===3?(f.push(d+2),d+=2):d++;if(f.length===0)return l;p=c-f.length,g=new Uint8Array(p);var v=0;for(d=0;d<p;v++,d++)v===f[0]&&(v++,f.shift()),g[d]=l[v];return g},cr={parseSei:cs,parseUserData:ro,parseCaptionPackets:Ht,discardEmulationPreventionBytes:dt,USER_DATA_REGISTERED_ITU_T_T35:q},dr=t,ds=cr,je=function(l){l=l||{},je.prototype.init.call(this),this.parse708captions_=typeof l.parse708captions=="boolean"?l.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new R(0,0),new R(0,1),new R(1,0),new R(1,1)],this.parse708captions_&&(this.cc708Stream_=new ye({captionServices:l.captionServices})),this.reset(),this.ccStreams_.forEach(function(c){c.on("data",this.trigger.bind(this,"data")),c.on("partialdone",this.trigger.bind(this,"partialdone")),c.on("done",this.trigger.bind(this,"done"))},this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};je.prototype=new dr,je.prototype.push=function(l){var c,f,d;if(l.nalUnitType==="sei_rbsp"&&(c=ds.parseSei(l.escapedRBSP),!!c.payload&&c.payloadType===ds.USER_DATA_REGISTERED_ITU_T_T35&&(f=ds.parseUserData(c),!!f))){if(l.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}else if(l.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1);return}d=ds.parseCaptionPackets(l.pts,f),this.captionPackets_=this.captionPackets_.concat(d),this.latestDts_!==l.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=l.dts}},je.prototype.flushCCStreams=function(l){this.ccStreams_.forEach(function(c){return l==="flush"?c.flush():c.partialFlush()},this)},je.prototype.flushStream=function(l){if(!this.captionPackets_.length){this.flushCCStreams(l);return}this.captionPackets_.forEach(function(c,f){c.presortIndex=f}),this.captionPackets_.sort(function(c,f){return c.pts===f.pts?c.presortIndex-f.presortIndex:c.pts-f.pts}),this.captionPackets_.forEach(function(c){c.type<2?this.dispatchCea608Packet(c):this.dispatchCea708Packet(c)},this),this.captionPackets_.length=0,this.flushCCStreams(l)},je.prototype.flush=function(){return this.flushStream("flush")},je.prototype.partialFlush=function(){return this.flushStream("partialFlush")},je.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(l){l.reset()})},je.prototype.dispatchCea608Packet=function(l){this.setsTextOrXDSActive(l)?this.activeCea608Channel_[l.type]=null:this.setsChannel1Active(l)?this.activeCea608Channel_[l.type]=0:this.setsChannel2Active(l)&&(this.activeCea608Channel_[l.type]=1),this.activeCea608Channel_[l.type]!==null&&this.ccStreams_[(l.type<<1)+this.activeCea608Channel_[l.type]].push(l)},je.prototype.setsChannel1Active=function(l){return(l.ccData&30720)===4096},je.prototype.setsChannel2Active=function(l){return(l.ccData&30720)===6144},je.prototype.setsTextOrXDSActive=function(l){return(l.ccData&28928)===256||(l.ccData&30974)===4138||(l.ccData&30974)===6186},je.prototype.dispatchCea708Packet=function(l){this.parse708captions_&&this.cc708Stream_.push(l)};var Vt={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},mn=function(l){var c=Vt[l]||l;return l&4096&&l===c?"":String.fromCharCode(c)},Mi=function(l){return 32<=l&&l<=127||160<=l&&l<=255},Ye=function(l){this.windowNum=l,this.reset()};Ye.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},Ye.prototype.getText=function(){return this.rows.join(` 202`)},Ye.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},Ye.prototype.newLine=function(l){for(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(l),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},Ye.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},Ye.prototype.addText=function(l){this.rows[this.rowIdx]+=l},Ye.prototype.backspace=function(){if(!this.isEmpty()){var l=this.rows[this.rowIdx];this.rows[this.rowIdx]=l.substr(0,l.length-1)}};var Tt=function(l,c,f){this.serviceNum=l,this.text="",this.currentWindow=new Ye(-1),this.windows=[],this.stream=f,typeof c=="string"&&this.createTextDecoder(c)};Tt.prototype.init=function(l,c){this.startPts=l;for(var f=0;f<8;f++)this.windows[f]=new Ye(f),typeof c=="function"&&(this.windows[f].beforeRowOverflow=c)},Tt.prototype.setCurrentWindow=function(l){this.currentWindow=this.windows[l]},Tt.prototype.createTextDecoder=function(l){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(l)}catch(c){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+l+" encoding. "+c})}};var ye=function(l){l=l||{},ye.prototype.init.call(this);var c=this,f=l.captionServices||{},d={},p;Object.keys(f).forEach(g=>{p=f[g],/^SERVICE/.test(g)&&(d[g]=p.encoding)}),this.serviceEncodings=d,this.current708Packet=null,this.services={},this.push=function(g){g.type===3?(c.new708Packet(),c.add708Bytes(g)):(c.current708Packet===null&&c.new708Packet(),c.add708Bytes(g))}};ye.prototype=new dr,ye.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},ye.prototype.add708Bytes=function(l){var c=l.ccData,f=c>>>8,d=c&255;this.current708Packet.ptsVals.push(l.pts),this.current708Packet.data.push(f),this.current708Packet.data.push(d)},ye.prototype.push708Packet=function(){var l=this.current708Packet,c=l.data,f=null,d=null,p=0,g=c[p++];for(l.seq=g>>6,l.sizeCode=g&63;p<c.length;p++)g=c[p++],f=g>>5,d=g&31,f===7&&d>0&&(g=c[p++],f=g),this.pushServiceBlock(f,p,d),d>0&&(p+=d-1)},ye.prototype.pushServiceBlock=function(l,c,f){var d,p=c,g=this.current708Packet.data,v=this.services[l];for(v||(v=this.initService(l,p));p<c+f&&p<g.length;p++)d=g[p],Mi(d)?p=this.handleText(p,v):d===24?p=this.multiByteCharacter(p,v):d===16?p=this.extendedCommands(p,v):128<=d&&d<=135?p=this.setCurrentWindow(p,v):152<=d&&d<=159?p=this.defineWindow(p,v):d===136?p=this.clearWindows(p,v):d===140?p=this.deleteWindows(p,v):d===137?p=this.displayWindows(p,v):d===138?p=this.hideWindows(p,v):d===139?p=this.toggleWindows(p,v):d===151?p=this.setWindowAttributes(p,v):d===144?p=this.setPenAttributes(p,v):d===145?p=this.setPenColor(p,v):d===146?p=this.setPenLocation(p,v):d===143?v=this.reset(p,v):d===8?v.currentWindow.backspace():d===12?v.currentWindow.clearText():d===13?v.currentWindow.pendingNewLine=!0:d===14?v.currentWindow.clearText():d===141&&p++},ye.prototype.extendedCommands=function(l,c){var f=this.current708Packet.data,d=f[++l];return Mi(d)&&(l=this.handleText(l,c,{isExtended:!0})),l},ye.prototype.getPts=function(l){return this.current708Packet.ptsVals[Math.floor(l/2)]},ye.prototype.initService=function(l,c){var d="SERVICE"+l,f=this,d,p;return d in this.serviceEncodings&&(p=this.serviceEncodings[d]),this.services[l]=new Tt(l,p,f),this.services[l].init(this.getPts(c),function(g){f.flushDisplayed(g,f.services[l])}),this.services[l]},ye.prototype.handleText=function(l,c,f){var d=f&&f.isExtended,p=f&&f.isMultiByte,g=this.current708Packet.data,v=d?4096:0,b=g[l],S=g[l+1],C=c.currentWindow,k,F;function Y(j){return j.map(ie=>("0"+(ie&255).toString(16)).slice(-2)).join("")}if(p?(F=[b,S],l++):F=[b],c.textDecoder_&&!d)k=c.textDecoder_.decode(new Uint8Array(F));else if(p){const j=Y(F);k=String.fromCharCode(parseInt(j,16))}else k=mn(v|b);return C.pendingNewLine&&!C.isEmpty()&&C.newLine(this.getPts(l)),C.pendingNewLine=!1,C.addText(k),l},ye.prototype.multiByteCharacter=function(l,c){var f=this.current708Packet.data,d=f[l+1],p=f[l+2];return Mi(d)&&Mi(p)&&(l=this.handleText(++l,c,{isMultiByte:!0})),l},ye.prototype.setCurrentWindow=function(l,c){var f=this.current708Packet.data,d=f[l],p=d&7;return c.setCurrentWindow(p),l},ye.prototype.defineWindow=function(l,c){var f=this.current708Packet.data,d=f[l],p=d&7;c.setCurrentWindow(p);var g=c.currentWindow;return d=f[++l],g.visible=(d&32)>>5,g.rowLock=(d&16)>>4,g.columnLock=(d&8)>>3,g.priority=d&7,d=f[++l],g.relativePositioning=(d&128)>>7,g.anchorVertical=d&127,d=f[++l],g.anchorHorizontal=d,d=f[++l],g.anchorPoint=(d&240)>>4,g.rowCount=d&15,d=f[++l],g.columnCount=d&63,d=f[++l],g.windowStyle=(d&56)>>3,g.penStyle=d&7,g.virtualRowCount=g.rowCount+1,l},ye.prototype.setWindowAttributes=function(l,c){var f=this.current708Packet.data,d=f[l],p=c.currentWindow.winAttr;return d=f[++l],p.fillOpacity=(d&192)>>6,p.fillRed=(d&48)>>4,p.fillGreen=(d&12)>>2,p.fillBlue=d&3,d=f[++l],p.borderType=(d&192)>>6,p.borderRed=(d&48)>>4,p.borderGreen=(d&12)>>2,p.borderBlue=d&3,d=f[++l],p.borderType+=(d&128)>>5,p.wordWrap=(d&64)>>6,p.printDirection=(d&48)>>4,p.scrollDirection=(d&12)>>2,p.justify=d&3,d=f[++l],p.effectSpeed=(d&240)>>4,p.effectDirection=(d&12)>>2,p.displayEffect=d&3,l},ye.prototype.flushDisplayed=function(l,c){for(var f=[],d=0;d<8;d++)c.windows[d].visible&&!c.windows[d].isEmpty()&&f.push(c.windows[d].getText());c.endPts=l,c.text=f.join(` 203 204`),this.pushCaption(c),c.startPts=l},ye.prototype.pushCaption=function(l){l.text!==""&&(this.trigger("data",{startPts:l.startPts,endPts:l.endPts,text:l.text,stream:"cc708_"+l.serviceNum}),l.text="",l.startPts=l.endPts)},ye.prototype.displayWindows=function(l,c){var f=this.current708Packet.data,d=f[++l],p=this.getPts(l);this.flushDisplayed(p,c);for(var g=0;g<8;g++)d&1<<g&&(c.windows[g].visible=1);return l},ye.prototype.hideWindows=function(l,c){var f=this.current708Packet.data,d=f[++l],p=this.getPts(l);this.flushDisplayed(p,c);for(var g=0;g<8;g++)d&1<<g&&(c.windows[g].visible=0);return l},ye.prototype.toggleWindows=function(l,c){var f=this.current708Packet.data,d=f[++l],p=this.getPts(l);this.flushDisplayed(p,c);for(var g=0;g<8;g++)d&1<<g&&(c.windows[g].visible^=1);return l},ye.prototype.clearWindows=function(l,c){var f=this.current708Packet.data,d=f[++l],p=this.getPts(l);this.flushDisplayed(p,c);for(var g=0;g<8;g++)d&1<<g&&c.windows[g].clearText();return l},ye.prototype.deleteWindows=function(l,c){var f=this.current708Packet.data,d=f[++l],p=this.getPts(l);this.flushDisplayed(p,c);for(var g=0;g<8;g++)d&1<<g&&c.windows[g].reset();return l},ye.prototype.setPenAttributes=function(l,c){var f=this.current708Packet.data,d=f[l],p=c.currentWindow.penAttr;return d=f[++l],p.textTag=(d&240)>>4,p.offset=(d&12)>>2,p.penSize=d&3,d=f[++l],p.italics=(d&128)>>7,p.underline=(d&64)>>6,p.edgeType=(d&56)>>3,p.fontStyle=d&7,l},ye.prototype.setPenColor=function(l,c){var f=this.current708Packet.data,d=f[l],p=c.currentWindow.penColor;return d=f[++l],p.fgOpacity=(d&192)>>6,p.fgRed=(d&48)>>4,p.fgGreen=(d&12)>>2,p.fgBlue=d&3,d=f[++l],p.bgOpacity=(d&192)>>6,p.bgRed=(d&48)>>4,p.bgGreen=(d&12)>>2,p.bgBlue=d&3,d=f[++l],p.edgeRed=(d&48)>>4,p.edgeGreen=(d&12)>>2,p.edgeBlue=d&3,l},ye.prototype.setPenLocation=function(l,c){var f=this.current708Packet.data,d=f[l],p=c.currentWindow.penLoc;return c.currentWindow.pendingNewLine=!0,d=f[++l],p.row=d&15,d=f[++l],p.column=d&63,l},ye.prototype.reset=function(l,c){var f=this.getPts(l);return this.flushDisplayed(f,c),this.initService(c.serviceNum,l)};var gn={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Bi=function(l){return l===null?"":(l=gn[l]||l,String.fromCharCode(l))},Fi=14,_n=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],zt=function(){for(var l=[],c=Fi+1;c--;)l.push({text:"",indent:0,offset:0});return l},R=function(l,c){R.prototype.init.call(this),this.field_=l||0,this.dataChannel_=c||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(f){var d,p,g,v,b;if(d=f.ccData&32639,d===this.lastControlCode_){this.lastControlCode_=null;return}if((d&61440)===4096?this.lastControlCode_=d:d!==this.PADDING_&&(this.lastControlCode_=null),g=d>>>8,v=d&255,d!==this.PADDING_)if(d===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(d===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(f.pts),this.flushDisplayed(f.pts),p=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=p,this.startPts_=f.pts;else if(d===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(f.pts);else if(d===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(f.pts);else if(d===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(f.pts);else if(d===this.CARRIAGE_RETURN_)this.clearFormatting(f.pts),this.flushDisplayed(f.pts),this.shiftRowsUp_(),this.startPts_=f.pts;else if(d===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(d===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(f.pts),this.displayed_=zt();else if(d===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=zt();else if(d===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(f.pts),this.displayed_=zt()),this.mode_="paintOn",this.startPts_=f.pts;else if(this.isSpecialCharacter(g,v))g=(g&3)<<8,b=Bi(g|v),this[this.mode_](f.pts,b),this.column_++;else if(this.isExtCharacter(g,v))this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),g=(g&3)<<8,b=Bi(g|v),this[this.mode_](f.pts,b),this.column_++;else if(this.isMidRowCode(g,v))this.clearFormatting(f.pts),this[this.mode_](f.pts," "),this.column_++,(v&14)===14&&this.addFormatting(f.pts,["i"]),(v&1)===1&&this.addFormatting(f.pts,["u"]);else if(this.isOffsetControlCode(g,v)){const C=v&3;this.nonDisplayed_[this.row_].offset=C,this.column_+=C}else if(this.isPAC(g,v)){var S=_n.indexOf(d&7968);if(this.mode_==="rollUp"&&(S-this.rollUpRows_+1<0&&(S=this.rollUpRows_-1),this.setRollUp(f.pts,S)),S!==this.row_&&S>=0&&S<=14&&(this.clearFormatting(f.pts),this.row_=S),v&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(f.pts,["u"]),(d&16)===16){const C=(d&14)>>1;this.column_=C*4,this.nonDisplayed_[this.row_].indent+=C}this.isColorPAC(v)&&(v&14)===14&&this.addFormatting(f.pts,["i"])}else this.isNormalChar(g)&&(v===0&&(v=null),b=Bi(g),b+=Bi(v),this[this.mode_](f.pts,b),this.column_+=b.length)}};R.prototype=new dr,R.prototype.flushDisplayed=function(l){const c=d=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+d+"."})},f=[];this.displayed_.forEach((d,p)=>{if(d&&d.text&&d.text.length){try{d.text=d.text.trim()}catch{c(p)}d.text.length&&f.push({text:d.text,line:p+1,position:10+Math.min(70,d.indent*10)+d.offset*2.5})}else d==null&&c(p)}),f.length&&this.trigger("data",{startPts:this.startPts_,endPts:l,content:f,stream:this.name_})},R.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=zt(),this.nonDisplayed_=zt(),this.lastControlCode_=null,this.column_=0,this.row_=Fi,this.rollUpRows_=2,this.formatting_=[]},R.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},R.prototype.isSpecialCharacter=function(l,c){return l===this.EXT_&&c>=48&&c<=63},R.prototype.isExtCharacter=function(l,c){return(l===this.EXT_+1||l===this.EXT_+2)&&c>=32&&c<=63},R.prototype.isMidRowCode=function(l,c){return l===this.EXT_&&c>=32&&c<=47},R.prototype.isOffsetControlCode=function(l,c){return l===this.OFFSET_&&c>=33&&c<=35},R.prototype.isPAC=function(l,c){return l>=this.BASE_&&l<this.BASE_+8&&c>=64&&c<=127},R.prototype.isColorPAC=function(l){return l>=64&&l<=79||l>=96&&l<=127},R.prototype.isNormalChar=function(l){return l>=32&&l<=127},R.prototype.setRollUp=function(l,c){if(this.mode_!=="rollUp"&&(this.row_=Fi,this.mode_="rollUp",this.flushDisplayed(l),this.nonDisplayed_=zt(),this.displayed_=zt()),c!==void 0&&c!==this.row_)for(var f=0;f<this.rollUpRows_;f++)this.displayed_[c-f]=this.displayed_[this.row_-f],this.displayed_[this.row_-f]={text:"",indent:0,offset:0};c===void 0&&(c=this.row_),this.topRow_=c-this.rollUpRows_+1},R.prototype.addFormatting=function(l,c){this.formatting_=this.formatting_.concat(c);var f=c.reduce(function(d,p){return d+"<"+p+">"},"");this[this.mode_](l,f)},R.prototype.clearFormatting=function(l){if(this.formatting_.length){var c=this.formatting_.reverse().reduce(function(f,d){return f+"</"+d+">"},"");this.formatting_=[],this[this.mode_](l,c)}},R.prototype.popOn=function(l,c){var f=this.nonDisplayed_[this.row_].text;f+=c,this.nonDisplayed_[this.row_].text=f},R.prototype.rollUp=function(l,c){var f=this.displayed_[this.row_].text;f+=c,this.displayed_[this.row_].text=f},R.prototype.shiftRowsUp_=function(){var l;for(l=0;l<this.topRow_;l++)this.displayed_[l]={text:"",indent:0,offset:0};for(l=this.row_+1;l<Fi+1;l++)this.displayed_[l]={text:"",indent:0,offset:0};for(l=this.topRow_;l<this.row_;l++)this.displayed_[l]=this.displayed_[l+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}},R.prototype.paintOn=function(l,c){var f=this.displayed_[this.row_].text;f+=c,this.displayed_[this.row_].text=f};var ve={CaptionStream:je,Cea608Stream:R,Cea708Stream:ye},Ui={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Tm=t,bm=8589934592,Sm=4294967296,Au="shared",no=function(l,c){var f=1;for(l>c&&(f=-1);Math.abs(c-l)>Sm;)l+=f*bm;return l},ao=function(l){var c,f;ao.prototype.init.call(this),this.type_=l||Au,this.push=function(d){if(d.type==="metadata"){this.trigger("data",d);return}this.type_!==Au&&d.type!==this.type_||(f===void 0&&(f=d.dts),d.dts=no(d.dts,f),d.pts=no(d.pts,f),c=d.dts,this.trigger("data",d))},this.flush=function(){f=c,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){f=void 0,c=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};ao.prototype=new Tm;var wu={TimestampRolloverStream:ao,handleRollover:no},xm=(l,c,f)=>{if(!l)return-1;for(var d=f;d<l.length;d++)if(l[d]===c)return d;return-1},Em={typedArrayIndexOf:xm},yn=Em.typedArrayIndexOf,vn={Iso88591:0,Utf16:1,Utf16be:2,Utf8:3},Du=function(l,c,f){var d,p="";for(d=c;d<f;d++)p+="%"+("00"+l[d].toString(16)).slice(-2);return p},hr=function(l,c,f){return decodeURIComponent(Du(l,c,f))},fr=function(l,c,f){return unescape(Du(l,c,f))},pr=function(l){return l[0]<<21|l[1]<<14|l[2]<<7|l[3]},mr={APIC:function(l){var c=1,f,d,p="-->";l.data[0]===vn.Utf8&&(f=yn(l.data,0,c),!(f<0)&&(l.mimeType=fr(l.data,c,f),c=f+1,l.pictureType=l.data[c],c++,d=yn(l.data,0,c),!(d<0)&&(l.description=hr(l.data,c,d),c=d+1,l.mimeType===p?l.url=fr(l.data,c,l.data.length):l.pictureData=l.data.subarray(c,l.data.length))))},"T*":function(l){l.data[0]===vn.Utf8&&(l.value=hr(l.data,1,l.data.length).replace(/\0*$/,""),l.values=l.value.split("\0"))},TXXX:function(l){var c;l.data[0]===vn.Utf8&&(c=yn(l.data,0,1),c!==-1&&(l.description=hr(l.data,1,c),l.value=hr(l.data,c+1,l.data.length).replace(/\0*$/,""),l.data=l.value))},"W*":function(l){l.url=fr(l.data,0,l.data.length).replace(/\0.*$/,"")},WXXX:function(l){var c;l.data[0]===vn.Utf8&&(c=yn(l.data,0,1),c!==-1&&(l.description=hr(l.data,1,c),l.url=fr(l.data,c+1,l.data.length).replace(/\0.*$/,"")))},PRIV:function(l){var c;for(c=0;c<l.data.length;c++)if(l.data[c]===0){l.owner=fr(l.data,0,c);break}l.privateData=l.data.subarray(c+1),l.data=l.privateData}},Cm=function(l){var c,f,d=10,p=0,g=[];if(!(l.length<10||l[0]!==73||l[1]!==68||l[2]!==51)){p=pr(l.subarray(6,10)),p+=10;var v=l[5]&64;v&&(d+=4,d+=pr(l.subarray(10,14)),p-=pr(l.subarray(16,20)));do{if(c=pr(l.subarray(d+4,d+8)),c<1)break;f=String.fromCharCode(l[d],l[d+1],l[d+2],l[d+3]);var b={id:f,data:l.subarray(d+10,d+c+10)};b.key=b.id,mr[b.id]?mr[b.id](b):b.id[0]==="T"?mr["T*"](b):b.id[0]==="W"&&mr["W*"](b),g.push(b),d+=10,d+=c}while(d<p);return g}},Iu={parseId3Frames:Cm,parseSyncSafeInteger:pr,frameParsers:mr},Am=t,wm=Ui,bi=Iu,Tn;Tn=function(l){var c={descriptor:l&&l.descriptor},f=0,d=[],p=0,g;if(Tn.prototype.init.call(this),this.dispatchType=wm.METADATA_STREAM_TYPE.toString(16),c.descriptor)for(g=0;g<c.descriptor.length;g++)this.dispatchType+=("00"+c.descriptor[g].toString(16)).slice(-2);this.push=function(v){var b,S,C,k,F,Y;if(v.type==="timed-metadata"){if(v.dataAlignmentIndicator&&(p=0,d.length=0),d.length===0&&(v.data.length<10||v.data[0]!==73||v.data[1]!==68||v.data[2]!==51)){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(d.push(v),p+=v.data.byteLength,d.length===1&&(f=bi.parseSyncSafeInteger(v.data.subarray(6,10)),f+=10),!(p<f)){for(b={data:new Uint8Array(f),frames:[],pts:d[0].pts,dts:d[0].dts},F=0;F<f;)b.data.set(d[0].data.subarray(0,f-F),F),F+=d[0].data.byteLength,p-=d[0].data.byteLength,d.shift();S=10,b.data[5]&64&&(S+=4,S+=bi.parseSyncSafeInteger(b.data.subarray(10,14)),f-=bi.parseSyncSafeInteger(b.data.subarray(16,20)));do{if(C=bi.parseSyncSafeInteger(b.data.subarray(S+4,S+8)),C<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if(Y=String.fromCharCode(b.data[S],b.data[S+1],b.data[S+2],b.data[S+3]),k={id:Y,data:b.data.subarray(S+10,S+C+10)},k.key=k.id,bi.frameParsers[k.id]?bi.frameParsers[k.id](k):k.id[0]==="T"?bi.frameParsers["T*"](k):k.id[0]==="W"&&bi.frameParsers["W*"](k),k.owner==="com.apple.streaming.transportStreamTimestamp"){var j=k.data,ie=(j[3]&1)<<30|j[4]<<22|j[5]<<14|j[6]<<6|j[7]>>>2;ie*=4,ie+=j[7]&3,k.timeStamp=ie,b.pts===void 0&&b.dts===void 0&&(b.pts=k.timeStamp,b.dts=k.timeStamp),this.trigger("timestamp",k)}b.frames.push(k),S+=10,S+=C}while(S<f);this.trigger("data",b)}}}},Tn.prototype=new Am;var Dm=Tn,oo=t,lo=ve,Nt=Ui,Im=wu.TimestampRolloverStream,bn,gr,Sn,hs=188,uo=71;bn=function(){var l=new Uint8Array(hs),c=0;bn.prototype.init.call(this),this.push=function(f){var d=0,p=hs,g;for(c?(g=new Uint8Array(f.byteLength+c),g.set(l.subarray(0,c)),g.set(f,c),c=0):g=f;p<g.byteLength;){if(g[d]===uo&&g[p]===uo){this.trigger("data",g.subarray(d,p)),d+=hs,p+=hs;continue}d++,p++}d<g.byteLength&&(l.set(g.subarray(d),0),c=g.byteLength-d)},this.flush=function(){c===hs&&l[0]===uo&&(this.trigger("data",l),c=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){c=0,this.trigger("reset")}},bn.prototype=new oo,gr=function(){var l,c,f,d;gr.prototype.init.call(this),d=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,l=function(p,g){var v=0;g.payloadUnitStartIndicator&&(v+=p[v]+1),g.type==="pat"?c(p.subarray(v),g):f(p.subarray(v),g)},c=function(p,g){g.section_number=p[7],g.last_section_number=p[8],d.pmtPid=(p[10]&31)<<8|p[11],g.pmtPid=d.pmtPid},f=function(p,g){var v,b,S,C;if(p[5]&1){for(d.programMapTable={video:null,audio:null,"timed-metadata":{}},v=(p[1]&15)<<8|p[2],b=3+v-4,S=(p[10]&15)<<8|p[11],C=12+S;C<b;){var k=p[C],F=(p[C+1]&31)<<8|p[C+2];k===Nt.H264_STREAM_TYPE&&d.programMapTable.video===null?d.programMapTable.video=F:k===Nt.ADTS_STREAM_TYPE&&d.programMapTable.audio===null?d.programMapTable.audio=F:k===Nt.METADATA_STREAM_TYPE&&(d.programMapTable["timed-metadata"][F]=k),C+=((p[C+3]&15)<<8|p[C+4])+5}g.programMapTable=d.programMapTable}},this.push=function(p){var g={},v=4;if(g.payloadUnitStartIndicator=!!(p[1]&64),g.pid=p[1]&31,g.pid<<=8,g.pid|=p[2],(p[3]&48)>>>4>1&&(v+=p[v]+1),g.pid===0)g.type="pat",l(p.subarray(v),g),this.trigger("data",g);else if(g.pid===this.pmtPid)for(g.type="pmt",l(p.subarray(v),g),this.trigger("data",g);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([p,v,g]):this.processPes_(p,v,g)},this.processPes_=function(p,g,v){v.pid===this.programMapTable.video?v.streamType=Nt.H264_STREAM_TYPE:v.pid===this.programMapTable.audio?v.streamType=Nt.ADTS_STREAM_TYPE:v.streamType=this.programMapTable["timed-metadata"][v.pid],v.type="pes",v.data=p.subarray(g),this.trigger("data",v)}},gr.prototype=new oo,gr.STREAM_TYPES={h264:27,adts:15},Sn=function(){var l=this,c=!1,f={data:[],size:0},d={data:[],size:0},p={data:[],size:0},g,v=function(S,C){var k;const F=S[0]<<16|S[1]<<8|S[2];C.data=new Uint8Array,F===1&&(C.packetLength=6+(S[4]<<8|S[5]),C.dataAlignmentIndicator=(S[6]&4)!==0,k=S[7],k&192&&(C.pts=(S[9]&14)<<27|(S[10]&255)<<20|(S[11]&254)<<12|(S[12]&255)<<5|(S[13]&254)>>>3,C.pts*=4,C.pts+=(S[13]&6)>>>1,C.dts=C.pts,k&64&&(C.dts=(S[14]&14)<<27|(S[15]&255)<<20|(S[16]&254)<<12|(S[17]&255)<<5|(S[18]&254)>>>3,C.dts*=4,C.dts+=(S[18]&6)>>>1)),C.data=S.subarray(9+S[8]))},b=function(S,C,k){var F=new Uint8Array(S.size),Y={type:C},j=0,ie=0,ne=!1,He;if(!(!S.data.length||S.size<9)){for(Y.trackId=S.data[0].pid,j=0;j<S.data.length;j++)He=S.data[j],F.set(He.data,ie),ie+=He.data.byteLength;v(F,Y),ne=C==="video"||Y.packetLength<=S.size,(k||ne)&&(S.size=0,S.data.length=0),ne&&l.trigger("data",Y)}};Sn.prototype.init.call(this),this.push=function(S){({pat:function(){},pes:function(){var C,k;switch(S.streamType){case Nt.H264_STREAM_TYPE:C=f,k="video";break;case Nt.ADTS_STREAM_TYPE:C=d,k="audio";break;case Nt.METADATA_STREAM_TYPE:C=p,k="timed-metadata";break;default:return}S.payloadUnitStartIndicator&&b(C,k,!0),C.data.push(S),C.size+=S.data.byteLength},pmt:function(){var C={type:"metadata",tracks:[]};g=S.programMapTable,g.video!==null&&C.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+g.video,codec:"avc",type:"video"}),g.audio!==null&&C.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+g.audio,codec:"adts",type:"audio"}),c=!0,l.trigger("data",C)}})[S.type]()},this.reset=function(){f.size=0,f.data.length=0,d.size=0,d.data.length=0,this.trigger("reset")},this.flushStreams_=function(){b(f,"video"),b(d,"audio"),b(p,"timed-metadata")},this.flush=function(){if(!c&&g){var S={type:"metadata",tracks:[]};g.video!==null&&S.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+g.video,codec:"avc",type:"video"}),g.audio!==null&&S.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+g.audio,codec:"adts",type:"audio"}),l.trigger("data",S)}c=!1,this.flushStreams_(),this.trigger("done")}},Sn.prototype=new oo;var ku={PAT_PID:0,MP2T_PACKET_LENGTH:hs,TransportPacketStream:bn,TransportParseStream:gr,ElementaryStream:Sn,TimestampRolloverStream:Im,CaptionStream:lo.CaptionStream,Cea608Stream:lo.Cea608Stream,Cea708Stream:lo.Cea708Stream,MetadataStream:Dm};for(var co in Nt)Nt.hasOwnProperty(co)&&(ku[co]=Nt[co]);var km=ku,Pm=t,Lm=pe.ONE_SECOND_IN_TS,xn,Pu=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];xn=function(l){var c,f=0;xn.prototype.init.call(this),this.skipWarn_=function(d,p){this.trigger("log",{level:"warn",message:`adts ski
204ping bytes ${d} to ${p} in frame ${f} outside syncword`})},this.push=function(d){var p=0,g,v,b,S,C;if(l||(f=0),d.type==="audio"){c&&c.length?(b=c,c=new Uint8Array(b.byteLength+d.data.byteLength),c.set(b),c.set(d.data,b.byteLength)):c=d.data;for(var k;p+7<c.length;){if(c[p]!==255||(c[p+1]&246)!==240){typeof k!="number"&&(k=p),p++;continue}if(typeof k=="number"&&(this.skipWarn_(k,p),k=null),v=(~c[p+1]&1)*2,g=(c[p+3]&3)<<11|c[p+4]<<3|(c[p+5]&224)>>5,S=((c[p+6]&3)+1)*1024,C=S*Lm/Pu[(c[p+2]&60)>>>2],c.byteLength-p<g)break;this.trigger("data",{pts:d.pts+f*C,dts:d.dts+f*C,sampleCount:S,audioobjecttype:(c[p+2]>>>6&3)+1,channelcount:(c[p+2]&1)<<2|(c[p+3]&192)>>>6,samplerate:Pu[(c[p+2]&60)>>>2],samplingfrequencyindex:(c[p+2]&60)>>>2,samplesize:16,data:c.subarray(p+7+v,p+g)}),f++,p+=g}typeof k=="number"&&(this.skipWarn_(k,p),k=null),c=c.subarray(p)}},this.flush=function(){f=0,this.trigger("done")},this.reset=function(){c=void 0,this.trigger("reset")},this.endTimeline=function(){c=void 0,this.trigger("endedtimeline")}},xn.prototype=new Pm;var Om=xn,Lu;Lu=function(l){var c=l.byteLength,f=0,d=0;this.length=function(){return 8*c},this.bitsAvailable=function(){return 8*c+d},this.loadWord=function(){var p=l.byteLength-c,g=new Uint8Array(4),v=Math.min(4,c);if(v===0)throw new Error("no bytes available");g.set(l.subarray(p,p+v)),f=new DataView(g.buffer).getUint32(0),d=v*8,c-=v},this.skipBits=function(p){var g;d>p?(f<<=p,d-=p):(p-=d,g=Math.floor(p/8),p-=g*8,c-=g,this.loadWord(),f<<=p,d-=p)},this.readBits=function(p){var g=Math.min(d,p),v=f>>>32-g;return d-=g,d>0?f<<=g:c>0&&this.loadWord(),g=p-g,g>0?v<<g|this.readBits(g):v},this.skipLeadingZeros=function(){var p;for(p=0;p<d;++p)if(f&2147483648>>>p)return f<<=p,d-=p,p;return this.loadWord(),p+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var p=this.skipLeadingZeros();return this.readBits(p+1)-1},this.readExpGolomb=function(){var p=this.readUnsignedExpGolomb();return 1&p?1+p>>>1:-1*(p>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var Rm=Lu,Ou=t,Nm=Rm,En,_r,Ru;_r=function(){var l=0,c,f;_r.prototype.init.call(this),this.push=function(d){var p;f?(p=new Uint8Array(f.byteLength+d.data.byteLength),p.set(f),p.set(d.data,f.byteLength),f=p):f=d.data;for(var g=f.byteLength;l<g-3;l++)if(f[l+2]===1){c=l+5;break}for(;c<g;)switch(f[c]){case 0:if(f[c-1]!==0){c+=2;break}else if(f[c-2]!==0){c++;break}l+3!==c-2&&this.trigger("data",f.subarray(l+3,c-2));do c++;while(f[c]!==1&&c<g);l=c-2,c+=3;break;case 1:if(f[c-1]!==0||f[c-2]!==0){c+=3;break}this.trigger("data",f.subarray(l+3,c-2)),l=c-2,c+=3;break;default:c+=3;break}f=f.subarray(l),c-=l,l=0},this.reset=function(){f=null,l=0,this.trigger("reset")},this.flush=function(){f&&f.byteLength>3&&this.trigger("data",f.subarray(l+3)),f=null,l=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},_r.prototype=new Ou,Ru={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},En=function(){var l=new _r,c,f,d,p,g,v,b;En.prototype.init.call(this),c=this,this.push=function(S){S.type==="video"&&(f=S.trackId,d=S.pts,p=S.dts,l.push(S))},l.on("data",function(S){var C={trackId:f,pts:d,dts:p,data:S,nalUnitTypeCode:S[0]&31};switch(C.nalUnitTypeCode){case 5:C.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:C.nalUnitType="sei_rbsp",C.escapedRBSP=g(S.subarray(1));break;case 7:C.nalUnitType="seq_parameter_set_rbsp",C.escapedRBSP=g(S.subarray(1)),C.config=v(C.escapedRBSP);break;case 8:C.nalUnitType="pic_parameter_set_rbsp";break;case 9:C.nalUnitType="access_unit_delimiter_rbsp";break}c.trigger("data",C)}),l.on("done",function(){c.trigger("done")}),l.on("partialdone",function(){c.trigger("partialdone")}),l.on("reset",function(){c.trigger("reset")}),l.on("endedtimeline",function(){c.trigger("endedtimeline")}),this.flush=function(){l.flush()},this.partialFlush=function(){l.partialFlush()},this.reset=function(){l.reset()},this.endTimeline=function(){l.endTimeline()},b=function(S,C){var k=8,F=8,Y,j;for(Y=0;Y<S;Y++)F!==0&&(j=C.readExpGolomb(),F=(k+j+256)%256),k=F===0?k:F},g=function(S){for(var C=S.byteLength,k=[],F=1,Y,j;F<C-2;
vendor: 64,097 bytes, line 204
204)S[F]===0&&S[F+1]===0&&S[F+2]===3?(k.push(F+2),F+=2):F++;if(k.length===0)return S;Y=C-k.length,j=new Uint8Array(Y);var ie=0;for(F=0;F<Y;ie++,F++)ie===k[0]&&(ie++,k.shift()),j[F]=S[ie];return j},v=function(S){var C=0,k=0,F=0,Y=0,j,ie,ne,He,wt,ji,lc,uc,cc,So,dc,Fe=[1,1],hc,Hi;if(j=new Nm(S),ie=j.readUnsignedByte(),He=j.readUnsignedByte(),ne=j.readUnsignedByte(),j.skipUnsignedExpGolomb(),Ru[ie]&&(wt=j.readUnsignedExpGolomb(),wt===3&&j.skipBits(1),j.skipUnsignedExpGolomb(),j.skipUnsignedExpGolomb(),j.skipBits(1),j.readBoolean()))for(dc=wt!==3?8:12,Hi=0;Hi<dc;Hi++)j.readBoolean()&&(Hi<6?b(16,j):b(64,j));if(j.skipUnsignedExpGolomb(),ji=j.readUnsignedExpGolomb(),ji===0)j.readUnsignedExpGolomb();else if(ji===1)for(j.skipBits(1),j.skipExpGolomb(),j.skipExpGolomb(),lc=j.readUnsignedExpGolomb(),Hi=0;Hi<lc;Hi++)j.skipExpGolomb();if(j.skipUnsignedExpGolomb(),j.skipBits(1),uc=j.readUnsignedExpGolomb(),cc=j.readUnsignedExpGolomb(),So=j.readBits(1),So===0&&j.skipBits(1),j.skipBits(1),j.readBoolean()&&(C=j.readUnsignedExpGolomb(),k=j.readUnsignedExpGolomb(),F=j.readUnsignedExpGolomb(),Y=j.readUnsignedExpGolomb()),j.readBoolean()&&j.readBoolean()){switch(hc=j.readUnsignedByte(),hc){case 1:Fe=[1,1];break;case 2:Fe=[12,11];break;case 3:Fe=[10,11];break;case 4:Fe=[16,11];break;case 5:Fe=[40,33];break;case 6:Fe=[24,11];break;case 7:Fe=[20,11];break;case 8:Fe=[32,11];break;case 9:Fe=[80,33];break;case 10:Fe=[18,11];break;case 11:Fe=[15,11];break;case 12:Fe=[64,33];break;case 13:Fe=[160,99];break;case 14:Fe=[4,3];break;case 15:Fe=[3,2];break;case 16:Fe=[2,1];break;case 255:{Fe=[j.readUnsignedByte()<<8|j.readUnsignedByte(),j.readUnsignedByte()<<8|j.readUnsignedByte()];break}}Fe&&Fe[0]/Fe[1]}return{profileIdc:ie,levelIdc:ne,profileCompatibility:He,width:(uc+1)*16-C*2-k*2,height:(2-So)*(cc+1)*16-F*2-Y*2,sarRatio:Fe}}},En.prototype=new Ou;var Mm={H264Stream:En,NalByteStream:_r},Bm=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],Nu=function(l,c){var f=l[c+6]<<21|l[c+7]<<14|l[c+8]<<7|l[c+9],d=l[c+5],p=(d&16)>>4;return f=f>=0?f:0,p?f+20:f+10},Mu=function(l,c){return l.length-c<10||l[c]!==73||l[c+1]!==68||l[c+2]!==51?c:(c+=Nu(l,c),Mu(l,c))},Fm=function(l){var c=Mu(l,0);return l.length>=c+2&&(l[c]&255)===255&&(l[c+1]&240)===240&&(l[c+1]&22)===16},Bu=function(l){return l[0]<<21|l[1]<<14|l[2]<<7|l[3]},Um=function(l,c,f){var d,p="";for(d=c;d<f;d++)p+="%"+("00"+l[d].toString(16)).slice(-2);return p},$m=function(l,c,f){return unescape(Um(l,c,f))},qm=function(l,c){var f=(l[c+5]&224)>>5,d=l[c+4]<<3,p=l[c+3]&6144;return p|d|f},jm=function(l,c){return l[c]===73&&l[c+1]===68&&l[c+2]===51?"timed-metadata":l[c]&!0&&(l[c+1]&240)===240?"audio":null},Hm=function(l){for(var c=0;c+5<l.length;){if(l[c]!==255||(l[c+1]&246)!==240){c++;continue}return Bm[(l[c+2]&60)>>>2]}return null},Vm=function(l){var c,f,d,p;c=10,l[5]&64&&(c+=4,c+=Bu(l.subarray(10,14)));do{if(f=Bu(l.subarray(c+4,c+8)),f<1)return null;if(p=String.fromCharCode(l[c],l[c+1],l[c+2],l[c+3]),p==="PRIV"){d=l.subarray(c+10,c+f+10);for(var g=0;g<d.byteLength;g++)if(d[g]===0){var v=$m(d,0,g);if(v==="com.apple.streaming.transportStreamTimestamp"){var b=d.subarray(g+1),S=(b[3]&1)<<30|b[4]<<22|b[5]<<14|b[6]<<6|b[7]>>>2;return S*=4,S+=b[7]&3,S}break}}c+=10,c+=f}while(c<l.byteLength);return null},ho={isLikelyAacData:Fm,parseId3TagSize:Nu,parseAdtsSize:qm,parseType:jm,parseSampleRate:Hm,parseAacTimestamp:Vm},zm=t,Fu=ho,Cn;Cn=function(){var l=new Uint8Array,c=0;Cn.prototype.init.call(this),this.setTimestamp=function(f){c=f},this.push=function(f){var d=0,p=0,g,v,b,S;for(l.length?(S=l.length,l=new Uint8Array(f.byteLength+S),l.set(l.subarray(0,S)),l.set(f,S)):l=f;l.length-p>=3;){if(l[p]===73&&l[p+1]===68&&l[p+2]===51){if(l.length-p<10||(d=Fu.parseId3TagSize(l,p),p+d>l.length))break;v={type:"timed-metadata",data:l.subarray(p,p+d)},this.trigger("data",v),p+=d;continue}else if((l[p]&255)===255&&(l[p+1]&240)===240){if(l.length-p<7||(d=Fu.parseAdtsSize(l,p),p+d>l.length))break;b={type:"audio",data:l.subarray(p,p+d),pts:c,dts:c},this.trigger("data",b),p+=d;continue}p++}g=l.length-p,g>0?l=l.subarray(p):l=new Uint8Array},this.reset=function(){l=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){l=new Uint8Array,this.trigger("endedtimeline")}},Cn.prototype=new zm;var Gm=Cn,Wm=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Xm=Wm,Km=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Ym=Km,An=t,yr=yi,vr=Ot,wn=fn,Mt=P,ai=km,Dn=pe,Uu=Om,Qm=Mm.H264Stream,Jm=Gm,Zm=ho.isLikelyAacData,eg=pe.ONE_SECOND_IN_TS,fo=Xm,po=Ym,Tr,fs,In,$i,tg=function(l,c){c.stream=l,this.trigger("log",c)},$u=function(l,c){for(var f=Object.keys(c),d=0;d<f.length;d++){var p=f[d];p==="headOfPipeline"||!c[p].on||c[p].on("log",tg.bind(l,p))}},qu=function(l,c){var f;if(l.length!==c.length)return!1;for(f=0;f<l.length;f++)if(l[f]!==c[f])return!1;return!0},mo=function(l,c,f,d,p,g){var v=f-c,b=d-c,S=p-f;return{start:{dts:l,pts:l+v},end:{dts:l+b,pts:l+S},prependedContentDuration:g,baseMediaDecodeTime:l}};fs=function(l,c){var f=[],d,p=0,g=0,v=1/0;c=c||{},d=c.firstSequenceNumber||0,fs.prototype.init.call(this),this.push=function(b){Mt.collectDtsInfo(l,b),l&&fo.forEach(function(S){l[S]=b[S]}),f.push(b)},this.setEarliestDts=function(b){p=b},this.setVideoBaseMediaDecodeTime=function(b){v=b},this.setAudioAppendStart=function(b){g=b},this.flush=function(){var b,S,C,k,F,Y,j;if(f.length===0){this.trigger("done","AudioSegmentStream");return}b=wn.trimAdtsFramesByEarliestDts(f,l,p),l.baseMediaDecodeTime=Mt.calculateTrackBaseMediaDecodeTime(l,c.keepOriginalTimestamps),j=wn.prefixWithSilence(l,b,g,v),l.samples=wn.generateSampleTable(b),C=yr.mdat(wn.concatenateFrameData(b)),f=[],S=yr.moof(d,[l]),k=new Uint8Array(S.byteLength+C.byteLength),d++,k.set(S),k.set(C,S.byteLength),Mt.clearDtsInfo(l),F=Math.ceil(eg*1024/l.samplerate),b.length&&(Y=b.length*F,this.trigger("segmentTimingInfo",mo(Dn.audioTsToVideoTs(l.baseMediaDecodeTime,l.samplerate),b[0].dts,b[0].pts,b[0].dts+Y,b[0].pts+Y,j||0)),this.trigger("timingInfo",{start:b[0].pts,end:b[0].pts+Y})),this.trigger("data",{track:l,boxes:k}),this.trigger("done","AudioSegmentStream")},this.reset=function(){Mt.clearDtsInfo(l),f=[],this.trigger("reset")}},fs.prototype=new An,Tr=function(l,c){var f,d=[],p=[],g,v;c=c||{},f=c.firstSequenceNumber||0,Tr.prototype.init.call(this),delete l.minPTS,this.gopCache_=[],this.push=function(b){Mt.collectDtsInfo(l,b),b.nalUnitType==="seq_parameter_set_rbsp"&&!g&&(g=b.config,l.sps=[b.data],po.forEach(function(S){l[S]=g[S]},this)),b.nalUnitType==="pic_parameter_set_rbsp"&&!v&&(v=b.data,l.pps=[b.data]),d.push(b)},this.flush=function(){for(var b,S,C,k,F,Y,j=0,ie,ne;d.length&&d[0].nalUnitType!=="access_unit_delimiter_rbsp";)d.shift();if(d.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(b=vr.groupNalsIntoFrames(d),C=vr.groupFramesIntoGops(b),C[0][0].keyFrame||(S=this.getGopForFusion_(d[0],l),S?(j=S.duration,C.unshift(S),C.byteLength+=S.byteLength,C.nalCount+=S.nalCount,C.pts=S.pts,C.dts=S.dts,C.duration+=S.duration):C=vr.extendFirstKeyFrame(C)),p.length){var He;if(c.alignGopsAtEnd?He=this.alignGopsAtEnd_(C):He=this.alignGopsAtStart_(C),!He){this.gopCache_.unshift({gop:C.pop(),pps:l.pps,sps:l.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),d=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}Mt.clearDtsInfo(l),C=He}Mt.collectDtsInfo(l,C),l.samples=vr.generateSampleTable(C),F=yr.mdat(vr.concatenateNalData(C)),l.baseMediaDecodeTime=Mt.calculateTrackBaseMediaDecodeTime(l,c.keepOriginalTimestamps),this.trigger("processedGopsInfo",C.map(function(wt){return{pts:wt.pts,dts:wt.dts,byteLength:wt.byteLength}})),ie=C[0],ne=C[C.length-1],this.trigger("segmentTimingInfo",mo(l.baseMediaDecodeTime,ie.dts,ie.pts,ne.dts+ne.duration,ne.pts+ne.duration,j)),this.trigger("timingInfo",{start:C[0].pts,end:C[C.length-1].pts+C[C.length-1].duration}),this.gopCache_.unshift({gop:C.pop(),pps:l.pps,sps:l.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),d=[],this.trigger("baseMediaDecodeTime",l.baseMediaDecodeTime),this.trigger("timelineStartInfo",l.timelineStartInfo),k=yr.moof(f,[l]),Y=new Uint8Array(k.byteLength+F.byteLength),f++,Y.set(k),Y.set(F,k.byteLength),this.trigger("data",{track:l,boxes:Y}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),d=[],this.gopCache_.length=0,p.length=0,this.trigger("reset")},this.resetStream_=function(){Mt.clearDtsInfo(l),g=void 0,v=void 0},this.getGopForFusion_=function(b){var S=45e3,C=1e4,k=1/0,F,Y,j,ie,ne;for(ne=0;ne<this.gopCache_.length;ne++)ie=this.gopCache_[ne],j=ie.gop,!(!(l.pps&&qu(l.pps[0],ie.pps[0]))||!(l.sps&&qu(l.sps[0],ie.sps[0])))&&(j.dts<l.timelineStartInfo.dts||(F=b.dts-j.dts-j.duration,F>=-C&&F<=S&&(!Y||k>F)&&(Y=ie,k=F)));return Y?Y.gop:null},this.alignGopsAtStart_=function(b){var S,C,k,F,Y,j,ie,ne;for(Y=b.byteLength,j=b.nalCount,ie=b.duration,S=C=0;S<p.length&&C<b.length&&(k=p[S],F=b[C],k.pts!==F.pts);){if(F.pts>k.pts){S++;continue}C++,Y-=F.byteLength,j-=F.nalCount,ie-=F.duration}return C===0?b:C===b.length?null:(ne=b.slice(C),ne.byteLength=Y,ne.duration=ie,ne.nalCount=j,ne.pts=ne[0].pts,ne.dts=ne[0].dts,ne)},this.alignGopsAtEnd_=function(b){var S,C,k,F,Y,j;for(S=p.length-1,C=b.length-1,Y=null,j=!1;S>=0&&C>=0;){if(k=p[S],F=b[C],k.pts===F.pts){j=!0;break}if(k.pts>F.pts){S--;continue}S===p.length-1&&(Y=C),C--}if(!j&&Y===null)return null;var ie;if(j?ie=C:ie=Y,ie===0)return b;var ne=b.slice(ie),He=ne.reduce(function(wt,ji){return wt.byteLength+=ji.byteLength,wt.duration+=ji.duration,wt.nalCount+=ji.nalCount,wt},{byteLength:0,duration:0,nalCount:0});return ne.byteLength=He.byteLength,ne.duration=He.duration,ne.nalCount=He.nalCount,ne.pts=ne[0].pts,ne.dts=ne[0].dts,ne},this.alignGopsWith=function(b){p=b}},Tr.prototype=new An,$i=function(l,c){this.numberOfTracks=0,this.metadataStream=c,l=l||{},typeof l.remux<"u"?this.remuxTracks=!!l.remux:this.remuxTracks=!0,typeof l.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=l.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,$i.prototype.init.call(this),this.push=function(f){if(f.content||f.text)return this.pendingCaptions.push(f);if(f.frames)return this.pendingMetadata.push(f);this.pendingTracks.push(f.track),this.pendingBytes+=f.boxes.byteLength,f.track.type==="video"&&(this.videoTrack=f.track,this.pendingBoxes.push(f.boxes)),f.track.type==="audio"&&(this.audioTrack=f.track,this.pendingBoxes.unshift(f.boxes))}},$i.prototype=new An,$i.prototype.flush=function(l){var c=0,f={captions:[],captionStreams:{},metadata:[],info:{}},d,p,g,v=0,b;if(this.pendingTracks.length<this.numberOfTracks){if(l!=="VideoSegmentStream"&&l!=="AudioSegmentStream")return;if(this.remuxTracks)return;if(this.pendingTracks.length===0){this.emittedTracks++,this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(v=this.videoTrack.timelineStartInfo.pts,po.forEach(function(S){f.info[S]=this.videoTrack[S]},this)):this.audioTrack&&(v=this.audioTrack.timelineStartInfo.pts,fo.forEach(function(S){f.info[S]=this.audioTrack[S]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?f.type=this.pendingTracks[0].type:f.type="combined",this.emittedTracks+=this.pendingTracks.length,g=yr.initSegment(this.pendingTracks),f.initSegment=new Uint8Array(g.byteLength),f.initSegment.set(g),f.data=new Uint8Array(this.pendingBytes),b=0;b<this.pendingBoxes.length;b++)f.data.set(this.pendingBoxes[b],c),c+=this.pendingBoxes[b].byteLength;for(b=0;b<this.pendingCaptions.length;b++)d=this.pendingCaptions[b],d.startTime=Dn.metadataTsToSeconds(d.startPts,v,this.keepOriginalTimestamps),d.endTime=Dn.metadataTsToSeconds(d.endPts,v,this.keepOriginalTimestamps),f.captionStreams[d.stream]=!0,f.captions.push(d);for(b=0;b<this.pendingMetadata.length;b++)p=this.pendingMetadata[b],p.cueTime=Dn.metadataTsToSeconds(p.pts,v,this.keepOriginalTimestamps),f.metadata.push(p);for(f.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",f),b=0;b<f.captions.length;b++)d=f.captions[b],this.trigger("caption",d);for(b=0;b<f.metadata.length;b++)p=f.metadata[b],this.trigger("id3Frame",p)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},$i.prototype.setRemux=function(l){this.remuxTracks=l},In=function(l){var c=this,f=!0,d,p;In.prototype.init.call(this),l=l||{},this.baseMediaDecodeTime=l.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var g={};this.transmuxPipeline_=g,g.type="aac",g.metadataStream=new ai.MetadataStream,g.aacStream=new Jm,g.audioTimestampRolloverStream=new ai.TimestampRolloverStream("audio"),g.timedMetadataTimestampRolloverStream=new ai.TimestampRolloverStream("timed-metadata"),g.adtsStream=new Uu,g.coalesceStream=new $i(l,g.metadataStream),g.headOfPipeline=g.aacStream,g.aacStream.pipe(g.audioTimestampRolloverStream).pipe(g.adtsStream),g.aacStream.pipe(g.timedMetadataTimestampRolloverStream).pipe(g.metadataStream).pipe(g.coalesceStream),g.metadataStream.on("timestamp",function(v){g.aacStream.setTimestamp(v.timeStamp)}),g.aacStream.on("data",function(v){v.type!=="timed-metadata"&&v.type!=="audio"||g.audioSegmentStream||(p=p||{timelineStartInfo:{baseMediaDecodeTime:c.baseMediaDecodeTime},codec:"adts",type:"audio"},g.coalesceStream.numberOfTracks++,g.audioSegmentStream=new fs(p,l),g.audioSegmentStream.on("log",c.getLogTrigger_("audioSegmentStream")),g.audioSegmentStream.on("timingInfo",c.trigger.bind(c,"audioTimingInfo")),g.adtsStream.pipe(g.audioSegmentStream).pipe(g.coalesceStream),c.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!d}))}),g.coalesceStream.on("data",this.trigger.bind(this,"data")),g.coalesceStream.on("done",this.trigger.bind(this,"done")),$u(this,g)},this.setupTsPipeline=function(){var g={};this.transmuxPipeline_=g,g.type="ts",g.metadataStream=new ai.MetadataStream,g.packetStream=new ai.TransportPacketStream,g.parseStream=new ai.TransportParseStream,g.elementaryStream=new ai.ElementaryStream,g.timestampRolloverStream=new ai.TimestampRolloverStream,g.adtsStream=new Uu,g.h264Stream=new Qm,g.captionStream=new ai.CaptionStream(l),g.coalesceStream=new $i(l,g.metadataStream),g.headOfPipeline=g.packetStream,g.packetStream.pipe(g.parseStream).pipe(g.elementaryStream).pipe(g.timestampRolloverStream),g.timestampRolloverStream.pipe(g.h264Stream),g.timestampRolloverStream.pipe(g.adtsStream),g.timestampRolloverStream.pipe(g.metadataStream).pipe(g.coalesceStream),g.h264Stream.pipe(g.captionStream).pipe(g.coalesceStream),g.elementaryStream.on("data",function(v){var b;if(v.type==="metadata"){for(b=v.tracks.length;b--;)!d&&v.tracks[b].type==="video"?(d=v.tracks[b],d.timelineStartInfo.baseMediaDecodeTime=c.baseMediaDecodeTime):!p&&v.tracks[b].type==="audio"&&(p=v.tracks[b],p.timelineStartInfo.baseMediaDecodeTime=c.baseMediaDecodeTime);d&&!g.videoSegmentStream&&(g.coalesceStream.numberOfTracks++,g.videoSegmentStream=new Tr(d,l),g.videoSegmentStream.on("log",c.getLogTrigger_("videoSegmentStream")),g.videoSegmentStream.on("timelineStartInfo",function(S){p&&!l.keepOriginalTimestamps&&(p.timelineStartInfo=S,g.audioSegmentStream.setEarliestDts(S.dts-c.baseMediaDecodeTime))}),g.videoSegmentStream.on("processedGopsInfo",c.trigger.bind(c,"gopInfo")),g.videoSegmentStream.on("segmentTimingInfo",c.trigger.bind(c,"videoSegmentTimingInfo")),g.videoSegmentStream.on("baseMediaDecodeTime",function(S){p&&g.audioSegmentStream.setVideoBaseMediaDecodeTime(S)}),g.videoSegmentStream.on("timingInfo",c.trigger.bind(c,"videoTimingInfo")),g.h264Stream.pipe(g.videoSegmentStream).pipe(g.coalesceStream)),p&&!g.audioSegmentStream&&(g.coalesceStream.numberOfTracks++,g.audioSegmentStream=new fs(p,l),g.audioSegmentStream.on("log",c.getLogTrigger_("audioSegmentStream")),g.audioSegmentStream.on("timingInfo",c.trigger.bind(c,"audioTimingInfo")),g.audioSegmentStream.on("segmentTimingInfo",c.trigger.bind(c,"audioSegmentTimingInfo")),g.adtsStream.pipe(g.audioSegmentStream).pipe(g.coalesceStream)),c.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!d})}}),g.coalesceStream.on("data",this.trigger.bind(this,"data")),g.coalesceStream.on("id3Frame",function(v){v.dispatchType=g.metadataStream.dispatchType,c.trigger("id3Frame",v)}),g.coalesceStream.on("caption",this.trigger.bind(this,"caption")),g.coalesceStream.on("done",this.trigger.bind(this,"done")),$u(this,g)},this.setBaseMediaDecodeTime=function(g){var v=this.transmuxPipeline_;l.keepOriginalTimestamps||(this.baseMediaDecodeTime=g),p&&(p.timelineStartInfo.dts=void 0,p.timelineStartInfo.pts=void 0,Mt.clearDtsInfo(p),v.audioTimestampRolloverStream&&v.audioTimestampRolloverStream.discontinuity()),d&&(v.videoSegmentStream&&(v.videoSegmentStream.gopCache_=[]),d.timelineStartInfo.dts=void 0,d.timelineStartInfo.pts=void 0,Mt.clearDtsInfo(d),v.captionStream.reset()),v.timestampRolloverStream&&v.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(g){p&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(g)},this.setRemux=function(g){var v=this.transmuxPipeline_;l.remux=g,v&&v.coalesceStream&&v.coalesceStream.setRemux(g)},this.alignGopsWith=function(g){d&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(g)},this.getLogTrigger_=function(g){var v=this;return function(b){b.stream=g,v.trigger("log",b)}},this.push=function(g){if(f){var v=Zm(g);v&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!v&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),f=!1}this.transmuxPipeline_.headOfPipeline.push(g)},this.flush=function(){f=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},In.prototype=new An;var ig={Transmuxer:In,VideoSegmentStream:Tr,AudioSegmentStream:fs,AUDIO_PROPERTIES:fo,VIDEO_PROPERTIES:po,generateSegmentTimingInfo:mo},sg=function(l){return l>>>0},rg=function(l){return("00"+l.toString(16)).slice(-2)},kn={toUnsigned:sg,toHexString:rg},ng=function(l){var c="";return c+=String.fromCharCode(l[0]),c+=String.fromCharCode(l[1]),c+=String.fromCharCode(l[2]),c+=String.fromCharCode(l[3]),c},ju=ng,ag=kn.toUnsigned,og=ju,Hu=function(l,c){var f=[],d,p,g,v,b;if(!c.length)return null;for(d=0;d<l.byteLength;)p=ag(l[d]<<24|l[d+1]<<16|l[d+2]<<8|l[d+3]),g=og(l.subarray(d+4,d+8)),v=p>1?d+p:l.byteLength,g===c[0]&&(c.length===1?f.push(l.subarray(d+8,v)):(b=Hu(l.subarray(d+8,v),c.slice(1)),b.length&&(f=f.concat(b)))),d=v;return f},Vu=Hu,lg=kn.toUnsigned,ug=n.getUint64,cg=function(l){var c={version:l[0],flags:new Uint8Array(l.subarray(1,4))};return c.version===1?c.baseMediaDecodeTime=ug(l.subarray(4)):c.baseMediaDecodeTime=lg(l[4]<<24|l[5]<<16|l[6]<<8|l[7]),c},zu=cg,dg=function(l){return{isLeading:(l[0]&12)>>>2,dependsOn:l[0]&3,isDependedOn:(l[1]&192)>>>6,hasRedundancy:(l[1]&48)>>>4,paddingValue:(l[1]&14)>>>1,isNonSyncSample:l[1]&1,degradationPriority:l[2]<<8|l[3]}},hg=dg,Gu=hg,fg=function(l){var c={version:l[0],flags:new Uint8Array(l.subarray(1,4)),samples:[]},f=new DataView(l.buffer,l.byteOffset,l.byteLength),d=c.flags[2]&1,p=c.flags[2]&4,g=c.flags[1]&1,v=c.flags[1]&2,b=c.flags[1]&4,S=c.flags[1]&8,C=f.getUint32(4),k=8,F;for(d&&(c.dataOffset=f.getInt32(k),k+=4),p&&C&&(F={flags:Gu(l.subarray(k,k+4))},k+=4,g&&(F.duration=f.getUint32(k),k+=4),v&&(F.size=f.getUint32(k),k+=4),S&&(c.version===1?F.compositionTimeOffset=f.getInt32(k):F.compositionTimeOffset=f.getUint32(k),k+=4),c.samples.push(F),C--);C--;)F={},g&&(F.duration=f.getUint32(k),k+=4),v&&(F.size=f.getUint32(k),k+=4),b&&(F.flags=Gu(l.subarray(k,k+4)),k+=4),S&&(c.version===1?F.compositionTimeOffset=f.getInt32(k):F.compositionTimeOffset=f.getUint32(k),k+=4),c.samples.push(F);return c},Wu=fg,pg=function(l){var c=new DataView(l.buffer,l.byteOffset,l.byteLength),f={version:l[0],flags:new Uint8Array(l.subarray(1,4)),trackId:c.getUint32(4)},d=f.flags[2]&1,p=f.flags[2]&2,g=f.flags[2]&8,v=f.flags[2]&16,b=f.flags[2]&32,S=f.flags[0]&65536,C=f.flags[0]&131072,k;return k=8,d&&(k+=4,f.baseDataOffset=c.getUint32(12),k+=4),p&&(f.sampleDescriptionIndex=c.getUint32(k),k+=4),g&&(f.defaultSampleDuration=c.getUint32(k),k+=4),v&&(f.defaultSampleSize=c.getUint32(k),k+=4),b&&(f.defaultSampleFlags=c.getUint32(k)),S&&(f.durationIsEmpty=!0),!d&&C&&(f.baseDataOffsetIsMoof=!0),f},Xu=pg,br;typeof window<"u"?br=window:typeof i<"u"?br=i:typeof self<"u"?br=self:br={};var Ku=br,mg=cr.discardEmulationPreventionBytes,gg=ve.CaptionStream,Sr=Vu,_g=zu,yg=Wu,vg=Xu,Yu=Ku,Tg=function(l,c){for(var f=l,d=0;d<c.length;d++){var p=c[d];if(f<p.size)return p;f-=p.size}return null},bg=function(l,c,f){var d=new DataView(l.buffer,l.byteOffset,l.byteLength),p={logs:[],seiNals:[]},g,v,b,S;for(v=0;v+4<l.length;v+=b)if(b=d.getUint32(v),v+=4,!(b<=0))switch(l[v]&31){case 6:var C=l.subarray(v+1,v+1+b),k=Tg(v,c);if(g={nalUnitType:"sei_rbsp",size:b,data:C,escapedRBSP:mg(C),trackId:f},k)g.pts=k.pts,g.dts=k.dts,S=k;else if(S)g.pts=S.pts,g.dts=S.dts;else{p.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+v+" for trackId "+f+". See mux.js#223."});break}p.seiNals.push(g);break}return p},Sg=function(l,c,f){var d=c,p=f.defaultSampleDuration||0,g=f.defaultSampleSize||0,v=f.trackId,b=[];return l.forEach(function(S){var C=yg(S),k=C.samples;k.forEach(function(F){F.duration===void 0&&(F.duration=p),F.size===void 0&&(F.size=g),F.trackId=v,F.dts=d,F.compositionTimeOffset===void 0&&(F.compositionTimeOffset=0),typeof d=="bigint"?(F.pts=d+Yu.BigInt(F.compositionTimeOffset),d+=Yu.BigInt(F.duration)):(F.pts=d+F.compositionTimeOffset,d+=F.duration)}),b=b.concat(k)}),b},xg=function(l,c){var f=Sr(l,["moof","traf"]),d=Sr(l,["mdat"]),p={},g=[];return d.forEach(function(v,b){var S=f[b];g.push({mdat:v,traf:S})}),g.forEach(function(v){var b=v.mdat,S=v.traf,C=Sr(S,["tfhd"]),k=vg(C[0]),F=k.trackId,Y=Sr(S,["tfdt"]),j=Y.length>0?_g(Y[0]).baseMediaDecodeTime:0,ie=Sr(S,["trun"]),ne,He;c===F&&ie.length>0&&(ne=Sg(ie,j,k),He=bg(b,ne,F),p[F]||(p[F]={seiNals:[],logs:[]}),p[F].seiNals=p[F].seiNals.concat(He.seiNals),p[F].logs=p[F].logs.concat(He.logs))}),p},Eg=function(l,c,f){var d;if(c===null)return null;d=xg(l,c);var p=d[c]||{};return{seiNals:p.seiNals,logs:p.logs,timescale:f}},Cg=function(){var l=!1,c,f,d,p,g,v;this.isInitialized=function(){return l},this.init=function(b){c=new gg,l=!0,v=b?b.isPartial:!1,c.on("data",function(S){S.startTime=S.startPts/p,S.endTime=S.endPts/p,g.captions.push(S),g.captionStreams[S.stream]=!0}),c.on("log",function(S){g.logs.push(S)})},this.isNewInit=function(b,S){return b&&b.length===0||S&&typeof S=="object"&&Object.keys(S).length===0?!1:d!==b[0]||p!==S[d]},this.parse=function(b,S,C){var k;if(this.isInitialized()){if(!S||!C)return null;if(this.isNewInit(S,C))d=S[0],p=C[d];else if(d===null||!p)return f.push(b),null}else return null;for(;f.length>0;){var F=f.shift();this.parse(F,S,C)}return k=Eg(b,d,p),k&&k.logs&&(g.logs=g.logs.concat(k.logs)),k===null||!k.seiNals?g.logs.length?{logs:g.logs,captions:[],captionStreams:[]}:null:(this.pushNals(k.seiNals),this.flushStream(),g)},this.pushNals=function(b){if(!this.isInitialized()||!b||b.length===0)return null;b.forEach(function(S){c.push(S)})},this.flushStream=function(){if(!this.isInitialized())return null;v?c.partialFlush():c.flush()},this.clearParsedCaptions=function(){g.captions=[],g.captionStreams={},g.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;c.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){f=[],d=null,p=null,g?this.clearParsedCaptions():g={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},Ag=Cg,wg=function(l){for(var c=0,f=String.fromCharCode(l[c]),d="";f!=="\0";)d+=f,c++,f=String.fromCharCode(l[c]);return d+=f,d},Dg={uint8ToCString:wg},Pn=Dg.uint8ToCString,Ig=n.getUint64,kg=function(l){var c=4,f=l[0],d,p,g,v,b,S,C,k;if(f===0){d=Pn(l.subarray(c)),c+=d.length,p=Pn(l.subarray(c)),c+=p.length;var F=new DataView(l.buffer);g=F.getUint32(c),c+=4,b=F.getUint32(c),c+=4,S=F.getUint32(c),c+=4,C=F.getUint32(c),c+=4}else if(f===1){var F=new DataView(l.buffer);g=F.getUint32(c),c+=4,v=Ig(l.subarray(c)),c+=8,S=F.getUint32(c),c+=4,C=F.getUint32(c),c+=4,d=Pn(l.subarray(c)),c+=d.length,p=Pn(l.subarray(c)),c+=p.length}k=new Uint8Array(l.subarray(c,l.byteLength));var Y={scheme_id_uri:d,value:p,timescale:g||1,presentation_time:v,presentation_time_delta:b,event_duration:S,id:C,message_data:k};return Lg(f,Y)?Y:void 0},Pg=function(l,c,f,d){return l||l===0?l/c:d+f/c},Lg=function(l,c){var f=c.scheme_id_uri!=="\0",d=l===0&&Qu(c.presentation_time_delta)&&f,p=l===1&&Qu(c.presentation_time)&&f;return!(l>1)&&d||p},Qu=function(l){return l!==void 0||l!==null},Og={parseEmsgBox:kg,scaleTime:Pg},Ln=kn.toUnsigned,xr=kn.toHexString,Be=Vu,ps=ju,go=Og,Rg=Xu,Ng=Wu,Mg=zu,Bg=n.getUint64,Ju,Zu,ec,tc,ic,_o,sc,yo=Ku,Fg=Iu.parseId3Frames;Ju=function(l){var c={},f=Be(l,["moov","trak"]);return f.reduce(function(d,p){var g,v,b,S,C;return g=Be(p,["tkhd"])[0],!g||(v=g[0],b=v===0?12:20,S=Ln(g[b]<<24|g[b+1]<<16|g[b+2]<<8|g[b+3]),C=Be(p,["mdia","mdhd"])[0],!C)?null:(v=C[0],b=v===0?12:20,d[S]=Ln(C[b]<<24|C[b+1]<<16|C[b+2]<<8|C[b+3]),d)},c)},Zu=function(l,c){var f;f=Be(c,["moof","traf"]);var d=f.reduce(function(p,g){var v=Be(g,["tfhd"])[0],b=Ln(v[4]<<24|v[5]<<16|v[6]<<8|v[7]),S=l[b]||9e4,C=Be(g,["tfdt"])[0],k=new DataView(C.buffer,C.byteOffset,C.byteLength),F;C[0]===1?F=Bg(C.subarray(4,12)):F=k.getUint32(4);let Y;return typeof F=="bigint"?Y=F/yo.BigInt(S):typeof F=="number"&&!isNaN(F)&&(Y=F/S),Y<Number.MAX_SAFE_INTEGER&&(Y=Number(Y)),Y<p&&(p=Y),p},1/0);return typeof d=="bigint"||isFinite(d)?d:0},ec=function(l,c){var f=Be(c,["moof","traf"]),d=0,p=0,g;if(f&&f.length){var v=Be(f[0],["tfhd"])[0],b=Be(f[0],["trun"])[0],S=Be(f[0],["tfdt"])[0];if(v){var C=Rg(v);g=C.trackId}if(S){var k=Mg(S);d=k.baseMediaDecodeTime}if(b){var F=Ng(b);F.samples&&F.samples.length&&(p=F.samples[0].compositionTimeOffset||0)}}var Y=l[g]||9e4;typeof d=="bigint"&&(p=yo.BigInt(p),Y=yo.BigInt(Y));var j=(d+p)/Y;return typeof j=="bigint"&&j<Number.MAX_SAFE_INTEGER&&(j=Number(j)),j},tc=function(l){var c=Be(l,["moov","trak"]),f=[];return c.forEach(function(d){var p=Be(d,["mdia","hdlr"]),g=Be(d,["tkhd"]);p.forEach(function(v,b){var S=ps(v.subarray(8,12)),C=g[b],k,F,Y;S==="vide"&&(k=new DataView(C.buffer,C.byteOffset,C.byteLength),F=k.getUint8(0),Y=F===0?k.getUint32(12):k.getUint32(20),f.push(Y))})}),f},_o=function(l){var c=l[0],f=c===0?12:20;return Ln(l[f]<<24|l[f+1]<<16|l[f+2]<<8|l[f+3])},ic=function(l){var c=Be(l,["moov","trak"]),f=[];return c.forEach(function(d){var p={},g=Be(d,["tkhd"])[0],v,b;g&&(v=new DataView(g.buffer,g.byteOffset,g.byteLength),b=v.getUint8(0),p.id=b===0?v.getUint32(12):v.getUint32(20));var S=Be(d,["mdia","hdlr"])[0];if(S){var C=ps(S.subarray(8,12));C==="vide"?p.type="video":C==="soun"?p.type="audio":p.type=C}var k=Be(d,["mdia","minf","stbl","stsd"])[0];if(k){var F=k.subarray(8);p.codec=ps(F.subarray(4,8));var Y=Be(F,[p.codec])[0],j,ie;Y&&(/^[asm]vc[1-9]$/i.test(p.codec)?(j=Y.subarray(78),ie=ps(j.subarray(4,8)),ie==="avcC"&&j.length>11?(p.codec+=".",p.codec+=xr(j[9]),p.codec+=xr(j[10]),p.codec+=xr(j[11])):p.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(p.codec)?(j=Y.subarray(28),ie=ps(j.subarray(4,8)),ie==="esds"&&j.length>20&&j[19]!==0?(p.codec+="."+xr(j[19]),p.codec+="."+xr(j[20]>>>2&63).replace(/^0/,"")):p.codec="mp4a.40.2"):p.codec=p.codec.toLowerCase())}var ne=Be(d,["mdia","mdhd"])[0];ne&&(p.timescale=_o(ne)),f.push(p)}),f},sc=function(l,c=0){var f=Be(l,["emsg"]);return f.map(d=>{var p=go.parseEmsgBox(new Uint8Array(d)),g=Fg(p.message_data);return{cueTime:go.scaleTime(p.presentation_time,p.timescale,p.presentation_time_delta,c),duration:go.scaleTime(p.event_duration,p.timescale),frames:g}})};var vo={findBox:Be,parseType:ps,timescale:Ju,startTime:Zu,compositionStartTime:ec,videoTrackIds:tc,tracks:ic,getTimescaleFromMediaHeader:_o,getEmsgID3:sc},To=Ui,rc=function(l){var c=l[1]&31;return c<<=8,c|=l[2],c},On=function(l){return!!(l[1]&64)},Rn=function(l){var c=0;return(l[3]&48)>>>4>1&&(c+=l[4]+1),c},Ug=function(l,c){var f=rc(l);return f===0?"pat":f===c?"pmt":c?"pes":null},$g=function(l){var c=On(l),f=4+Rn(l);return c&&(f+=l[f]+1),(l[f+10]&31)<<8|l[f+11]},qg=function(l){var c={},f=On(l),d=4+Rn(l);if(f&&(d+=l[d]+1),!!(l[d+5]&1)){var p,g,v;p=(l[d+1]&15)<<8|l[d+2],g=3+p-4,v=(l[d+10]&15)<<8|l[d+11];for(var b=12+v;b<g;){var S=d+b;c[(l[S+1]&31)<<8|l[S+2]]=l[S],b+=((l[S+3]&15)<<8|l[S+4])+5}return c}},jg=function(l,c){var f=rc(l),d=c[f];switch(d){case To.H264_STREAM_TYPE:return"video";case To.ADTS_STREAM_TYPE:return"audio";case To.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},Hg=function(l){var c=On(l);if(!c)return null;var f=4+Rn(l);if(f>=l.byteLength)return null;var d=null,p;return p=l[f+7],p&192&&(d={},d.pts=(l[f+9]&14)<<27|(l[f+10]&255)<<20|(l[f+11]&254)<<12|(l[f+12]&255)<<5|(l[f+13]&254)>>>3,d.pts*=4,d.pts+=(l[f+13]&6)>>>1,d.dts=d.pts,p&64&&(d.dts=(l[f+14]&14)<<27|(l[f+15]&255)<<20|(l[f+16]&254)<<12|(l[f+17]&255)<<5|(l[f+18]&254)>>>3,d.dts*=4,d.dts+=(l[f+18]&6)>>>1)),d},bo=function(l){switch(l){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},Vg=function(l){for(var c=4+Rn(l),f=l.subarray(c),d=0,p=0,g=!1,v;p<f.byteLength-3;p++)if(f[p+2]===1){d=p+5;break}for(;d<f.byteLength;)switch(f[d]){case 0:if(f[d-1]!==0){d+=2;break}else if(f[d-2]!==0){d++;break}p+3!==d-2&&(v=bo(f[p+3]&31),v==="slice_layer_without_partitioning_rbsp_idr"&&(g=!0));do d++;while(f[d]!==1&&d<f.length);p=d-2,d+=3;break;case 1:if(f[d-1]!==0||f[d-2]!==0){d+=3;break}v=bo(f[p+3]&31),v==="slice_layer_without_partitioning_rbsp_idr"&&(g=!0),p=d-2,d+=3;break;default:d+=3;break}return f=f.subarray(p),d-=p,p=0,f&&f.byteLength>3&&(v=bo(f[p+3]&31),v==="slice_layer_without_partitioning_rbsp_idr"&&(g=!0)),g},zg={parseType:Ug,parsePat:$g,parsePmt:qg,parsePayloadUnitStartIndicator:On,parsePesType:jg,parsePesTime:Hg,videoPacketContainsKeyFrame:Vg},nc=Ui,ms=wu.handleRollover,be={};be.ts=zg,be.aac=ho;var qi=pe.ONE_SECOND_IN_TS,st=188,Gt=71,Gg=function(l,c){for(var f=0,d=st,p,g;d<l.byteLength;){if(l[f]===Gt&&l[d]===Gt){switch(p=l.subarray(f,d),g=be.ts.parseType(p,c.pid),g){case"pat":c.pid=be.ts.parsePat(p);break;case"pmt":var v=be.ts.parsePmt(p);c.table=c.table||{},Object.keys(v).forEach(function(b){c.table[b]=v[b]});break}f+=st,d+=st;continue}f++,d++}},ac=function(l,c,f){for(var d=0,p=st,g,v,b,S,C,k=!1;p<=l.byteLength;){if(l[d]===Gt&&(l[p]===Gt||p===l.byteLength)){switch(g=l.subarray(d,p),v=be.ts.parseType(g,c.pid),v){case"pes":b=be.ts.parsePesType(g,c.table),S=be.ts.parsePayloadUnitStartIndicator(g),b==="audio"&&S&&(C=be.ts.parsePesTime(g),C&&(C.type="audio",f.audio.push(C),k=!0));break}if(k)break;d+=st,p+=st;continue}d++,p++}for(p=l.byteLength,d=p-st,k=!1;d>=0;){if(l[d]===Gt&&(l[p]===Gt||p===l.byteLength)){switch(g=l.subarray(d,p),v=be.ts.parseType(g,c.pid),v){case"pes":b=be.ts.parsePesType(g,c.table),S=be.ts.parsePayloadUnitStartIndicator(g),b==="audio"&&S&&(C=be.ts.parsePesTime(g),C&&(C.type="audio",f.audio.push(C),k=!0));break}if(k)break;d-=st,p-=st;continue}d--,p--}},Wg=function(l,c,f){for(var d=0,p=st,g,v,b,S,C,k,F,Y,j=!1,ie={data:[],size:0};p<l.byteLength;){if(l[d]===Gt&&l[p]===Gt){switch(g=l.subarray(d,p),v=be.ts.parseType(g,c.pid),v){case"pes":if(b=be.ts.parsePesType(g,c.table),S=be.ts.parsePayloadUnitStartIndicator(g),b==="video"&&(S&&!j&&(C=be.ts.parsePesTime(g),C&&(C.type="video",f.video.push(C),j=!0)),!f.firstKeyFrame)){if(S&&ie.size!==0){for(k=new Uint8Array(ie.size),F=0;ie.data.length;)Y=ie.data.shift(),k.set(Y,F),F+=Y.byteLength;if(be.ts.videoPacketContainsKeyFrame(k)){var ne=be.ts.parsePesTime(k);ne?(f.firstKeyFrame=ne,f.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}ie.size=0}ie.data.push(g),ie.size+=g.byteLength}break}if(j&&f.firstKeyFrame)break;d+=st,p+=st;continue}d++,p++}for(p=l.byteLength,d=p-st,j=!1;d>=0;){if(l[d]===Gt&&l[p]===Gt){switch(g=l.subarray(d,p),v=be.ts.parseType(g,c.pid),v){case"pes":b=be.ts.parsePesType(g,c.table),S=be.ts.parsePayloadUnitStartIndicator(g),b==="video"&&S&&(C=be.ts.parsePesTime(g),C&&(C.type="video",f.video.push(C),j=!0));break}if(j)break;d-=st,p-=st;continue}d--,p--}},Xg=function(l,c){if(l.audio&&l.audio.length){var f=c;(typeof f>"u"||isNaN(f))&&(f=l.audio[0].dts),l.audio.forEach(function(g){g.dts=ms(g.dts,f),g.pts=ms(g.pts,f),g.dtsTime=g.dts/qi,g.ptsTime=g.pts/qi})}if(l.video&&l.video.length){var d=c;if((typeof d>"u"||isNaN(d))&&(d=l.video[0].dts),l.video.forEach(function(g){g.dts=ms(g.dts,d),g.pts=ms(g.pts,d),g.dtsTime=g.dts/qi,g.ptsTime=g.pts/qi}),l.firstKeyFrame){var p=l.firstKeyFrame;p.dts=ms(p.dts,d),p.pts=ms(p.pts,d),p.dtsTime=p.dts/qi,p.ptsTime=p.pts/qi}}},Kg=function(l){for(var c=!1,f=0,d=null,p=null,g=0,v=0,b;l.length-v>=3;){var S=be.aac.parseType(l,v);switch(S){case"timed-metadata":if(l.length-v<10){c=!0;break}if(g=be.aac.parseId3TagSize(l,v),g>l.length){c=!0;break}p===null&&(b=l.subarray(v,v+g),p=be.aac.parseAacTimestamp(b)),v+=g;break;case"audio":if(l.length-v<7){c=!0;break}if(g=be.aac.parseAdtsSize(l,v),g>l.length){c=!0;break}d===null&&(b=l.subarray(v,v+g),d=be.aac.parseSampleRate(b)),f++,v+=g;break;default:v++;break}if(c)return null}if(d===null||p===null)return null;var C=qi/d,k={audio:[{type:"audio",dts:p,pts:p},{type:"audio",dts:p+f*1024*C,pts:p+f*1024*C}]};return k},Yg=function(l){var c={pid:null,table:null},f={};Gg(l,c);for(var d in c.table)if(c.table.hasOwnProperty(d)){var p=c.table[d];switch(p){case nc.H264_STREAM_TYPE:f.video=[],Wg(l,c,f),f.video.length===0&&delete f.video;break;case nc.ADTS_STREAM_TYPE:f.audio=[],ac(l,c,f),f.audio.length===0&&delete f.audio;break}}return f},Qg=function(l,c){var f=be.aac.isLikelyAacData(l),d;return f?d=Kg(l):d=Yg(l),!d||!d.audio&&!d.video?null:(Xg(d,c),d)},Jg={inspect:Qg,parseAudioPes_:ac};const Zg=function(l,c){c.on("data",function(f){const d=f.initSegment;f.initSegment={data:d.buffer,byteOffset:d.byteOffset,byteLength:d.byteLength};const p=f.data;f.data=p.buffer,l.postMessage({action:"data",segment:f,byteOffset:p.byteOffset,byteLength:p.byteLength},[f.data])}),c.on("done",function(f){l.postMessage({action:"done"})}),c.on("gopInfo",function(f){l.postMessage({action:"gopInfo",gopInfo:f})}),c.on("videoSegmentTimingInfo",function(f){const d={start:{decode:pe.videoTsToSeconds(f.start.dts),presentation:pe.videoTsToSeconds(f.start.pts)},end:{decode:pe.videoTsToSeconds(f.end.dts),presentation:pe.videoTsToSeconds(f.end.pts)},baseMediaDecodeTime:pe.videoTsToSeconds(f.baseMediaDecodeTime)};f.prependedContentDuration&&(d.prependedContentDuration=pe.videoTsToSeconds(f.prependedContentDuration)),l.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:d})}),c.on("audioSegmentTimingInfo",function(f){const d={start:{decode:pe.videoTsToSeconds(f.start.dts),presentation:pe.videoTsToSeconds(f.start.pts)},end:{decode:pe.videoTsToSeconds(f.end.dts),presentation:pe.videoTsToSeconds(f.end.pts)},baseMediaDecodeTime:pe.videoTsToSeconds(f.baseMediaDecodeTime)};f.prependedContentDuration&&(d.prependedContentDuration=pe.videoTsToSeconds(f.prependedContentDuration)),l.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:d})}),c.on("id3Frame",function(f){l.postMessage({action:"id3Frame",id3Frame:f})}),c.on("caption",function(f){l.postMessage({action:"caption",caption:f})}),c.on("trackinfo",function(f){l.postMessage({action:"trackinfo",trackInfo:f})}),c.on("audioTimingInfo",function(f){l.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:pe.videoTsToSeconds(f.start),end:pe.videoTsToSeconds(f.end)}})}),c.on("videoTimingInfo",function(f){l.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:pe.videoTsToSeconds(f.start),end:pe.videoTsToSeconds(f.end)}})}),c.on("log",function(f){l.postMessage({action:"log",log:f})})};class oc{constructor(c,f){this.options=f||{},this.self=c,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new ig.Transmuxer(this.options),Zg(this.self,this.transmuxer)}pushMp4Captions(c){this.captionParser||(this.captionParser=new Ag,this.captionParser.init());const f=new Uint8Array(c.data,c.byteOffset,c.byteLength),d=this.captionParser.parse(f,c.trackIds,c.timescales);this.self.postMessage({action:"mp4Captions",captions:d&&d.captions||[],logs:d&&d.logs||[],data:f.buffer},[f.buffer])}probeMp4StartTime({timescales:c,data:f}){const d=vo.startTime(c,f);this.self.postMessage({action:"probeMp4StartTime",startTime:d,data:f},[f.buffer])}probeMp4Tracks({data:c}){const f=vo.tracks(c);this.self.postMessage({action:"probeMp4Tracks",tracks:f,data:c},[c.buffer])}probeEmsgID3({data:c,offset:f}){const d=vo.getEmsgID3(c,f);this.self.postMessage({action:"probeEmsgID3",id3Frames:d,emsgData:c},[c.buffer])}probeTs({data:c,baseStartTime:f}){const d=typeof f=="number"&&!isNaN(f)?f*pe.ONE_SECOND_IN_TS:void 0,p=Jg.inspect(c,d);let g=null;p&&(g={hasVideo:p.video&&p.video.length===2||!1,hasAudio:p.audio&&p.audio.length===2||!1},g.hasVideo&&(g.videoStart=p.video[0].ptsTime),g.hasAudio&&(g.audioStart=p.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:g,data:c},[c.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(c){const f=new Uint8Array(c.data,c.byteOffset,c.byteLength);this.transmuxer.push(f)}reset(){this.transmuxer.reset()}setTimestampOffset(c){const f=c.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(pe.secondsToVideoTs(f)))}setAudioAppendStart(c){this.transmuxer.setAudioAppendStart(Math.ceil(pe.secondsToVideoTs(c.appendStart)))}setRemux(c){this.transmuxer.setRemux(c.remux)}flush(c){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(c){this.transmuxer.alignGopsWith(c.gopsToAlignWith.slice())}}self.onmessage=function(l){if(l.data.action==="init"&&l.data.options){this.messageHandlers=new oc(self,l.data.options);return}this.messageHandlers||(this.messageHandlers=new oc(self)),l.data&&l.data.action&&l.data.action!=="init"&&this.messageHandlers[l.data.action]&&this.messageHandlers[l.data.action](l.data)}}));var ib=zp(tb);const sb=(i,e,t)=>{const{type:s,initSegment:r,captions:n,captionStreams:a,metadata:o,videoFrameDtsTime:u,videoFramePtsTime:h}=i.data.segment;e.buffer.push({captions:n,captionStreams:a,metadata:o});const m=i.data.segment.boxes||{data:i.data.segment.data},_={type:s,data:new Uint8Array(m.data,m.data.byteOffset,m.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)};typeof u<"u"&&(_.videoFrameDtsTime=u),typeof h<"u"&&(_.videoFramePtsTime=h),t(_)},rb=({transmuxedData:i,callback:e})=>{i.buffer=[],e(i)},nb=(i,e)=>{e.gopInfo=i.data.gopInfo},Xp=i=>{const{transmuxer:e,bytes:t,audioAppendStart:s,gopsToAlignWith:r,remux:n,onData:a,onTrackInfo:o,onAudioTimingInfo:u,onVideoTimingInfo:h,onVideoSegmentTimingInfo:m,onAudioSegmentTimingInfo:_,onId3:T,onCaptions:E,onDone:A,onEndedTimeline:y,onTransmuxerLog:w,isEndOfTimeline:D,segment:N,triggerSegmentEventFn:O}=i,B={buffer:[]};let I=D;const $=K=>{e.currentTransmux===i&&(K.data.action==="data"&&sb(K,B,a),K.data.action==="trackinfo"&&o(K.data.trackInfo),K.data.action==="gopInfo"&&nb(K,B),K.data.action==="audioTimingInfo"&&u(K.data.audioTimingInfo),K.data.action==="videoTimingInfo"&&h(K.data.videoTimingInfo),K.data.action==="videoSegmentTimingInfo"&&m(K.data.videoSegmentTimingInfo),K.data.action==="audioSegmentTimingInfo"&&_(K.data.audioSegmentTimingInfo),K.data.action==="id3Frame"&&T([K.data.id3Frame],K.data.id3Frame.dispatchType),K.data.action==="caption"&&E(K.data.caption),K.data.action==="endedtimeline"&&(I=!1,y()),K.data.action==="log"&&w(K.data.log),K.data.type==="transmuxed"&&(I||(e.onmessage=null,rb({transmuxedData:B,callback:A}),Kp(e))))},X=()=>{const K={message:"Received an error message from the transmuxer worker",metadata:{errorType:M.Error.StreamingFailedToTransmuxSegment,segmentInfo:Gi({segment:N})}};A(null,K)};if(e.onmessage=$,e.onerror=X,s&&e.postMessage({action:"setAudioAppendStart",appendStart:s}),Array.isArray(r)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),typeof n<"u"&&e.postMessage({action:"setRemux",remux:n}),t.byteLength){const K=t instanceof ArrayBuffer?t:t.buffer,re=t instanceof ArrayBuffer?0:t.byteOffset;O({type:"segmenttransmuxingstart",segment:N}),e.postMessage({action:"push",data:K,byteOffset:re,byteLength:t.byteLength},[K])}D&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},Kp=i=>{i.currentTransmux=null,i.transmuxQueue.length&&(i.currentTransmux=i.transmuxQueue.shift(),typeof i.currentTransmux=="function"?i.currentTransmux():Xp(i.currentTransmux))},Nd=(i,e)=>{i.postMessage({action:e}),Kp(i)},Yp=(i,e)=>{if(!e.currentTransmux){e.currentTransmux=i,Nd(e,i);return}e.transmuxQueue.push(Nd.bind(null,e,i))},ab=i=>{Yp("reset",i)},ob=i=>{Yp("endTimeline",i)},Qp=i=>{if(!i.transmuxer.currentTransmux){i.transmuxer.currentTransmux=i,Xp(i);return}i.transmuxer.transmuxQueue.push(i)},lb=i=>{const e=new ib;e.currentTransmux=null,e.transmuxQueue=[];const t=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,t.call(e)),e.postMessage({action:"init",options:i}),e};var Go={reset:ab,endTimeline:ob,transmux:Qp,createTransmuxer:lb};const Vr=function(i){const e=i.transmuxer,t=i.endAction||i.action,s=i.callback,r=Me({},i,{endAction:null,transmuxer:null,callback:null}),n=a=>{a.data.action===t&&(e.removeEventListener("message",n),a.data.data&&(a.data.data=new Uint8Array(a.data.data,i.byteOffset||0,i.byteLength||a.data.data.byteLength),i.data&&(i.data=a.data.data)),s(a.data))};if(e.addEventListener("message",n),i.data){const a=i.data instanceof ArrayBuffer;r.byteOffset=a?0:i.data.byteOffset,r.byteLength=i.data.byteLength;const o=[a?i.data:i.data.buffer];e.postMessage(r,o)}else e.postMessage(r)},Zt={FAILURE:2,TIMEOUT:-101,ABORTED:-102},yl=i=>{i.forEach(e=>{e.abort()})},ub=i=>({bandwidth:i.bandwidth,bytesReceived:i.bytesReceived||0,roundTripTime:i.roundTripTime||0}),cb=i=>{const e=i.target,s={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return s.bytesReceived=i.loaded,s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3),s},Eu=(i,e)=>{const{requestType:t}=e,s=Zi({requestType:t,request:e,error:i});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:Zt.TIMEOUT,xhr:e,metadata:s}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:Zt.ABORTED,xhr:e,metadata:s}:i?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:Zt.FAILURE,xhr:e,metadata:s}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:Zt.FAILURE,xhr:e,metadata:s}:null},Md=(i,e,t,s)=>(r,n)=>{const a=n.response,o=Eu(r,n);if(o)return t(o,i);if(a.byteLength!==16)return t({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:Zt.FAILURE,xhr:n},i);const u=new DataView(a),h=new Uint32Array([u.getUint32(0),u.getUint32(4),u.getUint32(8),u.getUint32(12)]);for(let _=0;_<e.length;_++)e[_].bytes=h;const m={uri:n.uri};return s({type:"segmentkeyloadcomplete",segment:i,keyInfo:m}),t(null,i)},Jp=(i,e)=>{const t=Hl(i.map.bytes);if(t!=="mp4"){const s=i.map.resolvedUri||i.map.uri,r=t||"unknown";return e({internal:!0,message:`Found unsupported ${r} container for initialization segment at URL: ${s}`,code:Zt.FAILURE,metadata:{mediaType:r}})}Vr({action:"probeMp4Tracks",data:i.map.bytes,transmuxer:i.transmuxer,callback:({tracks:s,data:r})=>(i.map.bytes=r,s.forEach(function(n){i.map.tracks=i.map.tracks||{},!i.map.tracks[n.type]&&(i.map.tracks[n.type]=n,typeof n.id=="number"&&n.timescale&&(i.map.timescales=i.map.timescales||{},i.map.timescales[n.id]=n.timescale))}),e(null))})},db=({segment:i,finishProcessingFn:e,triggerSegmentEventFn:t})=>(s,r)=>{const n=Eu(s,r);if(n)return e(n,i);const a=new Uint8Array(r.response);if(t({type:"segmentloaded",segment:i}),i.map.key)return i.map.encryptedBytes=a,e(null,i);i.map.bytes=a,Jp(i,function(o){if(o)return o.xhr=r,o.status=r.status,e(o,i);e(null,i)})},hb=({segment:i,finishProcessingFn:e,responseType:t,triggerSegmentEventFn:s})=>(r,n)=>{const a=Eu(r,n);if(a)return e(a,i);s({type:"segmentloaded",segment:i});const o=t==="arraybuffer"||!n.responseText?n.response:Z2(n.responseText.substring(i.lastReachedChar||0));return i.stats=ub(n),i.key?i.encryptedBytes=new Uint8Array(o):i.bytes=new Uint8Array(o),e(null,i)},fb=({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:h,dataFn:m,doneFn:_,onTransmuxerLog:T,triggerSegmentEventFn:E})=>{const A=i.map&&i.map.tracks||{},y=!!(A.audio&&A.video);let w=s.bind(null,i,"audio","start");const D=s.bind(null,i,"audio","end");let N=s.bind(null,i,"video","start");const O=s.bind(null,i,"video","end"),B=()=>Qp({bytes:e,transmuxer:i.transmuxer,audioAppendStart:i.audioAppendStart,gopsToAlignWith:i.gopsToAlignWith,remux:y,onData:I=>{I.type=I.type==="combined"?"video":I.type,m(i,I)},onTrackInfo:I=>{t&&(y&&(I.isMuxed=!0),t(i,I))},onAudioTimingInfo:I=>{w&&typeof I.start<"u"&&(w(I.start),w=null),D&&typeof I.end<"u"&&D(I.end)},onVideoTimingInfo:I=>{N&&typeof I.start<"u"&&(N(I.start),N=null),O&&typeof I.end<"u"&&O(I.end)},onVideoSegmentTimingInfo:I=>{const $={pts:{start:I.start.presentation,end:I.end.presentation},dts:{start:I.start.decode,end:I.end.decode}};E({type:"segmenttransmuxingtiminginfoavailable",segment:i,timingInfo:$}),r(I)},onAudioSegmentTimingInfo:I=>{const $={pts:{start:I.start.pts,end:I.end.pts},dts:{start:I.start.dts,end:I.end.dts}};E({type:"segmenttransmuxingtiminginfoavailable",segment:i,timingInfo:$}),n(I)},onId3:(I,$)=>{a(i,I,$)},onCaptions:I=>{o(i,[I])},isEndOfTimeline:u,onEndedTimeline:()=>{h()},onTransmuxerLog:T,onDone:(I,$)=>{_&&(I.type=I.type==="combined"?"video":I.type,E({type:"segmenttransmuxingcomplete",segment:i}),_($,i,I))},segment:i,triggerSegmentEventFn:E});Vr({action:"probeTs",transmuxer:i.transmuxer,data:e,baseStartTime:i.baseStartTime,callback:I=>{i.bytes=e=I.data;const $=I.result;$&&(t(i,{hasAudio:$.hasAudio,hasVideo:$.hasVideo,isMuxed:y}),t=null),B()}})},Zp=({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:h,dataFn:m,doneFn:_,onTransmuxerLog:T,triggerSegmentEventFn:E})=>{let A=new Uint8Array(e);if(Bv(A)){i.isFmp4=!0;const{tracks:y}=i.map,w={isFmp4:!0,hasVideo:!!y.video,hasAudio:!!y.audio};y.audio&&y.audio.codec&&y.audio.codec!=="enca"&&(w.audioCodec=y.audio.codec),y.video&&y.video.codec&&y.video.codec!=="encv"&&(w.videoCodec=y.video.codec),y.video&&y.audio&&(w.isMuxed=!0),t(i,w);const D=(N,O)=>{m(i,{data:A,type:w.hasAudio&&!w.isMuxed?"audio":"video"}),O&&O.length&&a(i,O),N&&N.length&&o(i,N),_(null,i,{})};Vr({action:"probeMp4StartTime",timescales:i.map.timescales,data:A,transmuxer:i.transmuxer,callback:({data:N,startTime:O})=>{e=N.buffer,i.bytes=A=N,w.hasAudio&&!w.isMuxed&&s(i,"audio","start",O),w.hasVideo&&s(i,"video","start",O),Vr({action:"probeEmsgID3",data:A,transmuxer:i.transmuxer,offset:O,callback:({emsgData:B,id3Frames:I})=>{if(e=B.buffer,i.bytes=A=B,!y.video||!B.byteLength||!i.transmuxer){D(void 0,I);return}Vr({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:i.transmuxer,data:A,timescales:i.map.timescales,trackIds:[y.video.id],callback:$=>{e=$.data.buffer,i.bytes=A=$.data,$.logs.forEach(function(X){T(Te(X,{stream:"mp4CaptionParser"}))}),D($.captions,I)}})}})}});return}if(!i.transmuxer){_(null,i,{});return}if(typeof i.container>"u"&&(i.container=Hl(A)),i.container!=="ts"&&i.container!=="aac"){t(i,{hasAudio:!1,hasVideo:!1}),_(null,i,{});return}fb({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:h,dataFn:m,doneFn:_,onTransmuxerLog:T,triggerSegmentEventFn:E})},em=function({id:i,key:e,encryptedBytes:t,decryptionWorker:s,segment:r,doneFn:n},a){const o=h=>{if(h.data.source===i){s.removeEventListener("message",o);const m=h.data.decrypted;a(new Uint8Array(m.bytes,m.byteOffset,m.byteLength))}};s.onerror=()=>{const h="An error occurred in the decryption worker",m=Gi({segment:r}),_={message:h,metadata:{error:new Error(h),errorType:M.Error.StreamingFailedToDecryptSegment,segmentInfo:m,keyInfo:{uri:r.key.resolvedUri||r.map.key.resolvedUri}}};n(_,r)},s.addEventListener("message",o);let u;e.bytes.slice?u=e.bytes.slice():u=new Uint32Array(Array.prototype.slice.call(e.bytes)),s.postMessage(Up({source:i,encrypted:t,key:u,iv:e.iv}),[t.buffer,u.buffer])},pb=({decryptionWorker:i,segment:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:h,dataFn:m,doneFn:_,onTransmuxerLog:T,triggerSegmentEventFn:E})=>{E({type:"segmentdecryptionstart"}),em({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:i,segment:e,doneFn:_},A=>{e.bytes=A,E({type:"segmentdecryptioncomplete",segment:e}),Zp({segment:e,bytes:e.bytes,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:h,dataFn:m,doneFn:_,onTransmuxerLog:T,triggerSegmentEventFn:E})})},mb=({activeXhrs:i,decryptionWorker:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:h,dataFn:m,doneFn:_,onTransmuxerLog:T,triggerSegmentEventFn:E})=>{let A=0,y=!1;return(w,D)=>{if(!y){if(w)return y=!0,yl(i),_(w,D);if(A+=1,A===i.length){const N=function(){if(D.encryptedBytes)return pb({decryptionWorker:e,segment:D,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:h,dataFn:m,doneFn:_,onTransmuxerLog:T,triggerSegmentEventFn:E});Zp({segment:D,bytes:D.bytes,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:h,dataFn:m,doneFn:_,onTransmuxerLog:T,triggerSegmentEventFn:E})};if(D.endOfAllRequests=Date.now(),D.map&&D.map.encryptedBytes&&!D.map.bytes)return E({type:"segmentdecryptionstart",segment:D}),em({decryptionWorker:e,id:D.requestId+"-init",encryptedBytes:D.map.encryptedBytes,key:D.map.key,segment:D,doneFn:_},O=>{D.map.bytes=O,E({type:"segmentdecryptioncomplete",segment:D}),Jp(D,B=>{if(B)return yl(i),_(B,D);N()})});N()}}}},gb=({loadendState:i,abortFn:e})=>t=>{t.target.aborted&&e&&!i.calledAbortFn&&(e(),i.calledAbortFn=!0)},_b=({segment:i,progressFn:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:h,dataFn:m})=>_=>{if(!_.target.aborted)return i.stats=Te(i.stats,cb(_)),!i.stats.firstBytesReceivedAt&&i.stats.bytesReceived&&(i.stats.firstBytesReceivedAt=Date.now()),e(_,i)},yb=({xhr:i,xhrOptions:e,decryptionWorker:t,segment:s,abortFn:r,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:u,audioSegmentTimingInfoFn:h,id3Fn:m,captionsFn:_,isEndOfTimeline:T,endedTimelineFn:E,dataFn:A,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:D})=>{const N=[],O=mb({activeXhrs:N,decryptionWorker:t,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:u,audioSegmentTimingInfoFn:h,id3Fn:m,captionsFn:_,isEndOfTimeline:T,endedTimelineFn:E,dataFn:A,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:D});if(s.key&&!s.key.bytes){const K=[s.key];s.map&&!s.map.bytes&&s.map.key&&s.map.key.resolvedUri===s.key.resolvedUri&&K.push(s.map.key);const re=Te(e,{uri:s.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),xe=Md(s,K,O,D),ue={uri:s.key.resolvedUri};D({type:"segmentkeyloadstart",segment:s,keyInfo:ue});const ge=i(re,xe);N.push(ge)}if(s.map&&!s.map.bytes){if(s.map.key&&(!s.key||s.key.resolvedUri!==s.map.key.resolvedUri)){const ge=Te(e,{uri:s.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),ee=Md(s,[s.map.key],O,D),he={uri:s.map.key.resolvedUri};D({type:"segmentkeyloadstart",segment:s,keyInfo:he});const Re=i(ge,ee);N.push(Re)}const re=Te(e,{uri:s.map.resolvedUri,responseType:"arraybuffer",headers:gl(s.map),requestType:"segment-media-initialization"}),xe=db({segment:s,finishProcessingFn:O,triggerSegmentEventFn:D});D({type:"segmentloadstart",segment:s});const ue=i(re,xe);N.push(ue)}const B=Te(e,{uri:s.part&&s.part.resolvedUri||s.resolvedUri,responseType:"arraybuffer",headers:gl(s),requestType:"segment"}),I=hb({segment:s,finishProcessingFn:O,responseType:B.responseType,triggerSegmentEventFn:D});D({type:"segmentloadstart",segment:s});const $=i(B,I);$.addEventListener("progress",_b({segment:s,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:u,audioSegmentTimingInfoFn:h,id3Fn:m,captionsFn:_,isEndOfTimeline:T,endedTimelineFn:E,dataFn:A})),N.push($);const X={};return N.forEach(K=>{K.addEventListener("loadend",gb({loadendState:X,abortFn:r}))}),()=>yl(N)},vb=Lt("CodecUtils"),Tb=function(i){const e=i.attributes||{};if(e.CODECS)return Xt(e.CODECS)},tm=(i,e)=>{const t=e.attributes||{};return i&&i.mediaGroups&&i.mediaGroups.AUDIO&&t.AUDIO&&i.mediaGroups.AUDIO[t.AUDIO]},bb=(i,e)=>{if(!tm(i,e))return!0;const t=e.attributes||{},s=i.mediaGroups.AUDIO[t.AUDIO];for(const r in s)if(!s[r].uri&&!s[r].playlists)return!0;return!1},Ta=function(i){const e={};return i.forEach(({mediaType:t,type:s,details:r})=>{e[t]=e[t]||[],e[t].push(oh(`${s}${r}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1){vb(`multiple ${t} codecs found as attributes: ${e[t].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),e[t]=null;return}e[t]=e[t][0]}),e},Bd=function(i){let e=0;return i.audio&&e++,i.video&&e++,e},zr=function(i,e){const t=e.attributes||{},s=Ta(Tb(e)||[]);if(tm(i,e)&&!s.audio&&!bb(i,e)){const r=Ta(M_(i,t.AUDIO)||[]);r.audio&&(s.audio=r.audio)}return s},zn=Lt("PlaylistSelector"),Fd=function(i){if(!i||!i.playlist)return;const e=i.playlist;return JSON.stringify({id:e.id,bandwidth:i.bandwidth,width:i.width,height:i.height,codecs:e.attributes&&e.attributes.CODECS||""})},ba=function(i,e){if(!i)return"";const t=x.getComputedStyle(i);return t?t[e]:""},Rs=function(i,e){const t=i.slice();i.sort(function(s,r){const n=e(s,r);return n===0?t.indexOf(s)-t.indexOf(r):n})},Cu=function(i,e){let t,s;return i.attributes.BANDWIDTH&&(t=i.attributes.BANDWIDTH),t=t||x.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(s=e.attributes.BANDWIDTH),s=s||x.Number.MAX_VALUE,t-s},Sb=function(i,e){let t,s;return i.attributes.RESOLUTION&&i.attributes.RESOLUTION.width&&(t=i.attributes.RESOLUTION.width),t=t||x.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(s=e.attributes.RESOLUTION.width),s=s||x.Number.MAX_VALUE,t===s&&i.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?i.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-s};let im=function(i,e,t,s,r,n){if(!i)return;const a={bandwidth:e,width:t,height:s,limitRenditionByPlayerDimensions:r};let o=i.playlists;gt.isAudioOnly(i)&&(o=n.getAudioTrackPlaylists_(),a.audioOnly=!0);let u=o.map(I=>{let $;const X=I.attributes&&I.attributes.RESOLUTION&&I.attributes.RESOLUTION.width,K=I.attributes&&I.attributes.RESOLUTION&&I.attributes.RESOLUTION.height;return $=I.attributes&&I.attributes.BANDWIDTH,$=$||x.Number.MAX_VALUE,{bandwidth:$,width:X,height:K,playlist:I}});Rs(u,(I,$)=>I.bandwidth-$.bandwidth),u=u.filter(I=>!gt.isIncompatible(I.playlist));let h=u.filter(I=>gt.isEnabled(I.playlist));h.length||(h=u.filter(I=>!gt.isDisabled(I.playlist)));const m=h.filter(I=>I.bandwidth*Ve.BANDWIDTH_VARIANCE<e);let _=m[m.length-1];const T=m.filter(I=>I.bandwidth===_.bandwidth)[0];if(r===!1){const I=T||h[0]||u[0];if(I&&I.playlist){let $="sortedPlaylistReps";return T&&($="bandwidthBestRep"),h[0]&&($="enabledPlaylistReps"),zn(`choosing ${Fd(I)} using ${$} with options`,a),I.playlist}return zn("could not choose a playlist with options",a),null}const E=m.filter(I=>I.width&&I.height);Rs(E,(I,$)=>I.width-$.width);const A=E.filter(I=>I.width===t&&I.height===s);_=A[A.length-1];const y=A.filter(I=>I.bandwidth===_.bandwidth)[0];let w,D,N;y||(w=E.filter(I=>I.width>t||I.height>s),D=w.filter(I=>I.width===w[0].width&&I.height===w[0].height),_=D[D.length-1],N=D.filter(I=>I.bandwidth===_.bandwidth)[0]);let O;if(n.leastPixelDiffSelector){const I=E.map($=>($.pixelDiff=Math.abs($.width-t)+Math.abs($.height-s),$));Rs(I,($,X)=>$.pixelDiff===X.pixelDiff?X.bandwidth-$.bandwidth:$.pixelDiff-X.pixelDiff),O=I[0]}const B=O||N||y||T||h[0]||u[0];if(B&&B.playlist){let I="sortedPlaylistReps";return O?I="leastPixelDiffRep":N?I="resolutionPlusOneRep":y?I="resolutionBestRep":T?I="bandwidthBestRep":h[0]&&(I="enabledPlaylistReps"),zn(`choosing ${Fd(B)} using ${I} with options`,a),B.playlist}return zn("could not choose a playlist with options",a),null};const Ud=function(){let i=this.useDevicePixelRatio&&x.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(i=this.customPixelRatio),im(this.playlists.main,this.systemBandwidth,parseInt(ba(this.tech_.el(),"width"),10)*i,parseInt(ba(this.tech_.el(),"height"),10)*i,this.limitRenditionByPlayerDimensions,this.playlistController_)},xb=function(i){let e=-1,t=-1;if(i<0||i>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let s=this.useDevicePixelRatio&&x.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(s=this.customPixelRatio),e<0&&(e=this.systemBandwidth,t=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==t&&(e=i*this.systemBandwidth+(1-i)*e,t=this.systemBandwidth),im(this.playlists.main,e,parseInt(ba(this.tech_.el(),"width"),10)*s,parseInt(ba(this.tech_.el(),"height"),10)*s,this.limitRenditionByPlayerDimensions,this.playlistController_)}},Eb=function(i){const{main:e,currentTime:t,bandwidth:s,duration:r,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:o,syncController:u}=i,h=e.playlists.filter(A=>!gt.isIncompatible(A));let m=h.filter(gt.isEnabled);m.length||(m=h.filter(A=>!gt.isDisabled(A)));const T=m.filter(gt.hasAttribute.bind(null,"BANDWIDTH")).map(A=>{const w=u.getSyncPoint(A,r,o,t)?1:2,N=gt.estimateSegmentRequestTime(n,s,A)*w-a;return{playlist:A,rebufferingImpact:N}}),E=T.filter(A=>A.rebufferingImpact<=0);return Rs(E,(A,y)=>Cu(y.playlist,A.playlist)),E.length?E[0]:(Rs(T,(A,y)=>A.rebufferingImpact-y.rebufferingImpact),T[0]||null)},Cb=function(){const i=this.playlists.main.playlists.filter(gt.isEnabled);return Rs(i,(t,s)=>Cu(t,s)),i.filter(t=>!!zr(this.playlists.main,t).video)[0]||null},Ab=i=>{let e=0,t;return i.bytes&&(t=new Uint8Array(i.bytes),i.segments.forEach(s=>{t.set(s,e),e+=s.byteLength})),t};function sm(i){try{return new URL(i).pathname.split("/").slice(-2).join("/")}catch{return""}}const wb=function(i,e,t){if(!i[t]){e.trigger({type:"usage",name:"vhs-608"});let s=t;/^cc708_/.test(t)&&(s="SERVICE"+t.split("_")[1]);const r=e.textTracks().getTrackById(s);if(r)i[t]=r;else{const n=e.options_.vhs&&e.options_.vhs.captionServices||{};let a=t,o=t,u=!1;const h=n[s];h&&(a=h.label,o=h.language,u=h.default),i[t]=e.addRemoteTextTrack({kind:"captions",id:s,default:u,label:a,language:o},!1).track}}},Db=function({inbandTextTracks:i,captionArray:e,timestampOffset:t}){if(!e)return;const s=x.WebKitDataCue||x.VTTCue;e.forEach(r=>{const n=r.stream;r.content?r.content.forEach(a=>{const o=new s(r.startTime+t,r.endTime+t,a.text);o.line=a.line,o.align="left",o.position=a.position,o.positionAlign="line-left",i[n].addCue(o)}):i[n].addCue(new s(r.startTime+t,r.endTime+t,r.text))})},Ib=function(i){Object.defineProperties(i.frame,{id:{get(){return M.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),i.value.key}},value:{get(){return M.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),i.value.data}},privateData:{get(){return M.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),i.value.data}}})},kb=({inbandTextTracks:i,metadataArray:e,timestampOffset:t,videoDuration:s})=>{if(!e)return;const r=x.WebKitDataCue||x.VTTCue,n=i.metadataTrack_;if(!n||(e.forEach(m=>{const _=m.cueTime+t;typeof _!="number"||x.isNaN(_)||_<0||!(_<1/0)||!m.frames||!m.frames.length||m.frames.forEach(T=>{const E=new r(_,_,T.value||T.url||T.data||"");E.frame=T,E.value=T,Ib(E),n.addCue(E)})}),!n.cues||!n.cues.length))return;const a=n.cues,o=[];for(let m=0;m<a.length;m++)a[m]&&o.push(a[m]);const u=o.reduce((m,_)=>{const T=m[_.startTime]||[];return T.push(_),m[_.startTime]=T,m},{}),h=Object.keys(u).sort((m,_)=>Number(m)-Number(_));h.forEach((m,_)=>{const T=u[m],E=isFinite(s)?s:m,A=Number(h[_+1])||E;T.forEach(y=>{y.endTime=A})})},Pb={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},Lb=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),Ob=({inbandTextTracks:i,dateRanges:e})=>{const t=i.metadataTrack_;if(!t)return;const s=x.WebKitDataCue||x.VTTCue;e.forEach(r=>{for(const n of Object.keys(r)){if(Lb.has(n))continue;const a=new s(r.startTime,r.endTime,"");a.id=r.id,a.type="com.apple.quicktime.HLS",a.value={key:Pb[n],data:r[n]},(n==="scte35Out"||n==="scte35In")&&(a.value.data=new Uint8Array(a.value.data.match(/[\da-f]{2}/gi)).buffer),t.addCue(a)}r.processDateRange()})},$d=(i,e,t)=>{i.metadataTrack_||(i.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,M.browser.IS_ANY_SAFARI||(i.metadataTrack_.inBandMetadataTrackDispatchType=e))},Br=function(i,e,t){let s,r;if(t&&t.cues)for(s=t.cues.length;s--;)r=t.cues[s],r.startTime>=i&&r.endTime<=e&&t.removeCue(r)},Rb=function(i){const e=i.cues;if(!e)return;const t={};for(let s=e.length-1;s>=0;s--){const r=e[s],n=`${r.startTime}-${r.endTime}-${r.text}`;t[n]?i.removeCue(r):t[n]=r}},Nb=(i,e,t)=>{if(typeof e>"u"||e===null||!i.length)return[];const s=Math.ceil((e-t+3)*Wi.ONE_SECOND_IN_TS);let r;for(r=0;r<i.length&&!(i[r].pts>s);r++);return i.slice(r)},Mb=(i,e,t)=>{if(!e.length)return i;if(t)return e.slice();const s=e[0].pts;let r=0;for(r;r<i.length&&!(i[r].pts>=s);r++);return i.slice(0,r).concat(e)},Bb=(i,e,t,s)=>{const r=Math.ceil((e-s)*Wi.ONE_SECOND_IN_TS),n=Math.ceil((t-s)*Wi.ONE_SECOND_IN_TS),a=i.slice();let o=i.length;for(;o--&&!(i[o].pts<=n););if(o===-1)return a;let u=o+1;for(;u--&&!(i[u].pts<=r););return u=Math.max(u,0),a.splice(u,o-u+1),a},Fb=function(i,e){if(!i&&!e||!i&&e||i&&!e)return!1;if(i===e)return!0;const t=Object.keys(i).sort(),s=Object.keys(e).sort();if(t.length!==s.length)return!1;for(let r=0;r<t.length;r++){const n=t[r];if(n!==s[r]||i[n]!==e[n])return!1}return!0},Ub=function(i,e,t){e=e||[];const s=[];let r=0;for(let n=0;n<e.length;n++){const a=e[n];if(i===a.timeline&&(s.push(n),r+=a.duration,r>t))return n}return s.length===0?0:s[s.length-1]},Pr=1,$b=500,qd=i=>typeof i=="number"&&isFinite(i),Gn=1/60,qb=(i,e,t)=>i!=="main"||!e||!t?null:!t.hasAudio&&!t.hasVideo?"Neither audio nor video foun
204d in segment.":e.hasVideo&&!t.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!e.hasVideo&&t.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null,jb=(i,e,t)=>{let s=e-Ve.BACK_BUFFER_LENGTH;i.length&&(s=Math.max(s,i.start(0)));const r=e-t;return Math.min(r,s)},Es=i=>{const{startOfSegment:e,duration:t,segment:s,part:r,playlist:{mediaSequence:n,id:a,segments:o=[]},mediaIndex:u,partIndex:h,timeline:m}=i,_=o.length-1;let T="mediaIndex/partIndex increment";i.getMediaInfoForTime?T=`getMediaInfoForTime (${i.getMediaInfoForTime})`:i.isSyncRequest&&(T="getSyncSegmentCandidate (isSyncRequest)"),i.independent&&(T+=` with independent ${i.independent}`);const E=typeof h=="number",A=i.segment.uri?"segment":"pre-segment",y=E?xp({preloadSegment:s})-1:0;return`${A} [${n+u}/${n+_}]`+(E?` part [${h}/${y}]`:"")+` segment start/end [${s.start} => ${s.end}]`+(E?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${e}] duration [${t}] timeline [${m}] selected by [${T}] playlist [${a}]`},jd=i=>`${i}TimingInfo`,Hb=({segmentTimeline:i,currentTimeline:e,startOfSegment:t,buffered:s,overrideCheck:r})=>!r&&i===e?null:i<e?t:s.length?s.end(s.length-1):t,vl=({timelineChangeController:i,currentTimeline:e,segmentTimeline:t,loaderType:s,audioDisabled:r})=>{if(e===t)return!1;if(s==="audio"){const n=i.lastTimelineChange({type:"main"});return!n||n.to!==t}if(s==="main"&&r){const n=i.pendingTimelineChange({type:"audio"});return!(n&&n.to===t)}return!1},Vb=i=>{if(!i)return!1;const e=i.pendingTimelineChange({type:"audio"}),t=i.pendingTimelineChange({type:"main"}),s=e&&t,r=s&&e.to!==t.to;return!!(s&&e.from!==-1&&t.from!==-1&&r)},zb=i=>{i&&(i.pause(),i.resetEverything(),i.load())},Gb=i=>{const e=i.timelineChangeController_.pendingTimelineChange({type:"audio"}),t=i.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&t&&e.to<t.to},Ci=i=>{const e=i.pendingSegment_;if(!e)return;if(vl({timelineChangeController:i.timelineChangeController_,currentTimeline:i.currentTimeline_,segmentTimeline:e.timeline,loaderType:i.loaderType_,audioDisabled:i.audioDisabled_})&&Vb(i.timelineChangeController_)){if(Gb(i)){i.timelineChangeController_.trigger("audioTimelineBehind");return}zb(i)}},Wb=i=>{let e=0;return["video","audio"].forEach(function(t){const s=i[`${t}TimingInfo`];if(!s)return;const{start:r,end:n}=s;let a;typeof r=="bigint"||typeof n=="bigint"?a=x.BigInt(n)-x.BigInt(r):typeof r=="number"&&typeof n=="number"&&(a=n-r),typeof a<"u"&&a>e&&(e=a)}),typeof e=="bigint"&&e<Number.MAX_SAFE_INTEGER&&(e=Number(e)),e},Hd=({segmentDuration:i,maxDuration:e})=>i?Math.round(i)>e+Qt:!1,Xb=(i,e)=>{if(e!=="hls")return null;const t=Wb({audioTimingInfo:i.audioTimingInfo,videoTimingInfo:i.videoTimingInfo});if(!t)return null;const s=i.playlist.targetDuration,r=Hd({segmentDuration:t,maxDuration:s*2}),n=Hd({segmentDuration:t,maxDuration:s}),a=`Segment with index ${i.mediaIndex} from playlist ${i.playlist.id} has a duration of ${t} when the reported duration is ${i.duration} and the target duration is ${s}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return r||n?{severity:r?"warn":"info",message:a}:null},Gi=({type:i,segment:e})=>{if(!e)return;const t=!!(e.key||e.map&&e.map.ke),s=!!(e.map&&!e.map.bytes),r=e.startOfSegment===void 0?e.start:e.startOfSegment;return{type:i||e.type,uri:e.resolvedUri||e.uri,start:r,duration:e.duration,isEncrypted:t,isMediaInitialization:s}};class Tl extends M.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={}
vendor: 43,516 bytes, lines 204-216
204,this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=Lt(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(s){s!==this.state_&&(this.logger_(`${this.state_} -> ${s}`),this.state_=s,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Ci(this)}),this.sourceUpdater_.on("codecschange",s=>{this.trigger(Me({type:"codecschange"},s))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Ci(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",s=>{this.trigger(Me({type:"timelinechange"},s)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():Ci(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Ci(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return Go.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&x.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,x.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e}error(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&Go.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Xe();if(this.loaderType_==="main"){const{hasAudio:t,hasVideo:s,isMuxed:r}=e;if(s&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(s)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const s=va(e);let r=this.initSegments_[s];return t&&!r&&e.bytes&&(this.initSegments_[s]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e}segmentKey(e,t=!1){if(!e)return null;const s=$p(e);let r=this.keyCache_[s];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[s]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});const n={resolvedUri:(r||e).resolvedUri};return r&&(n.bytes=r.bytes),n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e)return;const s=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let n=null;if(s&&(s.id?n=s.id:s.uri&&(n=s.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update: 205currentTime: ${this.currentTime_()} 206bufferedEnd: ${Vo(this.buffered_())} 207`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!s||s.uri!==e.uri){this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}const a=e.mediaSequence-s.mediaSequence;if(this.logger_(`live window shift [${a}]`),this.mediaIndex!==null)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const o=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!o.parts||!o.parts.length||!o.parts[this.partIndex])){const u=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=u}}r&&(r.mediaIndex-=a,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(s,e)}pause(){this.checkBufferTimeout_&&(x.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&Go.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;this.sourceType_==="hls"&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,s=()=>{},r=!1){if(t===1/0&&(t=this.duration_()),t<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let n=1;const a=()=>{n--,n===0&&s()};(r||!this.audioDisabled_)&&(n++,this.sourceUpdater_.removeAudio(e,t,a)),(r||this.loaderType_==="main")&&(this.gopBuffer_=Bb(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,a));for(const o in this.inbandTextTracks_)Br(e,t,this.inbandTextTracks_[o]);Br(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&x.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=x.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&x.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=x.setTimeout(this.monitorBufferTick_.bind(this),$b)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:Gi({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t}),typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,s=this.partIndex){if(!t||!this.mediaSource_)return!1;const r=typeof e=="number"&&t.segments[e],n=e+1===t.segments.length,a=!r||!r.parts||s+1===r.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&n&&a}chooseNextRequest_(){const e=this.buffered_(),t=Vo(e)||0,s=Tu(e,this.currentTime_()),r=!this.hasPlayed_()&&s>=1,n=s>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||r||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const o={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(o.isSyncRequest)o.mediaIndex=Ub(this.currentTimeline_,a,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${o.mediaIndex}`);else if(this.mediaIndex!==null){const T=a[this.mediaIndex],E=typeof this.partIndex=="number"?this.partIndex:-1;o.startOfSegment=T.end?T.end:t,T.parts&&T.parts[E+1]?(o.mediaIndex=this.mediaIndex,o.partIndex=E+1):o.mediaIndex=this.mediaIndex+1}else{let T,E,A;const y=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch: 208For TargetTime: ${y}. 209CurrentTime: ${this.currentTime_()} 210BufferedEnd: ${t} 211Fetch At Buffer: ${this.fetchAtBuffer_} 212`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const w=this.getSyncInfoFromMediaSequenceSync_(y);if(!w){const D="No sync info found while using media sequence sync";return this.error({message:D,metadata:{errorType:M.Error.StreamingFailedToSelectNextSegment,error:new Error(D)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${w.start} --> ${w.end})`),T=w.segmentIndex,E=w.partIndex,A=w.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const w=gt.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:y,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});T=w.segmentIndex,E=w.partIndex,A=w.startTime}o.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${y}`:`currentTime ${y}`,o.mediaIndex=T,o.startOfSegment=A,o.partIndex=E,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${o.mediaIndex} `)}const u=a[o.mediaIndex];let h=u&&typeof o.partIndex=="number"&&u.parts&&u.parts[o.partIndex];if(!u||typeof o.partIndex=="number"&&!h)return null;typeof o.partIndex!="number"&&u.parts&&(o.partIndex=0,h=u.parts[0]);const m=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!s&&h&&!m&&!h.independent)if(o.partIndex===0){const T=a[o.mediaIndex-1],E=T.parts&&T.parts.length&&T.parts[T.parts.length-1];E&&E.independent&&(o.mediaIndex-=1,o.partIndex=T.parts.length-1,o.independent="previous segment")}else u.parts[o.partIndex-1].independent&&(o.partIndex-=1,o.independent="previous part");const _=this.mediaSource_&&this.mediaSource_.readyState==="ended";return o.mediaIndex>=a.length-1&&_&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,o.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(o))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const s=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!s)return null;if(!s.isAppended)return s;const r=this.mediaSequenceSync_.getSyncInfoForTime(s.end);return r?(r.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),r):null}generateSegmentInfo_(e){const{independent:t,playlist:s,mediaIndex:r,startOfSegment:n,isSyncRequest:a,partIndex:o,forceTimestampOffset:u,getMediaInfoForTime:h}=e,m=s.segments[r],_=typeof o=="number"&&m.parts[o],T={requestId:"segment-loader-"+Math.random(),uri:_&&_.resolvedUri||m.resolvedUri,mediaIndex:r,partIndex:_?o:null,isSyncRequest:a,startOfSegment:n,playlist:s,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:m.timeline,duration:_&&_.duration||m.duration,segment:m,part:_,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:h,independent:t},E=typeof u<"u"?u:this.isPendingTimestampOffset_;T.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:m.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:E});const A=Vo(this.sourceUpdater_.audioBuffered());return typeof A=="number"&&(T.audioAppendStart=A-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(T.gopsToAlignWith=Nb(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),T}timestampOffsetForSegment_(e){return Hb(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),s=e.bandwidth,r=this.pendingSegment_.duration,n=gt.estimateSegmentRequestTime(r,s,this.playlist_,e.bytesReceived),a=h2(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=a)return;const o=Eb({main:this.vhs_.playlists.main,currentTime:t,bandwidth:s,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!o)return;const h=n-a-o.rebufferingImpact;let m=.5;a<=Qt&&(m=1),!(!o.playlist||o.playlist.uri===this.playlist_.uri||h<m)&&(this.bandwidth=o.playlist.attributes.BANDWIDTH*Ve.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${Es(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId)&&this.trigger("progress")}handleTrackInfo_(e,t){const{hasAudio:s,hasVideo:r}=t,n={segmentInfo:Gi({type:this.loaderType_,segment:e}),trackInfo:{hasAudio:s,hasVideo:r}};this.trigger({type:"segmenttransmuxingtrackinfoavailable",metadata:n}),this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.checkForIllegalMediaSwitch(t)||(t=t||{},Fb(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),!this.checkForAbort_(e.requestId)&&(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()?this.processCallQueue_():Ci(this))))}handleTimingInfo_(e,t,s,r){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const n=this.pendingSegment_,a=jd(t);n[a]=n[a]||{},n[a][s]=r,this.logger_(`timinginfo: ${t} - ${s} - ${r}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Ci(this)}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(t.length===0){this.logger_("SegmentLoader received no captions from a caption event");return}if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));return}const r=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),n={};t.forEach(a=>{n[a.stream]=n[a.stream]||{startTime:1/0,captions:[],endTime:0};const o=n[a.stream];o.startTime=Math.min(o.startTime,a.startTime+r),o.endTime=Math.max(o.endTime,a.endTime+r),o.captions.push(a)}),Object.keys(n).forEach(a=>{const{startTime:o,endTime:u,captions:h}=n[a],m=this.inbandTextTracks_;this.logger_(`adding cues from ${o} -> ${u} for ${a}`),wb(m,this.vhs_.tech_,a),Br(o,u,m[a]),Db({captionArray:h,inbandTextTracks:m,timestampOffset:r})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,s){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,s));return}this.addMetadataToTextTrack(s,t,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(t=>t())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(t=>t())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!vl({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:s,hasVideo:r,isMuxed:n}=t;return!(r&&!e.videoTimingInfo||s&&!this.audioDisabled_&&!n&&!e.audioTimingInfo||vl({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){Ci(this),this.callQueue_.push(this.handleData_.bind(this,e,t));return}const s=this.pendingSegment_;if(this.setTimeMapping_(s.timeline),this.updateMediaSecondsLoaded_(s.part||s.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),s.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),s.isFmp4=e.isFmp4,s.timingInfo=s.timingInfo||{},s.isFmp4)this.trigger("fmp4"),s.timingInfo.start=s[jd(t.type)].start;else{const r=this.getCurrentMediaInfo_(),n=this.loaderType_==="main"&&r&&r.hasVideo;let a;n&&(a=s.videoTimingInfo.start),s.timingInfo.start=this.trueSegmentStart_({currentStart:s.timingInfo.start,playlist:s.playlist,mediaIndex:s.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:n,firstVideoFrameTimeForData:a,videoTimingInfo:s.videoTimingInfo,audioTimingInfo:s.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(s,t.type),this.updateSourceBufferTimestampOffset_(s),s.isSyncRequest){this.updateTimingInfoEnd_(s),this.syncController_.saveSegmentTimingInfo({segmentInfo:s,shouldSaveTimelineMapping:this.loaderType_==="main"});const r=this.chooseNextRequest_();if(r.mediaIndex!==s.mediaIndex||r.partIndex!==s.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}s.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(s,t)}}updateAppendInitSegmentStatus(e,t){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:s,playlist:r}){if(s){const n=va(s);if(this.activeInitSegmentId_===n)return null;t=this.initSegmentForMap(s,!0).bytes,this.activeInitSegmentId_=n}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:s},r){const n=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Xi(n).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Xi(a).join(", "));const o=n.length?n.start(0):0,u=n.length?n.end(n.length-1):0,h=a.length?a.start(0):0,m=a.length?a.end(a.length-1):0;if(u-o<=Pr&&m-h<=Pr){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${s.byteLength}, audio buffer: ${Xi(n).join(", ")}, video buffer: ${Xi(a).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:s}));const T=this.currentTime_()-Pr;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${T}`),this.remove(0,T,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${Pr}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=x.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},Pr*1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:s},r){if(r){if(r.code===Rp){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:s});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error({message:`${t} append of ${s.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:M.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:s,data:r,bytes:n}){if(!n){const o=[r];let u=r.byteLength;s&&(o.unshift(s),u+=s.byteLength),n=Ab({bytes:u,segments:o})}const a={segmentInfo:Gi({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:a}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:n}))}handleSegmentTimingInfo_(e,t,s){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const r=this.pendingSegment_.segment,n=`${e}TimingInfo`;r[n]||(r[n]={}),r[n].transmuxerPrependedSeconds=s.prependedContentDuration||0,r[n].transmuxedPresentationStart=s.start.presentation,r[n].transmuxedDecodeStart=s.start.decode,r[n].transmuxedPresentationEnd=s.end.presentation,r[n].transmuxedDecodeEnd=s.end.decode,r[n].baseMediaDecodeTime=s.baseMediaDecodeTime}appendData_(e,t){const{type:s,data:r}=t;if(!r||!r.byteLength||s==="audio"&&this.audioDisabled_)return;const n=this.getInitSegmentAndUpdateState_({type:s,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:s,initSegment:n,data:r})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){Ci(this),this.loadQueue_.push(()=>{const t=Me({},e,{forceTimestampOffset:!0});Me(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),s=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=this.mediaIndex!==null,n=e.timeline!==this.currentTimeline_&&e.timeline>0,a=s||r&&n;this.logger_(`Requesting 213${sm(e.uri)} 214${Es(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=yb({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:a,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:o,level:u,stream:h})=>{this.logger_(`${Es(e)} logged from transmuxer stream ${h} as a ${u}: ${o}`)},triggerSegmentEventFn:({type:o,segment:u,keyInfo:h,trackInfo:m,timingInfo:_})=>{const E={segmentInfo:Gi({segment:u})};h&&(E.keyInfo=h),m&&(E.trackInfo=m),_&&(E.timingInfo=_),this.trigger({type:o,metadata:E})}})}trimBackBuffer_(e){const t=jb(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,s=e.part,r=e.segment.key||e.segment.map&&e.segment.map.key,n=e.segment.map&&!e.segment.map.bytes,a={resolvedUri:s?s.resolvedUri:t.resolvedUri,byterange:s?s.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:r,isMediaInitialization:n},o=e.playlist.segments[e.mediaIndex-1];if(o&&o.timeline===t.timeline&&(o.videoTimingInfo?a.baseStartTime=o.videoTimingInfo.transmuxedDecodeEnd:o.audioTimingInfo&&(a.baseStartTime=o.audioTimingInfo.transmuxedDecodeEnd)),t.key){const u=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);a.key=this.segmentKey(t.key),a.key.iv=u}return t.map&&(a.map=this.initSegmentForMap(t.map)),a}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e<Gn){this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record ${Gn}`);return}const s={bandwidthInfo:{from:this.bandwidth,to:t.bandwidth}};this.trigger({type:"bandwidthupdated",metadata:s}),this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime}handleTimeout_(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")}segmentRequestFinished_(e,t,s){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,s));return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_||t.requestId!==this.pendingSegment_.requestId)return;if(e){if(this.pendingSegment_=null,this.state="READY",e.code===Zt.ABORTED)return;if(this.pause(),e.code===Zt.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1,this.error(e),this.trigger("error");return}const r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),r.endOfAllRequests=t.endOfAllRequests,s.gopInfo&&(this.gopBuffer_=Mb(this.gopBuffer_,s.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(r)}setTimeMapping_(e){const t=this.syncController_.mappingForTimeline(e);t!==null&&(this.timeMapping_=t)}updateMediaSecondsLoaded_(e){typeof e.start=="number"&&typeof e.end=="number"?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return e===null?!1:this.loaderType_==="main"&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset()}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:s,firstVideoFrameTimeForData:r,currentVideoTimestampOffset:n,useVideoTimingInfo:a,videoTimingInfo:o,audioTimingInfo:u}){if(typeof e<"u")return e;if(!a)return u.start;const h=t.segments[s-1];return s===0||!h||typeof h.start>"u"||h.end!==r+n?r:o.start}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),this.trigger("error");return}const{hasAudio:s,hasVideo:r,isMuxed:n}=t,a=this.loaderType_==="main"&&r,o=!this.audioDisabled_&&s&&!n;if(e.waitingOnAppends=0,!e.hasAppendedData_){!e.timingInfo&&typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}a&&e.waitingOnAppends++,o&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),o&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=qb(this.loaderType_,this.getCurrentMediaInfo_(),e);return t?(this.error({message:t,playlistExclusionDuration:1/0}),this.trigger("error"),!0):!1}updateSourceBufferTimestampOffset_(e){if(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:s}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:t&&typeof t.transmuxedDecodeStart=="number"?t.transmuxedDecodeStart:s.start:s.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),r=this.loaderType_==="main"&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;r&&(e.timingInfo.end=typeof r.end=="number"?r.end:r.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){const u={segmentInfo:Gi({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:u})}if(!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});const t=Xb(e,this.sourceType_);if(t&&(t.severity==="warn"?M.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_(`Throwing away un-appended sync request ${Es(e)}`);return}this.logger_(`Appended ${Es(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const s=e.segment,r=e.part,n=s.end&&this.currentTime_()-s.end>e.playlist.targetDuration*3,a=r&&r.end&&this.currentTime_()-r.end>e.playlist.partTargetDuration*3;if(n||a){this.logger_(`bad ${n?"segment":"part"} ${Es(e)}`),this.resetEverything();return}this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duration<Gn){this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record ${Gn}`);return}const t=this.throughput.rate,s=Date.now()-e.endOfAllRequests+1,r=Math.floor(e.byteLength/s*8*1e3);this.throughput.rate+=(r-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;const t=e.segment,s=t.start,r=t.end;if(!qd(s)||!qd(r))return;Br(s,r,this.segmentMetadataTrack_);const n=x.WebKitDataCue||x.VTTCue,a={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,programDateTime:t.programDateTime,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:s,end:r},o=JSON.stringify(a),u=new n(s,r,o);u.value=a,this.segmentMetadataTrack_.addCue(u)}}function ui(){}const rm=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toUpperCase())},Kb=["video","audio"],bl=(i,e)=>{const t=e[`${i}Buffer`];return t&&t.updating||e.queuePending[i]},Yb=(i,e)=>{for(let t=0;t<e.length;t++){const s=e[t];if(s.type==="mediaSource")return null;if(s.type===i)return t}return null},Ns=(i,e)=>{if(e.queue.length===0)return;let t=0,s=e.queue[t];if(s.type==="mediaSource"){!e.updating()&&e.mediaSource.readyState!=="closed"&&(e.queue.shift(),s.action(e),s.doneFn&&s.doneFn(),Ns("audio",e),Ns("video",e));return}if(i!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||bl(i,e))){if(s.type!==i){if(t=Yb(i,e.queue),t===null)return;s=e.queue[t]}if(e.queue.splice(t,1),e.queuePending[i]=s,s.action(i,e),!s.doneFn){e.queuePending[i]=null,Ns(i,e);return}}},nm=(i,e)=>{const t=e[`${i}Buffer`],s=rm(i);t&&(t.removeEventListener("updateend",e[`on${s}UpdateEnd_`]),t.removeEventListener("error",e[`on${s}Error_`]),e.codecs[i]=null,e[`${i}Buffer`]=null)},Kt=(i,e)=>i&&e&&Array.prototype.indexOf.call(i.sourceBuffers,e)!==-1,bt={appendBuffer:(i,e,t)=>(s,r)=>{const n=r[`${s}Buffer`];if(Kt(r.mediaSource,n)){r.logger_(`Appending segment ${e.mediaIndex}'s ${i.length} bytes to ${s}Buffer`);try{n.appendBuffer(i)}catch(a){r.logger_(`Error with code ${a.code} `+(a.code===Rp?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${s}Buffer`),r.queuePending[s]=null,t(a)}}},remove:(i,e)=>(t,s)=>{const r=s[`${t}Buffer`];if(Kt(s.mediaSource,r)){s.logger_(`Removing ${i} to ${e} from ${t}Buffer`);try{r.remove(i,e)}catch{s.logger_(`Remove ${i} to ${e} from ${t}Buffer failed`)}}},timestampOffset:i=>(e,t)=>{const s=t[`${e}Buffer`];Kt(t.mediaSource,s)&&(t.logger_(`Setting ${e}timestampOffset to ${i}`),s.timestampOffset=i)},callback:i=>(e,t)=>{i()},endOfStream:i=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${i||""})`);try{e.mediaSource.endOfStream(i)}catch(t){M.log.warn("Failed to call media source endOfStream",t)}}},duration:i=>e=>{e.logger_(`Setting mediaSource duration to ${i}`);try{e.mediaSource.duration=i}catch(t){M.log.warn("Failed to set media source duration",t)}},abort:()=>(i,e)=>{if(e.mediaSource.readyState!=="open")return;const t=e[`${i}Buffer`];if(Kt(e.mediaSource,t)){e.logger_(`calling abort on ${i}Buffer`);try{t.abort()}catch(s){M.log.warn(`Failed to abort on ${i}Buffer`,s)}}},addSourceBuffer:(i,e)=>t=>{const s=rm(i),r=Ms(e);t.logger_(`Adding ${i}Buffer with codec ${e} to mediaSource`);const n=t.mediaSource.addSourceBuffer(r);n.addEventListener("updateend",t[`on${s}UpdateEnd_`]),n.addEventListener("error",t[`on${s}Error_`]),t.codecs[i]=e,t[`${i}Buffer`]=n},removeSourceBuffer:i=>e=>{const t=e[`${i}Buffer`];if(nm(i,e),!!Kt(e.mediaSource,t)){e.logger_(`Removing ${i}Buffer with codec ${e.codecs[i]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(s){M.log.warn(`Failed to removeSourceBuffer ${i}Buffer`,s)}}},changeType:i=>(e,t)=>{const s=t[`${e}Buffer`],r=Ms(i);if(!Kt(t.mediaSource,s))return;const n=i.substring(0,i.indexOf(".")),a=t.codecs[e];if(a.substring(0,a.indexOf("."))===n)return;const u={codecsChangeInfo:{from:a,to:i}};t.trigger({type:"codecschange",metadata:u}),t.logger_(`changing ${e}Buffer codec from ${a} to ${i}`);try{s.changeType(r),t.codecs[e]=i}catch(h){u.errorType=M.Error.StreamingCodecsChangeError,u.error=h,h.metadata=u,t.error_=h,t.trigger("error"),M.log.warn(`Failed to changeType on ${e}Buffer`,h)}}},St=({type:i,sourceUpdater:e,action:t,doneFn:s,name:r})=>{e.queue.push({type:i,action:t,doneFn:s,name:r}),Ns(i,e)},Vd=(i,e)=>t=>{const s=e[`${i}Buffered`](),r=u2(s);if(e.logger_(`received "updateend" event for ${i} Source Buffer: `,r),e.queuePending[i]){const n=e.queuePending[i].doneFn;e.queuePending[i]=null,n&&n(e[`${i}Error_`])}Ns(i,e)};class am extends M.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Ns("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=Lt("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=Vd("video",this),this.onAudioUpdateEnd_=Vd("audio",this),this.onVideoError_=t=>{this.videoError_=t},this.onAudioError_=t=>{this.audioError_=t},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){St({type:"mediaSource",sourceUpdater:this,action:bt.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){St({type:e,sourceUpdater:this,action:bt.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){M.log.error("removeSourceBuffer is not supported!");return}St({type:"mediaSource",sourceUpdater:this,action:bt.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!M.browser.IS_FIREFOX&&x.MediaSource&&x.MediaSource.prototype&&typeof x.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return x.SourceBuffer&&x.SourceBuffer.prototype&&typeof x.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){M.log.error("changeType is not supported!");return}St({type:e,sourceUpdater:this,action:bt.changeType(t),name:"changeType"})}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const s=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,s);this.canChangeType()&&this.changeType(t,s)})}appendBuffer(e,t){const{segmentInfo:s,type:r,bytes:n}=e;if(this.processedAppend_=!0,r==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${n.length} until video append`);return}const a=t;if(St({type:r,sourceUpdater:this,action:bt.appendBuffer(n,s||{mediaIndex:-1},a),doneFn:t,name:"appendBuffer"}),r==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const o=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${o.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,o.forEach(u=>{this.appendBuffer.apply(this,u)})}}audioBuffered(){return Kt(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Xe()}videoBuffered(){return Kt(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Xe()}buffered(){const e=Kt(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Kt(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():d2(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=ui){St({type:"mediaSource",sourceUpdater:this,action:bt.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=ui){typeof e!="string"&&(e=void 0),St({type:"mediaSource",sourceUpdater:this,action:bt.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,s=ui){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){s();return}St({type:"audio",sourceUpdater:this,action:bt.remove(e,t),doneFn:s,name:"remove"})}removeVideo(e,t,s=ui){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){s();return}St({type:"video",sourceUpdater:this,action:bt.remove(e,t),doneFn:s,name:"remove"})}updating(){return!!(bl("audio",this)||bl("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(St({type:"audio",sourceUpdater:this,action:bt.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(St({type:"video",sourceUpdater:this,action:bt.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&St({type:"audio",sourceUpdater:this,action:bt.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&St({type:"video",sourceUpdater:this,action:bt.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),Kb.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>nm(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const zd=i=>decodeURIComponent(escape(String.fromCharCode.apply(null,i))),Qb=i=>{const e=new Uint8Array(i);return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},Gd=new Uint8Array(` 215 216`.split("").map(i=>i.charCodeAt(0)));
216class Jb extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class Zb extends Tl{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return Xe();const e=this.subtitlesTrack_.cues,t=e[0].startTime,s=e[e.length-1].startTime;return Xe([[t,s]])}initSegmentForMap(e,t=!1){if(!e)return null;const s=va(e);let r=this.initSegments_[s];if(t&&!r&&e.bytes){const n=Gd.byteLength+e.bytes.byteLength,a=new Uint8Array(n);a.set(e.bytes),a.set(Gd,e.bytes.byteLength),this.initSegments_[s]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return typeof e>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(e,t){Br(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const t=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};this.syncController_.one("timestampoffset",t),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,s){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===Zt.TIMEOUT&&this.handleTimeout_(),e.code===Zt.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}const r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const n=r.segment;if(n.map&&(n.map.bytes=t.map.bytes),r.bytes=t.bytes,typeof x.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,s),()=>this.stopForError({message:"Error loading vtt.js"}));return}n.requested=!0;try{this.parseVTTCues_(r)}catch(a){this.stopForError({message:a.message,metadata:{errorType:M.Error.StreamingVttParserError,error:a}});return}if(this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=n.duration,r.cues.forEach(a=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new x.VTTCue(a.startTime,a.endTime,a.text):a)}),Rb(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(e){let t,s=!1;if(typeof x.WebVTT!="function")throw new Jb;typeof x.TextDecoder=="function"?t=new x.TextDecoder("utf8"):(t=x.WebVTT.StringDecoder(),s=!0);const r=new x.WebVTT.Parser(x,x.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=a=>{e.timestampmap=a},r.onparsingerror=a=>{M.log.warn("Error encountered when parsing cues: "+a.message)},e.segment.map){let a=e.segment.map.bytes;s&&(a=zd(a)),r.parse(a)}let n=e.bytes;s&&(n=zd(n)),r.parse(n),r.flush()}
vendor: 25,775 bytes, lines 216-219
216updateTimeMapping_(e,t,s){const r=e.segment;if(!t)return;if(!e.cues.length){r.empty=!0;return}const{MPEGTS:n,LOCAL:a}=e.timestampmap,u=n/Wi.ONE_SECOND_IN_TS-a+t.mapping;if(e.cues.forEach(h=>{const m=h.endTime-h.startTime,_=this.handleRollover_(h.startTime+u,t.time);h.startTime=Math.max(_,0),h.endTime=Math.max(_+m,0)}),!s.syncInfo){const h=e.cues[0].startTime,m=e.cues[e.cues.length-1].startTime;s.syncInfo={mediaSequence:s.mediaSequence+e.mediaIndex,time:Math.min(h,m-r.duration)}}}handleRollover_(e,t){if(t===null)return e;let s=e*Wi.ONE_SECOND_IN_TS;const r=t*Wi.ONE_SECOND_IN_TS;let n;for(r<s?n=-8589934592:n=8589934592;Math.abs(s-r)>4294967296;)s+=n;return s/Wi.ONE_SECOND_IN_TS}}const e1=function(i,e){const t=i.cues;for(let s=0;s<t.length;s++){const r=t[s];if(e>=r.adStartTime&&e<=r.adEndTime)return r}return null},t1=function(i,e,t=0){if(!i.segments)return;let s=t,r;for(let n=0;n<i.segments.length;n++){const a=i.segments[n];if(r||(r=e1(e,s+a.duration/2)),r){if("cueIn"in a){r.endTime=s,r.adEndTime=s,s+=a.duration,r=null;continue}if(s<r.endTime){s+=a.duration;continue}r.endTime+=a.duration}else if("cueOut"in a&&(r=new x.VTTCue(s,s+a.duration,a.cueOut),r.adStartTime=s,r.adEndTime=s+parseFloat(a.cueOut),e.addCue(r)),"cueOutCont"in a){const[o,u]=a.cueOutCont.split("/").map(parseFloat);r=new x.VTTCue(s,s+a.duration,""),r.adStartTime=s-o,r.adEndTime=r.adStartTime+u,e.addCue(r)}s+=a.duration}};class Wd{constructor({start:e,end:t,segmentIndex:s,partIndex:r=null,appended:n=!1}){this.start_=e,this.end_=t,this.segmentIndex_=s,this.partIndex_=r,this.appended_=n}isInRange(e){return e>=this.start&&e<this.end}markAppended(){this.appended_=!0}resetAppendedStatus(){this.appended_=!1}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}}class i1{constructor(e,t=[]){this.segmentSyncInfo_=e,this.partsSyncInfo_=t}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class om{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){const{mediaSequence:s,segments:r}=e;if(this.isReliable_=this.isReliablePlaylist_(s,r),!!this.isReliable_)return this.updateStorage_(r,s,this.calculateBaseTime_(s,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:s}of this.storage_.values())if(s.length){for(const r of s)if(r.isInRange(e))return r}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,s){const r=new Map;let n=` 217`,a=s,o=t;this.start_=a,e.forEach((u,h)=>{const m=this.storage_.get(o),_=a,T=_+u.duration,E=!!(m&&m.segmentSyncInfo&&m.segmentSyncInfo.isAppended),A=new Wd({start:_,end:T,appended:E,segmentIndex:h});u.syncInfo=A;let y=a;const w=(u.parts||[]).map((D,N)=>{const O=y,B=y+D.duration,I=!!(m&&m.partsSyncInfo&&m.partsSyncInfo[N]&&m.partsSyncInfo[N].isAppended),$=new Wd({start:O,end:B,appended:I,segmentIndex:h,partIndex:N});return y=B,n+=`Media Sequence: ${o}.${N} | Range: ${O} --> ${B} | Appended: ${I} 218`,D.syncInfo=$,$});r.set(o,new i1(A,w)),n+=`${sm(u.resolvedUri)} | Media Sequence: ${o} | Range: ${_} --> ${T} | Appended: ${E} 219`,o++,a=T}),this.end_=a,this.storage_=r,this.diagnostics_=n}calculateBaseTime_(e,t){return this.storage_.size?this.storage_.has(e)?this.storage_.get(e).segmentSyncInfo.start:t:0}isReliablePlaylist_(e,t){return e!=null&&Array.isArray(t)&&t.length}}class Xd extends om{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t){if(!this.storage_.size){const s=this.parent_.getSyncInfoForMediaSequence(e);return s?s.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t)}}const s1=86400,Wo=[{name:"VOD",run:(i,e,t,s,r)=>t!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(i,e,t,s,r,n)=>{const a=i.getMediaSequenceSync(n);if(!a||!a.isReliable)return null;const o=a.getSyncInfoForTime(r);return o?{time:o.start,partIndex:o.partIndex,segmentIndex:o.segmentIndex}:null}},{name:"ProgramDateTime",run:(i,e,t,s,r)=>{if(!Object.keys(i.timelineToDatetimeMappings).length)return null;let n=null,a=null;const o=dl(e);r=r||0;for(let u=0;u<o.length;u++){const h=e.endList||r===0?u:o.length-(u+1),m=o[h],_=m.segment,T=i.timelineToDatetimeMappings[_.timeline];if(!T||!_.dateTimeObject)continue;let A=_.dateTimeObject.getTime()/1e3+T;if(_.parts&&typeof m.partIndex=="number")for(let w=0;w<m.partIndex;w++)A+=_.parts[w].duration;const y=Math.abs(r-A);if(a!==null&&(y===0||a<y))break;a=y,n={time:A,segmentIndex:m.segmentIndex,partIndex:m.partIndex}}return n}},{name:"Segment",run:(i,e,t,s,r)=>{let n=null,a=null;r=r||0;const o=dl(e);for(let u=0;u<o.length;u++){const h=e.endList||r===0?u:o.length-(u+1),m=o[h],_=m.segment,T=m.part&&m.part.start||_&&_.start;if(_.timeline===s&&typeof T<"u"){const E=Math.abs(r-T);if(a!==null&&a<E)break;(!n||a===null||a>=E)&&(a=E,n={time:T,segmentIndex:m.segmentIndex,partIndex:m.partIndex})}}return n}},{name:"Discontinuity",run:(i,e,t,s,r)=>{let n=null;if(r=r||0,e.discontinuityStarts&&e.discontinuityStarts.length){let a=null;for(let o=0;o<e.discontinuityStarts.length;o++){const u=e.discontinuityStarts[o],h=e.discontinuitySequence+o+1,m=i.discontinuities[h];if(m){const _=Math.abs(r-m.time);if(a!==null&&a<_)break;(!n||a===null||a>=_)&&(a=_,n={time:m.time,segmentIndex:u,partIndex:null})}}}return n}},{name:"Playlist",run:(i,e,t,s,r)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];class r1 extends M.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new om,s=new Xd(t),r=new Xd(t);this.mediaSequenceStorage_={main:t,audio:s,vtt:r},this.logger_=Lt("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,s,r,n){if(t!==1/0)return Wo.find(({name:u})=>u==="VOD").run(this,e,t);const a=this.runStrategies_(e,t,s,r,n);if(!a.length)return null;for(const o of a){const{syncPoint:u,strategy:h}=o,{segmentIndex:m,time:_}=u;if(m<0)continue;const T=e.segments[m],E=_,A=E+T.duration;if(this.logger_(`Strategy: ${h}. Current time: ${r}. selected segment: ${m}. Time: [${E} -> ${A}]}`),r>=E&&r<A)return this.logger_("Found sync point with exact match: ",u),u}return this.selectSyncPoint_(a,{key:"time",value:r})}getExpiredTime(e,t){if(!e||!e.segments)return null;const s=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!s.length)return null;const r=this.selectSyncPoint_(s,{key:"segmentIndex",value:0});return r.segmentIndex>0&&(r.time*=-1),Math.abs(r.time+Hr({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,s,r,n){const a=[];for(let o=0;o<Wo.length;o++){const u=Wo[o],h=u.run(this,e,t,s,r,n);h&&(h.strategy=u.name,a.push({strategy:u.name,syncPoint:h}))}return a}selectSyncPoint_(e,t){let s=e[0].syncPoint,r=Math.abs(e[0].syncPoint[t.key]-t.value),n=e[0].strategy;for(let a=1;a<e.length;a++){const o=Math.abs(e[a].syncPoint[t.key]-t.value);o<r&&(r=o,s=e[a].syncPoint,n=e[a].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${n}]: [time:${s.time}, segmentIndex:${s.segmentIndex}`+(typeof s.partIndex=="number"?`,partIndex:${s.partIndex}`:"")+"]"),s}saveExpiredSegmentInfo(e,t){const s=t.mediaSequence-e.mediaSequence;if(s>s1){M.log.warn(`Not saving expired segment info. Media sequence gap ${s} is too large.`);return}for(let r=s-1;r>=0;r--){const n=e.segments[r];if(n&&typeof n.start<"u"){t.syncInfo={mediaSequence:e.mediaSequence+r,time:n.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],s=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-s}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const s=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;s&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));const n=r.dateTimeObject;r.discontinuity&&t&&n&&(this.timelineToDatetimeMappings[r.timeline]=-(n.getTime()/1e3))}timestampOffsetForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time}mappingForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,s){const r=e.segment,n=e.part;let a=this.timelines[e.timeline],o,u;if(typeof e.timestampOffset=="number")a={time:e.startOfSegment,mapping:e.startOfSegment-t.start},s&&(this.timelines[e.timeline]=a,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${a.time}] [mapping: ${a.mapping}]`)),o=e.startOfSegment,u=t.end+a.mapping;else if(a)o=t.start+a.mapping,u=t.end+a.mapping;else return!1;return n&&(n.start=o,n.end=u),(!r.start||o<r.start)&&(r.start=o),r.end=u,!0}saveDiscontinuitySyncInfo_(e){const t=e.playlist,s=e.segment;if(s.discontinuity)this.discontinuities[s.timeline]={time:s.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let r=0;r<t.discontinuityStarts.length;r++){const n=t.discontinuityStarts[r],a=t.discontinuitySequence+r+1,o=n-e.mediaIndex,u=Math.abs(o);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>u){let h;o<0?h=s.start-Hr({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):h=s.end+Hr({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n}),this.discontinuities[a]={time:h,accuracy:u}}}}dispose(){this.trigger("dispose"),this.off()}}class n1 extends M.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:s}){return typeof t=="number"&&typeof s=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:s},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:s}){if(typeof t=="number"&&typeof s=="number"){this.lastTimelineChanges_[e]={type:e,from:t,to:s},delete this.pendingTimelineChanges_[e];const r={timelineChangeInfo:{from:t,to:s}};this.trigger({type:"timelinechange",metadata:r})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const a1=Gp(Wp(function(){var i=function(){function y(){this.listeners={}}var w=y.prototype;return w.on=function(N,O){this.listeners[N]||(this.listeners[N]=[]),this.listeners[N].push(O)},w.off=function(N,O){if(!this.listeners[N])return!1;var B=this.listeners[N].indexOf(O);return this.listeners[N]=this.listeners[N].slice(0),this.listeners[N].splice(B,1),B>-1},w.trigger=function(N){var O=this.listeners[N];if(O)if(arguments.length===2)for(var B=O.length,I=0;I<B;++I)O[I].call(this,arguments[1]);else for(var $=Array.prototype.slice.call(arguments,1),X=O.length,K=0;K<X;++K)O[K].apply(this,$)},w.dispose=function(){this.listeners={}},w.pipe=function(N){this.on("data",function(O){N.push(O)})},y}();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function e(y){return y.subarray(0,y.byteLength-y[y.byteLength-1])}/*! @name aes-decrypter @version 4.0.2 @license Apache-2.0 */const t=function(){const y=[[[],[],[],[],[]],[[],[],[],[],[]]],w=y[0],D=y[1],N=w[4],O=D[4];let B,I,$;const X=[],K=[];let re,xe,ue,ge,ee,he;for(B=0;B<256;B++)K[(X[B]=B<<1^(B>>7)*283)^B]=B;for(I=$=0;!N[I];I^=re||1,$=K[$]||1)for(ge=$^$<<1^$<<2^$<<3^$<<4,ge=ge>>8^ge&255^99,N[I]=ge,O[ge]=I,ue=X[xe=X[re=X[I]]],he=ue*16843009^xe*65537^re*257^I*16843008,ee=X[ge]*257^ge*16843008,B=0;B<4;B++)w[B][I]=ee=ee<<24^ee>>>8,D[B][ge]=he=he<<24^he>>>8;for(B=0;B<5;B++)w[B]=w[B].slice(0),D[B]=D[B].slice(0);return y};let s=null;class r{constructor(w){s||(s=t()),this._tables=[[s[0][0].slice(),s[0][1].slice(),s[0][2].slice(),s[0][3].slice(),s[0][4].slice()],[s[1][0].slice(),s[1][1].slice(),s[1][2].slice(),s[1][3].slice(),s[1][4].slice()]];let D,N,O;const B=this._tables[0][4],I=this._tables[1],$=w.length;let X=1;if($!==4&&$!==6&&$!==8)throw new Error("Invalid aes key size");const K=w.slice(0),re=[];for(this._key=[K,re],D=$;D<4*$+28;D++)O=K[D-1],(D%$===0||$===8&&D%$===4)&&(O=B[O>>>24]<<24^B[O>>16&255]<<16^B[O>>8&255]<<8^B[O&255],D%$===0&&(O=O<<8^O>>>24^X<<24,X=X<<1^(X>>7)*283)),K[D]=K[D-$]^O;for(N=0;D;N++,D--)O=K[N&3?D:D-4],D<=4||N<4?re[N]=O:re[N]=I[0][B[O>>>24]]^I[1][B[O>>16&255]]^I[2][B[O>>8&255]]^I[3][B[O&255]]}decrypt(w,D,N,O,B,I){const $=this._key[1];let X=w^$[0],K=O^$[1],re=N^$[2],xe=D^$[3],ue,ge,ee;const he=$.length/4-2;let Re,ce=4;const Ie=this._tables[1],Ke=Ie[0],At=Ie[1],it=Ie[2],ct=Ie[3],qt=Ie[4];for(Re=0;Re<he;Re++)ue=Ke[X>>>24]^At[K>>16&255]^it[re>>8&255]^ct[xe&255]^$[ce],ge=Ke[K>>>24]^At[re>>16&255]^it[xe>>8&255]^ct[X&255]^$[ce+1],ee=Ke[re>>>24]^At[xe>>16&255]^it[X>>8&255]^ct[K&255]^$[ce+2],xe=Ke[xe>>>24]^At[X>>16&255]^it[K>>8&255]^ct[re&255]^$[ce+3],ce+=4,X=ue,K=ge,re=ee;for(Re=0;Re<4;Re++)B[(3&-Re)+I]=qt[X>>>24]<<24^qt[K>>16&255]<<16^qt[re>>8&255]<<8^qt[xe&255]^$[ce++],ue=X,X=K,K=re,re=xe,xe=ue}}class n extends i{constructor(){super(i),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(w){this.jobs.push(w),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const a=function(y){return y<<24|(y&65280)<<8|(y&16711680)>>8|y>>>24},o=function(y,w,D){const N=new Int32Array(y.buffer,y.byteOffset,y.byteLength>>2),O=new r(Array.prototype.slice.call(w)),B=new Uint8Array(y.byteLength),I=new Int32Array(B.buffer);let $,X,K,re,xe,ue,ge,ee,he;for($=D[0],X=D[1],K=D[2],re=D[3],he=0;he<N.length;he+=4)xe=a(N[he]),ue=a(N[he+1]),ge=a(N[he+2]),ee=a(N[he+3]),O.decrypt(xe,ue,ge,ee,I,he),I[he]=a(I[he]^$),I[he+1]=a(I[he+1]^X),I[he+2]=a(I[he+2]^K),I[he+3]=a(I[he+3]^re),$=xe,X=ue,K=ge,re=ee;return B};class u{constructor(w,D,N,O){const B=u.STEP,I=new Int32Array(w.buffer),$=new Uint8Array(w.byteLength);let X=0;for(this.asyncStream_=new n,this.asyncStream_.push(this.decryptChunk_(I.subarray(X,X+B),D,N,$)),X=B;X<I.length;X+=B)N=new Uint32Array([a(I[X-4]),a(I[X-3]),a(I[X-2]),a(I[X-1])]),this.asyncStream_.push(this.decryptChunk_(I.subarray(X,X+B),D,N,$));this.asyncStream_.push(function(){O(null,e($))})}static get STEP(){return 32e3}decryptChunk_(w,D,N,O){return function(){const B=o(w,D,N);O.set(B,w.byteOffset)}}}var h=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},m;typeof window<"u"?m=window:typeof h<"u"?m=h:typeof self<"u"?m=self:m={};var _=m,T=function(w){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(w):w&&w.buffer instanceof ArrayBuffer},E=_.BigInt||Number;E("0x1"),E("0x100"),E("0x10000"),E("0x1000000"),E("0x100000000"),E("0x10000000000"),E("0x1000000000000"),E("0x100000000000000"),E("0x10000000000000000"),function(){var y=new Uint16Array([65484]),w=new Uint8Array(y.buffer,y.byteOffset,y.byteLength);return w[0]===255?"big":w[0]===204?"little":"unknown"}();const A=function(y){const w={};return Object.keys(y).forEach(D=>{const N=y[D];T(N)?w[D]={bytes:N.buffer,byteOffset:N.byteOffset,byteLength:N.byteLength}:w[D]=N}),w};self.onmessage=function(y){const w=y.data,D=new Uint8Array(w.encrypted.bytes,w.encrypted.byteOffset,w.encrypted.byteLength),N=new Uint32Array(w.key.bytes,w.key.byteOffset,w.key.byteLength/4),O=new Uint32Array(w.iv.bytes,w.iv.byteOffset,w.iv.byteLength/4);new u(D,N,O,function(B,I){self.postMessage(A({source:w.source,decrypted:I}),[I.buffer])})}}));var o1=zp(a1);const l1=i=>{let e=i.default?"main":"alternative";return i.characteristics&&i.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},lm=(i,e)=>{i.abort(),i.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},Sl=(i,e)=>{e.activePlaylistLoader=i,i.load()},u1=(i,e)=>()=>{const{segmentLoaders:{[i]:t,main:s},mediaTypes:{[i]:r}}=e,n=r.activeTrack(),a=r.getActiveGroup(),o=r.activePlaylistLoader,u=r.lastGroup_;if(!(a&&u&&a.id===u.id)&&(r.lastGroup_=a,r.lastTrack_=n,lm(t,r),!(!a||a.isMainPlaylist))){if(!a.playlistLoader){o&&s.resetEverything();return}t.resyncLoader(),Sl(a.playlistLoader,r)}},c1=(i,e)=>()=>{const{segmentLoaders:{[i]:t},mediaTypes:{[i]:s}}=e;s.lastGroup_=null,t.abort(),t.pause()},d1=(i,e)=>()=>{const{mainPlaylistLoader:t,segmentLoaders:{[i]:s,main:r},mediaTypes:{[i]:n}}=e,a=n.activeTrack(),o=n.getActiveGroup(),u=n.activePlaylistLoader,h=n.lastTrack_;if(!(h&&a&&h.id===a.id)&&(n.lastGroup_=o,n.lastTrack_=a,lm(s,n),!!o)){if(o.isMainPlaylist){if(!a||!h||a.id===h.id)return;const m=e.vhs.playlistController_,_=m.selectPlaylist();if(m.media()===_)return;n.logger_(`track change. Switching main audio from ${h.id} to ${a.id}`),t.pause(),r.resetEverything(),m.fastQualityChange_(_);return}if(i==="AUDIO"){if(!o.playlistLoader){r.setAudio(!0),r.resetEverything();return}s.setAudio(!0),r.setAudio(!1)}if(u===o.playlistLoader){Sl(o.playlistLoader,n);return}s.track&&s.track(a),s.resetEverything(),Sl(o.playlistLoader,n)}},Sa={AUDIO:(i,e)=>()=>{const{mediaTypes:{[i]:t},excludePlaylist:s}=e,r=t.activeTrack(),n=t.activeGroup(),a=(n.filter(u=>u.default)[0]||n[0]).id,o=t.tracks[a];if(r===o){s({error:{message:"Problem encountered loading the default audio track."}});return}M.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const u in t.tracks)t.tracks[u].enabled=t.tracks[u]===o;t.onTrackChanged()},SUBTITLES:(i,e)=>()=>{const{mediaTypes:{[i]:t}}=e;M.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const s=t.activeTrack();s&&(s.mode="disabled"),t.onTrackChanged()}},Kd={AUDIO:(i,e,t)=>{if(!e)return;const{tech:s,requestOptions:r,segmentLoaders:{[i]:n}}=t;e.on("loadedmetadata",()=>{const a=e.media();n.playlist(a,r),(!s.paused()||a.endList&&s.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),s.paused()||n.load()}),e.on("error",Sa[i](i,t))},SUBTITLES:(i,e,t)=>{const{tech:s,requestOptions:r,segmentLoaders:{[i]:n},mediaTypes:{[i]:a}}=t;e.on("loadedmetadata",()=>{const o=e.media();n.playlist(o,r),n.track(a.activeTrack()),(!s.paused()||o.endList&&s.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),s.paused()||n.load()}),e.on("error",Sa[i](i,t))}},h1={AUDIO:(i,e)=>{const{vhs:t,sourceType:s,segmentLoaders:{[i]:r},requestOptions:n,main:{mediaGroups:a},mediaTypes:{[i]:{groups:o,tracks:u,logger_:h}},mainPlaylistLoader:m}=e,_=un(m.main);(!a[i]||Object.keys(a[i]).length===0)&&(a[i]={main:{default:{default:!0}}},_&&(a[i].main.default.playlists=m.main.playlists));for(const T in a[i]){o[T]||(o[T]=[]);for(const E in a[i][T]){let A=a[i][T][E],y;if(_?(h(`AUDIO group '${T}' label '${E}' is a main playlist`),A.isMainPlaylist=!0,y=null):s==="vhs-json"&&A.playlists?y=new Ds(A.playlists[0],t,n):A.resolvedUri?y=new Ds(A.resolvedUri,t,n):A.playlists&&s==="dash"?y=new _l(A.playlists[0],t,n,m):y=null,A=Te({id:E,playlistLoader:y},A),Kd[i](i,A.playlistLoader,e),o[T].push(A),typeof u[E]>"u"){const w=new M.AudioTrack({id:E,kind:l1(A),enabled:!1,language:A.language,default:A.default,label:E});u[E]=w}}}r.on("error",Sa[i](i,e))},SUBTITLES:(i,e)=>{const{tech:t,vhs:s,sourceType:r,segmentLoaders:{[i]:n},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[i]:{groups:u,tracks:h}},mainPlaylistLoader:m}=e;for(const _ in o[i]){u[_]||(u[_]=[]);for(const T in o[i][_]){if(!s.options_.useForcedSubtitles&&o[i][_][T].forced)continue;let E=o[i][_][T],A;if(r==="hls")A=new Ds(E.resolvedUri,s,a);else if(r==="dash"){if(!E.playlists.filter(w=>w.excludeUntil!==1/0).length)return;A=new _l(E.playlists[0],s,a,m)}else r==="vhs-json"&&(A=new Ds(E.playlists?E.playlists[0]:E.resolvedUri,s,a));if(E=Te({id:T,playlistLoader:A},E),Kd[i](i,E.playlistLoader,e),u[_].push(E),typeof h[T]>"u"){const y=t.addRemoteTextTrack({id:T,kind:"subtitles",default:E.default&&E.autoselect,language:E.language,label:T},!1).track;h[T]=y}}}n.on("error",Sa[i](i,e))},"CLOSED-CAPTIONS":(i,e)=>{const{tech:t,main:{mediaGroups:s},mediaTypes:{[i]:{groups:r,tracks:n}}}=e;for(const a in s[i]){r[a]||(r[a]=[]);for(const o in s[i][a]){const u=s[i][a][o];if(!/^(?:CC|SERVICE)/.test(u.instreamId))continue;const h=t.options_.vhs&&t.options_.vhs.captionServices||{};let m={label:o,language:u.language,instreamId:u.instreamId,default:u.default&&u.autoselect};if(h[m.instreamId]&&(m=Te(m,h[m.instreamId])),m.default===void 0&&delete m.default,r[a].push(Te({id:o},u)),typeof n[o]>"u"){const _=t.addRemoteTextTrack({id:m.instreamId,kind:"captions",default:m.default,language:m.language,label:m.label},!1).track;n[o]=_}}}}},um=(i,e)=>{for(let t=0;t<i.length;t++)if(xu(e,i[t])||i[t].playlists&&um(i[t].playlists,e))return!0;return!1},f1=(i,e)=>t=>{const{mainPlaylistLoader:s,mediaTypes:{[i]:{groups:r}}}=e,n=s.media();if(!n)return null;let a=null;n.attributes[i]&&(a=r[n.attributes[i]]);const o=Object.keys(r);if(!a)if(i==="AUDIO"&&o.length>1&&un(e.main))for(let u=0;u<o.length;u++){const h=r[o[u]];if(um(h,n)){a=h;break}}else r.main?a=r.main:o.length===1&&(a=r[o[0]]);return typeof t>"u"?a:t===null||!a?null:a.filter(u=>u.id===t.id)[0]||null},p1={AUDIO:(i,e)=>()=>{const{mediaTypes:{[i]:{tracks:t}}}=e;for(const s in t)if(t[s].enabled)return t[s];return null},SUBTITLES:(i,e)=>()=>{const{mediaTypes:{[i]:{tracks:t}}}=e;for(const s in t)if(t[s].mode==="showing"||t[s].mode==="hidden")return t[s];return null}},m1=(i,{mediaTypes:e})=>()=>{const t=e[i].activeTrack();return t?e[i].activeGroup(t):null},g1=i=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(h=>{h1[h](h,i)});const{mediaTypes:e,mainPlaylistLoader:t,tech:s,vhs:r,segmentLoaders:{["AUDIO"]:n,main:a}}=i;["AUDIO","SUBTITLES"].forEach(h=>{e[h].activeGroup=f1(h,i),e[h].activeTrack=p1[h](h,i),e[h].onGroupChanged=u1(h,i),e[h].onGroupChanging=c1(h,i),e[h].onTrackChanged=d1(h,i),e[h].getActiveGroup=m1(h,i)});const o=e.AUDIO.activeGroup();if(o){const h=(o.filter(_=>_.default)[0]||o[0]).id;e.AUDIO.tracks[h].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),n.setAudio(!0)):a.setAudio(!0)}t.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(h=>e[h].onGroupChanged())}),t.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(h=>e[h].onGroupChanging())});const u=()=>{e.AUDIO.onTrackChanged(),s.trigger({type:"usage",name:"vhs-audio-change"})};s.audioTracks().addEventListener("change",u),s.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),r.on("dispose",()=>{s.audioTracks().removeEventListener("change",u),s.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),s.clearTracks("audio");for(const h in e.AUDIO.tracks)s.audioTracks().addTrack(e.AUDIO.tracks[h])},_1=()=>{const i={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{i[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:ui,activeTrack:ui,getActiveGroup:ui,onGroupChanged:ui,onTrackChanged:ui,lastTrack_:null,logger_:Lt(`MediaGroups[${e}]`)}}),i};class Yd{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=mt(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(t=>[t.ID,t])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class y1 extends M.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new Yd,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=Lt("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const s=t.serverUri||t.serverURL;if(!s){this.logger_(`steering manifest URL is ${s}, cannot request steering manifest.`),this.trigger("error");return}if(s.startsWith("data:")){this.decodeDataUriManifest_(s.substring(s.indexOf(",")+1));return}this.steeringManifest.reloadUri=mt(e,s),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const s=e?t:this.getRequestURI(t);if(!s){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}const r={contentSteeringInfo:{uri:s}};this.trigger({type:"contentsteeringloadstart",metadata:r}),this.request_=this.xhr_({uri:s,requestType:"content-steering-manifest"},(n,a)=>
219{if(n){if(a.status===410){this.logger_(`manifest request 410 ${n}.`),this.logger_(`There will be no more content steering requests to ${s} this session.`),this.excludedSteeringManifestURLs.add(s);return}if(a.status===429){const h=a.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${n}.`),this.logger_(`content steering will retry in ${h} seconds.`),this.startTTLTimeout_(parseInt(h,10));return}this.logger_(`manifest failed to load ${n}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:r});let o;try{o=JSON.parse(this.request_.responseText)}catch(h){const m={errorType:M.Error.StreamingContentSteeringParserError,error:h};this.trigger({type:"error",metadata:m})}this.assignSteeringProperties_(o);const u={contentSteeringInfo:r.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:u}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new x.URL(e),s=new x.URL(this.proxyServerUrl_);return s.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(s.toString())}decodeDataUriManifest_(e){const t=JSON.parse(x.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new x.URL(e),s=this.getPathway(),r=this.getBandwidth_();if(s){const n=`_${this.manifestType_}_pathway`;t.searchParams.set(n,s)}if(r){const n=`_${this.manifestType_}_throughput`;t.searchParams.set(n,r)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const s=(r=>{for(const n of r)if(this.availablePathways_.has(n))return n;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==s&&(this.currentPathway=s,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=r=>this.excludedSteeringManifestURLs.has(r);if(this.proxyServerUrl_){const r=this.setProxyServerUrl_(e);if(!t(r))return r}const s=this.setSteeringParams_(e);return t(s)?null:s}startTTLTimeout_(e=this.steeringManifest.ttl){const t=e*1e3;this.ttlTimeout_=x.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){x.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new Yd}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(mt(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const v1=10;let oi;const T1=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],b1=function(i){return this.audioSegmentLoader_[i]+this.mainSegmentLoader_[i]},S1=function({currentPlaylist:i,buffered:e,currentTime:t,nextPlaylist:s,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:a,bufferBasedABR:o,log:u}){if(!s)return M.log.warn("We received no playlist to switch to. Please check your stream."),!1;const h=`allowing switch ${i&&i.id||"null"} -> ${s.id}`;if(!i)return u(`${h} as current playlist is not set`),!0;if(s.id===i.id)return!1;const m=!!ws(e,t).length;if(!i.endList)return!m&&typeof i.partTargetDuration=="number"?(u(`not ${h} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(u(`${h} as current playlist is live`),!0);const _=Tu(e,t),T=o?Ve.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Ve.MAX_BUFFER_LOW_WATER_LINE;if(a<T)return u(`${h} as duration < max low water line (${a} < ${T})`),!0;const E=s.attributes.BANDWIDTH,A=i.attributes.BANDWIDTH;if(E<A&&(!o||_<n)){let y=`${h} as next bandwidth < current bandwidth (${E} < ${A})`;return o&&(y+=` and forwardBuffer < bufferHighWaterLine (${_} < ${n})`),u(y),!0}if((!o||E>A)&&_>=r){let y=`${h} as forwardBuffer >= bufferLowWaterLine (${_} >= ${r})`;return o&&(y+=` and next bandwidth > current bandwidth (${E} > ${A})`),u(y),!0}return u(`not ${h} as no switching criteria met`),!1};class x1 extends M.EventTarget{constructor(e){super();const{src:t,withCredentials:s,tech:r,bandwidth:n,externVhs:a,useCueTags:o,playlistExclusionDuration:u,enableLowInitialPlaylist:h,sourceType:m,cacheEncryptionKeys:_,bufferBasedABR:T,leastPixelDiffSelector:E,captionServices:A,experimentalUseMMS:y}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:w}=e;(w===null||typeof w>"u")&&(w=1/0),oi=a,this.bufferBasedABR=!!T,this.leastPixelDiffSelector=!!E,this.withCredentials=s,this.tech_=r,this.vhs_=r.vhs,this.player_=e.player_,this.sourceType_=m,this.useCueTags_=o,this.playlistExclusionDuration=u,this.maxPlaylistRetries=w,this.enableLowInitialPlaylist=h,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:s,maxPlaylistRetries:w,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=_1(),y&&x.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new x.ManagedMediaSource,M.log("Using ManagedMediaSource")):x.MediaSource&&(this.mediaSource=new x.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.seekable_=Xe(),this.hasPlayed_=!1,this.syncController_=new r1(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new o1,this.sourceUpdater_=new am(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new n1,this.keyStatusMap_=new Map;const D={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:A,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:n,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:_,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new _l(t,this.vhs_,Te(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new Ds(t,this.vhs_,Te(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Tl(Te(D,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new Tl(Te(D,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new Zb(Te(D,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((B,I)=>{function $(){r.off("vttjserror",X),B()}function X(){r.off("vttjsloaded",$),I()}r.one("vttjsloaded",$),r.one("vttjserror",X),r.addWebVttScript_()})}),e);const N=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new y1(this.vhs_.xhr,N),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>
vendor: 15,363 bytes, line 219
219this.startABRTimer_())),T1.forEach(B=>{this[B+"_"]=b1.bind(this,B)}),this.logger_=Lt("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const O=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(O,()=>{const B=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-B,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return e===-1||t===-1?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,s){const r=this.media(),n=r&&(r.id||r.uri),a=e&&(e.id||e.uri);if(n&&n!==a){this.logger_(`switch media ${n} -> ${a} from ${t}`);const o={renditionInfo:{id:a,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:o}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,s)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e],s=t?t.activeGroup():null,r=this.contentSteeringController_.getPathway();if(s&&r){const a=(s.length?s[0].playlists:s.playlists).filter(o=>o.attributes.serviceLocation===r);a.length&&this.mediaTypes_[e].activePlaylistLoader.media(a[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=x.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(x.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const s=e.mediaGroups.AUDIO,r=Object.keys(s);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{const o=s.main||r.length&&s[r[0]];for(const u in o)if(o[u].default){n={label:u};break}}if(!n)return t;const a=[];for(const o in s)if(s[o][n.label]){const u=s[o][n.label];if(u.playlists&&u.playlists.length)a.push.apply(a,u.playlists);else if(u.uri)a.push(u);else if(e.playlists.length)for(let h=0;h<e.playlists.length;h++){const m=e.playlists[h];m.attributes&&m.attributes.AUDIO&&m.attributes.AUDIO===o&&a.push(m)}}return a.length?a:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const t=this.mainPlaylistLoader_.media(),s=t.targetDuration*1.5*1e3;hl(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=s,t.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.mainSegmentLoader_.load()),g1({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),t),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let t=this.mainPlaylistLoader_.media();if(!t){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let s;if(this.enableLowInitialPlaylist&&(s=this.selectInitialPlaylist()),s||(s=this.selectPlaylist()),!s||!this.shouldSwitchToMedia_(s)||(this.initialMedia_=s,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;t=this.initialMedia_}this.handleUpdatedMediaPlaylist(t)}),this.mainPlaylistLoader_.on("error",()=>{const t=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:t.playlist,error:t})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const t=this.mainPlaylistLoader_.media(),s=t.targetDuration*1.5*1e3;hl(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=s,this.sourceType_==="dash"&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const t=this.mainPlaylistLoader_.media();if(t.lastExcludeReason_==="playlist-unchanged")return;this.stuckAtPlaylistEnd_(t)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(t=>{this.mainPlaylistLoader_.on(t,s=>{this.player_.trigger(Me({},s))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const s=e.mediaGroups||{};let r=!0;const n=Object.keys(s.AUDIO);for(const a in s.AUDIO)for(const o in s.AUDIO[a])s.AUDIO[a][o].uri||(r=!1);r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(s.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),oi.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),n.length&&Object.keys(s.AUDIO[n[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,s=this.tech_.currentTime(),r=this.bufferLowWaterLine(),n=this.bufferHighWaterLine(),a=this.tech_.buffered();return S1({buffered:a,currentTime:s,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const s=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:s.playlist,error:s})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const s=this.audioSegmentLoader_.pendingSegment_;if(!s||!s.segment||!s.segment.syncInfo)return;const r=s.segment.syncInfo.end+.01;this.tech_.setCurrentTime(r)}),this.mainSegmentLoader_.on("earlyabort",s=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:v1}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const s=this.getCodecsOrExclude_();s&&this.sourceUpdater_.addOrChangeSourceBuffers(s)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(s=>{this.mainSegmentLoader_.on(s,r=>{this.player_.trigger(Me({},r))}),this.audioSegmentLoader_.on(s,r=>{this.player_.trigger(Me({},r))}),this.subtitleSegmentLoader_.on(s,r=>{this.player_.trigger(Me({},r))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(()=>{this.mainSegmentLoader_.load()})}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0))return this.tech_.setCurrentTime(e.end(e.length-1))}setupFirstPlay(){const e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){const t=this.seekable();if(!t.length)return!1;const s=t.end(0);let r=s;if(e.start){const n=e.start.timeOffset;n<0?r=Math.max(s+n,t.start(0)):r=Math.min(s,n)}this.trigger("firstplay"),this.tech_.setCurrentTime(r)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const e=this.tech_.play();typeof e<"u"&&typeof e.then=="function"&&e.then(null,t=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();!t||t.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const s=this.syncController_.getExpiredTime(e,this.duration());if(s===null)return!1;const r=oi.Playlist.playlistEnd(e,s),n=this.tech_.currentTime(),a=this.tech_.buffered();if(!a.length)return r-n<=Jt;const o=a.end(a.length-1);return o-n<=Jt&&r-o<=Jt}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:s}){if(e=e||this.mainPlaylistLoader_.media(),s=s||t.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=t,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;const r=this.mainPlaylistLoader_.main.playlists,n=r.filter(Wa),a=n.length===1&&n[0]===e;if(r.length===1&&s!==1/0)return M.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(a);if(a){if(this.main().contentSteering){const A=this.pathwayAttribute_(e),y=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(A),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(A)},y);return}let E=!1;r.forEach(A=>{if(A===e)return;const y=A.excludeUntil;typeof y<"u"&&y!==1/0&&(E=!0,delete A.excludeUntil)}),E&&(M.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let o;e.playlistErrors_>this.maxPlaylistRetries?o=1/0:o=Date.now()+s*1e3,e.excludeUntil=o,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const u=this.selectPlaylist();if(!u){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const h=t.internal?this.logger_:M.log.warn,m=t.message?" "+t.message:"";h(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${m} Switching to playlist ${u.id}.`),u.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),u.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const _=u.targetDuration/2*1e3||5*1e3,T=typeof u.lastRequest=="number"&&Date.now()-u.lastRequest<=_;return this.switchMedia_(u,"exclude",a||T)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const s=[],r=e==="all";(r||e==="main")&&s.push(this.mainPlaylistLoader_);const n=[];(r||e==="audio")&&n.push("AUDIO"),(r||e==="subtitle")&&(n.push("CLOSED-CAPTIONS"),n.push("SUBTITLES")),n.forEac
219h(a=>{const o=this.mediaTypes_[a]&&this.mediaTypes_[a].activePlaylistLoader;o&&s.push(o)}),["main","audio","subtitle"].forEach(a=>{const o=this[`${a}SegmentLoader_`];o&&(e===a||e==="all")&&s.push(o)}),s.forEach(a=>t.forEach(o=>{typeof a[o]=="function"&&a[o]()}))}setCurrentTime(e){const t=ws(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(t&&t.length)return e;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:oi.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_)return;let t=this.mainPlaylistLoader_.media();if(!t)return;let s=this.syncController_.getExpiredTime(t,this.duration());if(s===null)return;const r=this.mainPlaylistLoader_.main,n=oi.Playlist.seekable(t,s,oi.Playlist.liveEdgeDelay(r,t));if(n.length===0||this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),s=this.syncController_.getExpiredTime(t,this.duration()),s===null||(e=oi.Playlist.seekable(t,s,oi.Playlist.liveEdgeDelay(r,t)),e.length===0)))return;let a,o;if(this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),o=this.seekable_.start(0)),e?e.start(0)>n.end(0)||n.start(0)>e.end(0)?this.seekable_=n:this.seekable_=Xe([[e.start(0)>n.start(0)?e.start(0):n.start(0),e.end(0)<n.end(0)?e.end(0):n.end(0)]]):this.seekable_=n,this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===a&&this.seekable_.start(0)===o)return;this.logger_(`seekable updated [${bp(this.seekable_)}]`);const u={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:u}),this.tech_.trigger("seekablechanged")}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(e){const r=this.seekable();if(!r.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<r.end(r.length-1))&&this.sourceUpdater_.setDuration(r.end(r.length-1));return}const t=this.tech_.buffered();let s=oi.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(s=Math.max(s,t.end(t.length-1))),this.mediaSource.duration!==s&&this.sourceUpdater_.setDuration(s)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const s in t)t[s].forEach(r=>{r.playlistLoader&&r.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),s=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!t||!s)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const s=zr(this.main(),t),r={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=s.video||e.main.videoCodec||F_),e.main.isMuxed&&(r.video+=`,${s.audio||e.main.audioCodec||Ic}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||n)&&(r.audio=s.audio||e.main.audioCodec||e.audio.audioCodec||Ic,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!r.audio&&!r.video){this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const a=(h,m)=>h?Ur(m):ko(m),o={};let u;if(["video","audio"].forEach(function(h){if(r.hasOwnProperty(h)&&!a(e[h].isFmp4,r[h])){const m=e[h].isFmp4?"browser":"muxer";o[m]=o[m]||[],o[m].push(r[h]),h==="audio"&&(u=m)}}),n&&u&&t.attributes.AUDIO){const h=t.attributes.AUDIO;
vendor: 20,259 bytes, line 219
219this.main().playlists.forEach(m=>{(m.attributes&&m.attributes.AUDIO)===h&&m!==t&&(m.excludeUntil=1/0)}),this.logger_(`excluding audio group ${h} as ${u} does not support codec(s): "${r.audio}"`)}if(Object.keys(o).length){const h=Object.keys(o).reduce((m,_)=>(m&&(m+=", "),m+=`${_} does not support codec(s): "${o[_].join(",")}"`,m),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:h},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const h=[];if(["video","audio"].forEach(m=>{const _=(Xt(this.sourceUpdater_.codecs[m]||"")[0]||{}).type,T=(Xt(r[m]||"")[0]||{}).type;_&&T&&_.toLowerCase()!==T.toLowerCase()&&h.push(`"${this.sourceUpdater_.codecs[m]}" -> "${r[m]}"`)}),h.length){this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${h.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return r}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach(s=>{const r=e[s];if(t.indexOf(r.id)!==-1)return;t.push(r.id);const n=zr(this.main,r),a=[];n.audio&&!ko(n.audio)&&!Ur(n.audio)&&a.push(`audio codec ${n.audio}`),n.video&&!ko(n.video)&&!Ur(n.video)&&a.push(`video codec ${n.video}`),n.text&&n.text==="stpp.ttml.im1t"&&a.push(`text codec ${n.text}`),a.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${a.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],s=this.main().playlists,r=Ta(Xt(e)),n=Bd(r),a=r.video&&Xt(r.video)[0]||null,o=r.audio&&Xt(r.audio)[0]||null;Object.keys(s).forEach(u=>{const h=s[u];if(t.indexOf(h.id)!==-1||h.excludeUntil===1/0)return;t.push(h.id);const m=[],_=zr(this.mainPlaylistLoader_.main,h),T=Bd(_);if(!(!_.audio&&!_.video)){if(T!==n&&m.push(`codec count "${T}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){const E=_.video&&Xt(_.video)[0]||null,A=_.audio&&Xt(_.audio)[0]||null;E&&a&&E.type.toLowerCase()!==a.type.toLowerCase()&&m.push(`video codec "${E.type}" !== "${a.type}"`),A&&o&&A.type.toLowerCase()!==o.type.toLowerCase()&&m.push(`audio codec "${A.type}" !== "${o.type}"`)}m.length&&(h.excludeUntil=1/0,this.logger_(`excluding ${h.id}: ${m.join(" && ")}`))}})}updateAdCues_(e){let t=0;const s=this.seekable();s.length&&(t=s.start(0)),t1(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=Ve.GOAL_BUFFER_LENGTH,s=Ve.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,Ve.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*s,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=Ve.BUFFER_LOW_WATER_LINE,s=Ve.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,Ve.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(t,Ve.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*s,this.bufferBasedABR?n:r)}bufferHighWaterLine(){return Ve.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){$d(this.inbandTextTracks_,"com.apple.streaming",this.tech_),Ob({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,s){const r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();$d(this.inbandTextTracks_,e,this.tech_),kb({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:s})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));if(this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(t=>{this.contentSteeringController_.on(t,s=>{this.trigger(Me({},s))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const t=this.main();(this.contentSteeringController_.didDASHTagChange(t.uri,t.contentSteering)||(()=>{const n=this.contentSteeringController_.getAvailablePathways(),a=[];for(const o of t.playlists){const u=o.attributes.serviceLocation;if(u&&(a.push(u),!n.has(u)))return!0}return!!(!a.length&&n.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const s=this.main().playlists,r=new Set;let n=!1;Object.keys(s).forEach(a=>{const o=s[a],u=this.pathwayAttribute_(o),h=u&&e!==u;o.excludeUntil===1/0&&o.lastExcludeReason_==="content-steering"&&!h&&(delete o.excludeUntil,delete o.lastExcludeReason_,n=!0);const _=!o.excludeUntil&&o.excludeUntil!==1/0;!r.has(o.id)&&h&&_&&(r.add(o.id),o.excludeUntil=1/0,o.lastExcludeReason_="content-steering",this.logger_(`excluding ${o.id} for ${o.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(a=>{const o=this.mediaTypes_[a];if(o.activePlaylistLoader){const u=o.activePlaylistLoader.media_;u&&u.attributes.serviceLocation!==e&&(n=!0)}}),n&&this.changeSegmentPathway_()}handlePathwayClones_(){const t=this.main().playlists,s=this.contentSteeringController_.currentPathwayClones,r=this.contentSteeringController_.nextPathwayClones;if(s&&s.size||r&&r.size){for(const[a,o]of s.entries())r.get(a)||(this.mainPlaylistLoader_.updateOrDeleteClone(o),this.contentSteeringController_.excludePathway(a));for(const[a,o]of r.entries()){const u=s.get(a);if(!u){t.filter(m=>m.attributes["PATHWAY-ID"]===o["BASE-ID"]).forEach(m=>{this.mainPlaylistLoader_.addClonePathway(o,m)}),this.contentSteeringController_.addAvailablePathway(a);continue}this.equalPathwayClones_(u,o)||(this.mainPlaylistLoader_.updateOrDeleteClone(o,!0),this.contentSteeringController_.addAvailablePathway(a))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...r])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const s=e["URI-REPLACEMENT"].PARAMS,r=t["URI-REPLACEMENT"].PARAMS;for(const n in s)if(s[n]!==r[n])return!1;for(const n in r)if(s[n]!==r[n])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(s=>{const r=this.mainPlaylistLoader_.getKeyIdSet(s);!r||!r.size||r.forEach(n=>{const a="usable",o=this.keyStatusMap_.has(n)&&this.keyStatusMap_.get(n)===a,u=s.lastExcludeReason_===t&&s.excludeUntil===1/0;o?o&&u&&(delete s.excludeUntil,delete s.lastExcludeReason_,this.logger_(`enabling playlist ${s.id} because key ID ${n} is ${a}`)):(s.excludeUntil!==1/0&&s.lastExcludeReason_!==t&&(s.excludeUntil=1/0,s.lastExcludeReason_=t,this.logger_(`excluding playlist ${s.id} because the key ID ${n} doesn't exist in the keyStatusMap or is not ${a}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(s=>{const r=s&&s.attributes&&s.attributes.RESOLUTION&&s.attributes.RESOLUTION.height<720,n=s.excludeUntil===1/0&&s.lastExcludeReason_===t;r&&n&&(delete s.excludeUntil,M.log.warn(`enabling non-HD playlist ${s.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const n=(typeof e=="string"?e:Qb(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${n} added to the keyStatusMap`),this.keyStatusMap_.set(n,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const E1=(i,e,t)=>s=>{const r=i.main.playlists[e],n=Su(r),a=Wa(r);if(typeof s>"u")return a;s?delete r.disabled:r.disabled=!0;const o={renditionInfo:{id:e,bandwidth:r.attributes.BANDWIDTH,resolution:r.attributes.RESOLUTION,codecs:r.attributes.CODECS},cause:"fast-quality"};return s!==a&&!n&&(t(r),s?i.trigger({type:"renditionenabled",metadata:o}):i.trigger({type:"renditiondisabled",metadata:o})),s};class C1{constructor(e,t,s){const{playlistController_:r}=e,n=r.fastQualityChange_.bind(r);if(t.attributes){const a=t.attributes.RESOLUTION;this.width=a&&a.width,this.height=a&&a.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=zr(r.main(),t),this.playlist=t,this.id=s,this.enabled=E1(e.playlists,t.id,n)}}const A1=function(i){i.representations=()=>{const e=i.playlistController_.main(),t=un(e)?i.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(s=>!Su(s)).map((s,r)=>new C1(i,s,s.id)):[]}},Qd=["seeking","seeked","pause","playing","error"];class w1 extends M.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=Lt("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),s=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),n=()=>this.resetTimeUpdate_(),a=this.playlistController_,o=["main","subtitle","audio"],u={};o.forEach(m=>{u[m]={reset:()=>this.resetSegmentDownloads_(m),updateend:()=>this.checkSegmentDownloads_(m)},a[`${m}SegmentLoader_`].on("appendsdone",u[m].updateend),a[`${m}SegmentLoader_`].on("playlistupdate",u[m].reset),this.tech_.on(["seeked","seeking"],u[m].reset)});const h=m=>{["main","audio"].forEach(_=>{a[`${_}SegmentLoader_`][m]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),h("off"))},this.clearSeekingAppendCheck_=()=>h("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),h("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(Qd,n),this.tech_.on("canplay",s),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(Qd,n),this.tech_.off("canplay",s),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),o.forEach(m=>{a[`${m}SegmentLoader_`].off("appendsdone",u[m].updateend),a[`${m}SegmentLoader_`].off("playlistupdate",u[m].reset),this.tech_.off(["seeked","seeking"],u[m].reset)}),this.checkCurrentTimeTimeout_&&x.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&x.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=x.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,s=t[`${e}SegmentLoader_`],r=s.buffered_(),n=f2(this[`${e}Buffered_`],r);if(this[`${e}Buffered_`]=r,n){const a={bufferedRanges:r};t.trigger({type:"bufferedrangeschanged",metadata:a}),this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:s.playlist_&&s.playlist_.id,buffered:Xi(r)}),!(this[`${e}StalledDownloads_`]<10)&&(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),e!=="subtitle"&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Jt>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(Xe([this.lastRecordedTime,e]));const s={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:s}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const t=this.seekable(),s=this.tech_.currentTime(),r=this.afterSeekableWindow_(t,s,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let n;if(r&&(n=t.end(t.length-1)),this.beforeSeekableWindow_(t,s)){const A=t.start(0);n=A+(A===t.end(0)?0:Jt)}if(typeof n<"u")return this.logger_(`Trying to seek outside of seekable at time ${s} with seekable range ${bp(t)}. Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0;const a=this.playlistController_.sourceUpdater_,o=this.tech_.buffered(),u=a.audioBuffer?a.audioBuffered():null,h=a.videoBuffer?a.videoBuffered():null,m=this.media(),_=m.partTargetDuration?m.partTargetDuration:(m.targetDuration-Qt)*2,T=[u,h];for(let A=0;A<T.length;A++){if(!T[A])continue;if(Tu(T[A],s)<_)return!1}const E=Vn(o,s);return E.length===0?!1:(n=E.start(0)+Jt,this.logger_(`Buffered region starts (${E.start(0)}) just beyond seek point (${s}). Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0)}waiting_(){if(this.techWaiting_())return;const e=this.tech_.currentTime(),t=this.tech_.buffered(),s=ws(t,e);if(s.length&&e+3<=s.end(0)){this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${s.start(0)} -> ${s.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const o=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${o}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(o),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const s=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:s.audioBuffered(),videoBuffered:s.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const a=Vn(r,t);return a.length>0?(this.logger_(`Stopped at ${t} and seeking to ${a.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0):!1}afterSeekableWindow_(e,t,s,r=!1){if(!e.length)return!1;let n=e.end(e.length-1)+Jt;const a=!s.endList,o=typeof s.partTargetDuration=="number";return a&&(o||r)&&(n=e.end(e.length-1)+s.targetDuration*3),t>n}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:s}){if(!e)return;let r;if(e.length&&t.length){const n=ws(e,s-3),a=ws(e,s),o=ws(t,s);o.length&&!a.length&&n.length&&(r={start:n.end(0),end:o.end(0)})}else Vn(e,s).length||(r=this.gapFromVideoUnderflow_(e,s));return r?(this.logger_(`Encountered a gap in video from ${r.start} to ${r.end}. Seeking to current time ${s}`),!0):!1}skipTheGap_(e){const t=this.tech_.buffered(),s=this.tech_.currentTime(),r=Vn(t,s);if(this.resetTimeUpdate_(),r.length===0||s!==e)return;this.logger_("skipTheGap_:","currentTime:",s,"scheduled currentTime:",e,"nextRange start:",r.start(0)),this.tech_.setCurrentTime(r.start(0)+Qt);const n={gapInfo:{from:s,to:r.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:n}),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(e,t){const s=c2(e);for(let r=0;r<s.length;r++){const n=s.start(r),a=s.end(r);if(t-n<4&&t-n>2)return{start:n,end:a}}return null}}const D1={errorInterval:30,getSource(i){const t=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return i(t)}},cm=function(i,e){let t=0,s=0;const r=Te(D1,e);i.ready(()=>{i.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const n=function(){s&&i.currentTime(s)},a=function(m){m!=null&&(s=i.duration()!==1/0&&i.currentTime()||0,i.one("loadedmetadata",n),i.src(m),i.trigger({type:"usage",name:"vhs-error-reload"}),i.play())},o=function(){if(Date.now()-t<r.errorInterval*1e3){i.trigger({type:"usage",name:"vhs-error-reload-canceled"});return}if(!r.getSource||typeof r.getSource!="function"){M.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return t=Date.now(),r.getSource.call(i,a)},u=function(){i.off("loadedmetadata",n),i.off("error",o),i.off("dispose",u)},h=function(m){u(),cm(i,m)};i.on("error",o),i.on("dispose",u),i.reloadSourceOnError=h},I1=function(i){cm(this,i)};var dm="3.14.2",k1="7.0.3",P1="1.3.0",L1="7.2.0",O1="4.0.2";const Le={PlaylistLoader:Ds,Playlist:gt,utils:B2,STANDARD_PLAYLIST_SELECTOR:Ud,INITIAL_PLAYLIST_SELECTOR:Cb,lastBandwidthSelector:Ud,movingAverageBandwidthSelector:xb,comparePlaylistBandwidth:Cu,comparePlaylistResolution:Sb,xhr:Fp()};Object.keys(Ve).forEach(i=>{Object.defineProperty(Le,i,{get(){return M.log.warn(`using Vhs.${i} is UNSAFE be sure you know what you are doing`),Ve[i]},set(e){if(M.log.warn(`using Vhs.${i} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){M.log.warn(`value of Vhs.${i} must be greater than or equal to 0`);return}Ve[i]=e}})});const hm="videojs-vhs",fm=function(i,e){const t=e.media();let s=-1;for(let r=0;r<i.length;r++)if(i[r].id===t.id){s=r;break}i.selectedIndex_=s,i.trigger({selectedIndex:s,type:"change"})},R1=function(i,e){e.representations().forEach(t=>{i.addQualityLevel(t)}),fm(i,e.playlists)};Le.canPlaySource=function(){return M.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const N1=(i,e,t)=>{if(!i)return i;let s={};e&&e.attributes&&e.attributes.CODECS&&(s=Ta(Xt(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(s.audio=t.attributes.CODECS);const r=Ms(s.video),n=Ms(s.audio),a={};for(const o in i)a[o]={},n&&(a[o].audioContentType=n),r&&(a[o].videoContentType=r),e.contentProtection&&e.contentProtection[o]&&e.contentProtection[o].pssh&&(a[o].pssh=e.contentProtection[o].pssh),typeof i[o]=="string"&&(a[o].url=i[o]);return Te(i,a)},M1=(i,e)=>i.reduce((t,s)=>{if(!s.contentProtection)return t;const r=e.reduce((n,a)=>{const o=s.contentProtection[a];return o&&o.pssh&&(n[a]={pssh:o.pssh}),n},{});return Object.keys(r).length&&t.push(r),t},[]),B1=({player:i,sourceKeySystems:e,audioMedia:t,mainPlaylists:s})=>{if(!i.eme.initializeMediaKeys)return Promise.resolve();const r=t?s.concat([t]):s,n=M1(r,Object.keys(e)),a=[],o=[];
219return n.forEach(u=>{o.push(new Promise((h,m)=>{i.tech_.one("keysessioncreated",h)})),a.push(new Promise((h,m)=>{i.eme.initializeMediaKeys({keySystems:u},_=>{if(_){m(_);return}h()})}))}),Promise.race([Promise.all(a),Promise.race(o)])},F1=({player:i,sourceKeySystems:e,media:t,audioMedia:s})=>{const r=N1(e,t,s);return r?(i.currentSource().keySystems=r,r&&!i.eme?(M.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},pm=()=>{if(!x.localStorage)return null;const i=x.localStorage.getItem(hm);if(!i)return null;try{return JSON.parse(i)}catch{return null}},U1=i=>{if(!x.localStorage)return!1;let e=pm();e=e?Te(e,i):i;try{x.localStorage.setItem(hm,JSON.stringify(e))}catch{return!1}return e},$1=i=>i.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(i.substring(i.indexOf(",")+1)):i,mm=(i,e)=>{i._requestCallbackSet||(i._requestCallbackSet=new Set),i._requestCallbackSet.add(e)},gm=(i,e)=>{i._responseCallbackSet||(i._responseCallbackSet=new Set),i._responseCallbackSet.add(e)},_m=(i,e)=>{i._requestCallbackSet&&(i._requestCallbackSet.delete(e),i._requestCallbackSet.size||delete i._requestCallbackSet)},ym=(i,e)=>{i._responseCallbackSet&&(i._responseCallbackSet.delete(e),i._responseCallbackSet.size||delete i._responseCallbackSet)};Le.supportsNativeHls=function(){if(!V||!V.createElement)return!1;const i=V.createElement("video");return M.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(t){return/maybe|probably/i.test(i.canPlayType(t))}):!1}();Le.supportsNativeDash=function(){return!V||!V.createElement||!M.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(V.createElement("video").canPlayType("application/dash+xml"))}();Le.supportsTypeNatively=i=>i==="hls"?Le.supportsNativeHls:i==="dash"?Le.supportsNativeDash:!1;Le.isSupported=function(){return M.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};Le.xhr.onRequest=function(i){mm(Le.xhr,i)};Le.xhr.onResponse=function(i){gm(Le.xhr,i)};Le.xhr.offRequest=function(i){_m(Le.xhr,i)};Le.xhr.offResponse=function(i){ym(Le.xhr,i)};const q1=M.getComponent("Component");class vm extends q1{constructor(e,t,s){if(super(t,s.vhs),typeof s.initialBandwidth=="number"&&(this.options_.bandwidth=s.initialBandwidth),this.logger_=Lt("VhsHandler"),t.options_&&t.options_.playerId){const r=M.getPlayer(t.options_.playerId);this.player_=r}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(V,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],r=>{const n=V.fullscreenElement||V.webkitFullscreenElement||V.mozFullScreenElement||V.msFullscreenElement;n&&n.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=Te(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||
vendor: 7,297 bytes, line 219
219!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const s=pm();s&&s.bandwidth&&(this.options_.bandwidth=s.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),s&&s.throughput&&(this.options_.throughput=s.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=Ve.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Ve.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(s=>{typeof this.source_[s]<"u"&&(this.options_[s]=this.source_[s])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio;const t=this.options_.customPixelRatio;typeof t=="number"&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=$1(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Le,this.options_.sourceType=uh(t),this.options_.seekTo=n=>{this.tech_.setCurrentTime(n)},this.options_.player_=this.player_,this.playlistController_=new x1(this.options_);const s=Te({liveRangeSafeTimeDelta:Jt},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new w1(s),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const n=M.players[this.tech_.options_.playerId];let a=this.playlistController_.error;typeof a=="object"&&!a.code?a.code=3:typeof a=="string"&&(a={message:a,code:3}),n.error(a)});const r=this.options_.bufferBasedABR?Le.movingAverageBandwidthSelector(.55):Le.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=Le.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(n){this.playlistController_.selectPlaylist=n.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(n){this.playlistController_.mainSegmentLoader_.throughput.rate=n,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let n=this.playlistController_.mainSegmentLoader_.bandwidth;const a=x.navigator.connection||x.navigator.mozConnection||x.navigator.webkitConnection,o=1e7;if(this.options_.useNetworkInformationApi&&a){const u=a.downlink*1e3*1e3;u>=o&&n>=o?n=Math.max(n,u):n=u}return n},set(n){this.playlistController_.mainSegmentLoader_.bandwidth=n,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const n=1/(this.bandwidth||1);let a;return this.throughput>0?a=1/this.throughput:a=0,Math.floor(1/(n+a))},set(){M.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>Xi(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>Xi(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&U1({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{A1(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=x.URL.createObjectURL(this.playlistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),B1({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(t=>{this.logger_("error while creating EME key session",t),this.player_.error({message:"Failed to initialize media ke
219ys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=F1({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",s=>{this.playlistController_.updatePlaylistByKeyStatus(s.keyId,s.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!t){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=M.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{R1(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{fm(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":dm,"mux.js":k1,"mpd-parser":P1,"m3u8-parser":L1,"aes-decrypter":O1}}version(){return this.constructor.version()}canChangeType(){return am.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&x.URL.revokeObjectURL&&(x.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return V2({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,s=!0,r=2){return Hp({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:s,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{mm(this.xhr,e)},this.xhr.onResponse=e=>{gm(this.xhr,e)},this.xhr.offRequest=e=>{_m(this.xhr,e)},this.xhr.offResponse=e=>{ym(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const e=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"],t=["gapjumped","playedrangeschanged"];e.forEach(s=>{this.playlistController_.on(s,r=>{this.player_.trigger(Me({},r))})}),t.forEach(s=>{this.playbackWatcher_.on(s,r=>{this.player_.trigger(Me({},r))})})}}const xa={name:"videojs-http-streaming",VERSION:dm,canHandleSource(i,e={}){const t=Te(M.options,e);return!t.vhs.experimentalUseMMS&&!Ur("avc1.4d400d,mp4a.40.2",!1)?!1:xa.canPlayType(i.type,t)},handleSource(i,e,t={}){const s=Te(M.options,t);return e.vhs=new vm(i,e,s),e.vhs.xhr=Fp(),e.vhs.setupXhrHooks_(),e.vhs.src(i.src,i.type),e.vhs},canPlayType(i,e){const t=uh(i);if(!t)return"";const s=xa.getOverrideNative(e);return!Le.supportsTypeNatively(t)||s?"maybe":""},getOverrideNative(i={}){const{vhs:e={}}=i,t=!(M.browser.IS_ANY_SAFARI||M.browser.IS_IOS),{overrideNative:s=t}=e;return s}},j1=()=>Ur("avc1.4d400d,mp4a.40.2",!0);j1()&&M.getTech("Html5").registerSourceHandler(xa,0);M.VhsHandler=vm;M.VhsSourceHandler=xa;M.Vhs=Le;M.use||M.registerComponent("Vhs",Le);M.options.vhs=M.options.vhs||{};(!M.getPlugin||!M.getPlugin("reloadSourceOnError"))&&M.registerPlugin("reloadSourceOnError",I1);const H1="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAhCAYAAABX5MJvAAAAAXNSR0IArs4c6QAABnJJREFUWEeVmAWsXUUURdfB3SW4O4QESwhugVAI7lAoVlo0uLtr0QLBNUCwBmvxQAkUSAnuUtyhuA6zPuc2t4/32zLJS+h798/ds/c++5whmIBVSpkJmBdYHVgFWBqYE5gcCOB34DPgDeAp4HHgHeDLiCjje4Ub9LpKKdMASwI7AOsDM+dL/8wX/w34komBSfPjft8nkOuBkRHx3bje0xVEKcXvPfluCWBWYDTwAvAk8CLwMfBTgpgKmANYItlaAZA9X34ncKksRcRf3cD8B0QpxVOtCBwDrJYvGgp4qpeAH4FfutFcSpkCkL2Fqhw7VRY2AWZM8CfX/R6OiD86gYwFopQyEbAmcDqwFPA0cEn97jHgmwnRt3lBKWUGYDlgYN1nA2AUcCxwdyeQMSBSAhm4KAHcUY13GvBmROiB/73yUMp6OLBjlffDyuwhwP1tadog5gcuBtYGBHB0RLzX25tLKVPW5/WK8jVLqr+NCL0yZpVS5gaOAvoCrwK766uG2R4QpZRpgYOq+Q4Enq+ltXdE+HDXlQD6AQOAqVsPfQvcDlwbERq3DURGZHYz4Obqq8Mi4isfiJRhpTSeptpPJiLC8usNhDlxG7B4lwcsz/uAE2tlvdWmvZSi3Bp8+vTKEH8XhO49Pim6Rc0i4uuOU1hu5oEv0Lxb18
219y4MMuwG1DDy70ObE6bjHvIQ2vpHmClAP0j4gtB6OAbASXZJcuoJ+WSpUXzD3+o+p+UJepzp3YB0QA1H+6SjYhQorYs7ndrBt92wHBB7J+ZMLwG0B4ia/6ilDIPcG71ycYZTn2kGNgqTSzwXwBNOkn9/pUaWpdlWn6SJh1L1lKKUpyVbJ4DDBKEqNbJH86PCDeVhcYf0ucferqjgSuzdyjH2+l2k9LqUlYPY0kL6s/OlCyl+P0WKeezwJ6CEL09wYi2fnuQl1J0872ZGVaR39ugjgAeAmbPz2Q1B35NpvSSpl2wntCw+gZ4GXgvInymZ5VSDELNaylvKgg1U++NIsKe0Dy4QO0Dj+QJm68FInqNuVhtWKdkVnyeOWCu3FA/C2d+2Cs+TeluiggjvzngsJRxa0FIv214vYiQ3jYIHSyYZul6a3xwJuvy2VU1pPmyT5a4nrGrNsu2vi8wVKZLKXPJehq7XxvEuhHhw20QjwLztTaTNXU3yK7Lztn8rBF3rl1z2TS6PmrWz2nwM2QjQSiHNthVENa+pusTEerXgNAT96TGTbwby5aeFXNB/d2W7W8y8VytBivNDNg8jdlsp/a2hFMiYnRWnZ1Z828nCEvOf/SNiAdbICw7hxmjWfp63J4VYTPSfGaFBlVOm9T7mQHK1O4pHvLIyurVGrSUYtI+UE3+m+1eEENyZDNmL40If2jYcD6w+ehm3a4c7+boNktKpfZ6RXMqyRrAmTmRma6y9LonzmFI5sydy3M+6fGEJ7C9WgkD2jHbAuNmnkwmBLZqleEE4IMMKMvSnOgPvKbOyZItQeAyNtjumvnjgW2ATlynC2LlbCrSvQ0wonN4ybnA/iEra2WfMaAE1SSmZb5XdlGj2Yxx5HMsODQiZMnyFKxl7PRl/A8TxGw5SQngKp3dOZi2mpzjmq5Xms5lMPXonh5zfnD2PFsJPViOf05aJu9IR0DB+YtUezoBuPpFhNKMWaUUS+m8DCnH/G7LtNw7mTDUprNy2g2slGLAWdqyoAVujIjfm6HGk6mTE4/1e1BEqHdjUP1gCno6TSUbnUOy2bFlROiJ/6ycrpwxrSzLc2BEmKb/bpQtW42vyLARrTX9UQcjamzZbp+VYd/w1FbGGWrdrq7WIbwoHZb9ycNp4OFjjXcJRFm84BhEtnDN4zg2qm3UUoo6azynJI1qGqqvm441W+a+PiP1VoOVoh9uUYYGZOfIb81rPocXgZghg4zppvm0Tqc3fF4mfu0cB3MONXUPrjmxbXZU8+OaTrDdLj9uvF5V6bgMKQdWZw4lcjAd3dtNKk1u+poPRrfddpnME+W6vRtbvV0DNaIpaS/YMFuubdr+YGf1JmYuNNc6pVQm3e/lycHZO6wsPZESP9OWoO218V2ILU2vgoaK/cBTGlD6wJAy4o1lpbHX+JFJBxirRF/ZIz4f1/Q+ThBpLFkRzCJ5MTJhnTGaudLHZMQXW00jav9wBLAjf9Xb6SeYic5iz0uSISQjTXJ6EG/sOt/q8L/1zXj/v0Sz/z8r4XG9VjaCxwAAAABJRU5ErkJggg==",V1="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAhCAYAAABX5MJvAAAAAXNSR0IArs4c6QAABkpJREFUWEeNmAfM3WMUxp+j9t57b0JsQoxQpbHatInVWi1ipAOxQmgpFaNmUUqFxEqQjypitEiNhmqNWGm1dosaVVTxen83z//63787+iZfvvvd73/f9znnec5zzntDi7lSSktJWl3SqpI2lLSRX4eknyV9JelLST9KmhcRfyzm1mKDtiultJyk9STtK+lQSTtLWlnS0pK6SUr++VPSAkkfSHpO0suAiohfO53REkRKiQOI+GhJx0naWNISktiUaL+R9IsBrCRpHUlrSOI1a66kxyQ9IGlmRCxqBaYpiJTSspIOkHSBpF0lscFbkl7M70/0AUT+j0EAGLqgis8dImkvSctL+ihnbpSkCRExvxmQ/4FIKRHJsTm155uGyZIezHS8QAYi4vd26U0pLWMwe+cMnGhAaObOvN+YiCBDDasBREppRUkDDQDeSeX15rZlOpuBKtE51HQC7m72qwKpg7D6j8mCu9qR3CPpuoj4upOwOmQGio7IIr7SeiGo0WVqaiBSSvyGQ5BulgU5NvN5bTsArpoVpFqFLYiI31qBMUWI+xpJlO45WWtPRsTffKYAgbJvlNTb/A+LCGq+YRksYkM3lOxu3mO6S5JqARBlW/0sHnN5pvZUi/ykiJhVA5FSWlJS32xEt7js+kfE+8UOKSX8gGrhuXWdMYxqrcwvGiIasvCDJKibYtNCQwsjYmFpL7I8WtI+pud2hA6IDfyP7lCQo7yB1FojO0rayZEjVPjFCyhNfu9pEK/aMxDfPEk/SaIc8ZRpkqbjEw64v8/5nOAjYjYgemQLRoTU/ZER8aF1QvrgEHAvORv4wZp2TQ6DGrJDFoj4E0nfGRh/HyTpjQxqaETwPvrDAO/1HmdI6gLEiGw+ZyEUBBMRuCEPEymVQrTvGAyZgJb3zG8/g8KQTjCov9xLsO5t3FMAMcf7AvzCDHyQLWA4IJ43qosl3R8RZAQQiG9I5vgwSd8aBNqYmhV+kaStsoPul+36Dov0EtPFx6GC7AH67Qx8RCk4iuFgzsrAZ0jqBwgUiviOj4hJJRHBL9GdnH94BjC4HVkDAM3sJkl7GCzaorew0AQgaHyPAzQiaG61lVLaUhLBk7XegAA1/PYs9FDyDiK9TNLsTEkvC+3ZbGL4A56yu90VXZQX+42XtKn7xtMRwYEFCHQBXWS7lgnMg47YPSJmlndKKbHJbZlD+sX+Ti8fvspagZb1q5Yg6XsfQhkPjggEW1+uyKfceQcCgjSh3B4R8Wnl4bVdThyEoLbN0d1n0IPd3isYalWGcAkM8EMigtdVEM9IWg26AQFqHu4VEYiu/DBa6WOXQ0Q4KrxTIYiu2YIKdIAxPSFpXNXSU0qbWBPs3xcQlB+RUrN1Py/xx2a3epDBvHbwRNUMACb2cc4q7R8qz65SYb0xo3R5zz6AGJfL7ihzT9Oqq9gfoCyZC07JWXnXVcGU1Wwgot+QZvxhgrtlw3jnNkDV4c4MSIMAcZqFRj0PqPJnIJTfFTYmyu9Aj34FEBoWZsSmuCqVcGlEfFZNl00Qsff0nmMAsX1G/pAkRIgHdEUEaS1rg8MQ5TDbMw2LTSg1/kfjYvJioZXhZK26jwNiZHjE1k7vmAYIGhOjHBMQqaSkcMiG5TYOYKqCSsFfcD5EincUHZUuObUFAKqBNgG1D+c9zsNJAUEkbM4cSdrp+WPLLbgkUp5FqHC6ubNAK+d97h2U74wWAHiGCQubp80PkDSJ2aMYahAfsyVpJAsMHm82G06cUjopQw2OymKGmNhsiC0FsF32hZs9S1BtIyOCIeg/haeUmK5Geih9xU2KOaBBH6VNqfFV/Pf8VjcuZ3oLixCfYW9KF9+preq0DVrGPO4Or3n6mdJufqxqpyJogEI1HfZwOymaYs/6CFgFwd8YEr2BgQS7vct6mVu0+XYHmy7ECmVo4HQbHG7MuDC5mt1mlx/eI33nevYkmtdtwbRfLjLY/KJiWvYdgxsY7Z8qQS9cH9AMvkH5QnVTetvdRZmsiOTMnImtPVcyFzIzMgjjjgBCM2gD68cpd3EQAPrCo+OjZLWV0Nveym2xlC180sgYZrilF3xSnrwm2mKgoYtyOL2BBjar09Wx41cD5piDqR5cE8ejiRXfT3B48f0EsyblSo+Z0+oCXNXUv6oZWMASiYuxAAAAAElFTkSuQmCC",z1="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAhCAYAAABX5MJvAAAAAXNSR0IArs4c6QAABnFJREFUWEeNmAesnmMYhq/H3nvvFStGxIjEXq2Y1dIipagRI0ZT1KZENJTGLEErVKWCSGuTkqgYIVqUomaL0NIarVZ5fdfJ851853dOjzc5+f/zjfe93/u5n/t53j/4H6OUsiSwFrAhsAuwA7AxsBoQwFzgO+Bj4D3ga2BWRCz8H9O3TdDl
219yMXXBvYCjgH2BFYGlujipQL8AUwBngJeAb6PiEWLW6dLEKUUF3Pxc4E9gGWBObnbj4CZwK+AC/vsusD2wI7A6sA/wNTq+j3ACxHxc1dAOgVRSpH204HTgDWAD5wImAB8C/wJSLULCcJwLQ0sl2HrCRyW4H32SeBWYHpE+HyH8R8QpZQtgauS/vnAY9XEdyatUt3tKKUIxjAOyI3I0kTgymreya1AOoAopWwG3AgcDXxW7eympPKXblfu5IFSyorA7sAVwN7A61VILzRMTSDtIEop0i7Ss4APgUuANyLir+b8DbGqEYdzGJrfMjzzmguUUhSxOnFzB1bZ9TQwOCJm1PO2gSilGM9+wM3AAuDsZMCYt4+ccJ/qmcuALfKGMZ6cf353t5Mi4u/6xVKK68jIXcDWyfDtEdEW3hrEVsAYYJsEMqJ+oAWE3jC6iu9+KUYXNWMUrbv1vmE8Ffiq0pZA5stMbvT4nN93Tgbe8Z53jdt5FaWXA6+akk2qGruR/oHADZmC3lK4r1Vh1AcOqBZwLrPhmSoznvUvIn5ozKHhyfZxwIMmQETMFYT0yMKmVd4PMhtazaURV5/brmFWX1YLXFsJrS9waIOd2Xl9dJPRDIu6kM15ZmBETBVEf+CWCp0GNKALFlZKgBdXz/rdoXYeaoC4Pk3LEMjE+RGhfXcYpRRT996K9f0za0YJYmTSc3+1k+sj4vdOXlyqsmAFeUYlvIPTA4x574z9ScAJwKr6SU5uDTE8cyOiXeCllDqsQ1NLgwTxdkWP/qAunqhVndRpOmaOjqiIl0/addO3kgVTeKPUgkI1XWXjcGDXqsgp8uktAjdTrC2zKjfuI4gf88XeESGgtlFKcfc7p3HpeNL/ZgpulRSlsW+z4UYG7JSWb8Fz13coxojQR+q5N6/M6+XcWG9BSL+IekTEpy2ITVl9Xyt3sW9yAX2gg4ckcBl9NMu9LDpkwVC9W79TSpG557IVGCAId2hFPCgiVHuN1jCo+hFZlLzuwpqRAlYTraKzvzBbdN0ahOF5WAeuK2kWyPFZeQcKQpossz0j4pMGiPUzdfdNTXjLtDJkV6crtjqqupE1U3m3TGUZtAofERFWYEMtE8+nkPsLQg/35b4RMakBYj3gkTQh/V/GnNyiNjMiBNQ+SikrpJV/LqtVug7PLHKThnRoROiUghDoSxniXoLQ8WxGBhvPumClzRqO2ypxrZmxvRSQLQXnogLTX/zUMc/M0u9iRwLrJBuCmBARCzLrTHdbBJnpJwiNyubFi0Miwm6p1oUhuS89wolkzJJsvP2uUK0H2rd2LGjfF5TXBOv/dmeK2Rpiml9QtYEa3+NWbq8elS2Y4jQk7YJLu+6RPYDpeEhSXOOUes1rk8wKY92+h9SQlXNYQ5Ru7IHsugQzThDWDN1SY7kOGCltLVmi32vLiq3ZCE0ztbM8mwHqqDnez41ZWdWC2uqT3qE/WTumC2KZLKvDsjE9pROH05zUjGHTiuthOOzCdM270yXtEXRMM86KO6ahsw2yVZQ9ZTDcAlf3Eza2FhXFNcpcjwgNrKl+C4+q1z0d7sq2T/vV8AzrRdnmu0vDO7F2ykbLMCRFfmJtjjUIP0XnbjScawQTEYqrCUQr18TqoU8sTMFZvAypXZagFjXqkLXHUm/DrKjtzMzEtsNRs8dUtRYm+0wXt+MeX+d2S6w7/df+s9nWpQ5c1JQ0e+zgrNo3Ns8hrd22za6UnpNxtg5o2zM6qxXdAcve4djsRRTtOMUfEWqpfXR27jD2er9AFKQNiillfzCnuyNdduOGZttkVq04xmY17QCgQzhaYu/iOp7tnu2fB14Ll0XHPkIrrvsGX61PYIbUA3OvFLlOqyt6FBwbET91xt7izqIK0FJuWpqGhsrUE9AX6ZaCsUDZ8pl+lnKbWZ3S515MD5rSKvLFhqMVaSlFVpzcs6VnTL9bN0xRN1GfLf1U0P5EYMNiGKdFRLent8X+NNASIncrG+7YEOm0AhSM9cFqrDP6OdtWvjvh1vf/Bfzpg8ALQjizAAAAAElFTkSuQmCC",G1="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAhCAYAAABX5MJvAAAAAXNSR0IArs4c6QAABnFJREFUWEeVmAmsXlUVhb+tKAoqDnEAJwgKiAOKQHBAcWgYVErRCARoLKLSMkgoWo0FnNCiwbRlxjqWAnWASCIIKjhVpAiVwaooIFOLtgqtQhGw2/P92Zfc/r6pN3l57/3v3nPWXXuttfd5wQSuzHw28BLgLcCbgFcBWwGbAgE8AtwH/An4NfBz4DZgVUTkeFu4wKhXZj4N2BE4BNgLeE5t+lhtvB5wkycCT6ov11tTQBYCyyLigbH2GRFEZvq5b/7BAvBcYC3wO+BXwE3AvcCDBWIzYEvgFcXWLoDsufklwDmyFBH/HQnM/4HITN9qV+BEYI/a6ArAt7oZ+DewbiSaM/MpgOxt28pxWGNhMvCsAv/5tt5PI+LRYSAbgMjMJwB7AnOAVwK/Ac5qn/0M+OdE6tttkJnPBHYGZrR19gbuAk4CfjAM5HEQVQIZOKMAXNyE90Xg1ohQAxt91UtZ1k8Ah7by3t2Y/Rhweb80fRBbA2cCbwcEMDsi7tjonUd4IDNfBHwKmAosB45QVx2zAxCZ+XRgZhPf8cD1zVpHRcTyzHxyOcJS/GckQKUDn/9XRDw8GujMlBGZnQJc2HQ1KyJWe39UGXYr4SmqY2UiItZn5suALwM/Ar4dEet6NdeSLwD2KwFfBFwWEWbGiFdmWm4FvkVp5VLLIgjV++miaLE1i4h/FENucloD9ZoS6/carapbO76t6uzCumKBwouINeWwGNZS5c7Hm3WP0ynARyLi74JQwYvaZlL6gbLRIOVKWC8FfNBNZ7ccuKpKZ10NLy1tGb6qrQuE1L8eWOImfVoyc7sWgN+pZw8e3JOZH61MWNIC6EP9hzJT2vYB3l2eXwF8EpApGXptgbBM58pogXhdi/XzWt780HJGhKE2uGpNS/z+WmOuIET1jqr9vK7umWlfOLBK5RuvKovJ2AkF5Oyml90bUw+1UJoHfLOxpZ3d1HB6awu49yryHohN/KwxcTpwHfBhQfy+qDGi9a/9QMRGtZscUP1iWdv4mPank0uQ06tHyIDB9plWzr+6aLlMZ323xf/XW4TPjwiBdmx4/2UFdn9B3K+9pDwi7Andjc8HvlblMEl9m/cophLWH+tnrSv1S0v5bqoDzge+Vb3l0IhY2VtbzVwJPNWyCMJ62oYnRcRfejfKhI3H/Fd8gpBGBXlUtXFBa2lt+eoWdL8oQP5+ZDFnG5jSD77MfKGsV5Ob1gfxzohwBuiYGA2Ei8uGttRFt9RmNwD2C9NWXRjTArZvqIvbe2sLwnKotcMFYe+35b4rIlywA/G8sp3O6MohEwIQiCAG8imWdJkbKc47SzuntpK+eEB5hH2jW9vP7MyG48GC+HP9MjUifjykiW/UmxjvXTmGQXSPuM7nGvU3VqDpAp33S3OmP9hk5g6VwuppsiAurZHts2qg6xGZ+YxqOtZ/8xrddIos6AAt3F0OKw49tmv7zzWtTO+r7ilDzhH9AFTgitn5ZKAJ26zt1SSc3jWV6imm2xcadW8oirWx99oNLVF36TAT037iDDofsAO/sXrO46lZ0e0LTyvhzxGEG2gp6TOclg6h1qr2DsVmVgjk6Bp0fcZLi1v/CypR3dx+9BOzpD8MZaYjg/Z1+rJNXCkIBegkJQA9bv5vMJgWK+pCSo1y+4jj25tL4ZbDTJFVy2igCcQUXdgFVbV9Jy17kC90WESsEIS0uqgAvKZFhKUZ9aouKXgncMFoNUW8wD5Rs4Mi1QUzIsJgM4W3tzzFgmVdZOvvhhr9bZ30tf6dGRHabMyrN/RYFq3uYNMJUGCystJhp6YrZ0zzQ3sKbpCiHQi/O647E+xUaE+JiHvGAzKRv2emB6VZpSdfTpvb5geA+zOmZZHerxSNisdx7K6NmbKHQRUDUq8bdJF6WNyfwIZHfi1mr+jqaYbMNagiwvPGhK/MtDnZqGz7B3lkAL5kovbniw2Y6FbPTIFMKoXbcj1pmXwKysF07WgnqRK5UezIaLA5uNjYLIEW/v4wgBFBlIrtmgIw7fatlmv4/LZmQ5PObOiOdZbSo6Dqt2s6OHuGdTYxti3xtaMNweMdiFW4R0FDxZnRtzS0HFAcAcx+xWWES79fMunM+YcKJSf1v3XD0kj1HBNEjxXBvLwORibsNrVhl5gy4sa6yeHm6mrxq8c6AnSAxgXRR16HJL0vIyan+eIaNi+V72zpz+pm3P9LdGv/D2AJc705qQeFAAAAAElFTkSuQmCC",W1="/assets/Cooltron-High-Performance-Fan-Series-B8Q9-q4H.pdf",X1={class:"index-container"},K1={class:"header-inner"},Y1={class:"partner-login"},Q1={href:"/resource"},J1={class:"banner"},Z1={class:"banner-item"},eS=["innerHTML"],tS=["innerHTML"],iS={class:"banner-desc-wrapper animate__animated animate__fadeInLeft"},sS={class:"banner-desc"},rS=["src"],nS={class:"banner-desc"},aS=["src"],oS={class:"banner-desc"},lS=["src"],uS={class:"banner-desc"},cS=["src"],dS=["href"],hS={class:"banner-item"},fS={class:"banner-title animate__animated animate__fadeInRight"},pS={key:1,class:"banner-content animate__animated animate__fadeInRight"},mS={href:"/product/fans"},gS={class:"banner-item"},_S=["innerHTML"],yS=["innerHTML"],vS={href:"/contact-us"},TS={class:"banner-item"},bS=["innerHTML"],SS={key:0,alt:"",src:S0,class:"banner-bg"},xS={key:1,alt:"",src:x0,class:"banner-bg"},ES={href:"https://www.cooltron.com/product/detail/400w-smd-high-bay-light-cold-forged-heatsink-1975745605231308801"},CS={class:"banner-indicator"},AS=["onClick"],wS={key:2,class:"about-us"},DS={class:"container"},IS={class:"title","data-aos":"fade-up","data-aos-duration":"800"},kS={class:"container-main"},PS={class:"video"},LS=["poster","src"],OS={key:2,class:"en-video-wrapper"},RS=["src"],NS=["src"],MS={class:"text","data-aos":"fade-left","data-aos-duration":"3000"},BS=["innerHTML"],FS={class:"buttons"},US={href:"/about-us"},$S={href:"/contact-us"},qS={key:3,class:"mobile-about-us"},jS={class:"container"},HS={class:"title","data-aos":"fade-up","data-aos-duration":"800"},VS={key:0,class:"text","data-aos":"fade-up","data-aos-duration":"1200"},zS=["innerHTML"],GS={key:1,class:"video","data-aos":"fade-up","data-aos-duration":"2000"},WS=["poster","src"],XS={key:2,class:"en-video-wrapper","data-aos":"fade-up","data-aos-duration":"2000"},KS=["src"],YS=["src"],QS={key:4,class:"products-solutions"},JS={class:"title","data-aos":"fade-up","data-aos-duration":"800"},ZS=["src"],ex={class:"container"},tx={class:"container-left animate__animated animate__fadeInLeft"},ix={class:"subtitle","data-aos":"fade-right","data-aos-duration":"1000"},sx=["innerHTML"],rx={class:"container-right animate__animated animate__fadeInRight"},nx={key:0,class:"solution-title ellipsis","data-aos":"fade-left","data-aos-duration":"1000"},ax={class:"feature-list","data-aos":"fade-left","data-aos-duration":"1000"},ox=["title"],lx={key:1,class:"categories-title ellipsis","data-aos":"fade-left","data-aos-duration":"1000"},ux={class:"category-list","data-aos":"fade-left","data-aos-duration":"1000"},cx=["title"],dx=["src"],hx={key:1,class:"category-img"},fx={class:"name ellipsis"},px={class:"learn-more-btn","data-aos":"fade-left","data-aos-duration":"1000"},mx=["href"],gx={class:"solution-inidicator"},_x=["onClick"],yx={class:"image-wrapper"},vx=["src"],Tx={class:"item-title"}
219,bx={key:5,class:"mobile-products-solutions"},Sx={class:"title","data-aos":"fade-up","data-aos-duration":"800"},xx={class:"subtitle","data-aos":"fade-up","data-aos-duration":"1000"},Ex={class:"solution-list","data-aos":"fade-up","data-aos-duration":"2000"},Cx=["onClick"],Ax=["src"],wx={class:"solution-info"},Dx=["src"],Ix={class:"item-title"},kx={key:6,class:"main-products"},Px={class:"container"},Lx={class:"title","data-aos":"fade-up","data-aos-duration":"800"},Ox={class:"subtitle","data-aos":"fade-up","data-aos-duration":"800"},Rx={class:"tab-nav","data-aos":"fade-up"},Nx=["onClick"],Mx=["title"],Bx={class:"inner-text"},Fx={class:"tab-content"},Ux=["href","title"],$x=["src"],qx={class:"title ellipsis"},jx={key:0,class:"product-item link-to-more","data-aos":"zoom-in","data-aos-duration":"500",href:"/product"},Hx={class:"item-wrapper"},Vx={class:"text"},zx=["href"],Gx={class:"item-wrapper"},Wx={class:"text"},Xx={key:7,class:"mobile-main-products"},Kx={class:"container"},Yx={class:"title","data-aos":"fade-up","data-aos-duration":"800"},Qx={class:"subtitle","data-aos":"fade-up","data-aos-duration":"1000"},Jx={class:"category-list"},Zx=["onClick"],eE={class:"inner-container"},tE=["src"],iE={class:"category-info"},sE={key:8,class:"submit-form"},rE={class:"inner-container"},nE={class:"title","data-aos":"fade-up","data-aos-duration":"800"},aE={class:"sub-title","data-aos":"fade-up","data-aos-duration":"1000"},oE={class:"tips"},lE={class:"button","data-aos":"zoom-out","data-aos-duration":"1200"},uE={key:9,class:"mobile-submit-form"},cE={class:"container"},dE={class:"title","data-aos":"fade-up","data-aos-duration":"800"},hE={class:"subtitle","data-aos":"fade-up","data-aos-duration":"1000"},fE={class:"tips"},pE={class:"button","data-aos":"zoom-out","data-aos-duration":"1200"},mE={key:10,class:"news"},gE={class:"container"},_E={class:"title","data-aos":"fade-up","data-aos-duration":"800"},yE={class:"subtitle","data-aos":"fade-up","data-aos-duration":"800"},vE={class:"main-container"},TE={class:"inner-container"},bE={class:"info"},SE=["href"],xE=["title"],EE={class:"time","data-aos":"fade-left","data-aos-duration":"1000"},CE=["href"],AE=["href"],wE=["src"],DE={key:11,class:"mobile-news"},IE={class:"title","data-aos":"fade-up","data-aos-duration":"800"},kE={class:"subtitle","data-aos":"fade-up","data-aos-duration":"800"},PE={class:"swiper-container"},LE={class:"news-item"},OE=["onClick"],RE=["src"],NE={class:"info"},ME=["onClick"],BE=["title"],FE={class:"time","data-aos":"fade-left","data-aos-duration":"1000"},UE=["onClick"],$E={key:0,class:"swiper-indicator"},qE=["onClick"],jE={class:"quick-access"},HE={class:"container"},VE=["data-aos"],zE={class:"inner-container"},GE=["src"],WE={class:"right-box"},XE={class:"item-title"},KE={class:"item-description"},YE=["href"],QE={__name:"index",setup(i){const e=g0(),{t}=i0(),s=s0(),{push:r}=o0();let n=de({color:"#ffffff"}),a=de(null),o=de(""),u=de(null),h=de({"--menu-active-color":"#ffffff"}),m=de("#ffffff"),_=de(null);const T=()=>{Er.getMetaData().then(P=>{o.value=P.data.data.cn.logoPath,u.value={"background-image":`url(${o.value})`}})},E=gs(()=>s.locale==="zh-CN"),A=gs(()=>({color:"#333333",fontSize:"16px",lineHeight:"2"}));function y(P){window.scrollY===0&&!B.value&&O()}function w(P){window.scrollY===0&&!B.value&&N()}const D=()=>{window.scrollY===0?N():O()};function N(){a.value={},n.value={color:"#ffffff"},u.value={...u.value,filter:"drop-shadow(99999px 0 0 #ffffff)",transform:"translate(-99999px)"},m.value="#ffffff",_.value={background:"transparent","border-color":"#ffffff"},h.value={"--menu-color":"rgba(255,255,255,0.92)","--menu-active-color":"#ffffff"}}function O(){a.value={height:"100%",top:0,background:" rgba(255,255,255,0.92) "},n.value={color:"#333","box-shadow":" 0 0 12px 0 rgba(0, 0, 0, 0.15)"},u.value={...u.value,filter:" none !important",transform:"none !important"},m.value="var(--ct-color-primary)",_.value={background:"var(--ct-color-primary)","border-color":"var(--ct-color-primary)"},h.value={"--menu-color":"#303133","--menu-active-color":"var(--ct-color-primary)"}}let B=de(!1);const I=()=>{B.value=!B.value,O(),a.value.background="#ffffff !important"},$=()=>{B.value=!1};fc(e,()=>{B.value&&$()});let X=de(!1),K=de(!!pc()),re=de(!1);function xe(P){re.value=P}function ue(){l0.get("/api/logoutAction",{headers:{authorization:pc()}}).then(P=>{K.value=!1,_c(),r("/")}
219).catch(P=>{var q,_e;gc.error(t("message.loginAgain")),((_e=(q=P.response)==null?void 0:q.data)==null?void 0:_e.code)==="B0301"&&(K.value=!1,_c(),r("/"))})}const ge=[_0],ee=de(),he=P=>{ee.value=P};let Re=de(0);const ce=gs(()=>{if(e.isMobile)return{top:"50%",transform:"translateY(-50%)"}}),Ie=P=>{Re.value=P.realIndex},Ke=de(!0),At=de(null),it=de(!1),ct=()=>{s.locale==="en-US"&&(it.value=!0),Oi.value||(Oi.value=Li.value),n0(()=>{At.value.play()})},qt=()=>{At.value.pause()};let Li=de(),Oi=de(),ss=de(),_i=de(),yi=mc({});const Xa=()=>{Er.getVideo().then(P=>{const{data:q}=P;Li.value=q.data.uploadVideo,ss.value=q.data.videoUrl,_i.value=q.data.videoImage,yi={cn:q.data.cn.introduce.replaceAll(` 220`,"<br>"),en:q.data.eng.introduce.replaceAll(` 221`,"<br>")}})},rs=de(),Ka=P=>{rs.value=P};let vi=de(null);const cn=()=>{Er.getSolutionList().then(P=>{vi.value=P.data.data})};let rr=de(0);const Ya=P=>{rr.value=P.realIndex},Qa=gs(()=>{var P,q;return(q=(P=vi.value)==null?void 0:P[rr.value])==null?void 0:q.solutionImage});let ns=de([]),Ot=de(null),Rt=de([]);const nr=()=>{yc.getMainClassList().then(P=>{Rt.value=P.data.data})},me=()=>{yc.getSubClassList().then(P=>{ns.value=P.data.data,Ot.value=ns.value[0]})},ar={1:"/product/fans",2:"/product/blowers",3:"/product/accessories",4:"/product/heat-sinks",5:"/product/motors",6:"/product/electronics"},or=P=>{const q=ar[P];q&&r(q)},ke=mc({fullName:"",email:"",phone:"",askHelpInfo:""});de(null);let as=de(!0),os=de("");const ls=de({showDialCodeInList:!1,showDialCodeInSelection:!0,showFlags:!0}),Ri=de({placeholder:gs(()=>t("form.phone")),maxlength:20}),us=P=>{os.value=P.dialCode},lr=P=>{as.value=P.valid},Ni=()=>{pe.value.validateField("phone")},ur=(P,q,_e)=>{as.value?_e():_e(new Error(t("error.phone")))},pe=de(),dn=()=>{pe.value.validate(P=>{P&&Ja()})};fc(()=>s.locale,P=>{pe.value.resetFields()});const Ti=de(!1),Ja=()=>{Ti.value=!0},hn=()=>{Ti.value=!1},Za=()=>{Er.save({...ke,phone:"+"+os.value+"-"+ke.phone}).then(P=>{gc.success(t("message.submitSuccess")),pe.value.resetFields(),ke.askHelpInfo=""}).finally(()=>{hn()})};let jt=de([]);function eo(){Er.getNewsList().then(P=>{jt.value=P.data.data.slice(0,3)})}const fn=de(),to=P=>{fn.value=P},pn=de(0),io=P=>{pn.value=P.realIndex},so=gs(()=>[{icon:p0,title:t("quickAccess.title1"),description:t("quickAccess.subtitle1"),link:"/cooltron-outside-sales-rep"},{icon:m0,title:t("quickAccess.title2"),description:t("quickAccess.subtitle2"),link:"/cooltron-distributors"}]);return r0(()=>{T(),Xa(),cn(),nr(),me(),eo(),window.addEventListener("scroll",D)}),(P,q)=>{var Bi,Fi,_n,zt;const _e=Je("el-menu-item"),cs=Je("el-sub-menu"),ro=Je("el-menu"),Ht=Je("svg-icon"),dt=Je("el-button"),cr=Je("el-dropdown-item"),dr=Je("el-dropdown-menu"),ds=Je("el-dropdown"),je=Je("ArrowRightBold"),Vt=Je("el-icon"),mn=Je("ArrowLeft"),Mi=Je("ArrowRight"),Ye=Je("el-input"),Tt=Je("el-form-item"),ye=Je("vue-tel-input"),gn=Je("el-form");return W(),Z("div",X1,[H(e).isMobile?le("",!0):(W(),Z("div",{key:0,class:"index-header",style:Pe(H(n))},[L("div",{class:"header-bg",style:Pe(H(a))},null,4),L("div",K1,[L("a",{class:"logo",style:Pe(H(u)),href:"/"},null,4),L("div",{class:"menu",style:Pe({width:P.$forI18n("48%","54%")})},[z(ro,{router:"","default-active":"/","show-timeout":100,"hide-timeout":100,mode:"horizontal",ellipsis:!1,style:Pe(H(h)),onOpen:y,onClose:w},{default:Q(()=>[z(_e,{index:"/"},{default:Q(()=>[L("span",null,G(P.$t("menu.home")),1)]),_:1}),z(cs,{index:"2",onClick:q[0]||(q[0]=R=>H(r)("/product"))},{title:Q(()=>[L("span",null,G(P.$t("menu.products.title")),1)]),default:Q(()=>[Nn(z(_e,{index:"/product"},null,512),[[Bn,!1]]),z(_e,{index:"/product/fans"},{default:Q(()=>[fe(G(P.$t("menu.products.fans")),1)]),_:1}),z(_e,{index:"/product/blowers"},{default:Q(()=>[fe(G(P.$t("menu.products.blowers")),1)]),_:1}),z(_e,{index:"/product/accessories"},{default:Q(()=>[fe(G(P.$t("menu.products.accessories")),1)]),_:1}),z(_e,{index:"/product/heat-sinks"},{default:Q(()=>[fe(G(P.$t("menu.products.heatSinks")),1)]),_:1}),z(_e,{index:"/product/motors"},{default:Q(()=>[fe(G(P.$t("menu.products.motors")),1)]),_:1}),z(_e,{index:"/product/electronics"},{default:Q(()=>[fe(G(P.$t("menu.products.electronics")),1)]),_:1})]),_:1}),z(cs,{index:"3",onClick:q[1]||(q[1]=R=>H(r)("/solution"))},{title:Q(()=>[L("span",null,G(P.$t("menu.solutions.title")),1)]),default:Q(()=>[Nn(z(_e,{index:"/solution"},null,512),[[Bn,!1]]),z(_e,{index:"/solution/fan-series"},{default:Q(()=>
221[fe(G(P.$t("menu.solutions.fan")),1)]),_:1}),z(_e,{index:"/solution/heat-sink-series"},{default:Q(()=>[fe(G(P.$t("menu.solutions.heatSink")),1)]),_:1}),z(_e,{index:"/solution/motor-series"},{default:Q(()=>[fe(G(P.$t("menu.solutions.motor")),1)]),_:1})]),_:1}),z(_e,{index:"/technology"},{default:Q(()=>[L("span",null,G(P.$t("menu.technology")),1)]),_:1}),z(cs,{index:"5",onClick:q[2]||(q[2]=R=>H(r)("/about-us"))},{title:Q(()=>[L("span",null,G(P.$t("menu.about.title")),1)]),default:Q(()=>[Nn(z(_e,{index:"/about-us"},null,512),[[Bn,!1]]),z(_e,{index:"/about-us"},{default:Q(()=>[fe(G(P.$t("menu.about.cooltron")),1)]),_:1}),z(_e,{index:"/certifications"},{default:Q(()=>[fe(G(P.$t("menu.about.certifications")),1)]),_:1}),z(_e,{index:"/staff-presence"},{default:Q(()=>[fe(G(P.$t("menu.about.staff")),1)]),_:1}),z(_e,{index:"/news"},{default:Q(()=>[fe(G(P.$t("menu.about.news")),1)]),_:1})]),_:1}),z(cs,{index:"6",onClick:q[3]||(q[3]=R=>H(r)("/contact-us"))},{title:Q(()=>[L("span",null,G(P.$t("menu.contact.title")),1)]),default:Q(()=>[Nn(z(_e,{index:"/contact-us"},null,512),[[Bn,!1]]),z(_e,{index:"/contact-us"},{default:Q(()=>[fe(G(P.$t("menu.contact.title")),1)]),_:1}),z(_e,{index:"/cooltron-outside-sales-rep"},{default:Q(()=>[fe(G(P.$t("menu.contact.sales")),1)]),_:1}),z(_e,{index:"/cooltron-distributors"},{default:Q(()=>[fe(G(P.$t("menu.contact.distributors")),1)]),_:1})]),_:1})]),_:1},8,["style"])],4),L("div",{class:"search",onClick:q[4]||(q[4]=R=>I())},[z(Ht,{iconName:"icon-sousuo",color:H(m)},null,8,["color"])]),L("div",{class:"language",onClick:q[5]||(q[5]=R=>H(s).setLocale())},[H(s).locale==="en-US"?(W(),Z(Qe,{key:0},[q[25]||(q[25]=L("img",{alt:"",src:u0},null,-1)),q[26]||(q[26]=L("span",null,"EN",-1))],64)):(W(),Z(Qe,{key:1},[q[27]||(q[27]=L("img",{alt:"",src:c0},null,-1)),q[28]||(q[28]=L("span",null,"䏿",-1))],64))]),L("div",Y1,[H(K)?(W(),Bt(ds,{key:1,"popper-class":"login-dropdown",onVisibleChange:xe},{dropdown:Q(()=>[z(dr,null,{default:Q(()=>[z(cr,null,{default:Q(()=>[L("a",Q1,[z(Ht,{iconName:"icon-ziyuanzhongxin",color:"#999999"}),L("span",null,G(P.$t("logResource")),1)])]),_:1}),z(cr,{divided:"",onClick:ue},{default:Q(()=>[z(Ht,{iconName:"icon-weibiaoti--",color:"#999999"}),L("span",null,G(P.$t("logout")),1)]),_:1})]),_:1})]),default:Q(()=>[z(dt,{type:"primary",style:Pe(H(_))},{icon:Q(()=>[z(Ht,{iconName:"icon-wode",color:"#ffffff"})]),default:Q(()=>[fe(" "+G(P.$t("hasLogin"))+" ",1),H(re)?(W(),Bt(Ht,{key:1,class:"hasLoginSvg",style:{transform:"rotate(-90deg)"},iconName:"icon-triangle-fill",color:"#ffffff"})):(W(),Bt(Ht,{key:0,class:"hasLoginSvg",iconName:"icon-triangle-fill",color:"#ffffff"}))]),_:1},8,["style"])]),_:1})):(W(),Bt(dt,{key:0,type:"primary",style:Pe(H(_)),onClick:q[6]||(q[6]=R=>Eo(X)?X.value=!0:X=!0)},{icon:Q(()=>[z(Ht,{iconName:"icon-wode",color:"#ffffff"})]),default:Q(()=>[fe(" "+G(P.$t("login")),1)]),_:1},8,["style"]))])])],4)),H(X)?(W(),Bt(d0,{key:1,visible:H(X),"onUpdate:visible":q[7]||(q[7]=R=>Eo(X)?X.value=R:X=R)},null,8,["visible"])):le("",!0),z(h0,{drawerVisible:H(B),onCloseSearchDrawer:$},null,8,["drawerVisible"]),L("div",J1,[z(H(Co),{onSwiper:he,onSlideChange:Ie,modules:ge,loop:!0,autoplay:{delay:4e3},"slides-per-view":1},{default:Q(()=>[z(H(_s),null,{default:Q(()=>[L("div",Z1,[q[29]||(q[29]=L("img",{alt:"",src:y0,class:"banner-bg"},null,-1)),H(Re)===0?(W(),Z("div",{key:0,class:"banner01-text",style:Pe(ce.value)},[L("div",{class:"banner-title animate__animated animate__fadeInLeft",innerHTML:P.$t("banner.title1")},null,8,eS),H(e).isMobile?le("",!0):(W(),Z("div",{key:0,class:"banner-subtitle animate__animated animate__fadeInLeft",innerHTML:P.$t("banner.subtitle1"),style:Pe({marginTop:P.$forI18n("0.5em"," 0.3em")})},null,12,tS)),L("div",iS,[L("div",sS,[L("img",{alt:"",src:H(H1)},null,8,rS),fe(G(P.$t("banner.desc1")),1)]),L("div",nS,[L("img",{alt:"",src:H(V1)},null,8,aS),fe(G(P.$t("banner.desc2")),1)]),L("div",oS,[L("img",{alt:"",src:H(z1)},null,8,lS),fe(G(P.$t("banner.desc3")),1)]),L("div",uS,[L("img",{alt:"",src:H(G1)},null,8,cS),fe(G(P.$t("banner.desc4")),1)])]),L("a",{href:H(W1),target:"_blank"}
221,[H(e).isMobile?le("",!0):(W(),Bt(dt,{key:0,type:"primary",class:"more-btn more-btn01 animate__animated animate__zoomIn",style:Pe({marginTop:P.$forI18n("2.9em","1.5em")})},{default:Q(()=>[fe(G(P.$t("banner.button")),1),z(Vt,null,{default:Q(()=>[z(je)]),_:1})]),_:1},8,["style"]))],8,dS)],4)):le("",!0)])]),_:1}),z(H(_s),null,{default:Q(()=>[L("div",hS,[q[30]||(q[30]=L("img",{alt:"",src:v0,class:"banner-bg"},null,-1)),H(Re)===1?(W(),Z("div",{key:0,class:"banner02-text",style:Pe(ce.value)},[L("div",fS,G(P.$t("banner.title2")),1),H(e).isMobile?le("",!0):(W(),Z("div",{key:0,class:"banner-content animate__animated animate__fadeInRight",style:Pe({fontSize:P.$forI18n("calc(10px + 0.75vw)","calc(6px + 0.8vw)")})},G(P.$t("banner.content2")),5)),H(e).isMobile?(W(),Z("div",pS,G(P.$t("banner.mobileContent2")),1)):le("",!0),L("a",mS,[H(e).isMobile?le("",!0):(W(),Bt(dt,{key:0,type:"primary",class:"more-btn more-btn02 animate__animated animate__zoomIn"},{default:Q(()=>[fe(G(P.$t("banner.button")),1),z(Vt,null,{default:Q(()=>[z(je)]),_:1})]),_:1}))])],4)):le("",!0)])]),_:1}),z(H(_s),null,{default:Q(()=>[L("div",gS,[q[31]||(q[31]=L("img",{alt:"",src:T0,class:"banner-bg"},null,-1)),H(Re)===2?(W(),Z("div",{key:0,class:"banner03-text",style:Pe({...ce.value,lineHeight:P.$forI18n("","1.1")})},[L("div",{class:"banner-title animate__animated animate__fadeInLeft",innerHTML:P.$t("banner.title3"),style:Pe({fontSize:P.$forI18n("3.5vw","3.4vw")})},null,12,_S),L("div",{class:"banner-content animate__animated animate__fadeInLeft",innerHTML:P.$t("banner.content3"),style:Pe({marginTop:P.$forI18n("0.2em","0.5em"),fontSize:P.$forI18n("2.1vw","1.9vw"),maxWidth:P.$forI18n("60%","50%")})},null,12,yS),L("a",vS,[H(e).isMobile?le("",!0):(W(),Bt(dt,{key:0,type:"primary",class:"more-btn more-btn03 animate__animated animate__zoomIn",style:Pe({marginTop:P.$forI18n("3.5em","2em")})},{default:Q(()=>[fe(G(P.$t("banner.button")),1),z(Vt,null,{default:Q(()=>[z(je)]),_:1})]),_:1},8,["style"]))])],4)):le("",!0)])]),_:1}),z(H(_s),null,{default:Q(()=>[L("div",TS,[q[33]||(q[33]=L("img",{alt:"",src:b0,class:"banner-bg"},null,-1)),H(Re)===3?(W(),Z("div",{key:0,class:"banner03-text",style:Pe({...ce.value,lineHeight:P.$forI18n("1.1","1.1")})},[L("div",{class:"banner-title animate__animated animate__fadeInLeft",innerHTML:P.$t("banner.title4"),style:Pe({marginTop:P.$forI18n("0.5em","0.7em"),fontSize:P.$forI18n("3.5vw","3.5vw"),lineHeight:P.$forI18n("1.1","1.1")})},null,12,bS),L("div",{class:"banner-content animate__animated animate__fadeInLeft",style:Pe({marginTop:P.$forI18n("0.5em","0.5em"),fontSize:P.$forI18n("2.1vw","2.1vw"),maxWidth:P.$forI18n("50%","50%")})},[P.$t("banner.titleimg4")=="DescriptionCN"?(W(),Z("img",SS)):le("",!0),P.$t("banner.titleimg4")=="DescriptionEN"?(W(),Z("img",xS)):le("",!0)],4),L("a",ES,[H(e).isMobile?le("",!0):(W(),Bt(dt,{key:0,type:"primary",class:"more-btn more-btn03 animate__animated animate__zoomIn",style:Pe({marginTop:P.$forI18n("1em","1em")})},{default:Q(()=>[fe(G(P.$t("banner.button")),1),z(Vt,null,{default:Q(()=>[z(je)]),_:1})]),_:1},8,["style"]))]),L("div",{class:"banner-content animate__animated animate__fadeInLeft",style:Pe({marginTop:P.$forI18n("0.5em","0.5em"),fontSize:P.$forI18n("2.1vw","2.1vw"),maxWidth:P.$forI18n("72%","52%")})},q[32]||(q[32]=[L("img",{alt:"",src:E0,class:"banner-bg"},null,-1)]),4)],4)):le("",!0)])]),_:1})]),_:1}),L("div",CS,[(W(),Z(Qe,null,ht(4,(R,ve)=>L("div",{class:Mn(H(Re)===ve?"indicator-item active":"indicator-item"),key:ve,onClick:Ui=>ee.value.slideToLoop(ve)},null,10,AS)),64))]),H(e).isMobile?le("",!0):(W(),Z("div",{key:0,class:"arrow-left animate__animated",onClick:q[8]||(q[8]=R=>ee.value.slidePrev())},[z(Vt,null,{default:Q(()=>[z(mn)]),_:1})])),H(e).isMobile?le("",!0):(W(),Z("div",{key:1,class:"arrow-right animate__animated",onClick:q[9]||(q[9]=R=>ee.value.slideNext())},[z(Vt,null,{default:Q(()=>[z(Mi)]),_:1})]))]),H(e).isMobile?le("",!0):(W(),Z("div",wS,[L("div",DS,[L("div",IS,G(P.$t("homeAboutUs.title")),1),L("div",kS,[L("div",PS,[H(s).locale==="zh-CN"?(W(),Z("video",{key:0,ref_key:"videoPlayer",ref:At,onPlay:q[10]||(q[10]=R=>Ke.value=!1),onPause:q[11]||(q[11]=R=>Ke.value=!0),poster:H(_i),onClick:qt,src:H(Oi),"data-aos":"fade-right","data-aos-duration":"3000"},null,40,LS)):le("",!0),H(s).locale==="zh-CN"&&Ke.value?(W(),Z("div",{key:1,class:"video-play-btn",onClick:ct,"data-aos":"fade-right","data-aos-duration":"3000"},q[34]||(q[34]=[L("div",{class:"img-wrapper"},[L("img",{alt:"",src:Fn})],-1)]))):le("",!0),H(s).locale==="en-US"?(W(),Z("div",OS,[it.value?le("",!0):(W(),Z("img",{key:0,alt:"",src:H(_i),class:"video-cover",onClick:ct,"data-aos":"fade-right","data-aos-duration":"3000"},null,8,RS)),it.value?le("",!0):(W(),Z("div",{key:1,class:"video-play-btn",onClick:ct,"data-aos":"fade-right","data-aos-duration":"3000"},q[35]||(q[35]=[L("div",{class:"img-wrapper"},[L("img",{alt:"",src:Fn})],-1)]))),it.value?(W(),Z("iframe",{key:2,ref:"youtubeIframe",style:{"border-radius":"20px"},src:`${H(ss)}?rel=0&autoplay=1&enablejsapi=1`,title:"YouTube video player",frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture;
221 compute-pressure",referrerpolicy:"strict-origin-when-cross-origin",allowfullscreen:""},null,8,NS)):le("",!0)])):le("",!0)]),L("div",MS,[q[38]||(q[38]=L("div",{class:"welcome"},"Cooltron Industrial Supply, Inc.",-1)),L("div",{class:"content",innerHTML:P.$forI18n(H(yi).cn,H(yi).en),style:Pe(E.value?A.value:{})},null,12,BS),L("div",FS,[L("a",US,[z(dt,{type:"primary"},{default:Q(()=>[fe(G(P.$t("homeAboutUs.more"))+" ",1),q[36]||(q[36]=L("i",{class:"bi bi-arrow-right"},null,-1))]),_:1})]),L("a",$S,[z(dt,{type:"primary"},{default:Q(()=>[fe(G(P.$t("homeAboutUs.contact")),1),q[37]||(q[37]=L("i",{class:"bi bi-arrow-right"},null,-1))]),_:1})])])])])])])),H(e).isMobile?(W(),Z("div",qS,[L("div",jS,[L("div",HS,G(P.$t("homeAboutUs.title")),1),H(yi).cn?(W(),Z("div",VS,[L("span",{class:"content",innerHTML:((Bi=P.$forI18n(H(yi).cn,H(yi).en)||"")==null?void 0:Bi.split("<br>")[0])+"â",style:Pe(E.value?A.value:{})},null,12,zS),L("span",{class:"more-about",onClick:q[12]||(q[12]=R=>H(r)("/about-us"))},G(P.$t("homeAboutUs.more")),1)])):le("",!0),H(s).locale==="zh-CN"?(W(),Z("div",GS,[L("video",{ref_key:"videoPlayer",ref:At,onPlay:q[13]||(q[13]=R=>Ke.value=!1),onPause:q[14]||(q[14]=R=>Ke.value=!0),poster:H(_i),onClick:qt,src:H(Oi)},null,40,WS),Ke.value?(W(),Z("div",{key:0,class:"video-play-btn",onClick:ct},q[39]||(q[39]=[L("img",{alt:"",src:Fn},null,-1)]))):le("",!0)])):le("",!0),H(s).locale==="en-US"?(W(),Z("div",XS,[it.value?le("",!0):(W(),Z("img",{key:0,alt:"",src:H(_i),class:"video-cover",onClick:ct},null,8,KS)),it.value?le("",!0):(W(),Z("div",{key:1,class:"video-play-btn",onClick:ct},q[40]||(q[40]=[L("div",{class:"img-wrapper"},[L("img",{alt:"",src:Fn})],-1)]))),it.value?(W(),Z("iframe",{key:2,ref:"youtubeIframe",style:{"border-radius":"20px"},src:`${H(ss)}?rel=0&autoplay=1&enablejsapi=1`,title:"YouTube video player",frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; compute-pressure",referrerpolicy:"strict-origin-when-cross-origin",allowfullscreen:""},null,8,YS)):le("",!0)])):le("",!0)])])):le("",!0),!H(e).isMobile&&H(vi)?(W(),Z("div",QS,[L("div",JS,G(P.$t("productsAndSolutions.title")),1),z(H(Co),{onSwiper:Ka,onSlideChange:Ya,modules:ge,autoplay:{delay:4e3},loop:!0},{default:Q(()=>[L("img",{alt:"",class:"solution-background",src:Qa.value},null,8,ZS),(W(!0),Z(Qe,null,ht(H(vi),R=>(W(),Bt(H(_s),{key:R.id,class:"solution-item"},{default:Q(()=>[L("div",ex,[L("div",tx,[L("div",ix,G(P.$forI18n(R.cn.introduceTitle,R.eng.introduceTitle)),1),L("div",{class:"desc","data-aos":"fade-right","data-aos-duration":"1000",innerHTML:H(a0)(P.$forI18n(R.cn.introduceDesc,R.eng.introduceDesc))},null,8,sx)]),L("div",rx,[R.cn.solutionTitle&&R.eng.solutionTitle?(W(),Z("div",nx,G(P.$forI18n(R.cn.solutionTitle,R.eng.solutionTitle)),1)):le("",!0),L("div",ax,[(W(!0),Z(Qe,null,ht(P.$forI18n(R.cn.solutionFutures,R.eng.solutionFutures),ve=>(W(),Z("div",{class:"feature-item",key:ve.id},[q[41]||(q[41]=L("div",{class:"tick-icon"},[L("img",{alt:"",src:C0})],-1)),L("span",{class:"ellipsis",title:ve.future},G(ve.future),9,ox)]))),128))]),R.cn.categoryTitle&&R.eng.categoryTitle?(W(),Z("div",lx,G(P.$forI18n(R.cn.categoryTitle,R.eng.categoryTitle))+" : ",1)):le("",!0),L("div",ux,[(W(!0),Z(Qe,null,ht(P.$forI18n(R.cn.specialCategories,R.eng.specialCategories),ve=>(W(),Z("div",{class:"category-item",key:ve.id,title:ve.category},[ve.categoryIcon?(W(),Z("img",{key:0,alt:"",class:"category-img",src:ve.categoryIcon},null,8,dx)):(W(),Z("div",hx)),L("div",fx,G(ve.category),1)],8,cx))),128))]),L("div",px,[L("a",{href:R.skipUrl},[z(dt,{type:"primary"},{default:Q(()=>[fe(G(P.$t("productsAndSolutions.more")),1),q[42]||(q[42]=L("i",{class:"bi bi-arrow-right"},null,-1))]),_:1})],8,mx)])])])]),_:2},1024))),128))]),_:1}),L("div",{class:"arrow-left",onClick:q[15]||(q[15]=R=>rs.value.slidePrev())},[z(Vt,null,{default:Q(()=>[z(mn)]),_:1})]),L("div",{class:"arrow-right",onClick:q[16]||(q[16]=R=>rs.value.slideNext())},[z(Vt,null,{default:Q(()=>[z(Mi)]),_:1})]),L("div",gx,[(W(!0),Z(Qe,null,ht(H(vi),(R,ve)=>(W(),Z("div",{class:Mn(ve===H(rr)?"indicator-item indicator-item-active":"indicator-item"),key:R.id,onClick:Ui=>rs.value.slideToLoop(ve)},[L("div",yx,[L("img",{alt:"",src:R.solutionIcon},null,8,vx)]),L("div",Tx,G(P.$forI18n(R.cn.solutionTitle,R.eng.solutionTitle)),1)],10,_x))),128))])])):(W(),Z("div",bx,[L("div",Sx,G(P.$t("productsAndSolutions.title")),1),L("div",xx,G(P.$t("productsAndSolutions.subtitle")),1),L("div",Ex,[(W(!0),Z(Qe,null,ht(H(vi),R=>(W(),Z("div",{class:"solution-item",key:R.id,"data-aos":"zoom-in","data-aos-duration":"1000",onClick:ve=>H(r)(R.skipUrl)},[L("img",{alt:"",class:"solution-background",src:R.solutionImage},null,8,Ax),L("div",wx,[L("img",{alt:"",class:"solution-icon",src:R.solutionIcon},null,8,Dx),L("div",Ix,G(P.$forI18n(R.cn.solutionTitle,R.eng.solutionTitle)),1)])],8,Cx))),128))])])),H(e).isMobile?(W(),Z("div",Xx,[L("div",Kx,[L("div",Yx,G(P.$t("mainProducts.title")),1),L("div",Qx,G(P.$t("mainProducts.subtitle")),1),L("div",Jx,[(W(!0),Z(Qe,null,ht(H(Rt),R=>(W(),Z("div",{class:"category-item",key:R.id,onClick:ve=>or(R.id),"data-aos":"zoom-in","data-aos-duration":"1000"},[L("div",eE,[L("img",{alt:"",src:R.productImage},null,8,tE),L("div",iE,[L("div",null,G(P.$forI18n(R.cn.productName,R.eng.productName)),1),z(Ht,{"icon-name":"icon-gengduo1",color:"#C6C6C6"})])])],8,Zx))),128))])])])):(W(),Z("div",kx,[L("div",Px,[L("div",Lx,G(P.$t("mainProducts.title")),1),L("div",Ox,G(P.$t("mainProducts.subtitle")),1),L("div",Rx,[L("ul",null,[(W(!0),Z(Qe,null,ht(H(ns),R=>(W(),Z("li",{key:R.id,onClick:ve=>Eo(Ot)?Ot.value=R:Ot=R},[L("a",{class:Mn(H(Ot).mainClassId===R.mainClassId?"active":""),title:P.$forI18n(R.cn.mainProductName,R.eng.mainProductName)},[L("div",Bx,G(P.$forI18n(R.cn.mainProductName,R.eng.mainProductName)),1)],10,Mx)],8,Nx))),128))])]),L("div",Fx,[(W(!0),Z(Qe,null,ht(H(Ot)&&H(Ot).productSubclassList.slice(0,7),R=>(W(),Z("a",{class:"product-item",href:ar[R.parentId]+`/${R.eng.productName.toLowerCase()}`,key:R.id,"data-aos":"zoom-in","data-aos-duration":"1000",title:P.$forI18n(R.cn.productName,R.eng.productName)},[L("img",{alt:"",src:R.productImage||""},null,8,$x),L("div",qx,G(P.$forI18n(R.cn.productName,R.eng.productName)),1)],8,Ux))),128)),H(Ot)===H(ns)[0]?(W(),Z("a",jx,[L("div",Hx,[q[43]||(q[43]=L("i",{class:"bi bi-arrow-right"},null,-1)),L("div",Vx,G(P.$t("mainProducts.catalog")),1)])])):(W(),Z("a",{key:1,class:"product-item link-to-more","data-aos":"zoom-in","data-aos-duration":"500",href:ar[(Fi=H(Ot))==null?void 0:Fi.mainClassId]},[L("div",Gx,[q[44]||(q[44]=L("i",{class:"bi bi-arrow-right"},null,-1)),L("div",Wx,G(P.$t("mainProducts.moreCategories")),1)])],8,zx)),(W(),Z(Qe,null,ht(2,R=>L("div",{key:R,style:{"padding-top":"0",border:"none","margin-bottom":"0",width:"24%"}})),64))])])])),H(e).isMobile?(W(),Z("div",uE,[L("div",cE,[L("div",dE,G(P.$t("form.mobileTitle")),1),L("div",hE,G(P.$t("form.mobileSubtitle")),1),z(gn,{class:"input-wrapper",ref_key:"formRef",ref:pe,model:ke,"data-aos":"zoom-in","data-aos-duration":"1000"},{default:Q(()=>[z(Tt,{prop:"fullName",rules:[{required:!0,message:H(t)("message.fullName"),trigger:"blur"}]},{default:Q(()=>[z(Ye,{class:"fullNameInput",type:"text",placeholder:P.$t("form.name"),modelValue:ke.fullName,"onUpdate:modelValue":q[21]||(q[21]=R=>ke.fullName=R),maxlength:"255",size:"large"},null,8,["placeholder","modelValue"])]),_:1},8,["rules"]),z(Tt,{prop:"email",rules:[{required:!0,message:H(t)("message.email"),trigger:"blur"},{pattern:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,message:H(t)("error.email"),trigger:"blur"}]},{default:Q(()=>[z(Ye,{class:"emailInput",type:"text",placeholder:P.$t("form.email"),modelValue:ke.email,"onUpdate:modelValue":q[22]||(q[22]=R=>ke.email=R),maxlength:"320",size:"large"},null,8,["placeholder","modelValue"])]),_:1},8,["rules"]),z(Tt,{prop:"phone",rules:[{required:!0,message:H(t)("message.phone"),trigger:"blur"},{validator:ur,trigger:"blur"}]},{default:Q(()=>[z(ye,{modelValue:ke.phone,"onUpdate:modelValue":q[23]||(q[23]=R=>
221ke.phone=R),dropdownOptions:ls.value,inputOptions:Ri.value,validCharactersOnly:"",autoDefaultCountry:"",onCountryChanged:us,onValidate:lr,onBlur:Ni,onClose:Ni},null,8,["modelValue","dropdownOptions","inputOptions"])]),_:1},8,["rules"]),z(Tt,null,{default:Q(()=>[z(Ye,{modelValue:ke.askHelpInfo,"onUpdate:modelValue":q[24]||(q[24]=R=>ke.askHelpInfo=R),rows:7,type:"textarea",maxlength:"500",placeholder:P.$t("form.requirements")},null,8,["modelValue","placeholder"])]),_:1})]),_:1},8,["model"]),L("div",fE,[q[46]||(q[46]=L("span",null,"*",-1)),fe(G(P.$t("form.tips")),1)]),L("div",pE,[z(dt,{type:"primary",onClick:dn},{default:Q(()=>[fe(G(P.$t("form.submit")),1)]),_:1})])])])):(W(),Z("div",sE,[L("div",rE,[L("div",nE,G(P.$t("form.title")),1),L("div",aE,G(P.$t("form.subtitle")),1),z(gn,{class:"input-wrapper",ref_key:"formRef",ref:pe,model:ke,"data-aos":"zoom-in","data-aos-duration":"1000"},{default:Q(()=>[z(Tt,{prop:"fullName",rules:[{required:!0,message:H(t)("message.fullName"),trigger:"blur"}]},{default:Q(()=>[z(Ye,{class:"fullNameInput",type:"text",placeholder:P.$t("form.name"),modelValue:ke.fullName,"onUpdate:modelValue":q[17]||(q[17]=R=>ke.fullName=R),maxlength:"255",size:"large"},null,8,["placeholder","modelValue"])]),_:1},8,["rules"]),z(Tt,{prop:"email",rules:[{required:!0,message:H(t)("message.email"),trigger:"blur"},{pattern:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,message:H(t)("error.email"),trigger:"blur"}]},{default:Q(()=>[z(Ye,{class:"emailInput",type:"text",placeholder:P.$t("form.email"),modelValue:ke.email,"onUpdate:modelValue":q[18]||(q[18]=R=>ke.email=R),maxlength:"320",size:"large"},null,8,["placeholder","modelValue"])]),_:1},8,["rules"]),z(Tt,{prop:"phone",rules:[{required:!0,message:H(t)("message.phone"),trigger:"blur"},{validator:ur,trigger:"blur"}]},{default:Q(()=>[z(ye,{modelValue:ke.phone,"onUpdate:modelValue":q[19]||(q[19]=R=>
221ke.phone=R),dropdownOptions:ls.value,inputOptions:Ri.value,validCharactersOnly:"",autoDefaultCountry:"",onCountryChanged:us,onValidate:lr,onBlur:Ni,onClose:Ni},null,8,["modelValue","dropdownOptions","inputOptions"])]),_:1},8,["rules"]),z(Tt,null,{default:Q(()=>[z(Ye,{modelValue:ke.askHelpInfo,"onUpdate:modelValue":q[20]||(q[20]=R=>ke.askHelpInfo=R),rows:7,type:"textarea",maxlength:"500",placeholder:P.$t("form.requirements")},null,8,["modelValue","placeholder"])]),_:1})]),_:1},8,["model"]),L("div",oE,[q[45]||(q[45]=L("span",null,"*",-1)),fe(G(P.$t("form.tips")),1)]),L("div",lE,[z(dt,{type:"primary",onClick:dn},{default:Q(()=>[fe(G(P.$t("form.submit")),1)]),_:1})])])])),(_n=H(jt))!=null&&_n.length&&!H(e).isMobile?(W(),Z("div",mE,[L("div",gE,[L("div",_E,G(P.$t("news.title")),1),L("div",yE,[L("span",null,G(P.$t("news.subtitle")),1),q[47]||(q[47]=L("a",{class:"btn",href:"/news"},"More",-1))]),L("div",vE,[(W(!0),Z(Qe,null,ht(H(jt),R=>(W(),Z("div",{class:"news-item",key:R},[L("div",TE,[L("div",bE,[L("a",{class:"news-title ellipsis","data-aos":"fade-left","data-aos-duration":"800",href:`/news/${P.$forI18n(R.cn.title,R.eng.title)}-${R.cn.id||R.eng.id}`},[L("span",{title:P.$forI18n(R.cn.title,R.eng.title)},G(P.$forI18n(R.cn.title,R.eng.title)),9,xE)],8,SE),L("div",EE,[L("span",null,G(P.$forI18n(R.cn.publishDate,R.eng.publishDate)),1)]),L("a",{class:"abstract","data-aos":"fade-left","data-aos-duration":"1200",href:`/news/${P.$forI18n(R.cn.title,R.eng.title)}-${R.cn.id||R.eng.id}`},G(P.$forI18n(R.cn.digest,R.eng.digest)),9,CE)]),L("a",{class:"image","data-aos":"fade-up","data-aos-duration":"1000",href:`/news/${P.$forI18n(R.cn.title,R.eng.title)}-${R.cn.id||R.eng.id}`},[L("img",{alt:"",src:P.$forI18n(R.cn.image,R.eng.image)},null,8,wE)],8,AE)])]))),128))])])])):le("",!0),(zt=H(jt))!=null&&zt.length&&H(e).isMobile?(W(),Z("div",DE,[L("div",IE,G(P.$t("news.title")),1),L("div",kE,[L("span",null,G(P.$t("news.subtitle")),1)]),L("div",PE,[z(H(Co),{onSwiper:to,onSlideChange:io,"space-between":50,loop:H(jt).length>1},{default:Q(()=>[(W(!0),Z(Qe,null,ht(H(jt),R=>(W(),Bt(H(_s),{key:R},{default:Q(()=>[L("div",LE,[L("div",{class:"image","data-aos":"fade-up","data-aos-duration":"1000",onClick:ve=>H(r)(`/news/${P.$forI18n(R.cn.title,R.eng.title)}-${R.cn.id||R.eng.id}`)},[L("img",{alt:"",src:P.$forI18n(R.cn.image,R.eng.image)},null,8,RE)],8,OE),L("div",NE,[L("div",{class:"news-title ellipsis","data-aos":"fade-left","data-aos-duration":"800",onClick:ve=>H(r)(`/news/${P.$forI18n(R.cn.title,R.eng.title)}-${R.cn.id||R.eng.id}`)},[L("span",{title:P.$forI18n(R.cn.title,R.eng.title)},G(P.$forI18n(R.cn.title,R.eng.title)),9,BE)],8,ME),L("div",FE,[L("span",null,G(P.$forI18n(R.cn.publishDate,R.eng.publishDate)),1)]),L("div",{class:"abstract","data-aos":"fade-left","data-aos-duration":"1200",onClick:ve=>H(r)(`/news/${P.$forI18n(R.cn.title,R.eng.title)}-${R.cn.id||R.eng.id}`)},G(P.$forI18n(R.cn.digest,R.eng.digest)),9,UE)])])]),_:2},1024))),128))]),_:1},8,["loop"]),H(jt).length>1?(W(),Z("div",$E,[(W(!0),Z(Qe,null,ht(H(jt),(R,ve)=>(W(),Z("div",{class:Mn(pn.value===ve?"indicator-item active":"indicator-item"),key:R.id,onClick:Ui=>fn.value.slideToLoop(ve)},null,10,qE))),128))])):le("",!0)])])):le("",!0),L("div",jE,[L("div",HE,[(W(!0),Z(Qe,null,ht(so.value,(R,ve)=>(W(),Z("div",{class:"access-item",key:R,"data-aos":ve===0?"fade-right":"fade-left","data-aos-duration":"800"},[L("div",zE,[L("img",{alt:"",src:R.icon},null,8,GE),L("div",WE,[L("div",XE,G(R.title),1),L("div",KE,G(R.description),1),L("a",{href:R.link},[z(dt,{type:"primary"},{default:Q(()=>[fe(G(P.$t("quickAccess.viewNow")),1),q[48]||(q[48]=L("i",{class:"bi bi-arrow-right"},null,-1))]),_:1})],8,YE)])])],8,VE))),128))])]),z(H(f0),{show:Ti.value,sliderText:P.$t("puzzle.sliderText"),successText:P.$t("puzzle.successText"),failText:P.$t("puzzle.failText"),onSuccess:Za,onClose:hn},null,8,["show","sliderText","successText","failText"])])}}},rC=t0(QE,[["__scopeId","data-v-cf62830a"]]);export{rC as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.