chunk-1525d6f2.00126f41.js 1.2 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1525d6f2"],{"0129":function(e,t,i){"use strict";var n=function(){this.init=function(){var e={};this.on=function(t,i){e[t]||(e[t]=[]),e[t]=e[t].concat(i)},this.off=function(t,i){var n;return!!e[t]&&(n=e[t].indexOf(i),e[t]=e[t].slice(),e[t].splice(n,1),n>-1)},this.trigger=function(t){var i,n,r,s;if(i=e[t],i)if(2===arguments.length)for(r=i.length,n=0;n<r;++n)i[n].call(this,arguments[1]);else{for(s=[],n=arguments.length,n=1;n<arguments.length;++n)s.push(arguments[n]);for(r=i.length,n=0;n<r;++n)i[n].apply(this,s)}},this.dispose=function(){e={}}}};n.prototype.pipe=function(e){return this.on("data",(function(t){e.push(t)})),this.on("done",(function(t){e.flush(t)})),e},n.prototype.push=function(e){this.trigger("data",e)},n.prototype.flush=function(e){this.trigger("done",e)},e.exports=n},"0c1c":function(e,t,i){"use strict";e.exports=function(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}},"0de0":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return/mp4a\.\d+.\d+/i.test(e)},r=function(e){return/avc1\.[\da-f]+/i.test(e)},s=function(e){var t={type:"",parameters:{}},i=e.trim().split(";");return t.type=i.shift().trim(),i.forEach((function(e){var i=e.trim().split("=");if(i.length>1){var n=i[0].replace(/"/g,"").trim(),r=i[1].replace(/"/g,"").trim();t.parameters[n]=r}})),t},a=function(e){return e.map((function(e){return e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e,t,i){var n=("00"+Number(t).toString(16)).slice(-2),r=("00"+Number(i).toString(16)).slice(-2);return"avc1."+n+"00"+r}))}))};t["default"]={isAudioCodec:n,parseContentType:s,isVideoCodec:r,translateLegacyCodecs:a},e.exports=t["default"]},1283:function(e,t){var i={"":!0,up:!0};function n(e){if("string"!==typeof e)return!1;var t=i[e.toLowerCase()];return!!t&&e.toLowerCase()}function r(e){return"number"===typeof e&&e>=0&&e<=100}function s(){var e=100,t=3,i=0,s=100,a=0,o=100,l="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!r(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!==typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return s},set:function(e){if(!r(e))throw new Error("RegionAnchorX must be between 0 and 100.");s=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!r(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!r(e))throw new Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return a},set:function(e){if(!r(e))throw new Error("ViewportAnchorX must be between 0 and 100.");a=e}},scroll:{enumerable:!0,get:function(){return l},set:function(e){var t=n(e);if(!1===t)throw new SyntaxError("An invalid or illegal string was specified.");l=t}}})}e.exports=s},"12c6":function(e,t,i){
  2. /**
  3. * @license
  4. * Video.js 6.13.0 <http://videojs.com/>
  5. * Copyright Brightcove, Inc. <https://www.brightcove.com/>
  6. * Available under Apache License Version 2.0
  7. * <https://github.com/videojs/video.js/blob/master/LICENSE>
  8. *
  9. * Includes vtt.js <https://github.com/mozilla/vtt.js>
  10. * Available under Apache License Version 2.0
  11. * <https://github.com/mozilla/vtt.js/blob/master/LICENSE>
  12. */
  13. function n(e){return e&&"object"===typeof e&&"default"in e?e["default"]:e}var r=n(i("ea7c")),s=n(i("4742")),a=n(i("1b8d")),o=n(i("8c10")),l=n(i("eec7")),u=n(i("bec7")),c="6.13.0",h=r.navigator&&r.navigator.userAgent||"",d=/AppleWebKit\/([\d.]+)/i.exec(h),p=d?parseFloat(d.pop()):null,f=/iPad/i.test(h),m=/iPhone/i.test(h)&&!f,g=/iPod/i.test(h),y=m||f||g,v=function(){var e=h.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),_=/Android/i.test(h),b=function(){var e=h.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null}(),T=_&&/webkit/i.test(h)&&b<2.3,S=_&&b<5&&p<537,k=/Firefox/i.test(h),E=/Edge/i.test(h),w=!E&&(/Chrome/i.test(h)||/CriOS/i.test(h)),C=function(){var e=h.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),x=/MSIE\s8\.0/.test(h),A=function(){var e=/MSIE\s(\d+)\.\d/.exec(h),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(h)&&/rv:11.0/.test(h)&&(t=11),t}(),I=/Safari/i.test(h)&&!w&&!_&&!E,O=(I||y)&&!w,P=ie()&&("ontouchstart"in r||r.navigator.maxTouchPoints||r.DocumentTouch&&r.document instanceof r.DocumentTouch),L=ie()&&"backgroundSize"in r.document.createElement("video").style,D=(Object.freeze||Object)({IS_IPAD:f,IS_IPHONE:m,IS_IPOD:g,IS_IOS:y,IOS_VERSION:v,IS_ANDROID:_,ANDROID_VERSION:b,IS_OLD_ANDROID:T,IS_NATIVE_ANDROID:S,IS_FIREFOX:k,IS_EDGE:E,IS_CHROME:w,CHROME_VERSION:C,IS_IE8:x,IE_VERSION:A,IS_SAFARI:I,IS_ANY_SAFARI:O,TOUCH_ENABLED:P,BACKGROUND_SIZE_SUPPORTED:L}),M="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},R=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},N=function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},j=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t},B=function(e,t){return e.raw=t,e},U=Object.prototype.toString,F=function(e){return z(e)?Object.keys(e):[]};function q(e,t){F(e).forEach((function(i){return t(e[i],i)}))}function H(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return F(e).reduce((function(i,n){return t(i,e[n],n)}),i)}function V(e){for(var t=arguments.length,i=Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return Object.assign?Object.assign.apply(Object,[e].concat(i)):(i.forEach((function(t){t&&q(t,(function(t,i){e[i]=t}))})),e)}function z(e){return!!e&&"object"===("undefined"===typeof e?"undefined":M(e))}function W(e){return z(e)&&"[object Object]"===U.call(e)&&e.constructor===Object}var $=[],G=function(e,t){return function(i,n,s,a){var o=t.levels[n],l=new RegExp("^("+o+")$");if("log"!==i&&s.unshift(i.toUpperCase()+":"),s.unshift(e+":"),$&&$.push([].concat(s)),r.console){var u=r.console[i];u||"debug"!==i||(u=r.console.info||r.console.log),u&&o&&l.test(i)&&(a&&(s=s.map((function(e){if(z(e)||Array.isArray(e))try{return JSON.stringify(e)}catch(t){return String(e)}return String(e)})).join(" ")),u.apply?u[Array.isArray(s)?"apply":"call"](r.console,s):u(s))}}};function X(e){var t="info",i=void 0,n=function e(){for(var n=e.stringify||A&&A<11,r=arguments.length,s=Array(r),a=0;a<r;a++)s[a]=arguments[a];i("log",t,s,n)};return i=G(e,n),n.createLogger=function(t){return X(e+": "+t)},n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:t},n.level=function(e){if("string"===typeof e){if(!n.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');t=e}return t},n.history=function(){return $?[].concat($):[]},n.history.filter=function(e){return($||[]).filter((function(t){return new RegExp(".*"+e+".*").test(t[0])}))},n.history.clear=function(){$&&($.length=0)},n.history.disable=function(){null!==$&&($.length=0,$=null)},n.history.enable=function(){null===$&&($=[])},n.error=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return i("error",t,n)},n.warn=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return i("warn",t,n)},n.debug=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return i("debug",t,n)},n}var K=X("VIDEOJS"),Y=K.createLogger;function Q(e,t){if(!e||!t)return"";if("function"===typeof r.getComputedStyle){var i=r.getComputedStyle(e);return i?i[t]:""}return e.currentStyle[t]||""}var J=B(["Setting attributes in the second argument of createEl()\n has been deprecated. Use the third argument instead.\n createEl(type, properties, attributes). Attempting to set "," to ","."],["Setting attributes in the second argument of createEl()\n has been deprecated. Use the third argument instead.\n createEl(type, properties, attributes). Attempting to set "," to ","."]);function Z(e){return"string"===typeof e&&/\S/.test(e)}function ee(e){if(/\s/.test(e))throw new Error("class has illegal whitespace characters")}function te(e){return new RegExp("(^|\\s)"+e+"($|\\s)")}function ie(){return s===r.document&&"undefined"!==typeof s.createElement}function ne(e){return z(e)&&1===e.nodeType}function re(){try{return r.parent!==r.self}catch(e){return!0}}function se(e){return function(t,i){if(!Z(t))return s[e](null);Z(i)&&(i=s.querySelector(i));var n=ne(i)?i:s;return n[e]&&n[e](t)}}function ae(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments[3],r=s.createElement(e);return Object.getOwnPropertyNames(t).forEach((function(e){var i=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(K.warn(a(J,e,i)),r.setAttribute(e,i)):"textContent"===e?oe(r,i):r[e]=i})),Object.getOwnPropertyNames(i).forEach((function(e){r.setAttribute(e,i[e])})),n&&Ce(r,n),r}function oe(e,t){return"undefined"===typeof e.textContent?e.innerText=t:e.textContent=t,e}function le(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function ue(e,t){return ee(t),e.classList?e.classList.contains(t):te(t).test(e.className)}function ce(e,t){return e.classList?e.classList.add(t):ue(e,t)||(e.className=(e.className+" "+t).trim()),e}function he(e,t){return e.classList?e.classList.remove(t):(ee(t),e.className=e.className.split(/\s+/).filter((function(e){return e!==t})).join(" ")),e}function de(e,t,i){var n=ue(e,t);if("function"===typeof i&&(i=i(e,t)),"boolean"!==typeof i&&(i=!n),i!==n)return i?ce(e,t):he(e,t),e}function pe(e,t){Object.getOwnPropertyNames(t).forEach((function(i){var n=t[i];null===n||"undefined"===typeof n||!1===n?e.removeAttribute(i):e.setAttribute(i,!0===n?"":n)}))}function fe(e){var t={},i=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(e&&e.attributes&&e.attributes.length>0)for(var n=e.attributes,r=n.length-1;r>=0;r--){var s=n[r].name,a=n[r].value;"boolean"!==typeof e[s]&&-1===i.indexOf(","+s+",")||(a=null!==a),t[s]=a}return t}function me(e,t){return e.getAttribute(t)}function ge(e,t,i){e.setAttribute(t,i)}function ye(e,t){e.removeAttribute(t)}function ve(){s.body.focus(),s.onselectstart=function(){return!1}}function _e(){s.onselectstart=function(){return!0}}function be(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach((function(e){void 0!==t[e]&&(i[e]=t[e])})),i.height||(i.height=parseFloat(Q(e,"height"))),i.width||(i.width=parseFloat(Q(e,"width"))),i}}function Te(e){var t=void 0;if(e.getBoundingClientRect&&e.parentNode&&(t=e.getBoundingClientRect()),!t)return{left:0,top:0};var i=s.documentElement,n=s.body,a=i.clientLeft||n.clientLeft||0,o=r.pageXOffset||n.scrollLeft,l=t.left+o-a,u=i.clientTop||n.clientTop||0,c=r.pageYOffset||n.scrollTop,h=t.top+c-u;return{left:Math.round(l),top:Math.round(h)}}function Se(e,t){var i={},n=Te(e),r=e.offsetWidth,s=e.offsetHeight,a=n.top,o=n.left,l=t.pageY,u=t.pageX;return t.changedTouches&&(u=t.changedTouches[0].pageX,l=t.changedTouches[0].pageY),i.y=Math.max(0,Math.min(1,(a-l+s)/s)),i.x=Math.max(0,Math.min(1,(u-o)/r)),i}function ke(e){return z(e)&&3===e.nodeType}function Ee(e){while(e.firstChild)e.removeChild(e.firstChild);return e}function we(e){return"function"===typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((function(e){return"function"===typeof e&&(e=e()),ne(e)||ke(e)?e:"string"===typeof e&&/\S/.test(e)?s.createTextNode(e):void 0})).filter((function(e){return e}))}function Ce(e,t){return we(t).forEach((function(t){return e.appendChild(t)})),e}function xe(e,t){return Ce(Ee(e),t)}function Ae(e){return void 0===e.button&&void 0===e.buttons||(0===e.button&&void 0===e.buttons||(9===A||0===e.button&&1===e.buttons))}var Ie=se("querySelector"),Oe=se("querySelectorAll"),Pe=(Object.freeze||Object)({isReal:ie,isEl:ne,isInFrame:re,createEl:ae,textContent:oe,prependTo:le,hasClass:ue,addClass:ce,removeClass:he,toggleClass:de,setAttributes:pe,getAttributes:fe,getAttribute:me,setAttribute:ge,removeAttribute:ye,blockTextSelection:ve,unblockTextSelection:_e,getBoundingClientRect:be,findPosition:Te,getPointerPosition:Se,isTextNode:ke,emptyEl:Ee,normalizeContent:we,appendContent:Ce,insertContent:xe,isSingleLeftClick:Ae,$:Ie,$$:Oe}),Le=1;function De(){return Le++}var Me={},Re="vdata"+(new Date).getTime();function Ne(e){var t=e[Re];return t||(t=e[Re]=De()),Me[t]||(Me[t]={}),Me[t]}function je(e){var t=e[Re];return!!t&&!!Object.getOwnPropertyNames(Me[t]).length}function Be(e){var t=e[Re];if(t){delete Me[t];try{delete e[Re]}catch(i){e.removeAttribute?e.removeAttribute(Re):e[Re]=null}}}function Ue(e,t){var i=Ne(e);0===i.handlers[t].length&&(delete i.handlers[t],e.removeEventListener?e.removeEventListener(t,i.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&Be(e)}function Fe(e,t,i,n){i.forEach((function(i){e(t,i,n)}))}function qe(e){function t(){return!0}function i(){return!1}if(!e||!e.isPropagationStopped){var n=e||r.event;for(var a in e={},n)"layerX"!==a&&"layerY"!==a&&"keyLocation"!==a&&"webkitMovementX"!==a&&"webkitMovementY"!==a&&("returnValue"===a&&n.preventDefault||(e[a]=n[a]));if(e.target||(e.target=e.srcElement||s),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){n.preventDefault&&n.preventDefault(),e.returnValue=!1,n.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){n.stopPropagation&&n.stopPropagation(),e.cancelBubble=!0,n.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=i,e.stopImmediatePropagation=function(){n.stopImmediatePropagation&&n.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=i,null!==e.clientX&&void 0!==e.clientX){var o=s.documentElement,l=s.body;e.pageX=e.clientX+(o&&o.scrollLeft||l&&l.scrollLeft||0)-(o&&o.clientLeft||l&&l.clientLeft||0),e.pageY=e.clientY+(o&&o.scrollTop||l&&l.scrollTop||0)-(o&&o.clientTop||l&&l.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e}var He=!1;(function(){try{var e=Object.defineProperty({},"passive",{get:function(){He=!0}});r.addEventListener("test",null,e),r.removeEventListener("test",null,e)}catch(t){}})();var Ve=["touchstart","touchmove"];function ze(e,t,i){if(Array.isArray(t))return Fe(ze,e,t,i);var n=Ne(e);if(n.handlers||(n.handlers={}),n.handlers[t]||(n.handlers[t]=[]),i.guid||(i.guid=De()),n.handlers[t].push(i),n.dispatcher||(n.disabled=!1,n.dispatcher=function(t,i){if(!n.disabled){t=qe(t);var r=n.handlers[t.type];if(r)for(var s=r.slice(0),a=0,o=s.length;a<o;a++){if(t.isImmediatePropagationStopped())break;try{s[a].call(e,t,i)}catch(l){K.error(l)}}}}),1===n.handlers[t].length)if(e.addEventListener){var r=!1;He&&Ve.indexOf(t)>-1&&(r={passive:!0}),e.addEventListener(t,n.dispatcher,r)}else e.attachEvent&&e.attachEvent("on"+t,n.dispatcher)}function We(e,t,i){if(je(e)){var n=Ne(e);if(n.handlers){if(Array.isArray(t))return Fe(We,e,t,i);var r=function(e,t){n.handlers[t]=[],Ue(e,t)};if(void 0!==t){var s=n.handlers[t];if(s)if(i){if(i.guid)for(var a=0;a<s.length;a++)s[a].guid===i.guid&&s.splice(a--,1);Ue(e,t)}else r(e,t)}else for(var o in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},o)&&r(e,o)}}}function $e(e,t,i){var n=je(e)?Ne(e):{},r=e.parentNode||e.ownerDocument;if("string"===typeof t?t={type:t,target:e}:t.target||(t.target=e),t=qe(t),n.dispatcher&&n.dispatcher.call(e,t,i),r&&!t.isPropagationStopped()&&!0===t.bubbles)$e.call(null,r,t,i);else if(!r&&!t.defaultPrevented){var s=Ne(t.target);t.target[t.type]&&(s.disabled=!0,"function"===typeof t.target[t.type]&&t.target[t.type](),s.disabled=!1)}return!t.defaultPrevented}function Ge(e,t,i){if(Array.isArray(t))return Fe(Ge,e,t,i);var n=function n(){We(e,t,n),i.apply(this,arguments)};n.guid=i.guid=i.guid||De(),ze(e,t,n)}var Xe=(Object.freeze||Object)({fixEvent:qe,on:ze,off:We,trigger:$e,one:Ge}),Ke=!1,Ye=void 0,Qe=function(){if(ie()&&!1!==Ye.options.autoSetup){var e=s.getElementsByTagName("video"),t=s.getElementsByTagName("audio"),i=s.getElementsByTagName("video-js"),n=[];if(e&&e.length>0)for(var r=0,a=e.length;r<a;r++)n.push(e[r]);if(t&&t.length>0)for(var o=0,l=t.length;o<l;o++)n.push(t[o]);if(i&&i.length>0)for(var u=0,c=i.length;u<c;u++)n.push(i[u]);if(n&&n.length>0)for(var h=0,d=n.length;h<d;h++){var p=n[h];if(!p||!p.getAttribute){Je(1);break}if(void 0===p.player){var f=p.getAttribute("data-setup");null!==f&&Ye(p)}}else Ke||Je(1)}};function Je(e,t){t&&(Ye=t),r.setTimeout(Qe,e)}ie()&&"complete"===s.readyState?Ke=!0:Ge(r,"load",(function(){Ke=!0}));var Ze=function(e){var t=s.createElement("style");return t.className=e,t},et=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t},tt=function(e,t,i){t.guid||(t.guid=De());var n=function(){return t.apply(e,arguments)};return n.guid=i?i+"_"+t.guid:t.guid,n},it=function(e,t){var i=Date.now(),n=function(){var n=Date.now();n-i>=t&&(e.apply(void 0,arguments),i=n)};return n},nt=function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r,s=void 0,a=function(){n.clearTimeout(s),s=null},o=function(){var r=this,a=arguments,o=function(){s=null,o=null,i||e.apply(r,a)};!s&&i&&e.apply(r,a),n.clearTimeout(s),s=n.setTimeout(o,t)};return o.cancel=a,o},rt=function(){};rt.prototype.allowedEvents_={},rt.prototype.on=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},ze(this,e,t),this.addEventListener=i},rt.prototype.addEventListener=rt.prototype.on,rt.prototype.off=function(e,t){We(this,e,t)},rt.prototype.removeEventListener=rt.prototype.off,rt.prototype.one=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},Ge(this,e,t),this.addEventListener=i},rt.prototype.trigger=function(e){var t=e.type||e;"string"===typeof e&&(e={type:t}),e=qe(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),$e(this,e)},rt.prototype.dispatchEvent=rt.prototype.trigger;var st=function(e){return e instanceof rt||!!e.eventBusEl_&&["on","one","off","trigger"].every((function(t){return"function"===typeof e[t]}))},at=function(e){return"string"===typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},ot=function(e){if(!e.nodeName&&!st(e))throw new Error("Invalid target; must be a DOM node or evented object.")},lt=function(e){if(!at(e))throw new Error("Invalid event type; must be a non-empty string or array.")},ut=function(e){if("function"!==typeof e)throw new Error("Invalid listener; must be a function.")},ct=function(e,t){var i=t.length<3||t[0]===e||t[0]===e.eventBusEl_,n=void 0,r=void 0,s=void 0;return i?(n=e.eventBusEl_,t.length>=3&&t.shift(),r=t[0],s=t[1]):(n=t[0],r=t[1],s=t[2]),ot(n),lt(r),ut(s),s=tt(e,s),{isTargetingSelf:i,target:n,type:r,listener:s}},ht=function(e,t,i,n){ot(e),e.nodeName?Xe[t](e,i,n):e[t](i,n)},dt={on:function(){for(var e=this,t=arguments.length,i=Array(t),n=0;n<t;n++)i[n]=arguments[n];var r=ct(this,i),s=r.isTargetingSelf,a=r.target,o=r.type,l=r.listener;if(ht(a,"on",o,l),!s){var u=function(){return e.off(a,o,l)};u.guid=l.guid;var c=function(){return e.off("dispose",u)};c.guid=l.guid,ht(this,"on","dispose",u),ht(a,"on","dispose",c)}},one:function(){for(var e=this,t=arguments.length,i=Array(t),n=0;n<t;n++)i[n]=arguments[n];var r=ct(this,i),s=r.isTargetingSelf,a=r.target,o=r.type,l=r.listener;if(s)ht(a,"one",o,l);else{var u=function t(){for(var i=arguments.length,n=Array(i),r=0;r<i;r++)n[r]=arguments[r];e.off(a,o,t),l.apply(null,n)};u.guid=l.guid,ht(a,"one",o,u)}},off:function(e,t,i){if(!e||at(e))We(this.eventBusEl_,e,t);else{var n=e,r=t;ot(n),lt(r),ut(i),i=tt(this,i),this.off("dispose",i),n.nodeName?(We(n,r,i),We(n,"dispose",i)):st(n)&&(n.off(r,i),n.off("dispose",i))}},trigger:function(e,t){return $e(this.eventBusEl_,e,t)}};function pt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.eventBusKey;if(i){if(!e[i].nodeName)throw new Error('The eventBusKey "'+i+'" does not refer to an element.');e.eventBusEl_=e[i]}else e.eventBusEl_=ae("span",{className:"vjs-event-bus"});return V(e,dt),e.on("dispose",(function(){e.off(),r.setTimeout((function(){e.eventBusEl_=null}),0)})),e}var ft={state:{},setState:function(e){var t=this;"function"===typeof e&&(e=e());var i=void 0;return q(e,(function(e,n){t.state[n]!==e&&(i=i||{},i[n]={from:t.state[n],to:e}),t.state[n]=e})),i&&st(this)&&this.trigger({changes:i,type:"statechanged"}),i}};function mt(e,t){return V(e,ft),e.state=V({},e.state,t),"function"===typeof e.handleStateChanged&&st(e)&&e.on("statechanged",e.handleStateChanged),e}function gt(e){return"string"!==typeof e?e:e.charAt(0).toUpperCase()+e.slice(1)}function yt(e,t){return gt(e)===gt(t)}function vt(){for(var e={},t=arguments.length,i=Array(t),n=0;n<t;n++)i[n]=arguments[n];return i.forEach((function(t){t&&q(t,(function(t,i){W(t)?(W(e[i])||(e[i]={}),e[i]=vt(e[i],t)):e[i]=t}))})),e}var _t=function(){function e(t,i,n){if(R(this,e),!t&&this.play?this.player_=t=this:this.player_=t,this.options_=vt({},this.options_),i=this.options_=vt(this.options_,i),this.id_=i.id||i.el&&i.el.id,!this.id_){var r=t&&t.id&&t.id()||"no_player";this.id_=r+"_component_"+De()}this.name_=i.name||null,i.el?this.el_=i.el:!1!==i.createEl&&(this.el_=this.createEl()),!1!==i.evented&&pt(this,{eventBusKey:this.el_?"el_":null}),mt(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},!1!==i.initChildren&&this.initChildren(),this.ready(n),!1!==i.reportTouchActivity&&this.enableTouchActivity()}return e.prototype.dispose=function(){if(this.trigger({type:"dispose",bubbles:!1}),this.children_)for(var e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),Be(this.el_),this.el_=null),this.player_=null},e.prototype.player=function(){return this.player_},e.prototype.options=function(e){return K.warn("this.options() has been deprecated and will be moved to the constructor in 6.0"),e?(this.options_=vt(this.options_,e),this.options_):this.options_},e.prototype.el=function(){return this.el_},e.prototype.createEl=function(e,t,i){return ae(e,t,i)},e.prototype.localize=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,n=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),s=r&&r[n],a=n&&n.split("-")[0],o=r&&r[a],l=i;return s&&s[e]?l=s[e]:o&&o[e]&&(l=o[e]),t&&(l=l.replace(/\{(\d+)\}/g,(function(e,i){var n=t[i-1],r=n;return"undefined"===typeof n&&(r=e),r}))),l},e.prototype.contentEl=function(){return this.contentEl_||this.el_},e.prototype.id=function(){return this.id_},e.prototype.name=function(){return this.name_},e.prototype.children=function(){return this.children_},e.prototype.getChildById=function(e){return this.childIndex_[e]},e.prototype.getChild=function(e){if(e)return e=gt(e),this.childNameIndex_[e]},e.prototype.addChild=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.children_.length,r=void 0,s=void 0;if("string"===typeof t){s=gt(t);var a=i.componentClass||s;i.name=s;var o=e.getComponent(a);if(!o)throw new Error("Component "+a+" does not exist");if("function"!==typeof o)return null;r=new o(this.player_||this,i)}else r=t;if(this.children_.splice(n,0,r),"function"===typeof r.id&&(this.childIndex_[r.id()]=r),s=s||r.name&&gt(r.name()),s&&(this.childNameIndex_[s]=r),"function"===typeof r.el&&r.el()){var l=this.contentEl().children,u=l[n]||null;this.contentEl().insertBefore(r.el(),u)}return r},e.prototype.removeChild=function(e){if("string"===typeof e&&(e=this.getChild(e)),e&&this.children_){for(var t=!1,i=this.children_.length-1;i>=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(t){this.childIndex_[e.id()]=null,this.childNameIndex_[e.name()]=null;var n=e.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},e.prototype.initChildren=function(){var t=this,i=this.options_.children;if(i){var n=this.options_,r=function(e){var i=e.name,r=e.opts;if(void 0!==n[i]&&(r=n[i]),!1!==r){!0===r&&(r={}),r.playerOptions=t.options_.playerOptions;var s=t.addChild(i,r);s&&(t[i]=s)}},s=void 0,a=e.getComponent("Tech");s=Array.isArray(i)?i:Object.keys(i),s.concat(Object.keys(this.options_).filter((function(e){return!s.some((function(t){return"string"===typeof t?e===t:e===t.name}))}))).map((function(e){var n=void 0,r=void 0;return"string"===typeof e?(n=e,r=i[n]||t.options_[n]||{}):(n=e.name,r=e),{name:n,opts:r}})).filter((function(t){var i=e.getComponent(t.opts.componentClass||gt(t.name));return i&&!a.isTech(i)})).forEach(r)}},e.prototype.buildCSSClass=function(){return""},e.prototype.ready=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},e.prototype.triggerReady=function(){this.isReady_=!0,this.setTimeout((function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach((function(e){e.call(this)}),this),this.trigger("ready")}),1)},e.prototype.$=function(e,t){return Ie(e,t||this.contentEl())},e.prototype.$$=function(e,t){return Oe(e,t||this.contentEl())},e.prototype.hasClass=function(e){return ue(this.el_,e)},e.prototype.addClass=function(e){ce(this.el_,e)},e.prototype.removeClass=function(e){he(this.el_,e)},e.prototype.toggleClass=function(e,t){de(this.el_,e,t)},e.prototype.show=function(){this.removeClass("vjs-hidden")},e.prototype.hide=function(){this.addClass("vjs-hidden")},e.prototype.lockShowing=function(){this.addClass("vjs-lock-showing")},e.prototype.unlockShowing=function(){this.removeClass("vjs-lock-showing")},e.prototype.getAttribute=function(e){return me(this.el_,e)},e.prototype.setAttribute=function(e,t){ge(this.el_,e,t)},e.prototype.removeAttribute=function(e){ye(this.el_,e)},e.prototype.width=function(e,t){return this.dimension("width",e,t)},e.prototype.height=function(e,t){return this.dimension("height",e,t)},e.prototype.dimensions=function(e,t){this.width(e,!0),this.height(t)},e.prototype.dimension=function(e,t,i){if(void 0!==t)return null!==t&&t===t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;var n=this.el_.style[e],r=n.indexOf("px");return-1!==r?parseInt(n.slice(0,r),10):parseInt(this.el_["offset"+gt(e)],10)},e.prototype.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if("function"===typeof r.getComputedStyle){var i=r.getComputedStyle(this.el_);t=i.getPropertyValue(e)||i[e]}if(t=parseFloat(t),0===t){var n="offset"+gt(e);t=this.el_[n]}return t},e.prototype.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},e.prototype.currentWidth=function(){return this.currentDimension("width")},e.prototype.currentHeight=function(){return this.currentDimension("height")},e.prototype.focus=function(){this.el_.focus()},e.prototype.blur=function(){this.el_.blur()},e.prototype.emitTapEvents=function(){var e=0,t=null,i=10,n=200,r=void 0;this.on("touchstart",(function(i){1===i.touches.length&&(t={pageX:i.touches[0].pageX,pageY:i.touches[0].pageY},e=(new Date).getTime(),r=!0)})),this.on("touchmove",(function(e){if(e.touches.length>1)r=!1;else if(t){var n=e.touches[0].pageX-t.pageX,s=e.touches[0].pageY-t.pageY,a=Math.sqrt(n*n+s*s);a>i&&(r=!1)}}));var s=function(){r=!1};this.on("touchleave",s),this.on("touchcancel",s),this.on("touchend",(function(i){if(t=null,!0===r){var s=(new Date).getTime()-e;s<n&&(i.preventDefault(),this.trigger("tap"))}}))},e.prototype.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e=tt(this.player(),this.player().reportUserActivity),t=void 0;this.on("touchstart",(function(){e(),this.clearInterval(t),t=this.setInterval(e,250)}));var i=function(i){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",i),this.on("touchcancel",i)}},e.prototype.setTimeout=function(e,t){var i,n,s=this;return e=tt(this,e),i=r.setTimeout((function(){s.off("dispose",n),e()}),t),n=function(){return s.clearTimeout(i)},n.guid="vjs-timeout-"+i,this.on("dispose",n),i},e.prototype.clearTimeout=function(e){r.clearTimeout(e);var t=function(){};return t.guid="vjs-timeout-"+e,this.off("dispose",t),e},e.prototype.setInterval=function(e,t){var i=this;e=tt(this,e);var n=r.setInterval(e,t),s=function(){return i.clearInterval(n)};return s.guid="vjs-interval-"+n,this.on("dispose",s),n},e.prototype.clearInterval=function(e){r.clearInterval(e);var t=function(){};return t.guid="vjs-interval-"+e,this.off("dispose",t),e},e.prototype.requestAnimationFrame=function(e){var t,i,n=this;return this.supportsRaf_?(e=tt(this,e),t=r.requestAnimationFrame((function(){n.off("dispose",i),e()})),i=function(){return n.cancelAnimationFrame(t)},i.guid="vjs-raf-"+t,this.on("dispose",i),t):this.setTimeout(e,1e3/60)},e.prototype.cancelAnimationFrame=function(e){if(this.supportsRaf_){r.cancelAnimationFrame(e);var t=function(){};return t.guid="vjs-raf-"+e,this.off("dispose",t),e}return this.clearTimeout(e)},e.registerComponent=function(t,i){if("string"!==typeof t||!t)throw new Error('Illegal component name, "'+t+'"; must be a non-empty string.');var n=e.getComponent("Tech"),r=n&&n.isTech(i),s=e===i||e.prototype.isPrototypeOf(i.prototype);if(r||!s){var a=void 0;throw a=r?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+t+'"; '+a+".")}t=gt(t),e.components_||(e.components_={});var o=e.getComponent("Player");if("Player"===t&&o&&o.players){var l=o.players,u=Object.keys(l);if(l&&u.length>0&&u.map((function(e){return l[e]})).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return e.components_[t]=i,i},e.getComponent=function(t){if(t)return t=gt(t),e.components_&&e.components_[t]?e.components_[t]:void 0},e}();function bt(e,t,i){if("number"!==typeof t||t<0||t>i)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+i+").")}function Tt(e,t,i,n){return bt(e,n,i.length-1),i[n][t]}function St(e){return void 0===e||0===e.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:Tt.bind(null,"start",0,e),end:Tt.bind(null,"end",1,e)}}function kt(e,t){return Array.isArray(e)?St(e):void 0===e||void 0===t?St():St([[e,t]])}function Et(e,t){var i=0,n=void 0,r=void 0;if(!t)return 0;e&&e.length||(e=kt(0,0));for(var s=0;s<e.length;s++)n=e.start(s),r=e.end(s),r>t&&(r=t),i+=r-n;return i/t}_t.prototype.supportsRaf_="function"===typeof r.requestAnimationFrame&&"function"===typeof r.cancelAnimationFrame,_t.registerComponent("Component",_t);for(var wt={},Ct=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],xt=Ct[0],At=void 0,It=0;It<Ct.length;It++)if(Ct[It][1]in s){At=Ct[It];break}if(At)for(var Ot=0;Ot<At.length;Ot++)wt[xt[Ot]]=At[Ot];function Pt(e){if(e instanceof Pt)return e;"number"===typeof e?this.code=e:"string"===typeof e?this.message=e:z(e)&&("number"===typeof e.code&&(this.code=e.code),V(this,e)),this.message||(this.message=Pt.defaultMessages[this.code]||"")}Pt.prototype.code=0,Pt.prototype.message="",Pt.prototype.status=null,Pt.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Pt.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."};for(var Lt=0;Lt<Pt.errorTypes.length;Lt++)Pt[Pt.errorTypes[Lt]]=Lt,Pt.prototype[Pt.errorTypes[Lt]]=Lt;function Dt(e){return void 0!==e&&null!==e&&"function"===typeof e.then}function Mt(e){Dt(e)&&e.then(null,(function(e){}))}var Rt=function(e){var t=["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((function(t,i,n){return e[i]&&(t[i]=e[i]),t}),{cues:e.cues&&Array.prototype.map.call(e.cues,(function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}}))});return t},Nt=function(e){var t=e.$$("track"),i=Array.prototype.map.call(t,(function(e){return e.track})),n=Array.prototype.map.call(t,(function(e){var t=Rt(e.track);return e.src&&(t.src=e.src),t}));return n.concat(Array.prototype.filter.call(e.textTracks(),(function(e){return-1===i.indexOf(e)})).map(Rt))},jt=function(e,t){return e.forEach((function(e){var i=t.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach((function(e){return i.addCue(e)}))})),t.textTracks()},Bt={textTracksToJson:Nt,jsonToTextTracks:jt,trackToJson_:Rt},Ut="vjs-modal-dialog",Ft=27,qt=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.opened_=r.hasBeenOpened_=r.hasBeenFilled_=!1,r.closeable(!r.options_.uncloseable),r.content(r.options_.content),r.contentEl_=ae("div",{className:Ut+"-content"},{role:"document"}),r.descEl_=ae("p",{className:Ut+"-description vjs-control-text",id:r.el().getAttribute("aria-describedby")}),oe(r.descEl_,r.description()),r.el_.appendChild(r.descEl_),r.el_.appendChild(r.contentEl_),r}return N(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},t.prototype.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,e.prototype.dispose.call(this)},t.prototype.buildCSSClass=function(){return Ut+" vjs-hidden "+e.prototype.buildCSSClass.call(this)},t.prototype.handleKeyPress=function(e){e.which===Ft&&this.closeable()&&this.close()},t.prototype.label=function(){return this.localize(this.options_.label||"Modal Window")},t.prototype.description=function(){var 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},t.prototype.open=function(){if(!this.opened_){var 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.closeable()&&this.on(this.el_.ownerDocument,"keydown",tt(this,this.handleKeyPress)),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}},t.prototype.opened=function(e){return"boolean"===typeof e&&this[e?"open":"close"](),this.opened_},t.prototype.close=function(){if(this.opened_){var e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.closeable()&&this.off(this.el_.ownerDocument,"keydown",tt(this,this.handleKeyPress)),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}},t.prototype.closeable=function(e){if("boolean"===typeof e){var t=this.closeable_=!!e,i=this.getChild("closeButton");if(t&&!i){var n=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=n,this.on(i,"close",this.close)}!t&&i&&(this.off(i,"close",this.close),this.removeChild(i),i.dispose())}return this.closeable_},t.prototype.fill=function(){this.fillWith(this.content())},t.prototype.fillWith=function(e){var t=this.contentEl(),i=t.parentNode,n=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),xe(t,e),this.trigger("modalfill"),n?i.insertBefore(t,n):i.appendChild(t);var r=this.getChild("closeButton");r&&i.appendChild(r.el_)},t.prototype.empty=function(){this.trigger("beforemodalempty"),Ee(this.contentEl()),this.trigger("modalempty")},t.prototype.content=function(e){return"undefined"!==typeof e&&(this.content_=e),this.content_},t.prototype.conditionalFocus_=function(){var e=s.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus(),this.on(s,"keydown",this.handleKeyDown))},t.prototype.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null),this.off(s,"keydown",this.handleKeyDown)},t.prototype.handleKeyDown=function(e){if(9===e.which){for(var t=this.focusableEls_(),i=this.el_.querySelector(":focus"),n=void 0,r=0;r<t.length;r++)if(i===t[r]){n=r;break}s.activeElement===this.el_&&(n=0),e.shiftKey&&0===n?(t[t.length-1].focus(),e.preventDefault()):e.shiftKey||n!==t.length-1||(t[0].focus(),e.preventDefault())}},t.prototype.focusableEls_=function(){var e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,(function(e){return(e instanceof r.HTMLAnchorElement||e instanceof r.HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof r.HTMLInputElement||e instanceof r.HTMLSelectElement||e instanceof r.HTMLTextAreaElement||e instanceof r.HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof r.HTMLIFrameElement||e instanceof r.HTMLObjectElement||e instanceof r.HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable")}))},t}(_t);qt.prototype.options_={pauseOnOpen:!0,temporary:!0},_t.registerComponent("ModalDialog",qt);var Ht=function(e){function t(){var i,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;R(this,t);var a=j(this,e.call(this));if(!r&&(r=a,x))for(var o in r=s.createElement("custom"),t.prototype)"constructor"!==o&&(r[o]=t.prototype[o]);r.tracks_=[],Object.defineProperty(r,"length",{get:function(){return this.tracks_.length}});for(var l=0;l<n.length;l++)r.addTrack(n[l]);return i=r,j(a,i)}return N(t,e),t.prototype.addTrack=function(e){var t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.tracks_[t]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack"}))},t.prototype.removeTrack=function(e){for(var t=void 0,i=0,n=this.length;i<n;i++)if(this[i]===e){t=this[i],t.off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack"})},t.prototype.getTrackById=function(e){for(var t=null,i=0,n=this.length;i<n;i++){var r=this[i];if(r.id===e){t=r;break}}return t},t}(rt);for(var Vt in Ht.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack"},Ht.prototype.allowedEvents_)Ht.prototype["on"+Vt]=null;var zt=function(e,t){for(var i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].enabled=!1)},Wt=function(e){function t(){var i,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];R(this,t);for(var a=void 0,o=r.length-1;o>=0;o--)if(r[o].enabled){zt(r,r[o]);break}if(x){for(var l in a=s.createElement("custom"),Ht.prototype)"constructor"!==l&&(a[l]=Ht.prototype[l]);for(var u in t.prototype)"constructor"!==u&&(a[u]=t.prototype[u])}return i=j(this,e.call(this,r,a)),a=i,a.changing_=!1,n=a,j(i,n)}return N(t,e),t.prototype.addTrack=function(t){var i=this;t.enabled&&zt(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&t.addEventListener("enabledchange",(function(){i.changing_||(i.changing_=!0,zt(i,t),i.changing_=!1,i.trigger("change"))}))},t}(Ht),$t=function(e,t){for(var i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].selected=!1)},Gt=function(e){function t(){var i,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];R(this,t);for(var a=void 0,o=r.length-1;o>=0;o--)if(r[o].selected){$t(r,r[o]);break}if(x){for(var l in a=s.createElement("custom"),Ht.prototype)"constructor"!==l&&(a[l]=Ht.prototype[l]);for(var u in t.prototype)"constructor"!==u&&(a[u]=t.prototype[u])}return i=j(this,e.call(this,r,a)),a=i,a.changing_=!1,Object.defineProperty(a,"selectedIndex",{get:function(){for(var e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set:function(){}}),n=a,j(i,n)}return N(t,e),t.prototype.addTrack=function(t){var i=this;t.selected&&$t(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&t.addEventListener("selectedchange",(function(){i.changing_||(i.changing_=!0,$t(i,t),i.changing_=!1,i.trigger("change"))}))},t}(Ht),Xt=function(e){function t(){var i,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];R(this,t);var a=void 0;if(x){for(var o in a=s.createElement("custom"),Ht.prototype)"constructor"!==o&&(a[o]=Ht.prototype[o]);for(var l in t.prototype)"constructor"!==l&&(a[l]=t.prototype[l])}return i=j(this,e.call(this,r,a)),a=i,n=a,j(i,n)}return N(t,e),t.prototype.addTrack=function(t){e.prototype.addTrack.call(this,t),t.addEventListener("modechange",tt(this,(function(){this.trigger("change")})));var i=["metadata","chapters"];-1===i.indexOf(t.kind)&&t.addEventListener("modechange",tt(this,(function(){this.trigger("selectedlanguagechange")})))},t}(Ht),Kt=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];R(this,e);var i=this;if(x)for(var n in i=s.createElement("custom"),e.prototype)"constructor"!==n&&(i[n]=e.prototype[n]);i.trackElements_=[],Object.defineProperty(i,"length",{get:function(){return this.trackElements_.length}});for(var r=0,a=t.length;r<a;r++)i.addTrackElement_(t[r]);if(x)return i}return e.prototype.addTrackElement_=function(e){var t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.trackElements_[t]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)},e.prototype.getTrackElementByTrack_=function(e){for(var t=void 0,i=0,n=this.trackElements_.length;i<n;i++)if(e===this.trackElements_[i].track){t=this.trackElements_[i];break}return t},e.prototype.removeTrackElement_=function(e){for(var t=0,i=this.trackElements_.length;t<i;t++)if(e===this.trackElements_[t]){this.trackElements_.splice(t,1);break}},e}(),Yt=function(){function e(t){R(this,e);var i=this;if(x)for(var n in i=s.createElement("custom"),e.prototype)"constructor"!==n&&(i[n]=e.prototype[n]);if(e.prototype.setCues_.call(i,t),Object.defineProperty(i,"length",{get:function(){return this.length_}}),x)return i}return e.prototype.setCues_=function(e){var t=this.length||0,i=0,n=e.length;this.cues_=e,this.length_=e.length;var r=function(e){""+e in this||Object.defineProperty(this,""+e,{get:function(){return this.cues_[e]}})};if(t<n)for(i=t;i<n;i++)r.call(this,i)},e.prototype.getCueById=function(e){for(var t=null,i=0,n=this.length;i<n;i++){var r=this[i];if(r.id===e){t=r;break}}return t},e}(),Qt={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Jt={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},Zt={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},ei={disabled:"disabled",hidden:"hidden",showing:"showing"},ti=function(e){function t(){var i,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};R(this,t);var r=j(this,e.call(this)),a=r;if(x)for(var o in a=s.createElement("custom"),t.prototype)"constructor"!==o&&(a[o]=t.prototype[o]);var l={id:n.id||"vjs_track_"+De(),kind:n.kind||"",label:n.label||"",language:n.language||""},u=function(e){Object.defineProperty(a,e,{get:function(){return l[e]},set:function(){}})};for(var c in l)u(c);return i=a,j(r,i)}return N(t,e),t}(rt),ii=function(e){var t=["protocol","hostname","port","pathname","search","hash","host"],i=s.createElement("a");i.href=e;var n=""===i.host&&"file:"!==i.protocol,a=void 0;n&&(a=s.createElement("div"),a.innerHTML='<a href="'+e+'"></a>',i=a.firstChild,a.setAttribute("style","display:none; position:absolute;"),s.body.appendChild(a));for(var o={},l=0;l<t.length;l++)o[t[l]]=i[t[l]];return"http:"===o.protocol&&(o.host=o.host.replace(/:80$/,"")),"https:"===o.protocol&&(o.host=o.host.replace(/:443$/,"")),o.protocol||(o.protocol=r.location.protocol),n&&s.body.removeChild(a),o},ni=function(e){if(!e.match(/^https?:\/\//)){var t=s.createElement("div");t.innerHTML='<a href="'+e+'">x</a>',e=t.firstChild.href}return e},ri=function(e){if("string"===typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i,i=t.exec(e);if(i)return i.pop().toLowerCase()}return""},si=function(e){var t=r.location,i=ii(e),n=":"===i.protocol?t.protocol:i.protocol,s=n+i.host!==t.protocol+t.host;return s},ai=(Object.freeze||Object)({parseUrl:ii,getAbsoluteURL:ni,getFileExtension:ri,isCrossOrigin:si}),oi=function(e,t){var i=new r.WebVTT.Parser(r,r.vttjs,r.WebVTT.StringDecoder()),n=[];i.oncue=function(e){t.addCue(e)},i.onparsingerror=function(e){n.push(e)},i.onflush=function(){t.trigger({type:"loadeddata",target:t})},i.parse(e),n.length>0&&(r.console&&r.console.groupCollapsed&&r.console.groupCollapsed("Text Track parsing errors for "+t.src),n.forEach((function(e){return K.error(e)})),r.console&&r.console.groupEnd&&r.console.groupEnd()),i.flush()},li=function(e,t){var i={uri:e},n=si(e);n&&(i.cors=n),l(i,tt(this,(function(e,i,n){if(e)return K.error(e,i);if(t.loaded_=!0,"function"!==typeof r.WebVTT){if(t.tech_){var s=function(){return oi(n,t)};t.tech_.on("vttjsloaded",s),t.tech_.on("vttjserror",(function(){K.error("vttjs failed to load, stopping trying to process "+t.src),t.tech_.off("vttjsloaded",s)}))}}else oi(n,t)})))},ui=function(e){function t(){var i,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(R(this,t),!r.tech)throw new Error("A tech was not provided.");var s=vt(r,{kind:Zt[r.kind]||"subtitles",language:r.language||r.srclang||""}),a=ei[s.mode]||"disabled",o=s["default"];"metadata"!==s.kind&&"chapters"!==s.kind||(a="hidden");var l=(i=j(this,e.call(this,s)),i);if(l.tech_=s.tech,x)for(var u in t.prototype)"constructor"!==u&&(l[u]=t.prototype[u]);l.cues_=[],l.activeCues_=[];var c=new Yt(l.cues_),h=new Yt(l.activeCues_),d=!1,p=tt(l,(function(){this.activeCues=this.activeCues,d&&(this.trigger("cuechange"),d=!1)}));return"disabled"!==a&&l.tech_.ready((function(){l.tech_.on("timeupdate",p)}),!0),Object.defineProperty(l,"default",{get:function(){return o},set:function(){}}),Object.defineProperty(l,"mode",{get:function(){return a},set:function(e){var t=this;ei[e]&&(a=e,"disabled"!==a?this.tech_.ready((function(){t.tech_.on("timeupdate",p)}),!0):this.tech_.off("timeupdate",p),this.trigger("modechange"))}}),Object.defineProperty(l,"cues",{get:function(){return this.loaded_?c:null},set:function(){}}),Object.defineProperty(l,"activeCues",{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return h;for(var e=this.tech_.currentTime(),t=[],i=0,n=this.cues.length;i<n;i++){var r=this.cues[i];(r.startTime<=e&&r.endTime>=e||r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e)&&t.push(r)}if(d=!1,t.length!==this.activeCues_.length)d=!0;else for(var s=0;s<t.length;s++)-1===this.activeCues_.indexOf(t[s])&&(d=!0);return this.activeCues_=t,h.setCues_(this.activeCues_),h},set:function(){}}),s.src?(l.src=s.src,li(s.src,l)):l.loaded_=!0,n=l,j(i,n)}return N(t,e),t.prototype.addCue=function(e){var t=e;if(r.vttjs&&!(e instanceof r.vttjs.VTTCue)){for(var i in t=new r.vttjs.VTTCue(e.startTime,e.endTime,e.text),e)i in t||(t[i]=e[i]);t.id=e.id,t.originalCue_=e}for(var n=this.tech_.textTracks(),s=0;s<n.length;s++)n[s]!==this&&n[s].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)},t.prototype.removeCue=function(e){var t=this.cues_.length;while(t--){var i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}},t}(ti);ui.prototype.allowedEvents_={cuechange:"cuechange"};var ci=function(e){function t(){var i,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};R(this,t);var s=vt(r,{kind:Jt[r.kind]||""}),a=(i=j(this,e.call(this,s)),i),o=!1;if(x)for(var l in t.prototype)"constructor"!==l&&(a[l]=t.prototype[l]);return Object.defineProperty(a,"enabled",{get:function(){return o},set:function(e){"boolean"===typeof e&&e!==o&&(o=e,this.trigger("enabledchange"))}}),s.enabled&&(a.enabled=s.enabled),a.loaded_=!0,n=a,j(i,n)}return N(t,e),t}(ti),hi=function(e){function t(){var i,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};R(this,t);var s=vt(r,{kind:Qt[r.kind]||""}),a=(i=j(this,e.call(this,s)),i),o=!1;if(x)for(var l in t.prototype)"constructor"!==l&&(a[l]=t.prototype[l]);return Object.defineProperty(a,"selected",{get:function(){return o},set:function(e){"boolean"===typeof e&&e!==o&&(o=e,this.trigger("selectedchange"))}}),s.selected&&(a.selected=s.selected),n=a,j(i,n)}return N(t,e),t}(ti),di=0,pi=1,fi=2,mi=3,gi=function(e){function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};R(this,t);var n=j(this,e.call(this)),r=void 0,a=n;if(x)for(var o in a=s.createElement("custom"),t.prototype)"constructor"!==o&&(a[o]=t.prototype[o]);var l,u=new ui(i);return a.kind=u.kind,a.src=u.src,a.srclang=u.language,a.label=u.label,a["default"]=u["default"],Object.defineProperty(a,"readyState",{get:function(){return r}}),Object.defineProperty(a,"track",{get:function(){return u}}),r=di,u.addEventListener("loadeddata",(function(){r=fi,a.trigger({type:"load",target:a})})),x?(l=a,j(n,l)):n}return N(t,e),t}(rt);gi.prototype.allowedEvents_={load:"load"},gi.NONE=di,gi.LOADING=pi,gi.LOADED=fi,gi.ERROR=mi;var yi={audio:{ListClass:Wt,TrackClass:ci,capitalName:"Audio"},video:{ListClass:Gt,TrackClass:hi,capitalName:"Video"},text:{ListClass:Xt,TrackClass:ui,capitalName:"Text"}};Object.keys(yi).forEach((function(e){yi[e].getterName=e+"Tracks",yi[e].privateName=e+"Tracks_"}));var vi={remoteText:{ListClass:Xt,TrackClass:ui,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Kt,TrackClass:gi,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},_i=vt(yi,vi);function bi(e,t,i,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=e.textTracks();r.kind=t,i&&(r.label=i),n&&(r.language=n),r.tech=e;var a=new _i.text.TrackClass(r);return s.addTrack(a),a}vi.names=Object.keys(vi),yi.names=Object.keys(yi),_i.names=[].concat(vi.names).concat(yi.names);var Ti=function(e){function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};R(this,t),i.reportTouchActivity=!1;var r=j(this,e.call(this,null,i,n));return r.hasStarted_=!1,r.on("playing",(function(){this.hasStarted_=!0})),r.on("loadstart",(function(){this.hasStarted_=!1})),_i.names.forEach((function(e){var t=_i[e];i&&i[t.getterName]&&(r[t.privateName]=i[t.getterName])})),r.featuresProgressEvents||r.manualProgressOn(),r.featuresTimeupdateEvents||r.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach((function(e){!1===i["native"+e+"Tracks"]&&(r["featuresNative"+e+"Tracks"]=!1)})),!1===i.nativeCaptions||!1===i.nativeTextTracks?r.featuresNativeTextTracks=!1:!0!==i.nativeCaptions&&!0!==i.nativeTextTracks||(r.featuresNativeTextTracks=!0),r.featuresNativeTextTracks||r.emulateTextTracks(),r.autoRemoteTextTracks_=new _i.text.ListClass,r.initTrackListeners(),i.nativeControlsForTouch||r.emitTapEvents(),r.constructor&&(r.name_=r.constructor.name||"Unknown Tech"),r}return N(t,e),t.prototype.triggerSourceset=function(e){var t=this;this.isReady_||this.one("ready",(function(){return t.setTimeout((function(){return t.triggerSourceset(e)}),1)})),this.trigger({src:e,type:"sourceset"})},t.prototype.manualProgressOn=function(){this.on("durationchange",this.onDurationChange),this.manualProgress=!0,this.one("ready",this.trackProgress)},t.prototype.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange)},t.prototype.trackProgress=function(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(tt(this,(function(){var e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()})),500)},t.prototype.onDurationChange=function(e){this.duration_=this.duration()},t.prototype.buffered=function(){return kt(0,0)},t.prototype.bufferedPercent=function(){return Et(this.buffered(),this.duration_)},t.prototype.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},t.prototype.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime),this.on("pause",this.stopTrackingCurrentTime)},t.prototype.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime),this.off("pause",this.stopTrackingCurrentTime)},t.prototype.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval((function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}),250)},t.prototype.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},t.prototype.dispose=function(){this.clearTracks(yi.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),e.prototype.dispose.call(this)},t.prototype.clearTracks=function(e){var t=this;e=[].concat(e),e.forEach((function(e){var i=t[e+"Tracks"]()||[],n=i.length;while(n--){var r=i[n];"text"===e&&t.removeRemoteTextTrack(r),i.removeTrack(r)}}))},t.prototype.cleanupAutoTextTracks=function(){var e=this.autoRemoteTextTracks_||[],t=e.length;while(t--){var i=e[t];this.removeRemoteTextTrack(i)}},t.prototype.reset=function(){},t.prototype.error=function(e){return void 0!==e&&(this.error_=new Pt(e),this.trigger("error")),this.error_},t.prototype.played=function(){return this.hasStarted_?kt(0,0):kt()},t.prototype.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},t.prototype.initTrackListeners=function(){var e=this;yi.names.forEach((function(t){var i=yi[t],n=function(){e.trigger(t+"trackchange")},r=e[i.getterName]();r.addEventListener("removetrack",n),r.addEventListener("addtrack",n),e.on("dispose",(function(){r.removeEventListener("removetrack",n),r.removeEventListener("addtrack",n)}))}))},t.prototype.addWebVttScript_=function(){var e=this;if(!r.WebVTT)if(s.body.contains(this.el())){if(!this.options_["vtt.js"]&&W(u)&&Object.keys(u).length>0)return void this.trigger("vttjsloaded");var t=s.createElement("script");t.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.12.4/vtt.min.js",t.onload=function(){e.trigger("vttjsloaded")},t.onerror=function(){e.trigger("vttjserror")},this.on("dispose",(function(){t.onload=null,t.onerror=null})),r.WebVTT=!0,this.el().parentNode.appendChild(t)}else this.ready(this.addWebVttScript_)},t.prototype.emulateTextTracks=function(){var e=this,t=this.textTracks(),i=this.remoteTextTracks(),n=function(e){return t.addTrack(e.track)},r=function(e){return t.removeTrack(e.track)};i.on("addtrack",n),i.on("removetrack",r),this.addWebVttScript_();var s=function(){return e.trigger("texttrackchange")},a=function(){s();for(var e=0;e<t.length;e++){var i=t[e];i.removeEventListener("cuechange",s),"showing"===i.mode&&i.addEventListener("cuechange",s)}};a(),t.addEventListener("change",a),t.addEventListener("addtrack",a),t.addEventListener("removetrack",a),this.on("dispose",(function(){i.off("addtrack",n),i.off("removetrack",r),t.removeEventListener("change",a),t.removeEventListener("addtrack",a),t.removeEventListener("removetrack",a);for(var e=0;e<t.length;e++){var o=t[e];o.removeEventListener("cuechange",s)}}))},t.prototype.addTextTrack=function(e,t,i){if(!e)throw new Error("TextTrack kind is required but was not provided");return bi(this,e,t,i)},t.prototype.createRemoteTextTrack=function(e){var t=vt(e,{tech:this});return new vi.remoteTextEl.TrackClass(t)},t.prototype.addRemoteTextTrack=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments[1],n=this.createRemoteTextTrack(t);return!0!==i&&!1!==i&&(K.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),i=!0),this.remoteTextTrackEls().addTrackElement_(n),this.remoteTextTracks().addTrack(n.track),!0!==i&&this.ready((function(){return e.autoRemoteTextTracks_.addTrack(n.track)})),n},t.prototype.removeRemoteTextTrack=function(e){var t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)},t.prototype.getVideoPlaybackQuality=function(){return{}},t.prototype.setPoster=function(){},t.prototype.playsinline=function(){},t.prototype.setPlaysinline=function(){},t.prototype.canPlayType=function(){return""},t.canPlayType=function(){return""},t.canPlaySource=function(e,i){return t.canPlayType(e.type)},t.isTech=function(e){return e.prototype instanceof t||e instanceof t||e===t},t.registerTech=function(e,i){if(t.techs_||(t.techs_={}),!t.isTech(i))throw new Error("Tech "+e+" must be a Tech");if(!t.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!t.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=gt(e),t.techs_[e]=i,"Tech"!==e&&t.defaultTechOrder_.push(e),i},t.getTech=function(e){if(e)return e=gt(e),t.techs_&&t.techs_[e]?t.techs_[e]:r&&r.videojs&&r.videojs[e]?(K.warn("The "+e+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),r.videojs[e]):void 0},t}(_t);_i.names.forEach((function(e){var t=_i[e];Ti.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}})),Ti.prototype.featuresVolumeControl=!0,Ti.prototype.featuresMuteControl=!0,Ti.prototype.featuresFullscreenResize=!1,Ti.prototype.featuresPlaybackRate=!1,Ti.prototype.featuresProgressEvents=!1,Ti.prototype.featuresSourceset=!1,Ti.prototype.featuresTimeupdateEvents=!1,Ti.prototype.featuresNativeTextTracks=!1,Ti.withSourceHandlers=function(e){e.registerSourceHandler=function(t,i){var n=e.sourceHandlers;n||(n=e.sourceHandlers=[]),void 0===i&&(i=n.length),n.splice(i,0,t)},e.canPlayType=function(t){for(var i=e.sourceHandlers||[],n=void 0,r=0;r<i.length;r++)if(n=i[r].canPlayType(t),n)return n;return""},e.selectSourceHandler=function(t,i){for(var n=e.sourceHandlers||[],r=void 0,s=0;s<n.length;s++)if(r=n[s].canHandleSource(t,i),r)return n[s];return null},e.canPlaySource=function(t,i){var n=e.selectSourceHandler(t,i);return n?n.canHandleSource(t,i):""};var t=["seekable","seeking","duration"];t.forEach((function(e){var t=this[e];"function"===typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})}),e.prototype),e.prototype.setSource=function(t){var i=e.selectSourceHandler(t,this.options_);i||(e.nativeSourceHandler?i=e.nativeSourceHandler:K.error("No source hander found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler),i!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=i.handleSource(t,this,this.options_),this.on("dispose",this.disposeSourceHandler)},e.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)}},_t.registerComponent("Tech",Ti),Ti.registerTech("Tech",Ti),Ti.defaultTechOrder_=[];var Si={},ki={},Ei={};function wi(e,t){Si[e]=Si[e]||[],Si[e].push(t)}function Ci(e,t,i){e.setTimeout((function(){return Bi(t,Si[t.type],i,e)}),1)}function xi(e,t){e.forEach((function(e){return e.setTech&&e.setTech(t)}))}function Ai(e,t,i){return e.reduceRight(Mi(i),t[i]())}function Ii(e,t,i,n){return t[i](e.reduce(Mi(i),n))}function Oi(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r="call"+gt(i),s=e.reduce(Mi(r),n),a=s===Ei,o=a?null:t[i](s);return Ri(e,i,o,a),o}var Pi={buffered:1,currentTime:1,duration:1,seekable:1,played:1,paused:1},Li={setCurrentTime:1},Di={play:1,pause:1};function Mi(e){return function(t,i){return t===Ei?Ei:i[e]?i[e](t):t}}function Ri(e,t,i,n){for(var r=e.length-1;r>=0;r--){var s=e[r];s[t]&&s[t](n,i)}}function Ni(e){ki[e.id()]=null}function ji(e,t){var i=ki[e.id()],n=null;if(void 0===i||null===i)return n=t(e),ki[e.id()]=[[t,n]],n;for(var r=0;r<i.length;r++){var s=i[r],a=s[0],o=s[1];a===t&&(n=o)}return null===n&&(n=t(e),i.push([t,n])),n}function Bi(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments[2],n=arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=t[0],o=t.slice(1);if("string"===typeof a)Bi(e,Si[a],i,n,r,s);else if(a){var l=ji(n,a);if(!l.setSource)return r.push(l),Bi(e,o,i,n,r,s);l.setSource(V({},e),(function(t,a){if(t)return Bi(e,o,i,n,r,s);r.push(l),Bi(a,e.type===a.type?o:Si[a.type],i,n,r,s)}))}else o.length?Bi(e,o,i,n,r,s):s?i(e,r):Bi(e,Si["*"],i,n,r,!0)}var Ui={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",mp3:"audio/mpeg",aac:"audio/aac",oga:"audio/ogg",m3u8:"application/x-mpegURL"},Fi=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=ri(e),i=Ui[t.toLowerCase()];return i||""},qi=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var i=e.cache_.sources.filter((function(e){return e.src===t}));if(i.length)return i[0].type;for(var n=e.$$("source"),r=0;r<n.length;r++){var s=n[r];if(s.type&&s.src&&s.src===t)return s.type}return Fi(t)},Hi=function e(t){if(Array.isArray(t)){var i=[];t.forEach((function(t){t=e(t),Array.isArray(t)?i=i.concat(t):z(t)&&i.push(t)})),t=i}else t="string"===typeof t&&t.trim()?[Vi({src:t})]:z(t)&&"string"===typeof t.src&&t.src&&t.src.trim()?[Vi(t)]:[];return t};function Vi(e){var t=Fi(e.src);return!e.type&&t&&(e.type=t),e}var zi=function(e){function t(i,n,r){R(this,t);var s=vt({createEl:!1},n),a=j(this,e.call(this,i,s,r));if(n.playerOptions.sources&&0!==n.playerOptions.sources.length)i.src(n.playerOptions.sources);else for(var o=0,l=n.playerOptions.techOrder;o<l.length;o++){var u=gt(l[o]),c=Ti.getTech(u);if(u||(c=_t.getComponent(u)),c&&c.isSupported()){i.loadTech_(u);break}}return a}return N(t,e),t}(_t);_t.registerComponent("MediaLoader",zi);var Wi=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.emitTapEvents(),r.enable(),r}return N(t,e),t.prototype.createEl=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i=V({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass(),tabIndex:0},i),"button"===t&&K.error("Creating a ClickableComponent with an HTML element of "+t+" is not supported; use a Button instead."),n=V({role:"button"},n),this.tabIndex_=i.tabIndex;var r=e.prototype.createEl.call(this,t,i,n);return this.createControlTextEl(r),r},t.prototype.dispose=function(){this.controlTextEl_=null,e.prototype.dispose.call(this)},t.prototype.createControlTextEl=function(e){return this.controlTextEl_=ae("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_},t.prototype.controlText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.el();if(void 0===e)return this.controlText_||"Need Text";var i=this.localize(e);this.controlText_=e,oe(this.controlTextEl_,i),this.nonIconControl||t.setAttribute("title",i)},t.prototype.buildCSSClass=function(){return"vjs-control vjs-button "+e.prototype.buildCSSClass.call(this)},t.prototype.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),"undefined"!==typeof this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur))},t.prototype.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),"undefined"!==typeof this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off(["tap","click"],this.handleClick),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur)},t.prototype.handleClick=function(e){},t.prototype.handleFocus=function(e){ze(s,"keydown",tt(this,this.handleKeyPress))},t.prototype.handleKeyPress=function(t){32===t.which||13===t.which?(t.preventDefault(),this.trigger("click")):e.prototype.handleKeyPress&&e.prototype.handleKeyPress.call(this,t)},t.prototype.handleBlur=function(e){We(s,"keydown",tt(this,this.handleKeyPress))},t}(_t);_t.registerComponent("ClickableComponent",Wi);var $i=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.update(),i.on("posterchange",tt(r,r.update)),r}return N(t,e),t.prototype.dispose=function(){this.player().off("posterchange",this.update),e.prototype.dispose.call(this)},t.prototype.createEl=function(){var e=ae("div",{className:"vjs-poster",tabIndex:-1});return L||(this.fallbackImg_=ae("img"),e.appendChild(this.fallbackImg_)),e},t.prototype.update=function(e){var t=this.player().poster();this.setSrc(t),t?this.show():this.hide()},t.prototype.setSrc=function(e){if(this.fallbackImg_)this.fallbackImg_.src=e;else{var t="";e&&(t='url("'+e+'")'),this.el_.style.backgroundImage=t}},t.prototype.handleClick=function(e){this.player_.controls()&&(this.player_.paused()?Mt(this.player_.play()):this.player_.pause())},t}(Wi);_t.registerComponent("PosterImage",$i);var Gi="#222",Xi="#ccc",Ki={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',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Yi(e,t){var i=void 0;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");i=e.slice(1)}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function Qi(e,t,i){try{e.style[t]=i}catch(n){return}}var Ji=function(e){function t(i,n,s){R(this,t);var a=j(this,e.call(this,i,n,s)),o=tt(a,a.updateDisplay);return i.on("loadstart",tt(a,a.toggleDisplay)),i.on("texttrackchange",o),i.on("loadstart",tt(a,a.preselectTrack)),i.ready(tt(a,(function(){if(i.tech_&&i.tech_.featuresNativeTextTracks)this.hide();else{i.on("fullscreenchange",o),i.on("playerresize",o),r.addEventListener&&r.addEventListener("orientationchange",o),i.on("dispose",(function(){return r.removeEventListener("orientationchange",o)}));for(var e=this.options_.playerOptions.tracks||[],t=0;t<e.length;t++)this.player_.addRemoteTextTrack(e[t],!0);this.preselectTrack()}}))),a}return N(t,e),t.prototype.preselectTrack=function(){for(var e={captions:1,subtitles:1},t=this.player_.textTracks(),i=this.player_.cache_.selectedLanguage,n=void 0,r=void 0,s=void 0,a=0;a<t.length;a++){var o=t[a];i&&i.enabled&&i.language===o.language?o.kind===i.kind?s=o:s||(s=o):i&&!i.enabled?(s=null,n=null,r=null):o["default"]&&("descriptions"!==o.kind||n?o.kind in e&&!r&&(r=o):n=o)}s?s.mode="showing":r?r.mode="showing":n&&(n.mode="showing")},t.prototype.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{"aria-live":"off","aria-atomic":"true"})},t.prototype.clearDisplay=function(){"function"===typeof r.WebVTT&&r.WebVTT.processCues(r,[],this.el_)},t.prototype.updateDisplay=function(){var e=this.player_.textTracks();this.clearDisplay();var t=null,i=null,n=e.length;while(n--){var r=e[n];"showing"===r.mode&&("descriptions"===r.kind?t=r:i=r)}i?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(i)):t&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(t))},t.prototype.updateForTrack=function(e){if("function"===typeof r.WebVTT&&e.activeCues){for(var t=[],i=0;i<e.activeCues.length;i++)t.push(e.activeCues[i]);if(r.WebVTT.processCues(r,t,this.el_),this.player_.textTrackSettings){var n=this.player_.textTrackSettings.getValues(),s=t.length;while(s--){var a=t[s];if(a){var o=a.displayState;if(n.color&&(o.firstChild.style.color=n.color),n.textOpacity&&Qi(o.firstChild,"color",Yi(n.color||"#fff",n.textOpacity)),n.backgroundColor&&(o.firstChild.style.backgroundColor=n.backgroundColor),n.backgroundOpacity&&Qi(o.firstChild,"backgroundColor",Yi(n.backgroundColor||"#000",n.backgroundOpacity)),n.windowColor&&(n.windowOpacity?Qi(o,"backgroundColor",Yi(n.windowColor,n.windowOpacity)):o.style.backgroundColor=n.windowColor),n.edgeStyle&&("dropshadow"===n.edgeStyle?o.firstChild.style.textShadow="2px 2px 3px "+Gi+", 2px 2px 4px "+Gi+", 2px 2px 5px "+Gi:"raised"===n.edgeStyle?o.firstChild.style.textShadow="1px 1px "+Gi+", 2px 2px "+Gi+", 3px 3px "+Gi:"depressed"===n.edgeStyle?o.firstChild.style.textShadow="1px 1px "+Xi+", 0 1px "+Xi+", -1px -1px "+Gi+", 0 -1px "+Gi:"uniform"===n.edgeStyle&&(o.firstChild.style.textShadow="0 0 4px "+Gi+", 0 0 4px "+Gi+", 0 0 4px "+Gi+", 0 0 4px "+Gi)),n.fontPercent&&1!==n.fontPercent){var l=r.parseFloat(o.style.fontSize);o.style.fontSize=l*n.fontPercent+"px",o.style.height="auto",o.style.top="auto",o.style.bottom="2px"}n.fontFamily&&"default"!==n.fontFamily&&("small-caps"===n.fontFamily?o.firstChild.style.fontVariant="small-caps":o.firstChild.style.fontFamily=Ki[n.fontFamily])}}}}},t}(_t);_t.registerComponent("TextTrackDisplay",Ji);var Zi=function(e){function t(){return R(this,t),j(this,e.apply(this,arguments))}return N(t,e),t.prototype.createEl=function(){var t=this.player_.isAudio(),i=this.localize(t?"Audio Player":"Video Player"),n=ae("span",{className:"vjs-control-text",innerHTML:this.localize("{1} is loading.",[i])}),r=e.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return r.appendChild(n),r},t}(_t);_t.registerComponent("LoadingSpinner",Zi);var en=function(e){function t(){return R(this,t),j(this,e.apply(this,arguments))}return N(t,e),t.prototype.createEl=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e="button",t=V({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass()},t),i=V({type:"button"},i);var n=_t.prototype.createEl.call(this,e,t,i);return this.createControlTextEl(n),n},t.prototype.addChild=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.constructor.name;return K.warn("Adding an actionable (user controllable) child to a Button ("+i+") is not supported; use a ClickableComponent instead."),_t.prototype.addChild.call(this,e,t)},t.prototype.enable=function(){e.prototype.enable.call(this),this.el_.removeAttribute("disabled")},t.prototype.disable=function(){e.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},t.prototype.handleKeyPress=function(t){32!==t.which&&13!==t.which&&e.prototype.handleKeyPress.call(this,t)},t}(Wi);_t.registerComponent("Button",en);var tn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.mouseused_=!1,r.on("mousedown",r.handleMouseDown),r}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-big-play-button"},t.prototype.handleClick=function(e){var t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY)Mt(t);else{var i=this.player_.getChild("controlBar"),n=i&&i.getChild("playToggle");if(n){var r=function(){return n.focus()};Dt(t)?t.then(r,(function(){})):this.setTimeout(r,1)}else this.player_.focus()}},t.prototype.handleKeyPress=function(t){this.mouseused_=!1,e.prototype.handleKeyPress.call(this,t)},t.prototype.handleMouseDown=function(e){this.mouseused_=!0},t}(en);tn.prototype.controlText_="Play Video",_t.registerComponent("BigPlayButton",tn);var nn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.controlText(n&&n.controlText||r.localize("Close")),r}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this)},t.prototype.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},t}(en);_t.registerComponent("CloseButton",nn);var rn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.on(i,"play",r.handlePlay),r.on(i,"pause",r.handlePause),r.on(i,"ended",r.handleEnded),r}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)},t.prototype.handleClick=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},t.prototype.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},t.prototype.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},t.prototype.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},t.prototype.handleEnded=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",this.handleSeeked)},t}(en);rn.prototype.controlText_="Play",_t.registerComponent("PlayToggle",rn);var sn=function(e,t){e=e<0?0:e;var i=Math.floor(e%60),n=Math.floor(e/60%60),r=Math.floor(e/3600),s=Math.floor(t/60%60),a=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(r=n=i="-"),r=r>0||a>0?r+":":"",n=((r||s>=10)&&n<10?"0"+n:n)+":",i=i<10?"0"+i:i,r+n+i},an=sn;function on(e){an=e}function ln(){an=sn}var un=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return an(e,t)},cn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.throttledUpdateContent=it(tt(r,r.updateContent),25),r.on(i,"timeupdate",r.throttledUpdateContent),r}return N(t,e),t.prototype.createEl=function(t){var i=this.buildCSSClass(),n=e.prototype.createEl.call(this,"div",{className:i+" vjs-time-control vjs-control",innerHTML:'<span class="vjs-control-text">'+this.localize(this.labelText_)+" </span>"});return this.contentEl_=ae("span",{className:i+"-display"},{"aria-live":"off"}),this.updateTextNode_(),n.appendChild(this.contentEl_),n},t.prototype.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this)},t.prototype.updateTextNode_=function(){if(this.contentEl_){while(this.contentEl_.firstChild)this.contentEl_.removeChild(this.contentEl_.firstChild);this.textNode_=s.createTextNode(this.formattedTime_||this.formatTime_(0)),this.contentEl_.appendChild(this.textNode_)}},t.prototype.formatTime_=function(e){return un(e)},t.prototype.updateFormattedTime_=function(e){var t=this.formatTime_(e);t!==this.formattedTime_&&(this.formattedTime_=t,this.requestAnimationFrame(this.updateTextNode_))},t.prototype.updateContent=function(e){},t}(_t);cn.prototype.labelText_="Time",cn.prototype.controlText_="Time",_t.registerComponent("TimeDisplay",cn);var hn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.on(i,"ended",r.handleEnded),r}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-current-time"},t.prototype.updateContent=function(e){var t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateFormattedTime_(t)},t.prototype.handleEnded=function(e){this.player_.duration()&&this.updateFormattedTime_(this.player_.duration())},t}(cn);hn.prototype.labelText_="Current Time",hn.prototype.controlText_="Current Time",_t.registerComponent("CurrentTimeDisplay",hn);var dn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.on(i,"durationchange",r.updateContent),r.on(i,"loadedmetadata",r.throttledUpdateContent),r}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-duration"},t.prototype.updateContent=function(e){var t=this.player_.duration();t&&this.duration_!==t&&(this.duration_=t,this.updateFormattedTime_(t))},t}(cn);dn.prototype.labelText_="Duration",dn.prototype.controlText_="Duration",_t.registerComponent("DurationDisplay",dn);var pn=function(e){function t(){return R(this,t),j(this,e.apply(this,arguments))}return N(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"<div><span>/</span></div>"})},t}(_t);_t.registerComponent("TimeDivider",pn);var fn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.on(i,"durationchange",r.throttledUpdateContent),r.on(i,"ended",r.handleEnded),r}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-remaining-time"},t.prototype.formatTime_=function(t){return"-"+e.prototype.formatTime_.call(this,t)},t.prototype.updateContent=function(e){this.player_.duration()&&(this.player_.remainingTimeDisplay?this.updateFormattedTime_(this.player_.remainingTimeDisplay()):this.updateFormattedTime_(this.player_.remainingTime()))},t.prototype.handleEnded=function(e){this.player_.duration()&&this.updateFormattedTime_(0)},t}(cn);fn.prototype.labelText_="Remaining Time",fn.prototype.controlText_="Remaining Time",_t.registerComponent("RemainingTimeDisplay",fn);var mn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.updateShowing(),r.on(r.player(),"durationchange",r.updateShowing),r}return N(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=ae("div",{className:"vjs-live-display",innerHTML:'<span class="vjs-control-text">'+this.localize("Stream Type")+" </span>"+this.localize("LIVE")},{"aria-live":"off"}),t.appendChild(this.contentEl_),t},t.prototype.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},t.prototype.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(_t);_t.registerComponent("LiveDisplay",mn);var gn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.bar=r.getChild(r.options_.barName),r.vertical(!!r.options_.vertical),r.enable(),r}return N(t,e),t.prototype.enabled=function(){return this.enabled_},t.prototype.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown),this.on("touchstart",this.handleMouseDown),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur),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)},t.prototype.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown),this.off("touchstart",this.handleMouseDown),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur),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}},t.prototype.createEl=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i.className=i.className+" vjs-slider",i=V({tabIndex:0},i),n=V({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},n),e.prototype.createEl.call(this,t,i,n)},t.prototype.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||w||e.preventDefault(),ve(),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)},t.prototype.handleMouseMove=function(e){},t.prototype.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;_e(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),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.update()},t.prototype.update=function(){if(this.el_){var e=this.getPercent(),t=this.bar;if(t){("number"!==typeof e||e!==e||e<0||e===1/0)&&(e=0);var i=(100*e).toFixed(2)+"%",n=t.el().style;return this.vertical()?n.height=i:n.width=i,e}}},t.prototype.calculateDistance=function(e){var t=Se(this.el_,e);return this.vertical()?t.y:t.x},t.prototype.handleFocus=function(){this.on(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},t.prototype.handleKeyPress=function(e){37===e.which||40===e.which?(e.preventDefault(),this.stepBack()):38!==e.which&&39!==e.which||(e.preventDefault(),this.stepForward())},t.prototype.handleBlur=function(){this.off(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},t.prototype.handleClick=function(e){e.stopImmediatePropagation(),e.preventDefault()},t.prototype.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},t}(_t);_t.registerComponent("Slider",gn);var yn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.partEls_=[],r.on(i,"progress",r.update),r}return N(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Loaded")+"</span>: 0%</span>"})},t.prototype.dispose=function(){this.partEls_=null,e.prototype.dispose.call(this)},t.prototype.update=function(e){var t=this.player_.buffered(),i=this.player_.duration(),n=this.player_.bufferedEnd(),r=this.partEls_,s=function(e,t){var i=e/t||0;return 100*(i>=1?1:i)+"%"};this.el_.style.width=s(n,i);for(var a=0;a<t.length;a++){var o=t.start(a),l=t.end(a),u=r[a];u||(u=this.el_.appendChild(ae()),r[a]=u),u.style.left=s(o,n),u.style.width=s(l-o,n)}for(var c=r.length;c>t.length;c--)this.el_.removeChild(r[c-1]);r.length=t.length},t}(_t);_t.registerComponent("LoadProgressBar",yn);var vn=function(e){function t(){return R(this,t),j(this,e.apply(this,arguments))}return N(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"})},t.prototype.update=function(e,t,i){var n=be(this.el_),r=be(this.player_.el()),s=e.width*t;if(r&&n){var a=e.left-r.left+s,o=e.width-s+(r.right-e.right),l=n.width/2;a<l?l+=l-a:o<l&&(l=o),l<0?l=0:l>n.width&&(l=n.width),this.el_.style.right="-"+l+"px",oe(this.el_,i)}},t}(_t);_t.registerComponent("TimeTooltip",vn);var _n=function(e){function t(){return R(this,t),j(this,e.apply(this,arguments))}return N(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Progress")+"</span>: 0%</span>"})},t.prototype.update=function(e,t){var i=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame((function(){var n=i.player_.scrubbing()?i.player_.getCache().currentTime:i.player_.currentTime(),r=un(n,i.player_.duration()),s=i.getChild("timeTooltip");s&&s.update(e,t,r)}))},t}(_t);_n.prototype.options_={children:[]},A&&!(A>8)||y||_||_n.prototype.options_.children.push("timeTooltip"),_t.registerComponent("PlayProgressBar",_n);var bn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.update=it(tt(r,r.update),25),r}return N(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},t.prototype.update=function(e,t){var i=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame((function(){var n=i.player_.duration(),r=un(t*n,n);i.el_.style.left=e.width*t+"px",i.getChild("timeTooltip").update(e,t,r)}))},t}(_t);bn.prototype.options_={children:["timeTooltip"]},_t.registerComponent("MouseTimeDisplay",bn);var Tn=5,Sn=30,kn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.setEventHandlers_(),r}return N(t,e),t.prototype.setEventHandlers_=function(){var e=this;this.update=it(tt(this,this.update),Sn),this.on(this.player_,"timeupdate",this.update),this.on(this.player_,"ended",this.handleEnded),this.updateInterval=null,this.on(this.player_,["playing"],(function(){e.clearInterval(e.updateInterval),e.updateInterval=e.setInterval((function(){e.requestAnimationFrame((function(){e.update()}))}),Sn)})),this.on(this.player_,["ended","pause","waiting"],(function(){e.clearInterval(e.updateInterval)})),this.on(this.player_,["timeupdate","ended"],this.update)},t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},t.prototype.update_=function(e,t){var i=this.player_.duration();this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[un(e,i),un(i,i)],"{1} of {2}")),this.bar.update(be(this.el_),t)},t.prototype.update=function(t){var i=e.prototype.update.call(this);return this.update_(this.getCurrentTime_(),i),i},t.prototype.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},t.prototype.handleEnded=function(e){this.update_(this.player_.duration(),1)},t.prototype.getPercent=function(){var e=this.getCurrentTime_()/this.player_.duration();return e>=1?1:e},t.prototype.handleMouseDown=function(t){Ae(t)&&(t.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t))},t.prototype.handleMouseMove=function(e){if(Ae(e)){var t=this.calculateDistance(e)*this.player_.duration();t===this.player_.duration()&&(t-=.1),this.player_.currentTime(t)}},t.prototype.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show()},t.prototype.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide()},t.prototype.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t),t&&t.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying&&Mt(this.player_.play())},t.prototype.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+Tn)},t.prototype.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-Tn)},t.prototype.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},t.prototype.handleKeyPress=function(t){32===t.which||13===t.which?(t.preventDefault(),this.handleAction(t)):e.prototype.handleKeyPress&&e.prototype.handleKeyPress.call(this,t)},t}(gn);kn.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},A&&!(A>8)||y||_||kn.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),kn.prototype.playerEvent="timeupdate",_t.registerComponent("SeekBar",kn);var En=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.handleMouseMove=it(tt(r,r.handleMouseMove),25),r.throttledHandleMouseSeek=it(tt(r,r.handleMouseSeek),25),r.enable(),r}return N(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},t.prototype.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var i=t.getChild("mouseTimeDisplay"),n=t.el(),r=be(n),s=Se(n,e).x;s>1?s=1:s<0&&(s=0),i&&i.update(r,s)}},t.prototype.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},t.prototype.enabled=function(){return this.enabled_},t.prototype.disable=function(){this.children().forEach((function(e){return e.disable&&e.disable()})),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDown),this.off(this.el_,"mousemove",this.handleMouseMove),this.handleMouseUp(),this.addClass("disabled"),this.enabled_=!1)},t.prototype.enable=function(){this.children().forEach((function(e){return e.enable&&e.enable()})),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDown),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},t.prototype.handleMouseDown=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},t.prototype.handleMouseUp=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseUp(e),this.off(t,"mousemove",this.throttledHandleMouseSeek),this.off(t,"touchmove",this.throttledHandleMouseSeek),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchend",this.handleMouseUp)},t}(_t);En.prototype.options_={children:["seekBar"]},_t.registerComponent("ProgressControl",En);var wn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.on(i,"fullscreenchange",r.handleFullscreenChange),!1===s[wt.fullscreenEnabled]&&r.disable(),r}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)},t.prototype.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},t.prototype.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}(en);wn.prototype.controlText_="Fullscreen",_t.registerComponent("FullscreenToggle",wn);var Cn=function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))},xn=function(e){function t(){return R(this,t),j(this,e.apply(this,arguments))}return N(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:'<span class="vjs-control-text"></span>'})},t}(_t);_t.registerComponent("VolumeLevel",xn);var An=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.on("slideractive",r.updateLastVolume_),r.on(i,"volumechange",r.updateARIAAttributes),i.ready((function(){return r.updateARIAAttributes()})),r}return N(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},t.prototype.handleMouseDown=function(t){Ae(t)&&e.prototype.handleMouseDown.call(this,t)},t.prototype.handleMouseMove=function(e){Ae(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},t.prototype.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},t.prototype.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},t.prototype.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},t.prototype.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},t.prototype.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},t.prototype.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},t.prototype.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",(function(){0===e.player_.volume()&&e.player_.lastVolume_(t)}))},t}(gn);An.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},An.prototype.playerEvent="volumechange",_t.registerComponent("VolumeBar",An);var In=function(e){function t(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};R(this,t),n.vertical=n.vertical||!1,("undefined"===typeof n.volumeBar||W(n.volumeBar))&&(n.volumeBar=n.volumeBar||{},n.volumeBar.vertical=n.vertical);var r=j(this,e.call(this,i,n));return Cn(r,i),r.throttledHandleMouseMove=it(tt(r,r.handleMouseMove),25),r.on("mousedown",r.handleMouseDown),r.on("touchstart",r.handleMouseDown),r.on(r.volumeBar,["focus","slideractive"],(function(){r.volumeBar.addClass("vjs-slider-active"),r.addClass("vjs-slider-active"),r.trigger("slideractive")})),r.on(r.volumeBar,["blur","sliderinactive"],(function(){r.volumeBar.removeClass("vjs-slider-active"),r.removeClass("vjs-slider-active"),r.trigger("sliderinactive")})),r}return N(t,e),t.prototype.createEl=function(){var t="vjs-volume-horizontal";return this.options_.vertical&&(t="vjs-volume-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t})},t.prototype.handleMouseDown=function(e){var t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},t.prototype.handleMouseUp=function(e){var t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchend",this.handleMouseUp)},t.prototype.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},t}(_t);In.prototype.options_={children:["volumeBar"]},_t.registerComponent("VolumeControl",In);var On=function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))},Pn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return On(r,i),r.on(i,["loadstart","volumechange"],r.update),r}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)},t.prototype.handleClick=function(e){var t=this.player_.volume(),i=this.player_.lastVolume_();if(0===t){var n=i<.1?.1:i;this.player_.volume(n),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},t.prototype.update=function(e){this.updateIcon_(),this.updateControlText_()},t.prototype.updateIcon_=function(){var e=this.player_.volume(),t=3;y&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var i=0;i<4;i++)he(this.el_,"vjs-vol-"+i);ce(this.el_,"vjs-vol-"+t)},t.prototype.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume(),t=e?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)},t}(en);Pn.prototype.controlText_="Mute",_t.registerComponent("MuteToggle",Pn);var Ln=function(e){function t(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};R(this,t),"undefined"!==typeof n.inline?n.inline=n.inline:n.inline=!0,("undefined"===typeof n.volumeControl||W(n.volumeControl))&&(n.volumeControl=n.volumeControl||{},n.volumeControl.vertical=!n.inline);var r=j(this,e.call(this,i,n));return r.on(i,["loadstart"],r.volumePanelState_),r.on(r.volumeControl,["slideractive"],r.sliderActive_),r.on(r.volumeControl,["sliderinactive"],r.sliderInactive_),r}return N(t,e),t.prototype.sliderActive_=function(){this.addClass("vjs-slider-active")},t.prototype.sliderInactive_=function(){this.removeClass("vjs-slider-active")},t.prototype.volumePanelState_=function(){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")},t.prototype.createEl=function(){var t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})},t}(_t);Ln.prototype.options_={children:["muteToggle","volumeControl"]},_t.registerComponent("VolumePanel",Ln);var Dn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return n&&(r.menuButton_=n.menuButton),r.focusedChild_=-1,r.on("keydown",r.handleKeyPress),r}return N(t,e),t.prototype.addItem=function(e){this.addChild(e),e.on("click",tt(this,(function(t){this.menuButton_&&(this.menuButton_.unpressButton(),"CaptionSettingsMenuItem"!==e.name()&&this.menuButton_.focus())})))},t.prototype.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=ae(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var i=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return i.appendChild(this.contentEl_),ze(i,"click",(function(e){e.preventDefault(),e.stopImmediatePropagation()})),i},t.prototype.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},t.prototype.handleKeyPress=function(e){37===e.which||40===e.which?(e.preventDefault(),this.stepForward()):38!==e.which&&39!==e.which||(e.preventDefault(),this.stepBack())},t.prototype.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},t.prototype.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},t.prototype.focus=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this.children().slice(),i=t.length&&t[0].className&&/vjs-menu-title/.test(t[0].className);i&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())},t}(_t);_t.registerComponent("Menu",Dn);var Mn=function(e){function t(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};R(this,t);var r=j(this,e.call(this,i,n));r.menuButton_=new en(i,n),r.menuButton_.controlText(r.controlText_),r.menuButton_.el_.setAttribute("aria-haspopup","true");var s=en.prototype.buildCSSClass();return r.menuButton_.el_.className=r.buildCSSClass()+" "+s,r.menuButton_.removeClass("vjs-control"),r.addChild(r.menuButton_),r.update(),r.enabled_=!0,r.on(r.menuButton_,"tap",r.handleClick),r.on(r.menuButton_,"click",r.handleClick),r.on(r.menuButton_,"focus",r.handleFocus),r.on(r.menuButton_,"blur",r.handleBlur),r.on("keydown",r.handleSubmenuKeyPress),r}return N(t,e),t.prototype.update=function(){var 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.show()},t.prototype.createMenu=function(){var e=new Dn(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=ae("li",{className:"vjs-menu-title",innerHTML:gt(this.options_.title),tabIndex:-1});this.hideThreshold_+=1,e.children_.unshift(t),le(t,e.contentEl())}if(this.items=this.createItems(),this.items)for(var i=0;i<this.items.length;i++)e.addItem(this.items[i]);return e},t.prototype.createItems=function(){},t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},t.prototype.buildWrapperCSSClass=function(){var t="vjs-menu-button";!0===this.options_.inline?t+="-inline":t+="-popup";var i=en.prototype.buildCSSClass();return"vjs-menu-button "+t+" "+i+" "+e.prototype.buildCSSClass.call(this)},t.prototype.buildCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+e.prototype.buildCSSClass.call(this)},t.prototype.controlText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.menuButton_.el();return this.menuButton_.controlText(e,t)},t.prototype.handleClick=function(e){this.one(this.menu.contentEl(),"mouseleave",tt(this,(function(e){this.unpressButton(),this.el_.blur()}))),this.buttonPressed_?this.unpressButton():this.pressButton()},t.prototype.focus=function(){this.menuButton_.focus()},t.prototype.blur=function(){this.menuButton_.blur()},t.prototype.handleFocus=function(){ze(s,"keydown",tt(this,this.handleKeyPress))},t.prototype.handleBlur=function(){We(s,"keydown",tt(this,this.handleKeyPress))},t.prototype.handleKeyPress=function(e){27===e.which||9===e.which?(this.buttonPressed_&&this.unpressButton(),9!==e.which&&(e.preventDefault(),this.menuButton_.el_.focus())):38!==e.which&&40!==e.which||this.buttonPressed_||(this.pressButton(),e.preventDefault())},t.prototype.handleSubmenuKeyPress=function(e){27!==e.which&&9!==e.which||(this.buttonPressed_&&this.unpressButton(),9!==e.which&&(e.preventDefault(),this.menuButton_.el_.focus()))},t.prototype.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),y&&re())return;this.menu.focus()}},t.prototype.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},t.prototype.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},t.prototype.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},t}(_t);_t.registerComponent("MenuButton",Mn);var Rn=function(e){function t(i,n){R(this,t);var r=n.tracks,s=j(this,e.call(this,i,n));if(s.items.length<=1&&s.hide(),!r)return j(s);var a=tt(s,s.update);return r.addEventListener("removetrack",a),r.addEventListener("addtrack",a),s.player_.on("ready",a),s.player_.on("dispose",(function(){r.removeEventListener("removetrack",a),r.removeEventListener("addtrack",a)})),s}return N(t,e),t}(Mn);_t.registerComponent("TrackButton",Rn);var Nn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.selectable=n.selectable,r.isSelected_=n.selected||!1,r.multiSelectable=n.multiSelectable,r.selected(r.isSelected_),r.selectable?r.multiSelectable?r.el_.setAttribute("role","menuitemcheckbox"):r.el_.setAttribute("role","menuitemradio"):r.el_.setAttribute("role","menuitem"),r}return N(t,e),t.prototype.createEl=function(t,i,n){return this.nonIconControl=!0,e.prototype.createEl.call(this,"li",V({className:"vjs-menu-item",innerHTML:'<span class="vjs-menu-item-text">'+this.localize(this.options_.label)+"</span>",tabIndex:-1},i),n)},t.prototype.handleClick=function(e){this.selected(!0)},t.prototype.selected=function(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))},t}(Wi);_t.registerComponent("MenuItem",Nn);var jn=function(e){function t(i,n){R(this,t);var a=n.track,o=i.textTracks();n.label=a.label||a.language||"Unknown",n.selected="showing"===a.mode;var l=j(this,e.call(this,i,n));l.track=a;var u=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];l.handleTracksChange.apply(l,t)},c=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];l.handleSelectedLanguageChange.apply(l,t)};if(i.on(["loadstart","texttrackchange"],u),o.addEventListener("change",u),o.addEventListener("selectedlanguagechange",c),l.on("dispose",(function(){i.off(["loadstart","texttrackchange"],u),o.removeEventListener("change",u),o.removeEventListener("selectedlanguagechange",c)})),void 0===o.onchange){var h=void 0;l.on(["tap","click"],(function(){if("object"!==M(r.Event))try{h=new r.Event("change")}catch(e){}h||(h=s.createEvent("Event"),h.initEvent("change",!0,!0)),o.dispatchEvent(h)}))}return l.handleTracksChange(),l}return N(t,e),t.prototype.handleClick=function(t){var i=this.track.kind,n=this.track.kinds,r=this.player_.textTracks();if(n||(n=[i]),e.prototype.handleClick.call(this,t),r)for(var s=0;s<r.length;s++){var a=r[s];a===this.track&&n.indexOf(a.kind)>-1?"showing"!==a.mode&&(a.mode="showing"):"disabled"!==a.mode&&(a.mode="disabled")}},t.prototype.handleTracksChange=function(e){var t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)},t.prototype.handleSelectedLanguageChange=function(e){if("showing"===this.track.mode){var 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}}},t.prototype.dispose=function(){this.track=null,e.prototype.dispose.call(this)},t}(Nn);_t.registerComponent("TextTrackMenuItem",jn);var Bn=function(e){function t(i,n){return R(this,t),n.track={player:i,kind:n.kind,kinds:n.kinds,default:!1,mode:"disabled"},n.kinds||(n.kinds=[n.kind]),n.label?n.track.label=n.label:n.track.label=n.kinds.join(" and ")+" off",n.selectable=!0,n.multiSelectable=!1,j(this,e.call(this,i,n))}return N(t,e),t.prototype.handleTracksChange=function(e){for(var t=this.player().textTracks(),i=!0,n=0,r=t.length;n<r;n++){var s=t[n];if(this.options_.kinds.indexOf(s.kind)>-1&&"showing"===s.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)},t.prototype.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),i=!0,n=0,r=t.length;n<r;n++){var s=t[n];if(["captions","descriptions","subtitles"].indexOf(s.kind)>-1&&"showing"===s.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}(jn);_t.registerComponent("OffTextTrackMenuItem",Bn);var Un=function(e){function t(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return R(this,t),n.tracks=i.textTracks(),j(this,e.call(this,i,n))}return N(t,e),t.prototype.createItems=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:jn,i=void 0;this.label_&&(i=this.label_+" off"),e.push(new Bn(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;var n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var r=0;r<n.length;r++){var s=n[r];if(this.kinds_.indexOf(s.kind)>-1){var a=new t(this.player_,{track:s,selectable:!0,multiSelectable:!1});a.addClass("vjs-"+s.kind+"-menu-item"),e.push(a)}}return e},t}(Rn);_t.registerComponent("TextTrackButton",Un);var Fn=function(e){function t(i,n){R(this,t);var r=n.track,s=n.cue,a=i.currentTime();n.selectable=!0,n.multiSelectable=!1,n.label=s.text,n.selected=s.startTime<=a&&a<s.endTime;var o=j(this,e.call(this,i,n));return o.track=r,o.cue=s,r.addEventListener("cuechange",tt(o,o.update)),o}return N(t,e),t.prototype.handleClick=function(t){e.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime),this.update(this.cue.startTime)},t.prototype.update=function(e){var t=this.cue,i=this.player_.currentTime();this.selected(t.startTime<=i&&i<t.endTime)},t}(Nn);_t.registerComponent("ChaptersTrackMenuItem",Fn);var qn=function(e){function t(i,n,r){return R(this,t),j(this,e.call(this,i,n,r))}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildWrapperCSSClass.call(this)},t.prototype.update=function(t){this.track_&&(!t||"addtrack"!==t.type&&"removetrack"!==t.type)||this.setTrack(this.findChaptersTrack()),e.prototype.update.call(this)},t.prototype.setTrack=function(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";var i=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);i&&i.addEventListener("load",this.updateHandler_)}}},t.prototype.findChaptersTrack=function(){for(var e=this.player_.textTracks()||[],t=e.length-1;t>=0;t--){var i=e[t];if(i.kind===this.kind_)return i}},t.prototype.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(gt(this.kind_))},t.prototype.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this)},t.prototype.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var i=0,n=t.length;i<n;i++){var r=t[i],s=new Fn(this.player_,{track:this.track_,cue:r});e.push(s)}return e},t}(Un);qn.prototype.kind_="chapters",qn.prototype.controlText_="Chapters",_t.registerComponent("ChaptersButton",qn);var Hn=function(e){function t(i,n,r){R(this,t);var s=j(this,e.call(this,i,n,r)),a=i.textTracks(),o=tt(s,s.handleTracksChange);return a.addEventListener("change",o),s.on("dispose",(function(){a.removeEventListener("change",o)})),s}return N(t,e),t.prototype.handleTracksChange=function(e){for(var t=this.player().textTracks(),i=!1,n=0,r=t.length;n<r;n++){var s=t[n];if(s.kind!==this.kind_&&"showing"===s.mode){i=!0;break}}i?this.disable():this.enable()},t.prototype.buildCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(Un);Hn.prototype.kind_="descriptions",Hn.prototype.controlText_="Descriptions",_t.registerComponent("DescriptionsButton",Hn);var Vn=function(e){function t(i,n,r){return R(this,t),j(this,e.call(this,i,n,r))}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(Un);Vn.prototype.kind_="subtitles",Vn.prototype.controlText_="Subtitles",_t.registerComponent("SubtitlesButton",Vn);var zn=function(e){function t(i,n){R(this,t),n.track={player:i,kind:n.kind,label:n.kind+" settings",selectable:!1,default:!1,mode:"disabled"},n.selectable=!1,n.name="CaptionSettingsMenuItem";var r=j(this,e.call(this,i,n));return r.addClass("vjs-texttrack-settings"),r.controlText(", opens "+n.kind+" settings dialog"),r}return N(t,e),t.prototype.handleClick=function(e){this.player().getChild("textTrackSettings").open()},t}(jn);_t.registerComponent("CaptionSettingsMenuItem",zn);var Wn=function(e){function t(i,n,r){return R(this,t),j(this,e.call(this,i,n,r))}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-captions-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-captions-button "+e.prototype.buildWrapperCSSClass.call(this)},t.prototype.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new zn(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),e.prototype.createItems.call(this,t)},t}(Un);Wn.prototype.kind_="captions",Wn.prototype.controlText_="Captions",_t.registerComponent("CaptionsButton",Wn);var $n=function(e){function t(){return R(this,t),j(this,e.apply(this,arguments))}return N(t,e),t.prototype.createEl=function(t,i,n){var r='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);"captions"===this.options_.track.kind&&(r+='\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> '+this.localize("Captions")+"</span>\n "),r+="</span>";var s=e.prototype.createEl.call(this,t,V({innerHTML:r},i),n);return s},t}(jn);_t.registerComponent("SubsCapsMenuItem",$n);var Gn=function(e){function t(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};R(this,t);var r=j(this,e.call(this,i,n));return r.label_="subtitles",["en","en-us","en-ca","fr-ca"].indexOf(r.player_.language_)>-1&&(r.label_="captions"),r.menuButton_.controlText(gt(r.label_)),r}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this)},t.prototype.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new zn(this.player_,{kind:this.label_})),this.hideThreshold_+=1),t=e.prototype.createItems.call(this,t,$n),t},t}(Un);Gn.prototype.kinds_=["captions","subtitles"],Gn.prototype.controlText_="Subtitles",_t.registerComponent("SubsCapsButton",Gn);var Xn=function(e){function t(i,n){R(this,t);var r=n.track,s=i.audioTracks();n.label=r.label||r.language||"Unknown",n.selected=r.enabled;var a=j(this,e.call(this,i,n));a.track=r,a.addClass("vjs-"+r.kind+"-menu-item");var o=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];a.handleTracksChange.apply(a,t)};return s.addEventListener("change",o),a.on("dispose",(function(){s.removeEventListener("change",o)})),a}return N(t,e),t.prototype.createEl=function(t,i,n){var r='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);"main-desc"===this.options_.track.kind&&(r+='\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> '+this.localize("Descriptions")+"</span>\n "),r+="</span>";var s=e.prototype.createEl.call(this,t,V({innerHTML:r},i),n);return s},t.prototype.handleClick=function(t){var i=this.player_.audioTracks();e.prototype.handleClick.call(this,t);for(var n=0;n<i.length;n++){var r=i[n];r.enabled=r===this.track}},t.prototype.handleTracksChange=function(e){this.selected(this.track.enabled)},t}(Nn);_t.registerComponent("AudioTrackMenuItem",Xn);var Kn=function(e){function t(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return R(this,t),n.tracks=i.audioTracks(),j(this,e.call(this,i,n))}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-audio-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-audio-button "+e.prototype.buildWrapperCSSClass.call(this)},t.prototype.createItems=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.hideThreshold_=1;for(var t=this.player_.audioTracks(),i=0;i<t.length;i++){var n=t[i];e.push(new Xn(this.player_,{track:n,selectable:!0,multiSelectable:!1}))}return e},t}(Rn);Kn.prototype.controlText_="Audio Track",_t.registerComponent("AudioTrackButton",Kn);var Yn=function(e){function t(i,n){R(this,t);var r=n.rate,s=parseFloat(r,10);n.label=r,n.selected=1===s,n.selectable=!0,n.multiSelectable=!1;var a=j(this,e.call(this,i,n));return a.label=r,a.rate=s,a.on(i,"ratechange",a.update),a}return N(t,e),t.prototype.handleClick=function(t){e.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},t.prototype.update=function(e){this.selected(this.player().playbackRate()===this.rate)},t}(Nn);Yn.prototype.contentElType="button",_t.registerComponent("PlaybackRateMenuItem",Yn);var Qn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.updateVisibility(),r.updateLabel(),r.on(i,"loadstart",r.updateVisibility),r.on(i,"ratechange",r.updateLabel),r}return N(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this);return this.labelEl_=ae("div",{className:"vjs-playback-rate-value",innerHTML:"1x"}),t.appendChild(this.labelEl_),t},t.prototype.dispose=function(){this.labelEl_=null,e.prototype.dispose.call(this)},t.prototype.buildCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildWrapperCSSClass.call(this)},t.prototype.createMenu=function(){var e=new Dn(this.player()),t=this.playbackRates();if(t)for(var i=t.length-1;i>=0;i--)e.addChild(new Yn(this.player(),{rate:t[i]+"x"}));return e},t.prototype.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},t.prototype.handleClick=function(e){for(var t=this.player().playbackRate(),i=this.playbackRates(),n=i[0],r=0;r<i.length;r++)if(i[r]>t){n=i[r];break}this.player().playbackRate(n)},t.prototype.playbackRates=function(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates},t.prototype.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},t.prototype.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},t.prototype.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.innerHTML=this.player().playbackRate()+"x")},t}(Mn);Qn.prototype.controlText_="Playback Rate",_t.registerComponent("PlaybackRateMenuButton",Qn);var Jn=function(e){function t(){return R(this,t),j(this,e.apply(this,arguments))}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)},t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})},t}(_t);_t.registerComponent("Spacer",Jn);var Zn=function(e){function t(){return R(this,t),j(this,e.apply(this,arguments))}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this)},t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,{className:this.buildCSSClass()});return t.innerHTML=" ",t},t}(Jn);_t.registerComponent("CustomControlSpacer",Zn);var er=function(e){function t(){return R(this,t),j(this,e.apply(this,arguments))}return N(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(_t);er.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},_t.registerComponent("ControlBar",er);var tr=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.on(i,"error",r.open),r}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-error-display "+e.prototype.buildCSSClass.call(this)},t.prototype.content=function(){var e=this.player().error();return e?this.localize(e.message):""},t}(qt);tr.prototype.options_=vt(qt.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),_t.registerComponent("ErrorDisplay",tr);var ir="vjs-text-track-settings",nr=["#000","Black"],rr=["#00F","Blue"],sr=["#0FF","Cyan"],ar=["#0F0","Green"],or=["#F0F","Magenta"],lr=["#F00","Red"],ur=["#FFF","White"],cr=["#FF0","Yellow"],hr=["1","Opaque"],dr=["0.5","Semi-Transparent"],pr=["0","Transparent"],fr={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[nr,ur,lr,ar,rr,cr,or,sr]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[hr,dr,pr]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[ur,nr,lr,ar,rr,cr,or,sr]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",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:"captions-font-size-%s",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:function(e){return"1.00"===e?null:Number(e)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[hr,dr]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[pr,dr,hr]}};function mr(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}function gr(e,t){var i=e.options[e.options.selectedIndex].value;return mr(i,t)}function yr(e,t,i){if(t)for(var n=0;n<e.options.length;n++)if(mr(e.options[n].value,i)===t){e.selectedIndex=n;break}}fr.windowColor.options=fr.backgroundColor.options;var vr=function(e){function t(i,n){R(this,t),n.temporary=!1;var r=j(this,e.call(this,i,n));return r.updateDisplay=tt(r,r.updateDisplay),r.fill(),r.hasBeenOpened_=r.hasBeenFilled_=!0,r.endDialog=ae("p",{className:"vjs-control-text",textContent:r.localize("End of dialog window.")}),r.el().appendChild(r.endDialog),r.setDefaults(),void 0===n.persistTextTrackSettings&&(r.options_.persistTextTrackSettings=r.options_.playerOptions.persistTextTrackSettings),r.on(r.$(".vjs-done-button"),"click",(function(){r.saveSettings(),r.close()})),r.on(r.$(".vjs-default-button"),"click",(function(){r.setDefaults(),r.updateDisplay()})),q(fr,(function(e){r.on(r.$(e.selector),"change",r.updateDisplay)})),r.options_.persistTextTrackSettings&&r.restoreSettings(),r}return N(t,e),t.prototype.dispose=function(){this.endDialog=null,e.prototype.dispose.call(this)},t.prototype.createElSelect_=function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"label",r=fr[e],s=r.id.replace("%s",this.id_),a=[i,s].join(" ").trim();return["<"+n+' id="'+s+'" class="'+("label"===n?"vjs-label":"")+'">',this.localize(r.label),"</"+n+">",'<select aria-labelledby="'+a+'">'].concat(r.options.map((function(e){var i=s+"-"+e[1].replace(/\W+/g,"");return['<option id="'+i+'" value="'+e[0]+'" ','aria-labelledby="'+a+" "+i+'">',t.localize(e[1]),"</option>"].join("")}))).concat("</select>").join("")},t.prototype.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",e),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")},t.prototype.createElBgColor_=function(){var e="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",e),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")},t.prototype.createElWinColor_=function(){var e="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",e),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")},t.prototype.createElColors_=function(){return ae("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},t.prototype.createElFont_=function(){return ae("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})},t.prototype.createElControls_=function(){var e=this.localize("restore all settings to the default values");return ae("div",{className:"vjs-track-settings-controls",innerHTML:['<button type="button" class="vjs-default-button" title="'+e+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+e+"</span>","</button>",'<button type="button" class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},t.prototype.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},t.prototype.label=function(){return this.localize("Caption Settings Dialog")},t.prototype.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},t.prototype.buildCSSClass=function(){return e.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},t.prototype.getValues=function(){var e=this;return H(fr,(function(t,i,n){var r=gr(e.$(i.selector),i.parser);return void 0!==r&&(t[n]=r),t}),{})},t.prototype.setValues=function(e){var t=this;q(fr,(function(i,n){yr(t.$(i.selector),e[n],i.parser)}))},t.prototype.setDefaults=function(){var e=this;q(fr,(function(t){var i=t.hasOwnProperty("default")?t["default"]:0;e.$(t.selector).selectedIndex=i}))},t.prototype.restoreSettings=function(){var e=void 0;try{e=JSON.parse(r.localStorage.getItem(ir))}catch(t){K.warn(t)}e&&this.setValues(e)},t.prototype.saveSettings=function(){if(this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?r.localStorage.setItem(ir,JSON.stringify(e)):r.localStorage.removeItem(ir)}catch(t){K.warn(t)}}},t.prototype.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()},t.prototype.conditionalBlur_=function(){this.previouslyActiveEl_=null,this.off(s,"keydown",this.handleKeyDown);var e=this.player_.controlBar,t=e&&e.subsCapsButton,i=e&&e.captionsButton;t?t.focus():i&&i.focus()},t}(qt);_t.registerComponent("TextTrackSettings",vr);var _r=function(e){function t(i,n){R(this,t);var s=n.ResizeObserver||r.ResizeObserver;null===n.ResizeObserver&&(s=!1);var a=vt({createEl:!s},n),o=j(this,e.call(this,i,a));return o.ResizeObserver=n.ResizeObserver||r.ResizeObserver,o.loadListener_=null,o.resizeObserver_=null,o.debouncedHandler_=nt((function(){o.resizeHandler()}),100,!1,o),s?(o.resizeObserver_=new o.ResizeObserver(o.debouncedHandler_),o.resizeObserver_.observe(i.el())):(o.loadListener_=function(){o.el_&&o.el_.contentWindow&&ze(o.el_.contentWindow,"resize",o.debouncedHandler_)},o.one("load",o.loadListener_)),o}return N(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager"})},t.prototype.resizeHandler=function(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")},t.prototype.dispose=function(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.el_&&this.el_.contentWindow&&We(this.el_.contentWindow,"resize",this.debouncedHandler_),this.loadListener_&&this.off("load",this.loadListener_),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null},t}(_t);_t.registerComponent("ResizeManager",_r);var br=function(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var i=e.$$("source"),n=[],r="";if(!i.length)return!1;for(var s=0;s<i.length;s++){var a=i[s].src;a&&-1===n.indexOf(a)&&n.push(a)}return!!n.length&&(1===n.length&&(r=n[0]),e.triggerSourceset(r),!0)},Tr={};x||(Tr=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(e){var t=s.createElement(this.nodeName.toLowerCase());t.innerHTML=e;var i=s.createDocumentFragment();while(t.childNodes.length)i.appendChild(t.childNodes[0]);return this.innerText="",r.Element.prototype.appendChild.call(this,i),this.innerHTML}}));var Sr=function(e,t){for(var i={},n=0;n<e.length;n++)if(i=Object.getOwnPropertyDescriptor(e[n],t),i&&i.set&&i.get)break;return i.enumerable=!0,i.configurable=!0,i},kr=function(e){return Sr([e.el(),r.HTMLMediaElement.prototype,r.Element.prototype,Tr],"innerHTML")},Er=function(e){var t=e.el();if(!t.resetSourceWatch_){var i={},n=kr(e),r=function(i){return function(){for(var n=arguments.length,r=Array(n),s=0;s<n;s++)r[s]=arguments[s];var a=i.apply(t,r);return br(e),a}};["append","appendChild","insertAdjacentHTML"].forEach((function(e){t[e]&&(i[e]=t[e],t[e]=r(i[e]))})),Object.defineProperty(t,"innerHTML",vt(n,{set:r(n.set)})),t.resetSourceWatch_=function(){t.resetSourceWatch_=null,Object.keys(i).forEach((function(e){t[e]=i[e]})),Object.defineProperty(t,"innerHTML",n)},e.one("sourceset",t.resetSourceWatch_)}},wr={};x||(wr=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?ni(r.Element.prototype.getAttribute.call(this,"src")):""},set:function(e){return r.Element.prototype.setAttribute.call(this,"src",e),e}}));var Cr=function(e){return Sr([e.el(),r.HTMLMediaElement.prototype,wr],"src")},xr=function(e){if(e.featuresSourceset){var t=e.el();if(!t.resetSourceset_){var i=Cr(e),n=t.setAttribute,r=t.load;Object.defineProperty(t,"src",vt(i,{set:function(n){var r=i.set.call(t,n);return e.triggerSourceset(t.src),r}})),t.setAttribute=function(i,r){var s=n.call(t,i,r);return/src/i.test(i)&&e.triggerSourceset(t.src),s},t.load=function(){var i=r.call(t);return br(e)||(e.triggerSourceset(""),Er(e)),i},t.currentSrc?e.triggerSourceset(t.currentSrc):br(e)||Er(e),t.resetSourceset_=function(){t.resetSourceset_=null,t.load=r,t.setAttribute=n,Object.defineProperty(t,"src",i),t.resetSourceWatch_&&t.resetSourceWatch_()}}}},Ar=B(["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n This may prevent text tracks from loading."],["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n This may prevent text tracks from loading."]),Ir=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n)),s=i.source,o=!1;if(s&&(r.el_.currentSrc!==s.src||i.tag&&3===i.tag.initNetworkState_)?r.setSource(s):r.handleLateInit_(r.el_),i.enableSourceset&&r.setupSourcesetHandling_(),r.el_.hasChildNodes()){var l=r.el_.childNodes,u=l.length,c=[];while(u--){var h=l[u],d=h.nodeName.toLowerCase();"track"===d&&(r.featuresNativeTextTracks?(r.remoteTextTrackEls().addTrackElement_(h),r.remoteTextTracks().addTrack(h.track),r.textTracks().addTrack(h.track),o||r.el_.hasAttribute("crossorigin")||!si(h.src)||(o=!0)):c.push(h))}for(var p=0;p<c.length;p++)r.el_.removeChild(c[p])}return r.proxyNativeTracks_(),r.featuresNativeTextTracks&&o&&K.warn(a(Ar)),r.restoreMetadataTracksInIOSNativePlayer_(),(P||m||S)&&!0===i.nativeControlsForTouch&&r.setControls(!0),r.proxyWebkitFullscreen_(),r.triggerReady(),r}return N(t,e),t.prototype.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),t.disposeMediaElement(this.el_),this.options_=null,e.prototype.dispose.call(this)},t.prototype.setupSourcesetHandling_=function(){xr(this)},t.prototype.restoreMetadataTracksInIOSNativePlayer_=function(){var e=this.textTracks(),t=void 0,i=function(){t=[];for(var i=0;i<e.length;i++){var n=e[i];"metadata"===n.kind&&t.push({track:n,storedMode:n.mode})}};i(),e.addEventListener("change",i),this.on("dispose",(function(){return e.removeEventListener("change",i)}));var n=function i(){for(var n=0;n<t.length;n++){var r=t[n];"disabled"===r.track.mode&&r.track.mode!==r.storedMode&&(r.track.mode=r.storedMode)}e.removeEventListener("change",i)};this.on("webkitbeginfullscreen",(function(){e.removeEventListener("change",i),e.removeEventListener("change",n),e.addEventListener("change",n)})),this.on("webkitendfullscreen",(function(){e.removeEventListener("change",i),e.addEventListener("change",i),e.removeEventListener("change",n)}))},t.prototype.proxyNativeTracks_=function(){var e=this;yi.names.forEach((function(t){var i=yi[t],n=e.el()[i.getterName],r=e[i.getterName]();if(e["featuresNative"+i.capitalName+"Tracks"]&&n&&n.addEventListener){var s={change:function(e){r.trigger({type:"change",target:r,currentTarget:r,srcElement:r})},addtrack:function(e){r.addTrack(e.track)},removetrack:function(e){r.removeTrack(e.track)}},a=function(){for(var e=[],t=0;t<r.length;t++){for(var i=!1,s=0;s<n.length;s++)if(n[s]===r[t]){i=!0;break}i||e.push(r[t])}while(e.length)r.removeTrack(e.shift())};Object.keys(s).forEach((function(t){var i=s[t];n.addEventListener(t,i),e.on("dispose",(function(e){return n.removeEventListener(t,i)}))})),e.on("loadstart",a),e.on("dispose",(function(t){return e.off("loadstart",a)}))}}))},t.prototype.createEl=function(){var e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){var i=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(i,e),t.disposeMediaElement(e),e=i}else{e=s.createElement("video");var n=this.options_.tag&&fe(this.options_.tag),r=vt({},n);P&&!0===this.options_.nativeControlsForTouch||delete r.controls,pe(e,V(r,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}"undefined"!==typeof this.options_.preload&&ge(e,"preload",this.options_.preload);for(var a=["loop","muted","playsinline","autoplay"],o=0;o<a.length;o++){var l=a[o],u=this.options_[l];"undefined"!==typeof u&&(u?ge(e,l,l):ye(e,l),e[l]=u)}return e},t.prototype.handleLateInit_=function(e){if(0!==e.networkState&&3!==e.networkState){if(0===e.readyState){var t=!1,i=function(){t=!0};this.on("loadstart",i);var n=function(){t||this.trigger("loadstart")};return this.on("loadedmetadata",n),void this.ready((function(){this.off("loadstart",i),this.off("loadedmetadata",n),t||this.trigger("loadstart")}))}var r=["loadstart"];r.push("loadedmetadata"),e.readyState>=2&&r.push("loadeddata"),e.readyState>=3&&r.push("canplay"),e.readyState>=4&&r.push("canplaythrough"),this.ready((function(){r.forEach((function(e){this.trigger(e)}),this)}))}},t.prototype.setCurrentTime=function(e){try{this.el_.currentTime=e}catch(t){K(t,"Video is not ready. (Video.js)")}},t.prototype.duration=function(){var e=this;if(this.el_.duration===1/0&&_&&w&&0===this.el_.currentTime){var t=function t(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",t))};return this.on("timeupdate",t),NaN}return this.el_.duration||NaN},t.prototype.width=function(){return this.el_.offsetWidth},t.prototype.height=function(){return this.el_.offsetHeight},t.prototype.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var t=function(){this.trigger("fullscreenchange",{isFullscreen:!1})},i=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",t),this.trigger("fullscreenchange",{isFullscreen:!0}))};this.on("webkitbeginfullscreen",i),this.on("dispose",(function(){e.off("webkitbeginfullscreen",i),e.off("webkitendfullscreen",t)}))}},t.prototype.supportsFullScreen=function(){if("function"===typeof this.el_.webkitEnterFullScreen){var e=r.navigator&&r.navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},t.prototype.enterFullScreen=function(){var e=this.el_;e.paused&&e.networkState<=e.HAVE_METADATA?(this.el_.play(),this.setTimeout((function(){e.pause(),e.webkitEnterFullScreen()}),0)):e.webkitEnterFullScreen()},t.prototype.exitFullScreen=function(){this.el_.webkitExitFullScreen()},t.prototype.src=function(e){if(void 0===e)return this.el_.src;this.setSrc(e)},t.prototype.reset=function(){t.resetMediaElement(this.el_)},t.prototype.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},t.prototype.setControls=function(e){this.el_.controls=!!e},t.prototype.addTextTrack=function(t,i,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(t,i,n):e.prototype.addTextTrack.call(this,t,i,n)},t.prototype.createRemoteTextTrack=function(t){if(!this.featuresNativeTextTracks)return e.prototype.createRemoteTextTrack.call(this,t);var i=s.createElement("track");return t.kind&&(i.kind=t.kind),t.label&&(i.label=t.label),(t.language||t.srclang)&&(i.srclang=t.language||t.srclang),t["default"]&&(i["default"]=t["default"]),t.id&&(i.id=t.id),t.src&&(i.src=t.src),i},t.prototype.addRemoteTextTrack=function(t,i){var n=e.prototype.addRemoteTextTrack.call(this,t,i);return this.featuresNativeTextTracks&&this.el().appendChild(n),n},t.prototype.removeRemoteTextTrack=function(t){if(e.prototype.removeRemoteTextTrack.call(this,t),this.featuresNativeTextTracks){var i=this.$$("track"),n=i.length;while(n--)t!==i[n]&&t!==i[n].track||this.el().removeChild(i[n])}},t.prototype.getVideoPlaybackQuality=function(){if("function"===typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var e={};return"undefined"!==typeof this.el().webkitDroppedFrameCount&&"undefined"!==typeof this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),r.performance&&"function"===typeof r.performance.now?e.creationTime=r.performance.now():r.performance&&r.performance.timing&&"number"===typeof r.performance.timing.navigationStart&&(e.creationTime=r.Date.now()-r.performance.timing.navigationStart),e},t}(Ti);if(ie()){Ir.TEST_VID=s.createElement("video");var Or=s.createElement("track");Or.kind="captions",Or.srclang="en",Or.label="English",Ir.TEST_VID.appendChild(Or)}Ir.isSupported=function(){try{Ir.TEST_VID.volume=.5}catch(e){return!1}return!(!Ir.TEST_VID||!Ir.TEST_VID.canPlayType)},Ir.canPlayType=function(e){return Ir.TEST_VID.canPlayType(e)},Ir.canPlaySource=function(e,t){return Ir.canPlayType(e.type)},Ir.canControlVolume=function(){try{var e=Ir.TEST_VID.volume;return Ir.TEST_VID.volume=e/2+.1,e!==Ir.TEST_VID.volume}catch(t){return!1}},Ir.canMuteVolume=function(){try{var e=Ir.TEST_VID.muted;return Ir.TEST_VID.muted=!e,Ir.TEST_VID.muted?ge(Ir.TEST_VID,"muted","muted"):ye(Ir.TEST_VID,"muted","muted"),e!==Ir.TEST_VID.muted}catch(t){return!1}},Ir.canControlPlaybackRate=function(){if(_&&w&&C<58)return!1;try{var e=Ir.TEST_VID.playbackRate;return Ir.TEST_VID.playbackRate=e/2+.1,e!==Ir.TEST_VID.playbackRate}catch(t){return!1}},Ir.canOverrideAttributes=function(){if(x)return!1;try{var e=function(){};Object.defineProperty(s.createElement("video"),"src",{get:e,set:e}),Object.defineProperty(s.createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(s.createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(s.createElement("audio"),"innerHTML",{get:e,set:e})}catch(t){return!1}return!0},Ir.supportsNativeTextTracks=function(){return O||y&&w},Ir.supportsNativeVideoTracks=function(){return!(!Ir.TEST_VID||!Ir.TEST_VID.videoTracks)},Ir.supportsNativeAudioTracks=function(){return!(!Ir.TEST_VID||!Ir.TEST_VID.audioTracks)},Ir.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],Ir.prototype.featuresVolumeControl=Ir.canControlVolume(),Ir.prototype.featuresMuteControl=Ir.canMuteVolume(),Ir.prototype.featuresPlaybackRate=Ir.canControlPlaybackRate(),Ir.prototype.featuresSourceset=Ir.canOverrideAttributes(),Ir.prototype.movingMediaElementInDOM=!y,Ir.prototype.featuresFullscreenResize=!0,Ir.prototype.featuresProgressEvents=!0,Ir.prototype.featuresTimeupdateEvents=!0,Ir.prototype.featuresNativeTextTracks=Ir.supportsNativeTextTracks(),Ir.prototype.featuresNativeVideoTracks=Ir.supportsNativeVideoTracks(),Ir.prototype.featuresNativeAudioTracks=Ir.supportsNativeAudioTracks();var Pr=Ir.TEST_VID&&Ir.TEST_VID.constructor.prototype.canPlayType,Lr=/^application\/(?:x-|vnd\.apple\.)mpegurl/i,Dr=/^video\/mp4/i;Ir.patchCanPlayType=function(){b>=4&&!k&&!w?Ir.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&Lr.test(e)?"maybe":Pr.call(this,e)}:T&&(Ir.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&Dr.test(e)?"maybe":Pr.call(this,e)})},Ir.unpatchCanPlayType=function(){var e=Ir.TEST_VID.constructor.prototype.canPlayType;return Ir.TEST_VID.constructor.prototype.canPlayType=Pr,e},Ir.patchCanPlayType(),Ir.disposeMediaElement=function(e){if(e){e.parentNode&&e.parentNode.removeChild(e);while(e.hasChildNodes())e.removeChild(e.firstChild);e.removeAttribute("src"),"function"===typeof e.load&&function(){try{e.load()}catch(t){}}()}},Ir.resetMediaElement=function(e){if(e){var t=e.querySelectorAll("source"),i=t.length;while(i--)e.removeChild(t[i]);e.removeAttribute("src"),"function"===typeof e.load&&function(){try{e.load()}catch(t){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(e){Ir.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}})),["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(e){Ir.prototype["set"+gt(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}})),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","played","networkState","readyState","videoWidth","videoHeight"].forEach((function(e){Ir.prototype[e]=function(){return this.el_[e]}})),["volume","src","poster","preload","playbackRate","defaultPlaybackRate"].forEach((function(e){Ir.prototype["set"+gt(e)]=function(t){this.el_[e]=t}})),["pause","load","play"].forEach((function(e){Ir.prototype[e]=function(){return this.el_[e]()}})),Ti.withSourceHandlers(Ir),Ir.nativeSourceHandler={},Ir.nativeSourceHandler.canPlayType=function(e){try{return Ir.TEST_VID.canPlayType(e)}catch(t){return""}},Ir.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return Ir.nativeSourceHandler.canPlayType(e.type);if(e.src){var i=ri(e.src);return Ir.nativeSourceHandler.canPlayType("video/"+i)}return""},Ir.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)},Ir.nativeSourceHandler.dispose=function(){},Ir.registerSourceHandler(Ir.nativeSourceHandler),Ti.registerTech("Html5",Ir);var Mr=B(["\n Using the tech directly can be dangerous. I hope you know what you're doing.\n See https://github.com/videojs/video.js/issues/2617 for more info.\n "],["\n Using the tech directly can be dangerous. I hope you know what you're doing.\n See https://github.com/videojs/video.js/issues/2617 for more info.\n "]),Rr=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Nr={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},jr=["tiny","xsmall","small","medium","large","xlarge","huge"],Br={};jr.forEach((function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;Br[e]="vjs-layout-"+t}));var Ur={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Fr=function(e){function t(i,n,r){if(R(this,t),i.id=i.id||n.id||"vjs_video_"+De(),n=V(t.getTagSettings(i),n),n.initChildren=!1,n.createEl=!1,n.evented=!1,n.reportTouchActivity=!1,!n.language)if("function"===typeof i.closest){var s=i.closest("[lang]");s&&s.getAttribute&&(n.language=s.getAttribute("lang"))}else{var a=i;while(a&&1===a.nodeType){if(fe(a).hasOwnProperty("lang")){n.language=a.getAttribute("lang");break}a=a.parentNode}}var o=j(this,e.call(this,null,n,r));if(o.log=Y(o.id_),o.isPosterFromTech_=!1,o.queuedCallbacks_=[],o.isReady_=!1,o.hasStarted_=!1,o.userActive_=!1,!o.options_||!o.options_.techOrder||!o.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(o.tag=i,o.tagAttributes=i&&fe(i),o.language(o.options_.language),n.languages){var l={};Object.getOwnPropertyNames(n.languages).forEach((function(e){l[e.toLowerCase()]=n.languages[e]})),o.languages_=l}else o.languages_=t.prototype.options_.languages;o.cache_={},o.poster_=n.poster||"",o.controls_=!!n.controls,o.cache_.lastVolume=1,i.controls=!1,i.removeAttribute("controls"),i.hasAttribute("autoplay")?o.options_.autoplay=!0:o.autoplay(o.options_.autoplay),o.scrubbing_=!1,o.el_=o.createEl(),o.cache_.lastPlaybackRate=o.defaultPlaybackRate(),pt(o,{eventBusKey:"el_"});var u=vt(o.options_);if(n.plugins){var h=n.plugins;Object.keys(h).forEach((function(e){if("function"!==typeof this[e])throw new Error('plugin "'+e+'" does not exist');this[e](h[e])}),o)}o.options_.playerOptions=u,o.middleware_=[],o.initChildren(),o.isAudio("audio"===i.nodeName.toLowerCase()),o.controls()?o.addClass("vjs-controls-enabled"):o.addClass("vjs-controls-disabled"),o.el_.setAttribute("role","region"),o.isAudio()?o.el_.setAttribute("aria-label",o.localize("Audio Player")):o.el_.setAttribute("aria-label",o.localize("Video Player")),o.isAudio()&&o.addClass("vjs-audio"),o.flexNotSupported_()&&o.addClass("vjs-no-flex"),y||o.addClass("vjs-workinghover"),t.players[o.id_]=o;var d=c.split(".")[0];return o.addClass("vjs-v"+d),o.userActive(!0),o.reportUserActivity(),o.one("play",o.listenForUserActivity_),o.on("fullscreenchange",o.handleFullscreenChange_),o.on("stageclick",o.handleStageClick_),o.breakpoints(o.options_.breakpoints),o.responsive(o.options_.responsive),o.changingSrc_=!1,o.playWaitingForReady_=!1,o.playOnLoadstart_=null,o}return N(t,e),t.prototype.dispose=function(){this.trigger("dispose"),this.off("dispose"),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),t.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),Ni(this),e.prototype.dispose.call(this)},t.prototype.createEl=function(){var t=this.tag,i=void 0,n=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player"),a="video-js"===this.tag.tagName.toLowerCase();n?i=this.el_=t.parentNode:a||(i=this.el_=e.prototype.createEl.call(this,"div"));var o=fe(t);if(a){i=this.el_=t,t=this.tag=s.createElement("video");while(i.children.length)t.appendChild(i.firstChild);ue(i,"video-js")||ce(i,"video-js"),i.appendChild(t),n=this.playerElIngest_=i,["autoplay","controls","crossOrigin","defaultMuted","defaultPlaybackRate","loop","muted","playbackRate","src","volume"].forEach((function(e){"undefined"!==typeof i[e]&&(t[e]=i[e])}))}if(t.setAttribute("tabindex","-1"),o.tabindex="-1",A&&(t.setAttribute("role","application"),o.role="application"),t.removeAttribute("width"),t.removeAttribute("height"),"width"in o&&delete o.width,"height"in o&&delete o.height,Object.getOwnPropertyNames(o).forEach((function(e){"class"===e?(i.className+=" "+o[e],a&&(t.className+=" "+o[e])):(i.setAttribute(e,o[e]),a&&t.setAttribute(e,o[e]))})),t.playerId=t.id,t.id+="_html5_api",t.className="vjs-tech",t.player=i.player=this,this.addClass("vjs-paused"),!0!==r.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=Ze("vjs-styles-dimensions");var l=Ie(".vjs-styles-defaults"),u=Ie("head");u.insertBefore(this.styleEl_,l?l.nextSibling:u.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);for(var c=t.getElementsByTagName("a"),h=0;h<c.length;h++){var d=c.item(h);ce(d,"vjs-hidden"),d.setAttribute("hidden","hidden")}return t.initNetworkState_=t.networkState,t.parentNode&&!n&&t.parentNode.insertBefore(i,t),le(t,i),this.children_.unshift(t),this.el_.setAttribute("lang",this.language_),this.el_=i,i},t.prototype.width=function(e){return this.dimension("width",e)},t.prototype.height=function(e){return this.dimension("height",e)},t.prototype.dimension=function(e,t){var i=e+"_";if(void 0===t)return this[i]||0;if(""===t)return this[i]=void 0,void this.updateStyleEl_();var n=parseFloat(t);isNaN(n)?K.error('Improper value "'+t+'" supplied for for '+e):(this[i]=n,this.updateStyleEl_())},t.prototype.fluid=function(e){if(void 0===e)return!!this.fluid_;this.fluid_=!!e,e?(this.addClass("vjs-fluid"),this.fill(!1)):this.removeClass("vjs-fluid"),this.updateStyleEl_()},t.prototype.fill=function(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")},t.prototype.aspectRatio=function(e){if(void 0===e)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_()},t.prototype.updateStyleEl_=function(){if(!0!==r.VIDEOJS_NO_DYNAMIC_STYLE){var e=void 0,t=void 0,i=void 0,n=void 0;i=void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9";var s=i.split(":"),a=s[1]/s[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/a:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*a,n=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(n),et(this.styleEl_,"\n ."+n+" {\n width: "+e+"px;\n height: "+t+"px;\n }\n\n ."+n+".vjs-fluid {\n padding-top: "+100*a+"%;\n }\n ")}else{var o="number"===typeof this.width_?this.width_:this.options_.width,l="number"===typeof this.height_?this.height_:this.options_.height,u=this.tech_&&this.tech_.el();u&&(o>=0&&(u.width=o),l>=0&&(u.height=l))}},t.prototype.loadTech_=function(e,t){var i=this;this.tech_&&this.unloadTech_();var n=gt(e),r=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==n&&this.tag&&(Ti.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;var s="string"!==typeof this.autoplay()&&this.autoplay(),a={source:t,autoplay:s,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+r+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,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};_i.names.forEach((function(e){var t=_i[e];a[t.getterName]=i[t.privateName]})),V(a,this.options_[n]),V(a,this.options_[r]),V(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);var o=Ti.getTech(e);if(!o)throw new Error("No Tech named '"+n+"' exists! '"+n+"' should be registered using videojs.registerTech()'");this.tech_=new o(a),this.tech_.ready(tt(this,this.handleTechReady_),!0),Bt.jsonToTextTracks(this.textTracksJson_||[],this.tech_),Rr.forEach((function(e){i.on(i.tech_,e,i["handleTech"+gt(e)+"_"])})),Object.keys(Nr).forEach((function(e){i.on(i.tech_,e,(function(t){0===i.tech_.playbackRate()&&i.tech_.seeking()?i.queuedCallbacks_.push({callback:i["handleTech"+Nr[e]+"_"].bind(i),event:t}):i["handleTech"+Nr[e]+"_"](t)}))})),this.on(this.tech_,"loadstart",this.handleTechLoadStart_),this.on(this.tech_,"sourceset",this.handleTechSourceset_),this.on(this.tech_,"waiting",this.handleTechWaiting_),this.on(this.tech_,"ended",this.handleTechEnded_),this.on(this.tech_,"seeking",this.handleTechSeeking_),this.on(this.tech_,"play",this.handleTechPlay_),this.on(this.tech_,"firstplay",this.handleTechFirstPlay_),this.on(this.tech_,"pause",this.handleTechPause_),this.on(this.tech_,"durationchange",this.handleTechDurationChange_),this.on(this.tech_,"fullscreenchange",this.handleTechFullscreenChange_),this.on(this.tech_,"error",this.handleTechError_),this.on(this.tech_,"loadedmetadata",this.updateStyleEl_),this.on(this.tech_,"posterchange",this.handleTechPosterChange_),this.on(this.tech_,"textdata",this.handleTechTextData_),this.on(this.tech_,"ratechange",this.handleTechRateChange_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===n&&this.tag||le(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},t.prototype.unloadTech_=function(){var e=this;_i.names.forEach((function(t){var i=_i[t];e[i.privateName]=e[i.getterName]()})),this.textTracksJson_=Bt.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},t.prototype.tech=function(e){return void 0===e&&K.warn(a(Mr)),this.tech_},t.prototype.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"mousedown",this.handleTechClick_),this.on(this.tech_,"touchstart",this.handleTechTouchStart_),this.on(this.tech_,"touchmove",this.handleTechTouchMove_),this.on(this.tech_,"touchend",this.handleTechTouchEnd_),this.on(this.tech_,"tap",this.handleTechTap_)},t.prototype.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.handleTechTap_),this.off(this.tech_,"touchstart",this.handleTechTouchStart_),this.off(this.tech_,"touchmove",this.handleTechTouchMove_),this.off(this.tech_,"touchend",this.handleTechTouchEnd_),this.off(this.tech_,"mousedown",this.handleTechClick_)},t.prototype.handleTechReady_=function(){if(this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_(),(this.src()||this.currentSrc())&&this.tag&&this.options_.autoplay&&this.paused())try{delete this.tag.poster}catch(e){K("deleting tag.poster throws in some browsers",e)}},t.prototype.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(this.autoplay())},t.prototype.manualAutoplay_=function(e){var t=this;if(this.tech_&&"string"===typeof e){var i=function(){var e=t.muted();t.muted(!0);var i=t.play();if(i&&i.then&&i["catch"])return i["catch"]((function(i){t.muted(e)}))},n=void 0;if("any"===e?(n=this.play(),n&&n.then&&n["catch"]&&n["catch"]((function(){return i()}))):n="muted"===e?i():this.play(),n&&n.then&&n["catch"])return n.then((function(){t.trigger({type:"autoplay-success",autoplay:e})}))["catch"]((function(i){t.trigger({type:"autoplay-failure",autoplay:e})}))}},t.prototype.updateSourceCaches_=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e,i="";"string"!==typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=qi(this,t)),this.cache_.source=vt({},e,{src:t,type:i});for(var n=this.cache_.sources.filter((function(e){return e.src&&e.src===t})),r=[],s=this.$$("source"),a=[],o=0;o<s.length;o++){var l=fe(s[o]);r.push(l),l.src&&l.src===t&&a.push(l.src)}a.length&&!n.length?this.cache_.sources=r:n.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t},t.prototype.handleTechSourceset_=function(e){var t=this;if(!this.changingSrc_){var i=function(e){return t.updateSourceCaches_(e)},n=this.currentSource().src,r=e.src;if(n&&!/^blob:/.test(n)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==n)&&(i=function(){}),i(r),!e.src){var s=function e(i){if("sourceset"!==i.type){var n=t.techGet("currentSrc");t.lastSource_.tech=n,t.updateSourceCaches_(n)}t.tech_.off(["sourceset","loadstart"],e)};this.tech_.one(["sourceset","loadstart"],s)}}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})},t.prototype.hasStarted=function(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},t.prototype.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},t.prototype.handleTechRateChange_=function(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach((function(e){return e.callback(e.event)})),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},t.prototype.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting"),this.one("timeupdate",(function(){return e.removeClass("vjs-waiting")}))},t.prototype.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},t.prototype.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},t.prototype.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},t.prototype.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},t.prototype.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.trigger("seeked")},t.prototype.handleTechFirstPlay_=function(){this.options_.starttime&&(K.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},t.prototype.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},t.prototype.handleTechEnded_=function(){this.addClass("vjs-ended"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},t.prototype.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},t.prototype.handleTechClick_=function(e){Ae(e)&&this.controls_&&(this.paused()?Mt(this.play()):this.pause())},t.prototype.handleTechTap_=function(){this.userActive(!this.userActive())},t.prototype.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},t.prototype.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},t.prototype.handleTechTouchEnd_=function(e){e.preventDefault()},t.prototype.handleFullscreenChange_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},t.prototype.handleStageClick_=function(){this.reportUserActivity()},t.prototype.handleTechFullscreenChange_=function(e,t){t&&this.isFullscreen(t.isFullscreen),this.trigger("fullscreenchange")},t.prototype.handleTechError_=function(){var e=this.tech_.error();this.error(e)},t.prototype.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)},t.prototype.getCache=function(){return this.cache_},t.prototype.techCall_=function(e,t){this.ready((function(){if(e in Li)return Ii(this.middleware_,this.tech_,e,t);if(e in Di)return Oi(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(i){throw K(i),i}}),!0)},t.prototype.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in Pi)return Ai(this.middleware_,this.tech_,e);if(e in Di)return Oi(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw K("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",t),t;if("TypeError"===t.name)throw K("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",t),this.tech_.isReady_=!1,t;throw K(t),t}}},t.prototype.play=function(){var e=this,t=this.options_.Promise||r.Promise;return t?new t((function(t){e.play_(t)})):this.play_()},t.prototype.play_=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mt;if(this.playOnLoadstart_&&this.off("loadstart",this.playOnLoadstart_),this.isReady_){if(!this.changingSrc_&&(this.src()||this.currentSrc()))return void t(this.techGet_("play"));this.playOnLoadstart_=function(){e.playOnLoadstart_=null,t(e.play())},this.one("loadstart",this.playOnLoadstart_)}else{if(this.playWaitingForReady_)return;this.playWaitingForReady_=!0,this.ready((function(){e.playWaitingForReady_=!1,t(e.play())}))}},t.prototype.pause=function(){this.techCall_("pause")},t.prototype.paused=function(){return!1!==this.techGet_("paused")},t.prototype.played=function(){return this.techGet_("played")||kt(0,0)},t.prototype.scrubbing=function(e){if("undefined"===typeof e)return this.scrubbing_;this.scrubbing_=!!e,e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},t.prototype.currentTime=function(e){return"undefined"!==typeof e?(e<0&&(e=0),void this.techCall_("setCurrentTime",e)):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},t.prototype.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?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"),this.trigger("durationchange"))},t.prototype.remainingTime=function(){return this.duration()-this.currentTime()},t.prototype.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},t.prototype.buffered=function(){var e=this.techGet_("buffered");return e&&e.length||(e=kt(0,0)),e},t.prototype.bufferedPercent=function(){return Et(this.buffered(),this.duration())},t.prototype.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),i=e.end(e.length-1);return i>t&&(i=t),i},t.prototype.volume=function(e){var t=void 0;return void 0!==e?(t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)},t.prototype.muted=function(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)},t.prototype.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},t.prototype.lastVolume_=function(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e},t.prototype.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},t.prototype.isFullscreen=function(e){if(void 0===e)return!!this.isFullscreen_;this.isFullscreen_=!!e},t.prototype.requestFullscreen=function(){var e=wt;this.isFullscreen(!0),e.requestFullscreen?(ze(s,e.fullscreenchange,tt(this,(function t(i){this.isFullscreen(s[e.fullscreenElement]),!1===this.isFullscreen()&&We(s,e.fullscreenchange,t),this.trigger("fullscreenchange")}))),this.el_[e.requestFullscreen]()):this.tech_.supportsFullScreen()?this.techCall_("enterFullScreen"):(this.enterFullWindow(),this.trigger("fullscreenchange"))},t.prototype.exitFullscreen=function(){var e=wt;this.isFullscreen(!1),e.requestFullscreen?s[e.exitFullscreen]():this.tech_.supportsFullScreen()?this.techCall_("exitFullScreen"):(this.exitFullWindow(),this.trigger("fullscreenchange"))},t.prototype.enterFullWindow=function(){this.isFullWindow=!0,this.docOrigOverflow=s.documentElement.style.overflow,ze(s,"keydown",tt(this,this.fullWindowOnEscKey)),s.documentElement.style.overflow="hidden",ce(s.body,"vjs-full-window"),this.trigger("enterFullWindow")},t.prototype.fullWindowOnEscKey=function(e){27===e.keyCode&&(!0===this.isFullscreen()?this.exitFullscreen():this.exitFullWindow())},t.prototype.exitFullWindow=function(){this.isFullWindow=!1,We(s,"keydown",this.fullWindowOnEscKey),s.documentElement.style.overflow=this.docOrigOverflow,he(s.body,"vjs-full-window"),this.trigger("exitFullWindow")},t.prototype.canPlayType=function(e){for(var t=void 0,i=0,n=this.options_.techOrder;i<n.length;i++){var r=n[i],s=Ti.getTech(r);if(s||(s=_t.getComponent(r)),s){if(s.isSupported()&&(t=s.canPlayType(e),t))return t}else K.error('The "'+r+'" tech is undefined. Skipped browser support check for that tech.')}return""},t.prototype.selectSource=function(e){var t=this,i=this.options_.techOrder.map((function(e){return[e,Ti.getTech(e)]})).filter((function(e){var t=e[0],i=e[1];return i?i.isSupported():(K.error('The "'+t+'" tech is undefined. Skipped browser support check for that tech.'),!1)})),n=function(e,t,i){var n=void 0;return e.some((function(e){return t.some((function(t){if(n=i(e,t),n)return!0}))})),n},r=void 0,s=function(e){return function(t,i){return e(i,t)}},a=function(e,i){var n=e[0],r=e[1];if(r.canPlaySource(i,t.options_[n.toLowerCase()]))return{source:i,tech:n}};return r=this.options_.sourceOrder?n(e,i,s(a)):n(i,e,a),r||!1},t.prototype.src=function(e){var t=this;if("undefined"===typeof e)return this.cache_.src||"";var i=Hi(e);i.length?(this.changingSrc_=!0,this.cache_.sources=i,this.updateSourceCaches_(i[0]),Ci(this,i[0],(function(e,n){t.middleware_=n,t.cache_.sources=i,t.updateSourceCaches_(e);var r=t.src_(e);if(r)return i.length>1?t.src(i.slice(1)):(t.changingSrc_=!1,t.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0),void t.triggerReady());xi(n,t.tech_)}))):this.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0)},t.prototype.src_=function(e){var t=this,i=this.selectSource([e]);return!i||(yt(i.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_(i.tech,i.source),this.tech_.ready((function(){t.changingSrc_=!1})),!1))},t.prototype.load=function(){this.techCall_("load")},t.prototype.reset=function(){this.tech_&&this.tech_.clearTracks("text"),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset")},t.prototype.currentSources=function(){var e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t},t.prototype.currentSource=function(){return this.cache_.source||{}},t.prototype.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},t.prototype.currentType=function(){return this.currentSource()&&this.currentSource().type||""},t.prototype.preload=function(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")},t.prototype.autoplay=function(e){if(void 0===e)return this.options_.autoplay||!1;var t=void 0;"string"===typeof e&&/(any|play|muted)/.test(e)?(this.options_.autoplay=e,this.manualAutoplay_(e),t=!1):this.options_.autoplay=!!e,t=t||this.options_.autoplay,this.tech_&&this.techCall_("setAutoplay",t)},t.prototype.playsinline=function(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},t.prototype.loop=function(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")},t.prototype.poster=function(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},t.prototype.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},t.prototype.controls=function(e){if(void 0===e)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_()))},t.prototype.usingNativeControls=function(e){if(void 0===e)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")))},t.prototype.error=function(e){return void 0===e?this.error_||null:null===e?(this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close())):(this.error_=new Pt(e),this.addClass("vjs-error"),K.error("(CODE:"+this.error_.code+" "+Pt.errorTypes[this.error_.code]+")",this.error_.message,this.error_),void this.trigger("error"))},t.prototype.reportUserActivity=function(e){this.userActivity_=!0},t.prototype.userActive=function(e){if(void 0===e)return this.userActive_;if(e=!!e,e!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",(function(e){e.stopPropagation(),e.preventDefault()})),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},t.prototype.listenForUserActivity_=function(){var e=void 0,t=void 0,i=void 0,n=tt(this,this.reportUserActivity),r=function(e){e.screenX===t&&e.screenY===i||(t=e.screenX,i=e.screenY,n())},s=function(){n(),this.clearInterval(e),e=this.setInterval(n,250)},a=function(t){n(),this.clearInterval(e)};this.on("mousedown",s),this.on("mousemove",r),this.on("mouseup",a),this.on("keydown",n),this.on("keyup",n);var o=void 0;this.setInterval((function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(o);var e=this.options_.inactivityTimeout;e<=0||(o=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),e))}}),250)},t.prototype.playbackRate=function(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)},t.prototype.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},t.prototype.isAudio=function(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e},t.prototype.addTextTrack=function(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)},t.prototype.addRemoteTextTrack=function(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)},t.prototype.removeRemoteTextTrack=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.track,i=void 0===t?arguments[0]:t;if(this.tech_)return this.tech_.removeRemoteTextTrack(i)},t.prototype.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},t.prototype.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},t.prototype.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},t.prototype.language=function(e){if(void 0===e)return this.language_;this.language_=String(e).toLowerCase()},t.prototype.languages=function(){return vt(t.prototype.options_.languages,this.languages_)},t.prototype.toJSON=function(){var e=vt(this.options_),t=e.tracks;e.tracks=[];for(var i=0;i<t.length;i++){var n=t[i];n=vt(n),n.player=void 0,e.tracks[i]=n}return e},t.prototype.createModal=function(e,t){var i=this;t=t||{},t.content=e||"";var n=new qt(this,t);return this.addChild(n),n.on("dispose",(function(){i.removeChild(n)})),n.open(),n},t.prototype.updateCurrentBreakpoint_=function(){if(this.responsive())for(var e=this.currentBreakpoint(),t=this.currentWidth(),i=0;i<jr.length;i++){var n=jr[i],r=this.breakpoints_[n];if(t<=r){if(e===n)return;e&&this.removeClass(Br[e]),this.addClass(Br[n]),this.breakpoint_=n;break}}},t.prototype.removeCurrentBreakpoint_=function(){var e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)},t.prototype.breakpoints=function(e){return void 0===e||(this.breakpoint_="",this.breakpoints_=V({},Ur,e),this.updateCurrentBreakpoint_()),V(this.breakpoints_)},t.prototype.responsive=function(e){if(void 0===e)return this.responsive_;e=Boolean(e);var t=this.responsive_;return e!==t?(this.responsive_=e,e?(this.on("playerresize",this.updateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.updateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0},t.prototype.currentBreakpoint=function(){return this.breakpoint_},t.prototype.currentBreakpointClass=function(){return Br[this.breakpoint_]||""},t.getTagSettings=function(e){var t={sources:[],tracks:[]},i=fe(e),n=i["data-setup"];if(ue(e,"vjs-fill")&&(i.fill=!0),ue(e,"vjs-fluid")&&(i.fluid=!0),null!==n){var r=o(n||"{}"),s=r[0],a=r[1];s&&K.error(s),V(i,a)}if(V(t,i),e.hasChildNodes())for(var l=e.childNodes,u=0,c=l.length;u<c;u++){var h=l[u],d=h.nodeName.toLowerCase();"source"===d?t.sources.push(fe(h)):"track"===d&&t.tracks.push(fe(h))}return t},t.prototype.flexNotSupported_=function(){var e=s.createElement("i");return!("flexBasis"in e.style||"webkitFlexBasis"in e.style||"mozFlexBasis"in e.style||"msFlexBasis"in e.style||"msFlexOrder"in e.style)},t}(_t);_i.names.forEach((function(e){var t=_i[e];Fr.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}})),Fr.players={};var qr=r.navigator;Fr.prototype.options_={techOrder:Ti.defaultTechOrder_,html5:{},flash:{},inactivityTimeout:2e3,playbackRates:[],children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","controlBar","errorDisplay","textTrackSettings"],language:qr&&(qr.languages&&qr.languages[0]||qr.userLanguage||qr.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",breakpoints:{},responsive:!1},x||Fr.prototype.options_.children.push("resizeManager"),["ended","seeking","seekable","networkState","readyState"].forEach((function(e){Fr.prototype[e]=function(){return this.techGet_(e)}})),Rr.forEach((function(e){Fr.prototype["handleTech"+gt(e)+"_"]=function(){return this.trigger(e)}})),_t.registerComponent("Player",Fr);var Hr="plugin",Vr="activePlugins_",zr={},Wr=function(e){return zr.hasOwnProperty(e)},$r=function(e){return Wr(e)?zr[e]:void 0},Gr=function(e,t){e[Vr]=e[Vr]||{},e[Vr][t]=!0},Xr=function(e,t,i){var n=(i?"before":"")+"pluginsetup";e.trigger(n,t),e.trigger(n+":"+t.name,t)},Kr=function(e,t){var i=function(){Xr(this,{name:e,plugin:t,instance:null},!0);var i=t.apply(this,arguments);return Gr(this,e),Xr(this,{name:e,plugin:t,instance:i}),i};return Object.keys(t).forEach((function(e){i[e]=t[e]})),i},Yr=function(e,t){return t.prototype.name=e,function(){Xr(this,{name:e,plugin:t,instance:null},!0);for(var i=arguments.length,n=Array(i),r=0;r<i;r++)n[r]=arguments[r];var s=new(Function.prototype.bind.apply(t,[null].concat([this].concat(n))));return this[e]=function(){return s},Xr(this,s.getEventHash()),s}},Qr=function(){function e(t){if(R(this,e),this.constructor===e)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=t,pt(this),delete this.trigger,mt(this,this.constructor.defaultState),Gr(t,this.name),this.dispose=tt(this,this.dispose),t.on("dispose",this.dispose)}return e.prototype.version=function(){return this.constructor.VERSION},e.prototype.getEventHash=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.name=this.name,e.plugin=this.constructor,e.instance=this,e},e.prototype.trigger=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return $e(this.eventBusEl_,e,this.getEventHash(t))},e.prototype.handleStateChanged=function(e){},e.prototype.dispose=function(){var e=this.name,t=this.player;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[Vr][e]=!1,this.player=this.state=null,t[e]=Yr(e,zr[e])},e.isBasic=function(t){var i="string"===typeof t?$r(t):t;return"function"===typeof i&&!e.prototype.isPrototypeOf(i.prototype)},e.registerPlugin=function(t,i){if("string"!==typeof t)throw new Error('Illegal plugin name, "'+t+'", must be a string, was '+("undefined"===typeof t?"undefined":M(t))+".");if(Wr(t))K.warn('A plugin named "'+t+'" already exists. You may want to avoid re-registering plugins!');else if(Fr.prototype.hasOwnProperty(t))throw new Error('Illegal plugin name, "'+t+'", cannot share a name with an existing player method!');if("function"!==typeof i)throw new Error('Illegal plugin for "'+t+'", must be a function, was '+("undefined"===typeof i?"undefined":M(i))+".");return zr[t]=i,t!==Hr&&(e.isBasic(i)?Fr.prototype[t]=Kr(t,i):Fr.prototype[t]=Yr(t,i)),i},e.deregisterPlugin=function(e){if(e===Hr)throw new Error("Cannot de-register base plugin.");Wr(e)&&(delete zr[e],delete Fr.prototype[e])},e.getPlugins=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.keys(zr),t=void 0;return e.forEach((function(e){var i=$r(e);i&&(t=t||{},t[e]=i)})),t},e.getPluginVersion=function(e){var t=$r(e);return t&&t.VERSION||""},e}();Qr.getPlugin=$r,Qr.BASE_PLUGIN_NAME=Hr,Qr.registerPlugin(Hr,Qr),Fr.prototype.usingPlugin=function(e){return!!this[Vr]&&!0===this[Vr][e]},Fr.prototype.hasPlugin=function(e){return!!Wr(e)};var Jr=function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"===typeof t?"undefined":M(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.super_=t)},Zr=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=function(){e.apply(this,arguments)},n={};for(var r in"object"===("undefined"===typeof t?"undefined":M(t))?(t.constructor!==Object.prototype.constructor&&(i=t.constructor),n=t):"function"===typeof t&&(i=t),Jr(i,e),n)n.hasOwnProperty(r)&&(i.prototype[r]=n[r]);return i};"undefined"===typeof HTMLVideoElement&&ie()&&(s.createElement("video"),s.createElement("audio"),s.createElement("track"),s.createElement("video-js"));var es=function(e){return 0===e.indexOf("#")?e.slice(1):e};function ts(e,t,i){var n=ts.getPlayer(e);if(n)return t&&K.warn('Player "'+e+'" is already initialised. Options will not be applied.'),i&&n.ready(i),n;var r="string"===typeof e?Ie("#"+es(e)):e;if(!ne(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");s.body.contains(r)||K.warn("The element supplied is not included in the DOM"),t=t||{},ts.hooks("beforesetup").forEach((function(e){var i=e(r,vt(t));z(i)&&!Array.isArray(i)?t=vt(t,i):K.error("please return an object in beforesetup hooks")}));var a=_t.getComponent("Player");return n=new a(r,t,i),ts.hooks("setup").forEach((function(e){return e(n)})),n}if(ts.hooks_={},ts.hooks=function(e,t){return ts.hooks_[e]=ts.hooks_[e]||[],t&&(ts.hooks_[e]=ts.hooks_[e].concat(t)),ts.hooks_[e]},ts.hook=function(e,t){ts.hooks(e,t)},ts.hookOnce=function(e,t){ts.hooks(e,[].concat(t).map((function(t){var i=function i(){return ts.removeHook(e,i),t.apply(void 0,arguments)};return i})))},ts.removeHook=function(e,t){var i=ts.hooks(e).indexOf(t);return!(i<=-1)&&(ts.hooks_[e]=ts.hooks_[e].slice(),ts.hooks_[e].splice(i,1),!0)},!0!==r.VIDEOJS_NO_DYNAMIC_STYLE&&ie()){var is=Ie(".vjs-styles-defaults");if(!is){is=Ze("vjs-styles-defaults");var ns=Ie("head");ns&&ns.insertBefore(is,ns.firstChild),et(is,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid {\n padding-top: 56.25%\n }\n ")}}Je(1,ts),ts.VERSION=c,ts.options=Fr.prototype.options_,ts.getPlayers=function(){return Fr.players},ts.getPlayer=function(e){var t=Fr.players,i=void 0;if("string"===typeof e){var n=es(e),r=t[n];if(r)return r;i=Ie("#"+n)}else i=e;if(ne(i)){var s=i,a=s.player,o=s.playerId;if(a||t[o])return a||t[o]}},ts.getAllPlayers=function(){return Object.keys(Fr.players).map((function(e){return Fr.players[e]})).filter(Boolean)},ts.players=Fr.players,ts.getComponent=_t.getComponent,ts.registerComponent=function(e,t){Ti.isTech(t)&&K.warn("The "+e+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),_t.registerComponent.call(_t,e,t)},ts.getTech=Ti.getTech,ts.registerTech=Ti.registerTech,ts.use=wi,!x&&Object.defineProperty?(Object.defineProperty(ts,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(ts.middleware,"TERMINATOR",{value:Ei,writeable:!1,enumerable:!0})):ts.middleware={TERMINATOR:Ei},ts.browser=D,ts.TOUCH_ENABLED=P,ts.extend=Zr,ts.mergeOptions=vt,ts.bind=tt,ts.registerPlugin=Qr.registerPlugin,ts.deregisterPlugin=Qr.deregisterPlugin,ts.plugin=function(e,t){return K.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Qr.registerPlugin(e,t)},ts.getPlugins=Qr.getPlugins,ts.getPlugin=Qr.getPlugin,ts.getPluginVersion=Qr.getPluginVersion,ts.addLanguage=function(e,t){var i;return e=(""+e).toLowerCase(),ts.options.languages=vt(ts.options.languages,(i={},i[e]=t,i)),ts.options.languages[e]},ts.log=K,ts.createLogger=Y,ts.createTimeRange=ts.createTimeRanges=kt,ts.formatTime=un,ts.setFormatTime=on,ts.resetFormatTime=ln,ts.parseUrl=ii,ts.isCrossOrigin=si,ts.EventTarget=rt,ts.on=ze,ts.one=Ge,ts.off=We,ts.trigger=$e,ts.xhr=l,ts.TextTrack=ui,ts.AudioTrack=ci,ts.VideoTrack=hi,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach((function(e){ts[e]=function(){return K.warn("videojs."+e+"() is deprecated; use videojs.dom."+e+"() instead"),Pe[e].apply(null,arguments)}})),ts.computedStyle=Q,ts.dom=Pe,ts.url=ai,e.exports=ts},1376:function(e,t,i){e.exports={tag:i("d36f"),Transmuxer:i("bc1c"),getFlvHeader:i("c5323")}},"140c":function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i("e475"),s=n(r),a={errorInterval:30,getSource:function(e){var t=this.tech({IWillNotUseThisInPlugins:!0}),i=t.currentSource_;return e(i)}},o=function e(t,i){var n=0,r=0,o=s["default"].mergeOptions(a,i);t.ready((function(){t.trigger({type:"usage",name:"hls-error-reload-initialized"})}));var l=function(){r&&t.currentTime(r)},u=function(e){null!==e&&void 0!==e&&(r=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",l),t.src(e),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},c=function(){if(Date.now()-n<1e3*o.errorInterval)t.trigger({type:"usage",name:"hls-error-reload-canceled"});else{if(o.getSource&&"function"===typeof o.getSource)return n=Date.now(),o.getSource.call(t,u);s["default"].log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}},h=function e(){t.off("loadedmetadata",l),t.off("error",c),t.off("dispose",e)},d=function(i){h(),e(t,i)};t.on("error",c),t.on("dispose",h),t.reloadSourceOnError=d},l=function(e){o(this,e)};t["default"]=l,e.exports=t["default"]},"14b8":function(e,t){var i=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function n(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function r(e){function t(e,t,i,n){return 3600*(0|e)+60*(0|t)+(0|i)+(0|n)/1e3}var i=e.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function s(){this.values=i(null)}function a(e,t,i,n){var r=n?e.split(n):[e];for(var s in r)if("string"===typeof r[s]){var a=r[s].split(i);if(2===a.length){var o=a[0],l=a[1];t(o,l)}}}function o(e,t,i){var o=e;function l(){var t=r(e);if(null===t)throw new n(n.Errors.BadTimeStamp,"Malformed timestamp: "+o);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function u(e,t){var n=new s;a(e,(function(e,t){switch(e){case"region":for(var r=i.length-1;r>=0;r--)if(i[r].id===t){n.set(e,i[r].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var s=t.split(","),a=s[0];n.integer(e,a),n.percent(e,a)&&n.set("snapToLines",!1),n.alt(e,a,["auto"]),2===s.length&&n.alt("lineAlign",s[1],["start","middle","end"]);break;case"position":s=t.split(","),n.percent(e,s[0]),2===s.length&&n.alt("positionAlign",s[1],["start","middle","end"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start","middle","end","left","right"]);break}}),/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical",""),t.line=n.get("line","auto"),t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100),t.align=n.get("align","middle"),t.position=n.get("position",{start:0,left:0,middle:50,end:100,right:100},t.align),t.positionAlign=n.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},t.align)}function c(){e=e.replace(/^\s+/,"")}if(c(),t.startTime=l(),c(),"--\x3e"!==e.substr(0,3))throw new n(n.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+o);e=e.substr(3),c(),t.endTime=l(),c(),u(e,t)}n.prototype=i(Error.prototype),n.prototype.constructor=n,n.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},s.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var n=0;n<i.length;++n)if(t===i[n]){this.set(e,t);break}},integer:function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},percent:function(e,t){return!!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(t=parseFloat(t),t>=0&&t<=100))&&(this.set(e,t),!0)}};var l={"&amp;":"&","&lt;":"<","&gt;":">","&lrm;":"‎","&rlm;":"‏","&nbsp;":" "},u={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},c={v:"title",lang:"lang"},h={rt:"ruby"};function d(e,t){function i(){if(!t)return null;function e(e){return t=t.substr(e.length),e}var i=t.match(/^([^<]*)(<[^>]*>?)?/);return e(i[1]?i[1]:i[2])}function n(e){return l[e]}function s(e){while(v=e.match(/&(amp|lt|gt|lrm|rlm|nbsp);/))e=e.replace(v[0],n);return e}function a(e,t){return!h[t.localName]||h[t.localName]===e.localName}function o(t,i){var n=u[t];if(!n)return null;var r=e.document.createElement(n);r.localName=n;var s=c[t];return s&&i&&(r[s]=i.trim()),r}var d,p=e.document.createElement("div"),f=p,m=[];while(null!==(d=i()))if("<"!==d[0])f.appendChild(e.document.createTextNode(s(d)));else{if("/"===d[1]){m.length&&m[m.length-1]===d.substr(2).replace(">","")&&(m.pop(),f=f.parentNode);continue}var g,y=r(d.substr(1,d.length-2));if(y){g=e.document.createProcessingInstruction("timestamp",y),f.appendChild(g);continue}var v=d.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!v)continue;if(g=o(v[1],v[3]),!g)continue;if(!a(f,g))continue;v[2]&&(g.className=v[2].substr(1).replace("."," ")),m.push(v[1]),f.appendChild(g),f=g}return p}var p=[[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 f(e){for(var t=0;t<p.length;t++){var i=p[t];if(e>=i[0]&&e<=i[1])return!0}return!1}function m(e){var t,i=[],n="";if(!e||!e.childNodes)return"ltr";function r(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function s(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var n=i.match(/^.*(\n|\r)/);return n?(e.length=0,n[0]):i}return"ruby"===t.tagName?s(e):t.childNodes?(r(e,t),s(e)):void 0}r(i,e);while(n=s(i))for(var a=0;a<n.length;a++)if(t=n.charCodeAt(a),f(t))return"rtl";return"ltr"}function g(e){if("number"===typeof e.line&&(e.snapToLines||e.line>=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,n=0,r=0;r<i.length&&i[r]!==t;r++)"showing"===i[r].mode&&n++;return-1*++n}function y(){}function v(e,t,i){var n=/MSIE\s8\.0/.test(navigator.userAgent),r="rgba(255, 255, 255, 1)",s="rgba(0, 0, 0, 0.8)";n&&(r="rgb(255, 255, 255)",s="rgb(0, 0, 0)"),y.call(this),this.cue=t,this.cueDiv=d(e,t.text);var a={color:r,backgroundColor:s,position:"relative",left:0,right:0,top:0,bottom:0,display:"inline"};n||(a.writingMode=""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",a.unicodeBidi="plaintext"),this.applyStyles(a,this.cueDiv),this.div=e.document.createElement("div"),a={textAlign:"middle"===t.align?"center":t.align,font:i.font,whiteSpace:"pre-line",position:"absolute"},n||(a.direction=m(this.cueDiv),a.writingMode=""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl".stylesunicodeBidi="plaintext"),this.applyStyles(a),this.div.appendChild(this.cueDiv);var o=0;switch(t.positionAlign){case"start":o=t.position;break;case"middle":o=t.position-t.size/2;break;case"end":o=t.position-t.size;break}""===t.vertical?this.applyStyles({left:this.formatStyle(o,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(o,"%"),height:this.formatStyle(t.size,"%")}),this.move=function(e){this.applyStyles({top:this.formatStyle(e.top,"px"),bottom:this.formatStyle(e.bottom,"px"),left:this.formatStyle(e.left,"px"),right:this.formatStyle(e.right,"px"),height:this.formatStyle(e.height,"px"),width:this.formatStyle(e.width,"px")})}}function _(e){var t,i,n,r,s=/MSIE\s8\.0/.test(navigator.userAgent);if(e.div){i=e.div.offsetHeight,n=e.div.offsetWidth,r=e.div.offsetTop;var a=(a=e.div.childNodes)&&(a=a[0])&&a.getClientRects&&a.getClientRects();e=e.div.getBoundingClientRect(),t=a?Math.max(a[0]&&a[0].height||0,e.height/a.length):0}this.left=e.left,this.right=e.right,this.top=e.top||r,this.height=e.height||i,this.bottom=e.bottom||r+(e.height||i),this.width=e.width||n,this.lineHeight=void 0!==t?t:e.lineHeight,s&&!this.lineHeight&&(this.lineHeight=13)}function b(e,t,i,n){function r(e,t){for(var r,s=new _(e),a=1,o=0;o<t.length;o++){while(e.overlapsOppositeAxis(i,t[o])||e.within(i)&&e.overlapsAny(n))e.move(t[o]);if(e.within(i))return e;var l=e.intersectPercentage(i);a>l&&(r=new _(e),a=l),e=new _(s)}return r||s}var s=new _(t),a=t.cue,o=g(a),l=[];if(a.snapToLines){var u;switch(a.vertical){case"":l=["+y","-y"],u="height";break;case"rl":l=["+x","-x"],u="width";break;case"lr":l=["-x","+x"],u="width";break}var c=s.lineHeight,h=c*Math.round(o),d=i[u]+c,p=l[0];Math.abs(h)>d&&(h=h<0?-1:1,h*=Math.ceil(d/c)*c),o<0&&(h+=""===a.vertical?i.height:i.width,l=l.reverse()),s.move(p,h)}else{var f=s.lineHeight/i.height*100;switch(a.lineAlign){case"middle":o-=f/2;break;case"end":o-=f;break}switch(a.vertical){case"":t.applyStyles({top:t.formatStyle(o,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(o,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(o,"%")});break}l=["+y","-x","+x","-y"],s=new _(t)}var m=r(s,l);t.move(m.toCSSCompatValues(i))}function T(){}y.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},y.prototype.formatStyle=function(e,t){return 0===e?0:e+t},v.prototype=i(y.prototype),v.prototype.constructor=v,_.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t;break}},_.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},_.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1},_.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},_.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.left<e.left;case"-x":return this.right>e.right;case"+y":return this.top<e.top;case"-y":return this.bottom>e.bottom}},_.prototype.intersectPercentage=function(e){var t=Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left)),i=Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top)),n=t*i;return n/(this.height*this.width)},_.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},_.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e;var r={left:e.left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i};return r},T.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!==typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},T.convertCueToDOMTree=function(e,t){return e&&t?d(e,t):null};var S=.05,k="sans-serif",E="1.5%";T.processCues=function(e,t,i){if(!e||!t||!i)return null;while(i.firstChild)i.removeChild(i.firstChild);var n=e.document.createElement("div");function r(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return!0;return!1}if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin=E,i.appendChild(n),r(t)){var s=[],a=_.getSimpleBoxPosition(n),o=Math.round(a.height*S*100)/100,l={font:o+"px "+k};(function(){for(var i,r,o=0;o<t.length;o++)r=t[o],i=new v(e,r,l),n.appendChild(i.div),b(e,i,a,s),r.displayState=i.div,s.push(_.getSimpleBoxPosition(i))})()}else for(var u=0;u<t.length;u++)n.appendChild(t[u].displayState)},T.Parser=function(e,t,i){i||(i=t,t={}),t||(t={}),this.window=e,this.vttjs=t,this.state="INITIAL",this.buffer="",this.decoder=i||new TextDecoder("utf8"),this.regionList=[]},T.Parser.prototype={reportOrThrowError:function(e){if(!(e instanceof n))throw e;this.onparsingerror&&this.onparsingerror(e)},parse:function(e){var t=this;function i(){var e=t.buffer,i=0;while(i<e.length&&"\r"!==e[i]&&"\n"!==e[i])++i;var n=e.substr(0,i);return"\r"===e[i]&&++i,"\n"===e[i]&&++i,t.buffer=e.substr(i),n}function l(e){var i=new s;if(a(e,(function(e,t){switch(e){case"id":i.set(e,t);break;case"width":i.percent(e,t);break;case"lines":i.integer(e,t);break;case"regionanchor":case"viewportanchor":var n=t.split(",");if(2!==n.length)break;var r=new s;if(r.percent("x",n[0]),r.percent("y",n[1]),!r.has("x")||!r.has("y"))break;i.set(e+"X",r.get("x")),i.set(e+"Y",r.get("y"));break;case"scroll":i.alt(e,t,["up"]);break}}),/=/,/\s/),i.has("id")){var n=new(t.vttjs.VTTRegion||t.window.VTTRegion);n.width=i.get("width",100),n.lines=i.get("lines",3),n.regionAnchorX=i.get("regionanchorX",0),n.regionAnchorY=i.get("regionanchorY",100),n.viewportAnchorX=i.get("viewportanchorX",0),n.viewportAnchorY=i.get("viewportanchorY",100),n.scroll=i.get("scroll",""),t.onregion&&t.onregion(n),t.regionList.push({id:i.get("id"),region:n})}}function u(e){var i=new s;a(e,(function(e,t){switch(e){case"MPEGT":i.integer(e+"S",t);break;case"LOCA":i.set(e+"L",r(t));break}}),/[^\d]:/,/,/),t.ontimestampmap&&t.ontimestampmap({MPEGTS:i.get("MPEGTS"),LOCAL:i.get("LOCAL")})}function c(e){e.match(/X-TIMESTAMP-MAP/)?a(e,(function(e,t){switch(e){case"X-TIMESTAMP-MAP":u(t);break}}),/=/):a(e,(function(e,t){switch(e){case"Region":l(t);break}}),/:/)}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{var h;if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;h=i();var d=h.match(/^WEBVTT([ \t].*)?$/);if(!d||!d[0])throw new n(n.Errors.BadSignature);t.state="HEADER"}var p=!1;while(t.buffer){if(!/\r\n|\n/.test(t.buffer))return this;switch(p?p=!1:h=i(),t.state){case"HEADER":/:/.test(h)?c(h):h||(t.state="ID");continue;case"NOTE":h||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(h)){t.state="NOTE";break}if(!h)continue;if(t.cue=new(t.vttjs.VTTCue||t.window.VTTCue)(0,0,""),t.state="CUE",-1===h.indexOf("--\x3e")){t.cue.id=h;continue}case"CUE":try{o(h,t.cue,t.regionList)}catch(m){t.reportOrThrowError(m),t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":var f=-1!==h.indexOf("--\x3e");if(!h||f&&(p=!0)){t.oncue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}t.cue.text&&(t.cue.text+="\n"),t.cue.text+=h;continue;case"BADCUE":h||(t.state="ID");continue}}}catch(m){t.reportOrThrowError(m),"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state)throw new n(n.Errors.BadSignature)}catch(t){e.reportOrThrowError(t)}return e.onflush&&e.onflush(),this}},e.exports=T},"17a3":function(e,t,i){"use strict";i.d(t,"i",(function(){return l})),i.d(t,"h",(function(){return u})),i.d(t,"d",(function(){return c})),i.d(t,"f",(function(){return h})),i.d(t,"e",(function(){return p})),i.d(t,"c",(function(){return f})),i.d(t,"g",(function(){return m})),i.d(t,"a",(function(){return g})),i.d(t,"b",(function(){return y}));var n=i("be09"),r=i.n(n),s={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^/},a=["video","audio","text"],o=["Video","Audio","Text"],l=function(e){return e?e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e,t,i){var n=("00"+Number(t).toString(16)).slice(-2),r=("00"+Number(i).toString(16)).slice(-2);return"avc1."+n+"00"+r})):e},u=function(e){void 0===e&&(e="");var t=e.split(","),i=[];return t.forEach((function(e){var t;e=e.trim(),a.forEach((function(n){var r=s[n].exec(e.toLowerCase());if(r&&!(r.length<=1)){t=n;var a=e.substring(0,r[1].length),o=e.replace(a,"");i.push({type:a,details:o,mediaType:n})}})),t||i.push({type:e,details:"",mediaType:"unknown"})})),i},c=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i=e.mediaGroups.AUDIO[t];if(!i)return null;for(var n in i){var r=i[n];if(r.default&&r.playlists)return u(r.playlists[0].attributes.CODECS)}return null},h=function(e){return void 0===e&&(e=""),s.audio.test(e.trim().toLowerCase())},d=function(e){return void 0===e&&(e=""),s.text.test(e.trim().toLowerCase())},p=function(e){if(e&&"string"===typeof e){var t=e.toLowerCase().split(",").map((function(e){return l(e.trim())})),i="video";1===t.length&&h(t[0])?i="audio":1===t.length&&d(t[0])&&(i="application");var n="mp4";return t.every((function(e){return s.mp4.test(e)}))?n="mp4":t.every((function(e){return s.webm.test(e)}))?n="webm":t.every((function(e){return s.ogg.test(e)}))&&(n="ogg"),i+"/"+n+';codecs="'+e+'"'}},f=function(e){return void 0===e&&(e=""),r.a.MediaSource&&r.a.MediaSource.isTypeSupported&&r.a.MediaSource.isTypeSupported(p(e))||!1},m=function(e){return void 0===e&&(e=""),e.toLowerCase().split(",").every((function(e){e=e.trim();for(var t=0;t<o.length;t++){var i=o[t];if(s["muxer"+i].test(e))return!0}return!1}))},g="mp4a.40.2",y="avc1.4d400d"},"19b3":function(e,t,i){"use strict";var n=i("769d"),r=u(n),s=i("faec"),a=u(s),o=i("f42a"),l=u(o);function u(e){return e&&e.__esModule?e:{default:e}}e.exports={LineStream:r["default"],ParseStream:a["default"],Parser:l["default"]}},"1b15":function(e,t,i){"use strict";var n,r,s,a;n=function(e,t){var i,s,a,o,l,u=[];if(!t.length)return null;for(i=0;i<e.byteLength;)s=e[i]<<24,s|=e[i+1]<<16,s|=e[i+2]<<8,s|=e[i+3],a=r(e.subarray(i+4,i+8)),o=s>1?i+s:e.byteLength,a===t[0]&&(1===t.length?u.push(e.subarray(i+8,o)):(l=n(e.subarray(i+8,o),t.slice(1)),l.length&&(u=u.concat(l)))),i=o;return u},r=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3]),t},s=function(e){var t={},i=n(e,["moov","trak"]);return i.reduce((function(e,t){var i,r,s,a,o;return i=n(t,["tkhd"])[0],i?(r=i[0],s=0===r?12:20,a=i[s]<<24|i[s+1]<<16|i[s+2]<<8|i[s+3],o=n(t,["mdia","mdhd"])[0],o?(r=o[0],s=0===r?12:20,e[a]=o[s]<<24|o[s+1]<<16|o[s+2]<<8|o[s+3],e):null):null}),t)},a=function(e,t){var i,r,s;return i=n(t,["moof","traf"]),r=[].concat.apply([],i.map((function(t){return n(t,["tfhd"]).map((function(i){var r,s,a;return r=i[4]<<24|i[5]<<16|i[6]<<8|i[7],s=e[r]||9e4,a=n(t,["tfdt"]).map((function(e){var t,i;return t=e[0],i=e[4]<<24|e[5]<<16|e[6]<<8|e[7],1===t&&(i*=Math.pow(2,32),i+=e[8]<<24|e[9]<<16|e[10]<<8|e[11]),i}))[0],a=a||1/0,a/s}))}))),s=Math.min.apply(null,r),isFinite(s)?s:0},e.exports={parseType:r,timescale:s,startTime:a}},"1b5c":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}();function r(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=i("ed7b"),o=r(a),l=i("de2e"),u=r(l),c=i("50a6"),h=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},d=function(e,t,i){var n=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),r=new o["default"](Array.prototype.slice.call(t)),s=new Uint8Array(e.byteLength),a=new Int32Array(s.buffer),l=void 0,u=void 0,c=void 0,d=void 0,p=void 0,f=void 0,m=void 0,g=void 0,y=void 0;for(l=i[0],u=i[1],c=i[2],d=i[3],y=0;y<n.length;y+=4)p=h(n[y]),f=h(n[y+1]),m=h(n[y+2]),g=h(n[y+3]),r.decrypt(p,f,m,g,a,y),a[y]=h(a[y]^l),a[y+1]=h(a[y+1]^u),a[y+2]=h(a[y+2]^c),a[y+3]=h(a[y+3]^d),l=p,u=f,c=m,d=g;return s};t.decrypt=d;var p=function(){function e(t,i,n,r){s(this,e);var a=e.STEP,o=new Int32Array(t.buffer),l=new Uint8Array(t.byteLength),d=0;for(this.asyncStream_=new u["default"],this.asyncStream_.push(this.decryptChunk_(o.subarray(d,d+a),i,n,l)),d=a;d<o.length;d+=a)n=new Uint32Array([h(o[d-4]),h(o[d-3]),h(o[d-2]),h(o[d-1])]),this.asyncStream_.push(this.decryptChunk_(o.subarray(d,d+a),i,n,l));this.asyncStream_.push((function(){r(null,(0,c.unpad)(l))}))}return n(e,[{key:"decryptChunk_",value:function(e,t,i,n){return function(){var r=d(e,t,i);n.set(r,e.byteOffset)}}}],[{key:"STEP",get:function(){return 32e3}}]),e}();t.Decrypter=p,t["default"]={Decrypter:p,decrypt:d}},"1b8d":function(e,t){function i(e){return e.replace(/\n\r?\s*/g,"")}e.exports=function(e){for(var t="",n=0;n<arguments.length;n++)t+=i(e[n])+(arguments[n+1]||"");return t}},"210b":function(e,t,i){var n=i("e1c8");t.DOMImplementation=n.DOMImplementation,t.XMLSerializer=n.XMLSerializer,t.DOMParser=i("b074").DOMParser},"230d":function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i("e475"),s=n(r),a=i("8c57"),o=n(a),l=function(){},u=function(e){var t=e["default"]?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},c=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)};t.stopLoaders=c;var h=function(e,t){t.activePlaylistLoader=e,e.load()};t.startLoaders=h;var d=function(e,t){return function(){var i=t.segmentLoaders,n=i[e],r=i.main,s=t.mediaTypes[e],a=s.activeTrack(),o=s.activeGroup(a),l=s.activePlaylistLoader;c(n,s),o&&(o.playlistLoader?(n.resyncLoader(),h(o.playlistLoader,s)):l&&r.resetEverything())}};t.onGroupChanged=d;var p=function(e,t){return function(){var i=t.segmentLoaders,n=i[e],r=i.main,s=t.mediaTypes[e],a=s.activeTrack(),o=s.activeGroup(a),l=s.activePlaylistLoader;c(n,s),o&&(o.playlistLoader?l!==o.playlistLoader?(n.track&&n.track(a),n.resetEverything(),h(o.playlistLoader,s)):h(o.playlistLoader,s):r.resetEverything())}};t.onTrackChanged=p;var f={AUDIO:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e],r=t.blacklistCurrentPlaylist;c(i,n);var a=n.activeTrack(),o=n.activeGroup(),l=(o.filter((function(e){return e["default"]}))[0]||o[0]).id,u=n.tracks[l];if(a!==u){for(var h in s["default"].log.warn("Problem encountered loading the alternate audio track.Switching back to default."),n.tracks)n.tracks[h].enabled=n.tracks[h]===u;n.onTrackChanged()}else r({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e];s["default"].log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),c(i,n);var r=n.activeTrack();r&&(r.mode="disabled"),n.onTrackChanged()}}};t.onError=f;var m={AUDIO:function(e,t,i){if(t){var n=i.tech,r=i.requestOptions,s=i.segmentLoaders[e];t.on("loadedmetadata",(function(){var e=t.media();s.playlist(e,r),(!n.paused()||e.endList&&"none"!==n.preload())&&s.load()})),t.on("loadedplaylist",(function(){s.playlist(t.media(),r),n.paused()||s.load()})),t.on("error",f[e](e,i))}},SUBTITLES:function(e,t,i){var n=i.tech,r=i.requestOptions,s=i.segmentLoaders[e],a=i.mediaTypes[e];t.on("loadedmetadata",(function(){var e=t.media();s.playlist(e,r),s.track(a.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&s.load()})),t.on("loadedplaylist",(function(){s.playlist(t.media(),r),n.paused()||s.load()})),t.on("error",f[e](e,i))}};t.setupListeners=m;var g={AUDIO:function(e,t){var i=t.mode,n=t.hls,r=t.segmentLoaders[e],a=t.requestOptions,l=t.master.mediaGroups,c=t.mediaTypes[e],h=c.groups,d=c.tracks;for(var p in l[e]&&0!==Object.keys(l[e]).length&&"html5"===i||(l[e]={main:{default:{default:!0}}}),l[e])for(var g in h[p]||(h[p]=[]),l[e][p]){var y=l[e][p][g],v=void 0;if(v=y.resolvedUri?new o["default"](y.resolvedUri,n,a):null,y=s["default"].mergeOptions({id:g,playlistLoader:v},y),m[e](e,y.playlistLoader,t),h[p].push(y),"undefined"===typeof d[g]){var _=new s["default"].AudioTrack({id:g,kind:u(y),enabled:!1,language:y.language,default:y["default"],label:g});d[g]=_}}r.on("error",f[e](e,t))},SUBTITLES:function(e,t){var i=t.tech,n=t.hls,r=t.segmentLoaders[e],a=t.requestOptions,l=t.master.mediaGroups,u=t.mediaTypes[e],c=u.groups,h=u.tracks;for(var d in l[e])for(var p in c[d]||(c[d]=[]),l[e][d])if(!l[e][d][p].forced){var g=l[e][d][p];if(g=s["default"].mergeOptions({id:p,playlistLoader:new o["default"](g.resolvedUri,n,a)},g),m[e](e,g.playlistLoader,t),c[d].push(g),"undefined"===typeof h[p]){var y=i.addRemoteTextTrack({id:p,kind:"subtitles",enabled:!1,language:g.language,label:p},!1).track;h[p]=y}}r.on("error",f[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var i=t.tech,n=t.master.mediaGroups,r=t.mediaTypes[e],a=r.groups,o=r.tracks;for(var l in n[e])for(var u in a[l]||(a[l]=[]),n[e][l]){var c=n[e][l][u];if(c.instreamId.match(/CC\d/)&&(a[l].push(s["default"].mergeOptions({id:u},c)),"undefined"===typeof o[u])){var h=i.addRemoteTextTrack({id:c.instreamId,kind:"captions",enabled:!1,language:c.language,label:u},!1).track;o[u]=h}}}};t.initialize=g;var y=function(e,t){return function(i){var n=t.masterPlaylistLoader,r=t.mediaTypes[e].groups,s=n.media();if(!s)return null;var a=null;return s.attributes[e]&&(a=r[s.attributes[e]]),a=a||r.main,"undefined"===typeof i?a:null===i?null:a.filter((function(e){return e.id===i.id}))[0]||null}};t.activeGroup=y;var v={AUDIO:function(e,t){return function(){var i=t.mediaTypes[e].tracks;for(var n in i)if(i[n].enabled)return i[n];return null}},SUBTITLES:function(e,t){return function(){var i=t.mediaTypes[e].tracks;for(var n in i)if("showing"===i[n].mode)return i[n];return null}}};t.activeTrack=v;var _=function(e){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((function(t){g[t](t,e)}));var t=e.mediaTypes,i=e.masterPlaylistLoader,n=e.tech,r=e.hls;["AUDIO","SUBTITLES"].forEach((function(i){t[i].activeGroup=y(i,e),t[i].activeTrack=v[i](i,e),t[i].onGroupChanged=d(i,e),t[i].onTrackChanged=p(i,e)}));var s=t.AUDIO.activeGroup(),a=(s.filter((function(e){return e["default"]}))[0]||s[0]).id;t.AUDIO.tracks[a].enabled=!0,t.AUDIO.onTrackChanged(),i.on("mediachange",(function(){["AUDIO","SUBTITLES"].forEach((function(e){return t[e].onGroupChanged()}))}));var o=function(){t.AUDIO.onTrackChanged(),n.trigger({type:"usage",name:"hls-audio-change"})};for(var l in n.audioTracks().addEventListener("change",o),n.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),r.on("dispose",(function(){n.audioTracks().removeEventListener("change",o),n.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)})),n.clearTracks("audio"),t.AUDIO.tracks)n.audioTracks().addTrack(t.AUDIO.tracks[l])};t.setupMediaGroups=_;var b=function(){var e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((function(t){e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:l,activeTrack:l,onGroupChanged:l,onTrackChanged:l}})),e};t.createMediaTypes=b},"269f":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=function(e,t,i){var n=!0;while(n){var r=e,s=t,a=i;n=!1,null===r&&(r=Function.prototype);var o=Object.getOwnPropertyDescriptor(r,s);if(void 0!==o){if("value"in o)return o.value;var l=o.get;if(void 0===l)return;return l.call(a)}var u=Object.getPrototypeOf(r);if(null===u)return;e=u,t=s,i=a,n=!0,o=u=void 0}};function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=i("12c6"),u=s(l),c=i("9417"),h=s(c),d=i("4ea2"),p=s(d),f=i("ba2d"),m=i("78d8"),g=s(m),y=i("5c9d"),v=s(y),_=i("0de0"),b=function(){var e=void 0;try{e="5c9d"}catch(t){}return e},T=function(e,t){var i=e.addSourceBuffer(t),n=Object.create(null);n.updating=!1,n.realBuffer_=i;var r=function(e){"function"===typeof i[e]?n[e]=function(){return i[e].apply(i,arguments)}:"undefined"===typeof n[e]&&Object.defineProperty(n,e,{get:function(){return i[e]},set:function(t){return i[e]=t}})};for(var s in i)r(s);return n},S=function(e,t,i){if(!t||!e.length)return[];var n=Math.ceil(9e4*(t.currentTime()-i+3)),r=void 0;for(r=0;r<e.length;r++)if(e[r].pts>n)break;return e.slice(r)};t.gopsSafeToAlignWith=S;var k=function(e,t,i){if(!t.length)return e;if(i)return t.slice();var n=t[0].pts,r=0;for(r;r<e.length;r++)if(e[r].pts>=n)break;return e.slice(0,r).concat(t)};t.updateGopBuffer=k;var E=function(e,t,i,n){var r=Math.ceil(9e4*(t-n)),s=Math.ceil(9e4*(i-n)),a=e.slice(),o=e.length;while(o--)if(e[o].pts<=s)break;if(-1===o)return a;var l=o+1;while(l--)if(e[l].pts<=r)break;return l=Math.max(l,0),a.splice(l,o-l+1),a};t.removeGopBuffer=E;var w=function(e){function t(e,i){var n=this;a(this,t),r(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,u["default"].EventTarget),this.timestampOffset_=0,this.pendingBuffers_=[],this.bufferUpdating_=!1,this.mediaSource_=e,this.codecs_=i,this.audioCodec_=null,this.videoCodec_=null,this.audioDisabled_=!1,this.appendAudioInitSegment_=!0,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=u["default"].browser.IE_VERSION>=11;var s={remux:!1,alignGopsAtEnd:this.safeAppend_};this.codecs_.forEach((function(e){(0,_.isAudioCodec)(e)?n.audioCodec_=e:(0,_.isVideoCodec)(e)&&(n.videoCodec_=e)})),this.transmuxer_=(0,g["default"])(v["default"],b()),this.transmuxer_.postMessage({action:"init",options:s}),this.transmuxer_.onmessage=function(e){return"data"===e.data.action?n.data_(e):"done"===e.data.action?n.done_(e):"gopInfo"===e.data.action?n.appendGopInfo_(e):void 0},Object.defineProperty(this,"timestampOffset",{get:function(){return this.timestampOffset_},set:function(e){"number"===typeof e&&e>=0&&(this.timestampOffset_=e,this.appendAudioInitSegment_=!0,this.gopBuffer_.length=0,this.timeMapping_=0,this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e}))}}),Object.defineProperty(this,"appendWindowStart",{get:function(){return(this.videoBuffer_||this.audioBuffer_).appendWindowStart},set:function(e){this.videoBuffer_&&(this.videoBuffer_.appendWindowStart=e),this.audioBuffer_&&(this.audioBuffer_.appendWindowStart=e)}}),Object.defineProperty(this,"updating",{get:function(){return!!(this.bufferUpdating_||!this.audioDisabled_&&this.audioBuffer_&&this.audioBuffer_.updating||this.videoBuffer_&&this.videoBuffer_.updating)}}),Object.defineProperty(this,"buffered",{get:function(){var e=null,t=null,i=0,n=[],r=[];if(!this.videoBuffer_&&!this.audioBuffer_)return u["default"].createTimeRange();if(!this.videoBuffer_)return this.audioBuffer_.buffered;if(!this.audioBuffer_)return this.videoBuffer_.buffered;if(this.audioDisabled_)return this.videoBuffer_.buffered;if(0===this.videoBuffer_.buffered.length&&0===this.audioBuffer_.buffered.length)return u["default"].createTimeRange();var s=this.videoBuffer_.buffered,a=this.audioBuffer_.buffered,o=s.length;while(o--)n.push({time:s.start(o),type:"start"}),n.push({time:s.end(o),type:"end"});o=a.length;while(o--)n.push({time:a.start(o),type:"start"}),n.push({time:a.end(o),type:"end"});for(n.sort((function(e,t){return e.time-t.time})),o=0;o<n.length;o++)"start"===n[o].type?(i++,2===i&&(e=n[o].time)):"end"===n[o].type&&(i--,1===i&&(t=n[o].time)),null!==e&&null!==t&&(r.push([e,t]),e=null,t=null);return u["default"].createTimeRanges(r)}})}return o(t,e),n(t,[{key:"data_",value:function(e){var t=e.data.segment;t.data=new Uint8Array(t.data,e.data.byteOffset,e.data.byteLength),t.initSegment=new Uint8Array(t.initSegment.data,t.initSegment.byteOffset,t.initSegment.byteLength),(0,h["default"])(this,this.mediaSource_,t),this.pendingBuffers_.push(t)}},{key:"done_",value:function(e){"closed"!==this.mediaSource_.readyState?this.processPendingSegments_():this.pendingBuffers_.length=0}},{key:"createRealSourceBuffers_",value:function(){var e=this,t=["audio","video"];t.forEach((function(i){if(e[i+"Codec_"]&&!e[i+"Buffer_"]){var n=null;if(e.mediaSource_[i+"Buffer_"])n=e.mediaSource_[i+"Buffer_"],n.updating=!1;else{var r=i+"Codec_",s=i+'/mp4;codecs="'+e[r]+'"';n=T(e.mediaSource_.nativeMediaSource_,s),e.mediaSource_[i+"Buffer_"]=n}e[i+"Buffer_"]=n,["update","updatestart","updateend"].forEach((function(r){n.addEventListener(r,(function(){if("audio"!==i||!e.audioDisabled_){"updateend"===r&&(e[i+"Buffer_"].updating=!1);var n=t.every((function(t){return!("audio"!==t||!e.audioDisabled_)||(i===t||!e[t+"Buffer_"]||!e[t+"Buffer_"].updating)}));return n?e.trigger(r):void 0}}))}))}}))}},{key:"appendBuffer",value:function(e){if(this.bufferUpdating_=!0,this.audioBuffer_&&this.audioBuffer_.buffered.length){var t=this.audioBuffer_.buffered;this.transmuxer_.postMessage({action:"setAudioAppendStart",appendStart:t.end(t.length-1)})}this.videoBuffer_&&this.transmuxer_.postMessage({action:"alignGopsWith",gopsToAlignWith:S(this.gopBuffer_,this.mediaSource_.player_,this.timeMapping_)}),this.transmuxer_.postMessage({action:"push",data:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength},[e.buffer]),this.transmuxer_.postMessage({action:"flush"})}},{key:"appendGopInfo_",value:function(e){this.gopBuffer_=k(this.gopBuffer_,e.data.gopInfo,this.safeAppend_)}},{key:"remove",value:function(e,t){if(this.videoBuffer_&&(this.videoBuffer_.updating=!0,this.videoBuffer_.remove(e,t),this.gopBuffer_=E(this.gopBuffer_,e,t,this.timeMapping_)),!this.audioDisabled_&&this.audioBuffer_&&(this.audioBuffer_.updating=!0,this.audioBuffer_.remove(e,t)),(0,p["default"])(e,t,this.metadataTrack_),this.inbandTextTracks_)for(var i in this.inbandTextTracks_)(0,p["default"])(e,t,this.inbandTextTracks_[i])}},{key:"processPendingSegments_",value:function(){var e={video:{segments:[],bytes:0},audio:{segments:[],bytes:0},captions:[],metadata:[]};e=this.pendingBuffers_.reduce((function(e,t){var i=t.type,n=t.data,r=t.initSegment;return e[i].segments.push(n),e[i].bytes+=n.byteLength,e[i].initSegment=r,t.captions&&(e.captions=e.captions.concat(t.captions)),t.info&&(e[i].info=t.info),t.metadata&&(e.metadata=e.metadata.concat(t.metadata)),e}),e),this.videoBuffer_||this.audioBuffer_||(0===e.video.bytes&&(this.videoCodec_=null),0===e.audio.bytes&&(this.audioCodec_=null),this.createRealSourceBuffers_()),e.audio.info&&this.mediaSource_.trigger({type:"audioinfo",info:e.audio.info}),e.video.info&&this.mediaSource_.trigger({type:"videoinfo",info:e.video.info}),this.appendAudioInitSegment_&&(!this.audioDisabled_&&this.audioBuffer_&&(e.audio.segments.unshift(e.audio.initSegment),e.audio.bytes+=e.audio.initSegment.byteLength),this.appendAudioInitSegment_=!1);var t=!1;this.videoBuffer_&&e.video.bytes?(e.video.segments.unshift(e.video.initSegment),e.video.bytes+=e.video.initSegment.byteLength,this.concatAndAppendSegments_(e.video,this.videoBuffer_),(0,f.addTextTrackData)(this,e.captions,e.metadata)):!this.videoBuffer_||!this.audioDisabled_&&this.audioBuffer_||(t=!0),!this.audioDisabled_&&this.audioBuffer_&&this.concatAndAppendSegments_(e.audio,this.audioBuffer_),this.pendingBuffers_.length=0,t&&this.trigger("updateend"),this.bufferUpdating_=!1}},{key:"concatAndAppendSegments_",value:function(e,t){var i=0,n=void 0;if(e.bytes){n=new Uint8Array(e.bytes),e.segments.forEach((function(e){n.set(e,i),i+=e.byteLength}));try{t.updating=!0,t.appendBuffer(n)}catch(r){this.mediaSource_.player_&&this.mediaSource_.player_.error({code:-3,type:"APPEND_BUFFER_ERR",message:r.message,originalError:r})}}}},{key:"abort",value:function(){this.videoBuffer_&&this.videoBuffer_.abort(),!this.audioDisabled_&&this.audioBuffer_&&this.audioBuffer_.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"reset"}),this.pendingBuffers_.length=0,this.bufferUpdating_=!1}}]),t}(u["default"].EventTarget);t["default"]=w},"2b8c":function(e,t,i){var n=i("be09"),r=e.exports={WebVTT:i("d02c"),VTTCue:i("b03c"),VTTRegion:i("f97d")};n.vttjs=r,n.WebVTT=r.WebVTT;var s=r.VTTCue,a=r.VTTRegion,o=n.VTTCue,l=n.VTTRegion;r.shim=function(){n.VTTCue=s,n.VTTRegion=a},r.restore=function(){n.VTTCue=o,n.VTTRegion=l},n.VTTCue||r.shim()},"2c5a":function(e,t,i){"use strict";var n,r,s,a,o,l,u,c,h,d,p,f=i("0129"),m=i("a31d"),g=i("70fd"),y=i("a65d"),v=i("eaba").H264Stream,_=i("ae50"),b=i("3211"),T=i("7eb3"),S=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],k=["width","height","profileIdc","levelIdc","profileCompatibility"],E=9e4;o=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0}}},l=function(e){return e[0]==="I".charCodeAt(0)&&e[1]==="D".charCodeAt(0)&&e[2]==="3".charCodeAt(0)},d=function(e,t){var i;if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0},p=function(e){var t,i,n=0;for(t=0;t<e.length;t++)i=e[t],n+=i.data.byteLength;return n},r=function(e){var t=[],i=0,n=0,s=0,a=1/0;r.prototype.init.call(this),this.push=function(i){u(e,i),e&&S.forEach((function(t){e[t]=i[t]})),t.push(i)},this.setEarliestDts=function(t){n=t-e.timelineStartInfo.baseMediaDecodeTime},this.setVideoBaseMediaDecodeTime=function(e){a=e},this.setAudioAppendStart=function(e){s=e},this.flush=function(){var n,r,s,a;0!==t.length?(n=this.trimAdtsFramesByEarliestDts_(t),e.baseMediaDecodeTime=h(e),this.prefixWithSilence_(e,n),e.samples=this.generateSampleTable_(n),s=m.mdat(this.concatenateFrameData_(n)),t=[],r=m.moof(i,[e]),a=new Uint8Array(r.byteLength+s.byteLength),i++,a.set(r),a.set(s,r.byteLength),c(e),this.trigger("data",{track:e,boxes:a}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")},this.prefixWithSilence_=function(e,t){var i,n,r,o=0,l=0,u=0,c=0;if(t.length&&(i=T.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),o=Math.ceil(E/(e.samplerate/1024)),s&&a&&(l=i-Math.max(s,a),u=Math.floor(l/o),c=u*o),!(u<1||c>E/2))){for(n=b[e.samplerate],n||(n=t[0].data),r=0;r<u;r++)t.splice(r,0,{data:n});e.baseMediaDecodeTime-=Math.floor(T.videoTsToAudioTs(c,e.samplerate))}},this.trimAdtsFramesByEarliestDts_=function(t){return e.minSegmentDts>=n?t:(e.minSegmentDts=1/0,t.filter((function(t){return t.dts>=n&&(e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),e.minSegmentPts=e.minSegmentDts,!0)})))},this.generateSampleTable_=function(e){var t,i,n=[];for(t=0;t<e.length;t++)i=e[t],n.push({size:i.data.byteLength,duration:1024});return n},this.concatenateFrameData_=function(e){var t,i,n=0,r=new Uint8Array(p(e));for(t=0;t<e.length;t++)i=e[t],r.set(i.data,n),n+=i.data.byteLength;return r}},r.prototype=new f,n=function(e,t){var i,r,s=0,a=[],l=[];t=t||{},n.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){u(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||i||(i=t.config,e.sps=[t.data],k.forEach((function(t){e[t]=i[t]}),this)),"pic_parameter_set_rbsp"!==t.nalUnitType||r||(r=t.data,e.pps=[t.data]),a.push(t)},this.flush=function(){var i,n,r,o,d,p;while(a.length){if("access_unit_delimiter_rbsp"===a[0].nalUnitType)break;a.shift()}if(0===a.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(i=this.groupNalsIntoFrames_(a),r=this.groupFramesIntoGops_(i),r[0][0].keyFrame||(n=this.getGopForFusion_(a[0],e),n?(r.unshift(n),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.pts=n.pts,r.dts=n.dts,r.duration+=n.duration):r=this.extendFirstKeyFrame_(r)),l.length){var f;if(f=t.alignGopsAtEnd?this.alignGopsAtEnd_(r):this.alignGopsAtStart_(r),!f)return this.gopCache_.unshift({gop:r.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");c(e),r=f}u(e,r),e.samples=this.generateSampleTable_(r),d=m.mdat(this.concatenateNalData_(r)),e.baseMediaDecodeTime=h(e),this.trigger("processedGopsInfo",r.map((function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}))),this.gopCache_.unshift({gop:r.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),o=m.moof(s,[e]),p=new Uint8Array(o.byteLength+d.byteLength),s++,p.set(o),p.set(d,o.byteLength),this.trigger("data",{track:e,boxes:p}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.resetStream_=function(){c(e),i=void 0,r=void 0},this.getGopForFusion_=function(t){var i,n,r,s,a,o=45e3,l=1e4,u=1/0;for(a=0;a<this.gopCache_.length;a++)s=this.gopCache_[a],r=s.gop,e.pps&&d(e.pps[0],s.pps[0])&&e.sps&&d(e.sps[0],s.sps[0])&&(r.dts<e.timelineStartInfo.dts||(i=t.dts-r.dts-r.duration,i>=-l&&i<=o&&(!n||u>i)&&(n=s,u=i)));return n?n.gop:null},this.extendFirstKeyFrame_=function(e){var t;return!e[0][0].keyFrame&&e.length>1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},this.groupNalsIntoFrames_=function(e){var t,i,n=[],r=[];for(n.byteLength=0,t=0;t<e.length;t++)i=e[t],"access_unit_delimiter_rbsp"===i.nalUnitType?(n.length&&(n.duration=i.dts-n.dts,r.push(n)),n=[i],n.byteLength=i.data.byteLength,n.pts=i.pts,n.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(n.keyFrame=!0),n.duration=i.dts-n.dts,n.byteLength+=i.data.byteLength,n.push(i));return r.length&&(!n.duration||n.duration<=0)&&(n.duration=r[r.length-1].duration),r.push(n),r},this.groupFramesIntoGops_=function(e){var t,i,n=[],r=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=e[0].pts,n.dts=e[0].dts,r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,t=0;t<e.length;t++)i=e[t],i.keyFrame?(n.length&&(r.push(n),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration),n=[i],n.nalCount=i.length,n.byteLength=i.byteLength,n.pts=i.pts,n.dts=i.dts,n.duration=i.duration):(n.duration+=i.duration,n.nalCount+=i.length,n.byteLength+=i.byteLength,n.push(i));return r.length&&n.duration<=0&&(n.duration=r[r.length-1].duration),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration,r.push(n),r},this.generateSampleTable_=function(e,t){var i,n,r,s,a,l=t||0,u=[];for(i=0;i<e.length;i++)for(s=e[i],n=0;n<s.length;n++)a=s[n],r=o(),r.dataOffset=l,r.compositionTimeOffset=a.pts-a.dts,r.duration=a.duration,r.size=4*a.length,r.size+=a.byteLength,a.keyFrame&&(r.flags.dependsOn=2),l+=r.size,u.push(r);return u},this.concatenateNalData_=function(e){var t,i,n,r,s,a,o=0,l=e.byteLength,u=e.nalCount,c=l+4*u,h=new Uint8Array(c),d=new DataView(h.buffer);for(t=0;t<e.length;t++)for(r=e[t],i=0;i<r.length;i++)for(s=r[i],n=0;n<s.length;n++)a=s[n],d.setUint32(o,a.data.byteLength),o+=4,h.set(a.data,o),o+=a.data.byteLength;return h},this.alignGopsAtStart_=function(e){var t,i,n,r,s,a,o,u;s=e.byteLength,a=e.nalCount,o=e.duration,t=i=0;while(t<l.length&&i<e.length){if(n=l[t],r=e[i],n.pts===r.pts)break;r.pts>n.pts?t++:(i++,s-=r.byteLength,a-=r.nalCount,o-=r.duration)}return 0===i?e:i===e.length?null:(u=e.slice(i),u.byteLength=s,u.duration=o,u.nalCount=a,u.pts=u[0].pts,u.dts=u[0].dts,u)},this.alignGopsAtEnd_=function(e){var t,i,n,r,s,a,o;t=l.length-1,i=e.length-1,s=null,a=!1;while(t>=0&&i>=0){if(n=l[t],r=e[i],n.pts===r.pts){a=!0;break}n.pts>r.pts?t--:(t===l.length-1&&(s=i),i--)}if(!a&&null===s)return null;if(o=a?i:s,0===o)return e;var u=e.slice(o),c=u.reduce((function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e}),{byteLength:0,duration:0,nalCount:0});return u.byteLength=c.byteLength,u.duration=c.duration,u.nalCount=c.nalCount,u.pts=u[0].pts,u.dts=u[0].dts,u},this.alignGopsWith=function(e){l=e}},n.prototype=new f,u=function(e,t){"number"===typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"===typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))},c=function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},h=function(e){var t,i,n=e.minSegmentDts-e.timelineStartInfo.dts;return t=e.timelineStartInfo.baseMediaDecodeTime,t+=n,t=Math.max(0,t),"audio"===e.type&&(i=e.samplerate/E,t*=i,t=Math.floor(t)),t},a=function(e,t){this.numberOfTracks=0,this.metadataStream=t,"undefined"!==typeof e.remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,a.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBoxes.push(e.boxes),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track),void("audio"===e.track.type&&(this.audioTrack=e.track)))}},a.prototype=new f,a.prototype.flush=function(e){var t,i,n,r,s=0,a={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}for(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,k.forEach((function(e){a.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,S.forEach((function(e){a.info[e]=this.audioTrack[e]}),this)),1===this.pendingTracks.length?a.type=this.pendingTracks[0].type:a.type="combined",this.emittedTracks+=this.pendingTracks.length,n=m.initSegment(this.pendingTracks),a.initSegment=new Uint8Array(n.byteLength),a.initSegment.set(n),a.data=new Uint8Array(this.pendingBytes),r=0;r<this.pendingBoxes.length;r++)a.data.set(this.pendingBoxes[r],s),s+=this.pendingBoxes[r].byteLength;for(r=0;r<this.pendingCaptions.length;r++)t=this.pendingCaptions[r],t.startTime=t.startPts-o,t.startTime/=9e4,t.endTime=t.endPts-o,t.endTime/=9e4,a.captionStreams[t.stream]=!0,a.captions.push(t);for(r=0;r<this.pendingMetadata.length;r++)i=this.pendingMetadata[r],i.cueTime=i.pts-o,i.cueTime/=9e4,a.metadata.push(i);a.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",a),this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},s=function(e){var t,i,o=this,u=!0;s.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var t={};this.transmuxPipeline_=t,t.type="aac",t.metadataStream=new g.MetadataStream,t.aacStream=new _,t.audioTimestampRolloverStream=new g.TimestampRolloverStream("audio"),t.timedMetadataTimestampRolloverStream=new g.TimestampRolloverStream("timed-metadata"),t.adtsStream=new y,t.coalesceStream=new a(e,t.metadataStream),t.headOfPipeline=t.aacStream,t.aacStream.pipe(t.audioTimestampRolloverStream).pipe(t.adtsStream),t.aacStream.pipe(t.timedMetadataTimestampRolloverStream).pipe(t.metadataStream).pipe(t.coalesceStream),t.metadataStream.on("timestamp",(function(e){t.aacStream.setTimestamp(e.timeStamp)})),t.aacStream.on("data",(function(e){"timed-metadata"!==e.type||t.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:o.baseMediaDecodeTime},codec:"adts",type:"audio"},t.coalesceStream.numberOfTracks++,t.audioSegmentStream=new r(i),t.adtsStream.pipe(t.audioSegmentStream).pipe(t.coalesceStream))})),t.coalesceStream.on("data",this.trigger.bind(this,"data")),t.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setupTsPipeline=function(){var s={};this.transmuxPipeline_=s,s.type="ts",s.metadataStream=new g.MetadataStream,s.packetStream=new g.TransportPacketStream,s.parseStream=new g.TransportParseStream,s.elementaryStream=new g.ElementaryStream,s.videoTimestampRolloverStream=new g.TimestampRolloverStream("video"),s.audioTimestampRolloverStream=new g.TimestampRolloverStream("audio"),s.timedMetadataTimestampRolloverStream=new g.TimestampRolloverStream("timed-metadata"),s.adtsStream=new y,s.h264Stream=new v,s.captionStream=new g.CaptionStream,s.coalesceStream=new a(e,s.metadataStream),s.headOfPipeline=s.packetStream,s.packetStream.pipe(s.parseStream).pipe(s.elementaryStream),s.elementaryStream.pipe(s.videoTimestampRolloverStream).pipe(s.h264Stream),s.elementaryStream.pipe(s.audioTimestampRolloverStream).pipe(s.adtsStream),s.elementaryStream.pipe(s.timedMetadataTimestampRolloverStream).pipe(s.metadataStream).pipe(s.coalesceStream),s.h264Stream.pipe(s.captionStream).pipe(s.coalesceStream),s.elementaryStream.on("data",(function(a){var l;if("metadata"===a.type){l=a.tracks.length;while(l--)t||"video"!==a.tracks[l].type?i||"audio"!==a.tracks[l].type||(i=a.tracks[l],i.timelineStartInfo.baseMediaDecodeTime=o.baseMediaDecodeTime):(t=a.tracks[l],t.timelineStartInfo.baseMediaDecodeTime=o.baseMediaDecodeTime);t&&!s.videoSegmentStream&&(s.coalesceStream.numberOfTracks++,s.videoSegmentStream=new n(t,e),s.videoSegmentStream.on("timelineStartInfo",(function(e){i&&(i.timelineStartInfo=e,s.audioSegmentStream.setEarliestDts(e.dts))})),s.videoSegmentStream.on("processedGopsInfo",o.trigger.bind(o,"gopInfo")),s.videoSegmentStream.on("baseMediaDecodeTime",(function(e){i&&s.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),s.h264Stream.pipe(s.videoSegmentStream).pipe(s.coalesceStream)),i&&!s.audioSegmentStream&&(s.coalesceStream.numberOfTracks++,s.audioSegmentStream=new r(i),s.adtsStream.pipe(s.audioSegmentStream).pipe(s.coalesceStream))}})),s.coalesceStream.on("data",this.trigger.bind(this,"data")),s.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setBaseMediaDecodeTime=function(e){var n=this.transmuxPipeline_;this.baseMediaDecodeTime=e,i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,c(i),i.timelineStartInfo.baseMediaDecodeTime=e,n.audioTimestampRolloverStream&&n.audioTimestampRolloverStream.discontinuity()),t&&(n.videoSegmentStream&&(n.videoSegmentStream.gopCache_=[],n.videoTimestampRolloverStream.discontinuity()),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,c(t),n.captionStream.reset(),t.timelineStartInfo.baseMediaDecodeTime=e),n.timedMetadataTimestampRolloverStream&&n.timedMetadataTimestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.push=function(e){if(u){var t=l(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),u=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){u=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},s.prototype=new f,e.exports={Transmuxer:s,VideoSegmentStream:n,AudioSegmentStream:r,AUDIO_PROPERTIES:S,VIDEO_PROPERTIES:k}},"2fdb":function(e,t){var i={"":!0,up:!0};function n(e){if("string"!==typeof e)return!1;var t=i[e.toLowerCase()];return!!t&&e.toLowerCase()}function r(e){return"number"===typeof e&&e>=0&&e<=100}function s(){var e=100,t=3,i=0,s=100,a=0,o=100,l="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!r(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!==typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return s},set:function(e){if(!r(e))throw new Error("RegionAnchorX must be between 0 and 100.");s=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!r(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!r(e))throw new Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return a},set:function(e){if(!r(e))throw new Error("ViewportAnchorX must be between 0 and 100.");a=e}},scroll:{enumerable:!0,get:function(){return l},set:function(e){var t=n(e);if(!1===t)throw new SyntaxError("An invalid or illegal string was specified.");l=t}}})}e.exports=s},3211:function(e,t){var i=[33,16,5,32,164,27],n=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],r=function(e){var t=[];while(e--)t.push(0);return t},s=function(e){return Object.keys(e).reduce((function(t,i){return t[i]=new Uint8Array(e[i].reduce((function(e,t){return e.concat(t)}),[])),t}),{})},a={96e3:[i,[227,64],r(154),[56]],88200:[i,[231],r(170),[56]],64e3:[i,[248,192],r(240),[56]],48e3:[i,[255,192],r(268),[55,148,128],r(54),[112]],44100:[i,[255,192],r(268),[55,163,128],r(84),[112]],32e3:[i,[255,192],r(268),[55,234],r(226),[112]],24e3:[i,[255,192],r(268),[55,255,128],r(268),[111,112],r(126),[224]],16e3:[i,[255,192],r(268),[55,255,128],r(268),[111,255],r(269),[223,108],r(195),[1,192]],12e3:[n,r(268),[3,127,248],r(268),[6,255,240],r(268),[13,255,224],r(268),[27,253,128],r(259),[56]],11025:[n,r(268),[3,127,248],r(268),[6,255,240],r(268),[13,255,224],r(268),[27,255,192],r(268),[55,175,128],r(108),[112]],8e3:[n,r(268),[3,121,16],r(47),[7]]};e.exports=s(a)},"321f":function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));var n=i("de66"),r=Object(n["k"])([73,68,51]),s=function(e,t){void 0===t&&(t=0),e=Object(n["k"])(e);var i=e[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],s=(16&i)>>4;return s?r+20:r+10},a=function e(t,i){return void 0===i&&(i=0),t=Object(n["k"])(t),t.length-i<10||!Object(n["a"])(t,r,{offset:i})?i:(i+=s(t,i),e(t,i))}},3603:function(e,t,i){"use strict";var n=i("be09"),r=i("a559"),s=i("8362");c.httpHandler=i("8c00");
  14. /**
  15. * @license
  16. * slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
  17. * Copyright (c) 2014 David Björklund
  18. * Available under the MIT license
  19. * <https://github.com/kesla/parse-headers/blob/master/LICENCE>
  20. */
  21. var a=function(e){var t={};return e?(e.trim().split("\n").forEach((function(e){var i=e.indexOf(":"),n=e.slice(0,i).trim().toLowerCase(),r=e.slice(i+1).trim();"undefined"===typeof t[n]?t[n]=r:Array.isArray(t[n])?t[n].push(r):t[n]=[t[n],r]})),t):t};function o(e,t){for(var i=0;i<e.length;i++)t(e[i])}function l(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function u(e,t,i){var n=e;return s(t)?(i=t,"string"===typeof e&&(n={uri:e})):n=r({},t,{uri:e}),n.callback=i,n}function c(e,t,i){return t=u(e,t,i),h(t)}function h(e){if("undefined"===typeof e.callback)throw new Error("callback argument missing");var t=!1,i=function(i,n,r){t||(t=!0,e.callback(i,n,r))};function n(){4===p.readyState&&setTimeout(o,0)}function r(){var e=void 0;if(e=p.response?p.response:p.responseText||d(p),b)try{e=JSON.parse(e)}catch(t){}return e}function s(e){return clearTimeout(f),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,i(e,T)}function o(){if(!h){var t;clearTimeout(f),t=e.useXDR&&void 0===p.status?200:1223===p.status?204:p.status;var n=T,s=null;return 0!==t?(n={body:r(),statusCode:t,method:g,headers:{},url:m,rawRequest:p},p.getAllResponseHeaders&&(n.headers=a(p.getAllResponseHeaders()))):s=new Error("Internal XMLHttpRequest Error"),i(s,n,n.body)}}var u,h,p=e.xhr||null;p||(p=e.cors||e.useXDR?new c.XDomainRequest:new c.XMLHttpRequest);var f,m=p.url=e.uri||e.url,g=p.method=e.method||"GET",y=e.body||e.data,v=p.headers=e.headers||{},_=!!e.sync,b=!1,T={body:void 0,headers:{},statusCode:0,method:g,url:m,rawRequest:p};if("json"in e&&!1!==e.json&&(b=!0,v["accept"]||v["Accept"]||(v["Accept"]="application/json"),"GET"!==g&&"HEAD"!==g&&(v["content-type"]||v["Content-Type"]||(v["Content-Type"]="application/json"),y=JSON.stringify(!0===e.json?y:e.json))),p.onreadystatechange=n,p.onload=o,p.onerror=s,p.onprogress=function(){},p.onabort=function(){h=!0},p.ontimeout=s,p.open(g,m,!_,e.username,e.password),_||(p.withCredentials=!!e.withCredentials),!_&&e.timeout>0&&(f=setTimeout((function(){if(!h){h=!0,p.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",s(e)}}),e.timeout)),p.setRequestHeader)for(u in v)v.hasOwnProperty(u)&&p.setRequestHeader(u,v[u]);else if(e.headers&&!l(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(p.responseType=e.responseType),"beforeSend"in e&&"function"===typeof e.beforeSend&&e.beforeSend(p),p.send(y||null),p}function d(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(i){}return null}function p(){}e.exports=c,e.exports.default=c,c.XMLHttpRequest=n.XMLHttpRequest||p,c.XDomainRequest="withCredentials"in new c.XMLHttpRequest?c.XMLHttpRequest:n.XDomainRequest,o(["get","put","post","patch","head","delete"],(function(e){c["delete"===e?"del":e]=function(t,i,n){return i=u(t,i,n),i.method=e.toUpperCase(),h(i)}}))},"36c6":function(e,t){var i,n,r,s,a,o,l,u=9e4;i=function(e){return e*u},n=function(e,t){return e*t},r=function(e){return e/u},s=function(e,t){return e/t},a=function(e,t){return i(s(e,t))},o=function(e,t){return n(r(e),t)},l=function(e,t,i){return r(i?e:e-t)},e.exports={ONE_SECOND_IN_TS:u,secondsToVideoTs:i,secondsToAudioTs:n,videoTsToSeconds:r,audioTsToSeconds:s,audioTsToVideoTs:a,videoTsToAudioTs:o,metadataTsToSeconds:l}},3727:function(e,t,i){"use strict";var n=i("3e7e"),r=8589934592,s=4294967296,a=function(e,t){var i=1;e>t&&(i=-1);while(Math.abs(t-e)>s)e+=i*r;return e},o=function(e){var t,i;o.prototype.init.call(this),this.type_=e,this.push=function(e){e.type===this.type_&&(void 0===i&&(i=e.dts),e.dts=a(e.dts,i),e.pts=a(e.pts,i),t=e.dts,this.trigger("data",e))},this.flush=function(){i=t,this.trigger("done")},this.discontinuity=function(){i=void 0,t=void 0}};o.prototype=new n,e.exports={TimestampRolloverStream:o,handleRollover:a}},"3e7e":function(e,t,i){"use strict";var n=function(){this.init=function(){var e={};this.on=function(t,i){e[t]||(e[t]=[]),e[t]=e[t].concat(i)},this.off=function(t,i){var n;return!!e[t]&&(n=e[t].indexOf(i),e[t]=e[t].slice(),e[t].splice(n,1),n>-1)},this.trigger=function(t){var i,n,r,s;if(i=e[t],i)if(2===arguments.length)for(r=i.length,n=0;n<r;++n)i[n].call(this,arguments[1]);else{for(s=[],n=arguments.length,n=1;n<arguments.length;++n)s.push(arguments[n]);for(r=i.length,n=0;n<r;++n)i[n].apply(this,s)}},this.dispose=function(){e={}}}};n.prototype.pipe=function(e){return this.on("data",(function(t){e.push(t)})),this.on("done",(function(t){e.flush(t)})),e},n.prototype.push=function(e){this.trigger("data",e)},n.prototype.flush=function(e){this.trigger("done",e)},e.exports=n},"46af":function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i("e475"),s=n(r),a=function(){var e=function e(t,i){t=(0,r.mergeOptions)({timeout:45e3},t);var n=e.beforeRequest||s["default"].Hls.xhr.beforeRequest;if(n&&"function"===typeof n){var a=n(t);a&&(t=a)}var o=(0,r.xhr)(t,(function(e,t){var n=o.response;!e&&n&&(o.responseTime=Date.now(),o.roundTripTime=o.responseTime-o.requestTime,o.bytesReceived=n.byteLength||n.length,o.bandwidth||(o.bandwidth=Math.floor(o.bytesReceived/o.roundTripTime*8*1e3))),e&&"ETIMEDOUT"===e.code&&(o.timedout=!0),e||o.aborted||200===t.statusCode||206===t.statusCode||0===t.statusCode||(e=new Error("XHR Failed with a response of: "+(o&&(n||o.responseText)))),i(e,o)})),l=o.abort;return o.abort=function(){return o.aborted=!0,l.apply(o,arguments)},o.uri=t.uri,o.requestTime=Date.now(),o};return e};t["default"]=a,e.exports=t["default"]},4742:function(e,t,i){(function(t){var n,r="undefined"!==typeof t?t:"undefined"!==typeof window?window:{},s=i(3);"undefined"!==typeof document?n=document:(n=r["__GLOBAL_DOCUMENT_CACHE@4"],n||(n=r["__GLOBAL_DOCUMENT_CACHE@4"]=s)),e.exports=n}).call(this,i("c8ba"))},"4d20e":function(e,t,i){(function(t){var n,r="undefined"!==typeof t?t:"undefined"!==typeof window?window:{},s=i(2);"undefined"!==typeof document?n=document:(n=r["__GLOBAL_DOCUMENT_CACHE@4"],n||(n=r["__GLOBAL_DOCUMENT_CACHE@4"]=s)),e.exports=n}).call(this,i("c8ba"))},"4e4e":function(e,t){var i=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function n(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function r(e){function t(e,t,i,n){return 3600*(0|e)+60*(0|t)+(0|i)+(0|n)/1e3}var i=e.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function s(){this.values=i(null)}function a(e,t,i,n){var r=n?e.split(n):[e];for(var s in r)if("string"===typeof r[s]){var a=r[s].split(i);if(2===a.length){var o=a[0],l=a[1];t(o,l)}}}function o(e,t,i){var o=e;function l(){var t=r(e);if(null===t)throw new n(n.Errors.BadTimeStamp,"Malformed timestamp: "+o);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function u(e,t){var n=new s;a(e,(function(e,t){switch(e){case"region":for(var r=i.length-1;r>=0;r--)if(i[r].id===t){n.set(e,i[r].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var s=t.split(","),a=s[0];n.integer(e,a),n.percent(e,a)&&n.set("snapToLines",!1),n.alt(e,a,["auto"]),2===s.length&&n.alt("lineAlign",s[1],["start","middle","end"]);break;case"position":s=t.split(","),n.percent(e,s[0]),2===s.length&&n.alt("positionAlign",s[1],["start","middle","end"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start","middle","end","left","right"]);break}}),/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical",""),t.line=n.get("line","auto"),t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100),t.align=n.get("align","middle"),t.position=n.get("position",{start:0,left:0,middle:50,end:100,right:100},t.align),t.positionAlign=n.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},t.align)}function c(){e=e.replace(/^\s+/,"")}if(c(),t.startTime=l(),c(),"--\x3e"!==e.substr(0,3))throw new n(n.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+o);e=e.substr(3),c(),t.endTime=l(),c(),u(e,t)}n.prototype=i(Error.prototype),n.prototype.constructor=n,n.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},s.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var n=0;n<i.length;++n)if(t===i[n]){this.set(e,t);break}},integer:function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},percent:function(e,t){return!!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(t=parseFloat(t),t>=0&&t<=100))&&(this.set(e,t),!0)}};var l={"&amp;":"&","&lt;":"<","&gt;":">","&lrm;":"‎","&rlm;":"‏","&nbsp;":" "},u={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},c={v:"title",lang:"lang"},h={rt:"ruby"};function d(e,t){function i(){if(!t)return null;function e(e){return t=t.substr(e.length),e}var i=t.match(/^([^<]*)(<[^>]*>?)?/);return e(i[1]?i[1]:i[2])}function n(e){return l[e]}function s(e){while(v=e.match(/&(amp|lt|gt|lrm|rlm|nbsp);/))e=e.replace(v[0],n);return e}function a(e,t){return!h[t.localName]||h[t.localName]===e.localName}function o(t,i){var n=u[t];if(!n)return null;var r=e.document.createElement(n);r.localName=n;var s=c[t];return s&&i&&(r[s]=i.trim()),r}var d,p=e.document.createElement("div"),f=p,m=[];while(null!==(d=i()))if("<"!==d[0])f.appendChild(e.document.createTextNode(s(d)));else{if("/"===d[1]){m.length&&m[m.length-1]===d.substr(2).replace(">","")&&(m.pop(),f=f.parentNode);continue}var g,y=r(d.substr(1,d.length-2));if(y){g=e.document.createProcessingInstruction("timestamp",y),f.appendChild(g);continue}var v=d.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!v)continue;if(g=o(v[1],v[3]),!g)continue;if(!a(f,g))continue;v[2]&&(g.className=v[2].substr(1).replace("."," ")),m.push(v[1]),f.appendChild(g),f=g}return p}var p=[[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 f(e){for(var t=0;t<p.length;t++){var i=p[t];if(e>=i[0]&&e<=i[1])return!0}return!1}function m(e){var t,i=[],n="";if(!e||!e.childNodes)return"ltr";function r(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function s(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var n=i.match(/^.*(\n|\r)/);return n?(e.length=0,n[0]):i}return"ruby"===t.tagName?s(e):t.childNodes?(r(e,t),s(e)):void 0}r(i,e);while(n=s(i))for(var a=0;a<n.length;a++)if(t=n.charCodeAt(a),f(t))return"rtl";return"ltr"}function g(e){if("number"===typeof e.line&&(e.snapToLines||e.line>=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,n=0,r=0;r<i.length&&i[r]!==t;r++)"showing"===i[r].mode&&n++;return-1*++n}function y(){}function v(e,t,i){var n=/MSIE\s8\.0/.test(navigator.userAgent),r="rgba(255, 255, 255, 1)",s="rgba(0, 0, 0, 0.8)";n&&(r="rgb(255, 255, 255)",s="rgb(0, 0, 0)"),y.call(this),this.cue=t,this.cueDiv=d(e,t.text);var a={color:r,backgroundColor:s,position:"relative",left:0,right:0,top:0,bottom:0,display:"inline"};n||(a.writingMode=""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",a.unicodeBidi="plaintext"),this.applyStyles(a,this.cueDiv),this.div=e.document.createElement("div"),a={textAlign:"middle"===t.align?"center":t.align,font:i.font,whiteSpace:"pre-line",position:"absolute"},n||(a.direction=m(this.cueDiv),a.writingMode=""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl".stylesunicodeBidi="plaintext"),this.applyStyles(a),this.div.appendChild(this.cueDiv);var o=0;switch(t.positionAlign){case"start":o=t.position;break;case"middle":o=t.position-t.size/2;break;case"end":o=t.position-t.size;break}""===t.vertical?this.applyStyles({left:this.formatStyle(o,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(o,"%"),height:this.formatStyle(t.size,"%")}),this.move=function(e){this.applyStyles({top:this.formatStyle(e.top,"px"),bottom:this.formatStyle(e.bottom,"px"),left:this.formatStyle(e.left,"px"),right:this.formatStyle(e.right,"px"),height:this.formatStyle(e.height,"px"),width:this.formatStyle(e.width,"px")})}}function _(e){var t,i,n,r,s=/MSIE\s8\.0/.test(navigator.userAgent);if(e.div){i=e.div.offsetHeight,n=e.div.offsetWidth,r=e.div.offsetTop;var a=(a=e.div.childNodes)&&(a=a[0])&&a.getClientRects&&a.getClientRects();e=e.div.getBoundingClientRect(),t=a?Math.max(a[0]&&a[0].height||0,e.height/a.length):0}this.left=e.left,this.right=e.right,this.top=e.top||r,this.height=e.height||i,this.bottom=e.bottom||r+(e.height||i),this.width=e.width||n,this.lineHeight=void 0!==t?t:e.lineHeight,s&&!this.lineHeight&&(this.lineHeight=13)}function b(e,t,i,n){function r(e,t){for(var r,s=new _(e),a=1,o=0;o<t.length;o++){while(e.overlapsOppositeAxis(i,t[o])||e.within(i)&&e.overlapsAny(n))e.move(t[o]);if(e.within(i))return e;var l=e.intersectPercentage(i);a>l&&(r=new _(e),a=l),e=new _(s)}return r||s}var s=new _(t),a=t.cue,o=g(a),l=[];if(a.snapToLines){var u;switch(a.vertical){case"":l=["+y","-y"],u="height";break;case"rl":l=["+x","-x"],u="width";break;case"lr":l=["-x","+x"],u="width";break}var c=s.lineHeight,h=c*Math.round(o),d=i[u]+c,p=l[0];Math.abs(h)>d&&(h=h<0?-1:1,h*=Math.ceil(d/c)*c),o<0&&(h+=""===a.vertical?i.height:i.width,l=l.reverse()),s.move(p,h)}else{var f=s.lineHeight/i.height*100;switch(a.lineAlign){case"middle":o-=f/2;break;case"end":o-=f;break}switch(a.vertical){case"":t.applyStyles({top:t.formatStyle(o,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(o,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(o,"%")});break}l=["+y","-x","+x","-y"],s=new _(t)}var m=r(s,l);t.move(m.toCSSCompatValues(i))}function T(){}y.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},y.prototype.formatStyle=function(e,t){return 0===e?0:e+t},v.prototype=i(y.prototype),v.prototype.constructor=v,_.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t;break}},_.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},_.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1},_.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},_.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.left<e.left;case"-x":return this.right>e.right;case"+y":return this.top<e.top;case"-y":return this.bottom>e.bottom}},_.prototype.intersectPercentage=function(e){var t=Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left)),i=Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top)),n=t*i;return n/(this.height*this.width)},_.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},_.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e;var r={left:e.left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i};return r},T.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!==typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},T.convertCueToDOMTree=function(e,t){return e&&t?d(e,t):null};var S=.05,k="sans-serif",E="1.5%";T.processCues=function(e,t,i){if(!e||!t||!i)return null;while(i.firstChild)i.removeChild(i.firstChild);var n=e.document.createElement("div");function r(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return!0;return!1}if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin=E,i.appendChild(n),r(t)){var s=[],a=_.getSimpleBoxPosition(n),o=Math.round(a.height*S*100)/100,l={font:o+"px "+k};(function(){for(var i,r,o=0;o<t.length;o++)r=t[o],i=new v(e,r,l),n.appendChild(i.div),b(e,i,a,s),r.displayState=i.div,s.push(_.getSimpleBoxPosition(i))})()}else for(var u=0;u<t.length;u++)n.appendChild(t[u].displayState)},T.Parser=function(e,t,i){i||(i=t,t={}),t||(t={}),this.window=e,this.vttjs=t,this.state="INITIAL",this.buffer="",this.decoder=i||new TextDecoder("utf8"),this.regionList=[]},T.Parser.prototype={reportOrThrowError:function(e){if(!(e instanceof n))throw e;this.onparsingerror&&this.onparsingerror(e)},parse:function(e){var t=this;function i(){var e=t.buffer,i=0;while(i<e.length&&"\r"!==e[i]&&"\n"!==e[i])++i;var n=e.substr(0,i);return"\r"===e[i]&&++i,"\n"===e[i]&&++i,t.buffer=e.substr(i),n}function l(e){var i=new s;if(a(e,(function(e,t){switch(e){case"id":i.set(e,t);break;case"width":i.percent(e,t);break;case"lines":i.integer(e,t);break;case"regionanchor":case"viewportanchor":var n=t.split(",");if(2!==n.length)break;var r=new s;if(r.percent("x",n[0]),r.percent("y",n[1]),!r.has("x")||!r.has("y"))break;i.set(e+"X",r.get("x")),i.set(e+"Y",r.get("y"));break;case"scroll":i.alt(e,t,["up"]);break}}),/=/,/\s/),i.has("id")){var n=new(t.vttjs.VTTRegion||t.window.VTTRegion);n.width=i.get("width",100),n.lines=i.get("lines",3),n.regionAnchorX=i.get("regionanchorX",0),n.regionAnchorY=i.get("regionanchorY",100),n.viewportAnchorX=i.get("viewportanchorX",0),n.viewportAnchorY=i.get("viewportanchorY",100),n.scroll=i.get("scroll",""),t.onregion&&t.onregion(n),t.regionList.push({id:i.get("id"),region:n})}}function u(e){var i=new s;a(e,(function(e,t){switch(e){case"MPEGT":i.integer(e+"S",t);break;case"LOCA":i.set(e+"L",r(t));break}}),/[^\d]:/,/,/),t.ontimestampmap&&t.ontimestampmap({MPEGTS:i.get("MPEGTS"),LOCAL:i.get("LOCAL")})}function c(e){e.match(/X-TIMESTAMP-MAP/)?a(e,(function(e,t){switch(e){case"X-TIMESTAMP-MAP":u(t);break}}),/=/):a(e,(function(e,t){switch(e){case"Region":l(t);break}}),/:/)}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{var h;if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;h=i();var d=h.match(/^WEBVTT([ \t].*)?$/);if(!d||!d[0])throw new n(n.Errors.BadSignature);t.state="HEADER"}var p=!1;while(t.buffer){if(!/\r\n|\n/.test(t.buffer))return this;switch(p?p=!1:h=i(),t.state){case"HEADER":/:/.test(h)?c(h):h||(t.state="ID");continue;case"NOTE":h||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(h)){t.state="NOTE";break}if(!h)continue;if(t.cue=new(t.vttjs.VTTCue||t.window.VTTCue)(0,0,""),t.state="CUE",-1===h.indexOf("--\x3e")){t.cue.id=h;continue}case"CUE":try{o(h,t.cue,t.regionList)}catch(m){t.reportOrThrowError(m),t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":var f=-1!==h.indexOf("--\x3e");if(!h||f&&(p=!0)){t.oncue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}t.cue.text&&(t.cue.text+="\n"),t.cue.text+=h;continue;case"BADCUE":h||(t.state="ID");continue}}}catch(m){t.reportOrThrowError(m),"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state)throw new n(n.Errors.BadSignature)}catch(t){e.reportOrThrowError(t)}return e.onflush&&e.onflush(),this}},e.exports=T},"4e9a":function(e,t,i){"use strict";(function(e){i.d(t,"a",(function(){return a}));var n=i("be09"),r=i.n(n),s=function(t){return r.a.atob?r.a.atob(t):e.from(t,"base64").toString("binary")};function a(e){for(var t=s(e),i=new Uint8Array(t.length),n=0;n<t.length;n++)i[n]=t.charCodeAt(n);return i}}).call(this,i("b639").Buffer)},"4ea2":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,i){var n=void 0,r=void 0;if(i&&i.cues){n=i.cues.length;while(n--)r=i.cues[n],r.startTime<=t&&r.endTime>=e&&i.removeCue(r)}};t["default"]=n,e.exports=t["default"]},"50a6":function(e,t,i){"use strict";t.pad=i("6941"),t.unpad=i("0c1c")},5164:function(e,t,i){"use strict";var n=i("6516"),r=i("3727").handleRollover,s={};s.ts=i("ac62"),s.aac=i("d8c8");var a=9e4,o=188,l=71,u=function(e){return e[0]==="I".charCodeAt(0)&&e[1]==="D".charCodeAt(0)&&e[2]==="3".charCodeAt(0)},c=function(e,t){var i,n,r=0,a=o;while(a<e.byteLength)if(e[r]!==l||e[a]!==l)r++,a++;else{switch(i=e.subarray(r,a),n=s.ts.parseType(i,t.pid),n){case"pat":t.pid||(t.pid=s.ts.parsePat(i));break;case"pmt":t.table||(t.table=s.ts.parsePmt(i));break;default:break}if(t.pid&&t.table)return;r+=o,a+=o}},h=function(e,t,i){var n,r,a,u,c,h=0,d=o,p=!1;while(d<e.byteLength)if(e[h]!==l||e[d]!==l)h++,d++;else{switch(n=e.subarray(h,d),r=s.ts.parseType(n,t.pid),r){case"pes":a=s.ts.parsePesType(n,t.table),u=s.ts.parsePayloadUnitStartIndicator(n),"audio"===a&&u&&(c=s.ts.parsePesTime(n),c&&(c.type="audio",i.audio.push(c),p=!0));break;default:break}if(p)break;h+=o,d+=o}d=e.byteLength,h=d-o,p=!1;while(h>=0)if(e[h]!==l||e[d]!==l)h--,d--;else{switch(n=e.subarray(h,d),r=s.ts.parseType(n,t.pid),r){case"pes":a=s.ts.parsePesType(n,t.table),u=s.ts.parsePayloadUnitStartIndicator(n),"audio"===a&&u&&(c=s.ts.parsePesTime(n),c&&(c.type="audio",i.audio.push(c),p=!0));break;default:break}if(p)break;h-=o,d-=o}},d=function(e,t,i){var n,r,a,u,c,h,d,p,f=0,m=o,g=!1,y={data:[],size:0};while(m<e.byteLength)if(e[f]!==l||e[m]!==l)f++,m++;else{switch(n=e.subarray(f,m),r=s.ts.parseType(n,t.pid),r){case"pes":if(a=s.ts.parsePesType(n,t.table),u=s.ts.parsePayloadUnitStartIndicator(n),"video"===a&&(u&&!g&&(c=s.ts.parsePesTime(n),c&&(c.type="video",i.video.push(c),g=!0)),!i.firstKeyFrame)){if(u&&0!==y.size){h=new Uint8Array(y.size),d=0;while(y.data.length)p=y.data.shift(),h.set(p,d),d+=p.byteLength;s.ts.videoPacketContainsKeyFrame(h)&&(i.firstKeyFrame=s.ts.parsePesTime(h),i.firstKeyFrame.type="video"),y.size=0}y.data.push(n),y.size+=n.byteLength}break;default:break}if(g&&i.firstKeyFrame)break;f+=o,m+=o}m=e.byteLength,f=m-o,g=!1;while(f>=0)if(e[f]!==l||e[m]!==l)f--,m--;else{switch(n=e.subarray(f,m),r=s.ts.parseType(n,t.pid),r){case"pes":a=s.ts.parsePesType(n,t.table),u=s.ts.parsePayloadUnitStartIndicator(n),"video"===a&&u&&(c=s.ts.parsePesTime(n),c&&(c.type="video",i.video.push(c),g=!0));break;default:break}if(g)break;f-=o,m-=o}},p=function(e,t){if(e.audio&&e.audio.length){var i=t;"undefined"===typeof i&&(i=e.audio[0].dts),e.audio.forEach((function(e){e.dts=r(e.dts,i),e.pts=r(e.pts,i),e.dtsTime=e.dts/a,e.ptsTime=e.pts/a}))}if(e.video&&e.video.length){var n=t;if("undefined"===typeof n&&(n=e.video[0].dts),e.video.forEach((function(e){e.dts=r(e.dts,n),e.pts=r(e.pts,n),e.dtsTime=e.dts/a,e.ptsTime=e.pts/a})),e.firstKeyFrame){var s=e.firstKeyFrame;s.dts=r(s.dts,n),s.pts=r(s.pts,n),s.dtsTime=s.dts/a,s.ptsTime=s.dts/a}}},f=function(e){var t,i=!1,n=0,r=null,o=null,l=0,u=0;while(e.length-u>=3){var c=s.aac.parseType(e,u);switch(c){case"timed-metadata":if(e.length-u<10){i=!0;break}if(l=s.aac.parseId3TagSize(e,u),l>e.length){i=!0;break}null===o&&(t=e.subarray(u,u+l),o=s.aac.parseAacTimestamp(t)),u+=l;break;case"audio":if(e.length-u<7){i=!0;break}if(l=s.aac.parseAdtsSize(e,u),l>e.length){i=!0;break}null===r&&(t=e.subarray(u,u+l),r=s.aac.parseSampleRate(t)),n++,u+=l;break;default:u++;break}if(i)return null}if(null===r||null===o)return null;var h=a/r,d={audio:[{type:"audio",dts:o,pts:o},{type:"audio",dts:o+1024*n*h,pts:o+1024*n*h}]};return d},m=function(e){var t={pid:null,table:null},i={};for(var r in c(e,t),t.table)if(t.table.hasOwnProperty(r)){var s=t.table[r];switch(s){case n.H264_STREAM_TYPE:i.video=[],d(e,t,i),0===i.video.length&&delete i.video;break;case n.ADTS_STREAM_TYPE:i.audio=[],h(e,t,i),0===i.audio.length&&delete i.audio;break;default:break}}return i},g=function(e,t){var i,n=u(e);return i=n?f(e):m(e),i&&(i.audio||i.video)?(p(i,t),i):null};e.exports={inspect:g}},"53a8":function(e,t){e.exports=n;var i=Object.prototype.hasOwnProperty;function n(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var r in n)i.call(n,r)&&(e[r]=n[r])}return e}},5496:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=function(e,t,i){var n=!0;while(n){var r=e,s=t,a=i;n=!1,null===r&&(r=Function.prototype);var o=Object.getOwnPropertyDescriptor(r,s);if(void 0!==o){if("value"in o)return o.value;var l=o.get;if(void 0===l)return;return l.call(a)}var u=Object.getPrototypeOf(r);if(null===u)return;e=u,t=s,i=a,n=!0,o=u=void 0}};function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=i("f7fd"),u=s(l),c=i("e475"),h=s(c),d=i("be09"),p=s(d),f=i("4ea2"),m=s(f),g=i("f24e"),y=new Uint8Array("\n\n".split("").map((function(e){return e.charCodeAt(0)}))),v=function(e){return String.fromCharCode.apply(null,e)},_=function(e){function t(e){var i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];a(this,t),r(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,i),this.mediaSource_=null,this.subtitlesTrack_=null}return o(t,e),n(t,[{key:"buffered_",value:function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues.length)return h["default"].createTimeRanges();var e=this.subtitlesTrack_.cues,t=e[0].startTime,i=e[e.length-1].startTime;return h["default"].createTimeRanges([[t,i]])}},{key:"initSegment",value:function(e){var t=!(arguments.length<=1||void 0===arguments[1])&&arguments[1];if(!e)return null;var i=(0,g.initSegmentId)(e),n=this.initSegments_[i];if(t&&!n&&e.bytes){var r=y.byteLength+e.bytes.byteLength,s=new Uint8Array(r);s.set(e.bytes),s.set(y,e.bytes.byteLength),this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:s}}return n||e}},{key:"couldBeginLoading_",value:function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}},{key:"init_",value:function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}},{key:"track",value:function(e){return"undefined"===typeof e||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}},{key:"remove",value:function(e,t){(0,m["default"])(e,t,this.subtitlesTrack_)}},{key:"fillBuffer_",value:function(){var e=this;this.syncPoint_||(this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_()));var t=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_);if(t=this.skipEmptySegments_(t),t){if(null===this.syncController_.timestampOffsetForTimeline(t.timeline)){var i=function(){e.state="READY",e.paused()||e.monitorBuffer_()};return this.syncController_.one("timestampoffset",i),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(t)}}},{key:"skipEmptySegments_",value:function(e){while(e&&e.segment.empty)e=this.generateSegmentInfo_(e.playlist,e.mediaIndex+1,e.startOfSegment+e.duration,e.isSyncRequest);return e}},{key:"handleSegment_",value:function(){var e=this;if(this.pendingSegment_&&this.subtitlesTrack_){this.state="APPENDING";var t=this.pendingSegment_,i=t.segment;if("function"!==typeof p["default"].WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var n=function(){var t=function(){e.handleSegment_()};return e.state="WAITING_ON_VTTJS",e.subtitlesTrack_.tech_.one("vttjsloaded",t),e.subtitlesTrack_.tech_.one("vttjserror",(function(){e.subtitlesTrack_.tech_.off("vttjsloaded",t),e.error({message:"Error loading vtt.js"}),e.state="READY",e.pause(),e.trigger("error")})),{v:void 0}}();if("object"===typeof n)return n.v}i.requested=!0;try{this.parseVTTCues_(t)}catch(r){return this.error({message:r.message}),this.state="READY",this.pause(),this.trigger("error")}if(this.updateTimeMapping_(t,this.syncController_.timelines[t.timeline],this.playlist_),t.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");t.byteLength=t.bytes.byteLength,this.mediaSecondsLoaded+=i.duration,t.cues.length&&this.remove(t.cues[0].endTime,t.cues[t.cues.length-1].endTime),t.cues.forEach((function(t){e.subtitlesTrack_.addCue(t)})),this.handleUpdateEnd_()}else this.state="READY"}},{key:"parseVTTCues_",value:function(e){var t=void 0,i=!1;"function"===typeof p["default"].TextDecoder?t=new p["default"].TextDecoder("utf8"):(t=p["default"].WebVTT.StringDecoder(),i=!0);var n=new p["default"].WebVTT.Parser(p["default"],p["default"].vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},n.oncue=e.cues.push.bind(e.cues),n.ontimestampmap=function(t){return e.timestampmap=t},n.onparsingerror=function(e){h["default"].log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){var r=e.segment.map.bytes;i&&(r=v(r)),n.parse(r)}var s=e.bytes;i&&(s=v(s)),n.parse(s),n.flush()}},{key:"updateTimeMapping_",value:function(e,t,i){var n=e.segment;if(t)if(e.cues.length){var r=e.timestampmap,s=r.MPEGTS/9e4-r.LOCAL+t.mapping;if(e.cues.forEach((function(e){e.startTime+=s,e.endTime+=s})),!i.syncInfo){var a=e.cues[0].startTime,o=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(a,o-n.duration)}}}else n.empty=!0}}]),t}(u["default"]);t["default"]=_,e.exports=t["default"]},"56c8":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,GOAL_BUFFER_LENGTH_RATE:1,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,BUFFER_LOW_WATER_LINE_RATE:1},e.exports=t["default"]},"57db":function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i("56c8"),s=n(r),a=i("d61a"),o=n(a),l=i("6066"),u=function(e,t){var i=void 0;return e?(i=window.getComputedStyle(e),i?i[t]:""):""},c=function(e,t){var i=e.slice();e.sort((function(e,n){var r=t(e,n);return 0===r?i.indexOf(e)-i.indexOf(n):r}))},h=function(e,t){var i=void 0,n=void 0;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||window.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(n=t.attributes.BANDWIDTH),n=n||window.Number.MAX_VALUE,i-n};t.comparePlaylistBandwidth=h;var d=function(e,t){var i=void 0,n=void 0;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||window.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),n=n||window.Number.MAX_VALUE,i===n&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n};t.comparePlaylistResolution=d;var p=function(e,t,i,n){var r=e.playlists.map((function(e){var t=void 0,i=void 0,n=void 0;return t=e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,i=e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height,n=e.attributes.BANDWIDTH,n=n||window.Number.MAX_VALUE,{bandwidth:n,width:t,height:i,playlist:e}}));c(r,(function(e,t){return e.bandwidth-t.bandwidth})),r=r.filter((function(e){return!o["default"].isIncompatible(e.playlist)}));var a=r.filter((function(e){return o["default"].isEnabled(e.playlist)}));a.length||(a=r.filter((function(e){return!o["default"].isDisabled(e.playlist)})));var l=a.filter((function(e){return e.bandwidth*s["default"].BANDWIDTH_VARIANCE<t})),u=l[l.length-1],h=l.filter((function(e){return e.bandwidth===u.bandwidth}))[0],d=l.filter((function(e){return e.width&&e.height}));c(d,(function(e,t){return e.width-t.width}));var p=d.filter((function(e){return e.width===i&&e.height===n}));u=p[p.length-1];var f=p.filter((function(e){return e.bandwidth===u.bandwidth}))[0],m=void 0,g=void 0,y=void 0;f||(m=d.filter((function(e){return e.width>i||e.height>n})),g=m.filter((function(e){return e.width===m[0].width&&e.height===m[0].height})),u=g[g.length-1],y=g.filter((function(e){return e.bandwidth===u.bandwidth}))[0]);var v=y||f||h||a[0]||r[0];return v?v.playlist:null};t.simpleSelector=p;var f=function(){return p(this.playlists.master,this.systemBandwidth,parseInt(u(this.tech_.el(),"width"),10),parseInt(u(this.tech_.el(),"height"),10))};t.lastBandwidthSelector=f;var m=function(e){var t=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){return t<0&&(t=this.systemBandwidth),t=e*this.systemBandwidth+(1-e)*t,p(this.playlists.master,t,parseInt(u(this.tech_.el(),"width"),10),parseInt(u(this.tech_.el(),"height"),10))}};t.movingAverageBandwidthSelector=m;var g=function(e){var t=e.master,i=e.currentTime,n=e.bandwidth,r=e.duration,s=e.segmentDuration,a=e.timeUntilRebuffer,l=e.currentTimeline,u=e.syncController,d=t.playlists.filter((function(e){return!o["default"].isIncompatible(e)})),p=d.filter(o["default"].isEnabled);p.length||(p=d.filter((function(e){return!o["default"].isDisabled(e)})));var f=p.filter(o["default"].hasAttribute.bind(null,"BANDWIDTH")),m=f.map((function(e){var t=u.getSyncPoint(e,r,l,i),c=t?1:2,h=o["default"].estimateSegmentRequestTime(s,n,e),d=h*c-a;return{playlist:e,rebufferingImpact:d}})),g=m.filter((function(e){return e.rebufferingImpact<=0}));return c(g,(function(e,t){return h(t.playlist,e.playlist)})),g.length?g[0]:(c(m,(function(e,t){return e.rebufferingImpact-t.rebufferingImpact})),m[0]||null)};t.minRebufferMaxBandwidthSelector=g;var y=function(){var e=this.playlists.master.playlists.filter(o["default"].isEnabled);c(e,(function(e,t){return h(e,t)}));var t=e.filter((function(e){return(0,l.parseCodecs)(e.attributes.CODECS).videoCodec}));return t[0]||null};t.lowestBitrateCompatibleVariantSelector=y},"5c9d":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}();function r(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=i("be09"),o=r(a),l=i("fef4"),u=r(l),c=function(e){e.on("data",(function(e){var t=e.initSegment;e.initSegment={data:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength};var i=e.data;e.data=i.buffer,o["default"].postMessage({action:"data",segment:e,byteOffset:i.byteOffset,byteLength:i.byteLength},[e.data])})),e.captionStream&&e.captionStream.on("data",(function(e){o["default"].postMessage({action:"caption",data:e})})),e.on("done",(function(e){o["default"].postMessage({action:"done"})})),e.on("gopInfo",(function(e){o["default"].postMessage({action:"gopInfo",gopInfo:e})}))},h=function(){function e(t){s(this,e),this.options=t||{},this.init()}return n(e,[{key:"init",value:function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new u["default"].Transmuxer(this.options),c(this.transmuxer)}},{key:"push",value:function(e){var t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}},{key:"reset",value:function(){this.init()}},{key:"setTimestampOffset",value:function(e){var t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(9e4*t))}},{key:"setAudioAppendStart",value:function(e){this.transmuxer.setAudioAppendStart(Math.ceil(9e4*e.appendStart))}},{key:"flush",value:function(e){this.transmuxer.flush()}},{key:"resetCaptions",value:function(){this.transmuxer.resetCaptions()}},{key:"alignGopsWith",value:function(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}]),e}(),d=function(e){e.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new h(e.data.options):(this.messageHandlers||(this.messageHandlers=new h),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}};t["default"]=function(e){return new d(e)},e.exports=t["default"]},6066:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0],t={codecCount:0},i=void 0;return t.codecCount=e.split(",").length,t.codecCount=t.codecCount||2,i=/(^|\s|,)+(avc1)([^ ,]*)/i.exec(e),i&&(t.videoCodec=i[2],t.videoObjectTypeIndicator=i[3]),t.audioProfile=/(^|\s|,)+mp4a.[0-9A-Fa-f]+\.([0-9A-Fa-f]+)/i.exec(e),t.audioProfile=t.audioProfile&&t.audioProfile[2],t};t.parseCodecs=n},6373:function(e,t,i){"use strict";e.exports={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21}},"63ec":function(e,t,i){"use strict";var n=i("d136"),r=i.n(n),s=i("be09"),a=i.n(s),o="http://example.com",l=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=a.a.location&&a.a.location.href||"");var i="function"===typeof a.a.URL,n=/^\/\//.test(e),s=!a.a.location&&!/\/\//i.test(e);if(i?e=new a.a.URL(e,a.a.location||o):/\/\//i.test(e)||(e=r.a.buildAbsoluteURL(a.a.location&&a.a.location.href||"",e)),i){var l=new URL(t,e);return s?l.href.slice(o.length):n?l.href.slice(l.protocol.length):l.href}return r.a.buildAbsoluteURL(e,t)};t["a"]=l},6444:function(e,t){var i=function(e){return e.replace(/^\s+|\s+$/g,"")},n=function(e){return"[object Array]"===Object.prototype.toString.call(e)};e.exports=function(e){if(!e)return{};for(var t={},r=i(e).split("\n"),s=0;s<r.length;s++){var a=r[s],o=a.indexOf(":"),l=i(a.slice(0,o)).toLowerCase(),u=i(a.slice(o+1));"undefined"===typeof t[l]?t[l]=u:n(t[l])?t[l].push(u):t[l]=[t[l],u]}return t}},6516:function(e,t,i){"use strict";e.exports={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21}},"672d":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=function(e,t,i){var n=!0;while(n){var r=e,s=t,a=i;n=!1,null===r&&(r=Function.prototype);var o=Object.getOwnPropertyDescriptor(r,s);if(void 0!==o){if("value"in o)return o.value;var l=o.get;if(void 0===l)return;return l.call(a)}var u=Object.getPrototypeOf(r);if(null===u)return;e=u,t=s,i=a,n=!0,o=u=void 0}};function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=i("be09"),u=s(l),c=i("12c6"),h=s(c),d=i("1376"),p=s(d),f=i("4ea2"),m=s(f),g=i("9417"),y=s(g),v=i("ba2d"),_=i("a64c"),b=s(_),T=i("78d8"),S=s(T),k=i("e206"),E=s(k),w=function(){var e=void 0;try{e="a64c"}catch(t){}return e},C=function(e){u["default"].setTimeout(e,E["default"].TIME_BETWEEN_CHUNKS)},x=function(){return Math.random().toString(36).slice(2,8)},A=function(e,t){("number"!==typeof t||t<0)&&(t=0);var i=Math.pow(10,t);return Math.round(e*i)/i},I=function(e){function t(e){var i=this;a(this,t),r(Object.getPrototypeOf(t.prototype),"constructor",this).call(this);var n=void 0;this.chunkSize_=E["default"].BYTES_PER_CHUNK,this.buffer_=[],this.bufferSize_=0,this.basePtsOffset_=NaN,this.mediaSource_=e,this.audioBufferEnd_=NaN,this.videoBufferEnd_=NaN,this.updating=!1,this.timestampOffset_=0,n=u["default"].btoa(String.fromCharCode.apply(null,Array.prototype.slice.call(p["default"].getFlvHeader())));var s=this.mediaSource_.player_.id().replace(/[^a-zA-Z0-9]/g,"_");this.flashEncodedHeaderName_="vjs_flashEncodedHeader_"+s+x(),this.flashEncodedDataName_="vjs_flashEncodedData_"+s+x(),u["default"][this.flashEncodedHeaderName_]=function(){return delete u["default"][i.flashEncodedHeaderName_],n},this.mediaSource_.swfObj.vjs_appendChunkReady(this.flashEncodedHeaderName_),this.transmuxer_=(0,S["default"])(b["default"],w()),this.transmuxer_.postMessage({action:"init",options:{}}),this.transmuxer_.onmessage=function(e){"data"===e.data.action&&i.receiveBuffer_(e.data.segment)},this.one("updateend",(function(){i.mediaSource_.tech_.trigger("loadedmetadata")})),Object.defineProperty(this,"timestampOffset",{get:function(){return this.timestampOffset_},set:function(e){"number"===typeof e&&e>=0&&(this.timestampOffset_=e,this.mediaSource_.swfObj.vjs_discontinuity(),this.basePtsOffset_=NaN,this.audioBufferEnd_=NaN,this.videoBufferEnd_=NaN,this.transmuxer_.postMessage({action:"reset"}))}}),Object.defineProperty(this,"buffered",{get:function(){if(!this.mediaSource_||!this.mediaSource_.swfObj||!("vjs_getProperty"in this.mediaSource_.swfObj))return h["default"].createTimeRange();var e=this.mediaSource_.swfObj.vjs_getProperty("buffered");return e&&e.length&&(e[0][0]=A(e[0][0],3),e[0][1]=A(e[0][1],3)),h["default"].createTimeRanges(e)}}),this.mediaSource_.player_.on("seeked",(function(){if((0,m["default"])(0,1/0,i.metadataTrack_),i.inbandTextTracks_)for(var e in i.inbandTextTracks_)(0,m["default"])(0,1/0,i.inbandTextTracks_[e])}));var o=this.onHlsReset_.bind(this);this.mediaSource_.player_.tech_.on("hls-reset",o),this.mediaSource_.player_.tech_.hls.on("dispose",(function(){i.transmuxer_.terminate(),i.mediaSource_.player_.tech_.off("hls-reset",o)}))}return o(t,e),n(t,[{key:"appendBuffer",value:function(e){var t=void 0;if(this.updating)throw t=new Error("SourceBuffer.append() cannot be called while an update is in progress"),t.name="InvalidStateError",t.code=11,t;this.updating=!0,this.mediaSource_.readyState="open",this.trigger({type:"update"}),this.transmuxer_.postMessage({action:"push",data:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength},[e.buffer]),this.transmuxer_.postMessage({action:"flush"})}},{key:"abort",value:function(){this.buffer_=[],this.bufferSize_=0,this.mediaSource_.swfObj.vjs_abort(),this.updating&&(this.updating=!1,this.trigger({type:"updateend"}))}},{key:"remove",value:function(e,t){if((0,m["default"])(e,t,this.metadataTrack_),this.inbandTextTracks_)for(var i in this.inbandTextTracks_)(0,m["default"])(e,t,this.inbandTextTracks_[i]);this.trigger({type:"update"}),this.trigger({type:"updateend"})}},{key:"receiveBuffer_",value:function(e){var t=this;(0,y["default"])(this,this.mediaSource_,e),(0,v.addTextTrackData)(this,e.captions,e.metadata),C((function(){var i=t.convertTagsToData_(e);0===t.buffer_.length&&C(t.processBuffer_.bind(t)),i&&(t.buffer_.push(i),t.bufferSize_+=i.byteLength)}))}},{key:"processBuffer_",value:function(){var e=this,t=E["default"].BYTES_PER_CHUNK;if(this.buffer_.length){var i=this.buffer_[0].subarray(0,t);i.byteLength<t||this.buffer_[0].byteLength===t?this.buffer_.shift():this.buffer_[0]=this.buffer_[0].subarray(t),this.bufferSize_-=i.byteLength;for(var n=[],r=i.byteLength,s=0;s<r;s++)n.push(String.fromCharCode(i[s]));var a=u["default"].btoa(n.join(""));u["default"][this.flashEncodedDataName_]=function(){return C(e.processBuffer_.bind(e)),delete u["default"][e.flashEncodedDataName_],a},this.mediaSource_.swfObj.vjs_appendChunkReady(this.flashEncodedDataName_)}else!1!==this.updating&&(this.updating=!1,this.trigger({type:"updateend"}))}},{key:"convertTagsToData_",value:function(e){var t=0,i=this.mediaSource_.tech_,n=0,r=void 0,s=e.tags.videoTags,a=e.tags.audioTags;if(isNaN(this.basePtsOffset_)&&(s.length||a.length)){var o=s[0]||{pts:1/0},l=a[0]||{pts:1/0};this.basePtsOffset_=Math.min(l.pts,o.pts)}i.seeking()&&(this.videoBufferEnd_=NaN,this.audioBufferEnd_=NaN),isNaN(this.videoBufferEnd_)?(i.buffered().length&&(n=i.buffered().end(0)-this.timestampOffset),i.seeking()&&(n=Math.max(n,i.currentTime()-this.timestampOffset)),n*=1e3,n+=this.basePtsOffset_):n=this.videoBufferEnd_+.1;var u=s.length;if(u&&s[u-1].pts>=n){while(--u){var c=s[u];if(!(c.pts>n)&&(c.keyFrame||c.metaDataTag))break}while(u){var h=s[u-1];if(!h.metaDataTag)break;u--}}var d=s.slice(u),p=void 0;p=isNaN(this.audioBufferEnd_)?n:this.audioBufferEnd_+.1,d.length&&(p=Math.min(p,d[0].pts)),u=0;while(u<a.length){if(a[u].pts>=p)break;u++}var f=a.slice(u);f.length&&(this.audioBufferEnd_=f[f.length-1].pts),d.length&&(this.videoBufferEnd_=d[d.length-1].pts);var m=this.getOrderedTags_(d,f);if(0!==m.length){if(m[0].pts<n&&i.seeking()){var g=1/30,y=i.currentTime(),v=(n-m[0].pts)/1e3,_=y-v;_<g&&(_=0);try{this.mediaSource_.swfObj.vjs_adjustCurrentTime(_)}catch(S){}}for(var b=0;b<m.length;b++)t+=m[b].bytes.byteLength;r=new Uint8Array(t);b=0;for(var T=0;b<m.length;b++)r.set(m[b].bytes,T),T+=m[b].bytes.byteLength;return r}}},{key:"getOrderedTags_",value:function(e,t){var i=void 0,n=[];while(e.length||t.length)i=e.length?t.length&&t[0].dts<e[0].dts?t.shift():e.shift():t.shift(),n.push(i);return n}},{key:"onHlsReset_",value:function(){this.transmuxer_.postMessage({action:"resetCaptions"})}}]),t}(h["default"].EventTarget);t["default"]=I,e.exports=t["default"]},6941:function(e,t,i){"use strict";var n;e.exports=function(e){var t=n[e.byteLength%16||0],i=new Uint8Array(e.byteLength+t.length);return i.set(e),i.set(t,e.byteLength),i},n=[[16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16],[15,15,15,15,15,15,15,15,15,15,15,15,15,15,15],[14,14,14,14,14,14,14,14,14,14,14,14,14,14],[13,13,13,13,13,13,13,13,13,13,13,13,13],[12,12,12,12,12,12,12,12,12,12,12,12],[11,11,11,11,11,11,11,11,11,11,11],[10,10,10,10,10,10,10,10,10,10],[9,9,9,9,9,9,9,9,9],[8,8,8,8,8,8,8,8],[7,7,7,7,7,7,7],[6,6,6,6,6,6],[5,5,5,5,5],[4,4,4,4],[3,3,3],[2,2],[1]]},"6be2":function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i("d136"),s=n(r),a=i("be09"),o=n(a),l=function(e,t){return/^[a-z]+:/i.test(t)?t:(/\/\//i.test(e)||(e=s["default"].buildAbsoluteURL(o["default"].location.href,e)),s["default"].buildAbsoluteURL(e,t))};t["default"]=l,e.exports=t["default"]},"6d67":function(e,t){var i="auto",n={"":!0,lr:!0,rl:!0},r={start:!0,middle:!0,end:!0,left:!0,right:!0};function s(e){if("string"!==typeof e)return!1;var t=n[e.toLowerCase()];return!!t&&e.toLowerCase()}function a(e){if("string"!==typeof e)return!1;var t=r[e.toLowerCase()];return!!t&&e.toLowerCase()}function o(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)e[n]=i[n]}return e}function l(e,t,n){var r=this,l=/MSIE\s8\.0/.test(navigator.userAgent),u={};l?r=document.createElement("custom"):u.enumerable=!0,r.hasBeenReset=!1;var c="",h=!1,d=e,p=t,f=n,m=null,g="",y=!0,v="auto",_="start",b=50,T="middle",S=50,k="middle";if(Object.defineProperty(r,"id",o({},u,{get:function(){return c},set:function(e){c=""+e}})),Object.defineProperty(r,"pauseOnExit",o({},u,{get:function(){return h},set:function(e){h=!!e}})),Object.defineProperty(r,"startTime",o({},u,{get:function(){return d},set:function(e){if("number"!==typeof e)throw new TypeError("Start time must be set to a number.");d=e,this.hasBeenReset=!0}})),Object.defineProperty(r,"endTime",o({},u,{get:function(){return p},set:function(e){if("number"!==typeof e)throw new TypeError("End time must be set to a number.");p=e,this.hasBeenReset=!0}})),Object.defineProperty(r,"text",o({},u,{get:function(){return f},set:function(e){f=""+e,this.hasBeenReset=!0}})),Object.defineProperty(r,"region",o({},u,{get:function(){return m},set:function(e){m=e,this.hasBeenReset=!0}})),Object.defineProperty(r,"vertical",o({},u,{get:function(){return g},set:function(e){var t=s(e);if(!1===t)throw new SyntaxError("An invalid or illegal string was specified.");g=t,this.hasBeenReset=!0}})),Object.defineProperty(r,"snapToLines",o({},u,{get:function(){return y},set:function(e){y=!!e,this.hasBeenReset=!0}})),Object.defineProperty(r,"line",o({},u,{get:function(){return v},set:function(e){if("number"!==typeof e&&e!==i)throw new SyntaxError("An invalid number or illegal string was specified.");v=e,this.hasBeenReset=!0}})),Object.defineProperty(r,"lineAlign",o({},u,{get:function(){return _},set:function(e){var t=a(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");_=t,this.hasBeenReset=!0}})),Object.defineProperty(r,"position",o({},u,{get:function(){return b},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");b=e,this.hasBeenReset=!0}})),Object.defineProperty(r,"positionAlign",o({},u,{get:function(){return T},set:function(e){var t=a(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");T=t,this.hasBeenReset=!0}})),Object.defineProperty(r,"size",o({},u,{get:function(){return S},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");S=e,this.hasBeenReset=!0}})),Object.defineProperty(r,"align",o({},u,{get:function(){return k},set:function(e){var t=a(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");k=t,this.hasBeenReset=!0}})),r.displayState=void 0,l)return r}l.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},e.exports=l},"6e1b":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}();function r(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=i("e475"),o=r(a),l=function(){},u=function(){function e(t,i){var n=this;s(this,e);var r=function(){n.sourceBuffer_=t.addSourceBuffer(i),n.onUpdateendCallback_=function(){var e=n.pendingCallback_;n.pendingCallback_=null,e&&e(),n.runCallback_()},n.sourceBuffer_.addEventListener("updateend",n.onUpdateendCallback_),n.runCallback_()};this.callbacks_=[],this.pendingCallback_=null,this.timestampOffset_=0,this.mediaSource=t,this.processedAppend_=!1,"closed"===t.readyState?t.addEventListener("sourceopen",r):r()}return n(e,[{key:"abort",value:function(e){var t=this;this.processedAppend_&&this.queueCallback_((function(){t.sourceBuffer_.abort()}),e)}},{key:"appendBuffer",value:function(e,t){var i=this;this.processedAppend_=!0,this.queueCallback_((function(){i.sourceBuffer_.appendBuffer(e)}),t)}},{key:"buffered",value:function(){return this.sourceBuffer_?this.sourceBuffer_.buffered:o["default"].createTimeRanges()}},{key:"remove",value:function(e,t){var i=this;this.processedAppend_&&this.queueCallback_((function(){i.sourceBuffer_.remove(e,t)}),l)}},{key:"updating",value:function(){return!this.sourceBuffer_||this.sourceBuffer_.updating||this.pendingCallback_}},{key:"timestampOffset",value:function(e){var t=this;return"undefined"!==typeof e&&(this.queueCallback_((function(){t.sourceBuffer_.timestampOffset=e})),this.timestampOffset_=e),this.timestampOffset_}},{key:"queueCallback_",value:function(e,t){this.callbacks_.push([e.bind(this),t]),this.runCallback_()}},{key:"runCallback_",value:function(){var e=void 0;!this.updating()&&this.callbacks_.length&&(e=this.callbacks_.shift(),this.pendingCallback_=e[1],e[0]())}},{key:"dispose",value:function(){this.sourceBuffer_.removeEventListener("updateend",this.onUpdateendCallback_),this.sourceBuffer_&&"open"===this.mediaSource.readyState&&this.sourceBuffer_.abort()}}]),e}();t["default"]=u,e.exports=t["default"]},7002:function(e,t,i){"use strict";var n=function(){var e=this;this.list=[],this.push=function(e){this.list.push({bytes:e.bytes,dts:e.dts,pts:e.pts,keyFrame:e.keyFrame,metaDataTag:e.metaDataTag})},Object.defineProperty(this,"length",{get:function(){return e.list.length}})};e.exports=n},"70fd":function(e,t,i){"use strict";var n,r,s,a=i("0129"),o=i("db3d"),l=i("6373"),u=i("96b7").TimestampRolloverStream,c=i("6373"),h=188,d=71;n=function(){var e=new Uint8Array(h),t=0;n.prototype.init.call(this),this.push=function(i){var n,r=0,s=h;t?(n=new Uint8Array(i.byteLength+t),n.set(e.subarray(0,t)),n.set(i,t),t=0):n=i;while(s<n.byteLength)n[r]!==d||n[s]!==d?(r++,s++):(this.trigger("data",n.subarray(r,s)),r+=h,s+=h);r<n.byteLength&&(e.set(n.subarray(r),0),t=n.byteLength-r)},this.flush=function(){t===h&&e[0]===d&&(this.trigger("data",e),t=0),this.trigger("done")}},n.prototype=new a,r=function(){var e,t,i,n;r.prototype.init.call(this),n=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,n){var r=0;n.payloadUnitStartIndicator&&(r+=e[r]+1),"pat"===n.type?t(e.subarray(r),n):i(e.subarray(r),n)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],n.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=n.pmtPid},i=function(e,t){var i,r,s,a;if(1&e[5]){n.programMapTable={video:null,audio:null,"timed-metadata":{}},i=(15&e[1])<<8|e[2],r=3+i-4,s=(15&e[10])<<8|e[11],a=12+s;while(a<r){var o=e[a],u=(31&e[a+1])<<8|e[a+2];o===l.H264_STREAM_TYPE&&null===n.programMapTable.video?n.programMapTable.video=u:o===l.ADTS_STREAM_TYPE&&null===n.programMapTable.audio?n.programMapTable.audio=u:o===l.METADATA_STREAM_TYPE&&(n.programMapTable["timed-metadata"][u]=o),a+=5+((15&e[a+3])<<8|e[a+4])}t.programMapTable=n.programMapTable}},this.push=function(t){var i={},n=4;if(i.payloadUnitStartIndicator=!!(64&t[1]),i.pid=31&t[1],i.pid<<=8,i.pid|=t[2],(48&t[3])>>>4>1&&(n+=t[n]+1),0===i.pid)i.type="pat",e(t.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid){i.type="pmt",e(t.subarray(n),i),this.trigger("data",i);while(this.packetsWaitingForPmt.length)this.processPes_.apply(this,this.packetsWaitingForPmt.shift())}else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,n,i]):this.processPes_(t,n,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=l.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=l.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}},r.prototype=new a,r.STREAM_TYPES={h264:27,adts:15},s=function(){var e=this,t={data:[],size:0},i={data:[],size:0},n={data:[],size:0},r=function(e,t){var i;t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=0!==(4&e[6]),i=e[7],192&i&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&i&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8])},a=function(t,i,n){var s,a=new Uint8Array(t.size),o={type:i},l=0,u=0,c=!1;if(t.data.length&&!(t.size<9)){for(o.trackId=t.data[0].pid,l=0;l<t.data.length;l++)s=t.data[l],a.set(s.data,u),u+=s.data.byteLength;r(a,o),c="video"===i||o.packetLength<=t.size,(n||c)&&(t.size=0,t.data.length=0),c&&e.trigger("data",o)}};s.prototype.init.call(this),this.push=function(r){({pat:function(){},pes:function(){var e,s;switch(r.streamType){case l.H264_STREAM_TYPE:case c.H264_STREAM_TYPE:e=t,s="video";break;case l.ADTS_STREAM_TYPE:e=i,s="audio";break;case l.METADATA_STREAM_TYPE:e=n,s="timed-metadata";break;default:return}r.payloadUnitStartIndicator&&a(e,s,!0),e.data.push(r),e.size+=r.data.byteLength},pmt:function(){var t={type:"metadata",tracks:[]},i=r.programMapTable;null!==i.video&&t.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+i.video,codec:"avc",type:"video"}),null!==i.audio&&t.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+i.audio,codec:"adts",type:"audio"}),e.trigger("data",t)}})[r.type]()},this.flush=function(){a(t,"video"),a(i,"audio"),a(n,"timed-metadata"),this.trigger("done")}},s.prototype=new a;var p={PAT_PID:0,MP2T_PACKET_LENGTH:h,TransportPacketStream:n,TransportParseStream:r,ElementaryStream:s,TimestampRolloverStream:u,CaptionStream:o.CaptionStream,Cea608Stream:o.Cea608Stream,MetadataStream:i("9d91")};for(var f in l)l.hasOwnProperty(f)&&(p[f]=l[f]);e.exports=p},"713c":function(e,t,i){"use strict";var n=i("0129"),r=function(e){this.numberOfTracks=0,this.metadataStream=e.metadataStream,this.videoTags=[],this.audioTags=[],this.videoTrack=null,this.audioTrack=null,this.pendingCaptions=[],this.pendingMetadata=[],this.pendingTracks=0,this.processedTracks=0,r.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):("video"===e.track.type&&(this.videoTrack=e.track,this.videoTags=e.tags,this.pendingTracks++),void("audio"===e.track.type&&(this.audioTrack=e.track,this.audioTags=e.tags,this.pendingTracks++)))}};r.prototype=new n,r.prototype.flush=function(e){var t,i,n,r,s={tags:{},captions:[],captionStreams:{},metadata:[]};if(this.pendingTracks<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(0===this.pendingTracks&&(this.processedTracks++,this.processedTracks<this.numberOfTracks))return}if(this.processedTracks+=this.pendingTracks,this.pendingTracks=0,!(this.processedTracks<this.numberOfTracks)){for(this.videoTrack?r=this.videoTrack.timelineStartInfo.pts:this.audioTrack&&(r=this.audioTrack.timelineStartInfo.pts),s.tags.videoTags=this.videoTags,s.tags.audioTags=this.audioTags,n=0;n<this.pendingCaptions.length;n++)i=this.pendingCaptions[n],i.startTime=i.startPts-r,i.startTime/=9e4,i.endTime=i.endPts-r,i.endTime/=9e4,s.captionStreams[i.stream]=!0,s.captions.push(i);for(n=0;n<this.pendingMetadata.length;n++)t=this.pendingMetadata[n],t.cueTime=t.pts-r,t.cueTime/=9e4,s.metadata.push(t);s.metadata.dispatchType=this.metadataStream.dispatchType,this.videoTrack=null,this.audioTrack=null,this.videoTags=[],this.audioTags=[],this.pendingCaptions.length=0,this.pendingMetadata.length=0,this.pendingTracks=0,this.processedTracks=0,this.trigger("data",s),this.trigger("done")}},e.exports=r},"769d":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=i("9fd3"),s=a(r);function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function u(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var c=function(e){function t(){o(this,t);var e=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.buffer="",e}return u(t,e),n(t,[{key:"push",value:function(e){var t=void 0;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}]),t}(s["default"]);t["default"]=c},"78d8":function(e,t,i){var n=arguments[3],r=arguments[4],s=arguments[5],a=JSON.stringify,o=!1,l=function(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=entryModule)};"undefined"===typeof n&&(o=!0,n=l,r=i.m);var u=function(e){for(var t,i=Object.keys(s),o=0;o<i.length;o++){var l=i[o],u=s[l].exports;if(u===e||u&&u.default===e){t=l;break}}if(!t){t=Math.floor(Math.pow(16,8)*Math.random()).toString(16);var c={};for(o=0;o<i.length;o++){l=i[o];c[l]=l}r[t]=["function(require,module,exports){"+e+"(self); }",c]}var h=Math.floor(Math.pow(16,8)*Math.random()).toString(16),d={};return d[t]=t,r[h]=["function(require,module,exports){var f = require("+a(t)+");(f.default ? f.default : f)(self);}",d],"("+n+")({"+Object.keys(r).map((function(e){return a(e)+":["+r[e][0]+","+a(r[e][1])+"]"})).join(",")+"},{},["+a(h)+"])"},c=function(e,t){var s,o="string"===typeof t;s=o?{}:[],Object.keys(r).forEach((function(e){r[e]&&(s[e]=r[e].toString())}));var l,u=i(t);if(!u||u!==e&&u.default!==e){var c=s[t];s[t]=c.substring(0,c.length-1)+"\n"+e.name+"();\n}"}if(o){t=a(t);var h=Object.keys(s).map((function(e){return a(e)+":"+s[e]}));l="{"+h.join(",")+"}"}else l="["+s.join(",")+"]";return"var fn = ("+n.toString().replace("entryModule",t)+")("+l+');\n(typeof fn === "function") && fn(self);'};e.exports=function(e,t){var i;i=o?c(e,t):u(e);var n=new Blob([i],{type:"text/javascript"}),r=window.URL||window.webkitURL||window.mozURL||window.msURL,s=r.createObjectURL(n),a=new Worker(s);return a.objectURL=s,a}},"7eb3":function(e,t){var i,n,r,s,a,o,l=9e4;i=function(e){return e*l},n=function(e,t){return e*t},r=function(e){return e/l},s=function(e,t){return e/t},a=function(e,t){return i(s(e,t))},o=function(e,t){return n(r(e),t)},e.exports={secondsToVideoTs:i,secondsToAudioTs:n,videoTsToSeconds:r,audioTsToSeconds:s,audioTsToVideoTs:a,videoTsToAudioTs:o}},"80eb":function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i("be09"),s=n(r),a=i("92b0"),o=n(a),l=i("9f7a"),u=n(l),c=i("12c6"),h=n(c),d=0,p={mode:"auto"};h["default"].mediaSources={};var f=function(e,t){var i=h["default"].mediaSources[e];if(!i)throw new Error("Media Source not found (Video.js)");i.trigger({type:"sourceopen",swfId:t})},m=function(){return!!s["default"].MediaSource&&!!s["default"].MediaSource.isTypeSupported&&s["default"].MediaSource.isTypeSupported('video/mp4;codecs="avc1.4d400d,mp4a.40.2"')},g=function(e){var t=h["default"].mergeOptions(p,e);if(this.MediaSource={open:f,supportsNativeMediaSources:m},"html5"===t.mode||"auto"===t.mode&&m())return new u["default"];if(h["default"].getTech("Flash"))return new o["default"];throw new Error("Cannot use Flash or Html5 to create a MediaSource for this video")};t.MediaSource=g,g.open=f,g.supportsNativeMediaSources=m;var y={createObjectURL:function(e){var t="blob:vjs-media-source/",i=void 0;return e instanceof u["default"]?(i=s["default"].URL.createObjectURL(e.nativeMediaSource_),e.url_=i,i):e instanceof o["default"]?(i=t+d,d++,h["default"].mediaSources[i]=e,i):(i=s["default"].URL.createObjectURL(e),e.url_=i,i)}};t.URL=y,h["default"].MediaSource=g,h["default"].URL=y},"81bc":function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i("e475"),s=n(r),a=i("f24e"),o={FAILURE:2,TIMEOUT:-101,ABORTED:-102};t.REQUEST_ERRORS=o;var l=function(e){var t=void 0,i=void 0;return i=e.offset+e.length-1,t=e.offset,"bytes="+t+"-"+i},u=function(e){var t={};return e.byterange&&(t.Range=l(e.byterange)),t},c=function(e){e.forEach((function(e){e.abort()}))},h=function(e){return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}},d=function(e){var t=e.target,i=Date.now()-t.requestTime,n={bandwidth:1/0,bytesReceived:0,roundTripTime:i||0};return n.bytesReceived=e.loaded,n.bandwidth=Math.floor(n.bytesReceived/n.roundTripTime*8*1e3),n},p=function(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:o.TIMEOUT,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:o.ABORTED,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:o.FAILURE,xhr:t}:null},f=function(e,t){return function(i,n){var r=n.response,s=p(i,n);if(s)return t(s,e);if(16!==r.byteLength)return t({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:o.FAILURE,xhr:n},e);var a=new DataView(r);return e.key.bytes=new Uint32Array([a.getUint32(0),a.getUint32(4),a.getUint32(8),a.getUint32(12)]),t(null,e)}},m=function(e,t){return function(i,n){var r=n.response,s=p(i,n);return s?t(s,e):0===r.byteLength?t({status:n.status,message:"Empty HLS segment content at URL: "+n.uri,code:o.FAILURE,xhr:n},e):(e.map.bytes=new Uint8Array(n.response),t(null,e))}},g=function(e,t){return function(i,n){var r=n.response,s=p(i,n);return s?t(s,e):0===r.byteLength?t({status:n.status,message:"Empty HLS segment content at URL: "+n.uri,code:o.FAILURE,xhr:n},e):(e.stats=h(n),e.key?e.encryptedBytes=new Uint8Array(n.response):e.bytes=new Uint8Array(n.response),t(null,e))}},y=function(e,t,i){var n=function n(r){if(r.data.source===t.requestId){e.removeEventListener("message",n);var s=r.data.decrypted;return t.bytes=new Uint8Array(s.bytes,s.byteOffset,s.byteLength),i(null,t)}};e.addEventListener("message",n),e.postMessage((0,a.createTransferableMessage)({source:t.requestId,encrypted:t.encryptedBytes,key:t.key.bytes,iv:t.key.iv}),[t.encryptedBytes.buffer,t.key.bytes.buffer])},v=function(e){return e.reduce((function(e,t){return t.code>e.code?t:e}))},_=function(e,t,i){var n=[],r=0;return function(s,a){if(s&&(c(e),n.push(s)),r+=1,r===e.length){if(a.endOfAllRequests=Date.now(),n.length>0){var o=v(n);return i(o,a)}return a.encryptedBytes?y(t,a,i):i(null,a)}}},b=function(e,t){return function(i){return e.stats=s["default"].mergeOptions(e.stats,d(i)),!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived&&(e.stats.firstBytesReceivedAt=Date.now()),t(i,e)}},T=function(e,t,i,n,r,a){var o=[],l=_(o,i,a);if(n.key){var h=s["default"].mergeOptions(t,{uri:n.key.resolvedUri,responseType:"arraybuffer"}),d=f(n,l),p=e(h,d);o.push(p)}if(n.map&&!n.map.bytes){var y=s["default"].mergeOptions(t,{uri:n.map.resolvedUri,responseType:"arraybuffer",headers:u(n.map)}),v=m(n,l),T=e(y,v);o.push(T)}var S=s["default"].mergeOptions(t,{uri:n.resolvedUri,responseType:"arraybuffer",headers:u(n)}),k=g(n,l),E=e(S,k);return E.addEventListener("progress",b(n,r)),o.push(E),function(){return c(o)}};t.mediaSegmentRequest=T},"81c0":function(e,t,i){var n=i("a968").getUint64,r=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},r=12;0===i.version?(i.earliestPresentationTime=t.getUint32(r),i.firstOffset=t.getUint32(r+4),r+=8):(i.earliestPresentationTime=n(e.subarray(r)),i.firstOffset=n(e.subarray(r+8)),r+=16),r+=2;var s=t.getUint16(r);for(r+=2;s>0;r+=12,s--)i.references.push({referenceType:(128&e[r])>>>7,referencedSize:2147483647&t.getUint32(r),subsegmentDuration:t.getUint32(r+4),startsWithSap:!!(128&e[r+8]),sapType:(112&e[r+8])>>>4,sapDeltaTime:268435455&t.getUint32(r+8)});return i};e.exports=r},8352:function(e,t,i){var n=i("be09"),r=e.exports={WebVTT:i("14b8"),VTTCue:i("6d67"),VTTRegion:i("1283")};n.vttjs=r,n.WebVTT=r.WebVTT;var s=r.VTTCue,a=r.VTTRegion,o=n.VTTCue,l=n.VTTRegion;r.shim=function(){n.VTTCue=s,n.VTTRegion=a},r.restore=function(){n.VTTCue=o,n.VTTRegion=l},n.VTTCue||r.shim()},8362:function(e,t){e.exports=n;var i=Object.prototype.toString;function n(e){if(!e)return!1;var t=i.call(e);return"[object Function]"===t||"function"===typeof e&&"[object RegExp]"!==t||"undefined"!==typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}},8484:function(e,t,i){"use strict";i.d(t,"a",(function(){return w})),i.d(t,"b",(function(){return M})),i.d(t,"c",(function(){return Ae})),i.d(t,"d",(function(){return Ie}));var n=i("63ec"),r=i("be09"),s=i.n(r),a=function(e,t,i){t.forEach((function(t){for(var n in e.mediaGroups[t])for(var r in e.mediaGroups[t][n]){var s=e.mediaGroups[t][n][r];i(s,t,n,r)}}))},o=i("ffdf"),l=i("210b");const u=e=>!!e&&"object"===typeof e,c=(...e)=>e.reduce((e,t)=>("object"!==typeof t||Object.keys(t).forEach(i=>{Array.isArray(e[i])&&Array.isArray(t[i])?e[i]=e[i].concat(t[i]):u(e[i])&&u(t[i])?e[i]=c(e[i],t[i]):e[i]=t[i]}),e),{}),h=e=>Object.keys(e).map(t=>e[t]),d=(e,t)=>{const i=[];for(let n=e;n<t;n++)i.push(n);return i},p=e=>e.reduce((e,t)=>e.concat(t),[]),f=e=>{if(!e.length)return[];const t=[];for(let i=0;i<e.length;i++)t.push(e[i]);return t},m=(e,t)=>e.reduce((e,i,n)=>(i[t]&&e.push(n),e),[]),g=(e,t)=>h(e.reduce((e,i)=>(i.forEach(i=>{e[t(i)]=i}),e),{}));var y={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 v=({baseUrl:e="",source:t="",range:i="",indexRange:r=""})=>{const a={uri:t,resolvedUri:Object(n["a"])(e||"",t)};if(i||r){const e=i||r,t=e.split("-");let n,o=s.a.BigInt?s.a.BigInt(t[0]):parseInt(t[0],10),l=s.a.BigInt?s.a.BigInt(t[1]):parseInt(t[1],10);o<Number.MAX_SAFE_INTEGER&&"bigint"===typeof o&&(o=Number(o)),l<Number.MAX_SAFE_INTEGER&&"bigint"===typeof l&&(l=Number(l)),n="bigint"===typeof l||"bigint"===typeof o?s.a.BigInt(l)-s.a.BigInt(o)+s.a.BigInt(1):l-o+1,"bigint"===typeof n&&n<Number.MAX_SAFE_INTEGER&&(n=Number(n)),a.byterange={length:n,offset:o}}return a},_=e=>{let t;return t="bigint"===typeof e.offset||"bigint"===typeof e.length?s.a.BigInt(e.offset)+s.a.BigInt(e.length)-s.a.BigInt(1):e.offset+e.length-1,`${e.offset}-${t}`},b=e=>(e&&"number"!==typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e),T={static(e){const{duration:t,timescale:i=1,sourceDuration:n,periodDuration:r}=e,s=b(e.endNumber),a=t/i;return"number"===typeof s?{start:0,end:s}:"number"===typeof r?{start:0,end:r/a}:{start:0,end:n/a}},dynamic(e){const{NOW:t,clientOffset:i,availabilityStartTime:n,timescale:r=1,duration:s,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:l=1/0}=e,u=b(e.endNumber),c=(t+i)/1e3,h=n+a,d=c+o,p=d-h,f=Math.ceil(p*r/s),m=Math.floor((c-h-l)*r/s),g=Math.floor((c-h)*r/s);return{start:Math.max(0,m),end:"number"===typeof u?u:Math.min(f,g)}}},S=e=>t=>{const{duration:i,timescale:n=1,periodStart:r,startNumber:s=1}=e;return{number:s+t,duration:i/n,timeline:r,time:t*i}},k=e=>{const{type:t,duration:i,timescale:n=1,periodDuration:r,sourceDuration:s}=e,{start:a,end:o}=T[t](e),l=d(a,o).map(S(e));if("static"===t){const e=l.length-1,t="number"===typeof r?r:s;l[e].duration=t-i/n*e}return l},E=e=>{const{baseUrl:t,initialization:i={},sourceDuration:n,indexRange:r="",periodStart:s,presentationTime:a,number:o=0,duration:l}=e;if(!t)throw new Error(y.NO_BASE_URL);const u=v({baseUrl:t,source:i.sourceURL,range:i.range}),c=v({baseUrl:t,source:t,indexRange:r});if(c.map=u,l){const t=k(e);t.length&&(c.duration=t[0].duration,c.timeline=t[0].timeline)}else n&&(c.duration=n,c.timeline=s);return c.presentationTime=a||s,c.number=o,[c]},w=(e,t,i)=>{const n=e.sidx.map?e.sidx.map:null,r=e.sidx.duration,a=e.timeline||0,o=e.sidx.byterange,l=o.offset+o.length,u=t.timescale,c=t.references.filter(e=>1!==e.referenceType),h=[],d=e.endList?"static":"dynamic",p=e.sidx.timeline;let f,m=p,g=e.mediaSequence||0;f="bigint"===typeof t.firstOffset?s.a.BigInt(l)+t.firstOffset:l+t.firstOffset;for(let y=0;y<c.length;y++){const e=t.references[y],o=e.referencedSize,l=e.subsegmentDuration;let c;c="bigint"===typeof f?f+s.a.BigInt(o)-s.a.BigInt(1):f+o-1;const v=`${f}-${c}`,_={baseUrl:i,timescale:u,timeline:a,periodStart:p,presentationTime:m,number:g,duration:l,sourceDuration:r,indexRange:v,type:d},b=E(_)[0];n&&(b.map=n),h.push(b),f+="bigint"===typeof f?s.a.BigInt(o):o,m+=l/u,g++}return e.segments=h,e},C=["AUDIO","SUBTITLES"],x=1/60,A=e=>g(e,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),I=(e,t)=>{for(let i=0;i<e.length;i++)if(e[i].attributes.NAME===t)return e[i];return null},O=e=>{let t=[];return a(e,C,(e,i,n,r)=>{t=t.concat(e.playlists||[])}),t},P=({playlist:e,mediaSequence:t})=>{e.mediaSequence=t,e.segments.forEach((t,i)=>{t.number=e.mediaSequence+i})},L=({oldPlaylists:e,newPlaylists:t,timelineStarts:i})=>{t.forEach(t=>{t.discontinuitySequence=i.findIndex((function({timeline:e}){return e===t.timeline}));const n=I(e,t.attributes.NAME);if(!n)return;if(t.sidx)return;const r=t.segments[0],s=n.segments.findIndex((function(e){return Math.abs(e.presentationTime-r.presentationTime)<x}));if(-1===s)return P({playlist:t,mediaSequence:n.mediaSequence+n.segments.length}),t.segments[0].discontinuity=!0,t.discontinuityStarts.unshift(0),void((!n.segments.length&&t.timeline>n.timeline||n.segments.length&&t.timeline>n.segments[n.segments.length-1].timeline)&&t.discontinuitySequence--);const a=n.segments[s];a.discontinuity&&!r.discontinuity&&(r.discontinuity=!0,t.discontinuityStarts.unshift(0),t.discontinuitySequence--),P({playlist:t,mediaSequence:n.segments[s].number})})},D=({oldManifest:e,newManifest:t})=>{const i=e.playlists.concat(O(e)),n=t.playlists.concat(O(t));return t.timelineStarts=A([e.timelineStarts,t.timelineStarts]),L({oldPlaylists:i,newPlaylists:n,timelineStarts:t.timelineStarts}),t},M=e=>e&&e.uri+"-"+_(e.byterange),R=e=>{const t=e.reduce((function(e,t){return e[t.attributes.baseUrl]||(e[t.attributes.baseUrl]=[]),e[t.attributes.baseUrl].push(t),e}),{});let i=[];return Object.values(t).forEach(e=>{const t=h(e.reduce((e,t)=>{const i=t.attributes.id+(t.attributes.lang||"");return e[i]?(t.segments&&(t.segments[0]&&(t.segments[0].discontinuity=!0),e[i].segments.push(...t.segments)),t.attributes.contentProtection&&(e[i].attributes.contentProtection=t.attributes.contentProtection)):(e[i]=t,e[i].attributes.timelineStarts=[]),e[i].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart}),e},{}));i=i.concat(t)}),i.map(e=>(e.discontinuityStarts=m(e.segments||[],"discontinuity"),e))},N=(e,t)=>{const i=M(e.sidx),n=i&&t[i]&&t[i].sidx;return n&&w(e,n,e.sidx.resolvedUri),e},j=(e,t={})=>{if(!Object.keys(t).length)return e;for(const i in e)e[i]=N(e[i],t);return e},B=({attributes:e,segments:t,sidx:i,mediaSequence:n,discontinuitySequence:r,discontinuityStarts:s},a)=>{const o={attributes:{NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs,["PROGRAM-ID"]:1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuitySequence:r,discontinuityStarts:s,timelineStarts:e.timelineStarts,mediaSequence:n,segments:t};return e.contentProtection&&(o.contentProtection=e.contentProtection),e.serviceLocation&&(o.attributes.serviceLocation=e.serviceLocation),i&&(o.sidx=i),a&&(o.attributes.AUDIO="audio",o.attributes.SUBTITLES="subs"),o},U=({attributes:e,segments:t,mediaSequence:i,discontinuityStarts:n,discontinuitySequence:r})=>{"undefined"===typeof t&&(t=[{uri:e.baseUrl,timeline:e.periodStart,resolvedUri:e.baseUrl||"",duration:e.sourceDuration,number:0}],e.duration=e.sourceDuration);const s={NAME:e.id,BANDWIDTH:e.bandwidth,["PROGRAM-ID"]:1};e.codecs&&(s.CODECS=e.codecs);const a={attributes:s,uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,timelineStarts:e.timelineStarts,discontinuityStarts:n,discontinuitySequence:r,mediaSequence:i,segments:t};return e.serviceLocation&&(a.attributes.serviceLocation=e.serviceLocation),a},F=(e,t={},i=!1)=>{let n;const r=e.reduce((e,r)=>{const s=r.attributes.role&&r.attributes.role.value||"",a=r.attributes.lang||"";let o=r.attributes.label||"main";if(a&&!r.attributes.label){const e=s?` (${s})`:"";o=`${r.attributes.lang}${e}`}e[o]||(e[o]={language:a,autoselect:!0,default:"main"===s,playlists:[],uri:""});const l=N(B(r,i),t);return e[o].playlists.push(l),"undefined"===typeof n&&"main"===s&&(n=r,n.default=!0),e},{});if(!n){const e=Object.keys(r)[0];r[e].default=!0}return r},q=(e,t={})=>e.reduce((e,i)=>{const n=i.attributes.label||i.attributes.lang||"text";return e[n]||(e[n]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),e[n].playlists.push(N(U(i),t)),e},{}),H=e=>e.reduce((e,t)=>t?(t.forEach(t=>{const{channel:i,language:n}=t;e[n]={autoselect:!1,default:!1,instreamId:i,language:n},t.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[n].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[n]["3D"]=t["3D"])}),e):e,{}),V=({attributes:e,segments:t,sidx:i,discontinuityStarts:n})=>{const r={attributes:{NAME:e.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:e.width,height:e.height},CODECS:e.codecs,BANDWIDTH:e.bandwidth,["PROGRAM-ID"]:1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuityStarts:n,timelineStarts:e.timelineStarts,segments:t};return e.frameRate&&(r.attributes["FRAME-RATE"]=e.frameRate),e.contentProtection&&(r.contentProtection=e.contentProtection),e.serviceLocation&&(r.attributes.serviceLocation=e.serviceLocation),i&&(r.sidx=i),r},z=({attributes:e})=>"video/mp4"===e.mimeType||"video/webm"===e.mimeType||"video"===e.contentType,W=({attributes:e})=>"audio/mp4"===e.mimeType||"audio/webm"===e.mimeType||"audio"===e.contentType,$=({attributes:e})=>"text/vtt"===e.mimeType||"text"===e.contentType,G=(e,t)=>{e.forEach(e=>{e.mediaSequence=0,e.discontinuitySequence=t.findIndex((function({timeline:t}){return t===e.timeline})),e.segments&&e.segments.forEach((e,t)=>{e.number=t})})},X=e=>e?Object.keys(e).reduce((t,i)=>{const n=e[i];return t.concat(n.playlists)},[]):[],K=({dashPlaylists:e,locations:t,contentSteering:i,sidxMapping:n={},previousManifest:r,eventStream:s})=>{if(!e.length)return{};const{sourceDuration:a,type:o,suggestedPresentationDelay:l,minimumUpdatePeriod:u}=e[0].attributes,c=R(e.filter(z)).map(V),h=R(e.filter(W)),d=R(e.filter($)),p=e.map(e=>e.attributes.captionServices).filter(Boolean),f={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},["CLOSED-CAPTIONS"]:{},SUBTITLES:{}},uri:"",duration:a,playlists:j(c,n)};u>=0&&(f.minimumUpdatePeriod=1e3*u),t&&(f.locations=t),i&&(f.contentSteering=i),"dynamic"===o&&(f.suggestedPresentationDelay=l),s&&s.length>0&&(f.eventStream=s);const m=0===f.playlists.length,g=h.length?F(h,n,m):null,y=d.length?q(d,n):null,v=c.concat(X(g),X(y)),_=v.map(({timelineStarts:e})=>e);return f.timelineStarts=A(_),G(v,f.timelineStarts),g&&(f.mediaGroups.AUDIO.audio=g),y&&(f.mediaGroups.SUBTITLES.subs=y),p.length&&(f.mediaGroups["CLOSED-CAPTIONS"].cc=H(p)),r?D({oldManifest:r,newManifest:f}):f},Y=(e,t,i)=>{const{NOW:n,clientOffset:r,availabilityStartTime:s,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:l=0}=e,u=(n+r)/1e3,c=s+o,h=u+l,d=h-c;return Math.ceil((d*a-t)/i)},Q=(e,t)=>{const{type:i,minimumUpdatePeriod:n=0,media:r="",sourceDuration:s,timescale:a=1,startNumber:o=1,periodStart:l}=e,u=[];let c=-1;for(let h=0;h<t.length;h++){const d=t[h],p=d.d,f=d.r||0,m=d.t||0;let g;if(c<0&&(c=m),m&&m>c&&(c=m),f<0){const o=h+1;g=o===t.length?"dynamic"===i&&n>0&&r.indexOf("$Number$")>0?Y(e,c,p):(s*a-c)/p:(t[o].t-c)/p}else g=f+1;const y=o+u.length+g;let v=o+u.length;while(v<y)u.push({number:v,duration:p/a,time:c,timeline:l}),c+=p,v++}return u},J=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,Z=e=>(t,i,n,r)=>{if("$$"===t)return"$";if("undefined"===typeof e[i])return t;const s=""+e[i];return"RepresentationID"===i?s:(r=n?parseInt(r,10):1,s.length>=r?s:`${new Array(r-s.length+1).join("0")}${s}`)},ee=(e,t)=>e.replace(J,Z(t)),te=(e,t)=>e.duration||t?e.duration?k(e):Q(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}],ie=(e,t)=>{const i={RepresentationID:e.id,Bandwidth:e.bandwidth||0},{initialization:r={sourceURL:"",range:""}}=e,s=v({baseUrl:e.baseUrl,source:ee(r.sourceURL,i),range:r.range}),a=te(e,t);return a.map(t=>{i.Number=t.number,i.Time=t.time;const r=ee(e.media||"",i),a=e.timescale||1,o=e.presentationTimeOffset||0,l=e.periodStart+(t.time-o)/a,u={uri:r,timeline:t.timeline,duration:t.duration,resolvedUri:Object(n["a"])(e.baseUrl||"",r),map:s,number:t.number,presentationTime:l};return u})},ne=(e,t)=>{const{baseUrl:i,initialization:n={}}=e,r=v({baseUrl:i,source:n.sourceURL,range:n.range}),s=v({baseUrl:i,source:t.media,range:t.mediaRange});return s.map=r,s},re=(e,t)=>{const{duration:i,segmentUrls:n=[],periodStart:r}=e;if(!i&&!t||i&&t)throw new Error(y.SEGMENT_TIME_UNSPECIFIED);const s=n.map(t=>ne(e,t));let a;i&&(a=k(e)),t&&(a=Q(e,t));const o=a.map((t,i)=>{if(s[i]){const n=s[i],a=e.timescale||1,o=e.presentationTimeOffset||0;return n.timeline=t.timeline,n.duration=t.duration,n.number=t.number,n.presentationTime=r+(t.time-o)/a,n}}).filter(e=>e);return o},se=({attributes:e,segmentInfo:t})=>{let i,n;t.template?(n=ie,i=c(e,t.template)):t.base?(n=E,i=c(e,t.base)):t.list&&(n=re,i=c(e,t.list));const r={attributes:e};if(!n)return r;const s=n(i,t.segmentTimeline);if(i.duration){const{duration:e,timescale:t=1}=i;i.duration=e/t}else s.length?i.duration=s.reduce((e,t)=>Math.max(e,Math.ceil(t.duration)),0):i.duration=0;return r.attributes=i,r.segments=s,t.base&&i.indexRange&&(r.sidx=s[0],r.segments=[]),r},ae=e=>e.map(se),oe=(e,t)=>f(e.childNodes).filter(({tagName:e})=>e===t),le=e=>e.textContent.trim(),ue=e=>parseFloat(e.split("/").reduce((e,t)=>e/t)),ce=e=>{const t=31536e3,i=2592e3,n=86400,r=3600,s=60,a=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/,o=a.exec(e);if(!o)return 0;const[l,u,c,h,d,p]=o.slice(1);return parseFloat(l||0)*t+parseFloat(u||0)*i+parseFloat(c||0)*n+parseFloat(h||0)*r+parseFloat(d||0)*s+parseFloat(p||0)},he=e=>{const t=/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/;return t.test(e)&&(e+="Z"),Date.parse(e)},de={mediaPresentationDuration(e){return ce(e)},availabilityStartTime(e){return he(e)/1e3},minimumUpdatePeriod(e){return ce(e)},suggestedPresentationDelay(e){return ce(e)},type(e){return e},timeShiftBufferDepth(e){return ce(e)},start(e){return ce(e)},width(e){return parseInt(e,10)},height(e){return parseInt(e,10)},bandwidth(e){return parseInt(e,10)},frameRate(e){return ue(e)},startNumber(e){return parseInt(e,10)},timescale(e){return parseInt(e,10)},presentationTimeOffset(e){return parseInt(e,10)},duration(e){const t=parseInt(e,10);return isNaN(t)?ce(e):t},d(e){return parseInt(e,10)},t(e){return parseInt(e,10)},r(e){return parseInt(e,10)},presentationTime(e){return parseInt(e,10)},DEFAULT(e){return e}},pe=e=>e&&e.attributes?f(e.attributes).reduce((e,t)=>{const i=de[t.name]||de.DEFAULT;return e[t.name]=i(t.value),e},{}):{},fe={"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"},me=(e,t)=>t.length?p(e.map((function(e){return t.map((function(t){const i=le(t),r=Object(n["a"])(e.baseUrl,i),s=c(pe(t),{baseUrl:r});return r!==i&&!s.serviceLocation&&e.serviceLocation&&(s.serviceLocation=e.serviceLocation),s}))}))):e,ge=e=>{const t=oe(e,"SegmentTemplate")[0],i=oe(e,"SegmentList")[0],n=i&&oe(i,"SegmentURL").map(e=>c({tag:"SegmentURL"},pe(e))),r=oe(e,"SegmentBase")[0],s=i||t,a=s&&oe(s,"SegmentTimeline")[0],o=i||r||t,l=o&&oe(o,"Initialization")[0],u=t&&pe(t);u&&l?u.initialization=l&&pe(l):u&&u.initialization&&(u.initialization={sourceURL:u.initialization});const h={template:u,segmentTimeline:a&&oe(a,"S").map(e=>pe(e)),list:i&&c(pe(i),{segmentUrls:n,initialization:pe(l)}),base:r&&c(pe(r),{initialization:pe(l)})};return Object.keys(h).forEach(e=>{h[e]||delete h[e]}),h},ye=(e,t,i)=>n=>{const r=oe(n,"BaseURL"),s=me(t,r),a=c(e,pe(n)),o=ge(n);return s.map(e=>({segmentInfo:c(i,o),attributes:c(a,e)}))},ve=e=>e.reduce((e,t)=>{const i=pe(t);i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase());const n=fe[i.schemeIdUri];if(n){e[n]={attributes:i};const r=oe(t,"cenc:pssh")[0];if(r){const t=le(r);e[n].pssh=t&&Object(o["a"])(t)}}return e},{}),_e=e=>{if("urn:scte:dash:cc:cea-608:2015"===e.schemeIdUri){const t="string"!==typeof e.value?[]:e.value.split(";");return t.map(e=>{let t,i;return i=e,/^CC\d=/.test(e)?[t,i]=e.split("="):/^CC\d$/.test(e)&&(t=e),{channel:t,language:i}})}if("urn:scte:dash:cc:cea-708:2015"===e.schemeIdUri){const t="string"!==typeof e.value?[]:e.value.split(";");return t.map(e=>{const t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){const[i,n=""]=e.split("=");t.channel=i,t.language=e,n.split(",").forEach(e=>{const[i,n]=e.split(":");"lang"===i?t.language=n:"er"===i?t.easyReader=Number(n):"war"===i?t.aspectRatio=Number(n):"3D"===i&&(t["3D"]=Number(n))})}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t})}},be=e=>p(oe(e.node,"EventStream").map(t=>{const i=pe(t),n=i.schemeIdUri;return oe(t,"Event").map(t=>{const r=pe(t),s=r.presentationTime||0,a=i.timescale||1,o=r.duration||0,l=s/a+e.attributes.start;return{schemeIdUri:n,value:i.value,id:r.id,start:l,end:l+o/a,messageData:le(t)||r.messageData,contentEncoding:i.contentEncoding,presentationTimeOffset:i.presentationTimeOffset||0}})})),Te=(e,t,i)=>n=>{const r=pe(n),s=me(t,oe(n,"BaseURL")),a=oe(n,"Role")[0],o={role:pe(a)};let l=c(e,r,o);const u=oe(n,"Accessibility")[0],h=_e(pe(u));h&&(l=c(l,{captionServices:h}));const d=oe(n,"Label")[0];if(d&&d.childNodes.length){const e=d.childNodes[0].nodeValue.trim();l=c(l,{label:e})}const f=ve(oe(n,"ContentProtection"));Object.keys(f).length&&(l=c(l,{contentProtection:f}));const m=ge(n),g=oe(n,"Representation"),y=c(i,m);return p(g.map(ye(l,s,y)))},Se=(e,t)=>(i,n)=>{const r=me(t,oe(i.node,"BaseURL")),s=c(e,{periodStart:i.attributes.start});"number"===typeof i.attributes.duration&&(s.periodDuration=i.attributes.duration);const a=oe(i.node,"AdaptationSet"),o=ge(i.node);return p(a.map(Te(s,r,o)))},ke=(e,t)=>{if(e.length>1&&t({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!e.length)return null;const i=c({serverURL:le(e[0])},pe(e[0]));return i.queryBeforeStart="true"===i.queryBeforeStart,i},Ee=({attributes:e,priorPeriodAttributes:t,mpdType:i})=>"number"===typeof e.start?e.start:t&&"number"===typeof t.start&&"number"===typeof t.duration?t.start+t.duration:t||"static"!==i?null:0,we=(e,t={})=>{const{manifestUri:i="",NOW:n=Date.now(),clientOffset:r=0,eventHandler:s=function(){}}=t,a=oe(e,"Period");if(!a.length)throw new Error(y.INVALID_NUMBER_OF_PERIOD);const o=oe(e,"Location"),l=pe(e),u=me([{baseUrl:i}],oe(e,"BaseURL")),c=oe(e,"ContentSteering");l.type=l.type||"static",l.sourceDuration=l.mediaPresentationDuration||0,l.NOW=n,l.clientOffset=r,o.length&&(l.locations=o.map(le));const h=[];return a.forEach((e,t)=>{const i=pe(e),n=h[t-1];i.start=Ee({attributes:i,priorPeriodAttributes:n?n.attributes:null,mpdType:l.type}),h.push({node:e,attributes:i})}),{locations:l.locations,contentSteeringInfo:ke(c,s),representationInfo:p(h.map(Se(l,u))),eventStream:p(h.map(be))}},Ce=e=>{if(""===e)throw new Error(y.DASH_EMPTY_MANIFEST);const t=new l["DOMParser"];let i,n;try{i=t.parseFromString(e,"application/xml"),n=i&&"MPD"===i.documentElement.tagName?i.documentElement:null}catch(r){}if(!n||n&&n.getElementsByTagName("parsererror").length>0)throw new Error(y.DASH_INVALID_XML);return n},xe=e=>{const t=oe(e,"UTCTiming")[0];if(!t)return null;const i=pe(t);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.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":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT",i.value=Date.parse(i.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(y.UNSUPPORTED_UTC_TIMING_SCHEME)}return i},Ae=(e,t={})=>{const i=we(Ce(e),t),n=ae(i.representationInfo);return K({dashPlaylists:n,locations:i.locations,contentSteering:i.contentSteeringInfo,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest,eventStream:i.eventStream})},Ie=e=>xe(Ce(e))},"89a7":function(e,t,i){"use strict";function n(e,t,i){if(void 0===i&&(i=Array.prototype),e&&"function"===typeof i.find)return i.find.call(e,t);for(var n=0;n<e.length;n++)if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];if(t.call(void 0,r,n,e))return r}}function r(e,t){return void 0===t&&(t=Object),t&&"function"===typeof t.freeze?t.freeze(e):e}function s(e,t){if(null===e||"object"!==typeof e)throw new TypeError("target is not an object");for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}var a=r({HTML:"text/html",isHTML:function(e){return e===a.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),o=r({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===o.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});t.assign=s,t.find=n,t.freeze=r,t.MIME_TYPE=a,t.NAMESPACE=o},"8b53":function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));var n=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,r=/^application\/dash\+xml/i,s=function(e){return n.test(e)?"hls":r.test(e)?"dash":"application/vnd.videojs.vhs+json"===e?"vhs-json":null}},"8c00":function(e,t,i){"use strict";var n=i("be09"),r=function(e,t){return void 0===t&&(t=!1),function(i,r,a){if(i)e(i);else if(r.statusCode>=400&&r.statusCode<=599){var o=a;if(t)if(n.TextDecoder){var l=s(r.headers&&r.headers["content-type"]);try{o=new TextDecoder(l).decode(a)}catch(u){}}else o=String.fromCharCode.apply(null,new Uint8Array(a));e({cause:o})}else e(null,a)}};function s(e){return void 0===e&&(e=""),e.toLowerCase().split(";").reduce((function(e,t){var i=t.split("="),n=i[0],r=i[1];return"charset"===n.trim()?r.trim():e}),"utf-8")}e.exports=r},"8c10":function(e,t){function i(e,t){var i,n=null;try{i=JSON.parse(e,t)}catch(r){n=r}return[n,i]}e.exports=i},"8c57":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=function(e,t,i){var n=!0;while(n){var r=e,s=t,a=i;n=!1,null===r&&(r=Function.prototype);var o=Object.getOwnPropertyDescriptor(r,s);if(void 0!==o){if("value"in o)return o.value;var l=o.get;if(void 0===l)return;return l.call(a)}var u=Object.getPrototypeOf(r);if(null===u)return;e=u,t=s,i=a,n=!0,o=u=void 0}};function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=i("6be2"),u=s(l),c=i("e475"),h=i("19b3"),d=s(h),p=i("be09"),f=s(p),m=function(e,t,i){var n=t.slice();i=i||0;for(var r=Math.min(e.length,t.length+i),s=i;s<r;s++)n[s-i]=(0,c.mergeOptions)(e[s],n[s-i]);return n};t.updateSegments=m;var g=function(e,t){e.resolvedUri||(e.resolvedUri=(0,u["default"])(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=(0,u["default"])(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=(0,u["default"])(t,e.map.uri))};t.resolveSegmentUris=g;var y=function(e,t){var i=(0,c.mergeOptions)(e,{}),n=i.playlists.filter((function(e){return e.uri===t.uri}))[0];if(!n)return null;if(n.segments&&t.segments&&n.segments.length===t.segments.length&&n.mediaSequence===t.mediaSequence)return null;var r=(0,c.mergeOptions)(n,t);n.segments&&(r.segments=m(n.segments,t.segments,t.mediaSequence-n.mediaSequence)),r.segments.forEach((function(e){g(e,r.resolvedUri)}));for(var s=0;s<i.playlists.length;s++)i.playlists[s].uri===t.uri&&(i.playlists[s]=r);return i.playlists[t.uri]=r,i};t.updateMaster=y;var v=function(e){var t=e.playlists.length;while(t--){var i=e.playlists[t];e.playlists[i.uri]=i,i.resolvedUri=(0,u["default"])(e.uri,i.uri),i.attributes||(i.attributes={},c.log.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute."))}};t.setupMediaPlaylists=v;var _=function(e){["AUDIO","SUBTITLES"].forEach((function(t){for(var i in e.mediaGroups[t])for(var n in e.mediaGroups[t][i]){var r=e.mediaGroups[t][i][n];r.uri&&(r.resolvedUri=(0,u["default"])(e.uri,r.uri))}}))};t.resolveMediaGroupUris=_;var b=function(e,t){var i=e.segments[e.segments.length-1],n=void 0;return n=t&&i&&i.duration?1e3*i.duration:500*(e.targetDuration||10),n};t.refreshDelay=b;var T=function(e){function t(e,i,n){var s=this;if(a(this,t),r(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),n=n||{},this.srcUrl=e,this.hls_=i,this.withCredentials=!!n.withCredentials,this.handleManifestRedirects=!!n.handleManifestRedirects,!this.srcUrl)throw new Error("A non-empty playlist URL is required");this.state="HAVE_NOTHING",this.on("mediaupdatetimeout",(function(){"HAVE_METADATA"===s.state&&(s.state="HAVE_CURRENT_METADATA",s.request=s.hls_.xhr({uri:(0,u["default"])(s.master.uri,s.media().uri),withCredentials:s.withCredentials},(function(e,t){if(s.request)return e?s.playlistRequestError(s.request,s.media().uri,"HAVE_METADATA"):void s.haveMetadata(s.request,s.media().uri)})))}))}return o(t,e),n(t,[{key:"playlistRequestError",value:function(e,t,i){this.request=null,i&&(this.state=i),this.error={playlist:this.master.playlists[t],status:e.status,message:"HLS playlist request error at URL: "+t,responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")}},{key:"haveMetadata",value:function(e,t){var i=this;this.request=null,this.state="HAVE_METADATA";var n=new d["default"].Parser;n.push(e.responseText),n.end(),n.manifest.uri=t,n.manifest.attributes=n.manifest.attributes||{};var r=y(this.master,n.manifest);this.targetDuration=n.manifest.targetDuration,r?(this.master=r,this.media_=this.master.playlists[n.manifest.uri]):this.trigger("playlistunchanged"),this.media().endList||(f["default"].clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=f["default"].setTimeout((function(){i.trigger("mediaupdatetimeout")}),b(this.media(),!!r))),this.trigger("loadedplaylist")}},{key:"dispose",value:function(){this.stopRequest(),f["default"].clearTimeout(this.mediaUpdateTimeout)}},{key:"stopRequest",value:function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}},{key:"media",value:function(e){var t=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var i=this.state;if("string"===typeof e){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}var n=!this.media_||e.uri!==this.media_.uri;if(this.master.playlists[e.uri].endList)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(n&&(this.trigger("mediachanging"),this.trigger("mediachange")));if(n){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.request=this.hls_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},(function(n,r){if(t.request){if(e.resolvedUri=t.resolveManifestRedirect(e.resolvedUri,r),n)return t.playlistRequestError(t.request,e.uri,i);t.haveMetadata(r,e.uri),"HAVE_MASTER"===i?t.trigger("loadedmetadata"):t.trigger("mediachange")}}))}}},{key:"resolveManifestRedirect",value:function(e,t){return this.handleManifestRedirects&&t.responseURL&&e!==t.responseURL?t.responseURL:e}},{key:"pause",value:function(){this.stopRequest(),f["default"].clearTimeout(this.mediaUpdateTimeout),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")}},{key:"load",value:function(e){var t=this;f["default"].clearTimeout(this.mediaUpdateTimeout);var i=this.media();if(e){var n=i?i.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=f["default"].setTimeout((function(){return t.load()}),n)}else this.started?i&&!i.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}},{key:"start",value:function(){var e=this;this.started=!0,this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},(function(t,i){if(e.request){if(e.request=null,t)return e.error={status:i.status,message:"HLS playlist request error at URL: "+e.srcUrl,responseText:i.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");var n=new d["default"].Parser;return n.push(i.responseText),n.end(),e.state="HAVE_MASTER",e.srcUrl=e.resolveManifestRedirect(e.srcUrl,i),n.manifest.uri=e.srcUrl,n.manifest.playlists?(e.master=n.manifest,v(e.master),_(e.master),e.trigger("loadedplaylist"),void(e.request||e.media(n.manifest.playlists[0]))):(e.master={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:f["default"].location.href,playlists:[{uri:e.srcUrl,resolvedUri:e.srcUrl,attributes:{}}]},e.master.playlists[e.srcUrl]=e.master.playlists[0],e.haveMetadata(i,e.srcUrl),e.trigger("loadedmetadata"))}}))}}]),t}(c.EventTarget);t["default"]=T},"91c5":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=function(e,t,i){var n=!0;while(n){var r=e,s=t,a=i;n=!1,null===r&&(r=Function.prototype);var o=Object.getOwnPropertyDescriptor(r,s);if(void 0!==o){if("value"in o)return o.value;var l=o.get;if(void 0===l)return;return l.call(a)}var u=Object.getPrototypeOf(r);if(null===u)return;e=u,t=s,i=a,n=!0,o=u=void 0}};function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=i("8c57"),u=s(l),c=i("d61a"),h=i("f7fd"),d=s(h),p=i("5496"),f=s(p),m=i("d3ae"),g=s(m),y=i("e475"),v=s(y),_=i("ed4d"),b=s(_),T=i("c7ca"),S=s(T),k=i("0de0"),E=i("78d8"),w=s(E),C=i("a254"),x=s(C),A=i("56c8"),I=s(A),O=i("6066"),P=i("230d"),L=120,D=void 0,M={videoCodec:"avc1",videoObjectTypeIndicator:".4d400d",audioProfile:"2"},R=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred"],N=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},j=function(){var e=void 0;try{e="a254"}catch(t){}return e},B=function(e){return e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e){return(0,k.translateLegacyCodecs)([e])[0]}))};t.mapLegacyAvcCodecs_=B;var U=function(e,t,i){return e+"/"+t+'; codecs="'+i.filter((function(e){return!!e})).join(", ")+'"'},F=function(e){return e.segments&&e.segments.length&&e.segments[0].map?"mp4":"mp2t"},q=function(e){var t=e.attributes||{};return t.CODECS?(0,O.parseCodecs)(t.CODECS):M},H=function(e,t){var i=F(t),n=q(t),r=t.attributes||{},s=!0,a=!1;if(!t)return[];if(e.mediaGroups.AUDIO&&r.AUDIO){var o=e.mediaGroups.AUDIO[r.AUDIO];if(o)for(var l in a=!0,s=!1,o)if(!o[l].uri){s=!0;break}}a&&!n.audioProfile&&(v["default"].log.warn("Multiple audio tracks present but no audio codec string is specified. Attempting to use the default audio codec (mp4a.40.2)"),n.audioProfile=M.audioProfile);var u={};n.videoCodec&&(u.video=""+n.videoCodec+n.videoObjectTypeIndicator),n.audioProfile&&(u.audio="mp4a.40."+n.audioProfile);var c=U("audio",i,[u.audio]),h=U("video",i,[u.video]),d=U("video",i,[u.video,u.audio]);return a?!s&&u.video?[h,c]:[d,c]:u.video?[d]:[c]};t.mimeTypesForPlaylist_=H;var V=function(e){function t(e){var i=this;a(this,t),r(Object.getPrototypeOf(t.prototype),"constructor",this).call(this);var n=e.url,s=e.handleManifestRedirects,o=e.withCredentials,l=e.mode,c=e.tech,h=e.bandwidth,p=e.externHls,m=e.useCueTags,g=e.blacklistDuration,y=e.enableLowInitialPlaylist;if(!n)throw new Error("A non-empty playlist URL is required");D=p,this.tech_=c,this.hls_=c.hls,this.mode_=l,this.useCueTags_=m,this.blacklistDuration=g,this.enableLowInitialPlaylist=y,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:o,handleManifestRedirects:s,timeout:null},this.mediaTypes_=(0,P.createMediaTypes)(),this.mediaSource=new v["default"].MediaSource({mode:l}),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_.bind(this)),this.seekable_=v["default"].createTimeRanges(),this.hasPlayed_=function(){return!1},this.syncController_=new S["default"](e),this.segmentMetadataTrack_=c.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=(0,w["default"])(x["default"],j());var _={hls:this.hls_,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:function(){return i.seekable()},seeking:function(){return i.tech_.seeking()},duration:function(){return i.mediaSource.duration},hasPlayed:function(){return i.hasPlayed_()},goalBufferLength:function(){return i.goalBufferLength()},bandwidth:h,syncController:this.syncController_,decrypter:this.decrypter_};this.masterPlaylistLoader_=new u["default"](n,this.hls_,this.requestOptions_),this.setupMasterPlaylistLoaderListeners_(),this.mainSegmentLoader_=new d["default"](v["default"].mergeOptions(_,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new d["default"](v["default"].mergeOptions(_,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new f["default"](v["default"].mergeOptions(_,{loaderType:"vtt"}),e),this.setupSegmentLoaderListeners_(),R.forEach((function(e){i[e+"_"]=N.bind(i,e)})),this.masterPlaylistLoader_.load()}return o(t,e),n(t,[{key:"setupMasterPlaylistLoaderListeners_",value:function(){var e=this;this.masterPlaylistLoader_.on("loadedmetadata",(function(){var t=e.masterPlaylistLoader_.media(),i=1.5*e.masterPlaylistLoader_.targetDuration*1e3;(0,c.isLowestEnabledRendition)(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=i,t.endList&&"none"!==e.tech_.preload()&&(e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load()),(0,P.setupMediaGroups)({segmentLoaders:{AUDIO:e.audioSegmentLoader_,SUBTITLES:e.subtitleSegmentLoader_,main:e.mainSegmentLoader_},tech:e.tech_,requestOptions:e.requestOptions_,masterPlaylistLoader:e.masterPlaylistLoader_,mode:e.mode_,hls:e.hls_,master:e.master(),mediaTypes:e.mediaTypes_,blacklistCurrentPlaylist:e.blacklistCurrentPlaylist.bind(e)}),e.triggerPresenceUsage_(e.master(),t);try{e.setupSourceBuffers_()}catch(n){return v["default"].log.warn("Failed to create SourceBuffers",n),e.mediaSource.endOfStream("decode")}e.setupFirstPlay(),e.trigger("selectedinitialmedia")})),this.masterPlaylistLoader_.on("loadedplaylist",(function(){var t=e.masterPlaylistLoader_.media();if(!t){var i=void 0;return e.enableLowInitialPlaylist&&(i=e.selectInitialPlaylist()),i||(i=e.selectPlaylist()),e.initialMedia_=i,void e.masterPlaylistLoader_.media(e.initialMedia_)}e.useCueTags_&&e.updateAdCues_(t),e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.updateDuration(),e.tech_.paused()||e.mainSegmentLoader_.load(),t.endList||function(){var t=function(){var t=e.seekable();0!==t.length&&e.mediaSource.addSeekableRange_(t.start(0),t.end(0))};e.duration()!==1/0?function(){var i=function i(){e.duration()===1/0?t():e.tech_.one("durationchange",i)};e.tech_.one("durationchange",i)}():t()}()})),this.masterPlaylistLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.masterPlaylistLoader_.error)})),this.masterPlaylistLoader_.on("mediachanging",(function(){e.mainSegmentLoader_.abort(),e.mainSegmentLoader_.pause()})),this.masterPlaylistLoader_.on("mediachange",(function(){var t=e.masterPlaylistLoader_.media(),i=1.5*e.masterPlaylistLoader_.targetDuration*1e3;(0,c.isLowestEnabledRendition)(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=i,e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load(),e.tech_.trigger({type:"mediachange",bubbles:!0})})),this.masterPlaylistLoader_.on("playlistunchanged",(function(){var t=e.masterPlaylistLoader_.media(),i=e.stuckAtPlaylistEnd_(t);i&&(e.blacklistCurrentPlaylist({message:"Playlist no longer updating."}),e.tech_.trigger("playliststuck"))})),this.masterPlaylistLoader_.on("renditiondisabled",(function(){e.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})})),this.masterPlaylistLoader_.on("renditionenabled",(function(){e.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})}))}},{key:"triggerPresenceUsage_",value:function(e,t){var i=e.mediaGroups||{},n=!0,r=Object.keys(i.AUDIO);for(var s in i.AUDIO)for(var a in i.AUDIO[s]){var o=i.AUDIO[s][a];o.uri||(n=!1)}n&&this.tech_.trigger({type:"usage",name:"hls-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"hls-webvtt"}),D.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"hls-aes"}),D.Playlist.isFmp4(t)&&this.tech_.trigger({type:"usage",name:"hls-fmp4"}),r.length&&Object.keys(i.AUDIO[r[0]]).length>1&&this.tech_.trigger({type:"usage",name:"hls-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"})}},{key:"setupSegmentLoaderListeners_",value:function(){var e=this;this.mainSegmentLoader_.on("bandwidthupdate",(function(){var t=e.selectPlaylist(),i=e.masterPlaylistLoader_.media(),n=e.tech_.buffered(),r=n.length?n.end(n.length-1)-e.tech_.currentTime():0,s=e.bufferLowWaterLine();(!i.endList||e.duration()<I["default"].MAX_BUFFER_LOW_WATER_LINE||t.attributes.BANDWIDTH<i.attributes.BANDWIDTH||r>=s)&&e.masterPlaylistLoader_.media(t),e.tech_.trigger("bandwidthupdate")})),this.mainSegmentLoader_.on("progress",(function(){e.trigger("progress")})),this.mainSegmentLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())})),this.mainSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("timestampoffset",(function(){e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})})),this.audioSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("ended",(function(){e.onEndOfStream()})),this.mainSegmentLoader_.on("earlyabort",(function(){e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},L)})),this.mainSegmentLoader_.on("reseteverything",(function(){e.tech_.trigger("hls-reset")})),this.mainSegmentLoader_.on("segmenttimemapping",(function(t){e.tech_.trigger({type:"hls-segment-time-mapping",mapping:t.mapping})})),this.audioSegmentLoader_.on("ended",(function(){e.onEndOfStream()}))}},{key:"mediaSecondsLoaded_",value:function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}},{key:"load",value:function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}},{key:"fastQualityChange_",value:function(){var e=this.selectPlaylist();e!==this.masterPlaylistLoader_.media()&&(this.masterPlaylistLoader_.media(e),this.mainSegmentLoader_.resetLoader())}},{key:"play",value:function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_()&&this.load();var e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.tech_.setCurrentTime(e.end(e.length-1)):void 0}}},{key:"setupFirstPlay",value:function(){var e=this,t=this.masterPlaylistLoader_.media();if(!t||this.tech_.paused()||this.hasPlayed_())return!1;if(!t.endList){var i=function(){var t=e.seekable();return t.length?v["default"].browser.IE_VERSION&&"html5"===e.mode_&&0===e.tech_.readyState()?(e.tech_.one("loadedmetadata",(function(){e.trigger("firstplay"),e.tech_.setCurrentTime(t.end(0)),e.hasPlayed_=function(){return!0}})),{v:!1}):(e.trigger("firstplay"),void e.tech_.setCurrentTime(t.end(0))):{v:!1}}();if("object"===typeof i)return i.v}return this.hasPlayed_=function(){return!0},this.load(),!0}},{key:"handleSourceOpen_",value:function(){try{this.setupSourceBuffers_()}catch(t){return v["default"].log.warn("Failed to create Source Buffers",t),this.mediaSource.endOfStream("decode")}if(this.tech_.autoplay()){var e=this.tech_.play();"undefined"!==typeof e&&"function"===typeof e.then&&e.then(null,(function(e){}))}this.trigger("sourceopen")}},{key:"onEndOfStream",value:function(){var e=this.mainSegmentLoader_.ended_;this.mediaTypes_.AUDIO.activePlaylistLoader&&(e=e&&this.audioSegmentLoader_.ended_),e&&this.mediaSource.endOfStream()}},{key:"stuckAtPlaylistEnd_",value:function(e){var t=this.seekable();if(!t.length)return!1;var i=this.syncController_.getExpiredTime(e,this.mediaSource.duration);if(null===i)return!1;var n=D.Playlist.playlistEnd(e,i),r=this.tech_.currentTime(),s=this.tech_.buffered();if(!s.length)return n-r<=g["default"].SAFE_TIME_DELTA;var a=s.end(s.length-1);return a-r<=g["default"].SAFE_TIME_DELTA&&n-a<=g["default"].SAFE_TIME_DELTA}},{key:"blacklistCurrentPlaylist",value:function(e,t){void 0===e&&(e={});var i=void 0,n=void 0;if(i=e.playlist||this.masterPlaylistLoader_.media(),t=t||e.blacklistDuration||this.blacklistDuration,!i){this.error=e;try{return this.mediaSource.endOfStream("network")}catch(s){return this.trigger("error")}}var r=1===this.masterPlaylistLoader_.master.playlists.filter(c.isEnabled).length;return r?(v["default"].log.warn("Problem encountered with the current HLS playlist. Trying again since it is the final playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(r)):(i.excludeUntil=Date.now()+1e3*t,this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"}),n=this.selectPlaylist(),v["default"].log.warn("Problem encountered with the current HLS playlist."+(e.message?" "+e.message:"")+" Switching to another playlist."),this.masterPlaylistLoader_.media(n))}},{key:"pauseLoading",value:function(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}},{key:"setCurrentTime",value:function(e){var t=g["default"].findRange(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length&&"flash"!==this.mode_?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0}},{key:"duration",value:function(){return this.masterPlaylistLoader_?this.mediaSource?this.mediaSource.duration:D.Playlist.duration(this.masterPlaylistLoader_.media()):0}},{key:"seekable",value:function(){return this.seekable_}},{key:"onSyncInfoUpdate_",value:function(){var e=void 0,t=void 0;if(this.masterPlaylistLoader_){var i=this.masterPlaylistLoader_.media();if(i){var n=this.syncController_.getExpiredTime(i,this.mediaSource.duration);if(null!==n&&(e=D.Playlist.seekable(i,n),0!==e.length)){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(i=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),n=this.syncController_.getExpiredTime(i,this.mediaSource.duration),null===n)return;if(t=D.Playlist.seekable(i,n),0===t.length)return}t?t.start(0)>e.end(0)||e.start(0)>t.end(0)?this.seekable_=e:this.seekable_=v["default"].createTimeRanges([[t.start(0)>e.start(0)?t.start(0):e.start(0),t.end(0)<e.end(0)?t.end(0):e.end(0)]]):this.seekable_=e,this.tech_.trigger("seekablechanged")}}}}},{key:"updateDuration",value:function(){var e=this,t=this.mediaSource.duration,i=D.Playlist.duration(this.masterPlaylistLoader_.media()),n=this.tech_.buffered(),r=function t(){e.mediaSource.duration=i,e.tech_.trigger("durationchange"),e.mediaSource.removeEventListener("sourceopen",t)};n.length>0&&(i=Math.max(i,n.end(n.length-1))),t!==i&&("open"!==this.mediaSource.readyState?this.mediaSource.addEventListener("sourceopen",r):r())}},{key:"dispose",value:function(){var e=this;this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),["AUDIO","SUBTITLES"].forEach((function(t){var i=e.mediaTypes_[t].groups;for(var n in i)i[n].forEach((function(e){e.playlistLoader&&e.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose()}},{key:"master",value:function(){return this.masterPlaylistLoader_.master}},{key:"media",value:function(){return this.masterPlaylistLoader_.media()||this.initialMedia_}},{key:"setupSourceBuffers_",value:function(){var e=this.masterPlaylistLoader_.media(),t=void 0;if(e&&"open"===this.mediaSource.readyState){if(t=H(this.masterPlaylistLoader_.master,e),t.length<1)return this.error="No compatible SourceBuffer configuration for the variant stream:"+e.resolvedUri,this.mediaSource.endOfStream("decode");this.mainSegmentLoader_.mimeType(t[0]),t[1]&&this.audioSegmentLoader_.mimeType(t[1]),this.excludeIncompatibleVariants_(e)}}},{key:"excludeIncompatibleVariants_",value:function(e){var t=this.masterPlaylistLoader_.master,i=2,n=null,r=void 0;e.attributes.CODECS&&(r=(0,O.parseCodecs)(e.attributes.CODECS),n=r.videoCodec,i=r.codecCount),t.playlists.forEach((function(e){var t={codecCount:2,videoCodec:null};if(e.attributes.CODECS){var r=e.attributes.CODECS;t=(0,O.parseCodecs)(r),window.MediaSource&&window.MediaSource.isTypeSupported&&!window.MediaSource.isTypeSupported('video/mp4; codecs="'+B(r)+'"')&&(e.excludeUntil=1/0)}t.codecCount!==i&&(e.excludeUntil=1/0),t.videoCodec!==n&&(e.excludeUntil=1/0)}))}},{key:"updateAdCues_",value:function(e){var t=0,i=this.seekable();i.length&&(t=i.start(0)),b["default"].updateAdCues(e,this.cueTagsTrack_,t)}},{key:"goalBufferLength",value:function(){var e=this.tech_.currentTime(),t=I["default"].GOAL_BUFFER_LENGTH,i=I["default"].GOAL_BUFFER_LENGTH_RATE,n=Math.max(t,I["default"].MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,n)}},{key:"bufferLowWaterLine",value:function(){var e=this.tech_.currentTime(),t=I["default"].BUFFER_LOW_WATER_LINE,i=I["default"].BUFFER_LOW_WATER_LINE_RATE,n=Math.max(t,I["default"].MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,n)}}]),t}(v["default"].EventTarget);t.MasterPlaylistController=V},"92b0":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=function(e,t,i){var n=!0;while(n){var r=e,s=t,a=i;n=!1,null===r&&(r=Function.prototype);var o=Object.getOwnPropertyDescriptor(r,s);if(void 0!==o){if("value"in o)return o.value;var l=o.get;if(void 0===l)return;return l.call(a)}var u=Object.getPrototypeOf(r);if(null===u)return;e=u,t=s,i=a,n=!0,o=u=void 0}};function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=i("ef34"),u=s(l),c=i("12c6"),h=s(c),d=i("672d"),p=s(d),f=i("e206"),m=s(f),g=i("0de0"),y=function(e){function t(){var e=this;a(this,t),r(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this.sourceBuffers=[],this.readyState="closed",this.on(["sourceopen","webkitsourceopen"],(function(t){e.swfObj=u["default"].getElementById(t.swfId),e.player_=(0,h["default"])(e.swfObj.parentNode),e.tech_=e.swfObj.tech,e.readyState="open",e.tech_.on("seeking",(function(){var t=e.sourceBuffers.length;while(t--)e.sourceBuffers[t].abort()})),e.swfObj&&e.swfObj.vjs_load()}))}return o(t,e),n(t,[{key:"addSeekableRange_",value:function(){}},{key:"addSourceBuffer",value:function(e){var t=(0,g.parseContentType)(e),i=void 0;if("video/mp2t"!==t.type&&"audio/mp2t"!==t.type)throw new Error("NotSupportedError (Video.js)");return i=new p["default"](this),this.sourceBuffers.push(i),i}},{key:"endOfStream",value:function(e){"network"===e?this.tech_.error(2):"decode"===e&&this.tech_.error(3),"ended"!==this.readyState&&(this.readyState="ended",this.swfObj.vjs_endOfStream())}}]),t}(h["default"].EventTarget);t["default"]=y;try{Object.defineProperty(y.prototype,"duration",{get:function(){return this.swfObj?this.swfObj.vjs_getProperty("duration"):NaN},set:function(e){var t=void 0,i=this.swfObj.vjs_getProperty("duration");if(this.swfObj.vjs_setProperty("duration",e),e<i)for(t=0;t<this.sourceBuffers.length;t++)this.sourceBuffers[t].remove(e,i);return e}})}catch(_){y.prototype.duration=NaN}for(var v in m["default"])y[v]=m["default"][v];e.exports=t["default"]},9417:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,i){var n=t.player_;if(i.captions&&i.captions.length)for(var r in e.inbandTextTracks_||(e.inbandTextTracks_={}),i.captionStreams)if(!e.inbandTextTracks_[r]){n.tech_.trigger({type:"usage",name:"hls-608"});var s=n.textTracks().getTrackById(r);e.inbandTextTracks_[r]=s||n.addRemoteTextTrack({kind:"captions",id:r,label:r},!1).track}i.metadata&&i.metadata.length&&!e.metadataTrack_&&(e.metadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,e.metadataTrack_.inBandMetadataTrackDispatchType=i.metadata.dispatchType)};t["default"]=n,e.exports=t["default"]},"96b7":function(e,t,i){"use strict";var n=i("0129"),r=8589934592,s=4294967296,a=function(e,t){var i=1;e>t&&(i=-1);while(Math.abs(t-e)>s)e+=i*r;return e},o=function(e){var t,i;o.prototype.init.call(this),this.type_=e,this.push=function(e){e.type===this.type_&&(void 0===i&&(i=e.dts),e.dts=a(e.dts,i),e.pts=a(e.pts,i),t=e.dts,this.trigger("data",e))},this.flush=function(){i=t,this.trigger("done")},this.discontinuity=function(){i=void 0,t=void 0}};o.prototype=new n,e.exports={TimestampRolloverStream:o,handleRollover:a}},"9d91":function(e,t,i){"use strict";var n,r=i("0129"),s=i("6373"),a=function(e,t,i){var n,r="";for(n=t;n<i;n++)r+="%"+("00"+e[n].toString(16)).slice(-2);return r},o=function(e,t,i){return decodeURIComponent(a(e,t,i))},l=function(e,t,i){return unescape(a(e,t,i))},u=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},c={TXXX:function(e){var t;if(3===e.data[0]){for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=o(e.data,1,t),e.value=o(e.data,t+1,e.data.length).replace(/\0*$/,"");break}e.data=e.value}},WXXX:function(e){var t;if(3===e.data[0])for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=o(e.data,1,t),e.url=o(e.data,t+1,e.data.length);break}},PRIV:function(e){var t;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=l(e.data,0,t);break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}};n=function(e){var t,i={debug:!(!e||!e.debug),descriptor:e&&e.descriptor},r=0,a=[],o=0;if(n.prototype.init.call(this),this.dispatchType=s.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(t=0;t<i.descriptor.length;t++)this.dispatchType+=("00"+i.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,n,s,l,h,d;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(o=0,a.length=0),0===a.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))i.debug&&console.log("Skipping unrecognized metadata packet");else if(a.push(e),o+=e.data.byteLength,1===a.length&&(r=u(e.data.subarray(6,10)),r+=10),!(o<r)){for(t={data:new Uint8Array(r),frames:[],pts:a[0].pts,dts:a[0].dts},h=0;h<r;)t.data.set(a[0].data.subarray(0,r-h),h),h+=a[0].data.byteLength,o-=a[0].data.byteLength,a.shift();n=10,64&t.data[5]&&(n+=4,n+=u(t.data.subarray(10,14)),r-=u(t.data.subarray(16,20)));do{if(s=u(t.data.subarray(n+4,n+8)),s<1)return console.log("Malformed ID3 frame encountered. Skipping metadata parsing.");if(d=String.fromCharCode(t.data[n],t.data[n+1],t.data[n+2],t.data[n+3]),l={id:d,data:t.data.subarray(n+10,n+s+10)},l.key=l.id,c[l.id]&&(c[l.id](l),"com.apple.streaming.transportStreamTimestamp"===l.owner)){var p=l.data,f=(1&p[3])<<30|p[4]<<22|p[5]<<14|p[6]<<6|p[7]>>>2;f*=4,f+=3&p[7],l.timeStamp=f,void 0===t.pts&&void 0===t.dts&&(t.pts=l.timeStamp,t.dts=l.timeStamp),this.trigger("timestamp",l)}t.frames.push(l),n+=10,n+=s}while(n<r);this.trigger("data",t)}}},n.prototype=new r,e.exports=n},"9f7a":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=function(e,t,i){var n=!0;while(n){var r=e,s=t,a=i;n=!1,null===r&&(r=Function.prototype);var o=Object.getOwnPropertyDescriptor(r,s);if(void 0!==o){if("value"in o)return o.value;var l=o.get;if(void 0===l)return;return l.call(a)}var u=Object.getPrototypeOf(r);if(null===u)return;e=u,t=s,i=a,n=!0,o=u=void 0}};function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=i("be09"),u=s(l),c=i("ef34"),h=s(c),d=i("12c6"),p=s(d),f=i("269f"),m=s(f),g=i("ba2d"),y=i("0de0"),v=function(e){function t(){var e=this;a(this,t),r(Object.getPrototypeOf(t.prototype),"constructor",this).call(this);var i=void 0;for(i in this.nativeMediaSource_=new u["default"].MediaSource,this.nativeMediaSource_)i in t.prototype||"function"!==typeof this.nativeMediaSource_[i]||(this[i]=this.nativeMediaSource_[i].bind(this.nativeMediaSource_));this.duration_=NaN,Object.defineProperty(this,"duration",{get:function(){return this.duration_===1/0?this.duration_:this.nativeMediaSource_.duration},set:function(e){this.duration_=e,e===1/0||(this.nativeMediaSource_.duration=e)}}),Object.defineProperty(this,"seekable",{get:function(){return this.duration_===1/0?p["default"].createTimeRanges([[0,this.nativeMediaSource_.duration]]):this.nativeMediaSource_.seekable}}),Object.defineProperty(this,"readyState",{get:function(){return this.nativeMediaSource_.readyState}}),Object.defineProperty(this,"activeSourceBuffers",{get:function(){return this.activeSourceBuffers_}}),this.sourceBuffers=[],this.activeSourceBuffers_=[],this.updateActiveSourceBuffers_=function(){if(e.activeSourceBuffers_.length=0,1===e.sourceBuffers.length){var t=e.sourceBuffers[0];return t.appendAudioInitSegment_=!0,t.audioDisabled_=!t.audioCodec_,void e.activeSourceBuffers_.push(t)}for(var i=!1,n=!0,r=0;r<e.player_.audioTracks().length;r++){var s=e.player_.audioTracks()[r];if(s.enabled&&"main"!==s.kind){i=!0,n=!1;break}}e.sourceBuffers.forEach((function(t){if(t.appendAudioInitSegment_=!0,t.videoCodec_&&t.audioCodec_)t.audioDisabled_=i;else if(t.videoCodec_&&!t.audioCodec_)t.audioDisabled_=!0,n=!1;else if(!t.videoCodec_&&t.audioCodec_&&(t.audioDisabled_=n,n))return;e.activeSourceBuffers_.push(t)}))},this.onPlayerMediachange_=function(){e.sourceBuffers.forEach((function(e){e.appendAudioInitSegment_=!0}))},this.onHlsReset_=function(){e.sourceBuffers.forEach((function(e){e.transmuxer_&&e.transmuxer_.postMessage({action:"resetCaptions"})}))},this.onHlsSegmentTimeMapping_=function(t){e.sourceBuffers.forEach((function(e){return e.timeMapping_=t.mapping}))},["sourceopen","sourceclose","sourceended"].forEach((function(e){this.nativeMediaSource_.addEventListener(e,this.trigger.bind(this))}),this),this.on("sourceopen",(function(t){var i=h["default"].querySelector('[src="'+e.url_+'"]');i&&(e.player_=(0,p["default"])(i.parentNode),e.player_.tech_.on("hls-reset",e.onHlsReset_),e.player_.tech_.on("hls-segment-time-mapping",e.onHlsSegmentTimeMapping_),e.player_.audioTracks&&e.player_.audioTracks()&&(e.player_.audioTracks().on("change",e.updateActiveSourceBuffers_),e.player_.audioTracks().on("addtrack",e.updateActiveSourceBuffers_),e.player_.audioTracks().on("removetrack",e.updateActiveSourceBuffers_)),e.player_.on("mediachange",e.onPlayerMediachange_))})),this.on("sourceended",(function(t){for(var i=(0,g.durationOfVideo)(e.duration),n=0;n<e.sourceBuffers.length;n++){var r=e.sourceBuffers[n],s=r.metadataTrack_&&r.metadataTrack_.cues;s&&s.length&&(s[s.length-1].endTime=i)}})),this.on("sourceclose",(function(e){this.sourceBuffers.forEach((function(e){e.transmuxer_&&e.transmuxer_.terminate()})),this.sourceBuffers.length=0,this.player_&&(this.player_.audioTracks&&this.player_.audioTracks()&&(this.player_.audioTracks().off("change",this.updateActiveSourceBuffers_),this.player_.audioTracks().off("addtrack",this.updateActiveSourceBuffers_),this.player_.audioTracks().off("removetrack",this.updateActiveSourceBuffers_)),this.player_.el_&&(this.player_.off("mediachange",this.onPlayerMediachange_),this.player_.tech_.off("hls-reset",this.onHlsReset_),this.player_.tech_.off("hls-segment-time-mapping",this.onHlsSegmentTimeMapping_)))}))}return o(t,e),n(t,[{key:"addSeekableRange_",value:function(e,t){var i=void 0;if(this.duration!==1/0)throw i=new Error("MediaSource.addSeekableRange() can only be invoked when the duration is Infinity"),i.name="InvalidStateError",i.code=11,i;(t>this.nativeMediaSource_.duration||isNaN(this.nativeMediaSource_.duration))&&(this.nativeMediaSource_.duration=t)}},{key:"addSourceBuffer",value:function(e){var t=void 0,i=(0,y.parseContentType)(e);if(/^(video|audio)\/mp2t$/i.test(i.type)){var n=[];i.parameters&&i.parameters.codecs&&(n=i.parameters.codecs.split(","),n=(0,y.translateLegacyCodecs)(n),n=n.filter((function(e){return(0,y.isAudioCodec)(e)||(0,y.isVideoCodec)(e)}))),0===n.length&&(n=["avc1.4d400d","mp4a.40.2"]),t=new m["default"](this,n),0!==this.sourceBuffers.length&&(this.sourceBuffers[0].createRealSourceBuffers_(),t.createRealSourceBuffers_(),this.sourceBuffers[0].audioDisabled_=!0)}else t=this.nativeMediaSource_.addSourceBuffer(e);return this.sourceBuffers.push(t),t}}]),t}(p["default"].EventTarget);t["default"]=v,e.exports=t["default"]},"9fd3":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}();function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=function(){function e(){r(this,e),this.listeners={}}return n(e,[{key:"on",value:function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)}},{key:"off",value:function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e].splice(i,1),i>-1}},{key:"trigger",value:function(e){var t=this.listeners[e],i=void 0,n=void 0,r=void 0;if(t)if(2===arguments.length)for(n=t.length,i=0;i<n;++i)t[i].call(this,arguments[1]);else for(r=Array.prototype.slice.call(arguments,1),n=t.length,i=0;i<n;++i)t[i].apply(this,r)}},{key:"dispose",value:function(){this.listeners={}}},{key:"pipe",value:function(e){this.on("data",(function(t){e.push(t)}))}}]),e}();t["default"]=s},a151:function(e,t,i){"use strict";var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=function(e,t,i){var n=!0;while(n){var r=e,s=t,a=i;n=!1,null===r&&(r=Function.prototype);var o=Object.getOwnPropertyDescriptor(r,s);if(void 0!==o){if("value"in o)return o.value;var l=o.get;if(void 0===l)return;return l.call(a)}var u=Object.getPrototypeOf(r);if(null===u)return;e=u,t=s,i=a,n=!0,o=u=void 0}};function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=i("ef34"),u=s(l),c=i("8c57"),h=s(c),d=i("d61a"),p=s(d),f=i("46af"),m=s(f),g=i("b658"),y=i("f24e"),v=s(y),_=i("80eb"),b=i("19b3"),T=s(b),S=i("e475"),k=s(S),E=i("91c5"),w=i("56c8"),C=s(w),x=i("e044"),A=s(x),I=i("be09"),O=s(I),P=i("f631"),L=s(P),D=i("140c"),M=s(D),R=i("57db"),N={PlaylistLoader:h["default"],Playlist:p["default"],Decrypter:g.Decrypter,AsyncStream:g.AsyncStream,decrypt:g.decrypt,utils:v["default"],STANDARD_PLAYLIST_SELECTOR:R.lastBandwidthSelector,INITIAL_PLAYLIST_SELECTOR:R.lowestBitrateCompatibleVariantSelector,comparePlaylistBandwidth:R.comparePlaylistBandwidth,comparePlaylistResolution:R.comparePlaylistResolution,xhr:(0,m["default"])()},j=4194304;["GOAL_BUFFER_LENGTH","MAX_GOAL_BUFFER_LENGTH","GOAL_BUFFER_LENGTH_RATE","BUFFER_LOW_WATER_LINE","MAX_BUFFER_LOW_WATER_LINE","BUFFER_LOW_WATER_LINE_RATE","BANDWIDTH_VARIANCE"].forEach((function(e){Object.defineProperty(N,e,{get:function(){return k["default"].log.warn("using Hls."+e+" is UNSAFE be sure you know what you are doing"),C["default"][e]},set:function(t){k["default"].log.warn("using Hls."+e+" is UNSAFE be sure you know what you are doing"),"number"!==typeof t||t<0?k["default"].log.warn("value of Hls."+e+" must be greater than or equal to 0"):C["default"][e]=t}})}));var B=function(e,t){for(var i=t.media(),n=-1,r=0;r<e.length;r++)if(e[r].id===i.uri){n=r;break}e.selectedIndex_=n,e.trigger({selectedIndex:n,type:"change"})},U=function(e,t){t.representations().forEach((function(t){e.addQualityLevel(t)})),B(e,t.playlists)};N.canPlaySource=function(){return k["default"].log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")},N.supportsNativeHls=function(){var e=u["default"].createElement("video");if(!k["default"].getTech("Html5").isSupported())return!1;var t=["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"];return t.some((function(t){return/maybe|probably/i.test(e.canPlayType(t))}))}(),N.isSupported=function(){return k["default"].log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var F=k["default"].getComponent("Component"),q=function(e){function t(e,i,n){var s=this;if(a(this,t),r(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,i,n.hls),i.options_&&i.options_.playerId){var o=(0,k["default"])(i.options_.playerId);o.hasOwnProperty("hls")||Object.defineProperty(o,"hls",{get:function(){return k["default"].log.warn("player.hls is deprecated. Use player.tech_.hls instead."),i.trigger({type:"usage",name:"hls-player-access"}),s}})}if(this.tech_=i,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&(i.featuresNativeVideoTracks||i.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");this.on(u["default"],["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(function(e){var t=u["default"].fullscreenElement||u["default"].webkitFullscreenElement||u["default"].mozFullScreenElement||u["default"].msFullscreenElement;t&&t.contains(s.tech_.el())&&s.masterPlaylistController_.fastQualityChange_()})),this.on(this.tech_,"seeking",(function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())})),this.on(this.tech_,"error",(function(){this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()})),this.on(this.tech_,"play",this.play)}return o(t,e),n(t,[{key:"setOptions_",value:function(){var e=this;this.options_.withCredentials=this.options_.withCredentials||!1,"number"!==typeof this.options_.blacklistDuration&&(this.options_.blacklistDuration=300),"number"!==typeof this.options_.bandwidth&&(this.options_.bandwidth=j),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===j,["withCredentials","bandwidth","handleManifestRedirects"].forEach((function(t){"undefined"!==typeof e.source_[t]&&(e.options_[t]=e.source_[t])})),this.bandwidth=this.options_.bandwidth}},{key:"src",value:function(e){var t=this;e&&(this.setOptions_(),this.options_.url=this.source_.src,this.options_.tech=this.tech_,this.options_.externHls=N,this.masterPlaylistController_=new E.MasterPlaylistController(this.options_),this.playbackWatcher_=new L["default"](k["default"].mergeOptions(this.options_,{seekable:function(){return t.seekable()}})),this.masterPlaylistController_.on("error",(function(){var e=k["default"].players[t.tech_.options_.playerId];e.error(t.masterPlaylistController_.error)})),this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):N.STANDARD_PLAYLIST_SELECTOR.bind(this),this.masterPlaylistController_.selectInitialPlaylist=N.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(e){this.masterPlaylistController_.selectPlaylist=e.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=e,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.bandwidth},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=e,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var e=1/(this.bandwidth||1),t=void 0;t=this.throughput>0?1/this.throughput:0;var i=Math.floor(1/(e+t));return i},set:function(){k["default"].log.error('The "systemBandwidth" property is read-only')}}}),Object.defineProperties(this.stats,{bandwidth:{get:function(){return t.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return t.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return t.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return t.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return t.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return t.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return t.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return t.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.masterPlaylistController_.on("selectedinitialmedia",(function(){(0,A["default"])(t)})),this.on(this.masterPlaylistController_,"progress",(function(){this.tech_.trigger("progress")})),this.on(this.masterPlaylistController_,"firstplay",(function(){this.ignoreNextSeekingEvent_=!0})),this.tech_.ready((function(){return t.setupQualityLevels_()})),this.tech_.el()&&this.tech_.src(k["default"].URL.createObjectURL(this.masterPlaylistController_.mediaSource)))}},{key:"setupQualityLevels_",value:function(){var e=this,t=k["default"].players[this.tech_.options_.playerId];t&&t.qualityLevels&&(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",(function(){U(e.qualityLevels_,e)})),this.playlists.on("mediachange",(function(){B(e.qualityLevels_,e.playlists)})))}},{key:"play",value:function(){this.masterPlaylistController_.play()}},{key:"setCurrentTime",value:function(e){this.masterPlaylistController_.setCurrentTime(e)}},{key:"duration",value:function(){return this.masterPlaylistController_.duration()}},{key:"seekable",value:function(){return this.masterPlaylistController_.seekable()}},{key:"dispose",value:function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),r(Object.getPrototypeOf(t.prototype),"dispose",this).call(this)}}]),t}(F),H=function e(t){return{canHandleSource:function(i){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r=k["default"].mergeOptions(k["default"].options,n);return(!r.hls||!r.hls.mode||r.hls.mode===t)&&e.canPlayType(i.type,r)},handleSource:function(e,i){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],r=k["default"].mergeOptions(k["default"].options,n,{hls:{mode:t}});return"flash"===t&&i.setTimeout((function(){i.trigger("loadstart")}),1),i.hls=new q(e,i,r),i.hls.xhr=(0,m["default"])(),i.hls.src(e.src),i.hls},canPlayType:function(t){var i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=k["default"].mergeOptions(k["default"].options,i);return e.canPlayType(t,n)?"maybe":""}}};H.canPlayType=function(e,t){if(k["default"].browser.IE_VERSION&&k["default"].browser.IE_VERSION<=10)return!1;var i=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i;return!(!t.hls.overrideNative&&N.supportsNativeHls)&&i.test(e)},"undefined"!==typeof k["default"].MediaSource&&"undefined"!==typeof k["default"].URL||(k["default"].MediaSource=_.MediaSource,k["default"].URL=_.URL);var V=k["default"].getTech("Flash");_.MediaSource.supportsNativeMediaSources()&&k["default"].getTech("Html5").registerSourceHandler(H("html5"),0),O["default"].Uint8Array&&V&&V.registerSourceHandler(H("flash")),k["default"].HlsHandler=q,k["default"].HlsSourceHandler=H,k["default"].Hls=N,k["default"].use||k["default"].registerComponent("Hls",N),k["default"].m3u8=T["default"],k["default"].options.hls=k["default"].options.hls||{},k["default"].registerPlugin?k["default"].registerPlugin("reloadSourceOnError",M["default"]):k["default"].plugin("reloadSourceOnError",M["default"]),e.exports={Hls:N,HlsHandler:q,HlsSourceHandler:H}},a254:function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i("be09"),s=n(r),a=i("b658"),o=i("f24e"),l=function(e){e.onmessage=function(e){var t=e.data,i=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),n=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),r=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new a.Decrypter(i,n,r,(function(e,i){s["default"].postMessage((0,o.createTransferableMessage)({source:t.source,decrypted:i}),[i.buffer])}))}};t["default"]=function(e){return new l(e)},e.exports=t["default"]},a31d:function(e,t,i){"use strict";var n,r,s,a,o,l,u,c,h,d,p,f,m,g,y,v,_,b,T,S,k,E,w,C,x,A,I,O,P,L,D,M,R,N,j,B,U=Math.pow(2,32)-1;(function(){var e;if(w={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!==typeof Uint8Array){for(e in w)w.hasOwnProperty(e)&&(w[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);C=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),A=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),x=new Uint8Array([0,0,0,1]),I=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]),O=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]),P={video:I,audio:O},M=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),D=new Uint8Array([0,0,0,0,0,0,0,0]),R=new Uint8Array([0,0,0,0,0,0,0,0]),N=R,j=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),B=R,L=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),n=function(e){var t,i,n,r=[],s=0;for(t=1;t<arguments.length;t++)r.push(arguments[t]);t=r.length;while(t--)s+=r[t].byteLength;for(i=new Uint8Array(s+8),n=new DataView(i.buffer,i.byteOffset,i.byteLength),n.setUint32(0,i.byteLength),i.set(e,4),t=0,s=8;t<r.length;t++)i.set(r[t],s),s+=r[t].byteLength;return i},r=function(){return n(w.dinf,n(w.dref,M))},s=function(e){return n(w.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,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},a=function(){return n(w.ftyp,C,x,C,A)},v=function(e){return n(w.hdlr,P[e])},o=function(e){return n(w.mdat,e)},y=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(t[12]=e.samplerate>>>24&255,t[13]=e.samplerate>>>16&255,t[14]=e.samplerate>>>8&255,t[15]=255&e.samplerate),n(w.mdhd,t)},g=function(e){return n(w.mdia,y(e),v(e.type),u(e))},l=function(e){return n(w.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},u=function(e){return n(w.minf,"video"===e.type?n(w.vmhd,L):n(w.smhd,D),r(),b(e))},c=function(e,t){var i=[],r=t.length;while(r--)i[r]=S(t[r]);return n.apply(null,[w.moof,l(e)].concat(i))},h=function(e){var t=e.length,i=[];while(t--)i[t]=f(e[t]);return n.apply(null,[w.moov,p(4294967295)].concat(i).concat(d(e)))},d=function(e){var t=e.length,i=[];while(t--)i[t]=k(e[t]);return n.apply(null,[w.mvex].concat(i))},p=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,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 n(w.mvhd,t)},_=function(e){var t,i,r=e.samples||[],s=new Uint8Array(4+r.length);for(i=0;i<r.length;i++)t=r[i].flags,s[i+4]=t.dependsOn<<4|t.isDependedOn<<2|t.hasRedundancy;return n(w.sdtp,s)},b=function(e){return n(w.stbl,T(e),n(w.stts,B),n(w.stsc,N),n(w.stsz,j),n(w.stco,R))},function(){var e,t;T=function(i){return n(w.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===i.type?e(i):t(i))},e=function(e){var t,i=e.sps||[],r=e.pps||[],s=[],a=[];for(t=0;t<i.length;t++)s.push((65280&i[t].byteLength)>>>8),s.push(255&i[t].byteLength),s=s.concat(Array.prototype.slice.call(i[t]));for(t=0;t<r.length;t++)a.push((65280&r[t].byteLength)>>>8),a.push(255&r[t].byteLength),a=a.concat(Array.prototype.slice.call(r[t]));return n(w.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,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,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]),n(w.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([i.length]).concat(s).concat([r.length]).concat(a))),n(w.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])))},t=function(e){return n(w.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),s(e))}}(),m=function(e){var t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,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,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return n(w.tkhd,t)},S=function(e){var t,i,r,s,a,o,l;return t=n(w.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),o=Math.floor(e.baseMediaDecodeTime/(U+1)),l=Math.floor(e.baseMediaDecodeTime%(U+1)),i=n(w.tfdt,new Uint8Array([1,0,0,0,o>>>24&255,o>>>16&255,o>>>8&255,255&o,l>>>24&255,l>>>16&255,l>>>8&255,255&l])),a=92,"audio"===e.type?(r=E(e,a),n(w.traf,t,i,r)):(s=_(e),r=E(e,s.length+a),n(w.traf,t,i,r,s))},f=function(e){return e.duration=e.duration||4294967295,n(w.trak,m(e),g(e))},k=function(e){var t=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(t[t.length-1]=0),n(w.trex,t)},function(){var e,t,i;i=function(e,t){var i=0,n=0,r=0,s=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(n=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset&&(s=8)),[0,0,i|n|r|s,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},t=function(e,t){var r,s,a,o;for(s=e.samples||[],t+=20+16*s.length,r=i(s,t),o=0;o<s.length;o++)a=s[o],r=r.concat([(4278190080&a.duration)>>>24,(16711680&a.duration)>>>16,(65280&a.duration)>>>8,255&a.duration,(4278190080&a.size)>>>24,(16711680&a.size)>>>16,(65280&a.size)>>>8,255&a.size,a.flags.isLeading<<2|a.flags.dependsOn,a.flags.isDependedOn<<6|a.flags.hasRedundancy<<4|a.flags.paddingValue<<1|a.flags.isNonSyncSample,61440&a.flags.degradationPriority,15&a.flags.degradationPriority,(4278190080&a.compositionTimeOffset)>>>24,(16711680&a.compositionTimeOffset)>>>16,(65280&a.compositionTimeOffset)>>>8,255&a.compositionTimeOffset]);return n(w.trun,new Uint8Array(r))},e=function(e,t){var r,s,a,o;for(s=e.samples||[],t+=20+8*s.length,r=i(s,t),o=0;o<s.length;o++)a=s[o],r=r.concat([(4278190080&a.duration)>>>24,(16711680&a.duration)>>>16,(65280&a.duration)>>>8,255&a.duration,(4278190080&a.size)>>>24,(16711680&a.size)>>>16,(65280&a.size)>>>8,255&a.size]);return n(w.trun,new Uint8Array(r))},E=function(i,n){return"audio"===i.type?e(i,n):t(i,n)}}(),e.exports={ftyp:a,mdat:o,moof:c,moov:h,initSegment:function(e){var t,i=a(),n=h(e);return t=new Uint8Array(i.byteLength+n.byteLength),t.set(i),t.set(n,i.byteLength),t}}},a559:function(e,t){function i(){return e.exports=i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)({}).hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},e.exports.__esModule=!0,e.exports["default"]=e.exports,i.apply(null,arguments)}e.exports=i,e.exports.__esModule=!0,e.exports["default"]=e.exports},a59e:function(e,t,i){(function(t){var i;i="undefined"!==typeof window?window:"undefined"!==typeof t?t:"undefined"!==typeof self?self:{},e.exports=i}).call(this,i("c8ba"))},a64c:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}();function r(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=i("be09"),o=r(a),l=i("1376"),u=r(l),c=function(e){e.on("data",(function(e){o["default"].postMessage({action:"data",segment:e})})),e.on("done",(function(e){o["default"].postMessage({action:"done"})}))},h=function(){function e(t){s(this,e),this.options=t||{},this.init()}return n(e,[{key:"init",value:function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new u["default"].Transmuxer(this.options),c(this.transmuxer)}},{key:"push",value:function(e){var t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}},{key:"reset",value:function(){this.init()}},{key:"flush",value:function(){this.transmuxer.flush()}},{key:"resetCaptions",value:function(){this.transmuxer.resetCaptions()}}]),e}(),d=function(e){e.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new h(e.data.options):(this.messageHandlers||(this.messageHandlers=new h),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}};t["default"]=function(e){return new d(e)},e.exports=t["default"]},a65d:function(e,t,i){"use strict";var n,r=i("0129"),s=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];n=function(){var e;n.prototype.init.call(this),this.push=function(t){var i,n,r,a,o,l,u=0,c=0;if("audio"===t.type){e?(a=e,e=new Uint8Array(a.byteLength+t.data.byteLength),e.set(a),e.set(t.data,a.byteLength)):e=t.data;while(u+5<e.length)if(255===e[u]&&240===(246&e[u+1])){if(n=2*(1&~e[u+1]),i=(3&e[u+3])<<11|e[u+4]<<3|(224&e[u+5])>>5,o=1024*(1+(3&e[u+6])),l=9e4*o/s[(60&e[u+2])>>>2],r=u+i,e.byteLength<r)return;if(this.trigger("data",{pts:t.pts+c*l,dts:t.dts+c*l,sampleCount:o,audioobjecttype:1+(e[u+2]>>>6&3),channelcount:(1&e[u+2])<<2|(192&e[u+3])>>>6,samplerate:s[(60&e[u+2])>>>2],samplingfrequencyindex:(60&e[u+2])>>>2,samplesize:16,data:e.subarray(u+7+n,r)}),e.byteLength===r)return void(e=void 0);c++,e=e.subarray(r)}else u++}},this.flush=function(){this.trigger("done")}},n.prototype=new r,e.exports=n},a968:function(e,t){var i=Math.pow(2,32),n=function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getBigUint64?(t=n.getBigUint64(0),t<Number.MAX_SAFE_INTEGER?Number(t):t):n.getUint32(0)*i+n.getUint32(4)};e.exports={getUint64:n,MAX_UINT32:i}},ac62:function(e,t,i){"use strict";var n=i("6516"),r=function(e){var t=31&e[1];return t<<=8,t|=e[2],t},s=function(e){return!!(64&e[1])},a=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},o=function(e,t){var i=r(e);return 0===i?"pat":i===t?"pmt":t?"pes":null},l=function(e){var t=s(e),i=4+a(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},u=function(e){var t={},i=s(e),n=4+a(e);if(i&&(n+=e[n]+1),1&e[n+5]){var r,o,l;r=(15&e[n+1])<<8|e[n+2],o=3+r-4,l=(15&e[n+10])<<8|e[n+11];var u=12+l;while(u<o){var c=n+u;t[(31&e[c+1])<<8|e[c+2]]=e[c],u+=5+((15&e[c+3])<<8|e[c+4])}return t}},c=function(e,t){var i=r(e),s=t[i];switch(s){case n.H264_STREAM_TYPE:return"video";case n.ADTS_STREAM_TYPE:return"audio";case n.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},h=function(e){var t=s(e);if(!t)return null;var i=4+a(e);if(i>=e.byteLength)return null;var n,r=null;return n=e[i+7],192&n&&(r={},r.pts=(14&e[i+9])<<27|(255&e[i+10])<<20|(254&e[i+11])<<12|(255&e[i+12])<<5|(254&e[i+13])>>>3,r.pts*=4,r.pts+=(6&e[i+13])>>>1,r.dts=r.pts,64&n&&(r.dts=(14&e[i+14])<<27|(255&e[i+15])<<20|(254&e[i+16])<<12|(255&e[i+17])<<5|(254&e[i+18])>>>3,r.dts*=4,r.dts+=(6&e[i+18])>>>1)),r},d=function(e){switch(e){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}},p=function(e){for(var t,i=4+a(e),n=e.subarray(i),r=0,s=0,o=!1;s<n.byteLength-3;s++)if(1===n[s+2]){r=s+5;break}while(r<n.byteLength)switch(n[r]){case 0:if(0!==n[r-1]){r+=2;break}if(0!==n[r-2]){r++;break}s+3!==r-2&&(t=d(31&n[s+3]),"slice_layer_without_partitioning_rbsp_idr"===t&&(o=!0));do{r++}while(1!==n[r]&&r<n.length);s=r-2,r+=3;break;case 1:if(0!==n[r-1]||0!==n[r-2]){r+=3;break}t=d(31&n[s+3]),"slice_layer_without_partitioning_rbsp_idr"===t&&(o=!0),s=r-2,r+=3;break;default:r+=3;break}return n=n.subarray(s),r-=s,s=0,n&&n.byteLength>3&&(t=d(31&n[s+3]),"slice_layer_without_partitioning_rbsp_idr"===t&&(o=!0)),o};e.exports={parseType:o,parsePat:l,parsePmt:u,parsePayloadUnitStartIndicator:s,parsePesType:c,parsePesTime:h,videoPacketContainsKeyFrame:p}},ae50:function(e,t,i){"use strict";var n,r=i("0129");n=function(){var e=new Uint8Array,t=0;n.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.parseId3TagSize=function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],n=e[t+5],r=(16&n)>>4;return r?i+20:i+10},this.parseAdtsSize=function(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3,r=6144&e[t+3];return r|n|i},this.push=function(i){var n,r,s,a,o=0,l=0;e.length?(a=e.length,e=new Uint8Array(i.byteLength+a),e.set(e.subarray(0,a)),e.set(i,a)):e=i;while(e.length-l>=3)if(e[l]!=="I".charCodeAt(0)||e[l+1]!=="D".charCodeAt(0)||e[l+2]!=="3".charCodeAt(0))if(!0&e[l]&&240===(240&e[l+1])){if(e.length-l<7)break;if(o=this.parseAdtsSize(e,l),o>e.length)break;s={type:"audio",data:e.subarray(l,l+o),pts:t,dts:t},this.trigger("data",s),l+=o}else l++;else{if(e.length-l<10)break;if(o=this.parseId3TagSize(e,l),o>e.length)break;r={type:"timed-metadata",data:e.subarray(l,l+o)},this.trigger("data",r),l+=o}n=e.length-l,e=n>0?e.subarray(l):new Uint8Array}},n.prototype=new r,e.exports=n},b03c:function(e,t){var i="auto",n={"":1,lr:1,rl:1},r={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function s(e){if("string"!==typeof e)return!1;var t=n[e.toLowerCase()];return!!t&&e.toLowerCase()}function a(e){if("string"!==typeof e)return!1;var t=r[e.toLowerCase()];return!!t&&e.toLowerCase()}function o(e,t,n){this.hasBeenReset=!1;var r="",o=!1,l=e,u=t,c=n,h=null,d="",p=!0,f="auto",m="start",g="auto",y="auto",v=100,_="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return r},set:function(e){r=""+e}},pauseOnExit:{enumerable:!0,get:function(){return o},set:function(e){o=!!e}},startTime:{enumerable:!0,get:function(){return l},set:function(e){if("number"!==typeof e)throw new TypeError("Start time must be set to a number.");l=e,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return u},set:function(e){if("number"!==typeof e)throw new TypeError("End time must be set to a number.");u=e,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return c},set:function(e){c=""+e,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return h},set:function(e){h=e,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return d},set:function(e){var t=s(e);if(!1===t)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");d=t,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return p},set:function(e){p=!!e,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return f},set:function(e){if("number"!==typeof e&&e!==i)throw new SyntaxError("Line: an invalid number or illegal string was specified.");f=e,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return m},set:function(e){var t=a(e);t?(m=t,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return g},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");g=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return y},set:function(e){var t=a(e);t?(y=t,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return v},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");v=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return _},set:function(e){var t=a(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");_=t,this.hasBeenReset=!0}}}),this.displayState=void 0}o.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},e.exports=o},b074:function(e,t,i){var n=i("89a7"),r=i("e1c8"),s=i("b30f"),a=i("e003"),o=r.DOMImplementation,l=n.NAMESPACE,u=a.ParseError,c=a.XMLReader;function h(e){return e.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function d(e){this.options=e||{locator:{}}}function p(e,t,i){if(!e){if(t instanceof f)return t;e=t}var n={},r=e instanceof Function;function s(t){var s=e[t];!s&&r&&(s=2==e.length?function(i){e(t,i)}:e),n[t]=s&&function(e){s("[xmldom "+t+"]\t"+e+g(i))}||function(){}}return i=i||{},s("warning"),s("error"),s("fatalError"),n}function f(){this.cdata=!1}function m(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function g(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function y(e,t,i){return"string"==typeof e?e.substr(t,i):e.length>=t+i||t?new java.lang.String(e,t,i)+"":e}function v(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}d.prototype.parseFromString=function(e,t){var i=this.options,n=new c,r=i.domBuilder||new f,a=i.errorHandler,o=i.locator,u=i.xmlns||{},d=/\/x?html?$/.test(t),m=d?s.HTML_ENTITIES:s.XML_ENTITIES;o&&r.setDocumentLocator(o),n.errorHandler=p(a,r,o),n.domBuilder=i.domBuilder||r,d&&(u[""]=l.HTML),u.xml=u.xml||l.XML;var g=i.normalizeLineEndings||h;return e&&"string"===typeof e?n.parse(g(e),u,m):n.errorHandler.error("invalid doc source"),r.doc},f.prototype={startDocument:function(){this.doc=(new o).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,i,n){var r=this.doc,s=r.createElementNS(e,i||t),a=n.length;v(this,s),this.currentElement=s,this.locator&&m(this.locator,s);for(var o=0;o<a;o++){e=n.getURI(o);var l=n.getValue(o),u=(i=n.getQName(o),r.createAttributeNS(e,i));this.locator&&m(n.getLocator(o),u),u.value=u.nodeValue=l,s.setAttributeNode(u)}},endElement:function(e,t,i){var n=this.currentElement;n.tagName;this.currentElement=n.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var i=this.doc.createProcessingInstruction(e,t);this.locator&&m(this.locator,i),v(this,i)},ignorableWhitespace:function(e,t,i){},characters:function(e,t,i){if(e=y.apply(this,arguments),e){if(this.cdata)var n=this.doc.createCDATASection(e);else n=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(e)&&this.doc.appendChild(n),this.locator&&m(this.locator,n)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,i){e=y.apply(this,arguments);var n=this.doc.createComment(e);this.locator&&m(this.locator,n),v(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,i){var n=this.doc.implementation;if(n&&n.createDocumentType){var r=n.createDocumentType(e,t,i);this.locator&&m(this.locator,r),v(this,r),this.doc.doctype=r}},warning:function(e){console.warn("[xmldom warning]\t"+e,g(this.locator))},error:function(e){console.error("[xmldom error]\t"+e,g(this.locator))},fatalError:function(e){throw new u(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(e){f.prototype[e]=function(){return null}})),t.__DOMHandler=f,t.normalizeLineEndings=h,t.DOMParser=d},b30f:function(e,t,i){"use strict";var n=i("89a7").freeze;t.XML_ENTITIES=n({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),t.HTML_ENTITIES=n({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:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",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:"ʼn",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:"\n",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:"\t",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:"‌"}),t.entityMap=t.HTML_ENTITIES},b52b:function(e,t,i){"use strict";var n;n=function(e){var t=e.byteLength,i=0,n=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+n},this.loadWord=function(){var r=e.byteLength-t,s=new Uint8Array(4),a=Math.min(4,t);if(0===a)throw new Error("no bytes available");s.set(e.subarray(r,r+a)),i=new DataView(s.buffer).getUint32(0),n=8*a,t-=a},this.skipBits=function(e){var r;n>e?(i<<=e,n-=e):(e-=n,r=Math.floor(e/8),e-=8*r,t-=r,this.loadWord(),i<<=e,n-=e)},this.readBits=function(e){var r=Math.min(n,e),s=i>>>32-r;return n-=r,n>0?i<<=r:t>0&&this.loadWord(),r=e-r,r>0?s<<r|this.readBits(r):s},this.skipLeadingZeros=function(){var e;for(e=0;e<n;++e)if(0!==(i&2147483648>>>e))return i<<=e,n-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()},e.exports=n},b658:function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i("1b5c"),s=i("de2e"),a=n(s);t["default"]={decrypt:r.decrypt,Decrypter:r.Decrypter,AsyncStream:a["default"]},e.exports=t["default"]},ba2d:function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i("be09"),s=n(r),a=i("12c6"),o=n(a),l=function(e){Object.defineProperties(e.frame,{id:{get:function(){return o["default"].log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return o["default"].log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return o["default"].log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})},u=function(e){var t=void 0;return t=isNaN(e)||Math.abs(e)===1/0?Number.MAX_VALUE:e,t},c=function(e,t,i){var n=s["default"].WebKitDataCue||s["default"].VTTCue;t&&t.forEach((function(e){var t=e.stream;this.inbandTextTracks_[t].addCue(new n(e.startTime+this.timestampOffset,e.endTime+this.timestampOffset,e.text))}),e),i&&function(){var t=u(e.mediaSource_.duration);i.forEach((function(e){var t=e.cueTime+this.timestampOffset;e.frames.forEach((function(e){var i=new n(t,t,e.value||e.url||e.data||"");i.frame=e,i.value=e,l(i),this.metadataTrack_.addCue(i)}),this)}),e),e.metadataTrack_&&e.metadataTrack_.cues&&e.metadataTrack_.cues.length&&function(){for(var i=e.metadataTrack_.cues,n=[],r=0;r<i.length;r++)i[r]&&n.push(i[r]);var s=n.reduce((function(e,t){var i=e[t.startTime]||[];return i.push(t),e[t.startTime]=i,e}),{}),a=Object.keys(s).sort((function(e,t){return Number(e)-Number(t)}));a.forEach((function(e,i){var n=s[e],r=Number(a[i+1])||t;n.forEach((function(e){e.endTime=r}))}))}()}()};t["default"]={addTextTrackData:c,durationOfVideo:u},e.exports=t["default"]},bc1c:function(e,t,i){"use strict";var n,r,s,a,o,l,u=i("0129"),c=i("d36f"),h=i("70fd"),d=i("a65d"),p=i("eaba").H264Stream,f=i("713c"),m=i("7002");a=function(e,t){"number"===typeof t.pts&&(void 0===e.timelineStartInfo.pts?e.timelineStartInfo.pts=t.pts:e.timelineStartInfo.pts=Math.min(e.timelineStartInfo.pts,t.pts)),"number"===typeof t.dts&&(void 0===e.timelineStartInfo.dts?e.timelineStartInfo.dts=t.dts:e.timelineStartInfo.dts=Math.min(e.timelineStartInfo.dts,t.dts))},o=function(e,t){var i=new c(c.METADATA_TAG);return i.dts=t,i.pts=t,i.writeMetaDataDouble("videocodecid",7),i.writeMetaDataDouble("width",e.width),i.writeMetaDataDouble("height",e.height),i},l=function(e,t){var i,n=new c(c.VIDEO_TAG,!0);for(n.dts=t,n.pts=t,n.writeByte(1),n.writeByte(e.profileIdc),n.writeByte(e.profileCompatibility),n.writeByte(e.levelIdc),n.writeByte(255),n.writeByte(225),n.writeShort(e.sps[0].length),n.writeBytes(e.sps[0]),n.writeByte(e.pps.length),i=0;i<e.pps.length;++i)n.writeShort(e.pps[i].length),n.writeBytes(e.pps[i]);return n},s=function(e){var t,i=[],n=[];s.prototype.init.call(this),this.push=function(t){a(e,t),e&&(e.audioobjecttype=t.audioobjecttype,e.channelcount=t.channelcount,e.samplerate=t.samplerate,e.samplingfrequencyindex=t.samplingfrequencyindex,e.samplesize=t.samplesize,e.extraData=e.audioobjecttype<<11|e.samplingfrequencyindex<<7|e.channelcount<<3),t.pts=Math.round(t.pts/90),t.dts=Math.round(t.dts/90),i.push(t)},this.flush=function(){var r,s,a,o=new m;if(0!==i.length){a=-1/0;while(i.length)r=i.shift(),n.length&&r.pts>=n[0]&&(a=n.shift(),this.writeMetaDataTags(o,a)),(e.extraData!==t||r.pts-a>=1e3)&&(this.writeMetaDataTags(o,r.pts),t=e.extraData,a=r.pts),s=new c(c.AUDIO_TAG),s.pts=r.pts,s.dts=r.dts,s.writeBytes(r.data),o.push(s.finalize());n.length=0,t=null,this.trigger("data",{track:e,tags:o.list}),this.trigger("done","AudioSegmentStream")}else this.trigger("done","AudioSegmentStream")},this.writeMetaDataTags=function(t,i){var n;n=new c(c.METADATA_TAG),n.pts=i,n.dts=i,n.writeMetaDataDouble("audiocodecid",10),n.writeMetaDataBoolean("stereo",2===e.channelcount),n.writeMetaDataDouble("audiosamplerate",e.samplerate),n.writeMetaDataDouble("audiosamplesize",16),t.push(n.finalize()),n=new c(c.AUDIO_TAG,!0),n.pts=i,n.dts=i,n.view.setUint16(n.position,e.extraData),n.position+=2,n.length=Math.max(n.length,n.position),t.push(n.finalize())},this.onVideoKeyFrame=function(e){n.push(e)}},s.prototype=new u,r=function(e){var t,i,n=[];r.prototype.init.call(this),this.finishFrame=function(n,r){if(r){if(t&&e&&e.newMetadata&&(r.keyFrame||0===n.length)){var s=o(t,r.dts).finalize(),a=l(e,r.dts).finalize();s.metaDataTag=a.metaDataTag=!0,n.push(s),n.push(a),e.newMetadata=!1,this.trigger("keyframe",r.dts)}r.endNalUnit(),n.push(r.finalize()),i=null}},this.push=function(t){a(e,t),t.pts=Math.round(t.pts/90),t.dts=Math.round(t.dts/90),n.push(t)},this.flush=function(){var r,s=new m;while(n.length){if("access_unit_delimiter_rbsp"===n[0].nalUnitType)break;n.shift()}if(0!==n.length){while(n.length)r=n.shift(),"seq_parameter_set_rbsp"===r.nalUnitType?(e.newMetadata=!0,t=r.config,e.width=t.width,e.height=t.height,e.sps=[r.data],e.profileIdc=t.profileIdc,e.levelIdc=t.levelIdc,e.profileCompatibility=t.profileCompatibility,i.endNalUnit()):"pic_parameter_set_rbsp"===r.nalUnitType?(e.newMetadata=!0,e.pps=[r.data],i.endNalUnit()):"access_unit_delimiter_rbsp"===r.nalUnitType?(i&&this.finishFrame(s,i),i=new c(c.VIDEO_TAG),i.pts=r.pts,i.dts=r.dts):("slice_layer_without_partitioning_rbsp_idr"===r.nalUnitType&&(i.keyFrame=!0),i.endNalUnit()),i.startNalUnit(),i.writeBytes(r.data);i&&this.finishFrame(s,i),this.trigger("data",{track:e,tags:s.list}),this.trigger("done","VideoSegmentStream")}else this.trigger("done","VideoSegmentStream")}},r.prototype=new u,n=function(e){var t,i,a,o,l,u,c,m,g,y,v,_,b=this;n.prototype.init.call(this),e=e||{},this.metadataStream=new h.MetadataStream,e.metadataStream=this.metadataStream,t=new h.TransportPacketStream,i=new h.TransportParseStream,a=new h.ElementaryStream,o=new h.TimestampRolloverStream("video"),l=new h.TimestampRolloverStream("audio"),u=new h.TimestampRolloverStream("timed-metadata"),c=new d,m=new p,_=new f(e),t.pipe(i).pipe(a),a.pipe(o).pipe(m),a.pipe(l).pipe(c),a.pipe(u).pipe(this.metadataStream).pipe(_),v=new h.CaptionStream,m.pipe(v).pipe(_),a.on("data",(function(e){var t,i,n;if("metadata"===e.type){t=e.tracks.length;while(t--)"video"===e.tracks[t].type?i=e.tracks[t]:"audio"===e.tracks[t].type&&(n=e.tracks[t]);i&&!g&&(_.numberOfTracks++,g=new r(i),m.pipe(g).pipe(_)),n&&!y&&(_.numberOfTracks++,y=new s(n),c.pipe(y).pipe(_),g&&g.on("keyframe",y.onVideoKeyFrame))}})),this.push=function(e){t.push(e)},this.flush=function(){t.flush()},this.resetCaptions=function(){v.reset()},_.on("data",(function(e){b.trigger("data",e)})),_.on("done",(function(){b.trigger("done")}))},n.prototype=new u,e.exports=n},be09:function(e,t,i){(function(t){var i;i="undefined"!==typeof window?window:"undefined"!==typeof t?t:"undefined"!==typeof self?self:{},e.exports=i}).call(this,i("c8ba"))},bec7:function(e,t,i){var n=i("be09"),r=e.exports={WebVTT:i("4e4e"),VTTCue:i("ea3c"),VTTRegion:i("2fdb")};n.vttjs=r,n.WebVTT=r.WebVTT;var s=r.VTTCue,a=r.VTTRegion,o=n.VTTCue,l=n.VTTRegion;r.shim=function(){n.VTTCue=s,n.VTTRegion=a},r.restore=function(){n.VTTCue=o,n.VTTRegion=l},n.VTTCue||r.shim()},c5323:function(e,t,i){"use strict";var n=i("d36f"),r=function(e,t,i){var r,s,a,o=new Uint8Array(9),l=new DataView(o.buffer);return e=e||0,t=void 0===t||t,i=void 0===i||i,l.setUint8(0,70),l.setUint8(1,76),l.setUint8(2,86),l.setUint8(3,1),l.setUint8(4,(t?4:0)|(i?1:0)),l.setUint32(5,o.byteLength),e<=0?(s=new Uint8Array(o.byteLength+4),s.set(o),s.set([0,0,0,0],o.byteLength),s):(r=new n(n.METADATA_TAG),r.pts=r.dts=0,r.writeMetaDataDouble("duration",e),a=r.finalize().length,s=new Uint8Array(o.byteLength+a),s.set(o),s.set(l.byteLength,a),s)};e.exports=r},c7ca:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=function(e,t,i){var n=!0;while(n){var r=e,s=t,a=i;n=!1,null===r&&(r=Function.prototype);var o=Object.getOwnPropertyDescriptor(r,s);if(void 0!==o){if("value"in o)return o.value;var l=o.get;if(void 0===l)return;return l.call(a)}var u=Object.getPrototypeOf(r);if(null===u)return;e=u,t=s,i=a,n=!0,o=u=void 0}};function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=i("1b15"),u=s(l),c=i("5164"),h=i("d61a"),d=i("e475"),p=s(d),f=[{name:"VOD",run:function(e,t,i,n,r){if(i!==1/0){var s={time:0,segmentIndex:0};return s}return null}},{name:"ProgramDateTime",run:function(e,t,i,n,r){if(e.datetimeToDisplayTime&&t.dateTimeObject){var s=t.dateTimeObject.getTime()/1e3,a=s+e.datetimeToDisplayTime,o={time:a,segmentIndex:0};return o}return null}},{name:"Segment",run:function(e,t,i,n,r){var s=t.segments||[],a=null,o=null;r=r||0;for(var l=0;l<s.length;l++){var u=s[l];if(u.timeline===n&&"undefined"!==typeof u.start){var c=Math.abs(r-u.start);if(null!==o&&o<c)break;(!a||null===o||o>=c)&&(o=c,a={time:u.start,segmentIndex:l})}}return a}},{name:"Discontinuity",run:function(e,t,i,n,r){var s=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var a=null,o=0;o<t.discontinuityStarts.length;o++){var l=t.discontinuityStarts[o],u=t.discontinuitySequence+o+1,c=e.discontinuities[u];if(c){var h=Math.abs(r-c.time);if(null!==a&&a<h)break;(!s||null===a||a>=h)&&(a=h,s={time:c.time,segmentIndex:l})}}return s}},{name:"Playlist",run:function(e,t,i,n,r){if(t.syncInfo){var s={time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence};return s}return null}}];t.syncPointStrategies=f;var m=function(e){function t(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];a(this,t),r(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this.inspectCache_=void 0,this.timelines=[],this.discontinuities=[],this.datetimeToDisplayTime=null,e.debug&&(this.logger_=p["default"].log.bind(p["default"],"sync-controller ->"))}return o(t,e),n(t,[{key:"getSyncPoint",value:function(e,t,i,n){var r=this.runStrategies_(e,t,i,n);return r.length?this.selectSyncPoint_(r,{key:"time",value:n}):null}},{key:"getExpiredTime",value:function(e,t){if(!e||!e.segments)return null;var i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;var n=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return n.segmentIndex>0&&(n.time*=-1),Math.abs(n.time+(0,h.sumDurations)(e,n.segmentIndex,0))}},{key:"runStrategies_",value:function(e,t,i,n){for(var r=[],s=0;s<f.length;s++){var a=f[s],o=a.run(this,e,t,i,n);o&&(o.strategy=a.name,r.push({strategy:a.name,syncPoint:o}),this.logger_("syncPoint found via <"+a.name+">:",o))}return r}},{key:"selectSyncPoint_",value:function(e,t){for(var i=e[0].syncPoint,n=Math.abs(e[0].syncPoint[t.key]-t.value),r=e[0].strategy,s=1;s<e.length;s++){var a=Math.abs(e[s].syncPoint[t.key]-t.value);a<n&&(n=a,i=e[s].syncPoint,r=e[s].strategy)}return this.logger_("syncPoint with strategy <"+r+"> chosen: ",i),i}},{key:"saveExpiredSegmentInfo",value:function(e,t){for(var i=t.mediaSequence-e.mediaSequence,n=i-1;n>=0;n--){var r=e.segments[n];if(r&&"undefined"!==typeof r.start){t.syncInfo={mediaSequence:e.mediaSequence+n,time:r.start},this.logger_("playlist sync:",t.syncInfo),this.trigger("syncinfoupdate");break}}}},{key:"setDateTimeMapping",value:function(e){if(!this.datetimeToDisplayTime&&e.dateTimeObject){var t=e.dateTimeObject.getTime()/1e3;this.datetimeToDisplayTime=-t}}},{key:"reset",value:function(){this.inspectCache_=void 0}},{key:"probeSegmentInfo",value:function(e){var t=e.segment,i=e.playlist,n=void 0;return n=t.map?this.probeMp4Segment_(e):this.probeTsSegment_(e),n&&this.calculateSegmentTimeMapping_(e,n)&&(this.saveDiscontinuitySyncInfo_(e),i.syncInfo||(i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:t.start})),n}},{key:"probeMp4Segment_",value:function(e){var t=e.segment,i=u["default"].timescale(t.map.bytes),n=u["default"].startTime(i,e.bytes);return null!==e.timestampOffset&&(e.timestampOffset-=n),{start:n,end:n+t.duration}}},{key:"probeTsSegment_",value:function(e){var t=(0,c.inspect)(e.bytes,this.inspectCache_),i=void 0,n=void 0;return t?(t.video&&2===t.video.length?(this.inspectCache_=t.video[1].dts,i=t.video[0].dtsTime,n=t.video[1].dtsTime):t.audio&&2===t.audio.length&&(this.inspectCache_=t.audio[1].dts,i=t.audio[0].dtsTime,n=t.audio[1].dtsTime),{start:i,end:n,containsVideo:t.video&&2===t.video.length,containsAudio:t.audio&&2===t.audio.length}):null}},{key:"timestampOffsetForTimeline",value:function(e){return"undefined"===typeof this.timelines[e]?null:this.timelines[e].time}},{key:"mappingForTimeline",value:function(e){return"undefined"===typeof this.timelines[e]?null:this.timelines[e].mapping}},{key:"calculateSegmentTimeMapping_",value:function(e,t){var i=e.segment,n=this.timelines[e.timeline];if(null!==e.timestampOffset)this.logger_("tsO:",e.timestampOffset),n={time:e.startOfSegment,mapping:e.startOfSegment-t.start},this.timelines[e.timeline]=n,this.trigger("timestampoffset"),i.start=e.startOfSegment,i.end=t.end+n.mapping;else{if(!n)return!1;i.start=t.start+n.mapping,i.end=t.end+n.mapping}return!0}},{key:"saveDiscontinuitySyncInfo_",value:function(e){var t=e.playlist,i=e.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.start,accuracy:0};else if(t.discontinuityStarts.length)for(var n=0;n<t.discontinuityStarts.length;n++){var r=t.discontinuityStarts[n],s=t.discontinuitySequence+n+1,a=r-e.mediaIndex,o=Math.abs(a);if(!this.discontinuities[s]||this.discontinuities[s].accuracy>o){var l=void 0;l=a<0?i.start-(0,h.sumDurations)(t,e.mediaIndex,r):i.end+(0,h.sumDurations)(t,e.mediaIndex+1,r),this.discontinuities[s]={time:l,accuracy:o}}}}},{key:"logger_",value:function(){}}]),t}(p["default"].EventTarget);t["default"]=m},d02c:function(e,t,i){var n=i("ef34"),r=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function s(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function a(e){function t(e,t,i,n){return 3600*(0|e)+60*(0|t)+(0|i)+(0|n)/1e3}var i=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function o(){this.values=r(null)}function l(e,t,i,n){var r=n?e.split(n):[e];for(var s in r)if("string"===typeof r[s]){var a=r[s].split(i);if(2===a.length){var o=a[0].trim(),l=a[1].trim();t(o,l)}}}function u(e,t,i){var n=e;function r(){var t=a(e);if(null===t)throw new s(s.Errors.BadTimeStamp,"Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function u(e,t){var n=new o;l(e,(function(e,t){switch(e){case"region":for(var r=i.length-1;r>=0;r--)if(i[r].id===t){n.set(e,i[r].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var s=t.split(","),a=s[0];n.integer(e,a),n.percent(e,a)&&n.set("snapToLines",!1),n.alt(e,a,["auto"]),2===s.length&&n.alt("lineAlign",s[1],["start","center","end"]);break;case"position":s=t.split(","),n.percent(e,s[0]),2===s.length&&n.alt("positionAlign",s[1],["start","center","end"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start","center","end","left","right"]);break}}),/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");try{t.line=n.get("line","auto")}catch(r){}t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100);try{t.align=n.get("align","center")}catch(r){t.align=n.get("align","middle")}try{t.position=n.get("position","auto")}catch(r){t.position=n.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=n.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}function c(){e=e.replace(/^\s+/,"")}if(c(),t.startTime=r(),c(),"--\x3e"!==e.substr(0,3))throw new s(s.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.substr(3),c(),t.endTime=r(),c(),u(e,t)}s.prototype=r(Error.prototype),s.prototype.constructor=s,s.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},o.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var n=0;n<i.length;++n)if(t===i[n]){this.set(e,t);break}},integer:function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},percent:function(e,t){return!!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(t=parseFloat(t),t>=0&&t<=100))&&(this.set(e,t),!0)}};var c=n.createElement&&n.createElement("textarea"),h={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},d={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)"},p={v:"title",lang:"lang"},f={rt:"ruby"};function m(e,t){function i(){if(!t)return null;function e(e){return t=t.substr(e.length),e}var i=t.match(/^([^<]*)(<[^>]*>?)?/);return e(i[1]?i[1]:i[2])}function n(e){return c.innerHTML=e,e=c.textContent,c.textContent="",e}function r(e,t){return!f[t.localName]||f[t.localName]===e.localName}function s(t,i){var n=h[t];if(!n)return null;var r=e.document.createElement(n),s=p[t];return s&&i&&(r[s]=i.trim()),r}var o,l=e.document.createElement("div"),u=l,m=[];while(null!==(o=i()))if("<"!==o[0])u.appendChild(e.document.createTextNode(n(o)));else{if("/"===o[1]){m.length&&m[m.length-1]===o.substr(2).replace(">","")&&(m.pop(),u=u.parentNode);continue}var g,y=a(o.substr(1,o.length-2));if(y){g=e.document.createProcessingInstruction("timestamp",y),u.appendChild(g);continue}var v=o.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!v)continue;if(g=s(v[1],v[3]),!g)continue;if(!r(u,g))continue;if(v[2]){var _=v[2].split(".");_.forEach((function(e){var t=/^bg_/.test(e),i=t?e.slice(3):e;if(d.hasOwnProperty(i)){var n=t?"background-color":"color",r=d[i];g.style[n]=r}})),g.className=_.join(" ")}m.push(v[1]),u.appendChild(g),u=g}return l}var g=[[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 y(e){for(var t=0;t<g.length;t++){var i=g[t];if(e>=i[0]&&e<=i[1])return!0}return!1}function v(e){var t,i=[],n="";if(!e||!e.childNodes)return"ltr";function r(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function s(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var n=i.match(/^.*(\n|\r)/);return n?(e.length=0,n[0]):i}return"ruby"===t.tagName?s(e):t.childNodes?(r(e,t),s(e)):void 0}r(i,e);while(n=s(i))for(var a=0;a<n.length;a++)if(t=n.charCodeAt(a),y(t))return"rtl";return"ltr"}function _(e){if("number"===typeof e.line&&(e.snapToLines||e.line>=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,n=0,r=0;r<i.length&&i[r]!==t;r++)"showing"===i[r].mode&&n++;return-1*++n}function b(){}function T(e,t,i){b.call(this),this.cue=t,this.cueDiv=m(e,t.text);var n={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:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(n,this.cueDiv),this.div=e.document.createElement("div"),n={direction:v(this.cueDiv),writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===t.align?"center":t.align,font:i.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(n),this.div.appendChild(this.cueDiv);var r=0;switch(t.positionAlign){case"start":case"line-left":r=t.position;break;case"center":r=t.position-t.size/2;break;case"end":case"line-right":r=t.position-t.size;break}""===t.vertical?this.applyStyles({left:this.formatStyle(r,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(r,"%"),height:this.formatStyle(t.size,"%")}),this.move=function(e){this.applyStyles({top:this.formatStyle(e.top,"px"),bottom:this.formatStyle(e.bottom,"px"),left:this.formatStyle(e.left,"px"),right:this.formatStyle(e.right,"px"),height:this.formatStyle(e.height,"px"),width:this.formatStyle(e.width,"px")})}}function S(e){var t,i,n,r;if(e.div){i=e.div.offsetHeight,n=e.div.offsetWidth,r=e.div.offsetTop;var s=(s=e.div.childNodes)&&(s=s[0])&&s.getClientRects&&s.getClientRects();e=e.div.getBoundingClientRect(),t=s?Math.max(s[0]&&s[0].height||0,e.height/s.length):0}this.left=e.left,this.right=e.right,this.top=e.top||r,this.height=e.height||i,this.bottom=e.bottom||r+(e.height||i),this.width=e.width||n,this.lineHeight=void 0!==t?t:e.lineHeight}function k(e,t,i,n){function r(e,t){for(var r,s=new S(e),a=1,o=0;o<t.length;o++){while(e.overlapsOppositeAxis(i,t[o])||e.within(i)&&e.overlapsAny(n))e.move(t[o]);if(e.within(i))return e;var l=e.intersectPercentage(i);a>l&&(r=new S(e),a=l),e=new S(s)}return r||s}var s=new S(t),a=t.cue,o=_(a),l=[];if(a.snapToLines){var u;switch(a.vertical){case"":l=["+y","-y"],u="height";break;case"rl":l=["+x","-x"],u="width";break;case"lr":l=["-x","+x"],u="width";break}var c=s.lineHeight,h=c*Math.round(o),d=i[u]+c,p=l[0];Math.abs(h)>d&&(h=h<0?-1:1,h*=Math.ceil(d/c)*c),o<0&&(h+=""===a.vertical?i.height:i.width,l=l.reverse()),s.move(p,h)}else{var f=s.lineHeight/i.height*100;switch(a.lineAlign){case"center":o-=f/2;break;case"end":o-=f;break}switch(a.vertical){case"":t.applyStyles({top:t.formatStyle(o,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(o,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(o,"%")});break}l=["+y","-x","+x","-y"],s=new S(t)}var m=r(s,l);t.move(m.toCSSCompatValues(i))}function E(){}b.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},b.prototype.formatStyle=function(e,t){return 0===e?0:e+t},T.prototype=r(b.prototype),T.prototype.constructor=T,S.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t;break}},S.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},S.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1},S.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},S.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.left<e.left;case"-x":return this.right>e.right;case"+y":return this.top<e.top;case"-y":return this.bottom>e.bottom}},S.prototype.intersectPercentage=function(e){var t=Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left)),i=Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top)),n=t*i;return n/(this.height*this.width)},S.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},S.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e;var r={left:e.left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i};return r},E.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!==typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},E.convertCueToDOMTree=function(e,t){return e&&t?m(e,t):null};var w=.05,C="sans-serif",x="1.5%";E.processCues=function(e,t,i){if(!e||!t||!i)return null;while(i.firstChild)i.removeChild(i.firstChild);var n=e.document.createElement("div");function r(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return!0;return!1}if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin=x,i.appendChild(n),r(t)){var s=[],a=S.getSimpleBoxPosition(n),o=Math.round(a.height*w*100)/100,l={font:o+"px "+C};(function(){for(var i,r,o=0;o<t.length;o++)r=t[o],i=new T(e,r,l),n.appendChild(i.div),k(e,i,a,s),r.displayState=i.div,s.push(S.getSimpleBoxPosition(i))})()}else for(var u=0;u<t.length;u++)n.appendChild(t[u].displayState)},E.Parser=function(e,t,i){i||(i=t,t={}),t||(t={}),this.window=e,this.vttjs=t,this.state="INITIAL",this.buffer="",this.decoder=i||new TextDecoder("utf8"),this.regionList=[]},E.Parser.prototype={reportOrThrowError:function(e){if(!(e instanceof s))throw e;this.onparsingerror&&this.onparsingerror(e)},parse:function(e){var t=this;function i(){var e=t.buffer,i=0;while(i<e.length&&"\r"!==e[i]&&"\n"!==e[i])++i;var n=e.substr(0,i);return"\r"===e[i]&&++i,"\n"===e[i]&&++i,t.buffer=e.substr(i),n}function n(e){var i=new o;if(l(e,(function(e,t){switch(e){case"id":i.set(e,t);break;case"width":i.percent(e,t);break;case"lines":i.integer(e,t);break;case"regionanchor":case"viewportanchor":var n=t.split(",");if(2!==n.length)break;var r=new o;if(r.percent("x",n[0]),r.percent("y",n[1]),!r.has("x")||!r.has("y"))break;i.set(e+"X",r.get("x")),i.set(e+"Y",r.get("y"));break;case"scroll":i.alt(e,t,["up"]);break}}),/=/,/\s/),i.has("id")){var n=new(t.vttjs.VTTRegion||t.window.VTTRegion);n.width=i.get("width",100),n.lines=i.get("lines",3),n.regionAnchorX=i.get("regionanchorX",0),n.regionAnchorY=i.get("regionanchorY",100),n.viewportAnchorX=i.get("viewportanchorX",0),n.viewportAnchorY=i.get("viewportanchorY",100),n.scroll=i.get("scroll",""),t.onregion&&t.onregion(n),t.regionList.push({id:i.get("id"),region:n})}}function r(e){var i=new o;l(e,(function(e,t){switch(e){case"MPEGT":i.integer(e+"S",t);break;case"LOCA":i.set(e+"L",a(t));break}}),/[^\d]:/,/,/),t.ontimestampmap&&t.ontimestampmap({MPEGTS:i.get("MPEGTS"),LOCAL:i.get("LOCAL")})}function c(e){e.match(/X-TIMESTAMP-MAP/)?l(e,(function(e,t){switch(e){case"X-TIMESTAMP-MAP":r(t);break}}),/=/):l(e,(function(e,t){switch(e){case"Region":n(t);break}}),/:/)}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{var h;if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;h=i();var d=h.match(/^WEBVTT([ \t].*)?$/);if(!d||!d[0])throw new s(s.Errors.BadSignature);t.state="HEADER"}var p=!1;while(t.buffer){if(!/\r\n|\n/.test(t.buffer))return this;switch(p?p=!1:h=i(),t.state){case"HEADER":/:/.test(h)?c(h):h||(t.state="ID");continue;case"NOTE":h||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(h)){t.state="NOTE";break}if(!h)continue;t.cue=new(t.vttjs.VTTCue||t.window.VTTCue)(0,0,"");try{t.cue.align="center"}catch(m){t.cue.align="middle"}if(t.state="CUE",-1===h.indexOf("--\x3e")){t.cue.id=h;continue}case"CUE":try{u(h,t.cue,t.regionList)}catch(m){t.reportOrThrowError(m),t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":var f=-1!==h.indexOf("--\x3e");if(!h||f&&(p=!0)){t.oncue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}t.cue.text&&(t.cue.text+="\n"),t.cue.text+=h.replace(/\u2028/g,"\n").replace(/u2029/g,"\n");continue;case"BADCUE":h||(t.state="ID");continue}}}catch(m){t.reportOrThrowError(m),"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state)throw new s(s.Errors.BadSignature)}catch(t){e.reportOrThrowError(t)}return e.onflush&&e.onflush(),this}},e.exports=E},d136:function(e,t,i){(function(t){var i=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,n=/^(?=([^\/?#]*))\1([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,a={buildAbsoluteURL:function(e,t,i){if(i=i||{},e=e.trim(),t=t.trim(),!t){if(!i.alwaysNormalize)return e;var r=a.parseURL(e);if(!r)throw new Error("Error trying to parse base URL.");return r.path=a.normalizePath(r.path),a.buildURLFromParts(r)}var s=a.parseURL(t);if(!s)throw new Error("Error trying to parse relative URL.");if(s.scheme)return i.alwaysNormalize?(s.path=a.normalizePath(s.path),a.buildURLFromParts(s)):t;var o=a.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var l=n.exec(o.path);o.netLoc=l[1],o.path=l[2]}o.netLoc&&!o.path&&(o.path="/");var u={scheme:o.scheme,netLoc:s.netLoc,path:null,params:s.params,query:s.query,fragment:s.fragment};if(!s.netLoc&&(u.netLoc=o.netLoc,"/"!==s.path[0]))if(s.path){var c=o.path,h=c.substring(0,c.lastIndexOf("/")+1)+s.path;u.path=a.normalizePath(h)}else u.path=o.path,s.params||(u.params=o.params,s.query||(u.query=o.query));return null===u.path&&(u.path=i.alwaysNormalize?a.normalizePath(s.path):s.path),a.buildURLFromParts(u)},parseURL:function(e){var t=i.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){e=e.split("").reverse().join("").replace(r,"");while(e.length!==(e=e.replace(s,"")).length);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};e.exports=a})()},d36f:function(e,t,i){"use strict";var n;n=function(e,t){var i,r=0,s=16384,a=function(e,t){var i,n=e.position+t;n<e.bytes.byteLength||(i=new Uint8Array(2*n),i.set(e.bytes.subarray(0,e.position),0),e.bytes=i,e.view=new DataView(e.bytes.buffer))},o=n.widthBytes||new Uint8Array("width".length),l=n.heightBytes||new Uint8Array("height".length),u=n.videocodecidBytes||new Uint8Array("videocodecid".length);if(!n.widthBytes){for(i=0;i<"width".length;i++)o[i]="width".charCodeAt(i);for(i=0;i<"height".length;i++)l[i]="height".charCodeAt(i);for(i=0;i<"videocodecid".length;i++)u[i]="videocodecid".charCodeAt(i);n.widthBytes=o,n.heightBytes=l,n.videocodecidBytes=u}switch(this.keyFrame=!1,e){case n.VIDEO_TAG:this.length=16,s*=6;break;case n.AUDIO_TAG:this.length=13,this.keyFrame=!0;break;case n.METADATA_TAG:this.length=29,this.keyFrame=!0;break;default:throw new Error("Unknown FLV tag type")}this.bytes=new Uint8Array(s),this.view=new DataView(this.bytes.buffer),this.bytes[0]=e,this.position=this.length,this.keyFrame=t,this.pts=0,this.dts=0,this.writeBytes=function(e,t,i){var n,r=t||0;i=i||e.byteLength,n=r+i,a(this,i),this.bytes.set(e.subarray(r,n),this.position),this.position+=i,this.length=Math.max(this.length,this.position)},this.writeByte=function(e){a(this,1),this.bytes[this.position]=e,this.position++,this.length=Math.max(this.length,this.position)},this.writeShort=function(e){a(this,2),this.view.setUint16(this.position,e),this.position+=2,this.length=Math.max(this.length,this.position)},this.negIndex=function(e){return this.bytes[this.length-e]},this.nalUnitSize=function(){return 0===r?0:this.length-(r+4)},this.startNalUnit=function(){if(r>0)throw new Error("Attempted to create new NAL wihout closing the old one");r=this.length,this.length+=4,this.position=this.length},this.endNalUnit=function(e){var t,i;this.length===r+4?this.length-=4:r>0&&(t=r+4,i=this.length-t,this.position=r,this.view.setUint32(this.position,i),this.position=this.length,e&&e.push(this.bytes.subarray(t,t+i))),r=0},this.writeMetaDataDouble=function(e,t){var i;if(a(this,2+e.length+9),this.view.setUint16(this.position,e.length),this.position+=2,"width"===e)this.bytes.set(o,this.position),this.position+=5;else if("height"===e)this.bytes.set(l,this.position),this.position+=6;else if("videocodecid"===e)this.bytes.set(u,this.position),this.position+=12;else for(i=0;i<e.length;i++)this.bytes[this.position]=e.charCodeAt(i),this.position++;this.position++,this.view.setFloat64(this.position,t),this.position+=8,this.length=Math.max(this.length,this.position),++r},this.writeMetaDataBoolean=function(e,t){var i;for(a(this,2),this.view.setUint16(this.position,e.length),this.position+=2,i=0;i<e.length;i++)a(this,1),this.bytes[this.position]=e.charCodeAt(i),this.position++;a(this,2),this.view.setUint8(this.position,1),this.position++,this.view.setUint8(this.position,t?1:0),this.position++,this.length=Math.max(this.length,this.position),++r},this.finalize=function(){var e,i;switch(this.bytes[0]){case n.VIDEO_TAG:this.bytes[11]=7|(this.keyFrame||t?16:32),this.bytes[12]=t?0:1,e=this.pts-this.dts,this.bytes[13]=(16711680&e)>>>16,this.bytes[14]=(65280&e)>>>8,this.bytes[15]=(255&e)>>>0;break;case n.AUDIO_TAG:this.bytes[11]=175,this.bytes[12]=t?0:1;break;case n.METADATA_TAG:this.position=11,this.view.setUint8(this.position,2),this.position++,this.view.setUint16(this.position,10),this.position+=2,this.bytes.set([111,110,77,101,116,97,68,97,116,97],this.position),this.position+=10,this.bytes[this.position]=8,this.position++,this.view.setUint32(this.position,r),this.position=this.length,this.bytes.set([0,0,9],this.position),this.position+=3,this.length=this.position;break}return i=this.length-11,this.bytes[1]=(16711680&i)>>>16,this.bytes[2]=(65280&i)>>>8,this.bytes[3]=(255&i)>>>0,this.bytes[4]=(16711680&this.dts)>>>16,this.bytes[5]=(65280&this.dts)>>>8,this.bytes[6]=(255&this.dts)>>>0,this.bytes[7]=(4278190080&this.dts)>>>24,this.bytes[8]=0,this.bytes[9]=0,this.bytes[10]=0,a(this,4),this.view.setUint32(this.length,this.length),this.length+=4,this.position+=4,this.bytes=this.bytes.subarray(0,this.length),this.frameTime=n.frameTime(this.bytes),this}},n.AUDIO_TAG=8,n.VIDEO_TAG=9,n.METADATA_TAG=18,n.isAudioFrame=function(e){return n.AUDIO_TAG===e[0]},n.isVideoFrame=function(e){return n.VIDEO_TAG===e[0]},n.isMetaData=function(e){return n.METADATA_TAG===e[0]},n.isKeyFrame=function(e){return n.isVideoFrame(e)?23===e[11]:!!n.isAudioFrame(e)||!!n.isMetaData(e)},n.frameTime=function(e){var t=e[4]<<16;return t|=e[5]<<8,t|=e[6]<<0,t|=e[7]<<24,t},e.exports=n},d3ae:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){var i=[],n=!0,r=!1,s=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0)if(i.push(a.value),t&&i.length===t)break}catch(l){r=!0,s=l}finally{try{!n&&o["return"]&&o["return"]()}finally{if(r)throw s}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();function r(e){return e&&e.__esModule?e:{default:e}}var s=i("e475"),a=r(s),o=1/30,l=3*o,u=function(e,t){var i=n(t,2),r=i[0],s=i[1];return Math.min(Math.max(r,e),s)},c=function(e,t){var i=[],n=void 0;if(e&&e.length)for(n=0;n<e.length;n++)t(e.start(n),e.end(n))&&i.push([e.start(n),e.end(n)]);return a["default"].createTimeRanges(i)},h=function(e,t){return c(e,(function(e,i){return e-o<=t&&i+o>=t}))},d=function(e,t){return c(e,(function(e){return e-o>=t}))},p=function(e){if(e.length<2)return a["default"].createTimeRanges();for(var t=[],i=1;i<e.length;i++){var n=e.end(i-1),r=e.start(i);t.push([n,r])}return a["default"].createTimeRanges(t)},f=function(e,t){var i=void 0,n=void 0,r=void 0,s=[],a=[],o=function(e){return e[0]<=r&&e[1]>=r};if(e)for(i=0;i<e.length;i++)n=e.start(i),r=e.end(i),a.push([n,r]);if(t)for(i=0;i<t.length;i++)n=t.start(i),r=t.end(i),a.some(o)||s.push(r);return 1!==s.length?null:s[0]},m=function(e,t){var i=null,n=null,r=0,s=[],o=[];if(!e||!e.length||!t||!t.length)return a["default"].createTimeRange();var l=e.length;while(l--)s.push({time:e.start(l),type:"start"}),s.push({time:e.end(l),type:"end"});l=t.length;while(l--)s.push({time:t.start(l),type:"start"}),s.push({time:t.end(l),type:"end"});for(s.sort((function(e,t){return e.time-t.time})),l=0;l<s.length;l++)"start"===s[l].type?(r++,2===r&&(i=s[l].time)):"end"===s[l].type&&(r--,1===r&&(n=s[l].time)),null!==i&&null!==n&&(o.push([i,n]),i=null,n=null);return a["default"].createTimeRanges(o)},g=function(e,t,i,n){var r=t.end(0)-t.start(0),s=e.end(0)-e.start(0),a=r-s,o=m(e,n),l=m(t,n),u=0,c=0,h=o.length;while(h--)u+=o.end(h)-o.start(h),o.start(h)===i&&(u+=a);h=l.length;while(h--)c+=l.end(h)-l.start(h);return Math.max(u,c)/r*100},y=function(e,t,i,n){var r=e+t,s=a["default"].createTimeRanges([[e,r]]),o=a["default"].createTimeRanges([[u(e,[i,r]),r]]);if(o.start(0)===o.end(0))return 0;var l=g(o,s,i,n);return isNaN(l)||l===1/0||l===-1/0?0:l},v=function(e){var t=[];if(!e||!e.length)return"";for(var i=0;i<e.length;i++)t.push(e.start(i)+" => "+e.end(i));return t.join(", ")},_=function(e,t){var i=arguments.length<=2||void 0===arguments[2]?1:arguments[2],n=e.length?e.end(e.length-1):0;return(n-t)/i};t["default"]={findRange:h,findNextRange:d,findGaps:p,findSoleUncommonTimeRangesEnd:f,getSegmentBufferedPercent:y,TIME_FUDGE_FACTOR:o,SAFE_TIME_DELTA:l,printableRange:v,timeUntilRebuffer:_},e.exports=t["default"]},d61a:function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i("e475"),s=i("be09"),a=n(s),o=function(e,t){var i=0,n=t-e.mediaSequence,r=e.segments[n];if(r){if("undefined"!==typeof r.start)return{result:r.start,precise:!0};if("undefined"!==typeof r.end)return{result:r.end-r.duration,precise:!0}}while(n--){if(r=e.segments[n],"undefined"!==typeof r.end)return{result:i+r.end,precise:!0};if(i+=r.duration,"undefined"!==typeof r.start)return{result:i+r.start,precise:!0}}return{result:i,precise:!1}},l=function(e,t){for(var i=0,n=void 0,r=t-e.mediaSequence;r<e.segments.length;r++){if(n=e.segments[r],"undefined"!==typeof n.start)return{result:n.start-i,precise:!0};if(i+=n.duration,"undefined"!==typeof n.end)return{result:n.end-i,precise:!0}}return{result:-1,precise:!1}},u=function(e,t,i){var n=void 0,r=void 0;return"undefined"===typeof t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence?0:(n=o(e,t),n.precise?n.result:(r=l(e,t),r.precise?r.result:n.result+i))},c=function(e,t,i){if(!e)return 0;if("number"!==typeof i&&(i=0),"undefined"===typeof t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return a["default"].Infinity}return u(e,t,i)};t.duration=c;var h=function(e,t,i){var n=0;if(t>i){var r=[i,t];t=r[0],i=r[1]}if(t<0){for(var s=t;s<Math.min(0,i);s++)n+=e.targetDuration;t=0}for(s=t;s<i;s++)n+=e.segments[s].duration;return n};t.sumDurations=h;var d=function(e){if(!e.segments.length)return 0;var t=e.segments.length-1,i=e.segments[t].duration||e.targetDuration,n=i+2*e.targetDuration;while(t--)if(i+=e.segments[t].duration,i>=n)break;return Math.max(0,t)};t.safeLiveIndex=d;var p=function(e,t,i){if(!e||!e.segments)return null;if(e.endList)return c(e);if(null===t)return null;t=t||0;var n=i?d(e):e.segments.length;return u(e,e.mediaSequence+n,t)};t.playlistEnd=p;var f=function(e,t){var i=!0,n=t||0,s=p(e,t,i);return null===s?(0,r.createTimeRange)():(0,r.createTimeRange)(n,s)};t.seekable=f;var m=function(e){return e-Math.floor(e)===0},g=function(e,t){if(m(t))return t+.1*e;for(var i=t.toString().split(".")[1].length,n=1;n<=i;n++){var r=Math.pow(10,n),s=t*r;if(m(s)||n===i)return(s+e)/r}},y=g.bind(null,1),v=g.bind(null,-1),_=function(e,t,i,n){var r=void 0,s=void 0,a=e.segments.length,o=t-n;if(o<0){if(i>0)for(r=i-1;r>=0;r--)if(s=e.segments[r],o+=v(s.duration),o>0)return{mediaIndex:r,startTime:n-h(e,i,r)};return{mediaIndex:0,startTime:t}}if(i<0){for(r=i;r<0;r++)if(o-=e.targetDuration,o<0)return{mediaIndex:0,startTime:t};i=0}for(r=i;r<a;r++)if(s=e.segments[r],o-=y(s.duration),o<0)return{mediaIndex:r,startTime:n+h(e,i,r)};return{mediaIndex:a-1,startTime:t}};t.getMediaInfoForTime=_;var b=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()};t.isBlacklisted=b;var T=function(e){return e.excludeUntil&&e.excludeUntil===1/0};t.isIncompatible=T;var S=function(e){var t=b(e);return!e.disabled&&!t};t.isEnabled=S;var k=function(e){return e.disabled};t.isDisabled=k;var E=function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1};t.isAes=E;var w=function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].map)return!0;return!1};t.isFmp4=w;var C=function(e,t){return t.attributes&&t.attributes[e]};t.hasAttribute=C;var x=function(e,t,i){var n=arguments.length<=3||void 0===arguments[3]?0:arguments[3];if(!C("BANDWIDTH",i))return NaN;var r=e*i.attributes.BANDWIDTH;return(r-8*n)/t};t.estimateSegmentRequestTime=x;var A=function(e,t){if(1===e.playlists.length)return!0;var i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter((function(e){return!!S(e)&&(e.attributes.BANDWIDTH||0)<i})).length};t.isLowestEnabledRendition=A,t["default"]={duration:c,seekable:f,safeLiveIndex:d,getMediaInfoForTime:_,isEnabled:S,isDisabled:k,isBlacklisted:b,isIncompatible:T,playlistEnd:p,isAes:E,isFmp4:w,hasAttribute:C,estimateSegmentRequestTime:x,isLowestEnabledRendition:A}},d749:function(e,t,i){"use strict";i.d(t,"a",(function(){return g}));var n=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(i,1),i>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n<i;++n)t[n].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),s=t.length,a=0;a<s;++a)t[a].apply(this,r)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}(),r=i("a559"),s=i.n(r),a=i("4e9a");
  22. /*! @name m3u8-parser @version 7.1.0 @license Apache-2.0 */
  23. class o extends n{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const l=String.fromCharCode(9),u=function(e){const t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),i={};return t[1]&&(i.length=parseInt(t[1],10)),t[2]&&(i.offset=parseInt(t[2],10)),i},c=function(){const e="[^=]*",t='"[^"]*"|[^,]*',i="(?:"+e+")=(?:"+t+")";return new RegExp("(?:^|,)("+i+")")},h=function(e){const t={};if(!e)return t;const i=e.split(c());let n,r=i.length;while(r--)""!==i[r]&&(n=/([^=]*)=(.*)/.exec(i[r]).slice(1),n[0]=n[0].replace(/^\s+|\s+$/g,""),n[1]=n[1].replace(/^\s+|\s+$/g,""),n[1]=n[1].replace(/^['"](.*)['"]$/g,"$1"),t[n[0]]=n[1]);return t};class d extends n{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,i;if(e=e.trim(),0===e.length)return;if("#"!==e[0])return void this.trigger("data",{type:"uri",uri:e});const n=this.tagMappers.reduce((t,i)=>{const n=i(e);return n===e?t:t.concat([n])},[e]);n.forEach(e=>{for(let t=0;t<this.customParsers.length;t++)if(this.customParsers[t].call(this,e))return;if(0===e.indexOf("#EXT"))if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e),t)this.trigger("data",{type:"tag",tagType:"m3u"});else{if(t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(e),t)return i={type:"tag",tagType:"inf"},t[1]&&(i.duration=parseFloat(t[1])),t[2]&&(i.title=t[2]),void this.trigger("data",i);if(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"targetduration"},t[1]&&(i.duration=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"version"},t[1]&&(i.version=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"media-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(e),t)return i={type:"tag",tagType:"playlist-type"},t[1]&&(i.playlistType=t[1]),void this.trigger("data",i);if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(e),t)return i=s()(u(t[1]),{type:"tag",tagType:"byterange"}),void this.trigger("data",i);if(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(e),t)return i={type:"tag",tagType:"allow-cache"},t[1]&&(i.allowed=!/NO/.test(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-MAP:(.*)$/.exec(e),t){if(i={type:"tag",tagType:"map"},t[1]){const e=h(t[1]);e.URI&&(i.uri=e.URI),e.BYTERANGE&&(i.byterange=u(e.BYTERANGE))}this.trigger("data",i)}else if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(e),t){if(i={type:"tag",tagType:"stream-inf"},t[1]){if(i.attributes=h(t[1]),i.attributes.RESOLUTION){const e=i.attributes.RESOLUTION.split("x"),t={};e[0]&&(t.width=parseInt(e[0],10)),e[1]&&(t.height=parseInt(e[1],10)),i.attributes.RESOLUTION=t}i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),i.attributes["PROGRAM-ID"]&&(i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10))}this.trigger("data",i)}else{if(t=/^#EXT-X-MEDIA:(.*)$/.exec(e),t)return i={type:"tag",tagType:"media"},t[1]&&(i.attributes=h(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-ENDLIST/.exec(e),t)this.trigger("data",{type:"tag",tagType:"endlist"});else if(t=/^#EXT-X-DISCONTINUITY/.exec(e),t)this.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(e),t)return i={type:"tag",tagType:"program-date-time"},t[1]&&(i.dateTimeString=t[1],i.dateTimeObject=new Date(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-KEY:(.*)$/.exec(e),t)return i={type:"tag",tagType:"key"},t[1]&&(i.attributes=h(t[1]),i.attributes.IV&&("0x"===i.attributes.IV.substring(0,2).toLowerCase()&&(i.attributes.IV=i.attributes.IV.substring(2)),i.attributes.IV=i.attributes.IV.match(/.{8}/g),i.attributes.IV[0]=parseInt(i.attributes.IV[0],16),i.attributes.IV[1]=parseInt(i.attributes.IV[1],16),i.attributes.IV[2]=parseInt(i.attributes.IV[2],16),i.attributes.IV[3]=parseInt(i.attributes.IV[3],16),i.attributes.IV=new Uint32Array(i.attributes.IV))),void this.trigger("data",i);if(t=/^#EXT-X-START:(.*)$/.exec(e),t)return i={type:"tag",tagType:"start"},t[1]&&(i.attributes=h(t[1]),i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]),i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)),void this.trigger("data",i);if(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-out-cont"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-out"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-CUE-IN:(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-in"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-SKIP:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"skip"},i.attributes=h(t[1]),i.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(i.attributes["SKIPPED-SEGMENTS"]=parseInt(i.attributes["SKIPPED-SEGMENTS"],10)),i.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(i.attributes["RECENTLY-REMOVED-DATERANGES"]=i.attributes["RECENTLY-REMOVED-DATERANGES"].split(l)),void this.trigger("data",i);if(t=/^#EXT-X-PART:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"part"},i.attributes=h(t[1]),["DURATION"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))})),["INDEPENDENT","GAP"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/.test(i.attributes[e]))})),i.attributes.hasOwnProperty("BYTERANGE")&&(i.attributes.byterange=u(i.attributes.BYTERANGE)),void this.trigger("data",i);if(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"server-control"},i.attributes=h(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))})),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/.test(i.attributes[e]))})),void this.trigger("data",i);if(t=/^#EXT-X-PART-INF:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"part-inf"},i.attributes=h(t[1]),["PART-TARGET"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))})),void this.trigger("data",i);if(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"preload-hint"},i.attributes=h(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach((function(e){if(i.attributes.hasOwnProperty(e)){i.attributes[e]=parseInt(i.attributes[e],10);const t="BYTERANGE-LENGTH"===e?"length":"offset";i.attributes.byterange=i.attributes.byterange||{},i.attributes.byterange[t]=i.attributes[e],delete i.attributes[e]}})),void this.trigger("data",i);if(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"rendition-report"},i.attributes=h(t[1]),["LAST-MSN","LAST-PART"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseInt(i.attributes[e],10))})),void this.trigger("data",i);if(t=/^#EXT-X-DATERANGE:(.*)$/.exec(e),t&&t[1]){i={type:"tag",tagType:"daterange"},i.attributes=h(t[1]),["ID","CLASS"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=String(i.attributes[e]))})),["START-DATE","END-DATE"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=new Date(i.attributes[e]))})),["DURATION","PLANNED-DURATION"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))})),["END-ON-NEXT"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/i.test(i.attributes[e]))})),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=i.attributes[e].toString(16))}));const e=/^X-([A-Z]+-)+[A-Z]+$/;for(const t in i.attributes){if(!e.test(t))continue;const n=/[0-9A-Fa-f]{6}/g.test(i.attributes[t]),r=/^\d+(\.\d+)?$/.test(i.attributes[t]);i.attributes[t]=n?i.attributes[t].toString(16):r?parseFloat(i.attributes[t]):String(i.attributes[t])}this.trigger("data",i)}else if(t=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(e),t)this.trigger("data",{type:"tag",tagType:"independent-segments"});else{if(t=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(e),t)return i={type:"tag",tagType:"content-steering"},i.attributes=h(t[1]),void this.trigger("data",i);this.trigger("data",{type:"tag",data:e.slice(4)})}}}}else this.trigger("data",{type:"comment",text:e.slice(1)})})}addParser({expression:e,customType:t,dataParser:i,segment:n}){"function"!==typeof i&&(i=e=>e),this.customParsers.push(r=>{const s=e.exec(r);if(s)return this.trigger("data",{type:"custom",data:i(r),customType:t,segment:n}),!0})}addTagMapper({expression:e,map:t}){const i=i=>e.test(i)?t(i):i;this.tagMappers.push(i)}}const p=e=>e.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),f=function(e){const t={};return Object.keys(e).forEach((function(i){t[p(i)]=e[i]})),t},m=function(e){const{serverControl:t,targetDuration:i,partTargetDuration:n}=e;if(!t)return;const r="#EXT-X-SERVER-CONTROL",s="holdBack",a="partHoldBack",o=i&&3*i,l=n&&2*n;i&&!t.hasOwnProperty(s)&&(t[s]=o,this.trigger("info",{message:`${r} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})),o&&t[s]<o&&(this.trigger("warn",{message:`${r} clamping HOLD-BACK (${t[s]}) to targetDuration * 3 (${o})`}),t[s]=o),n&&!t.hasOwnProperty(a)&&(t[a]=3*n,this.trigger("info",{message:`${r} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${t[a]}).`})),n&&t[a]<l&&(this.trigger("warn",{message:`${r} clamping PART-HOLD-BACK (${t[a]}) to partTargetDuration * 2 (${l}).`}),t[a]=l)};class g extends n{constructor(){super(),this.lineStream=new o,this.parseStream=new d,this.lineStream.pipe(this.parseStream),this.lastProgramDateTime=null;const e=this,t=[];let i,n,r={},l=!1;const u=function(){},c={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},h="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";let p=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],segments:[]};let g=0,y=0;const v={};this.on("end",()=>{r.uri||!r.parts&&!r.preloadHints||(!r.map&&i&&(r.map=i),!r.key&&n&&(r.key=n),r.timeline||"number"!==typeof p||(r.timeline=p),this.manifest.preloadSegment=r)}),this.parseStream.on("data",(function(o){let d,_;({tag(){({version(){o.version&&(this.manifest.version=o.version)},"allow-cache"(){this.manifest.allowCache=o.allowed,"allowed"in o||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const e={};"length"in o&&(r.byterange=e,e.length=o.length,"offset"in o||(o.offset=g)),"offset"in o&&(r.byterange=e,e.offset=o.offset),g=e.offset+e.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"})),o.title&&(r.title=o.title),o.duration>0&&(r.duration=o.duration),0===o.duration&&(r.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=t},key(){if(o.attributes)if("NONE"!==o.attributes.METHOD)if(o.attributes.URI){if("com.apple.streamingkeydelivery"===o.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:o.attributes});if("com.microsoft.playready"===o.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:o.attributes.URI});if(o.attributes.KEYFORMAT===h){const e=["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"];return-1===e.indexOf(o.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===o.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==o.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):o.attributes.KEYID&&"0x"===o.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:o.attributes.KEYFORMAT,keyId:o.attributes.KEYID.substring(2)},pssh:Object(a["a"])(o.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}))}o.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),n={method:o.attributes.METHOD||"AES-128",uri:o.attributes.URI},"undefined"!==typeof o.attributes.IV&&(n.iv=o.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else n=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence"(){isFinite(o.number)?this.manifest.mediaSequence=o.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+o.number})},"discontinuity-sequence"(){isFinite(o.number)?(this.manifest.discontinuitySequence=o.number,p=o.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+o.number})},"playlist-type"(){/VOD|EVENT/.test(o.playlistType)?this.manifest.playlistType=o.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+o.playlist})},map(){i={},o.uri&&(i.uri=o.uri),o.byterange&&(i.byterange=o.byterange),n&&(i.key=n)},"stream-inf"(){this.manifest.playlists=t,this.manifest.mediaGroups=this.manifest.mediaGroups||c,o.attributes?(r.attributes||(r.attributes={}),s()(r.attributes,o.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||c,!(o.attributes&&o.attributes.TYPE&&o.attributes["GROUP-ID"]&&o.attributes.NAME))return void this.trigger("warn",{message:"ignoring incomplete or missing media group"});const e=this.manifest.mediaGroups[o.attributes.TYPE];e[o.attributes["GROUP-ID"]]=e[o.attributes["GROUP-ID"]]||{},d=e[o.attributes["GROUP-ID"]],_={default:/yes/i.test(o.attributes.DEFAULT)},_.default?_.autoselect=!0:_.autoselect=/yes/i.test(o.attributes.AUTOSELECT),o.attributes.LANGUAGE&&(_.language=o.attributes.LANGUAGE),o.attributes.URI&&(_.uri=o.attributes.URI),o.attributes["INSTREAM-ID"]&&(_.instreamId=o.attributes["INSTREAM-ID"]),o.attributes.CHARACTERISTICS&&(_.characteristics=o.attributes.CHARACTERISTICS),o.attributes.FORCED&&(_.forced=/yes/i.test(o.attributes.FORCED)),d[o.attributes.NAME]=_},discontinuity(){p+=1,r.discontinuity=!0,this.manifest.discontinuityStarts.push(t.length)},"program-date-time"(){"undefined"===typeof this.manifest.dateTimeString&&(this.manifest.dateTimeString=o.dateTimeString,this.manifest.dateTimeObject=o.dateTimeObject),r.dateTimeString=o.dateTimeString,r.dateTimeObject=o.dateTimeObject;const{lastProgramDateTime:e}=this;this.lastProgramDateTime=new Date(o.dateTimeString).getTime(),null===e&&this.manifest.segments.reduceRight((e,t)=>(t.programDateTime=e-1e3*t.duration,t.programDateTime),this.lastProgramDateTime)},targetduration(){!isFinite(o.duration)||o.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+o.duration}):(this.manifest.targetDuration=o.duration,m.call(this,this.manifest))},start(){o.attributes&&!isNaN(o.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:o.attributes["TIME-OFFSET"],precise:o.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out"(){r.cueOut=o.data},"cue-out-cont"(){r.cueOutCont=o.data},"cue-in"(){r.cueIn=o.data},skip(){this.manifest.skip=f(o.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",o.attributes,["SKIPPED-SEGMENTS"])},part(){l=!0;const e=this.manifest.segments.length,t=f(o.attributes);r.parts=r.parts||[],r.parts.push(t),t.byterange&&(t.byterange.hasOwnProperty("offset")||(t.byterange.offset=y),y=t.byterange.offset+t.byterange.length);const i=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${i} for segment #${e}`,o.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((e,t)=>{e.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${t} lacks required attribute(s): LAST-PART`})})},"server-control"(){const e=this.manifest.serverControl=f(o.attributes);e.hasOwnProperty("canBlockReload")||(e.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),m.call(this,this.manifest),e.canSkipDateranges&&!e.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 e=this.manifest.segments.length,t=f(o.attributes),i=t.type&&"PART"===t.type;r.preloadHints=r.preloadHints||[],r.preloadHints.push(t),t.byterange&&(t.byterange.hasOwnProperty("offset")||(t.byterange.offset=i?y:0,i&&(y=t.byterange.offset+t.byterange.length)));const n=r.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${n} for segment #${e}`,o.attributes,["TYPE","URI"]),t.type)for(let s=0;s<r.preloadHints.length-1;s++){const i=r.preloadHints[s];i.type&&(i.type===t.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${n} for segment #${e} has the same TYPE ${t.type} as preload hint #${s}`}))}},"rendition-report"(){const e=f(o.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(e);const t=this.manifest.renditionReports.length-1,i=["LAST-MSN","URI"];l&&i.push("LAST-PART"),this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #"+t,o.attributes,i)},"part-inf"(){this.manifest.partInf=f(o.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",o.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),m.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(f(o.attributes));const e=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_("#EXT-X-DATERANGE #"+e,o.attributes,["ID","START-DATE"]);const t=this.manifest.dateRanges[e];t.endDate&&t.startDate&&new Date(t.endDate)<new Date(t.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),t.duration&&t.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),t.plannedDuration&&t.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});const i=!!t.endOnNext;if(i&&!t.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"}),i&&(t.duration||t.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),t.duration&&t.endDate){const i=t.startDate,n=i.getTime()+1e3*t.duration;this.manifest.dateRanges[e].endDate=new Date(n)}if(v[t.id]){for(const i in v[t.id])if(t[i]&&JSON.stringify(v[t.id][i])!==JSON.stringify(t[i])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}const e=this.manifest.dateRanges.findIndex(e=>e.id===t.id);this.manifest.dateRanges[e]=s()(this.manifest.dateRanges[e],t),v[t.id]=s()(v[t.id],t),this.manifest.dateRanges.pop()}else v[t.id]=t},"independent-segments"(){this.manifest.independentSegments=!0},"content-steering"(){this.manifest.contentSteering=f(o.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",o.attributes,["SERVER-URI"])}}[o.tagType]||u).call(e)},uri(){r.uri=o.uri,t.push(r),this.manifest.targetDuration&&!("duration"in r)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),r.duration=this.manifest.targetDuration),n&&(r.key=n),r.timeline=p,i&&(r.map=i),y=0,null!==this.lastProgramDateTime&&(r.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=1e3*r.duration),r={}},comment(){},custom(){o.segment?(r.custom=r.custom||{},r.custom[o.customType]=o.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[o.customType]=o.data)}})[o.type].call(e)}))}warnOnMissingAttributes_(e,t,i){const n=[];i.forEach((function(e){t.hasOwnProperty(e)||n.push(e)})),n.length&&this.trigger("warn",{message:`${e} lacks required attribute(s): ${n.join(", ")}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push("\n"),this.manifest.dateRanges.length&&null===this.lastProgramDateTime&&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)}}},d8c8:function(e,t,i){"use strict";var n=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],r=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},s=function(e,t,i){var n,r="";for(n=t;n<i;n++)r+="%"+("00"+e[n].toString(16)).slice(-2);return r},a=function(e,t,i){return unescape(s(e,t,i))},o=function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],n=e[t+5],r=(16&n)>>4;return r?i+20:i+10},l=function(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3,r=6144&e[t+3];return r|n|i},u=function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&240===(240&e[t+1])?"audio":null},c=function(e){var t=0;while(t+5<e.length){if(255===e[t]&&240===(246&e[t+1]))return n[(60&e[t+2])>>>2];t++}return null},h=function(e){var t,i,n,s;t=10,64&e[5]&&(t+=4,t+=r(e.subarray(10,14)));do{if(i=r(e.subarray(t+4,t+8)),i<1)return null;if(s=String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3]),"PRIV"===s){n=e.subarray(t+10,t+i+10);for(var o=0;o<n.byteLength;o++)if(0===n[o]){var l=a(n,0,o);if("com.apple.streaming.transportStreamTimestamp"===l){var u=n.subarray(o+1),c=(1&u[3])<<30|u[4]<<22|u[5]<<14|u[6]<<6|u[7]>>>2;return c*=4,c+=3&u[7],c}break}}t+=10,t+=i}while(t<e.byteLength);return null};e.exports={parseId3TagSize:o,parseAdtsSize:l,parseType:u,parseSampleRate:c,parseAacTimestamp:h}},db3d:function(e,t,i){"use strict";var n=4,r=128,s=i("0129"),a=function(e){var t=0,i={payloadType:-1,payloadSize:0},s=0,a=0;while(t<e.byteLength){if(e[t]===r)break;while(255===e[t])s+=255,t++;s+=e[t++];while(255===e[t])a+=255,t++;if(a+=e[t++],!i.payload&&s===n){i.payloadType=s,i.payloadSize=a,i.payload=e.subarray(t,t+a);break}t+=a,s=0,a=0}return i},o=function(e){return 181!==e.payload[0]||49!==(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},l=function(e,t){var i,n,r,s,a=[];if(!(64&t[0]))return a;for(n=31&t[0],i=0;i<n;i++)r=3*i,s={type:3&t[r+2],pts:e},4&t[r+2]&&(s.ccData=t[r+3]<<8|t[r+4],a.push(s));return a},u=function(){u.prototype.init.call(this),this.captionPackets_=[],this.ccStreams_=[new m(0,0),new m(0,1),new m(1,0),new m(1,1)],this.reset(),this.ccStreams_.forEach((function(e){e.on("data",this.trigger.bind(this,"data")),e.on("done",this.trigger.bind(this,"done"))}),this)};u.prototype=new s,u.prototype.push=function(e){var t,i;"sei_rbsp"===e.nalUnitType&&(t=a(e.escapedRBSP),t.payloadType===n&&(i=o(t),i&&(e.dts<this.latestDts_?this.ignoreNextEqualDts_=!0:e.dts===this.latestDts_&&this.ignoreNextEqualDts_?this.ignoreNextEqualDts_=!1:(this.captionPackets_=this.captionPackets_.concat(l(e.pts,i)),this.latestDts_=e.dts))))},u.prototype.flush=function(){this.captionPackets_.length?(this.captionPackets_.forEach((function(e,t){e.presortIndex=t})),this.captionPackets_.sort((function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts})),this.captionPackets_.forEach((function(e){e.type<2&&this.dispatchCea608Packet(e)}),this),this.captionPackets_.length=0,this.ccStreams_.forEach((function(e){e.flush()}),this)):this.ccStreams_.forEach((function(e){e.flush()}),this)},u.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(e){e.reset()}))},u.prototype.dispatchCea608Packet=function(e){this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},u.prototype.setsChannel1Active=function(e){return 4096===(30720&e.ccData)},u.prototype.setsChannel2Active=function(e){return 6144===(30720&e.ccData)};var c={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},h=function(e){return null===e?"":(e=c[e]||e,String.fromCharCode(e))},d=14,p=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],f=function(){var e=[],t=d+1;while(t--)e.push("");return e},m=function(e,t){m.prototype.init.call(this),this.field_=e||0,this.dataChannel_=t||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,i,n,r,s;if(t=32639&e.ccData,t!==this.lastControlCode_){if(4096===(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),n=t>>>8,r=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.topRow_=d-1,this.mode_="rollUp";else if(t===this.ROLL_UP_3_ROWS_)this.topRow_=d-2,this.mode_="rollUp";else if(t===this.ROLL_UP_4_ROWS_)this.topRow_=d-3,this.mode_="rollUp";else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[d]=this.nonDisplayed_[d].slice(0,-1):this.displayed_[d]=this.displayed_[d].slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=f();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=f();else if(t===this.RESUME_DIRECT_CAPTIONING_)this.mode_="paintOn";else if(this.isSpecialCharacter(n,r))n=(3&n)<<8,s=h(n|r),this[this.mode_](e.pts,s),this.column_++;else if(this.isExtCharacter(n,r))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[d]=this.displayed_[d].slice(0,-1),n=(3&n)<<8,s=h(n|r),this[this.mode_](e.pts,s),this.column_++;else if(this.isMidRowCode(n,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14===(14&r)&&this.addFormatting(e.pts,["i"]),1===(1&r)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(n,r))this.column_+=3&r;else if(this.isPAC(n,r)){var a=p.indexOf(7968&t);a!==this.row_&&(this.clearFormatting(e.pts),this.row_=a),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16===(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(r)&&14===(14&r)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(n)&&(0===r&&(r=null),s=h(n),s+=h(r),this[this.mode_](e.pts,s),this.column_+=s.length)}else this.lastControlCode_=null}};m.prototype=new s,m.prototype.flushDisplayed=function(e){var t=this.displayed_.map((function(e){return e.trim()})).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},m.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=f(),this.nonDisplayed_=f(),this.lastControlCode_=null,this.column_=0,this.row_=d,this.formatting_=[]},m.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},m.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},m.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},m.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},m.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},m.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},m.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},m.prototype.isNormalChar=function(e){return e>=32&&e<=127},m.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var i=t.reduce((function(e,t){return e+"<"+t+">"}),"");this[this.mode_](e,i)},m.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce((function(e,t){return e+"</"+t+">"}),"");this.formatting_=[],this[this.mode_](e,t)}},m.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_];i+=t,this.nonDisplayed_[this.row_]=i},m.prototype.rollUp=function(e,t){var i=this.displayed_[d];i+=t,this.displayed_[d]=i},m.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++)this.displayed_[e]="";for(e=this.topRow_;e<d;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[d]=""},m.prototype.paintOn=function(){},e.exports={CaptionStream:u,Cea608Stream:m}},de2e:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=function(e,t,i){var n=!0;while(n){var r=e,s=t,a=i;n=!1,null===r&&(r=Function.prototype);var o=Object.getOwnPropertyDescriptor(r,s);if(void 0!==o){if("value"in o)return o.value;var l=o.get;if(void 0===l)return;return l.call(a)}var u=Object.getPrototypeOf(r);if(null===u)return;e=u,t=s,i=a,n=!0,o=u=void 0}};function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=i("e9b0"),u=s(l),c=function(e){function t(){a(this,t),r(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,u["default"]),this.jobs=[],this.delay=1,this.timeout_=null}return o(t,e),n(t,[{key:"processJob_",value:function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}},{key:"push",value:function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}]),t}(u["default"]);t["default"]=c,e.exports=t["default"]},de66:function(e,t,i){"use strict";i.d(t,"g",(function(){return l})),i.d(t,"e",(function(){return u})),i.d(t,"k",(function(){return h})),i.d(t,"j",(function(){return d})),i.d(t,"i",(function(){return p})),i.d(t,"b",(function(){return g})),i.d(t,"f",(function(){return y})),i.d(t,"c",(function(){return v})),i.d(t,"h",(function(){return _})),i.d(t,"d",(function(){return b})),i.d(t,"a",(function(){return T}));var n=i("be09"),r=i.n(n),s=function(e,t){var i="";while(t--)i+=e;return i},a=function(e){return e.toString(2).length},o=function(e){return Math.ceil(a(e)/8)},l=function(e,t,i){return void 0===i&&(i=" "),(s(i,t)+e.toString()).slice(-t)},u=function(e){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},c=function(e){return u(e)},h=function(e){return e instanceof Uint8Array?e:(Array.isArray(e)||c(e)||e instanceof ArrayBuffer||(e="number"!==typeof e||"number"===typeof e&&e!==e?0:[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},d=function(e){e=h(e);for(var t="",i=0;i<e.length;i++)t+=l(e[i].toString(16),2,"0");return t},p=function(e){e=h(e);for(var t="",i=0;i<e.length;i++)t+=l(e[i].toString(2),8,"0");return t},f=r.a.BigInt||Number,m=[f("0x1"),f("0x100"),f("0x10000"),f("0x1000000"),f("0x100000000"),f("0x10000000000"),f("0x1000000000000"),f("0x100000000000000"),f("0x10000000000000000")],g=(function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);255===t[0]||t[0]}(),function(e,t){var i=void 0===t?{}:t,n=i.signed,r=void 0!==n&&n,s=i.le,a=void 0!==s&&s;e=h(e);var o=a?"reduce":"reduceRight",l=e[o]?e[o]:Array.prototype[o],u=l.call(e,(function(t,i,n){var r=a?n:Math.abs(n+1-e.length);return t+f(i)*m[r]}),f(0));if(r){var c=m[e.length]/f(2)-f(1);u=f(u),u>c&&(u-=c,u-=c,u-=f(2))}return Number(u)}),y=function(e,t){var i=void 0===t?{}:t,n=i.le,r=void 0!==n&&n;("bigint"!==typeof e&&"number"!==typeof e||"number"===typeof e&&e!==e)&&(e=0),e=f(e);for(var s=o(e),a=new Uint8Array(new ArrayBuffer(s)),l=0;l<s;l++){var u=r?l:Math.abs(l+1-a.length);a[u]=Number(e/m[l]&f(255)),e<0&&(a[u]=Math.abs(~a[u]),a[u]-=0===l?1:2)}return a},v=function(e){if(!e)return"";e=Array.prototype.slice.call(e);var t=String.fromCharCode.apply(null,h(e));try{return decodeURIComponent(escape(t))}catch(i){}return t},_=function(e,t){if("string"!==typeof e&&e&&"function"===typeof e.toString&&(e=e.toString()),"string"!==typeof e)return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var i=new Uint8Array(e.length),n=0;n<e.length;n++)i[n]=e.charCodeAt(n);return i},b=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];if(t=t.filter((function(e){return e&&(e.byteLength||e.length)&&"string"!==typeof e})),t.length<=1)return h(t[0]);var n=t.reduce((function(e,t,i){return e+(t.byteLength||t.length)}),0),r=new Uint8Array(n),s=0;return t.forEach((function(e){e=h(e),r.set(e,s),s+=e.byteLength})),r},T=function(e,t,i){var n=void 0===i?{}:i,r=n.offset,s=void 0===r?0:r,a=n.mask,o=void 0===a?[]:a;e=h(e),t=h(t);var l=t.every?t.every:Array.prototype.every;return t.length&&e.length-s>=t.length&&l.call(t,(function(t,i){var n=o[i]?o[i]&e[s+i]:e[s+i];return t===n}))}},df33:function(e,t){function i(e){if(e&&"object"===typeof e){var t=e.which||e.keyCode||e.charCode;t&&(e=t)}if("number"===typeof e)return a[e];var i=String(e),s=n[i.toLowerCase()];if(s)return s;s=r[i.toLowerCase()];return s||(1===i.length?i.charCodeAt(0):void 0)}i.isEventKey=function(e,t){if(e&&"object"===typeof e){var i=e.which||e.keyCode||e.charCode;if(null===i||void 0===i)return!1;if("string"===typeof t){var s=n[t.toLowerCase()];if(s)return s===i;s=r[t.toLowerCase()];if(s)return s===i}else if("number"===typeof t)return t===i;return!1}},t=e.exports=i;var n=t.code=t.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},r=t.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};
  24. /*!
  25. * Programatically add the following
  26. */
  27. for(s=97;s<123;s++)n[String.fromCharCode(s)]=s-32;for(var s=48;s<58;s++)n[s-48]=s;for(s=1;s<13;s++)n["f"+s]=s+111;for(s=0;s<10;s++)n["numpad "+s]=s+96;var a=t.names=t.title={};for(s in n)a[n[s]]=s;for(var o in r)n[o]=r[o]},e003:function(e,t,i){var n=i("89a7").NAMESPACE,r=/[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]/,s=new RegExp("[\\-\\.0-9"+r.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),a=new RegExp("^"+r.source+s.source+"*(?::"+r.source+s.source+"*)?$"),o=0,l=1,u=2,c=3,h=4,d=5,p=6,f=7;function m(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,m)}function g(){}function y(e,t,i,r,s){function a(e){if(e>65535){e-=65536;var t=55296+(e>>10),i=56320+(1023&e);return String.fromCharCode(t,i)}return String.fromCharCode(e)}function o(e){var t=e.slice(1,-1);return Object.hasOwnProperty.call(i,t)?i[t]:"#"===t.charAt(0)?a(parseInt(t.substr(1).replace("x","0x"))):(s.error("entity not found:"+e),e)}function l(t){if(t>y){var i=e.substring(y,t).replace(/&#?\w+;/g,o);p&&u(y),r.characters(i,0,t-y),y=t}}function u(t,i){while(t>=h&&(i=d.exec(e)))c=i.index,h=c+i[0].length,p.lineNumber++;p.columnNumber=t-c+1}var c=0,h=0,d=/.*(?:\r\n?|\n)|.*$/g,p=r.locator,f=[{currentNSMap:t}],g={},y=0;while(1){try{var k=e.indexOf("<",y);if(k<0){if(!e.substr(y).match(/^\s*$/)){var x=r.doc,A=x.createTextNode(e.substr(y));x.appendChild(A),r.currentElement=A}return}switch(k>y&&l(k),e.charAt(k+1)){case"/":var I=e.indexOf(">",k+3),O=e.substring(k+2,I).replace(/[ \t\n\r]+$/g,""),P=f.pop();I<0?(O=e.substring(k+2).replace(/[\s<].*/,""),s.error("end tag name: "+O+" is not complete:"+P.tagName),I=k+1+O.length):O.match(/\s</)&&(O=O.replace(/[\s<].*/,""),s.error("end tag name: "+O+" maybe not complete"),I=k+1+O.length);var L=P.localNSMap,D=P.tagName==O,M=D||P.tagName&&P.tagName.toLowerCase()==O.toLowerCase();if(M){if(r.endElement(P.uri,P.localName,O),L)for(var R in L)Object.prototype.hasOwnProperty.call(L,R)&&r.endPrefixMapping(R);D||s.fatalError("end tag name: "+O+" is not match the current start tagName:"+P.tagName)}else f.push(P);I++;break;case"?":p&&u(k),I=w(e,k,r);break;case"!":p&&u(k),I=E(e,k,r,s);break;default:p&&u(k);var N=new C,j=f[f.length-1].currentNSMap,B=(I=_(e,k,N,j,o,s),N.length);if(!N.closed&&S(e,I,N.tagName,g)&&(N.closed=!0,i.nbsp||s.warning("unclosed xml attribute")),p&&B){for(var U=v(p,{}),F=0;F<B;F++){var q=N[F];u(q.offset),q.locator=v(p,{})}r.locator=U,b(N,r,j)&&f.push(N),r.locator=p}else b(N,r,j)&&f.push(N);n.isHTML(N.uri)&&!N.closed?I=T(e,I,N.tagName,o,r):I++}}catch(H){if(H instanceof m)throw H;s.error("element parse error: "+H),I=-1}I>y?y=I:l(Math.max(k,y)+1)}}function v(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function _(e,t,i,r,s,a){function m(e,t,n){i.attributeNames.hasOwnProperty(e)&&a.fatalError("Attribute "+e+" redefined"),i.addValue(e,t.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,s),n)}var g,y=++t,v=o;while(1){var _=e.charAt(y);switch(_){case"=":if(v===l)g=e.slice(t,y),v=c;else{if(v!==u)throw new Error("attribute equal must after attrName");v=c}break;case"'":case'"':if(v===c||v===l){if(v===l&&(a.warning('attribute value must after "="'),g=e.slice(t,y)),t=y+1,y=e.indexOf(_,t),!(y>0))throw new Error("attribute value no end '"+_+"' match");b=e.slice(t,y),m(g,b,t-1),v=d}else{if(v!=h)throw new Error('attribute value must after "="');b=e.slice(t,y),m(g,b,t),a.warning('attribute "'+g+'" missed start quot('+_+")!!"),t=y+1,v=d}break;case"/":switch(v){case o:i.setTagName(e.slice(t,y));case d:case p:case f:v=f,i.closed=!0;case h:case l:break;case u:i.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return a.error("unexpected end of input"),v==o&&i.setTagName(e.slice(t,y)),y;case">":switch(v){case o:i.setTagName(e.slice(t,y));case d:case p:case f:break;case h:case l:b=e.slice(t,y),"/"===b.slice(-1)&&(i.closed=!0,b=b.slice(0,-1));case u:v===u&&(b=g),v==h?(a.warning('attribute "'+b+'" missed quot(")!'),m(g,b,t)):(n.isHTML(r[""])&&b.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+b+'" missed value!! "'+b+'" instead!!'),m(b,b,t));break;case c:throw new Error("attribute value missed!!")}return y;case"€":_=" ";default:if(_<=" ")switch(v){case o:i.setTagName(e.slice(t,y)),v=p;break;case l:g=e.slice(t,y),v=u;break;case h:var b=e.slice(t,y);a.warning('attribute "'+b+'" missed quot(")!!'),m(g,b,t);case d:v=p;break}else switch(v){case u:i.tagName;n.isHTML(r[""])&&g.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+g+'" missed value!! "'+g+'" instead2!!'),m(g,g,t),t=y,v=l;break;case d:a.warning('attribute space is required"'+g+'"!!');case p:v=l,t=y;break;case c:v=h,t=y;break;case f:throw new Error("elements closed character '/' and '>' must be connected to")}}y++}}function b(e,t,i){var r=e.tagName,s=null,a=e.length;while(a--){var o=e[a],l=o.qName,u=o.value,c=l.indexOf(":");if(c>0)var h=o.prefix=l.slice(0,c),d=l.slice(c+1),p="xmlns"===h&&d;else d=l,h=null,p="xmlns"===l&&"";o.localName=d,!1!==p&&(null==s&&(s={},k(i,i={})),i[p]=s[p]=u,o.uri=n.XMLNS,t.startPrefixMapping(p,u))}a=e.length;while(a--){o=e[a];h=o.prefix;h&&("xml"===h&&(o.uri=n.XML),"xmlns"!==h&&(o.uri=i[h||""]))}c=r.indexOf(":");c>0?(h=e.prefix=r.slice(0,c),d=e.localName=r.slice(c+1)):(h=null,d=e.localName=r);var f=e.uri=i[h||""];if(t.startElement(f,d,r,e),!e.closed)return e.currentNSMap=i,e.localNSMap=s,!0;if(t.endElement(f,d,r),s)for(h in s)Object.prototype.hasOwnProperty.call(s,h)&&t.endPrefixMapping(h)}function T(e,t,i,n,r){if(/^(?:script|textarea)$/i.test(i)){var s=e.indexOf("</"+i+">",t),a=e.substring(t+1,s);if(/[&<]/.test(a))return/^script$/i.test(i)?(r.characters(a,0,a.length),s):(a=a.replace(/&#?\w+;/g,n),r.characters(a,0,a.length),s)}return t+1}function S(e,t,i,n){var r=n[i];return null==r&&(r=e.lastIndexOf("</"+i+">"),r<t&&(r=e.lastIndexOf("</"+i)),n[i]=r),r<t}function k(e,t){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}function E(e,t,i,n){var r=e.charAt(t+2);switch(r){case"-":if("-"===e.charAt(t+3)){var s=e.indexOf("--\x3e",t+4);return s>t?(i.comment(e,t+4,s-t-4),s+3):(n.error("Unclosed comment"),-1)}return-1;default:if("CDATA["==e.substr(t+3,6)){s=e.indexOf("]]>",t+9);return i.startCDATA(),i.characters(e,t+9,s-t-9),i.endCDATA(),s+3}var a=x(e,t),o=a.length;if(o>1&&/!doctype/i.test(a[0][0])){var l=a[1][0],u=!1,c=!1;o>3&&(/^public$/i.test(a[2][0])?(u=a[3][0],c=o>4&&a[4][0]):/^system$/i.test(a[2][0])&&(c=a[3][0]));var h=a[o-1];return i.startDTD(l,u,c),i.endDTD(),h.index+h[0].length}}return-1}function w(e,t,i){var n=e.indexOf("?>",t);if(n){var r=e.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(r){r[0].length;return i.processingInstruction(r[1],r[2]),n+2}return-1}return-1}function C(){this.attributeNames={}}function x(e,t){var i,n=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;r.lastIndex=t,r.exec(e);while(i=r.exec(e))if(n.push(i),i[1])return n}m.prototype=new Error,m.prototype.name=m.name,g.prototype={parse:function(e,t,i){var n=this.domBuilder;n.startDocument(),k(t,t={}),y(e,t,i,n,this.errorHandler),n.endDocument()}},C.prototype={setTagName:function(e){if(!a.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,i){if(!a.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:i}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},t.XMLReader=g,t.ParseError=m},e044:function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=i("d61a"),s=function(e,t,i){return function(n){var s=e.master.playlists[t],a=(0,r.isIncompatible)(s),o=(0,r.isEnabled)(s);return"undefined"===typeof n?o:(n?delete s.disabled:s.disabled=!0,n===o||a||(i(),n?e.trigger("renditionenabled"):e.trigger("renditiondisabled")),n)}},a=function e(t,i,r){n(this,e);var a=t.masterPlaylistController_.fastQualityChange_.bind(t.masterPlaylistController_);if(i.attributes.RESOLUTION){var o=i.attributes.RESOLUTION;this.width=o.width,this.height=o.height}this.bandwidth=i.attributes.BANDWIDTH,this.id=r,this.enabled=s(t.playlists,i.uri,a)},o=function(e){var t=e.playlists;e.representations=function(){return t.master.playlists.filter((function(e){return!(0,r.isIncompatible)(e)})).map((function(t,i){return new a(e,t,t.uri)}))}};t["default"]=o,e.exports=t["default"]},e1c8:function(e,t,i){var n=i("89a7"),r=n.find,s=n.NAMESPACE;function a(e){return""!==e}function o(e){return e?e.split(/[\t\n\f\r ]+/).filter(a):[]}function l(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function u(e){if(!e)return[];var t=o(e);return Object.keys(t.reduce(l,{}))}function c(e){return function(t){return e&&-1!==e.indexOf(t)}}function h(e,t){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}function d(e,t){var i=e.prototype;if(!(i instanceof t)){function n(){}n.prototype=t.prototype,n=new n,h(i,n),e.prototype=i=n}i.constructor!=e&&("function"!=typeof e&&console.error("unknown Class:"+e),i.constructor=e)}var p={},f=p.ELEMENT_NODE=1,m=p.ATTRIBUTE_NODE=2,g=p.TEXT_NODE=3,y=p.CDATA_SECTION_NODE=4,v=p.ENTITY_REFERENCE_NODE=5,_=p.ENTITY_NODE=6,b=p.PROCESSING_INSTRUCTION_NODE=7,T=p.COMMENT_NODE=8,S=p.DOCUMENT_NODE=9,k=p.DOCUMENT_TYPE_NODE=10,E=p.DOCUMENT_FRAGMENT_NODE=11,w=p.NOTATION_NODE=12,C={},x={},A=(C.INDEX_SIZE_ERR=(x[1]="Index size error",1),C.DOMSTRING_SIZE_ERR=(x[2]="DOMString size error",2),C.HIERARCHY_REQUEST_ERR=(x[3]="Hierarchy request error",3)),I=(C.WRONG_DOCUMENT_ERR=(x[4]="Wrong document",4),C.INVALID_CHARACTER_ERR=(x[5]="Invalid character",5),C.NO_DATA_ALLOWED_ERR=(x[6]="No data allowed",6),C.NO_MODIFICATION_ALLOWED_ERR=(x[7]="No modification allowed",7),C.NOT_FOUND_ERR=(x[8]="Not found",8)),O=(C.NOT_SUPPORTED_ERR=(x[9]="Not supported",9),C.INUSE_ATTRIBUTE_ERR=(x[10]="Attribute in use",10));C.INVALID_STATE_ERR=(x[11]="Invalid state",11),C.SYNTAX_ERR=(x[12]="Syntax error",12),C.INVALID_MODIFICATION_ERR=(x[13]="Invalid modification",13),C.NAMESPACE_ERR=(x[14]="Invalid namespace",14),C.INVALID_ACCESS_ERR=(x[15]="Invalid access",15);function P(e,t){if(t instanceof Error)var i=t;else i=this,Error.call(this,x[e]),this.message=x[e],Error.captureStackTrace&&Error.captureStackTrace(this,P);return i.code=e,t&&(this.message=this.message+": "+t),i}function L(){}function D(e,t){this._node=e,this._refresh=t,M(this)}function M(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var i=e._refresh(e._node);if(we(e,"length",i.length),!e.$$length||i.length<e.$$length)for(var n=i.length;n in e;n++)Object.prototype.hasOwnProperty.call(e,n)&&delete e[n];h(i,e),e._inc=t}}function R(){}function N(e,t){var i=e.length;while(i--)if(e[i]===t)return i}function j(e,t,i,n){if(n?t[N(t,n)]=i:t[t.length++]=i,e){i.ownerElement=e;var r=e.ownerDocument;r&&(n&&W(r,e,n),z(r,e,i))}}function B(e,t,i){var n=N(t,i);if(!(n>=0))throw new P(I,new Error(e.tagName+"@"+i));var r=t.length-1;while(n<r)t[n]=t[++n];if(t.length=r,e){var s=e.ownerDocument;s&&(W(s,e,i),i.ownerElement=null)}}function U(){}function F(){}function q(e){return("<"==e?"&lt;":">"==e&&"&gt;")||"&"==e&&"&amp;"||'"'==e&&"&quot;"||"&#"+e.charCodeAt()+";"}function H(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(H(e,t))return!0}while(e=e.nextSibling)}function V(){this.ownerDocument=this}function z(e,t,i){e&&e._inc++;var n=i.namespaceURI;n===s.XMLNS&&(t._nsMap[i.prefix?i.localName:""]=i.value)}function W(e,t,i,n){e&&e._inc++;var r=i.namespaceURI;r===s.XMLNS&&delete t._nsMap[i.prefix?i.localName:""]}function $(e,t,i){if(e&&e._inc){e._inc++;var n=t.childNodes;if(i)n[n.length++]=i;else{var r=t.firstChild,s=0;while(r)n[s++]=r,r=r.nextSibling;n.length=s,delete n[n.length]}}}function G(e,t){var i=t.previousSibling,n=t.nextSibling;return i?i.nextSibling=n:e.firstChild=n,n?n.previousSibling=i:e.lastChild=i,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,$(e.ownerDocument,e),t}function X(e){return e&&(e.nodeType===F.DOCUMENT_NODE||e.nodeType===F.DOCUMENT_FRAGMENT_NODE||e.nodeType===F.ELEMENT_NODE)}function K(e){return e&&(Q(e)||J(e)||Y(e)||e.nodeType===F.DOCUMENT_FRAGMENT_NODE||e.nodeType===F.COMMENT_NODE||e.nodeType===F.PROCESSING_INSTRUCTION_NODE)}function Y(e){return e&&e.nodeType===F.DOCUMENT_TYPE_NODE}function Q(e){return e&&e.nodeType===F.ELEMENT_NODE}function J(e){return e&&e.nodeType===F.TEXT_NODE}function Z(e,t){var i=e.childNodes||[];if(r(i,Q)||Y(t))return!1;var n=r(i,Y);return!(t&&n&&i.indexOf(n)>i.indexOf(t))}function ee(e,t){var i=e.childNodes||[];function n(e){return Q(e)&&e!==t}if(r(i,n))return!1;var s=r(i,Y);return!(t&&s&&i.indexOf(s)>i.indexOf(t))}function te(e,t,i){if(!X(e))throw new P(A,"Unexpected parent node type "+e.nodeType);if(i&&i.parentNode!==e)throw new P(I,"child not in parent");if(!K(t)||Y(t)&&e.nodeType!==F.DOCUMENT_NODE)throw new P(A,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)}function ie(e,t,i){var n=e.childNodes||[],s=t.childNodes||[];if(t.nodeType===F.DOCUMENT_FRAGMENT_NODE){var a=s.filter(Q);if(a.length>1||r(s,J))throw new P(A,"More than one element or text in fragment");if(1===a.length&&!Z(e,i))throw new P(A,"Element in fragment can not be inserted before doctype")}if(Q(t)&&!Z(e,i))throw new P(A,"Only one element can be added and only after doctype");if(Y(t)){if(r(n,Y))throw new P(A,"Only one doctype is allowed");var o=r(n,Q);if(i&&n.indexOf(o)<n.indexOf(i))throw new P(A,"Doctype can only be inserted before an element");if(!i&&o)throw new P(A,"Doctype can not be appended since element is present")}}function ne(e,t,i){var n=e.childNodes||[],s=t.childNodes||[];if(t.nodeType===F.DOCUMENT_FRAGMENT_NODE){var a=s.filter(Q);if(a.length>1||r(s,J))throw new P(A,"More than one element or text in fragment");if(1===a.length&&!ee(e,i))throw new P(A,"Element in fragment can not be inserted before doctype")}if(Q(t)&&!ee(e,i))throw new P(A,"Only one element can be added and only after doctype");if(Y(t)){function o(e){return Y(e)&&e!==i}if(r(n,o))throw new P(A,"Only one doctype is allowed");var l=r(n,Q);if(i&&n.indexOf(l)<n.indexOf(i))throw new P(A,"Doctype can only be inserted before an element")}}function re(e,t,i,n){te(e,t,i),e.nodeType===F.DOCUMENT_NODE&&(n||ie)(e,t,i);var r=t.parentNode;if(r&&r.removeChild(t),t.nodeType===E){var s=t.firstChild;if(null==s)return t;var a=t.lastChild}else s=a=t;var o=i?i.previousSibling:e.lastChild;s.previousSibling=o,a.nextSibling=i,o?o.nextSibling=s:e.firstChild=s,null==i?e.lastChild=a:i.previousSibling=a;do{s.parentNode=e}while(s!==a&&(s=s.nextSibling));return $(e.ownerDocument||e,e),t.nodeType==E&&(t.firstChild=t.lastChild=null),t}function se(e,t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=e,t.previousSibling=e.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,e.lastChild=t,$(e.ownerDocument,e,t),t}function ae(){this._nsMap={}}function oe(){}function le(){}function ue(){}function ce(){}function he(){}function de(){}function pe(){}function fe(){}function me(){}function ge(){}function ye(){}function ve(){}function _e(e,t){var i=[],n=9==this.nodeType&&this.documentElement||this,r=n.prefix,s=n.namespaceURI;if(s&&null==r){r=n.lookupPrefix(s);if(null==r)var a=[{namespace:s,prefix:null}]}return Se(this,i,e,t,a),i.join("")}function be(e,t,i){var n=e.prefix||"",r=e.namespaceURI;if(!r)return!1;if("xml"===n&&r===s.XML||r===s.XMLNS)return!1;var a=i.length;while(a--){var o=i[a];if(o.prefix===n)return o.namespace!==r}return!0}function Te(e,t,i){e.push(" ",t,'="',i.replace(/[<>&"\t\n\r]/g,q),'"')}function Se(e,t,i,n,r){if(r||(r=[]),n){if(e=n(e),!e)return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case f:var a=e.attributes,o=a.length,l=e.firstChild,u=e.tagName;i=s.isHTML(e.namespaceURI)||i;var c=u;if(!i&&!e.prefix&&e.namespaceURI){for(var h,d=0;d<a.length;d++)if("xmlns"===a.item(d).name){h=a.item(d).value;break}if(!h)for(var p=r.length-1;p>=0;p--){var _=r[p];if(""===_.prefix&&_.namespace===e.namespaceURI){h=_.namespace;break}}if(h!==e.namespaceURI)for(p=r.length-1;p>=0;p--){_=r[p];if(_.namespace===e.namespaceURI){_.prefix&&(c=_.prefix+":"+u);break}}}t.push("<",c);for(var w=0;w<o;w++){var C=a.item(w);"xmlns"==C.prefix?r.push({prefix:C.localName,namespace:C.value}):"xmlns"==C.nodeName&&r.push({prefix:"",namespace:C.value})}for(w=0;w<o;w++){C=a.item(w);if(be(C,i,r)){var x=C.prefix||"",A=C.namespaceURI;Te(t,x?"xmlns:"+x:"xmlns",A),r.push({prefix:x,namespace:A})}Se(C,t,i,n,r)}if(u===c&&be(e,i,r)){x=e.prefix||"",A=e.namespaceURI;Te(t,x?"xmlns:"+x:"xmlns",A),r.push({prefix:x,namespace:A})}if(l||i&&!/^(?:meta|link|img|br|hr|input)$/i.test(u)){if(t.push(">"),i&&/^script$/i.test(u))while(l)l.data?t.push(l.data):Se(l,t,i,n,r.slice()),l=l.nextSibling;else while(l)Se(l,t,i,n,r.slice()),l=l.nextSibling;t.push("</",c,">")}else t.push("/>");return;case S:case E:l=e.firstChild;while(l)Se(l,t,i,n,r.slice()),l=l.nextSibling;return;case m:return Te(t,e.name,e.value);case g:return t.push(e.data.replace(/[<&>]/g,q));case y:return t.push("<![CDATA[",e.data,"]]>");case T:return t.push("\x3c!--",e.data,"--\x3e");case k:var I=e.publicId,O=e.systemId;if(t.push("<!DOCTYPE ",e.name),I)t.push(" PUBLIC ",I),O&&"."!=O&&t.push(" ",O),t.push(">");else if(O&&"."!=O)t.push(" SYSTEM ",O,">");else{var P=e.internalSubset;P&&t.push(" [",P,"]"),t.push(">")}return;case b:return t.push("<?",e.target," ",e.data,"?>");case v:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function ke(e,t,i){var n;switch(t.nodeType){case f:n=t.cloneNode(!1),n.ownerDocument=e;case E:break;case m:i=!0;break}if(n||(n=t.cloneNode(!1)),n.ownerDocument=e,n.parentNode=null,i){var r=t.firstChild;while(r)n.appendChild(ke(e,r,i)),r=r.nextSibling}return n}function Ee(e,t,i){var n=new t.constructor;for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var s=t[r];"object"!=typeof s&&s!=n[r]&&(n[r]=s)}switch(t.childNodes&&(n.childNodes=new L),n.ownerDocument=e,n.nodeType){case f:var a=t.attributes,o=n.attributes=new R,l=a.length;o._ownerElement=n;for(var u=0;u<l;u++)n.setAttributeNode(Ee(e,a.item(u),!0));break;case m:i=!0}if(i){var c=t.firstChild;while(c)n.appendChild(Ee(e,c,i)),c=c.nextSibling}return n}function we(e,t,i){e[t]=i}P.prototype=Error.prototype,h(C,P),L.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e,t){for(var i=[],n=0;n<this.length;n++)Se(this[n],i,e,t);return i.join("")},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}},D.prototype.item=function(e){return M(this),this[e]||null},d(D,L),R.prototype={length:0,item:L.prototype.item,getNamedItem:function(e){var t=this.length;while(t--){var i=this[t];if(i.nodeName==e)return i}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new P(O);var i=this.getNamedItem(e.nodeName);return j(this._ownerElement,this,e,i),i},setNamedItemNS:function(e){var t,i=e.ownerElement;if(i&&i!=this._ownerElement)throw new P(O);return t=this.getNamedItemNS(e.namespaceURI,e.localName),j(this._ownerElement,this,e,t),t},removeNamedItem:function(e){var t=this.getNamedItem(e);return B(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var i=this.getNamedItemNS(e,t);return B(this._ownerElement,this,i),i},getNamedItemNS:function(e,t){var i=this.length;while(i--){var n=this[i];if(n.localName==t&&n.namespaceURI==e)return n}return null}},U.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,i){var n=new V;if(n.implementation=this,n.childNodes=new L,n.doctype=i||null,i&&n.appendChild(i),t){var r=n.createElementNS(e,t);n.appendChild(r)}return n},createDocumentType:function(e,t,i){var n=new de;return n.name=e,n.nodeName=e,n.publicId=t||"",n.systemId=i||"",n}},F.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(e,t){return re(this,e,t)},replaceChild:function(e,t){re(this,e,t,ne),t&&this.removeChild(t)},removeChild:function(e){return G(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return Ee(this.ownerDocument||this,this,e)},normalize:function(){var e=this.firstChild;while(e){var t=e.nextSibling;t&&t.nodeType==g&&e.nodeType==g?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){var t=this;while(t){var i=t._nsMap;if(i)for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&i[n]===e)return n;t=t.nodeType==m?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){var t=this;while(t){var i=t._nsMap;if(i&&Object.prototype.hasOwnProperty.call(i,e))return i[e];t=t.nodeType==m?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){var t=this.lookupPrefix(e);return null==t}},h(p,F),h(p,F.prototype),V.prototype={nodeName:"#document",nodeType:S,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==E){var i=e.firstChild;while(i){var n=i.nextSibling;this.insertBefore(i,t),i=n}return e}return re(this,e,t),e.ownerDocument=this,null===this.documentElement&&e.nodeType===f&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),G(this,e)},replaceChild:function(e,t){re(this,e,t,ne),e.ownerDocument=this,t&&this.removeChild(t),Q(e)&&(this.documentElement=e)},importNode:function(e,t){return ke(this,e,t)},getElementById:function(e){var t=null;return H(this.documentElement,(function(i){if(i.nodeType==f&&i.getAttribute("id")==e)return t=i,!0})),t},getElementsByClassName:function(e){var t=u(e);return new D(this,(function(i){var n=[];return t.length>0&&H(i.documentElement,(function(r){if(r!==i&&r.nodeType===f){var s=r.getAttribute("class");if(s){var a=e===s;if(!a){var o=u(s);a=t.every(c(o))}a&&n.push(r)}}})),n}))},createElement:function(e){var t=new ae;t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new L;var i=t.attributes=new R;return i._ownerElement=t,t},createDocumentFragment:function(){var e=new ge;return e.ownerDocument=this,e.childNodes=new L,e},createTextNode:function(e){var t=new ue;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new ce;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new he;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var i=new ye;return i.ownerDocument=this,i.tagName=i.nodeName=i.target=e,i.nodeValue=i.data=t,i},createAttribute:function(e){var t=new oe;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new me;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var i=new ae,n=t.split(":"),r=i.attributes=new R;return i.childNodes=new L,i.ownerDocument=this,i.nodeName=t,i.tagName=t,i.namespaceURI=e,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,r._ownerElement=i,i},createAttributeNS:function(e,t){var i=new oe,n=t.split(":");return i.ownerDocument=this,i.nodeName=t,i.name=t,i.namespaceURI=e,i.specified=!0,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,i}},d(V,F),ae.prototype={nodeType:f,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var i=this.ownerDocument.createAttribute(e);i.value=i.nodeValue=""+t,this.setAttributeNode(i)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===E?this.insertBefore(e,null):se(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);i&&this.removeAttributeNode(i)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);return i&&i.value||""},setAttributeNS:function(e,t,i){var n=this.ownerDocument.createAttributeNS(e,t);n.value=n.nodeValue=""+i,this.setAttributeNode(n)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new D(this,(function(t){var i=[];return H(t,(function(n){n===t||n.nodeType!=f||"*"!==e&&n.tagName!=e||i.push(n)})),i}))},getElementsByTagNameNS:function(e,t){return new D(this,(function(i){var n=[];return H(i,(function(r){r===i||r.nodeType!==f||"*"!==e&&r.namespaceURI!==e||"*"!==t&&r.localName!=t||n.push(r)})),n}))}},V.prototype.getElementsByTagName=ae.prototype.getElementsByTagName,V.prototype.getElementsByTagNameNS=ae.prototype.getElementsByTagNameNS,d(ae,F),oe.prototype.nodeType=m,d(oe,F),le.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(x[A])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,i){var n=this.data.substring(0,e),r=this.data.substring(e+t);i=n+i+r,this.nodeValue=this.data=i,this.length=i.length}},d(le,F),ue.prototype={nodeName:"#text",nodeType:g,splitText:function(e){var t=this.data,i=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(i);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},d(ue,le),ce.prototype={nodeName:"#comment",nodeType:T},d(ce,le),he.prototype={nodeName:"#cdata-section",nodeType:y},d(he,le),de.prototype.nodeType=k,d(de,F),pe.prototype.nodeType=w,d(pe,F),fe.prototype.nodeType=_,d(fe,F),me.prototype.nodeType=v,d(me,F),ge.prototype.nodeName="#document-fragment",ge.prototype.nodeType=E,d(ge,F),ye.prototype.nodeType=b,d(ye,F),ve.prototype.serializeToString=function(e,t,i){return _e.call(e,t,i)},F.prototype.toString=_e;try{if(Object.defineProperty){function Ce(e){switch(e.nodeType){case f:case E:var t=[];e=e.firstChild;while(e)7!==e.nodeType&&8!==e.nodeType&&t.push(Ce(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}}Object.defineProperty(D.prototype,"length",{get:function(){return M(this),this.$$length}}),Object.defineProperty(F.prototype,"textContent",{get:function(){return Ce(this)},set:function(e){switch(this.nodeType){case f:case E:while(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}}}),we=function(e,t,i){e["$$"+t]=i}}}catch(xe){}t.DocumentType=de,t.DOMException=P,t.DOMImplementation=U,t.Element=ae,t.Node=F,t.NodeList=L,t.XMLSerializer=ve},e206:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={TIME_BETWEEN_CHUNKS:1,BYTES_PER_CHUNK:32768};t["default"]=n,e.exports=t["default"]},e475:function(e,t,i){
  28. /**
  29. * @license
  30. * Video.js 6.13.0 <http://videojs.com/>
  31. * Copyright Brightcove, Inc. <https://www.brightcove.com/>
  32. * Available under Apache License Version 2.0
  33. * <https://github.com/videojs/video.js/blob/master/LICENSE>
  34. *
  35. * Includes vtt.js <https://github.com/mozilla/vtt.js>
  36. * Available under Apache License Version 2.0
  37. * <https://github.com/mozilla/vtt.js/blob/master/LICENSE>
  38. */
  39. function n(e){return e&&"object"===typeof e&&"default"in e?e["default"]:e}var r=n(i("a59e")),s=n(i("4d20e")),a=n(i("1b8d")),o=n(i("8c10")),l=n(i("eec7")),u=n(i("8352")),c="6.13.0",h=r.navigator&&r.navigator.userAgent||"",d=/AppleWebKit\/([\d.]+)/i.exec(h),p=d?parseFloat(d.pop()):null,f=/iPad/i.test(h),m=/iPhone/i.test(h)&&!f,g=/iPod/i.test(h),y=m||f||g,v=function(){var e=h.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),_=/Android/i.test(h),b=function(){var e=h.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null}(),T=_&&/webkit/i.test(h)&&b<2.3,S=_&&b<5&&p<537,k=/Firefox/i.test(h),E=/Edge/i.test(h),w=!E&&(/Chrome/i.test(h)||/CriOS/i.test(h)),C=function(){var e=h.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),x=/MSIE\s8\.0/.test(h),A=function(){var e=/MSIE\s(\d+)\.\d/.exec(h),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(h)&&/rv:11.0/.test(h)&&(t=11),t}(),I=/Safari/i.test(h)&&!w&&!_&&!E,O=(I||y)&&!w,P=ie()&&("ontouchstart"in r||r.navigator.maxTouchPoints||r.DocumentTouch&&r.document instanceof r.DocumentTouch),L=ie()&&"backgroundSize"in r.document.createElement("video").style,D=(Object.freeze||Object)({IS_IPAD:f,IS_IPHONE:m,IS_IPOD:g,IS_IOS:y,IOS_VERSION:v,IS_ANDROID:_,ANDROID_VERSION:b,IS_OLD_ANDROID:T,IS_NATIVE_ANDROID:S,IS_FIREFOX:k,IS_EDGE:E,IS_CHROME:w,CHROME_VERSION:C,IS_IE8:x,IE_VERSION:A,IS_SAFARI:I,IS_ANY_SAFARI:O,TOUCH_ENABLED:P,BACKGROUND_SIZE_SUPPORTED:L}),M="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},R=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},N=function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},j=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t},B=function(e,t){return e.raw=t,e},U=Object.prototype.toString,F=function(e){return z(e)?Object.keys(e):[]};function q(e,t){F(e).forEach((function(i){return t(e[i],i)}))}function H(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return F(e).reduce((function(i,n){return t(i,e[n],n)}),i)}function V(e){for(var t=arguments.length,i=Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return Object.assign?Object.assign.apply(Object,[e].concat(i)):(i.forEach((function(t){t&&q(t,(function(t,i){e[i]=t}))})),e)}function z(e){return!!e&&"object"===("undefined"===typeof e?"undefined":M(e))}function W(e){return z(e)&&"[object Object]"===U.call(e)&&e.constructor===Object}var $=[],G=function(e,t){return function(i,n,s,a){var o=t.levels[n],l=new RegExp("^("+o+")$");if("log"!==i&&s.unshift(i.toUpperCase()+":"),s.unshift(e+":"),$&&$.push([].concat(s)),r.console){var u=r.console[i];u||"debug"!==i||(u=r.console.info||r.console.log),u&&o&&l.test(i)&&(a&&(s=s.map((function(e){if(z(e)||Array.isArray(e))try{return JSON.stringify(e)}catch(t){return String(e)}return String(e)})).join(" ")),u.apply?u[Array.isArray(s)?"apply":"call"](r.console,s):u(s))}}};function X(e){var t="info",i=void 0,n=function e(){for(var n=e.stringify||A&&A<11,r=arguments.length,s=Array(r),a=0;a<r;a++)s[a]=arguments[a];i("log",t,s,n)};return i=G(e,n),n.createLogger=function(t){return X(e+": "+t)},n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:t},n.level=function(e){if("string"===typeof e){if(!n.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');t=e}return t},n.history=function(){return $?[].concat($):[]},n.history.filter=function(e){return($||[]).filter((function(t){return new RegExp(".*"+e+".*").test(t[0])}))},n.history.clear=function(){$&&($.length=0)},n.history.disable=function(){null!==$&&($.length=0,$=null)},n.history.enable=function(){null===$&&($=[])},n.error=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return i("error",t,n)},n.warn=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return i("warn",t,n)},n.debug=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return i("debug",t,n)},n}var K=X("VIDEOJS"),Y=K.createLogger;function Q(e,t){if(!e||!t)return"";if("function"===typeof r.getComputedStyle){var i=r.getComputedStyle(e);return i?i[t]:""}return e.currentStyle[t]||""}var J=B(["Setting attributes in the second argument of createEl()\n has been deprecated. Use the third argument instead.\n createEl(type, properties, attributes). Attempting to set "," to ","."],["Setting attributes in the second argument of createEl()\n has been deprecated. Use the third argument instead.\n createEl(type, properties, attributes). Attempting to set "," to ","."]);function Z(e){return"string"===typeof e&&/\S/.test(e)}function ee(e){if(/\s/.test(e))throw new Error("class has illegal whitespace characters")}function te(e){return new RegExp("(^|\\s)"+e+"($|\\s)")}function ie(){return s===r.document&&"undefined"!==typeof s.createElement}function ne(e){return z(e)&&1===e.nodeType}function re(){try{return r.parent!==r.self}catch(e){return!0}}function se(e){return function(t,i){if(!Z(t))return s[e](null);Z(i)&&(i=s.querySelector(i));var n=ne(i)?i:s;return n[e]&&n[e](t)}}function ae(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments[3],r=s.createElement(e);return Object.getOwnPropertyNames(t).forEach((function(e){var i=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(K.warn(a(J,e,i)),r.setAttribute(e,i)):"textContent"===e?oe(r,i):r[e]=i})),Object.getOwnPropertyNames(i).forEach((function(e){r.setAttribute(e,i[e])})),n&&Ce(r,n),r}function oe(e,t){return"undefined"===typeof e.textContent?e.innerText=t:e.textContent=t,e}function le(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function ue(e,t){return ee(t),e.classList?e.classList.contains(t):te(t).test(e.className)}function ce(e,t){return e.classList?e.classList.add(t):ue(e,t)||(e.className=(e.className+" "+t).trim()),e}function he(e,t){return e.classList?e.classList.remove(t):(ee(t),e.className=e.className.split(/\s+/).filter((function(e){return e!==t})).join(" ")),e}function de(e,t,i){var n=ue(e,t);if("function"===typeof i&&(i=i(e,t)),"boolean"!==typeof i&&(i=!n),i!==n)return i?ce(e,t):he(e,t),e}function pe(e,t){Object.getOwnPropertyNames(t).forEach((function(i){var n=t[i];null===n||"undefined"===typeof n||!1===n?e.removeAttribute(i):e.setAttribute(i,!0===n?"":n)}))}function fe(e){var t={},i=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(e&&e.attributes&&e.attributes.length>0)for(var n=e.attributes,r=n.length-1;r>=0;r--){var s=n[r].name,a=n[r].value;"boolean"!==typeof e[s]&&-1===i.indexOf(","+s+",")||(a=null!==a),t[s]=a}return t}function me(e,t){return e.getAttribute(t)}function ge(e,t,i){e.setAttribute(t,i)}function ye(e,t){e.removeAttribute(t)}function ve(){s.body.focus(),s.onselectstart=function(){return!1}}function _e(){s.onselectstart=function(){return!0}}function be(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach((function(e){void 0!==t[e]&&(i[e]=t[e])})),i.height||(i.height=parseFloat(Q(e,"height"))),i.width||(i.width=parseFloat(Q(e,"width"))),i}}function Te(e){var t=void 0;if(e.getBoundingClientRect&&e.parentNode&&(t=e.getBoundingClientRect()),!t)return{left:0,top:0};var i=s.documentElement,n=s.body,a=i.clientLeft||n.clientLeft||0,o=r.pageXOffset||n.scrollLeft,l=t.left+o-a,u=i.clientTop||n.clientTop||0,c=r.pageYOffset||n.scrollTop,h=t.top+c-u;return{left:Math.round(l),top:Math.round(h)}}function Se(e,t){var i={},n=Te(e),r=e.offsetWidth,s=e.offsetHeight,a=n.top,o=n.left,l=t.pageY,u=t.pageX;return t.changedTouches&&(u=t.changedTouches[0].pageX,l=t.changedTouches[0].pageY),i.y=Math.max(0,Math.min(1,(a-l+s)/s)),i.x=Math.max(0,Math.min(1,(u-o)/r)),i}function ke(e){return z(e)&&3===e.nodeType}function Ee(e){while(e.firstChild)e.removeChild(e.firstChild);return e}function we(e){return"function"===typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((function(e){return"function"===typeof e&&(e=e()),ne(e)||ke(e)?e:"string"===typeof e&&/\S/.test(e)?s.createTextNode(e):void 0})).filter((function(e){return e}))}function Ce(e,t){return we(t).forEach((function(t){return e.appendChild(t)})),e}function xe(e,t){return Ce(Ee(e),t)}function Ae(e){return void 0===e.button&&void 0===e.buttons||(0===e.button&&void 0===e.buttons||(9===A||0===e.button&&1===e.buttons))}var Ie=se("querySelector"),Oe=se("querySelectorAll"),Pe=(Object.freeze||Object)({isReal:ie,isEl:ne,isInFrame:re,createEl:ae,textContent:oe,prependTo:le,hasClass:ue,addClass:ce,removeClass:he,toggleClass:de,setAttributes:pe,getAttributes:fe,getAttribute:me,setAttribute:ge,removeAttribute:ye,blockTextSelection:ve,unblockTextSelection:_e,getBoundingClientRect:be,findPosition:Te,getPointerPosition:Se,isTextNode:ke,emptyEl:Ee,normalizeContent:we,appendContent:Ce,insertContent:xe,isSingleLeftClick:Ae,$:Ie,$$:Oe}),Le=1;function De(){return Le++}var Me={},Re="vdata"+(new Date).getTime();function Ne(e){var t=e[Re];return t||(t=e[Re]=De()),Me[t]||(Me[t]={}),Me[t]}function je(e){var t=e[Re];return!!t&&!!Object.getOwnPropertyNames(Me[t]).length}function Be(e){var t=e[Re];if(t){delete Me[t];try{delete e[Re]}catch(i){e.removeAttribute?e.removeAttribute(Re):e[Re]=null}}}function Ue(e,t){var i=Ne(e);0===i.handlers[t].length&&(delete i.handlers[t],e.removeEventListener?e.removeEventListener(t,i.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&Be(e)}function Fe(e,t,i,n){i.forEach((function(i){e(t,i,n)}))}function qe(e){function t(){return!0}function i(){return!1}if(!e||!e.isPropagationStopped){var n=e||r.event;for(var a in e={},n)"layerX"!==a&&"layerY"!==a&&"keyLocation"!==a&&"webkitMovementX"!==a&&"webkitMovementY"!==a&&("returnValue"===a&&n.preventDefault||(e[a]=n[a]));if(e.target||(e.target=e.srcElement||s),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){n.preventDefault&&n.preventDefault(),e.returnValue=!1,n.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){n.stopPropagation&&n.stopPropagation(),e.cancelBubble=!0,n.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=i,e.stopImmediatePropagation=function(){n.stopImmediatePropagation&&n.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=i,null!==e.clientX&&void 0!==e.clientX){var o=s.documentElement,l=s.body;e.pageX=e.clientX+(o&&o.scrollLeft||l&&l.scrollLeft||0)-(o&&o.clientLeft||l&&l.clientLeft||0),e.pageY=e.clientY+(o&&o.scrollTop||l&&l.scrollTop||0)-(o&&o.clientTop||l&&l.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e}var He=!1;(function(){try{var e=Object.defineProperty({},"passive",{get:function(){He=!0}});r.addEventListener("test",null,e),r.removeEventListener("test",null,e)}catch(t){}})();var Ve=["touchstart","touchmove"];function ze(e,t,i){if(Array.isArray(t))return Fe(ze,e,t,i);var n=Ne(e);if(n.handlers||(n.handlers={}),n.handlers[t]||(n.handlers[t]=[]),i.guid||(i.guid=De()),n.handlers[t].push(i),n.dispatcher||(n.disabled=!1,n.dispatcher=function(t,i){if(!n.disabled){t=qe(t);var r=n.handlers[t.type];if(r)for(var s=r.slice(0),a=0,o=s.length;a<o;a++){if(t.isImmediatePropagationStopped())break;try{s[a].call(e,t,i)}catch(l){K.error(l)}}}}),1===n.handlers[t].length)if(e.addEventListener){var r=!1;He&&Ve.indexOf(t)>-1&&(r={passive:!0}),e.addEventListener(t,n.dispatcher,r)}else e.attachEvent&&e.attachEvent("on"+t,n.dispatcher)}function We(e,t,i){if(je(e)){var n=Ne(e);if(n.handlers){if(Array.isArray(t))return Fe(We,e,t,i);var r=function(e,t){n.handlers[t]=[],Ue(e,t)};if(void 0!==t){var s=n.handlers[t];if(s)if(i){if(i.guid)for(var a=0;a<s.length;a++)s[a].guid===i.guid&&s.splice(a--,1);Ue(e,t)}else r(e,t)}else for(var o in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},o)&&r(e,o)}}}function $e(e,t,i){var n=je(e)?Ne(e):{},r=e.parentNode||e.ownerDocument;if("string"===typeof t?t={type:t,target:e}:t.target||(t.target=e),t=qe(t),n.dispatcher&&n.dispatcher.call(e,t,i),r&&!t.isPropagationStopped()&&!0===t.bubbles)$e.call(null,r,t,i);else if(!r&&!t.defaultPrevented){var s=Ne(t.target);t.target[t.type]&&(s.disabled=!0,"function"===typeof t.target[t.type]&&t.target[t.type](),s.disabled=!1)}return!t.defaultPrevented}function Ge(e,t,i){if(Array.isArray(t))return Fe(Ge,e,t,i);var n=function n(){We(e,t,n),i.apply(this,arguments)};n.guid=i.guid=i.guid||De(),ze(e,t,n)}var Xe=(Object.freeze||Object)({fixEvent:qe,on:ze,off:We,trigger:$e,one:Ge}),Ke=!1,Ye=void 0,Qe=function(){if(ie()&&!1!==Ye.options.autoSetup){var e=s.getElementsByTagName("video"),t=s.getElementsByTagName("audio"),i=s.getElementsByTagName("video-js"),n=[];if(e&&e.length>0)for(var r=0,a=e.length;r<a;r++)n.push(e[r]);if(t&&t.length>0)for(var o=0,l=t.length;o<l;o++)n.push(t[o]);if(i&&i.length>0)for(var u=0,c=i.length;u<c;u++)n.push(i[u]);if(n&&n.length>0)for(var h=0,d=n.length;h<d;h++){var p=n[h];if(!p||!p.getAttribute){Je(1);break}if(void 0===p.player){var f=p.getAttribute("data-setup");null!==f&&Ye(p)}}else Ke||Je(1)}};function Je(e,t){t&&(Ye=t),r.setTimeout(Qe,e)}ie()&&"complete"===s.readyState?Ke=!0:Ge(r,"load",(function(){Ke=!0}));var Ze=function(e){var t=s.createElement("style");return t.className=e,t},et=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t},tt=function(e,t,i){t.guid||(t.guid=De());var n=function(){return t.apply(e,arguments)};return n.guid=i?i+"_"+t.guid:t.guid,n},it=function(e,t){var i=Date.now(),n=function(){var n=Date.now();n-i>=t&&(e.apply(void 0,arguments),i=n)};return n},nt=function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r,s=void 0,a=function(){n.clearTimeout(s),s=null},o=function(){var r=this,a=arguments,o=function(){s=null,o=null,i||e.apply(r,a)};!s&&i&&e.apply(r,a),n.clearTimeout(s),s=n.setTimeout(o,t)};return o.cancel=a,o},rt=function(){};rt.prototype.allowedEvents_={},rt.prototype.on=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},ze(this,e,t),this.addEventListener=i},rt.prototype.addEventListener=rt.prototype.on,rt.prototype.off=function(e,t){We(this,e,t)},rt.prototype.removeEventListener=rt.prototype.off,rt.prototype.one=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},Ge(this,e,t),this.addEventListener=i},rt.prototype.trigger=function(e){var t=e.type||e;"string"===typeof e&&(e={type:t}),e=qe(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),$e(this,e)},rt.prototype.dispatchEvent=rt.prototype.trigger;var st=function(e){return e instanceof rt||!!e.eventBusEl_&&["on","one","off","trigger"].every((function(t){return"function"===typeof e[t]}))},at=function(e){return"string"===typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},ot=function(e){if(!e.nodeName&&!st(e))throw new Error("Invalid target; must be a DOM node or evented object.")},lt=function(e){if(!at(e))throw new Error("Invalid event type; must be a non-empty string or array.")},ut=function(e){if("function"!==typeof e)throw new Error("Invalid listener; must be a function.")},ct=function(e,t){var i=t.length<3||t[0]===e||t[0]===e.eventBusEl_,n=void 0,r=void 0,s=void 0;return i?(n=e.eventBusEl_,t.length>=3&&t.shift(),r=t[0],s=t[1]):(n=t[0],r=t[1],s=t[2]),ot(n),lt(r),ut(s),s=tt(e,s),{isTargetingSelf:i,target:n,type:r,listener:s}},ht=function(e,t,i,n){ot(e),e.nodeName?Xe[t](e,i,n):e[t](i,n)},dt={on:function(){for(var e=this,t=arguments.length,i=Array(t),n=0;n<t;n++)i[n]=arguments[n];var r=ct(this,i),s=r.isTargetingSelf,a=r.target,o=r.type,l=r.listener;if(ht(a,"on",o,l),!s){var u=function(){return e.off(a,o,l)};u.guid=l.guid;var c=function(){return e.off("dispose",u)};c.guid=l.guid,ht(this,"on","dispose",u),ht(a,"on","dispose",c)}},one:function(){for(var e=this,t=arguments.length,i=Array(t),n=0;n<t;n++)i[n]=arguments[n];var r=ct(this,i),s=r.isTargetingSelf,a=r.target,o=r.type,l=r.listener;if(s)ht(a,"one",o,l);else{var u=function t(){for(var i=arguments.length,n=Array(i),r=0;r<i;r++)n[r]=arguments[r];e.off(a,o,t),l.apply(null,n)};u.guid=l.guid,ht(a,"one",o,u)}},off:function(e,t,i){if(!e||at(e))We(this.eventBusEl_,e,t);else{var n=e,r=t;ot(n),lt(r),ut(i),i=tt(this,i),this.off("dispose",i),n.nodeName?(We(n,r,i),We(n,"dispose",i)):st(n)&&(n.off(r,i),n.off("dispose",i))}},trigger:function(e,t){return $e(this.eventBusEl_,e,t)}};function pt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.eventBusKey;if(i){if(!e[i].nodeName)throw new Error('The eventBusKey "'+i+'" does not refer to an element.');e.eventBusEl_=e[i]}else e.eventBusEl_=ae("span",{className:"vjs-event-bus"});return V(e,dt),e.on("dispose",(function(){e.off(),r.setTimeout((function(){e.eventBusEl_=null}),0)})),e}var ft={state:{},setState:function(e){var t=this;"function"===typeof e&&(e=e());var i=void 0;return q(e,(function(e,n){t.state[n]!==e&&(i=i||{},i[n]={from:t.state[n],to:e}),t.state[n]=e})),i&&st(this)&&this.trigger({changes:i,type:"statechanged"}),i}};function mt(e,t){return V(e,ft),e.state=V({},e.state,t),"function"===typeof e.handleStateChanged&&st(e)&&e.on("statechanged",e.handleStateChanged),e}function gt(e){return"string"!==typeof e?e:e.charAt(0).toUpperCase()+e.slice(1)}function yt(e,t){return gt(e)===gt(t)}function vt(){for(var e={},t=arguments.length,i=Array(t),n=0;n<t;n++)i[n]=arguments[n];return i.forEach((function(t){t&&q(t,(function(t,i){W(t)?(W(e[i])||(e[i]={}),e[i]=vt(e[i],t)):e[i]=t}))})),e}var _t=function(){function e(t,i,n){if(R(this,e),!t&&this.play?this.player_=t=this:this.player_=t,this.options_=vt({},this.options_),i=this.options_=vt(this.options_,i),this.id_=i.id||i.el&&i.el.id,!this.id_){var r=t&&t.id&&t.id()||"no_player";this.id_=r+"_component_"+De()}this.name_=i.name||null,i.el?this.el_=i.el:!1!==i.createEl&&(this.el_=this.createEl()),!1!==i.evented&&pt(this,{eventBusKey:this.el_?"el_":null}),mt(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},!1!==i.initChildren&&this.initChildren(),this.ready(n),!1!==i.reportTouchActivity&&this.enableTouchActivity()}return e.prototype.dispose=function(){if(this.trigger({type:"dispose",bubbles:!1}),this.children_)for(var e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),Be(this.el_),this.el_=null),this.player_=null},e.prototype.player=function(){return this.player_},e.prototype.options=function(e){return K.warn("this.options() has been deprecated and will be moved to the constructor in 6.0"),e?(this.options_=vt(this.options_,e),this.options_):this.options_},e.prototype.el=function(){return this.el_},e.prototype.createEl=function(e,t,i){return ae(e,t,i)},e.prototype.localize=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,n=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),s=r&&r[n],a=n&&n.split("-")[0],o=r&&r[a],l=i;return s&&s[e]?l=s[e]:o&&o[e]&&(l=o[e]),t&&(l=l.replace(/\{(\d+)\}/g,(function(e,i){var n=t[i-1],r=n;return"undefined"===typeof n&&(r=e),r}))),l},e.prototype.contentEl=function(){return this.contentEl_||this.el_},e.prototype.id=function(){return this.id_},e.prototype.name=function(){return this.name_},e.prototype.children=function(){return this.children_},e.prototype.getChildById=function(e){return this.childIndex_[e]},e.prototype.getChild=function(e){if(e)return e=gt(e),this.childNameIndex_[e]},e.prototype.addChild=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.children_.length,r=void 0,s=void 0;if("string"===typeof t){s=gt(t);var a=i.componentClass||s;i.name=s;var o=e.getComponent(a);if(!o)throw new Error("Component "+a+" does not exist");if("function"!==typeof o)return null;r=new o(this.player_||this,i)}else r=t;if(this.children_.splice(n,0,r),"function"===typeof r.id&&(this.childIndex_[r.id()]=r),s=s||r.name&&gt(r.name()),s&&(this.childNameIndex_[s]=r),"function"===typeof r.el&&r.el()){var l=this.contentEl().children,u=l[n]||null;this.contentEl().insertBefore(r.el(),u)}return r},e.prototype.removeChild=function(e){if("string"===typeof e&&(e=this.getChild(e)),e&&this.children_){for(var t=!1,i=this.children_.length-1;i>=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(t){this.childIndex_[e.id()]=null,this.childNameIndex_[e.name()]=null;var n=e.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},e.prototype.initChildren=function(){var t=this,i=this.options_.children;if(i){var n=this.options_,r=function(e){var i=e.name,r=e.opts;if(void 0!==n[i]&&(r=n[i]),!1!==r){!0===r&&(r={}),r.playerOptions=t.options_.playerOptions;var s=t.addChild(i,r);s&&(t[i]=s)}},s=void 0,a=e.getComponent("Tech");s=Array.isArray(i)?i:Object.keys(i),s.concat(Object.keys(this.options_).filter((function(e){return!s.some((function(t){return"string"===typeof t?e===t:e===t.name}))}))).map((function(e){var n=void 0,r=void 0;return"string"===typeof e?(n=e,r=i[n]||t.options_[n]||{}):(n=e.name,r=e),{name:n,opts:r}})).filter((function(t){var i=e.getComponent(t.opts.componentClass||gt(t.name));return i&&!a.isTech(i)})).forEach(r)}},e.prototype.buildCSSClass=function(){return""},e.prototype.ready=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},e.prototype.triggerReady=function(){this.isReady_=!0,this.setTimeout((function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach((function(e){e.call(this)}),this),this.trigger("ready")}),1)},e.prototype.$=function(e,t){return Ie(e,t||this.contentEl())},e.prototype.$$=function(e,t){return Oe(e,t||this.contentEl())},e.prototype.hasClass=function(e){return ue(this.el_,e)},e.prototype.addClass=function(e){ce(this.el_,e)},e.prototype.removeClass=function(e){he(this.el_,e)},e.prototype.toggleClass=function(e,t){de(this.el_,e,t)},e.prototype.show=function(){this.removeClass("vjs-hidden")},e.prototype.hide=function(){this.addClass("vjs-hidden")},e.prototype.lockShowing=function(){this.addClass("vjs-lock-showing")},e.prototype.unlockShowing=function(){this.removeClass("vjs-lock-showing")},e.prototype.getAttribute=function(e){return me(this.el_,e)},e.prototype.setAttribute=function(e,t){ge(this.el_,e,t)},e.prototype.removeAttribute=function(e){ye(this.el_,e)},e.prototype.width=function(e,t){return this.dimension("width",e,t)},e.prototype.height=function(e,t){return this.dimension("height",e,t)},e.prototype.dimensions=function(e,t){this.width(e,!0),this.height(t)},e.prototype.dimension=function(e,t,i){if(void 0!==t)return null!==t&&t===t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;var n=this.el_.style[e],r=n.indexOf("px");return-1!==r?parseInt(n.slice(0,r),10):parseInt(this.el_["offset"+gt(e)],10)},e.prototype.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if("function"===typeof r.getComputedStyle){var i=r.getComputedStyle(this.el_);t=i.getPropertyValue(e)||i[e]}if(t=parseFloat(t),0===t){var n="offset"+gt(e);t=this.el_[n]}return t},e.prototype.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},e.prototype.currentWidth=function(){return this.currentDimension("width")},e.prototype.currentHeight=function(){return this.currentDimension("height")},e.prototype.focus=function(){this.el_.focus()},e.prototype.blur=function(){this.el_.blur()},e.prototype.emitTapEvents=function(){var e=0,t=null,i=10,n=200,r=void 0;this.on("touchstart",(function(i){1===i.touches.length&&(t={pageX:i.touches[0].pageX,pageY:i.touches[0].pageY},e=(new Date).getTime(),r=!0)})),this.on("touchmove",(function(e){if(e.touches.length>1)r=!1;else if(t){var n=e.touches[0].pageX-t.pageX,s=e.touches[0].pageY-t.pageY,a=Math.sqrt(n*n+s*s);a>i&&(r=!1)}}));var s=function(){r=!1};this.on("touchleave",s),this.on("touchcancel",s),this.on("touchend",(function(i){if(t=null,!0===r){var s=(new Date).getTime()-e;s<n&&(i.preventDefault(),this.trigger("tap"))}}))},e.prototype.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e=tt(this.player(),this.player().reportUserActivity),t=void 0;this.on("touchstart",(function(){e(),this.clearInterval(t),t=this.setInterval(e,250)}));var i=function(i){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",i),this.on("touchcancel",i)}},e.prototype.setTimeout=function(e,t){var i,n,s=this;return e=tt(this,e),i=r.setTimeout((function(){s.off("dispose",n),e()}),t),n=function(){return s.clearTimeout(i)},n.guid="vjs-timeout-"+i,this.on("dispose",n),i},e.prototype.clearTimeout=function(e){r.clearTimeout(e);var t=function(){};return t.guid="vjs-timeout-"+e,this.off("dispose",t),e},e.prototype.setInterval=function(e,t){var i=this;e=tt(this,e);var n=r.setInterval(e,t),s=function(){return i.clearInterval(n)};return s.guid="vjs-interval-"+n,this.on("dispose",s),n},e.prototype.clearInterval=function(e){r.clearInterval(e);var t=function(){};return t.guid="vjs-interval-"+e,this.off("dispose",t),e},e.prototype.requestAnimationFrame=function(e){var t,i,n=this;return this.supportsRaf_?(e=tt(this,e),t=r.requestAnimationFrame((function(){n.off("dispose",i),e()})),i=function(){return n.cancelAnimationFrame(t)},i.guid="vjs-raf-"+t,this.on("dispose",i),t):this.setTimeout(e,1e3/60)},e.prototype.cancelAnimationFrame=function(e){if(this.supportsRaf_){r.cancelAnimationFrame(e);var t=function(){};return t.guid="vjs-raf-"+e,this.off("dispose",t),e}return this.clearTimeout(e)},e.registerComponent=function(t,i){if("string"!==typeof t||!t)throw new Error('Illegal component name, "'+t+'"; must be a non-empty string.');var n=e.getComponent("Tech"),r=n&&n.isTech(i),s=e===i||e.prototype.isPrototypeOf(i.prototype);if(r||!s){var a=void 0;throw a=r?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+t+'"; '+a+".")}t=gt(t),e.components_||(e.components_={});var o=e.getComponent("Player");if("Player"===t&&o&&o.players){var l=o.players,u=Object.keys(l);if(l&&u.length>0&&u.map((function(e){return l[e]})).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return e.components_[t]=i,i},e.getComponent=function(t){if(t)return t=gt(t),e.components_&&e.components_[t]?e.components_[t]:void 0},e}();function bt(e,t,i){if("number"!==typeof t||t<0||t>i)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+i+").")}function Tt(e,t,i,n){return bt(e,n,i.length-1),i[n][t]}function St(e){return void 0===e||0===e.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:Tt.bind(null,"start",0,e),end:Tt.bind(null,"end",1,e)}}function kt(e,t){return Array.isArray(e)?St(e):void 0===e||void 0===t?St():St([[e,t]])}function Et(e,t){var i=0,n=void 0,r=void 0;if(!t)return 0;e&&e.length||(e=kt(0,0));for(var s=0;s<e.length;s++)n=e.start(s),r=e.end(s),r>t&&(r=t),i+=r-n;return i/t}_t.prototype.supportsRaf_="function"===typeof r.requestAnimationFrame&&"function"===typeof r.cancelAnimationFrame,_t.registerComponent("Component",_t);for(var wt={},Ct=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],xt=Ct[0],At=void 0,It=0;It<Ct.length;It++)if(Ct[It][1]in s){At=Ct[It];break}if(At)for(var Ot=0;Ot<At.length;Ot++)wt[xt[Ot]]=At[Ot];function Pt(e){if(e instanceof Pt)return e;"number"===typeof e?this.code=e:"string"===typeof e?this.message=e:z(e)&&("number"===typeof e.code&&(this.code=e.code),V(this,e)),this.message||(this.message=Pt.defaultMessages[this.code]||"")}Pt.prototype.code=0,Pt.prototype.message="",Pt.prototype.status=null,Pt.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Pt.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."};for(var Lt=0;Lt<Pt.errorTypes.length;Lt++)Pt[Pt.errorTypes[Lt]]=Lt,Pt.prototype[Pt.errorTypes[Lt]]=Lt;function Dt(e){return void 0!==e&&null!==e&&"function"===typeof e.then}function Mt(e){Dt(e)&&e.then(null,(function(e){}))}var Rt=function(e){var t=["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((function(t,i,n){return e[i]&&(t[i]=e[i]),t}),{cues:e.cues&&Array.prototype.map.call(e.cues,(function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}}))});return t},Nt=function(e){var t=e.$$("track"),i=Array.prototype.map.call(t,(function(e){return e.track})),n=Array.prototype.map.call(t,(function(e){var t=Rt(e.track);return e.src&&(t.src=e.src),t}));return n.concat(Array.prototype.filter.call(e.textTracks(),(function(e){return-1===i.indexOf(e)})).map(Rt))},jt=function(e,t){return e.forEach((function(e){var i=t.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach((function(e){return i.addCue(e)}))})),t.textTracks()},Bt={textTracksToJson:Nt,jsonToTextTracks:jt,trackToJson_:Rt},Ut="vjs-modal-dialog",Ft=27,qt=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.opened_=r.hasBeenOpened_=r.hasBeenFilled_=!1,r.closeable(!r.options_.uncloseable),r.content(r.options_.content),r.contentEl_=ae("div",{className:Ut+"-content"},{role:"document"}),r.descEl_=ae("p",{className:Ut+"-description vjs-control-text",id:r.el().getAttribute("aria-describedby")}),oe(r.descEl_,r.description()),r.el_.appendChild(r.descEl_),r.el_.appendChild(r.contentEl_),r}return N(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},t.prototype.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,e.prototype.dispose.call(this)},t.prototype.buildCSSClass=function(){return Ut+" vjs-hidden "+e.prototype.buildCSSClass.call(this)},t.prototype.handleKeyPress=function(e){e.which===Ft&&this.closeable()&&this.close()},t.prototype.label=function(){return this.localize(this.options_.label||"Modal Window")},t.prototype.description=function(){var 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},t.prototype.open=function(){if(!this.opened_){var 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.closeable()&&this.on(this.el_.ownerDocument,"keydown",tt(this,this.handleKeyPress)),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}},t.prototype.opened=function(e){return"boolean"===typeof e&&this[e?"open":"close"](),this.opened_},t.prototype.close=function(){if(this.opened_){var e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.closeable()&&this.off(this.el_.ownerDocument,"keydown",tt(this,this.handleKeyPress)),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}},t.prototype.closeable=function(e){if("boolean"===typeof e){var t=this.closeable_=!!e,i=this.getChild("closeButton");if(t&&!i){var n=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=n,this.on(i,"close",this.close)}!t&&i&&(this.off(i,"close",this.close),this.removeChild(i),i.dispose())}return this.closeable_},t.prototype.fill=function(){this.fillWith(this.content())},t.prototype.fillWith=function(e){var t=this.contentEl(),i=t.parentNode,n=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),xe(t,e),this.trigger("modalfill"),n?i.insertBefore(t,n):i.appendChild(t);var r=this.getChild("closeButton");r&&i.appendChild(r.el_)},t.prototype.empty=function(){this.trigger("beforemodalempty"),Ee(this.contentEl()),this.trigger("modalempty")},t.prototype.content=function(e){return"undefined"!==typeof e&&(this.content_=e),this.content_},t.prototype.conditionalFocus_=function(){var e=s.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus(),this.on(s,"keydown",this.handleKeyDown))},t.prototype.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null),this.off(s,"keydown",this.handleKeyDown)},t.prototype.handleKeyDown=function(e){if(9===e.which){for(var t=this.focusableEls_(),i=this.el_.querySelector(":focus"),n=void 0,r=0;r<t.length;r++)if(i===t[r]){n=r;break}s.activeElement===this.el_&&(n=0),e.shiftKey&&0===n?(t[t.length-1].focus(),e.preventDefault()):e.shiftKey||n!==t.length-1||(t[0].focus(),e.preventDefault())}},t.prototype.focusableEls_=function(){var e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,(function(e){return(e instanceof r.HTMLAnchorElement||e instanceof r.HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof r.HTMLInputElement||e instanceof r.HTMLSelectElement||e instanceof r.HTMLTextAreaElement||e instanceof r.HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof r.HTMLIFrameElement||e instanceof r.HTMLObjectElement||e instanceof r.HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable")}))},t}(_t);qt.prototype.options_={pauseOnOpen:!0,temporary:!0},_t.registerComponent("ModalDialog",qt);var Ht=function(e){function t(){var i,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;R(this,t);var a=j(this,e.call(this));if(!r&&(r=a,x))for(var o in r=s.createElement("custom"),t.prototype)"constructor"!==o&&(r[o]=t.prototype[o]);r.tracks_=[],Object.defineProperty(r,"length",{get:function(){return this.tracks_.length}});for(var l=0;l<n.length;l++)r.addTrack(n[l]);return i=r,j(a,i)}return N(t,e),t.prototype.addTrack=function(e){var t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.tracks_[t]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack"}))},t.prototype.removeTrack=function(e){for(var t=void 0,i=0,n=this.length;i<n;i++)if(this[i]===e){t=this[i],t.off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack"})},t.prototype.getTrackById=function(e){for(var t=null,i=0,n=this.length;i<n;i++){var r=this[i];if(r.id===e){t=r;break}}return t},t}(rt);for(var Vt in Ht.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack"},Ht.prototype.allowedEvents_)Ht.prototype["on"+Vt]=null;var zt=function(e,t){for(var i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].enabled=!1)},Wt=function(e){function t(){var i,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];R(this,t);for(var a=void 0,o=r.length-1;o>=0;o--)if(r[o].enabled){zt(r,r[o]);break}if(x){for(var l in a=s.createElement("custom"),Ht.prototype)"constructor"!==l&&(a[l]=Ht.prototype[l]);for(var u in t.prototype)"constructor"!==u&&(a[u]=t.prototype[u])}return i=j(this,e.call(this,r,a)),a=i,a.changing_=!1,n=a,j(i,n)}return N(t,e),t.prototype.addTrack=function(t){var i=this;t.enabled&&zt(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&t.addEventListener("enabledchange",(function(){i.changing_||(i.changing_=!0,zt(i,t),i.changing_=!1,i.trigger("change"))}))},t}(Ht),$t=function(e,t){for(var i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].selected=!1)},Gt=function(e){function t(){var i,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];R(this,t);for(var a=void 0,o=r.length-1;o>=0;o--)if(r[o].selected){$t(r,r[o]);break}if(x){for(var l in a=s.createElement("custom"),Ht.prototype)"constructor"!==l&&(a[l]=Ht.prototype[l]);for(var u in t.prototype)"constructor"!==u&&(a[u]=t.prototype[u])}return i=j(this,e.call(this,r,a)),a=i,a.changing_=!1,Object.defineProperty(a,"selectedIndex",{get:function(){for(var e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set:function(){}}),n=a,j(i,n)}return N(t,e),t.prototype.addTrack=function(t){var i=this;t.selected&&$t(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&t.addEventListener("selectedchange",(function(){i.changing_||(i.changing_=!0,$t(i,t),i.changing_=!1,i.trigger("change"))}))},t}(Ht),Xt=function(e){function t(){var i,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];R(this,t);var a=void 0;if(x){for(var o in a=s.createElement("custom"),Ht.prototype)"constructor"!==o&&(a[o]=Ht.prototype[o]);for(var l in t.prototype)"constructor"!==l&&(a[l]=t.prototype[l])}return i=j(this,e.call(this,r,a)),a=i,n=a,j(i,n)}return N(t,e),t.prototype.addTrack=function(t){e.prototype.addTrack.call(this,t),t.addEventListener("modechange",tt(this,(function(){this.trigger("change")})));var i=["metadata","chapters"];-1===i.indexOf(t.kind)&&t.addEventListener("modechange",tt(this,(function(){this.trigger("selectedlanguagechange")})))},t}(Ht),Kt=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];R(this,e);var i=this;if(x)for(var n in i=s.createElement("custom"),e.prototype)"constructor"!==n&&(i[n]=e.prototype[n]);i.trackElements_=[],Object.defineProperty(i,"length",{get:function(){return this.trackElements_.length}});for(var r=0,a=t.length;r<a;r++)i.addTrackElement_(t[r]);if(x)return i}return e.prototype.addTrackElement_=function(e){var t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.trackElements_[t]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)},e.prototype.getTrackElementByTrack_=function(e){for(var t=void 0,i=0,n=this.trackElements_.length;i<n;i++)if(e===this.trackElements_[i].track){t=this.trackElements_[i];break}return t},e.prototype.removeTrackElement_=function(e){for(var t=0,i=this.trackElements_.length;t<i;t++)if(e===this.trackElements_[t]){this.trackElements_.splice(t,1);break}},e}(),Yt=function(){function e(t){R(this,e);var i=this;if(x)for(var n in i=s.createElement("custom"),e.prototype)"constructor"!==n&&(i[n]=e.prototype[n]);if(e.prototype.setCues_.call(i,t),Object.defineProperty(i,"length",{get:function(){return this.length_}}),x)return i}return e.prototype.setCues_=function(e){var t=this.length||0,i=0,n=e.length;this.cues_=e,this.length_=e.length;var r=function(e){""+e in this||Object.defineProperty(this,""+e,{get:function(){return this.cues_[e]}})};if(t<n)for(i=t;i<n;i++)r.call(this,i)},e.prototype.getCueById=function(e){for(var t=null,i=0,n=this.length;i<n;i++){var r=this[i];if(r.id===e){t=r;break}}return t},e}(),Qt={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Jt={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},Zt={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},ei={disabled:"disabled",hidden:"hidden",showing:"showing"},ti=function(e){function t(){var i,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};R(this,t);var r=j(this,e.call(this)),a=r;if(x)for(var o in a=s.createElement("custom"),t.prototype)"constructor"!==o&&(a[o]=t.prototype[o]);var l={id:n.id||"vjs_track_"+De(),kind:n.kind||"",label:n.label||"",language:n.language||""},u=function(e){Object.defineProperty(a,e,{get:function(){return l[e]},set:function(){}})};for(var c in l)u(c);return i=a,j(r,i)}return N(t,e),t}(rt),ii=function(e){var t=["protocol","hostname","port","pathname","search","hash","host"],i=s.createElement("a");i.href=e;var n=""===i.host&&"file:"!==i.protocol,a=void 0;n&&(a=s.createElement("div"),a.innerHTML='<a href="'+e+'"></a>',i=a.firstChild,a.setAttribute("style","display:none; position:absolute;"),s.body.appendChild(a));for(var o={},l=0;l<t.length;l++)o[t[l]]=i[t[l]];return"http:"===o.protocol&&(o.host=o.host.replace(/:80$/,"")),"https:"===o.protocol&&(o.host=o.host.replace(/:443$/,"")),o.protocol||(o.protocol=r.location.protocol),n&&s.body.removeChild(a),o},ni=function(e){if(!e.match(/^https?:\/\//)){var t=s.createElement("div");t.innerHTML='<a href="'+e+'">x</a>',e=t.firstChild.href}return e},ri=function(e){if("string"===typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i,i=t.exec(e);if(i)return i.pop().toLowerCase()}return""},si=function(e){var t=r.location,i=ii(e),n=":"===i.protocol?t.protocol:i.protocol,s=n+i.host!==t.protocol+t.host;return s},ai=(Object.freeze||Object)({parseUrl:ii,getAbsoluteURL:ni,getFileExtension:ri,isCrossOrigin:si}),oi=function(e,t){var i=new r.WebVTT.Parser(r,r.vttjs,r.WebVTT.StringDecoder()),n=[];i.oncue=function(e){t.addCue(e)},i.onparsingerror=function(e){n.push(e)},i.onflush=function(){t.trigger({type:"loadeddata",target:t})},i.parse(e),n.length>0&&(r.console&&r.console.groupCollapsed&&r.console.groupCollapsed("Text Track parsing errors for "+t.src),n.forEach((function(e){return K.error(e)})),r.console&&r.console.groupEnd&&r.console.groupEnd()),i.flush()},li=function(e,t){var i={uri:e},n=si(e);n&&(i.cors=n),l(i,tt(this,(function(e,i,n){if(e)return K.error(e,i);if(t.loaded_=!0,"function"!==typeof r.WebVTT){if(t.tech_){var s=function(){return oi(n,t)};t.tech_.on("vttjsloaded",s),t.tech_.on("vttjserror",(function(){K.error("vttjs failed to load, stopping trying to process "+t.src),t.tech_.off("vttjsloaded",s)}))}}else oi(n,t)})))},ui=function(e){function t(){var i,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(R(this,t),!r.tech)throw new Error("A tech was not provided.");var s=vt(r,{kind:Zt[r.kind]||"subtitles",language:r.language||r.srclang||""}),a=ei[s.mode]||"disabled",o=s["default"];"metadata"!==s.kind&&"chapters"!==s.kind||(a="hidden");var l=(i=j(this,e.call(this,s)),i);if(l.tech_=s.tech,x)for(var u in t.prototype)"constructor"!==u&&(l[u]=t.prototype[u]);l.cues_=[],l.activeCues_=[];var c=new Yt(l.cues_),h=new Yt(l.activeCues_),d=!1,p=tt(l,(function(){this.activeCues=this.activeCues,d&&(this.trigger("cuechange"),d=!1)}));return"disabled"!==a&&l.tech_.ready((function(){l.tech_.on("timeupdate",p)}),!0),Object.defineProperty(l,"default",{get:function(){return o},set:function(){}}),Object.defineProperty(l,"mode",{get:function(){return a},set:function(e){var t=this;ei[e]&&(a=e,"disabled"!==a?this.tech_.ready((function(){t.tech_.on("timeupdate",p)}),!0):this.tech_.off("timeupdate",p),this.trigger("modechange"))}}),Object.defineProperty(l,"cues",{get:function(){return this.loaded_?c:null},set:function(){}}),Object.defineProperty(l,"activeCues",{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return h;for(var e=this.tech_.currentTime(),t=[],i=0,n=this.cues.length;i<n;i++){var r=this.cues[i];(r.startTime<=e&&r.endTime>=e||r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e)&&t.push(r)}if(d=!1,t.length!==this.activeCues_.length)d=!0;else for(var s=0;s<t.length;s++)-1===this.activeCues_.indexOf(t[s])&&(d=!0);return this.activeCues_=t,h.setCues_(this.activeCues_),h},set:function(){}}),s.src?(l.src=s.src,li(s.src,l)):l.loaded_=!0,n=l,j(i,n)}return N(t,e),t.prototype.addCue=function(e){var t=e;if(r.vttjs&&!(e instanceof r.vttjs.VTTCue)){for(var i in t=new r.vttjs.VTTCue(e.startTime,e.endTime,e.text),e)i in t||(t[i]=e[i]);t.id=e.id,t.originalCue_=e}for(var n=this.tech_.textTracks(),s=0;s<n.length;s++)n[s]!==this&&n[s].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)},t.prototype.removeCue=function(e){var t=this.cues_.length;while(t--){var i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}},t}(ti);ui.prototype.allowedEvents_={cuechange:"cuechange"};var ci=function(e){function t(){var i,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};R(this,t);var s=vt(r,{kind:Jt[r.kind]||""}),a=(i=j(this,e.call(this,s)),i),o=!1;if(x)for(var l in t.prototype)"constructor"!==l&&(a[l]=t.prototype[l]);return Object.defineProperty(a,"enabled",{get:function(){return o},set:function(e){"boolean"===typeof e&&e!==o&&(o=e,this.trigger("enabledchange"))}}),s.enabled&&(a.enabled=s.enabled),a.loaded_=!0,n=a,j(i,n)}return N(t,e),t}(ti),hi=function(e){function t(){var i,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};R(this,t);var s=vt(r,{kind:Qt[r.kind]||""}),a=(i=j(this,e.call(this,s)),i),o=!1;if(x)for(var l in t.prototype)"constructor"!==l&&(a[l]=t.prototype[l]);return Object.defineProperty(a,"selected",{get:function(){return o},set:function(e){"boolean"===typeof e&&e!==o&&(o=e,this.trigger("selectedchange"))}}),s.selected&&(a.selected=s.selected),n=a,j(i,n)}return N(t,e),t}(ti),di=0,pi=1,fi=2,mi=3,gi=function(e){function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};R(this,t);var n=j(this,e.call(this)),r=void 0,a=n;if(x)for(var o in a=s.createElement("custom"),t.prototype)"constructor"!==o&&(a[o]=t.prototype[o]);var l,u=new ui(i);return a.kind=u.kind,a.src=u.src,a.srclang=u.language,a.label=u.label,a["default"]=u["default"],Object.defineProperty(a,"readyState",{get:function(){return r}}),Object.defineProperty(a,"track",{get:function(){return u}}),r=di,u.addEventListener("loadeddata",(function(){r=fi,a.trigger({type:"load",target:a})})),x?(l=a,j(n,l)):n}return N(t,e),t}(rt);gi.prototype.allowedEvents_={load:"load"},gi.NONE=di,gi.LOADING=pi,gi.LOADED=fi,gi.ERROR=mi;var yi={audio:{ListClass:Wt,TrackClass:ci,capitalName:"Audio"},video:{ListClass:Gt,TrackClass:hi,capitalName:"Video"},text:{ListClass:Xt,TrackClass:ui,capitalName:"Text"}};Object.keys(yi).forEach((function(e){yi[e].getterName=e+"Tracks",yi[e].privateName=e+"Tracks_"}));var vi={remoteText:{ListClass:Xt,TrackClass:ui,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Kt,TrackClass:gi,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},_i=vt(yi,vi);function bi(e,t,i,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=e.textTracks();r.kind=t,i&&(r.label=i),n&&(r.language=n),r.tech=e;var a=new _i.text.TrackClass(r);return s.addTrack(a),a}vi.names=Object.keys(vi),yi.names=Object.keys(yi),_i.names=[].concat(vi.names).concat(yi.names);var Ti=function(e){function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};R(this,t),i.reportTouchActivity=!1;var r=j(this,e.call(this,null,i,n));return r.hasStarted_=!1,r.on("playing",(function(){this.hasStarted_=!0})),r.on("loadstart",(function(){this.hasStarted_=!1})),_i.names.forEach((function(e){var t=_i[e];i&&i[t.getterName]&&(r[t.privateName]=i[t.getterName])})),r.featuresProgressEvents||r.manualProgressOn(),r.featuresTimeupdateEvents||r.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach((function(e){!1===i["native"+e+"Tracks"]&&(r["featuresNative"+e+"Tracks"]=!1)})),!1===i.nativeCaptions||!1===i.nativeTextTracks?r.featuresNativeTextTracks=!1:!0!==i.nativeCaptions&&!0!==i.nativeTextTracks||(r.featuresNativeTextTracks=!0),r.featuresNativeTextTracks||r.emulateTextTracks(),r.autoRemoteTextTracks_=new _i.text.ListClass,r.initTrackListeners(),i.nativeControlsForTouch||r.emitTapEvents(),r.constructor&&(r.name_=r.constructor.name||"Unknown Tech"),r}return N(t,e),t.prototype.triggerSourceset=function(e){var t=this;this.isReady_||this.one("ready",(function(){return t.setTimeout((function(){return t.triggerSourceset(e)}),1)})),this.trigger({src:e,type:"sourceset"})},t.prototype.manualProgressOn=function(){this.on("durationchange",this.onDurationChange),this.manualProgress=!0,this.one("ready",this.trackProgress)},t.prototype.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange)},t.prototype.trackProgress=function(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(tt(this,(function(){var e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()})),500)},t.prototype.onDurationChange=function(e){this.duration_=this.duration()},t.prototype.buffered=function(){return kt(0,0)},t.prototype.bufferedPercent=function(){return Et(this.buffered(),this.duration_)},t.prototype.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},t.prototype.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime),this.on("pause",this.stopTrackingCurrentTime)},t.prototype.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime),this.off("pause",this.stopTrackingCurrentTime)},t.prototype.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval((function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}),250)},t.prototype.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},t.prototype.dispose=function(){this.clearTracks(yi.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),e.prototype.dispose.call(this)},t.prototype.clearTracks=function(e){var t=this;e=[].concat(e),e.forEach((function(e){var i=t[e+"Tracks"]()||[],n=i.length;while(n--){var r=i[n];"text"===e&&t.removeRemoteTextTrack(r),i.removeTrack(r)}}))},t.prototype.cleanupAutoTextTracks=function(){var e=this.autoRemoteTextTracks_||[],t=e.length;while(t--){var i=e[t];this.removeRemoteTextTrack(i)}},t.prototype.reset=function(){},t.prototype.error=function(e){return void 0!==e&&(this.error_=new Pt(e),this.trigger("error")),this.error_},t.prototype.played=function(){return this.hasStarted_?kt(0,0):kt()},t.prototype.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},t.prototype.initTrackListeners=function(){var e=this;yi.names.forEach((function(t){var i=yi[t],n=function(){e.trigger(t+"trackchange")},r=e[i.getterName]();r.addEventListener("removetrack",n),r.addEventListener("addtrack",n),e.on("dispose",(function(){r.removeEventListener("removetrack",n),r.removeEventListener("addtrack",n)}))}))},t.prototype.addWebVttScript_=function(){var e=this;if(!r.WebVTT)if(s.body.contains(this.el())){if(!this.options_["vtt.js"]&&W(u)&&Object.keys(u).length>0)return void this.trigger("vttjsloaded");var t=s.createElement("script");t.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.12.4/vtt.min.js",t.onload=function(){e.trigger("vttjsloaded")},t.onerror=function(){e.trigger("vttjserror")},this.on("dispose",(function(){t.onload=null,t.onerror=null})),r.WebVTT=!0,this.el().parentNode.appendChild(t)}else this.ready(this.addWebVttScript_)},t.prototype.emulateTextTracks=function(){var e=this,t=this.textTracks(),i=this.remoteTextTracks(),n=function(e){return t.addTrack(e.track)},r=function(e){return t.removeTrack(e.track)};i.on("addtrack",n),i.on("removetrack",r),this.addWebVttScript_();var s=function(){return e.trigger("texttrackchange")},a=function(){s();for(var e=0;e<t.length;e++){var i=t[e];i.removeEventListener("cuechange",s),"showing"===i.mode&&i.addEventListener("cuechange",s)}};a(),t.addEventListener("change",a),t.addEventListener("addtrack",a),t.addEventListener("removetrack",a),this.on("dispose",(function(){i.off("addtrack",n),i.off("removetrack",r),t.removeEventListener("change",a),t.removeEventListener("addtrack",a),t.removeEventListener("removetrack",a);for(var e=0;e<t.length;e++){var o=t[e];o.removeEventListener("cuechange",s)}}))},t.prototype.addTextTrack=function(e,t,i){if(!e)throw new Error("TextTrack kind is required but was not provided");return bi(this,e,t,i)},t.prototype.createRemoteTextTrack=function(e){var t=vt(e,{tech:this});return new vi.remoteTextEl.TrackClass(t)},t.prototype.addRemoteTextTrack=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments[1],n=this.createRemoteTextTrack(t);return!0!==i&&!1!==i&&(K.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),i=!0),this.remoteTextTrackEls().addTrackElement_(n),this.remoteTextTracks().addTrack(n.track),!0!==i&&this.ready((function(){return e.autoRemoteTextTracks_.addTrack(n.track)})),n},t.prototype.removeRemoteTextTrack=function(e){var t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)},t.prototype.getVideoPlaybackQuality=function(){return{}},t.prototype.setPoster=function(){},t.prototype.playsinline=function(){},t.prototype.setPlaysinline=function(){},t.prototype.canPlayType=function(){return""},t.canPlayType=function(){return""},t.canPlaySource=function(e,i){return t.canPlayType(e.type)},t.isTech=function(e){return e.prototype instanceof t||e instanceof t||e===t},t.registerTech=function(e,i){if(t.techs_||(t.techs_={}),!t.isTech(i))throw new Error("Tech "+e+" must be a Tech");if(!t.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!t.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=gt(e),t.techs_[e]=i,"Tech"!==e&&t.defaultTechOrder_.push(e),i},t.getTech=function(e){if(e)return e=gt(e),t.techs_&&t.techs_[e]?t.techs_[e]:r&&r.videojs&&r.videojs[e]?(K.warn("The "+e+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),r.videojs[e]):void 0},t}(_t);_i.names.forEach((function(e){var t=_i[e];Ti.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}})),Ti.prototype.featuresVolumeControl=!0,Ti.prototype.featuresMuteControl=!0,Ti.prototype.featuresFullscreenResize=!1,Ti.prototype.featuresPlaybackRate=!1,Ti.prototype.featuresProgressEvents=!1,Ti.prototype.featuresSourceset=!1,Ti.prototype.featuresTimeupdateEvents=!1,Ti.prototype.featuresNativeTextTracks=!1,Ti.withSourceHandlers=function(e){e.registerSourceHandler=function(t,i){var n=e.sourceHandlers;n||(n=e.sourceHandlers=[]),void 0===i&&(i=n.length),n.splice(i,0,t)},e.canPlayType=function(t){for(var i=e.sourceHandlers||[],n=void 0,r=0;r<i.length;r++)if(n=i[r].canPlayType(t),n)return n;return""},e.selectSourceHandler=function(t,i){for(var n=e.sourceHandlers||[],r=void 0,s=0;s<n.length;s++)if(r=n[s].canHandleSource(t,i),r)return n[s];return null},e.canPlaySource=function(t,i){var n=e.selectSourceHandler(t,i);return n?n.canHandleSource(t,i):""};var t=["seekable","seeking","duration"];t.forEach((function(e){var t=this[e];"function"===typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})}),e.prototype),e.prototype.setSource=function(t){var i=e.selectSourceHandler(t,this.options_);i||(e.nativeSourceHandler?i=e.nativeSourceHandler:K.error("No source hander found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler),i!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=i.handleSource(t,this,this.options_),this.on("dispose",this.disposeSourceHandler)},e.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)}},_t.registerComponent("Tech",Ti),Ti.registerTech("Tech",Ti),Ti.defaultTechOrder_=[];var Si={},ki={},Ei={};function wi(e,t){Si[e]=Si[e]||[],Si[e].push(t)}function Ci(e,t,i){e.setTimeout((function(){return Bi(t,Si[t.type],i,e)}),1)}function xi(e,t){e.forEach((function(e){return e.setTech&&e.setTech(t)}))}function Ai(e,t,i){return e.reduceRight(Mi(i),t[i]())}function Ii(e,t,i,n){return t[i](e.reduce(Mi(i),n))}function Oi(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r="call"+gt(i),s=e.reduce(Mi(r),n),a=s===Ei,o=a?null:t[i](s);return Ri(e,i,o,a),o}var Pi={buffered:1,currentTime:1,duration:1,seekable:1,played:1,paused:1},Li={setCurrentTime:1},Di={play:1,pause:1};function Mi(e){return function(t,i){return t===Ei?Ei:i[e]?i[e](t):t}}function Ri(e,t,i,n){for(var r=e.length-1;r>=0;r--){var s=e[r];s[t]&&s[t](n,i)}}function Ni(e){ki[e.id()]=null}function ji(e,t){var i=ki[e.id()],n=null;if(void 0===i||null===i)return n=t(e),ki[e.id()]=[[t,n]],n;for(var r=0;r<i.length;r++){var s=i[r],a=s[0],o=s[1];a===t&&(n=o)}return null===n&&(n=t(e),i.push([t,n])),n}function Bi(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments[2],n=arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=t[0],o=t.slice(1);if("string"===typeof a)Bi(e,Si[a],i,n,r,s);else if(a){var l=ji(n,a);if(!l.setSource)return r.push(l),Bi(e,o,i,n,r,s);l.setSource(V({},e),(function(t,a){if(t)return Bi(e,o,i,n,r,s);r.push(l),Bi(a,e.type===a.type?o:Si[a.type],i,n,r,s)}))}else o.length?Bi(e,o,i,n,r,s):s?i(e,r):Bi(e,Si["*"],i,n,r,!0)}var Ui={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",mp3:"audio/mpeg",aac:"audio/aac",oga:"audio/ogg",m3u8:"application/x-mpegURL"},Fi=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=ri(e),i=Ui[t.toLowerCase()];return i||""},qi=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var i=e.cache_.sources.filter((function(e){return e.src===t}));if(i.length)return i[0].type;for(var n=e.$$("source"),r=0;r<n.length;r++){var s=n[r];if(s.type&&s.src&&s.src===t)return s.type}return Fi(t)},Hi=function e(t){if(Array.isArray(t)){var i=[];t.forEach((function(t){t=e(t),Array.isArray(t)?i=i.concat(t):z(t)&&i.push(t)})),t=i}else t="string"===typeof t&&t.trim()?[Vi({src:t})]:z(t)&&"string"===typeof t.src&&t.src&&t.src.trim()?[Vi(t)]:[];return t};function Vi(e){var t=Fi(e.src);return!e.type&&t&&(e.type=t),e}var zi=function(e){function t(i,n,r){R(this,t);var s=vt({createEl:!1},n),a=j(this,e.call(this,i,s,r));if(n.playerOptions.sources&&0!==n.playerOptions.sources.length)i.src(n.playerOptions.sources);else for(var o=0,l=n.playerOptions.techOrder;o<l.length;o++){var u=gt(l[o]),c=Ti.getTech(u);if(u||(c=_t.getComponent(u)),c&&c.isSupported()){i.loadTech_(u);break}}return a}return N(t,e),t}(_t);_t.registerComponent("MediaLoader",zi);var Wi=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.emitTapEvents(),r.enable(),r}return N(t,e),t.prototype.createEl=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i=V({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass(),tabIndex:0},i),"button"===t&&K.error("Creating a ClickableComponent with an HTML element of "+t+" is not supported; use a Button instead."),n=V({role:"button"},n),this.tabIndex_=i.tabIndex;var r=e.prototype.createEl.call(this,t,i,n);return this.createControlTextEl(r),r},t.prototype.dispose=function(){this.controlTextEl_=null,e.prototype.dispose.call(this)},t.prototype.createControlTextEl=function(e){return this.controlTextEl_=ae("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_},t.prototype.controlText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.el();if(void 0===e)return this.controlText_||"Need Text";var i=this.localize(e);this.controlText_=e,oe(this.controlTextEl_,i),this.nonIconControl||t.setAttribute("title",i)},t.prototype.buildCSSClass=function(){return"vjs-control vjs-button "+e.prototype.buildCSSClass.call(this)},t.prototype.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),"undefined"!==typeof this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur))},t.prototype.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),"undefined"!==typeof this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off(["tap","click"],this.handleClick),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur)},t.prototype.handleClick=function(e){},t.prototype.handleFocus=function(e){ze(s,"keydown",tt(this,this.handleKeyPress))},t.prototype.handleKeyPress=function(t){32===t.which||13===t.which?(t.preventDefault(),this.trigger("click")):e.prototype.handleKeyPress&&e.prototype.handleKeyPress.call(this,t)},t.prototype.handleBlur=function(e){We(s,"keydown",tt(this,this.handleKeyPress))},t}(_t);_t.registerComponent("ClickableComponent",Wi);var $i=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.update(),i.on("posterchange",tt(r,r.update)),r}return N(t,e),t.prototype.dispose=function(){this.player().off("posterchange",this.update),e.prototype.dispose.call(this)},t.prototype.createEl=function(){var e=ae("div",{className:"vjs-poster",tabIndex:-1});return L||(this.fallbackImg_=ae("img"),e.appendChild(this.fallbackImg_)),e},t.prototype.update=function(e){var t=this.player().poster();this.setSrc(t),t?this.show():this.hide()},t.prototype.setSrc=function(e){if(this.fallbackImg_)this.fallbackImg_.src=e;else{var t="";e&&(t='url("'+e+'")'),this.el_.style.backgroundImage=t}},t.prototype.handleClick=function(e){this.player_.controls()&&(this.player_.paused()?Mt(this.player_.play()):this.player_.pause())},t}(Wi);_t.registerComponent("PosterImage",$i);var Gi="#222",Xi="#ccc",Ki={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',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Yi(e,t){var i=void 0;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");i=e.slice(1)}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function Qi(e,t,i){try{e.style[t]=i}catch(n){return}}var Ji=function(e){function t(i,n,s){R(this,t);var a=j(this,e.call(this,i,n,s)),o=tt(a,a.updateDisplay);return i.on("loadstart",tt(a,a.toggleDisplay)),i.on("texttrackchange",o),i.on("loadstart",tt(a,a.preselectTrack)),i.ready(tt(a,(function(){if(i.tech_&&i.tech_.featuresNativeTextTracks)this.hide();else{i.on("fullscreenchange",o),i.on("playerresize",o),r.addEventListener&&r.addEventListener("orientationchange",o),i.on("dispose",(function(){return r.removeEventListener("orientationchange",o)}));for(var e=this.options_.playerOptions.tracks||[],t=0;t<e.length;t++)this.player_.addRemoteTextTrack(e[t],!0);this.preselectTrack()}}))),a}return N(t,e),t.prototype.preselectTrack=function(){for(var e={captions:1,subtitles:1},t=this.player_.textTracks(),i=this.player_.cache_.selectedLanguage,n=void 0,r=void 0,s=void 0,a=0;a<t.length;a++){var o=t[a];i&&i.enabled&&i.language===o.language?o.kind===i.kind?s=o:s||(s=o):i&&!i.enabled?(s=null,n=null,r=null):o["default"]&&("descriptions"!==o.kind||n?o.kind in e&&!r&&(r=o):n=o)}s?s.mode="showing":r?r.mode="showing":n&&(n.mode="showing")},t.prototype.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{"aria-live":"off","aria-atomic":"true"})},t.prototype.clearDisplay=function(){"function"===typeof r.WebVTT&&r.WebVTT.processCues(r,[],this.el_)},t.prototype.updateDisplay=function(){var e=this.player_.textTracks();this.clearDisplay();var t=null,i=null,n=e.length;while(n--){var r=e[n];"showing"===r.mode&&("descriptions"===r.kind?t=r:i=r)}i?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(i)):t&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(t))},t.prototype.updateForTrack=function(e){if("function"===typeof r.WebVTT&&e.activeCues){for(var t=[],i=0;i<e.activeCues.length;i++)t.push(e.activeCues[i]);if(r.WebVTT.processCues(r,t,this.el_),this.player_.textTrackSettings){var n=this.player_.textTrackSettings.getValues(),s=t.length;while(s--){var a=t[s];if(a){var o=a.displayState;if(n.color&&(o.firstChild.style.color=n.color),n.textOpacity&&Qi(o.firstChild,"color",Yi(n.color||"#fff",n.textOpacity)),n.backgroundColor&&(o.firstChild.style.backgroundColor=n.backgroundColor),n.backgroundOpacity&&Qi(o.firstChild,"backgroundColor",Yi(n.backgroundColor||"#000",n.backgroundOpacity)),n.windowColor&&(n.windowOpacity?Qi(o,"backgroundColor",Yi(n.windowColor,n.windowOpacity)):o.style.backgroundColor=n.windowColor),n.edgeStyle&&("dropshadow"===n.edgeStyle?o.firstChild.style.textShadow="2px 2px 3px "+Gi+", 2px 2px 4px "+Gi+", 2px 2px 5px "+Gi:"raised"===n.edgeStyle?o.firstChild.style.textShadow="1px 1px "+Gi+", 2px 2px "+Gi+", 3px 3px "+Gi:"depressed"===n.edgeStyle?o.firstChild.style.textShadow="1px 1px "+Xi+", 0 1px "+Xi+", -1px -1px "+Gi+", 0 -1px "+Gi:"uniform"===n.edgeStyle&&(o.firstChild.style.textShadow="0 0 4px "+Gi+", 0 0 4px "+Gi+", 0 0 4px "+Gi+", 0 0 4px "+Gi)),n.fontPercent&&1!==n.fontPercent){var l=r.parseFloat(o.style.fontSize);o.style.fontSize=l*n.fontPercent+"px",o.style.height="auto",o.style.top="auto",o.style.bottom="2px"}n.fontFamily&&"default"!==n.fontFamily&&("small-caps"===n.fontFamily?o.firstChild.style.fontVariant="small-caps":o.firstChild.style.fontFamily=Ki[n.fontFamily])}}}}},t}(_t);_t.registerComponent("TextTrackDisplay",Ji);var Zi=function(e){function t(){return R(this,t),j(this,e.apply(this,arguments))}return N(t,e),t.prototype.createEl=function(){var t=this.player_.isAudio(),i=this.localize(t?"Audio Player":"Video Player"),n=ae("span",{className:"vjs-control-text",innerHTML:this.localize("{1} is loading.",[i])}),r=e.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return r.appendChild(n),r},t}(_t);_t.registerComponent("LoadingSpinner",Zi);var en=function(e){function t(){return R(this,t),j(this,e.apply(this,arguments))}return N(t,e),t.prototype.createEl=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e="button",t=V({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass()},t),i=V({type:"button"},i);var n=_t.prototype.createEl.call(this,e,t,i);return this.createControlTextEl(n),n},t.prototype.addChild=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.constructor.name;return K.warn("Adding an actionable (user controllable) child to a Button ("+i+") is not supported; use a ClickableComponent instead."),_t.prototype.addChild.call(this,e,t)},t.prototype.enable=function(){e.prototype.enable.call(this),this.el_.removeAttribute("disabled")},t.prototype.disable=function(){e.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},t.prototype.handleKeyPress=function(t){32!==t.which&&13!==t.which&&e.prototype.handleKeyPress.call(this,t)},t}(Wi);_t.registerComponent("Button",en);var tn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.mouseused_=!1,r.on("mousedown",r.handleMouseDown),r}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-big-play-button"},t.prototype.handleClick=function(e){var t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY)Mt(t);else{var i=this.player_.getChild("controlBar"),n=i&&i.getChild("playToggle");if(n){var r=function(){return n.focus()};Dt(t)?t.then(r,(function(){})):this.setTimeout(r,1)}else this.player_.focus()}},t.prototype.handleKeyPress=function(t){this.mouseused_=!1,e.prototype.handleKeyPress.call(this,t)},t.prototype.handleMouseDown=function(e){this.mouseused_=!0},t}(en);tn.prototype.controlText_="Play Video",_t.registerComponent("BigPlayButton",tn);var nn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.controlText(n&&n.controlText||r.localize("Close")),r}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this)},t.prototype.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},t}(en);_t.registerComponent("CloseButton",nn);var rn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.on(i,"play",r.handlePlay),r.on(i,"pause",r.handlePause),r.on(i,"ended",r.handleEnded),r}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)},t.prototype.handleClick=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},t.prototype.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},t.prototype.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},t.prototype.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},t.prototype.handleEnded=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",this.handleSeeked)},t}(en);rn.prototype.controlText_="Play",_t.registerComponent("PlayToggle",rn);var sn=function(e,t){e=e<0?0:e;var i=Math.floor(e%60),n=Math.floor(e/60%60),r=Math.floor(e/3600),s=Math.floor(t/60%60),a=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(r=n=i="-"),r=r>0||a>0?r+":":"",n=((r||s>=10)&&n<10?"0"+n:n)+":",i=i<10?"0"+i:i,r+n+i},an=sn;function on(e){an=e}function ln(){an=sn}var un=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return an(e,t)},cn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.throttledUpdateContent=it(tt(r,r.updateContent),25),r.on(i,"timeupdate",r.throttledUpdateContent),r}return N(t,e),t.prototype.createEl=function(t){var i=this.buildCSSClass(),n=e.prototype.createEl.call(this,"div",{className:i+" vjs-time-control vjs-control",innerHTML:'<span class="vjs-control-text">'+this.localize(this.labelText_)+" </span>"});return this.contentEl_=ae("span",{className:i+"-display"},{"aria-live":"off"}),this.updateTextNode_(),n.appendChild(this.contentEl_),n},t.prototype.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this)},t.prototype.updateTextNode_=function(){if(this.contentEl_){while(this.contentEl_.firstChild)this.contentEl_.removeChild(this.contentEl_.firstChild);this.textNode_=s.createTextNode(this.formattedTime_||this.formatTime_(0)),this.contentEl_.appendChild(this.textNode_)}},t.prototype.formatTime_=function(e){return un(e)},t.prototype.updateFormattedTime_=function(e){var t=this.formatTime_(e);t!==this.formattedTime_&&(this.formattedTime_=t,this.requestAnimationFrame(this.updateTextNode_))},t.prototype.updateContent=function(e){},t}(_t);cn.prototype.labelText_="Time",cn.prototype.controlText_="Time",_t.registerComponent("TimeDisplay",cn);var hn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.on(i,"ended",r.handleEnded),r}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-current-time"},t.prototype.updateContent=function(e){var t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateFormattedTime_(t)},t.prototype.handleEnded=function(e){this.player_.duration()&&this.updateFormattedTime_(this.player_.duration())},t}(cn);hn.prototype.labelText_="Current Time",hn.prototype.controlText_="Current Time",_t.registerComponent("CurrentTimeDisplay",hn);var dn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.on(i,"durationchange",r.updateContent),r.on(i,"loadedmetadata",r.throttledUpdateContent),r}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-duration"},t.prototype.updateContent=function(e){var t=this.player_.duration();t&&this.duration_!==t&&(this.duration_=t,this.updateFormattedTime_(t))},t}(cn);dn.prototype.labelText_="Duration",dn.prototype.controlText_="Duration",_t.registerComponent("DurationDisplay",dn);var pn=function(e){function t(){return R(this,t),j(this,e.apply(this,arguments))}return N(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"<div><span>/</span></div>"})},t}(_t);_t.registerComponent("TimeDivider",pn);var fn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.on(i,"durationchange",r.throttledUpdateContent),r.on(i,"ended",r.handleEnded),r}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-remaining-time"},t.prototype.formatTime_=function(t){return"-"+e.prototype.formatTime_.call(this,t)},t.prototype.updateContent=function(e){this.player_.duration()&&(this.player_.remainingTimeDisplay?this.updateFormattedTime_(this.player_.remainingTimeDisplay()):this.updateFormattedTime_(this.player_.remainingTime()))},t.prototype.handleEnded=function(e){this.player_.duration()&&this.updateFormattedTime_(0)},t}(cn);fn.prototype.labelText_="Remaining Time",fn.prototype.controlText_="Remaining Time",_t.registerComponent("RemainingTimeDisplay",fn);var mn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.updateShowing(),r.on(r.player(),"durationchange",r.updateShowing),r}return N(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=ae("div",{className:"vjs-live-display",innerHTML:'<span class="vjs-control-text">'+this.localize("Stream Type")+" </span>"+this.localize("LIVE")},{"aria-live":"off"}),t.appendChild(this.contentEl_),t},t.prototype.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},t.prototype.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(_t);_t.registerComponent("LiveDisplay",mn);var gn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.bar=r.getChild(r.options_.barName),r.vertical(!!r.options_.vertical),r.enable(),r}return N(t,e),t.prototype.enabled=function(){return this.enabled_},t.prototype.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown),this.on("touchstart",this.handleMouseDown),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur),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)},t.prototype.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown),this.off("touchstart",this.handleMouseDown),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur),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}},t.prototype.createEl=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i.className=i.className+" vjs-slider",i=V({tabIndex:0},i),n=V({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},n),e.prototype.createEl.call(this,t,i,n)},t.prototype.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||w||e.preventDefault(),ve(),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)},t.prototype.handleMouseMove=function(e){},t.prototype.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;_e(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),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.update()},t.prototype.update=function(){if(this.el_){var e=this.getPercent(),t=this.bar;if(t){("number"!==typeof e||e!==e||e<0||e===1/0)&&(e=0);var i=(100*e).toFixed(2)+"%",n=t.el().style;return this.vertical()?n.height=i:n.width=i,e}}},t.prototype.calculateDistance=function(e){var t=Se(this.el_,e);return this.vertical()?t.y:t.x},t.prototype.handleFocus=function(){this.on(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},t.prototype.handleKeyPress=function(e){37===e.which||40===e.which?(e.preventDefault(),this.stepBack()):38!==e.which&&39!==e.which||(e.preventDefault(),this.stepForward())},t.prototype.handleBlur=function(){this.off(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},t.prototype.handleClick=function(e){e.stopImmediatePropagation(),e.preventDefault()},t.prototype.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},t}(_t);_t.registerComponent("Slider",gn);var yn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.partEls_=[],r.on(i,"progress",r.update),r}return N(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Loaded")+"</span>: 0%</span>"})},t.prototype.dispose=function(){this.partEls_=null,e.prototype.dispose.call(this)},t.prototype.update=function(e){var t=this.player_.buffered(),i=this.player_.duration(),n=this.player_.bufferedEnd(),r=this.partEls_,s=function(e,t){var i=e/t||0;return 100*(i>=1?1:i)+"%"};this.el_.style.width=s(n,i);for(var a=0;a<t.length;a++){var o=t.start(a),l=t.end(a),u=r[a];u||(u=this.el_.appendChild(ae()),r[a]=u),u.style.left=s(o,n),u.style.width=s(l-o,n)}for(var c=r.length;c>t.length;c--)this.el_.removeChild(r[c-1]);r.length=t.length},t}(_t);_t.registerComponent("LoadProgressBar",yn);var vn=function(e){function t(){return R(this,t),j(this,e.apply(this,arguments))}return N(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"})},t.prototype.update=function(e,t,i){var n=be(this.el_),r=be(this.player_.el()),s=e.width*t;if(r&&n){var a=e.left-r.left+s,o=e.width-s+(r.right-e.right),l=n.width/2;a<l?l+=l-a:o<l&&(l=o),l<0?l=0:l>n.width&&(l=n.width),this.el_.style.right="-"+l+"px",oe(this.el_,i)}},t}(_t);_t.registerComponent("TimeTooltip",vn);var _n=function(e){function t(){return R(this,t),j(this,e.apply(this,arguments))}return N(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Progress")+"</span>: 0%</span>"})},t.prototype.update=function(e,t){var i=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame((function(){var n=i.player_.scrubbing()?i.player_.getCache().currentTime:i.player_.currentTime(),r=un(n,i.player_.duration()),s=i.getChild("timeTooltip");s&&s.update(e,t,r)}))},t}(_t);_n.prototype.options_={children:[]},A&&!(A>8)||y||_||_n.prototype.options_.children.push("timeTooltip"),_t.registerComponent("PlayProgressBar",_n);var bn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.update=it(tt(r,r.update),25),r}return N(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},t.prototype.update=function(e,t){var i=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame((function(){var n=i.player_.duration(),r=un(t*n,n);i.el_.style.left=e.width*t+"px",i.getChild("timeTooltip").update(e,t,r)}))},t}(_t);bn.prototype.options_={children:["timeTooltip"]},_t.registerComponent("MouseTimeDisplay",bn);var Tn=5,Sn=30,kn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.setEventHandlers_(),r}return N(t,e),t.prototype.setEventHandlers_=function(){var e=this;this.update=it(tt(this,this.update),Sn),this.on(this.player_,"timeupdate",this.update),this.on(this.player_,"ended",this.handleEnded),this.updateInterval=null,this.on(this.player_,["playing"],(function(){e.clearInterval(e.updateInterval),e.updateInterval=e.setInterval((function(){e.requestAnimationFrame((function(){e.update()}))}),Sn)})),this.on(this.player_,["ended","pause","waiting"],(function(){e.clearInterval(e.updateInterval)})),this.on(this.player_,["timeupdate","ended"],this.update)},t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},t.prototype.update_=function(e,t){var i=this.player_.duration();this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[un(e,i),un(i,i)],"{1} of {2}")),this.bar.update(be(this.el_),t)},t.prototype.update=function(t){var i=e.prototype.update.call(this);return this.update_(this.getCurrentTime_(),i),i},t.prototype.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},t.prototype.handleEnded=function(e){this.update_(this.player_.duration(),1)},t.prototype.getPercent=function(){var e=this.getCurrentTime_()/this.player_.duration();return e>=1?1:e},t.prototype.handleMouseDown=function(t){Ae(t)&&(t.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t))},t.prototype.handleMouseMove=function(e){if(Ae(e)){var t=this.calculateDistance(e)*this.player_.duration();t===this.player_.duration()&&(t-=.1),this.player_.currentTime(t)}},t.prototype.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show()},t.prototype.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide()},t.prototype.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t),t&&t.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying&&Mt(this.player_.play())},t.prototype.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+Tn)},t.prototype.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-Tn)},t.prototype.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},t.prototype.handleKeyPress=function(t){32===t.which||13===t.which?(t.preventDefault(),this.handleAction(t)):e.prototype.handleKeyPress&&e.prototype.handleKeyPress.call(this,t)},t}(gn);kn.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},A&&!(A>8)||y||_||kn.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),kn.prototype.playerEvent="timeupdate",_t.registerComponent("SeekBar",kn);var En=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.handleMouseMove=it(tt(r,r.handleMouseMove),25),r.throttledHandleMouseSeek=it(tt(r,r.handleMouseSeek),25),r.enable(),r}return N(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},t.prototype.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var i=t.getChild("mouseTimeDisplay"),n=t.el(),r=be(n),s=Se(n,e).x;s>1?s=1:s<0&&(s=0),i&&i.update(r,s)}},t.prototype.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},t.prototype.enabled=function(){return this.enabled_},t.prototype.disable=function(){this.children().forEach((function(e){return e.disable&&e.disable()})),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDown),this.off(this.el_,"mousemove",this.handleMouseMove),this.handleMouseUp(),this.addClass("disabled"),this.enabled_=!1)},t.prototype.enable=function(){this.children().forEach((function(e){return e.enable&&e.enable()})),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDown),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},t.prototype.handleMouseDown=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},t.prototype.handleMouseUp=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseUp(e),this.off(t,"mousemove",this.throttledHandleMouseSeek),this.off(t,"touchmove",this.throttledHandleMouseSeek),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchend",this.handleMouseUp)},t}(_t);En.prototype.options_={children:["seekBar"]},_t.registerComponent("ProgressControl",En);var wn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.on(i,"fullscreenchange",r.handleFullscreenChange),!1===s[wt.fullscreenEnabled]&&r.disable(),r}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)},t.prototype.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},t.prototype.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}(en);wn.prototype.controlText_="Fullscreen",_t.registerComponent("FullscreenToggle",wn);var Cn=function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))},xn=function(e){function t(){return R(this,t),j(this,e.apply(this,arguments))}return N(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:'<span class="vjs-control-text"></span>'})},t}(_t);_t.registerComponent("VolumeLevel",xn);var An=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.on("slideractive",r.updateLastVolume_),r.on(i,"volumechange",r.updateARIAAttributes),i.ready((function(){return r.updateARIAAttributes()})),r}return N(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},t.prototype.handleMouseDown=function(t){Ae(t)&&e.prototype.handleMouseDown.call(this,t)},t.prototype.handleMouseMove=function(e){Ae(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},t.prototype.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},t.prototype.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},t.prototype.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},t.prototype.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},t.prototype.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},t.prototype.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},t.prototype.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",(function(){0===e.player_.volume()&&e.player_.lastVolume_(t)}))},t}(gn);An.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},An.prototype.playerEvent="volumechange",_t.registerComponent("VolumeBar",An);var In=function(e){function t(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};R(this,t),n.vertical=n.vertical||!1,("undefined"===typeof n.volumeBar||W(n.volumeBar))&&(n.volumeBar=n.volumeBar||{},n.volumeBar.vertical=n.vertical);var r=j(this,e.call(this,i,n));return Cn(r,i),r.throttledHandleMouseMove=it(tt(r,r.handleMouseMove),25),r.on("mousedown",r.handleMouseDown),r.on("touchstart",r.handleMouseDown),r.on(r.volumeBar,["focus","slideractive"],(function(){r.volumeBar.addClass("vjs-slider-active"),r.addClass("vjs-slider-active"),r.trigger("slideractive")})),r.on(r.volumeBar,["blur","sliderinactive"],(function(){r.volumeBar.removeClass("vjs-slider-active"),r.removeClass("vjs-slider-active"),r.trigger("sliderinactive")})),r}return N(t,e),t.prototype.createEl=function(){var t="vjs-volume-horizontal";return this.options_.vertical&&(t="vjs-volume-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t})},t.prototype.handleMouseDown=function(e){var t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},t.prototype.handleMouseUp=function(e){var t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchend",this.handleMouseUp)},t.prototype.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},t}(_t);In.prototype.options_={children:["volumeBar"]},_t.registerComponent("VolumeControl",In);var On=function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))},Pn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return On(r,i),r.on(i,["loadstart","volumechange"],r.update),r}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)},t.prototype.handleClick=function(e){var t=this.player_.volume(),i=this.player_.lastVolume_();if(0===t){var n=i<.1?.1:i;this.player_.volume(n),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},t.prototype.update=function(e){this.updateIcon_(),this.updateControlText_()},t.prototype.updateIcon_=function(){var e=this.player_.volume(),t=3;y&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var i=0;i<4;i++)he(this.el_,"vjs-vol-"+i);ce(this.el_,"vjs-vol-"+t)},t.prototype.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume(),t=e?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)},t}(en);Pn.prototype.controlText_="Mute",_t.registerComponent("MuteToggle",Pn);var Ln=function(e){function t(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};R(this,t),"undefined"!==typeof n.inline?n.inline=n.inline:n.inline=!0,("undefined"===typeof n.volumeControl||W(n.volumeControl))&&(n.volumeControl=n.volumeControl||{},n.volumeControl.vertical=!n.inline);var r=j(this,e.call(this,i,n));return r.on(i,["loadstart"],r.volumePanelState_),r.on(r.volumeControl,["slideractive"],r.sliderActive_),r.on(r.volumeControl,["sliderinactive"],r.sliderInactive_),r}return N(t,e),t.prototype.sliderActive_=function(){this.addClass("vjs-slider-active")},t.prototype.sliderInactive_=function(){this.removeClass("vjs-slider-active")},t.prototype.volumePanelState_=function(){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")},t.prototype.createEl=function(){var t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})},t}(_t);Ln.prototype.options_={children:["muteToggle","volumeControl"]},_t.registerComponent("VolumePanel",Ln);var Dn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return n&&(r.menuButton_=n.menuButton),r.focusedChild_=-1,r.on("keydown",r.handleKeyPress),r}return N(t,e),t.prototype.addItem=function(e){this.addChild(e),e.on("click",tt(this,(function(t){this.menuButton_&&(this.menuButton_.unpressButton(),"CaptionSettingsMenuItem"!==e.name()&&this.menuButton_.focus())})))},t.prototype.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=ae(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var i=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return i.appendChild(this.contentEl_),ze(i,"click",(function(e){e.preventDefault(),e.stopImmediatePropagation()})),i},t.prototype.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},t.prototype.handleKeyPress=function(e){37===e.which||40===e.which?(e.preventDefault(),this.stepForward()):38!==e.which&&39!==e.which||(e.preventDefault(),this.stepBack())},t.prototype.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},t.prototype.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},t.prototype.focus=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this.children().slice(),i=t.length&&t[0].className&&/vjs-menu-title/.test(t[0].className);i&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())},t}(_t);_t.registerComponent("Menu",Dn);var Mn=function(e){function t(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};R(this,t);var r=j(this,e.call(this,i,n));r.menuButton_=new en(i,n),r.menuButton_.controlText(r.controlText_),r.menuButton_.el_.setAttribute("aria-haspopup","true");var s=en.prototype.buildCSSClass();return r.menuButton_.el_.className=r.buildCSSClass()+" "+s,r.menuButton_.removeClass("vjs-control"),r.addChild(r.menuButton_),r.update(),r.enabled_=!0,r.on(r.menuButton_,"tap",r.handleClick),r.on(r.menuButton_,"click",r.handleClick),r.on(r.menuButton_,"focus",r.handleFocus),r.on(r.menuButton_,"blur",r.handleBlur),r.on("keydown",r.handleSubmenuKeyPress),r}return N(t,e),t.prototype.update=function(){var 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.show()},t.prototype.createMenu=function(){var e=new Dn(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=ae("li",{className:"vjs-menu-title",innerHTML:gt(this.options_.title),tabIndex:-1});this.hideThreshold_+=1,e.children_.unshift(t),le(t,e.contentEl())}if(this.items=this.createItems(),this.items)for(var i=0;i<this.items.length;i++)e.addItem(this.items[i]);return e},t.prototype.createItems=function(){},t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},t.prototype.buildWrapperCSSClass=function(){var t="vjs-menu-button";!0===this.options_.inline?t+="-inline":t+="-popup";var i=en.prototype.buildCSSClass();return"vjs-menu-button "+t+" "+i+" "+e.prototype.buildCSSClass.call(this)},t.prototype.buildCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+e.prototype.buildCSSClass.call(this)},t.prototype.controlText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.menuButton_.el();return this.menuButton_.controlText(e,t)},t.prototype.handleClick=function(e){this.one(this.menu.contentEl(),"mouseleave",tt(this,(function(e){this.unpressButton(),this.el_.blur()}))),this.buttonPressed_?this.unpressButton():this.pressButton()},t.prototype.focus=function(){this.menuButton_.focus()},t.prototype.blur=function(){this.menuButton_.blur()},t.prototype.handleFocus=function(){ze(s,"keydown",tt(this,this.handleKeyPress))},t.prototype.handleBlur=function(){We(s,"keydown",tt(this,this.handleKeyPress))},t.prototype.handleKeyPress=function(e){27===e.which||9===e.which?(this.buttonPressed_&&this.unpressButton(),9!==e.which&&(e.preventDefault(),this.menuButton_.el_.focus())):38!==e.which&&40!==e.which||this.buttonPressed_||(this.pressButton(),e.preventDefault())},t.prototype.handleSubmenuKeyPress=function(e){27!==e.which&&9!==e.which||(this.buttonPressed_&&this.unpressButton(),9!==e.which&&(e.preventDefault(),this.menuButton_.el_.focus()))},t.prototype.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),y&&re())return;this.menu.focus()}},t.prototype.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},t.prototype.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},t.prototype.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},t}(_t);_t.registerComponent("MenuButton",Mn);var Rn=function(e){function t(i,n){R(this,t);var r=n.tracks,s=j(this,e.call(this,i,n));if(s.items.length<=1&&s.hide(),!r)return j(s);var a=tt(s,s.update);return r.addEventListener("removetrack",a),r.addEventListener("addtrack",a),s.player_.on("ready",a),s.player_.on("dispose",(function(){r.removeEventListener("removetrack",a),r.removeEventListener("addtrack",a)})),s}return N(t,e),t}(Mn);_t.registerComponent("TrackButton",Rn);var Nn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.selectable=n.selectable,r.isSelected_=n.selected||!1,r.multiSelectable=n.multiSelectable,r.selected(r.isSelected_),r.selectable?r.multiSelectable?r.el_.setAttribute("role","menuitemcheckbox"):r.el_.setAttribute("role","menuitemradio"):r.el_.setAttribute("role","menuitem"),r}return N(t,e),t.prototype.createEl=function(t,i,n){return this.nonIconControl=!0,e.prototype.createEl.call(this,"li",V({className:"vjs-menu-item",innerHTML:'<span class="vjs-menu-item-text">'+this.localize(this.options_.label)+"</span>",tabIndex:-1},i),n)},t.prototype.handleClick=function(e){this.selected(!0)},t.prototype.selected=function(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))},t}(Wi);_t.registerComponent("MenuItem",Nn);var jn=function(e){function t(i,n){R(this,t);var a=n.track,o=i.textTracks();n.label=a.label||a.language||"Unknown",n.selected="showing"===a.mode;var l=j(this,e.call(this,i,n));l.track=a;var u=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];l.handleTracksChange.apply(l,t)},c=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];l.handleSelectedLanguageChange.apply(l,t)};if(i.on(["loadstart","texttrackchange"],u),o.addEventListener("change",u),o.addEventListener("selectedlanguagechange",c),l.on("dispose",(function(){i.off(["loadstart","texttrackchange"],u),o.removeEventListener("change",u),o.removeEventListener("selectedlanguagechange",c)})),void 0===o.onchange){var h=void 0;l.on(["tap","click"],(function(){if("object"!==M(r.Event))try{h=new r.Event("change")}catch(e){}h||(h=s.createEvent("Event"),h.initEvent("change",!0,!0)),o.dispatchEvent(h)}))}return l.handleTracksChange(),l}return N(t,e),t.prototype.handleClick=function(t){var i=this.track.kind,n=this.track.kinds,r=this.player_.textTracks();if(n||(n=[i]),e.prototype.handleClick.call(this,t),r)for(var s=0;s<r.length;s++){var a=r[s];a===this.track&&n.indexOf(a.kind)>-1?"showing"!==a.mode&&(a.mode="showing"):"disabled"!==a.mode&&(a.mode="disabled")}},t.prototype.handleTracksChange=function(e){var t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)},t.prototype.handleSelectedLanguageChange=function(e){if("showing"===this.track.mode){var 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}}},t.prototype.dispose=function(){this.track=null,e.prototype.dispose.call(this)},t}(Nn);_t.registerComponent("TextTrackMenuItem",jn);var Bn=function(e){function t(i,n){return R(this,t),n.track={player:i,kind:n.kind,kinds:n.kinds,default:!1,mode:"disabled"},n.kinds||(n.kinds=[n.kind]),n.label?n.track.label=n.label:n.track.label=n.kinds.join(" and ")+" off",n.selectable=!0,n.multiSelectable=!1,j(this,e.call(this,i,n))}return N(t,e),t.prototype.handleTracksChange=function(e){for(var t=this.player().textTracks(),i=!0,n=0,r=t.length;n<r;n++){var s=t[n];if(this.options_.kinds.indexOf(s.kind)>-1&&"showing"===s.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)},t.prototype.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),i=!0,n=0,r=t.length;n<r;n++){var s=t[n];if(["captions","descriptions","subtitles"].indexOf(s.kind)>-1&&"showing"===s.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}(jn);_t.registerComponent("OffTextTrackMenuItem",Bn);var Un=function(e){function t(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return R(this,t),n.tracks=i.textTracks(),j(this,e.call(this,i,n))}return N(t,e),t.prototype.createItems=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:jn,i=void 0;this.label_&&(i=this.label_+" off"),e.push(new Bn(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;var n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var r=0;r<n.length;r++){var s=n[r];if(this.kinds_.indexOf(s.kind)>-1){var a=new t(this.player_,{track:s,selectable:!0,multiSelectable:!1});a.addClass("vjs-"+s.kind+"-menu-item"),e.push(a)}}return e},t}(Rn);_t.registerComponent("TextTrackButton",Un);var Fn=function(e){function t(i,n){R(this,t);var r=n.track,s=n.cue,a=i.currentTime();n.selectable=!0,n.multiSelectable=!1,n.label=s.text,n.selected=s.startTime<=a&&a<s.endTime;var o=j(this,e.call(this,i,n));return o.track=r,o.cue=s,r.addEventListener("cuechange",tt(o,o.update)),o}return N(t,e),t.prototype.handleClick=function(t){e.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime),this.update(this.cue.startTime)},t.prototype.update=function(e){var t=this.cue,i=this.player_.currentTime();this.selected(t.startTime<=i&&i<t.endTime)},t}(Nn);_t.registerComponent("ChaptersTrackMenuItem",Fn);var qn=function(e){function t(i,n,r){return R(this,t),j(this,e.call(this,i,n,r))}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildWrapperCSSClass.call(this)},t.prototype.update=function(t){this.track_&&(!t||"addtrack"!==t.type&&"removetrack"!==t.type)||this.setTrack(this.findChaptersTrack()),e.prototype.update.call(this)},t.prototype.setTrack=function(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";var i=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);i&&i.addEventListener("load",this.updateHandler_)}}},t.prototype.findChaptersTrack=function(){for(var e=this.player_.textTracks()||[],t=e.length-1;t>=0;t--){var i=e[t];if(i.kind===this.kind_)return i}},t.prototype.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(gt(this.kind_))},t.prototype.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this)},t.prototype.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var i=0,n=t.length;i<n;i++){var r=t[i],s=new Fn(this.player_,{track:this.track_,cue:r});e.push(s)}return e},t}(Un);qn.prototype.kind_="chapters",qn.prototype.controlText_="Chapters",_t.registerComponent("ChaptersButton",qn);var Hn=function(e){function t(i,n,r){R(this,t);var s=j(this,e.call(this,i,n,r)),a=i.textTracks(),o=tt(s,s.handleTracksChange);return a.addEventListener("change",o),s.on("dispose",(function(){a.removeEventListener("change",o)})),s}return N(t,e),t.prototype.handleTracksChange=function(e){for(var t=this.player().textTracks(),i=!1,n=0,r=t.length;n<r;n++){var s=t[n];if(s.kind!==this.kind_&&"showing"===s.mode){i=!0;break}}i?this.disable():this.enable()},t.prototype.buildCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(Un);Hn.prototype.kind_="descriptions",Hn.prototype.controlText_="Descriptions",_t.registerComponent("DescriptionsButton",Hn);var Vn=function(e){function t(i,n,r){return R(this,t),j(this,e.call(this,i,n,r))}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(Un);Vn.prototype.kind_="subtitles",Vn.prototype.controlText_="Subtitles",_t.registerComponent("SubtitlesButton",Vn);var zn=function(e){function t(i,n){R(this,t),n.track={player:i,kind:n.kind,label:n.kind+" settings",selectable:!1,default:!1,mode:"disabled"},n.selectable=!1,n.name="CaptionSettingsMenuItem";var r=j(this,e.call(this,i,n));return r.addClass("vjs-texttrack-settings"),r.controlText(", opens "+n.kind+" settings dialog"),r}return N(t,e),t.prototype.handleClick=function(e){this.player().getChild("textTrackSettings").open()},t}(jn);_t.registerComponent("CaptionSettingsMenuItem",zn);var Wn=function(e){function t(i,n,r){return R(this,t),j(this,e.call(this,i,n,r))}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-captions-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-captions-button "+e.prototype.buildWrapperCSSClass.call(this)},t.prototype.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new zn(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),e.prototype.createItems.call(this,t)},t}(Un);Wn.prototype.kind_="captions",Wn.prototype.controlText_="Captions",_t.registerComponent("CaptionsButton",Wn);var $n=function(e){function t(){return R(this,t),j(this,e.apply(this,arguments))}return N(t,e),t.prototype.createEl=function(t,i,n){var r='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);"captions"===this.options_.track.kind&&(r+='\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> '+this.localize("Captions")+"</span>\n "),r+="</span>";var s=e.prototype.createEl.call(this,t,V({innerHTML:r},i),n);return s},t}(jn);_t.registerComponent("SubsCapsMenuItem",$n);var Gn=function(e){function t(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};R(this,t);var r=j(this,e.call(this,i,n));return r.label_="subtitles",["en","en-us","en-ca","fr-ca"].indexOf(r.player_.language_)>-1&&(r.label_="captions"),r.menuButton_.controlText(gt(r.label_)),r}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this)},t.prototype.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new zn(this.player_,{kind:this.label_})),this.hideThreshold_+=1),t=e.prototype.createItems.call(this,t,$n),t},t}(Un);Gn.prototype.kinds_=["captions","subtitles"],Gn.prototype.controlText_="Subtitles",_t.registerComponent("SubsCapsButton",Gn);var Xn=function(e){function t(i,n){R(this,t);var r=n.track,s=i.audioTracks();n.label=r.label||r.language||"Unknown",n.selected=r.enabled;var a=j(this,e.call(this,i,n));a.track=r,a.addClass("vjs-"+r.kind+"-menu-item");var o=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];a.handleTracksChange.apply(a,t)};return s.addEventListener("change",o),a.on("dispose",(function(){s.removeEventListener("change",o)})),a}return N(t,e),t.prototype.createEl=function(t,i,n){var r='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);"main-desc"===this.options_.track.kind&&(r+='\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> '+this.localize("Descriptions")+"</span>\n "),r+="</span>";var s=e.prototype.createEl.call(this,t,V({innerHTML:r},i),n);return s},t.prototype.handleClick=function(t){var i=this.player_.audioTracks();e.prototype.handleClick.call(this,t);for(var n=0;n<i.length;n++){var r=i[n];r.enabled=r===this.track}},t.prototype.handleTracksChange=function(e){this.selected(this.track.enabled)},t}(Nn);_t.registerComponent("AudioTrackMenuItem",Xn);var Kn=function(e){function t(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return R(this,t),n.tracks=i.audioTracks(),j(this,e.call(this,i,n))}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-audio-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-audio-button "+e.prototype.buildWrapperCSSClass.call(this)},t.prototype.createItems=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.hideThreshold_=1;for(var t=this.player_.audioTracks(),i=0;i<t.length;i++){var n=t[i];e.push(new Xn(this.player_,{track:n,selectable:!0,multiSelectable:!1}))}return e},t}(Rn);Kn.prototype.controlText_="Audio Track",_t.registerComponent("AudioTrackButton",Kn);var Yn=function(e){function t(i,n){R(this,t);var r=n.rate,s=parseFloat(r,10);n.label=r,n.selected=1===s,n.selectable=!0,n.multiSelectable=!1;var a=j(this,e.call(this,i,n));return a.label=r,a.rate=s,a.on(i,"ratechange",a.update),a}return N(t,e),t.prototype.handleClick=function(t){e.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},t.prototype.update=function(e){this.selected(this.player().playbackRate()===this.rate)},t}(Nn);Yn.prototype.contentElType="button",_t.registerComponent("PlaybackRateMenuItem",Yn);var Qn=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.updateVisibility(),r.updateLabel(),r.on(i,"loadstart",r.updateVisibility),r.on(i,"ratechange",r.updateLabel),r}return N(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this);return this.labelEl_=ae("div",{className:"vjs-playback-rate-value",innerHTML:"1x"}),t.appendChild(this.labelEl_),t},t.prototype.dispose=function(){this.labelEl_=null,e.prototype.dispose.call(this)},t.prototype.buildCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildWrapperCSSClass.call(this)},t.prototype.createMenu=function(){var e=new Dn(this.player()),t=this.playbackRates();if(t)for(var i=t.length-1;i>=0;i--)e.addChild(new Yn(this.player(),{rate:t[i]+"x"}));return e},t.prototype.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},t.prototype.handleClick=function(e){for(var t=this.player().playbackRate(),i=this.playbackRates(),n=i[0],r=0;r<i.length;r++)if(i[r]>t){n=i[r];break}this.player().playbackRate(n)},t.prototype.playbackRates=function(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates},t.prototype.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},t.prototype.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},t.prototype.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.innerHTML=this.player().playbackRate()+"x")},t}(Mn);Qn.prototype.controlText_="Playback Rate",_t.registerComponent("PlaybackRateMenuButton",Qn);var Jn=function(e){function t(){return R(this,t),j(this,e.apply(this,arguments))}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)},t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})},t}(_t);_t.registerComponent("Spacer",Jn);var Zn=function(e){function t(){return R(this,t),j(this,e.apply(this,arguments))}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this)},t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,{className:this.buildCSSClass()});return t.innerHTML=" ",t},t}(Jn);_t.registerComponent("CustomControlSpacer",Zn);var er=function(e){function t(){return R(this,t),j(this,e.apply(this,arguments))}return N(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(_t);er.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},_t.registerComponent("ControlBar",er);var tr=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n));return r.on(i,"error",r.open),r}return N(t,e),t.prototype.buildCSSClass=function(){return"vjs-error-display "+e.prototype.buildCSSClass.call(this)},t.prototype.content=function(){var e=this.player().error();return e?this.localize(e.message):""},t}(qt);tr.prototype.options_=vt(qt.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),_t.registerComponent("ErrorDisplay",tr);var ir="vjs-text-track-settings",nr=["#000","Black"],rr=["#00F","Blue"],sr=["#0FF","Cyan"],ar=["#0F0","Green"],or=["#F0F","Magenta"],lr=["#F00","Red"],ur=["#FFF","White"],cr=["#FF0","Yellow"],hr=["1","Opaque"],dr=["0.5","Semi-Transparent"],pr=["0","Transparent"],fr={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[nr,ur,lr,ar,rr,cr,or,sr]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[hr,dr,pr]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[ur,nr,lr,ar,rr,cr,or,sr]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",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:"captions-font-size-%s",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:function(e){return"1.00"===e?null:Number(e)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[hr,dr]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[pr,dr,hr]}};function mr(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}function gr(e,t){var i=e.options[e.options.selectedIndex].value;return mr(i,t)}function yr(e,t,i){if(t)for(var n=0;n<e.options.length;n++)if(mr(e.options[n].value,i)===t){e.selectedIndex=n;break}}fr.windowColor.options=fr.backgroundColor.options;var vr=function(e){function t(i,n){R(this,t),n.temporary=!1;var r=j(this,e.call(this,i,n));return r.updateDisplay=tt(r,r.updateDisplay),r.fill(),r.hasBeenOpened_=r.hasBeenFilled_=!0,r.endDialog=ae("p",{className:"vjs-control-text",textContent:r.localize("End of dialog window.")}),r.el().appendChild(r.endDialog),r.setDefaults(),void 0===n.persistTextTrackSettings&&(r.options_.persistTextTrackSettings=r.options_.playerOptions.persistTextTrackSettings),r.on(r.$(".vjs-done-button"),"click",(function(){r.saveSettings(),r.close()})),r.on(r.$(".vjs-default-button"),"click",(function(){r.setDefaults(),r.updateDisplay()})),q(fr,(function(e){r.on(r.$(e.selector),"change",r.updateDisplay)})),r.options_.persistTextTrackSettings&&r.restoreSettings(),r}return N(t,e),t.prototype.dispose=function(){this.endDialog=null,e.prototype.dispose.call(this)},t.prototype.createElSelect_=function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"label",r=fr[e],s=r.id.replace("%s",this.id_),a=[i,s].join(" ").trim();return["<"+n+' id="'+s+'" class="'+("label"===n?"vjs-label":"")+'">',this.localize(r.label),"</"+n+">",'<select aria-labelledby="'+a+'">'].concat(r.options.map((function(e){var i=s+"-"+e[1].replace(/\W+/g,"");return['<option id="'+i+'" value="'+e[0]+'" ','aria-labelledby="'+a+" "+i+'">',t.localize(e[1]),"</option>"].join("")}))).concat("</select>").join("")},t.prototype.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",e),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")},t.prototype.createElBgColor_=function(){var e="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",e),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")},t.prototype.createElWinColor_=function(){var e="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",e),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")},t.prototype.createElColors_=function(){return ae("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},t.prototype.createElFont_=function(){return ae("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})},t.prototype.createElControls_=function(){var e=this.localize("restore all settings to the default values");return ae("div",{className:"vjs-track-settings-controls",innerHTML:['<button type="button" class="vjs-default-button" title="'+e+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+e+"</span>","</button>",'<button type="button" class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},t.prototype.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},t.prototype.label=function(){return this.localize("Caption Settings Dialog")},t.prototype.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},t.prototype.buildCSSClass=function(){return e.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},t.prototype.getValues=function(){var e=this;return H(fr,(function(t,i,n){var r=gr(e.$(i.selector),i.parser);return void 0!==r&&(t[n]=r),t}),{})},t.prototype.setValues=function(e){var t=this;q(fr,(function(i,n){yr(t.$(i.selector),e[n],i.parser)}))},t.prototype.setDefaults=function(){var e=this;q(fr,(function(t){var i=t.hasOwnProperty("default")?t["default"]:0;e.$(t.selector).selectedIndex=i}))},t.prototype.restoreSettings=function(){var e=void 0;try{e=JSON.parse(r.localStorage.getItem(ir))}catch(t){K.warn(t)}e&&this.setValues(e)},t.prototype.saveSettings=function(){if(this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?r.localStorage.setItem(ir,JSON.stringify(e)):r.localStorage.removeItem(ir)}catch(t){K.warn(t)}}},t.prototype.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()},t.prototype.conditionalBlur_=function(){this.previouslyActiveEl_=null,this.off(s,"keydown",this.handleKeyDown);var e=this.player_.controlBar,t=e&&e.subsCapsButton,i=e&&e.captionsButton;t?t.focus():i&&i.focus()},t}(qt);_t.registerComponent("TextTrackSettings",vr);var _r=function(e){function t(i,n){R(this,t);var s=n.ResizeObserver||r.ResizeObserver;null===n.ResizeObserver&&(s=!1);var a=vt({createEl:!s},n),o=j(this,e.call(this,i,a));return o.ResizeObserver=n.ResizeObserver||r.ResizeObserver,o.loadListener_=null,o.resizeObserver_=null,o.debouncedHandler_=nt((function(){o.resizeHandler()}),100,!1,o),s?(o.resizeObserver_=new o.ResizeObserver(o.debouncedHandler_),o.resizeObserver_.observe(i.el())):(o.loadListener_=function(){o.el_&&o.el_.contentWindow&&ze(o.el_.contentWindow,"resize",o.debouncedHandler_)},o.one("load",o.loadListener_)),o}return N(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager"})},t.prototype.resizeHandler=function(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")},t.prototype.dispose=function(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.el_&&this.el_.contentWindow&&We(this.el_.contentWindow,"resize",this.debouncedHandler_),this.loadListener_&&this.off("load",this.loadListener_),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null},t}(_t);_t.registerComponent("ResizeManager",_r);var br=function(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var i=e.$$("source"),n=[],r="";if(!i.length)return!1;for(var s=0;s<i.length;s++){var a=i[s].src;a&&-1===n.indexOf(a)&&n.push(a)}return!!n.length&&(1===n.length&&(r=n[0]),e.triggerSourceset(r),!0)},Tr={};x||(Tr=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(e){var t=s.createElement(this.nodeName.toLowerCase());t.innerHTML=e;var i=s.createDocumentFragment();while(t.childNodes.length)i.appendChild(t.childNodes[0]);return this.innerText="",r.Element.prototype.appendChild.call(this,i),this.innerHTML}}));var Sr=function(e,t){for(var i={},n=0;n<e.length;n++)if(i=Object.getOwnPropertyDescriptor(e[n],t),i&&i.set&&i.get)break;return i.enumerable=!0,i.configurable=!0,i},kr=function(e){return Sr([e.el(),r.HTMLMediaElement.prototype,r.Element.prototype,Tr],"innerHTML")},Er=function(e){var t=e.el();if(!t.resetSourceWatch_){var i={},n=kr(e),r=function(i){return function(){for(var n=arguments.length,r=Array(n),s=0;s<n;s++)r[s]=arguments[s];var a=i.apply(t,r);return br(e),a}};["append","appendChild","insertAdjacentHTML"].forEach((function(e){t[e]&&(i[e]=t[e],t[e]=r(i[e]))})),Object.defineProperty(t,"innerHTML",vt(n,{set:r(n.set)})),t.resetSourceWatch_=function(){t.resetSourceWatch_=null,Object.keys(i).forEach((function(e){t[e]=i[e]})),Object.defineProperty(t,"innerHTML",n)},e.one("sourceset",t.resetSourceWatch_)}},wr={};x||(wr=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?ni(r.Element.prototype.getAttribute.call(this,"src")):""},set:function(e){return r.Element.prototype.setAttribute.call(this,"src",e),e}}));var Cr=function(e){return Sr([e.el(),r.HTMLMediaElement.prototype,wr],"src")},xr=function(e){if(e.featuresSourceset){var t=e.el();if(!t.resetSourceset_){var i=Cr(e),n=t.setAttribute,r=t.load;Object.defineProperty(t,"src",vt(i,{set:function(n){var r=i.set.call(t,n);return e.triggerSourceset(t.src),r}})),t.setAttribute=function(i,r){var s=n.call(t,i,r);return/src/i.test(i)&&e.triggerSourceset(t.src),s},t.load=function(){var i=r.call(t);return br(e)||(e.triggerSourceset(""),Er(e)),i},t.currentSrc?e.triggerSourceset(t.currentSrc):br(e)||Er(e),t.resetSourceset_=function(){t.resetSourceset_=null,t.load=r,t.setAttribute=n,Object.defineProperty(t,"src",i),t.resetSourceWatch_&&t.resetSourceWatch_()}}}},Ar=B(["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n This may prevent text tracks from loading."],["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n This may prevent text tracks from loading."]),Ir=function(e){function t(i,n){R(this,t);var r=j(this,e.call(this,i,n)),s=i.source,o=!1;if(s&&(r.el_.currentSrc!==s.src||i.tag&&3===i.tag.initNetworkState_)?r.setSource(s):r.handleLateInit_(r.el_),i.enableSourceset&&r.setupSourcesetHandling_(),r.el_.hasChildNodes()){var l=r.el_.childNodes,u=l.length,c=[];while(u--){var h=l[u],d=h.nodeName.toLowerCase();"track"===d&&(r.featuresNativeTextTracks?(r.remoteTextTrackEls().addTrackElement_(h),r.remoteTextTracks().addTrack(h.track),r.textTracks().addTrack(h.track),o||r.el_.hasAttribute("crossorigin")||!si(h.src)||(o=!0)):c.push(h))}for(var p=0;p<c.length;p++)r.el_.removeChild(c[p])}return r.proxyNativeTracks_(),r.featuresNativeTextTracks&&o&&K.warn(a(Ar)),r.restoreMetadataTracksInIOSNativePlayer_(),(P||m||S)&&!0===i.nativeControlsForTouch&&r.setControls(!0),r.proxyWebkitFullscreen_(),r.triggerReady(),r}return N(t,e),t.prototype.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),t.disposeMediaElement(this.el_),this.options_=null,e.prototype.dispose.call(this)},t.prototype.setupSourcesetHandling_=function(){xr(this)},t.prototype.restoreMetadataTracksInIOSNativePlayer_=function(){var e=this.textTracks(),t=void 0,i=function(){t=[];for(var i=0;i<e.length;i++){var n=e[i];"metadata"===n.kind&&t.push({track:n,storedMode:n.mode})}};i(),e.addEventListener("change",i),this.on("dispose",(function(){return e.removeEventListener("change",i)}));var n=function i(){for(var n=0;n<t.length;n++){var r=t[n];"disabled"===r.track.mode&&r.track.mode!==r.storedMode&&(r.track.mode=r.storedMode)}e.removeEventListener("change",i)};this.on("webkitbeginfullscreen",(function(){e.removeEventListener("change",i),e.removeEventListener("change",n),e.addEventListener("change",n)})),this.on("webkitendfullscreen",(function(){e.removeEventListener("change",i),e.addEventListener("change",i),e.removeEventListener("change",n)}))},t.prototype.proxyNativeTracks_=function(){var e=this;yi.names.forEach((function(t){var i=yi[t],n=e.el()[i.getterName],r=e[i.getterName]();if(e["featuresNative"+i.capitalName+"Tracks"]&&n&&n.addEventListener){var s={change:function(e){r.trigger({type:"change",target:r,currentTarget:r,srcElement:r})},addtrack:function(e){r.addTrack(e.track)},removetrack:function(e){r.removeTrack(e.track)}},a=function(){for(var e=[],t=0;t<r.length;t++){for(var i=!1,s=0;s<n.length;s++)if(n[s]===r[t]){i=!0;break}i||e.push(r[t])}while(e.length)r.removeTrack(e.shift())};Object.keys(s).forEach((function(t){var i=s[t];n.addEventListener(t,i),e.on("dispose",(function(e){return n.removeEventListener(t,i)}))})),e.on("loadstart",a),e.on("dispose",(function(t){return e.off("loadstart",a)}))}}))},t.prototype.createEl=function(){var e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){var i=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(i,e),t.disposeMediaElement(e),e=i}else{e=s.createElement("video");var n=this.options_.tag&&fe(this.options_.tag),r=vt({},n);P&&!0===this.options_.nativeControlsForTouch||delete r.controls,pe(e,V(r,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}"undefined"!==typeof this.options_.preload&&ge(e,"preload",this.options_.preload);for(var a=["loop","muted","playsinline","autoplay"],o=0;o<a.length;o++){var l=a[o],u=this.options_[l];"undefined"!==typeof u&&(u?ge(e,l,l):ye(e,l),e[l]=u)}return e},t.prototype.handleLateInit_=function(e){if(0!==e.networkState&&3!==e.networkState){if(0===e.readyState){var t=!1,i=function(){t=!0};this.on("loadstart",i);var n=function(){t||this.trigger("loadstart")};return this.on("loadedmetadata",n),void this.ready((function(){this.off("loadstart",i),this.off("loadedmetadata",n),t||this.trigger("loadstart")}))}var r=["loadstart"];r.push("loadedmetadata"),e.readyState>=2&&r.push("loadeddata"),e.readyState>=3&&r.push("canplay"),e.readyState>=4&&r.push("canplaythrough"),this.ready((function(){r.forEach((function(e){this.trigger(e)}),this)}))}},t.prototype.setCurrentTime=function(e){try{this.el_.currentTime=e}catch(t){K(t,"Video is not ready. (Video.js)")}},t.prototype.duration=function(){var e=this;if(this.el_.duration===1/0&&_&&w&&0===this.el_.currentTime){var t=function t(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",t))};return this.on("timeupdate",t),NaN}return this.el_.duration||NaN},t.prototype.width=function(){return this.el_.offsetWidth},t.prototype.height=function(){return this.el_.offsetHeight},t.prototype.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var t=function(){this.trigger("fullscreenchange",{isFullscreen:!1})},i=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",t),this.trigger("fullscreenchange",{isFullscreen:!0}))};this.on("webkitbeginfullscreen",i),this.on("dispose",(function(){e.off("webkitbeginfullscreen",i),e.off("webkitendfullscreen",t)}))}},t.prototype.supportsFullScreen=function(){if("function"===typeof this.el_.webkitEnterFullScreen){var e=r.navigator&&r.navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},t.prototype.enterFullScreen=function(){var e=this.el_;e.paused&&e.networkState<=e.HAVE_METADATA?(this.el_.play(),this.setTimeout((function(){e.pause(),e.webkitEnterFullScreen()}),0)):e.webkitEnterFullScreen()},t.prototype.exitFullScreen=function(){this.el_.webkitExitFullScreen()},t.prototype.src=function(e){if(void 0===e)return this.el_.src;this.setSrc(e)},t.prototype.reset=function(){t.resetMediaElement(this.el_)},t.prototype.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},t.prototype.setControls=function(e){this.el_.controls=!!e},t.prototype.addTextTrack=function(t,i,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(t,i,n):e.prototype.addTextTrack.call(this,t,i,n)},t.prototype.createRemoteTextTrack=function(t){if(!this.featuresNativeTextTracks)return e.prototype.createRemoteTextTrack.call(this,t);var i=s.createElement("track");return t.kind&&(i.kind=t.kind),t.label&&(i.label=t.label),(t.language||t.srclang)&&(i.srclang=t.language||t.srclang),t["default"]&&(i["default"]=t["default"]),t.id&&(i.id=t.id),t.src&&(i.src=t.src),i},t.prototype.addRemoteTextTrack=function(t,i){var n=e.prototype.addRemoteTextTrack.call(this,t,i);return this.featuresNativeTextTracks&&this.el().appendChild(n),n},t.prototype.removeRemoteTextTrack=function(t){if(e.prototype.removeRemoteTextTrack.call(this,t),this.featuresNativeTextTracks){var i=this.$$("track"),n=i.length;while(n--)t!==i[n]&&t!==i[n].track||this.el().removeChild(i[n])}},t.prototype.getVideoPlaybackQuality=function(){if("function"===typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var e={};return"undefined"!==typeof this.el().webkitDroppedFrameCount&&"undefined"!==typeof this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),r.performance&&"function"===typeof r.performance.now?e.creationTime=r.performance.now():r.performance&&r.performance.timing&&"number"===typeof r.performance.timing.navigationStart&&(e.creationTime=r.Date.now()-r.performance.timing.navigationStart),e},t}(Ti);if(ie()){Ir.TEST_VID=s.createElement("video");var Or=s.createElement("track");Or.kind="captions",Or.srclang="en",Or.label="English",Ir.TEST_VID.appendChild(Or)}Ir.isSupported=function(){try{Ir.TEST_VID.volume=.5}catch(e){return!1}return!(!Ir.TEST_VID||!Ir.TEST_VID.canPlayType)},Ir.canPlayType=function(e){return Ir.TEST_VID.canPlayType(e)},Ir.canPlaySource=function(e,t){return Ir.canPlayType(e.type)},Ir.canControlVolume=function(){try{var e=Ir.TEST_VID.volume;return Ir.TEST_VID.volume=e/2+.1,e!==Ir.TEST_VID.volume}catch(t){return!1}},Ir.canMuteVolume=function(){try{var e=Ir.TEST_VID.muted;return Ir.TEST_VID.muted=!e,Ir.TEST_VID.muted?ge(Ir.TEST_VID,"muted","muted"):ye(Ir.TEST_VID,"muted","muted"),e!==Ir.TEST_VID.muted}catch(t){return!1}},Ir.canControlPlaybackRate=function(){if(_&&w&&C<58)return!1;try{var e=Ir.TEST_VID.playbackRate;return Ir.TEST_VID.playbackRate=e/2+.1,e!==Ir.TEST_VID.playbackRate}catch(t){return!1}},Ir.canOverrideAttributes=function(){if(x)return!1;try{var e=function(){};Object.defineProperty(s.createElement("video"),"src",{get:e,set:e}),Object.defineProperty(s.createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(s.createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(s.createElement("audio"),"innerHTML",{get:e,set:e})}catch(t){return!1}return!0},Ir.supportsNativeTextTracks=function(){return O||y&&w},Ir.supportsNativeVideoTracks=function(){return!(!Ir.TEST_VID||!Ir.TEST_VID.videoTracks)},Ir.supportsNativeAudioTracks=function(){return!(!Ir.TEST_VID||!Ir.TEST_VID.audioTracks)},Ir.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],Ir.prototype.featuresVolumeControl=Ir.canControlVolume(),Ir.prototype.featuresMuteControl=Ir.canMuteVolume(),Ir.prototype.featuresPlaybackRate=Ir.canControlPlaybackRate(),Ir.prototype.featuresSourceset=Ir.canOverrideAttributes(),Ir.prototype.movingMediaElementInDOM=!y,Ir.prototype.featuresFullscreenResize=!0,Ir.prototype.featuresProgressEvents=!0,Ir.prototype.featuresTimeupdateEvents=!0,Ir.prototype.featuresNativeTextTracks=Ir.supportsNativeTextTracks(),Ir.prototype.featuresNativeVideoTracks=Ir.supportsNativeVideoTracks(),Ir.prototype.featuresNativeAudioTracks=Ir.supportsNativeAudioTracks();var Pr=Ir.TEST_VID&&Ir.TEST_VID.constructor.prototype.canPlayType,Lr=/^application\/(?:x-|vnd\.apple\.)mpegurl/i,Dr=/^video\/mp4/i;Ir.patchCanPlayType=function(){b>=4&&!k&&!w?Ir.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&Lr.test(e)?"maybe":Pr.call(this,e)}:T&&(Ir.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&Dr.test(e)?"maybe":Pr.call(this,e)})},Ir.unpatchCanPlayType=function(){var e=Ir.TEST_VID.constructor.prototype.canPlayType;return Ir.TEST_VID.constructor.prototype.canPlayType=Pr,e},Ir.patchCanPlayType(),Ir.disposeMediaElement=function(e){if(e){e.parentNode&&e.parentNode.removeChild(e);while(e.hasChildNodes())e.removeChild(e.firstChild);e.removeAttribute("src"),"function"===typeof e.load&&function(){try{e.load()}catch(t){}}()}},Ir.resetMediaElement=function(e){if(e){var t=e.querySelectorAll("source"),i=t.length;while(i--)e.removeChild(t[i]);e.removeAttribute("src"),"function"===typeof e.load&&function(){try{e.load()}catch(t){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(e){Ir.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}})),["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(e){Ir.prototype["set"+gt(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}})),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","played","networkState","readyState","videoWidth","videoHeight"].forEach((function(e){Ir.prototype[e]=function(){return this.el_[e]}})),["volume","src","poster","preload","playbackRate","defaultPlaybackRate"].forEach((function(e){Ir.prototype["set"+gt(e)]=function(t){this.el_[e]=t}})),["pause","load","play"].forEach((function(e){Ir.prototype[e]=function(){return this.el_[e]()}})),Ti.withSourceHandlers(Ir),Ir.nativeSourceHandler={},Ir.nativeSourceHandler.canPlayType=function(e){try{return Ir.TEST_VID.canPlayType(e)}catch(t){return""}},Ir.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return Ir.nativeSourceHandler.canPlayType(e.type);if(e.src){var i=ri(e.src);return Ir.nativeSourceHandler.canPlayType("video/"+i)}return""},Ir.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)},Ir.nativeSourceHandler.dispose=function(){},Ir.registerSourceHandler(Ir.nativeSourceHandler),Ti.registerTech("Html5",Ir);var Mr=B(["\n Using the tech directly can be dangerous. I hope you know what you're doing.\n See https://github.com/videojs/video.js/issues/2617 for more info.\n "],["\n Using the tech directly can be dangerous. I hope you know what you're doing.\n See https://github.com/videojs/video.js/issues/2617 for more info.\n "]),Rr=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Nr={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},jr=["tiny","xsmall","small","medium","large","xlarge","huge"],Br={};jr.forEach((function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;Br[e]="vjs-layout-"+t}));var Ur={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Fr=function(e){function t(i,n,r){if(R(this,t),i.id=i.id||n.id||"vjs_video_"+De(),n=V(t.getTagSettings(i),n),n.initChildren=!1,n.createEl=!1,n.evented=!1,n.reportTouchActivity=!1,!n.language)if("function"===typeof i.closest){var s=i.closest("[lang]");s&&s.getAttribute&&(n.language=s.getAttribute("lang"))}else{var a=i;while(a&&1===a.nodeType){if(fe(a).hasOwnProperty("lang")){n.language=a.getAttribute("lang");break}a=a.parentNode}}var o=j(this,e.call(this,null,n,r));if(o.log=Y(o.id_),o.isPosterFromTech_=!1,o.queuedCallbacks_=[],o.isReady_=!1,o.hasStarted_=!1,o.userActive_=!1,!o.options_||!o.options_.techOrder||!o.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(o.tag=i,o.tagAttributes=i&&fe(i),o.language(o.options_.language),n.languages){var l={};Object.getOwnPropertyNames(n.languages).forEach((function(e){l[e.toLowerCase()]=n.languages[e]})),o.languages_=l}else o.languages_=t.prototype.options_.languages;o.cache_={},o.poster_=n.poster||"",o.controls_=!!n.controls,o.cache_.lastVolume=1,i.controls=!1,i.removeAttribute("controls"),i.hasAttribute("autoplay")?o.options_.autoplay=!0:o.autoplay(o.options_.autoplay),o.scrubbing_=!1,o.el_=o.createEl(),o.cache_.lastPlaybackRate=o.defaultPlaybackRate(),pt(o,{eventBusKey:"el_"});var u=vt(o.options_);if(n.plugins){var h=n.plugins;Object.keys(h).forEach((function(e){if("function"!==typeof this[e])throw new Error('plugin "'+e+'" does not exist');this[e](h[e])}),o)}o.options_.playerOptions=u,o.middleware_=[],o.initChildren(),o.isAudio("audio"===i.nodeName.toLowerCase()),o.controls()?o.addClass("vjs-controls-enabled"):o.addClass("vjs-controls-disabled"),o.el_.setAttribute("role","region"),o.isAudio()?o.el_.setAttribute("aria-label",o.localize("Audio Player")):o.el_.setAttribute("aria-label",o.localize("Video Player")),o.isAudio()&&o.addClass("vjs-audio"),o.flexNotSupported_()&&o.addClass("vjs-no-flex"),y||o.addClass("vjs-workinghover"),t.players[o.id_]=o;var d=c.split(".")[0];return o.addClass("vjs-v"+d),o.userActive(!0),o.reportUserActivity(),o.one("play",o.listenForUserActivity_),o.on("fullscreenchange",o.handleFullscreenChange_),o.on("stageclick",o.handleStageClick_),o.breakpoints(o.options_.breakpoints),o.responsive(o.options_.responsive),o.changingSrc_=!1,o.playWaitingForReady_=!1,o.playOnLoadstart_=null,o}return N(t,e),t.prototype.dispose=function(){this.trigger("dispose"),this.off("dispose"),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),t.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),Ni(this),e.prototype.dispose.call(this)},t.prototype.createEl=function(){var t=this.tag,i=void 0,n=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player"),a="video-js"===this.tag.tagName.toLowerCase();n?i=this.el_=t.parentNode:a||(i=this.el_=e.prototype.createEl.call(this,"div"));var o=fe(t);if(a){i=this.el_=t,t=this.tag=s.createElement("video");while(i.children.length)t.appendChild(i.firstChild);ue(i,"video-js")||ce(i,"video-js"),i.appendChild(t),n=this.playerElIngest_=i,["autoplay","controls","crossOrigin","defaultMuted","defaultPlaybackRate","loop","muted","playbackRate","src","volume"].forEach((function(e){"undefined"!==typeof i[e]&&(t[e]=i[e])}))}if(t.setAttribute("tabindex","-1"),o.tabindex="-1",A&&(t.setAttribute("role","application"),o.role="application"),t.removeAttribute("width"),t.removeAttribute("height"),"width"in o&&delete o.width,"height"in o&&delete o.height,Object.getOwnPropertyNames(o).forEach((function(e){"class"===e?(i.className+=" "+o[e],a&&(t.className+=" "+o[e])):(i.setAttribute(e,o[e]),a&&t.setAttribute(e,o[e]))})),t.playerId=t.id,t.id+="_html5_api",t.className="vjs-tech",t.player=i.player=this,this.addClass("vjs-paused"),!0!==r.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=Ze("vjs-styles-dimensions");var l=Ie(".vjs-styles-defaults"),u=Ie("head");u.insertBefore(this.styleEl_,l?l.nextSibling:u.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);for(var c=t.getElementsByTagName("a"),h=0;h<c.length;h++){var d=c.item(h);ce(d,"vjs-hidden"),d.setAttribute("hidden","hidden")}return t.initNetworkState_=t.networkState,t.parentNode&&!n&&t.parentNode.insertBefore(i,t),le(t,i),this.children_.unshift(t),this.el_.setAttribute("lang",this.language_),this.el_=i,i},t.prototype.width=function(e){return this.dimension("width",e)},t.prototype.height=function(e){return this.dimension("height",e)},t.prototype.dimension=function(e,t){var i=e+"_";if(void 0===t)return this[i]||0;if(""===t)return this[i]=void 0,void this.updateStyleEl_();var n=parseFloat(t);isNaN(n)?K.error('Improper value "'+t+'" supplied for for '+e):(this[i]=n,this.updateStyleEl_())},t.prototype.fluid=function(e){if(void 0===e)return!!this.fluid_;this.fluid_=!!e,e?(this.addClass("vjs-fluid"),this.fill(!1)):this.removeClass("vjs-fluid"),this.updateStyleEl_()},t.prototype.fill=function(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")},t.prototype.aspectRatio=function(e){if(void 0===e)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_()},t.prototype.updateStyleEl_=function(){if(!0!==r.VIDEOJS_NO_DYNAMIC_STYLE){var e=void 0,t=void 0,i=void 0,n=void 0;i=void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9";var s=i.split(":"),a=s[1]/s[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/a:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*a,n=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(n),et(this.styleEl_,"\n ."+n+" {\n width: "+e+"px;\n height: "+t+"px;\n }\n\n ."+n+".vjs-fluid {\n padding-top: "+100*a+"%;\n }\n ")}else{var o="number"===typeof this.width_?this.width_:this.options_.width,l="number"===typeof this.height_?this.height_:this.options_.height,u=this.tech_&&this.tech_.el();u&&(o>=0&&(u.width=o),l>=0&&(u.height=l))}},t.prototype.loadTech_=function(e,t){var i=this;this.tech_&&this.unloadTech_();var n=gt(e),r=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==n&&this.tag&&(Ti.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;var s="string"!==typeof this.autoplay()&&this.autoplay(),a={source:t,autoplay:s,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+r+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,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};_i.names.forEach((function(e){var t=_i[e];a[t.getterName]=i[t.privateName]})),V(a,this.options_[n]),V(a,this.options_[r]),V(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);var o=Ti.getTech(e);if(!o)throw new Error("No Tech named '"+n+"' exists! '"+n+"' should be registered using videojs.registerTech()'");this.tech_=new o(a),this.tech_.ready(tt(this,this.handleTechReady_),!0),Bt.jsonToTextTracks(this.textTracksJson_||[],this.tech_),Rr.forEach((function(e){i.on(i.tech_,e,i["handleTech"+gt(e)+"_"])})),Object.keys(Nr).forEach((function(e){i.on(i.tech_,e,(function(t){0===i.tech_.playbackRate()&&i.tech_.seeking()?i.queuedCallbacks_.push({callback:i["handleTech"+Nr[e]+"_"].bind(i),event:t}):i["handleTech"+Nr[e]+"_"](t)}))})),this.on(this.tech_,"loadstart",this.handleTechLoadStart_),this.on(this.tech_,"sourceset",this.handleTechSourceset_),this.on(this.tech_,"waiting",this.handleTechWaiting_),this.on(this.tech_,"ended",this.handleTechEnded_),this.on(this.tech_,"seeking",this.handleTechSeeking_),this.on(this.tech_,"play",this.handleTechPlay_),this.on(this.tech_,"firstplay",this.handleTechFirstPlay_),this.on(this.tech_,"pause",this.handleTechPause_),this.on(this.tech_,"durationchange",this.handleTechDurationChange_),this.on(this.tech_,"fullscreenchange",this.handleTechFullscreenChange_),this.on(this.tech_,"error",this.handleTechError_),this.on(this.tech_,"loadedmetadata",this.updateStyleEl_),this.on(this.tech_,"posterchange",this.handleTechPosterChange_),this.on(this.tech_,"textdata",this.handleTechTextData_),this.on(this.tech_,"ratechange",this.handleTechRateChange_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===n&&this.tag||le(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},t.prototype.unloadTech_=function(){var e=this;_i.names.forEach((function(t){var i=_i[t];e[i.privateName]=e[i.getterName]()})),this.textTracksJson_=Bt.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},t.prototype.tech=function(e){return void 0===e&&K.warn(a(Mr)),this.tech_},t.prototype.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"mousedown",this.handleTechClick_),this.on(this.tech_,"touchstart",this.handleTechTouchStart_),this.on(this.tech_,"touchmove",this.handleTechTouchMove_),this.on(this.tech_,"touchend",this.handleTechTouchEnd_),this.on(this.tech_,"tap",this.handleTechTap_)},t.prototype.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.handleTechTap_),this.off(this.tech_,"touchstart",this.handleTechTouchStart_),this.off(this.tech_,"touchmove",this.handleTechTouchMove_),this.off(this.tech_,"touchend",this.handleTechTouchEnd_),this.off(this.tech_,"mousedown",this.handleTechClick_)},t.prototype.handleTechReady_=function(){if(this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_(),(this.src()||this.currentSrc())&&this.tag&&this.options_.autoplay&&this.paused())try{delete this.tag.poster}catch(e){K("deleting tag.poster throws in some browsers",e)}},t.prototype.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(this.autoplay())},t.prototype.manualAutoplay_=function(e){var t=this;if(this.tech_&&"string"===typeof e){var i=function(){var e=t.muted();t.muted(!0);var i=t.play();if(i&&i.then&&i["catch"])return i["catch"]((function(i){t.muted(e)}))},n=void 0;if("any"===e?(n=this.play(),n&&n.then&&n["catch"]&&n["catch"]((function(){return i()}))):n="muted"===e?i():this.play(),n&&n.then&&n["catch"])return n.then((function(){t.trigger({type:"autoplay-success",autoplay:e})}))["catch"]((function(i){t.trigger({type:"autoplay-failure",autoplay:e})}))}},t.prototype.updateSourceCaches_=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e,i="";"string"!==typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=qi(this,t)),this.cache_.source=vt({},e,{src:t,type:i});for(var n=this.cache_.sources.filter((function(e){return e.src&&e.src===t})),r=[],s=this.$$("source"),a=[],o=0;o<s.length;o++){var l=fe(s[o]);r.push(l),l.src&&l.src===t&&a.push(l.src)}a.length&&!n.length?this.cache_.sources=r:n.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t},t.prototype.handleTechSourceset_=function(e){var t=this;if(!this.changingSrc_){var i=function(e){return t.updateSourceCaches_(e)},n=this.currentSource().src,r=e.src;if(n&&!/^blob:/.test(n)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==n)&&(i=function(){}),i(r),!e.src){var s=function e(i){if("sourceset"!==i.type){var n=t.techGet("currentSrc");t.lastSource_.tech=n,t.updateSourceCaches_(n)}t.tech_.off(["sourceset","loadstart"],e)};this.tech_.one(["sourceset","loadstart"],s)}}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})},t.prototype.hasStarted=function(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},t.prototype.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},t.prototype.handleTechRateChange_=function(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach((function(e){return e.callback(e.event)})),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},t.prototype.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting"),this.one("timeupdate",(function(){return e.removeClass("vjs-waiting")}))},t.prototype.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},t.prototype.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},t.prototype.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},t.prototype.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},t.prototype.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.trigger("seeked")},t.prototype.handleTechFirstPlay_=function(){this.options_.starttime&&(K.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},t.prototype.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},t.prototype.handleTechEnded_=function(){this.addClass("vjs-ended"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},t.prototype.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},t.prototype.handleTechClick_=function(e){Ae(e)&&this.controls_&&(this.paused()?Mt(this.play()):this.pause())},t.prototype.handleTechTap_=function(){this.userActive(!this.userActive())},t.prototype.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},t.prototype.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},t.prototype.handleTechTouchEnd_=function(e){e.preventDefault()},t.prototype.handleFullscreenChange_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},t.prototype.handleStageClick_=function(){this.reportUserActivity()},t.prototype.handleTechFullscreenChange_=function(e,t){t&&this.isFullscreen(t.isFullscreen),this.trigger("fullscreenchange")},t.prototype.handleTechError_=function(){var e=this.tech_.error();this.error(e)},t.prototype.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)},t.prototype.getCache=function(){return this.cache_},t.prototype.techCall_=function(e,t){this.ready((function(){if(e in Li)return Ii(this.middleware_,this.tech_,e,t);if(e in Di)return Oi(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(i){throw K(i),i}}),!0)},t.prototype.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in Pi)return Ai(this.middleware_,this.tech_,e);if(e in Di)return Oi(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw K("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",t),t;if("TypeError"===t.name)throw K("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",t),this.tech_.isReady_=!1,t;throw K(t),t}}},t.prototype.play=function(){var e=this,t=this.options_.Promise||r.Promise;return t?new t((function(t){e.play_(t)})):this.play_()},t.prototype.play_=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mt;if(this.playOnLoadstart_&&this.off("loadstart",this.playOnLoadstart_),this.isReady_){if(!this.changingSrc_&&(this.src()||this.currentSrc()))return void t(this.techGet_("play"));this.playOnLoadstart_=function(){e.playOnLoadstart_=null,t(e.play())},this.one("loadstart",this.playOnLoadstart_)}else{if(this.playWaitingForReady_)return;this.playWaitingForReady_=!0,this.ready((function(){e.playWaitingForReady_=!1,t(e.play())}))}},t.prototype.pause=function(){this.techCall_("pause")},t.prototype.paused=function(){return!1!==this.techGet_("paused")},t.prototype.played=function(){return this.techGet_("played")||kt(0,0)},t.prototype.scrubbing=function(e){if("undefined"===typeof e)return this.scrubbing_;this.scrubbing_=!!e,e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},t.prototype.currentTime=function(e){return"undefined"!==typeof e?(e<0&&(e=0),void this.techCall_("setCurrentTime",e)):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},t.prototype.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?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"),this.trigger("durationchange"))},t.prototype.remainingTime=function(){return this.duration()-this.currentTime()},t.prototype.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},t.prototype.buffered=function(){var e=this.techGet_("buffered");return e&&e.length||(e=kt(0,0)),e},t.prototype.bufferedPercent=function(){return Et(this.buffered(),this.duration())},t.prototype.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),i=e.end(e.length-1);return i>t&&(i=t),i},t.prototype.volume=function(e){var t=void 0;return void 0!==e?(t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)},t.prototype.muted=function(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)},t.prototype.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},t.prototype.lastVolume_=function(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e},t.prototype.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},t.prototype.isFullscreen=function(e){if(void 0===e)return!!this.isFullscreen_;this.isFullscreen_=!!e},t.prototype.requestFullscreen=function(){var e=wt;this.isFullscreen(!0),e.requestFullscreen?(ze(s,e.fullscreenchange,tt(this,(function t(i){this.isFullscreen(s[e.fullscreenElement]),!1===this.isFullscreen()&&We(s,e.fullscreenchange,t),this.trigger("fullscreenchange")}))),this.el_[e.requestFullscreen]()):this.tech_.supportsFullScreen()?this.techCall_("enterFullScreen"):(this.enterFullWindow(),this.trigger("fullscreenchange"))},t.prototype.exitFullscreen=function(){var e=wt;this.isFullscreen(!1),e.requestFullscreen?s[e.exitFullscreen]():this.tech_.supportsFullScreen()?this.techCall_("exitFullScreen"):(this.exitFullWindow(),this.trigger("fullscreenchange"))},t.prototype.enterFullWindow=function(){this.isFullWindow=!0,this.docOrigOverflow=s.documentElement.style.overflow,ze(s,"keydown",tt(this,this.fullWindowOnEscKey)),s.documentElement.style.overflow="hidden",ce(s.body,"vjs-full-window"),this.trigger("enterFullWindow")},t.prototype.fullWindowOnEscKey=function(e){27===e.keyCode&&(!0===this.isFullscreen()?this.exitFullscreen():this.exitFullWindow())},t.prototype.exitFullWindow=function(){this.isFullWindow=!1,We(s,"keydown",this.fullWindowOnEscKey),s.documentElement.style.overflow=this.docOrigOverflow,he(s.body,"vjs-full-window"),this.trigger("exitFullWindow")},t.prototype.canPlayType=function(e){for(var t=void 0,i=0,n=this.options_.techOrder;i<n.length;i++){var r=n[i],s=Ti.getTech(r);if(s||(s=_t.getComponent(r)),s){if(s.isSupported()&&(t=s.canPlayType(e),t))return t}else K.error('The "'+r+'" tech is undefined. Skipped browser support check for that tech.')}return""},t.prototype.selectSource=function(e){var t=this,i=this.options_.techOrder.map((function(e){return[e,Ti.getTech(e)]})).filter((function(e){var t=e[0],i=e[1];return i?i.isSupported():(K.error('The "'+t+'" tech is undefined. Skipped browser support check for that tech.'),!1)})),n=function(e,t,i){var n=void 0;return e.some((function(e){return t.some((function(t){if(n=i(e,t),n)return!0}))})),n},r=void 0,s=function(e){return function(t,i){return e(i,t)}},a=function(e,i){var n=e[0],r=e[1];if(r.canPlaySource(i,t.options_[n.toLowerCase()]))return{source:i,tech:n}};return r=this.options_.sourceOrder?n(e,i,s(a)):n(i,e,a),r||!1},t.prototype.src=function(e){var t=this;if("undefined"===typeof e)return this.cache_.src||"";var i=Hi(e);i.length?(this.changingSrc_=!0,this.cache_.sources=i,this.updateSourceCaches_(i[0]),Ci(this,i[0],(function(e,n){t.middleware_=n,t.cache_.sources=i,t.updateSourceCaches_(e);var r=t.src_(e);if(r)return i.length>1?t.src(i.slice(1)):(t.changingSrc_=!1,t.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0),void t.triggerReady());xi(n,t.tech_)}))):this.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0)},t.prototype.src_=function(e){var t=this,i=this.selectSource([e]);return!i||(yt(i.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_(i.tech,i.source),this.tech_.ready((function(){t.changingSrc_=!1})),!1))},t.prototype.load=function(){this.techCall_("load")},t.prototype.reset=function(){this.tech_&&this.tech_.clearTracks("text"),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset")},t.prototype.currentSources=function(){var e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t},t.prototype.currentSource=function(){return this.cache_.source||{}},t.prototype.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},t.prototype.currentType=function(){return this.currentSource()&&this.currentSource().type||""},t.prototype.preload=function(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")},t.prototype.autoplay=function(e){if(void 0===e)return this.options_.autoplay||!1;var t=void 0;"string"===typeof e&&/(any|play|muted)/.test(e)?(this.options_.autoplay=e,this.manualAutoplay_(e),t=!1):this.options_.autoplay=!!e,t=t||this.options_.autoplay,this.tech_&&this.techCall_("setAutoplay",t)},t.prototype.playsinline=function(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},t.prototype.loop=function(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")},t.prototype.poster=function(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},t.prototype.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},t.prototype.controls=function(e){if(void 0===e)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_()))},t.prototype.usingNativeControls=function(e){if(void 0===e)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")))},t.prototype.error=function(e){return void 0===e?this.error_||null:null===e?(this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close())):(this.error_=new Pt(e),this.addClass("vjs-error"),K.error("(CODE:"+this.error_.code+" "+Pt.errorTypes[this.error_.code]+")",this.error_.message,this.error_),void this.trigger("error"))},t.prototype.reportUserActivity=function(e){this.userActivity_=!0},t.prototype.userActive=function(e){if(void 0===e)return this.userActive_;if(e=!!e,e!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",(function(e){e.stopPropagation(),e.preventDefault()})),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},t.prototype.listenForUserActivity_=function(){var e=void 0,t=void 0,i=void 0,n=tt(this,this.reportUserActivity),r=function(e){e.screenX===t&&e.screenY===i||(t=e.screenX,i=e.screenY,n())},s=function(){n(),this.clearInterval(e),e=this.setInterval(n,250)},a=function(t){n(),this.clearInterval(e)};this.on("mousedown",s),this.on("mousemove",r),this.on("mouseup",a),this.on("keydown",n),this.on("keyup",n);var o=void 0;this.setInterval((function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(o);var e=this.options_.inactivityTimeout;e<=0||(o=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),e))}}),250)},t.prototype.playbackRate=function(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)},t.prototype.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},t.prototype.isAudio=function(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e},t.prototype.addTextTrack=function(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)},t.prototype.addRemoteTextTrack=function(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)},t.prototype.removeRemoteTextTrack=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.track,i=void 0===t?arguments[0]:t;if(this.tech_)return this.tech_.removeRemoteTextTrack(i)},t.prototype.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},t.prototype.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},t.prototype.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},t.prototype.language=function(e){if(void 0===e)return this.language_;this.language_=String(e).toLowerCase()},t.prototype.languages=function(){return vt(t.prototype.options_.languages,this.languages_)},t.prototype.toJSON=function(){var e=vt(this.options_),t=e.tracks;e.tracks=[];for(var i=0;i<t.length;i++){var n=t[i];n=vt(n),n.player=void 0,e.tracks[i]=n}return e},t.prototype.createModal=function(e,t){var i=this;t=t||{},t.content=e||"";var n=new qt(this,t);return this.addChild(n),n.on("dispose",(function(){i.removeChild(n)})),n.open(),n},t.prototype.updateCurrentBreakpoint_=function(){if(this.responsive())for(var e=this.currentBreakpoint(),t=this.currentWidth(),i=0;i<jr.length;i++){var n=jr[i],r=this.breakpoints_[n];if(t<=r){if(e===n)return;e&&this.removeClass(Br[e]),this.addClass(Br[n]),this.breakpoint_=n;break}}},t.prototype.removeCurrentBreakpoint_=function(){var e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)},t.prototype.breakpoints=function(e){return void 0===e||(this.breakpoint_="",this.breakpoints_=V({},Ur,e),this.updateCurrentBreakpoint_()),V(this.breakpoints_)},t.prototype.responsive=function(e){if(void 0===e)return this.responsive_;e=Boolean(e);var t=this.responsive_;return e!==t?(this.responsive_=e,e?(this.on("playerresize",this.updateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.updateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0},t.prototype.currentBreakpoint=function(){return this.breakpoint_},t.prototype.currentBreakpointClass=function(){return Br[this.breakpoint_]||""},t.getTagSettings=function(e){var t={sources:[],tracks:[]},i=fe(e),n=i["data-setup"];if(ue(e,"vjs-fill")&&(i.fill=!0),ue(e,"vjs-fluid")&&(i.fluid=!0),null!==n){var r=o(n||"{}"),s=r[0],a=r[1];s&&K.error(s),V(i,a)}if(V(t,i),e.hasChildNodes())for(var l=e.childNodes,u=0,c=l.length;u<c;u++){var h=l[u],d=h.nodeName.toLowerCase();"source"===d?t.sources.push(fe(h)):"track"===d&&t.tracks.push(fe(h))}return t},t.prototype.flexNotSupported_=function(){var e=s.createElement("i");return!("flexBasis"in e.style||"webkitFlexBasis"in e.style||"mozFlexBasis"in e.style||"msFlexBasis"in e.style||"msFlexOrder"in e.style)},t}(_t);_i.names.forEach((function(e){var t=_i[e];Fr.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}})),Fr.players={};var qr=r.navigator;Fr.prototype.options_={techOrder:Ti.defaultTechOrder_,html5:{},flash:{},inactivityTimeout:2e3,playbackRates:[],children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","controlBar","errorDisplay","textTrackSettings"],language:qr&&(qr.languages&&qr.languages[0]||qr.userLanguage||qr.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",breakpoints:{},responsive:!1},x||Fr.prototype.options_.children.push("resizeManager"),["ended","seeking","seekable","networkState","readyState"].forEach((function(e){Fr.prototype[e]=function(){return this.techGet_(e)}})),Rr.forEach((function(e){Fr.prototype["handleTech"+gt(e)+"_"]=function(){return this.trigger(e)}})),_t.registerComponent("Player",Fr);var Hr="plugin",Vr="activePlugins_",zr={},Wr=function(e){return zr.hasOwnProperty(e)},$r=function(e){return Wr(e)?zr[e]:void 0},Gr=function(e,t){e[Vr]=e[Vr]||{},e[Vr][t]=!0},Xr=function(e,t,i){var n=(i?"before":"")+"pluginsetup";e.trigger(n,t),e.trigger(n+":"+t.name,t)},Kr=function(e,t){var i=function(){Xr(this,{name:e,plugin:t,instance:null},!0);var i=t.apply(this,arguments);return Gr(this,e),Xr(this,{name:e,plugin:t,instance:i}),i};return Object.keys(t).forEach((function(e){i[e]=t[e]})),i},Yr=function(e,t){return t.prototype.name=e,function(){Xr(this,{name:e,plugin:t,instance:null},!0);for(var i=arguments.length,n=Array(i),r=0;r<i;r++)n[r]=arguments[r];var s=new(Function.prototype.bind.apply(t,[null].concat([this].concat(n))));return this[e]=function(){return s},Xr(this,s.getEventHash()),s}},Qr=function(){function e(t){if(R(this,e),this.constructor===e)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=t,pt(this),delete this.trigger,mt(this,this.constructor.defaultState),Gr(t,this.name),this.dispose=tt(this,this.dispose),t.on("dispose",this.dispose)}return e.prototype.version=function(){return this.constructor.VERSION},e.prototype.getEventHash=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.name=this.name,e.plugin=this.constructor,e.instance=this,e},e.prototype.trigger=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return $e(this.eventBusEl_,e,this.getEventHash(t))},e.prototype.handleStateChanged=function(e){},e.prototype.dispose=function(){var e=this.name,t=this.player;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[Vr][e]=!1,this.player=this.state=null,t[e]=Yr(e,zr[e])},e.isBasic=function(t){var i="string"===typeof t?$r(t):t;return"function"===typeof i&&!e.prototype.isPrototypeOf(i.prototype)},e.registerPlugin=function(t,i){if("string"!==typeof t)throw new Error('Illegal plugin name, "'+t+'", must be a string, was '+("undefined"===typeof t?"undefined":M(t))+".");if(Wr(t))K.warn('A plugin named "'+t+'" already exists. You may want to avoid re-registering plugins!');else if(Fr.prototype.hasOwnProperty(t))throw new Error('Illegal plugin name, "'+t+'", cannot share a name with an existing player method!');if("function"!==typeof i)throw new Error('Illegal plugin for "'+t+'", must be a function, was '+("undefined"===typeof i?"undefined":M(i))+".");return zr[t]=i,t!==Hr&&(e.isBasic(i)?Fr.prototype[t]=Kr(t,i):Fr.prototype[t]=Yr(t,i)),i},e.deregisterPlugin=function(e){if(e===Hr)throw new Error("Cannot de-register base plugin.");Wr(e)&&(delete zr[e],delete Fr.prototype[e])},e.getPlugins=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.keys(zr),t=void 0;return e.forEach((function(e){var i=$r(e);i&&(t=t||{},t[e]=i)})),t},e.getPluginVersion=function(e){var t=$r(e);return t&&t.VERSION||""},e}();Qr.getPlugin=$r,Qr.BASE_PLUGIN_NAME=Hr,Qr.registerPlugin(Hr,Qr),Fr.prototype.usingPlugin=function(e){return!!this[Vr]&&!0===this[Vr][e]},Fr.prototype.hasPlugin=function(e){return!!Wr(e)};var Jr=function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"===typeof t?"undefined":M(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.super_=t)},Zr=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=function(){e.apply(this,arguments)},n={};for(var r in"object"===("undefined"===typeof t?"undefined":M(t))?(t.constructor!==Object.prototype.constructor&&(i=t.constructor),n=t):"function"===typeof t&&(i=t),Jr(i,e),n)n.hasOwnProperty(r)&&(i.prototype[r]=n[r]);return i};"undefined"===typeof HTMLVideoElement&&ie()&&(s.createElement("video"),s.createElement("audio"),s.createElement("track"),s.createElement("video-js"));var es=function(e){return 0===e.indexOf("#")?e.slice(1):e};function ts(e,t,i){var n=ts.getPlayer(e);if(n)return t&&K.warn('Player "'+e+'" is already initialised. Options will not be applied.'),i&&n.ready(i),n;var r="string"===typeof e?Ie("#"+es(e)):e;if(!ne(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");s.body.contains(r)||K.warn("The element supplied is not included in the DOM"),t=t||{},ts.hooks("beforesetup").forEach((function(e){var i=e(r,vt(t));z(i)&&!Array.isArray(i)?t=vt(t,i):K.error("please return an object in beforesetup hooks")}));var a=_t.getComponent("Player");return n=new a(r,t,i),ts.hooks("setup").forEach((function(e){return e(n)})),n}if(ts.hooks_={},ts.hooks=function(e,t){return ts.hooks_[e]=ts.hooks_[e]||[],t&&(ts.hooks_[e]=ts.hooks_[e].concat(t)),ts.hooks_[e]},ts.hook=function(e,t){ts.hooks(e,t)},ts.hookOnce=function(e,t){ts.hooks(e,[].concat(t).map((function(t){var i=function i(){return ts.removeHook(e,i),t.apply(void 0,arguments)};return i})))},ts.removeHook=function(e,t){var i=ts.hooks(e).indexOf(t);return!(i<=-1)&&(ts.hooks_[e]=ts.hooks_[e].slice(),ts.hooks_[e].splice(i,1),!0)},!0!==r.VIDEOJS_NO_DYNAMIC_STYLE&&ie()){var is=Ie(".vjs-styles-defaults");if(!is){is=Ze("vjs-styles-defaults");var ns=Ie("head");ns&&ns.insertBefore(is,ns.firstChild),et(is,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid {\n padding-top: 56.25%\n }\n ")}}Je(1,ts),ts.VERSION=c,ts.options=Fr.prototype.options_,ts.getPlayers=function(){return Fr.players},ts.getPlayer=function(e){var t=Fr.players,i=void 0;if("string"===typeof e){var n=es(e),r=t[n];if(r)return r;i=Ie("#"+n)}else i=e;if(ne(i)){var s=i,a=s.player,o=s.playerId;if(a||t[o])return a||t[o]}},ts.getAllPlayers=function(){return Object.keys(Fr.players).map((function(e){return Fr.players[e]})).filter(Boolean)},ts.players=Fr.players,ts.getComponent=_t.getComponent,ts.registerComponent=function(e,t){Ti.isTech(t)&&K.warn("The "+e+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),_t.registerComponent.call(_t,e,t)},ts.getTech=Ti.getTech,ts.registerTech=Ti.registerTech,ts.use=wi,!x&&Object.defineProperty?(Object.defineProperty(ts,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(ts.middleware,"TERMINATOR",{value:Ei,writeable:!1,enumerable:!0})):ts.middleware={TERMINATOR:Ei},ts.browser=D,ts.TOUCH_ENABLED=P,ts.extend=Zr,ts.mergeOptions=vt,ts.bind=tt,ts.registerPlugin=Qr.registerPlugin,ts.deregisterPlugin=Qr.deregisterPlugin,ts.plugin=function(e,t){return K.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Qr.registerPlugin(e,t)},ts.getPlugins=Qr.getPlugins,ts.getPlugin=Qr.getPlugin,ts.getPluginVersion=Qr.getPluginVersion,ts.addLanguage=function(e,t){var i;return e=(""+e).toLowerCase(),ts.options.languages=vt(ts.options.languages,(i={},i[e]=t,i)),ts.options.languages[e]},ts.log=K,ts.createLogger=Y,ts.createTimeRange=ts.createTimeRanges=kt,ts.formatTime=un,ts.setFormatTime=on,ts.resetFormatTime=ln,ts.parseUrl=ii,ts.isCrossOrigin=si,ts.EventTarget=rt,ts.on=ze,ts.one=Ge,ts.off=We,ts.trigger=$e,ts.xhr=l,ts.TextTrack=ui,ts.AudioTrack=ci,ts.VideoTrack=hi,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach((function(e){ts[e]=function(){return K.warn("videojs."+e+"() is deprecated; use videojs.dom."+e+"() instead"),Pe[e].apply(null,arguments)}})),ts.computedStyle=Q,ts.dom=Pe,ts.url=ai,e.exports=ts},e9b0:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}();function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=function(){function e(){r(this,e),this.listeners={}}return n(e,[{key:"on",value:function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)}},{key:"off",value:function(e,t){var i=void 0;return!!this.listeners[e]&&(i=this.listeners[e].indexOf(t),this.listeners[e].splice(i,1),i>-1)}},{key:"trigger",value:function(e){var t=void 0,i=void 0,n=void 0,r=void 0;if(t=this.listeners[e],t)if(2===arguments.length)for(n=t.length,i=0;i<n;++i)t[i].call(this,arguments[1]);else for(r=Array.prototype.slice.call(arguments,1),n=t.length,i=0;i<n;++i)t[i].apply(this,r)}},{key:"dispose",value:function(){this.listeners={}}},{key:"pipe",value:function(e){this.on("data",(function(t){e.push(t)}))}}]),e}();t["default"]=s,e.exports=t["default"]},e9b3:function(e,t,i){(function(t){var i;i="undefined"!==typeof window?window:"undefined"!==typeof t?t:"undefined"!==typeof self?self:{},e.exports=i}).call(this,i("c8ba"))},ea3c:function(e,t){var i="auto",n={"":!0,lr:!0,rl:!0},r={start:!0,middle:!0,end:!0,left:!0,right:!0};function s(e){if("string"!==typeof e)return!1;var t=n[e.toLowerCase()];return!!t&&e.toLowerCase()}function a(e){if("string"!==typeof e)return!1;var t=r[e.toLowerCase()];return!!t&&e.toLowerCase()}function o(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)e[n]=i[n]}return e}function l(e,t,n){var r=this,l=/MSIE\s8\.0/.test(navigator.userAgent),u={};l?r=document.createElement("custom"):u.enumerable=!0,r.hasBeenReset=!1;var c="",h=!1,d=e,p=t,f=n,m=null,g="",y=!0,v="auto",_="start",b=50,T="middle",S=50,k="middle";if(Object.defineProperty(r,"id",o({},u,{get:function(){return c},set:function(e){c=""+e}})),Object.defineProperty(r,"pauseOnExit",o({},u,{get:function(){return h},set:function(e){h=!!e}})),Object.defineProperty(r,"startTime",o({},u,{get:function(){return d},set:function(e){if("number"!==typeof e)throw new TypeError("Start time must be set to a number.");d=e,this.hasBeenReset=!0}})),Object.defineProperty(r,"endTime",o({},u,{get:function(){return p},set:function(e){if("number"!==typeof e)throw new TypeError("End time must be set to a number.");p=e,this.hasBeenReset=!0}})),Object.defineProperty(r,"text",o({},u,{get:function(){return f},set:function(e){f=""+e,this.hasBeenReset=!0}})),Object.defineProperty(r,"region",o({},u,{get:function(){return m},set:function(e){m=e,this.hasBeenReset=!0}})),Object.defineProperty(r,"vertical",o({},u,{get:function(){return g},set:function(e){var t=s(e);if(!1===t)throw new SyntaxError("An invalid or illegal string was specified.");g=t,this.hasBeenReset=!0}})),Object.defineProperty(r,"snapToLines",o({},u,{get:function(){return y},set:function(e){y=!!e,this.hasBeenReset=!0}})),Object.defineProperty(r,"line",o({},u,{get:function(){return v},set:function(e){if("number"!==typeof e&&e!==i)throw new SyntaxError("An invalid number or illegal string was specified.");v=e,this.hasBeenReset=!0}})),Object.defineProperty(r,"lineAlign",o({},u,{get:function(){return _},set:function(e){var t=a(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");_=t,this.hasBeenReset=!0}})),Object.defineProperty(r,"position",o({},u,{get:function(){return b},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");b=e,this.hasBeenReset=!0}})),Object.defineProperty(r,"positionAlign",o({},u,{get:function(){return T},set:function(e){var t=a(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");T=t,this.hasBeenReset=!0}})),Object.defineProperty(r,"size",o({},u,{get:function(){return S},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");S=e,this.hasBeenReset=!0}})),Object.defineProperty(r,"align",o({},u,{get:function(){return k},set:function(e){var t=a(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");k=t,this.hasBeenReset=!0}})),r.displayState=void 0,l)return r}l.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},e.exports=l},ea7c:function(e,t,i){(function(t){var i;i="undefined"!==typeof window?window:"undefined"!==typeof t?t:"undefined"!==typeof self?self:{},e.exports=i}).call(this,i("c8ba"))},eaba:function(e,t,i){"use strict";var n,r,s,a=i("0129"),o=i("b52b");r=function(){var e,t,i=0;r.prototype.init.call(this),this.push=function(n){var r;for(t?(r=new Uint8Array(t.byteLength+n.data.byteLength),r.set(t),r.set(n.data,t.byteLength),t=r):t=n.data;i<t.byteLength-3;i++)if(1===t[i+2]){e=i+5;break}while(e<t.byteLength)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}i+3!==e-2&&this.trigger("data",t.subarray(i+3,e-2));do{e++}while(1!==t[e]&&e<t.length);i=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(i+3,e-2)),i=e-2,e+=3;break;default:e+=3;break}t=t.subarray(i),e-=i,i=0},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done")}},r.prototype=new a,s={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},n=function(){var e,t,i,a,l,u,c,h=new r;n.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,a=e.dts,h.push(e))},h.on("data",(function(n){var r={trackId:t,pts:i,dts:a,data:n};switch(31&n[0]){case 5:r.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:r.nalUnitType="sei_rbsp",r.escapedRBSP=l(n.subarray(1));break;case 7:r.nalUnitType="seq_parameter_set_rbsp",r.escapedRBSP=l(n.subarray(1)),r.config=u(r.escapedRBSP);break;case 8:r.nalUnitType="pic_parameter_set_rbsp";break;case 9:r.nalUnitType="access_unit_delimiter_rbsp";break;default:break}e.trigger("data",r)})),h.on("done",(function(){e.trigger("done")})),this.flush=function(){h.flush()},c=function(e,t){var i,n,r=8,s=8;for(i=0;i<e;i++)0!==s&&(n=t.readExpGolomb(),s=(r+n+256)%256),r=0===s?r:s},l=function(e){var t,i,n=e.byteLength,r=[],s=1;while(s<n-2)0===e[s]&&0===e[s+1]&&3===e[s+2]?(r.push(s+2),s+=2):s++;if(0===r.length)return e;t=n-r.length,i=new Uint8Array(t);var a=0;for(s=0;s<t;a++,s++)a===r[0]&&(a++,r.shift()),i[s]=e[a];return i},u=function(e){var t,i,n,r,a,l,u,h,d,p,f,m,g,y,v=0,_=0,b=0,T=0,S=1;if(t=new o(e),i=t.readUnsignedByte(),r=t.readUnsignedByte(),n=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),s[i]&&(a=t.readUnsignedExpGolomb(),3===a&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(f=3!==a?8:12,y=0;y<f;y++)t.readBoolean()&&c(y<6?16:64,t);if(t.skipUnsignedExpGolomb(),l=t.readUnsignedExpGolomb(),0===l)t.readUnsignedExpGolomb();else if(1===l)for(t.skipBits(1),t.skipExpGolomb(),t.skipExpGolomb(),u=t.readUnsignedExpGolomb(),y=0;y<u;y++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),h=t.readUnsignedExpGolomb(),d=t.readUnsignedExpGolomb(),p=t.readBits(1),0===p&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(v=t.readUnsignedExpGolomb(),_=t.readUnsignedExpGolomb(),b=t.readUnsignedExpGolomb(),T=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(g=t.readUnsignedByte(),g){case 1:m=[1,1];break;case 2:m=[12,11];break;case 3:m=[10,11];break;case 4:m=[16,11];break;case 5:m=[40,33];break;case 6:m=[24,11];break;case 7:m=[20,11];break;case 8:m=[32,11];break;case 9:m=[80,33];break;case 10:m=[18,11];break;case 11:m=[15,11];break;case 12:m=[64,33];break;case 13:m=[160,99];break;case 14:m=[4,3];break;case 15:m=[3,2];break;case 16:m=[2,1];break;case 255:m=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()];break}m&&(S=m[0]/m[1])}return{profileIdc:i,levelIdc:n,profileCompatibility:r,width:Math.ceil((16*(h+1)-2*v-2*_)*S),height:(2-p)*(d+1)*16-2*b-2*T}}},n.prototype=new a,e.exports={H264Stream:n,NalByteStream:r}},ed4d:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){var i=[],n=!0,r=!1,s=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0)if(i.push(a.value),t&&i.length===t)break}catch(l){r=!0,s=l}finally{try{!n&&o["return"]&&o["return"]()}finally{if(r)throw s}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();function r(e){return e&&e.__esModule?e:{default:e}}var s=i("be09"),a=r(s),o=function(e,t){for(var i=e.cues,n=0;n<i.length;n++){var r=i[n];if(t>=r.adStartTime&&t<=r.adEndTime)return r}return null},l=function(e,t){var i=arguments.length<=2||void 0===arguments[2]?0:arguments[2];if(e.segments)for(var r=i,s=void 0,l=0;l<e.segments.length;l++){var u=e.segments[l];if(s||(s=o(t,r+u.duration/2)),s){if("cueIn"in u){s.endTime=r,s.adEndTime=r,r+=u.duration,s=null;continue}if(r<s.endTime){r+=u.duration;continue}s.endTime+=u.duration}else if("cueOut"in u&&(s=new a["default"].VTTCue(r,r+u.duration,u.cueOut),s.adStartTime=r,s.adEndTime=r+parseFloat(u.cueOut),t.addCue(s)),"cueOutCont"in u){var c=void 0,h=void 0,d=u.cueOutCont.split("/").map(parseFloat),p=n(d,2);c=p[0],h=p[1],s=new a["default"].VTTCue(r,r+u.duration,""),s.adStartTime=r-c,s.adEndTime=s.adStartTime+h,t.addCue(s)}r+=u.duration}};t["default"]={updateAdCues:l,findAdCue:o},e.exports=t["default"]},ed7b:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}();function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=function(){var e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],i=e[1],n=t[4],r=i[4],s=void 0,a=void 0,o=void 0,l=[],u=[],c=void 0,h=void 0,d=void 0,p=void 0,f=void 0,m=void 0;for(s=0;s<256;s++)u[(l[s]=s<<1^283*(s>>7))^s]=s;for(a=o=0;!n[a];a^=c||1,o=u[o]||1)for(p=o^o<<1^o<<2^o<<3^o<<4,p=p>>8^255&p^99,n[a]=p,r[p]=a,d=l[h=l[c=l[a]]],m=16843009*d^65537*h^257*c^16843008*a,f=257*l[p]^16843008*p,s=0;s<4;s++)t[s][a]=f=f<<24^f>>>8,i[s][p]=m=m<<24^m>>>8;for(s=0;s<5;s++)t[s]=t[s].slice(0),i[s]=i[s].slice(0);return e},a=null,o=function(){function e(t){r(this,e),a||(a=s()),this._tables=[[a[0][0].slice(),a[0][1].slice(),a[0][2].slice(),a[0][3].slice(),a[0][4].slice()],[a[1][0].slice(),a[1][1].slice(),a[1][2].slice(),a[1][3].slice(),a[1][4].slice()]];var i=void 0,n=void 0,o=void 0,l=void 0,u=void 0,c=this._tables[0][4],h=this._tables[1],d=t.length,p=1;if(4!==d&&6!==d&&8!==d)throw new Error("Invalid aes key size");for(l=t.slice(0),u=[],this._key=[l,u],i=d;i<4*d+28;i++)o=l[i-1],(i%d===0||8===d&&i%d===4)&&(o=c[o>>>24]<<24^c[o>>16&255]<<16^c[o>>8&255]<<8^c[255&o],i%d===0&&(o=o<<8^o>>>24^p<<24,p=p<<1^283*(p>>7))),l[i]=l[i-d]^o;for(n=0;i;n++,i--)o=l[3&n?i:i-4],u[n]=i<=4||n<4?o:h[0][c[o>>>24]]^h[1][c[o>>16&255]]^h[2][c[o>>8&255]]^h[3][c[255&o]]}return n(e,[{key:"decrypt",value:function(e,t,i,n,r,s){var a=this._key[1],o=e^a[0],l=n^a[1],u=i^a[2],c=t^a[3],h=void 0,d=void 0,p=void 0,f=a.length/4-2,m=void 0,g=4,y=this._tables[1],v=y[0],_=y[1],b=y[2],T=y[3],S=y[4];for(m=0;m<f;m++)h=v[o>>>24]^_[l>>16&255]^b[u>>8&255]^T[255&c]^a[g],d=v[l>>>24]^_[u>>16&255]^b[c>>8&255]^T[255&o]^a[g+1],p=v[u>>>24]^_[c>>16&255]^b[o>>8&255]^T[255&l]^a[g+2],c=v[c>>>24]^_[o>>16&255]^b[l>>8&255]^T[255&u]^a[g+3],g+=4,o=h,l=d,u=p;for(m=0;m<4;m++)r[(3&-m)+s]=S[o>>>24]<<24^S[l>>16&255]<<16^S[u>>8&255]<<8^S[255&c]^a[g++],h=o,o=l,l=u,u=c,c=h}}]),e}();t["default"]=o,e.exports=t["default"]},eec7:function(e,t,i){"use strict";var n=i("e9b3"),r=i("8362"),s=i("6444"),a=i("53a8");function o(e,t){for(var i=0;i<e.length;i++)t(e[i])}function l(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function u(e,t,i){var n=e;return r(t)?(i=t,"string"===typeof e&&(n={uri:e})):n=a(t,{uri:e}),n.callback=i,n}function c(e,t,i){return t=u(e,t,i),h(t)}function h(e){if("undefined"===typeof e.callback)throw new Error("callback argument missing");var t=!1,i=function(i,n,r){t||(t=!0,e.callback(i,n,r))};function n(){4===p.readyState&&setTimeout(o,0)}function r(){var e=void 0;if(e=p.response?p.response:p.responseText||d(p),b)try{e=JSON.parse(e)}catch(t){}return e}function a(e){return clearTimeout(f),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,i(e,T)}function o(){if(!h){var t;clearTimeout(f),t=e.useXDR&&void 0===p.status?200:1223===p.status?204:p.status;var n=T,a=null;return 0!==t?(n={body:r(),statusCode:t,method:g,headers:{},url:m,rawRequest:p},p.getAllResponseHeaders&&(n.headers=s(p.getAllResponseHeaders()))):a=new Error("Internal XMLHttpRequest Error"),i(a,n,n.body)}}var u,h,p=e.xhr||null;p||(p=e.cors||e.useXDR?new c.XDomainRequest:new c.XMLHttpRequest);var f,m=p.url=e.uri||e.url,g=p.method=e.method||"GET",y=e.body||e.data,v=p.headers=e.headers||{},_=!!e.sync,b=!1,T={body:void 0,headers:{},statusCode:0,method:g,url:m,rawRequest:p};if("json"in e&&!1!==e.json&&(b=!0,v["accept"]||v["Accept"]||(v["Accept"]="application/json"),"GET"!==g&&"HEAD"!==g&&(v["content-type"]||v["Content-Type"]||(v["Content-Type"]="application/json"),y=JSON.stringify(!0===e.json?y:e.json))),p.onreadystatechange=n,p.onload=o,p.onerror=a,p.onprogress=function(){},p.onabort=function(){h=!0},p.ontimeout=a,p.open(g,m,!_,e.username,e.password),_||(p.withCredentials=!!e.withCredentials),!_&&e.timeout>0&&(f=setTimeout((function(){if(!h){h=!0,p.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",a(e)}}),e.timeout)),p.setRequestHeader)for(u in v)v.hasOwnProperty(u)&&p.setRequestHeader(u,v[u]);else if(e.headers&&!l(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(p.responseType=e.responseType),"beforeSend"in e&&"function"===typeof e.beforeSend&&e.beforeSend(p),p.send(y||null),p}function d(e){if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;return""!==e.responseType||t?null:e.responseXML}function p(){}e.exports=c,c.XMLHttpRequest=n.XMLHttpRequest||p,c.XDomainRequest="withCredentials"in new c.XMLHttpRequest?c.XMLHttpRequest:n.XDomainRequest,o(["get","put","post","patch","head","delete"],(function(e){c["delete"===e?"del":e]=function(t,i,n){return i=u(t,i,n),i.method=e.toUpperCase(),h(i)}}))},ef34:function(e,t,i){(function(t){var n,r="undefined"!==typeof t?t:"undefined"!==typeof window?window:{},s=i(1);"undefined"!==typeof document?n=document:(n=r["__GLOBAL_DOCUMENT_CACHE@4"],n||(n=r["__GLOBAL_DOCUMENT_CACHE@4"]=s)),e.exports=n}).call(this,i("c8ba"))},f0e2:function(e,t,i){"use strict";(function(e){i.d(t,"a",(function(){return Is}));var n=i("be09"),r=i.n(n),s=i("ef34"),a=i.n(s),o=i("df33"),l=i.n(o),u=i("8c10"),c=i.n(u),h=i("3603"),d=i.n(h),p=i("2b8c"),f=i.n(p),m=i("a559"),g=i.n(m),y=i("63ec"),v=i("d749"),_=i("17a3"),b=i("8b53"),T=i("de66"),S=i("8484"),k=i("81c0"),E=i.n(k),w=i("321f"),C=i("f8a8"),x=i("36c6"),A="8.12.0";const I={},O=function(e,t){return I[e]=I[e]||[],t&&(I[e]=I[e].concat(t)),I[e]},P=function(e,t){O(e,t)},L=function(e,t){const i=O(e).indexOf(t);return!(i<=-1)&&(I[e]=I[e].slice(),I[e].splice(i,1),!0)},D=function(e,t){O(e,[].concat(t).map(t=>{const i=(...n)=>(L(e,i),t(...n));return i}))},M={prefixed:!0},R=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],N=R[0];let j;for(let t=0;t<R.length;t++)if(R[t][1]in a.a){j=R[t];break}if(j){for(let e=0;e<j.length;e++)M[N[e]]=j[e];M.prefixed=j[0]!==N[0]}let B=[];const U=(e,t,i)=>(n,s,a)=>{const o=t.levels[s],l=new RegExp(`^(${o})$`);let u=e;if("log"!==n&&a.unshift(n.toUpperCase()+":"),i&&(u="%c"+e,a.unshift(i)),a.unshift(u+":"),B){B.push([].concat(a));const e=B.length-1e3;B.splice(0,e>0?e:0)}if(!r.a.console)return;let c=r.a.console[n];c||"debug"!==n||(c=r.a.console.info||r.a.console.log),c&&o&&l.test(n)&&c[Array.isArray(a)?"apply":"call"](r.a.console,a)};function F(e,t=":",i=""){let n,r="info";const s=function(...e){n("log",r,e)};return n=U(e,s,i),s.createLogger=(n,r,s)=>{const a=void 0!==r?r:t,o=void 0!==s?s:i,l=`${e} ${a} ${n}`;return F(l,a,o)},s.createNewLogger=(e,t,i)=>F(e,t,i),s.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:r},s.level=e=>{if("string"===typeof e){if(!s.levels.hasOwnProperty(e))throw new Error(`"${e}" in not a valid log level`);r=e}return r},s.history=()=>B?[].concat(B):[],s.history.filter=e=>(B||[]).filter(t=>new RegExp(`.*${e}.*`).test(t[0])),s.history.clear=()=>{B&&(B.length=0)},s.history.disable=()=>{null!==B&&(B.length=0,B=null)},s.history.enable=()=>{null===B&&(B=[])},s.error=(...e)=>n("error",r,e),s.warn=(...e)=>n("warn",r,e),s.debug=(...e)=>n("debug",r,e),s}const q=F("VIDEOJS"),H=q.createLogger,V=Object.prototype.toString,z=function(e){return G(e)?Object.keys(e):[]};function W(e,t){z(e).forEach(i=>t(e[i],i))}function $(e,t,i=0){return z(e).reduce((i,n)=>t(i,e[n],n),i)}function G(e){return!!e&&"object"===typeof e}function X(e){return G(e)&&"[object Object]"===V.call(e)&&e.constructor===Object}function K(...e){const t={};return e.forEach(e=>{e&&W(e,(e,i)=>{X(e)?(X(t[i])||(t[i]={}),t[i]=K(t[i],e)):t[i]=e})}),t}function Y(e={}){const t=[];for(const i in e)if(e.hasOwnProperty(i)){const n=e[i];t.push(n)}return t}function Q(e,t,i,n=!0){const r=i=>Object.defineProperty(e,t,{value:i,enumerable:!0,writable:!0}),s={configurable:!0,enumerable:!0,get(){const e=i();return r(e),e}};return n&&(s.set=r),Object.defineProperty(e,t,s)}var J=Object.freeze({__proto__:null,each:W,reduce:$,isObject:G,isPlain:X,merge:K,values:Y,defineLazyProperty:Q});let Z,ee=!1,te=null,ie=!1,ne=!1,re=!1,se=!1,ae=!1,oe=null,le=null,ue=null,ce=!1,he=!1,de=!1,pe=!1,fe=!1,me=!1,ge=!1;const ye=Boolean(Ee()&&("ontouchstart"in r.a||r.a.navigator.maxTouchPoints||r.a.DocumentTouch&&r.a.document instanceof r.a.DocumentTouch)),ve=r.a.navigator&&r.a.navigator.userAgentData;if(ve&&ve.platform&&ve.brands&&(ie="Android"===ve.platform,re=Boolean(ve.brands.find(e=>"Microsoft Edge"===e.brand)),se=Boolean(ve.brands.find(e=>"Chromium"===e.brand)),ae=!re&&se,oe=le=(ve.brands.find(e=>"Chromium"===e.brand)||{}).version||null,he="Windows"===ve.platform),!se){const e=r.a.navigator&&r.a.navigator.userAgent||"";ee=/iPod/i.test(e),te=function(){const t=e.match(/OS (\d+)_/i);return t&&t[1]?t[1]:null}(),ie=/Android/i.test(e),Z=function(){const t=e.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t)return null;const i=t[1]&&parseFloat(t[1]),n=t[2]&&parseFloat(t[2]);return i&&n?parseFloat(t[1]+"."+t[2]):i||null}(),ne=/Firefox/i.test(e),re=/Edg/i.test(e),se=/Chrome/i.test(e)||/CriOS/i.test(e),ae=!re&&se,oe=le=function(){const t=e.match(/(Chrome|CriOS)\/(\d+)/);return t&&t[2]?parseFloat(t[2]):null}(),ue=function(){const t=/MSIE\s(\d+)\.\d/.exec(e);let i=t&&parseFloat(t[1]);return!i&&/Trident\/7.0/i.test(e)&&/rv:11.0/.test(e)&&(i=11),i}(),fe=/Tizen/i.test(e),me=/Web0S/i.test(e),ge=fe||me,ce=/Safari/i.test(e)&&!ae&&!ie&&!re&&!ge,he=/Windows/i.test(e),de=/iPad/i.test(e)||ce&&ye&&!/iPhone/i.test(e),pe=/iPhone/i.test(e)&&!de}const _e=pe||de||ee,be=(ce||_e)&&!ae;var Te=Object.freeze({__proto__:null,get IS_IPOD(){return ee},get IOS_VERSION(){return te},get IS_ANDROID(){return ie},get ANDROID_VERSION(){return Z},get IS_FIREFOX(){return ne},get IS_EDGE(){return re},get IS_CHROMIUM(){return se},get IS_CHROME(){return ae},get CHROMIUM_VERSION(){return oe},get CHROME_VERSION(){return le},get IE_VERSION(){return ue},get IS_SAFARI(){return ce},get IS_WINDOWS(){return he},get IS_IPAD(){return de},get IS_IPHONE(){return pe},get IS_TIZEN(){return fe},get IS_WEBOS(){return me},get IS_SMART_TV(){return ge},TOUCH_ENABLED:ye,IS_IOS:_e,IS_ANY_SAFARI:be});function Se(e){return"string"===typeof e&&Boolean(e.trim())}function ke(e){if(e.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function Ee(){return a.a===r.a.document}function we(e){return G(e)&&1===e.nodeType}function Ce(){try{return r.a.parent!==r.a.self}catch(e){return!0}}function xe(e){return function(t,i){if(!Se(t))return a.a[e](null);Se(i)&&(i=a.a.querySelector(i));const n=we(i)?i:a.a;return n[e]&&n[e](t)}}function Ae(e="div",t={},i={},n){const r=a.a.createElement(e);return Object.getOwnPropertyNames(t).forEach((function(e){const i=t[e];"textContent"===e?Ie(r,i):r[e]===i&&"tabIndex"!==e||(r[e]=i)})),Object.getOwnPropertyNames(i).forEach((function(e){r.setAttribute(e,i[e])})),n&&Xe(r,n),r}function Ie(e,t){return"undefined"===typeof e.textContent?e.innerText=t:e.textContent=t,e}function Oe(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function Pe(e,t){return ke(t),e.classList.contains(t)}function Le(e,...t){return e.classList.add(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),e}function De(e,...t){return e?(e.classList.remove(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),e):(q.warn("removeClass was called with an element that doesn't exist"),null)}function Me(e,t,i){return"function"===typeof i&&(i=i(e,t)),"boolean"!==typeof i&&(i=void 0),t.split(/\s+/).forEach(t=>e.classList.toggle(t,i)),e}function Re(e,t){Object.getOwnPropertyNames(t).forEach((function(i){const n=t[i];null===n||"undefined"===typeof n||!1===n?e.removeAttribute(i):e.setAttribute(i,!0===n?"":n)}))}function Ne(e){const t={},i=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(e&&e.attributes&&e.attributes.length>0){const n=e.attributes;for(let e=n.length-1;e>=0;e--){const r=n[e].name;let s=n[e].value;i.includes(r)&&(s=null!==s),t[r]=s}}return t}function je(e,t){return e.getAttribute(t)}function Be(e,t,i){e.setAttribute(t,i)}function Ue(e,t){e.removeAttribute(t)}function Fe(){a.a.body.focus(),a.a.onselectstart=function(){return!1}}function qe(){a.a.onselectstart=function(){return!0}}function He(e){if(e&&e.getBoundingClientRect&&e.parentNode){const t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach(e=>{void 0!==t[e]&&(i[e]=t[e])}),i.height||(i.height=parseFloat(Ze(e,"height"))),i.width||(i.width=parseFloat(Ze(e,"width"))),i}}function Ve(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};const t=e.offsetWidth,i=e.offsetHeight;let n=0,r=0;while(e.offsetParent&&e!==a.a[M.fullscreenElement])n+=e.offsetLeft,r+=e.offsetTop,e=e.offsetParent;return{left:n,top:r,width:t,height:i}}function ze(e,t){const i={x:0,y:0};if(_e){let t=e;while(t&&"html"!==t.nodeName.toLowerCase()){const e=Ze(t,"transform");if(/^matrix/.test(e)){const t=e.slice(7,-1).split(/,\s/).map(Number);i.x+=t[4],i.y+=t[5]}else if(/^matrix3d/.test(e)){const t=e.slice(9,-1).split(/,\s/).map(Number);i.x+=t[12],i.y+=t[13]}t=t.parentNode}}const n={},r=Ve(t.target),s=Ve(e),a=s.width,o=s.height;let l=t.offsetY-(s.top-r.top),u=t.offsetX-(s.left-r.left);return t.changedTouches&&(u=t.changedTouches[0].pageX-s.left,l=t.changedTouches[0].pageY+s.top,_e&&(u-=i.x,l-=i.y)),n.y=1-Math.max(0,Math.min(1,l/o)),n.x=Math.max(0,Math.min(1,u/a)),n}function We(e){return G(e)&&3===e.nodeType}function $e(e){while(e.firstChild)e.removeChild(e.firstChild);return e}function Ge(e){return"function"===typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map(e=>("function"===typeof e&&(e=e()),we(e)||We(e)?e:"string"===typeof e&&/\S/.test(e)?a.a.createTextNode(e):void 0)).filter(e=>e)}function Xe(e,t){return Ge(t).forEach(t=>e.appendChild(t)),e}function Ke(e,t){return Xe($e(e),t)}function Ye(e){return void 0===e.button&&void 0===e.buttons||(0===e.button&&void 0===e.buttons||("mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons))}const Qe=xe("querySelector"),Je=xe("querySelectorAll");function Ze(e,t){if(!e||!t)return"";if("function"===typeof r.a.getComputedStyle){let n;try{n=r.a.getComputedStyle(e)}catch(i){return""}return n?n.getPropertyValue(t)||n[t]:""}return""}function et(e){[...a.a.styleSheets].forEach(t=>{try{const i=[...t.cssRules].map(e=>e.cssText).join(""),n=a.a.createElement("style");n.textContent=i,e.document.head.appendChild(n)}catch(i){const n=a.a.createElement("link");n.rel="stylesheet",n.type=t.type,n.media=t.media.mediaText,n.href=t.href,e.document.head.appendChild(n)}})}var tt=Object.freeze({__proto__:null,isReal:Ee,isEl:we,isInFrame:Ce,createEl:Ae,textContent:Ie,prependTo:Oe,hasClass:Pe,addClass:Le,removeClass:De,toggleClass:Me,setAttributes:Re,getAttributes:Ne,getAttribute:je,setAttribute:Be,removeAttribute:Ue,blockTextSelection:Fe,unblockTextSelection:qe,getBoundingClientRect:He,findPosition:Ve,getPointerPosition:ze,isTextNode:We,emptyEl:$e,normalizeContent:Ge,appendContent:Xe,insertContent:Ke,isSingleLeftClick:Ye,$:Qe,$$:Je,computedStyle:Ze,copyStyleSheetsToWindow:et});let it,nt=!1;const rt=function(){if(!1===it.options.autoSetup)return;const e=Array.prototype.slice.call(a.a.getElementsByTagName("video")),t=Array.prototype.slice.call(a.a.getElementsByTagName("audio")),i=Array.prototype.slice.call(a.a.getElementsByTagName("video-js")),n=e.concat(t,i);if(n&&n.length>0)for(let r=0,s=n.length;r<s;r++){const e=n[r];if(!e||!e.getAttribute){st(1);break}if(void 0===e.player){const t=e.getAttribute("data-setup");null!==t&&it(e)}}else nt||st(1)};function st(e,t){Ee()&&(t&&(it=t),r.a.setTimeout(rt,e))}function at(){nt=!0,r.a.removeEventListener("load",at)}Ee()&&("complete"===a.a.readyState?at():r.a.addEventListener("load",at));const ot=function(e){const t=a.a.createElement("style");return t.className=e,t},lt=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t};var ut=new WeakMap;const ct=3;let ht,dt=ct;function pt(){return dt++}function ft(e,t){if(!ut.has(e))return;const i=ut.get(e);0===i.handlers[t].length&&(delete i.handlers[t],e.removeEventListener?e.removeEventListener(t,i.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&ut.delete(e)}function mt(e,t,i,n){i.forEach((function(i){e(t,i,n)}))}function gt(e){if(e.fixed_)return e;function t(){return!0}function i(){return!1}if(!e||!e.isPropagationStopped||!e.isImmediatePropagationStopped){const n=e||r.a.event;e={};for(const t in n)"layerX"!==t&&"layerY"!==t&&"keyLocation"!==t&&"webkitMovementX"!==t&&"webkitMovementY"!==t&&"path"!==t&&("returnValue"===t&&n.preventDefault||(e[t]=n[t]));if(e.target||(e.target=e.srcElement||a.a),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){n.preventDefault&&n.preventDefault(),e.returnValue=!1,n.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){n.stopPropagation&&n.stopPropagation(),e.cancelBubble=!0,n.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=i,e.stopImmediatePropagation=function(){n.stopImmediatePropagation&&n.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=i,null!==e.clientX&&void 0!==e.clientX){const t=a.a.documentElement,i=a.a.body;e.pageX=e.clientX+(t&&t.scrollLeft||i&&i.scrollLeft||0)-(t&&t.clientLeft||i&&i.clientLeft||0),e.pageY=e.clientY+(t&&t.scrollTop||i&&i.scrollTop||0)-(t&&t.clientTop||i&&i.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e.fixed_=!0,e}const yt=function(){if("boolean"!==typeof ht){ht=!1;try{const e=Object.defineProperty({},"passive",{get(){ht=!0}});r.a.addEventListener("test",null,e),r.a.removeEventListener("test",null,e)}catch(e){}}return ht},vt=["touchstart","touchmove"];function _t(e,t,i){if(Array.isArray(t))return mt(_t,e,t,i);ut.has(e)||ut.set(e,{});const n=ut.get(e);if(n.handlers||(n.handlers={}),n.handlers[t]||(n.handlers[t]=[]),i.guid||(i.guid=pt()),n.handlers[t].push(i),n.dispatcher||(n.disabled=!1,n.dispatcher=function(t,i){if(n.disabled)return;t=gt(t);const r=n.handlers[t.type];if(r){const n=r.slice(0);for(let r=0,a=n.length;r<a;r++){if(t.isImmediatePropagationStopped())break;try{n[r].call(e,t,i)}catch(s){q.error(s)}}}}),1===n.handlers[t].length)if(e.addEventListener){let i=!1;yt()&&vt.indexOf(t)>-1&&(i={passive:!0}),e.addEventListener(t,n.dispatcher,i)}else e.attachEvent&&e.attachEvent("on"+t,n.dispatcher)}function bt(e,t,i){if(!ut.has(e))return;const n=ut.get(e);if(!n.handlers)return;if(Array.isArray(t))return mt(bt,e,t,i);const r=function(e,t){n.handlers[t]=[],ft(e,t)};if(void 0===t){for(const t in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},t)&&r(e,t);return}const s=n.handlers[t];if(s)if(i){if(i.guid)for(let e=0;e<s.length;e++)s[e].guid===i.guid&&s.splice(e--,1);ft(e,t)}else r(e,t)}function Tt(e,t,i){const n=ut.has(e)?ut.get(e):{},r=e.parentNode||e.ownerDocument;if("string"===typeof t?t={type:t,target:e}:t.target||(t.target=e),t=gt(t),n.dispatcher&&n.dispatcher.call(e,t,i),r&&!t.isPropagationStopped()&&!0===t.bubbles)Tt.call(null,r,t,i);else if(!r&&!t.defaultPrevented&&t.target&&t.target[t.type]){ut.has(t.target)||ut.set(t.target,{});const e=ut.get(t.target);t.target[t.type]&&(e.disabled=!0,"function"===typeof t.target[t.type]&&t.target[t.type](),e.disabled=!1)}return!t.defaultPrevented}function St(e,t,i){if(Array.isArray(t))return mt(St,e,t,i);const n=function(){bt(e,t,n),i.apply(this,arguments)};n.guid=i.guid=i.guid||pt(),_t(e,t,n)}function kt(e,t,i){const n=function(){bt(e,t,n),i.apply(this,arguments)};n.guid=i.guid=i.guid||pt(),_t(e,t,n)}var Et=Object.freeze({__proto__:null,fixEvent:gt,on:_t,off:bt,trigger:Tt,one:St,any:kt});const wt=30,Ct=function(e,t,i){t.guid||(t.guid=pt());const n=t.bind(e);return n.guid=i?i+"_"+t.guid:t.guid,n},xt=function(e,t){let i=r.a.performance.now();const n=function(...n){const s=r.a.performance.now();s-i>=t&&(e(...n),i=s)};return n},At=function(e,t,i,n=r.a){let s;const a=()=>{n.clearTimeout(s),s=null},o=function(){const r=this,a=arguments;let o=function(){s=null,o=null,i||e.apply(r,a)};!s&&i&&e.apply(r,a),n.clearTimeout(s),s=n.setTimeout(o,t)};return o.cancel=a,o};var It=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:wt,bind_:Ct,throttle:xt,debounce:At});let Ot;class Pt{on(e,t){const i=this.addEventListener;this.addEventListener=()=>{},_t(this,e,t),this.addEventListener=i}off(e,t){bt(this,e,t)}one(e,t){const i=this.addEventListener;this.addEventListener=()=>{},St(this,e,t),this.addEventListener=i}any(e,t){const i=this.addEventListener;this.addEventListener=()=>{},kt(this,e,t),this.addEventListener=i}trigger(e){const t=e.type||e;"string"===typeof e&&(e={type:t}),e=gt(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Tt(this,e)}queueTrigger(e){Ot||(Ot=new Map);const t=e.type||e;let i=Ot.get(this);i||(i=new Map,Ot.set(this,i));const n=i.get(t);i.delete(t),r.a.clearTimeout(n);const s=r.a.setTimeout(()=>{i.delete(t),0===i.size&&(i=null,Ot.delete(this)),this.trigger(e)},0);i.set(t,s)}}Pt.prototype.allowedEvents_={},Pt.prototype.addEventListener=Pt.prototype.on,Pt.prototype.removeEventListener=Pt.prototype.off,Pt.prototype.dispatchEvent=Pt.prototype.trigger;const Lt=e=>"function"===typeof e.name?e.name():"string"===typeof e.name?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e,Dt=e=>e instanceof Pt||!!e.eventBusEl_&&["on","one","off","trigger"].every(t=>"function"===typeof e[t]),Mt=(e,t)=>{Dt(e)?t():(e.eventedCallbacks||(e.eventedCallbacks=[]),e.eventedCallbacks.push(t))},Rt=e=>"string"===typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length,Nt=(e,t,i)=>{if(!e||!e.nodeName&&!Dt(e))throw new Error(`Invalid target for ${Lt(t)}#${i}; must be a DOM node or evented object.`)},jt=(e,t,i)=>{if(!Rt(e))throw new Error(`Invalid event type for ${Lt(t)}#${i}; must be a non-empty string or array.`)},Bt=(e,t,i)=>{if("function"!==typeof e)throw new Error(`Invalid listener for ${Lt(t)}#${i}; must be a function.`)},Ut=(e,t,i)=>{const n=t.length<3||t[0]===e||t[0]===e.eventBusEl_;let r,s,a;return n?(r=e.eventBusEl_,t.length>=3&&t.shift(),[s,a]=t):[r,s,a]=t,Nt(r,e,i),jt(s,e,i),Bt(a,e,i),a=Ct(e,a),{isTargetingSelf:n,target:r,type:s,listener:a}},Ft=(e,t,i,n)=>{Nt(e,e,t),e.nodeName?Et[t](e,i,n):e[t](i,n)},qt={on(...e){const{isTargetingSelf:t,target:i,type:n,listener:r}=Ut(this,e,"on");if(Ft(i,"on",n,r),!t){const e=()=>this.off(i,n,r);e.guid=r.guid;const t=()=>this.off("dispose",e);t.guid=r.guid,Ft(this,"on","dispose",e),Ft(i,"on","dispose",t)}},one(...e){const{isTargetingSelf:t,target:i,type:n,listener:r}=Ut(this,e,"one");if(t)Ft(i,"one",n,r);else{const e=(...t)=>{this.off(i,n,e),r.apply(null,t)};e.guid=r.guid,Ft(i,"one",n,e)}},any(...e){const{isTargetingSelf:t,target:i,type:n,listener:r}=Ut(this,e,"any");if(t)Ft(i,"any",n,r);else{const e=(...t)=>{this.off(i,n,e),r.apply(null,t)};e.guid=r.guid,Ft(i,"any",n,e)}},off(e,t,i){if(!e||Rt(e))bt(this.eventBusEl_,e,t);else{const n=e,r=t;Nt(n,this,"off"),jt(r,this,"off"),Bt(i,this,"off"),i=Ct(this,i),this.off("dispose",i),n.nodeName?(bt(n,r,i),bt(n,"dispose",i)):Dt(n)&&(n.off(r,i),n.off("dispose",i))}},trigger(e,t){Nt(this.eventBusEl_,this,"trigger");const i=e&&"string"!==typeof e?e.type:e;if(!Rt(i))throw new Error(`Invalid event type for ${Lt(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return Tt(this.eventBusEl_,e,t)}};function Ht(e,t={}){const{eventBusKey:i}=t;if(i){if(!e[i].nodeName)throw new Error(`The eventBusKey "${i}" does not refer to an element.`);e.eventBusEl_=e[i]}else e.eventBusEl_=Ae("span",{className:"vjs-event-bus"});return Object.assign(e,qt),e.eventedCallbacks&&e.eventedCallbacks.forEach(e=>{e()}),e.on("dispose",()=>{e.off(),[e,e.el_,e.eventBusEl_].forEach((function(e){e&&ut.has(e)&&ut.delete(e)})),r.a.setTimeout(()=>{e.eventBusEl_=null},0)}),e}const Vt={state:{},setState(e){let t;return"function"===typeof e&&(e=e()),W(e,(e,i)=>{this.state[i]!==e&&(t=t||{},t[i]={from:this.state[i],to:e}),this.state[i]=e}),t&&Dt(this)&&this.trigger({changes:t,type:"statechanged"}),t}};function zt(e,t){return Object.assign(e,Vt),e.state=Object.assign({},e.state,t),"function"===typeof e.handleStateChanged&&Dt(e)&&e.on("statechanged",e.handleStateChanged),e}const Wt=function(e){return"string"!==typeof e?e:e.replace(/./,e=>e.toLowerCase())},$t=function(e){return"string"!==typeof e?e:e.replace(/./,e=>e.toUpperCase())},Gt=function(e,t){return $t(e)===$t(t)};var Xt=Object.freeze({__proto__:null,toLowerCase:Wt,toTitleCase:$t,titleCaseEquals:Gt});class Kt{constructor(e,t,i){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=K({},this.options_),t=this.options_=K(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const t=e&&e.id&&e.id()||"no_player";this.id_=`${t}_component_${pt()}`}this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(e=>this.addClass(e)),["on","off","one","any","trigger"].forEach(e=>{this[e]=void 0}),!1!==t.evented&&(Ht(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),zt(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,!1!==t.initChildren&&this.initChildren(),this.ready(i),!1!==t.reportTouchActivity&&this.enableTouchActivity()}on(e,t){}off(e,t){}one(e,t){}any(e,t){}trigger(e,t){}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 e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].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 Boolean(this.isDisposed_)}player(){return this.player_}options(e){return e?(this.options_=K(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,i){return Ae(e,t,i)}localize(e,t,i=e){const n=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),s=r&&r[n],a=n&&n.split("-")[0],o=r&&r[a];let l=i;return s&&s[e]?l=s[e]:o&&o[e]&&(l=o[e]),t&&(l=l.replace(/\{(\d+)\}/g,(function(e,i){const n=t[i-1];let r=n;return"undefined"===typeof n&&(r=e),r}))),l}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((e,t)=>e.concat(t),[]);let t=this;for(let i=0;i<e.length;i++)if(t=t.getChild(e[i]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;const i="http://www.w3.org/2000/svg",n=Ae("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),r=a.a.createElementNS(i,"svg");r.setAttributeNS(null,"viewBox","0 0 512 512");const s=a.a.createElementNS(i,"use");return r.appendChild(s),s.setAttributeNS(null,"href","#vjs-icon-"+e),n.appendChild(r),this.iconIsSet_?t.replaceChild(n,t.querySelector(".vjs-icon-placeholder")):t.appendChild(n),this.iconIsSet_=!0,n}addChild(e,t={},i=this.children_.length){let n,r;if("string"===typeof e){r=$t(e);const i=t.componentClass||r;t.name=r;const s=Kt.getComponent(i);if(!s)throw new Error(`Component ${i} does not exist`);if("function"!==typeof s)return null;n=new s(this.player_||this,t)}else n=e;if(n.parentComponent_&&n.parentComponent_.removeChild(n),this.children_.splice(i,0,n),n.parentComponent_=this,"function"===typeof n.id&&(this.childIndex_[n.id()]=n),r=r||n.name&&$t(n.name()),r&&(this.childNameIndex_[r]=n,this.childNameIndex_[Wt(r)]=n),"function"===typeof n.el&&n.el()){let e=null;this.children_[i+1]&&(this.children_[i+1].el_?e=this.children_[i+1].el_:we(this.children_[i+1])&&(e=this.children_[i+1])),this.contentEl().insertBefore(n.el(),e)}return n}removeChild(e){if("string"===typeof e&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let n=this.children_.length-1;n>=0;n--)if(this.children_[n]===e){t=!0,this.children_.splice(n,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[$t(e.name())]=null,this.childNameIndex_[Wt(e.name())]=null;const i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,i=e=>{const i=e.name;let n=e.opts;if(void 0!==t[i]&&(n=t[i]),!1===n)return;!0===n&&(n={}),n.playerOptions=this.options_.playerOptions;const r=this.addChild(i,n);r&&(this[i]=r)};let n;const r=Kt.getComponent("Tech");n=Array.isArray(e)?e:Object.keys(e),n.concat(Object.keys(this.options_).filter((function(e){return!n.some((function(t){return"string"===typeof t?e===t:e===t.name}))}))).map(t=>{let i,n;return"string"===typeof t?(i=t,n=e[i]||this.options_[i]||{}):(i=t.name,n=t),{name:i,opts:n}}).filter(e=>{const t=Kt.getComponent(e.opts.componentClass||$t(e.name));return t&&!r.isTech(t)}).forEach(i)}}buildCSSClass(){return""}ready(e,t=!1){if(e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))}triggerReady(){this.isReady_=!0,this.setTimeout((function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach((function(e){e.call(this)}),this),this.trigger("ready")}),1)}$(e,t){return Qe(e,t||this.contentEl())}$$(e,t){return Je(e,t||this.contentEl())}hasClass(e){return Pe(this.el_,e)}addClass(...e){Le(this.el_,...e)}removeClass(...e){De(this.el_,...e)}toggleClass(e,t){Me(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 je(this.el_,e)}setAttribute(e,t){Be(this.el_,e,t)}removeAttribute(e){Ue(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,i){if(void 0!==t)return null!==t&&t===t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;const n=this.el_.style[e],r=n.indexOf("px");return-1!==r?parseInt(n.slice(0,r),10):parseInt(this.el_["offset"+$t(e)],10)}currentDimension(e){let t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=Ze(this.el_,e),t=parseFloat(t),0===t||isNaN(t)){const i="offset"+$t(e);t=this.el_[i]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(l.a.isEventKey(e,"Tab")||e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null;const i=10,n=200;let s;this.on("touchstart",(function(i){1===i.touches.length&&(t={pageX:i.touches[0].pageX,pageY:i.touches[0].pageY},e=r.a.performance.now(),s=!0)})),this.on("touchmove",(function(e){if(e.touches.length>1)s=!1;else if(t){const n=e.touches[0].pageX-t.pageX,r=e.touches[0].pageY-t.pageY,a=Math.sqrt(n*n+r*r);a>i&&(s=!1)}}));const a=function(){s=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",(function(i){if(t=null,!0===s){const t=r.a.performance.now()-e;t<n&&(i.preventDefault(),this.trigger("tap"))}}))}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=Ct(this.player(),this.player().reportUserActivity);let t;this.on("touchstart",(function(){e(),this.clearInterval(t),t=this.setInterval(e,250)}));const i=function(i){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",i),this.on("touchcancel",i)}setTimeout(e,t){var i;return e=Ct(this,e),this.clearTimersOnDispose_(),i=r.a.setTimeout(()=>{this.setTimeoutIds_.has(i)&&this.setTimeoutIds_.delete(i),e()},t),this.setTimeoutIds_.add(i),i}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),r.a.clearTimeout(e)),e}setInterval(e,t){e=Ct(this,e),this.clearTimersOnDispose_();const i=r.a.setInterval(e,t);return this.setIntervalIds_.add(i),i}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),r.a.clearInterval(e)),e}requestAnimationFrame(e){var t;return this.clearTimersOnDispose_(),e=Ct(this,e),t=r.a.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){if(this.namedRafs_.has(e))return;this.clearTimersOnDispose_(),t=Ct(this,t);const i=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,i),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),r.a.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((e,i)=>this[t](i))}),this.clearingTimersOnDispose_=!1}))}static registerComponent(e,t){if("string"!==typeof e||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const i=Kt.getComponent("Tech"),n=i&&i.isTech(t),r=Kt===t||Kt.prototype.isPrototypeOf(t.prototype);if(n||!r){let t;throw t=n?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error(`Illegal component, "${e}"; ${t}.`)}e=$t(e),Kt.components_||(Kt.components_={});const s=Kt.getComponent("Player");if("Player"===e&&s&&s.players){const e=s.players,t=Object.keys(e);if(e&&t.length>0&&t.map(t=>e[t]).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return Kt.components_[e]=t,Kt.components_[Wt(e)]=t,t}static getComponent(e){if(e&&Kt.components_)return Kt.components_[e]}}function Yt(e,t,i){if("number"!==typeof t||t<0||t>i)throw new Error(`Failed to execute '${e}' on 'TimeRanges': The index provided (${t}) is non-numeric or out of bounds (0-${i}).`)}function Qt(e,t,i,n){return Yt(e,n,i.length-1),i[n][t]}function Jt(e){let t;return t=void 0===e||0===e.length?{length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:Qt.bind(null,"start",0,e),end:Qt.bind(null,"end",1,e)},r.a.Symbol&&r.a.Symbol.iterator&&(t[r.a.Symbol.iterator]=()=>(e||[]).values()),t}function Zt(e,t){return Array.isArray(e)?Jt(e):void 0===e||void 0===t?Jt():Jt([[e,t]])}Kt.registerComponent("Component",Kt);const ei=function(e,t){e=e<0?0:e;let i=Math.floor(e%60),n=Math.floor(e/60%60),r=Math.floor(e/3600);const s=Math.floor(t/60%60),a=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(r=n=i="-"),r=r>0||a>0?r+":":"",n=((r||s>=10)&&n<10?"0"+n:n)+":",i=i<10?"0"+i:i,r+n+i};let ti=ei;function ii(e){ti=e}function ni(){ti=ei}function ri(e,t=e){return ti(e,t)}var si=Object.freeze({__proto__:null,createTimeRanges:Zt,createTimeRange:Zt,setFormatTime:ii,resetFormatTime:ni,formatTime:ri});function ai(e,t){let i,n,r=0;if(!t)return 0;e&&e.length||(e=Zt(0,0));for(let s=0;s<e.length;s++)i=e.start(s),n=e.end(s),n>t&&(n=t),r+=n-i;return r/t}function oi(e){if(e instanceof oi)return e;"number"===typeof e?this.code=e:"string"===typeof e?this.message=e:G(e)&&("number"===typeof e.code&&(this.code=e.code),Object.assign(this,e)),this.message||(this.message=oi.defaultMessages[this.code]||"")}function li(e){return void 0!==e&&null!==e&&"function"===typeof e.then}function ui(e){li(e)&&e.then(null,e=>{})}oi.prototype.code=0,oi.prototype.message="",oi.prototype.status=null,oi.prototype.metadata=null,oi.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],oi.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."},oi.MEDIA_ERR_CUSTOM=0,oi.prototype.MEDIA_ERR_CUSTOM=0,oi.MEDIA_ERR_ABORTED=1,oi.prototype.MEDIA_ERR_ABORTED=1,oi.MEDIA_ERR_NETWORK=2,oi.prototype.MEDIA_ERR_NETWORK=2,oi.MEDIA_ERR_DECODE=3,oi.prototype.MEDIA_ERR_DECODE=3,oi.MEDIA_ERR_SRC_NOT_SUPPORTED=4,oi.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4,oi.MEDIA_ERR_ENCRYPTED=5,oi.prototype.MEDIA_ERR_ENCRYPTED=5;const ci=function(e){const t=["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,i,n)=>(e[i]&&(t[i]=e[i]),t),{cues:e.cues&&Array.prototype.map.call(e.cues,(function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}}))});return t},hi=function(e){const t=e.$$("track"),i=Array.prototype.map.call(t,e=>e.track),n=Array.prototype.map.call(t,(function(e){const t=ci(e.track);return e.src&&(t.src=e.src),t}));return n.concat(Array.prototype.filter.call(e.textTracks(),(function(e){return-1===i.indexOf(e)})).map(ci))},di=function(e,t){return e.forEach((function(e){const i=t.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach(e=>i.addCue(e))})),t.textTracks()};var pi={textTracksToJson:hi,jsonToTextTracks:di,trackToJson_:ci};const fi="vjs-modal-dialog";class mi extends Kt{constructor(e,t){super(e,t),this.handleKeyDown_=e=>this.handleKeyDown(e),this.close_=e=>this.close(e),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=Ae("div",{className:fi+"-content"},{role:"document"}),this.descEl_=Ae("p",{className:fi+"-description vjs-control-text",id:this.el().getAttribute("aria-describedby")}),Ie(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`${fi} 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_)return void(this.options_.fillAlways&&this.fill());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"boolean"===typeof e&&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("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if("boolean"===typeof e){const t=this.closeable_=!!e;let i=this.getChild("closeButton");if(t&&!i){const e=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=e,this.on(i,"close",this.close_)}!t&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),i=t.parentNode,n=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),Ke(t,e),this.trigger("modalfill"),n?i.insertBefore(t,n):i.appendChild(t);const r=this.getChild("closeButton");r&&i.appendChild(r.el_)}empty(){this.trigger("beforemodalempty"),$e(this.contentEl()),this.trigger("modalempty")}content(e){return"undefined"!==typeof e&&(this.content_=e),this.content_}conditionalFocus_(){const e=a.a.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(e.stopPropagation(),l.a.isEventKey(e,"Escape")&&this.closeable())return e.preventDefault(),void this.close();if(!l.a.isEventKey(e,"Tab"))return;const t=this.focusableEls_(),i=this.el_.querySelector(":focus");let n;for(let r=0;r<t.length;r++)if(i===t[r]){n=r;break}a.a.activeElement===this.el_&&(n=0),e.shiftKey&&0===n?(t[t.length-1].focus(),e.preventDefault()):e.shiftKey||n!==t.length-1||(t[0].focus(),e.preventDefault())}focusableEls_(){const e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,e=>(e instanceof r.a.HTMLAnchorElement||e instanceof r.a.HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof r.a.HTMLInputElement||e instanceof r.a.HTMLSelectElement||e instanceof r.a.HTMLTextAreaElement||e instanceof r.a.HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof r.a.HTMLIFrameElement||e instanceof r.a.HTMLObjectElement||e instanceof r.a.HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable"))}}mi.prototype.options_={pauseOnOpen:!0,temporary:!0},Kt.registerComponent("ModalDialog",mi);class gi extends Pt{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]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=()=>{this.trigger({track:e,type:"labelchange",target:this})},Dt(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let i=0,n=this.length;i<n;i++)if(this[i]===e){t=this[i],t.off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let i=0,n=this.length;i<n;i++){const n=this[i];if(n.id===e){t=n;break}}return t}}gi.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const t in gi.prototype.allowedEvents_)gi.prototype["on"+t]=null;const yi=function(e,t){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].enabled=!1)};class vi extends gi{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){yi(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&yi(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,yi(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 _i=function(e,t){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].selected=!1)};class bi extends gi{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){_i(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set(){}})}addTrack(e){e.selected&&_i(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,_i(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 Ti extends gi{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_);const t=["metadata","chapters"];-1===t.indexOf(e.kind)&&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 Si{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,i=e.length;t<i;t++)this.addTrackElement_(e[t])}addTrackElement_(e){const t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.trackElements_[t]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)}getTrackElementByTrack_(e){let t;for(let i=0,n=this.trackElements_.length;i<n;i++)if(e===this.trackElements_[i].track){t=this.trackElements_[i];break}return t}removeTrackElement_(e){for(let t=0,i=this.trackElements_.length;t<i;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&"function"===typeof this.trackElements_[t].track.off&&this.trackElements_[t].track.off(),"function"===typeof this.trackElements_[t].off&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}}}class ki{constructor(e){ki.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){const t=this.length||0;let i=0;const n=e.length;this.cues_=e,this.length_=e.length;const r=function(e){""+e in this||Object.defineProperty(this,""+e,{get(){return this.cues_[e]}})};if(t<n)for(i=t;i<n;i++)r.call(this,i)}getCueById(e){let t=null;for(let i=0,n=this.length;i<n;i++){const n=this[i];if(n.id===e){t=n;break}}return t}}const Ei={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},wi={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},Ci={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},xi={disabled:"disabled",hidden:"hidden",showing:"showing"};class Ai extends Pt{constructor(e={}){super();const t={id:e.id||"vjs_track_"+pt(),kind:e.kind||"",language:e.language||""};let i=e.label||"";for(const n in t)Object.defineProperty(this,n,{get(){return t[n]},set(){}});Object.defineProperty(this,"label",{get(){return i},set(e){e!==i&&(i=e,this.trigger("labelchange"))}})}}const Ii=function(e){const t=["protocol","hostname","port","pathname","search","hash","host"],i=a.a.createElement("a");i.href=e;const n={};for(let r=0;r<t.length;r++)n[t[r]]=i[t[r]];return"http:"===n.protocol&&(n.host=n.host.replace(/:80$/,"")),"https:"===n.protocol&&(n.host=n.host.replace(/:443$/,"")),n.protocol||(n.protocol=r.a.location.protocol),n.host||(n.host=r.a.location.host),n},Oi=function(e){if(!e.match(/^https?:\/\//)){const t=a.a.createElement("a");t.href=e,e=t.href}return e},Pi=function(e){if("string"===typeof e){const t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/,i=t.exec(e);if(i)return i.pop().toLowerCase()}return""},Li=function(e,t=r.a.location){const i=Ii(e),n=":"===i.protocol?t.protocol:i.protocol,s=n+i.host!==t.protocol+t.host;return s};var Di=Object.freeze({__proto__:null,parseUrl:Ii,getAbsoluteURL:Oi,getFileExtension:Pi,isCrossOrigin:Li});const Mi=function(e,t){const i=new r.a.WebVTT.Parser(r.a,r.a.vttjs,r.a.WebVTT.StringDecoder()),n=[];i.oncue=function(e){t.addCue(e)},i.onparsingerror=function(e){n.push(e)},i.onflush=function(){t.trigger({type:"loadeddata",target:t})},i.parse(e),n.length>0&&(r.a.console&&r.a.console.groupCollapsed&&r.a.console.groupCollapsed("Text Track parsing errors for "+t.src),n.forEach(e=>q.error(e)),r.a.console&&r.a.console.groupEnd&&r.a.console.groupEnd()),i.flush()},Ri=function(e,t){const i={uri:e},n=Li(e);n&&(i.cors=n);const s="use-credentials"===t.tech_.crossOrigin();s&&(i.withCredentials=s),d()(i,Ct(this,(function(e,i,n){if(e)return q.error(e,i);t.loaded_=!0,"function"!==typeof r.a.WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],e=>{if("vttjserror"!==e.type)return Mi(n,t);q.error("vttjs failed to load, stopping trying to process "+t.src)}):Mi(n,t)})))};class Ni extends Ai{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=K(e,{kind:Ci[e.kind]||"subtitles",language:e.language||e.srclang||""});let i=xi[t.mode]||"disabled";const n=t.default;"metadata"!==t.kind&&"chapters"!==t.kind||(i="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=!1!==this.tech_.preloadTextTracks;const r=new ki(this.cues_),s=new ki(this.activeCues_);let a=!1;this.timeupdateHandler=Ct(this,(function(e={}){this.tech_.isDisposed()||(this.tech_.isReady_?(this.activeCues=this.activeCues,a&&(this.trigger("cuechange"),a=!1),"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))):"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))}));const o=()=>{this.stopTracking()};this.tech_.one("dispose",o),"disabled"!==i&&this.startTracking(),Object.defineProperties(this,{default:{get(){return n},set(){}},mode:{get(){return i},set(e){xi[e]&&i!==e&&(i=e,this.preload_||"disabled"===i||0!==this.cues.length||Ri(this.src,this),this.stopTracking(),"disabled"!==i&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?r:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(0===this.cues.length)return s;const e=this.tech_.currentTime(),t=[];for(let i=0,n=this.cues.length;i<n;i++){const n=this.cues[i];n.startTime<=e&&n.endTime>=e&&t.push(n)}if(a=!1,t.length!==this.activeCues_.length)a=!0;else for(let i=0;i<t.length;i++)-1===this.activeCues_.indexOf(t[i])&&(a=!0);return this.activeCues_=t,s.setCues_(this.activeCues_),s},set(){}}}),t.src?(this.src=t.src,this.preload_||(this.loaded_=!0),(this.preload_||"subtitles"!==t.kind&&"captions"!==t.kind)&&Ri(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 r.a.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(const i in e)i in t||(t[i]=e[i]);t.id=e.id,t.originalCue_=e}const i=this.tech_.textTracks();for(let n=0;n<i.length;n++)i[n]!==this&&i[n].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}removeCue(e){let t=this.cues_.length;while(t--){const i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}}Ni.prototype.allowedEvents_={cuechange:"cuechange"};class ji extends Ai{constructor(e={}){const t=K(e,{kind:wi[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"enabled",{get(){return i},set(e){"boolean"===typeof e&&e!==i&&(i=e,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class Bi extends Ai{constructor(e={}){const t=K(e,{kind:Ei[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"selected",{get(){return i},set(e){"boolean"===typeof e&&e!==i&&(i=e,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class Ui extends Pt{constructor(e={}){let t;super();const i=new Ni(e);this.kind=i.kind,this.src=i.src,this.srclang=i.language,this.label=i.label,this.default=i.default,Object.defineProperties(this,{readyState:{get(){return t}},track:{get(){return i}}}),t=Ui.NONE,i.addEventListener("loadeddata",()=>{t=Ui.LOADED,this.trigger({type:"load",target:this})})}}Ui.prototype.allowedEvents_={load:"load"},Ui.NONE=0,Ui.LOADING=1,Ui.LOADED=2,Ui.ERROR=3;const Fi={audio:{ListClass:vi,TrackClass:ji,capitalName:"Audio"},video:{ListClass:bi,TrackClass:Bi,capitalName:"Video"},text:{ListClass:Ti,TrackClass:Ni,capitalName:"Text"}};Object.keys(Fi).forEach((function(e){Fi[e].getterName=e+"Tracks",Fi[e].privateName=e+"Tracks_"}));const qi={remoteText:{ListClass:Ti,TrackClass:Ni,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Si,TrackClass:Ui,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},Hi=Object.assign({},Fi,qi);function Vi(e,t,i,n,r={}){const s=e.textTracks();r.kind=t,i&&(r.label=i),n&&(r.language=n),r.tech=e;const a=new Hi.text.TrackClass(r);return s.addTrack(a),a}qi.names=Object.keys(qi),Fi.names=Object.keys(Fi),Hi.names=[].concat(qi.names).concat(Fi.names);class zi extends Kt{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=e=>this.onDurationChange(e),this.trackProgress_=e=>this.trackProgress(e),this.trackCurrentTime_=e=>this.trackCurrentTime(e),this.stopTrackingCurrentTime_=e=>this.stopTrackingCurrentTime(e),this.disposeSourceHandler_=e=>this.disposeSourceHandler(e),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",(function(){this.hasStarted_=!0})),this.on("loadstart",(function(){this.hasStarted_=!1})),Hi.names.forEach(t=>{const i=Hi[t];e&&e[i.getterName]&&(this[i.privateName]=e[i.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(t=>{!1===e[`native${t}Tracks`]&&(this[`featuresNative${t}Tracks`]=!1)}),!1===e.nativeCaptions||!1===e.nativeTextTracks?this.featuresNativeTextTracks=!1:!0!==e.nativeCaptions&&!0!==e.nativeTextTracks||(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=!1!==e.preloadTextTracks,this.autoRemoteTextTracks_=new Hi.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(Ct(this,(function(){const e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()})),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return Zt(0,0)}bufferedPercent(){return ai(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(Fi.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){e=[].concat(e),e.forEach(e=>{const t=this[e+"Tracks"]()||[];let i=t.length;while(i--){const n=t[i];"text"===e&&this.removeRemoteTextTrack(n),t.removeTrack(n)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;while(t--){const i=e[t];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return void 0!==e&&(this.error_=new oi(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?Zt(0,0):Zt()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){Fi.names.forEach(e=>{const t=Fi[e],i=()=>{this.trigger(e+"trackchange")},n=this[t.getterName]();n.addEventListener("removetrack",i),n.addEventListener("addtrack",i),this.on("dispose",()=>{n.removeEventListener("removetrack",i),n.removeEventListener("addtrack",i)})})}addWebVttScript_(){if(!r.a.WebVTT)if(a.a.body.contains(this.el())){if(!this.options_["vtt.js"]&&X(f.a)&&Object.keys(f.a).length>0)return void this.trigger("vttjsloaded");const e=a.a.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}),r.a.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),i=t=>e.addTrack(t.track),n=t=>e.removeTrack(t.track);t.on("addtrack",i),t.on("removetrack",n),this.addWebVttScript_();const r=()=>this.trigger("texttrackchange"),s=()=>{r();for(let t=0;t<e.length;t++){const i=e[t];i.removeEventListener("cuechange",r),"showing"===i.mode&&i.addEventListener("cuechange",r)}};s(),e.addEventListener("change",s),e.addEventListener("addtrack",s),e.addEventListener("removetrack",s),this.on("dispose",(function(){t.off("addtrack",i),t.off("removetrack",n),e.removeEventListener("change",s),e.removeEventListener("addtrack",s),e.removeEventListener("removetrack",s);for(let t=0;t<e.length;t++){const i=e[t];i.removeEventListener("cuechange",r)}}))}addTextTrack(e,t,i){if(!e)throw new Error("TextTrack kind is required but was not provided");return Vi(this,e,t,i)}createRemoteTextTrack(e){const t=K(e,{tech:this});return new qi.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){const i=this.createRemoteTextTrack(e);return"boolean"!==typeof t&&(t=!1),this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),!1===t&&this.ready(()=>this.autoRemoteTextTracks_.addTrack(i.track)),i}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=pt();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 zi.canPlayType(e.type)}static isTech(e){return e.prototype instanceof zi||e instanceof zi||e===zi}static registerTech(e,t){if(zi.techs_||(zi.techs_={}),!zi.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!zi.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!zi.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=$t(e),zi.techs_[e]=t,zi.techs_[Wt(e)]=t,"Tech"!==e&&zi.defaultTechOrder_.push(e),t}static getTech(e){if(e)return zi.techs_&&zi.techs_[e]?zi.techs_[e]:(e=$t(e),r.a&&r.a.videojs&&r.a.videojs[e]?(q.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),r.a.videojs[e]):void 0)}}Hi.names.forEach((function(e){const t=Hi[e];zi.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}})),zi.prototype.featuresVolumeControl=!0,zi.prototype.featuresMuteControl=!0,zi.prototype.featuresFullscreenResize=!1,zi.prototype.featuresPlaybackRate=!1,zi.prototype.featuresProgressEvents=!1,zi.prototype.featuresSourceset=!1,zi.prototype.featuresTimeupdateEvents=!1,zi.prototype.featuresNativeTextTracks=!1,zi.prototype.featuresVideoFrameCallback=!1,zi.withSourceHandlers=function(e){e.registerSourceHandler=function(t,i){let n=e.sourceHandlers;n||(n=e.sourceHandlers=[]),void 0===i&&(i=n.length),n.splice(i,0,t)},e.canPlayType=function(t){const i=e.sourceHandlers||[];let n;for(let e=0;e<i.length;e++)if(n=i[e].canPlayType(t),n)return n;return""},e.selectSourceHandler=function(t,i){const n=e.sourceHandlers||[];let r;for(let e=0;e<n.length;e++)if(r=n[e].canHandleSource(t,i),r)return n[e];return null},e.canPlaySource=function(t,i){const n=e.selectSourceHandler(t,i);return n?n.canHandleSource(t,i):""};const t=["seekable","seeking","duration"];t.forEach((function(e){const t=this[e];"function"===typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})}),e.prototype),e.prototype.setSource=function(t){let i=e.selectSourceHandler(t,this.options_);i||(e.nativeSourceHandler?i=e.nativeSourceHandler:q.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),i!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=i.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},e.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)}},Kt.registerComponent("Tech",zi),zi.registerTech("Tech",zi),zi.defaultTechOrder_=[];const Wi={},$i={},Gi={};function Xi(e,t){Wi[e]=Wi[e]||[],Wi[e].push(t)}function Ki(e,t,i){e.setTimeout(()=>ln(t,Wi[t.type],i,e),1)}function Yi(e,t){e.forEach(e=>e.setTech&&e.setTech(t))}function Qi(e,t,i){return e.reduceRight(rn(i),t[i]())}function Ji(e,t,i,n){return t[i](e.reduce(rn(i),n))}function Zi(e,t,i,n=null){const r="call"+$t(i),s=e.reduce(rn(r),n),a=s===Gi,o=a?null:t[i](s);return sn(e,i,o,a),o}const en={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},tn={setCurrentTime:1,setMuted:1,setVolume:1},nn={play:1,pause:1};function rn(e){return(t,i)=>t===Gi?Gi:i[e]?i[e](t):t}function sn(e,t,i,n){for(let r=e.length-1;r>=0;r--){const s=e[r];s[t]&&s[t](n,i)}}function an(e){$i[e.id()]=null}function on(e,t){const i=$i[e.id()];let n=null;if(void 0===i||null===i)return n=t(e),$i[e.id()]=[[t,n]],n;for(let r=0;r<i.length;r++){const[e,s]=i[r];e===t&&(n=s)}return null===n&&(n=t(e),i.push([t,n])),n}function ln(e={},t=[],i,n,r=[],s=!1){const[a,...o]=t;if("string"===typeof a)ln(e,Wi[a],i,n,r,s);else if(a){const t=on(n,a);if(!t.setSource)return r.push(t),ln(e,o,i,n,r,s);t.setSource(Object.assign({},e),(function(a,l){if(a)return ln(e,o,i,n,r,s);r.push(t),ln(l,e.type===l.type?o:Wi[l.type],i,n,r,s)}))}else o.length?ln(e,o,i,n,r,s):s?i(e,r):ln(e,Wi["*"],i,n,r,!0)}const un={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"},cn=function(e=""){const t=Pi(e),i=un[t.toLowerCase()];return i||""},hn=(e,t)=>{if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;const i=e.cache_.sources.filter(e=>e.src===t);if(i.length)return i[0].type;const n=e.$$("source");for(let r=0;r<n.length;r++){const e=n[r];if(e.type&&e.src&&e.src===t)return e.type}return cn(t)},dn=function(e){if(Array.isArray(e)){let t=[];e.forEach((function(e){e=dn(e),Array.isArray(e)?t=t.concat(e):G(e)&&t.push(e)})),e=t}else e="string"===typeof e&&e.trim()?[pn({src:e})]:G(e)&&"string"===typeof e.src&&e.src&&e.src.trim()?[pn(e)]:[];return e};function pn(e){if(!e.type){const t=cn(e.src);t&&(e.type=t)}return e}var fn='<svg xmlns="http://www.w3.org/2000/svg">\n <defs>\n <symbol viewBox="0 0 48 48" id="vjs-icon-play">\n <path d="M16 10v28l22-14z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-pause">\n <path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-audio">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-captions">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-subtitles">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter">\n <path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit">\n <path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-play-circle">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-low">\n <path d="M14 18v12h8l10 10V8L22 18h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-spinner">\n <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>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-hd">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-chapters">\n <path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path>\n </symbol>\n <symbol viewBox="0 0 40 40" id="vjs-icon-downloading">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-share">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cog">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-square">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle">\n <circle cx="24" cy="24" r="20"></circle>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cancel">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-replay">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-repeat">\n <path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-5">\n <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>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-10">\n <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>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-30">\n <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>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-5">\n <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>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-10">\n <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>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-30">\n <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>\n </symbol>\n <symbol viewBox="0 0 512 512" id="vjs-icon-audio-description">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-next-item">\n <path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-previous-item">\n <path d="M12 12h4v24h-4zm7 12l17 12V12z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-shuffle">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cast">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter">\n <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>\n </symbol>\n <symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit">\n <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>\n <path fill="none" d="M-1-3h24v24H-1z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook">\n <path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin">\n <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>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-twitter">\n <path d="M1684 408q-67 98-162 167 1 14 1 42 0 130-38 259.5T1369.5 1125 1185 1335.5t-258 146-323 54.5q-271 0-496-145 35 4 78 4 225 0 401-138-105-2-188-64.5T285 1033q33 5 61 5 43 0 85-11-112-23-185.5-111.5T172 710v-4q68 38 146 41-66-44-105-115t-39-154q0-88 44-163 121 149 294.5 238.5T884 653q-8-38-8-74 0-134 94.5-228.5T1199 256q140 0 236 102 109-21 205-78-37 115-142 178 93-10 186-50z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr">\n <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>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest">\n <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>\n </symbol>\n </defs>\n</svg>';class mn extends Kt{constructor(e,t,i){const n=K({createEl:!1},t);if(super(e,n,i),t.playerOptions.sources&&0!==t.playerOptions.sources.length)e.src(t.playerOptions.sources);else for(let r=0,s=t.playerOptions.techOrder;r<s.length;r++){const t=$t(s[r]);let i=zi.getTech(t);if(t||(i=Kt.getComponent(t)),i&&i.isSupported()){e.loadTech_(t);break}}}}Kt.registerComponent("MediaLoader",mn);class gn extends Kt{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=e=>this.handleMouseOver(e),this.handleMouseOut_=e=>this.handleMouseOut(e),this.handleClick_=e=>this.handleClick(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.emitTapEvents(),this.enable()}createEl(e="div",t={},i={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),"button"===e&&q.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),i=Object.assign({role:"button"},i),this.tabIndex_=t.tabIndex;const n=Ae(e,t,i);return this.player_.options_.experimentalSvgIcons||n.appendChild(Ae("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(n),n}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=Ae("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(void 0===e)return this.controlText_||"Need Text";const i=this.localize(e);this.controlText_=e,Ie(this.controlTextEl_,i),this.nonIconControl||this.player_.options_.noUITitleAttributes||t.setAttribute("title",i)}buildCSSClass(){return"vjs-control vjs-button "+super.buildCSSClass()}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),"undefined"!==typeof this.tabIndex_&&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"),"undefined"!==typeof this.tabIndex_&&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){l.a.isEventKey(e,"Space")||l.a.isEventKey(e,"Enter")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}Kt.registerComponent("ClickableComponent",gn);class yn extends gn{constructor(e,t){super(e,t),this.update(),this.update_=e=>this.update(e),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return Ae("div",{className:"vjs-poster"})}crossOrigin(e){if("undefined"===typeof e)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;null===e||"anonymous"===e||"use-credentials"===e?this.$("img")&&(this.$("img").crossOrigin=e):this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){e?(this.$("img")||this.el_.appendChild(Ae("picture",{className:"vjs-poster",tabIndex:-1},{},Ae("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e):this.el_.textContent=""}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?ui(this.player_.play()):this.player_.pause())}}yn.prototype.crossorigin=yn.prototype.crossOrigin,Kt.registerComponent("PosterImage",yn);const vn="#222",_n="#ccc",bn={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',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Tn(e,t){let i;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");i=e.slice(1)}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function Sn(e,t,i){try{e.style[t]=i}catch(n){return}}function kn(e){return e?e+"px":""}class En extends Kt{constructor(e,t,i){super(e,t,i);const n=e=>this.updateDisplay(e),s=e=>{this.updateDisplayOverlay(),this.updateDisplay(e)};e.on("loadstart",e=>this.toggleDisplay(e)),e.on("texttrackchange",n),e.on("loadedmetadata",e=>{this.updateDisplayOverlay(),this.preselectTrack(e)}),e.ready(Ct(this,(function(){if(e.tech_&&e.tech_.featuresNativeTextTracks)return void this.hide();e.on("fullscreenchange",s),e.on("playerresize",s);const t=r.a.screen.orientation||r.a,i=r.a.screen.orientation?"change":"orientationchange";t.addEventListener(i,s),e.on("dispose",()=>t.removeEventListener(i,s));const n=this.options_.playerOptions.tracks||[];for(let e=0;e<n.length;e++)this.player_.addRemoteTextTrack(n[e],!0);this.preselectTrack()})))}preselectTrack(){const e={captions:1,subtitles:1},t=this.player_.textTracks(),i=this.player_.cache_.selectedLanguage;let n,r,s;for(let a=0;a<t.length;a++){const o=t[a];i&&i.enabled&&i.language&&i.language===o.language&&o.kind in e?o.kind===i.kind?s=o:s||(s=o):i&&!i.enabled?(s=null,n=null,r=null):o.default&&("descriptions"!==o.kind||n?o.kind in e&&!r&&(r=o):n=o)}s?s.mode="showing":r?r.mode="showing":n&&(n.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(){"function"===typeof r.a.WebVTT&&r.a.WebVTT.processCues(r.a,[],this.el_)}updateDisplay(){const e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){const t=[];for(let i=0;i<e.length;++i){const n=e[i];"showing"===n.mode&&t.push(n)}return void this.updateForTrack(t)}let i=null,n=null,r=e.length;while(r--){const t=e[r];"showing"===t.mode&&("descriptions"===t.kind?i=t:n=t)}n?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(n)):i&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(i))}updateDisplayOverlay(){if(!this.player_.videoHeight()||!r.a.CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),i=e/t,n=this.player_.videoWidth()/this.player_.videoHeight();let s=0,a=0;Math.abs(i-n)>.1&&(i>n?s=Math.round((e-t*n)/2):a=Math.round((t-e/n)/2)),Sn(this.el_,"insetInline",kn(s)),Sn(this.el_,"insetBlock",kn(a))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),i=e.activeCues;let n=i.length;while(n--){const e=i[n];if(!e)continue;const s=e.displayState;if(t.color&&(s.firstChild.style.color=t.color),t.textOpacity&&Sn(s.firstChild,"color",Tn(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(s.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&Sn(s.firstChild,"backgroundColor",Tn(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?Sn(s,"backgroundColor",Tn(t.windowColor,t.windowOpacity)):s.style.backgroundColor=t.windowColor),t.edgeStyle&&("dropshadow"===t.edgeStyle?s.firstChild.style.textShadow=`2px 2px 3px ${vn}, 2px 2px 4px ${vn}, 2px 2px 5px ${vn}`:"raised"===t.edgeStyle?s.firstChild.style.textShadow=`1px 1px ${vn}, 2px 2px ${vn}, 3px 3px ${vn}`:"depressed"===t.edgeStyle?s.firstChild.style.textShadow=`1px 1px ${_n}, 0 1px ${_n}, -1px -1px ${vn}, 0 -1px ${vn}`:"uniform"===t.edgeStyle&&(s.firstChild.style.textShadow=`0 0 4px ${vn}, 0 0 4px ${vn}, 0 0 4px ${vn}, 0 0 4px ${vn}`)),t.fontPercent&&1!==t.fontPercent){const e=r.a.parseFloat(s.style.fontSize);s.style.fontSize=e*t.fontPercent+"px",s.style.height="auto",s.style.top="auto"}t.fontFamily&&"default"!==t.fontFamily&&("small-caps"===t.fontFamily?s.firstChild.style.fontVariant="small-caps":s.firstChild.style.fontFamily=bn[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),"function"!==typeof r.a.WebVTT||e.every(e=>!e.activeCues))return;const t=[];for(let i=0;i<e.length;++i){const n=e[i];for(let e=0;e<n.activeCues.length;++e)t.push(n.activeCues[e])}r.a.WebVTT.processCues(r.a,t,this.el_);for(let i=0;i<e.length;++i){const t=e[i];for(let e=0;e<t.activeCues.length;++e){const n=t.activeCues[e].displayState;Le(n,"vjs-text-track-cue","vjs-text-track-cue-"+(t.language?t.language:i)),t.language&&Be(n,"lang",t.language)}this.player_.textTrackSettings&&this.updateDisplayState(t)}}}Kt.registerComponent("TextTrackDisplay",En);class wn extends Kt{createEl(){const e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),i=Ae("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),n=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return n.appendChild(i),n}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}}Kt.registerComponent("LoadingSpinner",wn);class Cn extends gn{createEl(e,t={},i={}){e="button",t=Object.assign({className:this.buildCSSClass()},t),i=Object.assign({type:"button"},i);const n=Ae(e,t,i);return this.player_.options_.experimentalSvgIcons||n.appendChild(Ae("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(n),n}addChild(e,t={}){const i=this.constructor.name;return q.warn(`Adding an actionable (user controllable) child to a Button (${i}) is not supported; use a ClickableComponent instead.`),Kt.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){l.a.isEventKey(e,"Space")||l.a.isEventKey(e,"Enter")?e.stopPropagation():super.handleKeyDown(e)}}Kt.registerComponent("Button",Cn);class xn extends Cn{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",e=>this.handleMouseDown(e))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(this.mouseused_&&"clientX"in e&&"clientY"in e)return ui(t),void(this.player_.tech(!0)&&this.player_.tech(!0).focus());const i=this.player_.getChild("controlBar"),n=i&&i.getChild("playToggle");if(!n)return void this.player_.tech(!0).focus();const r=()=>n.focus();li(t)?t.then(r,()=>{}):this.setTimeout(r,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}xn.prototype.controlText_="Play Video",Kt.registerComponent("BigPlayButton",xn);class An extends Cn{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){l.a.isEventKey(e,"Esc")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}Kt.registerComponent("CloseButton",An);class In extends Cn{constructor(e,t={}){super(e,t),t.replay=void 0===t.replay||t.replay,this.setIcon("play"),this.on(e,"play",e=>this.handlePlay(e)),this.on(e,"pause",e=>this.handlePause(e)),t.replay&&this.on(e,"ended",e=>this.handleEnded(e))}buildCSSClass(){return"vjs-play-control "+super.buildCSSClass()}handleClick(e){this.player_.paused()?ui(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",e=>this.handleSeeked(e))}}In.prototype.controlText_="Play",Kt.registerComponent("PlayToggle",In);class On extends Kt{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],e=>this.update(e)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:e+" vjs-time-control vjs-control"}),i=Ae("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+" "},{role:"presentation"});return t.appendChild(i),this.contentEl_=Ae("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||"seeking"!==e.type)&&this.updateContent(e)}updateTextNode_(e=0){e=ri(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let e=this.textNode_;e&&this.contentEl_.firstChild!==e&&(e=null,q.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_=a.a.createTextNode(this.formattedTime_),this.textNode_&&(e?this.contentEl_.replaceChild(this.textNode_,e):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}On.prototype.labelText_="Time",On.prototype.controlText_="Time",Kt.registerComponent("TimeDisplay",On);class Pn extends On{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}Pn.prototype.labelText_="Current Time",Pn.prototype.controlText_="Current Time",Kt.registerComponent("CurrentTimeDisplay",Pn);class Ln extends On{constructor(e,t){super(e,t);const i=e=>this.updateContent(e);this.on(e,"durationchange",i),this.on(e,"loadstart",i),this.on(e,"loadedmetadata",i)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}Ln.prototype.labelText_="Duration",Ln.prototype.controlText_="Duration",Kt.registerComponent("DurationDisplay",Ln);class Dn extends Kt{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),i=super.createEl("span",{textContent:"/"});return t.appendChild(i),e.appendChild(t),e}}Kt.registerComponent("TimeDivider",Dn);class Mn extends On{constructor(e,t){super(e,t),this.on(e,"durationchange",e=>this.updateContent(e))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return!1!==this.options_.displayNegative&&e.insertBefore(Ae("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if("number"!==typeof this.player_.duration())return;let t;t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t)}}Mn.prototype.labelText_="Remaining Time",Mn.prototype.controlText_="Remaining Time",Kt.registerComponent("RemainingTimeDisplay",Mn);class Rn extends Kt{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",e=>this.updateShowing(e))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=Ae("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(Ae("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+" "})),this.contentEl_.appendChild(a.a.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()}}Kt.registerComponent("LiveDisplay",Rn);class Nn extends Cn{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=e=>this.updateLiveEdgeStatus(e),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_=Ae("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()}}function jn(e,t,i){return e=Number(e),Math.min(i,Math.max(t,isNaN(e)?t:e))}Nn.prototype.controlText_="Seek to live, currently playing live",Kt.registerComponent("SeekToLive",Nn);var Bn=Object.freeze({__proto__:null,clamp:jn});class Un extends Kt{constructor(e,t){super(e,t),this.handleMouseDown_=e=>this.handleMouseDown(e),this.handleMouseUp_=e=>this.handleMouseUp(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.handleClick_=e=>this.handleClick(e),this.handleMouseMove_=e=>this.handleMouseMove(e),this.update_=e=>this.update(e),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={},i={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i),super.createEl(e,t,i)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||ae||e.preventDefault(),Fe(),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;qe(),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]=(100*e).toFixed(2)+"%"})),e}getProgress(){return Number(jn(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=ze(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){l.a.isEventKey(e,"Left")||l.a.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):l.a.isEventKey(e,"Right")||l.a.isEventKey(e,"Up")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}Kt.registerComponent("Slider",Un);const Fn=(e,t)=>jn(e/t*100,0,100).toFixed(2)+"%";class qn extends Kt{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",e=>this.update(e))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=Ae("span",{className:"vjs-control-text"}),i=Ae("span",{textContent:this.localize("Loaded")}),n=a.a.createTextNode(": ");return this.percentageEl_=Ae("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(i),t.appendChild(n),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const e=this.player_.liveTracker,t=this.player_.buffered(),i=e&&e.isLive()?e.seekableEnd():this.player_.duration(),n=this.player_.bufferedEnd(),r=this.partEls_,s=Fn(n,i);this.percent_!==s&&(this.el_.style.width=s,Ie(this.percentageEl_,s),this.percent_=s);for(let a=0;a<t.length;a++){const e=t.start(a),i=t.end(a);let s=r[a];s||(s=this.el_.appendChild(Ae()),r[a]=s),s.dataset.start===e&&s.dataset.end===i||(s.dataset.start=e,s.dataset.end=i,s.style.left=Fn(e,n),s.style.width=Fn(i-e,n))}for(let a=r.length;a>t.length;a--)this.el_.removeChild(r[a-1]);r.length=t.length})}}Kt.registerComponent("LoadProgressBar",qn);class Hn extends Kt{constructor(e,t){super(e,t),this.update=xt(Ct(this,this.update),wt)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){const n=Ve(this.el_),r=He(this.player_.el()),s=e.width*t;if(!r||!n)return;let a=e.left-r.left+s,o=e.width-s+(r.right-e.right);o||(o=e.width-s,a=s);let l=n.width/2;a<l?l+=l-a:o<l&&(l=o),l<0?l=0:l>n.width&&(l=n.width),l=Math.round(l),this.el_.style.right=`-${l}px`,this.write(i)}write(e){Ie(this.el_,e)}updateTime(e,t,i,n){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let r;const s=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const e=this.player_.liveTracker.liveWindow(),i=e-t*e;r=(i<1?"":"-")+ri(i,e)}else r=ri(i,s);this.update(e,t,r),n&&n()})}}Kt.registerComponent("TimeTooltip",Hn);class Vn extends Kt{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=xt(Ct(this,this.update),wt)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){const i=this.getChild("timeTooltip");if(!i)return;const n=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,n)}}Vn.prototype.options_={children:[]},_e||ie||Vn.prototype.options_.children.push("timeTooltip"),Kt.registerComponent("PlayProgressBar",Vn);class zn extends Kt{constructor(e,t){super(e,t),this.update=xt(Ct(this,this.update),wt)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,()=>{this.el_.style.left=e.width*t+"px"})}}zn.prototype.options_={children:["timeTooltip"]},Kt.registerComponent("MouseTimeDisplay",zn);const Wn=5,$n=12;class Gn extends Un{constructor(e,t){super(e,t),this.setEventHandlers_()}setEventHandlers_(){this.update_=Ct(this,this.update),this.update=xt(this.update_,wt),this.on(this.player_,["ended","durationchange","timeupdate"],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 a.a&&"visibilityState"in a.a&&this.on(a.a,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){"hidden"===a.a.visibilityState?(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,wt))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||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("hidden"===a.a.visibilityState)return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const e=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),i=this.player_.liveTracker;let n=this.player_.duration();i&&i.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.percent_=t),this.currentTime_===e&&this.duration_===n||(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[ri(e,n),ri(n,n)],"{1} of {2}")),this.currentTime_=e,this.duration_=n),this.bar&&this.bar.update(He(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 i=this.player_.liveTracker;return i&&i.isLive()?(t=(e-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){Ye(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!Ye(e)||isNaN(this.player_.duration()))return;let i;t||this.player_.scrubbing()||this.player_.scrubbing(!0);const n=this.calculateDistance(e),r=this.player_.liveTracker;if(r&&r.isLive()){if(n>=.99)return void r.seekToLiveEdge();const e=r.seekableStart(),t=r.liveCurrentTime();if(i=e+n*r.liveWindow(),i>=t&&(i=t),i<=e&&(i=e+.1),i===1/0)return}else i=n*this.player_.duration(),i===this.player_.duration()&&(i-=.1);this.userSeek_(i),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?ui(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+Wn)}stepBack(){this.userSeek_(this.player_.currentTime()-Wn)}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(l.a.isEventKey(e,"Space")||l.a.isEventKey(e,"Enter"))e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(l.a.isEventKey(e,"Home"))e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(l.a.isEventKey(e,"End"))e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(l()(e))){e.preventDefault(),e.stopPropagation();const i=10*(l.a.codes[l()(e)]-l.a.codes["0"])/100;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*i):this.userSeek_(this.player_.duration()*i)}else l.a.isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-Wn*$n)):l.a.isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+Wn*$n)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],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 a.a&&"visibilityState"in a.a&&this.off(a.a,"visibilitychange",this.toggleVisibility_),super.dispose()}}Gn.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},_e||ie||Gn.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),Kt.registerComponent("SeekBar",Gn);class Xn extends Kt{constructor(e,t){super(e,t),this.handleMouseMove=xt(Ct(this,this.handleMouseMove),wt),this.throttledHandleMouseSeek=xt(Ct(this,this.handleMouseSeek),wt),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.handleMouseDownHandler_=e=>this.handleMouseDown(e),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const i=t.getChild("playProgressBar"),n=t.getChild("mouseTimeDisplay");if(!i&&!n)return;const r=t.el(),s=Ve(r);let a=ze(r,e).x;a=jn(a,0,1),n&&n.update(s,a),i&&i.update(s,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){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&&ui(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,i=this.getChild("seekBar");i&&i.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()}}Xn.prototype.options_={children:["seekBar"]},Kt.registerComponent("ProgressControl",Xn);class Kn extends Cn{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],e=>this.handlePictureInPictureChange(e)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],e=>this.handlePictureInPictureEnabledChange(e)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return"vjs-picture-in-picture-control vjs-hidden "+super.buildCSSClass()}handlePictureInPictureAudioModeChange(){const e="audio"===this.player_.currentType().substring(0,5),t=e||this.player_.audioPosterMode()||this.player_.audioOnlyMode();t?(this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()):this.show()}handlePictureInPictureEnabledChange(){a.a.pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in r.a?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(){"function"===typeof a.a.exitPictureInPicture&&super.show()}}Kn.prototype.controlText_="Picture-in-Picture",Kt.registerComponent("PictureInPictureToggle",Kn);class Yn extends Cn{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",e=>this.handleFullscreenChange(e)),!1===a.a[e.fsApi_.fullscreenEnabled]&&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()}}Yn.prototype.controlText_="Fullscreen",Kt.registerComponent("FullscreenToggle",Yn);const Qn=function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))};class Jn extends Kt{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}}Kt.registerComponent("VolumeLevel",Jn);class Zn extends Kt{constructor(e,t){super(e,t),this.update=xt(Ct(this,this.update),wt)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,i,n){if(!i){const i=He(this.el_),n=He(this.player_.el()),r=e.width*t;if(!n||!i)return;const s=e.left-n.left+r,a=e.width-r+(n.right-e.right);let o=i.width/2;s<o?o+=o-s:a<o&&(o=a),o<0?o=0:o>i.width&&(o=i.width),this.el_.style.right=`-${o}px`}this.write(n+"%")}write(e){Ie(this.el_,e)}updateVolume(e,t,i,n,r){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,i,n.toFixed(0)),r&&r()})}}Kt.registerComponent("VolumeLevelTooltip",Zn);class er extends Kt{constructor(e,t){super(e,t),this.update=xt(Ct(this,this.update),wt)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,i){const n=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,n,()=>{i?this.el_.style.bottom=e.height*t+"px":this.el_.style.left=e.width*t+"px"})}}er.prototype.options_={children:["volumeLevelTooltip"]},Kt.registerComponent("MouseVolumeLevelDisplay",er);class tr extends Un{constructor(e,t){super(e,t),this.on("slideractive",e=>this.updateLastVolume_(e)),this.on(e,"volumechange",e=>this.updateARIAAttributes(e)),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){Ye(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const i=this.el(),n=He(i),r=this.vertical();let s=ze(i,e);s=r?s.y:s.x,s=jn(s,0,1),t.update(n,s,r)}Ye(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(100*this.player_.volume())}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{0===this.player_.volume()&&this.player_.lastVolume_(e)})}}tr.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},_e||ie||tr.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),tr.prototype.playerEvent="volumechange",Kt.registerComponent("VolumeBar",tr);class ir extends Kt{constructor(e,t={}){t.vertical=t.vertical||!1,("undefined"===typeof t.volumeBar||X(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),Qn(this,e),this.throttledHandleMouseMove=xt(Ct(this,this.handleMouseMove),wt),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.on("mousedown",e=>this.handleMouseDown(e)),this.on("touchstart",e=>this.handleMouseDown(e)),this.on("mousemove",e=>this.handleMouseMove(e)),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)}}ir.prototype.options_={children:["volumeBar"]},Kt.registerComponent("VolumeControl",ir);const nr=function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))};class rr extends Cn{constructor(e,t){super(e,t),nr(this,e),this.on(e,["loadstart","volumechange"],e=>this.update(e))}buildCSSClass(){return"vjs-mute-control "+super.buildCSSClass()}handleClick(e){const t=this.player_.volume(),i=this.player_.lastVolume_();if(0===t){const e=i<.1?.1:i;this.player_.volume(e),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"),_e&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||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),De(this.el_,[0,1,2,3].reduce((e,t)=>e+`${t?" ":""}vjs-vol-${t}`,"")),Le(this.el_,"vjs-vol-"+t)}updateControlText_(){const e=this.player_.muted()||0===this.player_.volume(),t=e?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)}}rr.prototype.controlText_="Mute",Kt.registerComponent("MuteToggle",rr);class sr extends Kt{constructor(e,t={}){"undefined"!==typeof t.inline?t.inline=t.inline:t.inline=!0,("undefined"===typeof t.volumeControl||X(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=e=>this.handleKeyPress(e),this.on(e,["loadstart"],e=>this.volumePanelState_(e)),this.on(this.muteToggle,"keyup",e=>this.handleKeyPress(e)),this.on(this.volumeControl,"keyup",e=>this.handleVolumeControlKeyUp(e)),this.on("keydown",e=>this.handleKeyPress(e)),this.on("mouseover",e=>this.handleMouseOver(e)),this.on("mouseout",e=>this.handleMouseOut(e)),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){l.a.isEventKey(e,"Esc")&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),_t(a.a,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),bt(a.a,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){l.a.isEventKey(e,"Esc")&&this.handleMouseOut()}}sr.prototype.options_={children:["muteToggle","volumeControl"]},Kt.registerComponent("VolumePanel",sr);class ar extends Cn{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(),i=this.player_.liveTracker,n=i&&i.isLive()?i.seekableEnd():this.player_.duration();let r;r=t+this.skipTime<=n?t+this.skipTime:n,this.player_.currentTime(r)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}ar.prototype.controlText_="Skip Forward",Kt.registerComponent("SkipForward",ar);class or extends Cn{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} 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(),i=this.player_.liveTracker,n=i&&i.isLive()&&i.seekableStart();let r;r=n&&t-this.skipTime<=n?n:t>=this.skipTime?t-this.skipTime:0,this.player_.currentTime(r)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}or.prototype.controlText_="Skip Backward",Kt.registerComponent("SkipBackward",or);class lr extends Kt{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",e=>this.handleKeyDown(e)),this.boundHandleBlur_=e=>this.handleBlur(e),this.boundHandleTapClick_=e=>this.handleTapClick(e)}addEventListenerForItem(e){e instanceof Kt&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof Kt&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){"string"===typeof e&&(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_=Ae(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_),_t(t,"click",(function(e){e.preventDefault(),e.stopImmediatePropagation()})),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||a.a.activeElement;if(!this.children().some(e=>e.el()===t)){const e=this.menuButton_;e&&e.buttonPressed_&&t!==e.el().firstChild&&e.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const i=t.filter(t=>t.el()===e.target)[0];if(!i)return;"CaptionSettingsMenuItem"!==i.name()&&this.menuButton_.focus()}}handleKeyDown(e){l.a.isEventKey(e,"Left")||l.a.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(l.a.isEventKey(e,"Right")||l.a.isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice(),i=t.length&&t[0].hasClass("vjs-menu-title");i&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}Kt.registerComponent("Menu",lr);class ur extends Kt{constructor(e,t={}){super(e,t),this.menuButton_=new Cn(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const i=Cn.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+i,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const n=e=>this.handleClick(e);this.handleMenuKeyUp_=e=>this.handleMenuKeyUp(e),this.on(this.menuButton_,"tap",n),this.on(this.menuButton_,"click",n),this.on(this.menuButton_,"keydown",e=>this.handleKeyDown(e)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),_t(a.a,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",e=>this.handleMouseLeave(e)),this.on("keydown",e=>this.handleSubmenuKeyDown(e))}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 lr(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=Ae("li",{className:"vjs-menu-title",textContent:$t(this.options_.title),tabIndex:-1}),i=new Kt(this.player_,{el:t});e.addItem(i)}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";!0===this.options_.inline?e+="-inline":e+="-popup";const t=Cn.prototype.buildCSSClass();return`vjs-menu-button ${e} ${t} ${super.buildCSSClass()}`}buildCSSClass(){let e="vjs-menu-button";return!0===this.options_.inline?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"),bt(a.a,"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){l.a.isEventKey(e,"Esc")||l.a.isEventKey(e,"Tab")?(this.buttonPressed_&&this.unpressButton(),l.a.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus())):(l.a.isEventKey(e,"Up")||l.a.isEventKey(e,"Down"))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))}handleMenuKeyUp(e){(l.a.isEventKey(e,"Esc")||l.a.isEventKey(e,"Tab"))&&this.removeClass("vjs-hover")}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){(l.a.isEventKey(e,"Esc")||l.a.isEventKey(e,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),l.a.isEventKey(e,"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"),_e&&Ce())return;this.menu.focus()}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))}disable(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()}}Kt.registerComponent("MenuButton",ur);class cr extends ur{constructor(e,t){const i=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!i)return;const n=Ct(this,this.update);i.addEventListener("removetrack",n),i.addEventListener("addtrack",n),i.addEventListener("labelchange",n),this.player_.on("ready",n),this.player_.on("dispose",(function(){i.removeEventListener("removetrack",n),i.removeEventListener("addtrack",n),i.removeEventListener("labelchange",n)}))}}Kt.registerComponent("TrackButton",cr);const hr=["Tab","Esc","Up","Down","Right","Left"];class dr extends gn{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,i){this.nonIconControl=!0;const n=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),i),r=Ae("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?n.appendChild(r):n.replaceChild(r,n.querySelector(".vjs-icon-placeholder")),n}handleKeyDown(e){hr.some(t=>l.a.isEventKey(e,t))||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))}}Kt.registerComponent("MenuItem",dr);class pr extends dr{constructor(e,t){const i=t.track,n=e.textTracks();t.label=i.label||i.language||"Unknown",t.selected="showing"===i.mode,super(e,t),this.track=i,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const s=(...e)=>{this.handleTracksChange.apply(this,e)},o=(...e)=>{this.handleSelectedLanguageChange.apply(this,e)};if(e.on(["loadstart","texttrackchange"],s),n.addEventListener("change",s),n.addEventListener("selectedlanguagechange",o),this.on("dispose",(function(){e.off(["loadstart","texttrackchange"],s),n.removeEventListener("change",s),n.removeEventListener("selectedlanguagechange",o)})),void 0===n.onchange){let e;this.on(["tap","click"],(function(){if("object"!==typeof r.a.Event)try{e=new r.a.Event("change")}catch(t){}e||(e=a.a.createEvent("Event"),e.initEvent("change",!0,!0)),n.dispatchEvent(e)}))}this.handleTracksChange()}handleClick(e){const t=this.track,i=this.player_.textTracks();if(super.handleClick(e),i)for(let n=0;n<i.length;n++){const e=i[n];-1!==this.kinds.indexOf(e.kind)&&(e===t?"showing"!==e.mode&&(e.mode="showing"):"disabled"!==e.mode&&(e.mode="disabled"))}}handleTracksChange(e){const t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){if("showing"===this.track.mode){const e=this.player_.cache_.selectedLanguage;if(e&&e.enabled&&e.language===this.track.language&&e.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()}}Kt.registerComponent("TextTrackMenuItem",pr);class fr extends pr{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 i=!0;for(let n=0,r=t.length;n<r;n++){const e=t[n];if(this.options_.kinds.indexOf(e.kind)>-1&&"showing"===e.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let i=!0;for(let n=0,r=t.length;n<r;n++){const e=t[n];if(["captions","descriptions","subtitles"].indexOf(e.kind)>-1&&"showing"===e.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}Kt.registerComponent("OffTextTrackMenuItem",fr);class mr extends cr{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=pr){let i;this.label_&&(i=this.label_+" off"),e.push(new fr(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;const n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let r=0;r<n.length;r++){const i=n[r];if(this.kinds_.indexOf(i.kind)>-1){const n=new t(this.player_,{track:i,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});n.addClass(`vjs-${i.kind}-menu-item`),e.push(n)}}return e}}Kt.registerComponent("TextTrackButton",mr);class gr extends dr{constructor(e,t){const i=t.track,n=t.cue,r=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=n.text,t.selected=n.startTime<=r&&r<n.endTime,super(e,t),this.track=i,this.cue=n}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}}Kt.registerComponent("ChaptersTrackMenuItem",gr);class yr extends mr{constructor(e,t,i){super(e,t,i),this.setIcon("chapters"),this.selectCurrentItem_=()=>{this.items.forEach(e=>{e.selected(this.track_.activeCues[0]===e.cue)})}}buildCSSClass(){return"vjs-chapters-button "+super.buildCSSClass()}buildWrapperCSSClass(){return"vjs-chapters-button "+super.buildWrapperCSSClass()}update(e){if(e&&e.track&&"chapters"!==e.track.kind)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 e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.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 i=e[t];if(i.kind===this.kind_)return i}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize($t(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 i=0,n=t.length;i<n;i++){const n=t[i],r=new gr(this.player_,{track:this.track_,cue:n});e.push(r)}return e}}yr.prototype.kind_="chapters",yr.prototype.controlText_="Chapters",Kt.registerComponent("ChaptersButton",yr);class vr extends mr{constructor(e,t,i){super(e,t,i),this.setIcon("audio-description");const n=e.textTracks(),r=Ct(this,this.handleTracksChange);n.addEventListener("change",r),this.on("dispose",(function(){n.removeEventListener("change",r)}))}handleTracksChange(e){const t=this.player().textTracks();let i=!1;for(let n=0,r=t.length;n<r;n++){const e=t[n];if(e.kind!==this.kind_&&"showing"===e.mode){i=!0;break}}i?this.disable():this.enable()}buildCSSClass(){return"vjs-descriptions-button "+super.buildCSSClass()}buildWrapperCSSClass(){return"vjs-descriptions-button "+super.buildWrapperCSSClass()}}vr.prototype.kind_="descriptions",vr.prototype.controlText_="Descriptions",Kt.registerComponent("DescriptionsButton",vr);class _r extends mr{constructor(e,t,i){super(e,t,i),this.setIcon("subtitles")}buildCSSClass(){return"vjs-subtitles-button "+super.buildCSSClass()}buildWrapperCSSClass(){return"vjs-subtitles-button "+super.buildWrapperCSSClass()}}_r.prototype.kind_="subtitles",_r.prototype.controlText_="Subtitles",Kt.registerComponent("SubtitlesButton",_r);class br extends pr{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()}}Kt.registerComponent("CaptionSettingsMenuItem",br);class Tr extends mr{constructor(e,t,i){super(e,t,i),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 br(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}Tr.prototype.kind_="captions",Tr.prototype.controlText_="Captions",Kt.registerComponent("CaptionsButton",Tr);class Sr extends pr{createEl(e,t,i){const n=super.createEl(e,t,i),r=n.querySelector(".vjs-menu-item-text");return"captions"===this.options_.track.kind&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",n):r.appendChild(Ae("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),r.appendChild(Ae("span",{className:"vjs-control-text",textContent:" "+this.localize("Captions")}))),n}}Kt.registerComponent("SubsCapsMenuItem",Sr);class kr extends mr{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($t(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 br(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,Sr),e}}kr.prototype.kinds_=["captions","subtitles"],kr.prototype.controlText_="Subtitles",Kt.registerComponent("SubsCapsButton",kr);class Er extends dr{constructor(e,t){const i=t.track,n=e.audioTracks();t.label=i.label||i.language||"Unknown",t.selected=i.enabled,super(e,t),this.track=i,this.addClass(`vjs-${i.kind}-menu-item`);const r=(...e)=>{this.handleTracksChange.apply(this,e)};n.addEventListener("change",r),this.on("dispose",()=>{n.removeEventListener("change",r)})}createEl(e,t,i){const n=super.createEl(e,t,i),r=n.querySelector(".vjs-menu-item-text");return["main-desc","description"].indexOf(this.options_.track.kind)>=0&&(r.appendChild(Ae("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),r.appendChild(Ae("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),n}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const e=this.player_.audioTracks();for(let t=0;t<e.length;t++){const i=e[t];i!==this.track&&(i.enabled=i===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}}Kt.registerComponent("AudioTrackMenuItem",Er);class wr extends cr{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 i=0;i<t.length;i++){const n=t[i];e.push(new Er(this.player_,{track:n,selectable:!0,multiSelectable:!1}))}return e}}wr.prototype.controlText_="Audio Track",Kt.registerComponent("AudioTrackButton",wr);class Cr extends dr{constructor(e,t){const i=t.rate,n=parseFloat(i,10);t.label=i,t.selected=n===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=i,this.rate=n,this.on(e,"ratechange",e=>this.update(e))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}Cr.prototype.contentElType="button",Kt.registerComponent("PlaybackRateMenuItem",Cr);class xr extends ur{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",e=>this.updateVisibility(e)),this.on(e,"ratechange",e=>this.updateLabel(e)),this.on(e,"playbackrateschange",e=>this.handlePlaybackRateschange(e))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=Ae("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 i=e.length-1;i>=0;i--)t.push(new Cr(this.player(),{rate:e[i]+"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")}}xr.prototype.controlText_="Playback Rate",Kt.registerComponent("PlaybackRateMenuButton",xr);class Ar extends Kt{buildCSSClass(){return"vjs-spacer "+super.buildCSSClass()}createEl(e="div",t={},i={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,i)}}Kt.registerComponent("Spacer",Ar);class Ir extends Ar{buildCSSClass(){return"vjs-custom-control-spacer "+super.buildCSSClass()}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}}Kt.registerComponent("CustomControlSpacer",Ir);class Or extends Kt{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}Or.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]},Kt.registerComponent("ControlBar",Or);class Pr extends mi{constructor(e,t){super(e,t),this.on(e,"error",e=>{this.open(e)})}buildCSSClass(){return"vjs-error-display "+super.buildCSSClass()}content(){const e=this.player().error();return e?this.localize(e.message):""}}Pr.prototype.options_=Object.assign({},mi.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),Kt.registerComponent("ErrorDisplay",Pr);const Lr="vjs-text-track-settings",Dr=["#000","Black"],Mr=["#00F","Blue"],Rr=["#0FF","Cyan"],Nr=["#0F0","Green"],jr=["#F0F","Magenta"],Br=["#F00","Red"],Ur=["#FFF","White"],Fr=["#FF0","Yellow"],qr=["1","Opaque"],Hr=["0.5","Semi-Transparent"],Vr=["0","Transparent"],zr={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Dr,Ur,Br,Nr,Mr,Fr,jr,Rr]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[qr,Hr,Vr]},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Ur,Dr,Br,Nr,Mr,Fr,jr,Rr]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",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:"captions-font-size-%s",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:e=>"1.00"===e?null:Number(e)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[qr,Hr]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[Vr,Hr,qr]}};function Wr(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}function $r(e,t){const i=e.options[e.options.selectedIndex].value;return Wr(i,t)}function Gr(e,t,i){if(t)for(let n=0;n<e.options.length;n++)if(Wr(e.options[n].value,i)===t){e.selectedIndex=n;break}}zr.windowColor.options=zr.backgroundColor.options;class Xr extends mi{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.endDialog=Ae("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),void 0===t.persistTextTrackSettings&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.on(this.$(".vjs-done-button"),"click",()=>{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),"click",()=>{this.setDefaults(),this.updateDisplay()}),W(zr,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)}),this.options_.persistTextTrackSettings&&this.restoreSettings()}dispose(){this.endDialog=null,super.dispose()}createElSelect_(e,t="",i="label"){const n=zr[e],r=n.id.replace("%s",this.id_),s=[t,r].join(" ").trim(),a="vjs_select_"+pt();return[`<${i} id="${r}"${"label"===i?` for="${a}" class="vjs-label"`:""}>`,this.localize(n.label),`</${i}>`,`<select aria-labelledby="${s}" id="${a}">`].concat(n.options.map(e=>{const t=r+"-"+e[1].replace(/\W+/g,"");return[`<option id="${t}" value="${e[0]}" `,`aria-labelledby="${s} ${t}">`,this.localize(e[1]),"</option>"].join("")})).concat("</select>").join("")}createElFgColor_(){const e="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg vjs-track-setting">',`<legend id="${e}">`,this.localize("Text"),"</legend>",'<span class="vjs-text-color">',this.createElSelect_("color",e),"</span>",'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")}createElBgColor_(){const e="captions-background-"+this.id_;return['<fieldset class="vjs-bg vjs-track-setting">',`<legend id="${e}">`,this.localize("Text Background"),"</legend>",'<span class="vjs-bg-color">',this.createElSelect_("backgroundColor",e),"</span>",'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")}createElWinColor_(){const e="captions-window-"+this.id_;return['<fieldset class="vjs-window vjs-track-setting">',`<legend id="${e}">`,this.localize("Caption Area Background"),"</legend>",'<span class="vjs-window-color">',this.createElSelect_("windowColor",e),"</span>",'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")}createElColors_(){return Ae("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})}createElFont_(){return Ae("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})}createElControls_(){const e=this.localize("restore all settings to the default values");return Ae("div",{className:"vjs-track-settings-controls",innerHTML:[`<button type="button" class="vjs-default-button" title="${e}">`,this.localize("Reset"),`<span class="vjs-control-text"> ${e}</span>`,"</button>",`<button type="button" class="vjs-done-button">${this.localize("Done")}</button>`].join("")})}content(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]}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 $(zr,(e,t,i)=>{const n=$r(this.$(t.selector),t.parser);return void 0!==n&&(e[i]=n),e},{})}setValues(e){W(zr,(t,i)=>{Gr(this.$(t.selector),e[i],t.parser)})}setDefaults(){W(zr,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(r.a.localStorage.getItem(Lr))}catch(t){q.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?r.a.localStorage.setItem(Lr,JSON.stringify(e)):r.a.localStorage.removeItem(Lr)}catch(t){q.warn(t)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}conditionalBlur_(){this.previouslyActiveEl_=null;const e=this.player_.controlBar,t=e&&e.subsCapsButton,i=e&&e.captionsButton;t?t.focus():i&&i.focus()}handleLanguagechange(){this.fill()}}Kt.registerComponent("TextTrackSettings",Xr);class Kr extends Kt{constructor(e,t){let i=t.ResizeObserver||r.a.ResizeObserver;null===t.ResizeObserver&&(i=!1);const n=K({createEl:!i,reportTouchActivity:!1},t);super(e,n),this.ResizeObserver=t.ResizeObserver||r.a.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=At(()=>{this.resizeHandler()},100,!1,this),i?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const e=this.debouncedHandler_;let t=this.unloadListener_=function(){bt(this,"resize",e),bt(this,"unload",t),t=null};_t(this.el_.contentWindow,"unload",t),_t(this.el_.contentWindow,"resize",e)},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()}}Kt.registerComponent("ResizeManager",Kr);const Yr={trackingThreshold:20,liveTolerance:15};class Qr extends Kt{constructor(e,t){const i=K(Yr,t,{createEl:!1});super(e,i),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=e=>this.handlePlay(e),this.handleFirstTimeupdate_=e=>this.handleFirstTimeupdate(e),this.handleSeeked_=e=>this.handleSeeked(e),this.seekToLiveEdge_=e=>this.seekToLiveEdge(e),this.reset_(),this.on(this.player_,"durationchange",e=>this.handleDurationchange(e)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(r.a.performance.now().toFixed(4)),i=-1===this.lastTime_?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+i;const n=this.liveCurrentTime(),s=this.player_.currentTime();let a=this.player_.paused()||this.seekedBehindLive_||Math.abs(n-s)>this.options_.liveTolerance;this.timeupdateSeen_&&n!==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_,wt),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 i=e?e.length:0;while(i--)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;while(i--)t.push(e.start(i));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-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return"number"===typeof this.trackingInterval_}seekToLiveEdge(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}Kt.registerComponent("LiveTracker",Qr);class Jr extends Kt{constructor(e,t){super(e,t),this.on("statechanged",e=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:Ae("div",{className:"vjs-title-bar-title",id:"vjs-title-bar-title-"+pt()}),description:Ae("div",{className:"vjs-title-bar-description",id:"vjs-title-bar-description-"+pt()})},Ae("div",{className:"vjs-title-bar"},{},Y(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,i={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(e=>{const n=this.state[e],r=this.els[e],s=i[e];$e(r),n&&Ie(r,n),t&&(t.removeAttribute(s),n&&t.setAttribute(s,r.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}}Kt.registerComponent("TitleBar",Jr);const Zr=e=>{const t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;const i=e.$$("source"),n=[];let r="";if(!i.length)return!1;for(let s=0;s<i.length;s++){const e=i[s].src;e&&-1===n.indexOf(e)&&n.push(e)}return!!n.length&&(1===n.length&&(r=n[0]),e.triggerSourceset(r),!0)},es=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(e){const t=a.a.createElement(this.nodeName.toLowerCase());t.innerHTML=e;const i=a.a.createDocumentFragment();while(t.childNodes.length)i.appendChild(t.childNodes[0]);return this.innerText="",r.a.Element.prototype.appendChild.call(this,i),this.innerHTML}}),ts=(e,t)=>{let i={};for(let n=0;n<e.length;n++)if(i=Object.getOwnPropertyDescriptor(e[n],t),i&&i.set&&i.get)break;return i.enumerable=!0,i.configurable=!0,i},is=e=>ts([e.el(),r.a.HTMLMediaElement.prototype,r.a.Element.prototype,es],"innerHTML"),ns=function(e){const t=e.el();if(t.resetSourceWatch_)return;const i={},n=is(e),r=i=>(...n)=>{const r=i.apply(t,n);return Zr(e),r};["append","appendChild","insertAdjacentHTML"].forEach(e=>{t[e]&&(i[e]=t[e],t[e]=r(i[e]))}),Object.defineProperty(t,"innerHTML",K(n,{set:r(n.set)})),t.resetSourceWatch_=()=>{t.resetSourceWatch_=null,Object.keys(i).forEach(e=>{t[e]=i[e]}),Object.defineProperty(t,"innerHTML",n)},e.one("sourceset",t.resetSourceWatch_)},rs=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?Oi(r.a.Element.prototype.getAttribute.call(this,"src")):""},set(e){return r.a.Element.prototype.setAttribute.call(this,"src",e),e}}),ss=e=>ts([e.el(),r.a.HTMLMediaElement.prototype,rs],"src"),as=function(e){if(!e.featuresSourceset)return;const t=e.el();if(t.resetSourceset_)return;const i=ss(e),n=t.setAttribute,r=t.load;Object.defineProperty(t,"src",K(i,{set:n=>{const r=i.set.call(t,n);return e.triggerSourceset(t.src),r}})),t.setAttribute=(i,r)=>{const s=n.call(t,i,r);return/src/i.test(i)&&e.triggerSourceset(t.src),s},t.load=()=>{const i=r.call(t);return Zr(e)||(e.triggerSourceset(""),ns(e)),i},t.currentSrc?e.triggerSourceset(t.currentSrc):Zr(e)||ns(e),t.resetSourceset_=()=>{t.resetSourceset_=null,t.load=r,t.setAttribute=n,Object.defineProperty(t,"src",i),t.resetSourceWatch_&&t.resetSourceWatch_()}};class os extends zi{constructor(e,t){super(e,t);const i=e.source;let n=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&"VIDEO"===this.el_.tagName,i&&(this.el_.currentSrc!==i.src||e.tag&&3===e.tag.initNetworkState_)?this.setSource(i):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const e=this.el_.childNodes;let t=e.length;const i=[];while(t--){const r=e[t],s=r.nodeName.toLowerCase();"track"===s&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(r),this.remoteTextTracks().addTrack(r.track),this.textTracks().addTrack(r.track),n||this.el_.hasAttribute("crossorigin")||!Li(r.src)||(n=!0)):i.push(r))}for(let n=0;n<i.length;n++)this.el_.removeChild(i[n])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&n&&q.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."),this.restoreMetadataTracksInIOSNativePlayer_(),(ye||pe)&&!0===e.nativeControlsForTouch&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),os.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){as(this)}restoreMetadataTracksInIOSNativePlayer_(){const e=this.textTracks();let t;const i=()=>{t=[];for(let i=0;i<e.length;i++){const n=e[i];"metadata"===n.kind&&t.push({track:n,storedMode:n.mode})}};i(),e.addEventListener("change",i),this.on("dispose",()=>e.removeEventListener("change",i));const n=()=>{for(let e=0;e<t.length;e++){const i=t[e];"disabled"===i.track.mode&&i.track.mode!==i.storedMode&&(i.track.mode=i.storedMode)}e.removeEventListener("change",n)};this.on("webkitbeginfullscreen",()=>{e.removeEventListener("change",i),e.removeEventListener("change",n),e.addEventListener("change",n)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",i),e.addEventListener("change",i),e.removeEventListener("change",n)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const i=e.toLowerCase();this[i+"TracksListeners_"]&&Object.keys(this[i+"TracksListeners_"]).forEach(e=>{const t=this.el()[i+"Tracks"];t.removeEventListener(e,this[i+"TracksListeners_"][e])}),this[`featuresNative${e}Tracks`]=!t,this[i+"TracksListeners_"]=null,this.proxyNativeTracksForType_(i)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=Fi[e],i=this.el()[t.getterName],n=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!i||!i.addEventListener)return;const r={change:t=>{const i={type:"change",target:n,currentTarget:n,srcElement:n};n.trigger(i),"text"===e&&this[qi.remoteText.getterName]().trigger(i)},addtrack(e){n.addTrack(e.track)},removetrack(e){n.removeTrack(e.track)}},s=function(){const e=[];for(let t=0;t<n.length;t++){let r=!1;for(let e=0;e<i.length;e++)if(i[e]===n[t]){r=!0;break}r||e.push(n[t])}while(e.length)n.removeTrack(e.shift())};this[t.getterName+"Listeners_"]=r,Object.keys(r).forEach(e=>{const t=r[e];i.addEventListener(e,t),this.on("dispose",n=>i.removeEventListener(e,t))}),this.on("loadstart",s),this.on("dispose",e=>this.off("loadstart",s))}proxyNativeTracks_(){Fi.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){const t=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(t,e),os.disposeMediaElement(e),e=t}else{e=a.a.createElement("video");const t=this.options_.tag&&Ne(this.options_.tag),i=K({},t);ye&&!0===this.options_.nativeControlsForTouch||delete i.controls,Re(e,Object.assign(i,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}"undefined"!==typeof this.options_.preload&&Be(e,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let i=0;i<t.length;i++){const n=t[i],r=this.options_[n];"undefined"!==typeof r&&(r?Be(e,n,n):Ue(e,n),e[n]=r)}return e}handleLateInit_(e){if(0===e.networkState||3===e.networkState)return;if(0===e.readyState){let e=!1;const t=function(){e=!0};this.on("loadstart",t);const i=function(){e||this.trigger("loadstart")};return this.on("loadedmetadata",i),void this.ready((function(){this.off("loadstart",t),this.off("loadedmetadata",i),e||this.trigger("loadstart")}))}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(e){this.trigger(e)}),this)}))}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&be?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){q(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&ie&&ae&&0===this.el_.currentTime){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_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(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"function"===typeof this.el_.webkitEnterFullScreen}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)ui(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(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))}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(void 0===e)return this.el_.src;this.setSrc(e)}reset(){os.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,i):super.addTextTrack(e,t,i)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=a.a.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 i=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(i),i}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let i=t.length;while(i--)e!==t[i]&&e!==t[i].track||this.el().removeChild(t[i])}}getVideoPlaybackQuality(){if("function"===typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();const e={};return"undefined"!==typeof this.el().webkitDroppedFrameCount&&"undefined"!==typeof this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),r.a.performance&&(e.creationTime=r.a.performance.now()),e}}Q(os,"TEST_VID",(function(){if(!Ee())return;const e=a.a.createElement("video"),t=a.a.createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e})),os.isSupported=function(){try{os.TEST_VID.volume=.5}catch(e){return!1}return!(!os.TEST_VID||!os.TEST_VID.canPlayType)},os.canPlayType=function(e){return os.TEST_VID.canPlayType(e)},os.canPlaySource=function(e,t){return os.canPlayType(e.type)},os.canControlVolume=function(){try{const e=os.TEST_VID.volume;os.TEST_VID.volume=e/2+.1;const t=e!==os.TEST_VID.volume;return t&&_e?(r.a.setTimeout(()=>{os&&os.prototype&&(os.prototype.featuresVolumeControl=e!==os.TEST_VID.volume)}),!1):t}catch(e){return!1}},os.canMuteVolume=function(){try{const e=os.TEST_VID.muted;return os.TEST_VID.muted=!e,os.TEST_VID.muted?Be(os.TEST_VID,"muted","muted"):Ue(os.TEST_VID,"muted","muted"),e!==os.TEST_VID.muted}catch(e){return!1}},os.canControlPlaybackRate=function(){if(ie&&ae&&le<58)return!1;try{const e=os.TEST_VID.playbackRate;return os.TEST_VID.playbackRate=e/2+.1,e!==os.TEST_VID.playbackRate}catch(e){return!1}},os.canOverrideAttributes=function(){try{const e=()=>{};Object.defineProperty(a.a.createElement("video"),"src",{get:e,set:e}),Object.defineProperty(a.a.createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(a.a.createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(a.a.createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},os.supportsNativeTextTracks=function(){return be||_e&&ae},os.supportsNativeVideoTracks=function(){return!(!os.TEST_VID||!os.TEST_VID.videoTracks)},os.supportsNativeAudioTracks=function(){return!(!os.TEST_VID||!os.TEST_VID.audioTracks)},os.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"]].forEach((function([e,t]){Q(os.prototype,e,()=>os[t](),!0)})),os.prototype.featuresVolumeControl=os.canControlVolume(),os.prototype.movingMediaElementInDOM=!_e,os.prototype.featuresFullscreenResize=!0,os.prototype.featuresProgressEvents=!0,os.prototype.featuresTimeupdateEvents=!0,os.prototype.featuresVideoFrameCallback=!(!os.TEST_VID||!os.TEST_VID.requestVideoFrameCallback),os.disposeMediaElement=function(e){if(e){e.parentNode&&e.parentNode.removeChild(e);while(e.hasChildNodes())e.removeChild(e.firstChild);e.removeAttribute("src"),"function"===typeof e.load&&function(){try{e.load()}catch(t){}}()}},os.resetMediaElement=function(e){if(!e)return;const t=e.querySelectorAll("source");let i=t.length;while(i--)e.removeChild(t[i]);e.removeAttribute("src"),"function"===typeof e.load&&function(){try{e.load()}catch(t){}}()},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(e){os.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}})),["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(e){os.prototype["set"+$t(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}})),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach((function(e){os.prototype[e]=function(){return this.el_[e]}})),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach((function(e){os.prototype["set"+$t(e)]=function(t){this.el_[e]=t}})),["pause","load","play"].forEach((function(e){os.prototype[e]=function(){return this.el_[e]()}})),zi.withSourceHandlers(os),os.nativeSourceHandler={},os.nativeSourceHandler.canPlayType=function(e){try{return os.TEST_VID.canPlayType(e)}catch(t){return""}},os.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return os.nativeSourceHandler.canPlayType(e.type);if(e.src){const t=Pi(e.src);return os.nativeSourceHandler.canPlayType("video/"+t)}return""},os.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)},os.nativeSourceHandler.dispose=function(){},os.registerSourceHandler(os.nativeSourceHandler),zi.registerTech("Html5",os);const ls=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],us={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},cs=["tiny","xsmall","small","medium","large","xlarge","huge"],hs={};cs.forEach(e=>{const t="x"===e.charAt(0)?"x-"+e.substring(1):e;hs[e]="vjs-layout-"+t});const ds={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class ps extends Kt{constructor(e,t,i){if(e.id=e.id||t.id||"vjs_video_"+pt(),t=Object.assign(ps.getTagSettings(e),t),t.initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const i=e.closest("[lang]");i&&(t.language=i.getAttribute("lang"))}if(super(null,t,i),this.boundDocumentFullscreenChange_=e=>this.documentFullscreenChange_(e),this.boundFullWindowOnEscKey_=e=>this.fullWindowOnEscKey(e),this.boundUpdateStyleEl_=e=>this.updateStyleEl_(e),this.boundApplyInitTime_=e=>this.applyInitTime_(e),this.boundUpdateCurrentBreakpoint_=e=>this.updateCurrentBreakpoint_(e),this.boundHandleTechClick_=e=>this.handleTechClick_(e),this.boundHandleTechDoubleClick_=e=>this.handleTechDoubleClick_(e),this.boundHandleTechTouchStart_=e=>this.handleTechTouchStart_(e),this.boundHandleTechTouchMove_=e=>this.handleTechTouchMove_(e),this.boundHandleTechTouchEnd_=e=>this.handleTechTouchEnd_(e),this.boundHandleTechTap_=e=>this.handleTechTap_(e),this.isFullscreen_=!1,this.log=H(this.id_),this.fsApi_=M,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_={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&&Ne(e),this.language(this.options_.language),t.languages){const e={};Object.getOwnPropertyNames(t.languages).forEach((function(i){e[i.toLowerCase()]=t.languages[i]})),this.languages_=e}else this.languages_=ps.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(e=>{if("function"!==typeof this[e])throw new Error(`plugin "${e}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),Ht(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(_t(a.a,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const n=K(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(e=>{this[e](t.plugins[e])}),t.debug&&this.debug(!0),this.options_.playerOptions=n,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const e=new r.a.DOMParser,t=e.parseFromString(fn,"image/svg+xml"),i=t.querySelector("parsererror");if(i)q.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const e=t.documentElement;e.style.display="none",this.el_.appendChild(e),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio("audio"===e.nodeName.toLowerCase()),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"),ye&&this.addClass("vjs-touch-enabled"),_e||this.addClass("vjs-workinghover"),ps.players[this.id_]=this;const s=A.split(".")[0];this.addClass("vjs-v"+s),this.userActive(!0),this.reportUserActivity(),this.one("play",e=>this.listenForUserActivity_(e)),this.on("keydown",e=>this.handleKeyDown(e)),this.on("languagechange",e=>this.handleLanguagechange(e)),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"),bt(a.a,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),bt(a.a,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),ps.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),an(this),Hi.names.forEach(e=>{const t=Hi[e],i=this[t.getterName]();i&&i.off&&i.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e,t=this.tag,i=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player");const n="video-js"===this.tag.tagName.toLowerCase();i?e=this.el_=t.parentNode:n||(e=this.el_=super.createEl("div"));const s=Ne(t);if(n){e=this.el_=t,t=this.tag=a.a.createElement("video");while(e.children.length)t.appendChild(e.firstChild);Pe(e,"video-js")||Le(e,"video-js"),e.appendChild(t),i=this.playerElIngest_=e,Object.keys(e).forEach(i=>{try{t[i]=e[i]}catch(n){}})}t.setAttribute("tabindex","-1"),s.tabindex="-1",ae&&he&&(t.setAttribute("role","application"),s.role="application"),t.removeAttribute("width"),t.removeAttribute("height"),"width"in s&&delete s.width,"height"in s&&delete s.height,Object.getOwnPropertyNames(s).forEach((function(i){n&&"class"===i||e.setAttribute(i,s[i]),n&&t.setAttribute(i,s[i])})),t.playerId=t.id,t.id+="_html5_api",t.className="vjs-tech",t.player=e.player=this,this.addClass("vjs-paused");const o=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE"].filter(e=>Te[e]).map(e=>"vjs-device-"+e.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...o),!0!==r.a.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=ot("vjs-styles-dimensions");const e=Qe(".vjs-styles-defaults"),t=Qe("head");t.insertBefore(this.styleEl_,e?e.nextSibling:t.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 l=t.getElementsByTagName("a");for(let r=0;r<l.length;r++){const e=l.item(r);Le(e,"vjs-hidden"),e.setAttribute("hidden","hidden")}return t.initNetworkState_=t.networkState,t.parentNode&&!i&&t.parentNode.insertBefore(e,t),Oe(t,e),this.children_.unshift(t),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=e,e}crossOrigin(e){if("undefined"===typeof e)return this.techGet_("crossOrigin");null===e||"anonymous"===e||"use-credentials"===e?(this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)):q.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const i=e+"_";if(void 0===t)return this[i]||0;if(""===t||"auto"===t)return this[i]=void 0,void this.updateStyleEl_();const n=parseFloat(t);isNaN(n)?q.error(`Improper value "${t}" supplied for for ${e}`):(this[i]=n,this.updateStyleEl_())}fluid(e){if(void 0===e)return!!this.fluid_;this.fluid_=!!e,Dt(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),Mt(this,()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(void 0===e)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(!0===r.a.VIDEOJS_NO_DYNAMIC_STYLE){const e="number"===typeof this.width_?this.width_:this.options_.width,t="number"===typeof this.height_?this.height_:this.options_.height,i=this.tech_&&this.tech_.el();return void(i&&(e>=0&&(i.width=e),t>=0&&(i.height=t)))}let e,t,i,n;i=void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9";const s=i.split(":"),a=s[1]/s[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/a:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*a,n=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(n),lt(this.styleEl_,`\n .${n} {\n width: ${e}px;\n height: ${t}px;\n }\n\n .${n}.vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: ${100*a}%;\n }\n `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const i=$t(e),n=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==i&&this.tag&&(zi.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,this.isReady_=!1;let r=this.autoplay();("string"===typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(r=!1);const s={source:t,autoplay:r,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${n}_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};Hi.names.forEach(e=>{const t=Hi[e];s[t.getterName]=this[t.privateName]}),Object.assign(s,this.options_[i]),Object.assign(s,this.options_[n]),Object.assign(s,this.options_[e.toLowerCase()]),this.tag&&(s.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(s.startTime=this.cache_.currentTime);const a=zi.getTech(e);if(!a)throw new Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`);this.tech_=new a(s),this.tech_.ready(Ct(this,this.handleTechReady_),!0),pi.jsonToTextTracks(this.textTracksJson_||[],this.tech_),ls.forEach(e=>{this.on(this.tech_,e,t=>this[`handleTech${$t(e)}_`](t))}),Object.keys(us).forEach(e=>{this.on(this.tech_,e,t=>{0===this.tech_.playbackRate()&&this.tech_.seeking()?this.queuedCallbacks_.push({callback:this[`handleTech${us[e]}_`].bind(this),event:t}):this[`handleTech${us[e]}_`](t)})}),this.on(this.tech_,"loadstart",e=>this.handleTechLoadStart_(e)),this.on(this.tech_,"sourceset",e=>this.handleTechSourceset_(e)),this.on(this.tech_,"waiting",e=>this.handleTechWaiting_(e)),this.on(this.tech_,"ended",e=>this.handleTechEnded_(e)),this.on(this.tech_,"seeking",e=>this.handleTechSeeking_(e)),this.on(this.tech_,"play",e=>this.handleTechPlay_(e)),this.on(this.tech_,"pause",e=>this.handleTechPause_(e)),this.on(this.tech_,"durationchange",e=>this.handleTechDurationChange_(e)),this.on(this.tech_,"fullscreenchange",(e,t)=>this.handleTechFullscreenChange_(e,t)),this.on(this.tech_,"fullscreenerror",(e,t)=>this.handleTechFullscreenError_(e,t)),this.on(this.tech_,"enterpictureinpicture",e=>this.handleTechEnterPictureInPicture_(e)),this.on(this.tech_,"leavepictureinpicture",e=>this.handleTechLeavePictureInPicture_(e)),this.on(this.tech_,"error",e=>this.handleTechError_(e)),this.on(this.tech_,"posterchange",e=>this.handleTechPosterChange_(e)),this.on(this.tech_,"textdata",e=>this.handleTechTextData_(e)),this.on(this.tech_,"ratechange",e=>this.handleTechRateChange_(e)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===i&&this.tag||Oe(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){Hi.names.forEach(e=>{const t=Hi[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=pi.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 void 0===e&&q.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_}version(){return{"video.js":A}}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_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||"string"!==typeof e)return;const t=()=>{const e=this.muted();this.muted(!0);const t=()=>{this.muted(e)};this.playTerminatedQueue_.push(t);const i=this.play();if(li(i))return i.catch(e=>{throw t(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(e||""))})};let i;return"any"!==e||this.muted()?i="muted"!==e||this.muted()?this.play():t():(i=this.play(),li(i)&&(i=i.catch(t))),li(i)?i.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})}):void 0}updateSourceCaches_(e=""){let t=e,i="";"string"!==typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=hn(this,t)),this.cache_.source=K({},e,{src:t,type:i});const n=this.cache_.sources.filter(e=>e.src&&e.src===t),r=[],s=this.$$("source"),a=[];for(let o=0;o<s.length;o++){const e=Ne(s[o]);r.push(e),e.src&&e.src===t&&a.push(e.src)}a.length&&!n.length?this.cache_.sources=r:n.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=e=>this.updateSourceCaches_(e);const i=this.currentSource().src,n=e.src;i&&!/^blob:/.test(i)&&/^blob:/.test(n)&&(!this.lastSource_||this.lastSource_.tech!==n&&this.lastSource_.player!==i)&&(t=()=>{}),t(n),e.src||this.tech_.any(["sourceset","loadstart"],e=>{if("sourceset"===e.type)return;const t=this.techGet_("currentSrc");this.lastSource_.tech=t,this.updateSourceCaches_(t)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(void 0===e)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&&0===this.cache_.lastPlaybackRate&&(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")}handleTechSeeked_(){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_&&(void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.click&&!1===this.options_.userActions.click||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"===typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?ui(this.play()):this.pause()))}handleTechDoubleClick_(e){if(!this.controls_)return;const t=Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),t=>t.contains(e.target));t||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"===typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):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 i=this.el();let n=a.a[this.fsApi_.fullscreenElement]===i;!n&&i.matches&&(n=i.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(n)}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 tn)return Ji(this.middleware_,this.tech_,e,t);if(e in nn)return Zi(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(i){throw q(i),i}}),!0)}techGet_(e){if(this.tech_&&this.tech_.isReady_){if(e in en)return Qi(this.middleware_,this.tech_,e);if(e in nn)return Zi(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw q(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t;if("TypeError"===t.name)throw q(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t;throw q(t),t}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=ui){this.playCallbacks_.push(e);const t=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc())),i=Boolean(be||_e);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t)return this.waitToPlay_=e=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(!t&&i&&this.load());const n=this.techGet_("play"),r=i&&this.hasClass("vjs-ended");r&&this.resetProgressBar_(),null===n?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(n)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach((function(e){e()}))}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach((function(t){t(e)}))}pause(){this.techCall_("pause")}paused(){return!1!==this.techGet_("paused")}played(){return this.techGet_("played")||Zt(0,0)}scrubbing(e){if("undefined"===typeof e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){return void 0===e?(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime):(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),this.cache_.initTime=0,void(isFinite(e)&&(this.cache_.currentTime=Number(e)))):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_)))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(void 0===e)return void 0!==this.cache_.duration?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=Zt(0,0)),e}seekable(){let e=this.techGet_("seekable");return e&&e.length||(e=Zt(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 ai(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let i=e.end(e.length-1);return i>t&&(i=t),i}volume(e){let t;return void 0!==e?(t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)}muted(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)}defaultMuted(e){return void 0!==e&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(void 0!==e){const t=this.isFullscreen_;return this.isFullscreen_=Boolean(e),this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise((i,n)=>{function r(){t.off("fullscreenerror",a),t.off("fullscreenchange",s)}function s(){r(),i()}function a(e,t){r(),n(t)}t.one("fullscreenchange",s),t.one("fullscreenerror",a);const o=t.requestFullscreenHelper_(e);o&&(o.then(r,r),o.then(i,n))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(t=e)),this.fsApi_.requestFullscreen){const e=this.el_[this.fsApi_.requestFullscreen](t);return e&&e.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),e}this.tech_.supportsFullScreen()&&!0===!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,i)=>{function n(){e.off("fullscreenerror",s),e.off("fullscreenchange",r)}function r(){n(),t()}function s(e,t){n(),i(t)}e.one("fullscreenchange",r),e.one("fullscreenerror",s);const a=e.exitFullscreenHelper_();a&&(a.then(n,n),a.then(t,i))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=a.a[this.fsApi_.exitFullscreen]();return e&&ui(e.then(()=>this.isFullscreen(!1))),e}this.tech_.supportsFullScreen()&&!0===!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=a.a.documentElement.style.overflow,_t(a.a,"keydown",this.boundFullWindowOnEscKey_),a.a.documentElement.style.overflow="hidden",Le(a.a.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){l.a.isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,bt(a.a,"keydown",this.boundFullWindowOnEscKey_),a.a.documentElement.style.overflow=this.docOrigOverflow,De(a.a.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&r.a.documentPictureInPicture){const e=a.a.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(Ae("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),r.a.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(et(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",t=>{const i=t.target.querySelector(".video-js");e.parentNode.replaceChild(i,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in a.a&&!1===this.disablePictureInPicture()?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){return r.a.documentPictureInPicture&&r.a.documentPictureInPicture.window?(r.a.documentPictureInPicture.window.close(),Promise.resolve()):"pictureInPictureEnabled"in a.a?a.a.exitPictureInPicture():void 0}handleKeyDown(e){const{userActions:t}=this.options_;if(!t||!t.hotkeys)return;const i=e=>{const t=e.tagName.toLowerCase();if(e.isContentEditable)return!0;const i=["button","checkbox","hidden","radio","reset","submit"];if("input"===t)return-1===i.indexOf(e.type);const n=["textarea"];return-1!==n.indexOf(t)};i(this.el_.ownerDocument.activeElement)||("function"===typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:i=(e=>l.a.isEventKey(e,"f")),muteKey:n=(e=>l.a.isEventKey(e,"m")),playPauseKey:r=(e=>l.a.isEventKey(e,"k")||l.a.isEventKey(e,"Space"))}=t;if(i.call(this,e)){e.preventDefault(),e.stopPropagation();const t=Kt.getComponent("FullscreenToggle");!1!==a.a[this.fsApi_.fullscreenEnabled]&&t.prototype.handleClick.call(this,e)}else if(n.call(this,e)){e.preventDefault(),e.stopPropagation();const t=Kt.getComponent("MuteToggle");t.prototype.handleClick.call(this,e)}else if(r.call(this,e)){e.preventDefault(),e.stopPropagation();const t=Kt.getComponent("PlayToggle");t.prototype.handleClick.call(this,e)}}canPlayType(e){let t;for(let i=0,n=this.options_.techOrder;i<n.length;i++){const r=n[i];let s=zi.getTech(r);if(s||(s=Kt.getComponent(r)),s){if(s.isSupported()&&(t=s.canPlayType(e),t))return t}else q.error(`The "${r}" tech is undefined. Skipped browser support check for that tech.`)}return""}selectSource(e){const t=this.options_.techOrder.map(e=>[e,zi.getTech(e)]).filter(([e,t])=>t?t.isSupported():(q.error(`The "${e}" tech is undefined. Skipped browser support check for that tech.`),!1)),i=function(e,t,i){let n;return e.some(e=>t.some(t=>{if(n=i(e,t),n)return!0})),n};let n;const r=e=>(t,i)=>e(i,t),s=([e,t],i)=>{if(t.canPlaySource(i,this.options_[e.toLowerCase()]))return{source:i,tech:e}};return n=this.options_.sourceOrder?i(e,t,r(s)):i(t,e,s),n||!1}handleSrc_(e,t){if("undefined"===typeof e)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const i=dn(e);if(i.length){if(this.changingSrc_=!0,t||(this.cache_.sources=i),this.updateSourceCaches_(i[0]),Ki(this,i[0],(e,n)=>{this.middleware_=n,t||(this.cache_.sources=i),this.updateSourceCaches_(e);const r=this.src_(e);if(r)return i.length>1?this.handleSrc_(i.slice(1)):(this.changingSrc_=!1,this.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage})}),0),void this.triggerReady());Yi(n,this.tech_)}),i.length>1){const e=()=>{this.error(null),this.handleSrc_(i.slice(1),!0)},t=()=>{this.off("error",e)};this.one("error",e),this.one("playing",t),this.resetRetryOnError_=()=>{this.off("error",e),this.off("playing",t)}}}else this.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage})}),0)}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return!t||(Gt(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))}load(){this.tech_&&this.tech_.vhs?this.src(this.currentSource()):this.techCall_("load")}reset(){if(this.paused())this.doReset_();else{const e=this.play();ui(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}),Dt(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:i,remainingTimeDisplay:n}=this.controlBar||{},{seekBar:r}=i||{};e&&e.updateContent(),t&&t.updateContent(),n&&n.updateContent(),r&&(r.update(),r.loadProgressBar&&r.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&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){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")}autoplay(e){if(void 0===e)return this.options_.autoplay||!1;let t;"string"===typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"===typeof e?e:"play"),t=!1):this.options_.autoplay=!!e,t="undefined"===typeof t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return void 0!==e&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")}poster(e){if(void 0===e)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(void 0===e)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(void 0===e)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(void 0===e)return this.error_||null;if(O("beforeerror").forEach(t=>{const i=t(this,e);G(i)&&!Array.isArray(i)||"string"===typeof i||"number"===typeof i||null===i?e=i:this.log.error("please return a value that MediaError expects in beforeerror hooks")}),this.options_.suppressNotSupportedError&&e&&4===e.code){const t=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),void this.one("loadstart",(function(){this.off(["click","touchstart"],t)}))}if(null===e)return this.error_=null,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new oi(e),this.addClass("vjs-error"),q.error(`(CODE:${this.error_.code} ${oi.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),O("error").forEach(e=>e(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(void 0===e)return this.userActive_;if(e=!!e,e!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",(function(e){e.stopPropagation(),e.preventDefault()})),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,i;const n=Ct(this,this.reportUserActivity),r=function(e){e.screenX===t&&e.screenY===i||(t=e.screenX,i=e.screenY,n())},s=function(){n(),this.clearInterval(e),e=this.setInterval(n,250)},a=function(t){n(),this.clearInterval(e)};this.on("mousedown",s),this.on("mousemove",r),this.on("mouseup",a),this.on("mouseleave",a);const o=this.getChild("controlBar");let l;!o||_e||ie||(o.on("mouseenter",(function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0})),o.on("mouseleave",(function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout}))),this.on("keydown",n),this.on("keyup",n);const u=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(l);const e=this.options_.inactivityTimeout;e<=0||(l=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),e))};this.setInterval(u,250)}playbackRate(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)}defaultPlaybackRate(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),i=t&&t.currentHeight();e.forEach(e=>{e!==t&&e.el_&&!e.hasClass("vjs-hidden")&&(e.hide(),this.audioOnlyCache_.hiddenChildren.push(e))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(i),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if("boolean"!==typeof e||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const e=[];return this.isInPictureInPicture()&&e.push(this.exitPictureInPicture()),this.isFullscreen()&&e.push(this.exitFullscreen()),this.audioPosterMode()&&e.push(this.audioPosterMode(!1)),Promise.all(e).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){const e=this.tech_&&this.tech_;e.hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){const e=this.tech_&&this.tech_;e.show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){if("boolean"!==typeof e||e===this.audioPosterMode_)return this.audioPosterMode_;if(this.audioPosterMode_=e,e){if(this.audioOnlyMode()){const e=this.audioOnlyMode(!1);return e.then(()=>{this.enablePosterModeUI_()})}return Promise.resolve().then(()=>{this.enablePosterModeUI_()})}return Promise.resolve().then(()=>{this.disablePosterModeUI_()})}addTextTrack(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)}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(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),Dt(this)&&this.trigger("languagechange"))}languages(){return K(ps.prototype.options_.languages,this.languages_)}toJSON(){const e=K(this.options_),t=e.tracks;e.tracks=[];for(let i=0;i<t.length;i++){let n=t[i];n=K(n),n.player=void 0,e.tracks[i]=n}return e}createModal(e,t){t=t||{},t.content=e||"";const i=new mi(this,t);return this.addChild(i),i.on("dispose",()=>{this.removeChild(i)}),i.open(),i}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let i=0;i<cs.length;i++){const n=cs[i],r=this.breakpoints_[n];if(t<=r){if(e===n)return;e&&this.removeClass(hs[e]),this.addClass(hs[n]),this.breakpoint_=n;break}}}removeCurrentBreakpoint_(){const e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return void 0===e||(this.breakpoint_="",this.breakpoints_=Object.assign({},ds,e),this.updateCurrentBreakpoint_()),Object.assign(this.breakpoints_)}responsive(e){if(void 0===e)return this.responsive_;e=Boolean(e);const t=this.responsive_;return e!==t?(this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return hs[this.breakpoint_]||""}loadMedia(e,t){if(!e||"object"!==typeof e)return;const i=this.crossOrigin();this.reset(),this.cache_.media=K(e);const{artist:n,artwork:r,description:s,poster:a,src:o,textTracks:l,title:u}=this.cache_.media;!r&&a&&(this.cache_.media.artwork=[{src:a,type:cn(a)}]),i&&this.crossOrigin(i),o&&this.src(o),a&&this.poster(a),Array.isArray(l)&&l.forEach(e=>this.addRemoteTextTrack(e,!1)),this.titleBar&&this.titleBar.update({title:u,description:s||n||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t=this.currentSources(),i=Array.prototype.map.call(this.remoteTextTracks(),e=>({kind:e.kind,label:e.label,language:e.language,src:e.src})),n={src:t,textTracks:i};return e&&(n.poster=e,n.artwork=[{src:n.poster,type:cn(n.poster)}]),n}return K(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},i=Ne(e),n=i["data-setup"];if(Pe(e,"vjs-fill")&&(i.fill=!0),Pe(e,"vjs-fluid")&&(i.fluid=!0),null!==n){const[e,t]=c()(n||"{}");e&&q.error(e),Object.assign(i,t)}if(Object.assign(t,i),e.hasChildNodes()){const i=e.childNodes;for(let e=0,n=i.length;e<n;e++){const n=i[e],r=n.nodeName.toLowerCase();"source"===r?t.sources.push(Ne(n)):"track"===r&&t.tracks.push(Ne(n))}}return t}debug(e){if(void 0===e)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(void 0===e)return this.cache_.playbackRates;Array.isArray(e)&&e.every(e=>"number"===typeof e)&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}Hi.names.forEach((function(e){const t=Hi[e];ps.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}})),ps.prototype.crossorigin=ps.prototype.crossOrigin,ps.players={};const fs=r.a.navigator;ps.prototype.options_={techOrder:zi.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:fs&&(fs.languages&&fs.languages[0]||fs.userLanguage||fs.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,enableSmoothSeeking:!1},ls.forEach((function(e){ps.prototype[`handleTech${$t(e)}_`]=function(){return this.trigger(e)}})),Kt.registerComponent("Player",ps);const ms="plugin",gs="activePlugins_",ys={},vs=e=>ys.hasOwnProperty(e),_s=e=>vs(e)?ys[e]:void 0,bs=(e,t)=>{e[gs]=e[gs]||{},e[gs][t]=!0},Ts=(e,t,i)=>{const n=(i?"before":"")+"pluginsetup";e.trigger(n,t),e.trigger(n+":"+t.name,t)},Ss=function(e,t){const i=function(){Ts(this,{name:e,plugin:t,instance:null},!0);const i=t.apply(this,arguments);return bs(this,e),Ts(this,{name:e,plugin:t,instance:i}),i};return Object.keys(t).forEach((function(e){i[e]=t[e]})),i},ks=(e,t)=>(t.prototype.name=e,function(...i){Ts(this,{name:e,plugin:t,instance:null},!0);const n=new t(...[this,...i]);return this[e]=()=>n,Ts(this,n.getEventHash()),n});class Es{constructor(e){if(this.constructor===Es)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),Ht(this),delete this.trigger,zt(this,this.constructor.defaultState),bs(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 Tt(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[gs][e]=!1,this.player=this.state=null,t[e]=ks(e,ys[e])}static isBasic(e){const t="string"===typeof e?_s(e):e;return"function"===typeof t&&!Es.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if("string"!==typeof e)throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(vs(e))q.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(ps.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if("function"!==typeof t)throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return ys[e]=t,e!==ms&&(Es.isBasic(t)?ps.prototype[e]=Ss(e,t):ps.prototype[e]=ks(e,t)),t}static deregisterPlugin(e){if(e===ms)throw new Error("Cannot de-register base plugin.");vs(e)&&(delete ys[e],delete ps.prototype[e])}static getPlugins(e=Object.keys(ys)){let t;return e.forEach(e=>{const i=_s(e);i&&(t=t||{},t[e]=i)}),t}static getPluginVersion(e){const t=_s(e);return t&&t.VERSION||""}}function ws(e,t){let i=!1;return function(...n){return i||q.warn(e),i=!0,t.apply(this,n)}}function Cs(e,t,i,n){return ws(`${t} is deprecated and will be removed in ${e}.0; please use ${i} instead.`,n)}Es.getPlugin=_s,Es.BASE_PLUGIN_NAME=ms,Es.registerPlugin(ms,Es),ps.prototype.usingPlugin=function(e){return!!this[gs]&&!0===this[gs][e]},ps.prototype.hasPlugin=function(e){return!!vs(e)};var xs={UnsupportedSidxContainer:"unsupported-sidx-container-error",DashManifestSidxParsingError:"dash-manifest-sidx-parsing-error",HlsPlaylistRequestError:"hls-playlist-request-error",SegmentUnsupportedMediaFormat:"segment-unsupported-media-format-error",UnsupportedMediaInitialization:"unsupported-media-initialization-error",SegmentSwitchError:"segment-switch-error",SegmentExceedsSourceBufferQuota:"segment-exceeds-source-buffer-quota-error",SegmentAppendError:"segment-append-error",VttLoadError:"vtt-load-error",VttCueParsingError:"vtt-cue-parsing-error",AdsBeforePrerollError:"ads-before-preroll-error",AdsPrerollError:"ads-preroll-error",AdsMidrollError:"ads-midroll-error",AdsPostrollError:"ads-postroll-error",AdsMacroReplacementFailed:"ads-macro-replacement-failed",AdsResumeContentFailed:"ads-resume-content-failed",EMEFailedToRequestMediaKeySystemAccess:"eme-failed-request-media-key-system-access",EMEFailedToCreateMediaKeys:"eme-failed-create-media-keys",EMEFailedToAttachMediaKeysToVideoElement:"eme-failed-attach-media-keys-to-video",EMEFailedToCreateMediaKeySession:"eme-failed-create-media-key-session",EMEFailedToSetServerCertificate:"eme-failed-set-server-certificate",EMEFailedToGenerateLicenseRequest:"eme-failed-generate-license-request",EMEFailedToUpdateSessionWithReceivedLicenseKeys:"eme-failed-update-session",EMEFailedToCloseSession:"eme-failed-close-session",EMEFailedToRemoveKeysFromSession:"eme-failed-remove-keys",EMEFailedToLoadSessionBySessionId:"eme-failed-load-session"};const As=e=>0===e.indexOf("#")?e.slice(1):e;function Is(e,t,i){let n=Is.getPlayer(e);if(n)return t&&q.warn(`Player "${e}" is already initialised. Options will not be applied.`),i&&n.ready(i),n;const s="string"===typeof e?Qe("#"+As(e)):e;if(!we(s))throw new TypeError("The element or ID supplied is not valid. (videojs)");const a="getRootNode"in s&&s.getRootNode()instanceof r.a.ShadowRoot,o=a?s.getRootNode():s.ownerDocument.body;s.ownerDocument.defaultView&&o.contains(s)||q.warn("The element supplied is not included in the DOM"),t=t||{},!0===t.restoreEl&&(t.restoreEl=(s.parentNode&&s.parentNode.hasAttribute("data-vjs-player")?s.parentNode:s).cloneNode(!0)),O("beforesetup").forEach(e=>{const i=e(s,K(t));G(i)&&!Array.isArray(i)?t=K(t,i):q.error("please return an object in beforesetup hooks")});const l=Kt.getComponent("Player");return n=new l(s,t,i),O("setup").forEach(e=>e(n)),n}if(Is.hooks_=I,Is.hooks=O,Is.hook=P,Is.hookOnce=D,Is.removeHook=L,!0!==r.a.VIDEOJS_NO_DYNAMIC_STYLE&&Ee()){let e=Qe(".vjs-styles-defaults");if(!e){e=ot("vjs-styles-defaults");const t=Qe("head");t&&t.insertBefore(e,t.firstChild),lt(e,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: 56.25%\n }\n ")}}st(1,Is),Is.VERSION=A,Is.options=ps.prototype.options_,Is.getPlayers=()=>ps.players,Is.getPlayer=e=>{const t=ps.players;let i;if("string"===typeof e){const n=As(e),r=t[n];if(r)return r;i=Qe("#"+n)}else i=e;if(we(i)){const{player:e,playerId:n}=i;if(e||t[n])return e||t[n]}},Is.getAllPlayers=()=>Object.keys(ps.players).map(e=>ps.players[e]).filter(Boolean),Is.players=ps.players,Is.getComponent=Kt.getComponent,Is.registerComponent=(e,t)=>(zi.isTech(t)&&q.warn(`The ${e} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),Kt.registerComponent.call(Kt,e,t)),Is.getTech=zi.getTech,Is.registerTech=zi.registerTech,Is.use=Xi,Object.defineProperty(Is,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(Is.middleware,"TERMINATOR",{value:Gi,writeable:!1,enumerable:!0}),Is.browser=Te,Is.obj=J,Is.mergeOptions=Cs(9,"videojs.mergeOptions","videojs.obj.merge",K),Is.defineLazyProperty=Cs(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",Q),Is.bind=Cs(9,"videojs.bind","native Function.prototype.bind",Ct),Is.registerPlugin=Es.registerPlugin,Is.deregisterPlugin=Es.deregisterPlugin,Is.plugin=(e,t)=>(q.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Es.registerPlugin(e,t)),Is.getPlugins=Es.getPlugins,Is.getPlugin=Es.getPlugin,Is.getPluginVersion=Es.getPluginVersion,Is.addLanguage=function(e,t){return e=(""+e).toLowerCase(),Is.options.languages=K(Is.options.languages,{[e]:t}),Is.options.languages[e]},Is.log=q,Is.createLogger=H,Is.time=si,Is.createTimeRange=Cs(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Zt),Is.createTimeRanges=Cs(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Zt),Is.formatTime=Cs(9,"videojs.formatTime","videojs.time.formatTime",ri),Is.setFormatTime=Cs(9,"videojs.setFormatTime","videojs.time.setFormatTime",ii),Is.resetFormatTime=Cs(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",ni),Is.parseUrl=Cs(9,"videojs.parseUrl","videojs.url.parseUrl",Ii),Is.isCrossOrigin=Cs(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",Li),Is.EventTarget=Pt,Is.any=kt,Is.on=_t,Is.one=St,Is.off=bt,Is.trigger=Tt,Is.xhr=d.a,Is.TextTrack=Ni,Is.AudioTrack=ji,Is.VideoTrack=Bi,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(e=>{Is[e]=function(){return q.warn(`videojs.${e}() is deprecated; use videojs.dom.${e}() instead`),tt[e].apply(null,arguments)}}),Is.computedStyle=Cs(9,"videojs.computedStyle","videojs.dom.computedStyle",Ze),Is.dom=tt,Is.fn=It,Is.num=Bn,Is.str=Xt,Is.url=Di,Is.Error=xs;
  40. /*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */
  41. class Os{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(e){t.enabled_(e)}}),t}}class Ps extends Is.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 i=this.levels_.length;return t=new Os(e),""+i in this||Object.defineProperty(this,i,{get(){return this.levels_[i]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let i=0,n=this.length;i<n;i++)if(this[i]===e){t=this.levels_.splice(i,1)[0],this.selectedIndex_===i?this.selectedIndex_=-1:this.selectedIndex_>i&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,i=this.length;t<i;t++){const i=this[t];if(i.id===e)return i}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}}Ps.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const t in Ps.prototype.allowedEvents_)Ps.prototype["on"+t]=null;var Ls="4.1.0";const Ds=function(e,t){const i=e.qualityLevels,n=new Ps,r=function(){n.dispose(),e.qualityLevels=i,e.off("dispose",r)};return e.on("dispose",r),e.qualityLevels=()=>n,e.qualityLevels.VERSION=Ls,n},Ms=function(e){return Ds(this,Is.obj.merge({},e))};Is.registerPlugin("qualityLevels",Ms),Ms.VERSION=Ls;
  42. /*! @name @videojs/http-streaming @version 3.12.1 @license Apache-2.0 */
  43. const Rs=y["a"],Ns=(e,t)=>t&&t.responseURL&&e!==t.responseURL?t.responseURL:e,js=e=>Is.log.debug?Is.log.debug.bind(Is,"VHS:",e+" >"):function(){};function Bs(...e){const t=Is.obj||Is,i=t.merge||t.mergeOptions;return i.apply(t,e)}function Us(...e){const t=Is.time||Is,i=t.createTimeRanges||t.createTimeRanges;return i.apply(t,e)}function Fs(e){if(0===e.length)return"Buffered Ranges are empty";let t="Buffered Ranges: \n";for(let i=0;i<e.length;i++){const n=e.start(i),r=e.end(i);t+=`${n} --\x3e ${r}. Duration (${r-n})\n`}return t}const qs=1/30,Hs=3*qs,Vs=function(e,t){const i=[];let n;if(e&&e.length)for(n=0;n<e.length;n++)t(e.start(n),e.end(n))&&i.push([e.start(n),e.end(n)]);return Us(i)},zs=function(e,t){return Vs(e,(function(e,i){return e-Hs<=t&&i+Hs>=t}))},Ws=function(e,t){return Vs(e,(function(e){return e-qs>=t}))},$s=function(e){if(e.length<2)return Us();const t=[];for(let i=1;i<e.length;i++){const n=e.end(i-1),r=e.start(i);t.push([n,r])}return Us(t)},Gs=function(e,t){let i=null,n=null,r=0;const s=[],a=[];if(!e||!e.length||!t||!t.length)return Us();let o=e.length;while(o--)s.push({time:e.start(o),type:"start"}),s.push({time:e.end(o),type:"end"});o=t.length;while(o--)s.push({time:t.start(o),type:"start"}),s.push({time:t.end(o),type:"end"});for(s.sort((function(e,t){return e.time-t.time})),o=0;o<s.length;o++)"start"===s[o].type?(r++,2===r&&(i=s[o].time)):"end"===s[o].type&&(r--,1===r&&(n=s[o].time)),null!==i&&null!==n&&(a.push([i,n]),i=null,n=null);return Us(a)},Xs=e=>{const t=[];if(!e||!e.length)return"";for(let i=0;i<e.length;i++)t.push(e.start(i)+" => "+e.end(i));return t.join(", ")},Ks=function(e,t,i=1){const n=e.length?e.end(e.length-1):0;return(n-t)/i},Ys=e=>{const t=[];for(let i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t},Qs=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;if(e.length!==t.length)return!0;for(let i=0;i<e.length;i++)if(e.start(i)!==t.start(i)||e.end(i)!==t.end(i))return!0;return!1},Js=function(e){if(e&&e.length&&e.end)return e.end(e.length-1)},Zs=function(e,t){let i=0;if(!e||!e.length)return i;for(let n=0;n<e.length;n++){const r=e.start(n),s=e.end(n);t>s||(i+=t>r&&t<=s?s-t:s-r)}return i},ea=(e,t)=>{if(!t.preload)return t.duration;let i=0;return(t.parts||[]).forEach((function(e){i+=e.duration})),(t.preloadHints||[]).forEach((function(t){"PART"===t.type&&(i+=e.partTargetDuration)})),i},ta=e=>(e.segments||[]).reduce((e,t,i)=>(t.parts?t.parts.forEach((function(n,r){e.push({duration:n.duration,segmentIndex:i,partIndex:r,part:n,segment:t})})):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e),[]),ia=e=>{const t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},na=({preloadSegment:e})=>{if(!e)return;const{parts:t,preloadHints:i}=e;let n=(i||[]).reduce((e,t)=>e+("PART"===t.type?1:0),0);return n+=t&&t.length?t.length:0,n},ra=(e,t)=>{if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;const i=ia(t).length>0;return i&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:i&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},sa=function(e,t){let i=0,n=t-e.mediaSequence,r=e.segments[n];if(r){if("undefined"!==typeof r.start)return{result:r.start,precise:!0};if("undefined"!==typeof r.end)return{result:r.end-r.duration,precise:!0}}while(n--){if(r=e.segments[n],"undefined"!==typeof r.end)return{result:i+r.end,precise:!0};if(i+=ea(e,r),"undefined"!==typeof r.start)return{result:i+r.start,precise:!0}}return{result:i,precise:!1}},aa=function(e,t){let i,n=0,r=t-e.mediaSequence;for(;r<e.segments.length;r++){if(i=e.segments[r],"undefined"!==typeof i.start)return{result:i.start-n,precise:!0};if(n+=ea(e,i),"undefined"!==typeof i.end)return{result:i.end-n,precise:!0}}return{result:-1,precise:!1}},oa=function(e,t,i){if("undefined"===typeof t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;const n=sa(e,t);if(n.precise)return n.result;const r=aa(e,t);return r.precise?r.result:n.result+i},la=function(e,t,i){if(!e)return 0;if("number"!==typeof i&&(i=0),"undefined"===typeof t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return r.a.Infinity}return oa(e,t,i)},ua=function({defaultDuration:e,durationList:t,startIndex:i,endIndex:n}){let r=0;if(i>n&&([i,n]=[n,i]),i<0){for(let t=i;t<Math.min(0,n);t++)r+=e;i=0}for(let s=i;s<n;s++)r+=t[s].duration;return r},ca=function(e,t,i,n){if(!e||!e.segments)return null;if(e.endList)return la(e);if(null===t)return null;t=t||0;let r=oa(e,e.mediaSequence+e.segments.length,t);return i&&(n="number"===typeof n?n:ra(null,e),r-=n),Math.max(0,r)},ha=function(e,t,i){const n=!0,r=t||0;let s=ca(e,t,n,i);return null===s?Us():(s<r&&(s=r),Us(r,s))},da=function({playlist:e,currentTime:t,startingSegmentIndex:i,startingPartIndex:n,startTime:r,exactManifestTimings:s}){let a=t-r;const o=ta(e);let l=0;for(let u=0;u<o.length;u++){const e=o[u];if(i===e.segmentIndex&&("number"!==typeof n||"number"!==typeof e.partIndex||n===e.partIndex)){l=u;break}}if(a<0){if(l>0)for(let t=l-1;t>=0;t--){const i=o[t];if(a+=i.duration,s){if(a<0)continue}else if(a+qs<=0)continue;return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:r-ua({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:t})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t}}if(l<0){for(let i=l;i<0;i++)if(a-=e.targetDuration,a<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t};l=0}for(let u=l;u<o.length;u++){const t=o[u];a-=t.duration;const i=t.duration>qs,n=0===a,c=i&&a+qs>=0;if(!n&&!c||u===o.length-1){if(s){if(a>0)continue}else if(a-qs>=0)continue;return{partIndex:t.partIndex,segmentIndex:t.segmentIndex,startTime:r+ua({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:u})}}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:t}},pa=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},fa=function(e){return e.excludeUntil&&e.excludeUntil===1/0},ma=function(e){const t=pa(e);return!e.disabled&&!t},ga=function(e){return e.disabled},ya=function(e){for(let t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},va=function(e,t){return t.attributes&&t.attributes[e]},_a=function(e,t,i,n=0){if(!va("BANDWIDTH",i))return NaN;const r=e*i.attributes.BANDWIDTH;return(r-8*n)/t},ba=(e,t)=>{if(1===e.playlists.length)return!0;const i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter(e=>!!ma(e)&&(e.attributes.BANDWIDTH||0)<i).length},Ta=(e,t)=>!(!e&&!t||!e&&t||e&&!t)&&(e===t||(!(!e.id||!t.id||e.id!==t.id)||(!(!e.resolvedUri||!t.resolvedUri||e.resolvedUri!==t.resolvedUri)||!(!e.uri||!t.uri||e.uri!==t.uri)))),Sa=function(e,t){const i=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{};let n=!1;for(const r in i){for(const e in i[r])if(n=t(i[r][e]),n)break;if(n)break}return!!n},ka=e=>{if(!e||!e.playlists||!e.playlists.length){const t=Sa(e,e=>e.playlists&&e.playlists.length||e.uri);return t}for(let t=0;t<e.playlists.length;t++){const i=e.playlists[t],n=i.attributes&&i.attributes.CODECS;if(n&&n.split(",").every(e=>Object(_["f"])(e)))continue;const r=Sa(e,e=>Ta(i,e));if(!r)return!1}return!0};var Ea={liveEdgeDelay:ra,duration:la,seekable:ha,getMediaInfoForTime:da,isEnabled:ma,isDisabled:ga,isExcluded:pa,isIncompatible:fa,playlistEnd:ca,isAes:ya,hasAttribute:va,estimateSegmentRequestTime:_a,isLowestEnabledRendition:ba,isAudioOnly:ka,playlistMatch:Ta,segmentDurationWithParts:ea};const{log:wa}=Is,Ca=(e,t)=>`${e}-${t}`,xa=(e,t,i)=>`placeholder-uri-${e}-${t}-${i}`,Aa=({onwarn:e,oninfo:t,manifestString:i,customTagParsers:n=[],customTagMappers:r=[],llhls:s})=>{const a=new v["a"];e&&a.on("warn",e),t&&a.on("info",t),n.forEach(e=>a.addParser(e)),r.forEach(e=>a.addTagMapper(e)),a.push(i),a.end();const o=a.manifest;if(s||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach((function(e){o.hasOwnProperty(e)&&delete o[e]})),o.segments&&o.segments.forEach((function(e){["parts","preloadHints"].forEach((function(t){e.hasOwnProperty(t)&&delete e[t]}))}))),!o.targetDuration){let t=10;o.segments&&o.segments.length&&(t=o.segments.reduce((e,t)=>Math.max(e,t.duration),0)),e&&e({message:"manifest has no targetDuration defaulting to "+t}),o.targetDuration=t}const l=ia(o);if(l.length&&!o.partTargetDuration){const t=l.reduce((e,t)=>Math.max(e,t.duration),0);e&&(e({message:"manifest has no partTargetDuration defaulting to "+t}),wa.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=t}return o},Ia=(e,t)=>{e.mediaGroups&&["AUDIO","SUBTITLES"].forEach(i=>{if(e.mediaGroups[i])for(const n in e.mediaGroups[i])for(const r in e.mediaGroups[i][n]){const s=e.mediaGroups[i][n][r];t(s,i,n,r)}})},Oa=({playlist:e,uri:t,id:i})=>{e.id=i,e.playlistErrors_=0,t&&(e.uri=t),e.attributes=e.attributes||{}},Pa=e=>{let t=e.playlists.length;while(t--){const i=e.playlists[t];Oa({playlist:i,id:Ca(t,i.uri)}),i.resolvedUri=Rs(e.uri,i.uri),e.playlists[i.id]=i,e.playlists[i.uri]=i,i.attributes.BANDWIDTH||wa.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},La=e=>{Ia(e,t=>{t.uri&&(t.resolvedUri=Rs(e.uri,t.uri))})},Da=(e,t)=>{const i=Ca(0,t),n={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:r.a.location.href,resolvedUri:r.a.location.href,playlists:[{uri:t,id:i,resolvedUri:t,attributes:{}}]};return n.playlists[i]=n.playlists[0],n.playlists[t]=n.playlists[0],n},Ma=(e,t,i=xa)=>{e.uri=t;for(let r=0;r<e.playlists.length;r++)if(!e.playlists[r].uri){const t="placeholder-uri-"+r;e.playlists[r].uri=t}const n=ka(e);Ia(e,(t,r,s,a)=>{if(!t.playlists||!t.playlists.length){if(n&&"AUDIO"===r&&!t.uri)for(let t=0;t<e.playlists.length;t++){const i=e.playlists[t];if(i.attributes&&i.attributes.AUDIO&&i.attributes.AUDIO===s)return}t.playlists=[g()({},t)]}t.playlists.forEach((function(t,n){const o=i(r,s,a,t),l=Ca(n,o);t.uri?t.resolvedUri=t.resolvedUri||Rs(e.uri,t.uri):(t.uri=0===n?o:l,t.resolvedUri=t.uri),t.id=t.id||l,t.attributes=t.attributes||{},e.playlists[t.id]=t,e.playlists[t.uri]=t}))}),Pa(e),La(e)};class Ra{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(e=[]){if(null!==this.offset_)return;if(!e.length)return;const[t]=e;void 0!==t.programDateTime&&(this.offset_=t.programDateTime/1e3)}setPendingDateRanges(e=[]){if(!e.length)return;const[t]=e,i=t.startDate.getTime();this.trimProcessedDateRanges_(i),this.pendingDateRanges_=e.reduce((e,t)=>(e.set(t.id,t),e),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(null===this.offset_)return[];const e={},t=[];this.pendingDateRanges_.forEach((i,n)=>{if(!this.processedDateRanges_.has(n)&&(i.startTime=i.startDate.getTime()/1e3-this.offset_,i.processDateRange=()=>this.processDateRange(i),t.push(i),i.class))if(e[i.class]){const t=e[i.class].push(i);i.classListIndex=t-1}else e[i.class]=[i],i.classListIndex=0});for(const i of t){const t=e[i.class]||[];i.endDate?i.endTime=i.endDate.getTime()/1e3-this.offset_:i.endOnNext&&t[i.classListIndex+1]?i.endTime=t[i.classListIndex+1].startTime:i.duration?i.endTime=i.startTime+i.duration:i.plannedDuration?i.endTime=i.startTime+i.plannedDuration:i.endTime=i.startTime}return t}trimProcessedDateRanges_(e){const t=new Map(this.processedDateRanges_);t.forEach((t,i)=>{t.startDate.getTime()<e&&this.processedDateRanges_.delete(i)})}}const{EventTarget:Na}=Is,ja=(e,t)=>{if(t.endList||!t.serverControl)return e;const i={};if(t.serverControl.canBlockReload){const{preloadSegment:e}=t;let n=t.mediaSequence+t.segments.length;if(e){const r=e.parts||[],s=na(t)-1;s>-1&&s!==r.length-1&&(i._HLS_part=s),(s>-1||r.length)&&n--}i._HLS_msn=n}if(t.serverControl&&t.serverControl.canSkipUntil&&(i._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(i).length){const t=new r.a.URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach((function(e){i.hasOwnProperty(e)&&t.searchParams.set(e,i[e])})),e=t.toString()}return e},Ba=(e,t)=>{if(!e)return t;const i=Bs(e,t);if(e.preloadHints&&!t.preloadHints&&delete i.preloadHints,e.parts&&!t.parts)delete i.parts;else if(e.parts&&t.parts)for(let n=0;n<t.parts.length;n++)e.parts&&e.parts[n]&&(i.parts[n]=Bs(e.parts[n],t.parts[n]));return!e.skipped&&t.skipped&&(i.skipped=!1),e.preload&&!t.preload&&(i.preload=!1),i},Ua=(e,t,i)=>{const n=e.slice(),r=t.slice();i=i||0;const s=[];let a;for(let o=0;o<r.length;o++){const e=n[o+i],t=r[o];e?(a=e.map||a,s.push(Ba(e,t))):(a&&!t.map&&(t.map=a),s.push(t))}return s},Fa=(e,t)=>{!e.resolvedUri&&e.uri&&(e.resolvedUri=Rs(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=Rs(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=Rs(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=Rs(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach(e=>{e.resolvedUri||(e.resolvedUri=Rs(t,e.uri))}),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach(e=>{e.resolvedUri||(e.resolvedUri=Rs(t,e.uri))})},qa=function(e){const t=e.segments||[],i=e.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints)for(let e=0;e<i.preloadHints.length;e++)if("MAP"===i.preloadHints[e].type)return t;i.duration=e.targetDuration,i.preload=!0,t.push(i)}return t},Ha=(e,t)=>e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment,Va=(e,t,i=Ha)=>{const n=Bs(e,{}),r=n.playlists[t.id];if(!r)return null;if(i(r,t))return null;t.segments=qa(t);const s=Bs(r,t);if(s.preloadSegment&&!t.preloadSegment&&delete s.preloadSegment,r.segments){if(t.skip){t.segments=t.segments||[];for(let e=0;e<t.skip.skippedSegments;e++)t.segments.unshift({skipped:!0})}s.segments=Ua(r.segments,t.segments,t.mediaSequence-r.mediaSequence)}s.segments.forEach(e=>{Fa(e,s.resolvedUri)});for(let a=0;a<n.playlists.length;a++)n.playlists[a].id===t.id&&(n.playlists[a]=s);return n.playlists[t.id]=s,n.playlists[t.uri]=s,Ia(e,(e,i,n,r)=>{if(e.playlists)for(let a=0;a<e.playlists.length;a++)t.id===e.playlists[a].id&&(e.playlists[a]=s)}),n},za=(e,t)=>{const i=e.segments||[],n=i[i.length-1],r=n&&n.parts&&n.parts[n.parts.length-1],s=r&&r.duration||n&&n.duration;return t&&s?1e3*s:500*(e.partTargetDuration||e.targetDuration||10)};class Wa extends Na{constructor(e,t,i={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=js("PlaylistLoader");const{withCredentials:n=!1}=i;this.src=e,this.vhs_=t,this.withCredentials=n,this.addDateRangesToTextTrack_=i.addDateRangesToTextTrack;const r=t.options_;this.customTagParsers=r&&r.customTagParsers||[],this.customTagMappers=r&&r.customTagMappers||[],this.llhls=r&&r.llhls,this.dateRangesStorage_=new Ra,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("HAVE_METADATA"!==this.state)return;const e=this.media();let t=Rs(this.main.uri,e.uri);this.llhls&&(t=ja(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(e,t)=>{if(this.request)return e?this.playlistRequestError(this.request,this.media(),"HAVE_METADATA"):void this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})})}playlistRequestError(e,t,i){const{uri:n,id:r}=t;this.request=null,i&&(this.state=i),this.error={playlist:this.main.playlists[r],status:e.status,message:`HLS playlist request error at URL: ${n}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:{errorType:Is.Error.HlsPlaylistRequestError}},this.trigger("error")}parseManifest_({url:e,manifestString:t}){return Aa({onwarn:({message:t})=>this.logger_(`m3u8-parser warn for ${e}: ${t}`),oninfo:({message:t})=>this.logger_(`m3u8-parser info for ${e}: ${t}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}haveMetadata({playlistString:e,playlistObject:t,url:i,id:n}){this.request=null,this.state="HAVE_METADATA";const r=t||this.parseManifest_({url:i,manifestString:e});r.lastRequest=Date.now(),Oa({playlist:r,uri:i,id:n});const s=Va(this.main,r);this.targetDuration=r.partTargetDuration||r.targetDuration,this.pendingMedia_=null,s?(this.main=s,this.media_=this.main.playlists[n]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(za(this.media(),!!s)),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),r.a.clearTimeout(this.mediaUpdateTimeout),r.a.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new Ra,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("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"===typeof e){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(r.a.clearTimeout(this.finalRenditionTimeout),t){const t=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;return void(this.finalRenditionTimeout=r.a.setTimeout(this.media.bind(this,e,!1),t))}const i=this.state,n=!this.media_||e.id!==this.media_.id,s=this.main.playlists[e.id];if(s&&s.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(n&&(this.trigger("mediachanging"),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(za(e,!0)),n){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,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,n)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=Ns(e.resolvedUri,n),t)return this.playlistRequestError(this.request,e,i);this.haveMetadata({playlistString:n.responseText,url:e.uri,id:e.id}),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}}pause(){this.mediaUpdateTimeout&&(r.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(r.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const e=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=r.a.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},e)}else this.started?t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(r.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=r.a.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,"object"===typeof this.src)return this.src.uri||(this.src.uri=r.a.location.href),this.src.resolvedUri=this.src.uri,void setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(e,t)=>{if(!this.request)return;if(this.request=null,e)return this.error={status:t.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:t.responseText,code:2,metadata:{errorType:Is.Error.HlsPlaylistRequestError}},"HAVE_NOTHING"===this.state&&(this.started=!1),this.trigger("error");this.src=Ns(this.src,t);const i=this.parseManifest_({manifestString:t.responseText,url:this.src});this.setupInitialPlaylist(i)})}srcUri(){return"string"===typeof this.src?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists)return this.main=e,Ma(this.main,this.srcUri()),e.playlists.forEach(e=>{e.segments=qa(e),e.segments.forEach(t=>{Fa(t,e.resolvedUri)})}),this.trigger("loadedplaylist"),void(this.request||this.media(this.main.playlists[0]));const t=this.srcUri()||r.a.location.href;this.main=Da(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const i=this.main,n=e.ID;let r=i.playlists.length;while(r--){const s=i.playlists[r];if(s.attributes["PATHWAY-ID"]===n){const a=s.resolvedUri,o=s.id;if(t){const t=this.createCloneURI_(s.resolvedUri,e),a=Ca(n,t),o=this.createCloneAttributes_(n,s.attributes),l=this.createClonePlaylist_(s,a,e,o);i.playlists[r]=l,i.playlists[a]=l,i.playlists[t]=l}else i.playlists.splice(r,1);delete i.playlists[o],delete i.playlists[a]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const i=this.main,n=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{if(i.mediaGroups[e]&&i.mediaGroups[e][n])for(const t in i.mediaGroups[e])if(t===n){for(const n in i.mediaGroups[e][t]){const r=i.mediaGroups[e][t][n];r.playlists.forEach((e,t)=>{const n=i.playlists[e.id],r=n.id,s=n.resolvedUri;delete i.playlists[r],delete i.playlists[s]})}delete i.mediaGroups[e][t]}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const i=this.main,n=i.playlists.length,r=this.createCloneURI_(t.resolvedUri,e),s=Ca(e.ID,r),a=this.createCloneAttributes_(e.ID,t.attributes),o=this.createClonePlaylist_(t,s,e,a);i.playlists[n]=o,i.playlists[s]=o,i.playlists[r]=o,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,i=e["BASE-ID"],n=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{if(n.mediaGroups[r]&&!n.mediaGroups[r][t])for(const s in n.mediaGroups[r])if(s===i){n.mediaGroups[r][t]={};for(const i in n.mediaGroups[r][s]){const a=n.mediaGroups[r][s][i];n.mediaGroups[r][t][i]=g()({},a);const o=n.mediaGroups[r][t][i],l=this.createCloneURI_(a.resolvedUri,e);o.resolvedUri=l,o.uri=l,o.playlists=[],a.playlists.forEach((s,a)=>{const l=n.playlists[s.id],u=xa(r,t,i),c=Ca(t,u);if(l&&!n.playlists[c]){const t=this.createClonePlaylist_(l,c,e),i=t.resolvedUri;n.playlists[c]=t,n.playlists[i]=t}o.playlists[a]=this.createClonePlaylist_(s,c,e)})}}})}createClonePlaylist_(e,t,i,n){const r=this.createCloneURI_(e.resolvedUri,i),s={resolvedUri:r,uri:r,id:t};return e.segments&&(s.segments=[]),n&&(s.attributes=n),Bs(e,s)}createCloneURI_(e,t){const i=new URL(e);i.hostname=t["URI-REPLACEMENT"].HOST;const n=t["URI-REPLACEMENT"].PARAMS;for(const r of Object.keys(n))i.searchParams.set(r,n[r]);return i.href}createCloneAttributes_(e,t){const i={["PATHWAY-ID"]:e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{t[n]&&(i[n]=e)}),i}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const n=e.contentProtection[i].attributes.keyId;n&&t.add(n.toLowerCase())}return t}}}const $a=function(e,t,i,n){const r="arraybuffer"===e.responseType?e.response:e.responseText;!t&&r&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=r.byteLength||r.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),i.headers&&(e.responseHeaders=i.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===i.statusCode||206===i.statusCode||0===i.statusCode||(t=new Error("XHR Failed with a response of: "+(e&&(r||e.responseText)))),n(t,e)},Ga=(e,t)=>{if(!e||!e.size)return;let i=t;return e.forEach(e=>{i=e(i)}),i},Xa=(e,t,i,n)=>{e&&e.size&&e.forEach(e=>{e(t,i,n)})},Ka=function(){const e=function e(t,i){t=Bs({timeout:45e3},t);const n=e.beforeRequest||Is.Vhs.xhr.beforeRequest,r=e._requestCallbackSet||Is.Vhs.xhr._requestCallbackSet||new Set,s=e._responseCallbackSet||Is.Vhs.xhr._responseCallbackSet;n&&"function"===typeof n&&(Is.log.warn("beforeRequest is deprecated, use onRequest instead."),r.add(n));const a=!0===Is.Vhs.xhr.original?Is.xhr:Is.Vhs.xhr,o=Ga(r,t);r.delete(n);const l=a(o||t,(function(e,t){return Xa(s,l,e,t),$a(l,e,t,i)})),u=l.abort;return l.abort=function(){return l.aborted=!0,u.apply(l,arguments)},l.uri=t.uri,l.requestTime=Date.now(),l};return e.original=!0,e},Ya=function(e){let t;const i=e.offset;return t="bigint"===typeof e.offset||"bigint"===typeof e.length?r.a.BigInt(e.offset)+r.a.BigInt(e.length)-r.a.BigInt(1):e.offset+e.length-1,"bytes="+i+"-"+t},Qa=function(e){const t={};return e.byterange&&(t.Range=Ya(e.byterange)),t},Ja=function(e,t){return e.start(t)+"-"+e.end(t)},Za=function(e,t){const i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},eo=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},to=function(e){const t={};return Object.keys(e).forEach(i=>{const n=e[i];Object(T["e"])(n)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n}),t},io=function(e){const t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},no=function(e){return e.resolvedUri},ro=e=>{const t=Array.prototype.slice.call(e),i=16;let n,r,s="";for(let a=0;a<t.length/i;a++)n=t.slice(a*i,a*i+i).map(Za).join(""),r=t.slice(a*i,a*i+i).map(eo).join(""),s+=n+" "+r+"\n";return s},so=({bytes:e})=>ro(e),ao=e=>{let t,i="";for(t=0;t<e.length;t++)i+=Ja(e,t)+" ";return i};var oo=Object.freeze({__proto__:null,createTransferableMessage:to,initSegmentId:io,segmentKeyId:no,hexDump:ro,tagDump:so,textRanges:ao});const lo=.25,uo=(e,t)=>{if(!t.dateTimeObject)return null;const i=t.videoTimingInfo.transmuxerPrependedSeconds,n=t.videoTimingInfo.transmuxedPresentationStart,r=n+i,s=e-r;return new Date(t.dateTimeObject.getTime()+1e3*s)},co=e=>e.transmuxedPresentationEnd-e.transmuxedPresentationStart-e.transmuxerPrependedSeconds,ho=(e,t)=>{let i;try{i=new Date(e)}catch(l){return null}if(!t||!t.segments||0===t.segments.length)return null;let n=t.segments[0];if(i<new Date(n.dateTimeObject))return null;for(let u=0;u<t.segments.length-1;u++){n=t.segments[u];const e=new Date(t.segments[u+1].dateTimeObject);if(i<e)break}const r=t.segments[t.segments.length-1],s=r.dateTimeObject,a=r.videoTimingInfo?co(r.videoTimingInfo):r.duration+r.duration*lo,o=new Date(s.getTime()+1e3*a);return i>o?null:(i>new Date(s)&&(n=r),{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:Ea.duration(t,t.mediaSequence+t.segments.indexOf(n)),type:n.videoTimingInfo?"accurate":"estimate"})},po=(e,t)=>{if(!t||!t.segments||0===t.segments.length)return null;let i,n=0;for(let s=0;s<t.segments.length;s++)if(i=t.segments[s],n=i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationEnd:n+i.duration,e<=n)break;const r=t.segments[t.segments.length-1];if(r.videoTimingInfo&&r.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>n){if(e>n+r.duration*lo)return null;i=r}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:n-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}},fo=(e,t)=>{let i,n;try{i=new Date(e),n=new Date(t)}catch(a){}const r=i.getTime(),s=n.getTime();return(s-r)/1e3},mo=e=>{if(!e.segments||0===e.segments.length)return!1;for(let t=0;t<e.segments.length;t++){const i=e.segments[t];if(!i.dateTimeObject)return!1}return!0},go=({playlist:e,time:t,callback:i})=>{if(!i)throw new Error("getProgramTime: callback must be provided");if(!e||void 0===t)return i({message:"getProgramTime: playlist and time must be provided"});const n=po(t,e);if(!n)return i({message:"valid programTime was not found"});if("estimate"===n.type)return i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:n.estimatedStart});const r={mediaSeconds:t},s=uo(t,n.segment);return s&&(r.programDateTime=s.toISOString()),i(null,r)},yo=({programTime:e,playlist:t,retryCount:i=2,seekTo:n,pauseAfterSeek:r=!0,tech:s,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if("undefined"===typeof e||!t||!n)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!t.endList&&!s.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!mo(t))return a({message:"programDateTime tags must be provided in the manifest "+t.resolvedUri});const o=ho(e,t);if(!o)return a({message:e+" was not found in the stream"});const l=o.segment,u=fo(l.dateTimeObject,e);if("estimate"===o.type)return 0===i?a({message:e+" is not buffered yet. Try again"}):(n(o.estimatedStart+u),void s.one("seeked",()=>{yo({programTime:e,playlist:t,retryCount:i-1,seekTo:n,pauseAfterSeek:r,tech:s,callback:a})}));const c=l.start+u,h=()=>a(null,s.currentTime());s.one("seeked",h),r&&s.pause(),n(c)},vo=(e,t)=>{if(4===e.readyState)return t()},_o=(e,t,i)=>{let n,r=[],s=!1;const a=function(e,t,n,r){return t.abort(),s=!0,i(e,t,n,r)},o=function(e,t){if(s)return;if(e)return a(e,t,"",r);const i=t.responseText.substring(r&&r.byteLength||0,t.responseText.length);if(r=Object(T["d"])(r,Object(T["h"])(i,!0)),n=n||Object(w["a"])(r),r.length<10||n&&r.length<n+2)return vo(t,()=>a(e,t,"",r));const o=Object(C["a"])(r);return"ts"===o&&r.length<188||!o&&r.length<376?vo(t,()=>a(e,t,"",r)):a(null,t,o,r)},l={uri:e,beforeSend(e){e.overrideMimeType("text/plain; charset=x-user-defined"),e.addEventListener("progress",(function({total:t,loaded:i}){return $a(e,null,{statusCode:e.status},o)}))}},u=t(l,(function(e,t){return $a(u,e,t,o)}));return u},{EventTarget:bo}=Is,To=function(e,t){if(!Ha(e,t))return!1;if(e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length))return!1;if(!e.sidx&&t.sidx||e.sidx&&!t.sidx)return!1;if(e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(let i=0;i<e.segments.length;i++){const n=e.segments[i],r=t.segments[i];if(n.uri!==r.uri)return!1;if(!n.byterange&&!r.byterange)continue;const s=n.byterange,a=r.byterange;if(s&&!a||!s&&a)return!1;if(s.offset!==a.offset||s.length!==a.length)return!1}return!0},So=(e,t,i,n)=>{const r=n.attributes.NAME||i;return`placeholder-uri-${e}-${t}-${r}`},ko=({mainXml:e,srcUrl:t,clientOffset:i,sidxMapping:n,previousManifest:r})=>{const s=Object(S["c"])(e,{manifestUri:t,clientOffset:i,sidxMapping:n,previousManifest:r});return Ma(s,t,So),s},Eo=(e,t)=>{Ia(e,(i,n,r,s)=>{s in t.mediaGroups[n][r]||delete e.mediaGroups[n][r][s]})},wo=(e,t,i)=>{let n=!0,r=Bs(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts});for(let s=0;s<t.playlists.length;s++){const e=t.playlists[s];if(e.sidx){const t=Object(S["b"])(e.sidx);i&&i[t]&&i[t].sidx&&Object(S["a"])(e,i[t].sidx,e.sidx.resolvedUri)}const a=Va(r,e,To);a&&(r=a,n=!1)}return Ia(t,(e,t,i,s)=>{if(e.playlists&&e.playlists.length){const a=e.playlists[0].id,o=Va(r,e.playlists[0],To);o&&(r=o,s in r.mediaGroups[t][i]||(r.mediaGroups[t][i][s]=e),r.mediaGroups[t][i][s].playlists[0]=r.playlists[a],n=!1)}}),Eo(r,t),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(n=!1),n?null:r},Co=(e,t)=>{const i=Boolean(!e.map&&!t.map),n=i||Boolean(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length);return n&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length},xo=(e,t)=>{const i={};for(const n in e){const r=e[n],s=r.sidx;if(s){const e=Object(S["b"])(s);if(!t[e])break;const n=t[e].sidxInfo;Co(n,s)&&(i[e]=t[e])}}return i},Ao=(e,t)=>{const i=xo(e.playlists,t);let n=i;return Ia(e,(e,i,r,s)=>{if(e.playlists&&e.playlists.length){const i=e.playlists;n=Bs(n,xo(i,t))}}),n};class Io extends bo{constructor(e,t,i={},n){super(),this.mainPlaylistLoader_=n||this,n||(this.isMain_=!0);const{withCredentials:r=!1}=i;if(this.vhs_=t,this.withCredentials=r,this.addMetadataToTextTrack=i.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_=js("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}requestErrored_(e,t,i){return!this.request||(this.request=null,e?(this.error="object"!==typeof e||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata}:e,i&&(this.state=i),this.trigger("error"),!0):void 0)}addSidxSegments_(e,t,i){const n=e.sidx&&Object(S["b"])(e.sidx);if(!e.sidx||!n||this.mainPlaylistLoader_.sidxMapping_[n])return void(this.mediaRequest_=r.a.setTimeout(()=>i(!1),0));const s=Ns(e.sidx.resolvedUri),a=(r,s)=>{if(this.requestErrored_(r,s,t))return;const a=this.mainPlaylistLoader_.sidxMapping_;let o;try{o=E()(Object(T["k"])(s.response).subarray(8))}catch(l){return l.metadata={errorType:Is.Error.DashManifestSidxParsingError},void this.requestErrored_(l,s,t)}return a[n]={sidxInfo:e.sidx,sidx:o},Object(S["a"])(e,o,e.sidx.resolvedUri),i(!0)};this.request=_o(s,this.vhs_.xhr,(t,i,n,r)=>{if(t)return a(t,i);if(!n||"mp4"!==n){const t=n||"unknown";return a({status:i.status,message:`Unsupported ${t} container type for sidx segment at URL: ${s}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2,metadata:{errorType:Is.Error.UnsupportedSidxContainer,sidxContainer:t}},i)}const{offset:o,length:l}=e.sidx.byterange;if(r.length>=l+o)return a(t,{response:r.subarray(o,o+l),status:i.status,uri:i.uri});this.request=this.vhs_.xhr({uri:s,responseType:"arraybuffer",headers:Qa({byterange:e.sidx.byterange})},a)})}dispose(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},r.a.clearTimeout(this.minimumUpdatePeriodTimeout_),r.a.clearTimeout(this.mediaRequest_),r.a.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("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if("string"===typeof e){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const i=!this.media_||e.id!==this.media_.id;if(i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(i&&(this.trigger("mediachanging"),this.trigger("mediachange")));i&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,i=>{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),"HAVE_MAIN_MANIFEST"===e?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),r.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(r.a.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)}load(e){r.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const e=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=r.a.setTimeout(()=>this.load(),e)}else this.started?t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()}start(){this.started=!0,this.isMain_?this.requestMain_((e,t)=>{this.haveMain_(),this.hasPendingRequest()||this.media_||this.media(this.mainPlaylistLoader_.main.playlists[0])}):this.mediaRequest_=r.a.setTimeout(()=>this.haveMain_(),0)}requestMain_(e){this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(t,i)=>{if(this.requestErrored_(t,i))return void("HAVE_NOTHING"===this.state&&(this.started=!1));const n=i.responseText!==this.mainPlaylistLoader_.mainXml_;return this.mainPlaylistLoader_.mainXml_=i.responseText,i.responseHeaders&&i.responseHeaders.date?this.mainLoaded_=Date.parse(i.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=Ns(this.mainPlaylistLoader_.srcUrl,i),n?(this.handleMain_(),void this.syncClientServerClock_(()=>e(i,n))):e(i,n)})}syncClientServerClock_(e){const t=Object(S["d"])(this.mainPlaylistLoader_.mainXml_);return null===t?(this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()):"DIRECT"===t.method?(this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:Rs(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(i,n)=>{if(!this.request)return;if(i)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();let r;r="HEAD"===t.method?n.responseHeaders&&n.responseHeaders.date?Date.parse(n.responseHeaders.date):this.mainLoaded_:Date.parse(n.responseText),this.mainPlaylistLoader_.clientOffset_=r-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;let t=ko({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(t=wo(e,t,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=t||e;const i=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];return i&&i!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=i),(!e||t&&t.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(t),Boolean(t)}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(r.a.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!==typeof t||t<=0?t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`):this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=r.a.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_=Ao(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,e=>{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,i=!this.media_||this.media_!==t[e];if(i?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const e=()=>{this.media().endList||(this.mediaUpdateTimeout=r.a.setTimeout(()=>{this.trigger("mediaupdatetimeout"),e()},za(this.media(),Boolean(i))))};e()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const e=this.mainPlaylistLoader_.main.eventStream.map(e=>({cueTime:e.start,frames:[{data:e.messageData}]}));this.addMetadataToTextTrack("EventStream",e,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const n=e.contentProtection[i].attributes["cenc:default_KID"];n&&t.add(n.replace(/-/g,"").toLowerCase())}return t}}}var Oo={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 Po=e=>{const t=new Uint8Array(new ArrayBuffer(e.length));for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t.buffer},Lo=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},Do=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(t){const i=new BlobBuilder;return i.append(e),URL.createObjectURL(i.getBlob())}},Mo=function(e){return function(){const t=Do(e),i=Lo(new Worker(t));i.objURL=t;const n=i.terminate;return i.on=i.addEventListener,i.off=i.removeEventListener,i.terminate=function(){return URL.revokeObjectURL(t),n.call(this)},i}},Ro=function(e){return`var browserWorkerPolyFill = ${Lo.toString()};\nbrowserWorkerPolyFill(self);\n`+e},No=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},jo=Ro(No((function(){var t="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof e?e:"undefined"!==typeof self?self:{},i=function(){this.init=function(){var e={};this.on=function(t,i){e[t]||(e[t]=[]),e[t]=e[t].concat(i)},this.off=function(t,i){var n;return!!e[t]&&(n=e[t].indexOf(i),e[t]=e[t].slice(),e[t].splice(n,1),n>-1)},this.trigger=function(t){var i,n,r,s;if(i=e[t],i)if(2===arguments.length)for(r=i.length,n=0;n<r;++n)i[n].call(this,arguments[1]);else{for(s=[],n=arguments.length,n=1;n<arguments.length;++n)s.push(arguments[n]);for(r=i.length,n=0;n<r;++n)i[n].apply(this,s)}},this.dispose=function(){e={}}}};i.prototype.pipe=function(e){return this.on("data",(function(t){e.push(t)})),this.on("done",(function(t){e.flush(t)})),this.on("partialdone",(function(t){e.partialFlush(t)})),this.on("endedtimeline",(function(t){e.endTimeline(t)})),this.on("reset",(function(t){e.reset(t)})),e},i.prototype.push=function(e){this.trigger("data",e)},i.prototype.flush=function(e){this.trigger("done",e)},i.prototype.partialFlush=function(e){this.trigger("partialdone",e)},i.prototype.endTimeline=function(e){this.trigger("endedtimeline",e)},i.prototype.reset=function(e){this.trigger("reset",e)};var n,r,s,a,o,l,u,c,h,d,p,f,m,g,y,v,_,b,T,S,k,E,w,C,x,A,I,O,P,L,D,M,R,N,j,B,U=i,F=Math.pow(2,32),q=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.getBigUint64?(t=i.getBigUint64(0),t<Number.MAX_SAFE_INTEGER?Number(t):t):i.getUint32(0)*F+i.getUint32(4)},H={getUint64:q,MAX_UINT32:F},V=H.MAX_UINT32;(function(){var e;if(w={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:[]},"undefined"!==typeof Uint8Array){for(e in w)w.hasOwnProperty(e)&&(w[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);C=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),A=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),x=new Uint8Array([0,0,0,1]),I=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]),O=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]),P={video:I,audio:O},M=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),D=new Uint8Array([0,0,0,0,0,0,0,0]),R=new Uint8Array([0,0,0,0,0,0,0,0]),N=R,j=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),B=R,L=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),n=function(e){var t,i,n,r=[],s=0;for(t=1;t<arguments.length;t++)r.push(arguments[t]);t=r.length;while(t--)s+=r[t].byteLength;for(i=new Uint8Array(s+8),n=new DataView(i.buffer,i.byteOffset,i.byteLength),n.setUint32(0,i.byteLength),i.set(e,4),t=0,s=8;t<r.length;t++)i.set(r[t],s),s+=r[t].byteLength;return i},r=function(){return n(w.dinf,n(w.dref,M))},s=function(e){return n(w.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,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},a=function(){return n(w.ftyp,C,x,C,A)},v=function(e){return n(w.hdlr,P[e])},o=function(e){return n(w.mdat,e)},y=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(t[12]=e.samplerate>>>24&255,t[13]=e.samplerate>>>16&255,t[14]=e.samplerate>>>8&255,t[15]=255&e.samplerate),n(w.mdhd,t)},g=function(e){return n(w.mdia,y(e),v(e.type),u(e))},l=function(e){return n(w.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},u=function(e){return n(w.minf,"video"===e.type?n(w.vmhd,L):n(w.smhd,D),r(),b(e))},c=function(e,t){var i=[],r=t.length;while(r--)i[r]=S(t[r]);return n.apply(null,[w.moof,l(e)].concat(i))},h=function(e){var t=e.length,i=[];while(t--)i[t]=f(e[t]);return n.apply(null,[w.moov,p(4294967295)].concat(i).concat(d(e)))},d=function(e){var t=e.length,i=[];while(t--)i[t]=k(e[t]);return n.apply(null,[w.mvex].concat(i))},p=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,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 n(w.mvhd,t)},_=function(e){var t,i,r=e.samples||[],s=new Uint8Array(4+r.length);for(i=0;i<r.length;i++)t=r[i].flags,s[i+4]=t.dependsOn<<4|t.isDependedOn<<2|t.hasRedundancy;return n(w.sdtp,s)},b=function(e){return n(w.stbl,T(e),n(w.stts,B),n(w.stsc,N),n(w.stsz,j),n(w.stco,R))},function(){var e,t;T=function(i){return n(w.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===i.type?e(i):t(i))},e=function(e){var t,i,r=e.sps||[],s=e.pps||[],a=[],o=[];for(t=0;t<r.length;t++)a.push((65280&r[t].byteLength)>>>8),a.push(255&r[t].byteLength),a=a.concat(Array.prototype.slice.call(r[t]));for(t=0;t<s.length;t++)o.push((65280&s[t].byteLength)>>>8),o.push(255&s[t].byteLength),o=o.concat(Array.prototype.slice.call(s[t]));if(i=[w.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,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,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]),n(w.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([r.length],a,[s.length],o))),n(w.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var l=e.sarRatio[0],u=e.sarRatio[1];i.push(n(w.pasp,new Uint8Array([(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l,(4278190080&u)>>24,(16711680&u)>>16,(65280&u)>>8,255&u])))}return n.apply(null,i)},t=function(e){return n(w.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),s(e))}}(),m=function(e){var t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,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,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return n(w.tkhd,t)},S=function(e){var t,i,r,s,a,o,l;return t=n(w.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),o=Math.floor(e.baseMediaDecodeTime/V),l=Math.floor(e.baseMediaDecodeTime%V),i=n(w.tfdt,new Uint8Array([1,0,0,0,o>>>24&255,o>>>16&255,o>>>8&255,255&o,l>>>24&255,l>>>16&255,l>>>8&255,255&l])),a=92,"audio"===e.type?(r=E(e,a),n(w.traf,t,i,r)):(s=_(e),r=E(e,s.length+a),n(w.traf,t,i,r,s))},f=function(e){return e.duration=e.duration||4294967295,n(w.trak,m(e),g(e))},k=function(e){var t=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(t[t.length-1]=0),n(w.trex,t)},function(){var e,t,i;i=function(e,t){var i=0,n=0,r=0,s=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(n=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset&&(s=8)),[0,0,i|n|r|s,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},t=function(e,t){var r,s,a,o,l,u;for(o=e.samples||[],t+=20+16*o.length,a=i(o,t),s=new Uint8Array(a.length+16*o.length),s.set(a),r=a.length,u=0;u<o.length;u++)l=o[u],s[r++]=(4278190080&l.duration)>>>24,s[r++]=(16711680&l.duration)>>>16,s[r++]=(65280&l.duration)>>>8,s[r++]=255&l.duration,s[r++]=(4278190080&l.size)>>>24,s[r++]=(16711680&l.size)>>>16,s[r++]=(65280&l.size)>>>8,s[r++]=255&l.size,s[r++]=l.flags.isLeading<<2|l.flags.dependsOn,s[r++]=l.flags.isDependedOn<<6|l.flags.hasRedundancy<<4|l.flags.paddingValue<<1|l.flags.isNonSyncSample,s[r++]=61440&l.flags.degradationPriority,s[r++]=15&l.flags.degradationPriority,s[r++]=(4278190080&l.compositionTimeOffset)>>>24,s[r++]=(16711680&l.compositionTimeOffset)>>>16,s[r++]=(65280&l.compositionTimeOffset)>>>8,s[r++]=255&l.compositionTimeOffset;return n(w.trun,s)},e=function(e,t){var r,s,a,o,l,u;for(o=e.samples||[],t+=20+8*o.length,a=i(o,t),r=new Uint8Array(a.length+8*o.length),r.set(a),s=a.length,u=0;u<o.length;u++)l=o[u],r[s++]=(4278190080&l.duration)>>>24,r[s++]=(16711680&l.duration)>>>16,r[s++]=(65280&l.duration)>>>8,r[s++]=255&l.duration,r[s++]=(4278190080&l.size)>>>24,r[s++]=(16711680&l.size)>>>16,r[s++]=(65280&l.size)>>>8,r[s++]=255&l.size;return n(w.trun,r)},E=function(i,n){return"audio"===i.type?e(i,n):t(i,n)}}();var z,W,$,G,X,K,Y,Q,J={ftyp:a,mdat:o,moof:c,moov:h,initSegment:function(e){var t,i=a(),n=h(e);return t=new Uint8Array(i.byteLength+n.byteLength),t.set(i),t.set(n,i.byteLength),t}},Z=function(e){var t,i,n=[],r=[];for(r.byteLength=0,r.nalCount=0,r.duration=0,n.byteLength=0,t=0;t<e.length;t++)i=e[t],"access_unit_delimiter_rbsp"===i.nalUnitType?(n.length&&(n.duration=i.dts-n.dts,r.byteLength+=n.byteLength,r.nalCount+=n.length,r.duration+=n.duration,r.push(n)),n=[i],n.byteLength=i.data.byteLength,n.pts=i.pts,n.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(n.keyFrame=!0),n.duration=i.dts-n.dts,n.byteLength+=i.data.byteLength,n.push(i));return r.length&&(!n.duration||n.duration<=0)&&(n.duration=r[r.length-1].duration),r.byteLength+=n.byteLength,r.nalCount+=n.length,r.duration+=n.duration,r.push(n),r},ee=function(e){var t,i,n=[],r=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=e[0].pts,n.dts=e[0].dts,r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,t=0;t<e.length;t++)i=e[t],i.keyFrame?(n.length&&(r.push(n),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration),n=[i],n.nalCount=i.length,n.byteLength=i.byteLength,n.pts=i.pts,n.dts=i.dts,n.duration=i.duration):(n.duration+=i.duration,n.nalCount+=i.length,n.byteLength+=i.byteLength,n.push(i));return r.length&&n.duration<=0&&(n.duration=r[r.length-1].duration),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration,r.push(n),r},te=function(e){var t;return!e[0][0].keyFrame&&e.length>1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},ie=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},ne=function(e,t){var i=ie();return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i},re=function(e,t){var i,n,r,s,a,o=t||0,l=[];for(i=0;i<e.length;i++)for(s=e[i],n=0;n<s.length;n++)a=s[n],r=ne(a,o),o+=r.size,l.push(r);return l},se=function(e){var t,i,n,r,s,a,o=0,l=e.byteLength,u=e.nalCount,c=l+4*u,h=new Uint8Array(c),d=new DataView(h.buffer);for(t=0;t<e.length;t++)for(r=e[t],i=0;i<r.length;i++)for(s=r[i],n=0;n<s.length;n++)a=s[n],d.setUint32(o,a.data.byteLength),o+=4,h.set(a.data,o),o+=a.data.byteLength;return h},ae=function(e,t){var i,n=t||0,r=[];return i=ne(e,n),r.push(i),r},oe=function(e){var t,i,n=0,r=e.byteLength,s=e.length,a=r+4*s,o=new Uint8Array(a),l=new DataView(o.buffer);for(t=0;t<e.length;t++)i=e[t],l.setUint32(n,i.data.byteLength),n+=4,o.set(i.data,n),n+=i.data.byteLength;return o},le={groupNalsIntoFrames:Z,groupFramesIntoGops:ee,extendFirstKeyFrame:te,generateSampleTable:re,concatenateNalData:se,generateSampleTableForFrame:ae,concatenateNalDataForFrame:oe},ue=[33,16,5,32,164,27],ce=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],he=function(e){var t=[];while(e--)t.push(0);return t},de=function(e){return Object.keys(e).reduce((function(t,i){return t[i]=new Uint8Array(e[i].reduce((function(e,t){return e.concat(t)}),[])),t}),{})},pe=function(){if(!z){var e={96e3:[ue,[227,64],he(154),[56]],88200:[ue,[231],he(170),[56]],64e3:[ue,[248,192],he(240),[56]],48e3:[ue,[255,192],he(268),[55,148,128],he(54),[112]],44100:[ue,[255,192],he(268),[55,163,128],he(84),[112]],32e3:[ue,[255,192],he(268),[55,234],he(226),[112]],24e3:[ue,[255,192],he(268),[55,255,128],he(268),[111,112],he(126),[224]],16e3:[ue,[255,192],he(268),[55,255,128],he(268),[111,255],he(269),[223,108],he(195),[1,192]],12e3:[ce,he(268),[3,127,248],he(268),[6,255,240],he(268),[13,255,224],he(268),[27,253,128],he(259),[56]],11025:[ce,he(268),[3,127,248],he(268),[6,255,240],he(268),[13,255,224],he(268),[27,255,192],he(268),[55,175,128],he(108),[112]],8e3:[ce,he(268),[3,121,16],he(47),[7]]};z=de(e)}return z},fe=9e4;W=function(e){return e*fe},$=function(e,t){return e*t},G=function(e){return e/fe},X=function(e,t){return e/t},K=function(e,t){return W(X(e,t))},Y=function(e,t){return $(G(e),t)},Q=function(e,t,i){return G(i?e:e-t)};var me={ONE_SECOND_IN_TS:fe,secondsToVideoTs:W,secondsToAudioTs:$,videoTsToSeconds:G,audioTsToSeconds:X,audioTsToVideoTs:K,videoTsToAudioTs:Y,metadataTsToSeconds:Q},ge=pe,ye=me,ve=function(e){var t,i,n=0;for(t=0;t<e.length;t++)i=e[t],n+=i.data.byteLength;return n},_e=function(e,t,i,n){var r,s,a,o,l=0,u=0,c=0,h=0;if(t.length&&(r=ye.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),l=Math.ceil(ye.ONE_SECOND_IN_TS/(e.samplerate/1024)),i&&n&&(u=r-Math.max(i,n),c=Math.floor(u/l),h=c*l),!(c<1||h>ye.ONE_SECOND_IN_TS/2))){for(s=ge()[e.samplerate],s||(s=t[0].data),a=0;a<c;a++)o=t[0],t.splice(0,0,{data:s,dts:o.dts-l,pts:o.pts-l});return e.baseMediaDecodeTime-=Math.floor(ye.videoTsToAudioTs(h,e.samplerate)),h}},be=function(e,t,i){return t.minSegmentDts>=i?e:(t.minSegmentDts=1/0,e.filter((function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)})))},Te=function(e){var t,i,n=[];for(t=0;t<e.length;t++)i=e[t],n.push({size:i.data.byteLength,duration:1024});return n},Se=function(e){var t,i,n=0,r=new Uint8Array(ve(e));for(t=0;t<e.length;t++)i=e[t],r.set(i.data,n),n+=i.data.byteLength;return r},ke={prefixWithSilence:_e,trimAdtsFramesByEarliestDts:be,generateSampleTable:Te,concatenateFrameData:Se},Ee=me.ONE_SECOND_IN_TS,we=function(e,t){"number"===typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"===typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))},Ce=function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},xe=function(e,t){var i,n,r=e.minSegmentDts;return t||(r-=e.timelineStartInfo.dts),i=e.timelineStartInfo.baseMediaDecodeTime,i+=r,i=Math.max(0,i),"audio"===e.type&&(n=e.samplerate/Ee,i*=n,i=Math.floor(i)),i},Ae={clearDtsInfo:Ce,calculateTrackBaseMediaDecodeTime:xe,collectDtsInfo:we},Ie=4,Oe=128,Pe=function(e){var t=0,i={payloadType:-1,payloadSize:0},n=0,r=0;while(t<e.byteLength){if(e[t]===Oe)break;while(255===e[t])n+=255,t++;n+=e[t++];while(255===e[t])r+=255,t++;if(r+=e[t++],!i.payload&&n===Ie){var s=String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6]);if("GA94"===s){i.payloadType=n,i.payloadSize=r,i.payload=e.subarray(t,t+r);break}i.payload=void 0}t+=r,n=0,r=0}return i},Le=function(e){return 181!==e.payload[0]||49!==(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},De=function(e,t){var i,n,r,s,a=[];if(!(64&t[0]))return a;for(n=31&t[0],i=0;i<n;i++)r=3*i,s={type:3&t[r+2],pts:e},4&t[r+2]&&(s.ccData=t[r+3]<<8|t[r+4],a.push(s));return a},Me=function(e){var t,i,n=e.byteLength,r=[],s=1;while(s<n-2)0===e[s]&&0===e[s+1]&&3===e[s+2]?(r.push(s+2),s+=2):s++;if(0===r.length)return e;t=n-r.length,i=new Uint8Array(t);var a=0;for(s=0;s<t;a++,s++)a===r[0]&&(a++,r.shift()),i[s]=e[a];return i},Re={parseSei:Pe,parseUserData:Le,parseCaptionPackets:De,discardEmulationPreventionBytes:Me,USER_DATA_REGISTERED_ITU_T_T35:Ie},Ne=U,je=Re,Be=function(e){e=e||{},Be.prototype.init.call(this),this.parse708captions_="boolean"!==typeof e.parse708captions||e.parse708captions,this.captionPackets_=[],this.ccStreams_=[new Ye(0,0),new Ye(0,1),new Ye(1,0),new Ye(1,1)],this.parse708captions_&&(this.cc708Stream_=new ze({captionServices:e.captionServices})),this.reset(),this.ccStreams_.forEach((function(e){e.on("data",this.trigger.bind(this,"data")),e.on("partialdone",this.trigger.bind(this,"partialdone")),e.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")))};Be.prototype=new Ne,Be.prototype.push=function(e){var t,i,n;if("sei_rbsp"===e.nalUnitType&&(t=je.parseSei(e.escapedRBSP),t.payload&&t.payloadType===je.USER_DATA_REGISTERED_ITU_T_T35&&(i=je.parseUserData(t),i)))if(e.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));n=je.parseCaptionPackets(e.pts,i),this.captionPackets_=this.captionPackets_.concat(n),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},Be.prototype.flushCCStreams=function(e){this.ccStreams_.forEach((function(t){return"flush"===e?t.flush():t.partialFlush()}),this)},Be.prototype.flushStream=function(e){this.captionPackets_.length?(this.captionPackets_.forEach((function(e,t){e.presortIndex=t})),this.captionPackets_.sort((function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts})),this.captionPackets_.forEach((function(e){e.type<2?this.dispatchCea608Packet(e):this.dispatchCea708Packet(e)}),this),this.captionPackets_.length=0,this.flushCCStreams(e)):this.flushCCStreams(e)},Be.prototype.flush=function(){return this.flushStream("flush")},Be.prototype.partialFlush=function(){return this.flushStream("partialFlush")},Be.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(e){e.reset()}))},Be.prototype.dispatchCea608Packet=function(e){this.setsTextOrXDSActive(e)?this.activeCea608Channel_[e.type]=null:this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},Be.prototype.setsChannel1Active=function(e){return 4096===(30720&e.ccData)},Be.prototype.setsChannel2Active=function(e){return 6144===(30720&e.ccData)},Be.prototype.setsTextOrXDSActive=function(e){return 256===(28928&e.ccData)||4138===(30974&e.ccData)||6186===(30974&e.ccData)},Be.prototype.dispatchCea708Packet=function(e){this.parse708captions_&&this.cc708Stream_.push(e)};var Ue={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},Fe=function(e){var t=Ue[e]||e;return 4096&e&&e===t?"":String.fromCharCode(t)},qe=function(e){return 32<=e&&e<=127||160<=e&&e<=255},He=function(e){this.windowNum=e,this.reset()};He.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},He.prototype.getText=function(){return this.rows.join("\n")},He.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},He.prototype.newLine=function(e){this.rows.length>=this.virtualRowCount&&"function"===typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);while(this.rows.length>this.virtualRowCount)this.rows.shift(),this.rowIdx--},He.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},He.prototype.addText=function(e){this.rows[this.rowIdx]+=e},He.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var Ve=function(e,t,i){this.serviceNum=e,this.text="",this.currentWindow=new He(-1),this.windows=[],this.stream=i,"string"===typeof t&&this.createTextDecoder(t)};Ve.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++)this.windows[i]=new He(i),"function"===typeof t&&(this.windows[i].beforeRowOverflow=t)},Ve.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},Ve.prototype.createTextDecoder=function(e){if("undefined"===typeof TextDecoder)this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(e)}catch(t){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+e+" encoding. "+t})}};var ze=function(e){e=e||{},ze.prototype.init.call(this);var t,i=this,n=e.captionServices||{},r={};Object.keys(n).forEach(e=>{t=n[e],/^SERVICE/.test(e)&&(r[e]=t.encoding)}),this.serviceEncodings=r,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(i.new708Packet(),i.add708Bytes(e)):(null===i.current708Packet&&i.new708Packet(),i.add708Bytes(e))}};ze.prototype=new Ne,ze.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},ze.prototype.add708Bytes=function(e){var t=e.ccData,i=t>>>8,n=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(i),this.current708Packet.data.push(n)},ze.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,i=null,n=null,r=0,s=t[r++];for(e.seq=s>>6,e.sizeCode=63&s;r<t.length;r++)s=t[r++],i=s>>5,n=31&s,7===i&&n>0&&(s=t[r++],i=s),this.pushServiceBlock(i,r,n),n>0&&(r+=n-1)},ze.prototype.pushServiceBlock=function(e,t,i){var n,r=t,s=this.current708Packet.data,a=this.services[e];for(a||(a=this.initService(e,r));r<t+i&&r<s.length;r++)n=s[r],qe(n)?r=this.handleText(r,a):24===n?r=this.multiByteCharacter(r,a):16===n?r=this.extendedCommands(r,a):128<=n&&n<=135?r=this.setCurrentWindow(r,a):152<=n&&n<=159?r=this.defineWindow(r,a):136===n?r=this.clearWindows(r,a):140===n?r=this.deleteWindows(r,a):137===n?r=this.displayWindows(r,a):138===n?r=this.hideWindows(r,a):139===n?r=this.toggleWindows(r,a):151===n?r=this.setWindowAttributes(r,a):144===n?r=this.setPenAttributes(r,a):145===n?r=this.setPenColor(r,a):146===n?r=this.setPenLocation(r,a):143===n?a=this.reset(r,a):8===n?a.currentWindow.backspace():12===n?a.currentWindow.clearText():13===n?a.currentWindow.pendingNewLine=!0:14===n?a.currentWindow.clearText():141===n&&r++},ze.prototype.extendedCommands=function(e,t){var i=this.current708Packet.data,n=i[++e];return qe(n)&&(e=this.handleText(e,t,{isExtended:!0})),e},ze.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},ze.prototype.initService=function(e,t){var i,n="SERVICE"+e,r=this;return n in this.serviceEncodings&&(i=this.serviceEncodings[n]),this.services[e]=new Ve(e,i,r),this.services[e].init(this.getPts(t),(function(t){r.flushDisplayed(t,r.services[e])})),this.services[e]},ze.prototype.handleText=function(e,t,i){var n,r,s=i&&i.isExtended,a=i&&i.isMultiByte,o=this.current708Packet.data,l=s?4096:0,u=o[e],c=o[e+1],h=t.currentWindow;function d(e){return e.map(e=>("0"+(255&e).toString(16)).slice(-2)).join("")}if(a?(r=[u,c],e++):r=[u],t.textDecoder_&&!s)n=t.textDecoder_.decode(new Uint8Array(r));else if(a){const e=d(r);n=String.fromCharCode(parseInt(e,16))}else n=Fe(l|u);return h.pendingNewLine&&!h.isEmpty()&&h.newLine(this.getPts(e)),h.pendingNewLine=!1,h.addText(n),e},ze.prototype.multiByteCharacter=function(e,t){var i=this.current708Packet.data,n=i[e+1],r=i[e+2];return qe(n)&&qe(r)&&(e=this.handleText(++e,t,{isMultiByte:!0})),e},ze.prototype.setCurrentWindow=function(e,t){var i=this.current708Packet.data,n=i[e],r=7&n;return t.setCurrentWindow(r),e},ze.prototype.defineWindow=function(e,t){var i=this.current708Packet.data,n=i[e],r=7&n;t.setCurrentWindow(r);var s=t.currentWindow;return n=i[++e],s.visible=(32&n)>>5,s.rowLock=(16&n)>>4,s.columnLock=(8&n)>>3,s.priority=7&n,n=i[++e],s.relativePositioning=(128&n)>>7,s.anchorVertical=127&n,n=i[++e],s.anchorHorizontal=n,n=i[++e],s.anchorPoint=(240&n)>>4,s.rowCount=15&n,n=i[++e],s.columnCount=63&n,n=i[++e],s.windowStyle=(56&n)>>3,s.penStyle=7&n,s.virtualRowCount=s.rowCount+1,e},ze.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.winAttr;return n=i[++e],r.fillOpacity=(192&n)>>6,r.fillRed=(48&n)>>4,r.fillGreen=(12&n)>>2,r.fillBlue=3&n,n=i[++e],r.borderType=(192&n)>>6,r.borderRed=(48&n)>>4,r.borderGreen=(12&n)>>2,r.borderBlue=3&n,n=i[++e],r.borderType+=(128&n)>>5,r.wordWrap=(64&n)>>6,r.printDirection=(48&n)>>4,r.scrollDirection=(12&n)>>2,r.justify=3&n,n=i[++e],r.effectSpeed=(240&n)>>4,r.effectDirection=(12&n)>>2,r.displayEffect=3&n,e},ze.prototype.flushDisplayed=function(e,t){for(var i=[],n=0;n<8;n++)t.windows[n].visible&&!t.windows[n].isEmpty()&&i.push(t.windows[n].getText());t.endPts=e,t.text=i.join("\n\n"),this.pushCaption(t),t.startPts=e},ze.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},ze.prototype.displayWindows=function(e,t){var i=this.current708Packet.data,n=i[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var s=0;s<8;s++)n&1<<s&&(t.windows[s].visible=1);return e},ze.prototype.hideWindows=function(e,t){var i=this.current708Packet.data,n=i[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var s=0;s<8;s++)n&1<<s&&(t.windows[s].visible=0);return e},ze.prototype.toggleWindows=function(e,t){var i=this.current708Packet.data,n=i[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var s=0;s<8;s++)n&1<<s&&(t.windows[s].visible^=1);return e},ze.prototype.clearWindows=function(e,t){var i=this.current708Packet.data,n=i[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var s=0;s<8;s++)n&1<<s&&t.windows[s].clearText();return e},ze.prototype.deleteWindows=function(e,t){var i=this.current708Packet.data,n=i[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var s=0;s<8;s++)n&1<<s&&t.windows[s].reset();return e},ze.prototype.setPenAttributes=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penAttr;return n=i[++e],r.textTag=(240&n)>>4,r.offset=(12&n)>>2,r.penSize=3&n,n=i[++e],r.italics=(128&n)>>7,r.underline=(64&n)>>6,r.edgeType=(56&n)>>3,r.fontStyle=7&n,e},ze.prototype.setPenColor=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penColor;return n=i[++e],r.fgOpacity=(192&n)>>6,r.fgRed=(48&n)>>4,r.fgGreen=(12&n)>>2,r.fgBlue=3&n,n=i[++e],r.bgOpacity=(192&n)>>6,r.bgRed=(48&n)>>4,r.bgGreen=(12&n)>>2,r.bgBlue=3&n,n=i[++e],r.edgeRed=(48&n)>>4,r.edgeGreen=(12&n)>>2,r.edgeBlue=3&n,e},ze.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,n=i[++e],r.row=15&n,n=i[++e],r.column=63&n,e},ze.prototype.reset=function(e,t){var i=this.getPts(e);return this.flushDisplayed(i,t),this.initService(t.serviceNum,e)};var We={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},$e=function(e){return null===e?"":(e=We[e]||e,String.fromCharCode(e))},Ge=14,Xe=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Ke=function(){var e=[],t=Ge+1;while(t--)e.push({text:"",indent:0,offset:0});return e},Ye=function(e,t){Ye.prototype.init.call(this),this.field_=e||0,this.dataChannel_=t||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,i,n,r,s;if(t=32639&e.ccData,t!==this.lastControlCode_){if(4096===(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),n=t>>>8,r=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?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(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=Ke();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Ke();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Ke()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(n,r))n=(3&n)<<8,s=$e(n|r),this[this.mode_](e.pts,s),this.column_++;else if(this.isExtCharacter(n,r))"popOn"===this.mode_?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),n=(3&n)<<8,s=$e(n|r),this[this.mode_](e.pts,s),this.column_++;else if(this.isMidRowCode(n,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14===(14&r)&&this.addFormatting(e.pts,["i"]),1===(1&r)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(n,r)){const e=3&r;this.nonDisplayed_[this.row_].offset=e,this.column_+=e}else if(this.isPAC(n,r)){var a=Xe.indexOf(7968&t);if("rollUp"===this.mode_&&(a-this.rollUpRows_+1<0&&(a=this.rollUpRows_-1),this.setRollUp(e.pts,a)),a!==this.row_&&a>=0&&a<=14&&(this.clearFormatting(e.pts),this.row_=a),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16===(16&t)){const e=(14&t)>>1;this.column_=4*e,this.nonDisplayed_[this.row_].indent+=e}this.isColorPAC(r)&&14===(14&r)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(n)&&(0===r&&(r=null),s=$e(n),s+=$e(r),this[this.mode_](e.pts,s),this.column_+=s.length)}else this.lastControlCode_=null}};Ye.prototype=new Ne,Ye.prototype.flushDisplayed=function(e){const t=e=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+e+"."})},i=[];this.displayed_.forEach((e,n)=>{if(e&&e.text&&e.text.length){try{e.text=e.text.trim()}catch(r){t(n)}e.text.length&&i.push({text:e.text,line:n+1,position:10+Math.min(70,10*e.indent)+2.5*e.offset})}else void 0!==e&&null!==e||t(n)}),i.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,content:i,stream:this.name_})},Ye.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Ke(),this.nonDisplayed_=Ke(),this.lastControlCode_=null,this.column_=0,this.row_=Ge,this.rollUpRows_=2,this.formatting_=[]},Ye.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},Ye.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},Ye.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},Ye.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},Ye.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},Ye.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},Ye.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},Ye.prototype.isNormalChar=function(e){return e>=32&&e<=127},Ye.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=Ge,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Ke(),this.displayed_=Ke()),void 0!==t&&t!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[t-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]={text:"",indent:0,offset:0};void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},Ye.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var i=t.reduce((function(e,t){return e+"<"+t+">"}),"");this[this.mode_](e,i)},Ye.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce((function(e,t){return e+"</"+t+">"}),"");this.formatting_=[],this[this.mode_](e,t)}},Ye.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_].text;i+=t,this.nonDisplayed_[this.row_].text=i},Ye.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_].text;i+=t,this.displayed_[this.row_].text=i},Ye.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++)this.displayed_[e]={text:"",indent:0,offset:0};for(e=this.row_+1;e<Ge+1;e++)this.displayed_[e]={text:"",indent:0,offset:0};for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}},Ye.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_].text;i+=t,this.displayed_[this.row_].text=i};var Qe={CaptionStream:Be,Cea608Stream:Ye,Cea708Stream:ze},Je={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Ze=U,et=8589934592,tt=4294967296,it="shared",nt=function(e,t){var i=1;e>t&&(i=-1);while(Math.abs(t-e)>tt)e+=i*et;return e},rt=function(e){var t,i;rt.prototype.init.call(this),this.type_=e||it,this.push=function(e){"metadata"!==e.type?this.type_!==it&&e.type!==this.type_||(void 0===i&&(i=e.dts),e.dts=nt(e.dts,i),e.pts=nt(e.pts,i),t=e.dts,this.trigger("data",e)):this.trigger("data",e)},this.flush=function(){i=t,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){i=void 0,t=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};rt.prototype=new Ze;var st,at={TimestampRolloverStream:rt,handleRollover:nt},ot=(e,t,i)=>{if(!e)return-1;for(var n=i;n<e.length;n++)if(e[n]===t)return n;return-1},lt={typedArrayIndexOf:ot},ut=lt.typedArrayIndexOf,ct={Iso88591:0,Utf16:1,Utf16be:2,Utf8:3},ht=function(e,t,i){var n,r="";for(n=t;n<i;n++)r+="%"+("00"+e[n].toString(16)).slice(-2);return r},dt=function(e,t,i){return decodeURIComponent(ht(e,t,i))},pt=function(e,t,i){return unescape(ht(e,t,i))},ft=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},mt={APIC:function(e){var t,i,n=1,r="--\x3e";e.data[0]===ct.Utf8&&(t=ut(e.data,0,n),t<0||(e.mimeType=pt(e.data,n,t),n=t+1,e.pictureType=e.data[n],n++,i=ut(e.data,0,n),i<0||(e.description=dt(e.data,n,i),n=i+1,e.mimeType===r?e.url=pt(e.data,n,e.data.length):e.pictureData=e.data.subarray(n,e.data.length))))},"T*":function(e){e.data[0]===ct.Utf8&&(e.value=dt(e.data,1,e.data.length).replace(/\0*$/,""),e.values=e.value.split("\0"))},TXXX:function(e){var t;e.data[0]===ct.Utf8&&(t=ut(e.data,0,1),-1!==t&&(e.description=dt(e.data,1,t),e.value=dt(e.data,t+1,e.data.length).replace(/\0*$/,""),e.data=e.value))},"W*":function(e){e.url=pt(e.data,0,e.data.length).replace(/\0.*$/,"")},WXXX:function(e){var t;e.data[0]===ct.Utf8&&(t=ut(e.data,0,1),-1!==t&&(e.description=dt(e.data,1,t),e.url=pt(e.data,t+1,e.data.length).replace(/\0.*$/,"")))},PRIV:function(e){var t;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=pt(e.data,0,t);break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}},gt=function(e){var t,i,n=10,r=0,s=[];if(!(e.length<10||e[0]!=="I".charCodeAt(0)||e[1]!=="D".charCodeAt(0)||e[2]!=="3".charCodeAt(0))){r=ft(e.subarray(6,10)),r+=10;var a=64&e[5];a&&(n+=4,n+=ft(e.subarray(10,14)),r-=ft(e.subarray(16,20)));do{if(t=ft(e.subarray(n+4,n+8)),t<1)break;i=String.fromCharCode(e[n],e[n+1],e[n+2],e[n+3]);var o={id:i,data:e.subarray(n+10,n+t+10)};o.key=o.id,mt[o.id]?mt[o.id](o):"T"===o.id[0]?mt["T*"](o):"W"===o.id[0]&&mt["W*"](o),s.push(o),n+=10,n+=t}while(n<r);return s}},yt={parseId3Frames:gt,parseSyncSafeInteger:ft,frameParsers:mt},vt=U,_t=Je,bt=yt;st=function(e){var t,i={descriptor:e&&e.descriptor},n=0,r=[],s=0;if(st.prototype.init.call(this),this.dispatchType=_t.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(t=0;t<i.descriptor.length;t++)this.dispatchType+=("00"+i.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,i,a,o,l,u;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(s=0,r.length=0),0===r.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});else if(r.push(e),s+=e.data.byteLength,1===r.length&&(n=bt.parseSyncSafeInteger(e.data.subarray(6,10)),n+=10),!(s<n)){for(t={data:new Uint8Array(n),frames:[],pts:r[0].pts,dts:r[0].dts},l=0;l<n;)t.data.set(r[0].data.subarray(0,n-l),l),l+=r[0].data.byteLength,s-=r[0].data.byteLength,r.shift();i=10,64&t.data[5]&&(i+=4,i+=bt.parseSyncSafeInteger(t.data.subarray(10,14)),n-=bt.parseSyncSafeInteger(t.data.subarray(16,20)));do{if(a=bt.parseSyncSafeInteger(t.data.subarray(i+4,i+8)),a<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if(u=String.fromCharCode(t.data[i],t.data[i+1],t.data[i+2],t.data[i+3]),o={id:u,data:t.data.subarray(i+10,i+a+10)},o.key=o.id,bt.frameParsers[o.id]?bt.frameParsers[o.id](o):"T"===o.id[0]?bt.frameParsers["T*"](o):"W"===o.id[0]&&bt.frameParsers["W*"](o),"com.apple.streaming.transportStreamTimestamp"===o.owner){var c=o.data,h=(1&c[3])<<30|c[4]<<22|c[5]<<14|c[6]<<6|c[7]>>>2;h*=4,h+=3&c[7],o.timeStamp=h,void 0===t.pts&&void 0===t.dts&&(t.pts=o.timeStamp,t.dts=o.timeStamp),this.trigger("timestamp",o)}t.frames.push(o),i+=10,i+=a}while(i<n);this.trigger("data",t)}}},st.prototype=new vt;var Tt,St,kt,Et=st,wt=U,Ct=Qe,xt=Je,At=at.TimestampRolloverStream,It=188,Ot=71;Tt=function(){var e=new Uint8Array(It),t=0;Tt.prototype.init.call(this),this.push=function(i){var n,r=0,s=It;t?(n=new Uint8Array(i.byteLength+t),n.set(e.subarray(0,t)),n.set(i,t),t=0):n=i;while(s<n.byteLength)n[r]!==Ot||n[s]!==Ot?(r++,s++):(this.trigger("data",n.subarray(r,s)),r+=It,s+=It);r<n.byteLength&&(e.set(n.subarray(r),0),t=n.byteLength-r)},this.flush=function(){t===It&&e[0]===Ot&&(this.trigger("data",e),t=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){t=0,this.trigger("reset")}},Tt.prototype=new wt,St=function(){var e,t,i,n;St.prototype.init.call(this),n=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,n){var r=0;n.payloadUnitStartIndicator&&(r+=e[r]+1),"pat"===n.type?t(e.subarray(r),n):i(e.subarray(r),n)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],n.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=n.pmtPid},i=function(e,t){var i,r,s,a;if(1&e[5]){n.programMapTable={video:null,audio:null,"timed-metadata":{}},i=(15&e[1])<<8|e[2],r=3+i-4,s=(15&e[10])<<8|e[11],a=12+s;while(a<r){var o=e[a],l=(31&e[a+1])<<8|e[a+2];o===xt.H264_STREAM_TYPE&&null===n.programMapTable.video?n.programMapTable.video=l:o===xt.ADTS_STREAM_TYPE&&null===n.programMapTable.audio?n.programMapTable.audio=l:o===xt.METADATA_STREAM_TYPE&&(n.programMapTable["timed-metadata"][l]=o),a+=5+((15&e[a+3])<<8|e[a+4])}t.programMapTable=n.programMapTable}},this.push=function(t){var i={},n=4;if(i.payloadUnitStartIndicator=!!(64&t[1]),i.pid=31&t[1],i.pid<<=8,i.pid|=t[2],(48&t[3])>>>4>1&&(n+=t[n]+1),0===i.pid)i.type="pat",e(t.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid){i.type="pmt",e(t.subarray(n),i),this.trigger("data",i);while(this.packetsWaitingForPmt.length)this.processPes_.apply(this,this.packetsWaitingForPmt.shift())}else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,n,i]):this.processPes_(t,n,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=xt.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=xt.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}},St.prototype=new wt,St.STREAM_TYPES={h264:27,adts:15},kt=function(){var e,t=this,i=!1,n={data:[],size:0},r={data:[],size:0},s={data:[],size:0},a=function(e,t){var i;const n=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array,1===n&&(t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=0!==(4&e[6]),i=e[7],192&i&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&i&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8]))},o=function(e,i,n){var r,s=new Uint8Array(e.size),o={type:i},l=0,u=0,c=!1;if(e.data.length&&!(e.size<9)){for(o.trackId=e.data[0].pid,l=0;l<e.data.length;l++)r=e.data[l],s.set(r.data,u),u+=r.data.byteLength;a(s,o),c="video"===i||o.packetLength<=e.size,(n||c)&&(e.size=0,e.data.length=0),c&&t.trigger("data",o)}};kt.prototype.init.call(this),this.push=function(a){({pat:function(){},pes:function(){var e,t;switch(a.streamType){case xt.H264_STREAM_TYPE:e=n,t="video";break;case xt.ADTS_STREAM_TYPE:e=r,t="audio";break;case xt.METADATA_STREAM_TYPE:e=s,t="timed-metadata";break;default:return}a.payloadUnitStartIndicator&&o(e,t,!0),e.data.push(a),e.size+=a.data.byteLength},pmt:function(){var n={type:"metadata",tracks:[]};e=a.programMapTable,null!==e.video&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),i=!0,t.trigger("data",n)}})[a.type]()},this.reset=function(){n.size=0,n.data.length=0,r.size=0,r.data.length=0,this.trigger("reset")},this.flushStreams_=function(){o(n,"video"),o(r,"audio"),o(s,"timed-metadata")},this.flush=function(){if(!i&&e){var n={type:"metadata",tracks:[]};null!==e.video&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",n)}i=!1,this.flushStreams_(),this.trigger("done")}},kt.prototype=new wt;var Pt={PAT_PID:0,MP2T_PACKET_LENGTH:It,TransportPacketStream:Tt,TransportParseStream:St,ElementaryStream:kt,TimestampRolloverStream:At,CaptionStream:Ct.CaptionStream,Cea608Stream:Ct.Cea608Stream,Cea708Stream:Ct.Cea708Stream,MetadataStream:Et};for(var Lt in xt)xt.hasOwnProperty(Lt)&&(Pt[Lt]=xt[Lt]);var Dt,Mt=Pt,Rt=U,Nt=me.ONE_SECOND_IN_TS,jt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];Dt=function(e){var t,i=0;Dt.prototype.init.call(this),this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:`adts skiping bytes ${e} to ${t} in frame ${i} outside syncword`})},this.push=function(n){var r,s,a,o,l,u=0;if(e||(i=0),"audio"===n.type){var c;t&&t.length?(a=t,t=new Uint8Array(a.byteLength+n.data.byteLength),t.set(a),t.set(n.data,a.byteLength)):t=n.data;while(u+7<t.length)if(255===t[u]&&240===(246&t[u+1])){if("number"===typeof c&&(this.skipWarn_(c,u),c=null),s=2*(1&~t[u+1]),r=(3&t[u+3])<<11|t[u+4]<<3|(224&t[u+5])>>5,o=1024*(1+(3&t[u+6])),l=o*Nt/jt[(60&t[u+2])>>>2],t.byteLength-u<r)break;this.trigger("data",{pts:n.pts+i*l,dts:n.dts+i*l,sampleCount:o,audioobjecttype:1+(t[u+2]>>>6&3),channelcount:(1&t[u+2])<<2|(192&t[u+3])>>>6,samplerate:jt[(60&t[u+2])>>>2],samplingfrequencyindex:(60&t[u+2])>>>2,samplesize:16,data:t.subarray(u+7+s,u+r)}),i++,u+=r}else"number"!==typeof c&&(c=u),u++;"number"===typeof c&&(this.skipWarn_(c,u),c=null),t=t.subarray(u)}},this.flush=function(){i=0,this.trigger("done")},this.reset=function(){t=void 0,this.trigger("reset")},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline")}},Dt.prototype=new Rt;var Bt,Ut=Dt;Bt=function(e){var t=e.byteLength,i=0,n=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+n},this.loadWord=function(){var r=e.byteLength-t,s=new Uint8Array(4),a=Math.min(4,t);if(0===a)throw new Error("no bytes available");s.set(e.subarray(r,r+a)),i=new DataView(s.buffer).getUint32(0),n=8*a,t-=a},this.skipBits=function(e){var r;n>e?(i<<=e,n-=e):(e-=n,r=Math.floor(e/8),e-=8*r,t-=r,this.loadWord(),i<<=e,n-=e)},this.readBits=function(e){var r=Math.min(n,e),s=i>>>32-r;return n-=r,n>0?i<<=r:t>0&&this.loadWord(),r=e-r,r>0?s<<r|this.readBits(r):s},this.skipLeadingZeros=function(){var e;for(e=0;e<n;++e)if(0!==(i&2147483648>>>e))return i<<=e,n-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var Ft,qt,Ht,Vt=Bt,zt=U,Wt=Vt;qt=function(){var e,t,i=0;qt.prototype.init.call(this),this.push=function(n){var r;t?(r=new Uint8Array(t.byteLength+n.data.byteLength),r.set(t),r.set(n.data,t.byteLength),t=r):t=n.data;for(var s=t.byteLength;i<s-3;i++)if(1===t[i+2]){e=i+5;break}while(e<s)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}i+3!==e-2&&this.trigger("data",t.subarray(i+3,e-2));do{e++}while(1!==t[e]&&e<s);i=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(i+3,e-2)),i=e-2,e+=3;break;default:e+=3;break}t=t.subarray(i),e-=i,i=0},this.reset=function(){t=null,i=0,this.trigger("reset")},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},qt.prototype=new zt,Ht={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Ft=function(){var e,t,i,n,r,s,a,o=new qt;Ft.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,n=e.dts,o.push(e))},o.on("data",(function(a){var o={trackId:t,pts:i,dts:n,data:a,nalUnitTypeCode:31&a[0]};switch(o.nalUnitTypeCode){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=r(a.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=r(a.subarray(1)),o.config=s(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp";break}e.trigger("data",o)})),o.on("done",(function(){e.trigger("done")})),o.on("partialdone",(function(){e.trigger("partialdone")})),o.on("reset",(function(){e.trigger("reset")})),o.on("endedtimeline",(function(){e.trigger("endedtimeline")})),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},a=function(e,t){var i,n,r=8,s=8;for(i=0;i<e;i++)0!==s&&(n=t.readExpGolomb(),s=(r+n+256)%256),r=0===s?r:s},r=function(e){var t,i,n=e.byteLength,r=[],s=1;while(s<n-2)0===e[s]&&0===e[s+1]&&3===e[s+2]?(r.push(s+2),s+=2):s++;if(0===r.length)return e;t=n-r.length,i=new Uint8Array(t);var a=0;for(s=0;s<t;a++,s++)a===r[0]&&(a++,r.shift()),i[s]=e[a];return i},s=function(e){var t,i,n,r,s,o,l,u,c,h,d,p,f,m=0,g=0,y=0,v=0,_=[1,1];if(t=new Wt(e),i=t.readUnsignedByte(),r=t.readUnsignedByte(),n=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),Ht[i]&&(s=t.readUnsignedExpGolomb(),3===s&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(d=3!==s?8:12,f=0;f<d;f++)t.readBoolean()&&a(f<6?16:64,t);if(t.skipUnsignedExpGolomb(),o=t.readUnsignedExpGolomb(),0===o)t.readUnsignedExpGolomb();else if(1===o)for(t.skipBits(1),t.skipExpGolomb(),t.skipExpGolomb(),l=t.readUnsignedExpGolomb(),f=0;f<l;f++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),u=t.readUnsignedExpGolomb(),c=t.readUnsignedExpGolomb(),h=t.readBits(1),0===h&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(m=t.readUnsignedExpGolomb(),g=t.readUnsignedExpGolomb(),y=t.readUnsignedExpGolomb(),v=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(p=t.readUnsignedByte(),p){case 1:_=[1,1];break;case 2:_=[12,11];break;case 3:_=[10,11];break;case 4:_=[16,11];break;case 5:_=[40,33];break;case 6:_=[24,11];break;case 7:_=[20,11];break;case 8:_=[32,11];break;case 9:_=[80,33];break;case 10:_=[18,11];break;case 11:_=[15,11];break;case 12:_=[64,33];break;case 13:_=[160,99];break;case 14:_=[4,3];break;case 15:_=[3,2];break;case 16:_=[2,1];break;case 255:_=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()];break}_&&(_[0],_[1])}return{profileIdc:i,levelIdc:n,profileCompatibility:r,width:16*(u+1)-2*m-2*g,height:(2-h)*(c+1)*16-2*y-2*v,sarRatio:_}}},Ft.prototype=new zt;var $t,Gt={H264Stream:Ft,NalByteStream:qt},Xt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],Kt=function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],n=e[t+5],r=(16&n)>>4;return i=i>=0?i:0,r?i+20:i+10},Yt=function(e,t){return e.length-t<10||e[t]!=="I".charCodeAt(0)||e[t+1]!=="D".charCodeAt(0)||e[t+2]!=="3".charCodeAt(0)?t:(t+=Kt(e,t),Yt(e,t))},Qt=function(e){var t=Yt(e,0);return e.length>=t+2&&255===(255&e[t])&&240===(240&e[t+1])&&16===(22&e[t+1])},Jt=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Zt=function(e,t,i){var n,r="";for(n=t;n<i;n++)r+="%"+("00"+e[n].toString(16)).slice(-2);return r},ei=function(e,t,i){return unescape(Zt(e,t,i))},ti=function(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3,r=6144&e[t+3];return r|n|i},ii=function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&240===(240&e[t+1])?"audio":null},ni=function(e){var t=0;while(t+5<e.length){if(255===e[t]&&240===(246&e[t+1]))return Xt[(60&e[t+2])>>>2];t++}return null},ri=function(e){var t,i,n,r;t=10,64&e[5]&&(t+=4,t+=Jt(e.subarray(10,14)));do{if(i=Jt(e.subarray(t+4,t+8)),i<1)return null;if(r=String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3]),"PRIV"===r){n=e.subarray(t+10,t+i+10);for(var s=0;s<n.byteLength;s++)if(0===n[s]){var a=ei(n,0,s);if("com.apple.streaming.transportStreamTimestamp"===a){var o=n.subarray(s+1),l=(1&o[3])<<30|o[4]<<22|o[5]<<14|o[6]<<6|o[7]>>>2;return l*=4,l+=3&o[7],l}break}}t+=10,t+=i}while(t<e.byteLength);return null},si={isLikelyAacData:Qt,parseId3TagSize:Kt,parseAdtsSize:ti,parseType:ii,parseSampleRate:ni,parseAacTimestamp:ri},ai=U,oi=si;$t=function(){var e=new Uint8Array,t=0;$t.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(i){var n,r,s,a,o=0,l=0;e.length?(a=e.length,e=new Uint8Array(i.byteLength+a),e.set(e.subarray(0,a)),e.set(i,a)):e=i;while(e.length-l>=3)if(e[l]!=="I".charCodeAt(0)||e[l+1]!=="D".charCodeAt(0)||e[l+2]!=="3".charCodeAt(0))if(255!==(255&e[l])||240!==(240&e[l+1]))l++;else{if(e.length-l<7)break;if(o=oi.parseAdtsSize(e,l),l+o>e.length)break;s={type:"audio",data:e.subarray(l,l+o),pts:t,dts:t},this.trigger("data",s),l+=o}else{if(e.length-l<10)break;if(o=oi.parseId3TagSize(e,l),l+o>e.length)break;r={type:"timed-metadata",data:e.subarray(l,l+o)},this.trigger("data",r),l+=o}n=e.length-l,e=n>0?e.subarray(l):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}},$t.prototype=new ai;var li,ui,ci,hi,di=$t,pi=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],fi=pi,mi=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],gi=mi,yi=U,vi=J,_i=le,bi=ke,Ti=Ae,Si=Mt,ki=me,Ei=Ut,wi=Gt.H264Stream,Ci=di,xi=si.isLikelyAacData,Ai=me.ONE_SECOND_IN_TS,Ii=fi,Oi=gi,Pi=function(e,t){t.stream=e,this.trigger("log",t)},Li=function(e,t){for(var i=Object.keys(t),n=0;n<i.length;n++){var r=i[n];"headOfPipeline"!==r&&t[r].on&&t[r].on("log",Pi.bind(e,r))}},Di=function(e,t){var i;if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0},Mi=function(e,t,i,n,r,s){var a=i-t,o=n-t,l=r-i;return{start:{dts:e,pts:e+a},end:{dts:e+o,pts:e+l},prependedContentDuration:s,baseMediaDecodeTime:e}};ui=function(e,t){var i,n=[],r=0,s=0,a=1/0;t=t||{},i=t.firstSequenceNumber||0,ui.prototype.init.call(this),this.push=function(t){Ti.collectDtsInfo(e,t),e&&Ii.forEach((function(i){e[i]=t[i]})),n.push(t)},this.setEarliestDts=function(e){r=e},this.setVideoBaseMediaDecodeTime=function(e){a=e},this.setAudioAppendStart=function(e){s=e},this.flush=function(){var o,l,u,c,h,d,p;0!==n.length?(o=bi.trimAdtsFramesByEarliestDts(n,e,r),e.baseMediaDecodeTime=Ti.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),p=bi.prefixWithSilence(e,o,s,a),e.samples=bi.generateSampleTable(o),u=vi.mdat(bi.concatenateFrameData(o)),n=[],l=vi.moof(i,[e]),c=new Uint8Array(l.byteLength+u.byteLength),i++,c.set(l),c.set(u,l.byteLength),Ti.clearDtsInfo(e),h=Math.ceil(1024*Ai/e.samplerate),o.length&&(d=o.length*h,this.trigger("segmentTimingInfo",Mi(ki.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),o[0].dts,o[0].pts,o[0].dts+d,o[0].pts+d,p||0)),this.trigger("timingInfo",{start:o[0].pts,end:o[0].pts+d})),this.trigger("data",{track:e,boxes:c}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")},this.reset=function(){Ti.clearDtsInfo(e),n=[],this.trigger("reset")}},ui.prototype=new yi,li=function(e,t){var i,n,r,s=[],a=[];t=t||{},i=t.firstSequenceNumber||0,li.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){Ti.collectDtsInfo(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||n||(n=t.config,e.sps=[t.data],Oi.forEach((function(t){e[t]=n[t]}),this)),"pic_parameter_set_rbsp"!==t.nalUnitType||r||(r=t.data,e.pps=[t.data]),s.push(t)},this.flush=function(){var n,r,o,l,u,c,h,d,p=0;while(s.length){if("access_unit_delimiter_rbsp"===s[0].nalUnitType)break;s.shift()}if(0===s.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(n=_i.groupNalsIntoFrames(s),o=_i.groupFramesIntoGops(n),o[0][0].keyFrame||(r=this.getGopForFusion_(s[0],e),r?(p=r.duration,o.unshift(r),o.byteLength+=r.byteLength,o.nalCount+=r.nalCount,o.pts=r.pts,o.dts=r.dts,o.duration+=r.duration):o=_i.extendFirstKeyFrame(o)),a.length){var f;if(f=t.alignGopsAtEnd?this.alignGopsAtEnd_(o):this.alignGopsAtStart_(o),!f)return this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),s=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");Ti.clearDtsInfo(e),o=f}Ti.collectDtsInfo(e,o),e.samples=_i.generateSampleTable(o),u=vi.mdat(_i.concatenateNalData(o)),e.baseMediaDecodeTime=Ti.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",o.map((function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}))),h=o[0],d=o[o.length-1],this.trigger("segmentTimingInfo",Mi(e.baseMediaDecodeTime,h.dts,h.pts,d.dts+d.duration,d.pts+d.duration,p)),this.trigger("timingInfo",{start:o[0].pts,end:o[o.length-1].pts+o[o.length-1].duration}),this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),s=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),l=vi.moof(i,[e]),c=new Uint8Array(l.byteLength+u.byteLength),i++,c.set(l),c.set(u,l.byteLength),this.trigger("data",{track:e,boxes:c}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),s=[],this.gopCache_.length=0,a.length=0,this.trigger("reset")},this.resetStream_=function(){Ti.clearDtsInfo(e),n=void 0,r=void 0},this.getGopForFusion_=function(t){var i,n,r,s,a,o=45e3,l=1e4,u=1/0;for(a=0;a<this.gopCache_.length;a++)s=this.gopCache_[a],r=s.gop,e.pps&&Di(e.pps[0],s.pps[0])&&e.sps&&Di(e.sps[0],s.sps[0])&&(r.dts<e.timelineStartInfo.dts||(i=t.dts-r.dts-r.duration,i>=-l&&i<=o&&(!n||u>i)&&(n=s,u=i)));return n?n.gop:null},this.alignGopsAtStart_=function(e){var t,i,n,r,s,o,l,u;s=e.byteLength,o=e.nalCount,l=e.duration,t=i=0;while(t<a.length&&i<e.length){if(n=a[t],r=e[i],n.pts===r.pts)break;r.pts>n.pts?t++:(i++,s-=r.byteLength,o-=r.nalCount,l-=r.duration)}return 0===i?e:i===e.length?null:(u=e.slice(i),u.byteLength=s,u.duration=l,u.nalCount=o,u.pts=u[0].pts,u.dts=u[0].dts,u)},this.alignGopsAtEnd_=function(e){var t,i,n,r,s,o,l;t=a.length-1,i=e.length-1,s=null,o=!1;while(t>=0&&i>=0){if(n=a[t],r=e[i],n.pts===r.pts){o=!0;break}n.pts>r.pts?t--:(t===a.length-1&&(s=i),i--)}if(!o&&null===s)return null;if(l=o?i:s,0===l)return e;var u=e.slice(l),c=u.reduce((function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e}),{byteLength:0,duration:0,nalCount:0});return u.byteLength=c.byteLength,u.duration=c.duration,u.nalCount=c.nalCount,u.pts=u[0].pts,u.dts=u[0].dts,u},this.alignGopsWith=function(e){a=e}},li.prototype=new yi,hi=function(e,t){this.numberOfTracks=0,this.metadataStream=t,e=e||{},"undefined"!==typeof e.remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"===typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,hi.prototype.init.call(this),this.push=function(e){return e.content||e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),void("audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes))))}},hi.prototype=new yi,hi.prototype.flush=function(e){var t,i,n,r,s=0,a={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,Oi.forEach((function(e){a.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,Ii.forEach((function(e){a.info[e]=this.audioTrack[e]}),this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?a.type=this.pendingTracks[0].type:a.type="combined",this.emittedTracks+=this.pendingTracks.length,n=vi.initSegment(this.pendingTracks),a.initSegment=new Uint8Array(n.byteLength),a.initSegment.set(n),a.data=new Uint8Array(this.pendingBytes),r=0;r<this.pendingBoxes.length;r++)a.data.set(this.pendingBoxes[r],s),s+=this.pendingBoxes[r].byteLength;for(r=0;r<this.pendingCaptions.length;r++)t=this.pendingCaptions[r],t.startTime=ki.metadataTsToSeconds(t.startPts,o,this.keepOriginalTimestamps),t.endTime=ki.metadataTsToSeconds(t.endPts,o,this.keepOriginalTimestamps),a.captionStreams[t.stream]=!0,a.captions.push(t);for(r=0;r<this.pendingMetadata.length;r++)i=this.pendingMetadata[r],i.cueTime=ki.metadataTsToSeconds(i.pts,o,this.keepOriginalTimestamps),a.metadata.push(i);for(a.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",a),r=0;r<a.captions.length;r++)t=a.captions[r],this.trigger("caption",t);for(r=0;r<a.metadata.length;r++)i=a.metadata[r],this.trigger("id3Frame",i)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},hi.prototype.setRemux=function(e){this.remuxTracks=e},ci=function(e){var t,i,n=this,r=!0;ci.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="aac",r.metadataStream=new Si.MetadataStream,r.aacStream=new Ci,r.audioTimestampRolloverStream=new Si.TimestampRolloverStream("audio"),r.timedMetadataTimestampRolloverStream=new Si.TimestampRolloverStream("timed-metadata"),r.adtsStream=new Ei,r.coalesceStream=new hi(e,r.metadataStream),r.headOfPipeline=r.aacStream,r.aacStream.pipe(r.audioTimestampRolloverStream).pipe(r.adtsStream),r.aacStream.pipe(r.timedMetadataTimestampRolloverStream).pipe(r.metadataStream).pipe(r.coalesceStream),r.metadataStream.on("timestamp",(function(e){r.aacStream.setTimestamp(e.timeStamp)})),r.aacStream.on("data",(function(s){"timed-metadata"!==s.type&&"audio"!==s.type||r.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:n.baseMediaDecodeTime},codec:"adts",type:"audio"},r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new ui(i,e),r.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t}))})),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),Li(this,r)},this.setupTsPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="ts",r.metadataStream=new Si.MetadataStream,r.packetStream=new Si.TransportPacketStream,r.parseStream=new Si.TransportParseStream,r.elementaryStream=new Si.ElementaryStream,r.timestampRolloverStream=new Si.TimestampRolloverStream,r.adtsStream=new Ei,r.h264Stream=new wi,r.captionStream=new Si.CaptionStream(e),r.coalesceStream=new hi(e,r.metadataStream),r.headOfPipeline=r.packetStream,r.packetStream.pipe(r.parseStream).pipe(r.elementaryStream).pipe(r.timestampRolloverStream),r.timestampRolloverStream.pipe(r.h264Stream),r.timestampRolloverStream.pipe(r.adtsStream),r.timestampRolloverStream.pipe(r.metadataStream).pipe(r.coalesceStream),r.h264Stream.pipe(r.captionStream).pipe(r.coalesceStream),r.elementaryStream.on("data",(function(s){var a;if("metadata"===s.type){a=s.tracks.length;while(a--)t||"video"!==s.tracks[a].type?i||"audio"!==s.tracks[a].type||(i=s.tracks[a],i.timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime):(t=s.tracks[a],t.timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime);t&&!r.videoSegmentStream&&(r.coalesceStream.numberOfTracks++,r.videoSegmentStream=new li(t,e),r.videoSegmentStream.on("log",n.getLogTrigger_("videoSegmentStream")),r.videoSegmentStream.on("timelineStartInfo",(function(t){i&&!e.keepOriginalTimestamps&&(i.timelineStartInfo=t,r.audioSegmentStream.setEarliestDts(t.dts-n.baseMediaDecodeTime))})),r.videoSegmentStream.on("processedGopsInfo",n.trigger.bind(n,"gopInfo")),r.videoSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"videoSegmentTimingInfo")),r.videoSegmentStream.on("baseMediaDecodeTime",(function(e){i&&r.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),r.videoSegmentStream.on("timingInfo",n.trigger.bind(n,"videoTimingInfo")),r.h264Stream.pipe(r.videoSegmentStream).pipe(r.coalesceStream)),i&&!r.audioSegmentStream&&(r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new ui(i,e),r.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),r.audioSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"audioSegmentTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream)),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t})}})),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("id3Frame",(function(e){e.dispatchType=r.metadataStream.dispatchType,n.trigger("id3Frame",e)})),r.coalesceStream.on("caption",this.trigger.bind(this,"caption")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),Li(this,r)},this.setBaseMediaDecodeTime=function(n){var r=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=n),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,Ti.clearDtsInfo(i),r.audioTimestampRolloverStream&&r.audioTimestampRolloverStream.discontinuity()),t&&(r.videoSegmentStream&&(r.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,Ti.clearDtsInfo(t),r.captionStream.reset()),r.timestampRolloverStream&&r.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var i=this.transmuxPipeline_;e.remux=t,i&&i.coalesceStream&&i.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.getLogTrigger_=function(e){var t=this;return function(i){i.stream=e,t.trigger("log",i)}},this.push=function(e){if(r){var t=xi(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),r=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){r=!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()}},ci.prototype=new yi;var Ri,Ni={Transmuxer:ci,VideoSegmentStream:li,AudioSegmentStream:ui,AUDIO_PROPERTIES:Ii,VIDEO_PROPERTIES:Oi,generateSegmentTimingInfo:Mi},ji=function(e){return e>>>0},Bi=function(e){return("00"+e.toString(16)).slice(-2)},Ui={toUnsigned:ji,toHexString:Bi},Fi=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3]),t},qi=Fi,Hi=Ui.toUnsigned,Vi=qi,zi=function(e,t){var i,n,r,s,a,o=[];if(!t.length)return null;for(i=0;i<e.byteLength;)n=Hi(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]),r=Vi(e.subarray(i+4,i+8)),s=n>1?i+n:e.byteLength,r===t[0]&&(1===t.length?o.push(e.subarray(i+8,s)):(a=zi(e.subarray(i+8,s),t.slice(1)),a.length&&(o=o.concat(a)))),i=s;return o},Wi=zi,$i=Ui.toUnsigned,Gi=H.getUint64,Xi=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};return 1===t.version?t.baseMediaDecodeTime=Gi(e.subarray(4)):t.baseMediaDecodeTime=$i(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),t},Ki=Xi,Yi=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},Qi=Yi,Ji=Qi,Zi=function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&i.flags[2],s=4&i.flags[2],a=1&i.flags[1],o=2&i.flags[1],l=4&i.flags[1],u=8&i.flags[1],c=n.getUint32(4),h=8;r&&(i.dataOffset=n.getInt32(h),h+=4),s&&c&&(t={flags:Ji(e.subarray(h,h+4))},h+=4,a&&(t.duration=n.getUint32(h),h+=4),o&&(t.size=n.getUint32(h),h+=4),u&&(1===i.version?t.compositionTimeOffset=n.getInt32(h):t.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(t),c--);while(c--)t={},a&&(t.duration=n.getUint32(h),h+=4),o&&(t.size=n.getUint32(h),h+=4),l&&(t.flags=Ji(e.subarray(h,h+4)),h+=4),u&&(1===i.version?t.compositionTimeOffset=n.getInt32(h):t.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(t);return i},en=Zi,tn=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:i.getUint32(4)},r=1&n.flags[2],s=2&n.flags[2],a=8&n.flags[2],o=16&n.flags[2],l=32&n.flags[2],u=65536&n.flags[0],c=131072&n.flags[0];return t=8,r&&(t+=4,n.baseDataOffset=i.getUint32(12),t+=4),s&&(n.sampleDescriptionIndex=i.getUint32(t),t+=4),a&&(n.defaultSampleDuration=i.getUint32(t),t+=4),o&&(n.defaultSampleSize=i.getUint32(t),t+=4),l&&(n.defaultSampleFlags=i.getUint32(t)),u&&(n.durationIsEmpty=!0),!r&&c&&(n.baseDataOffsetIsMoof=!0),n},nn=tn;Ri="undefined"!==typeof window?window:"undefined"!==typeof t?t:"undefined"!==typeof self?self:{};var rn,sn,an,on,ln,un,cn,hn=Ri,dn=Re.discardEmulationPreventionBytes,pn=Qe.CaptionStream,fn=Wi,mn=Ki,gn=en,yn=nn,vn=hn,_n=function(e,t){for(var i=e,n=0;n<t.length;n++){var r=t[n];if(i<r.size)return r;i-=r.size}return null},bn=function(e,t,i){var n,r,s,a,o=new DataView(e.buffer,e.byteOffset,e.byteLength),l={logs:[],seiNals:[]};for(r=0;r+4<e.length;r+=s)if(s=o.getUint32(r),r+=4,!(s<=0))switch(31&e[r]){case 6:var u=e.subarray(r+1,r+1+s),c=_n(r,t);if(n={nalUnitType:"sei_rbsp",size:s,data:u,escapedRBSP:dn(u),trackId:i},c)n.pts=c.pts,n.dts=c.dts,a=c;else{if(!a){l.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+r+" for trackId "+i+". See mux.js#223."});break}n.pts=a.pts,n.dts=a.dts}l.seiNals.push(n);break}return l},Tn=function(e,t,i){var n=t,r=i.defaultSampleDuration||0,s=i.defaultSampleSize||0,a=i.trackId,o=[];return e.forEach((function(e){var t=gn(e),i=t.samples;i.forEach((function(e){void 0===e.duration&&(e.duration=r),void 0===e.size&&(e.size=s),e.trackId=a,e.dts=n,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),"bigint"===typeof n?(e.pts=n+vn.BigInt(e.compositionTimeOffset),n+=vn.BigInt(e.duration)):(e.pts=n+e.compositionTimeOffset,n+=e.duration)})),o=o.concat(i)})),o},Sn=function(e,t){var i=fn(e,["moof","traf"]),n=fn(e,["mdat"]),r={},s=[];return n.forEach((function(e,t){var n=i[t];s.push({mdat:e,traf:n})})),s.forEach((function(e){var i,n,s=e.mdat,a=e.traf,o=fn(a,["tfhd"]),l=yn(o[0]),u=l.trackId,c=fn(a,["tfdt"]),h=c.length>0?mn(c[0]).baseMediaDecodeTime:0,d=fn(a,["trun"]);t===u&&d.length>0&&(i=Tn(d,h,l),n=bn(s,i,u),r[u]||(r[u]={seiNals:[],logs:[]}),r[u].seiNals=r[u].seiNals.concat(n.seiNals),r[u].logs=r[u].logs.concat(n.logs))})),r},kn=function(e,t,i){var n;if(null===t)return null;n=Sn(e,t);var r=n[t]||{};return{seiNals:r.seiNals,logs:r.logs,timescale:i}},En=function(){var e,t,i,n,r,s,a=!1;this.isInitialized=function(){return a},this.init=function(t){e=new pn,a=!0,s=!!t&&t.isPartial,e.on("data",(function(e){e.startTime=e.startPts/n,e.endTime=e.endPts/n,r.captions.push(e),r.captionStreams[e.stream]=!0})),e.on("log",(function(e){r.logs.push(e)}))},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"===typeof t&&0===Object.keys(t).length)&&(i!==e[0]||n!==t[i])},this.parse=function(e,s,a){var o;if(!this.isInitialized())return null;if(!s||!a)return null;if(this.isNewInit(s,a))i=s[0],n=a[i];else if(null===i||!n)return t.push(e),null;while(t.length>0){var l=t.shift();this.parse(l,s,a)}return o=kn(e,i,n),o&&o.logs&&(r.logs=r.logs.concat(o.logs)),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),r):r.logs.length?{logs:r.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach((function(t){e.push(t)}))},this.flushStream=function(){if(!this.isInitialized())return null;s?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){r.captions=[],r.captionStreams={},r.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],i=null,n=null,r?this.clearParsedCaptions():r={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},wn=En,Cn=function(e){var t=0,i=String.fromCharCode(e[t]),n="";while("\0"!==i)n+=i,t++,i=String.fromCharCode(e[t]);return n+=i,n},xn={uint8ToCString:Cn},An=xn.uint8ToCString,In=H.getUint64,On=function(e){var t,i,n,r,s,a,o,l,u=4,c=e[0];if(0===c){t=An(e.subarray(u)),u+=t.length,i=An(e.subarray(u)),u+=i.length;var h=new DataView(e.buffer);n=h.getUint32(u),u+=4,s=h.getUint32(u),u+=4,a=h.getUint32(u),u+=4,o=h.getUint32(u),u+=4}else if(1===c){h=new DataView(e.buffer);n=h.getUint32(u),u+=4,r=In(e.subarray(u)),u+=8,a=h.getUint32(u),u+=4,o=h.getUint32(u),u+=4,t=An(e.subarray(u)),u+=t.length,i=An(e.subarray(u)),u+=i.length}l=new Uint8Array(e.subarray(u,e.byteLength));var d={scheme_id_uri:t,value:i,timescale:n||1,presentation_time:r,presentation_time_delta:s,event_duration:a,id:o,message_data:l};return Ln(c,d)?d:void 0},Pn=function(e,t,i,n){return e||0===e?e/t:n+i/t},Ln=function(e,t){var i="\0"!==t.scheme_id_uri,n=0===e&&Dn(t.presentation_time_delta)&&i,r=1===e&&Dn(t.presentation_time)&&i;return!(e>1)&&n||r},Dn=function(e){return void 0!==e||null!==e},Mn={parseEmsgBox:On,scaleTime:Pn},Rn=Ui.toUnsigned,Nn=Ui.toHexString,jn=Wi,Bn=qi,Un=Mn,Fn=nn,qn=en,Hn=Ki,Vn=H.getUint64,zn=hn,Wn=yt.parseId3Frames;rn=function(e){var t={},i=jn(e,["moov","trak"]);return i.reduce((function(e,t){var i,n,r,s,a;return i=jn(t,["tkhd"])[0],i?(n=i[0],r=0===n?12:20,s=Rn(i[r]<<24|i[r+1]<<16|i[r+2]<<8|i[r+3]),a=jn(t,["mdia","mdhd"])[0],a?(n=a[0],r=0===n?12:20,e[s]=Rn(a[r]<<24|a[r+1]<<16|a[r+2]<<8|a[r+3]),e):null):null}),t)},sn=function(e,t){var i;i=jn(t,["moof","traf"]);var n=i.reduce((function(t,i){var n,r=jn(i,["tfhd"])[0],s=Rn(r[4]<<24|r[5]<<16|r[6]<<8|r[7]),a=e[s]||9e4,o=jn(i,["tfdt"])[0],l=new DataView(o.buffer,o.byteOffset,o.byteLength);let u;return n=1===o[0]?Vn(o.subarray(4,12)):l.getUint32(4),"bigint"===typeof n?u=n/zn.BigInt(a):"number"!==typeof n||isNaN(n)||(u=n/a),u<Number.MAX_SAFE_INTEGER&&(u=Number(u)),u<t&&(t=u),t}),1/0);return"bigint"===typeof n||isFinite(n)?n:0},an=function(e,t){var i,n=jn(t,["moof","traf"]),r=0,s=0;if(n&&n.length){var a=jn(n[0],["tfhd"])[0],o=jn(n[0],["trun"])[0],l=jn(n[0],["tfdt"])[0];if(a){var u=Fn(a);i=u.trackId}if(l){var c=Hn(l);r=c.baseMediaDecodeTime}if(o){var h=qn(o);h.samples&&h.samples.length&&(s=h.samples[0].compositionTimeOffset||0)}}var d=e[i]||9e4;"bigint"===typeof r&&(s=zn.BigInt(s),d=zn.BigInt(d));var p=(r+s)/d;return"bigint"===typeof p&&p<Number.MAX_SAFE_INTEGER&&(p=Number(p)),p},on=function(e){var t=jn(e,["moov","trak"]),i=[];return t.forEach((function(e){var t=jn(e,["mdia","hdlr"]),n=jn(e,["tkhd"]);t.forEach((function(e,t){var r,s,a,o=Bn(e.subarray(8,12)),l=n[t];"vide"===o&&(r=new DataView(l.buffer,l.byteOffset,l.byteLength),s=r.getUint8(0),a=0===s?r.getUint32(12):r.getUint32(20),i.push(a))}))})),i},un=function(e){var t=e[0],i=0===t?12:20;return Rn(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3])},ln=function(e){var t=jn(e,["moov","trak"]),i=[];return t.forEach((function(e){var t,n,r={},s=jn(e,["tkhd"])[0];s&&(t=new DataView(s.buffer,s.byteOffset,s.byteLength),n=t.getUint8(0),r.id=0===n?t.getUint32(12):t.getUint32(20));var a=jn(e,["mdia","hdlr"])[0];if(a){var o=Bn(a.subarray(8,12));r.type="vide"===o?"video":"soun"===o?"audio":o}var l=jn(e,["mdia","minf","stbl","stsd"])[0];if(l){var u=l.subarray(8);r.codec=Bn(u.subarray(4,8));var c,h,d=jn(u,[r.codec])[0];d&&(/^[asm]vc[1-9]$/i.test(r.codec)?(c=d.subarray(78),h=Bn(c.subarray(4,8)),"avcC"===h&&c.length>11?(r.codec+=".",r.codec+=Nn(c[9]),r.codec+=Nn(c[10]),r.codec+=Nn(c[11])):r.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(r.codec)?(c=d.subarray(28),h=Bn(c.subarray(4,8)),"esds"===h&&c.length>20&&0!==c[19]?(r.codec+="."+Nn(c[19]),r.codec+="."+Nn(c[20]>>>2&63).replace(/^0/,"")):r.codec="mp4a.40.2"):r.codec=r.codec.toLowerCase())}var p=jn(e,["mdia","mdhd"])[0];p&&(r.timescale=un(p)),i.push(r)})),i},cn=function(e,t=0){var i=jn(e,["emsg"]);return i.map(e=>{var i=Un.parseEmsgBox(new Uint8Array(e)),n=Wn(i.message_data);return{cueTime:Un.scaleTime(i.presentation_time,i.timescale,i.presentation_time_delta,t),duration:Un.scaleTime(i.event_duration,i.timescale),frames:n}})};var $n={findBox:jn,parseType:Bn,timescale:rn,startTime:sn,compositionStartTime:an,videoTrackIds:on,tracks:ln,getTimescaleFromMediaHeader:un,getEmsgID3:cn},Gn=Je,Xn=function(e){var t=31&e[1];return t<<=8,t|=e[2],t},Kn=function(e){return!!(64&e[1])},Yn=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},Qn=function(e,t){var i=Xn(e);return 0===i?"pat":i===t?"pmt":t?"pes":null},Jn=function(e){var t=Kn(e),i=4+Yn(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},Zn=function(e){var t={},i=Kn(e),n=4+Yn(e);if(i&&(n+=e[n]+1),1&e[n+5]){var r,s,a;r=(15&e[n+1])<<8|e[n+2],s=3+r-4,a=(15&e[n+10])<<8|e[n+11];var o=12+a;while(o<s){var l=n+o;t[(31&e[l+1])<<8|e[l+2]]=e[l],o+=5+((15&e[l+3])<<8|e[l+4])}return t}},er=function(e,t){var i=Xn(e),n=t[i];switch(n){case Gn.H264_STREAM_TYPE:return"video";case Gn.ADTS_STREAM_TYPE:return"audio";case Gn.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},tr=function(e){var t=Kn(e);if(!t)return null;var i=4+Yn(e);if(i>=e.byteLength)return null;var n,r=null;return n=e[i+7],192&n&&(r={},r.pts=(14&e[i+9])<<27|(255&e[i+10])<<20|(254&e[i+11])<<12|(255&e[i+12])<<5|(254&e[i+13])>>>3,r.pts*=4,r.pts+=(6&e[i+13])>>>1,r.dts=r.pts,64&n&&(r.dts=(14&e[i+14])<<27|(255&e[i+15])<<20|(254&e[i+16])<<12|(255&e[i+17])<<5|(254&e[i+18])>>>3,r.dts*=4,r.dts+=(6&e[i+18])>>>1)),r},ir=function(e){switch(e){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}},nr=function(e){for(var t,i=4+Yn(e),n=e.subarray(i),r=0,s=0,a=!1;s<n.byteLength-3;s++)if(1===n[s+2]){r=s+5;break}while(r<n.byteLength)switch(n[r]){case 0:if(0!==n[r-1]){r+=2;break}if(0!==n[r-2]){r++;break}s+3!==r-2&&(t=ir(31&n[s+3]),"slice_layer_without_partitioning_rbsp_idr"===t&&(a=!0));do{r++}while(1!==n[r]&&r<n.length);s=r-2,r+=3;break;case 1:if(0!==n[r-1]||0!==n[r-2]){r+=3;break}t=ir(31&n[s+3]),"slice_layer_without_partitioning_rbsp_idr"===t&&(a=!0),s=r-2,r+=3;break;default:r+=3;break}return n=n.subarray(s),r-=s,s=0,n&&n.byteLength>3&&(t=ir(31&n[s+3]),"slice_layer_without_partitioning_rbsp_idr"===t&&(a=!0)),a},rr={parseType:Qn,parsePat:Jn,parsePmt:Zn,parsePayloadUnitStartIndicator:Kn,parsePesType:er,parsePesTime:tr,videoPacketContainsKeyFrame:nr},sr=Je,ar=at.handleRollover,or={};or.ts=rr,or.aac=si;var lr=me.ONE_SECOND_IN_TS,ur=188,cr=71,hr=function(e,t){var i,n,r=0,s=ur;while(s<e.byteLength)if(e[r]!==cr||e[s]!==cr)r++,s++;else{switch(i=e.subarray(r,s),n=or.ts.parseType(i,t.pid),n){case"pat":t.pid=or.ts.parsePat(i);break;case"pmt":var a=or.ts.parsePmt(i);t.table=t.table||{},Object.keys(a).forEach((function(e){t.table[e]=a[e]}));break}r+=ur,s+=ur}},dr=function(e,t,i){var n,r,s,a,o,l=0,u=ur,c=!1;while(u<=e.byteLength)if(e[l]!==cr||e[u]!==cr&&u!==e.byteLength)l++,u++;else{switch(n=e.subarray(l,u),r=or.ts.parseType(n,t.pid),r){case"pes":s=or.ts.parsePesType(n,t.table),a=or.ts.parsePayloadUnitStartIndicator(n),"audio"===s&&a&&(o=or.ts.parsePesTime(n),o&&(o.type="audio",i.audio.push(o),c=!0));break}if(c)break;l+=ur,u+=ur}u=e.byteLength,l=u-ur,c=!1;while(l>=0)if(e[l]!==cr||e[u]!==cr&&u!==e.byteLength)l--,u--;else{switch(n=e.subarray(l,u),r=or.ts.parseType(n,t.pid),r){case"pes":s=or.ts.parsePesType(n,t.table),a=or.ts.parsePayloadUnitStartIndicator(n),"audio"===s&&a&&(o=or.ts.parsePesTime(n),o&&(o.type="audio",i.audio.push(o),c=!0));break}if(c)break;l-=ur,u-=ur}},pr=function(e,t,i){var n,r,s,a,o,l,u,c,h=0,d=ur,p=!1,f={data:[],size:0};while(d<e.byteLength)if(e[h]!==cr||e[d]!==cr)h++,d++;else{switch(n=e.subarray(h,d),r=or.ts.parseType(n,t.pid),r){case"pes":if(s=or.ts.parsePesType(n,t.table),a=or.ts.parsePayloadUnitStartIndicator(n),"video"===s&&(a&&!p&&(o=or.ts.parsePesTime(n),o&&(o.type="video",i.video.push(o),p=!0)),!i.firstKeyFrame)){if(a&&0!==f.size){l=new Uint8Array(f.size),u=0;while(f.data.length)c=f.data.shift(),l.set(c,u),u+=c.byteLength;if(or.ts.videoPacketContainsKeyFrame(l)){var m=or.ts.parsePesTime(l);m?(i.firstKeyFrame=m,i.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.")}f.size=0}f.data.push(n),f.size+=n.byteLength}break}if(p&&i.firstKeyFrame)break;h+=ur,d+=ur}d=e.byteLength,h=d-ur,p=!1;while(h>=0)if(e[h]!==cr||e[d]!==cr)h--,d--;else{switch(n=e.subarray(h,d),r=or.ts.parseType(n,t.pid),r){case"pes":s=or.ts.parsePesType(n,t.table),a=or.ts.parsePayloadUnitStartIndicator(n),"video"===s&&a&&(o=or.ts.parsePesTime(n),o&&(o.type="video",i.video.push(o),p=!0));break}if(p)break;h-=ur,d-=ur}},fr=function(e,t){if(e.audio&&e.audio.length){var i=t;("undefined"===typeof i||isNaN(i))&&(i=e.audio[0].dts),e.audio.forEach((function(e){e.dts=ar(e.dts,i),e.pts=ar(e.pts,i),e.dtsTime=e.dts/lr,e.ptsTime=e.pts/lr}))}if(e.video&&e.video.length){var n=t;if(("undefined"===typeof n||isNaN(n))&&(n=e.video[0].dts),e.video.forEach((function(e){e.dts=ar(e.dts,n),e.pts=ar(e.pts,n),e.dtsTime=e.dts/lr,e.ptsTime=e.pts/lr})),e.firstKeyFrame){var r=e.firstKeyFrame;r.dts=ar(r.dts,n),r.pts=ar(r.pts,n),r.dtsTime=r.dts/lr,r.ptsTime=r.pts/lr}}},mr=function(e){var t,i=!1,n=0,r=null,s=null,a=0,o=0;while(e.length-o>=3){var l=or.aac.parseType(e,o);switch(l){case"timed-metadata":if(e.length-o<10){i=!0;break}if(a=or.aac.parseId3TagSize(e,o),a>e.length){i=!0;break}null===s&&(t=e.subarray(o,o+a),s=or.aac.parseAacTimestamp(t)),o+=a;break;case"audio":if(e.length-o<7){i=!0;break}if(a=or.aac.parseAdtsSize(e,o),a>e.length){i=!0;break}null===r&&(t=e.subarray(o,o+a),r=or.aac.parseSampleRate(t)),n++,o+=a;break;default:o++;break}if(i)return null}if(null===r||null===s)return null;var u=lr/r,c={audio:[{type:"audio",dts:s,pts:s},{type:"audio",dts:s+1024*n*u,pts:s+1024*n*u}]};return c},gr=function(e){var t={pid:null,table:null},i={};for(var n in hr(e,t),t.table)if(t.table.hasOwnProperty(n)){var r=t.table[n];switch(r){case sr.H264_STREAM_TYPE:i.video=[],pr(e,t,i),0===i.video.length&&delete i.video;break;case sr.ADTS_STREAM_TYPE:i.audio=[],dr(e,t,i),0===i.audio.length&&delete i.audio;break}}return i},yr=function(e,t){var i,n=or.aac.isLikelyAacData(e);return i=n?mr(e):gr(e),i&&(i.audio||i.video)?(fr(i,t),i):null},vr={inspect:yr,parseAudioPes_:dr};const _r=function(e,t){t.on("data",(function(t){const i=t.initSegment;t.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength};const n=t.data;t.data=n.buffer,e.postMessage({action:"data",segment:t,byteOffset:n.byteOffset,byteLength:n.byteLength},[t.data])})),t.on("done",(function(t){e.postMessage({action:"done"})})),t.on("gopInfo",(function(t){e.postMessage({action:"gopInfo",gopInfo:t})})),t.on("videoSegmentTimingInfo",(function(t){const i={start:{decode:me.videoTsToSeconds(t.start.dts),presentation:me.videoTsToSeconds(t.start.pts)},end:{decode:me.videoTsToSeconds(t.end.dts),presentation:me.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:me.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=me.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:i})})),t.on("audioSegmentTimingInfo",(function(t){const i={start:{decode:me.videoTsToSeconds(t.start.dts),presentation:me.videoTsToSeconds(t.start.pts)},end:{decode:me.videoTsToSeconds(t.end.dts),presentation:me.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:me.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=me.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:i})})),t.on("id3Frame",(function(t){e.postMessage({action:"id3Frame",id3Frame:t})})),t.on("caption",(function(t){e.postMessage({action:"caption",caption:t})})),t.on("trackinfo",(function(t){e.postMessage({action:"trackinfo",trackInfo:t})})),t.on("audioTimingInfo",(function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:me.videoTsToSeconds(t.start),end:me.videoTsToSeconds(t.end)}})})),t.on("videoTimingInfo",(function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:me.videoTsToSeconds(t.start),end:me.videoTsToSeconds(t.end)}})})),t.on("log",(function(t){e.postMessage({action:"log",log:t})}))};class br{constructor(e,t){this.options=t||{},this.self=e,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Ni.Transmuxer(this.options),_r(this.self,this.transmuxer)}pushMp4Captions(e){this.captionParser||(this.captionParser=new wn,this.captionParser.init());const t=new Uint8Array(e.data,e.byteOffset,e.byteLength),i=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:i&&i.captions||[],logs:i&&i.logs||[],data:t.buffer},[t.buffer])}probeMp4StartTime({timescales:e,data:t}){const i=$n.startTime(e,t);this.self.postMessage({action:"probeMp4StartTime",startTime:i,data:t},[t.buffer])}probeMp4Tracks({data:e}){const t=$n.tracks(e);this.self.postMessage({action:"probeMp4Tracks",tracks:t,data:e},[e.buffer])}probeEmsgID3({data:e,offset:t}){const i=$n.getEmsgID3(e,t);this.self.postMessage({action:"probeEmsgID3",id3Frames:i,emsgData:e},[e.buffer])}probeTs({data:e,baseStartTime:t}){const i="number"!==typeof t||isNaN(t)?void 0:t*me.ONE_SECOND_IN_TS,n=vr.inspect(e,i);let r=null;n&&(r={hasVideo:n.video&&2===n.video.length||!1,hasAudio:n.audio&&2===n.audio.length||!1},r.hasVideo&&(r.videoStart=n.video[0].ptsTime),r.hasAudio&&(r.audioStart=n.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:r,data:e},[e.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(e){const t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}reset(){this.transmuxer.reset()}setTimestampOffset(e){const t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(me.secondsToVideoTs(t)))}setAudioAppendStart(e){this.transmuxer.setAudioAppendStart(Math.ceil(me.secondsToVideoTs(e.appendStart)))}setRemux(e){this.transmuxer.setRemux(e.remux)}flush(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}self.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new br(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new br(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}})));var Bo=Mo(jo);const Uo=(e,t,i)=>{const{type:n,initSegment:r,captions:s,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:u}=e.data.segment;t.buffer.push({captions:s,captionStreams:a,metadata:o});const c=e.data.segment.boxes||{data:e.data.segment.data},h={type:n,data:new Uint8Array(c.data,c.data.byteOffset,c.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)};"undefined"!==typeof l&&(h.videoFrameDtsTime=l),"undefined"!==typeof u&&(h.videoFramePtsTime=u),i(h)},Fo=({transmuxedData:e,callback:t})=>{e.buffer=[],t(e)},qo=(e,t)=>{t.gopInfo=e.data.gopInfo},Ho=e=>{const{transmuxer:t,bytes:i,audioAppendStart:n,gopsToAlignWith:r,remux:s,onData:a,onTrackInfo:o,onAudioTimingInfo:l,onVideoTimingInfo:u,onVideoSegmentTimingInfo:c,onAudioSegmentTimingInfo:h,onId3:d,onCaptions:p,onDone:f,onEndedTimeline:m,onTransmuxerLog:g,isEndOfTimeline:y}=e,v={buffer:[]};let _=y;const b=i=>{t.currentTransmux===e&&("data"===i.data.action&&Uo(i,v,a),"trackinfo"===i.data.action&&o(i.data.trackInfo),"gopInfo"===i.data.action&&qo(i,v),"audioTimingInfo"===i.data.action&&l(i.data.audioTimingInfo),"videoTimingInfo"===i.data.action&&u(i.data.videoTimingInfo),"videoSegmentTimingInfo"===i.data.action&&c(i.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===i.data.action&&h(i.data.audioSegmentTimingInfo),"id3Frame"===i.data.action&&d([i.data.id3Frame],i.data.id3Frame.dispatchType),"caption"===i.data.action&&p(i.data.caption),"endedtimeline"===i.data.action&&(_=!1,m()),"log"===i.data.action&&g(i.data.log),"transmuxed"===i.data.type&&(_||(t.onmessage=null,Fo({transmuxedData:v,callback:f}),Vo(t))))};if(t.onmessage=b,n&&t.postMessage({action:"setAudioAppendStart",appendStart:n}),Array.isArray(r)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),"undefined"!==typeof s&&t.postMessage({action:"setRemux",remux:s}),i.byteLength){const e=i instanceof ArrayBuffer?i:i.buffer,n=i instanceof ArrayBuffer?0:i.byteOffset;t.postMessage({action:"push",data:e,byteOffset:n,byteLength:i.byteLength},[e])}y&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},Vo=e=>{e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"===typeof e.currentTransmux?e.currentTransmux():Ho(e.currentTransmux))},zo=(e,t)=>{e.postMessage({action:t}),Vo(e)},Wo=(e,t)=>{if(!t.currentTransmux)return t.currentTransmux=e,void zo(t,e);t.transmuxQueue.push(zo.bind(null,t,e))},$o=e=>{Wo("reset",e)},Go=e=>{Wo("endTimeline",e)},Xo=e=>{if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void Ho(e);e.transmuxer.transmuxQueue.push(e)},Ko=e=>{const t=new Bo;t.currentTransmux=null,t.transmuxQueue=[];const i=t.terminate;return t.terminate=()=>(t.currentTransmux=null,t.transmuxQueue.length=0,i.call(t)),t.postMessage({action:"init",options:e}),t};var Yo={reset:$o,endTimeline:Go,transmux:Xo,createTransmuxer:Ko};const Qo=function(e){const t=e.transmuxer,i=e.endAction||e.action,n=e.callback,r=g()({},e,{endAction:null,transmuxer:null,callback:null}),s=r=>{r.data.action===i&&(t.removeEventListener("message",s),r.data.data&&(r.data.data=new Uint8Array(r.data.data,e.byteOffset||0,e.byteLength||r.data.data.byteLength),e.data&&(e.data=r.data.data)),n(r.data))};if(t.addEventListener("message",s),e.data){const i=e.data instanceof ArrayBuffer;r.byteOffset=i?0:e.data.byteOffset,r.byteLength=e.data.byteLength;const n=[i?e.data:e.data.buffer];t.postMessage(r,n)}else t.postMessage(r)},Jo={FAILURE:2,TIMEOUT:-101,ABORTED:-102},Zo=e=>{e.forEach(e=>{e.abort()})},el=e=>({bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}),tl=e=>{const t=e.target,i=Date.now()-t.requestTime,n={bandwidth:1/0,bytesReceived:0,roundTripTime:i||0};return n.bytesReceived=e.loaded,n.bandwidth=Math.floor(n.bytesReceived/n.roundTripTime*8*1e3),n},il=(e,t)=>t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:Jo.TIMEOUT,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:Jo.ABORTED,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:Jo.FAILURE,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:Jo.FAILURE,xhr:t}:null,nl=(e,t,i)=>(n,r)=>{const s=r.response,a=il(n,r);if(a)return i(a,e);if(16!==s.byteLength)return i({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:Jo.FAILURE,xhr:r},e);const o=new DataView(s),l=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]);for(let e=0;e<t.length;e++)t[e].bytes=l;return i(null,e)},rl=(e,t)=>{const i=Object(C["a"])(e.map.bytes);if("mp4"!==i){const n=e.map.resolvedUri||e.map.uri,r=i||"unknown";return t({internal:!0,message:`Found unsupported ${r} container for initialization segment at URL: ${n}`,code:Jo.FAILURE,metadata:{errorType:Is.Error.UnsupportedMediaInitialization,mediaType:r}})}Qo({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:({tracks:i,data:n})=>(e.map.bytes=n,i.forEach((function(t){e.map.tracks=e.map.tracks||{},e.map.tracks[t.type]||(e.map.tracks[t.type]=t,"number"===typeof t.id&&t.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[t.id]=t.timescale))})),t(null))})},sl=({segment:e,finishProcessingFn:t})=>(i,n)=>{const r=il(i,n);if(r)return t(r,e);const s=new Uint8Array(n.response);if(e.map.key)return e.map.encryptedBytes=s,t(null,e);e.map.bytes=s,rl(e,(function(i){if(i)return i.xhr=n,i.status=n.status,t(i,e);t(null,e)}))},al=({segment:e,finishProcessingFn:t,responseType:i})=>(n,r)=>{const s=il(n,r);if(s)return t(s,e);const a="arraybuffer"!==i&&r.responseText?Po(r.responseText.substring(e.lastReachedChar||0)):r.response;return e.stats=el(r),e.key?e.encryptedBytes=new Uint8Array(a):e.bytes=new Uint8Array(a),t(null,e)},ol=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:d})=>{const p=e.map&&e.map.tracks||{},f=Boolean(p.audio&&p.video);let m=n.bind(null,e,"audio","start");const g=n.bind(null,e,"audio","end");let y=n.bind(null,e,"video","start");const v=n.bind(null,e,"video","end"),_=()=>Xo({bytes:t,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,remux:f,onData:t=>{t.type="combined"===t.type?"video":t.type,c(e,t)},onTrackInfo:t=>{i&&(f&&(t.isMuxed=!0),i(e,t))},onAudioTimingInfo:e=>{m&&"undefined"!==typeof e.start&&(m(e.start),m=null),g&&"undefined"!==typeof e.end&&g(e.end)},onVideoTimingInfo:e=>{y&&"undefined"!==typeof e.start&&(y(e.start),y=null),v&&"undefined"!==typeof e.end&&v(e.end)},onVideoSegmentTimingInfo:e=>{r(e)},onAudioSegmentTimingInfo:e=>{s(e)},onId3:(t,i)=>{a(e,t,i)},onCaptions:t=>{o(e,[t])},isEndOfTimeline:l,onEndedTimeline:()=>{u()},onTransmuxerLog:d,onDone:t=>{h&&(t.type="combined"===t.type?"video":t.type,h(null,e,t))}});Qo({action:"probeTs",transmuxer:e.transmuxer,data:t,baseStartTime:e.baseStartTime,callback:n=>{e.bytes=t=n.data;const r=n.result;r&&(i(e,{hasAudio:r.hasAudio,hasVideo:r.hasVideo,isMuxed:f}),i=null),_()}})},ll=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:d})=>{let p=new Uint8Array(t);if(Object(C["b"])(p)){e.isFmp4=!0;const{tracks:r}=e.map,s={isFmp4:!0,hasVideo:!!r.video,hasAudio:!!r.audio};r.audio&&r.audio.codec&&"enca"!==r.audio.codec&&(s.audioCodec=r.audio.codec),r.video&&r.video.codec&&"encv"!==r.video.codec&&(s.videoCodec=r.video.codec),r.video&&r.audio&&(s.isMuxed=!0),i(e,s);const l=(t,i)=>{c(e,{data:p,type:s.hasAudio&&!s.isMuxed?"audio":"video"}),i&&i.length&&a(e,i),t&&t.length&&o(e,t),h(null,e,{})};Qo({action:"probeMp4StartTime",timescales:e.map.timescales,data:p,transmuxer:e.transmuxer,callback:({data:i,startTime:a})=>{t=i.buffer,e.bytes=p=i,s.hasAudio&&!s.isMuxed&&n(e,"audio","start",a),s.hasVideo&&n(e,"video","start",a),Qo({action:"probeEmsgID3",data:p,transmuxer:e.transmuxer,offset:a,callback:({emsgData:i,id3Frames:n})=>{t=i.buffer,e.bytes=p=i,r.video&&i.byteLength&&e.transmuxer?Qo({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:e.transmuxer,data:p,timescales:e.map.timescales,trackIds:[r.video.id],callback:i=>{t=i.data.buffer,e.bytes=p=i.data,i.logs.forEach((function(e){d(Bs(e,{stream:"mp4CaptionParser"}))})),l(i.captions,n)}}):l(void 0,n)}})}})}else if(e.transmuxer){if("undefined"===typeof e.container&&(e.container=Object(C["a"])(p)),"ts"!==e.container&&"aac"!==e.container)return i(e,{hasAudio:!1,hasVideo:!1}),void h(null,e,{});ol({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:d})}else h(null,e,{})},ul=function({id:e,key:t,encryptedBytes:i,decryptionWorker:n},r){const s=t=>{if(t.data.source===e){n.removeEventListener("message",s);const e=t.data.decrypted;r(new Uint8Array(e.bytes,e.byteOffset,e.byteLength))}};let a;n.addEventListener("message",s),a=t.bytes.slice?t.bytes.slice():new Uint32Array(Array.prototype.slice.call(t.bytes)),n.postMessage(to({source:e,encrypted:i,key:a,iv:t.iv}),[i.buffer,a.buffer])},cl=({decryptionWorker:e,segment:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:d})=>{ul({id:t.requestId,key:t.key,encryptedBytes:t.encryptedBytes,decryptionWorker:e},e=>{t.bytes=e,ll({segment:t,bytes:t.bytes,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:d})})},hl=({activeXhrs:e,decryptionWorker:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:d})=>{let p=0,f=!1;return(m,g)=>{if(!f){if(m)return f=!0,Zo(e),h(m,g);if(p+=1,p===e.length){const p=function(){if(g.encryptedBytes)return cl({decryptionWorker:t,segment:g,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:d});ll({segment:g,bytes:g.bytes,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:d})};if(g.endOfAllRequests=Date.now(),g.map&&g.map.encryptedBytes&&!g.map.bytes)return ul({decryptionWorker:t,id:g.requestId+"-init",encryptedBytes:g.map.encryptedBytes,key:g.map.key},t=>{g.map.bytes=t,rl(g,t=>{if(t)return Zo(e),h(t,g);p()})});p()}}}},dl=({loadendState:e,abortFn:t})=>i=>{const n=i.target;n.aborted&&t&&!e.calledAbortFn&&(t(),e.calledAbortFn=!0)},pl=({segment:e,progressFn:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c})=>i=>{const n=i.target;if(!n.aborted)return e.stats=Bs(e.stats,tl(i)),!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived&&(e.stats.firstBytesReceivedAt=Date.now()),t(i,e)},fl=({xhr:e,xhrOptions:t,decryptionWorker:i,segment:n,abortFn:r,progressFn:s,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:h,isEndOfTimeline:d,endedTimelineFn:p,dataFn:f,doneFn:m,onTransmuxerLog:g})=>{const y=[],v=hl({activeXhrs:y,decryptionWorker:i,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:h,isEndOfTimeline:d,endedTimelineFn:p,dataFn:f,doneFn:m,onTransmuxerLog:g});if(n.key&&!n.key.bytes){const i=[n.key];n.map&&!n.map.bytes&&n.map.key&&n.map.key.resolvedUri===n.key.resolvedUri&&i.push(n.map.key);const r=Bs(t,{uri:n.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),s=nl(n,i,v),a=e(r,s);y.push(a)}if(n.map&&!n.map.bytes){const i=n.map.key&&(!n.key||n.key.resolvedUri!==n.map.key.resolvedUri);if(i){const i=Bs(t,{uri:n.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),r=nl(n,[n.map.key],v),s=e(i,r);y.push(s)}const r=Bs(t,{uri:n.map.resolvedUri,responseType:"arraybuffer",headers:Qa(n.map),requestType:"segment-media-initialization"}),s=sl({segment:n,finishProcessingFn:v}),a=e(r,s);y.push(a)}const _=Bs(t,{uri:n.part&&n.part.resolvedUri||n.resolvedUri,responseType:"arraybuffer",headers:Qa(n),requestType:"segment"}),b=al({segment:n,finishProcessingFn:v,responseType:_.responseType}),T=e(_,b);T.addEventListener("progress",pl({segment:n,progressFn:s,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:h,isEndOfTimeline:d,endedTimelineFn:p,dataFn:f})),y.push(T);const S={};return y.forEach(e=>{e.addEventListener("loadend",dl({loadendState:S,abortFn:r}))}),()=>Zo(y)},ml=js("CodecUtils"),gl=function(e){const t=e.attributes||{};if(t.CODECS)return Object(_["h"])(t.CODECS)},yl=(e,t)=>{const i=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&i.AUDIO&&e.mediaGroups.AUDIO[i.AUDIO]},vl=(e,t)=>{if(!yl(e,t))return!0;const i=t.attributes||{},n=e.mediaGroups.AUDIO[i.AUDIO];for(const r in n)if(!n[r].uri&&!n[r].playlists)return!0;return!1},_l=function(e){const t={};return e.forEach(({mediaType:e,type:i,details:n})=>{t[e]=t[e]||[],t[e].push(Object(_["i"])(`${i}${n}`))}),Object.keys(t).forEach((function(e){if(t[e].length>1)return ml(`multiple ${e} codecs found as attributes: ${t[e].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),void(t[e]=null);t[e]=t[e][0]})),t},bl=function(e){let t=0;return e.audio&&t++,e.video&&t++,t},Tl=function(e,t){const i=t.attributes||{},n=_l(gl(t)||[]);if(yl(e,t)&&!n.audio&&!vl(e,t)){const t=_l(Object(_["d"])(e,i.AUDIO)||[]);t.audio&&(n.audio=t.audio)}return n},Sl=js("PlaylistSelector"),kl=function(e){if(!e||!e.playlist)return;const t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})},El=function(e,t){if(!e)return"";const i=r.a.getComputedStyle(e);return i?i[t]:""},wl=function(e,t){const i=e.slice();e.sort((function(e,n){const r=t(e,n);return 0===r?i.indexOf(e)-i.indexOf(n):r}))},Cl=function(e,t){let i,n;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||r.a.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(n=t.attributes.BANDWIDTH),n=n||r.a.Number.MAX_VALUE,i-n},xl=function(e,t){let i,n;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||r.a.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),n=n||r.a.Number.MAX_VALUE,i===n&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n};let Al=function(e,t,i,n,s,a){if(!e)return;const o={bandwidth:t,width:i,height:n,limitRenditionByPlayerDimensions:s};let l=e.playlists;Ea.isAudioOnly(e)&&(l=a.getAudioTrackPlaylists_(),o.audioOnly=!0);let u=l.map(e=>{let t;const i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,n=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return t=e.attributes&&e.attributes.BANDWIDTH,t=t||r.a.Number.MAX_VALUE,{bandwidth:t,width:i,height:n,playlist:e}});wl(u,(e,t)=>e.bandwidth-t.bandwidth),u=u.filter(e=>!Ea.isIncompatible(e.playlist));let c=u.filter(e=>Ea.isEnabled(e.playlist));c.length||(c=u.filter(e=>!Ea.isDisabled(e.playlist)));const h=c.filter(e=>e.bandwidth*Oo.BANDWIDTH_VARIANCE<t);let d=h[h.length-1];const p=h.filter(e=>e.bandwidth===d.bandwidth)[0];if(!1===s){const e=p||c[0]||u[0];if(e&&e.playlist){let t="sortedPlaylistReps";return p&&(t="bandwidthBestRep"),c[0]&&(t="enabledPlaylistReps"),Sl(`choosing ${kl(e)} using ${t} with options`,o),e.playlist}return Sl("could not choose a playlist with options",o),null}const f=h.filter(e=>e.width&&e.height);wl(f,(e,t)=>e.width-t.width);const m=f.filter(e=>e.width===i&&e.height===n);d=m[m.length-1];const g=m.filter(e=>e.bandwidth===d.bandwidth)[0];let y,v,_,b;if(g||(y=f.filter(e=>e.width>i||e.height>n),v=y.filter(e=>e.width===y[0].width&&e.height===y[0].height),d=v[v.length-1],_=v.filter(e=>e.bandwidth===d.bandwidth)[0]),a.leastPixelDiffSelector){const e=f.map(e=>(e.pixelDiff=Math.abs(e.width-i)+Math.abs(e.height-n),e));wl(e,(e,t)=>e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff),b=e[0]}const T=b||_||g||p||c[0]||u[0];if(T&&T.playlist){let e="sortedPlaylistReps";return b?e="leastPixelDiffRep":_?e="resolutionPlusOneRep":g?e="resolutionBestRep":p?e="bandwidthBestRep":c[0]&&(e="enabledPlaylistReps"),Sl(`choosing ${kl(T)} using ${e} with options`,o),T.playlist}return Sl("could not choose a playlist with options",o),null};const Il=function(){let e=this.useDevicePixelRatio&&r.a.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(e=this.customPixelRatio),Al(this.playlists.main,this.systemBandwidth,parseInt(El(this.tech_.el(),"width"),10)*e,parseInt(El(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.playlistController_)},Ol=function(e){let t=-1,i=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let n=this.useDevicePixelRatio&&r.a.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(n=this.customPixelRatio),t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),Al(this.playlists.main,t,parseInt(El(this.tech_.el(),"width"),10)*n,parseInt(El(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.playlistController_)}},Pl=function(e){const{main:t,currentTime:i,bandwidth:n,duration:r,segmentDuration:s,timeUntilRebuffer:a,currentTimeline:o,syncController:l}=e,u=t.playlists.filter(e=>!Ea.isIncompatible(e));let c=u.filter(Ea.isEnabled);c.length||(c=u.filter(e=>!Ea.isDisabled(e)));const h=c.filter(Ea.hasAttribute.bind(null,"BANDWIDTH")),d=h.map(e=>{const t=l.getSyncPoint(e,r,o,i),u=t?1:2,c=Ea.estimateSegmentRequestTime(s,n,e),h=c*u-a;return{playlist:e,rebufferingImpact:h}}),p=d.filter(e=>e.rebufferingImpact<=0);return wl(p,(e,t)=>Cl(t.playlist,e.playlist)),p.length?p[0]:(wl(d,(e,t)=>e.rebufferingImpact-t.rebufferingImpact),d[0]||null)},Ll=function(){const e=this.playlists.main.playlists.filter(Ea.isEnabled);wl(e,(e,t)=>Cl(e,t));const t=e.filter(e=>!!Tl(this.playlists.main,e).video);return t[0]||null},Dl=e=>{let t,i=0;return e.bytes&&(t=new Uint8Array(e.bytes),e.segments.forEach(e=>{t.set(e,i),i+=e.byteLength})),t};function Ml(e){try{return new URL(e).pathname.split("/").slice(-2).join("/")}catch(t){return""}}const Rl=function(e,t,i){if(!e[i]){t.trigger({type:"usage",name:"vhs-608"});let n=i;/^cc708_/.test(i)&&(n="SERVICE"+i.split("_")[1]);const r=t.textTracks().getTrackById(n);if(r)e[i]=r;else{const r=t.options_.vhs&&t.options_.vhs.captionServices||{};let s=i,a=i,o=!1;const l=r[n];l&&(s=l.label,a=l.language,o=l.default),e[i]=t.addRemoteTextTrack({kind:"captions",id:n,default:o,label:s,language:a},!1).track}}},Nl=function({inbandTextTracks:e,captionArray:t,timestampOffset:i}){if(!t)return;const n=r.a.WebKitDataCue||r.a.VTTCue;t.forEach(t=>{const r=t.stream;t.content?t.content.forEach(s=>{const a=new n(t.startTime+i,t.endTime+i,s.text);a.line=s.line,a.align="left",a.position=s.position,a.positionAlign="line-left",e[r].addCue(a)}):e[r].addCue(new n(t.startTime+i,t.endTime+i,t.text))})},jl=function(e){Object.defineProperties(e.frame,{id:{get(){return Is.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get(){return Is.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get(){return Is.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})},Bl=({inbandTextTracks:e,metadataArray:t,timestampOffset:i,videoDuration:n})=>{if(!t)return;const s=r.a.WebKitDataCue||r.a.VTTCue,a=e.metadataTrack_;if(!a)return;if(t.forEach(e=>{const t=e.cueTime+i;!("number"!==typeof t||r.a.isNaN(t)||t<0)&&t<1/0&&e.frames&&e.frames.length&&e.frames.forEach(e=>{const i=new s(t,t,e.value||e.url||e.data||"");i.frame=e,i.value=e,jl(i),a.addCue(i)})}),!a.cues||!a.cues.length)return;const o=a.cues,l=[];for(let r=0;r<o.length;r++)o[r]&&l.push(o[r]);const u=l.reduce((e,t)=>{const i=e[t.startTime]||[];return i.push(t),e[t.startTime]=i,e},{}),c=Object.keys(u).sort((e,t)=>Number(e)-Number(t));c.forEach((e,t)=>{const i=u[e],r=isFinite(n)?n:e,s=Number(c[t+1])||r;i.forEach(e=>{e.endTime=s})})},Ul={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"},Fl=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),ql=({inbandTextTracks:e,dateRanges:t})=>{const i=e.metadataTrack_;if(!i)return;const n=r.a.WebKitDataCue||r.a.VTTCue;t.forEach(e=>{for(const t of Object.keys(e)){if(Fl.has(t))continue;const r=new n(e.startTime,e.endTime,"");r.id=e.id,r.type="com.apple.quicktime.HLS",r.value={key:Ul[t],data:e[t]},"scte35Out"!==t&&"scte35In"!==t||(r.value.data=new Uint8Array(r.value.data.match(/[\da-f]{2}/gi)).buffer),i.addCue(r)}e.processDateRange()})},Hl=(e,t,i)=>{e.metadataTrack_||(e.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,Is.browser.IS_ANY_SAFARI||(e.metadataTrack_.inBandMetadataTrackDispatchType=t))},Vl=function(e,t,i){let n,r;if(i&&i.cues){n=i.cues.length;while(n--)r=i.cues[n],r.startTime>=e&&r.endTime<=t&&i.removeCue(r)}},zl=function(e){const t=e.cues;if(!t)return;const i={};for(let n=t.length-1;n>=0;n--){const r=t[n],s=`${r.startTime}-${r.endTime}-${r.text}`;i[s]?e.removeCue(r):i[s]=r}},Wl=(e,t,i)=>{if("undefined"===typeof t||null===t||!e.length)return[];const n=Math.ceil((t-i+3)*x["ONE_SECOND_IN_TS"]);let r;for(r=0;r<e.length;r++)if(e[r].pts>n)break;return e.slice(r)},$l=(e,t,i)=>{if(!t.length)return e;if(i)return t.slice();const n=t[0].pts;let r=0;for(r;r<e.length;r++)if(e[r].pts>=n)break;return e.slice(0,r).concat(t)},Gl=(e,t,i,n)=>{const r=Math.ceil((t-n)*x["ONE_SECOND_IN_TS"]),s=Math.ceil((i-n)*x["ONE_SECOND_IN_TS"]),a=e.slice();let o=e.length;while(o--)if(e[o].pts<=s)break;if(-1===o)return a;let l=o+1;while(l--)if(e[l].pts<=r)break;return l=Math.max(l,0),a.splice(l,o-l+1),a},Xl=function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;const i=Object.keys(e).sort(),n=Object.keys(t).sort();if(i.length!==n.length)return!1;for(let r=0;r<i.length;r++){const s=i[r];if(s!==n[r])return!1;if(e[s]!==t[s])return!1}return!0},Kl=22,Yl=function(e,t,i){t=t||[];const n=[];let r=0;for(let s=0;s<t.length;s++){const a=t[s];if(e===a.timeline&&(n.push(s),r+=a.duration,r>i))return s}return 0===n.length?0:n[n.length-1]},Ql=1,Jl=500,Zl=e=>"number"===typeof e&&isFinite(e),eu=1/60,tu=(e,t,i)=>"main"===e&&t&&i?i.hasAudio||i.hasVideo?t.hasVideo&&!i.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.":!t.hasVideo&&i.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:"Neither audio nor video found in segment.":null,iu=(e,t,i)=>{let n=t-Oo.BACK_BUFFER_LENGTH;e.length&&(n=Math.max(n,e.start(0)));const r=t-i;return Math.min(r,n)},nu=e=>{const{startOfSegment:t,duration:i,segment:n,part:r,playlist:{mediaSequence:s,id:a,segments:o=[]},mediaIndex:l,partIndex:u,timeline:c}=e,h=o.length-1;let d="mediaIndex/partIndex increment";e.getMediaInfoForTime?d=`getMediaInfoForTime (${e.getMediaInfoForTime})`:e.isSyncRequest&&(d="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(d+=" with independent "+e.independent);const p="number"===typeof u,f=e.segment.uri?"segment":"pre-segment",m=p?na({preloadSegment:n})-1:0;return`${f} [${s+l}/${s+h}]`+(p?` part [${u}/${m}]`:"")+` segment start/end [${n.start} => ${n.end}]`+(p?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${t}]`+` duration [${i}]`+` timeline [${c}]`+` selected by [${d}]`+` playlist [${a}]`},ru=e=>e+"TimingInfo",su=({segmentTimeline:e,currentTimeline:t,startOfSegment:i,buffered:n,overrideCheck:r})=>r||e!==t?e<t?i:n.length?n.end(n.length-1):i:null,au=({timelineChangeController:e,currentTimeline:t,segmentTimeline:i,loaderType:n,audioDisabled:r})=>{if(t===i)return!1;if("audio"===n){const t=e.lastTimelineChange({type:"main"});return!t||t.to!==i}if("main"===n&&r){const t=e.pendingTimelineChange({type:"audio"});return!t||t.to!==i}return!1},ou=e=>{let t=0;return["video","audio"].forEach((function(i){const n=e[i+"TimingInfo"];if(!n)return;const{start:s,end:a}=n;let o;"bigint"===typeof s||"bigint"===typeof a?o=r.a.BigInt(a)-r.a.BigInt(s):"number"===typeof s&&"number"===typeof a&&(o=a-s),"undefined"!==typeof o&&o>t&&(t=o)})),"bigint"===typeof t&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),t},lu=({segmentDuration:e,maxDuration:t})=>!!e&&Math.round(e)>t+qs,uu=(e,t)=>{if("hls"!==t)return null;const i=ou({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!i)return null;const n=e.playlist.targetDuration,r=lu({segmentDuration:i,maxDuration:2*n}),s=lu({segmentDuration:i,maxDuration:n}),a=`Segment with index ${e.mediaIndex} from playlist ${e.playlist.id} has a duration of ${i} when the reported duration is ${e.duration} and the target duration is ${n}. 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||s?{severity:r?"warn":"info",message:a}:null};class cu extends Is.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if("function"!==typeof e.currentTime)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_={},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_=js(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(e){e!==this.state_&&(this.logger_(`${this.state_} -> ${e}`),this.state_=e,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}),"main"===this.loaderType_&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}),"audio"===this.loaderType_&&this.timelineChangeController_.on("timelinechange",()=>{this.hasEnoughInfoToLoad_()&&this.processLoadQueue_(),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return Yo.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_&&r.a.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(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)}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,r.a.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)}error(e){return"undefined"!==typeof e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&Yo.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Us();if("main"===this.loaderType_){const{hasAudio:t,hasVideo:i,isMuxed:n}=e;if(i&&t&&!this.audioDisabled_&&!n)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const i=io(e);let n=this.initSegments_[i];return t&&!n&&e.bytes&&(this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),n||e}segmentKey(e,t=!1){if(!e)return null;const i=no(e);let n=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!n&&e.bytes&&(this.keyCache_[i]=n={resolvedUri:e.resolvedUri,bytes:e.bytes});const r={resolvedUri:(n||e).resolvedUri};return n&&(r.bytes=n.bytes),r}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),this.playlist_)return"INIT"===this.state&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY"))}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e)return;const i=this.playlist_,n=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));let r=null;if(i&&(i.id?r=i.id:i.uri&&(r=i.uri)),this.logger_(`playlist update [${r} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update:\ncurrentTime: ${this.currentTime_()}\nbufferedEnd: ${Js(this.buffered_())}\n`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri){if(null!==this.mediaIndex){const t=!e.endList&&"number"===typeof e.partTargetDuration;t?this.resetLoader():this.resyncLoader()}return this.currentMediaInfo_=void 0,void this.trigger("playlistupdate")}const s=e.mediaSequence-i.mediaSequence;if(this.logger_(`live window shift [${s}]`),null!==this.mediaIndex)if(this.mediaIndex-=s,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const e=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!e.parts||!e.parts.length||!e.parts[this.partIndex])){const e=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=e}}n&&(n.mediaIndex-=s,n.mediaIndex<0?(n.mediaIndex=null,n.partIndex=null):(n.mediaIndex>=0&&(n.segment=e.segments[n.mediaIndex]),n.partIndex>=0&&n.segment.parts&&(n.part=n.segment.parts[n.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}pause(){this.checkBufferTimeout_&&(r.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return null===this.checkBufferTimeout_}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_&&Yo.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4,t="hls"===this.sourceType_&&!e;t&&(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,i=(()=>{}),n=!1){if(t===1/0&&(t=this.duration_()),t<=e)return void this.logger_("skipping remove because end ${end} is <= start ${start}");if(!this.sourceUpdater_||!this.getMediaInfo_())return void this.logger_("skipping remove because no source updater or starting media info");let r=1;const s=()=>{r--,0===r&&i()};!n&&this.audioDisabled_||(r++,this.sourceUpdater_.removeAudio(e,t,s)),(n||"main"===this.loaderType_)&&(this.gopBuffer_=Gl(this.gopBuffer_,e,t,this.timeMapping_),r++,this.sourceUpdater_.removeVideo(e,t,s));for(const a in this.inbandTextTracks_)Vl(e,t,this.inbandTextTracks_[a]);Vl(e,t,this.segmentMetadataTrack_),s()}monitorBuffer_(){this.checkBufferTimeout_&&r.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=r.a.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&r.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=r.a.setTimeout(this.monitorBufferTick_.bind(this),Jl)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();e&&("number"===typeof e.timestampOffset&&(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_,i=this.partIndex){if(!t||!this.mediaSource_)return!1;const n="number"===typeof e&&t.segments[e],r=e+1===t.segments.length,s=!n||!n.parts||i+1===n.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&r&&s}chooseNextRequest_(){const e=this.buffered_(),t=Js(e)||0,i=Zs(e,this.currentTime_()),n=!this.hasPlayed_()&&i>=1,r=i>=this.goalBufferLength_(),s=this.playlist_.segments;if(!s.length||n||r)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const a={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(a.isSyncRequest)a.mediaIndex=Yl(this.currentTimeline_,s,t),this.logger_("choose next request. Can not find sync point. Fallback to media Index: "+a.mediaIndex);else if(null!==this.mediaIndex){const e=s[this.mediaIndex],i="number"===typeof this.partIndex?this.partIndex:-1;a.startOfSegment=e.end?e.end:t,e.parts&&e.parts[i+1]?(a.mediaIndex=this.mediaIndex,a.partIndex=i+1):a.mediaIndex=this.mediaIndex+1}else{let e,i,n;const r=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch:\nFor TargetTime: ${r}.\nCurrentTime: ${this.currentTime_()}\nBufferedEnd: ${t}\nFetch At Buffer: ${this.fetchAtBuffer_}\n`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const t=this.getSyncInfoFromMediaSequenceSync_(r);if(!t)return this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null;this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${t.start} --\x3e ${t.end})`),e=t.segmentIndex,i=t.partIndex,n=t.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const t=Ea.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:r,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});e=t.segmentIndex,i=t.partIndex,n=t.startTime}a.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+r:"currentTime "+r,a.mediaIndex=e,a.startOfSegment=n,a.partIndex=i,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${a.mediaIndex} `)}const o=s[a.mediaIndex];let l=o&&"number"===typeof a.partIndex&&o.parts&&o.parts[a.partIndex];if(!o||"number"===typeof a.partIndex&&!l)return null;"number"!==typeof a.partIndex&&o.parts&&(a.partIndex=0,l=o.parts[0]);const u=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!i&&l&&!u&&!l.independent)if(0===a.partIndex){const e=s[a.mediaIndex-1],t=e.parts&&e.parts.length&&e.parts[e.parts.length-1];t&&t.independent&&(a.mediaIndex-=1,a.partIndex=e.parts.length-1,a.independent="previous segment")}else o.parts[a.partIndex-1].independent&&(a.partIndex-=1,a.independent="previous part");const c=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return a.mediaIndex>=s.length-1&&c&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,a.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(a))}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 i=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!i)return null;if(!i.isAppended)return i;const n=this.mediaSequenceSync_.getSyncInfoForTime(i.end);return n?(n.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),n):null}generateSegmentInfo_(e){const{independent:t,playlist:i,mediaIndex:n,startOfSegment:r,isSyncRequest:s,partIndex:a,forceTimestampOffset:o,getMediaInfoForTime:l}=e,u=i.segments[n],c="number"===typeof a&&u.parts[a],h={requestId:"segment-loader-"+Math.random(),uri:c&&c.resolvedUri||u.resolvedUri,mediaIndex:n,partIndex:c?a:null,isSyncRequest:s,startOfSegment:r,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:u.timeline,duration:c&&c.duration||u.duration,segment:u,part:c,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:l,independent:t},d="undefined"!==typeof o?o:this.isPendingTimestampOffset_;h.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:u.timeline,currentTimeline:this.currentTimeline_,startOfSegment:r,buffered:this.buffered_(),overrideCheck:d});const p=Js(this.sourceUpdater_.audioBuffered());return"number"===typeof p&&(h.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(h.gopsToAlignWith=Wl(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),h}timestampOffsetForSegment_(e){return su(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)return;if(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),i=e.bandwidth,n=this.pendingSegment_.duration,r=Ea.estimateSegmentRequestTime(n,i,this.playlist_,e.bytesReceived),s=Ks(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(r<=s)return;const a=Pl({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:n,timeUntilRebuffer:s,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!a)return;const o=r-s,l=o-a.rebufferingImpact;let u=.5;s<=qs&&(u=1),!a.playlist||a.playlist.uri===this.playlist_.uri||l<u||(this.bandwidth=a.playlist.attributes.BANDWIDTH*Oo.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_("Aborting "+nu(e)),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||this.trigger("progress")}handleTrackInfo_(e,t){this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||this.checkForIllegalMediaSwitch(t)||(t=t||{},Xl(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_()))}handleTimingInfo_(e,t,i,n){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const r=this.pendingSegment_,s=ru(t);r[s]=r[s]||{},r[s][i]=n,this.logger_(`timinginfo: ${t} - ${i} - ${n}`),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(0===t.length)return void this.logger_("SegmentLoader received no captions from a caption event");const i=this.pendingSegment_;if(!i.hasAppendedData_)return void this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));const n=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),r={};t.forEach(e=>{r[e.stream]=r[e.stream]||{startTime:1/0,captions:[],endTime:0};const t=r[e.stream];t.startTime=Math.min(t.startTime,e.startTime+n),t.endTime=Math.max(t.endTime,e.endTime+n),t.captions.push(e)}),Object.keys(r).forEach(e=>{const{startTime:t,endTime:i,captions:s}=r[e],a=this.inbandTextTracks_;this.logger_(`adding cues from ${t} -> ${i} for ${e}`),Rl(a,this.vhs_.tech_,e),Vl(t,i,a[e]),Nl({captionArray:s,inbandTextTracks:a,timestampOffset:n})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,i){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const n=this.pendingSegment_;n.hasAppendedData_?this.addMetadataToTextTrack(i,t,this.duration_()):this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i))}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(e=>e())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(e=>e())}hasEnoughInfoToLoad_(){if("audio"!==this.loaderType_)return!0;const e=this.pendingSegment_;return!!e&&(!this.getCurrentMediaInfo_()||!au({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}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())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:i,hasVideo:n,isMuxed:r}=t;return!(n&&!e.videoTimingInfo)&&(!(i&&!this.audioDisabled_&&!r&&!e.audioTimingInfo)&&!au({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_())return void this.callQueue_.push(this.handleData_.bind(this,e,t));const i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[ru(t.type)].start;else{const e=this.getCurrentMediaInfo_(),t="main"===this.loaderType_&&e&&e.hasVideo;let n;t&&(n=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:t,firstVideoFrameTimeForData:n,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:"main"===this.loaderType_});const e=this.chooseNextRequest_();if(e.mediaIndex!==i.mediaIndex||e.partIndex!==i.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t)}}updateAppendInitSegmentStatus(e,t){"main"!==this.loaderType_||"number"!==typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:i,playlist:n}){if(i){const e=io(i);if(this.activeInitSegmentId_===e)return null;t=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=e}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=n,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i},n){const s=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();s.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Ys(s).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Ys(a).join(", "));const o=s.length?s.start(0):0,l=s.length?s.end(s.length-1):0,u=a.length?a.start(0):0,c=a.length?a.end(a.length-1):0;if(l-o<=Ql&&c-u<=Ql)return this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${i.byteLength}, audio buffer: ${Ys(s).join(", ")}, video buffer: ${Ys(a).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0,metadata:{errorType:Is.Error.SegmentExceedsSourceBufferQuota}}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:i}));const h=this.currentTime_(),d=h-Ql;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+d),this.remove(0,d,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${Ql}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=r.a.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},1e3*Ql)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:i},n){n&&(n.code!==Kl?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",n),this.error({message:`${t} append of ${i.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:Is.Error.SegmentAppendError}}),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i}))}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:n,bytes:r}){if(!r){const e=[n];let t=n.byteLength;i&&(e.unshift(i),t+=i.byteLength),r=Dl({bytes:t,segments:e})}this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:r},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:r}))}handleSegmentTimingInfo_(e,t,i){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const n=this.pendingSegment_.segment,r=e+"TimingInfo";n[r]||(n[r]={}),n[r].transmuxerPrependedSeconds=i.prependedContentDuration||0,n[r].transmuxedPresentationStart=i.start.presentation,n[r].transmuxedDecodeStart=i.start.decode,n[r].transmuxedPresentationEnd=i.end.presentation,n[r].transmuxedDecodeEnd=i.end.decode,n[r].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(e,t){const{type:i,data:n}=t;if(!n||!n.byteLength)return;if("audio"===i&&this.audioDisabled_)return;const r=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:r,data:n})}loadSegment_(e){this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"===typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):this.loadQueue_.push(()=>{const t=g()({},e,{forceTimestampOffset:!0});g()(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,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),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),n=null!==this.mediaIndex,r=e.timeline!==this.currentTimeline_&&e.timeline>0,s=i||n&&r;this.logger_(`Requesting\n${Ml(e.uri)}\n${nu(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=fl({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:s,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:t,level:i,stream:n})=>{this.logger_(`${nu(e)} logged from transmuxer stream ${n} as a ${i}: ${t}`)}})}trimBackBuffer_(e){const t=iu(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,i=e.part,n={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},r=e.playlist.segments[e.mediaIndex-1];if(r&&r.timeline===t.timeline&&(r.videoTimingInfo?n.baseStartTime=r.videoTimingInfo.transmuxedDecodeEnd:r.audioTimingInfo&&(n.baseStartTime=r.audioTimingInfo.transmuxedDecodeEnd)),t.key){const i=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);n.key=this.segmentKey(t.key),n.key.iv=i}return t.map&&(n.map=this.initSegmentForMap(t.map)),n}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){this.pendingSegment_.byteLength=t.bytesReceived,e<eu?this.logger_("Ignoring segment's bandwidth because its duration of "+e+" is less than the min to record "+eu):(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,i){if(this.callQueue_.length)return void this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,i));if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return;if(t.requestId!==this.pendingSegment_.requestId)return;if(e){if(this.pendingSegment_=null,this.state="READY",e.code===Jo.ABORTED)return;return this.pause(),e.code===Jo.TIMEOUT?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error"))}const n=this.pendingSegment_;this.saveBandwidthRelatedStats_(n.duration,t.stats),n.endOfAllRequests=t.endOfAllRequests,i.gopInfo&&(this.gopBuffer_=$l(this.gopBuffer_,i.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(n)}setTimeMapping_(e){const t=this.syncController_.mappingForTimeline(e);null!==t&&(this.timeMapping_=t)}updateMediaSecondsLoaded_(e){"number"===typeof e.start&&"number"===typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:i,firstVideoFrameTimeForData:n,currentVideoTimestampOffset:r,useVideoTimingInfo:s,videoTimingInfo:a,audioTimingInfo:o}){if("undefined"!==typeof e)return e;if(!s)return o.start;const l=t.segments[i-1];return 0!==i&&l&&"undefined"!==typeof l.start&&l.end===n+r?a.start:n}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t)return this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0,metadata:{errorType:Is.Error.SegmentUnsupportedMediaFormat}}),void this.trigger("error");const{hasAudio:i,hasVideo:n,isMuxed:r}=t,s="main"===this.loaderType_&&n,a=!this.audioDisabled_&&i&&!r;if(e.waitingOnAppends=0,!e.hasAppendedData_)return e.timingInfo||"number"!==typeof e.timestampOffset||(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),void this.checkAppendsDone_(e);s&&e.waitingOnAppends++,a&&e.waitingOnAppends++,s&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),a&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=tu(this.loaderType_,this.getCurrentMediaInfo_(),e);return!!t&&(this.error({message:t,playlistExclusionDuration:1/0,metadata:{errorType:Is.Error.SegmentSwitchError}}),this.trigger("error"),!0)}updateSourceBufferTimestampOffset_(e){if(null===e.timestampOffset||"number"!==typeof e.timingInfo.start||e.changedTimestampOffset||"main"!==this.loaderType_)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:i}){return this.useDtsForTimestampOffset_?e&&"number"===typeof e.transmuxedDecodeStart?e.transmuxedDecodeStart:t&&"number"===typeof t.transmuxedDecodeStart?t.transmuxedDecodeStart:i.start:i.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),i="main"===this.loaderType_&&t&&t.hasVideo,n=i&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;n&&(e.timingInfo.end="number"===typeof n.end?n.end:n.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());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:"main"===this.loaderType_});const t=uu(e,this.sourceType_);if(t&&("warn"===t.severity?Is.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_))return void this.logger_("Throwing away un-appended sync request "+nu(e));this.logger_("Appended "+nu(e)),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const i=e.segment,n=e.part,r=i.end&&this.currentTime_()-i.end>3*e.playlist.targetDuration,s=n&&n.end&&this.currentTime_()-n.end>3*e.playlist.partTargetDuration;if(r||s)return this.logger_(`bad ${r?"segment":"part"} ${nu(e)}`),void this.resetEverything();const a=null!==this.mediaIndex;a&&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<eu)return void this.logger_("Ignoring segment's throughput because its duration of "+e.duration+" is less than the min to record "+eu);const t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,n=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(n-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;const t=e.segment,i=t.start,n=t.end;if(!Zl(i)||!Zl(n))return;Vl(i,n,this.segmentMetadataTrack_);const s=r.a.WebKitDataCue||r.a.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:i,end:n},o=JSON.stringify(a),l=new s(i,n,o);l.value=a,this.segmentMetadataTrack_.addCue(l)}}function hu(){}const du=function(e){return"string"!==typeof e?e:e.replace(/./,e=>e.toUpperCase())},pu=["video","audio"],fu=(e,t)=>{const i=t[e+"Buffer"];return i&&i.updating||t.queuePending[e]},mu=(e,t)=>{for(let i=0;i<t.length;i++){const n=t[i];if("mediaSource"===n.type)return null;if(n.type===e)return i}return null},gu=(e,t)=>{if(0===t.queue.length)return;let i=0,n=t.queue[i];if("mediaSource"!==n.type){if("mediaSource"!==e&&t.ready()&&"closed"!==t.mediaSource.readyState&&!fu(e,t)){if(n.type!==e){if(i=mu(e,t.queue),null===i)return;n=t.queue[i]}return t.queue.splice(i,1),t.queuePending[e]=n,n.action(e,t),n.doneFn?void 0:(t.queuePending[e]=null,void gu(e,t))}}else t.updating()||"closed"===t.mediaSource.readyState||(t.queue.shift(),n.action(t),n.doneFn&&n.doneFn(),gu("audio",t),gu("video",t))},yu=(e,t)=>{const i=t[e+"Buffer"],n=du(e);i&&(i.removeEventListener("updateend",t[`on${n}UpdateEnd_`]),i.removeEventListener("error",t[`on${n}Error_`]),t.codecs[e]=null,t[e+"Buffer"]=null)},vu=(e,t)=>e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t),_u={appendBuffer:(e,t,i)=>(n,r)=>{const s=r[n+"Buffer"];if(vu(r.mediaSource,s)){r.logger_(`Appending segment ${t.mediaIndex}'s ${e.length} bytes to ${n}Buffer`);try{s.appendBuffer(e)}catch(a){r.logger_(`Error with code ${a.code} `+(a.code===Kl?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${t.mediaIndex} to ${n}Buffer`),r.queuePending[n]=null,i(a)}}},remove:(e,t)=>(i,n)=>{const r=n[i+"Buffer"];if(vu(n.mediaSource,r)){n.logger_(`Removing ${e} to ${t} from ${i}Buffer`);try{r.remove(e,t)}catch(s){n.logger_(`Remove ${e} to ${t} from ${i}Buffer failed`)}}},timestampOffset:e=>(t,i)=>{const n=i[t+"Buffer"];vu(i.mediaSource,n)&&(i.logger_(`Setting ${t}timestampOffset to ${e}`),n.timestampOffset=e)},callback:e=>(t,i)=>{e()},endOfStream:e=>t=>{if("open"===t.mediaSource.readyState){t.logger_(`Calling mediaSource endOfStream(${e||""})`);try{t.mediaSource.endOfStream(e)}catch(i){Is.log.warn("Failed to call media source endOfStream",i)}}},duration:e=>t=>{t.logger_("Setting mediaSource duration to "+e);try{t.mediaSource.duration=e}catch(i){Is.log.warn("Failed to set media source duration",i)}},abort:()=>(e,t)=>{if("open"!==t.mediaSource.readyState)return;const i=t[e+"Buffer"];if(vu(t.mediaSource,i)){t.logger_(`calling abort on ${e}Buffer`);try{i.abort()}catch(n){Is.log.warn(`Failed to abort on ${e}Buffer`,n)}}},addSourceBuffer:(e,t)=>i=>{const n=du(e),r=Object(_["e"])(t);i.logger_(`Adding ${e}Buffer with codec ${t} to mediaSource`);const s=i.mediaSource.addSourceBuffer(r);s.addEventListener("updateend",i[`on${n}UpdateEnd_`]),s.addEventListener("error",i[`on${n}Error_`]),i.codecs[e]=t,i[e+"Buffer"]=s},removeSourceBuffer:e=>t=>{const i=t[e+"Buffer"];if(yu(e,t),vu(t.mediaSource,i)){t.logger_(`Removing ${e}Buffer with codec ${t.codecs[e]} from mediaSource`);try{t.mediaSource.removeSourceBuffer(i)}catch(n){Is.log.warn(`Failed to removeSourceBuffer ${e}Buffer`,n)}}},changeType:e=>(t,i)=>{const n=i[t+"Buffer"],r=Object(_["e"])(e);if(!vu(i.mediaSource,n))return;const s=e.substring(0,e.indexOf(".")),a=i.codecs[t],o=a.substring(0,a.indexOf("."));if(o!==s){i.logger_(`changing ${t}Buffer codec from ${i.codecs[t]} to ${e}`);try{n.changeType(r),i.codecs[t]=e}catch(l){Is.log.warn(`Failed to changeType on ${t}Buffer`,l)}}}},bu=({type:e,sourceUpdater:t,action:i,doneFn:n,name:r})=>{t.queue.push({type:e,action:i,doneFn:n,name:r}),gu(e,t)},Tu=(e,t)=>i=>{const n=t[e+"Buffered"](),r=Fs(n);if(t.logger_(`received "updateend" event for ${e} Source Buffer: `,r),t.queuePending[e]){const i=t.queuePending[e].doneFn;t.queuePending[e]=null,i&&i(t[e+"Error_"])}gu(e,t)};class Su extends Is.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>gu("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=js("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=Tu("video",this),this.onAudioUpdateEnd_=Tu("audio",this),this.onVideoError_=e=>{this.videoError_=e},this.onAudioError_=e=>{this.audioError_=e},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){bu({type:"mediaSource",sourceUpdater:this,action:_u.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){bu({type:e,sourceUpdater:this,action:_u.abort(e),name:"abort"})}removeSourceBuffer(e){this.canRemoveSourceBuffer()?bu({type:"mediaSource",sourceUpdater:this,action:_u.removeSourceBuffer(e),name:"removeSourceBuffer"}):Is.log.error("removeSourceBuffer is not supported!")}canRemoveSourceBuffer(){return!Is.browser.IS_FIREFOX&&r.a.MediaSource&&r.a.MediaSource.prototype&&"function"===typeof r.a.MediaSource.prototype.removeSourceBuffer}static canChangeType(){return r.a.SourceBuffer&&r.a.SourceBuffer.prototype&&"function"===typeof r.a.SourceBuffer.prototype.changeType}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){this.canChangeType()?bu({type:e,sourceUpdater:this,action:_u.changeType(t),name:"changeType"}):Is.log.error("changeType is not supported!")}addOrChangeSourceBuffers(e){if(!e||"object"!==typeof e||0===Object.keys(e).length)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const i=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,i);this.canChangeType()&&this.changeType(t,i)})}appendBuffer(e,t){const{segmentInfo:i,type:n,bytes:r}=e;if(this.processedAppend_=!0,"audio"===n&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,t]),void this.logger_(`delayed audio append of ${r.length} until video append`);const s=t;if(bu({type:n,sourceUpdater:this,action:_u.appendBuffer(r,i||{mediaIndex:-1},s),doneFn:t,name:"appendBuffer"}),"video"===n){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const e=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${e.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,e.forEach(e=>{this.appendBuffer.apply(this,e)})}}audioBuffered(){return vu(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Us()}videoBuffered(){return vu(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Us()}buffered(){const e=vu(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=vu(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():Gs(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=hu){bu({type:"mediaSource",sourceUpdater:this,action:_u.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=hu){"string"!==typeof e&&(e=void 0),bu({type:"mediaSource",sourceUpdater:this,action:_u.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=hu){this.audioBuffered().length&&0!==this.audioBuffered().end(0)?bu({type:"audio",sourceUpdater:this,action:_u.remove(e,t),doneFn:i,name:"remove"}):i()}removeVideo(e,t,i=hu){this.videoBuffered().length&&0!==this.videoBuffered().end(0)?bu({type:"video",sourceUpdater:this,action:_u.remove(e,t),doneFn:i,name:"remove"}):i()}updating(){return!(!fu("audio",this)&&!fu("video",this))}audioTimestampOffset(e){return"undefined"!==typeof e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(bu({type:"audio",sourceUpdater:this,action:_u.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return"undefined"!==typeof e&&this.videoBuffer&&this.videoTimestampOffset!==e&&(bu({type:"video",sourceUpdater:this,action:_u.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&bu({type:"audio",sourceUpdater:this,action:_u.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&bu({type:"video",sourceUpdater:this,action:_u.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),pu.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[e+"QueueCallback"](()=>yu(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const ku=e=>decodeURIComponent(escape(String.fromCharCode.apply(null,e))),Eu=e=>{const t=new Uint8Array(e);return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")},wu=new Uint8Array("\n\n".split("").map(e=>e.charCodeAt(0)));class Cu extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class xu extends cu{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 Us();const e=this.subtitlesTrack_.cues,t=e[0].startTime,i=e[e.length-1].startTime;return Us([[t,i]])}initSegmentForMap(e,t=!1){if(!e)return null;const i=io(e);let n=this.initSegments_[i];if(t&&!n&&e.bytes){const t=wu.byteLength+e.bytes.byteLength,r=new Uint8Array(t);r.set(e.bytes),r.set(wu,e.bytes.byteLength),this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:r}}return n||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return"undefined"===typeof e||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}remove(e,t){Vl(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(null===this.syncController_.timestampOffsetForTimeline(e.timeline)){const e=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};return this.syncController_.one("timestampoffset",e),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){while(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,i){if(!this.subtitlesTrack_)return void(this.state="READY");if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===Jo.TIMEOUT&&this.handleTimeout_(),e.code===Jo.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);const n=this.pendingSegment_;this.saveBandwidthRelatedStats_(n.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const s=n.segment;if(s.map&&(s.map.bytes=t.map.bytes),n.bytes=t.bytes,"function"!==typeof r.a.WebVTT&&"function"===typeof this.loadVttJs)return this.state="WAITING_ON_VTTJS",void this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,i),()=>this.stopForError({message:"Error loading vtt.js",metadata:{errorType:Is.Error.VttLoadError}}));s.requested=!0;try{this.parseVTTCues_(n)}catch(a){return void this.stopForError({message:a.message,metadata:{errorType:Is.Error.VttCueParsingError}})}if(this.updateTimeMapping_(n,this.syncController_.timelines[n.timeline],this.playlist_),n.cues.length?n.timingInfo={start:n.cues[0].startTime,end:n.cues[n.cues.length-1].endTime}:n.timingInfo={start:n.startOfSegment,end:n.startOfSegment+n.duration},n.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");n.byteLength=n.bytes.byteLength,this.mediaSecondsLoaded+=s.duration,n.cues.forEach(e=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new r.a.VTTCue(e.startTime,e.endTime,e.text):e)}),zl(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(e){let t,i=!1;if("function"!==typeof r.a.WebVTT)throw new Cu;"function"===typeof r.a.TextDecoder?t=new r.a.TextDecoder("utf8"):(t=r.a.WebVTT.StringDecoder(),i=!0);const n=new r.a.WebVTT.Parser(r.a,r.a.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},n.oncue=e.cues.push.bind(e.cues),n.ontimestampmap=t=>{e.timestampmap=t},n.onparsingerror=e=>{Is.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){let t=e.segment.map.bytes;i&&(t=ku(t)),n.parse(t)}let s=e.bytes;i&&(s=ku(s)),n.parse(s),n.flush()}updateTimeMapping_(e,t,i){const n=e.segment;if(!t)return;if(!e.cues.length)return void(n.empty=!0);const{MPEGTS:r,LOCAL:s}=e.timestampmap,a=r/x["ONE_SECOND_IN_TS"],o=a-s+t.mapping;if(e.cues.forEach(e=>{const i=e.endTime-e.startTime,n=0===r?e.startTime+o:this.handleRollover_(e.startTime+o,t.time);e.startTime=Math.max(n,0),e.endTime=Math.max(n+i,0)}),!i.syncInfo){const t=e.cues[0].startTime,r=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(t,r-n.duration)}}}handleRollover_(e,t){if(null===t)return e;let i=e*x["ONE_SECOND_IN_TS"];const n=t*x["ONE_SECOND_IN_TS"];let r;r=n<i?-8589934592:8589934592;while(Math.abs(i-n)>4294967296)i+=r;return i/x["ONE_SECOND_IN_TS"]}}const Au=function(e,t){const i=e.cues;for(let n=0;n<i.length;n++){const e=i[n];if(t>=e.adStartTime&&t<=e.adEndTime)return e}return null},Iu=function(e,t,i=0){if(!e.segments)return;let n,s=i;for(let a=0;a<e.segments.length;a++){const i=e.segments[a];if(n||(n=Au(t,s+i.duration/2)),n){if("cueIn"in i){n.endTime=s,n.adEndTime=s,s+=i.duration,n=null;continue}if(s<n.endTime){s+=i.duration;continue}n.endTime+=i.duration}else if("cueOut"in i&&(n=new r.a.VTTCue(s,s+i.duration,i.cueOut),n.adStartTime=s,n.adEndTime=s+parseFloat(i.cueOut),t.addCue(n)),"cueOutCont"in i){const[e,a]=i.cueOutCont.split("/").map(parseFloat);n=new r.a.VTTCue(s,s+i.duration,""),n.adStartTime=s-e,n.adEndTime=n.adStartTime+a,t.addCue(n)}s+=i.duration}};class Ou{constructor({start:e,end:t,segmentIndex:i,partIndex:n=null,appended:r=!1}){this.start_=e,this.end_=t,this.segmentIndex_=i,this.partIndex_=n,this.appended_=r}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 Pu{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 Lu{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:i,segments:n}=e;if(this.isReliable_=this.isReliablePlaylist_(i,n),this.isReliable_)return this.updateStorage_(n,i,this.calculateBaseTime_(i,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:i}of this.storage_.values())if(i.length){for(const n of i)if(n.isInRange(e))return n}else if(t.isInRange(e))return t;return null}updateStorage_(e,t,i){const n=new Map;let r="\n",s=i,a=t;this.start_=s,e.forEach((e,t)=>{const i=this.storage_.get(a),o=s,l=o+e.duration,u=Boolean(i&&i.segmentSyncInfo&&i.segmentSyncInfo.isAppended),c=new Ou({start:o,end:l,appended:u,segmentIndex:t});e.syncInfo=c;let h=s;const d=(e.parts||[]).map((e,n)=>{const s=h,o=h+e.duration,l=Boolean(i&&i.partsSyncInfo&&i.partsSyncInfo[n]&&i.partsSyncInfo[n].isAppended),u=new Ou({start:s,end:o,appended:l,segmentIndex:t,partIndex:n});return h=o,r+=`Media Sequence: ${a}.${n} | Range: ${s} --\x3e ${o} | Appended: ${l}\n`,e.syncInfo=u,u});n.set(a,new Pu(c,d)),r+=`${Ml(e.resolvedUri)} | Media Sequence: ${a} | Range: ${o} --\x3e ${l} | Appended: ${u}\n`,a++,s=l}),this.end_=s,this.storage_=n,this.diagnostics_=r}calculateBaseTime_(e,t){return this.storage_.size?this.storage_.has(e)?this.storage_.get(e).segmentSyncInfo.start:t:0}isReliablePlaylist_(e,t){return void 0!==e&&null!==e&&Array.isArray(t)&&t.length}}const Du=86400,Mu=[{name:"VOD",run:(e,t,i,n,r)=>{if(i!==1/0){const e={time:0,segmentIndex:0,partIndex:null};return e}return null}},{name:"MediaSequence",run:(e,t,i,n,r,s)=>{const a=e.getMediaSequenceSync(s);if(!a)return null;if(!a.isReliable)return null;const o=a.getSyncInfoForTime(r);return o?{time:o.start,partIndex:o.partIndex,segmentIndex:o.segmentIndex}:null}},{name:"ProgramDateTime",run:(e,t,i,n,r)=>{if(!Object.keys(e.timelineToDatetimeMappings).length)return null;let s=null,a=null;const o=ta(t);r=r||0;for(let l=0;l<o.length;l++){const i=t.endList||0===r?l:o.length-(l+1),n=o[i],u=n.segment,c=e.timelineToDatetimeMappings[u.timeline];if(!c||!u.dateTimeObject)continue;const h=u.dateTimeObject.getTime()/1e3;let d=h+c;if(u.parts&&"number"===typeof n.partIndex)for(let e=0;e<n.partIndex;e++)d+=u.parts[e].duration;const p=Math.abs(r-d);if(null!==a&&(0===p||a<p))break;a=p,s={time:d,segmentIndex:n.segmentIndex,partIndex:n.partIndex}}return s}},{name:"Segment",run:(e,t,i,n,r)=>{let s=null,a=null;r=r||0;const o=ta(t);for(let l=0;l<o.length;l++){const e=t.endList||0===r?l:o.length-(l+1),i=o[e],u=i.segment,c=i.part&&i.part.start||u&&u.start;if(u.timeline===n&&"undefined"!==typeof c){const e=Math.abs(r-c);if(null!==a&&a<e)break;(!s||null===a||a>=e)&&(a=e,s={time:c,segmentIndex:i.segmentIndex,partIndex:i.partIndex})}}return s}},{name:"Discontinuity",run:(e,t,i,n,r)=>{let s=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length){let i=null;for(let n=0;n<t.discontinuityStarts.length;n++){const a=t.discontinuityStarts[n],o=t.discontinuitySequence+n+1,l=e.discontinuities[o];if(l){const e=Math.abs(r-l.time);if(null!==i&&i<e)break;(!s||null===i||i>=e)&&(i=e,s={time:l.time,segmentIndex:a,partIndex:null})}}}return s}},{name:"Playlist",run:(e,t,i,n,r)=>{if(t.syncInfo){const e={time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null};return e}return null}}];class Ru extends Is.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={},this.mediaSequenceStorage_={main:new Lu,audio:new Lu,vtt:new Lu},this.logger_=js("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,i,n,r){if(t!==1/0){const i=Mu.find(({name:e})=>"VOD"===e);return i.run(this,e,t)}const s=this.runStrategies_(e,t,i,n,r);if(!s.length)return null;for(const a of s){const{syncPoint:t,strategy:i}=a,{segmentIndex:r,time:s}=t;if(r<0)continue;const o=e.segments[r],l=s,u=l+o.duration;if(this.logger_(`Strategy: ${i}. Current time: ${n}. selected segment: ${r}. Time: [${l} -> ${u}]}`),n>=l&&n<u)return this.logger_("Found sync point with exact match: ",t),t}return this.selectSyncPoint_(s,{key:"time",value:n})}getExpiredTime(e,t){if(!e||!e.segments)return null;const i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;const n=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return n.segmentIndex>0&&(n.time*=-1),Math.abs(n.time+ua({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:n.segmentIndex,endIndex:0}))}runStrategies_(e,t,i,n,r){const s=[];for(let a=0;a<Mu.length;a++){const o=Mu[a],l=o.run(this,e,t,i,n,r);l&&(l.strategy=o.name,s.push({strategy:o.name,syncPoint:l}))}return s}selectSyncPoint_(e,t){let i=e[0].syncPoint,n=Math.abs(e[0].syncPoint[t.key]-t.value),r=e[0].strategy;for(let s=1;s<e.length;s++){const a=Math.abs(e[s].syncPoint[t.key]-t.value);a<n&&(n=a,i=e[s].syncPoint,r=e[s].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${r}]: [time:${i.time}, segmentIndex:`+i.segmentIndex+("number"===typeof i.partIndex?",partIndex:"+i.partIndex:"")+"]"),i}saveExpiredSegmentInfo(e,t){const i=t.mediaSequence-e.mediaSequence;if(i>Du)Is.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);else for(let n=i-1;n>=0;n--){const i=e.segments[n];if(i&&"undefined"!==typeof i.start){t.syncInfo={mediaSequence:e.mediaSequence+n,time:i.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],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const i=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),n=e.segment;i&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:n.start}));const r=n.dateTimeObject;n.discontinuity&&t&&r&&(this.timelineToDatetimeMappings[n.timeline]=-r.getTime()/1e3)}timestampOffsetForTimeline(e){return"undefined"===typeof this.timelines[e]?null:this.timelines[e].time}mappingForTimeline(e){return"undefined"===typeof this.timelines[e]?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,i){const n=e.segment,r=e.part;let s,a,o=this.timelines[e.timeline];if("number"===typeof e.timestampOffset)o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${o.time}] [mapping: ${o.mapping}]`)),s=e.startOfSegment,a=t.end+o.mapping;else{if(!o)return!1;s=t.start+o.mapping,a=t.end+o.mapping}return r&&(r.start=s,r.end=a),(!n.start||s<n.start)&&(n.start=s),n.end=a,!0}saveDiscontinuitySyncInfo_(e){const t=e.playlist,i=e.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let n=0;n<t.discontinuityStarts.length;n++){const r=t.discontinuityStarts[n],s=t.discontinuitySequence+n+1,a=r-e.mediaIndex,o=Math.abs(a);if(!this.discontinuities[s]||this.discontinuities[s].accuracy>o){let n;n=a<0?i.start-ua({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:r}):i.end+ua({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:r}),this.discontinuities[s]={time:n,accuracy:o}}}}dispose(){this.trigger("dispose"),this.off()}}class Nu extends Is.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:i}){return"number"===typeof t&&"number"===typeof i&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:i}){return"number"===typeof t&&"number"===typeof i&&(this.lastTimelineChanges_[e]={type:e,from:t,to:i},delete this.pendingTimelineChanges_[e],this.trigger("timelinechange")),this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const ju=Ro(No((function(){var t=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(i,1),i>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n<i;++n)t[n].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),s=t.length,a=0;a<s;++a)t[a].apply(this,r)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}();
  44. /*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function i(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}
  45. /*! @name aes-decrypter @version 4.0.1 @license Apache-2.0 */const n=function(){const e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],i=e[1],n=t[4],r=i[4];let s,a,o;const l=[],u=[];let c,h,d,p,f,m;for(s=0;s<256;s++)u[(l[s]=s<<1^283*(s>>7))^s]=s;for(a=o=0;!n[a];a^=c||1,o=u[o]||1)for(p=o^o<<1^o<<2^o<<3^o<<4,p=p>>8^255&p^99,n[a]=p,r[p]=a,d=l[h=l[c=l[a]]],m=16843009*d^65537*h^257*c^16843008*a,f=257*l[p]^16843008*p,s=0;s<4;s++)t[s][a]=f=f<<24^f>>>8,i[s][p]=m=m<<24^m>>>8;for(s=0;s<5;s++)t[s]=t[s].slice(0),i[s]=i[s].slice(0);return e};let r=null;class s{constructor(e){let t,i,s;r||(r=n()),this._tables=[[r[0][0].slice(),r[0][1].slice(),r[0][2].slice(),r[0][3].slice(),r[0][4].slice()],[r[1][0].slice(),r[1][1].slice(),r[1][2].slice(),r[1][3].slice(),r[1][4].slice()]];const a=this._tables[0][4],o=this._tables[1],l=e.length;let u=1;if(4!==l&&6!==l&&8!==l)throw new Error("Invalid aes key size");const c=e.slice(0),h=[];for(this._key=[c,h],t=l;t<4*l+28;t++)s=c[t-1],(t%l===0||8===l&&t%l===4)&&(s=a[s>>>24]<<24^a[s>>16&255]<<16^a[s>>8&255]<<8^a[255&s],t%l===0&&(s=s<<8^s>>>24^u<<24,u=u<<1^283*(u>>7))),c[t]=c[t-l]^s;for(i=0;t;i++,t--)s=c[3&i?t:t-4],h[i]=t<=4||i<4?s:o[0][a[s>>>24]]^o[1][a[s>>16&255]]^o[2][a[s>>8&255]]^o[3][a[255&s]]}decrypt(e,t,i,n,r,s){const a=this._key[1];let o,l,u,c=e^a[0],h=n^a[1],d=i^a[2],p=t^a[3];const f=a.length/4-2;let m,g=4;const y=this._tables[1],v=y[0],_=y[1],b=y[2],T=y[3],S=y[4];for(m=0;m<f;m++)o=v[c>>>24]^_[h>>16&255]^b[d>>8&255]^T[255&p]^a[g],l=v[h>>>24]^_[d>>16&255]^b[p>>8&255]^T[255&c]^a[g+1],u=v[d>>>24]^_[p>>16&255]^b[c>>8&255]^T[255&h]^a[g+2],p=v[p>>>24]^_[c>>16&255]^b[h>>8&255]^T[255&d]^a[g+3],g+=4,c=o,h=l,d=u;for(m=0;m<4;m++)r[(3&-m)+s]=S[c>>>24]<<24^S[h>>16&255]<<16^S[d>>8&255]<<8^S[255&p]^a[g++],o=c,c=h,h=d,d=p,p=o}}class a extends t{constructor(){super(t),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(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const o=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},l=function(e,t,i){const n=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),r=new s(Array.prototype.slice.call(t)),a=new Uint8Array(e.byteLength),l=new Int32Array(a.buffer);let u,c,h,d,p,f,m,g,y;for(u=i[0],c=i[1],h=i[2],d=i[3],y=0;y<n.length;y+=4)p=o(n[y]),f=o(n[y+1]),m=o(n[y+2]),g=o(n[y+3]),r.decrypt(p,f,m,g,l,y),l[y]=o(l[y]^u),l[y+1]=o(l[y+1]^c),l[y+2]=o(l[y+2]^h),l[y+3]=o(l[y+3]^d),u=p,c=f,h=m,d=g;return a};class u{constructor(e,t,n,r){const s=u.STEP,l=new Int32Array(e.buffer),c=new Uint8Array(e.byteLength);let h=0;for(this.asyncStream_=new a,this.asyncStream_.push(this.decryptChunk_(l.subarray(h,h+s),t,n,c)),h=s;h<l.length;h+=s)n=new Uint32Array([o(l[h-4]),o(l[h-3]),o(l[h-2]),o(l[h-1])]),this.asyncStream_.push(this.decryptChunk_(l.subarray(h,h+s),t,n,c));this.asyncStream_.push((function(){r(null,i(c))}))}static get STEP(){return 32e3}decryptChunk_(e,t,i,n){return function(){const r=l(e,t,i);n.set(r,e.byteOffset)}}}var c,h="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof e?e:"undefined"!==typeof self?self:{};c="undefined"!==typeof window?window:"undefined"!==typeof h?h:"undefined"!==typeof self?self:{};var d=c,p=function(e){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},f=d.BigInt||Number;f("0x1"),f("0x100"),f("0x10000"),f("0x1000000"),f("0x100000000"),f("0x10000000000"),f("0x1000000000000"),f("0x100000000000000"),f("0x10000000000000000"),function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);255===t[0]||t[0]}();const m=function(e){const t={};return Object.keys(e).forEach(i=>{const n=e[i];p(n)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n}),t};self.onmessage=function(e){const t=e.data,i=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),n=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),r=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new u(i,n,r,(function(e,i){self.postMessage(m({source:t.source,decrypted:i}),[i.buffer])}))}})));var Bu=Mo(ju);const Uu=e=>{let t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},Fu=(e,t)=>{e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},qu=(e,t)=>{t.activePlaylistLoader=e,e.load()},Hu=(e,t)=>()=>{const{segmentLoaders:{[e]:i,main:n},mediaTypes:{[e]:r}}=t,s=r.activeTrack(),a=r.getActiveGroup(),o=r.activePlaylistLoader,l=r.lastGroup_;a&&l&&a.id===l.id||(r.lastGroup_=a,r.lastTrack_=s,Fu(i,r),a&&!a.isMainPlaylist&&(a.playlistLoader?(i.resyncLoader(),qu(a.playlistLoader,r)):o&&n.resetEverything()))},Vu=(e,t)=>()=>{const{segmentLoaders:{[e]:i},mediaTypes:{[e]:n}}=t;n.lastGroup_=null,i.abort(),i.pause()},zu=(e,t)=>()=>{const{mainPlaylistLoader:i,segmentLoaders:{[e]:n,main:r},mediaTypes:{[e]:s}}=t,a=s.activeTrack(),o=s.getActiveGroup(),l=s.activePlaylistLoader,u=s.lastTrack_;if((!u||!a||u.id!==a.id)&&(s.lastGroup_=o,s.lastTrack_=a,Fu(n,s),o)){if(o.isMainPlaylist){if(!a||!u||a.id===u.id)return;const e=t.vhs.playlistController_,n=e.selectPlaylist();if(e.media()===n)return;return s.logger_(`track change. Switching main audio from ${u.id} to ${a.id}`),i.pause(),r.resetEverything(),void e.fastQualityChange_(n)}if("AUDIO"===e){if(!o.playlistLoader)return r.setAudio(!0),void r.resetEverything();n.setAudio(!0),r.setAudio(!1)}l!==o.playlistLoader?(n.track&&n.track(a),n.resetEverything(),qu(o.playlistLoader,s)):qu(o.playlistLoader,s)}},Wu={AUDIO:(e,t)=>()=>{const{mediaTypes:{[e]:i},excludePlaylist:n}=t,r=i.activeTrack(),s=i.activeGroup(),a=(s.filter(e=>e.default)[0]||s[0]).id,o=i.tracks[a];if(r!==o){Is.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const e in i.tracks)i.tracks[e].enabled=i.tracks[e]===o;i.onTrackChanged()}else n({error:{message:"Problem encountered loading the default audio track."}})},SUBTITLES:(e,t)=>()=>{const{mediaTypes:{[e]:i}}=t;Is.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const n=i.activeTrack();n&&(n.mode="disabled"),i.onTrackChanged()}},$u={AUDIO:(e,t,i)=>{if(!t)return;const{tech:n,requestOptions:r,segmentLoaders:{[e]:s}}=i;t.on("loadedmetadata",()=>{const e=t.media();s.playlist(e,r),(!n.paused()||e.endList&&"none"!==n.preload())&&s.load()}),t.on("loadedplaylist",()=>{s.playlist(t.media(),r),n.paused()||s.load()}),t.on("error",Wu[e](e,i))},SUBTITLES:(e,t,i)=>{const{tech:n,requestOptions:r,segmentLoaders:{[e]:s},mediaTypes:{[e]:a}}=i;t.on("loadedmetadata",()=>{const e=t.media();s.playlist(e,r),s.track(a.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&s.load()}),t.on("loadedplaylist",()=>{s.playlist(t.media(),r),n.paused()||s.load()}),t.on("error",Wu[e](e,i))}},Gu={AUDIO:(e,t)=>{const{vhs:i,sourceType:n,segmentLoaders:{[e]:r},requestOptions:s,main:{mediaGroups:a},mediaTypes:{[e]:{groups:o,tracks:l,logger_:u}},mainPlaylistLoader:c}=t,h=ka(c.main);a[e]&&0!==Object.keys(a[e]).length||(a[e]={main:{default:{default:!0}}},h&&(a[e].main.default.playlists=c.main.playlists));for(const d in a[e]){o[d]||(o[d]=[]);for(const r in a[e][d]){let p,f=a[e][d][r];if(h?(u(`AUDIO group '${d}' label '${r}' is a main playlist`),f.isMainPlaylist=!0,p=null):p="vhs-json"===n&&f.playlists?new Wa(f.playlists[0],i,s):f.resolvedUri?new Wa(f.resolvedUri,i,s):f.playlists&&"dash"===n?new Io(f.playlists[0],i,s,c):null,f=Bs({id:r,playlistLoader:p},f),$u[e](e,f.playlistLoader,t),o[d].push(f),"undefined"===typeof l[r]){const e=new Is.AudioTrack({id:r,kind:Uu(f),enabled:!1,language:f.language,default:f.default,label:r});l[r]=e}}}r.on("error",Wu[e](e,t))},SUBTITLES:(e,t)=>{const{tech:i,vhs:n,sourceType:r,segmentLoaders:{[e]:s},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[e]:{groups:l,tracks:u}},mainPlaylistLoader:c}=t;for(const h in o[e]){l[h]||(l[h]=[]);for(const s in o[e][h]){if(!n.options_.useForcedSubtitles&&o[e][h][s].forced)continue;let d,p=o[e][h][s];if("hls"===r)d=new Wa(p.resolvedUri,n,a);else if("dash"===r){const e=p.playlists.filter(e=>e.excludeUntil!==1/0);if(!e.length)return;d=new Io(p.playlists[0],n,a,c)}else"vhs-json"===r&&(d=new Wa(p.playlists?p.playlists[0]:p.resolvedUri,n,a));if(p=Bs({id:s,playlistLoader:d},p),$u[e](e,p.playlistLoader,t),l[h].push(p),"undefined"===typeof u[s]){const e=i.addRemoteTextTrack({id:s,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:s},!1).track;u[s]=e}}}s.on("error",Wu[e](e,t))},"CLOSED-CAPTIONS":(e,t)=>{const{tech:i,main:{mediaGroups:n},mediaTypes:{[e]:{groups:r,tracks:s}}}=t;for(const a in n[e]){r[a]||(r[a]=[]);for(const t in n[e][a]){const o=n[e][a][t];if(!/^(?:CC|SERVICE)/.test(o.instreamId))continue;const l=i.options_.vhs&&i.options_.vhs.captionServices||{};let u={label:t,language:o.language,instreamId:o.instreamId,default:o.default&&o.autoselect};if(l[u.instreamId]&&(u=Bs(u,l[u.instreamId])),void 0===u.default&&delete u.default,r[a].push(Bs({id:t},o)),"undefined"===typeof s[t]){const e=i.addRemoteTextTrack({id:u.instreamId,kind:"captions",default:u.default,language:u.language,label:u.label},!1).track;s[t]=e}}}}},Xu=(e,t)=>{for(let i=0;i<e.length;i++){if(Ta(t,e[i]))return!0;if(e[i].playlists&&Xu(e[i].playlists,t))return!0}return!1},Ku=(e,t)=>i=>{const{mainPlaylistLoader:n,mediaTypes:{[e]:{groups:r}}}=t,s=n.media();if(!s)return null;let a=null;s.attributes[e]&&(a=r[s.attributes[e]]);const o=Object.keys(r);if(!a)if("AUDIO"===e&&o.length>1&&ka(t.main))for(let e=0;e<o.length;e++){const t=r[o[e]];if(Xu(t,s)){a=t;break}}else r.main?a=r.main:1===o.length&&(a=r[o[0]]);return"undefined"===typeof i?a:null!==i&&a&&a.filter(e=>e.id===i.id)[0]||null},Yu={AUDIO:(e,t)=>()=>{const{mediaTypes:{[e]:{tracks:i}}}=t;for(const e in i)if(i[e].enabled)return i[e];return null},SUBTITLES:(e,t)=>()=>{const{mediaTypes:{[e]:{tracks:i}}}=t;for(const e in i)if("showing"===i[e].mode||"hidden"===i[e].mode)return i[e];return null}},Qu=(e,{mediaTypes:t})=>()=>{const i=t[e].activeTrack();return i?t[e].activeGroup(i):null},Ju=e=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{Gu[t](t,e)});const{mediaTypes:t,mainPlaylistLoader:i,tech:n,vhs:r,segmentLoaders:{["AUDIO"]:s,main:a}}=e;["AUDIO","SUBTITLES"].forEach(i=>{t[i].activeGroup=Ku(i,e),t[i].activeTrack=Yu[i](i,e),t[i].onGroupChanged=Hu(i,e),t[i].onGroupChanging=Vu(i,e),t[i].onTrackChanged=zu(i,e),t[i].getActiveGroup=Qu(i,e)});const o=t.AUDIO.activeGroup();if(o){const e=(o.filter(e=>e.default)[0]||o[0]).id;t.AUDIO.tracks[e].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged();const i=t.AUDIO.getActiveGroup();i.playlistLoader?(a.setAudio(!1),s.setAudio(!0)):a.setAudio(!0)}i.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(e=>t[e].onGroupChanged())}),i.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(e=>t[e].onGroupChanging())});const l=()=>{t.AUDIO.onTrackChanged(),n.trigger({type:"usage",name:"vhs-audio-change"})};n.audioTracks().addEventListener("change",l),n.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),r.on("dispose",()=>{n.audioTracks().removeEventListener("change",l),n.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)}),n.clearTracks("audio");for(const u in t.AUDIO.tracks)n.audioTracks().addTrack(t.AUDIO.tracks[u])},Zu=()=>{const e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:hu,activeTrack:hu,getActiveGroup:hu,onGroupChanged:hu,onTrackChanged:hu,lastTrack_:null,logger_:js(`MediaGroups[${t}]`)}}),e};class ec{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){1===e&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=Rs(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(e=>[e.ID,e])))}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 tc extends Is.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new ec,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_=js("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const i=t.serverUri||t.serverURL;if(!i)return this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`),void this.trigger("error");i.startsWith("data:")?this.decodeDataUriManifest_(i.substring(i.indexOf(",")+1)):(this.steeringManifest.reloadUri=Rs(e,i),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 i=e?t:this.getRequestURI(t);if(!i)return this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),void this.dispose();this.request_=this.xhr_({uri:i,requestType:"content-steering-manifest"},(e,t)=>{if(e){if(410===t.status)return this.logger_(`manifest request 410 ${e}.`),this.logger_(`There will be no more content steering requests to ${i} this session.`),void this.excludedSteeringManifestURLs.add(i);if(429===t.status){const i=t.responseHeaders["retry-after"];return this.logger_(`manifest request 429 ${e}.`),this.logger_(`content steering will retry in ${i} seconds.`),void this.startTTLTimeout_(parseInt(i,10))}return this.logger_(`manifest failed to load ${e}.`),void this.startTTLTimeout_()}const n=JSON.parse(this.request_.responseText);this.assignSteeringProperties_(n),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new r.a.URL(e),i=new r.a.URL(this.proxyServerUrl_);return i.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){const t=JSON.parse(r.a.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new r.a.URL(e),i=this.getPathway(),n=this.getBandwidth_();if(i){const e=`_${this.manifestType_}_pathway`;t.searchParams.set(e,i)}if(n){const e=`_${this.manifestType_}_throughput`;t.searchParams.set(e,n)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version)return this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),void this.trigger("error");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 t=e=>{for(const t of e)if(this.availablePathways_.has(t))return t;return[...this.availablePathways_][0]},i=t(this.steeringManifest.priority);this.currentPathway!==i&&(this.currentPathway=i,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=e=>this.excludedSteeringManifestURLs.has(e);if(this.proxyServerUrl_){const i=this.setProxyServerUrl_(e);if(!t(i))return i}const i=this.setSteeringParams_(e);return t(i)?null:i}startTTLTimeout_(e=this.steeringManifest.ttl){const t=1e3*e;this.ttlTimeout_=r.a.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){r.a.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 ec}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&&(Rs(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const ic=10;let nc;const rc=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],sc=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},ac=function({currentPlaylist:e,buffered:t,currentTime:i,nextPlaylist:n,bufferLowWaterLine:r,bufferHighWaterLine:s,duration:a,bufferBasedABR:o,log:l}){if(!n)return Is.log.warn("We received no playlist to switch to. Please check your stream."),!1;const u=`allowing switch ${e&&e.id||"null"} -> ${n.id}`;if(!e)return l(u+" as current playlist is not set"),!0;if(n.id===e.id)return!1;const c=Boolean(zs(t,i).length);if(!e.endList)return c||"number"!==typeof e.partTargetDuration?(l(u+" as current playlist is live"),!0):(l(`not ${u} as current playlist is live llhls, but currentTime isn't in buffered.`),!1);const h=Zs(t,i),d=o?Oo.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Oo.MAX_BUFFER_LOW_WATER_LINE;if(a<d)return l(`${u} as duration < max low water line (${a} < ${d})`),!0;const p=n.attributes.BANDWIDTH,f=e.attributes.BANDWIDTH;if(p<f&&(!o||h<s)){let e=`${u} as next bandwidth < current bandwidth (${p} < ${f})`;return o&&(e+=` and forwardBuffer < bufferHighWaterLine (${h} < ${s})`),l(e),!0}if((!o||p>f)&&h>=r){let e=`${u} as forwardBuffer >= bufferLowWaterLine (${h} >= ${r})`;return o&&(e+=` and next bandwidth > current bandwidth (${p} > ${f})`),l(e),!0}return l(`not ${u} as no switching criteria met`),!1};class oc extends Is.EventTarget{constructor(e){super();const{src:t,withCredentials:i,tech:n,bandwidth:s,externVhs:a,useCueTags:o,playlistExclusionDuration:l,enableLowInitialPlaylist:u,sourceType:c,cacheEncryptionKeys:h,bufferBasedABR:d,leastPixelDiffSelector:p,captionServices:f}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:m}=e;null!==m&&"undefined"!==typeof m||(m=1/0),nc=a,this.bufferBasedABR=Boolean(d),this.leastPixelDiffSelector=Boolean(p),this.withCredentials=i,this.tech_=n,this.vhs_=n.vhs,this.sourceType_=c,this.useCueTags_=o,this.playlistExclusionDuration=l,this.maxPlaylistRetries=m,this.enableLowInitialPlaylist=u,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:i,maxPlaylistRetries:m,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=Zu(),this.mediaSource=new r.a.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_=Us(),this.hasPlayed_=!1,this.syncController_=new Ru(e),this.segmentMetadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new Bu,this.sourceUpdater_=new Su(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new Nu,this.keyStatusMap_=new Map;const g={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:f,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:s,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:h,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_="dash"===this.sourceType_?new Io(t,this.vhs_,Bs(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new Wa(t,this.vhs_,Bs(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new cu(Bs(g,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new cu(Bs(g,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new xu(Bs(g,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((e,t)=>{function i(){n.off("vttjserror",r),e()}function r(){n.off("vttjsloaded",i),t()}n.one("vttjsloaded",i),n.one("vttjserror",r),n.addWebVttScript_()})}),e);const y=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new tc(this.vhs_.xhr,y),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),rc.forEach(e=>{this[e+"_"]=sc.bind(this,e)}),this.logger_=js("pc"),this.triggeredFmp4Usage=!1,"none"===this.tech_.preload()?(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 v="none"===this.tech_.preload()?"play":"loadstart";this.tech_.one(v,()=>{const e=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-e,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-1===e||-1===t?-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,i){const n=this.media(),r=n&&(n.id||n.uri),s=e&&(e.id||e.uri);r&&r!==s&&(this.logger_(`switch media ${r} -> ${s} from ${t}`),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.mainPlaylistLoader_.media(e,i)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e],i=t?t.activeGroup():null,n=this.contentSteeringController_.getPathway();if(i&&n){const t=i.length?i[0].playlists:i.playlists,r=t.filter(e=>e.attributes.serviceLocation===n);r.length&&this.mediaTypes_[e].activePlaylistLoader.media(r[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=r.a.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(r.a.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 i=e.mediaGroups.AUDIO,n=Object.keys(i);let r;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)r=this.mediaTypes_.AUDIO.activeTrack();else{const e=i.main||n.length&&i[n[0]];for(const t in e)if(e[t].default){r={label:t};break}}if(!r)return t;const s=[];for(const a in i)if(i[a][r.label]){const t=i[a][r.label];if(t.playlists&&t.playlists.length)s.push.apply(s,t.playlists);else if(t.uri)s.push(t);else if(e.playlists.length)for(let i=0;i<e.playlists.length;i++){const t=e.playlists[i];t.attributes&&t.attributes.AUDIO&&t.attributes.AUDIO===a&&s.push(t)}}return s.length?s:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;ba(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&"none"!==this.tech_.preload()&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),Ju({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(),e),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 e=this.mainPlaylistLoader_.media();if(!e){let t;if(this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_(),this.enableLowInitialPlaylist&&(t=this.selectInitialPlaylist()),t||(t=this.selectPlaylist()),!t||!this.shouldSwitchToMedia_(t))return;this.initialMedia_=t,this.switchMedia_(this.initialMedia_,"initial");const i="vhs-json"===this.sourceType_&&this.initialMedia_.segments;if(!i)return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)}),this.mainPlaylistLoader_.on("error",()=>{const e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;ba(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,"dash"===this.sourceType_&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const e=this.mainPlaylistLoader_.media();if("playlist-unchanged"===e.lastExcludeReason_)return;const t=this.stuckAtPlaylistEnd_(e);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"})})}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 i=e.mediaGroups||{};let n=!0;const r=Object.keys(i.AUDIO);for(const s in i.AUDIO)for(const e in i.AUDIO[s]){const t=i.AUDIO[s][e];t.uri||(n=!1)}n&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),nc.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),r.length&&Object.keys(i.AUDIO[r[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_,i=this.tech_.currentTime(),n=this.bufferLowWaterLine(),r=this.bufferHighWaterLine(),s=this.tech_.buffered();return ac({buffered:s,currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:n,bufferHighWaterLine:r,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 e=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),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.mainSegmentLoader_.on("earlyabort",e=>{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:ic}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const e=this.getCodecsOrExclude_();e&&this.sourceUpdater_.addOrChangeSourceBuffers(e)};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()})}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()){e&&e===this.mainPlaylistLoader_.media()?this.logger_("skipping fastQualityChange because new media is same as old"):(this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0)}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(()=>{this.tech_.setCurrentTime(this.tech_.currentTime())})}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.tech_.setCurrentTime(e.end(e.length-1)):void 0}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 i=t.end(0);let n=i;if(e.start){const r=e.start.timeOffset;n=r<0?Math.max(i+r,t.start(0)):Math.min(i,r)}this.trigger("firstplay"),this.tech_.setCurrentTime(n)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const e=this.tech_.play();"undefined"!==typeof e&&"function"===typeof e.then&&e.then(null,e=>{})}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_();e=!t||t.hasVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){const t=this.seekable();if(!t.length)return!1;const i=this.syncController_.getExpiredTime(e,this.duration());if(null===i)return!1;const n=nc.Playlist.playlistEnd(e,i),r=this.tech_.currentTime(),s=this.tech_.buffered();if(!s.length)return n-r<=Hs;const a=s.end(s.length-1);return a-r<=Hs&&n-a<=Hs}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:i}){if(e=e||this.mainPlaylistLoader_.media(),i=i||t.playlistExclusionDuration||this.playlistExclusionDuration,!e)return this.error=t,void("open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));e.playlistErrors_++;const n=this.mainPlaylistLoader_.main.playlists,r=n.filter(ma),s=1===r.length&&r[0]===e;if(1===n.length&&i!==1/0)return Is.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(s);if(s){if(this.main().contentSteering){const t=this.pathwayAttribute_(e),i=1e3*this.contentSteeringController_.steeringManifest.ttl;return this.contentSteeringController_.excludePathway(t),this.excludeThenChangePathway_(),void setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(t)},i)}let t=!1;n.forEach(i=>{if(i===e)return;const n=i.excludeUntil;"undefined"!==typeof n&&n!==1/0&&(t=!0,delete i.excludeUntil)}),t&&(Is.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let a;a=e.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*i,e.excludeUntil=a,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const o=this.selectPlaylist();if(!o)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");const l=t.internal?this.logger_:Is.log.warn,u=t.message?" "+t.message:"";l(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${u} Switching to playlist ${o.id}.`),o.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),o.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const c=o.targetDuration/2*1e3||5e3,h="number"===typeof o.lastRequest&&Date.now()-o.lastRequest<=c;return this.switchMedia_(o,"exclude",s||h)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const i=[],n="all"===e;(n||"main"===e)&&i.push(this.mainPlaylistLoader_);const r=[];(n||"audio"===e)&&r.push("AUDIO"),(n||"subtitle"===e)&&(r.push("CLOSED-CAPTIONS"),r.push("SUBTITLES")),r.forEach(e=>{const t=this.mediaTypes_[e]&&this.mediaTypes_[e].activePlaylistLoader;t&&i.push(t)}),["main","audio","subtitle"].forEach(t=>{const n=this[t+"SegmentLoader_"];!n||e!==t&&"all"!==e||i.push(n)}),i.forEach(e=>t.forEach(t=>{"function"===typeof e[t]&&e[t]()}))}setCurrentTime(e){const t=zs(this.tech_.buffered(),e);return this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media()&&this.mainPlaylistLoader_.media().segments?t&&t.length?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()),void this.load()):0}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:nc.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 i=this.syncController_.getExpiredTime(t,this.duration());if(null===i)return;const n=this.mainPlaylistLoader_.main,r=nc.Playlist.seekable(t,i,nc.Playlist.liveEdgeDelay(n,t));if(0===r.length)return;if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),i=this.syncController_.getExpiredTime(t,this.duration()),null===i)return;if(e=nc.Playlist.seekable(t,i,nc.Playlist.liveEdgeDelay(n,t)),0===e.length)return}let s,a;this.seekable_&&this.seekable_.length&&(s=this.seekable_.end(0),a=this.seekable_.start(0)),e?e.start(0)>r.end(0)||r.start(0)>e.end(0)?this.seekable_=r:this.seekable_=Us([[e.start(0)>r.start(0)?e.start(0):r.start(0),e.end(0)<r.end(0)?e.end(0):r.end(0)]]):this.seekable_=r,this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===s&&this.seekable_.start(0)===a||(this.logger_(`seekable updated [${Xs(this.seekable_)}]`),this.tech_.trigger("seekablechanged"))}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),"open"!==this.mediaSource.readyState)return this.updateDuration_=this.updateDuration.bind(this,e),void this.mediaSource.addEventListener("sourceopen",this.updateDuration_);if(e){const e=this.seekable();if(!e.length)return;return void((isNaN(this.mediaSource.duration)||this.mediaSource.duration<e.end(e.length-1))&&this.sourceUpdater_.setDuration(e.end(e.length-1)))}const t=this.tech_.buffered();let i=nc.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(i=Math.max(i,t.end(t.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)}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 i in t)t[i].forEach(e=>{e.playlistLoader&&e.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_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!i)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const i=Tl(this.main(),t),n={},r=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(n.video=i.video||e.main.videoCodec||_["b"]),e.main.isMuxed&&(n.video+=","+(i.audio||e.main.audioCodec||_["a"])),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||r)&&(n.audio=i.audio||e.main.audioCodec||e.audio.audioCodec||_["a"],e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!n.audio&&!n.video)return void this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});const s=(e,t)=>e?Object(_["c"])(t):Object(_["g"])(t),a={};let o;if(["video","audio"].forEach((function(t){if(n.hasOwnProperty(t)&&!s(e[t].isFmp4,n[t])){const i=e[t].isFmp4?"browser":"muxer";a[i]=a[i]||[],a[i].push(n[t]),"audio"===t&&(o=i)}})),r&&o&&t.attributes.AUDIO){const e=t.attributes.AUDIO;this.main().playlists.forEach(i=>{const n=i.attributes&&i.attributes.AUDIO;n===e&&i!==t&&(i.excludeUntil=1/0)}),this.logger_(`excluding audio group ${e} as ${o} does not support codec(s): "${n.audio}"`)}if(!Object.keys(a).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const e=[];if(["video","audio"].forEach(t=>{const i=(Object(_["h"])(this.sourceUpdater_.codecs[t]||"")[0]||{}).type,r=(Object(_["h"])(n[t]||"")[0]||{}).type;i&&r&&i.toLowerCase()!==r.toLowerCase()&&e.push(`"${this.sourceUpdater_.codecs[t]}" -> "${n[t]}"`)}),e.length)return void this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${e.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0})}return n}{const e=Object.keys(a).reduce((e,t)=>(e&&(e+=", "),e+=`${t} does not support codec(s): "${a[t].join(",")}"`,e),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:e},playlistExclusionDuration:1/0})}}tryToCreateSourceBuffers_(){if("open"!==this.mediaSource.readyState||this.sourceUpdater_.hasCreatedSourceBuffers())return;if(!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(i=>{const n=e[i];if(-1!==t.indexOf(n.id))return;t.push(n.id);const r=Tl(this.main,n),s=[];!r.audio||Object(_["g"])(r.audio)||Object(_["c"])(r.audio)||s.push("audio codec "+r.audio),!r.video||Object(_["g"])(r.video)||Object(_["c"])(r.video)||s.push("video codec "+r.video),r.text&&"stpp.ttml.im1t"===r.text&&s.push("text codec "+r.text),s.length&&(n.excludeUntil=1/0,this.logger_(`excluding ${n.id} for unsupported: ${s.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],i=this.main().playlists,n=_l(Object(_["h"])(e)),r=bl(n),s=n.video&&Object(_["h"])(n.video)[0]||null,a=n.audio&&Object(_["h"])(n.audio)[0]||null;Object.keys(i).forEach(e=>{const n=i[e];if(-1!==t.indexOf(n.id)||n.excludeUntil===1/0)return;t.push(n.id);const o=[],l=Tl(this.mainPlaylistLoader_.main,n),u=bl(l);if(l.audio||l.video){if(u!==r&&o.push(`codec count "${u}" !== "${r}"`),!this.sourceUpdater_.canChangeType()){const e=l.video&&Object(_["h"])(l.video)[0]||null,t=l.audio&&Object(_["h"])(l.audio)[0]||null;e&&s&&e.type.toLowerCase()!==s.type.toLowerCase()&&o.push(`video codec "${e.type}" !== "${s.type}"`),t&&a&&t.type.toLowerCase()!==a.type.toLowerCase()&&o.push(`audio codec "${t.type}" !== "${a.type}"`)}o.length&&(n.excludeUntil=1/0,this.logger_(`excluding ${n.id}: ${o.join(" && ")}`))}})}updateAdCues_(e){let t=0;const i=this.seekable();i.length&&(t=i.start(0)),Iu(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=Oo.GOAL_BUFFER_LENGTH,i=Oo.GOAL_BUFFER_LENGTH_RATE,n=Math.max(t,Oo.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,n)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=Oo.BUFFER_LOW_WATER_LINE,i=Oo.BUFFER_LOW_WATER_LINE_RATE,n=Math.max(t,Oo.MAX_BUFFER_LOW_WATER_LINE),r=Math.max(t,Oo.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?r:n)}bufferHighWaterLine(){return Oo.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){Hl(this.inbandTextTracks_,"com.apple.streaming",this.tech_),ql({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,i){const n=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();Hl(this.inbandTextTracks_,e,this.tech_),Bl({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:n,videoDuration:i})}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));this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart?this.contentSteeringController_.requestSteeringManifest(!0):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)),"dash"===this.sourceType_&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const e=this.main(),t=this.contentSteeringController_.didDASHTagChange(e.uri,e.contentSteering),i=()=>{const t=this.contentSteeringController_.getAvailablePathways(),i=[];for(const n of e.playlists){const e=n.attributes.serviceLocation;if(e&&(i.push(e),!t.has(e)))return!0}return!(i.length||!t.size)};(t||i())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const t=this.main(),i=t.playlists,n=new Set;let r=!1;Object.keys(i).forEach(t=>{const s=i[t],a=this.pathwayAttribute_(s),o=a&&e!==a,l=s.excludeUntil===1/0&&"content-steering"===s.lastExcludeReason_;l&&!o&&(delete s.excludeUntil,delete s.lastExcludeReason_,r=!0);const u=!s.excludeUntil&&s.excludeUntil!==1/0,c=!n.has(s.id)&&o&&u;c&&(n.add(s.id),s.excludeUntil=1/0,s.lastExcludeReason_="content-steering",this.logger_(`excluding ${s.id} for ${s.lastExcludeReason_}`))}),"DASH"===this.contentSteeringController_.manifestType_&&Object.keys(this.mediaTypes_).forEach(t=>{const i=this.mediaTypes_[t];if(i.activePlaylistLoader){const t=i.activePlaylistLoader.media_;t&&t.attributes.serviceLocation!==e&&(r=!0)}}),r&&this.changeSegmentPathway_()}handlePathwayClones_(){const e=this.main(),t=e.playlists,i=this.contentSteeringController_.currentPathwayClones,n=this.contentSteeringController_.nextPathwayClones,r=i&&i.size||n&&n.size;if(r){for(const[e,t]of i.entries()){const i=n.get(e);i||(this.mainPlaylistLoader_.updateOrDeleteClone(t),this.contentSteeringController_.excludePathway(e))}for(const[e,r]of n.entries()){const n=i.get(e);if(n)this.equalPathwayClones_(n,r)||(this.mainPlaylistLoader_.updateOrDeleteClone(r,!0),this.contentSteeringController_.addAvailablePathway(e));else{const i=t.filter(e=>e.attributes["PATHWAY-ID"]===r["BASE-ID"]);i.forEach(e=>{this.mainPlaylistLoader_.addClonePathway(r,e)}),this.contentSteeringController_.addAvailablePathway(e)}}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...n])))}}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 i=e["URI-REPLACEMENT"].PARAMS,n=t["URI-REPLACEMENT"].PARAMS;for(const r in i)if(i[r]!==n[r])return!1;for(const r in n)if(i[r]!==n[r])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),"DASH"===this.contentSteeringController_.manifestType_&&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(i=>{const n=this.mainPlaylistLoader_.getKeyIdSet(i);n&&n.size&&n.forEach(n=>{const r="usable",s=this.keyStatusMap_.has(n)&&this.keyStatusMap_.get(n)===r,a=i.lastExcludeReason_===t&&i.excludeUntil===1/0;s?s&&a&&(delete i.excludeUntil,delete i.lastExcludeReason_,this.logger_(`enabling playlist ${i.id} because key ID ${n} is ${r}`)):(i.excludeUntil!==1/0&&i.lastExcludeReason_!==t&&(i.excludeUntil=1/0,i.lastExcludeReason_=t,this.logger_(`excluding playlist ${i.id} because the key ID ${n} doesn't exist in the keyStatusMap or is not ${r}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(e=>{const i=e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height<720,n=e.excludeUntil===1/0&&e.lastExcludeReason_===t;i&&n&&(delete e.excludeUntil,Is.log.warn(`enabling non-HD playlist ${e.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const i="string"===typeof e,n=i?e:Eu(e),r=n.slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${r} added to the keyStatusMap`),this.keyStatusMap_.set(r,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 lc=(e,t,i)=>n=>{const r=e.main.playlists[t],s=fa(r),a=ma(r);return"undefined"===typeof n?a:(n?delete r.disabled:r.disabled=!0,n===a||s||(i(r),n?e.trigger("renditionenabled"):e.trigger("renditiondisabled")),n)};class uc{constructor(e,t,i){const{playlistController_:n}=e,r=n.fastQualityChange_.bind(n);if(t.attributes){const e=t.attributes.RESOLUTION;this.width=e&&e.width,this.height=e&&e.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=Tl(n.main(),t),this.playlist=t,this.id=i,this.enabled=lc(e.playlists,t.id,r)}}const cc=function(e){e.representations=()=>{const t=e.playlistController_.main(),i=ka(t)?e.playlistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter(e=>!fa(e)).map((t,i)=>new uc(e,t,t.id)):[]}},hc=["seeking","seeked","pause","playing","error"];class dc{constructor(e){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.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=js("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),n=()=>this.techWaiting_(),s=()=>this.resetTimeUpdate_(),a=this.playlistController_,o=["main","subtitle","audio"],l={};o.forEach(e=>{l[e]={reset:()=>this.resetSegmentDownloads_(e),updateend:()=>this.checkSegmentDownloads_(e)},a[e+"SegmentLoader_"].on("appendsdone",l[e].updateend),a[e+"SegmentLoader_"].on("playlistupdate",l[e].reset),this.tech_.on(["seeked","seeking"],l[e].reset)});const u=e=>{["main","audio"].forEach(t=>{a[t+"SegmentLoader_"][e]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),u("off"))},this.clearSeekingAppendCheck_=()=>u("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),u("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",n),this.tech_.on(hc,s),this.tech_.on("canplay",i),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",n),this.tech_.off(hc,s),this.tech_.off("canplay",i),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),o.forEach(e=>{a[e+"SegmentLoader_"].off("appendsdone",l[e].updateend),a[e+"SegmentLoader_"].off("playlistupdate",l[e].reset),this.tech_.off(["seeked","seeking"],l[e].reset)}),this.checkCurrentTimeTimeout_&&r.a.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&r.a.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=r.a.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_,i=t[e+"SegmentLoader_"],n=i.buffered_(),r=Qs(this[e+"Buffered_"],n);this[e+"Buffered_"]=n,r?this.resetSegmentDownloads_(e):(this[e+"StalledDownloads_"]++,this.logger_(`found #${this[e+"StalledDownloads_"]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:Ys(n)}),this[e+"StalledDownloads_"]<10||(this.logger_(e+" loader stalled download exclusion"),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),"subtitle"!==e&&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+Hs>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){const e=this.tech_.seeking();if(!e)return!1;const t=this.seekable(),i=this.tech_.currentTime(),n=this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let r;if(n){const e=t.end(t.length-1);r=e}if(this.beforeSeekableWindow_(t,i)){const e=t.start(0);r=e+(e===t.end(0)?0:Hs)}if("undefined"!==typeof r)return this.logger_(`Trying to seek outside of seekable at time ${i} with seekable range ${Xs(t)}. Seeking to `+r+"."),this.tech_.setCurrentTime(r),!0;const s=this.playlistController_.sourceUpdater_,a=this.tech_.buffered(),o=s.audioBuffer?s.audioBuffered():null,l=s.videoBuffer?s.videoBuffered():null,u=this.media(),c=u.partTargetDuration?u.partTargetDuration:2*(u.targetDuration-qs),h=[o,l];for(let p=0;p<h.length;p++){if(!h[p])continue;const e=Zs(h[p],i);if(e<c)return!1}const d=Ws(a,i);return 0!==d.length&&(r=d.start(0)+Hs,this.logger_(`Buffered region starts (${d.start(0)}) just beyond seek point (${i}). Seeking to ${r}.`),this.tech_.setCurrentTime(r),!0)}waiting_(){if(this.techWaiting_())return;const e=this.tech_.currentTime(),t=this.tech_.buffered(),i=zs(t,e);return i.length&&e+3<=i.end(0)?(this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${i.start(0)} -> ${i.end(0)}]. Attempting to resume playback by seeking to the current time.`),void this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"})):void 0}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const i=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) `+i),this.resetTimeUpdate_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const i=this.tech_.vhs.playlistController_.sourceUpdater_,n=this.tech_.buffered(),r=this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t});if(r)return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const s=Ws(n,t);return s.length>0&&(this.logger_(`Stopped at ${t} and seeking to ${s.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0)}afterSeekableWindow_(e,t,i,n=!1){if(!e.length)return!1;let r=e.end(e.length-1)+Hs;const s=!i.endList,a="number"===typeof i.partTargetDuration;return s&&(a||n)&&(r=e.end(e.length-1)+3*i.targetDuration),t>r}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:i}){if(!e)return;let n;if(e.length&&t.length){const r=zs(e,i-3),s=zs(e,i),a=zs(t,i);a.length&&!s.length&&r.length&&(n={start:r.end(0),end:a.end(0)})}else{const t=Ws(e,i);t.length||(n=this.gapFromVideoUnderflow_(e,i))}return!!n&&(this.logger_(`Encountered a gap in video from ${n.start} to ${n.end}. Seeking to current time `+i),!0)}skipTheGap_(e){const t=this.tech_.buffered(),i=this.tech_.currentTime(),n=Ws(t,i);this.resetTimeUpdate_(),0!==n.length&&i===e&&(this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",n.start(0)),this.tech_.setCurrentTime(n.start(0)+qs),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}))}gapFromVideoUnderflow_(e,t){const i=$s(e);for(let n=0;n<i.length;n++){const e=i.start(n),r=i.end(n);if(t-e<4&&t-e>2)return{start:e,end:r}}return null}}const pc={errorInterval:30,getSource(e){const t=this.tech({IWillNotUseThisInPlugins:!0}),i=t.currentSource_||this.currentSource();return e(i)}},fc=function(e,t){let i=0,n=0;const r=Bs(pc,t);e.ready(()=>{e.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const s=function(){n&&e.currentTime(n)},a=function(t){null!==t&&void 0!==t&&(n=e.duration()!==1/0&&e.currentTime()||0,e.one("loadedmetadata",s),e.src(t),e.trigger({type:"usage",name:"vhs-error-reload"}),e.play())},o=function(){if(Date.now()-i<1e3*r.errorInterval)e.trigger({type:"usage",name:"vhs-error-reload-canceled"});else{if(r.getSource&&"function"===typeof r.getSource)return i=Date.now(),r.getSource.call(e,a);Is.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}},l=function(){e.off("loadedmetadata",s),e.off("error",o),e.off("dispose",l)},u=function(t){l(),fc(e,t)};e.on("error",o),e.on("dispose",l),e.reloadSourceOnError=u},mc=function(e){fc(this,e)};var gc="3.12.1",yc="7.0.3",vc="1.3.0",_c="7.1.0",bc="4.0.1";const Tc={PlaylistLoader:Wa,Playlist:Ea,utils:oo,STANDARD_PLAYLIST_SELECTOR:Il,INITIAL_PLAYLIST_SELECTOR:Ll,lastBandwidthSelector:Il,movingAverageBandwidthSelector:Ol,comparePlaylistBandwidth:Cl,comparePlaylistResolution:xl,xhr:Ka()};Object.keys(Oo).forEach(e=>{Object.defineProperty(Tc,e,{get(){return Is.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),Oo[e]},set(t){Is.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),"number"!==typeof t||t<0?Is.log.warn(`value of Vhs.${e} must be greater than or equal to 0`):Oo[e]=t}})});const Sc="videojs-vhs",kc=function(e,t){const i=t.media();let n=-1;for(let r=0;r<e.length;r++)if(e[r].id===i.id){n=r;break}e.selectedIndex_=n,e.trigger({selectedIndex:n,type:"change"})},Ec=function(e,t){t.representations().forEach(t=>{e.addQualityLevel(t)}),kc(e,t.playlists)};Tc.canPlaySource=function(){return Is.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const wc=(e,t,i)=>{if(!e)return e;let n={};t&&t.attributes&&t.attributes.CODECS&&(n=_l(Object(_["h"])(t.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(n.audio=i.attributes.CODECS);const r=Object(_["e"])(n.video),s=Object(_["e"])(n.audio),a={};for(const o in e)a[o]={},s&&(a[o].audioContentType=s),r&&(a[o].videoContentType=r),t.contentProtection&&t.contentProtection[o]&&t.contentProtection[o].pssh&&(a[o].pssh=t.contentProtection[o].pssh),"string"===typeof e[o]&&(a[o].url=e[o]);return Bs(e,a)},Cc=(e,t)=>e.reduce((e,i)=>{if(!i.contentProtection)return e;const n=t.reduce((e,t)=>{const n=i.contentProtection[t];return n&&n.pssh&&(e[t]={pssh:n.pssh}),e},{});return Object.keys(n).length&&e.push(n),e},[]),xc=({player:e,sourceKeySystems:t,audioMedia:i,mainPlaylists:n})=>{if(!e.eme.initializeMediaKeys)return Promise.resolve();const r=i?n.concat([i]):n,s=Cc(r,Object.keys(t)),a=[],o=[];return s.forEach(t=>{o.push(new Promise((t,i)=>{e.tech_.one("keysessioncreated",t)})),a.push(new Promise((i,n)=>{e.eme.initializeMediaKeys({keySystems:t},e=>{e?n(e):i()})}))}),Promise.race([Promise.all(a),Promise.race(o)])},Ac=({player:e,sourceKeySystems:t,media:i,audioMedia:n})=>{const r=wc(t,i,n);return!!r&&(e.currentSource().keySystems=r,!(r&&!e.eme)||(Is.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1))},Ic=()=>{if(!r.a.localStorage)return null;const e=r.a.localStorage.getItem(Sc);if(!e)return null;try{return JSON.parse(e)}catch(t){return null}},Oc=e=>{if(!r.a.localStorage)return!1;let t=Ic();t=t?Bs(t,e):e;try{r.a.localStorage.setItem(Sc,JSON.stringify(t))}catch(i){return!1}return t},Pc=e=>0===e.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(e.substring(e.indexOf(",")+1)):e,Lc=(e,t)=>{e._requestCallbackSet||(e._requestCallbackSet=new Set),e._requestCallbackSet.add(t)},Dc=(e,t)=>{e._responseCallbackSet||(e._responseCallbackSet=new Set),e._responseCallbackSet.add(t)},Mc=(e,t)=>{e._requestCallbackSet&&(e._requestCallbackSet.delete(t),e._requestCallbackSet.size||delete e._requestCallbackSet)},Rc=(e,t)=>{e._responseCallbackSet&&(e._responseCallbackSet.delete(t),e._responseCallbackSet.size||delete e._responseCallbackSet)};Tc.supportsNativeHls=function(){if(!a.a||!a.a.createElement)return!1;const e=a.a.createElement("video");if(!Is.getTech("Html5").isSupported())return!1;const t=["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"];return t.some((function(t){return/maybe|probably/i.test(e.canPlayType(t))}))}(),Tc.supportsNativeDash=function(){return!!(a.a&&a.a.createElement&&Is.getTech("Html5").isSupported())&&/maybe|probably/i.test(a.a.createElement("video").canPlayType("application/dash+xml"))}(),Tc.supportsTypeNatively=e=>"hls"===e?Tc.supportsNativeHls:"dash"===e&&Tc.supportsNativeDash,Tc.isSupported=function(){return Is.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},Tc.xhr.onRequest=function(e){Lc(Tc.xhr,e)},Tc.xhr.onResponse=function(e){Dc(Tc.xhr,e)},Tc.xhr.offRequest=function(e){Mc(Tc.xhr,e)},Tc.xhr.offResponse=function(e){Rc(Tc.xhr,e)};const Nc=Is.getComponent("Component");class jc extends Nc{constructor(e,t,i){if(super(t,i.vhs),"number"===typeof i.initialBandwidth&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=js("VhsHandler"),t.options_&&t.options_.playerId){const e=Is.getPlayer(t.options_.playerId);this.player_=e}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(a.a,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],e=>{const t=a.a.fullscreenElement||a.a.webkitFullscreenElement||a.a.mozFullScreenElement||a.a.msFullscreenElement;t&&t.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",(function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1: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_=Bs(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage="undefined"!==typeof this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!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=!1!==this.options_.llhls,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,"number"!==typeof this.options_.playlistExclusionDuration&&(this.options_.playlistExclusionDuration=60),"number"!==typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){const e=Ic();e&&e.bandwidth&&(this.options_.bandwidth=e.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),e&&e.throughput&&(this.options_.throughput=e.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}"number"!==typeof this.options_.bandwidth&&(this.options_.bandwidth=Oo.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Oo.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(e=>{"undefined"!==typeof this.source_[e]&&(this.options_[e]=this.source_[e])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio;const t=this.options_.customPixelRatio;"number"===typeof t&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=Pc(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Tc,this.options_.sourceType=Object(b["a"])(t),this.options_.seekTo=e=>{this.tech_.setCurrentTime(e)},this.playlistController_=new oc(this.options_);const i=Bs({liveRangeSafeTimeDelta:Hs},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new dc(i),this.playlistController_.on("error",()=>{const e=Is.players[this.tech_.options_.playerId];let t=this.playlistController_.error;"object"!==typeof t||t.code?"string"===typeof t&&(t={message:t,code:3}):t.code=3,e.error(t)});const n=this.options_.bufferBasedABR?Tc.movingAverageBandwidthSelector(.55):Tc.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):n.bind(this),this.playlistController_.selectInitialPlaylist=Tc.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(e){this.playlistController_.selectPlaylist=e.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(e){this.playlistController_.mainSegmentLoader_.throughput.rate=e,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let e=this.playlistController_.mainSegmentLoader_.bandwidth;const t=r.a.navigator.connection||r.a.navigator.mozConnection||r.a.navigator.webkitConnection,i=1e7;if(this.options_.useNetworkInformationApi&&t){const n=1e3*t.downlink*1e3;e=n>=i&&e>=i?Math.max(e,n):n}return e},set(e){this.playlistController_.mainSegmentLoader_.bandwidth=e,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const e=1/(this.bandwidth||1);let t;t=this.throughput>0?1/this.throughput:0;const i=Math.floor(1/(e+t));return i},set(){Is.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:()=>Ys(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:()=>Ys(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&&Oc({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{cc(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_=r.a.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"),xc({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(e=>{this.logger_("error while creating EME key session",e),this.player_.error({message:"Failed to initialize media keys for EME",code:3,metadata:{errorType:Is.Error.EMEKeySessionCreationError}})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=Ac({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});this.player_.tech_.on("keystatuschange",e=>{this.playlistController_.updatePlaylistByKeyStatus(e.keyId,e.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),t?this.createKeySessions_():this.playlistController_.sourceUpdater_.initializedEme()}setupQualityLevels_(){const e=Is.players[this.tech_.options_.playerId];e&&e.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{Ec(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{kc(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":gc,"mux.js":yc,"mpd-parser":vc,"m3u8-parser":_c,"aes-decrypter":bc}}version(){return this.constructor.version()}canChangeType(){return Su.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_&&r.a.URL.revokeObjectURL&&(r.a.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return go({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,n=2){return yo({programTime:e,playlist:this.playlistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{Lc(this.xhr,e)},this.xhr.onResponse=e=>{Dc(this.xhr,e)},this.xhr.offRequest=e=>{Mc(this.xhr,e)},this.xhr.offResponse=e=>{Rc(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}}const Bc={name:"videojs-http-streaming",VERSION:gc,canHandleSource(e,t={}){const i=Bs(Is.options,t);return Bc.canPlayType(e.type,i)},handleSource(e,t,i={}){const n=Bs(Is.options,i);return t.vhs=new jc(e,t,n),t.vhs.xhr=Ka(),t.vhs.setupXhrHooks_(),t.vhs.src(e.src,e.type),t.vhs},canPlayType(e,t){const i=Object(b["a"])(e);if(!i)return"";const n=Bc.getOverrideNative(t),r=Tc.supportsTypeNatively(i),s=!r||n;return s?"maybe":""},getOverrideNative(e={}){const{vhs:t={}}=e,i=!(Is.browser.IS_ANY_SAFARI||Is.browser.IS_IOS),{overrideNative:n=i}=t;return n}},Uc=()=>Object(_["c"])("avc1.4d400d,mp4a.40.2");Uc()&&Is.getTech("Html5").registerSourceHandler(Bc,0),Is.VhsHandler=jc,Is.VhsSourceHandler=Bc,Is.Vhs=Tc,Is.use||Is.registerComponent("Vhs",Tc),Is.options.vhs=Is.options.vhs||{},Is.getPlugin&&Is.getPlugin("reloadSourceOnError")||Is.registerPlugin("reloadSourceOnError",mc)}).call(this,i("c8ba"))},f24e:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){return e.start(t)+"-"+e.end(t)},r=function(e,t){var i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},s=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},a=function(e){var t={};return Object.keys(e).forEach((function(i){var n=e[i];ArrayBuffer.isView(n)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n})),t},o=function(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},l={hexDump:function(e){for(var t=Array.prototype.slice.call(e),i=16,n="",a=void 0,o=void 0,l=0;l<t.length/i;l++)a=t.slice(l*i,l*i+i).map(r).join(""),o=t.slice(l*i,l*i+i).map(s).join(""),n+=a+" "+o+"\n";return n},tagDump:function(e){return l.hexDump(e.bytes)},textRanges:function(e){var t="",i=void 0;for(i=0;i<e.length;i++)t+=n(e,i)+" ";return t},createTransferableMessage:a,initSegmentId:o};t["default"]=l,e.exports=t["default"]},f42a:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},r=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),s=i("9fd3"),a=h(s),o=i("769d"),l=h(o),u=i("faec"),c=h(u);function h(e){return e&&e.__esModule?e:{default:e}}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function f(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var m=function(e){function t(){d(this,t);var e=p(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));e.lineStream=new l["default"],e.parseStream=new c["default"],e.lineStream.pipe(e.parseStream);var i=e,r=[],s={},a=void 0,o=void 0,u=function(){},h={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},f=0;return e.manifest={allowCache:!0,discontinuityStarts:[],segments:[]},e.parseStream.on("data",(function(e){var t=void 0,l=void 0;({tag:function(){({"allow-cache":function(){this.manifest.allowCache=e.allowed,"allowed"in e||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var t={};"length"in e&&(s.byterange=t,t.length=e.length,"offset"in e||(this.trigger("info",{message:"defaulting offset to zero"}),e.offset=0)),"offset"in e&&(s.byterange=t,t.offset=e.offset)},endlist:function(){this.manifest.endList=!0},inf:function(){"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"})),e.duration>0&&(s.duration=e.duration),0===e.duration&&(s.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=r},key:function(){e.attributes?"NONE"!==e.attributes.METHOD?e.attributes.URI?(e.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),o={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},"undefined"!==typeof e.attributes.IV&&(o.iv=e.attributes.IV)):this.trigger("warn",{message:"ignoring key declaration without URI"}):o=null:this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(e.number)?this.manifest.mediaSequence=e.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number})},"discontinuity-sequence":function(){isFinite(e.number)?(this.manifest.discontinuitySequence=e.number,f=e.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number})},"playlist-type":function(){/VOD|EVENT/.test(e.playlistType)?this.manifest.playlistType=e.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist})},map:function(){a={},e.uri&&(a.uri=e.uri),e.byterange&&(a.byterange=e.byterange)},"stream-inf":function(){this.manifest.playlists=r,this.manifest.mediaGroups=this.manifest.mediaGroups||h,e.attributes?(s.attributes||(s.attributes={}),n(s.attributes,e.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||h,e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME){var i=this.manifest.mediaGroups[e.attributes.TYPE];i[e.attributes["GROUP-ID"]]=i[e.attributes["GROUP-ID"]]||{},t=i[e.attributes["GROUP-ID"]],l={default:/yes/i.test(e.attributes.DEFAULT)},l["default"]?l.autoselect=!0:l.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(l.language=e.attributes.LANGUAGE),e.attributes.URI&&(l.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(l.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(l.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(l.forced=/yes/i.test(e.attributes.FORCED)),t[e.attributes.NAME]=l}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){f+=1,s.discontinuity=!0,this.manifest.discontinuityStarts.push(r.length)},"program-date-time":function(){this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject},targetduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration}):this.manifest.targetDuration=e.duration},totalduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid total duration: "+e.duration}):this.manifest.totalDuration=e.duration},"cue-out":function(){s.cueOut=e.data},"cue-out-cont":function(){s.cueOutCont=e.data},"cue-in":function(){s.cueIn=e.data}}[e.tagType]||u).call(i)},uri:function(){s.uri=e.uri,r.push(s),this.manifest.targetDuration&&!("duration"in s)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),s.duration=this.manifest.targetDuration),o&&(s.key=o),s.timeline=f,a&&(s.map=a),s={}},comment:function(){}})[e.type].call(i)})),e}return f(t,e),r(t,[{key:"push",value:function(e){this.lineStream.push(e)}},{key:"end",value:function(){this.lineStream.push("\n")}}]),t}(a["default"]);t["default"]=m},f631:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}();function r(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=i("be09"),o=r(a),l=i("d3ae"),u=r(l),c=i("e475"),h=r(c),d=["seeking","seeked","pause","playing","error"],p=function(){function e(t){var i=this;s(this,e),this.tech_=t.tech,this.seekable=t.seekable,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,t.debug&&(this.logger_=h["default"].log.bind(h["default"],"playback-watcher ->")),this.logger_("initialize");var n=function(){return i.monitorCurrentTime_()},r=function(){return i.techWaiting_()},a=function(){return i.cancelTimer_()},l=function(){return i.fixesBadSeeks_()};this.tech_.on("seekablechanged",l),this.tech_.on("waiting",r),this.tech_.on(d,a),this.tech_.on("canplay",n),this.dispose=function(){i.logger_("dispose"),i.tech_.off("seekablechanged",l),i.tech_.off("waiting",r),i.tech_.off(d,a),i.tech_.off("canplay",n),i.checkCurrentTimeTimeout_&&o["default"].clearTimeout(i.checkCurrentTimeTimeout_),i.cancelTimer_()}}return n(e,[{key:"monitorCurrentTime_",value:function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&o["default"].clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=o["default"].setTimeout(this.monitorCurrentTime_.bind(this),250)}},{key:"checkCurrentTime_",value:function(){if(this.tech_.seeking()&&this.fixesBadSeeks_())return this.consecutiveUpdates=0,void(this.lastRecordedTime=this.tech_.currentTime());if(!this.tech_.paused()&&!this.tech_.seeking()){var e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+u["default"].SAFE_TIME_DELTA>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}}},{key:"cancelTimer_",value:function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null}},{key:"fixesBadSeeks_",value:function(){var e=this.tech_.seeking(),t=this.seekable(),i=this.tech_.currentTime(),n=void 0;if(e&&this.afterSeekableWindow_(t,i)){var r=t.end(t.length-1);n=r}if(e&&this.beforeSeekableWindow_(t,i)){var s=t.start(0);n=s+u["default"].SAFE_TIME_DELTA}return"undefined"!==typeof n&&(this.logger_("Trying to seek outside of seekable at time "+i+" with seekable range "+u["default"].printableRange(t)+". Seeking to "+n+"."),this.tech_.setCurrentTime(n),!0)}},{key:"waiting_",value:function(){if(!this.techWaiting_()){var e=this.tech_.currentTime(),t=this.tech_.buffered(),i=u["default"].findRange(t,e);return i.length&&e+3<=i.end(0)?(this.cancelTimer_(),this.tech_.setCurrentTime(e),this.logger_("Stopped at "+e+" while inside a buffered region ["+i.start(0)+" -> "+i.end(0)+"]. Attempting to resume playback by seeking to the current time."),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0}}},{key:"techWaiting_",value:function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_())return!0;if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var i=e.end(e.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+i),this.cancelTimer_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var n=this.tech_.buffered(),r=u["default"].findNextRange(n,t);if(this.videoUnderflow_(r,n,t))return this.cancelTimer_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;if(r.length>0){var s=r.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+s+", seeking to "+r.start(0)),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*s,t),!0}return!1}},{key:"afterSeekableWindow_",value:function(e,t){return!!e.length&&t>e.end(e.length-1)+u["default"].SAFE_TIME_DELTA}},{key:"beforeSeekableWindow_",value:function(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-u["default"].SAFE_TIME_DELTA)}},{key:"videoUnderflow_",value:function(e,t,i){if(0===e.length){var n=this.gapFromVideoUnderflow_(t,i);if(n)return this.logger_("Encountered a gap in video from "+n.start+" to "+n.end+". Seeking to current time "+i),!0}return!1}},{key:"skipTheGap_",value:function(e){var t=this.tech_.buffered(),i=this.tech_.currentTime(),n=u["default"].findNextRange(t,i);this.cancelTimer_(),0!==n.length&&i===e&&(this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",n.start(0)),this.tech_.setCurrentTime(n.start(0)+u["default"].TIME_FUDGE_FACTOR),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))}},{key:"gapFromVideoUnderflow_",value:function(e,t){for(var i=u["default"].findGaps(e),n=0;n<i.length;n++){var r=i.start(n),s=i.end(n);if(t-r<4&&t-r>2)return{start:r,end:s}}return null}},{key:"logger_",value:function(){}}]),e}();t["default"]=p,e.exports=t["default"]},f7fd:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=function(e,t,i){var n=!0;while(n){var r=e,s=t,a=i;n=!1,null===r&&(r=Function.prototype);var o=Object.getOwnPropertyDescriptor(r,s);if(void 0!==o){if("value"in o)return o.value;var l=o.get;if(void 0===l)return;return l.call(a)}var u=Object.getPrototypeOf(r);if(null===u)return;e=u,t=s,i=a,n=!0,o=u=void 0}};function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=i("d61a"),u=s(l),c=i("e475"),h=s(c),d=i("6e1b"),p=s(d),f=i("56c8"),m=s(f),g=i("be09"),y=s(g),v=i("4ea2"),_=s(v),b=i("f24e"),T=i("81bc"),S=i("d3ae"),k=i("57db"),E=500,w=function(e,t,i){if(!e||!t)return!1;var n=e.segments,r=i===n.length;return e.endList&&"open"===t.readyState&&r},C=function(e){return"number"===typeof e&&isFinite(e)},x=function(e,t,i){return"main"===e&&t&&i?i.containsAudio||i.containsVideo?t.containsVideo&&!i.containsVideo?"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.":!t.containsVideo&&i.containsVideo?"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:"Neither audio nor video found in segment.":null};t.illegalMediaSwitch=x;var A=function(e,t,i){var n=void 0;return n=e.length&&e.start(0)>0&&e.start(0)<t?e.start(0):t-30,Math.min(n,t-i)};t.safeBackBufferTrimTime=A;var I=function(e){function t(e){var i=this,n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];if(a(this,t),r(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),!e)throw new TypeError("Initialization settings are required");if("function"!==typeof e.currentTime)throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.state="INIT",this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=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.hls_=e.hls,this.loaderType_=e.loaderType,this.startingMedia_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.pendingSegment_=null,this.mimeType_=null,this.sourceUpdater_=null,this.xhrOptions_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.syncController_.on("syncinfoupdate",(function(){return i.trigger("syncinfoupdate")})),this.mediaSource_.addEventListener("sourceopen",(function(){return i.ended_=!1})),this.fetchAtBuffer_=!1,n.debug&&(this.logger_=h["default"].log.bind(h["default"],"segment-loader",this.loaderType_,"->"))}return o(t,e),n(t,[{key:"resetStats_",value:function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0}},{key:"dispose",value:function(){this.state="DISPOSED",this.pause(),this.abort_(),this.sourceUpdater_&&this.sourceUpdater_.dispose(),this.resetStats_()}},{key:"abort",value:function(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)}},{key:"abort_",value:function(){this.pendingSegment_&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null}},{key:"error",value:function(e){return"undefined"!==typeof e&&(this.error_=e),this.pendingSegment_=null,this.error_}},{key:"endOfStream",value:function(){this.ended_=!0,this.pause(),this.trigger("ended")}},{key:"buffered_",value:function(){return this.sourceUpdater_?this.sourceUpdater_.buffered():h["default"].createTimeRanges()}},{key:"initSegment",value:function(e){var t=!(arguments.length<=1||void 0===arguments[1])&&arguments[1];if(!e)return null;var i=(0,b.initSegmentId)(e),n=this.initSegments_[i];return t&&!n&&e.bytes&&(this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes}),n||e}},{key:"couldBeginLoading_",value:function(){return this.playlist_&&(this.sourceUpdater_||this.mimeType_&&"INIT"===this.state)&&!this.paused()}},{key:"load",value:function(){if(this.monitorBuffer_(),this.playlist_){if(this.syncController_.setDateTimeMapping(this.playlist_),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY")}}},{key:"init_",value:function(){return this.state="READY",this.sourceUpdater_=new p["default"](this.mediaSource_,this.mimeType_),this.resetEverything(),this.monitorBuffer_()}},{key:"playlist",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];if(e){var i=this.playlist_,n=this.pendingSegment_;if(this.playlist_=e,this.xhrOptions_=t,this.hasPlayed_()||(e.syncInfo={mediaSequence:e.mediaSequence,time:0}),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(i&&i.uri===e.uri){var r=e.mediaSequence-i.mediaSequence;this.logger_("mediaSequenceDiff",r),null!==this.mediaIndex&&(this.mediaIndex-=r),n&&(n.mediaIndex-=r,n.mediaIndex>=0&&(n.segment=e.segments[n.mediaIndex])),this.syncController_.saveExpiredSegmentInfo(i,e)}else null!==this.mediaIndex&&this.resyncLoader()}}},{key:"pause",value:function(){this.checkBufferTimeout_&&(y["default"].clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}},{key:"paused",value:function(){return null===this.checkBufferTimeout_}},{key:"mimeType",value:function(e){this.mimeType_||(this.mimeType_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_())}},{key:"resetEverything",value:function(){this.ended_=!1,this.resetLoader(),this.remove(0,this.duration_()),this.trigger("reseteverything")}},{key:"resetLoader",value:function(){this.fetchAtBuffer_=!1,this.resyncLoader()}},{key:"resyncLoader",value:function(){this.mediaIndex=null,this.syncPoint_=null,this.abort()}},{key:"remove",value:function(e,t){this.sourceUpdater_&&this.sourceUpdater_.remove(e,t),(0,_["default"])(e,t,this.segmentMetadataTrack_)}},{key:"monitorBuffer_",value:function(){this.checkBufferTimeout_&&y["default"].clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=y["default"].setTimeout(this.monitorBufferTick_.bind(this),1)}},{key:"monitorBufferTick_",value:function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&y["default"].clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=y["default"].setTimeout(this.monitorBufferTick_.bind(this),E)}},{key:"fillBuffer_",value:function(){if(!this.sourceUpdater_.updating()){this.syncPoint_||(this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_()));var e=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_);if(e){var t=w(this.playlist_,this.mediaSource_,e.mediaIndex);t?this.endOfStream():(e.mediaIndex!==this.playlist_.segments.length-1||"ended"!==this.mediaSource_.readyState||this.seeking_())&&((e.timeline!==this.currentTimeline_||null!==e.startOfSegment&&e.startOfSegment<this.sourceUpdater_.timestampOffset())&&(this.syncController_.reset(),e.timestampOffset=e.startOfSegment),this.loadSegment_(e))}}}},{key:"checkBuffer_",value:function(e,t,i,n,r,s){var a=0,o=void 0;e.length&&(a=e.end(e.length-1));var l=Math.max(0,a-r);if(!t.segments.length)return null;if(l>=this.goalBufferLength_())return null;if(!n&&l>=1)return null;if(this.logger_("checkBuffer_","mediaIndex:",i,"hasPlayed:",n,"currentTime:",r,"syncPoint:",s,"fetchAtBuffer:",this.fetchAtBuffer_,"bufferedTime:",l),null===s)return i=this.getSyncSegmentCandidate_(t),this.logger_("getSync","mediaIndex:",i),this.generateSegmentInfo_(t,i,null,!0);if(null!==i){this.logger_("walkForward","mediaIndex:",i+1);var c=t.segments[i];return o=c&&c.end?c.end:a,this.generateSegmentInfo_(t,i+1,o,!1)}if(this.fetchAtBuffer_){var h=u["default"].getMediaInfoForTime(t,a,s.segmentIndex,s.time);i=h.mediaIndex,o=h.startTime}else{h=u["default"].getMediaInfoForTime(t,r,s.segmentIndex,s.time);i=h.mediaIndex,o=h.startTime}return this.logger_("getMediaIndexForTime","mediaIndex:",i,"startOfSegment:",o),this.generateSegmentInfo_(t,i,o,!1)}},{key:"getSyncSegmentCandidate_",value:function(e){var t=this;if(-1===this.currentTimeline_)return 0;var i=e.segments.map((function(e,t){return{timeline:e.timeline,segmentIndex:t}})).filter((function(e){return e.timeline===t.currentTimeline_}));return i.length?i[Math.min(i.length-1,1)].segmentIndex:Math.max(e.segments.length-1,0)}},{key:"generateSegmentInfo_",value:function(e,t,i,n){if(t<0||t>=e.segments.length)return null;var r=e.segments[t];return{requestId:"segment-loader-"+Math.random(),uri:r.resolvedUri,mediaIndex:t,isSyncRequest:n,startOfSegment:i,playlist:e,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:r.timeline,duration:r.duration,segment:r}}},{key:"abortRequestEarly_",value:function(e){if(this.hls_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)return!1;if(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return!1;var t=this.currentTime_(),i=e.bandwidth,n=this.pendingSegment_.duration,r=u["default"].estimateSegmentRequestTime(n,i,this.playlist_,e.bytesReceived),s=(0,S.timeUntilRebuffer)(this.buffered_(),t,this.hls_.tech_.playbackRate())-1;if(r<=s)return!1;var a=(0,k.minRebufferMaxBandwidthSelector)({master:this.hls_.playlists.master,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:n,timeUntilRebuffer:s,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(a){var o=r-s,l=o-a.rebufferingImpact,c=.5;return s<=S.TIME_FUDGE_FACTOR&&(c=1),!a.playlist||a.playlist.uri===this.playlist_.uri||l<c?!1:(this.bandwidth=a.playlist.attributes.BANDWIDTH*m["default"].BANDWIDTH_VARIANCE+1,this.abort(),this.trigger("earlyabort"),!0)}}},{key:"handleProgress_",value:function(e,t){this.pendingSegment_&&t.requestId===this.pendingSegment_.requestId&&!this.abortRequestEarly_(t.stats)&&this.trigger("progress")}},{key:"loadSegment_",value:function(e){this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),e.abortRequests=(0,T.mediaSegmentRequest)(this.hls_.xhr,this.xhrOptions_,this.decrypter_,this.createSimplifiedSegmentObj_(e),this.handleProgress_.bind(this),this.segmentRequestFinished_.bind(this))}},{key:"trimBackBuffer_",value:function(e){var t=A(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}},{key:"createSimplifiedSegmentObj_",value:function(e){var t=e.segment,i={resolvedUri:t.resolvedUri,byterange:t.byterange,requestId:e.requestId};if(t.key){var n=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);i.key={resolvedUri:t.key.resolvedUri,iv:n}}return t.map&&(i.map=this.initSegment(t.map)),i}},{key:"segmentRequestFinished_",value:function(e,t){if(this.mediaRequests+=1,t.stats&&(this.mediaBytesTransferred+=t.stats.bytesReceived,this.mediaTransferDuration+=t.stats.roundTripTime),this.pendingSegment_){if(t.requestId===this.pendingSegment_.requestId){if(e)return this.pendingSegment_=null,this.state="READY",e.code===T.REQUEST_ERRORS.ABORTED?void(this.mediaRequestsAborted+=1):(this.pause(),e.code===T.REQUEST_ERRORS.TIMEOUT?(this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,void this.trigger("bandwidthupdate")):(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error")));this.bandwidth=t.stats.bandwidth,this.roundTrip=t.stats.roundTripTime,t.map&&(t.map=this.initSegment(t.map,!0)),this.processSegmentResponse_(t)}}else this.mediaRequestsAborted+=1}},{key:"processSegmentResponse_",value:function(e){var t=this.pendingSegment_;t.bytes=e.bytes,e.map&&(t.segment.map.bytes=e.map.bytes),t.endOfAllRequests=e.endOfAllRequests,this.handleSegment_()}},{key:"handleSegment_",value:function(){var e=this;if(this.pendingSegment_){var t=this.pendingSegment_,i=t.segment,n=this.syncController_.probeSegmentInfo(t);"undefined"===typeof this.startingMedia_&&n&&(n.containsAudio||n.containsVideo)&&(this.startingMedia_={containsAudio:n.containsAudio,containsVideo:n.containsVideo});var r=x(this.loaderType_,this.startingMedia_,n);if(r)return this.error({message:r,blacklistDuration:1/0}),void this.trigger("error");if(t.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");null!==t.timestampOffset&&t.timestampOffset!==this.sourceUpdater_.timestampOffset()&&(this.sourceUpdater_.timestampOffset(t.timestampOffset),this.trigger("timestampoffset"));var s=this.syncController_.mappingForTimeline(t.timeline);null!==s&&this.trigger({type:"segmenttimemapping",mapping:s}),this.state="APPENDING",i.map&&function(){var t=(0,b.initSegmentId)(i.map);if(!e.activeInitSegmentId_||e.activeInitSegmentId_!==t){var n=e.initSegment(i.map);e.sourceUpdater_.appendBuffer(n.bytes,(function(){e.activeInitSegmentId_=t}))}}(),t.byteLength=t.bytes.byteLength,"number"===typeof i.start&&"number"===typeof i.end?this.mediaSecondsLoaded+=i.end-i.start:this.mediaSecondsLoaded+=i.duration,this.sourceUpdater_.appendBuffer(t.bytes,this.handleUpdateEnd_.bind(this))}else this.state="READY"}},{key:"handleUpdateEnd_",value:function(){if(this.logger_("handleUpdateEnd_","segmentInfo:",this.pendingSegment_),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var e=this.pendingSegment_,t=e.segment,i=null!==this.mediaIndex;if(this.pendingSegment_=null,this.recordThroughput_(e),this.addSegmentMetadataCue_(e),this.state="READY",this.mediaIndex=e.mediaIndex,this.fetchAtBuffer_=!0,this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate"),t.end&&this.currentTime_()-t.end>3*e.playlist.targetDuration)this.resetEverything();else{i&&this.trigger("bandwidthupdate"),this.trigger("progress");var n=w(e.playlist,this.mediaSource_,e.mediaIndex+1);n&&this.endOfStream(),this.paused()||this.monitorBuffer_()}}},{key:"recordThroughput_",value:function(e){var t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,n=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(n-t)/++this.throughput.count}},{key:"logger_",value:function(){}},{key:"addSegmentMetadataCue_",value:function(e){if(this.segmentMetadataTrack_){var t=e.segment,i=t.start,n=t.end;if(C(i)&&C(n)){(0,_["default"])(i,n,this.segmentMetadataTrack_);var r=y["default"].WebKitDataCue||y["default"].VTTCue,s={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.uri,start:i,end:n},a=JSON.stringify(s),o=new r(i,n,a);o.value=s,this.segmentMetadataTrack_.addCue(o)}}}}]),t}(h["default"].EventTarget);t["default"]=I},f8a8:function(e,t,i){"use strict";i.d(t,"a",(function(){return I})),i.d(t,"b",(function(){return O}));var n,r=i("de66"),s=(new Uint8Array([79,112,117,115,72,101,97,100]),function(e){return"string"===typeof e?Object(r["h"])(e):e}),a=function(e){return Array.isArray(e)?e.map((function(e){return s(e)})):[s(e)]},o=function(e){e=Object(r["k"])(e);var t=[],i=0;while(e.length>i){var s=e[i],a=0,o=0;o++;var l=e[o];o++;while(128&l)a=(127&l)<<7,l=e[o],o++;a+=127&l;for(var u=0;u<n.length;u++){var c=n[u],h=c.id,d=c.parser;if(s===h){t.push(d(e.subarray(o,o+a)));break}}i+=a+o}return t};n=[{id:3,parser:function(e){var t={tag:3,id:e[0]<<8|e[1],flags:e[2],size:3,dependsOnEsId:0,ocrEsId:0,descriptors:[],url:""};if(128&t.flags&&(t.dependsOnEsId=e[t.size]<<8|e[t.size+1],t.size+=2),64&t.flags){var i=e[t.size];t.url=Object(r["c"])(e.subarray(t.size+1,t.size+1+i)),t.size+=i}return 32&t.flags&&(t.ocrEsId=e[t.size]<<8|e[t.size+1],t.size+=2),t.descriptors=o(e.subarray(t.size))||[],t}},{id:4,parser:function(e){var t={tag:4,oti:e[0],streamType:e[1],bufferSize:e[2]<<16|e[3]<<8|e[4],maxBitrate:e[5]<<24|e[6]<<16|e[7]<<8|e[8],avgBitrate:e[9]<<24|e[10]<<16|e[11]<<8|e[12],descriptors:o(e.subarray(13))};return t}},{id:5,parser:function(e){return{tag:5,bytes:e}}},{id:6,parser:function(e){return{tag:6,bytes:e}}}];var l=function e(t,i,n){void 0===n&&(n=!1),i=a(i),t=Object(r["k"])(t);var s=[];if(!i.length)return s;var o=0;while(o<t.length){var l=(t[o]<<24|t[o+1]<<16|t[o+2]<<8|t[o+3])>>>0,u=t.subarray(o+4,o+8);if(0===l)break;var c=o+l;if(c>t.length){if(n)break;c=t.length}var h=t.subarray(o+8,c);Object(r["a"])(u,i[0])&&(1===i.length?s.push(h):s.push.apply(s,e(h,i.slice(1),n))),o=c}return s},u={EBML:Object(r["k"])([26,69,223,163]),DocType:Object(r["k"])([66,130]),Segment:Object(r["k"])([24,83,128,103]),SegmentInfo:Object(r["k"])([21,73,169,102]),Tracks:Object(r["k"])([22,84,174,107]),Track:Object(r["k"])([174]),TrackNumber:Object(r["k"])([215]),DefaultDuration:Object(r["k"])([35,227,131]),TrackEntry:Object(r["k"])([174]),TrackType:Object(r["k"])([131]),FlagDefault:Object(r["k"])([136]),CodecID:Object(r["k"])([134]),CodecPrivate:Object(r["k"])([99,162]),VideoTrack:Object(r["k"])([224]),AudioTrack:Object(r["k"])([225]),Cluster:Object(r["k"])([31,67,182,117]),Timestamp:Object(r["k"])([231]),TimestampScale:Object(r["k"])([42,215,177]),BlockGroup:Object(r["k"])([160]),BlockDuration:Object(r["k"])([155]),Block:Object(r["k"])([161]),SimpleBlock:Object(r["k"])([163])},c=[128,64,32,16,8,4,2,1],h=function(e){for(var t=1,i=0;i<c.length;i++){if(e&c[i])break;t++}return t},d=function(e,t,i,n){void 0===i&&(i=!0),void 0===n&&(n=!1);var s=h(e[t]),a=e.subarray(t,t+s);return i&&(a=Array.prototype.slice.call(e,t,t+s),a[0]^=c[s-1]),{length:s,value:Object(r["b"])(a,{signed:n}),bytes:a}},p=function e(t){return"string"===typeof t?t.match(/.{1,2}/g).map((function(t){return e(t)})):"number"===typeof t?Object(r["f"])(t):t},f=function(e){return Array.isArray(e)?e.map((function(e){return p(e)})):[p(e)]},m=function e(t,i,n){if(n>=i.length)return i.length;var s=d(i,n,!1);if(Object(r["a"])(t.bytes,s.bytes))return n;var a=d(i,n+s.length);return e(t,i,n+a.length+a.value+s.length)},g=function e(t,i){i=f(i),t=Object(r["k"])(t);var n=[];if(!i.length)return n;var s=0;while(s<t.length){var a=d(t,s,!1),o=d(t,s+a.length),l=s+a.length+o.length;127===o.value&&(o.value=m(a,t,l),o.value!==t.length&&(o.value-=l));var u=l+o.value>t.length?t.length:l+o.value,c=t.subarray(l,u);Object(r["a"])(i[0],a.bytes)&&(1===i.length?n.push(c):n=n.concat(e(c,i.slice(1))));var h=a.length+o.length+c.length;s+=h}return n},y=i("321f"),v=Object(r["k"])([0,0,0,1]),_=Object(r["k"])([0,0,1]),b=Object(r["k"])([0,0,3]),T=function(e){var t=[],i=1;while(i<e.length-2)Object(r["a"])(e.subarray(i,i+3),b)&&(t.push(i+2),i++),i++;if(0===t.length)return e;var n=e.length-t.length,s=new Uint8Array(n),a=0;for(i=0;i<n;a++,i++)a===t[0]&&(a++,t.shift()),s[i]=e[a];return s},S=function(e,t,i,n){void 0===n&&(n=1/0),e=Object(r["k"])(e),i=[].concat(i);var s,a=0,o=0;while(a<e.length&&(o<n||s)){var l=void 0;if(Object(r["a"])(e.subarray(a),v)?l=4:Object(r["a"])(e.subarray(a),_)&&(l=3),l){if(o++,s)return T(e.subarray(s,a));var u=void 0;"h264"===t?u=31&e[a+l]:"h265"===t&&(u=e[a+l]>>1&63),-1!==i.indexOf(u)&&(s=a+l),a+=l+("h264"===t?1:2)}else a++}return e.subarray(0,0)},k=function(e,t,i){return S(e,"h264",t,i)},E=function(e,t,i){return S(e,"h265",t,i)},w={webm:Object(r["k"])([119,101,98,109]),matroska:Object(r["k"])([109,97,116,114,111,115,107,97]),flac:Object(r["k"])([102,76,97,67]),ogg:Object(r["k"])([79,103,103,83]),ac3:Object(r["k"])([11,119]),riff:Object(r["k"])([82,73,70,70]),avi:Object(r["k"])([65,86,73]),wav:Object(r["k"])([87,65,86,69]),"3gp":Object(r["k"])([102,116,121,112,51,103]),mp4:Object(r["k"])([102,116,121,112]),fmp4:Object(r["k"])([115,116,121,112]),mov:Object(r["k"])([102,116,121,112,113,116]),moov:Object(r["k"])([109,111,111,118]),moof:Object(r["k"])([109,111,111,102])},C={aac:function(e){var t=Object(y["a"])(e);return Object(r["a"])(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Object(y["a"])(e);return Object(r["a"])(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=g(e,[u.EBML,u.DocType])[0];return Object(r["a"])(t,w.webm)},mkv:function(e){var t=g(e,[u.EBML,u.DocType])[0];return Object(r["a"])(t,w.matroska)},mp4:function(e){return!C["3gp"](e)&&!C.mov(e)&&(!(!Object(r["a"])(e,w.mp4,{offset:4})&&!Object(r["a"])(e,w.fmp4,{offset:4}))||(!(!Object(r["a"])(e,w.moof,{offset:4})&&!Object(r["a"])(e,w.moov,{offset:4}))||void 0))},mov:function(e){return Object(r["a"])(e,w.mov,{offset:4})},"3gp":function(e){return Object(r["a"])(e,w["3gp"],{offset:4})},ac3:function(e){var t=Object(y["a"])(e);return Object(r["a"])(e,w.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return 71===e[0];var t=0;while(t+188<e.length&&t<188){if(71===e[t]&&71===e[t+188])return!0;t+=1}return!1},flac:function(e){var t=Object(y["a"])(e);return Object(r["a"])(e,w.flac,{offset:t})},ogg:function(e){return Object(r["a"])(e,w.ogg)},avi:function(e){return Object(r["a"])(e,w.riff)&&Object(r["a"])(e,w.avi,{offset:8})},wav:function(e){return Object(r["a"])(e,w.riff)&&Object(r["a"])(e,w.wav,{offset:8})},h264:function(e){return k(e,7,3).length},h265:function(e){return E(e,[32,33],3).length}},x=Object.keys(C).filter((function(e){return"ts"!==e&&"h264"!==e&&"h265"!==e})).concat(["ts","h264","h265"]);x.forEach((function(e){var t=C[e];C[e]=function(e){return t(Object(r["k"])(e))}}));var A=C,I=function(e){e=Object(r["k"])(e);for(var t=0;t<x.length;t++){var i=x[t];if(A[i](e))return i}return""},O=function(e){return l(e,["moof"]).length>0}},f97d:function(e,t){var i={"":!0,up:!0};function n(e){if("string"!==typeof e)return!1;var t=i[e.toLowerCase()];return!!t&&e.toLowerCase()}function r(e){return"number"===typeof e&&e>=0&&e<=100}function s(){var e=100,t=3,i=0,s=100,a=0,o=100,l="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!r(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!==typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return s},set:function(e){if(!r(e))throw new Error("RegionAnchorX must be between 0 and 100.");s=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!r(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!r(e))throw new Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return a},set:function(e){if(!r(e))throw new Error("ViewportAnchorX must be between 0 and 100.");a=e}},scroll:{enumerable:!0,get:function(){return l},set:function(e){var t=n(e);!1===t?console.warn("Scroll: an invalid or illegal string was specified."):l=t}}})}e.exports=s},faec:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){var i=[],n=!0,r=!1,s=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done);n=!0)if(i.push(a.value),t&&i.length===t)break}catch(l){r=!0,s=l}finally{try{!n&&o["return"]&&o["return"]()}finally{if(r)throw s}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),s=i("9fd3"),a=o(s);function o(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function c(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var h=function(){var e="[^=]*",t='"[^"]*"|[^,]*',i="(?:"+e+")=(?:"+t+")";return new RegExp("(?:^|,)("+i+")")},d=function(e){var t=e.split(h()),i={},n=t.length,r=void 0;while(n--)""!==t[n]&&(r=/([^=]*)=(.*)/.exec(t[n]).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"),i[r[0]]=r[1]);return i},p=function(e){function t(){return l(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this))}return c(t,e),r(t,[{key:"push",value:function(e){var t=void 0,i=void 0;if(e=e.replace(/^[\u0000\s]+|[\u0000\s]+$/g,""),0!==e.length)if("#"===e[0])if(0===e.indexOf("#EXT"))if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e),t)this.trigger("data",{type:"tag",tagType:"m3u"});else{if(t=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(e),t)return i={type:"tag",tagType:"inf"},t[1]&&(i.duration=parseFloat(t[1])),t[2]&&(i.title=t[2]),void this.trigger("data",i);if(t=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"targetduration"},t[1]&&(i.duration=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#ZEN-TOTAL-DURATION:?([0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"totalduration"},t[1]&&(i.duration=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"version"},t[1]&&(i.version=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"media-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(e),t)return i={type:"tag",tagType:"playlist-type"},t[1]&&(i.playlistType=t[1]),void this.trigger("data",i);if(t=/^#EXT-X-BYTERANGE:?([0-9.]*)?@?([0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"byterange"},t[1]&&(i.length=parseInt(t[1],10)),t[2]&&(i.offset=parseInt(t[2],10)),void this.trigger("data",i);if(t=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(e),t)return i={type:"tag",tagType:"allow-cache"},t[1]&&(i.allowed=!/NO/.test(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-MAP:?(.*)$/.exec(e),t){if(i={type:"tag",tagType:"map"},t[1]){var r=d(t[1]);if(r.URI&&(i.uri=r.URI),r.BYTERANGE){var s=r.BYTERANGE.split("@"),a=n(s,2),o=a[0],l=a[1];i.byterange={},o&&(i.byterange.length=parseInt(o,10)),l&&(i.byterange.offset=parseInt(l,10))}}this.trigger("data",i)}else if(t=/^#EXT-X-STREAM-INF:?(.*)$/.exec(e),t){if(i={type:"tag",tagType:"stream-inf"},t[1]){if(i.attributes=d(t[1]),i.attributes.RESOLUTION){var u=i.attributes.RESOLUTION.split("x"),c={};u[0]&&(c.width=parseInt(u[0],10)),u[1]&&(c.height=parseInt(u[1],10)),i.attributes.RESOLUTION=c}i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes["PROGRAM-ID"]&&(i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10))}this.trigger("data",i)}else{if(t=/^#EXT-X-MEDIA:?(.*)$/.exec(e),t)return i={type:"tag",tagType:"media"},t[1]&&(i.attributes=d(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-ENDLIST/.exec(e),t)this.trigger("data",{type:"tag",tagType:"endlist"});else if(t=/^#EXT-X-DISCONTINUITY/.exec(e),t)this.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(t=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(e),t)return i={type:"tag",tagType:"program-date-time"},t[1]&&(i.dateTimeString=t[1],i.dateTimeObject=new Date(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-KEY:?(.*)$/.exec(e),t)return i={type:"tag",tagType:"key"},t[1]&&(i.attributes=d(t[1]),i.attributes.IV&&("0x"===i.attributes.IV.substring(0,2).toLowerCase()&&(i.attributes.IV=i.attributes.IV.substring(2)),i.attributes.IV=i.attributes.IV.match(/.{8}/g),i.attributes.IV[0]=parseInt(i.attributes.IV[0],16),i.attributes.IV[1]=parseInt(i.attributes.IV[1],16),i.attributes.IV[2]=parseInt(i.attributes.IV[2],16),i.attributes.IV[3]=parseInt(i.attributes.IV[3],16),i.attributes.IV=new Uint32Array(i.attributes.IV))),void this.trigger("data",i);if(t=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-out-cont"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-out"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-in"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);this.trigger("data",{type:"tag",data:e.slice(4)})}}}else this.trigger("data",{type:"comment",text:e.slice(1)});else this.trigger("data",{type:"uri",uri:e})}}]),t}(a["default"]);t["default"]=p},fda2:function(e,t,i){},fef4:function(e,t,i){e.exports={generator:i("a31d"),Transmuxer:i("2c5a").Transmuxer,AudioSegmentStream:i("2c5a").AudioSegmentStream,VideoSegmentStream:i("2c5a").VideoSegmentStream}},ffdf:function(e,t,i){"use strict";(function(e){i.d(t,"a",(function(){return a}));var n=i("be09"),r=i.n(n),s=function(t){return r.a.atob?r.a.atob(t):e.from(t,"base64").toString("binary")};function a(e){for(var t=s(e),i=new Uint8Array(t.length),n=0;n<t.length;n++)i[n]=t.charCodeAt(n);return i}}).call(this,i("b639").Buffer)}}]);