@clickview/player 1.17.0-rc.1 → 1.18.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/player.js DELETED
@@ -1,2 +0,0 @@
1
- /*! For license information please see player.js.LICENSE.txt */
2
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["@clickview/player"]=e():t["@clickview/player"]=e()}(self,(()=>(()=>{var t={68942:(t,e,r)=>{"use strict";var n=r(51562),i=r(448),o=r(63848),a=function(t){var e={};return t?(t.trim().split("\n").forEach((function(t){var r=t.indexOf(":"),n=t.slice(0,r).trim().toLowerCase(),i=t.slice(r+1).trim();void 0===e[n]?e[n]=i:Array.isArray(e[n])?e[n].push(i):e[n]=[e[n],i]})),e):e};function s(t,e,r){var n=t;return o(e)?(r=e,"string"==typeof t&&(n={uri:t})):n=i({},e,{uri:t}),n.callback=r,n}function u(t,e,r){return l(e=s(t,e,r))}function l(t){if(void 0===t.callback)throw new Error("callback argument missing");var e=!1,r=function(r,n,i){e||(e=!0,t.callback(r,n,i))};function n(){var t=void 0;if(t=c.response?c.response:c.responseText||function(t){try{if("document"===t.responseType)return t.responseXML;var e=t.responseXML&&"parsererror"===t.responseXML.documentElement.nodeName;if(""===t.responseType&&!e)return t.responseXML}catch(t){}return null}(c),v)try{t=JSON.parse(t)}catch(t){}return t}function i(t){return clearTimeout(f),t instanceof Error||(t=new Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,r(t,g)}function o(){if(!l){var e;clearTimeout(f),e=t.useXDR&&void 0===c.status?200:1223===c.status?204:c.status;var i=g,o=null;return 0!==e?(i={body:n(),statusCode:e,method:p,headers:{},url:h,rawRequest:c},c.getAllResponseHeaders&&(i.headers=a(c.getAllResponseHeaders()))):o=new Error("Internal XMLHttpRequest Error"),r(o,i,i.body)}}var s,l,c=t.xhr||null;c||(c=t.cors||t.useXDR?new u.XDomainRequest:new u.XMLHttpRequest);var f,h=c.url=t.uri||t.url,p=c.method=t.method||"GET",d=t.body||t.data,y=c.headers=t.headers||{},m=!!t.sync,v=!1,g={body:void 0,headers:{},statusCode:0,method:p,url:h,rawRequest:c};if("json"in t&&!1!==t.json&&(v=!0,y.accept||y.Accept||(y.Accept="application/json"),"GET"!==p&&"HEAD"!==p&&(y["content-type"]||y["Content-Type"]||(y["Content-Type"]="application/json"),d=JSON.stringify(!0===t.json?d:t.json))),c.onreadystatechange=function(){4===c.readyState&&setTimeout(o,0)},c.onload=o,c.onerror=i,c.onprogress=function(){},c.onabort=function(){l=!0},c.ontimeout=i,c.open(p,h,!m,t.username,t.password),m||(c.withCredentials=!!t.withCredentials),!m&&t.timeout>0&&(f=setTimeout((function(){if(!l){l=!0,c.abort("timeout");var t=new Error("XMLHttpRequest timeout");t.code="ETIMEDOUT",i(t)}}),t.timeout)),c.setRequestHeader)for(s in y)y.hasOwnProperty(s)&&c.setRequestHeader(s,y[s]);else if(t.headers&&!function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(c.responseType=t.responseType),"beforeSend"in t&&"function"==typeof t.beforeSend&&t.beforeSend(c),c.send(d||null),c}t.exports=u,t.exports.default=u,u.XMLHttpRequest=n.XMLHttpRequest||function(){},u.XDomainRequest="withCredentials"in new u.XMLHttpRequest?u.XMLHttpRequest:n.XDomainRequest,function(t,e){for(var r=0;r<t.length;r++)e(t[r])}(["get","put","post","patch","head","delete"],(function(t){u["delete"===t?"del":t]=function(e,r,n){return(r=s(e,r,n)).method=t.toUpperCase(),l(r)}}))},15206:t=>{var e=!("undefined"==typeof window||!window.document||!window.document.createElement);t.exports=e},94605:t=>{t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},29076:(t,e,r)=>{var n=r(62366);t.exports=function(t){if(!n(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},5822:(t,e,r)=>{var n=r(46802),i=r(22275),o=r(50430),a=n("unscopables"),s=Array.prototype;null==s[a]&&o(s,a,i(null)),t.exports=function(t){s[a][t]=!0}},25528:(t,e,r)=>{"use strict";var n=r(50189).charAt;t.exports=function(t,e,r){return e+(r?n(t,e).length:1)}},72814:t=>{t.exports=function(t,e,r){if(!(t instanceof e))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return t}},4905:(t,e,r)=>{var n=r(62366);t.exports=function(t){if(!n(t))throw TypeError(String(t)+" is not an object");return t}},16607:(t,e,r)=>{"use strict";var n=r(72758).forEach,i=r(31853);t.exports=i("forEach")?function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}:[].forEach},5029:(t,e,r)=>{var n=r(40678),i=r(74479),o=r(6971),a=function(t){return function(e,r,a){var s,u=n(e),l=i(u.length),c=o(a,l);if(t&&r!=r){for(;l>c;)if((s=u[c++])!=s)return!0}else for(;l>c;c++)if((t||c in u)&&u[c]===r)return t||c||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},72758:(t,e,r)=>{var n=r(17755),i=r(62901),o=r(87615),a=r(74479),s=r(17021),u=[].push,l=function(t){var e=1==t,r=2==t,l=3==t,c=4==t,f=6==t,h=5==t||f;return function(p,d,y,m){for(var v,g,b=o(p),_=i(b),w=n(d,y,3),T=a(_.length),S=0,E=m||s,O=e?E(p,T):r?E(p,0):void 0;T>S;S++)if((h||S in _)&&(g=w(v=_[S],S,b),t))if(e)O[S]=g;else if(g)switch(t){case 3:return!0;case 5:return v;case 6:return S;case 2:u.call(O,v)}else if(c)return!1;return f?-1:l||c?c:O}};t.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6)}},95611:(t,e,r)=>{var n=r(25061),i=r(46802),o=r(24101),a=i("species");t.exports=function(t){return o>=51||!n((function(){var e=[];return(e.constructor={})[a]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},62040:(t,e,r)=>{var n=r(94605),i=r(87615),o=r(62901),a=r(74479),s=function(t){return function(e,r,s,u){n(r);var l=i(e),c=o(l),f=a(l.length),h=t?f-1:0,p=t?-1:1;if(s<2)for(;;){if(h in c){u=c[h],h+=p;break}if(h+=p,t?h<0:f<=h)throw TypeError("Reduce of empty array with no initial value")}for(;t?h>=0:f>h;h+=p)h in c&&(u=r(u,c[h],h,l));return u}};t.exports={left:s(!1),right:s(!0)}},17021:(t,e,r)=>{var n=r(62366),i=r(20119),o=r(46802)("species");t.exports=function(t,e){var r;return i(t)&&("function"!=typeof(r=t.constructor)||r!==Array&&!i(r.prototype)?n(r)&&null===(r=r[o])&&(r=void 0):r=void 0),new(void 0===r?Array:r)(0===e?0:e)}},17755:(t,e,r)=>{var n=r(94605);t.exports=function(t,e,r){if(n(t),void 0===e)return t;switch(r){case 0:return function(){return t.call(e)};case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,i){return t.call(e,r,n,i)}}return function(){return t.apply(e,arguments)}}},35304:(t,e,r)=>{var n=r(4905);t.exports=function(t,e,r,i){try{return i?e(n(r)[0],r[1]):e(r)}catch(e){var o=t.return;throw void 0!==o&&n(o.call(t)),e}}},13165:(t,e,r)=>{var n=r(46802)("iterator"),i=!1;try{var o=0,a={next:function(){return{done:!!o++}},return:function(){i=!0}};a[n]=function(){return this},Array.from(a,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var r=!1;try{var o={};o[n]=function(){return{next:function(){return{done:r=!0}}}},t(o)}catch(t){}return r}},75489:t=>{var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},20486:(t,e,r)=>{var n=r(75489),i=r(46802)("toStringTag"),o="Arguments"==n(function(){return arguments}());t.exports=function(t){var e,r,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),i))?r:o?n(e):"Object"==(a=n(e))&&"function"==typeof e.callee?"Arguments":a}},53769:(t,e,r)=>{"use strict";var n=r(86846),i=r(81738).getWeakData,o=r(4905),a=r(62366),s=r(72814),u=r(98971),l=r(72758),c=r(51900),f=r(50684),h=f.set,p=f.getterFor,d=l.find,y=l.findIndex,m=0,v=function(t){return t.frozen||(t.frozen=new g)},g=function(){this.entries=[]},b=function(t,e){return d(t.entries,(function(t){return t[0]===e}))};g.prototype={get:function(t){var e=b(this,t);if(e)return e[1]},has:function(t){return!!b(this,t)},set:function(t,e){var r=b(this,t);r?r[1]=e:this.entries.push([t,e])},delete:function(t){var e=y(this.entries,(function(e){return e[0]===t}));return~e&&this.entries.splice(e,1),!!~e}},t.exports={getConstructor:function(t,e,r,l){var f=t((function(t,n){s(t,f,e),h(t,{type:e,id:m++,frozen:void 0}),null!=n&&u(n,t[l],t,r)})),d=p(e),y=function(t,e,r){var n=d(t),a=i(o(e),!0);return!0===a?v(n).set(e,r):a[n.id]=r,t};return n(f.prototype,{delete:function(t){var e=d(this);if(!a(t))return!1;var r=i(t);return!0===r?v(e).delete(t):r&&c(r,e.id)&&delete r[e.id]},has:function(t){var e=d(this);if(!a(t))return!1;var r=i(t);return!0===r?v(e).has(t):r&&c(r,e.id)}}),n(f.prototype,r?{get:function(t){var e=d(this);if(a(t)){var r=i(t);return!0===r?v(e).get(t):r?r[e.id]:void 0}},set:function(t,e){return y(this,t,e)}}:{add:function(t){return y(this,t,!0)}}),f}}},66606:(t,e,r)=>{"use strict";var n=r(29638),i=r(45001),o=r(91092),a=r(96313),s=r(81738),u=r(98971),l=r(72814),c=r(62366),f=r(25061),h=r(13165),p=r(40606),d=r(3419);t.exports=function(t,e,r,y,m){var v=i[t],g=v&&v.prototype,b=v,_=y?"set":"add",w={},T=function(t){var e=g[t];a(g,t,"add"==t?function(t){return e.call(this,0===t?0:t),this}:"delete"==t?function(t){return!(m&&!c(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return m&&!c(t)?void 0:e.call(this,0===t?0:t)}:"has"==t?function(t){return!(m&&!c(t))&&e.call(this,0===t?0:t)}:function(t,r){return e.call(this,0===t?0:t,r),this})};if(o(t,"function"!=typeof v||!(m||g.forEach&&!f((function(){(new v).entries().next()})))))b=r.getConstructor(e,t,y,_),s.REQUIRED=!0;else if(o(t,!0)){var S=new b,E=S[_](m?{}:-0,1)!=S,O=f((function(){S.has(1)})),k=h((function(t){new v(t)})),C=!m&&f((function(){for(var t=new v,e=5;e--;)t[_](e,e);return!t.has(-0)}));k||((b=e((function(e,r){l(e,b,t);var n=d(new v,e,b);return null!=r&&u(r,n[_],n,y),n}))).prototype=g,g.constructor=b),(O||C)&&(T("delete"),T("has"),y&&T("get")),(C||E)&&T(_),m&&g.clear&&delete g.clear}return w[t]=b,n({global:!0,forced:b!=v},w),p(b,t),m||r.setStrong(b,t,y),b}},46810:(t,e,r)=>{var n=r(51900),i=r(62466),o=r(8117),a=r(56462);t.exports=function(t,e){for(var r=i(e),s=a.f,u=o.f,l=0;l<r.length;l++){var c=r[l];n(t,c)||s(t,c,u(e,c))}}},10149:(t,e,r)=>{var n=r(25061);t.exports=!n((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},62141:(t,e,r)=>{"use strict";var n=r(61151).IteratorPrototype,i=r(22275),o=r(86034),a=r(40606),s=r(80501),u=function(){return this};t.exports=function(t,e,r){var l=e+" Iterator";return t.prototype=i(n,{next:o(1,r)}),a(t,l,!1,!0),s[l]=u,t}},50430:(t,e,r)=>{var n=r(11502),i=r(56462),o=r(86034);t.exports=n?function(t,e,r){return i.f(t,e,o(1,r))}:function(t,e,r){return t[e]=r,t}},86034:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},30645:(t,e,r)=>{"use strict";var n=r(29638),i=r(62141),o=r(64320),a=r(22848),s=r(40606),u=r(50430),l=r(96313),c=r(46802),f=r(20013),h=r(80501),p=r(61151),d=p.IteratorPrototype,y=p.BUGGY_SAFARI_ITERATORS,m=c("iterator"),v="keys",g="values",b="entries",_=function(){return this};t.exports=function(t,e,r,c,p,w,T){i(r,e,c);var S,E,O,k=function(t){if(t===p&&L)return L;if(!y&&t in x)return x[t];switch(t){case v:case g:case b:return function(){return new r(this,t)}}return function(){return new r(this)}},C=e+" Iterator",P=!1,x=t.prototype,j=x[m]||x["@@iterator"]||p&&x[p],L=!y&&j||k(p),I="Array"==e&&x.entries||j;if(I&&(S=o(I.call(new t)),d!==Object.prototype&&S.next&&(f||o(S)===d||(a?a(S,d):"function"!=typeof S[m]&&u(S,m,_)),s(S,C,!0,!0),f&&(h[C]=_))),p==g&&j&&j.name!==g&&(P=!0,L=function(){return j.call(this)}),f&&!T||x[m]===L||u(x,m,L),h[e]=L,p)if(E={values:k(g),keys:w?L:k(v),entries:k(b)},T)for(O in E)(y||P||!(O in x))&&l(x,O,E[O]);else n({target:e,proto:!0,forced:y||P},E);return E}},11502:(t,e,r)=>{var n=r(25061);t.exports=!n((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},36009:(t,e,r)=>{var n=r(45001),i=r(62366),o=n.document,a=i(o)&&i(o.createElement);t.exports=function(t){return a?o.createElement(t):{}}},58514:t=>{t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},72089:t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},29638:(t,e,r)=>{var n=r(45001),i=r(8117).f,o=r(50430),a=r(96313),s=r(88506),u=r(46810),l=r(91092);t.exports=function(t,e){var r,c,f,h,p,d=t.target,y=t.global,m=t.stat;if(r=y?n:m?n[d]||s(d,{}):(n[d]||{}).prototype)for(c in e){if(h=e[c],f=t.noTargetGet?(p=i(r,c))&&p.value:r[c],!l(y?c:d+(m?".":"#")+c,t.forced)&&void 0!==f){if(typeof h==typeof f)continue;u(h,f)}(t.sham||f&&f.sham)&&o(h,"sham",!0),a(r,c,h,t)}}},25061:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},95453:(t,e,r)=>{"use strict";var n=r(50430),i=r(96313),o=r(25061),a=r(46802),s=r(44847),u=a("species"),l=!o((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),c=!o((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var r="ab".split(t);return 2!==r.length||"a"!==r[0]||"b"!==r[1]}));t.exports=function(t,e,r,f){var h=a(t),p=!o((function(){var e={};return e[h]=function(){return 7},7!=""[t](e)})),d=p&&!o((function(){var e=!1,r=/a/;return"split"===t&&((r={}).constructor={},r.constructor[u]=function(){return r},r.flags="",r[h]=/./[h]),r.exec=function(){return e=!0,null},r[h](""),!e}));if(!p||!d||"replace"===t&&!l||"split"===t&&!c){var y=/./[h],m=r(h,""[t],(function(t,e,r,n,i){return e.exec===s?p&&!i?{done:!0,value:y.call(e,r,n)}:{done:!0,value:t.call(r,e,n)}:{done:!1}})),v=m[0],g=m[1];i(String.prototype,t,v),i(RegExp.prototype,h,2==e?function(t,e){return g.call(t,this,e)}:function(t){return g.call(t,this)}),f&&n(RegExp.prototype[h],"sham",!0)}}},98218:(t,e,r)=>{var n=r(25061);t.exports=!n((function(){return Object.isExtensible(Object.preventExtensions({}))}))},21501:(t,e,r)=>{var n=r(6809);t.exports=n("native-function-to-string",Function.toString)},3425:(t,e,r)=>{var n=r(53757),i=r(45001),o=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?o(n[t])||o(i[t]):n[t]&&n[t][e]||i[t]&&i[t][e]}},26354:(t,e,r)=>{var n=r(20486),i=r(80501),o=r(46802)("iterator");t.exports=function(t){if(null!=t)return t[o]||t["@@iterator"]||i[n(t)]}},45001:(t,e,r)=>{var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||Function("return this")()},51900:t=>{var e={}.hasOwnProperty;t.exports=function(t,r){return e.call(t,r)}},92499:t=>{t.exports={}},12118:(t,e,r)=>{var n=r(3425);t.exports=n("document","documentElement")},17788:(t,e,r)=>{var n=r(11502),i=r(25061),o=r(36009);t.exports=!n&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},62901:(t,e,r)=>{var n=r(25061),i=r(75489),o="".split;t.exports=n((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?o.call(t,""):Object(t)}:Object},3419:(t,e,r)=>{var n=r(62366),i=r(22848);t.exports=function(t,e,r){var o,a;return i&&"function"==typeof(o=e.constructor)&&o!==r&&n(a=o.prototype)&&a!==r.prototype&&i(t,a),t}},81738:(t,e,r)=>{var n=r(92499),i=r(62366),o=r(51900),a=r(56462).f,s=r(41050),u=r(98218),l=s("meta"),c=0,f=Object.isExtensible||function(){return!0},h=function(t){a(t,l,{value:{objectID:"O"+ ++c,weakData:{}}})},p=t.exports={REQUIRED:!1,fastKey:function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,l)){if(!f(t))return"F";if(!e)return"E";h(t)}return t[l].objectID},getWeakData:function(t,e){if(!o(t,l)){if(!f(t))return!0;if(!e)return!1;h(t)}return t[l].weakData},onFreeze:function(t){return u&&p.REQUIRED&&f(t)&&!o(t,l)&&h(t),t}};n[l]=!0},50684:(t,e,r)=>{var n,i,o,a=r(77650),s=r(45001),u=r(62366),l=r(50430),c=r(51900),f=r(61695),h=r(92499),p=s.WeakMap;if(a){var d=new p,y=d.get,m=d.has,v=d.set;n=function(t,e){return v.call(d,t,e),e},i=function(t){return y.call(d,t)||{}},o=function(t){return m.call(d,t)}}else{var g=f("state");h[g]=!0,n=function(t,e){return l(t,g,e),e},i=function(t){return c(t,g)?t[g]:{}},o=function(t){return c(t,g)}}t.exports={set:n,get:i,has:o,enforce:function(t){return o(t)?i(t):n(t,{})},getterFor:function(t){return function(e){var r;if(!u(e)||(r=i(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}}},55557:(t,e,r)=>{var n=r(46802),i=r(80501),o=n("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||a[o]===t)}},20119:(t,e,r)=>{var n=r(75489);t.exports=Array.isArray||function(t){return"Array"==n(t)}},91092:(t,e,r)=>{var n=r(25061),i=/#|\.prototype\./,o=function(t,e){var r=s[a(t)];return r==l||r!=u&&("function"==typeof e?n(e):!!e)},a=o.normalize=function(t){return String(t).replace(i,".").toLowerCase()},s=o.data={},u=o.NATIVE="N",l=o.POLYFILL="P";t.exports=o},62366:t=>{t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},20013:t=>{t.exports=!1},98971:(t,e,r)=>{var n=r(4905),i=r(55557),o=r(74479),a=r(17755),s=r(26354),u=r(35304),l=function(t,e){this.stopped=t,this.result=e};(t.exports=function(t,e,r,c,f){var h,p,d,y,m,v,g,b=a(e,r,c?2:1);if(f)h=t;else{if("function"!=typeof(p=s(t)))throw TypeError("Target is not iterable");if(i(p)){for(d=0,y=o(t.length);y>d;d++)if((m=c?b(n(g=t[d])[0],g[1]):b(t[d]))&&m instanceof l)return m;return new l(!1)}h=p.call(t)}for(v=h.next;!(g=v.call(h)).done;)if("object"==typeof(m=u(h,b,g.value,c))&&m&&m instanceof l)return m;return new l(!1)}).stop=function(t){return new l(!0,t)}},61151:(t,e,r)=>{"use strict";var n,i,o,a=r(64320),s=r(50430),u=r(51900),l=r(46802),c=r(20013),f=l("iterator"),h=!1;[].keys&&("next"in(o=[].keys())?(i=a(a(o)))!==Object.prototype&&(n=i):h=!0),null==n&&(n={}),c||u(n,f)||s(n,f,(function(){return this})),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:h}},80501:t=>{t.exports={}},99262:(t,e,r)=>{var n=r(25061);t.exports=!!Object.getOwnPropertySymbols&&!n((function(){return!String(Symbol())}))},77650:(t,e,r)=>{var n=r(45001),i=r(21501),o=n.WeakMap;t.exports="function"==typeof o&&/native code/.test(i.call(o))},71640:(t,e,r)=>{"use strict";var n=r(11502),i=r(25061),o=r(89749),a=r(72822),s=r(49265),u=r(87615),l=r(62901),c=Object.assign;t.exports=!c||i((function(){var t={},e={},r=Symbol(),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach((function(t){e[t]=t})),7!=c({},t)[r]||o(c({},e)).join("")!=n}))?function(t,e){for(var r=u(t),i=arguments.length,c=1,f=a.f,h=s.f;i>c;)for(var p,d=l(arguments[c++]),y=f?o(d).concat(f(d)):o(d),m=y.length,v=0;m>v;)p=y[v++],n&&!h.call(d,p)||(r[p]=d[p]);return r}:c},22275:(t,e,r)=>{var n=r(4905),i=r(56191),o=r(72089),a=r(92499),s=r(12118),u=r(36009),l=r(61695)("IE_PROTO"),c="prototype",f=function(){},h=function(){var t,e=u("iframe"),r=o.length,n="script",i="java"+n+":";for(e.style.display="none",s.appendChild(e),e.src=String(i),(t=e.contentWindow.document).open(),t.write("<"+n+">document.F=Object</"+n+">"),t.close(),h=t.F;r--;)delete h[c][o[r]];return h()};t.exports=Object.create||function(t,e){var r;return null!==t?(f[c]=n(t),r=new f,f[c]=null,r[l]=t):r=h(),void 0===e?r:i(r,e)},a[l]=!0},56191:(t,e,r)=>{var n=r(11502),i=r(56462),o=r(4905),a=r(89749);t.exports=n?Object.defineProperties:function(t,e){o(t);for(var r,n=a(e),s=n.length,u=0;s>u;)i.f(t,r=n[u++],e[r]);return t}},56462:(t,e,r)=>{var n=r(11502),i=r(17788),o=r(4905),a=r(76973),s=Object.defineProperty;e.f=n?s:function(t,e,r){if(o(t),e=a(e,!0),o(r),i)try{return s(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},8117:(t,e,r)=>{var n=r(11502),i=r(49265),o=r(86034),a=r(40678),s=r(76973),u=r(51900),l=r(17788),c=Object.getOwnPropertyDescriptor;e.f=n?c:function(t,e){if(t=a(t),e=s(e,!0),l)try{return c(t,e)}catch(t){}if(u(t,e))return o(!i.f.call(t,e),t[e])}},59219:(t,e,r)=>{var n=r(23855),i=r(72089).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,i)}},72822:(t,e)=>{e.f=Object.getOwnPropertySymbols},64320:(t,e,r)=>{var n=r(51900),i=r(87615),o=r(61695),a=r(10149),s=o("IE_PROTO"),u=Object.prototype;t.exports=a?Object.getPrototypeOf:function(t){return t=i(t),n(t,s)?t[s]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},23855:(t,e,r)=>{var n=r(51900),i=r(40678),o=r(5029).indexOf,a=r(92499);t.exports=function(t,e){var r,s=i(t),u=0,l=[];for(r in s)!n(a,r)&&n(s,r)&&l.push(r);for(;e.length>u;)n(s,r=e[u++])&&(~o(l,r)||l.push(r));return l}},89749:(t,e,r)=>{var n=r(23855),i=r(72089);t.exports=Object.keys||function(t){return n(t,i)}},49265:(t,e)=>{"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,i=n&&!r.call({1:2},1);e.f=i?function(t){var e=n(this,t);return!!e&&e.enumerable}:r},22848:(t,e,r)=>{var n=r(4905),i=r(29076);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),e=r instanceof Array}catch(t){}return function(r,o){return n(r),i(o),e?t.call(r,o):r.__proto__=o,r}}():void 0)},45085:(t,e,r)=>{"use strict";var n=r(20486),i={};i[r(46802)("toStringTag")]="z",t.exports="[object z]"!==String(i)?function(){return"[object "+n(this)+"]"}:i.toString},62466:(t,e,r)=>{var n=r(3425),i=r(59219),o=r(72822),a=r(4905);t.exports=n("Reflect","ownKeys")||function(t){var e=i.f(a(t)),r=o.f;return r?e.concat(r(t)):e}},7206:(t,e,r)=>{var n=r(45001),i=r(9522).trim,o=r(49309),a=n.parseInt,s=/^[+-]?0[Xx]/,u=8!==a(o+"08")||22!==a(o+"0x16");t.exports=u?function(t,e){var r=i(String(t));return a(r,e>>>0||(s.test(r)?16:10))}:a},53757:(t,e,r)=>{t.exports=r(45001)},86846:(t,e,r)=>{var n=r(96313);t.exports=function(t,e,r){for(var i in e)n(t,i,e[i],r);return t}},96313:(t,e,r)=>{var n=r(45001),i=r(6809),o=r(50430),a=r(51900),s=r(88506),u=r(21501),l=r(50684),c=l.get,f=l.enforce,h=String(u).split("toString");i("inspectSource",(function(t){return u.call(t)})),(t.exports=function(t,e,r,i){var u=!!i&&!!i.unsafe,l=!!i&&!!i.enumerable,c=!!i&&!!i.noTargetGet;"function"==typeof r&&("string"!=typeof e||a(r,"name")||o(r,"name",e),f(r).source=h.join("string"==typeof e?e:"")),t!==n?(u?!c&&t[e]&&(l=!0):delete t[e],l?t[e]=r:o(t,e,r)):l?t[e]=r:s(e,r)})(Function.prototype,"toString",(function(){return"function"==typeof this&&c(this).source||u.call(this)}))},41847:(t,e,r)=>{var n=r(75489),i=r(44847);t.exports=function(t,e){var r=t.exec;if("function"==typeof r){var o=r.call(t,e);if("object"!=typeof o)throw TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==n(t))throw TypeError("RegExp#exec called on incompatible receiver");return i.call(t,e)}},44847:(t,e,r)=>{"use strict";var n,i,o=r(5268),a=RegExp.prototype.exec,s=String.prototype.replace,u=a,l=(n=/a/,i=/b*/g,a.call(n,"a"),a.call(i,"a"),0!==n.lastIndex||0!==i.lastIndex),c=void 0!==/()??/.exec("")[1];(l||c)&&(u=function(t){var e,r,n,i,u=this;return c&&(r=new RegExp("^"+u.source+"$(?!\\s)",o.call(u))),l&&(e=u.lastIndex),n=a.call(u,t),l&&n&&(u.lastIndex=u.global?n.index+n[0].length:e),c&&n&&n.length>1&&s.call(n[0],r,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(n[i]=void 0)})),n}),t.exports=u},5268:(t,e,r)=>{"use strict";var n=r(4905);t.exports=function(){var t=n(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},64475:t=>{t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},88506:(t,e,r)=>{var n=r(45001),i=r(50430);t.exports=function(t,e){try{i(n,t,e)}catch(r){n[t]=e}return e}},40606:(t,e,r)=>{var n=r(56462).f,i=r(51900),o=r(46802)("toStringTag");t.exports=function(t,e,r){t&&!i(t=r?t:t.prototype,o)&&n(t,o,{configurable:!0,value:e})}},61695:(t,e,r)=>{var n=r(6809),i=r(41050),o=n("keys");t.exports=function(t){return o[t]||(o[t]=i(t))}},19982:(t,e,r)=>{var n=r(45001),i=r(88506),o="__core-js_shared__",a=n[o]||i(o,{});t.exports=a},6809:(t,e,r)=>{var n=r(20013),i=r(19982);(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.4.0",mode:n?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},31853:(t,e,r)=>{"use strict";var n=r(25061);t.exports=function(t,e){var r=[][t];return!r||!n((function(){r.call(null,e||function(){throw 1},1)}))}},50189:(t,e,r)=>{var n=r(90321),i=r(64475),o=function(t){return function(e,r){var o,a,s=String(i(e)),u=n(r),l=s.length;return u<0||u>=l?t?"":void 0:(o=s.charCodeAt(u))<55296||o>56319||u+1===l||(a=s.charCodeAt(u+1))<56320||a>57343?t?s.charAt(u):o:t?s.slice(u,u+2):a-56320+(o-55296<<10)+65536}};t.exports={codeAt:o(!1),charAt:o(!0)}},9522:(t,e,r)=>{var n=r(64475),i="["+r(49309)+"]",o=RegExp("^"+i+i+"*"),a=RegExp(i+i+"*$"),s=function(t){return function(e){var r=String(n(e));return 1&t&&(r=r.replace(o,"")),2&t&&(r=r.replace(a,"")),r}};t.exports={start:s(1),end:s(2),trim:s(3)}},6971:(t,e,r)=>{var n=r(90321),i=Math.max,o=Math.min;t.exports=function(t,e){var r=n(t);return r<0?i(r+e,0):o(r,e)}},40678:(t,e,r)=>{var n=r(62901),i=r(64475);t.exports=function(t){return n(i(t))}},90321:t=>{var e=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:e)(t)}},74479:(t,e,r)=>{var n=r(90321),i=Math.min;t.exports=function(t){return t>0?i(n(t),9007199254740991):0}},87615:(t,e,r)=>{var n=r(64475);t.exports=function(t){return Object(n(t))}},76973:(t,e,r)=>{var n=r(62366);t.exports=function(t,e){if(!n(t))return t;var r,i;if(e&&"function"==typeof(r=t.toString)&&!n(i=r.call(t)))return i;if("function"==typeof(r=t.valueOf)&&!n(i=r.call(t)))return i;if(!e&&"function"==typeof(r=t.toString)&&!n(i=r.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},41050:t=>{var e=0,r=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++e+r).toString(36)}},84583:(t,e,r)=>{var n=r(3425);t.exports=n("navigator","userAgent")||""},24101:(t,e,r)=>{var n,i,o=r(45001),a=r(84583),s=o.process,u=s&&s.versions,l=u&&u.v8;l?i=(n=l.split("."))[0]+n[1]:a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(i=n[1]),t.exports=i&&+i},46802:(t,e,r)=>{var n=r(45001),i=r(6809),o=r(41050),a=r(99262),s=n.Symbol,u=i("wks");t.exports=function(t){return u[t]||(u[t]=a&&s[t]||(a?s:o)("Symbol."+t))}},49309:t=>{t.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},15296:(t,e,r)=>{"use strict";var n=r(29638),i=r(72758).filter;n({target:"Array",proto:!0,forced:!r(95611)("filter")},{filter:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},94386:(t,e,r)=>{"use strict";var n=r(29638),i=r(16607);n({target:"Array",proto:!0,forced:[].forEach!=i},{forEach:i})},48868:(t,e,r)=>{"use strict";var n=r(40678),i=r(5822),o=r(80501),a=r(50684),s=r(30645),u="Array Iterator",l=a.set,c=a.getterFor(u);t.exports=s(Array,"Array",(function(t,e){l(this,{type:u,target:n(t),index:0,kind:e})}),(function(){var t=c(this),e=t.target,r=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}}),"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},82937:(t,e,r)=>{"use strict";var n=r(29638),i=r(62040).left;n({target:"Array",proto:!0,forced:r(31853)("reduce")},{reduce:function(t){return i(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}})},66403:(t,e,r)=>{var n=r(11502),i=r(56462).f,o=Function.prototype,a=o.toString,s=/^\s*function ([^ (]*)/,u="name";n&&!(u in o)&&i(o,u,{configurable:!0,get:function(){try{return a.call(this).match(s)[1]}catch(t){return""}}})},96609:(t,e,r)=>{var n=r(29638),i=r(71640);n({target:"Object",stat:!0,forced:Object.assign!==i},{assign:i})},92274:(t,e,r)=>{var n=r(96313),i=r(45085),o=Object.prototype;i!==o.toString&&n(o,"toString",i,{unsafe:!0})},68268:(t,e,r)=>{var n=r(29638),i=r(7206);n({global:!0,forced:parseInt!=i},{parseInt:i})},42295:(t,e,r)=>{"use strict";var n=r(29638),i=r(44847);n({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},81874:(t,e,r)=>{"use strict";var n=r(50189).charAt,i=r(50684),o=r(30645),a="String Iterator",s=i.set,u=i.getterFor(a);o(String,"String",(function(t){s(this,{type:a,string:String(t),index:0})}),(function(){var t,e=u(this),r=e.string,i=e.index;return i>=r.length?{value:void 0,done:!0}:(t=n(r,i),e.index+=t.length,{value:t,done:!1})}))},52963:(t,e,r)=>{"use strict";var n=r(95453),i=r(4905),o=r(74479),a=r(64475),s=r(25528),u=r(41847);n("match",1,(function(t,e,r){return[function(e){var r=a(this),n=null==e?void 0:e[t];return void 0!==n?n.call(e,r):new RegExp(e)[t](String(r))},function(t){var n=r(e,t,this);if(n.done)return n.value;var a=i(t),l=String(this);if(!a.global)return u(a,l);var c=a.unicode;a.lastIndex=0;for(var f,h=[],p=0;null!==(f=u(a,l));){var d=String(f[0]);h[p]=d,""===d&&(a.lastIndex=s(l,o(a.lastIndex),c)),p++}return 0===p?null:h}]}))},34994:(t,e,r)=>{"use strict";var n=r(95453),i=r(4905),o=r(87615),a=r(74479),s=r(90321),u=r(64475),l=r(25528),c=r(41847),f=Math.max,h=Math.min,p=Math.floor,d=/\$([$&'`]|\d\d?|<[^>]*>)/g,y=/\$([$&'`]|\d\d?)/g;n("replace",2,(function(t,e,r){return[function(r,n){var i=u(this),o=null==r?void 0:r[t];return void 0!==o?o.call(r,i,n):e.call(String(i),r,n)},function(t,o){var u=r(e,t,this,o);if(u.done)return u.value;var p=i(t),d=String(this),y="function"==typeof o;y||(o=String(o));var m=p.global;if(m){var v=p.unicode;p.lastIndex=0}for(var g=[];;){var b=c(p,d);if(null===b)break;if(g.push(b),!m)break;""===String(b[0])&&(p.lastIndex=l(d,a(p.lastIndex),v))}for(var _,w="",T=0,S=0;S<g.length;S++){b=g[S];for(var E=String(b[0]),O=f(h(s(b.index),d.length),0),k=[],C=1;C<b.length;C++)k.push(void 0===(_=b[C])?_:String(_));var P=b.groups;if(y){var x=[E].concat(k,O,d);void 0!==P&&x.push(P);var j=String(o.apply(void 0,x))}else j=n(E,d,O,k,P,o);O>=T&&(w+=d.slice(T,O)+j,T=O+E.length)}return w+d.slice(T)}];function n(t,r,n,i,a,s){var u=n+t.length,l=i.length,c=y;return void 0!==a&&(a=o(a),c=d),e.call(s,c,(function(e,o){var s;switch(o.charAt(0)){case"$":return"$";case"&":return t;case"`":return r.slice(0,n);case"'":return r.slice(u);case"<":s=a[o.slice(1,-1)];break;default:var c=+o;if(0===c)return e;if(c>l){var f=p(c/10);return 0===f?e:f<=l?void 0===i[f-1]?o.charAt(1):i[f-1]+o.charAt(1):e}s=i[c-1]}return void 0===s?"":s}))}}))},31341:(t,e,r)=>{"use strict";var n,i=r(45001),o=r(86846),a=r(81738),s=r(66606),u=r(53769),l=r(62366),c=r(50684).enforce,f=r(77650),h=!i.ActiveXObject&&"ActiveXObject"in i,p=Object.isExtensible,d=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},y=t.exports=s("WeakMap",d,u,!0,!0);if(f&&h){n=u.getConstructor(d,"WeakMap",!0),a.REQUIRED=!0;var m=y.prototype,v=m.delete,g=m.has,b=m.get,_=m.set;o(m,{delete:function(t){if(l(t)&&!p(t)){var e=c(this);return e.frozen||(e.frozen=new n),v.call(this,t)||e.frozen.delete(t)}return v.call(this,t)},has:function(t){if(l(t)&&!p(t)){var e=c(this);return e.frozen||(e.frozen=new n),g.call(this,t)||e.frozen.has(t)}return g.call(this,t)},get:function(t){if(l(t)&&!p(t)){var e=c(this);return e.frozen||(e.frozen=new n),g.call(this,t)?b.call(this,t):e.frozen.get(t)}return b.call(this,t)},set:function(t,e){if(l(t)&&!p(t)){var r=c(this);r.frozen||(r.frozen=new n),g.call(this,t)?_.call(this,t,e):r.frozen.set(t,e)}else _.call(this,t,e);return this}})}},98457:(t,e,r)=>{var n=r(45001),i=r(58514),o=r(16607),a=r(50430);for(var s in i){var u=n[s],l=u&&u.prototype;if(l&&l.forEach!==o)try{a(l,"forEach",o)}catch(t){l.forEach=o}}},54861:(t,e,r)=>{var n=r(45001),i=r(58514),o=r(48868),a=r(50430),s=r(46802),u=s("iterator"),l=s("toStringTag"),c=o.values;for(var f in i){var h=n[f],p=h&&h.prototype;if(p){if(p[u]!==c)try{a(p,u,c)}catch(t){p[u]=c}if(p[l]||a(p,l,f),i[f])for(var d in o)if(p[d]!==o[d])try{a(p,d,o[d])}catch(t){p[d]=o[d]}}}},16951:function(t){t.exports=function(){"use strict";var t=Object.freeze||function(t){return t},e=t(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),r=t(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","audio","canvas","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","video","view","vkern"]),n=t(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),i=t(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),o=t(["#text"]),a=Object.freeze||function(t){return t},s=a(["accept","action","align","alt","autocomplete","background","bgcolor","border","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","coords","crossorigin","datetime","default","dir","disabled","download","enctype","face","for","headers","height","hidden","high","href","hreflang","id","integrity","ismap","label","lang","list","loop","low","max","maxlength","media","method","min","minlength","multiple","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","type","usemap","valign","value","width","xmlns"]),u=a(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),l=a(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),c=a(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),f=Object.hasOwnProperty,h=Object.setPrototypeOf,p=("undefined"!=typeof Reflect&&Reflect).apply;function d(t,e){h&&h(t,null);for(var r=e.length;r--;){var n=e[r];if("string"==typeof n){var i=n.toLowerCase();i!==n&&(Object.isFrozen(e)||(e[r]=i),n=i)}t[n]=!0}return t}function y(t){var e={},r=void 0;for(r in t)p(f,t,[r])&&(e[r]=t[r]);return e}p||(p=function(t,e,r){return t.apply(e,r)});var m=Object.seal||function(t){return t},v=m(/\{\{[\s\S]*|[\s\S]*\}\}/gm),g=m(/<%[\s\S]*|[\s\S]*%>/gm),b=m(/^data-[\-\w.\u00B7-\uFFFF]/),_=m(/^aria-[\-\w]+$/),w=m(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),T=m(/^(?:\w+script|data):/i),S=m(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g),E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function O(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}var k=("undefined"!=typeof Reflect&&Reflect).apply,C=Array.prototype.slice,P=Object.freeze,x=function(){return"undefined"==typeof window?null:window};k||(k=function(t,e,r){return t.apply(e,r)});return function t(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x(),f=function(e){return t(e)};if(f.version="2.0.7",f.removed=[],!a||!a.document||9!==a.document.nodeType)return f.isSupported=!1,f;var h=a.document,p=!1,m=!1,j=a.document,L=a.DocumentFragment,I=a.HTMLTemplateElement,A=a.Node,R=a.NodeFilter,D=a.NamedNodeMap,M=void 0===D?a.NamedNodeMap||a.MozNamedAttrMap:D,N=a.Text,B=a.Comment,U=a.DOMParser,F=a.TrustedTypes;if("function"==typeof I){var V=j.createElement("template");V.content&&V.content.ownerDocument&&(j=V.content.ownerDocument)}var H=function(t,e){if("object"!==(void 0===t?"undefined":E(t))||"function"!=typeof t.createPolicy)return null;var r=null,n="data-tt-policy-suffix";e.currentScript&&e.currentScript.hasAttribute(n)&&(r=e.currentScript.getAttribute(n));var i="dompurify"+(r?"#"+r:"");try{return t.createPolicy(i,{createHTML:function(t){return t}})}catch(t){return console.warn("TrustedTypes policy "+i+" could not be created."),null}}(F,h),q=H?H.createHTML(""):"",z=j,W=z.implementation,G=z.createNodeIterator,X=z.getElementsByTagName,K=z.createDocumentFragment,Y=h.importNode,Q={};f.isSupported=W&&void 0!==W.createHTMLDocument&&9!==j.documentMode;var $=v,J=g,Z=b,tt=_,et=T,rt=S,nt=w,it=null,ot=d({},[].concat(O(e),O(r),O(n),O(i),O(o))),at=null,st=d({},[].concat(O(s),O(u),O(l),O(c))),ut=null,lt=null,ct=!0,ft=!0,ht=!1,pt=!1,dt=!1,yt=!1,mt=!1,vt=!1,gt=!1,bt=!1,_t=!1,wt=!1,Tt=!0,St=!0,Et=!1,Ot={},kt=d({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","plaintext","script","style","svg","template","thead","title","video","xmp"]),Ct=d({},["audio","video","img","source","image"]),Pt=null,xt=d({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),jt=null,Lt=j.createElement("form"),It=function(t){jt&&jt===t||(t&&"object"===(void 0===t?"undefined":E(t))||(t={}),it="ALLOWED_TAGS"in t?d({},t.ALLOWED_TAGS):ot,at="ALLOWED_ATTR"in t?d({},t.ALLOWED_ATTR):st,Pt="ADD_URI_SAFE_ATTR"in t?d(y(xt),t.ADD_URI_SAFE_ATTR):xt,ut="FORBID_TAGS"in t?d({},t.FORBID_TAGS):{},lt="FORBID_ATTR"in t?d({},t.FORBID_ATTR):{},Ot="USE_PROFILES"in t&&t.USE_PROFILES,ct=!1!==t.ALLOW_ARIA_ATTR,ft=!1!==t.ALLOW_DATA_ATTR,ht=t.ALLOW_UNKNOWN_PROTOCOLS||!1,pt=t.SAFE_FOR_JQUERY||!1,dt=t.SAFE_FOR_TEMPLATES||!1,yt=t.WHOLE_DOCUMENT||!1,gt=t.RETURN_DOM||!1,bt=t.RETURN_DOM_FRAGMENT||!1,_t=t.RETURN_DOM_IMPORT||!1,wt=t.RETURN_TRUSTED_TYPE||!1,vt=t.FORCE_BODY||!1,Tt=!1!==t.SANITIZE_DOM,St=!1!==t.KEEP_CONTENT,Et=t.IN_PLACE||!1,nt=t.ALLOWED_URI_REGEXP||nt,dt&&(ft=!1),bt&&(gt=!0),Ot&&(it=d({},[].concat(O(o))),at=[],!0===Ot.html&&(d(it,e),d(at,s)),!0===Ot.svg&&(d(it,r),d(at,u),d(at,c)),!0===Ot.svgFilters&&(d(it,n),d(at,u),d(at,c)),!0===Ot.mathMl&&(d(it,i),d(at,l),d(at,c))),t.ADD_TAGS&&(it===ot&&(it=y(it)),d(it,t.ADD_TAGS)),t.ADD_ATTR&&(at===st&&(at=y(at)),d(at,t.ADD_ATTR)),t.ADD_URI_SAFE_ATTR&&d(Pt,t.ADD_URI_SAFE_ATTR),St&&(it["#text"]=!0),yt&&d(it,["html","head","body"]),it.table&&(d(it,["tbody"]),delete ut.tbody),P&&P(t),jt=t)},At=function(t){f.removed.push({element:t});try{t.parentNode.removeChild(t)}catch(e){t.outerHTML=q}},Rt=function(t,e){try{f.removed.push({attribute:e.getAttributeNode(t),from:e})}catch(t){f.removed.push({attribute:null,from:e})}e.removeAttribute(t)},Dt=function(t){var e=void 0,r=void 0;if(vt)t="<remove></remove>"+t;else{var n=t.match(/^[\s]+/);(r=n&&n[0])&&(t=t.slice(r.length))}if(p)try{e=(new U).parseFromString(t,"text/html")}catch(t){}if(m&&d(ut,["title"]),!e||!e.documentElement){var i=(e=W.createHTMLDocument("")).body;i.parentNode.removeChild(i.parentNode.firstElementChild),i.outerHTML=H?H.createHTML(t):t}return t&&r&&e.body.insertBefore(j.createTextNode(r),e.body.childNodes[0]||null),X.call(e,yt?"html":"body")[0]};f.isSupported&&(function(){try{Dt('<svg><p><textarea><img src="</textarea><img src=x abc=1//">').querySelector("svg img")&&(p=!0)}catch(t){}}(),function(){try{var t=Dt("<x/><title>&lt;/title&gt;&lt;img&gt;");/<\/title/.test(t.querySelector("title").innerHTML)&&(m=!0)}catch(t){}}());var Mt=function(t){return G.call(t.ownerDocument||t,t,R.SHOW_ELEMENT|R.SHOW_COMMENT|R.SHOW_TEXT,(function(){return R.FILTER_ACCEPT}),!1)},Nt=function(t){return"object"===(void 0===A?"undefined":E(A))?t instanceof A:t&&"object"===(void 0===t?"undefined":E(t))&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},Bt=function(t,e,r){Q[t]&&Q[t].forEach((function(t){t.call(f,e,r,jt)}))},Ut=function(t){var e,r=void 0;if(Bt("beforeSanitizeElements",t,null),!((e=t)instanceof N||e instanceof B||"string"==typeof e.nodeName&&"string"==typeof e.textContent&&"function"==typeof e.removeChild&&e.attributes instanceof M&&"function"==typeof e.removeAttribute&&"function"==typeof e.setAttribute&&"string"==typeof e.namespaceURI))return At(t),!0;var n=t.nodeName.toLowerCase();if(Bt("uponSanitizeElement",t,{tagName:n,allowedTags:it}),("svg"===n||"math"===n)&&0!==t.querySelectorAll("p, br").length)return At(t),!0;if(!it[n]||ut[n]){if(St&&!kt[n]&&"function"==typeof t.insertAdjacentHTML)try{var i=t.innerHTML;t.insertAdjacentHTML("AfterEnd",H?H.createHTML(i):i)}catch(t){}return At(t),!0}return"noscript"===n&&/<\/noscript/i.test(t.innerHTML)||"noembed"===n&&/<\/noembed/i.test(t.innerHTML)?(At(t),!0):(!pt||t.firstElementChild||t.content&&t.content.firstElementChild||!/</g.test(t.textContent)||(f.removed.push({element:t.cloneNode()}),t.innerHTML?t.innerHTML=t.innerHTML.replace(/</g,"&lt;"):t.innerHTML=t.textContent.replace(/</g,"&lt;")),dt&&3===t.nodeType&&(r=(r=(r=t.textContent).replace($," ")).replace(J," "),t.textContent!==r&&(f.removed.push({element:t.cloneNode()}),t.textContent=r)),Bt("afterSanitizeElements",t,null),!1)},Ft=function(t,e,r){if(Tt&&("id"===e||"name"===e)&&(r in j||r in Lt))return!1;if(ft&&Z.test(e));else if(ct&&tt.test(e));else{if(!at[e]||lt[e])return!1;if(Pt[e]);else if(nt.test(r.replace(rt,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==r.indexOf("data:")||!Ct[t])if(ht&&!et.test(r.replace(rt,"")));else if(r)return!1}return!0},Vt=function(t){var e=void 0,r=void 0,n=void 0,i=void 0,o=void 0;Bt("beforeSanitizeAttributes",t,null);var a=t.attributes;if(a){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:at};for(o=a.length;o--;){var u=e=a[o],l=u.name,c=u.namespaceURI;if(r=e.value.trim(),n=l.toLowerCase(),s.attrName=n,s.attrValue=r,s.keepAttr=!0,Bt("uponSanitizeAttribute",t,s),r=s.attrValue,"name"===n&&"IMG"===t.nodeName&&a.id)i=a.id,a=k(C,a,[]),Rt("id",t),Rt(l,t),a.indexOf(i)>o&&t.setAttribute("id",i.value);else{if("INPUT"===t.nodeName&&"type"===n&&"file"===r&&s.keepAttr&&(at[n]||!lt[n]))continue;"id"===l&&t.setAttribute(l,""),Rt(l,t)}if(s.keepAttr)if(/svg|math/i.test(t.namespaceURI)&&new RegExp("</("+Object.keys(kt).join("|")+")","i").test(r))Rt(l,t);else{dt&&(r=(r=r.replace($," ")).replace(J," "));var h=t.nodeName.toLowerCase();if(Ft(h,n,r))try{c?t.setAttributeNS(c,l,r):t.setAttribute(l,r),f.removed.pop()}catch(t){}}}Bt("afterSanitizeAttributes",t,null)}},Ht=function t(e){var r=void 0,n=Mt(e);for(Bt("beforeSanitizeShadowDOM",e,null);r=n.nextNode();)Bt("uponSanitizeShadowNode",r,null),Ut(r)||(r.content instanceof L&&t(r.content),Vt(r));Bt("afterSanitizeShadowDOM",e,null)};return f.sanitize=function(t,e){var r=void 0,n=void 0,i=void 0,o=void 0,s=void 0;if(t||(t="\x3c!--\x3e"),"string"!=typeof t&&!Nt(t)){if("function"!=typeof t.toString)throw new TypeError("toString is not a function");if("string"!=typeof(t=t.toString()))throw new TypeError("dirty is not a string, aborting")}if(!f.isSupported){if("object"===E(a.toStaticHTML)||"function"==typeof a.toStaticHTML){if("string"==typeof t)return a.toStaticHTML(t);if(Nt(t))return a.toStaticHTML(t.outerHTML)}return t}if(mt||It(e),f.removed=[],Et);else if(t instanceof A)1===(n=(r=Dt("\x3c!--\x3e")).ownerDocument.importNode(t,!0)).nodeType&&"BODY"===n.nodeName||"HTML"===n.nodeName?r=n:r.appendChild(n);else{if(!gt&&!dt&&!yt&&wt&&-1===t.indexOf("<"))return H?H.createHTML(t):t;if(!(r=Dt(t)))return gt?null:q}r&&vt&&At(r.firstChild);for(var u=Mt(Et?t:r);i=u.nextNode();)3===i.nodeType&&i===o||Ut(i)||(i.content instanceof L&&Ht(i.content),Vt(i),o=i);if(o=null,Et)return t;if(gt){if(bt)for(s=K.call(r.ownerDocument);r.firstChild;)s.appendChild(r.firstChild);else s=r;return _t&&(s=Y.call(h,s,!0)),s}var l=yt?r.outerHTML:r.innerHTML;return dt&&(l=(l=l.replace($," ")).replace(J," ")),H&&wt?H.createHTML(l):l},f.setConfig=function(t){It(t),mt=!0},f.clearConfig=function(){jt=null,mt=!1},f.isValidAttribute=function(t,e,r){jt||It({});var n=t.toLowerCase(),i=e.toLowerCase();return Ft(n,i,r)},f.addHook=function(t,e){"function"==typeof e&&(Q[t]=Q[t]||[],Q[t].push(e))},f.removeHook=function(t){Q[t]&&Q[t].pop()},f.removeHooks=function(t){Q[t]&&(Q[t]=[])},f.removeAllHooks=function(){Q={}},f}()}()},3384:(t,e,r)=>{var n,i=void 0!==r.g?r.g:"undefined"!=typeof window?window:{},o=r(58421);"undefined"!=typeof document?n=document:(n=i["__GLOBAL_DOCUMENT_CACHE@4"])||(n=i["__GLOBAL_DOCUMENT_CACHE@4"]=o),t.exports=n},51562:(t,e,r)=>{var n;n="undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{},t.exports=n},63848:t=>{t.exports=function(t){if(!t)return!1;var r=e.call(t);return"[object Function]"===r||"function"==typeof t&&"[object RegExp]"!==r||"undefined"!=typeof window&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)};var e=Object.prototype.toString},19389:(t,e)=>{function r(t){if(t&&"object"==typeof t){var e=t.which||t.keyCode||t.charCode;e&&(t=e)}if("number"==typeof t)return a[t];var r,o=String(t);return(r=n[o.toLowerCase()])?r:(r=i[o.toLowerCase()])||(1===o.length?o.charCodeAt(0):void 0)}r.isEventKey=function(t,e){if(t&&"object"==typeof t){var r=t.which||t.keyCode||t.charCode;if(null==r)return!1;if("string"==typeof e){var o;if(o=n[e.toLowerCase()])return o===r;if(o=i[e.toLowerCase()])return o===r}else if("number"==typeof e)return e===r;return!1}};var n=(e=t.exports=r).code=e.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},i=e.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};for(o=97;o<123;o++)n[String.fromCharCode(o)]=o-32;for(var o=48;o<58;o++)n[o-48]=o;for(o=1;o<13;o++)n["f"+o]=o+111;for(o=0;o<10;o++)n["numpad "+o]=o+96;var a=e.names=e.title={};for(o in n)a[n[o]]=o;for(var s in i)n[s]=i[s]},40001:(t,e,r)=>{var n=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,a=/^0o[0-7]+$/i,s=parseInt,u="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,l="object"==typeof self&&self&&self.Object===Object&&self,c=u||l||Function("return this")(),f=Object.prototype.toString,h=Math.max,p=Math.min,d=function(){return c.Date.now()};function y(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function m(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==f.call(t)}(t))return NaN;if(y(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=y(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(n,"");var r=o.test(t);return r||a.test(t)?s(t.slice(2),r?2:8):i.test(t)?NaN:+t}t.exports=function(t,e,r){var n,i,o,a,s,u,l=0,c=!1,f=!1,v=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function g(e){var r=n,o=i;return n=i=void 0,l=e,a=t.apply(o,r)}function b(t){var r=t-u;return void 0===u||r>=e||r<0||f&&t-l>=o}function _(){var t=d();if(b(t))return w(t);s=setTimeout(_,function(t){var r=e-(t-u);return f?p(r,o-(t-l)):r}(t))}function w(t){return s=void 0,v&&n?g(t):(n=i=void 0,a)}function T(){var t=d(),r=b(t);if(n=arguments,i=this,u=t,r){if(void 0===s)return function(t){return l=t,s=setTimeout(_,e),c?g(t):a}(u);if(f)return s=setTimeout(_,e),g(u)}return void 0===s&&(s=setTimeout(_,e)),a}return e=m(e)||0,y(r)&&(c=!!r.leading,o=(f="maxWait"in r)?h(m(r.maxWait)||0,e):o,v="trailing"in r?!!r.trailing:v),T.cancel=function(){void 0!==s&&clearTimeout(s),l=0,n=u=i=s=void 0},T.flush=function(){return void 0===s?a:w(d())},T}},98511:(t,e,r)=>{var n,i="__lodash_hash_undefined__",o="[object Function]",a="[object GeneratorFunction]",s=/^\[object .+?Constructor\]$/,u="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,l="object"==typeof self&&self&&self.Object===Object&&self,c=u||l||Function("return this")(),f=Array.prototype,h=Function.prototype,p=Object.prototype,d=c["__core-js_shared__"],y=(n=/[^.]+$/.exec(d&&d.keys&&d.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",m=h.toString,v=p.hasOwnProperty,g=p.toString,b=RegExp("^"+m.call(v).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_=f.splice,w=P(c,"Map"),T=P(Object,"create");function S(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function E(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function O(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function k(t,e){for(var r,n,i=t.length;i--;)if((r=t[i][0])===(n=e)||r!=r&&n!=n)return i;return-1}function C(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function P(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){if(!j(t)||y&&y in t)return!1;var e=function(t){var e=j(t)?g.call(t):"";return e==o||e==a}(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t)?b:s;return e.test(function(t){if(null!=t){try{return m.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}(r)?r:void 0}function x(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=t.apply(this,n);return r.cache=o.set(i,a),a};return r.cache=new(x.Cache||O),r}function j(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}S.prototype.clear=function(){this.__data__=T?T(null):{}},S.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},S.prototype.get=function(t){var e=this.__data__;if(T){var r=e[t];return r===i?void 0:r}return v.call(e,t)?e[t]:void 0},S.prototype.has=function(t){var e=this.__data__;return T?void 0!==e[t]:v.call(e,t)},S.prototype.set=function(t,e){return this.__data__[t]=T&&void 0===e?i:e,this},E.prototype.clear=function(){this.__data__=[]},E.prototype.delete=function(t){var e=this.__data__,r=k(e,t);return!(r<0||(r==e.length-1?e.pop():_.call(e,r,1),0))},E.prototype.get=function(t){var e=this.__data__,r=k(e,t);return r<0?void 0:e[r][1]},E.prototype.has=function(t){return k(this.__data__,t)>-1},E.prototype.set=function(t,e){var r=this.__data__,n=k(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},O.prototype.clear=function(){this.__data__={hash:new S,map:new(w||E),string:new S}},O.prototype.delete=function(t){return C(this,t).delete(t)},O.prototype.get=function(t){return C(this,t).get(t)},O.prototype.has=function(t){return C(this,t).has(t)},O.prototype.set=function(t,e){return C(this,t).set(t,e),this},x.Cache=O,t.exports=x},50200:(t,e,r)=>{var n="Expected a function",i=NaN,o="[object Symbol]",a=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt,f="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,h="object"==typeof self&&self&&self.Object===Object&&self,p=f||h||Function("return this")(),d=Object.prototype.toString,y=Math.max,m=Math.min,v=function(){return p.Date.now()};function g(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function b(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&d.call(t)==o}(t))return i;if(g(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=g(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(a,"");var r=u.test(t);return r||l.test(t)?c(t.slice(2),r?2:8):s.test(t)?i:+t}t.exports=function(t,e,r){var i=!0,o=!0;if("function"!=typeof t)throw new TypeError(n);return g(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),function(t,e,r){var i,o,a,s,u,l,c=0,f=!1,h=!1,p=!0;if("function"!=typeof t)throw new TypeError(n);function d(e){var r=i,n=o;return i=o=void 0,c=e,s=t.apply(n,r)}function _(t){var r=t-l;return void 0===l||r>=e||r<0||h&&t-c>=a}function w(){var t=v();if(_(t))return T(t);u=setTimeout(w,function(t){var r=e-(t-l);return h?m(r,a-(t-c)):r}(t))}function T(t){return u=void 0,p&&i?d(t):(i=o=void 0,s)}function S(){var t=v(),r=_(t);if(i=arguments,o=this,l=t,r){if(void 0===u)return function(t){return c=t,u=setTimeout(w,e),f?d(t):s}(l);if(h)return u=setTimeout(w,e),d(l)}return void 0===u&&(u=setTimeout(w,e)),s}return e=b(e)||0,g(r)&&(f=!!r.leading,a=(h="maxWait"in r)?y(b(r.maxWait)||0,e):a,p="trailing"in r?!!r.trailing:p),S.cancel=function(){void 0!==u&&clearTimeout(u),c=0,i=l=o=u=void 0},S.flush=function(){return void 0===u?s:T(v())},S}(t,e,{leading:i,maxWait:e,trailing:o})}},57258:t=>{var e=Math.pow(2,32);t.exports=function(t){var r=new DataView(t.buffer,t.byteOffset,t.byteLength),n={version:t[0],flags:new Uint8Array(t.subarray(1,4)),references:[],referenceId:r.getUint32(4),timescale:r.getUint32(8)},i=12;0===n.version?(n.earliestPresentationTime=r.getUint32(i),n.firstOffset=r.getUint32(i+4),i+=8):(n.earliestPresentationTime=r.getUint32(i)*e+r.getUint32(i+4),n.firstOffset=r.getUint32(i+8)*e+r.getUint32(i+12),i+=16),i+=2;var o=r.getUint16(i);for(i+=2;o>0;i+=12,o--)n.references.push({referenceType:(128&t[i])>>>7,referencedSize:2147483647&r.getUint32(i),subsegmentDuration:r.getUint32(i+4),startsWithSap:!!(128&t[i+8]),sapType:(112&t[i+8])>>>4,sapDeltaTime:268435455&r.getUint32(i+8)});return n}},28195:t=>{var e,r,n,i,o,a,s,u=9e4;e=function(t){return t*u},r=function(t,e){return t*e},n=function(t){return t/u},i=function(t,e){return t/e},o=function(t,r){return e(i(t,r))},a=function(t,e){return r(n(t),e)},s=function(t,e,r){return n(r?t:t-e)},t.exports={ONE_SECOND_IN_TS:u,secondsToVideoTs:e,secondsToAudioTs:r,videoTsToSeconds:n,audioTsToSeconds:i,audioTsToVideoTs:o,videoTsToAudioTs:a,metadataTsToSeconds:s}},11602:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,o=Object.create(i.prototype),a=new P(n||[]);return o._invoke=function(t,e,r){var n=f;return function(i,o){if(n===p)throw new Error("Generator is already running");if(n===d){if("throw"===i)throw o;return j()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=O(a,r);if(s){if(s===y)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var u=c(t,e,r);if("normal"===u.type){if(n=r.done?d:h,u.arg===y)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=d,r.method="throw",r.arg=u.arg)}}}(t,r,a),o}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f="suspendedStart",h="suspendedYield",p="executing",d="completed",y={};function m(){}function v(){}function g(){}var b={};b[o]=function(){return this};var _=Object.getPrototypeOf,w=_&&_(_(x([])));w&&w!==r&&n.call(w,o)&&(b=w);var T=g.prototype=m.prototype=Object.create(b);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function r(i,o,a,s){var u=c(t[i],t,o);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var i;this._invoke=function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}}function O(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,O(t,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var i=c(n,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var o=i.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function x(t){if(t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:j}}function j(){return{value:e,done:!0}}return v.prototype=T.constructor=g,g.constructor=v,v.displayName=u(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,u(t,s,"GeneratorFunction")),t.prototype=Object.create(T),t},t.awrap=function(t){return{__await:t}},S(E.prototype),E.prototype[a]=function(){return this},t.AsyncIterator=E,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new E(l(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(T),u(T,s,"Generator"),T[o]=function(){return this},T.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=x,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:x(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}},8004:t=>{t.exports=function(t,e){var r,n=null;try{r=JSON.parse(t,e)}catch(t){n=t}return[n,r]}},31336:function(t){var e,r,n,i,o;e=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,n=/(?:\/|^)\.(?=\/)/g,i=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(t,e,n){if(n=n||{},t=t.trim(),!(e=e.trim())){if(!n.alwaysNormalize)return t;var i=o.parseURL(t);if(!i)throw new Error("Error trying to parse base URL.");return i.path=o.normalizePath(i.path),o.buildURLFromParts(i)}var a=o.parseURL(e);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return n.alwaysNormalize?(a.path=o.normalizePath(a.path),o.buildURLFromParts(a)):e;var s=o.parseURL(t);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&"/"!==s.path[0]){var u=r.exec(s.path);s.netLoc=u[1],s.path=u[2]}s.netLoc&&!s.path&&(s.path="/");var l={scheme:s.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(l.netLoc=s.netLoc,"/"!==a.path[0]))if(a.path){var c=s.path,f=c.substring(0,c.lastIndexOf("/")+1)+a.path;l.path=o.normalizePath(f)}else l.path=s.path,a.params||(l.params=s.params,a.query||(l.query=s.query));return null===l.path&&(l.path=n.alwaysNormalize?o.normalizePath(a.path):a.path),o.buildURLFromParts(l)},parseURL:function(t){var r=e.exec(t);return r?{scheme:r[1]||"",netLoc:r[2]||"",path:r[3]||"",params:r[4]||"",query:r[5]||"",fragment:r[6]||""}:null},normalizePath:function(t){for(t=t.split("").reverse().join("").replace(n,"");t.length!==(t=t.replace(i,"")).length;);return t.split("").reverse().join("")},buildURLFromParts:function(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}},t.exports=o},83983:(t,e,r)=>{var n=r(51562),i=t.exports={WebVTT:r(77735),VTTCue:r(65997),VTTRegion:r(17193)};n.vttjs=i,n.WebVTT=i.WebVTT;var o=i.VTTCue,a=i.VTTRegion,s=n.VTTCue,u=n.VTTRegion;i.shim=function(){n.VTTCue=o,n.VTTRegion=a},i.restore=function(){n.VTTCue=s,n.VTTRegion=u},n.VTTCue||i.shim()},77735:(t,e,r)=>{var n=r(3384),i=Object.create||function(){function t(){}return function(e){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return t.prototype=e,new t}}();function o(t,e){this.name="ParsingError",this.code=t.code,this.message=e||t.message}function a(t){function e(t,e,r,n){return 3600*(0|t)+60*(0|e)+(0|r)+(0|n)/1e3}var r=t.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return r?r[3]?e(r[1],r[2],r[3].replace(":",""),r[4]):r[1]>59?e(r[1],r[2],0,r[4]):e(0,r[1],r[2],r[4]):null}function s(){this.values=i(null)}function u(t,e,r,n){var i=n?t.split(n):[t];for(var o in i)if("string"==typeof i[o]){var a=i[o].split(r);2===a.length&&e(a[0].trim(),a[1].trim())}}function l(t,e,r){var n=t;function i(){var e=a(t);if(null===e)throw new o(o.Errors.BadTimeStamp,"Malformed timestamp: "+n);return t=t.replace(/^[^\sa-zA-Z-]+/,""),e}function l(){t=t.replace(/^\s+/,"")}if(l(),e.startTime=i(),l(),"--\x3e"!==t.substr(0,3))throw new o(o.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);t=t.substr(3),l(),e.endTime=i(),l(),function(t,e){var n=new s;u(t,(function(t,e){switch(t){case"region":for(var i=r.length-1;i>=0;i--)if(r[i].id===e){n.set(t,r[i].region);break}break;case"vertical":n.alt(t,e,["rl","lr"]);break;case"line":var o=e.split(","),a=o[0];n.integer(t,a),n.percent(t,a)&&n.set("snapToLines",!1),n.alt(t,a,["auto"]),2===o.length&&n.alt("lineAlign",o[1],["start","center","end"]);break;case"position":o=e.split(","),n.percent(t,o[0]),2===o.length&&n.alt("positionAlign",o[1],["start","center","end"]);break;case"size":n.percent(t,e);break;case"align":n.alt(t,e,["start","center","end","left","right"])}}),/:/,/\s/),e.region=n.get("region",null),e.vertical=n.get("vertical","");try{e.line=n.get("line","auto")}catch(t){}e.lineAlign=n.get("lineAlign","start"),e.snapToLines=n.get("snapToLines",!0),e.size=n.get("size",100);try{e.align=n.get("align","center")}catch(t){e.align=n.get("align","middle")}try{e.position=n.get("position","auto")}catch(t){e.position=n.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},e.align)}e.positionAlign=n.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},e.align)}(t,e)}o.prototype=i(Error.prototype),o.prototype.constructor=o,o.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},s.prototype={set:function(t,e){this.get(t)||""===e||(this.values[t]=e)},get:function(t,e,r){return r?this.has(t)?this.values[t]:e[r]:this.has(t)?this.values[t]:e},has:function(t){return t in this.values},alt:function(t,e,r){for(var n=0;n<r.length;++n)if(e===r[n]){this.set(t,e);break}},integer:function(t,e){/^-?\d+$/.test(e)&&this.set(t,parseInt(e,10))},percent:function(t,e){return!!(e.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(e=parseFloat(e))>=0&&e<=100)&&(this.set(t,e),!0)}};var c=n.createElement&&n.createElement("textarea"),f={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},h={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"},d={rt:"ruby"};function y(t,e){function r(){if(!e)return null;var t,r=e.match(/^([^<]*)(<[^>]*>?)?/);return t=r[1]?r[1]:r[2],e=e.substr(t.length),t}function n(t,e){return!d[e.localName]||d[e.localName]===t.localName}function i(e,r){var n=f[e];if(!n)return null;var i=t.document.createElement(n),o=p[e];return o&&r&&(i[o]=r.trim()),i}for(var o,s,u=t.document.createElement("div"),l=u,y=[];null!==(o=r());)if("<"!==o[0])l.appendChild(t.document.createTextNode((s=o,c.innerHTML=s,s=c.textContent,c.textContent="",s)));else{if("/"===o[1]){y.length&&y[y.length-1]===o.substr(2).replace(">","")&&(y.pop(),l=l.parentNode);continue}var m,v=a(o.substr(1,o.length-2));if(v){m=t.document.createProcessingInstruction("timestamp",v),l.appendChild(m);continue}var g=o.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!g)continue;if(!(m=i(g[1],g[3])))continue;if(!n(l,m))continue;if(g[2]){var b=g[2].split(".");b.forEach((function(t){var e=/^bg_/.test(t),r=e?t.slice(3):t;if(h.hasOwnProperty(r)){var n=e?"background-color":"color",i=h[r];m.style[n]=i}})),m.className=b.join(" ")}y.push(g[1]),l.appendChild(m),l=m}return u}var m=[[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 v(t){for(var e=0;e<m.length;e++){var r=m[e];if(t>=r[0]&&t<=r[1])return!0}return!1}function g(t){var e=[],r="";if(!t||!t.childNodes)return"ltr";function n(t,e){for(var r=e.childNodes.length-1;r>=0;r--)t.push(e.childNodes[r])}function i(t){if(!t||!t.length)return null;var e=t.pop(),r=e.textContent||e.innerText;if(r){var o=r.match(/^.*(\n|\r)/);return o?(t.length=0,o[0]):r}return"ruby"===e.tagName?i(t):e.childNodes?(n(t,e),i(t)):void 0}for(n(e,t);r=i(e);)for(var o=0;o<r.length;o++)if(v(r.charCodeAt(o)))return"rtl";return"ltr"}function b(){}function _(t,e,r){b.call(this),this.cue=e,this.cueDiv=y(t,e.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:""===e.vertical?"horizontal-tb":"lr"===e.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(n,this.cueDiv),this.div=t.document.createElement("div"),n={direction:g(this.cueDiv),writingMode:""===e.vertical?"horizontal-tb":"lr"===e.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===e.align?"center":e.align,font:r.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(n),this.div.appendChild(this.cueDiv);var i=0;switch(e.positionAlign){case"start":case"line-left":i=e.position;break;case"center":i=e.position-e.size/2;break;case"end":case"line-right":i=e.position-e.size}""===e.vertical?this.applyStyles({left:this.formatStyle(i,"%"),width:this.formatStyle(e.size,"%")}):this.applyStyles({top:this.formatStyle(i,"%"),height:this.formatStyle(e.size,"%")}),this.move=function(t){this.applyStyles({top:this.formatStyle(t.top,"px"),bottom:this.formatStyle(t.bottom,"px"),left:this.formatStyle(t.left,"px"),right:this.formatStyle(t.right,"px"),height:this.formatStyle(t.height,"px"),width:this.formatStyle(t.width,"px")})}}function w(t){var e,r,n,i;if(t.div){r=t.div.offsetHeight,n=t.div.offsetWidth,i=t.div.offsetTop;var o=(o=t.div.childNodes)&&(o=o[0])&&o.getClientRects&&o.getClientRects();t=t.div.getBoundingClientRect(),e=o?Math.max(o[0]&&o[0].height||0,t.height/o.length):0}this.left=t.left,this.right=t.right,this.top=t.top||i,this.height=t.height||r,this.bottom=t.bottom||i+(t.height||r),this.width=t.width||n,this.lineHeight=void 0!==e?e:t.lineHeight}function T(t,e,r,n){var i=new w(e),o=e.cue,a=function(t){if("number"==typeof t.line&&(t.snapToLines||t.line>=0&&t.line<=100))return t.line;if(!t.track||!t.track.textTrackList||!t.track.textTrackList.mediaElement)return-1;for(var e=t.track,r=e.textTrackList,n=0,i=0;i<r.length&&r[i]!==e;i++)"showing"===r[i].mode&&n++;return-1*++n}(o),s=[];if(o.snapToLines){var u;switch(o.vertical){case"":s=["+y","-y"],u="height";break;case"rl":s=["+x","-x"],u="width";break;case"lr":s=["-x","+x"],u="width"}var l=i.lineHeight,c=l*Math.round(a),f=r[u]+l,h=s[0];Math.abs(c)>f&&(c=c<0?-1:1,c*=Math.ceil(f/l)*l),a<0&&(c+=""===o.vertical?r.height:r.width,s=s.reverse()),i.move(h,c)}else{var p=i.lineHeight/r.height*100;switch(o.lineAlign){case"center":a-=p/2;break;case"end":a-=p}switch(o.vertical){case"":e.applyStyles({top:e.formatStyle(a,"%")});break;case"rl":e.applyStyles({left:e.formatStyle(a,"%")});break;case"lr":e.applyStyles({right:e.formatStyle(a,"%")})}s=["+y","-x","+x","-y"],i=new w(e)}var d=function(t,e){for(var i,o=new w(t),a=1,s=0;s<e.length;s++){for(;t.overlapsOppositeAxis(r,e[s])||t.within(r)&&t.overlapsAny(n);)t.move(e[s]);if(t.within(r))return t;var u=t.intersectPercentage(r);a>u&&(i=new w(t),a=u),t=new w(o)}return i||o}(i,s);e.move(d.toCSSCompatValues(r))}function S(){}b.prototype.applyStyles=function(t,e){for(var r in e=e||this.div,t)t.hasOwnProperty(r)&&(e.style[r]=t[r])},b.prototype.formatStyle=function(t,e){return 0===t?0:t+e},_.prototype=i(b.prototype),_.prototype.constructor=_,w.prototype.move=function(t,e){switch(e=void 0!==e?e:this.lineHeight,t){case"+x":this.left+=e,this.right+=e;break;case"-x":this.left-=e,this.right-=e;break;case"+y":this.top+=e,this.bottom+=e;break;case"-y":this.top-=e,this.bottom-=e}},w.prototype.overlaps=function(t){return this.left<t.right&&this.right>t.left&&this.top<t.bottom&&this.bottom>t.top},w.prototype.overlapsAny=function(t){for(var e=0;e<t.length;e++)if(this.overlaps(t[e]))return!0;return!1},w.prototype.within=function(t){return this.top>=t.top&&this.bottom<=t.bottom&&this.left>=t.left&&this.right<=t.right},w.prototype.overlapsOppositeAxis=function(t,e){switch(e){case"+x":return this.left<t.left;case"-x":return this.right>t.right;case"+y":return this.top<t.top;case"-y":return this.bottom>t.bottom}},w.prototype.intersectPercentage=function(t){return Math.max(0,Math.min(this.right,t.right)-Math.max(this.left,t.left))*Math.max(0,Math.min(this.bottom,t.bottom)-Math.max(this.top,t.top))/(this.height*this.width)},w.prototype.toCSSCompatValues=function(t){return{top:this.top-t.top,bottom:t.bottom-this.bottom,left:this.left-t.left,right:t.right-this.right,height:this.height,width:this.width}},w.getSimpleBoxPosition=function(t){var e=t.div?t.div.offsetHeight:t.tagName?t.offsetHeight:0,r=t.div?t.div.offsetWidth:t.tagName?t.offsetWidth:0,n=t.div?t.div.offsetTop:t.tagName?t.offsetTop:0;return{left:(t=t.div?t.div.getBoundingClientRect():t.tagName?t.getBoundingClientRect():t).left,right:t.right,top:t.top||n,height:t.height||e,bottom:t.bottom||n+(t.height||e),width:t.width||r}},S.StringDecoder=function(){return{decode:function(t){if(!t)return"";if("string"!=typeof t)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}},S.convertCueToDOMTree=function(t,e){return t&&e?y(t,e):null},S.processCues=function(t,e,r){if(!t||!e||!r)return null;for(;r.firstChild;)r.removeChild(r.firstChild);var n=t.document.createElement("div");if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin="1.5%",r.appendChild(n),function(t){for(var e=0;e<t.length;e++)if(t[e].hasBeenReset||!t[e].displayState)return!0;return!1}(e)){var i=[],o=w.getSimpleBoxPosition(n),a={font:Math.round(.05*o.height*100)/100+"px sans-serif"};!function(){for(var r,s,u=0;u<e.length;u++)s=e[u],r=new _(t,s,a),n.appendChild(r.div),T(0,r,o,i),s.displayState=r.div,i.push(w.getSimpleBoxPosition(r))}()}else for(var s=0;s<e.length;s++)n.appendChild(e[s].displayState)},S.Parser=function(t,e,r){r||(r=e,e={}),e||(e={}),this.window=t,this.vttjs=e,this.state="INITIAL",this.buffer="",this.decoder=r||new TextDecoder("utf8"),this.regionList=[]},S.Parser.prototype={reportOrThrowError:function(t){if(!(t instanceof o))throw t;this.onparsingerror&&this.onparsingerror(t)},parse:function(t){var e,r=this;function n(){for(var t=r.buffer,e=0;e<t.length&&"\r"!==t[e]&&"\n"!==t[e];)++e;var n=t.substr(0,e);return"\r"===t[e]&&++e,"\n"===t[e]&&++e,r.buffer=t.substr(e),n}t&&(r.buffer+=r.decoder.decode(t,{stream:!0}));try{var i;if("INITIAL"===r.state){if(!/\r\n|\n/.test(r.buffer))return this;var c=(i=n()).match(/^WEBVTT([ \t].*)?$/);if(!c||!c[0])throw new o(o.Errors.BadSignature);r.state="HEADER"}for(var f=!1;r.buffer;){if(!/\r\n|\n/.test(r.buffer))return this;switch(f?f=!1:i=n(),r.state){case"HEADER":/:/.test(i)?(e=i).match(/X-TIMESTAMP-MAP/)?u(e,(function(t,e){"X-TIMESTAMP-MAP"===t&&function(t){var e=new s;u(t,(function(t,r){switch(t){case"MPEGT":e.integer(t+"S",r);break;case"LOCA":e.set(t+"L",a(r))}}),/[^\d]:/,/,/),r.ontimestampmap&&r.ontimestampmap({MPEGTS:e.get("MPEGTS"),LOCAL:e.get("LOCAL")})}(e)}),/=/):u(e,(function(t,e){"Region"===t&&function(t){var e=new s;if(u(t,(function(t,r){switch(t){case"id":e.set(t,r);break;case"width":e.percent(t,r);break;case"lines":e.integer(t,r);break;case"regionanchor":case"viewportanchor":var n=r.split(",");if(2!==n.length)break;var i=new s;if(i.percent("x",n[0]),i.percent("y",n[1]),!i.has("x")||!i.has("y"))break;e.set(t+"X",i.get("x")),e.set(t+"Y",i.get("y"));break;case"scroll":e.alt(t,r,["up"])}}),/=/,/\s/),e.has("id")){var n=new(r.vttjs.VTTRegion||r.window.VTTRegion);n.width=e.get("width",100),n.lines=e.get("lines",3),n.regionAnchorX=e.get("regionanchorX",0),n.regionAnchorY=e.get("regionanchorY",100),n.viewportAnchorX=e.get("viewportanchorX",0),n.viewportAnchorY=e.get("viewportanchorY",100),n.scroll=e.get("scroll",""),r.onregion&&r.onregion(n),r.regionList.push({id:e.get("id"),region:n})}}(e)}),/:/):i||(r.state="ID");continue;case"NOTE":i||(r.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(i)){r.state="NOTE";break}if(!i)continue;r.cue=new(r.vttjs.VTTCue||r.window.VTTCue)(0,0,"");try{r.cue.align="center"}catch(t){r.cue.align="middle"}if(r.state="CUE",-1===i.indexOf("--\x3e")){r.cue.id=i;continue}case"CUE":try{l(i,r.cue,r.regionList)}catch(t){r.reportOrThrowError(t),r.cue=null,r.state="BADCUE";continue}r.state="CUETEXT";continue;case"CUETEXT":var h=-1!==i.indexOf("--\x3e");if(!i||h&&(f=!0)){r.oncue&&r.oncue(r.cue),r.cue=null,r.state="ID";continue}r.cue.text&&(r.cue.text+="\n"),r.cue.text+=i.replace(/\u2028/g,"\n").replace(/u2029/g,"\n");continue;case"BADCUE":i||(r.state="ID");continue}}}catch(t){r.reportOrThrowError(t),"CUETEXT"===r.state&&r.cue&&r.oncue&&r.oncue(r.cue),r.cue=null,r.state="INITIAL"===r.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var t=this;try{if(t.buffer+=t.decoder.decode(),(t.cue||"HEADER"===t.state)&&(t.buffer+="\n\n",t.parse()),"INITIAL"===t.state)throw new o(o.Errors.BadSignature)}catch(e){t.reportOrThrowError(e)}return t.onflush&&t.onflush(),this}},t.exports=S},65997:t=>{var e={"":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 n(t){return"string"==typeof t&&!!r[t.toLowerCase()]&&t.toLowerCase()}function i(t,r,i){this.hasBeenReset=!1;var o="",a=!1,s=t,u=r,l=i,c=null,f="",h=!0,p="auto",d="start",y="auto",m="auto",v=100,g="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return o},set:function(t){o=""+t}},pauseOnExit:{enumerable:!0,get:function(){return a},set:function(t){a=!!t}},startTime:{enumerable:!0,get:function(){return s},set:function(t){if("number"!=typeof t)throw new TypeError("Start time must be set to a number.");s=t,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return u},set:function(t){if("number"!=typeof t)throw new TypeError("End time must be set to a number.");u=t,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return l},set:function(t){l=""+t,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return c},set:function(t){c=t,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return f},set:function(t){var r=function(t){return"string"==typeof t&&!!e[t.toLowerCase()]&&t.toLowerCase()}(t);if(!1===r)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");f=r,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return h},set:function(t){h=!!t,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return p},set:function(t){if("number"!=typeof t&&"auto"!==t)throw new SyntaxError("Line: an invalid number or illegal string was specified.");p=t,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return d},set:function(t){var e=n(t);e?(d=e,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return y},set:function(t){if(t<0||t>100)throw new Error("Position must be between 0 and 100.");y=t,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return m},set:function(t){var e=n(t);e?(m=e,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return v},set:function(t){if(t<0||t>100)throw new Error("Size must be between 0 and 100.");v=t,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return g},set:function(t){var e=n(t);if(!e)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");g=e,this.hasBeenReset=!0}}}),this.displayState=void 0}i.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},t.exports=i},17193:t=>{var e={"":!0,up:!0};function r(t){return"number"==typeof t&&t>=0&&t<=100}t.exports=function(){var t=100,n=3,i=0,o=100,a=0,s=100,u="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return t},set:function(e){if(!r(e))throw new Error("Width must be between 0 and 100.");t=e}},lines:{enumerable:!0,get:function(){return n},set:function(t){if("number"!=typeof t)throw new TypeError("Lines must be set to a number.");n=t}},regionAnchorY:{enumerable:!0,get:function(){return o},set:function(t){if(!r(t))throw new Error("RegionAnchorX must be between 0 and 100.");o=t}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(t){if(!r(t))throw new Error("RegionAnchorY must be between 0 and 100.");i=t}},viewportAnchorY:{enumerable:!0,get:function(){return s},set:function(t){if(!r(t))throw new Error("ViewportAnchorY must be between 0 and 100.");s=t}},viewportAnchorX:{enumerable:!0,get:function(){return a},set:function(t){if(!r(t))throw new Error("ViewportAnchorX must be between 0 and 100.");a=t}},scroll:{enumerable:!0,get:function(){return u},set:function(t){var r=function(t){return"string"==typeof t&&!!e[t.toLowerCase()]&&t.toLowerCase()}(t);!1===r?console.warn("Scroll: an invalid or illegal string was specified."):u=r}}})}},73668:(t,e,r)=>{function n(t){this.options=t||{locator:{}}}function i(){this.cdata=!1}function o(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}function a(t){if(t)return"\n@"+(t.systemId||"")+"#[line:"+t.lineNumber+",col:"+t.columnNumber+"]"}function s(t,e,r){return"string"==typeof t?t.substr(e,r):t.length>=e+r||e?new java.lang.String(t,e,r)+"":t}function u(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}n.prototype.parseFromString=function(t,e){var r=this.options,n=new f,o=r.domBuilder||new i,s=r.errorHandler,u=r.locator,c=r.xmlns||{},h=/\/x?html?$/.test(e),p=h?l.entityMap:{lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return u&&o.setDocumentLocator(u),n.errorHandler=function(t,e,r){if(!t){if(e instanceof i)return e;t=e}var n={},o=t instanceof Function;function s(e){var i=t[e];!i&&o&&(i=2==t.length?function(r){t(e,r)}:t),n[e]=i&&function(t){i("[xmldom "+e+"]\t"+t+a(r))}||function(){}}return r=r||{},s("warning"),s("error"),s("fatalError"),n}(s,o,u),n.domBuilder=r.domBuilder||o,h&&(c[""]="http://www.w3.org/1999/xhtml"),c.xml=c.xml||"http://www.w3.org/XML/1998/namespace",t&&"string"==typeof t?n.parse(t,c,p):n.errorHandler.error("invalid doc source"),o.doc},i.prototype={startDocument:function(){this.doc=(new p).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(t,e,r,n){var i=this.doc,a=i.createElementNS(t,r||e),s=n.length;u(this,a),this.currentElement=a,this.locator&&o(this.locator,a);for(var l=0;l<s;l++){t=n.getURI(l);var c=n.getValue(l),f=(r=n.getQName(l),i.createAttributeNS(t,r));this.locator&&o(n.getLocator(l),f),f.value=f.nodeValue=c,a.setAttributeNode(f)}},endElement:function(t,e,r){var n=this.currentElement;n.tagName,this.currentElement=n.parentNode},startPrefixMapping:function(t,e){},endPrefixMapping:function(t){},processingInstruction:function(t,e){var r=this.doc.createProcessingInstruction(t,e);this.locator&&o(this.locator,r),u(this,r)},ignorableWhitespace:function(t,e,r){},characters:function(t,e,r){if(t=s.apply(this,arguments)){if(this.cdata)var n=this.doc.createCDATASection(t);else n=this.doc.createTextNode(t);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(t)&&this.doc.appendChild(n),this.locator&&o(this.locator,n)}},skippedEntity:function(t){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(t){(this.locator=t)&&(t.lineNumber=0)},comment:function(t,e,r){t=s.apply(this,arguments);var n=this.doc.createComment(t);this.locator&&o(this.locator,n),u(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(t,e,r){var n=this.doc.implementation;if(n&&n.createDocumentType){var i=n.createDocumentType(t,e,r);this.locator&&o(this.locator,i),u(this,i)}},warning:function(t){console.warn("[xmldom warning]\t"+t,a(this.locator))},error:function(t){console.error("[xmldom error]\t"+t,a(this.locator))},fatalError:function(t){throw new h(t,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(t){i.prototype[t]=function(){return null}}));var l=r(70624),c=r(91186),f=c.XMLReader,h=c.ParseError,p=r(51676).DOMImplementation;r(51676),e.a=n},51676:(t,e)=>{function r(t,e){for(var r in t)e[r]=t[r]}function n(t,e){var n=t.prototype;if(!(n instanceof e)){function i(){}i.prototype=e.prototype,r(n,i=new i),t.prototype=n=i}n.constructor!=t&&("function"!=typeof t&&console.error("unknow Class:"+t),n.constructor=t)}var i="http://www.w3.org/1999/xhtml",o={},a=o.ELEMENT_NODE=1,s=o.ATTRIBUTE_NODE=2,u=o.TEXT_NODE=3,l=o.CDATA_SECTION_NODE=4,c=o.ENTITY_REFERENCE_NODE=5,f=o.ENTITY_NODE=6,h=o.PROCESSING_INSTRUCTION_NODE=7,p=o.COMMENT_NODE=8,d=o.DOCUMENT_NODE=9,y=o.DOCUMENT_TYPE_NODE=10,m=o.DOCUMENT_FRAGMENT_NODE=11,v=o.NOTATION_NODE=12,g={},b={},_=(g.INDEX_SIZE_ERR=(b[1]="Index size error",1),g.DOMSTRING_SIZE_ERR=(b[2]="DOMString size error",2),g.HIERARCHY_REQUEST_ERR=(b[3]="Hierarchy request error",3)),w=(g.WRONG_DOCUMENT_ERR=(b[4]="Wrong document",4),g.INVALID_CHARACTER_ERR=(b[5]="Invalid character",5),g.NO_DATA_ALLOWED_ERR=(b[6]="No data allowed",6),g.NO_MODIFICATION_ALLOWED_ERR=(b[7]="No modification allowed",7),g.NOT_FOUND_ERR=(b[8]="Not found",8)),T=(g.NOT_SUPPORTED_ERR=(b[9]="Not supported",9),g.INUSE_ATTRIBUTE_ERR=(b[10]="Attribute in use",10));function S(t,e){if(e instanceof Error)var r=e;else r=this,Error.call(this,b[t]),this.message=b[t],Error.captureStackTrace&&Error.captureStackTrace(this,S);return r.code=t,e&&(this.message=this.message+": "+e),r}function E(){}function O(t,e){this._node=t,this._refresh=e,k(this)}function k(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!=e){var n=t._refresh(t._node);nt(t,"length",n.length),r(n,t),t._inc=e}}function C(){}function P(t,e){for(var r=t.length;r--;)if(t[r]===e)return r}function x(t,e,r,n){if(n?e[P(e,n)]=r:e[e.length++]=r,t){r.ownerElement=t;var i=t.ownerDocument;i&&(n&&M(i,t,n),function(t,e,r){t&&t._inc++,"http://www.w3.org/2000/xmlns/"==r.namespaceURI&&(e._nsMap[r.prefix?r.localName:""]=r.value)}(i,t,r))}}function j(t,e,r){var n=P(e,r);if(!(n>=0))throw S(w,new Error(t.tagName+"@"+r));for(var i=e.length-1;n<i;)e[n]=e[++n];if(e.length=i,t){var o=t.ownerDocument;o&&(M(o,t,r),r.ownerElement=null)}}function L(t){if(this._features={},t)for(var e in t)this._features=t[e]}function I(){}function A(t){return("<"==t?"&lt;":">"==t&&"&gt;")||"&"==t&&"&amp;"||'"'==t&&"&quot;"||"&#"+t.charCodeAt()+";"}function R(t,e){if(e(t))return!0;if(t=t.firstChild)do{if(R(t,e))return!0}while(t=t.nextSibling)}function D(){}function M(t,e,r,n){t&&t._inc++,"http://www.w3.org/2000/xmlns/"==r.namespaceURI&&delete e._nsMap[r.prefix?r.localName:""]}function N(t,e,r){if(t&&t._inc){t._inc++;var n=e.childNodes;if(r)n[n.length++]=r;else{for(var i=e.firstChild,o=0;i;)n[o++]=i,i=i.nextSibling;n.length=o}}}function B(t,e){var r=e.previousSibling,n=e.nextSibling;return r?r.nextSibling=n:t.firstChild=n,n?n.previousSibling=r:t.lastChild=r,N(t.ownerDocument,t),e}function U(t,e,r){var n=e.parentNode;if(n&&n.removeChild(e),e.nodeType===m){var i=e.firstChild;if(null==i)return e;var o=e.lastChild}else i=o=e;var a=r?r.previousSibling:t.lastChild;i.previousSibling=a,o.nextSibling=r,a?a.nextSibling=i:t.firstChild=i,null==r?t.lastChild=o:r.previousSibling=o;do{i.parentNode=t}while(i!==o&&(i=i.nextSibling));return N(t.ownerDocument||t,t),e.nodeType==m&&(e.firstChild=e.lastChild=null),e}function F(){this._nsMap={}}function V(){}function H(){}function q(){}function z(){}function W(){}function G(){}function X(){}function K(){}function Y(){}function Q(){}function $(){}function J(t,e){var r=[],n=9==this.nodeType&&this.documentElement||this,i=n.prefix,o=n.namespaceURI;if(o&&null==i&&null==(i=n.lookupPrefix(o)))var a=[{namespace:o,prefix:null}];return tt(this,r,t,e,a),r.join("")}function Z(t,e,r){var n=t.prefix||"",i=t.namespaceURI;if(!n&&!i)return!1;if("xml"===n&&"http://www.w3.org/XML/1998/namespace"===i||"http://www.w3.org/2000/xmlns/"==i)return!1;for(var o=r.length;o--;){var a=r[o];if(a.prefix==n)return a.namespace!=i}return!0}function tt(t,e,r,n,o){if(n){if(!(t=n(t)))return;if("string"==typeof t)return void e.push(t)}switch(t.nodeType){case a:o||(o=[]),o.length;var f=t.attributes,v=f.length,g=t.firstChild,b=t.tagName;r=i===t.namespaceURI||r,e.push("<",b);for(var _=0;_<v;_++)"xmlns"==(w=f.item(_)).prefix?o.push({prefix:w.localName,namespace:w.value}):"xmlns"==w.nodeName&&o.push({prefix:"",namespace:w.value});for(_=0;_<v;_++){var w;if(Z(w=f.item(_),0,o)){var T=w.prefix||"",S=w.namespaceURI,E=T?" xmlns:"+T:" xmlns";e.push(E,'="',S,'"'),o.push({prefix:T,namespace:S})}tt(w,e,r,n,o)}if(Z(t,0,o)&&(T=t.prefix||"",S=t.namespaceURI,E=T?" xmlns:"+T:" xmlns",e.push(E,'="',S,'"'),o.push({prefix:T,namespace:S})),g||r&&!/^(?:meta|link|img|br|hr|input)$/i.test(b)){if(e.push(">"),r&&/^script$/i.test(b))for(;g;)g.data?e.push(g.data):tt(g,e,r,n,o),g=g.nextSibling;else for(;g;)tt(g,e,r,n,o),g=g.nextSibling;e.push("</",b,">")}else e.push("/>");return;case d:case m:for(g=t.firstChild;g;)tt(g,e,r,n,o),g=g.nextSibling;return;case s:return e.push(" ",t.name,'="',t.value.replace(/[&"]/g,A),'"');case u:return e.push(t.data.replace(/[<&]/g,A).replace(/]]>/g,"]]&gt;"));case l:return e.push("<![CDATA[",t.data,"]]>");case p:return e.push("\x3c!--",t.data,"--\x3e");case y:var O=t.publicId,k=t.systemId;if(e.push("<!DOCTYPE ",t.name),O)e.push(" PUBLIC ",O),k&&"."!=k&&e.push(" ",k),e.push(">");else if(k&&"."!=k)e.push(" SYSTEM ",k,">");else{var C=t.internalSubset;C&&e.push(" [",C,"]"),e.push(">")}return;case h:return e.push("<?",t.target," ",t.data,"?>");case c:return e.push("&",t.nodeName,";");default:e.push("??",t.nodeName)}}function et(t,e,r){var n;switch(e.nodeType){case a:(n=e.cloneNode(!1)).ownerDocument=t;case m:break;case s:r=!0}if(n||(n=e.cloneNode(!1)),n.ownerDocument=t,n.parentNode=null,r)for(var i=e.firstChild;i;)n.appendChild(et(t,i,r)),i=i.nextSibling;return n}function rt(t,e,r){var n=new e.constructor;for(var i in e){var o=e[i];"object"!=typeof o&&o!=n[i]&&(n[i]=o)}switch(e.childNodes&&(n.childNodes=new E),n.ownerDocument=t,n.nodeType){case a:var u=e.attributes,l=n.attributes=new C,c=u.length;l._ownerElement=n;for(var f=0;f<c;f++)n.setAttributeNode(rt(t,u.item(f),!0));break;case s:r=!0}if(r)for(var h=e.firstChild;h;)n.appendChild(rt(t,h,r)),h=h.nextSibling;return n}function nt(t,e,r){t[e]=r}g.INVALID_STATE_ERR=(b[11]="Invalid state",11),g.SYNTAX_ERR=(b[12]="Syntax error",12),g.INVALID_MODIFICATION_ERR=(b[13]="Invalid modification",13),g.NAMESPACE_ERR=(b[14]="Invalid namespace",14),g.INVALID_ACCESS_ERR=(b[15]="Invalid access",15),S.prototype=Error.prototype,r(g,S),E.prototype={length:0,item:function(t){return this[t]||null},toString:function(t,e){for(var r=[],n=0;n<this.length;n++)tt(this[n],r,t,e);return r.join("")}},O.prototype.item=function(t){return k(this),this[t]},n(O,E),C.prototype={length:0,item:E.prototype.item,getNamedItem:function(t){for(var e=this.length;e--;){var r=this[e];if(r.nodeName==t)return r}},setNamedItem:function(t){var e=t.ownerElement;if(e&&e!=this._ownerElement)throw new S(T);var r=this.getNamedItem(t.nodeName);return x(this._ownerElement,this,t,r),r},setNamedItemNS:function(t){var e,r=t.ownerElement;if(r&&r!=this._ownerElement)throw new S(T);return e=this.getNamedItemNS(t.namespaceURI,t.localName),x(this._ownerElement,this,t,e),e},removeNamedItem:function(t){var e=this.getNamedItem(t);return j(this._ownerElement,this,e),e},removeNamedItemNS:function(t,e){var r=this.getNamedItemNS(t,e);return j(this._ownerElement,this,r),r},getNamedItemNS:function(t,e){for(var r=this.length;r--;){var n=this[r];if(n.localName==e&&n.namespaceURI==t)return n}return null}},L.prototype={hasFeature:function(t,e){var r=this._features[t.toLowerCase()];return!(!r||e&&!(e in r))},createDocument:function(t,e,r){var n=new D;if(n.implementation=this,n.childNodes=new E,n.doctype=r,r&&n.appendChild(r),e){var i=n.createElementNS(t,e);n.appendChild(i)}return n},createDocumentType:function(t,e,r){var n=new G;return n.name=t,n.nodeName=t,n.publicId=e,n.systemId=r,n}},I.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(t,e){return U(this,t,e)},replaceChild:function(t,e){this.insertBefore(t,e),e&&this.removeChild(e)},removeChild:function(t){return B(this,t)},appendChild:function(t){return this.insertBefore(t,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(t){return rt(this.ownerDocument||this,this,t)},normalize:function(){for(var t=this.firstChild;t;){var e=t.nextSibling;e&&e.nodeType==u&&t.nodeType==u?(this.removeChild(e),t.appendData(e.data)):(t.normalize(),t=e)}},isSupported:function(t,e){return this.ownerDocument.implementation.hasFeature(t,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(t){for(var e=this;e;){var r=e._nsMap;if(r)for(var n in r)if(r[n]==t)return n;e=e.nodeType==s?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){for(var e=this;e;){var r=e._nsMap;if(r&&t in r)return r[t];e=e.nodeType==s?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){return null==this.lookupPrefix(t)}},r(o,I),r(o,I.prototype),D.prototype={nodeName:"#document",nodeType:d,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType==m){for(var r=t.firstChild;r;){var n=r.nextSibling;this.insertBefore(r,e),r=n}return t}return null==this.documentElement&&t.nodeType==a&&(this.documentElement=t),U(this,t,e),t.ownerDocument=this,t},removeChild:function(t){return this.documentElement==t&&(this.documentElement=null),B(this,t)},importNode:function(t,e){return et(this,t,e)},getElementById:function(t){var e=null;return R(this.documentElement,(function(r){if(r.nodeType==a&&r.getAttribute("id")==t)return e=r,!0})),e},getElementsByClassName:function(t){var e=new RegExp("(^|\\s)"+t+"(\\s|$)");return new O(this,(function(t){var r=[];return R(t.documentElement,(function(n){n!==t&&n.nodeType==a&&e.test(n.getAttribute("class"))&&r.push(n)})),r}))},createElement:function(t){var e=new F;return e.ownerDocument=this,e.nodeName=t,e.tagName=t,e.childNodes=new E,(e.attributes=new C)._ownerElement=e,e},createDocumentFragment:function(){var t=new Q;return t.ownerDocument=this,t.childNodes=new E,t},createTextNode:function(t){var e=new q;return e.ownerDocument=this,e.appendData(t),e},createComment:function(t){var e=new z;return e.ownerDocument=this,e.appendData(t),e},createCDATASection:function(t){var e=new W;return e.ownerDocument=this,e.appendData(t),e},createProcessingInstruction:function(t,e){var r=new $;return r.ownerDocument=this,r.tagName=r.target=t,r.nodeValue=r.data=e,r},createAttribute:function(t){var e=new V;return e.ownerDocument=this,e.name=t,e.nodeName=t,e.localName=t,e.specified=!0,e},createEntityReference:function(t){var e=new Y;return e.ownerDocument=this,e.nodeName=t,e},createElementNS:function(t,e){var r=new F,n=e.split(":"),i=r.attributes=new C;return r.childNodes=new E,r.ownerDocument=this,r.nodeName=e,r.tagName=e,r.namespaceURI=t,2==n.length?(r.prefix=n[0],r.localName=n[1]):r.localName=e,i._ownerElement=r,r},createAttributeNS:function(t,e){var r=new V,n=e.split(":");return r.ownerDocument=this,r.nodeName=e,r.name=e,r.namespaceURI=t,r.specified=!0,2==n.length?(r.prefix=n[0],r.localName=n[1]):r.localName=e,r}},n(D,I),F.prototype={nodeType:a,hasAttribute:function(t){return null!=this.getAttributeNode(t)},getAttribute:function(t){var e=this.getAttributeNode(t);return e&&e.value||""},getAttributeNode:function(t){return this.attributes.getNamedItem(t)},setAttribute:function(t,e){var r=this.ownerDocument.createAttribute(t);r.value=r.nodeValue=""+e,this.setAttributeNode(r)},removeAttribute:function(t){var e=this.getAttributeNode(t);e&&this.removeAttributeNode(e)},appendChild:function(t){return t.nodeType===m?this.insertBefore(t,null):function(t,e){var r=e.parentNode;if(r){var n=t.lastChild;r.removeChild(e),n=t.lastChild}return n=t.lastChild,e.parentNode=t,e.previousSibling=n,e.nextSibling=null,n?n.nextSibling=e:t.firstChild=e,t.lastChild=e,N(t.ownerDocument,t,e),e}(this,t)},setAttributeNode:function(t){return this.attributes.setNamedItem(t)},setAttributeNodeNS:function(t){return this.attributes.setNamedItemNS(t)},removeAttributeNode:function(t){return this.attributes.removeNamedItem(t.nodeName)},removeAttributeNS:function(t,e){var r=this.getAttributeNodeNS(t,e);r&&this.removeAttributeNode(r)},hasAttributeNS:function(t,e){return null!=this.getAttributeNodeNS(t,e)},getAttributeNS:function(t,e){var r=this.getAttributeNodeNS(t,e);return r&&r.value||""},setAttributeNS:function(t,e,r){var n=this.ownerDocument.createAttributeNS(t,e);n.value=n.nodeValue=""+r,this.setAttributeNode(n)},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByTagName:function(t){return new O(this,(function(e){var r=[];return R(e,(function(n){n===e||n.nodeType!=a||"*"!==t&&n.tagName!=t||r.push(n)})),r}))},getElementsByTagNameNS:function(t,e){return new O(this,(function(r){var n=[];return R(r,(function(i){i===r||i.nodeType!==a||"*"!==t&&i.namespaceURI!==t||"*"!==e&&i.localName!=e||n.push(i)})),n}))}},D.prototype.getElementsByTagName=F.prototype.getElementsByTagName,D.prototype.getElementsByTagNameNS=F.prototype.getElementsByTagNameNS,n(F,I),V.prototype.nodeType=s,n(V,I),H.prototype={data:"",substringData:function(t,e){return this.data.substring(t,t+e)},appendData:function(t){t=this.data+t,this.nodeValue=this.data=t,this.length=t.length},insertData:function(t,e){this.replaceData(t,0,e)},appendChild:function(t){throw new Error(b[_])},deleteData:function(t,e){this.replaceData(t,e,"")},replaceData:function(t,e,r){r=this.data.substring(0,t)+r+this.data.substring(t+e),this.nodeValue=this.data=r,this.length=r.length}},n(H,I),q.prototype={nodeName:"#text",nodeType:u,splitText:function(t){var e=this.data,r=e.substring(t);e=e.substring(0,t),this.data=this.nodeValue=e,this.length=e.length;var n=this.ownerDocument.createTextNode(r);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},n(q,H),z.prototype={nodeName:"#comment",nodeType:p},n(z,H),W.prototype={nodeName:"#cdata-section",nodeType:l},n(W,H),G.prototype.nodeType=y,n(G,I),X.prototype.nodeType=v,n(X,I),K.prototype.nodeType=f,n(K,I),Y.prototype.nodeType=c,n(Y,I),Q.prototype.nodeName="#document-fragment",Q.prototype.nodeType=m,n(Q,I),$.prototype.nodeType=h,n($,I),I.prototype.toString=J;try{if(Object.defineProperty){function it(t){switch(t.nodeType){case a:case m:var e=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&e.push(it(t)),t=t.nextSibling;return e.join("");default:return t.nodeValue}}Object.defineProperty(O.prototype,"length",{get:function(){return k(this),this.$$length}}),Object.defineProperty(I.prototype,"textContent",{get:function(){return it(this)},set:function(t){switch(this.nodeType){case a:case m:for(;this.firstChild;)this.removeChild(this.firstChild);(t||String(t))&&this.appendChild(this.ownerDocument.createTextNode(t));break;default:this.data=t,this.value=t,this.nodeValue=t}}}),nt=function(t,e,r){t["$$"+e]=r}}}catch(ot){}e.DOMImplementation=L},70624:(t,e)=>{e.entityMap={lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}},91186:(t,e)=>{var 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]/,n=new RegExp("[\\-\\.0-9"+r.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),i=new RegExp("^"+r.source+n.source+"*(?::"+r.source+n.source+"*)?$");function o(t,e){this.message=t,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,o)}function a(){}function s(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function u(t,e,r,n,i,o){function a(t,e,n){t in r.attributeNames&&o.fatalError("Attribute "+t+" redefined"),r.addValue(t,e,n)}for(var s,u=++e,l=0;;){var c=t.charAt(u);switch(c){case"=":if(1===l)s=t.slice(e,u),l=3;else{if(2!==l)throw new Error("attribute equal must after attrName");l=3}break;case"'":case'"':if(3===l||1===l){if(1===l&&(o.warning('attribute value must after "="'),s=t.slice(e,u)),e=u+1,!((u=t.indexOf(c,e))>0))throw new Error("attribute value no end '"+c+"' match");a(s,f=t.slice(e,u).replace(/&#?\w+;/g,i),e-1),l=5}else{if(4!=l)throw new Error('attribute value must after "="');a(s,f=t.slice(e,u).replace(/&#?\w+;/g,i),e),o.warning('attribute "'+s+'" missed start quot('+c+")!!"),e=u+1,l=5}break;case"/":switch(l){case 0:r.setTagName(t.slice(e,u));case 5:case 6:case 7:l=7,r.closed=!0;case 4:case 1:case 2:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return o.error("unexpected end of input"),0==l&&r.setTagName(t.slice(e,u)),u;case">":switch(l){case 0:r.setTagName(t.slice(e,u));case 5:case 6:case 7:break;case 4:case 1:"/"===(f=t.slice(e,u)).slice(-1)&&(r.closed=!0,f=f.slice(0,-1));case 2:2===l&&(f=s),4==l?(o.warning('attribute "'+f+'" missed quot(")!'),a(s,f.replace(/&#?\w+;/g,i),e)):("http://www.w3.org/1999/xhtml"===n[""]&&f.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+f+'" missed value!! "'+f+'" instead!!'),a(f,f,e));break;case 3:throw new Error("attribute value missed!!")}return u;case"€":c=" ";default:if(c<=" ")switch(l){case 0:r.setTagName(t.slice(e,u)),l=6;break;case 1:s=t.slice(e,u),l=2;break;case 4:var f=t.slice(e,u).replace(/&#?\w+;/g,i);o.warning('attribute "'+f+'" missed quot(")!!'),a(s,f,e);case 5:l=6}else switch(l){case 2:r.tagName,"http://www.w3.org/1999/xhtml"===n[""]&&s.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+s+'" missed value!! "'+s+'" instead2!!'),a(s,s,e),e=u,l=1;break;case 5:o.warning('attribute space is required"'+s+'"!!');case 6:l=1,e=u;break;case 3:l=4,e=u;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}u++}}function l(t,e,r){for(var n=t.tagName,i=null,o=t.length;o--;){var a=t[o],s=a.qName,u=a.value;if((p=s.indexOf(":"))>0)var l=a.prefix=s.slice(0,p),c=s.slice(p+1),f="xmlns"===l&&c;else c=s,l=null,f="xmlns"===s&&"";a.localName=c,!1!==f&&(null==i&&(i={},h(r,r={})),r[f]=i[f]=u,a.uri="http://www.w3.org/2000/xmlns/",e.startPrefixMapping(f,u))}for(o=t.length;o--;)(l=(a=t[o]).prefix)&&("xml"===l&&(a.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==l&&(a.uri=r[l||""]));var p;(p=n.indexOf(":"))>0?(l=t.prefix=n.slice(0,p),c=t.localName=n.slice(p+1)):(l=null,c=t.localName=n);var d=t.uri=r[l||""];if(e.startElement(d,c,n,t),!t.closed)return t.currentNSMap=r,t.localNSMap=i,!0;if(e.endElement(d,c,n),i)for(l in i)e.endPrefixMapping(l)}function c(t,e,r,n,i){if(/^(?:script|textarea)$/i.test(r)){var o=t.indexOf("</"+r+">",e),a=t.substring(e+1,o);if(/[&<]/.test(a))return/^script$/i.test(r)?(i.characters(a,0,a.length),o):(a=a.replace(/&#?\w+;/g,n),i.characters(a,0,a.length),o)}return e+1}function f(t,e,r,n){var i=n[r];return null==i&&((i=t.lastIndexOf("</"+r+">"))<e&&(i=t.lastIndexOf("</"+r)),n[r]=i),i<e}function h(t,e){for(var r in t)e[r]=t[r]}function p(t,e,r,n){if("-"===t.charAt(e+2))return"-"===t.charAt(e+3)?(i=t.indexOf("--\x3e",e+4))>e?(r.comment(t,e+4,i-e-4),i+3):(n.error("Unclosed comment"),-1):-1;if("CDATA["==t.substr(e+3,6)){var i=t.indexOf("]]>",e+9);return r.startCDATA(),r.characters(t,e+9,i-e-9),r.endCDATA(),i+3}var o=function(t,e){var r,n=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=e,i.exec(t);r=i.exec(t);)if(n.push(r),r[1])return n}(t,e),a=o.length;if(a>1&&/!doctype/i.test(o[0][0])){var s=o[1][0],u=!1,l=!1;a>3&&(/^public$/i.test(o[2][0])?(u=o[3][0],l=a>4&&o[4][0]):/^system$/i.test(o[2][0])&&(l=o[3][0]));var c=o[a-1];return r.startDTD(s,u,l),r.endDTD(),c.index+c[0].length}return-1}function d(t,e,r){var n=t.indexOf("?>",e);if(n){var i=t.substring(e,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return i?(i[0].length,r.processingInstruction(i[1],i[2]),n+2):-1}return-1}function y(){this.attributeNames={}}o.prototype=new Error,o.prototype.name=o.name,a.prototype={parse:function(t,e,r){var n=this.domBuilder;n.startDocument(),h(e,e={}),function(t,e,r,n,i){function a(t){var e=t.slice(1,-1);return e in r?r[e]:"#"===e.charAt(0)?function(t){if(t>65535){var e=55296+((t-=65536)>>10),r=56320+(1023&t);return String.fromCharCode(e,r)}return String.fromCharCode(t)}(parseInt(e.substr(1).replace("x","0x"))):(i.error("entity not found:"+t),t)}function h(e){if(e>S){var r=t.substring(S,e).replace(/&#?\w+;/g,a);_&&m(S),n.characters(r,0,e-S),S=e}}function m(e,r){for(;e>=g&&(r=b.exec(t));)v=r.index,g=v+r[0].length,_.lineNumber++;_.columnNumber=e-v+1}for(var v=0,g=0,b=/.*(?:\r\n?|\n)|.*$/g,_=n.locator,w=[{currentNSMap:e}],T={},S=0;;){try{var E=t.indexOf("<",S);if(E<0){if(!t.substr(S).match(/^\s*$/)){var O=n.doc,k=O.createTextNode(t.substr(S));O.appendChild(k),n.currentElement=k}return}switch(E>S&&h(E),t.charAt(E+1)){case"/":var C=t.indexOf(">",E+3),P=t.substring(E+2,C),x=w.pop();C<0?(P=t.substring(E+2).replace(/[\s<].*/,""),i.error("end tag name: "+P+" is not complete:"+x.tagName),C=E+1+P.length):P.match(/\s</)&&(P=P.replace(/[\s<].*/,""),i.error("end tag name: "+P+" maybe not complete"),C=E+1+P.length);var j=x.localNSMap,L=x.tagName==P;if(L||x.tagName&&x.tagName.toLowerCase()==P.toLowerCase()){if(n.endElement(x.uri,x.localName,P),j)for(var I in j)n.endPrefixMapping(I);L||i.fatalError("end tag name: "+P+" is not match the current start tagName:"+x.tagName)}else w.push(x);C++;break;case"?":_&&m(E),C=d(t,E,n);break;case"!":_&&m(E),C=p(t,E,n,i);break;default:_&&m(E);var A=new y,R=w[w.length-1].currentNSMap,D=(C=u(t,E,A,R,a,i),A.length);if(!A.closed&&f(t,C,A.tagName,T)&&(A.closed=!0,r.nbsp||i.warning("unclosed xml attribute")),_&&D){for(var M=s(_,{}),N=0;N<D;N++){var B=A[N];m(B.offset),B.locator=s(_,{})}n.locator=M,l(A,n,R)&&w.push(A),n.locator=_}else l(A,n,R)&&w.push(A);"http://www.w3.org/1999/xhtml"!==A.uri||A.closed?C++:C=c(t,C,A.tagName,a,n)}}catch(t){if(t instanceof o)throw t;i.error("element parse error: "+t),C=-1}C>S?S=C:h(Math.max(E,S)+1)}}(t,e,r,n,this.errorHandler),n.endDocument()}},y.prototype={setTagName:function(t){if(!i.test(t))throw new Error("invalid tagName:"+t);this.tagName=t},addValue:function(t,e,r){if(!i.test(t))throw new Error("invalid attribute:"+t);this.attributeNames[t]=this.length,this[this.length++]={qName:t,value:e,offset:r}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}},e.XMLReader=a,e.ParseError=o},58421:()=>{},448:t=>{function e(){return t.exports=e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},t.exports.__esModule=!0,t.exports.default=t.exports,e.apply(this,arguments)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Player:()=>Dj}),r(11602);var t=r(51562),e=r.n(t),i=r(3384),o=r.n(i);function a(){return a=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},a.apply(this,arguments)}function s(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(t,e){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},u(t,e)}function l(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,u(t,e)}var c=r(8004),f=r.n(c),h=r(19389),p=r.n(h),d=r(68942),y=r.n(d),m=r(83983),v=r.n(m);function g(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(g=function(){return!!t})()}var b=r(31336),_=r.n(b);const w=function(t,r){if(/^[a-z]+:/i.test(r))return r;/^data:/.test(t)&&(t=e().location&&e().location.href||"");var n="function"==typeof e().URL,i=/^\/\//.test(t),o=!e().location&&!/\/\//i.test(t);if(n?t=new(e().URL)(t,e().location||"http://example.com"):/\/\//i.test(t)||(t=_().buildAbsoluteURL(e().location&&e().location.href||"",t)),n){var a=new URL(r,t);return o?a.href.slice(18):i?a.href.slice(a.protocol.length):a.href}return _().buildAbsoluteURL(t,r)};var T=function(){function t(){this.listeners={}}var e=t.prototype;return e.on=function(t,e){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e)},e.off=function(t,e){if(!this.listeners[t])return!1;var r=this.listeners[t].indexOf(e);return this.listeners[t]=this.listeners[t].slice(0),this.listeners[t].splice(r,1),r>-1},e.trigger=function(t){var e=this.listeners[t];if(e)if(2===arguments.length)for(var r=e.length,n=0;n<r;++n)e[n].call(this,arguments[1]);else for(var i=Array.prototype.slice.call(arguments,1),o=e.length,a=0;a<o;++a)e[a].apply(this,i)},e.dispose=function(){this.listeners={}},e.pipe=function(t){this.on("data",(function(e){t.push(e)}))},t}();function S(t){for(var r=function(t){return e().atob?e().atob(t):Buffer.from(t,"base64").toString("binary")}(t),n=new Uint8Array(r.length),i=0;i<r.length;i++)n[i]=r.charCodeAt(i);return n}var E,O=function(t){function e(){var e;return(e=t.call(this)||this).buffer="",e}return l(e,t),e.prototype.push=function(t){var e;for(this.buffer+=t,e=this.buffer.indexOf("\n");e>-1;e=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,e)),this.buffer=this.buffer.substring(e+1)},e}(T),k=String.fromCharCode(9),C=function(t){var e=/([0-9.]*)?@?([0-9.]*)?/.exec(t||""),r={};return e[1]&&(r.length=parseInt(e[1],10)),e[2]&&(r.offset=parseInt(e[2],10)),r},P=function(t){for(var e,r=t.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),n={},i=r.length;i--;)""!==r[i]&&((e=/([^=]*)=(.*)/.exec(r[i]).slice(1))[0]=e[0].replace(/^\s+|\s+$/g,""),e[1]=e[1].replace(/^\s+|\s+$/g,""),e[1]=e[1].replace(/^['"](.*)['"]$/g,"$1"),n[e[0]]=e[1]);return n},x=function(t){function e(){var e;return(e=t.call(this)||this).customParsers=[],e.tagMappers=[],e}l(e,t);var r=e.prototype;return r.push=function(t){var e,r,n=this;0!==(t=t.trim()).length&&("#"===t[0]?this.tagMappers.reduce((function(e,r){var n=r(t);return n===t?e:e.concat([n])}),[t]).forEach((function(t){for(var i=0;i<n.customParsers.length;i++)if(n.customParsers[i].call(n,t))return;if(0===t.indexOf("#EXT"))if(t=t.replace("\r",""),e=/^#EXTM3U/.exec(t))n.trigger("data",{type:"tag",tagType:"m3u"});else{if(e=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(t))return r={type:"tag",tagType:"inf"},e[1]&&(r.duration=parseFloat(e[1])),e[2]&&(r.title=e[2]),void n.trigger("data",r);if(e=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(t))return r={type:"tag",tagType:"targetduration"},e[1]&&(r.duration=parseInt(e[1],10)),void n.trigger("data",r);if(e=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(t))return r={type:"tag",tagType:"version"},e[1]&&(r.version=parseInt(e[1],10)),void n.trigger("data",r);if(e=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(t))return r={type:"tag",tagType:"media-sequence"},e[1]&&(r.number=parseInt(e[1],10)),void n.trigger("data",r);if(e=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(t))return r={type:"tag",tagType:"discontinuity-sequence"},e[1]&&(r.number=parseInt(e[1],10)),void n.trigger("data",r);if(e=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(t))return r={type:"tag",tagType:"playlist-type"},e[1]&&(r.playlistType=e[1]),void n.trigger("data",r);if(e=/^#EXT-X-BYTERANGE:?(.*)?$/.exec(t))return r=a(C(e[1]),{type:"tag",tagType:"byterange"}),void n.trigger("data",r);if(e=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(t))return r={type:"tag",tagType:"allow-cache"},e[1]&&(r.allowed=!/NO/.test(e[1])),void n.trigger("data",r);if(e=/^#EXT-X-MAP:?(.*)$/.exec(t)){if(r={type:"tag",tagType:"map"},e[1]){var o=P(e[1]);o.URI&&(r.uri=o.URI),o.BYTERANGE&&(r.byterange=C(o.BYTERANGE))}n.trigger("data",r)}else if(e=/^#EXT-X-STREAM-INF:?(.*)$/.exec(t)){if(r={type:"tag",tagType:"stream-inf"},e[1]){if(r.attributes=P(e[1]),r.attributes.RESOLUTION){var s=r.attributes.RESOLUTION.split("x"),u={};s[0]&&(u.width=parseInt(s[0],10)),s[1]&&(u.height=parseInt(s[1],10)),r.attributes.RESOLUTION=u}r.attributes.BANDWIDTH&&(r.attributes.BANDWIDTH=parseInt(r.attributes.BANDWIDTH,10)),r.attributes["PROGRAM-ID"]&&(r.attributes["PROGRAM-ID"]=parseInt(r.attributes["PROGRAM-ID"],10))}n.trigger("data",r)}else{if(e=/^#EXT-X-MEDIA:?(.*)$/.exec(t))return r={type:"tag",tagType:"media"},e[1]&&(r.attributes=P(e[1])),void n.trigger("data",r);if(e=/^#EXT-X-ENDLIST/.exec(t))n.trigger("data",{type:"tag",tagType:"endlist"});else if(e=/^#EXT-X-DISCONTINUITY/.exec(t))n.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(e=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(t))return r={type:"tag",tagType:"program-date-time"},e[1]&&(r.dateTimeString=e[1],r.dateTimeObject=new Date(e[1])),void n.trigger("data",r);if(e=/^#EXT-X-KEY:?(.*)$/.exec(t))return r={type:"tag",tagType:"key"},e[1]&&(r.attributes=P(e[1]),r.attributes.IV&&("0x"===r.attributes.IV.substring(0,2).toLowerCase()&&(r.attributes.IV=r.attributes.IV.substring(2)),r.attributes.IV=r.attributes.IV.match(/.{8}/g),r.attributes.IV[0]=parseInt(r.attributes.IV[0],16),r.attributes.IV[1]=parseInt(r.attributes.IV[1],16),r.attributes.IV[2]=parseInt(r.attributes.IV[2],16),r.attributes.IV[3]=parseInt(r.attributes.IV[3],16),r.attributes.IV=new Uint32Array(r.attributes.IV))),void n.trigger("data",r);if(e=/^#EXT-X-START:?(.*)$/.exec(t))return r={type:"tag",tagType:"start"},e[1]&&(r.attributes=P(e[1]),r.attributes["TIME-OFFSET"]=parseFloat(r.attributes["TIME-OFFSET"]),r.attributes.PRECISE=/YES/.test(r.attributes.PRECISE)),void n.trigger("data",r);if(e=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(t))return r={type:"tag",tagType:"cue-out-cont"},e[1]?r.data=e[1]:r.data="",void n.trigger("data",r);if(e=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(t))return r={type:"tag",tagType:"cue-out"},e[1]?r.data=e[1]:r.data="",void n.trigger("data",r);if(e=/^#EXT-X-CUE-IN:?(.*)?$/.exec(t))return r={type:"tag",tagType:"cue-in"},e[1]?r.data=e[1]:r.data="",void n.trigger("data",r);if((e=/^#EXT-X-SKIP:(.*)$/.exec(t))&&e[1])return(r={type:"tag",tagType:"skip"}).attributes=P(e[1]),r.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(r.attributes["SKIPPED-SEGMENTS"]=parseInt(r.attributes["SKIPPED-SEGMENTS"],10)),r.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(r.attributes["RECENTLY-REMOVED-DATERANGES"]=r.attributes["RECENTLY-REMOVED-DATERANGES"].split(k)),void n.trigger("data",r);if((e=/^#EXT-X-PART:(.*)$/.exec(t))&&e[1])return(r={type:"tag",tagType:"part"}).attributes=P(e[1]),["DURATION"].forEach((function(t){r.attributes.hasOwnProperty(t)&&(r.attributes[t]=parseFloat(r.attributes[t]))})),["INDEPENDENT","GAP"].forEach((function(t){r.attributes.hasOwnProperty(t)&&(r.attributes[t]=/YES/.test(r.attributes[t]))})),r.attributes.hasOwnProperty("BYTERANGE")&&(r.attributes.byterange=C(r.attributes.BYTERANGE)),void n.trigger("data",r);if((e=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(t))&&e[1])return(r={type:"tag",tagType:"server-control"}).attributes=P(e[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach((function(t){r.attributes.hasOwnProperty(t)&&(r.attributes[t]=parseFloat(r.attributes[t]))})),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach((function(t){r.attributes.hasOwnProperty(t)&&(r.attributes[t]=/YES/.test(r.attributes[t]))})),void n.trigger("data",r);if((e=/^#EXT-X-PART-INF:(.*)$/.exec(t))&&e[1])return(r={type:"tag",tagType:"part-inf"}).attributes=P(e[1]),["PART-TARGET"].forEach((function(t){r.attributes.hasOwnProperty(t)&&(r.attributes[t]=parseFloat(r.attributes[t]))})),void n.trigger("data",r);if((e=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(t))&&e[1])return(r={type:"tag",tagType:"preload-hint"}).attributes=P(e[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach((function(t){if(r.attributes.hasOwnProperty(t)){r.attributes[t]=parseInt(r.attributes[t],10);var e="BYTERANGE-LENGTH"===t?"length":"offset";r.attributes.byterange=r.attributes.byterange||{},r.attributes.byterange[e]=r.attributes[t],delete r.attributes[t]}})),void n.trigger("data",r);if((e=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(t))&&e[1])return(r={type:"tag",tagType:"rendition-report"}).attributes=P(e[1]),["LAST-MSN","LAST-PART"].forEach((function(t){r.attributes.hasOwnProperty(t)&&(r.attributes[t]=parseInt(r.attributes[t],10))})),void n.trigger("data",r);n.trigger("data",{type:"tag",data:t.slice(4)})}}}else n.trigger("data",{type:"comment",text:t.slice(1)})})):this.trigger("data",{type:"uri",uri:t}))},r.addParser=function(t){var e=this,r=t.expression,n=t.customType,i=t.dataParser,o=t.segment;"function"!=typeof i&&(i=function(t){return t}),this.customParsers.push((function(t){if(r.exec(t))return e.trigger("data",{type:"custom",data:i(t),customType:n,segment:o}),!0}))},r.addTagMapper=function(t){var e=t.expression,r=t.map;this.tagMappers.push((function(t){return e.test(t)?r(t):t}))},e}(T),j=function(t){var e={};return Object.keys(t).forEach((function(r){var n;e[(n=r,n.toLowerCase().replace(/-(\w)/g,(function(t){return t[1].toUpperCase()})))]=t[r]})),e},L=function(t){var e=t.serverControl,r=t.targetDuration,n=t.partTargetDuration;if(e){var i="#EXT-X-SERVER-CONTROL",o="holdBack",a="partHoldBack",s=r&&3*r,u=n&&2*n;r&&!e.hasOwnProperty(o)&&(e[o]=s,this.trigger("info",{message:i+" defaulting HOLD-BACK to targetDuration * 3 ("+s+")."})),s&&e[o]<s&&(this.trigger("warn",{message:i+" clamping HOLD-BACK ("+e[o]+") to targetDuration * 3 ("+s+")"}),e[o]=s),n&&!e.hasOwnProperty(a)&&(e[a]=3*n,this.trigger("info",{message:i+" defaulting PART-HOLD-BACK to partTargetDuration * 3 ("+e[a]+")."})),n&&e[a]<u&&(this.trigger("warn",{message:i+" clamping PART-HOLD-BACK ("+e[a]+") to partTargetDuration * 2 ("+u+")."}),e[a]=u)}},I=function(t){function e(){var e;(e=t.call(this)||this).lineStream=new O,e.parseStream=new x,e.lineStream.pipe(e.parseStream);var r,n,i=s(e),o=[],u={},l=!1,c=function(){},f={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},h=0;e.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};var p=0,d=0;return e.on("end",(function(){u.uri||!u.parts&&!u.preloadHints||(!u.map&&r&&(u.map=r),!u.key&&n&&(u.key=n),u.timeline||"number"!=typeof h||(u.timeline=h),e.manifest.preloadSegment=u)})),e.parseStream.on("data",(function(t){var e,s;({tag:function(){({version:function(){t.version&&(this.manifest.version=t.version)},"allow-cache":function(){this.manifest.allowCache=t.allowed,"allowed"in t||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var e={};"length"in t&&(u.byterange=e,e.length=t.length,"offset"in t||(t.offset=p)),"offset"in t&&(u.byterange=e,e.offset=t.offset),p=e.offset+e.length},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"})),t.duration>0&&(u.duration=t.duration),0===t.duration&&(u.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=o},key:function(){if(t.attributes)if("NONE"!==t.attributes.METHOD)if(t.attributes.URI){if("com.apple.streamingkeydelivery"===t.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:t.attributes});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===t.attributes.KEYFORMAT)return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(t.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===t.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==t.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):t.attributes.KEYID&&"0x"===t.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:t.attributes.KEYFORMAT,keyId:t.attributes.KEYID.substring(2)},pssh:S(t.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));t.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),n={method:t.attributes.METHOD||"AES-128",uri:t.attributes.URI},void 0!==t.attributes.IV&&(n.iv=t.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":function(){isFinite(t.number)?this.manifest.mediaSequence=t.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+t.number})},"discontinuity-sequence":function(){isFinite(t.number)?(this.manifest.discontinuitySequence=t.number,h=t.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+t.number})},"playlist-type":function(){/VOD|EVENT/.test(t.playlistType)?this.manifest.playlistType=t.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+t.playlist})},map:function(){r={},t.uri&&(r.uri=t.uri),t.byterange&&(r.byterange=t.byterange),n&&(r.key=n)},"stream-inf":function(){this.manifest.playlists=o,this.manifest.mediaGroups=this.manifest.mediaGroups||f,t.attributes?(u.attributes||(u.attributes={}),a(u.attributes,t.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||f,t.attributes&&t.attributes.TYPE&&t.attributes["GROUP-ID"]&&t.attributes.NAME){var r=this.manifest.mediaGroups[t.attributes.TYPE];r[t.attributes["GROUP-ID"]]=r[t.attributes["GROUP-ID"]]||{},e=r[t.attributes["GROUP-ID"]],(s={default:/yes/i.test(t.attributes.DEFAULT)}).default?s.autoselect=!0:s.autoselect=/yes/i.test(t.attributes.AUTOSELECT),t.attributes.LANGUAGE&&(s.language=t.attributes.LANGUAGE),t.attributes.URI&&(s.uri=t.attributes.URI),t.attributes["INSTREAM-ID"]&&(s.instreamId=t.attributes["INSTREAM-ID"]),t.attributes.CHARACTERISTICS&&(s.characteristics=t.attributes.CHARACTERISTICS),t.attributes.FORCED&&(s.forced=/yes/i.test(t.attributes.FORCED)),e[t.attributes.NAME]=s}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){h+=1,u.discontinuity=!0,this.manifest.discontinuityStarts.push(o.length)},"program-date-time":function(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=t.dateTimeString,this.manifest.dateTimeObject=t.dateTimeObject),u.dateTimeString=t.dateTimeString,u.dateTimeObject=t.dateTimeObject},targetduration:function(){!isFinite(t.duration)||t.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+t.duration}):(this.manifest.targetDuration=t.duration,L.call(this,this.manifest))},start:function(){t.attributes&&!isNaN(t.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:t.attributes["TIME-OFFSET"],precise:t.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){u.cueOut=t.data},"cue-out-cont":function(){u.cueOutCont=t.data},"cue-in":function(){u.cueIn=t.data},skip:function(){this.manifest.skip=j(t.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",t.attributes,["SKIPPED-SEGMENTS"])},part:function(){var e=this;l=!0;var r=this.manifest.segments.length,n=j(t.attributes);u.parts=u.parts||[],u.parts.push(n),n.byterange&&(n.byterange.hasOwnProperty("offset")||(n.byterange.offset=d),d=n.byterange.offset+n.byterange.length);var i=u.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+i+" for segment #"+r,t.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((function(t,r){t.hasOwnProperty("lastPart")||e.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+r+" lacks required attribute(s): LAST-PART"})}))},"server-control":function(){var e=this.manifest.serverControl=j(t.attributes);e.hasOwnProperty("canBlockReload")||(e.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),L.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":function(){var e=this.manifest.segments.length,r=j(t.attributes),n=r.type&&"PART"===r.type;u.preloadHints=u.preloadHints||[],u.preloadHints.push(r),r.byterange&&(r.byterange.hasOwnProperty("offset")||(r.byterange.offset=n?d:0,n&&(d=r.byterange.offset+r.byterange.length)));var i=u.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+i+" for segment #"+e,t.attributes,["TYPE","URI"]),r.type)for(var o=0;o<u.preloadHints.length-1;o++){var a=u.preloadHints[o];a.type&&a.type===r.type&&this.trigger("warn",{message:"#EXT-X-PRELOAD-HINT #"+i+" for segment #"+e+" has the same TYPE "+r.type+" as preload hint #"+o})}},"rendition-report":function(){var e=j(t.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(e);var r=this.manifest.renditionReports.length-1,n=["LAST-MSN","URI"];l&&n.push("LAST-PART"),this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #"+r,t.attributes,n)},"part-inf":function(){this.manifest.partInf=j(t.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",t.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),L.call(this,this.manifest)}}[t.tagType]||c).call(i)},uri:function(){u.uri=t.uri,o.push(u),this.manifest.targetDuration&&!("duration"in u)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),u.duration=this.manifest.targetDuration),n&&(u.key=n),u.timeline=h,r&&(u.map=r),d=0,u={}},comment:function(){},custom:function(){t.segment?(u.custom=u.custom||{},u.custom[t.customType]=t.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[t.customType]=t.data)}})[t.type].call(i)})),e}l(e,t);var r=e.prototype;return r.warnOnMissingAttributes_=function(t,e,r){var n=[];r.forEach((function(t){e.hasOwnProperty(t)||n.push(t)})),n.length&&this.trigger("warn",{message:t+" lacks required attribute(s): "+n.join(", ")})},r.push=function(t){this.lineStream.push(t)},r.end=function(){this.lineStream.push("\n"),this.trigger("end")},r.addParser=function(t){this.parseStream.addParser(t)},r.addTagMapper=function(t){this.parseStream.addTagMapper(t)},e}(T),A={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^/},R=["video","audio","text"],D=["Video","Audio","Text"],M=function(t){return t?t.replace(/avc1\.(\d+)\.(\d+)/i,(function(t,e,r){return"avc1."+("00"+Number(e).toString(16)).slice(-2)+"00"+("00"+Number(r).toString(16)).slice(-2)})):t},N=function(t){void 0===t&&(t="");var e=t.split(","),r=[];return e.forEach((function(t){var e;t=t.trim(),R.forEach((function(n){var i=A[n].exec(t.toLowerCase());if(i&&!(i.length<=1)){e=n;var o=t.substring(0,i[1].length),a=t.replace(o,"");r.push({type:o,details:a,mediaType:n})}})),e||r.push({type:t,details:"",mediaType:"unknown"})})),r},B=function(t){return void 0===t&&(t=""),A.audio.test(t.trim().toLowerCase())},U=function(t){if(t&&"string"==typeof t){var e,r=t.toLowerCase().split(",").map((function(t){return M(t.trim())})),n="video";1===r.length&&B(r[0])?n="audio":1===r.length&&(void 0===(e=r[0])&&(e=""),A.text.test(e.trim().toLowerCase()))&&(n="application");var i="mp4";return r.every((function(t){return A.mp4.test(t)}))?i="mp4":r.every((function(t){return A.webm.test(t)}))?i="webm":r.every((function(t){return A.ogg.test(t)}))&&(i="ogg"),n+"/"+i+';codecs="'+t+'"'}},F=function(t){return void 0===t&&(t=""),e().MediaSource&&e().MediaSource.isTypeSupported&&e().MediaSource.isTypeSupported(U(t))||!1},V=function(t){return void 0===t&&(t=""),t.toLowerCase().split(",").every((function(t){t=t.trim();for(var e=0;e<D.length;e++)if(A["muxer"+D[e]].test(t))return!0;return!1}))},H="mp4a.40.2",q=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,z=/^application\/dash\+xml/i,W=function(t){return q.test(t)?"hls":z.test(t)?"dash":"application/vnd.videojs.vhs+json"===t?"vhs-json":null},G=r(73668),X=function(t){return!!t&&"object"==typeof t},K=function t(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return r.reduce((function(e,r){return"object"!=typeof r||Object.keys(r).forEach((function(n){Array.isArray(e[n])&&Array.isArray(r[n])?e[n]=e[n].concat(r[n]):X(e[n])&&X(r[n])?e[n]=t(e[n],r[n]):e[n]=r[n]})),e}),{})},Y=function(t){return t.reduce((function(t,e){return t.concat(e)}),[])},Q=function(t){if(!t.length)return[];for(var e=[],r=0;r<t.length;r++)e.push(t[r]);return e},$=function(t){var e=t.baseUrl,r=void 0===e?"":e,n=t.source,i=void 0===n?"":n,o=t.range,a=void 0===o?"":o,s=t.indexRange,u=void 0===s?"":s,l={uri:i,resolvedUri:w(r||"",i)};if(a||u){var c=(a||u).split("-"),f=parseInt(c[0],10),h=parseInt(c[1],10);l.byterange={length:h-f+1,offset:f}}return l},J=function(t){return t&&"number"!=typeof t&&(t=parseInt(t,10)),isNaN(t)?null:t},Z={static:function(t){var e=t.duration,r=t.timescale,n=void 0===r?1:r,i=t.sourceDuration,o=J(t.endNumber);return{start:0,end:"number"==typeof o?o:Math.ceil(i/(e/n))}},dynamic:function(t){var e=t.NOW,r=t.clientOffset,n=t.availabilityStartTime,i=t.timescale,o=void 0===i?1:i,a=t.duration,s=t.start,u=void 0===s?0:s,l=t.minimumUpdatePeriod,c=void 0===l?0:l,f=t.timeShiftBufferDepth,h=void 0===f?1/0:f,p=J(t.endNumber),d=(e+r)/1e3,y=n+u,m=d+c-y,v=Math.ceil(m*o/a),g=Math.floor((d-y-h)*o/a),b=Math.floor((d-y)*o/a);return{start:Math.max(0,g),end:"number"==typeof p?p:Math.min(v,b)}}},tt=function(t){var e=t.type,r=void 0===e?"static":e,n=t.duration,i=t.timescale,o=void 0===i?1:i,a=t.sourceDuration,s=Z[r](t),u=function(t,e){for(var r=[],n=t;n<e;n++)r.push(n);return r}(s.start,s.end).map(function(t){return function(e,r){var n=t.duration,i=t.timescale,o=void 0===i?1:i,a=t.periodIndex,s=t.startNumber;return{number:(void 0===s?1:s)+e,duration:n/o,timeline:a,time:r*n}}}(t));if("static"===r){var l=u.length-1;u[l].duration=a-n/o*l}return u},et=function(t){var e=t.baseUrl,r=t.initialization,n=void 0===r?{}:r,i=t.sourceDuration,o=t.indexRange,a=void 0===o?"":o,s=t.duration;if(!e)throw new Error("NO_BASE_URL");var u=$({baseUrl:e,source:n.sourceURL,range:n.range}),l=$({baseUrl:e,source:e,indexRange:a});if(l.map=u,s){var c=tt(t);c.length&&(l.duration=c[0].duration,l.timeline=c[0].timeline)}else i&&(l.duration=i,l.timeline=0);return l.number=0,[l]},rt=function(t,e,r){for(var n=t.sidx.map?t.sidx.map:null,i=t.sidx.duration,o=t.timeline||0,a=t.sidx.byterange,s=a.offset+a.length,u=e.timescale,l=e.references.filter((function(t){return 1!==t.referenceType})),c=[],f=s+e.firstOffset,h=0;h<l.length;h++){var p=e.references[h],d=p.referencedSize,y=p.subsegmentDuration,m=et({baseUrl:r,timescale:u,timeline:o,periodIndex:o,duration:y,sourceDuration:i,indexRange:f+"-"+(f+d-1)})[0];n&&(m.map=n),c.push(m),f+=d}return t.segments=c,t},nt=function(t){return t&&t.uri+"-"+(r=(e=t.byterange).offset+e.length-1,e.offset+"-"+r);var e,r},it=function(t){var e=function(t){return Object.keys(t).map((function(e){return t[e]}))}(t.reduce((function(t,e){var r,n=e.attributes.id+(e.attributes.lang||"");return t[n]?(e.segments[0]&&(e.segments[0].discontinuity=!0),(r=t[n].segments).push.apply(r,e.segments),e.attributes.contentProtection&&(t[n].attributes.contentProtection=e.attributes.contentProtection)):t[n]=e,t}),{}));return e.map((function(t){var e;return t.discontinuityStarts=(e=t.segments,"discontinuity",e.reduce((function(t,e,r){return e.discontinuity&&t.push(r),t}),[])),t}))},ot=function(t,e){var r=nt(t.sidx),n=r&&e[r]&&e[r].sidx;return n&&rt(t,n,t.sidx.resolvedUri),t},at=function(t,e){if(void 0===e&&(e={}),!Object.keys(e).length)return t;for(var r in t)t[r]=ot(t[r],e);return t},st=function(t){var e,r=t.attributes,n=t.segments,i=t.sidx,o={attributes:(e={NAME:r.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:r.width,height:r.height},CODECS:r.codecs,BANDWIDTH:r.bandwidth},e["PROGRAM-ID"]=1,e),uri:"",endList:"static"===(r.type||"static"),timeline:r.periodIndex,resolvedUri:"",targetDuration:r.duration,segments:n,mediaSequence:n.length?n[0].number:1};return r.contentProtection&&(o.contentProtection=r.contentProtection),i&&(o.sidx=i),o},ut=function(t){var e=t.attributes;return"video/mp4"===e.mimeType||"video/webm"===e.mimeType||"video"===e.contentType},lt=function(t){var e=t.attributes;return"audio/mp4"===e.mimeType||"audio/webm"===e.mimeType||"audio"===e.contentType},ct=function(t){var e=t.attributes;return"text/vtt"===e.mimeType||"text"===e.contentType},ft=function(t,e,r){var n=t.NOW,i=t.clientOffset,o=t.availabilityStartTime,a=t.timescale,s=void 0===a?1:a,u=t.start,l=void 0===u?0:u,c=t.minimumUpdatePeriod,f=(n+i)/1e3+(void 0===c?0:c)-(o+l);return Math.ceil((f*s-e)/r)},ht=function(t,e){for(var r=t.type,n=void 0===r?"static":r,i=t.minimumUpdatePeriod,o=void 0===i?0:i,a=t.media,s=void 0===a?"":a,u=t.sourceDuration,l=t.timescale,c=void 0===l?1:l,f=t.startNumber,h=void 0===f?1:f,p=t.periodIndex,d=[],y=-1,m=0;m<e.length;m++){var v=e[m],g=v.d,b=v.r||0,_=v.t||0;y<0&&(y=_),_&&_>y&&(y=_);var w=void 0;if(b<0){var T=m+1;w=T===e.length?"dynamic"===n&&o>0&&s.indexOf("$Number$")>0?ft(t,y,g):(u*c-y)/g:(e[T].t-y)/g}else w=b+1;for(var S=h+d.length+w,E=h+d.length;E<S;)d.push({number:E,duration:g/c,time:y,timeline:p}),y+=g,E++}return d},pt=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,dt=function(t,e){return t.replace(pt,function(t){return function(e,r,n,i){if("$$"===e)return"$";if(void 0===t[r])return e;var o=""+t[r];return"RepresentationID"===r?o:(i=n?parseInt(i,10):1,o.length>=i?o:""+new Array(i-o.length+1).join("0")+o)}}(e))},yt=function(t,e){var r={RepresentationID:t.id,Bandwidth:t.bandwidth||0},n=t.initialization,i=void 0===n?{sourceURL:"",range:""}:n,o=$({baseUrl:t.baseUrl,source:dt(i.sourceURL,r),range:i.range}),a=function(t,e){return t.duration||e?t.duration?tt(t):ht(t,e):[{number:t.startNumber||1,duration:t.sourceDuration,time:0,timeline:t.periodIndex}]}(t,e);return a.map((function(e){r.Number=e.number,r.Time=e.time;var n=dt(t.media||"",r),i={uri:n,timeline:e.timeline,duration:e.duration,resolvedUri:w(t.baseUrl||"",n),map:o,number:e.number};return t.presentationTimeOffset&&(i.presentationTimeOffset=t.presentationTimeOffset),i}))},mt=function(t,e){var r=t.duration,n=t.segmentUrls,i=void 0===n?[]:n;if(!r&&!e||r&&e)throw new Error("SEGMENT_TIME_UNSPECIFIED");var o,a=i.map((function(e){return function(t,e){var r=t.baseUrl,n=t.initialization,i=void 0===n?{}:n,o=$({baseUrl:r,source:i.sourceURL,range:i.range}),a=$({baseUrl:r,source:e.media,range:e.mediaRange});return a.map=o,a}(t,e)}));return r&&(o=tt(t)),e&&(o=ht(t,e)),o.map((function(t,e){if(a[e]){var r=a[e];return r.timeline=t.timeline,r.duration=t.duration,r.number=t.number,r}})).filter((function(t){return t}))},vt=function(t){var e,r,n=t.attributes,i=t.segmentInfo;i.template?(r=yt,e=K(n,i.template),i.template.presentationTimeOffset&&(e.presentationTimeOffset=i.template.presentationTimeOffset/i.template.timescale)):i.base?(r=et,e=K(n,i.base)):i.list&&(r=mt,e=K(n,i.list));var o={attributes:n};if(!r)return o;var a=r(e,i.timeline);if(e.duration){var s=e,u=s.duration,l=s.timescale,c=void 0===l?1:l;e.duration=u/c}else a.length?e.duration=a.reduce((function(t,e){return Math.max(t,Math.ceil(e.duration))}),0):e.duration=0;return o.attributes=e,o.segments=a,i.base&&e.indexRange&&(o.sidx=a[0],o.segments=[]),o},gt=function(t,e){return Q(t.childNodes).filter((function(t){return t.tagName===e}))},bt=function(t){return t.textContent.trim()},_t=function(t){var e=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(t);if(!e)return 0;var r=e.slice(1),n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],u=r[5];return 31536e3*parseFloat(n||0)+2592e3*parseFloat(i||0)+86400*parseFloat(o||0)+3600*parseFloat(a||0)+60*parseFloat(s||0)+parseFloat(u||0)},wt={mediaPresentationDuration:function(t){return _t(t)},availabilityStartTime:function(t){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e=t)&&(e+="Z"),Date.parse(e)/1e3;var e},minimumUpdatePeriod:function(t){return _t(t)},suggestedPresentationDelay:function(t){return _t(t)},type:function(t){return t},timeShiftBufferDepth:function(t){return _t(t)},start:function(t){return _t(t)},width:function(t){return parseInt(t,10)},height:function(t){return parseInt(t,10)},bandwidth:function(t){return parseInt(t,10)},startNumber:function(t){return parseInt(t,10)},timescale:function(t){return parseInt(t,10)},presentationTimeOffset:function(t){return parseInt(t,10)},duration:function(t){var e=parseInt(t,10);return isNaN(e)?_t(t):e},d:function(t){return parseInt(t,10)},t:function(t){return parseInt(t,10)},r:function(t){return parseInt(t,10)},DEFAULT:function(t){return t}},Tt=function(t){return t&&t.attributes?Q(t.attributes).reduce((function(t,e){var r=wt[e.name]||wt.DEFAULT;return t[e.name]=r(e.value),t}),{}):{}},St={"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"},Et=function(t,e){return e.length?Y(t.map((function(t){return e.map((function(e){return w(t,bt(e))}))}))):t},Ot=function(t){var e=gt(t,"SegmentTemplate")[0],r=gt(t,"SegmentList")[0],n=r&&gt(r,"SegmentURL").map((function(t){return K({tag:"SegmentURL"},Tt(t))})),i=gt(t,"SegmentBase")[0],o=r||e,a=o&&gt(o,"SegmentTimeline")[0],s=r||i||e,u=s&&gt(s,"Initialization")[0],l=e&&Tt(e);l&&u?l.initialization=u&&Tt(u):l&&l.initialization&&(l.initialization={sourceURL:l.initialization});var c={template:l,timeline:a&&gt(a,"S").map((function(t){return Tt(t)})),list:r&&K(Tt(r),{segmentUrls:n,initialization:Tt(u)}),base:i&&K(Tt(i),{initialization:Tt(u)})};return Object.keys(c).forEach((function(t){c[t]||delete c[t]})),c},kt=function(t,r){return function(n,i){var o=Et(r,gt(n,"BaseURL")),a=Tt(n),s=parseInt(a.id,10),u=e().isNaN(s)?i:s,l=K(t,{periodIndex:u}),c=gt(n,"AdaptationSet"),f=Ot(n);return Y(c.map(function(t,e,r){return function(n){var i=Tt(n),o=Et(e,gt(n,"BaseURL")),a=gt(n,"Role")[0],s={role:Tt(a)},u=K(t,i,s),l=gt(n,"Label")[0];if(l&&l.childNodes.length){var c=l.childNodes[0].nodeValue.trim();u=K(u,{label:c})}var f=gt(n,"ContentProtection").reduce((function(t,e){var r=Tt(e),n=St[r.schemeIdUri];if(n){t[n]={attributes:r};var i=gt(e,"cenc:pssh")[0];if(i){var o=bt(i),a=o&&S(o);t[n].pssh=a}}return t}),{});Object.keys(f).length&&(u=K(u,{contentProtection:f}));var h=Ot(n),p=gt(n,"Representation"),d=K(r,h);return Y(p.map(function(t,e,r){return function(n){var i=gt(n,"BaseURL"),o=Et(e,i),a=K(t,Tt(n)),s=Ot(n);return o.map((function(t){return{segmentInfo:K(r,s),attributes:K(a,{baseUrl:t})}}))}}(u,o,d)))}}(l,o,f)))}},Ct=function(t){if(""===t)throw new Error("DASH_EMPTY_MANIFEST");var e,r,n=new G.a;try{r=(e=n.parseFromString(t,"application/xml"))&&"MPD"===e.documentElement.tagName?e.documentElement:null}catch(t){}if(!r||r&&r.getElementsByTagName("parsererror").length>0)throw new Error("DASH_INVALID_XML");return r},Pt=function(t,e){void 0===e&&(e={});var r=function(t,e){void 0===e&&(e={});var r=e,n=r.manifestUri,i=void 0===n?"":n,o=r.NOW,a=void 0===o?Date.now():o,s=r.clientOffset,u=void 0===s?0:s,l=gt(t,"Period");if(!l.length)throw new Error("INVALID_NUMBER_OF_PERIOD");var c=gt(t,"Location"),f=Tt(t),h=Et([i],gt(t,"BaseURL"));return f.sourceDuration=f.mediaPresentationDuration||0,f.NOW=a,f.clientOffset=u,c.length&&(f.locations=c.map(bt)),{locations:f.locations,representationInfo:Y(l.map(kt(f,h)))}}(Ct(t),e);return function(t,e,r){var n;if(void 0===r&&(r={}),!t.length)return{};var i=t[0].attributes,o=i.sourceDuration,a=i.type,s=void 0===a?"static":a,u=i.suggestedPresentationDelay,l=i.minimumUpdatePeriod,c=it(t.filter(ut)).map(st),f=it(t.filter(lt)),h=t.filter(ct),p={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(n={AUDIO:{},VIDEO:{}},n["CLOSED-CAPTIONS"]={},n.SUBTITLES={},n),uri:"",duration:o,playlists:at(c,r)};l>=0&&(p.minimumUpdatePeriod=1e3*l),e&&(p.locations=e),"dynamic"===s&&(p.suggestedPresentationDelay=u);var d=0===p.playlists.length;return f.length&&(p.mediaGroups.AUDIO.audio=function(t,e,r){var n;void 0===e&&(e={}),void 0===r&&(r=!1);var i=t.reduce((function(t,i){var o=i.attributes.role&&i.attributes.role.value||"",a=i.attributes.lang||"",s=i.attributes.label||"main";if(a&&!i.attributes.label){var u=o?" ("+o+")":"";s=""+i.attributes.lang+u}t[s]||(t[s]={language:a,autoselect:!0,default:"main"===o,playlists:[],uri:""});var l=ot(function(t,e){var r,n=t.attributes,i=t.segments,o=t.sidx,a={attributes:(r={NAME:n.id,BANDWIDTH:n.bandwidth,CODECS:n.codecs},r["PROGRAM-ID"]=1,r),uri:"",endList:"static"===(n.type||"static"),timeline:n.periodIndex,resolvedUri:"",targetDuration:n.duration,segments:i,mediaSequence:i.length?i[0].number:1};return n.contentProtection&&(a.contentProtection=n.contentProtection),o&&(a.sidx=o),e&&(a.attributes.AUDIO="audio",a.attributes.SUBTITLES="subs"),a}(i,r),e);return t[s].playlists.push(l),void 0===n&&"main"===o&&((n=i).default=!0),t}),{});return n||(i[Object.keys(i)[0]].default=!0),i}(f,r,d)),h.length&&(p.mediaGroups.SUBTITLES.subs=function(t,e){return void 0===e&&(e={}),t.reduce((function(t,r){var n=r.attributes.lang||"text";return t[n]||(t[n]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),t[n].playlists.push(ot(function(t){var e,r=t.attributes,n=t.segments;void 0===n&&(n=[{uri:r.baseUrl,timeline:r.periodIndex,resolvedUri:r.baseUrl||"",duration:r.sourceDuration,number:0}],r.duration=r.sourceDuration);var i=((e={NAME:r.id,BANDWIDTH:r.bandwidth})["PROGRAM-ID"]=1,e);return r.codecs&&(i.CODECS=r.codecs),{attributes:i,uri:"",endList:"static"===(r.type||"static"),timeline:r.periodIndex,resolvedUri:r.baseUrl||"",targetDuration:r.duration,segments:n,mediaSequence:n.length?n[0].number:1}}(r),e)),t}),{})}(h,r)),p}(r.representationInfo.map(vt),r.locations,e.sidxMapping)},xt=r(57258),jt=r.n(xt),Lt=function(t){return t instanceof Uint8Array?t:(Array.isArray(t)||function(t){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer}(t)||t instanceof ArrayBuffer||(t="number"!=typeof t||"number"==typeof t&&t!=t?0:[t]),new Uint8Array(t&&t.buffer||t,t&&t.byteOffset||0,t&&t.byteLength||0))},It=e().BigInt||Number,At=[It("0x1"),It("0x100"),It("0x10000"),It("0x1000000"),It("0x100000000"),It("0x10000000000"),It("0x1000000000000"),It("0x100000000000000"),It("0x10000000000000000")],Rt=(function(){var t=new Uint16Array([65484]),e=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);255===e[0]||e[0]}(),function(t,e){var r=void 0===e?{}:e,n=r.signed,i=void 0!==n&&n,o=r.le,a=void 0!==o&&o;t=Lt(t);var s=a?"reduce":"reduceRight",u=(t[s]?t[s]:Array.prototype[s]).call(t,(function(e,r,n){var i=a?n:Math.abs(n+1-t.length);return e+It(r)*At[i]}),It(0));if(i){var l=At[t.length]/It(2)-It(1);(u=It(u))>l&&(u-=l,u-=l,u-=It(2))}return Number(u)}),Dt=function(t,e){if("string"!=typeof t&&t&&"function"==typeof t.toString&&(t=t.toString()),"string"!=typeof t)return new Uint8Array;e||(t=unescape(encodeURIComponent(t)));for(var r=new Uint8Array(t.length),n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r},Mt=function(t,e,r){var n=void 0===r?{}:r,i=n.offset,o=void 0===i?0:i,a=n.mask,s=void 0===a?[]:a;t=Lt(t);var u=(e=Lt(e)).every?e.every:Array.prototype.every;return e.length&&t.length-o>=e.length&&u.call(e,(function(e,r){return e===(s[r]?s[r]&t[o+r]:t[o+r])}))},Nt=Lt([73,68,51]),Bt=function t(e,r){return void 0===r&&(r=0),(e=Lt(e)).length-r<10||!Mt(e,Nt,{offset:r})?r:(r+=function(t,e){void 0===e&&(e=0);var r=(t=Lt(t))[e+5],n=t[e+6]<<21|t[e+7]<<14|t[e+8]<<7|t[e+9];return(16&r)>>4?n+20:n+10}(e,r),t(e,r))},Ut=(new Uint8Array([79,112,117,115,72,101,97,100]),function(t){return"string"==typeof t?Dt(t):t}),Ft=function(t){t=Lt(t);for(var e=[],r=0;t.length>r;){var n=t[r],i=0,o=0,a=t[++o];for(o++;128&a;)i=(127&a)<<7,a=t[o],o++;i+=127&a;for(var s=0;s<E.length;s++){var u=E[s],l=u.id,c=u.parser;if(n===l){e.push(c(t.subarray(o,o+i)));break}}r+=i+o}return e};E=[{id:3,parser:function(t){var e={tag:3,id:t[0]<<8|t[1],flags:t[2],size:3,dependsOnEsId:0,ocrEsId:0,descriptors:[],url:""};if(128&e.flags&&(e.dependsOnEsId=t[e.size]<<8|t[e.size+1],e.size+=2),64&e.flags){var r=t[e.size];e.url=function(t){if(!t)return"";t=Array.prototype.slice.call(t);var e=String.fromCharCode.apply(null,Lt(t));try{return decodeURIComponent(escape(e))}catch(t){}return e}(t.subarray(e.size+1,e.size+1+r)),e.size+=r}return 32&e.flags&&(e.ocrEsId=t[e.size]<<8|t[e.size+1],e.size+=2),e.descriptors=Ft(t.subarray(e.size))||[],e}},{id:4,parser:function(t){return{tag:4,oti:t[0],streamType:t[1],bufferSize:t[2]<<16|t[3]<<8|t[4],maxBitrate:t[5]<<24|t[6]<<16|t[7]<<8|t[8],avgBitrate:t[9]<<24|t[10]<<16|t[11]<<8|t[12],descriptors:Ft(t.subarray(13))}}},{id:5,parser:function(t){return{tag:5,bytes:t}}},{id:6,parser:function(t){return{tag:6,bytes:t}}}];var Vt=function t(e,r,n){void 0===n&&(n=!1),r=function(t){return Array.isArray(t)?t.map((function(t){return Ut(t)})):[Ut(t)]}(r),e=Lt(e);var i=[];if(!r.length)return i;for(var o=0;o<e.length;){var a=(e[o]<<24|e[o+1]<<16|e[o+2]<<8|e[o+3])>>>0,s=e.subarray(o+4,o+8);if(0===a)break;var u=o+a;if(u>e.length){if(n)break;u=e.length}var l=e.subarray(o+8,u);Mt(s,r[0])&&(1===r.length?i.push(l):i.push.apply(i,t(l,r.slice(1),n))),o=u}return i},Ht={EBML:Lt([26,69,223,163]),DocType:Lt([66,130]),Segment:Lt([24,83,128,103]),SegmentInfo:Lt([21,73,169,102]),Tracks:Lt([22,84,174,107]),Track:Lt([174]),TrackNumber:Lt([215]),DefaultDuration:Lt([35,227,131]),TrackEntry:Lt([174]),TrackType:Lt([131]),FlagDefault:Lt([136]),CodecID:Lt([134]),CodecPrivate:Lt([99,162]),VideoTrack:Lt([224]),AudioTrack:Lt([225]),Cluster:Lt([31,67,182,117]),Timestamp:Lt([231]),TimestampScale:Lt([42,215,177]),BlockGroup:Lt([160]),BlockDuration:Lt([155]),Block:Lt([161]),SimpleBlock:Lt([163])},qt=[128,64,32,16,8,4,2,1],zt=function(t,e,r,n){void 0===r&&(r=!0),void 0===n&&(n=!1);var i=function(t){for(var e=1,r=0;r<qt.length&&!(t&qt[r]);r++)e++;return e}(t[e]),o=t.subarray(e,e+i);return r&&((o=Array.prototype.slice.call(t,e,e+i))[0]^=qt[i-1]),{length:i,value:Rt(o,{signed:n}),bytes:o}},Wt=function t(e){return"string"==typeof e?e.match(/.{1,2}/g).map((function(e){return t(e)})):"number"==typeof e?function(t,e){var r=(void 0===e?{}:e).le,n=void 0!==r&&r;("bigint"!=typeof t&&"number"!=typeof t||"number"==typeof t&&t!=t)&&(t=0);for(var i,o=(i=t=It(t),Math.ceil(function(t){return t.toString(2).length}(i)/8)),a=new Uint8Array(new ArrayBuffer(o)),s=0;s<o;s++){var u=n?s:Math.abs(s+1-a.length);a[u]=Number(t/At[s]&It(255)),t<0&&(a[u]=Math.abs(~a[u]),a[u]-=0===s?1:2)}return a}(e):e},Gt=function t(e,r,n){if(n>=r.length)return r.length;var i=zt(r,n,!1);if(Mt(e.bytes,i.bytes))return n;var o=zt(r,n+i.length);return t(e,r,n+o.length+o.value+i.length)},Xt=function t(e,r){r=function(t){return Array.isArray(t)?t.map((function(t){return Wt(t)})):[Wt(t)]}(r),e=Lt(e);var n=[];if(!r.length)return n;for(var i=0;i<e.length;){var o=zt(e,i,!1),a=zt(e,i+o.length),s=i+o.length+a.length;127===a.value&&(a.value=Gt(o,e,s),a.value!==e.length&&(a.value-=s));var u=s+a.value>e.length?e.length:s+a.value,l=e.subarray(s,u);Mt(r[0],o.bytes)&&(1===r.length?n.push(l):n=n.concat(t(l,r.slice(1)))),i+=o.length+a.length+l.length}return n},Kt=Lt([0,0,0,1]),Yt=Lt([0,0,1]),Qt=Lt([0,0,3]),$t=function(t){for(var e=[],r=1;r<t.length-2;)Mt(t.subarray(r,r+3),Qt)&&(e.push(r+2),r++),r++;if(0===e.length)return t;var n=t.length-e.length,i=new Uint8Array(n),o=0;for(r=0;r<n;o++,r++)o===e[0]&&(o++,e.shift()),i[r]=t[o];return i},Jt=function(t,e,r,n){void 0===n&&(n=1/0),t=Lt(t),r=[].concat(r);for(var i,o=0,a=0;o<t.length&&(a<n||i);){var s=void 0;if(Mt(t.subarray(o),Kt)?s=4:Mt(t.subarray(o),Yt)&&(s=3),s){if(a++,i)return $t(t.subarray(i,o));var u=void 0;"h264"===e?u=31&t[o+s]:"h265"===e&&(u=t[o+s]>>1&63),-1!==r.indexOf(u)&&(i=o+s),o+=s+("h264"===e?1:2)}else o++}return t.subarray(0,0)},Zt={webm:Lt([119,101,98,109]),matroska:Lt([109,97,116,114,111,115,107,97]),flac:Lt([102,76,97,67]),ogg:Lt([79,103,103,83]),ac3:Lt([11,119]),riff:Lt([82,73,70,70]),avi:Lt([65,86,73]),wav:Lt([87,65,86,69]),"3gp":Lt([102,116,121,112,51,103]),mp4:Lt([102,116,121,112]),fmp4:Lt([115,116,121,112]),mov:Lt([102,116,121,112,113,116]),moov:Lt([109,111,111,118]),moof:Lt([109,111,111,102])},te={aac:function(t){var e=Bt(t);return Mt(t,[255,16],{offset:e,mask:[255,22]})},mp3:function(t){var e=Bt(t);return Mt(t,[255,2],{offset:e,mask:[255,6]})},webm:function(t){var e=Xt(t,[Ht.EBML,Ht.DocType])[0];return Mt(e,Zt.webm)},mkv:function(t){var e=Xt(t,[Ht.EBML,Ht.DocType])[0];return Mt(e,Zt.matroska)},mp4:function(t){return!te["3gp"](t)&&!te.mov(t)&&(!(!Mt(t,Zt.mp4,{offset:4})&&!Mt(t,Zt.fmp4,{offset:4}))||!(!Mt(t,Zt.moof,{offset:4})&&!Mt(t,Zt.moov,{offset:4}))||void 0)},mov:function(t){return Mt(t,Zt.mov,{offset:4})},"3gp":function(t){return Mt(t,Zt["3gp"],{offset:4})},ac3:function(t){var e=Bt(t);return Mt(t,Zt.ac3,{offset:e})},ts:function(t){if(t.length<189&&t.length>=1)return 71===t[0];for(var e=0;e+188<t.length&&e<188;){if(71===t[e]&&71===t[e+188])return!0;e+=1}return!1},flac:function(t){var e=Bt(t);return Mt(t,Zt.flac,{offset:e})},ogg:function(t){return Mt(t,Zt.ogg)},avi:function(t){return Mt(t,Zt.riff)&&Mt(t,Zt.avi,{offset:8})},wav:function(t){return Mt(t,Zt.riff)&&Mt(t,Zt.wav,{offset:8})},h264:function(t){return function(t,e,r){return Jt(t,"h264",7,3)}(t).length},h265:function(t){return function(t,e,r){return Jt(t,"h265",[32,33],3)}(t).length}},ee=Object.keys(te).filter((function(t){return"ts"!==t&&"h264"!==t&&"h265"!==t})).concat(["ts","h264","h265"]);ee.forEach((function(t){var e=te[t];te[t]=function(t){return e(Lt(t))}}));for(var re,ne=te,ie=function(t){t=Lt(t);for(var e=0;e<ee.length;e++){var r=ee[e];if(ne[r](t))return r}return""},oe=r(28195),ae="7.12.4",se={prefixed:!0},ue=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],le=ue[0],ce=0;ce<ue.length;ce++)if(ue[ce][1]in o()){re=ue[ce];break}if(re){for(var fe=0;fe<re.length;fe++)se[le[fe]]=re[fe];se.prefixed=re[0]!==le[0]}var he=[],pe=function t(r){var n,i="info",o=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];n("log",i,e)};return n=function(t,r){return function(n,i,o){var a=r.levels[i],s=new RegExp("^("+a+")$");if("log"!==n&&o.unshift(n.toUpperCase()+":"),o.unshift(t+":"),he){he.push([].concat(o));var u=he.length-1e3;he.splice(0,u>0?u:0)}if(e().console){var l=e().console[n];l||"debug"!==n||(l=e().console.info||e().console.log),l&&a&&s.test(n)&&l[Array.isArray(o)?"apply":"call"](e().console,o)}}}(r,o),o.createLogger=function(e){return t(r+": "+e)},o.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:i},o.level=function(t){if("string"==typeof t){if(!o.levels.hasOwnProperty(t))throw new Error('"'+t+'" in not a valid log level');i=t}return i},(o.history=function(){return he?[].concat(he):[]}).filter=function(t){return(he||[]).filter((function(e){return new RegExp(".*"+t+".*").test(e[0])}))},o.history.clear=function(){he&&(he.length=0)},o.history.disable=function(){null!==he&&(he.length=0,he=null)},o.history.enable=function(){null===he&&(he=[])},o.error=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return n("error",i,e)},o.warn=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return n("warn",i,e)},o.debug=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return n("debug",i,e)},o}("VIDEOJS"),de=pe.createLogger,ye=Object.prototype.toString,me=function(t){return be(t)?Object.keys(t):[]};function ve(t,e){me(t).forEach((function(r){return e(t[r],r)}))}function ge(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return Object.assign?a.apply(void 0,[t].concat(r)):(r.forEach((function(e){e&&ve(e,(function(e,r){t[r]=e}))})),t)}function be(t){return!!t&&"object"==typeof t}function _e(t){return be(t)&&"[object Object]"===ye.call(t)&&t.constructor===Object}function we(t,r){if(!t||!r)return"";if("function"==typeof e().getComputedStyle){var n;try{n=e().getComputedStyle(t)}catch(t){return""}return n?n.getPropertyValue(r)||n[r]:""}return""}var Te,Se,Ee,Oe=e().navigator&&e().navigator.userAgent||"",ke=/AppleWebKit\/([\d.]+)/i.exec(Oe),Ce=ke?parseFloat(ke.pop()):null,Pe=/iPod/i.test(Oe),xe=(Te=Oe.match(/OS (\d+)_/i))&&Te[1]?Te[1]:null,je=/Android/i.test(Oe),Le=function(){var t=Oe.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t)return null;var e=t[1]&&parseFloat(t[1]),r=t[2]&&parseFloat(t[2]);return e&&r?parseFloat(t[1]+"."+t[2]):e||null}(),Ie=je&&Le<5&&Ce<537,Ae=/Firefox/i.test(Oe),Re=/Edg/i.test(Oe),De=!Re&&(/Chrome/i.test(Oe)||/CriOS/i.test(Oe)),Me=function(){var t=Oe.match(/(Chrome|CriOS)\/(\d+)/);return t&&t[2]?parseFloat(t[2]):null}(),Ne=(Se=/MSIE\s(\d+)\.\d/.exec(Oe),!(Ee=Se&&parseFloat(Se[1]))&&/Trident\/7.0/i.test(Oe)&&/rv:11.0/.test(Oe)&&(Ee=11),Ee),Be=/Safari/i.test(Oe)&&!De&&!je&&!Re,Ue=/Windows/i.test(Oe),Fe=Boolean(Ke()&&("ontouchstart"in e()||e().navigator.maxTouchPoints||e().DocumentTouch&&e().document instanceof e().DocumentTouch)),Ve=/iPad/i.test(Oe)||Be&&Fe&&!/iPhone/i.test(Oe),He=/iPhone/i.test(Oe)&&!Ve,qe=He||Ve||Pe,ze=(Be||qe)&&!De,We=Object.freeze({__proto__:null,IS_IPOD:Pe,IOS_VERSION:xe,IS_ANDROID:je,ANDROID_VERSION:Le,IS_NATIVE_ANDROID:Ie,IS_FIREFOX:Ae,IS_EDGE:Re,IS_CHROME:De,CHROME_VERSION:Me,IE_VERSION:Ne,IS_SAFARI:Be,IS_WINDOWS:Ue,TOUCH_ENABLED:Fe,IS_IPAD:Ve,IS_IPHONE:He,IS_IOS:qe,IS_ANY_SAFARI:ze});function Ge(t){return"string"==typeof t&&Boolean(t.trim())}function Xe(t){if(t.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function Ke(){return o()===e().document}function Ye(t){return be(t)&&1===t.nodeType}function Qe(){try{return e().parent!==e().self}catch(t){return!0}}function $e(t){return function(e,r){if(!Ge(e))return o()[t](null);Ge(r)&&(r=o().querySelector(r));var n=Ye(r)?r:o();return n[t]&&n[t](e)}}function Je(t,e,r,n){void 0===t&&(t="div"),void 0===e&&(e={}),void 0===r&&(r={});var i=o().createElement(t);return Object.getOwnPropertyNames(e).forEach((function(t){var r=e[t];-1!==t.indexOf("aria-")||"role"===t||"type"===t?(pe.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set "+t+" to "+r+"."),i.setAttribute(t,r)):"textContent"===t?Ze(i,r):i[t]===r&&"tabIndex"!==t||(i[t]=r)})),Object.getOwnPropertyNames(r).forEach((function(t){i.setAttribute(t,r[t])})),n&&gr(i,n),i}function Ze(t,e){return void 0===t.textContent?t.innerText=e:t.textContent=e,t}function tr(t,e){e.firstChild?e.insertBefore(t,e.firstChild):e.appendChild(t)}function er(t,e){return Xe(e),t.classList?t.classList.contains(e):(r=e,new RegExp("(^|\\s)"+r+"($|\\s)")).test(t.className);var r}function rr(t,e){return t.classList?t.classList.add(e):er(t,e)||(t.className=(t.className+" "+e).trim()),t}function nr(t,e){return t.classList?t.classList.remove(e):(Xe(e),t.className=t.className.split(/\s+/).filter((function(t){return t!==e})).join(" ")),t}function ir(t,e,r){var n=er(t,e);if("function"==typeof r&&(r=r(t,e)),"boolean"!=typeof r&&(r=!n),r!==n)return r?rr(t,e):nr(t,e),t}function or(t,e){Object.getOwnPropertyNames(e).forEach((function(r){var n=e[r];null==n||!1===n?t.removeAttribute(r):t.setAttribute(r,!0===n?"":n)}))}function ar(t){var e={};if(t&&t.attributes&&t.attributes.length>0)for(var r=t.attributes,n=r.length-1;n>=0;n--){var i=r[n].name,o=r[n].value;"boolean"!=typeof t[i]&&-1===",autoplay,controls,playsinline,loop,muted,default,defaultMuted,".indexOf(","+i+",")||(o=null!==o),e[i]=o}return e}function sr(t,e){return t.getAttribute(e)}function ur(t,e,r){t.setAttribute(e,r)}function lr(t,e){t.removeAttribute(e)}function cr(){o().body.focus(),o().onselectstart=function(){return!1}}function fr(){o().onselectstart=function(){return!0}}function hr(t){if(t&&t.getBoundingClientRect&&t.parentNode){var e=t.getBoundingClientRect(),r={};return["bottom","height","left","right","top","width"].forEach((function(t){void 0!==e[t]&&(r[t]=e[t])})),r.height||(r.height=parseFloat(we(t,"height"))),r.width||(r.width=parseFloat(we(t,"width"))),r}}function pr(t){if(!t||t&&!t.offsetParent)return{left:0,top:0,width:0,height:0};for(var e=t.offsetWidth,r=t.offsetHeight,n=0,i=0;t.offsetParent&&t!==o()[se.fullscreenElement];)n+=t.offsetLeft,i+=t.offsetTop,t=t.offsetParent;return{left:n,top:i,width:e,height:r}}function dr(t,e){var r={x:0,y:0};if(qe)for(var n=t;n&&"html"!==n.nodeName.toLowerCase();){var i=we(n,"transform");if(/^matrix/.test(i)){var o=i.slice(7,-1).split(/,\s/).map(Number);r.x+=o[4],r.y+=o[5]}else if(/^matrix3d/.test(i)){var a=i.slice(9,-1).split(/,\s/).map(Number);r.x+=a[12],r.y+=a[13]}n=n.parentNode}var s={},u=pr(e.target),l=pr(t),c=l.width,f=l.height,h=e.offsetY-(l.top-u.top),p=e.offsetX-(l.left-u.left);return e.changedTouches&&(p=e.changedTouches[0].pageX-l.left,h=e.changedTouches[0].pageY+l.top,qe&&(p-=r.x,h-=r.y)),s.y=1-Math.max(0,Math.min(1,h/f)),s.x=Math.max(0,Math.min(1,p/c)),s}function yr(t){return be(t)&&3===t.nodeType}function mr(t){for(;t.firstChild;)t.removeChild(t.firstChild);return t}function vr(t){return"function"==typeof t&&(t=t()),(Array.isArray(t)?t:[t]).map((function(t){return"function"==typeof t&&(t=t()),Ye(t)||yr(t)?t:"string"==typeof t&&/\S/.test(t)?o().createTextNode(t):void 0})).filter((function(t){return t}))}function gr(t,e){return vr(e).forEach((function(e){return t.appendChild(e)})),t}function br(t,e){return gr(mr(t),e)}function _r(t){return void 0===t.button&&void 0===t.buttons||0===t.button&&void 0===t.buttons||"mouseup"===t.type&&0===t.button&&0===t.buttons||0===t.button&&1===t.buttons}var wr,Tr=$e("querySelector"),Sr=$e("querySelectorAll"),Er=Object.freeze({__proto__:null,isReal:Ke,isEl:Ye,isInFrame:Qe,createEl:Je,textContent:Ze,prependTo:tr,hasClass:er,addClass:rr,removeClass:nr,toggleClass:ir,setAttributes:or,getAttributes:ar,getAttribute:sr,setAttribute:ur,removeAttribute:lr,blockTextSelection:cr,unblockTextSelection:fr,getBoundingClientRect:hr,findPosition:pr,getPointerPosition:dr,isTextNode:yr,emptyEl:mr,normalizeContent:vr,appendContent:gr,insertContent:br,isSingleLeftClick:_r,$:Tr,$$:Sr}),Or=!1,kr=function(){if(!1!==wr.options.autoSetup){var t=Array.prototype.slice.call(o().getElementsByTagName("video")),e=Array.prototype.slice.call(o().getElementsByTagName("audio")),r=Array.prototype.slice.call(o().getElementsByTagName("video-js")),n=t.concat(e,r);if(n&&n.length>0)for(var i=0,a=n.length;i<a;i++){var s=n[i];if(!s||!s.getAttribute){Cr(1);break}void 0===s.player&&null!==s.getAttribute("data-setup")&&wr(s)}else Or||Cr(1)}};function Cr(t,r){Ke()&&(r&&(wr=r),e().setTimeout(kr,t))}function Pr(){Or=!0,e().removeEventListener("load",Pr)}Ke()&&("complete"===o().readyState?Pr():e().addEventListener("load",Pr));var xr,jr=function(t){var e=o().createElement("style");return e.className=t,e},Lr=function(t,e){t.styleSheet?t.styleSheet.cssText=e:t.textContent=e},Ir=3;function Ar(){return Ir++}e().WeakMap||(xr=function(){function t(){this.vdata="vdata"+Math.floor(e().performance&&e().performance.now()||Date.now()),this.data={}}var r=t.prototype;return r.set=function(t,e){var r=t[this.vdata]||Ar();return t[this.vdata]||(t[this.vdata]=r),this.data[r]=e,this},r.get=function(t){var e=t[this.vdata];if(e)return this.data[e];pe("We have no data for this element",t)},r.has=function(t){return t[this.vdata]in this.data},r.delete=function(t){var e=t[this.vdata];e&&(delete this.data[e],delete t[this.vdata])},t}());var Rr,Dr=e().WeakMap?new WeakMap:new xr;function Mr(t,e){if(Dr.has(t)){var r=Dr.get(t);0===r.handlers[e].length&&(delete r.handlers[e],t.removeEventListener?t.removeEventListener(e,r.dispatcher,!1):t.detachEvent&&t.detachEvent("on"+e,r.dispatcher)),Object.getOwnPropertyNames(r.handlers).length<=0&&(delete r.handlers,delete r.dispatcher,delete r.disabled),0===Object.getOwnPropertyNames(r).length&&Dr.delete(t)}}function Nr(t,e,r,n){r.forEach((function(r){t(e,r,n)}))}function Br(t){if(t.fixed_)return t;function r(){return!0}function n(){return!1}if(!t||!t.isPropagationStopped){var i=t||e().event;for(var a in t={},i)"layerX"!==a&&"layerY"!==a&&"keyLocation"!==a&&"webkitMovementX"!==a&&"webkitMovementY"!==a&&("returnValue"===a&&i.preventDefault||(t[a]=i[a]));if(t.target||(t.target=t.srcElement||o()),t.relatedTarget||(t.relatedTarget=t.fromElement===t.target?t.toElement:t.fromElement),t.preventDefault=function(){i.preventDefault&&i.preventDefault(),t.returnValue=!1,i.returnValue=!1,t.defaultPrevented=!0},t.defaultPrevented=!1,t.stopPropagation=function(){i.stopPropagation&&i.stopPropagation(),t.cancelBubble=!0,i.cancelBubble=!0,t.isPropagationStopped=r},t.isPropagationStopped=n,t.stopImmediatePropagation=function(){i.stopImmediatePropagation&&i.stopImmediatePropagation(),t.isImmediatePropagationStopped=r,t.stopPropagation()},t.isImmediatePropagationStopped=n,null!==t.clientX&&void 0!==t.clientX){var s=o().documentElement,u=o().body;t.pageX=t.clientX+(s&&s.scrollLeft||u&&u.scrollLeft||0)-(s&&s.clientLeft||u&&u.clientLeft||0),t.pageY=t.clientY+(s&&s.scrollTop||u&&u.scrollTop||0)-(s&&s.clientTop||u&&u.clientTop||0)}t.which=t.charCode||t.keyCode,null!==t.button&&void 0!==t.button&&(t.button=1&t.button?0:4&t.button?1:2&t.button?2:0)}return t.fixed_=!0,t}var Ur=function(){if("boolean"!=typeof Rr){Rr=!1;try{var t=Object.defineProperty({},"passive",{get:function(){Rr=!0}});e().addEventListener("test",null,t),e().removeEventListener("test",null,t)}catch(t){}}return Rr},Fr=["touchstart","touchmove"];function Vr(t,e,r){if(Array.isArray(e))return Nr(Vr,t,e,r);Dr.has(t)||Dr.set(t,{});var n=Dr.get(t);if(n.handlers||(n.handlers={}),n.handlers[e]||(n.handlers[e]=[]),r.guid||(r.guid=Ar()),n.handlers[e].push(r),n.dispatcher||(n.disabled=!1,n.dispatcher=function(e,r){if(!n.disabled){e=Br(e);var i=n.handlers[e.type];if(i)for(var o=i.slice(0),a=0,s=o.length;a<s&&!e.isImmediatePropagationStopped();a++)try{o[a].call(t,e,r)}catch(t){pe.error(t)}}}),1===n.handlers[e].length)if(t.addEventListener){var i=!1;Ur()&&Fr.indexOf(e)>-1&&(i={passive:!0}),t.addEventListener(e,n.dispatcher,i)}else t.attachEvent&&t.attachEvent("on"+e,n.dispatcher)}function Hr(t,e,r){if(Dr.has(t)){var n=Dr.get(t);if(n.handlers){if(Array.isArray(e))return Nr(Hr,t,e,r);var i=function(t,e){n.handlers[e]=[],Mr(t,e)};if(void 0!==e){var o=n.handlers[e];if(o)if(r){if(r.guid)for(var a=0;a<o.length;a++)o[a].guid===r.guid&&o.splice(a--,1);Mr(t,e)}else i(t,e)}else for(var s in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},s)&&i(t,s)}}}function qr(t,e,r){var n=Dr.has(t)?Dr.get(t):{},i=t.parentNode||t.ownerDocument;if("string"==typeof e?e={type:e,target:t}:e.target||(e.target=t),e=Br(e),n.dispatcher&&n.dispatcher.call(t,e,r),i&&!e.isPropagationStopped()&&!0===e.bubbles)qr.call(null,i,e,r);else if(!i&&!e.defaultPrevented&&e.target&&e.target[e.type]){Dr.has(e.target)||Dr.set(e.target,{});var o=Dr.get(e.target);e.target[e.type]&&(o.disabled=!0,"function"==typeof e.target[e.type]&&e.target[e.type](),o.disabled=!1)}return!e.defaultPrevented}function zr(t,e,r){if(Array.isArray(e))return Nr(zr,t,e,r);var n=function n(){Hr(t,e,n),r.apply(this,arguments)};n.guid=r.guid=r.guid||Ar(),Vr(t,e,n)}function Wr(t,e,r){var n=function n(){Hr(t,e,n),r.apply(this,arguments)};n.guid=r.guid=r.guid||Ar(),Vr(t,e,n)}var Gr,Xr=Object.freeze({__proto__:null,fixEvent:Br,on:Vr,off:Hr,trigger:qr,one:zr,any:Wr}),Kr=30,Yr=function(t,e,r){e.guid||(e.guid=Ar());var n=e.bind(t);return n.guid=r?r+"_"+e.guid:e.guid,n},Qr=function(t,r){var n=e().performance.now();return function(){var i=e().performance.now();i-n>=r&&(t.apply(void 0,arguments),n=i)}},$r=function(){};$r.prototype.allowedEvents_={},$r.prototype.on=function(t,e){var r=this.addEventListener;this.addEventListener=function(){},Vr(this,t,e),this.addEventListener=r},$r.prototype.addEventListener=$r.prototype.on,$r.prototype.off=function(t,e){Hr(this,t,e)},$r.prototype.removeEventListener=$r.prototype.off,$r.prototype.one=function(t,e){var r=this.addEventListener;this.addEventListener=function(){},zr(this,t,e),this.addEventListener=r},$r.prototype.any=function(t,e){var r=this.addEventListener;this.addEventListener=function(){},Wr(this,t,e),this.addEventListener=r},$r.prototype.trigger=function(t){var e=t.type||t;"string"==typeof t&&(t={type:e}),t=Br(t),this.allowedEvents_[e]&&this["on"+e]&&this["on"+e](t),qr(this,t)},$r.prototype.dispatchEvent=$r.prototype.trigger,$r.prototype.queueTrigger=function(t){var r=this;Gr||(Gr=new Map);var n=t.type||t,i=Gr.get(this);i||(i=new Map,Gr.set(this,i));var o=i.get(n);i.delete(n),e().clearTimeout(o);var a=e().setTimeout((function(){0===i.size&&(i=null,Gr.delete(r)),r.trigger(t)}),0);i.set(n,a)};var Jr=function(t){return"function"==typeof t.name?t.name():"string"==typeof t.name?t.name:t.name_?t.name_:t.constructor&&t.constructor.name?t.constructor.name:typeof t},Zr=function(t){return t instanceof $r||!!t.eventBusEl_&&["on","one","off","trigger"].every((function(e){return"function"==typeof t[e]}))},tn=function(t){return"string"==typeof t&&/\S/.test(t)||Array.isArray(t)&&!!t.length},en=function(t,e,r){if(!t||!t.nodeName&&!Zr(t))throw new Error("Invalid target for "+Jr(e)+"#"+r+"; must be a DOM node or evented object.")},rn=function(t,e,r){if(!tn(t))throw new Error("Invalid event type for "+Jr(e)+"#"+r+"; must be a non-empty string or array.")},nn=function(t,e,r){if("function"!=typeof t)throw new Error("Invalid listener for "+Jr(e)+"#"+r+"; must be a function.")},on=function(t,e,r){var n,i,o,a=e.length<3||e[0]===t||e[0]===t.eventBusEl_;return a?(n=t.eventBusEl_,e.length>=3&&e.shift(),i=e[0],o=e[1]):(n=e[0],i=e[1],o=e[2]),en(n,t,r),rn(i,t,r),nn(o,t,r),{isTargetingSelf:a,target:n,type:i,listener:o=Yr(t,o)}},an=function(t,e,r,n){en(t,t,e),t.nodeName?Xr[e](t,r,n):t[e](r,n)},sn={on:function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var i=on(this,r,"on"),o=i.isTargetingSelf,a=i.target,s=i.type,u=i.listener;if(an(a,"on",s,u),!o){var l=function(){return t.off(a,s,u)};l.guid=u.guid;var c=function(){return t.off("dispose",l)};c.guid=u.guid,an(this,"on","dispose",l),an(a,"on","dispose",c)}},one:function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var i=on(this,r,"one"),o=i.isTargetingSelf,a=i.target,s=i.type,u=i.listener;if(o)an(a,"one",s,u);else{var l=function e(){t.off(a,s,e);for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];u.apply(null,n)};l.guid=u.guid,an(a,"one",s,l)}},any:function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var i=on(this,r,"any"),o=i.isTargetingSelf,a=i.target,s=i.type,u=i.listener;if(o)an(a,"any",s,u);else{var l=function e(){t.off(a,s,e);for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];u.apply(null,n)};l.guid=u.guid,an(a,"any",s,l)}},off:function(t,e,r){if(!t||tn(t))Hr(this.eventBusEl_,t,e);else{var n=t,i=e;en(n,this,"off"),rn(i,this,"off"),nn(r,this,"off"),r=Yr(this,r),this.off("dispose",r),n.nodeName?(Hr(n,i,r),Hr(n,"dispose",r)):Zr(n)&&(n.off(i,r),n.off("dispose",r))}},trigger:function(t,e){en(this.eventBusEl_,this,"trigger");var r=t&&"string"!=typeof t?t.type:t;if(!tn(r)){var n="Invalid event type for "+Jr(this)+"#trigger; must be a non-empty string or object with a type key that has a non-empty value.";if(!t)throw new Error(n);(this.log||pe).error(n)}return qr(this.eventBusEl_,t,e)}};function un(t,r){void 0===r&&(r={});var n=r.eventBusKey;if(n){if(!t[n].nodeName)throw new Error('The eventBusKey "'+n+'" does not refer to an element.');t.eventBusEl_=t[n]}else t.eventBusEl_=Je("span",{className:"vjs-event-bus"});return ge(t,sn),t.eventedCallbacks&&t.eventedCallbacks.forEach((function(t){t()})),t.on("dispose",(function(){t.off(),e().setTimeout((function(){t.eventBusEl_=null}),0)})),t}var ln={state:{},setState:function(t){var e,r=this;return"function"==typeof t&&(t=t()),ve(t,(function(t,n){r.state[n]!==t&&((e=e||{})[n]={from:r.state[n],to:t}),r.state[n]=t})),e&&Zr(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function cn(t,e){return ge(t,ln),t.state=ge({},t.state,e),"function"==typeof t.handleStateChanged&&Zr(t)&&t.on("statechanged",t.handleStateChanged),t}var fn=function(t){return"string"!=typeof t?t:t.replace(/./,(function(t){return t.toLowerCase()}))},hn=function(t){return"string"!=typeof t?t:t.replace(/./,(function(t){return t.toUpperCase()}))};function pn(){for(var t={},e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return r.forEach((function(e){e&&ve(e,(function(e,r){_e(e)?(_e(t[r])||(t[r]={}),t[r]=pn(t[r],e)):t[r]=e}))})),t}var dn=function(){function t(){this.map_={}}var e=t.prototype;return e.has=function(t){return t in this.map_},e.delete=function(t){var e=this.has(t);return delete this.map_[t],e},e.set=function(t,e){return this.map_[t]=e,this},e.forEach=function(t,e){for(var r in this.map_)t.call(e,this.map_[r],r,this)},t}(),yn=e().Map?e().Map:dn,mn=function(){function t(){this.set_={}}var e=t.prototype;return e.has=function(t){return t in this.set_},e.delete=function(t){var e=this.has(t);return delete this.set_[t],e},e.add=function(t){return this.set_[t]=1,this},e.forEach=function(t,e){for(var r in this.set_)t.call(e,r,r,this)},t}(),vn=e().Set?e().Set:mn,gn=function(){function t(t,e,r){if(!t&&this.play?this.player_=t=this:this.player_=t,this.isDisposed_=!1,this.parentComponent_=null,this.options_=pn({},this.options_),e=this.options_=pn(this.options_,e),this.id_=e.id||e.el&&e.el.id,!this.id_){var n=t&&t.id&&t.id()||"no_player";this.id_=n+"_component_"+Ar()}this.name_=e.name||null,e.el?this.el_=e.el:!1!==e.createEl&&(this.el_=this.createEl()),!1!==e.evented&&(un(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),cn(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new vn,this.setIntervalIds_=new vn,this.rafIds_=new vn,this.namedRafs_=new yn,this.clearingTimersOnDispose_=!1,!1!==e.initChildren&&this.initChildren(),this.ready(r),!1!==e.reportTouchActivity&&this.enableTouchActivity()}var r=t.prototype;return r.dispose=function(){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(var t=this.children_.length-1;t>=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),Dr.has(this.el_)&&Dr.delete(this.el_),this.el_=null),this.player_=null}},r.isDisposed=function(){return Boolean(this.isDisposed_)},r.player=function(){return this.player_},r.options=function(t){return t?(this.options_=pn(this.options_,t),this.options_):this.options_},r.el=function(){return this.el_},r.createEl=function(t,e,r){return Je(t,e,r)},r.localize=function(t,e,r){void 0===r&&(r=t);var n=this.player_.language&&this.player_.language(),i=this.player_.languages&&this.player_.languages(),o=i&&i[n],a=n&&n.split("-")[0],s=i&&i[a],u=r;return o&&o[t]?u=o[t]:s&&s[t]&&(u=s[t]),e&&(u=u.replace(/\{(\d+)\}/g,(function(t,r){var n=e[r-1],i=n;return void 0===n&&(i=t),i}))),u},r.handleLanguagechange=function(){},r.contentEl=function(){return this.contentEl_||this.el_},r.id=function(){return this.id_},r.name=function(){return this.name_},r.children=function(){return this.children_},r.getChildById=function(t){return this.childIndex_[t]},r.getChild=function(t){if(t)return this.childNameIndex_[t]},r.getDescendant=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];e=e.reduce((function(t,e){return t.concat(e)}),[]);for(var n=this,i=0;i<e.length;i++)if(!(n=n.getChild(e[i]))||!n.getChild)return;return n},r.addChild=function(e,r,n){var i,o;if(void 0===r&&(r={}),void 0===n&&(n=this.children_.length),"string"==typeof e){o=hn(e);var a=r.componentClass||o;r.name=o;var s=t.getComponent(a);if(!s)throw new Error("Component "+a+" does not exist");if("function"!=typeof s)return null;i=new s(this.player_||this,r)}else i=e;if(i.parentComponent_&&i.parentComponent_.removeChild(i),this.children_.splice(n,0,i),i.parentComponent_=this,"function"==typeof i.id&&(this.childIndex_[i.id()]=i),(o=o||i.name&&hn(i.name()))&&(this.childNameIndex_[o]=i,this.childNameIndex_[fn(o)]=i),"function"==typeof i.el&&i.el()){var u=null;this.children_[n+1]&&(this.children_[n+1].el_?u=this.children_[n+1].el_:Ye(this.children_[n+1])&&(u=this.children_[n+1])),this.contentEl().insertBefore(i.el(),u)}return i},r.removeChild=function(t){if("string"==typeof t&&(t=this.getChild(t)),t&&this.children_){for(var e=!1,r=this.children_.length-1;r>=0;r--)if(this.children_[r]===t){e=!0,this.children_.splice(r,1);break}if(e){t.parentComponent_=null,this.childIndex_[t.id()]=null,this.childNameIndex_[hn(t.name())]=null,this.childNameIndex_[fn(t.name())]=null;var n=t.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(t.el())}}},r.initChildren=function(){var e=this,r=this.options_.children;if(r){var n,i=this.options_,o=t.getComponent("Tech");(n=Array.isArray(r)?r:Object.keys(r)).concat(Object.keys(this.options_).filter((function(t){return!n.some((function(e){return"string"==typeof e?t===e:t===e.name}))}))).map((function(t){var n,i;return"string"==typeof t?i=r[n=t]||e.options_[n]||{}:(n=t.name,i=t),{name:n,opts:i}})).filter((function(e){var r=t.getComponent(e.opts.componentClass||hn(e.name));return r&&!o.isTech(r)})).forEach((function(t){var r=t.name,n=t.opts;if(void 0!==i[r]&&(n=i[r]),!1!==n){!0===n&&(n={}),n.playerOptions=e.options_.playerOptions;var o=e.addChild(r,n);o&&(e[r]=o)}}))}},r.buildCSSClass=function(){return""},r.ready=function(t,e){if(void 0===e&&(e=!1),t)return this.isReady_?void(e?t.call(this):this.setTimeout(t,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(t))},r.triggerReady=function(){this.isReady_=!0,this.setTimeout((function(){var t=this.readyQueue_;this.readyQueue_=[],t&&t.length>0&&t.forEach((function(t){t.call(this)}),this),this.trigger("ready")}),1)},r.$=function(t,e){return Tr(t,e||this.contentEl())},r.$$=function(t,e){return Sr(t,e||this.contentEl())},r.hasClass=function(t){return er(this.el_,t)},r.addClass=function(t){rr(this.el_,t)},r.removeClass=function(t){nr(this.el_,t)},r.toggleClass=function(t,e){ir(this.el_,t,e)},r.show=function(){this.removeClass("vjs-hidden")},r.hide=function(){this.addClass("vjs-hidden")},r.lockShowing=function(){this.addClass("vjs-lock-showing")},r.unlockShowing=function(){this.removeClass("vjs-lock-showing")},r.getAttribute=function(t){return sr(this.el_,t)},r.setAttribute=function(t,e){ur(this.el_,t,e)},r.removeAttribute=function(t){lr(this.el_,t)},r.width=function(t,e){return this.dimension("width",t,e)},r.height=function(t,e){return this.dimension("height",t,e)},r.dimensions=function(t,e){this.width(t,!0),this.height(e)},r.dimension=function(t,e,r){if(void 0!==e)return null!==e&&e==e||(e=0),-1!==(""+e).indexOf("%")||-1!==(""+e).indexOf("px")?this.el_.style[t]=e:this.el_.style[t]="auto"===e?"":e+"px",void(r||this.trigger("componentresize"));if(!this.el_)return 0;var n=this.el_.style[t],i=n.indexOf("px");return-1!==i?parseInt(n.slice(0,i),10):parseInt(this.el_["offset"+hn(t)],10)},r.currentDimension=function(t){var e=0;if("width"!==t&&"height"!==t)throw new Error("currentDimension only accepts width or height value");if(e=we(this.el_,t),0===(e=parseFloat(e))||isNaN(e)){var r="offset"+hn(t);e=this.el_[r]}return e},r.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},r.currentWidth=function(){return this.currentDimension("width")},r.currentHeight=function(){return this.currentDimension("height")},r.focus=function(){this.el_.focus()},r.blur=function(){this.el_.blur()},r.handleKeyDown=function(t){this.player_&&(t.stopPropagation(),this.player_.handleKeyDown(t))},r.handleKeyPress=function(t){this.handleKeyDown(t)},r.emitTapEvents=function(){var t,r=0,n=null;this.on("touchstart",(function(i){1===i.touches.length&&(n={pageX:i.touches[0].pageX,pageY:i.touches[0].pageY},r=e().performance.now(),t=!0)})),this.on("touchmove",(function(e){if(e.touches.length>1)t=!1;else if(n){var r=e.touches[0].pageX-n.pageX,i=e.touches[0].pageY-n.pageY;Math.sqrt(r*r+i*i)>10&&(t=!1)}}));var i=function(){t=!1};this.on("touchleave",i),this.on("touchcancel",i),this.on("touchend",(function(i){n=null,!0===t&&e().performance.now()-r<200&&(i.preventDefault(),this.trigger("tap"))}))},r.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var t,e=Yr(this.player(),this.player().reportUserActivity);this.on("touchstart",(function(){e(),this.clearInterval(t),t=this.setInterval(e,250)}));var r=function(r){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",r),this.on("touchcancel",r)}},r.setTimeout=function(t,r){var n,i=this;return t=Yr(this,t),this.clearTimersOnDispose_(),n=e().setTimeout((function(){i.setTimeoutIds_.has(n)&&i.setTimeoutIds_.delete(n),t()}),r),this.setTimeoutIds_.add(n),n},r.clearTimeout=function(t){return this.setTimeoutIds_.has(t)&&(this.setTimeoutIds_.delete(t),e().clearTimeout(t)),t},r.setInterval=function(t,r){t=Yr(this,t),this.clearTimersOnDispose_();var n=e().setInterval(t,r);return this.setIntervalIds_.add(n),n},r.clearInterval=function(t){return this.setIntervalIds_.has(t)&&(this.setIntervalIds_.delete(t),e().clearInterval(t)),t},r.requestAnimationFrame=function(t){var r,n=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),t=Yr(this,t),r=e().requestAnimationFrame((function(){n.rafIds_.has(r)&&n.rafIds_.delete(r),t()})),this.rafIds_.add(r),r):this.setTimeout(t,1e3/60)},r.requestNamedAnimationFrame=function(t,e){var r=this;if(!this.namedRafs_.has(t)){this.clearTimersOnDispose_(),e=Yr(this,e);var n=this.requestAnimationFrame((function(){e(),r.namedRafs_.has(t)&&r.namedRafs_.delete(t)}));return this.namedRafs_.set(t,n),t}},r.cancelNamedAnimationFrame=function(t){this.namedRafs_.has(t)&&(this.cancelAnimationFrame(this.namedRafs_.get(t)),this.namedRafs_.delete(t))},r.cancelAnimationFrame=function(t){return this.supportsRaf_?(this.rafIds_.has(t)&&(this.rafIds_.delete(t),e().cancelAnimationFrame(t)),t):this.clearTimeout(t)},r.clearTimersOnDispose_=function(){var t=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",(function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach((function(e){var r=e[0],n=e[1];t[r].forEach((function(e,r){return t[n](r)}))})),t.clearingTimersOnDispose_=!1})))},t.registerComponent=function(e,r){if("string"!=typeof e||!e)throw new Error('Illegal component name, "'+e+'"; must be a non-empty string.');var n=t.getComponent("Tech"),i=n&&n.isTech(r),o=t===r||t.prototype.isPrototypeOf(r.prototype);if(i||!o)throw new Error('Illegal component, "'+e+'"; '+(i?"techs must be registered using Tech.registerTech()":"must be a Component subclass")+".");e=hn(e),t.components_||(t.components_={});var a=t.getComponent("Player");if("Player"===e&&a&&a.players){var s=a.players,u=Object.keys(s);if(s&&u.length>0&&u.map((function(t){return s[t]})).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return t.components_[e]=r,t.components_[fn(e)]=r,r},t.getComponent=function(e){if(e&&t.components_)return t.components_[e]},t}();function bn(t,e,r,n){return function(t,e,r){if("number"!=typeof e||e<0||e>r)throw new Error("Failed to execute '"+t+"' on 'TimeRanges': The index provided ("+e+") is non-numeric or out of bounds (0-"+r+").")}(t,n,r.length-1),r[n][e]}function _n(t){return void 0===t||0===t.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:t.length,start:bn.bind(null,"start",0,t),end:bn.bind(null,"end",1,t)}}function wn(t,e){return Array.isArray(t)?_n(t):void 0===t||void 0===e?_n():_n([[t,e]])}function Tn(t,e){var r,n,i=0;if(!e)return 0;t&&t.length||(t=wn(0,0));for(var o=0;o<t.length;o++)r=t.start(o),(n=t.end(o))>e&&(n=e),i+=n-r;return i/e}function Sn(t){if(t instanceof Sn)return t;"number"==typeof t?this.code=t:"string"==typeof t?this.message=t:be(t)&&("number"==typeof t.code&&(this.code=t.code),ge(this,t)),this.message||(this.message=Sn.defaultMessages[this.code]||"")}gn.prototype.supportsRaf_="function"==typeof e().requestAnimationFrame&&"function"==typeof e().cancelAnimationFrame,gn.registerComponent("Component",gn),Sn.prototype.code=0,Sn.prototype.message="",Sn.prototype.status=null,Sn.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Sn.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 En=0;En<Sn.errorTypes.length;En++)Sn[Sn.errorTypes[En]]=En,Sn.prototype[Sn.errorTypes[En]]=En;function On(t){return null!=t&&"function"==typeof t.then}function kn(t){On(t)&&t.then(null,(function(t){}))}var Cn=function(t){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((function(e,r,n){return t[r]&&(e[r]=t[r]),e}),{cues:t.cues&&Array.prototype.map.call(t.cues,(function(t){return{startTime:t.startTime,endTime:t.endTime,text:t.text,id:t.id}}))})},Pn="vjs-modal-dialog",xn=function(t){function r(e,r){var n;return(n=t.call(this,e,r)||this).handleKeyDown_=function(t){return n.handleKeyDown(t)},n.close_=function(t){return n.close(t)},n.opened_=n.hasBeenOpened_=n.hasBeenFilled_=!1,n.closeable(!n.options_.uncloseable),n.content(n.options_.content),n.contentEl_=Je("div",{className:Pn+"-content"},{role:"document"}),n.descEl_=Je("p",{className:Pn+"-description vjs-control-text",id:n.el().getAttribute("aria-describedby")}),Ze(n.descEl_,n.description()),n.el_.appendChild(n.descEl_),n.el_.appendChild(n.contentEl_),n}l(r,t);var n=r.prototype;return n.createEl=function(){return t.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},n.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,t.prototype.dispose.call(this)},n.buildCSSClass=function(){return Pn+" vjs-hidden "+t.prototype.buildCSSClass.call(this)},n.label=function(){return this.localize(this.options_.label||"Modal Window")},n.description=function(){var t=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(t+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),t},n.open=function(){if(!this.opened_){var t=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!t.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&t.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=t.controls(),t.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}},n.opened=function(t){return"boolean"==typeof t&&this[t?"open":"close"](),this.opened_},n.close=function(){if(this.opened_){var t=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&t.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&t.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}},n.closeable=function(t){if("boolean"==typeof t){var e=this.closeable_=!!t,r=this.getChild("closeButton");if(e&&!r){var n=this.contentEl_;this.contentEl_=this.el_,r=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=n,this.on(r,"close",this.close_)}!e&&r&&(this.off(r,"close",this.close_),this.removeChild(r),r.dispose())}return this.closeable_},n.fill=function(){this.fillWith(this.content())},n.fillWith=function(t){var e=this.contentEl(),r=e.parentNode,n=e.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,r.removeChild(e),this.empty(),br(e,t),this.trigger("modalfill"),n?r.insertBefore(e,n):r.appendChild(e);var i=this.getChild("closeButton");i&&r.appendChild(i.el_)},n.empty=function(){this.trigger("beforemodalempty"),mr(this.contentEl()),this.trigger("modalempty")},n.content=function(t){return void 0!==t&&(this.content_=t),this.content_},n.conditionalFocus_=function(){var t=o().activeElement,e=this.player_.el_;this.previouslyActiveEl_=null,(e.contains(t)||e===t)&&(this.previouslyActiveEl_=t,this.focus())},n.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)},n.handleKeyDown=function(t){if(t.stopPropagation(),p().isEventKey(t,"Escape")&&this.closeable())return t.preventDefault(),void this.close();if(p().isEventKey(t,"Tab")){for(var e,r=this.focusableEls_(),n=this.el_.querySelector(":focus"),i=0;i<r.length;i++)if(n===r[i]){e=i;break}o().activeElement===this.el_&&(e=0),t.shiftKey&&0===e?(r[r.length-1].focus(),t.preventDefault()):t.shiftKey||e!==r.length-1||(r[0].focus(),t.preventDefault())}},n.focusableEls_=function(){var t=this.el_.querySelectorAll("*");return Array.prototype.filter.call(t,(function(t){return(t instanceof e().HTMLAnchorElement||t instanceof e().HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof e().HTMLInputElement||t instanceof e().HTMLSelectElement||t instanceof e().HTMLTextAreaElement||t instanceof e().HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof e().HTMLIFrameElement||t instanceof e().HTMLObjectElement||t instanceof e().HTMLEmbedElement||t.hasAttribute("tabindex")&&-1!==t.getAttribute("tabindex")||t.hasAttribute("contenteditable")}))},r}(gn);xn.prototype.options_={pauseOnOpen:!0,temporary:!0},gn.registerComponent("ModalDialog",xn);var jn=function(t){function e(e){var r;void 0===e&&(e=[]),(r=t.call(this)||this).tracks_=[],Object.defineProperty(s(r),"length",{get:function(){return this.tracks_.length}});for(var n=0;n<e.length;n++)r.addTrack(e[n]);return r}l(e,t);var r=e.prototype;return r.addTrack=function(t){var e=this,r=this.tracks_.length;""+r in this||Object.defineProperty(this,r,{get:function(){return this.tracks_[r]}}),-1===this.tracks_.indexOf(t)&&(this.tracks_.push(t),this.trigger({track:t,type:"addtrack",target:this})),t.labelchange_=function(){e.trigger({track:t,type:"labelchange",target:e})},Zr(t)&&t.addEventListener("labelchange",t.labelchange_)},r.removeTrack=function(t){for(var e,r=0,n=this.length;r<n;r++)if(this[r]===t){(e=this[r]).off&&e.off(),this.tracks_.splice(r,1);break}e&&this.trigger({track:e,type:"removetrack",target:this})},r.getTrackById=function(t){for(var e=null,r=0,n=this.length;r<n;r++){var i=this[r];if(i.id===t){e=i;break}}return e},e}($r);for(var Ln in jn.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"},jn.prototype.allowedEvents_)jn.prototype["on"+Ln]=null;var In=function(t,e){for(var r=0;r<t.length;r++)Object.keys(t[r]).length&&e.id!==t[r].id&&(t[r].enabled=!1)},An=function(t){function e(e){var r;void 0===e&&(e=[]);for(var n=e.length-1;n>=0;n--)if(e[n].enabled){In(e,e[n]);break}return(r=t.call(this,e)||this).changing_=!1,r}l(e,t);var r=e.prototype;return r.addTrack=function(e){var r=this;e.enabled&&In(this,e),t.prototype.addTrack.call(this,e),e.addEventListener&&(e.enabledChange_=function(){r.changing_||(r.changing_=!0,In(r,e),r.changing_=!1,r.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))},r.removeTrack=function(e){t.prototype.removeTrack.call(this,e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)},e}(jn),Rn=function(t,e){for(var r=0;r<t.length;r++)Object.keys(t[r]).length&&e.id!==t[r].id&&(t[r].selected=!1)},Dn=function(t){function e(e){var r;void 0===e&&(e=[]);for(var n=e.length-1;n>=0;n--)if(e[n].selected){Rn(e,e[n]);break}return(r=t.call(this,e)||this).changing_=!1,Object.defineProperty(s(r),"selectedIndex",{get:function(){for(var t=0;t<this.length;t++)if(this[t].selected)return t;return-1},set:function(){}}),r}l(e,t);var r=e.prototype;return r.addTrack=function(e){var r=this;e.selected&&Rn(this,e),t.prototype.addTrack.call(this,e),e.addEventListener&&(e.selectedChange_=function(){r.changing_||(r.changing_=!0,Rn(r,e),r.changing_=!1,r.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))},r.removeTrack=function(e){t.prototype.removeTrack.call(this,e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)},e}(jn),Mn=function(t){function e(){return t.apply(this,arguments)||this}l(e,t);var r=e.prototype;return r.addTrack=function(e){var r=this;t.prototype.addTrack.call(this,e),this.queueChange_||(this.queueChange_=function(){return r.queueTrigger("change")}),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=function(){return r.trigger("selectedlanguagechange")}),e.addEventListener("modechange",this.queueChange_),-1===["metadata","chapters"].indexOf(e.kind)&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)},r.removeTrack=function(e){t.prototype.removeTrack.call(this,e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))},e}(jn),Nn=function(){function t(t){void 0===t&&(t=[]),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var e=0,r=t.length;e<r;e++)this.addTrackElement_(t[e])}var e=t.prototype;return e.addTrackElement_=function(t){var e=this.trackElements_.length;""+e in this||Object.defineProperty(this,e,{get:function(){return this.trackElements_[e]}}),-1===this.trackElements_.indexOf(t)&&this.trackElements_.push(t)},e.getTrackElementByTrack_=function(t){for(var e,r=0,n=this.trackElements_.length;r<n;r++)if(t===this.trackElements_[r].track){e=this.trackElements_[r];break}return e},e.removeTrackElement_=function(t){for(var e=0,r=this.trackElements_.length;e<r;e++)if(t===this.trackElements_[e]){this.trackElements_[e].track&&"function"==typeof this.trackElements_[e].track.off&&this.trackElements_[e].track.off(),"function"==typeof this.trackElements_[e].off&&this.trackElements_[e].off(),this.trackElements_.splice(e,1);break}},t}(),Bn=function(){function t(e){t.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get:function(){return this.length_}})}var e=t.prototype;return e.setCues_=function(t){var e=this.length||0,r=0,n=t.length;this.cues_=t,this.length_=t.length;var i=function(t){""+t in this||Object.defineProperty(this,""+t,{get:function(){return this.cues_[t]}})};if(e<n)for(r=e;r<n;r++)i.call(this,r)},e.getCueById=function(t){for(var e=null,r=0,n=this.length;r<n;r++){var i=this[r];if(i.id===t){e=i;break}}return e},t}(),Un={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Fn={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},Vn={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Hn={disabled:"disabled",hidden:"hidden",showing:"showing"},qn=function(t){function e(e){var r;void 0===e&&(e={}),r=t.call(this)||this;var n={id:e.id||"vjs_track_"+Ar(),kind:e.kind||"",language:e.language||""},i=e.label||"",o=function(t){Object.defineProperty(s(r),t,{get:function(){return n[t]},set:function(){}})};for(var a in n)o(a);return Object.defineProperty(s(r),"label",{get:function(){return i},set:function(t){t!==i&&(i=t,this.trigger("labelchange"))}}),r}return l(e,t),e}($r),zn=function(t){var r=["protocol","hostname","port","pathname","search","hash","host"],n=o().createElement("a");n.href=t;var i,a=""===n.host&&"file:"!==n.protocol;a&&((i=o().createElement("div")).innerHTML='<a href="'+t+'"></a>',n=i.firstChild,i.setAttribute("style","display:none; position:absolute;"),o().body.appendChild(i));for(var s={},u=0;u<r.length;u++)s[r[u]]=n[r[u]];return"http:"===s.protocol&&(s.host=s.host.replace(/:80$/,"")),"https:"===s.protocol&&(s.host=s.host.replace(/:443$/,"")),s.protocol||(s.protocol=e().location.protocol),a&&o().body.removeChild(i),s},Wn=function(t){if(!t.match(/^https?:\/\//)){var e=o().createElement("div");e.innerHTML='<a href="'+t+'">x</a>',t=e.firstChild.href}return t},Gn=function(t){if("string"==typeof t){var e=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(t);if(e)return e.pop().toLowerCase()}return""},Xn=function(t,r){void 0===r&&(r=e().location);var n=zn(t);return(":"===n.protocol?r.protocol:n.protocol)+n.host!==r.protocol+r.host},Kn=Object.freeze({__proto__:null,parseUrl:zn,getAbsoluteURL:Wn,getFileExtension:Gn,isCrossOrigin:Xn}),Yn=function(t,r){var n=new(e().WebVTT.Parser)(e(),e().vttjs,e().WebVTT.StringDecoder()),i=[];n.oncue=function(t){r.addCue(t)},n.onparsingerror=function(t){i.push(t)},n.onflush=function(){r.trigger({type:"loadeddata",target:r})},n.parse(t),i.length>0&&(e().console&&e().console.groupCollapsed&&e().console.groupCollapsed("Text Track parsing errors for "+r.src),i.forEach((function(t){return pe.error(t)})),e().console&&e().console.groupEnd&&e().console.groupEnd()),n.flush()},Qn=function(t,r){var n={uri:t},i=Xn(t);i&&(n.cors=i);var o="use-credentials"===r.tech_.crossOrigin();o&&(n.withCredentials=o),y()(n,Yr(this,(function(t,n,i){if(t)return pe.error(t,n);r.loaded_=!0,"function"!=typeof e().WebVTT?r.tech_&&r.tech_.any(["vttjsloaded","vttjserror"],(function(t){if("vttjserror"!==t.type)return Yn(i,r);pe.error("vttjs failed to load, stopping trying to process "+r.src)})):Yn(i,r)})))},$n=function(t){function r(e){var r;if(void 0===e&&(e={}),!e.tech)throw new Error("A tech was not provided.");var n=pn(e,{kind:Vn[e.kind]||"subtitles",language:e.language||e.srclang||""}),i=Hn[n.mode]||"disabled",o=n.default;"metadata"!==n.kind&&"chapters"!==n.kind||(i="hidden"),(r=t.call(this,n)||this).tech_=n.tech,r.cues_=[],r.activeCues_=[],r.preload_=!1!==r.tech_.preloadTextTracks;var a=new Bn(r.cues_),u=new Bn(r.activeCues_),l=!1,c=Yr(s(r),(function(){this.tech_.isReady_&&!this.tech_.isDisposed()&&(this.activeCues=this.activeCues,l&&(this.trigger("cuechange"),l=!1))}));return r.tech_.one("dispose",(function(){r.tech_.off("timeupdate",c)})),"disabled"!==i&&r.tech_.on("timeupdate",c),Object.defineProperties(s(r),{default:{get:function(){return o},set:function(){}},mode:{get:function(){return i},set:function(t){Hn[t]&&i!==t&&(i=t,this.preload_||"disabled"===i||0!==this.cues.length||Qn(this.src,this),this.tech_.off("timeupdate",c),"disabled"!==i&&this.tech_.on("timeupdate",c),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?a:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return u;for(var t=this.tech_.currentTime(),e=[],r=0,n=this.cues.length;r<n;r++){var i=this.cues[r];(i.startTime<=t&&i.endTime>=t||i.startTime===i.endTime&&i.startTime<=t&&i.startTime+.5>=t)&&e.push(i)}if(l=!1,e.length!==this.activeCues_.length)l=!0;else for(var o=0;o<e.length;o++)-1===this.activeCues_.indexOf(e[o])&&(l=!0);return this.activeCues_=e,u.setCues_(this.activeCues_),u},set:function(){}}}),n.src?(r.src=n.src,r.preload_||(r.loaded_=!0),(r.preload_||"subtitles"!==n.kind&&"captions"!==n.kind)&&Qn(r.src,s(r))):r.loaded_=!0,r}l(r,t);var n=r.prototype;return n.addCue=function(t){var r=t;if(e().vttjs&&!(t instanceof e().vttjs.VTTCue)){for(var n in r=new(e().vttjs.VTTCue)(t.startTime,t.endTime,t.text),t)n in r||(r[n]=t[n]);r.id=t.id,r.originalCue_=t}for(var i=this.tech_.textTracks(),o=0;o<i.length;o++)i[o]!==this&&i[o].removeCue(r);this.cues_.push(r),this.cues.setCues_(this.cues_)},n.removeCue=function(t){for(var e=this.cues_.length;e--;){var r=this.cues_[e];if(r===t||r.originalCue_&&r.originalCue_===t){this.cues_.splice(e,1),this.cues.setCues_(this.cues_);break}}},r}(qn);$n.prototype.allowedEvents_={cuechange:"cuechange"};var Jn=function(t){function e(e){var r;void 0===e&&(e={});var n=pn(e,{kind:Fn[e.kind]||""});r=t.call(this,n)||this;var i=!1;return Object.defineProperty(s(r),"enabled",{get:function(){return i},set:function(t){"boolean"==typeof t&&t!==i&&(i=t,this.trigger("enabledchange"))}}),n.enabled&&(r.enabled=n.enabled),r.loaded_=!0,r}return l(e,t),e}(qn),Zn=function(t){function e(e){var r;void 0===e&&(e={});var n=pn(e,{kind:Un[e.kind]||""});r=t.call(this,n)||this;var i=!1;return Object.defineProperty(s(r),"selected",{get:function(){return i},set:function(t){"boolean"==typeof t&&t!==i&&(i=t,this.trigger("selectedchange"))}}),n.selected&&(r.selected=n.selected),r}return l(e,t),e}(qn),ti=function(t){function e(e){var r,n;void 0===e&&(e={}),r=t.call(this)||this;var i=new $n(e);return r.kind=i.kind,r.src=i.src,r.srclang=i.language,r.label=i.label,r.default=i.default,Object.defineProperties(s(r),{readyState:{get:function(){return n}},track:{get:function(){return i}}}),n=0,i.addEventListener("loadeddata",(function(){n=2,r.trigger({type:"load",target:s(r)})})),r}return l(e,t),e}($r);ti.prototype.allowedEvents_={load:"load"},ti.NONE=0,ti.LOADING=1,ti.LOADED=2,ti.ERROR=3;var ei={audio:{ListClass:An,TrackClass:Jn,capitalName:"Audio"},video:{ListClass:Dn,TrackClass:Zn,capitalName:"Video"},text:{ListClass:Mn,TrackClass:$n,capitalName:"Text"}};Object.keys(ei).forEach((function(t){ei[t].getterName=t+"Tracks",ei[t].privateName=t+"Tracks_"}));var ri={remoteText:{ListClass:Mn,TrackClass:$n,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Nn,TrackClass:ti,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},ni=a({},ei,ri);ri.names=Object.keys(ri),ei.names=Object.keys(ei),ni.names=[].concat(ri.names).concat(ei.names);var ii=function(t){function r(e,r){var n;return void 0===e&&(e={}),void 0===r&&(r=function(){}),e.reportTouchActivity=!1,(n=t.call(this,null,e,r)||this).onDurationChange_=function(t){return n.onDurationChange(t)},n.trackProgress_=function(t){return n.trackProgress(t)},n.trackCurrentTime_=function(t){return n.trackCurrentTime(t)},n.stopTrackingCurrentTime_=function(t){return n.stopTrackingCurrentTime(t)},n.disposeSourceHandler_=function(t){return n.disposeSourceHandler(t)},n.hasStarted_=!1,n.on("playing",(function(){this.hasStarted_=!0})),n.on("loadstart",(function(){this.hasStarted_=!1})),ni.names.forEach((function(t){var r=ni[t];e&&e[r.getterName]&&(n[r.privateName]=e[r.getterName])})),n.featuresProgressEvents||n.manualProgressOn(),n.featuresTimeupdateEvents||n.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach((function(t){!1===e["native"+t+"Tracks"]&&(n["featuresNative"+t+"Tracks"]=!1)})),!1===e.nativeCaptions||!1===e.nativeTextTracks?n.featuresNativeTextTracks=!1:!0!==e.nativeCaptions&&!0!==e.nativeTextTracks||(n.featuresNativeTextTracks=!0),n.featuresNativeTextTracks||n.emulateTextTracks(),n.preloadTextTracks=!1!==e.preloadTextTracks,n.autoRemoteTextTracks_=new ni.text.ListClass,n.initTrackListeners(),e.nativeControlsForTouch||n.emitTapEvents(),n.constructor&&(n.name_=n.constructor.name||"Unknown Tech"),n}l(r,t);var n=r.prototype;return n.triggerSourceset=function(t){var e=this;this.isReady_||this.one("ready",(function(){return e.setTimeout((function(){return e.triggerSourceset(t)}),1)})),this.trigger({src:t,type:"sourceset"})},n.manualProgressOn=function(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)},n.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)},n.trackProgress=function(t){this.stopTrackingProgress(),this.progressInterval=this.setInterval(Yr(this,(function(){var t=this.bufferedPercent();this.bufferedPercent_!==t&&this.trigger("progress"),this.bufferedPercent_=t,1===t&&this.stopTrackingProgress()})),500)},n.onDurationChange=function(t){this.duration_=this.duration()},n.buffered=function(){return wn(0,0)},n.bufferedPercent=function(){return Tn(this.buffered(),this.duration_)},n.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},n.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)},n.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)},n.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval((function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}),250)},n.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},n.dispose=function(){this.clearTracks(ei.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),t.prototype.dispose.call(this)},n.clearTracks=function(t){var e=this;(t=[].concat(t)).forEach((function(t){for(var r=e[t+"Tracks"]()||[],n=r.length;n--;){var i=r[n];"text"===t&&e.removeRemoteTextTrack(i),r.removeTrack(i)}}))},n.cleanupAutoTextTracks=function(){for(var t=this.autoRemoteTextTracks_||[],e=t.length;e--;){var r=t[e];this.removeRemoteTextTrack(r)}},n.reset=function(){},n.crossOrigin=function(){},n.setCrossOrigin=function(){},n.error=function(t){return void 0!==t&&(this.error_=new Sn(t),this.trigger("error")),this.error_},n.played=function(){return this.hasStarted_?wn(0,0):wn()},n.play=function(){},n.setScrubbing=function(){},n.scrubbing=function(){},n.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},n.initTrackListeners=function(){var t=this;ei.names.forEach((function(e){var r=ei[e],n=function(){t.trigger(e+"trackchange")},i=t[r.getterName]();i.addEventListener("removetrack",n),i.addEventListener("addtrack",n),t.on("dispose",(function(){i.removeEventListener("removetrack",n),i.removeEventListener("addtrack",n)}))}))},n.addWebVttScript_=function(){var t=this;if(!e().WebVTT)if(o().body.contains(this.el())){if(!this.options_["vtt.js"]&&_e(v())&&Object.keys(v()).length>0)return void this.trigger("vttjsloaded");var r=o().createElement("script");r.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",r.onload=function(){t.trigger("vttjsloaded")},r.onerror=function(){t.trigger("vttjserror")},this.on("dispose",(function(){r.onload=null,r.onerror=null})),e().WebVTT=!0,this.el().parentNode.appendChild(r)}else this.ready(this.addWebVttScript_)},n.emulateTextTracks=function(){var t=this,e=this.textTracks(),r=this.remoteTextTracks(),n=function(t){return e.addTrack(t.track)},i=function(t){return e.removeTrack(t.track)};r.on("addtrack",n),r.on("removetrack",i),this.addWebVttScript_();var o=function(){return t.trigger("texttrackchange")},a=function(){o();for(var t=0;t<e.length;t++){var r=e[t];r.removeEventListener("cuechange",o),"showing"===r.mode&&r.addEventListener("cuechange",o)}};a(),e.addEventListener("change",a),e.addEventListener("addtrack",a),e.addEventListener("removetrack",a),this.on("dispose",(function(){r.off("addtrack",n),r.off("removetrack",i),e.removeEventListener("change",a),e.removeEventListener("addtrack",a),e.removeEventListener("removetrack",a);for(var t=0;t<e.length;t++)e[t].removeEventListener("cuechange",o)}))},n.addTextTrack=function(t,e,r){if(!t)throw new Error("TextTrack kind is required but was not provided");return function(t,e,r,n,i){void 0===i&&(i={});var o=t.textTracks();i.kind=e,r&&(i.label=r),n&&(i.language=n),i.tech=t;var a=new ni.text.TrackClass(i);return o.addTrack(a),a}(this,t,e,r)},n.createRemoteTextTrack=function(t){var e=pn(t,{tech:this});return new ri.remoteTextEl.TrackClass(e)},n.addRemoteTextTrack=function(t,e){var r=this;void 0===t&&(t={});var n=this.createRemoteTextTrack(t);return!0!==e&&!1!==e&&(pe.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),e=!0),this.remoteTextTrackEls().addTrackElement_(n),this.remoteTextTracks().addTrack(n.track),!0!==e&&this.ready((function(){return r.autoRemoteTextTracks_.addTrack(n.track)})),n},n.removeRemoteTextTrack=function(t){var e=this.remoteTextTrackEls().getTrackElementByTrack_(t);this.remoteTextTrackEls().removeTrackElement_(e),this.remoteTextTracks().removeTrack(t),this.autoRemoteTextTracks_.removeTrack(t)},n.getVideoPlaybackQuality=function(){return{}},n.requestPictureInPicture=function(){var t=this.options_.Promise||e().Promise;if(t)return t.reject()},n.disablePictureInPicture=function(){return!0},n.setDisablePictureInPicture=function(){},n.setPoster=function(){},n.playsinline=function(){},n.setPlaysinline=function(){},n.overrideNativeAudioTracks=function(){},n.overrideNativeVideoTracks=function(){},n.canPlayType=function(){return""},r.canPlayType=function(){return""},r.canPlaySource=function(t,e){return r.canPlayType(t.type)},r.isTech=function(t){return t.prototype instanceof r||t instanceof r||t===r},r.registerTech=function(t,e){if(r.techs_||(r.techs_={}),!r.isTech(e))throw new Error("Tech "+t+" must be a Tech");if(!r.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!r.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return t=hn(t),r.techs_[t]=e,r.techs_[fn(t)]=e,"Tech"!==t&&r.defaultTechOrder_.push(t),e},r.getTech=function(t){if(t)return r.techs_&&r.techs_[t]?r.techs_[t]:(t=hn(t),e()&&e().videojs&&e().videojs[t]?(pe.warn("The "+t+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),e().videojs[t]):void 0)},r}(gn);ni.names.forEach((function(t){var e=ni[t];ii.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}})),ii.prototype.featuresVolumeControl=!0,ii.prototype.featuresMuteControl=!0,ii.prototype.featuresFullscreenResize=!1,ii.prototype.featuresPlaybackRate=!1,ii.prototype.featuresProgressEvents=!1,ii.prototype.featuresSourceset=!1,ii.prototype.featuresTimeupdateEvents=!1,ii.prototype.featuresNativeTextTracks=!1,ii.withSourceHandlers=function(t){t.registerSourceHandler=function(e,r){var n=t.sourceHandlers;n||(n=t.sourceHandlers=[]),void 0===r&&(r=n.length),n.splice(r,0,e)},t.canPlayType=function(e){for(var r,n=t.sourceHandlers||[],i=0;i<n.length;i++)if(r=n[i].canPlayType(e))return r;return""},t.selectSourceHandler=function(e,r){for(var n=t.sourceHandlers||[],i=0;i<n.length;i++)if(n[i].canHandleSource(e,r))return n[i];return null},t.canPlaySource=function(e,r){var n=t.selectSourceHandler(e,r);return n?n.canHandleSource(e,r):""},["seekable","seeking","duration"].forEach((function(t){var e=this[t];"function"==typeof e&&(this[t]=function(){return this.sourceHandler_&&this.sourceHandler_[t]?this.sourceHandler_[t].apply(this.sourceHandler_,arguments):e.apply(this,arguments)})}),t.prototype),t.prototype.setSource=function(e){var r=t.selectSourceHandler(e,this.options_);r||(t.nativeSourceHandler?r=t.nativeSourceHandler:pe.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),r!==t.nativeSourceHandler&&(this.currentSource_=e),this.sourceHandler_=r.handleSource(e,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},t.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)}},gn.registerComponent("Tech",ii),ii.registerTech("Tech",ii),ii.defaultTechOrder_=[];var oi={},ai={},si={};function ui(t,e,r){t.setTimeout((function(){return di(e,oi[e.type],r,t)}),1)}function li(t,e,r,n){void 0===n&&(n=null);var i="call"+hn(r),o=t.reduce(pi(i),n),a=o===si,s=a?null:e[r](o);return function(t,e,r,n){for(var i=t.length-1;i>=0;i--){var o=t[i];o[e]&&o[e](n,r)}}(t,r,s,a),s}var ci={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1},fi={setCurrentTime:1,setMuted:1,setVolume:1},hi={play:1,pause:1};function pi(t){return function(e,r){return e===si?si:r[t]?r[t](e):e}}function di(t,e,r,n,i,o){void 0===t&&(t={}),void 0===e&&(e=[]),void 0===i&&(i=[]),void 0===o&&(o=!1);var a=e,s=a[0],u=a.slice(1);if("string"==typeof s)di(t,oi[s],r,n,i,o);else if(s){var l=function(t,e){var r=ai[t.id()],n=null;if(null==r)return n=e(t),ai[t.id()]=[[e,n]],n;for(var i=0;i<r.length;i++){var o=r[i],a=o[0],s=o[1];a===e&&(n=s)}return null===n&&(n=e(t),r.push([e,n])),n}(n,s);if(!l.setSource)return i.push(l),di(t,u,r,n,i,o);l.setSource(ge({},t),(function(e,a){if(e)return di(t,u,r,n,i,o);i.push(l),di(a,t.type===a.type?u:oi[a.type],r,n,i,o)}))}else u.length?di(t,u,r,n,i,o):o?r(t,i):di(t,oi["*"],r,n,i,!0)}var yi={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",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},mi=function(t){void 0===t&&(t="");var e=Gn(t);return yi[e.toLowerCase()]||""},vi=function t(e){if(Array.isArray(e)){var r=[];e.forEach((function(e){e=t(e),Array.isArray(e)?r=r.concat(e):be(e)&&r.push(e)})),e=r}else e="string"==typeof e&&e.trim()?[gi({src:e})]:be(e)&&"string"==typeof e.src&&e.src&&e.src.trim()?[gi(e)]:[];return e};function gi(t){if(!t.type){var e=mi(t.src);e&&(t.type=e)}return t}var bi=function(t){function e(e,r,n){var i,o=pn({createEl:!1},r);if(i=t.call(this,e,o,n)||this,r.playerOptions.sources&&0!==r.playerOptions.sources.length)e.src(r.playerOptions.sources);else for(var a=0,s=r.playerOptions.techOrder;a<s.length;a++){var u=hn(s[a]),l=ii.getTech(u);if(u||(l=gn.getComponent(u)),l&&l.isSupported()){e.loadTech_(u);break}}return i}return l(e,t),e}(gn);gn.registerComponent("MediaLoader",bi);var _i=function(t){function e(e,r){var n;return(n=t.call(this,e,r)||this).handleMouseOver_=function(t){return n.handleMouseOver(t)},n.handleMouseOut_=function(t){return n.handleMouseOut(t)},n.handleClick_=function(t){return n.handleClick(t)},n.handleKeyDown_=function(t){return n.handleKeyDown(t)},n.emitTapEvents(),n.enable(),n}l(e,t);var r=e.prototype;return r.createEl=function(e,r,n){void 0===e&&(e="div"),void 0===r&&(r={}),void 0===n&&(n={}),r=ge({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass(),tabIndex:0},r),"button"===e&&pe.error("Creating a ClickableComponent with an HTML element of "+e+" is not supported; use a Button instead."),n=ge({role:"button"},n),this.tabIndex_=r.tabIndex;var i=t.prototype.createEl.call(this,e,r,n);return this.createControlTextEl(i),i},r.dispose=function(){this.controlTextEl_=null,t.prototype.dispose.call(this)},r.createControlTextEl=function(t){return this.controlTextEl_=Je("span",{className:"vjs-control-text"},{"aria-live":"polite"}),t&&t.appendChild(this.controlTextEl_),this.controlText(this.controlText_,t),this.controlTextEl_},r.controlText=function(t,e){if(void 0===e&&(e=this.el()),void 0===t)return this.controlText_||"Need Text";var r=this.localize(t);this.controlText_=t,Ze(this.controlTextEl_,r),this.nonIconControl||this.player_.options_.noUITitleAttributes||e.setAttribute("title",r)},r.buildCSSClass=function(){return"vjs-control vjs-button "+t.prototype.buildCSSClass.call(this)},r.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))},r.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==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_)},r.handleLanguagechange=function(){this.controlText(this.controlText_)},r.handleClick=function(t){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)},r.handleKeyDown=function(e){p().isEventKey(e,"Space")||p().isEventKey(e,"Enter")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):t.prototype.handleKeyDown.call(this,e)},e}(gn);gn.registerComponent("ClickableComponent",_i);var wi=function(t){function e(e,r){var n;return(n=t.call(this,e,r)||this).update(),n.update_=function(t){return n.update(t)},e.on("posterchange",n.update_),n}l(e,t);var r=e.prototype;return r.dispose=function(){this.player().off("posterchange",this.update_),t.prototype.dispose.call(this)},r.createEl=function(){return Je("div",{className:"vjs-poster",tabIndex:-1})},r.update=function(t){var e=this.player().poster();this.setSrc(e),e?this.show():this.hide()},r.setSrc=function(t){var e="";t&&(e='url("'+t+'")'),this.el_.style.backgroundImage=e},r.handleClick=function(t){if(this.player_.controls()){var e=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;!this.player_.tech(!0)||(Ne||Re)&&e||this.player_.tech(!0).focus(),this.player_.paused()?kn(this.player_.play()):this.player_.pause()}},e}(_i);gn.registerComponent("PosterImage",wi);var Ti="#222",Si={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 Ei(t,e){var r;if(4===t.length)r=t[1]+t[1]+t[2]+t[2]+t[3]+t[3];else{if(7!==t.length)throw new Error("Invalid color code provided, "+t+"; must be formatted as e.g. #f0e or #f604e2.");r=t.slice(1)}return"rgba("+parseInt(r.slice(0,2),16)+","+parseInt(r.slice(2,4),16)+","+parseInt(r.slice(4,6),16)+","+e+")"}function Oi(t,e,r){try{t.style[e]=r}catch(t){return}}var ki=function(t){function r(r,n,i){var o;o=t.call(this,r,n,i)||this;var a=function(t){return o.updateDisplay(t)};return r.on("loadstart",(function(t){return o.toggleDisplay(t)})),r.on("texttrackchange",a),r.on("loadedmetadata",(function(t){return o.preselectTrack(t)})),r.ready(Yr(s(o),(function(){if(r.tech_&&r.tech_.featuresNativeTextTracks)this.hide();else{r.on("fullscreenchange",a),r.on("playerresize",a),e().addEventListener("orientationchange",a),r.on("dispose",(function(){return e().removeEventListener("orientationchange",a)}));for(var t=this.options_.playerOptions.tracks||[],n=0;n<t.length;n++)this.player_.addRemoteTextTrack(t[n],!0);this.preselectTrack()}}))),o}l(r,t);var n=r.prototype;return n.preselectTrack=function(){for(var t,e,r,n={captions:1,subtitles:1},i=this.player_.textTracks(),o=this.player_.cache_.selectedLanguage,a=0;a<i.length;a++){var s=i[a];o&&o.enabled&&o.language&&o.language===s.language&&s.kind in n?s.kind===o.kind?r=s:r||(r=s):o&&!o.enabled?(r=null,t=null,e=null):s.default&&("descriptions"!==s.kind||t?s.kind in n&&!e&&(e=s):t=s)}r?r.mode="showing":e?e.mode="showing":t&&(t.mode="showing")},n.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},n.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{"aria-live":"off","aria-atomic":"true"})},n.clearDisplay=function(){"function"==typeof e().WebVTT&&e().WebVTT.processCues(e(),[],this.el_)},n.updateDisplay=function(){var t=this.player_.textTracks(),e=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),e){for(var r=[],n=0;n<t.length;++n){var i=t[n];"showing"===i.mode&&r.push(i)}this.updateForTrack(r)}else{for(var o=null,a=null,s=t.length;s--;){var u=t[s];"showing"===u.mode&&("descriptions"===u.kind?o=u:a=u)}a?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(a)):o&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(o))}},n.updateDisplayState=function(t){for(var r=this.player_.textTrackSettings.getValues(),n=t.activeCues,i=n.length;i--;){var o=n[i];if(o){var a=o.displayState;if(r.color&&(a.firstChild.style.color=r.color),r.textOpacity&&Oi(a.firstChild,"color",Ei(r.color||"#fff",r.textOpacity)),r.backgroundColor&&(a.firstChild.style.backgroundColor=r.backgroundColor),r.backgroundOpacity&&Oi(a.firstChild,"backgroundColor",Ei(r.backgroundColor||"#000",r.backgroundOpacity)),r.windowColor&&(r.windowOpacity?Oi(a,"backgroundColor",Ei(r.windowColor,r.windowOpacity)):a.style.backgroundColor=r.windowColor),r.edgeStyle&&("dropshadow"===r.edgeStyle?a.firstChild.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px "+Ti:"raised"===r.edgeStyle?a.firstChild.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px "+Ti:"depressed"===r.edgeStyle?a.firstChild.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px "+Ti:"uniform"===r.edgeStyle&&(a.firstChild.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px "+Ti)),r.fontPercent&&1!==r.fontPercent){var s=e().parseFloat(a.style.fontSize);a.style.fontSize=s*r.fontPercent+"px",a.style.height="auto",a.style.top="auto"}r.fontFamily&&"default"!==r.fontFamily&&("small-caps"===r.fontFamily?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=Si[r.fontFamily])}}},n.updateForTrack=function(t){if(Array.isArray(t)||(t=[t]),"function"==typeof e().WebVTT&&!t.every((function(t){return!t.activeCues}))){for(var r=[],n=0;n<t.length;++n)for(var i=t[n],o=0;o<i.activeCues.length;++o)r.push(i.activeCues[o]);e().WebVTT.processCues(e(),r,this.el_);for(var a=0;a<t.length;++a){for(var s=t[a],u=0;u<s.activeCues.length;++u){var l=s.activeCues[u].displayState;rr(l,"vjs-text-track-cue"),rr(l,"vjs-text-track-cue-"+(s.language?s.language:a))}this.player_.textTrackSettings&&this.updateDisplayState(s)}}},r}(gn);gn.registerComponent("TextTrackDisplay",ki);var Ci=function(t){function e(){return t.apply(this,arguments)||this}return l(e,t),e.prototype.createEl=function(){var e=this.player_.isAudio(),r=this.localize(e?"Audio Player":"Video Player"),n=Je("span",{className:"vjs-control-text",innerHTML:this.localize("{1} is loading.",[r])}),i=t.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return i.appendChild(n),i},e}(gn);gn.registerComponent("LoadingSpinner",Ci);var Pi=function(t){function e(){return t.apply(this,arguments)||this}l(e,t);var r=e.prototype;return r.createEl=function(t,e,r){void 0===e&&(e={}),void 0===r&&(r={}),e=ge({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass()},e),r=ge({type:"button"},r);var n=gn.prototype.createEl.call(this,"button",e,r);return this.createControlTextEl(n),n},r.addChild=function(t,e){void 0===e&&(e={});var r=this.constructor.name;return pe.warn("Adding an actionable (user controllable) child to a Button ("+r+") is not supported; use a ClickableComponent instead."),gn.prototype.addChild.call(this,t,e)},r.enable=function(){t.prototype.enable.call(this),this.el_.removeAttribute("disabled")},r.disable=function(){t.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},r.handleKeyDown=function(e){p().isEventKey(e,"Space")||p().isEventKey(e,"Enter")?e.stopPropagation():t.prototype.handleKeyDown.call(this,e)},e}(_i);gn.registerComponent("Button",Pi);var xi=function(t){function e(e,r){var n;return(n=t.call(this,e,r)||this).mouseused_=!1,n.on("mousedown",(function(t){return n.handleMouseDown(t)})),n}l(e,t);var r=e.prototype;return r.buildCSSClass=function(){return"vjs-big-play-button"},r.handleClick=function(t){var e=this.player_.play();if(this.mouseused_&&t.clientX&&t.clientY){var r=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;return kn(e),void(!this.player_.tech(!0)||(Ne||Re)&&r||this.player_.tech(!0).focus())}var n=this.player_.getChild("controlBar"),i=n&&n.getChild("playToggle");if(i){var o=function(){return i.focus()};On(e)?e.then(o,(function(){})):this.setTimeout(o,1)}else this.player_.tech(!0).focus()},r.handleKeyDown=function(e){this.mouseused_=!1,t.prototype.handleKeyDown.call(this,e)},r.handleMouseDown=function(t){this.mouseused_=!0},e}(Pi);xi.prototype.controlText_="Play Video",gn.registerComponent("BigPlayButton",xi);var ji=function(t){function e(e,r){var n;return(n=t.call(this,e,r)||this).controlText(r&&r.controlText||n.localize("Close")),n}l(e,t);var r=e.prototype;return r.buildCSSClass=function(){return"vjs-close-button "+t.prototype.buildCSSClass.call(this)},r.handleClick=function(t){this.trigger({type:"close",bubbles:!1})},r.handleKeyDown=function(e){p().isEventKey(e,"Esc")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):t.prototype.handleKeyDown.call(this,e)},e}(Pi);gn.registerComponent("CloseButton",ji);var Li=function(t){function e(e,r){var n;return void 0===r&&(r={}),n=t.call(this,e,r)||this,r.replay=void 0===r.replay||r.replay,n.on(e,"play",(function(t){return n.handlePlay(t)})),n.on(e,"pause",(function(t){return n.handlePause(t)})),r.replay&&n.on(e,"ended",(function(t){return n.handleEnded(t)})),n}l(e,t);var r=e.prototype;return r.buildCSSClass=function(){return"vjs-play-control "+t.prototype.buildCSSClass.call(this)},r.handleClick=function(t){this.player_.paused()?kn(this.player_.play()):this.player_.pause()},r.handleSeeked=function(t){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(t):this.handlePlay(t)},r.handlePlay=function(t){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},r.handlePause=function(t){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},r.handleEnded=function(t){var e=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",(function(t){return e.handleSeeked(t)}))},e}(Pi);Li.prototype.controlText_="Play",gn.registerComponent("PlayToggle",Li);var Ii=function(t,e){t=t<0?0:t;var r=Math.floor(t%60),n=Math.floor(t/60%60),i=Math.floor(t/3600),o=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(t)||t===1/0)&&(i=n=r="-"),(i=i>0||a>0?i+":":"")+(n=((i||o>=10)&&n<10?"0"+n:n)+":")+(r<10?"0"+r:r)},Ai=Ii;function Ri(t,e){return void 0===e&&(e=t),Ai(t,e)}var Di=function(t){function e(e,r){var n;return(n=t.call(this,e,r)||this).on(e,["timeupdate","ended"],(function(t){return n.updateContent(t)})),n.updateTextNode_(),n}l(e,t);var r=e.prototype;return r.createEl=function(){var e=this.buildCSSClass(),r=t.prototype.createEl.call(this,"div",{className:e+" vjs-time-control vjs-control",innerHTML:'<span class="vjs-control-text" role="presentation">'+this.localize(this.labelText_)+" </span>"});return this.contentEl_=Je("span",{className:e+"-display"},{"aria-live":"off",role:"presentation"}),r.appendChild(this.contentEl_),r},r.dispose=function(){this.contentEl_=null,this.textNode_=null,t.prototype.dispose.call(this)},r.updateTextNode_=function(t){var e=this;void 0===t&&(t=0),t=Ri(t),this.formattedTime_!==t&&(this.formattedTime_=t,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",(function(){if(e.contentEl_){var t=e.textNode_;t&&e.contentEl_.firstChild!==t&&(t=null,pe.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),e.textNode_=o().createTextNode(e.formattedTime_),e.textNode_&&(t?e.contentEl_.replaceChild(e.textNode_,t):e.contentEl_.appendChild(e.textNode_))}})))},r.updateContent=function(t){},e}(gn);Di.prototype.labelText_="Time",Di.prototype.controlText_="Time",gn.registerComponent("TimeDisplay",Di);var Mi=function(t){function e(){return t.apply(this,arguments)||this}l(e,t);var r=e.prototype;return r.buildCSSClass=function(){return"vjs-current-time"},r.updateContent=function(t){var e;e=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(e)},e}(Di);Mi.prototype.labelText_="Current Time",Mi.prototype.controlText_="Current Time",gn.registerComponent("CurrentTimeDisplay",Mi);var Ni=function(t){function e(e,r){var n,i=function(t){return n.updateContent(t)};return(n=t.call(this,e,r)||this).on(e,"durationchange",i),n.on(e,"loadstart",i),n.on(e,"loadedmetadata",i),n}l(e,t);var r=e.prototype;return r.buildCSSClass=function(){return"vjs-duration"},r.updateContent=function(t){var e=this.player_.duration();this.updateTextNode_(e)},e}(Di);Ni.prototype.labelText_="Duration",Ni.prototype.controlText_="Duration",gn.registerComponent("DurationDisplay",Ni);var Bi=function(t){function e(){return t.apply(this,arguments)||this}return l(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"<div><span>/</span></div>"},{"aria-hidden":!0})},e}(gn);gn.registerComponent("TimeDivider",Bi);var Ui=function(t){function e(e,r){var n;return(n=t.call(this,e,r)||this).on(e,"durationchange",(function(t){return n.updateContent(t)})),n}l(e,t);var r=e.prototype;return r.buildCSSClass=function(){return"vjs-remaining-time"},r.createEl=function(){var e=t.prototype.createEl.call(this);return e.insertBefore(Je("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e},r.updateContent=function(t){var e;"number"==typeof this.player_.duration()&&(e=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(e))},e}(Di);Ui.prototype.labelText_="Remaining Time",Ui.prototype.controlText_="Remaining Time",gn.registerComponent("RemainingTimeDisplay",Ui);var Fi=function(t){function e(e,r){var n;return(n=t.call(this,e,r)||this).updateShowing(),n.on(n.player(),"durationchange",(function(t){return n.updateShowing(t)})),n}l(e,t);var r=e.prototype;return r.createEl=function(){var e=t.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=Je("div",{className:"vjs-live-display",innerHTML:'<span class="vjs-control-text">'+this.localize("Stream Type")+" </span>"+this.localize("LIVE")},{"aria-live":"off"}),e.appendChild(this.contentEl_),e},r.dispose=function(){this.contentEl_=null,t.prototype.dispose.call(this)},r.updateShowing=function(t){this.player().duration()===1/0?this.show():this.hide()},e}(gn);gn.registerComponent("LiveDisplay",Fi);var Vi=function(t){function e(e,r){var n;return(n=t.call(this,e,r)||this).updateLiveEdgeStatus(),n.player_.liveTracker&&(n.updateLiveEdgeStatusHandler_=function(t){return n.updateLiveEdgeStatus(t)},n.on(n.player_.liveTracker,"liveedgechange",n.updateLiveEdgeStatusHandler_)),n}l(e,t);var r=e.prototype;return r.createEl=function(){var e=t.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=Je("span",{className:"vjs-seek-to-live-text",innerHTML:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e},r.updateLiveEdgeStatus=function(){!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"))},r.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},r.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,t.prototype.dispose.call(this)},e}(Pi);Vi.prototype.controlText_="Seek to live, currently playing live",gn.registerComponent("SeekToLive",Vi);var Hi=function(t,e,r){return t=Number(t),Math.min(r,Math.max(e,isNaN(t)?e:t))},qi=function(t){function e(e,r){var n;return(n=t.call(this,e,r)||this).handleMouseDown_=function(t){return n.handleMouseDown(t)},n.handleMouseUp_=function(t){return n.handleMouseUp(t)},n.handleKeyDown_=function(t){return n.handleKeyDown(t)},n.handleClick_=function(t){return n.handleClick(t)},n.handleMouseMove_=function(t){return n.handleMouseMove(t)},n.update_=function(t){return n.update(t)},n.bar=n.getChild(n.options_.barName),n.vertical(!!n.options_.vertical),n.enable(),n}l(e,t);var r=e.prototype;return r.enabled=function(){return this.enabled_},r.enable=function(){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)},r.disable=function(){if(this.enabled()){var t=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(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},r.createEl=function(e,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),r.className=r.className+" vjs-slider",r=ge({tabIndex:0},r),n=ge({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},n),t.prototype.createEl.call(this,e,r,n)},r.handleMouseDown=function(t){var e=this.bar.el_.ownerDocument;"mousedown"===t.type&&t.preventDefault(),"touchstart"!==t.type||De||t.preventDefault(),cr(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(e,"mousemove",this.handleMouseMove_),this.on(e,"mouseup",this.handleMouseUp_),this.on(e,"touchmove",this.handleMouseMove_),this.on(e,"touchend",this.handleMouseUp_),this.handleMouseMove(t)},r.handleMouseMove=function(t){},r.handleMouseUp=function(){var t=this.bar.el_.ownerDocument;fr(),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()},r.update=function(){var t=this;if(this.el_&&this.bar){var e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",(function(){var r=t.vertical()?"height":"width";t.bar.el().style[r]=(100*e).toFixed(2)+"%"}))),e}},r.getProgress=function(){return Number(Hi(this.getPercent(),0,1).toFixed(4))},r.calculateDistance=function(t){var e=dr(this.el_,t);return this.vertical()?e.y:e.x},r.handleKeyDown=function(e){p().isEventKey(e,"Left")||p().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):p().isEventKey(e,"Right")||p().isEventKey(e,"Up")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):t.prototype.handleKeyDown.call(this,e)},r.handleClick=function(t){t.stopPropagation(),t.preventDefault()},r.vertical=function(t){if(void 0===t)return this.vertical_||!1;this.vertical_=!!t,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},e}(gn);gn.registerComponent("Slider",qi);var zi=function(t,e){return Hi(t/e*100,0,100).toFixed(2)+"%"},Wi=function(t){function e(e,r){var n;return(n=t.call(this,e,r)||this).partEls_=[],n.on(e,"progress",(function(t){return n.update(t)})),n}l(e,t);var r=e.prototype;return r.createEl=function(){var e=t.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),r=Je("span",{className:"vjs-control-text"}),n=Je("span",{textContent:this.localize("Loaded")}),i=o().createTextNode(": ");return this.percentageEl_=Je("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(r),r.appendChild(n),r.appendChild(i),r.appendChild(this.percentageEl_),e},r.dispose=function(){this.partEls_=null,this.percentageEl_=null,t.prototype.dispose.call(this)},r.update=function(t){var e=this;this.requestNamedAnimationFrame("LoadProgressBar#update",(function(){var t=e.player_.liveTracker,r=e.player_.buffered(),n=t&&t.isLive()?t.seekableEnd():e.player_.duration(),i=e.player_.bufferedEnd(),o=e.partEls_,a=zi(i,n);e.percent_!==a&&(e.el_.style.width=a,Ze(e.percentageEl_,a),e.percent_=a);for(var s=0;s<r.length;s++){var u=r.start(s),l=r.end(s),c=o[s];c||(c=e.el_.appendChild(Je()),o[s]=c),c.dataset.start===u&&c.dataset.end===l||(c.dataset.start=u,c.dataset.end=l,c.style.left=zi(u,i),c.style.width=zi(l-u,i))}for(var f=o.length;f>r.length;f--)e.el_.removeChild(o[f-1]);o.length=r.length}))},e}(gn);gn.registerComponent("LoadProgressBar",Wi);var Gi=function(t){function e(e,r){var n;return(n=t.call(this,e,r)||this).update=Qr(Yr(s(n),n.update),Kr),n}l(e,t);var r=e.prototype;return r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},r.update=function(t,e,r){var n=pr(this.el_),i=hr(this.player_.el()),o=t.width*e;if(i&&n){var a=t.left-i.left+o,s=t.width-o+(i.right-t.right),u=n.width/2;a<u?u+=u-a:s<u&&(u=s),u<0?u=0:u>n.width&&(u=n.width),u=Math.round(u),this.el_.style.right="-"+u+"px",this.write(r)}},r.write=function(t){Ze(this.el_,t)},r.updateTime=function(t,e,r,n){var i=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",(function(){var o,a=i.player_.duration();if(i.player_.liveTracker&&i.player_.liveTracker.isLive()){var s=i.player_.liveTracker.liveWindow(),u=s-e*s;o=(u<1?"":"-")+Ri(u,s)}else o=Ri(r,a);i.update(t,e,o),n&&n()}))},e}(gn);gn.registerComponent("TimeTooltip",Gi);var Xi=function(t){function e(e,r){var n;return(n=t.call(this,e,r)||this).update=Qr(Yr(s(n),n.update),Kr),n}l(e,t);var r=e.prototype;return r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},r.update=function(t,e){var r=this.getChild("timeTooltip");if(r){var n=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();r.updateTime(t,e,n)}},e}(gn);Xi.prototype.options_={children:[]},qe||je||Xi.prototype.options_.children.push("timeTooltip"),gn.registerComponent("PlayProgressBar",Xi);var Ki=function(t){function e(e,r){var n;return(n=t.call(this,e,r)||this).update=Qr(Yr(s(n),n.update),Kr),n}l(e,t);var r=e.prototype;return r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},r.update=function(t,e){var r=this,n=e*this.player_.duration();this.getChild("timeTooltip").updateTime(t,e,n,(function(){r.el_.style.left=t.width*e+"px"}))},e}(gn);Ki.prototype.options_={children:["timeTooltip"]},gn.registerComponent("MouseTimeDisplay",Ki);var Yi=function(t){function e(e,r){var n;return(n=t.call(this,e,r)||this).setEventHandlers_(),n}l(e,t);var r=e.prototype;return r.setEventHandlers_=function(){var t=this;this.update_=Yr(this,this.update),this.update=Qr(this.update_,Kr),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_=function(e){return t.enableInterval_(e)},this.disableIntervalHandler_=function(e){return t.disableInterval_(e)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in o()&&"visibilityState"in o()&&this.on(o(),"visibilitychange",this.toggleVisibility_)},r.toggleVisibility_=function(t){"hidden"===o().visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(t)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())},r.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,Kr))},r.disableInterval_=function(t){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&t&&"ended"!==t.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)},r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},r.update=function(e){var r=this;if("hidden"!==o().visibilityState){var n=t.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",(function(){var t=r.player_.ended()?r.player_.duration():r.getCurrentTime_(),e=r.player_.liveTracker,i=r.player_.duration();e&&e.isLive()&&(i=r.player_.liveTracker.liveCurrentTime()),r.percent_!==n&&(r.el_.setAttribute("aria-valuenow",(100*n).toFixed(2)),r.percent_=n),r.currentTime_===t&&r.duration_===i||(r.el_.setAttribute("aria-valuetext",r.localize("progress bar timing: currentTime={1} duration={2}",[Ri(t,i),Ri(i,i)],"{1} of {2}")),r.currentTime_=t,r.duration_=i),r.bar&&r.bar.update(hr(r.el()),r.getProgress())})),n}},r.userSeek_=function(t){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(t)},r.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},r.getPercent=function(){var t,e=this.getCurrentTime_(),r=this.player_.liveTracker;return r&&r.isLive()?(t=(e-r.seekableStart())/r.liveWindow(),r.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t},r.handleMouseDown=function(e){_r(e)&&(e.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),t.prototype.handleMouseDown.call(this,e))},r.handleMouseMove=function(t){if(_r(t)){var e,r=this.calculateDistance(t),n=this.player_.liveTracker;if(n&&n.isLive()){if(r>=.99)return void n.seekToLiveEdge();var i=n.seekableStart(),o=n.liveCurrentTime();if((e=i+r*n.liveWindow())>=o&&(e=o),e<=i&&(e=i+.1),e===1/0)return}else(e=r*this.player_.duration())===this.player_.duration()&&(e-=.1);this.userSeek_(e)}},r.enable=function(){t.prototype.enable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.show()},r.disable=function(){t.prototype.disable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.hide()},r.handleMouseUp=function(e){t.prototype.handleMouseUp.call(this,e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?kn(this.player_.play()):this.update_()},r.stepForward=function(){this.userSeek_(this.player_.currentTime()+5)},r.stepBack=function(){this.userSeek_(this.player_.currentTime()-5)},r.handleAction=function(t){this.player_.paused()?this.player_.play():this.player_.pause()},r.handleKeyDown=function(e){var r=this.player_.liveTracker;if(p().isEventKey(e,"Space")||p().isEventKey(e,"Enter"))e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(p().isEventKey(e,"Home"))e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(p().isEventKey(e,"End"))e.preventDefault(),e.stopPropagation(),r&&r.isLive()?this.userSeek_(r.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(p()(e))){e.preventDefault(),e.stopPropagation();var n=10*(p().codes[p()(e)]-p().codes[0])/100;r&&r.isLive()?this.userSeek_(r.seekableStart()+r.liveWindow()*n):this.userSeek_(this.player_.duration()*n)}else p().isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):p().isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):t.prototype.handleKeyDown.call(this,e)},r.dispose=function(){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 o()&&"visibilityState"in o()&&this.off(o(),"visibilitychange",this.toggleVisibility_),t.prototype.dispose.call(this)},e}(qi);Yi.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},qe||je||Yi.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),gn.registerComponent("SeekBar",Yi);var Qi=function(t){function e(e,r){var n;return(n=t.call(this,e,r)||this).handleMouseMove=Qr(Yr(s(n),n.handleMouseMove),Kr),n.throttledHandleMouseSeek=Qr(Yr(s(n),n.handleMouseSeek),Kr),n.handleMouseUpHandler_=function(t){return n.handleMouseUp(t)},n.handleMouseDownHandler_=function(t){return n.handleMouseDown(t)},n.enable(),n}l(e,t);var r=e.prototype;return r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},r.handleMouseMove=function(t){var e=this.getChild("seekBar");if(e){var r=e.getChild("playProgressBar"),n=e.getChild("mouseTimeDisplay");if(r||n){var i=e.el(),o=pr(i),a=dr(i,t).x;a=Hi(a,0,1),n&&n.update(o,a),r&&r.update(o,e.getProgress())}}},r.handleMouseSeek=function(t){var e=this.getChild("seekBar");e&&e.handleMouseMove(t)},r.enabled=function(){return this.enabled_},r.disable=function(){if(this.children().forEach((function(t){return t.disable&&t.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())){var t=this.getChild("seekBar");this.player_.scrubbing(!1),t.videoWasPlaying&&kn(this.player_.play())}},r.enable=function(){this.children().forEach((function(t){return t.enable&&t.enable()})),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},r.removeListenersAddedOnMousedownAndTouchstart=function(){var t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseSeek),this.off(t,"touchmove",this.throttledHandleMouseSeek),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)},r.handleMouseDown=function(t){var e=this.el_.ownerDocument,r=this.getChild("seekBar");r&&r.handleMouseDown(t),this.on(e,"mousemove",this.throttledHandleMouseSeek),this.on(e,"touchmove",this.throttledHandleMouseSeek),this.on(e,"mouseup",this.handleMouseUpHandler_),this.on(e,"touchend",this.handleMouseUpHandler_)},r.handleMouseUp=function(t){var e=this.getChild("seekBar");e&&e.handleMouseUp(t),this.removeListenersAddedOnMousedownAndTouchstart()},e}(gn);Qi.prototype.options_={children:["seekBar"]},gn.registerComponent("ProgressControl",Qi);var $i=function(t){function e(e,r){var n;return(n=t.call(this,e,r)||this).on(e,["enterpictureinpicture","leavepictureinpicture"],(function(t){return n.handlePictureInPictureChange(t)})),n.on(e,["disablepictureinpicturechanged","loadedmetadata"],(function(t){return n.handlePictureInPictureEnabledChange(t)})),n.disable(),n}l(e,t);var r=e.prototype;return r.buildCSSClass=function(){return"vjs-picture-in-picture-control "+t.prototype.buildCSSClass.call(this)},r.handlePictureInPictureEnabledChange=function(){o().pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()?this.enable():this.disable()},r.handlePictureInPictureChange=function(t){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},r.handleClick=function(t){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},e}(Pi);$i.prototype.controlText_="Picture-in-Picture",gn.registerComponent("PictureInPictureToggle",$i);var Ji=function(t){function e(e,r){var n;return(n=t.call(this,e,r)||this).on(e,"fullscreenchange",(function(t){return n.handleFullscreenChange(t)})),!1===o()[e.fsApi_.fullscreenEnabled]&&n.disable(),n}l(e,t);var r=e.prototype;return r.buildCSSClass=function(){return"vjs-fullscreen-control "+t.prototype.buildCSSClass.call(this)},r.handleFullscreenChange=function(t){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},r.handleClick=function(t){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},e}(Pi);Ji.prototype.controlText_="Fullscreen",gn.registerComponent("FullscreenToggle",Ji);var Zi=function(t){function e(){return t.apply(this,arguments)||this}return l(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:'<span class="vjs-control-text"></span>'})},e}(gn);gn.registerComponent("VolumeLevel",Zi);var to=function(t){function e(e,r){var n;return(n=t.call(this,e,r)||this).update=Qr(Yr(s(n),n.update),Kr),n}l(e,t);var r=e.prototype;return r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},r.update=function(t,e,r,n){if(!r){var i=hr(this.el_),o=hr(this.player_.el()),a=t.width*e;if(!o||!i)return;var s=t.left-o.left+a,u=t.width-a+(o.right-t.right),l=i.width/2;s<l?l+=l-s:u<l&&(l=u),l<0?l=0:l>i.width&&(l=i.width),this.el_.style.right="-"+l+"px"}this.write(n+"%")},r.write=function(t){Ze(this.el_,t)},r.updateVolume=function(t,e,r,n,i){var o=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",(function(){o.update(t,e,r,n.toFixed(0)),i&&i()}))},e}(gn);gn.registerComponent("VolumeLevelTooltip",to);var eo=function(t){function e(e,r){var n;return(n=t.call(this,e,r)||this).update=Qr(Yr(s(n),n.update),Kr),n}l(e,t);var r=e.prototype;return r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},r.update=function(t,e,r){var n=this,i=100*e;this.getChild("volumeLevelTooltip").updateVolume(t,e,r,i,(function(){r?n.el_.style.bottom=t.height*e+"px":n.el_.style.left=t.width*e+"px"}))},e}(gn);eo.prototype.options_={children:["volumeLevelTooltip"]},gn.registerComponent("MouseVolumeLevelDisplay",eo);var ro=function(t){function e(e,r){var n;return(n=t.call(this,e,r)||this).on("slideractive",(function(t){return n.updateLastVolume_(t)})),n.on(e,"volumechange",(function(t){return n.updateARIAAttributes(t)})),e.ready((function(){return n.updateARIAAttributes()})),n}l(e,t);var r=e.prototype;return r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},r.handleMouseDown=function(e){_r(e)&&t.prototype.handleMouseDown.call(this,e)},r.handleMouseMove=function(t){var e=this.getChild("mouseVolumeLevelDisplay");if(e){var r=this.el(),n=hr(r),i=this.vertical(),o=dr(r,t);o=i?o.y:o.x,o=Hi(o,0,1),e.update(n,o,i)}_r(t)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(t)))},r.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},r.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},r.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},r.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},r.updateARIAAttributes=function(t){var e=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",e),this.el_.setAttribute("aria-valuetext",e+"%")},r.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},r.updateLastVolume_=function(){var t=this,e=this.player_.volume();this.one("sliderinactive",(function(){0===t.player_.volume()&&t.player_.lastVolume_(e)}))},e}(qi);ro.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},qe||je||ro.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),ro.prototype.playerEvent="volumechange",gn.registerComponent("VolumeBar",ro);var no=function(t){function e(e,r){var n;return void 0===r&&(r={}),r.vertical=r.vertical||!1,(void 0===r.volumeBar||_e(r.volumeBar))&&(r.volumeBar=r.volumeBar||{},r.volumeBar.vertical=r.vertical),function(t,e){e.tech_&&!e.tech_.featuresVolumeControl&&t.addClass("vjs-hidden"),t.on(e,"loadstart",(function(){e.tech_.featuresVolumeControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")}))}(s(n=t.call(this,e,r)||this),e),n.throttledHandleMouseMove=Qr(Yr(s(n),n.handleMouseMove),Kr),n.handleMouseUpHandler_=function(t){return n.handleMouseUp(t)},n.on("mousedown",(function(t){return n.handleMouseDown(t)})),n.on("touchstart",(function(t){return n.handleMouseDown(t)})),n.on("mousemove",(function(t){return n.handleMouseMove(t)})),n.on(n.volumeBar,["focus","slideractive"],(function(){n.volumeBar.addClass("vjs-slider-active"),n.addClass("vjs-slider-active"),n.trigger("slideractive")})),n.on(n.volumeBar,["blur","sliderinactive"],(function(){n.volumeBar.removeClass("vjs-slider-active"),n.removeClass("vjs-slider-active"),n.trigger("sliderinactive")})),n}l(e,t);var r=e.prototype;return r.createEl=function(){var e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),t.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+e})},r.handleMouseDown=function(t){var e=this.el_.ownerDocument;this.on(e,"mousemove",this.throttledHandleMouseMove),this.on(e,"touchmove",this.throttledHandleMouseMove),this.on(e,"mouseup",this.handleMouseUpHandler_),this.on(e,"touchend",this.handleMouseUpHandler_)},r.handleMouseUp=function(t){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseMove),this.off(e,"touchmove",this.throttledHandleMouseMove),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)},r.handleMouseMove=function(t){this.volumeBar.handleMouseMove(t)},e}(gn);no.prototype.options_={children:["volumeBar"]},gn.registerComponent("VolumeControl",no);var io=function(t){function e(e,r){var n;return function(t,e){e.tech_&&!e.tech_.featuresMuteControl&&t.addClass("vjs-hidden"),t.on(e,"loadstart",(function(){e.tech_.featuresMuteControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")}))}(s(n=t.call(this,e,r)||this),e),n.on(e,["loadstart","volumechange"],(function(t){return n.update(t)})),n}l(e,t);var r=e.prototype;return r.buildCSSClass=function(){return"vjs-mute-control "+t.prototype.buildCSSClass.call(this)},r.handleClick=function(t){var e=this.player_.volume(),r=this.player_.lastVolume_();if(0===e){var n=r<.1?.1:r;this.player_.volume(n),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},r.update=function(t){this.updateIcon_(),this.updateControlText_()},r.updateIcon_=function(){var t=this.player_.volume(),e=3;qe&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===t||this.player_.muted()?e=0:t<.33?e=1:t<.67&&(e=2);for(var r=0;r<4;r++)nr(this.el_,"vjs-vol-"+r);rr(this.el_,"vjs-vol-"+e)},r.updateControlText_=function(){var t=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)},e}(Pi);io.prototype.controlText_="Mute",gn.registerComponent("MuteToggle",io);var oo=function(t){function e(e,r){var n;return void 0===r&&(r={}),void 0!==r.inline?r.inline=r.inline:r.inline=!0,(void 0===r.volumeControl||_e(r.volumeControl))&&(r.volumeControl=r.volumeControl||{},r.volumeControl.vertical=!r.inline),(n=t.call(this,e,r)||this).handleKeyPressHandler_=function(t){return n.handleKeyPress(t)},n.on(e,["loadstart"],(function(t){return n.volumePanelState_(t)})),n.on(n.muteToggle,"keyup",(function(t){return n.handleKeyPress(t)})),n.on(n.volumeControl,"keyup",(function(t){return n.handleVolumeControlKeyUp(t)})),n.on("keydown",(function(t){return n.handleKeyPress(t)})),n.on("mouseover",(function(t){return n.handleMouseOver(t)})),n.on("mouseout",(function(t){return n.handleMouseOut(t)})),n.on(n.volumeControl,["slideractive"],n.sliderActive_),n.on(n.volumeControl,["sliderinactive"],n.sliderInactive_),n}l(e,t);var r=e.prototype;return r.sliderActive_=function(){this.addClass("vjs-slider-active")},r.sliderInactive_=function(){this.removeClass("vjs-slider-active")},r.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")},r.createEl=function(){var e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),t.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+e})},r.dispose=function(){this.handleMouseOut(),t.prototype.dispose.call(this)},r.handleVolumeControlKeyUp=function(t){p().isEventKey(t,"Esc")&&this.muteToggle.focus()},r.handleMouseOver=function(t){this.addClass("vjs-hover"),Vr(o(),"keyup",this.handleKeyPressHandler_)},r.handleMouseOut=function(t){this.removeClass("vjs-hover"),Hr(o(),"keyup",this.handleKeyPressHandler_)},r.handleKeyPress=function(t){p().isEventKey(t,"Esc")&&this.handleMouseOut()},e}(gn);oo.prototype.options_={children:["muteToggle","volumeControl"]},gn.registerComponent("VolumePanel",oo);var ao=function(t){function e(e,r){var n;return n=t.call(this,e,r)||this,r&&(n.menuButton_=r.menuButton),n.focusedChild_=-1,n.on("keydown",(function(t){return n.handleKeyDown(t)})),n.boundHandleBlur_=function(t){return n.handleBlur(t)},n.boundHandleTapClick_=function(t){return n.handleTapClick(t)},n}l(e,t);var r=e.prototype;return r.addEventListenerForItem=function(t){t instanceof gn&&(this.on(t,"blur",this.boundHandleBlur_),this.on(t,["tap","click"],this.boundHandleTapClick_))},r.removeEventListenerForItem=function(t){t instanceof gn&&(this.off(t,"blur",this.boundHandleBlur_),this.off(t,["tap","click"],this.boundHandleTapClick_))},r.removeChild=function(e){"string"==typeof e&&(e=this.getChild(e)),this.removeEventListenerForItem(e),t.prototype.removeChild.call(this,e)},r.addItem=function(t){var e=this.addChild(t);e&&this.addEventListenerForItem(e)},r.createEl=function(){var e=this.options_.contentElType||"ul";this.contentEl_=Je(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var r=t.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return r.appendChild(this.contentEl_),Vr(r,"click",(function(t){t.preventDefault(),t.stopImmediatePropagation()})),r},r.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,t.prototype.dispose.call(this)},r.handleBlur=function(t){var e=t.relatedTarget||o().activeElement;if(!this.children().some((function(t){return t.el()===e}))){var r=this.menuButton_;r&&r.buttonPressed_&&e!==r.el().firstChild&&r.unpressButton()}},r.handleTapClick=function(t){if(this.menuButton_){this.menuButton_.unpressButton();var e=this.children();if(!Array.isArray(e))return;var r=e.filter((function(e){return e.el()===t.target}))[0];if(!r)return;"CaptionSettingsMenuItem"!==r.name()&&this.menuButton_.focus()}},r.handleKeyDown=function(t){p().isEventKey(t,"Left")||p().isEventKey(t,"Down")?(t.preventDefault(),t.stopPropagation(),this.stepForward()):(p().isEventKey(t,"Right")||p().isEventKey(t,"Up"))&&(t.preventDefault(),t.stopPropagation(),this.stepBack())},r.stepForward=function(){var t=0;void 0!==this.focusedChild_&&(t=this.focusedChild_+1),this.focus(t)},r.stepBack=function(){var t=0;void 0!==this.focusedChild_&&(t=this.focusedChild_-1),this.focus(t)},r.focus=function(t){void 0===t&&(t=0);var e=this.children().slice();e.length&&e[0].hasClass("vjs-menu-title")&&e.shift(),e.length>0&&(t<0?t=0:t>=e.length&&(t=e.length-1),this.focusedChild_=t,e[t].el_.focus())},e}(gn);gn.registerComponent("Menu",ao);var so=function(t){function e(e,r){var n;void 0===r&&(r={}),(n=t.call(this,e,r)||this).menuButton_=new Pi(e,r),n.menuButton_.controlText(n.controlText_),n.menuButton_.el_.setAttribute("aria-haspopup","true");var i=Pi.prototype.buildCSSClass();n.menuButton_.el_.className=n.buildCSSClass()+" "+i,n.menuButton_.removeClass("vjs-control"),n.addChild(n.menuButton_),n.update(),n.enabled_=!0;var a=function(t){return n.handleClick(t)};return n.handleMenuKeyUp_=function(t){return n.handleMenuKeyUp(t)},n.on(n.menuButton_,"tap",a),n.on(n.menuButton_,"click",a),n.on(n.menuButton_,"keydown",(function(t){return n.handleKeyDown(t)})),n.on(n.menuButton_,"mouseenter",(function(){n.addClass("vjs-hover"),n.menu.show(),Vr(o(),"keyup",n.handleMenuKeyUp_)})),n.on("mouseleave",(function(t){return n.handleMouseLeave(t)})),n.on("keydown",(function(t){return n.handleSubmenuKeyDown(t)})),n}l(e,t);var r=e.prototype;return r.update=function(){var t=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=t,this.addChild(t),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show()},r.createMenu=function(){var t=new ao(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var e=Je("li",{className:"vjs-menu-title",innerHTML:hn(this.options_.title),tabIndex:-1}),r=new gn(this.player_,{el:e});t.addItem(r)}if(this.items=this.createItems(),this.items)for(var n=0;n<this.items.length;n++)t.addItem(this.items[n]);return t},r.createItems=function(){},r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},r.buildWrapperCSSClass=function(){var e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup","vjs-menu-button "+e+" "+Pi.prototype.buildCSSClass()+" "+t.prototype.buildCSSClass.call(this)},r.buildCSSClass=function(){var e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup","vjs-menu-button "+e+" "+t.prototype.buildCSSClass.call(this)},r.controlText=function(t,e){return void 0===e&&(e=this.menuButton_.el()),this.menuButton_.controlText(t,e)},r.dispose=function(){this.handleMouseLeave(),t.prototype.dispose.call(this)},r.handleClick=function(t){this.buttonPressed_?this.unpressButton():this.pressButton()},r.handleMouseLeave=function(t){this.removeClass("vjs-hover"),Hr(o(),"keyup",this.handleMenuKeyUp_)},r.focus=function(){this.menuButton_.focus()},r.blur=function(){this.menuButton_.blur()},r.handleKeyDown=function(t){p().isEventKey(t,"Esc")||p().isEventKey(t,"Tab")?(this.buttonPressed_&&this.unpressButton(),p().isEventKey(t,"Tab")||(t.preventDefault(),this.menuButton_.focus())):(p().isEventKey(t,"Up")||p().isEventKey(t,"Down"))&&(this.buttonPressed_||(t.preventDefault(),this.pressButton()))},r.handleMenuKeyUp=function(t){(p().isEventKey(t,"Esc")||p().isEventKey(t,"Tab"))&&this.removeClass("vjs-hover")},r.handleSubmenuKeyPress=function(t){this.handleSubmenuKeyDown(t)},r.handleSubmenuKeyDown=function(t){(p().isEventKey(t,"Esc")||p().isEventKey(t,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),p().isEventKey(t,"Tab")||(t.preventDefault(),this.menuButton_.focus()))},r.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),qe&&Qe())return;this.menu.focus()}},r.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},r.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},r.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},e}(gn);gn.registerComponent("MenuButton",so);var uo=function(t){function e(e,r){var n,i=r.tracks;if((n=t.call(this,e,r)||this).items.length<=1&&n.hide(),!i)return s(n);var o=Yr(s(n),n.update);return i.addEventListener("removetrack",o),i.addEventListener("addtrack",o),i.addEventListener("labelchange",o),n.player_.on("ready",o),n.player_.on("dispose",(function(){i.removeEventListener("removetrack",o),i.removeEventListener("addtrack",o),i.removeEventListener("labelchange",o)})),n}return l(e,t),e}(so);gn.registerComponent("TrackButton",uo);var lo=["Tab","Esc","Up","Down","Right","Left"],co=function(t){function e(e,r){var n;return(n=t.call(this,e,r)||this).selectable=r.selectable,n.isSelected_=r.selected||!1,n.multiSelectable=r.multiSelectable,n.selected(n.isSelected_),n.selectable?n.multiSelectable?n.el_.setAttribute("role","menuitemcheckbox"):n.el_.setAttribute("role","menuitemradio"):n.el_.setAttribute("role","menuitem"),n}l(e,t);var r=e.prototype;return r.createEl=function(e,r,n){return this.nonIconControl=!0,t.prototype.createEl.call(this,"li",ge({className:"vjs-menu-item",innerHTML:'<span class="vjs-menu-item-text">'+this.localize(this.options_.label)+"</span>",tabIndex:-1},r),n)},r.handleKeyDown=function(e){lo.some((function(t){return p().isEventKey(e,t)}))||t.prototype.handleKeyDown.call(this,e)},r.handleClick=function(t){this.selected(!0)},r.selected=function(t){this.selectable&&(t?(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))},e}(_i);gn.registerComponent("MenuItem",co);var fo=function(t){function r(r,n){var i,a=n.track,u=r.textTracks();n.label=a.label||a.language||"Unknown",n.selected="showing"===a.mode,(i=t.call(this,r,n)||this).track=a,i.kinds=(n.kinds||[n.kind||i.track.kind]).filter(Boolean);var l,c=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.handleTracksChange.apply(s(i),e)},f=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.handleSelectedLanguageChange.apply(s(i),e)};return r.on(["loadstart","texttrackchange"],c),u.addEventListener("change",c),u.addEventListener("selectedlanguagechange",f),i.on("dispose",(function(){r.off(["loadstart","texttrackchange"],c),u.removeEventListener("change",c),u.removeEventListener("selectedlanguagechange",f)})),void 0===u.onchange&&i.on(["tap","click"],(function(){if("object"!=typeof e().Event)try{l=new(e().Event)("change")}catch(t){}l||(l=o().createEvent("Event")).initEvent("change",!0,!0),u.dispatchEvent(l)})),i.handleTracksChange(),i}l(r,t);var n=r.prototype;return n.handleClick=function(e){var r=this.track,n=this.player_.textTracks();if(t.prototype.handleClick.call(this,e),n)for(var i=0;i<n.length;i++){var o=n[i];-1!==this.kinds.indexOf(o.kind)&&(o===r?"showing"!==o.mode&&(o.mode="showing"):"disabled"!==o.mode&&(o.mode="disabled"))}},n.handleTracksChange=function(t){var e="showing"===this.track.mode;e!==this.isSelected_&&this.selected(e)},n.handleSelectedLanguageChange=function(t){if("showing"===this.track.mode){var 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}}},n.dispose=function(){this.track=null,t.prototype.dispose.call(this)},r}(co);gn.registerComponent("TextTrackMenuItem",fo);var ho=function(t){function e(e,r){return r.track={player:e,kind:r.kind,kinds:r.kinds,default:!1,mode:"disabled"},r.kinds||(r.kinds=[r.kind]),r.label?r.track.label=r.label:r.track.label=r.kinds.join(" and ")+" off",r.selectable=!0,r.multiSelectable=!1,t.call(this,e,r)||this}l(e,t);var r=e.prototype;return r.handleTracksChange=function(t){for(var e=this.player().textTracks(),r=!0,n=0,i=e.length;n<i;n++){var o=e[n];if(this.options_.kinds.indexOf(o.kind)>-1&&"showing"===o.mode){r=!1;break}}r!==this.isSelected_&&this.selected(r)},r.handleSelectedLanguageChange=function(t){for(var e=this.player().textTracks(),r=!0,n=0,i=e.length;n<i;n++){var o=e[n];if(["captions","descriptions","subtitles"].indexOf(o.kind)>-1&&"showing"===o.mode){r=!1;break}}r&&(this.player_.cache_.selectedLanguage={enabled:!1})},e}(fo);gn.registerComponent("OffTextTrackMenuItem",ho);var po=function(t){function e(e,r){return void 0===r&&(r={}),r.tracks=e.textTracks(),t.call(this,e,r)||this}return l(e,t),e.prototype.createItems=function(t,e){var r;void 0===t&&(t=[]),void 0===e&&(e=fo),this.label_&&(r=this.label_+" off"),t.push(new ho(this.player_,{kinds:this.kinds_,kind:this.kind_,label:r})),this.hideThreshold_+=1;var n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var i=0;i<n.length;i++){var o=n[i];if(this.kinds_.indexOf(o.kind)>-1){var a=new e(this.player_,{track:o,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});a.addClass("vjs-"+o.kind+"-menu-item"),t.push(a)}}return t},e}(uo);gn.registerComponent("TextTrackButton",po);var yo=function(t){function e(e,r){var n,i=r.track,o=r.cue,a=e.currentTime();return r.selectable=!0,r.multiSelectable=!1,r.label=o.text,r.selected=o.startTime<=a&&a<o.endTime,(n=t.call(this,e,r)||this).track=i,n.cue=o,i.addEventListener("cuechange",Yr(s(n),n.update)),n}l(e,t);var r=e.prototype;return r.handleClick=function(e){t.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime),this.update(this.cue.startTime)},r.update=function(t){var e=this.cue,r=this.player_.currentTime();this.selected(e.startTime<=r&&r<e.endTime)},e}(co);gn.registerComponent("ChaptersTrackMenuItem",yo);var mo=function(t){function e(e,r,n){return t.call(this,e,r,n)||this}l(e,t);var r=e.prototype;return r.buildCSSClass=function(){return"vjs-chapters-button "+t.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-chapters-button "+t.prototype.buildWrapperCSSClass.call(this)},r.update=function(e){this.track_&&(!e||"addtrack"!==e.type&&"removetrack"!==e.type)||this.setTrack(this.findChaptersTrack()),t.prototype.update.call(this)},r.setTrack=function(t){if(this.track_!==t){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.removeEventListener("load",this.updateHandler_),this.track_=null}if(this.track_=t,this.track_){this.track_.mode="hidden";var r=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);r&&r.addEventListener("load",this.updateHandler_)}}},r.findChaptersTrack=function(){for(var t=this.player_.textTracks()||[],e=t.length-1;e>=0;e--){var r=t[e];if(r.kind===this.kind_)return r}},r.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(hn(this.kind_))},r.createMenu=function(){return this.options_.title=this.getMenuCaption(),t.prototype.createMenu.call(this)},r.createItems=function(){var t=[];if(!this.track_)return t;var e=this.track_.cues;if(!e)return t;for(var r=0,n=e.length;r<n;r++){var i=e[r],o=new yo(this.player_,{track:this.track_,cue:i});t.push(o)}return t},e}(po);mo.prototype.kind_="chapters",mo.prototype.controlText_="Chapters",gn.registerComponent("ChaptersButton",mo);var vo=function(t){function e(e,r,n){var i;i=t.call(this,e,r,n)||this;var o=e.textTracks(),a=Yr(s(i),i.handleTracksChange);return o.addEventListener("change",a),i.on("dispose",(function(){o.removeEventListener("change",a)})),i}l(e,t);var r=e.prototype;return r.handleTracksChange=function(t){for(var e=this.player().textTracks(),r=!1,n=0,i=e.length;n<i;n++){var o=e[n];if(o.kind!==this.kind_&&"showing"===o.mode){r=!0;break}}r?this.disable():this.enable()},r.buildCSSClass=function(){return"vjs-descriptions-button "+t.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+t.prototype.buildWrapperCSSClass.call(this)},e}(po);vo.prototype.kind_="descriptions",vo.prototype.controlText_="Descriptions",gn.registerComponent("DescriptionsButton",vo);var go=function(t){function e(e,r,n){return t.call(this,e,r,n)||this}l(e,t);var r=e.prototype;return r.buildCSSClass=function(){return"vjs-subtitles-button "+t.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+t.prototype.buildWrapperCSSClass.call(this)},e}(po);go.prototype.kind_="subtitles",go.prototype.controlText_="Subtitles",gn.registerComponent("SubtitlesButton",go);var bo=function(t){function e(e,r){var n;return r.track={player:e,kind:r.kind,label:r.kind+" settings",selectable:!1,default:!1,mode:"disabled"},r.selectable=!1,r.name="CaptionSettingsMenuItem",(n=t.call(this,e,r)||this).addClass("vjs-texttrack-settings"),n.controlText(", opens "+r.kind+" settings dialog"),n}return l(e,t),e.prototype.handleClick=function(t){this.player().getChild("textTrackSettings").open()},e}(fo);gn.registerComponent("CaptionSettingsMenuItem",bo);var _o=function(t){function e(e,r,n){return t.call(this,e,r,n)||this}l(e,t);var r=e.prototype;return r.buildCSSClass=function(){return"vjs-captions-button "+t.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-captions-button "+t.prototype.buildWrapperCSSClass.call(this)},r.createItems=function(){var e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new bo(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),t.prototype.createItems.call(this,e)},e}(po);_o.prototype.kind_="captions",_o.prototype.controlText_="Captions",gn.registerComponent("CaptionsButton",_o);var wo=function(t){function e(){return t.apply(this,arguments)||this}return l(e,t),e.prototype.createEl=function(e,r,n){var i='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return"captions"===this.options_.track.kind&&(i+='\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> '+this.localize("Captions")+"</span>\n "),i+="</span>",t.prototype.createEl.call(this,e,ge({innerHTML:i},r),n)},e}(fo);gn.registerComponent("SubsCapsMenuItem",wo);var To=function(t){function e(e,r){var n;return void 0===r&&(r={}),(n=t.call(this,e,r)||this).label_="subtitles",["en","en-us","en-ca","fr-ca"].indexOf(n.player_.language_)>-1&&(n.label_="captions"),n.menuButton_.controlText(hn(n.label_)),n}l(e,t);var r=e.prototype;return r.buildCSSClass=function(){return"vjs-subs-caps-button "+t.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+t.prototype.buildWrapperCSSClass.call(this)},r.createItems=function(){var e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new bo(this.player_,{kind:this.label_})),this.hideThreshold_+=1),t.prototype.createItems.call(this,e,wo)},e}(po);To.prototype.kinds_=["captions","subtitles"],To.prototype.controlText_="Subtitles",gn.registerComponent("SubsCapsButton",To);var So=function(t){function e(e,r){var n,i=r.track,o=e.audioTracks();r.label=i.label||i.language||"Unknown",r.selected=i.enabled,(n=t.call(this,e,r)||this).track=i,n.addClass("vjs-"+i.kind+"-menu-item");var a=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];n.handleTracksChange.apply(s(n),e)};return o.addEventListener("change",a),n.on("dispose",(function(){o.removeEventListener("change",a)})),n}l(e,t);var r=e.prototype;return r.createEl=function(e,r,n){var i='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return"main-desc"===this.options_.track.kind&&(i+='\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> '+this.localize("Descriptions")+"</span>\n "),i+="</span>",t.prototype.createEl.call(this,e,ge({innerHTML:i},r),n)},r.handleClick=function(e){t.prototype.handleClick.call(this,e),this.track.enabled=!0},r.handleTracksChange=function(t){this.selected(this.track.enabled)},e}(co);gn.registerComponent("AudioTrackMenuItem",So);var Eo=function(t){function e(e,r){return void 0===r&&(r={}),r.tracks=e.audioTracks(),t.call(this,e,r)||this}l(e,t);var r=e.prototype;return r.buildCSSClass=function(){return"vjs-audio-button "+t.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-audio-button "+t.prototype.buildWrapperCSSClass.call(this)},r.createItems=function(t){void 0===t&&(t=[]),this.hideThreshold_=1;for(var e=this.player_.audioTracks(),r=0;r<e.length;r++){var n=e[r];t.push(new So(this.player_,{track:n,selectable:!0,multiSelectable:!1}))}return t},e}(uo);Eo.prototype.controlText_="Audio Track",gn.registerComponent("AudioTrackButton",Eo);var Oo=function(t){function e(e,r){var n,i=r.rate,o=parseFloat(i,10);return r.label=i,r.selected=1===o,r.selectable=!0,r.multiSelectable=!1,(n=t.call(this,e,r)||this).label=i,n.rate=o,n.on(e,"ratechange",(function(t){return n.update(t)})),n}l(e,t);var r=e.prototype;return r.handleClick=function(e){t.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},r.update=function(t){this.selected(this.player().playbackRate()===this.rate)},e}(co);Oo.prototype.contentElType="button",gn.registerComponent("PlaybackRateMenuItem",Oo);var ko=function(t){function e(e,r){var n;return(n=t.call(this,e,r)||this).menuButton_.el_.setAttribute("aria-describedby",n.labelElId_),n.updateVisibility(),n.updateLabel(),n.on(e,"loadstart",(function(t){return n.updateVisibility(t)})),n.on(e,"ratechange",(function(t){return n.updateLabel(t)})),n}l(e,t);var r=e.prototype;return r.createEl=function(){var e=t.prototype.createEl.call(this);return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=Je("div",{className:"vjs-playback-rate-value",id:this.labelElId_,innerHTML:"1x"}),e.appendChild(this.labelEl_),e},r.dispose=function(){this.labelEl_=null,t.prototype.dispose.call(this)},r.buildCSSClass=function(){return"vjs-playback-rate "+t.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-playback-rate "+t.prototype.buildWrapperCSSClass.call(this)},r.createMenu=function(){var t=new ao(this.player()),e=this.playbackRates();if(e)for(var r=e.length-1;r>=0;r--)t.addChild(new Oo(this.player(),{rate:e[r]+"x"}));return t},r.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},r.handleClick=function(t){for(var e=this.player().playbackRate(),r=this.playbackRates(),n=r[0],i=0;i<r.length;i++)if(r[i]>e){n=r[i];break}this.player().playbackRate(n)},r.playbackRates=function(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates},r.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},r.updateVisibility=function(t){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},r.updateLabel=function(t){this.playbackRateSupported()&&(this.labelEl_.innerHTML=this.player().playbackRate()+"x")},e}(so);ko.prototype.controlText_="Playback Rate",gn.registerComponent("PlaybackRateMenuButton",ko);var Co=function(t){function e(){return t.apply(this,arguments)||this}l(e,t);var r=e.prototype;return r.buildCSSClass=function(){return"vjs-spacer "+t.prototype.buildCSSClass.call(this)},r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})},e}(gn);gn.registerComponent("Spacer",Co);var Po=function(t){function e(){return t.apply(this,arguments)||this}l(e,t);var r=e.prototype;return r.buildCSSClass=function(){return"vjs-custom-control-spacer "+t.prototype.buildCSSClass.call(this)},r.createEl=function(){var e=t.prototype.createEl.call(this,{className:this.buildCSSClass()});return e.innerHTML=" ",e},e}(Co);gn.registerComponent("CustomControlSpacer",Po);var xo=function(t){function e(){return t.apply(this,arguments)||this}return l(e,t),e.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},e}(gn);xo.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in o()&&xo.prototype.options_.children.splice(xo.prototype.options_.children.length-1,0,"pictureInPictureToggle"),gn.registerComponent("ControlBar",xo);var jo=function(t){function e(e,r){var n;return(n=t.call(this,e,r)||this).on(e,"error",(function(t){return n.open(t)})),n}l(e,t);var r=e.prototype;return r.buildCSSClass=function(){return"vjs-error-display "+t.prototype.buildCSSClass.call(this)},r.content=function(){var t=this.player().error();return t?this.localize(t.message):""},e}(xn);jo.prototype.options_=a({},xn.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),gn.registerComponent("ErrorDisplay",jo);var Lo="vjs-text-track-settings",Io=["#000","Black"],Ao=["#00F","Blue"],Ro=["#0FF","Cyan"],Do=["#0F0","Green"],Mo=["#F0F","Magenta"],No=["#F00","Red"],Bo=["#FFF","White"],Uo=["#FF0","Yellow"],Fo=["1","Opaque"],Vo=["0.5","Semi-Transparent"],Ho=["0","Transparent"],qo={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Io,Bo,No,Do,Ao,Uo,Mo,Ro]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[Fo,Vo,Ho]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Bo,Io,No,Do,Ao,Uo,Mo,Ro]},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(t){return"1.00"===t?null:Number(t)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[Fo,Vo]},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:[Ho,Vo,Fo]}};function zo(t,e){if(e&&(t=e(t)),t&&"none"!==t)return t}qo.windowColor.options=qo.backgroundColor.options;var Wo=function(t){function r(e,r){var n;return r.temporary=!1,(n=t.call(this,e,r)||this).updateDisplay=n.updateDisplay.bind(s(n)),n.fill(),n.hasBeenOpened_=n.hasBeenFilled_=!0,n.endDialog=Je("p",{className:"vjs-control-text",textContent:n.localize("End of dialog window.")}),n.el().appendChild(n.endDialog),n.setDefaults(),void 0===r.persistTextTrackSettings&&(n.options_.persistTextTrackSettings=n.options_.playerOptions.persistTextTrackSettings),n.on(n.$(".vjs-done-button"),"click",(function(){n.saveSettings(),n.close()})),n.on(n.$(".vjs-default-button"),"click",(function(){n.setDefaults(),n.updateDisplay()})),ve(qo,(function(t){n.on(n.$(t.selector),"change",n.updateDisplay)})),n.options_.persistTextTrackSettings&&n.restoreSettings(),n}l(r,t);var n=r.prototype;return n.dispose=function(){this.endDialog=null,t.prototype.dispose.call(this)},n.createElSelect_=function(t,e,r){var n=this;void 0===e&&(e=""),void 0===r&&(r="label");var i=qo[t],o=i.id.replace("%s",this.id_),a=[e,o].join(" ").trim();return["<"+r+' id="'+o+'" class="'+("label"===r?"vjs-label":"")+'">',this.localize(i.label),"</"+r+">",'<select aria-labelledby="'+a+'">'].concat(i.options.map((function(t){var e=o+"-"+t[1].replace(/\W+/g,"");return['<option id="'+e+'" value="'+t[0]+'" ','aria-labelledby="'+a+" "+e+'">',n.localize(t[1]),"</option>"].join("")}))).concat("</select>").join("")},n.createElFgColor_=function(){var t="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+t+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",t),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",t),"</span>","</fieldset>"].join("")},n.createElBgColor_=function(){var t="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+t+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",t),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",t),"</span>","</fieldset>"].join("")},n.createElWinColor_=function(){var t="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+t+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",t),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",t),"</span>","</fieldset>"].join("")},n.createElColors_=function(){return Je("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},n.createElFont_=function(){return Je("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("")})},n.createElControls_=function(){var t=this.localize("restore all settings to the default values");return Je("div",{className:"vjs-track-settings-controls",innerHTML:['<button type="button" class="vjs-default-button" title="'+t+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+t+"</span>","</button>",'<button type="button" class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},n.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},n.label=function(){return this.localize("Caption Settings Dialog")},n.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},n.buildCSSClass=function(){return t.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},n.getValues=function(){var t,e,r,n=this;return e=function(t,e,r){var i,o,a=(i=n.$(e.selector),o=e.parser,zo(i.options[i.options.selectedIndex].value,o));return void 0!==a&&(t[r]=a),t},void 0===(r={})&&(r=0),me(t=qo).reduce((function(r,n){return e(r,t[n],n)}),r)},n.setValues=function(t){var e=this;ve(qo,(function(r,n){!function(t,e,r){if(e)for(var n=0;n<t.options.length;n++)if(zo(t.options[n].value,r)===e){t.selectedIndex=n;break}}(e.$(r.selector),t[n],r.parser)}))},n.setDefaults=function(){var t=this;ve(qo,(function(e){var r=e.hasOwnProperty("default")?e.default:0;t.$(e.selector).selectedIndex=r}))},n.restoreSettings=function(){var t;try{t=JSON.parse(e().localStorage.getItem(Lo))}catch(t){pe.warn(t)}t&&this.setValues(t)},n.saveSettings=function(){if(this.options_.persistTextTrackSettings){var t=this.getValues();try{Object.keys(t).length?e().localStorage.setItem(Lo,JSON.stringify(t)):e().localStorage.removeItem(Lo)}catch(t){pe.warn(t)}}},n.updateDisplay=function(){var t=this.player_.getChild("textTrackDisplay");t&&t.updateDisplay()},n.conditionalBlur_=function(){this.previouslyActiveEl_=null;var t=this.player_.controlBar,e=t&&t.subsCapsButton,r=t&&t.captionsButton;e?e.focus():r&&r.focus()},r}(xn);gn.registerComponent("TextTrackSettings",Wo);var Go=function(t){function r(r,n){var i,o=n.ResizeObserver||e().ResizeObserver;null===n.ResizeObserver&&(o=!1);var a=pn({createEl:!o,reportTouchActivity:!1},n);return(i=t.call(this,r,a)||this).ResizeObserver=n.ResizeObserver||e().ResizeObserver,i.loadListener_=null,i.resizeObserver_=null,i.debouncedHandler_=function(t,r,n,i){var o;void 0===i&&(i=e());var a=function(){var e=this,r=arguments,n=function(){o=null,n=null,t.apply(e,r)};i.clearTimeout(o),o=i.setTimeout(n,100)};return a.cancel=function(){i.clearTimeout(o),o=null},a}((function(){i.resizeHandler()}),0,0,s(i)),o?(i.resizeObserver_=new i.ResizeObserver(i.debouncedHandler_),i.resizeObserver_.observe(r.el())):(i.loadListener_=function(){if(i.el_&&i.el_.contentWindow){var t=i.debouncedHandler_,e=i.unloadListener_=function(){Hr(this,"resize",t),Hr(this,"unload",e),e=null};Vr(i.el_.contentWindow,"unload",e),Vr(i.el_.contentWindow,"resize",t)}},i.one("load",i.loadListener_)),i}l(r,t);var n=r.prototype;return n.createEl=function(){return t.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager",tabIndex:-1},{"aria-hidden":"true"})},n.resizeHandler=function(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")},n.dispose=function(){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,t.prototype.dispose.call(this)},r}(gn);gn.registerComponent("ResizeManager",Go);var Xo={trackingThreshold:30,liveTolerance:15},Ko=function(t){function r(e,r){var n,i=pn(Xo,r,{createEl:!1});return(n=t.call(this,e,i)||this).handleVisibilityChange_=function(t){return n.handleVisibilityChange(t)},n.trackLiveHandler_=function(){return n.trackLive_()},n.handlePlay_=function(t){return n.handlePlay(t)},n.handleFirstTimeupdate_=function(t){return n.handleFirstTimeupdate(t)},n.handleSeeked_=function(t){return n.handleSeeked(t)},n.seekToLiveEdge_=function(t){return n.seekToLiveEdge(t)},n.reset_(),n.on(n.player_,"durationchange",(function(t){return n.handleDurationchange(t)})),n.one(n.player_,"canplay",(function(){return n.toggleTracking()})),Ne&&"hidden"in o()&&"visibilityState"in o()&&n.on(o(),"visibilitychange",n.handleVisibilityChange_),n}l(r,t);var n=r.prototype;return n.handleVisibilityChange=function(){this.player_.duration()===1/0&&(o().hidden?this.stopTracking():this.startTracking())},n.trackLive_=function(){var t=this.player_.seekable();if(t&&t.length){var r=Number(e().performance.now().toFixed(4)),n=-1===this.lastTime_?0:(r-this.lastTime_)/1e3;this.lastTime_=r,this.pastSeekEnd_=this.pastSeekEnd()+n;var i=this.liveCurrentTime(),o=this.player_.currentTime(),a=this.player_.paused()||this.seekedBehindLive_||Math.abs(i-o)>this.options_.liveTolerance;this.timeupdateSeen_&&i!==1/0||(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}},n.handleDurationchange=function(){this.toggleTracking()},n.toggleTracking=function(){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())},n.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,Kr),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_)))},n.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},n.handleSeeked=function(){var t=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&t>2,this.nextSeekedFromUser_=!1,this.trackLive_()},n.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},n.reset_=function(){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_)},n.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},n.stopTracking=function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))},n.seekableEnd=function(){for(var t=this.player_.seekable(),e=[],r=t?t.length:0;r--;)e.push(t.end(r));return e.length?e.sort()[e.length-1]:1/0},n.seekableStart=function(){for(var t=this.player_.seekable(),e=[],r=t?t.length:0;r--;)e.push(t.start(r));return e.length?e.sort()[0]:0},n.liveWindow=function(){var t=this.liveCurrentTime();return t===1/0?0:t-this.seekableStart()},n.isLive=function(){return this.isTracking()},n.atLiveEdge=function(){return!this.behindLiveEdge()},n.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},n.pastSeekEnd=function(){var t=this.seekableEnd();return-1!==this.lastSeekEnd_&&t!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=t,this.pastSeekEnd_},n.behindLiveEdge=function(){return this.behindLiveEdge_},n.isTracking=function(){return"number"==typeof this.trackingInterval_},n.seekToLiveEdge=function(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},n.dispose=function(){this.off(o(),"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),t.prototype.dispose.call(this)},r}(gn);gn.registerComponent("LiveTracker",Ko);var Yo,Qo=function(t){var e=t.el();if(e.hasAttribute("src"))return t.triggerSourceset(e.src),!0;var r=t.$$("source"),n=[],i="";if(!r.length)return!1;for(var o=0;o<r.length;o++){var a=r[o].src;a&&-1===n.indexOf(a)&&n.push(a)}return!!n.length&&(1===n.length&&(i=n[0]),t.triggerSourceset(i),!0)},$o=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(t){var r=o().createElement(this.nodeName.toLowerCase());r.innerHTML=t;for(var n=o().createDocumentFragment();r.childNodes.length;)n.appendChild(r.childNodes[0]);return this.innerText="",e().Element.prototype.appendChild.call(this,n),this.innerHTML}}),Jo=function(t,e){for(var r={},n=0;n<t.length&&!((r=Object.getOwnPropertyDescriptor(t[n],e))&&r.set&&r.get);n++);return r.enumerable=!0,r.configurable=!0,r},Zo=function(t){var r=t.el();if(!r.resetSourceWatch_){var n={},i=function(t){return Jo([t.el(),e().HTMLMediaElement.prototype,e().Element.prototype,$o],"innerHTML")}(t),o=function(e){return function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];var a=e.apply(r,i);return Qo(t),a}};["append","appendChild","insertAdjacentHTML"].forEach((function(t){r[t]&&(n[t]=r[t],r[t]=o(n[t]))})),Object.defineProperty(r,"innerHTML",pn(i,{set:o(i.set)})),r.resetSourceWatch_=function(){r.resetSourceWatch_=null,Object.keys(n).forEach((function(t){r[t]=n[t]})),Object.defineProperty(r,"innerHTML",i)},t.one("sourceset",r.resetSourceWatch_)}},ta=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?Wn(e().Element.prototype.getAttribute.call(this,"src")):""},set:function(t){return e().Element.prototype.setAttribute.call(this,"src",t),t}}),ea=function(t,e,r,n){void 0===n&&(n=!0);var i=function(r){return Object.defineProperty(t,e,{value:r,enumerable:!0,writable:!0})},o={configurable:!0,enumerable:!0,get:function(){var t=r();return i(t),t}};return n&&(o.set=i),Object.defineProperty(t,e,o)},ra=function(t){function r(e,r){var n;n=t.call(this,e,r)||this;var i=e.source,o=!1;if(i&&(n.el_.currentSrc!==i.src||e.tag&&3===e.tag.initNetworkState_)?n.setSource(i):n.handleLateInit_(n.el_),e.enableSourceset&&n.setupSourcesetHandling_(),n.isScrubbing_=!1,n.el_.hasChildNodes()){for(var a=n.el_.childNodes,s=a.length,u=[];s--;){var l=a[s];"track"===l.nodeName.toLowerCase()&&(n.featuresNativeTextTracks?(n.remoteTextTrackEls().addTrackElement_(l),n.remoteTextTracks().addTrack(l.track),n.textTracks().addTrack(l.track),o||n.el_.hasAttribute("crossorigin")||!Xn(l.src)||(o=!0)):u.push(l))}for(var c=0;c<u.length;c++)n.el_.removeChild(u[c])}return n.proxyNativeTracks_(),n.featuresNativeTextTracks&&o&&pe.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."),n.restoreMetadataTracksInIOSNativePlayer_(),(Fe||He||Ie)&&!0===e.nativeControlsForTouch&&n.setControls(!0),n.proxyWebkitFullscreen_(),n.triggerReady(),n}l(r,t);var n=r.prototype;return n.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),r.disposeMediaElement(this.el_),this.options_=null,t.prototype.dispose.call(this)},n.setupSourcesetHandling_=function(){!function(t){if(t.featuresSourceset){var r=t.el();if(!r.resetSourceset_){var n=function(t){return Jo([t.el(),e().HTMLMediaElement.prototype,ta],"src")}(t),i=r.setAttribute,o=r.load;Object.defineProperty(r,"src",pn(n,{set:function(e){var i=n.set.call(r,e);return t.triggerSourceset(r.src),i}})),r.setAttribute=function(e,n){var o=i.call(r,e,n);return/src/i.test(e)&&t.triggerSourceset(r.src),o},r.load=function(){var e=o.call(r);return Qo(t)||(t.triggerSourceset(""),Zo(t)),e},r.currentSrc?t.triggerSourceset(r.currentSrc):Qo(t)||Zo(t),r.resetSourceset_=function(){r.resetSourceset_=null,r.load=o,r.setAttribute=i,Object.defineProperty(r,"src",n),r.resetSourceWatch_&&r.resetSourceWatch_()}}}}(this)},n.restoreMetadataTracksInIOSNativePlayer_=function(){var t,e=this.textTracks(),r=function(){t=[];for(var r=0;r<e.length;r++){var n=e[r];"metadata"===n.kind&&t.push({track:n,storedMode:n.mode})}};r(),e.addEventListener("change",r),this.on("dispose",(function(){return e.removeEventListener("change",r)}));var n=function r(){for(var n=0;n<t.length;n++){var i=t[n];"disabled"===i.track.mode&&i.track.mode!==i.storedMode&&(i.track.mode=i.storedMode)}e.removeEventListener("change",r)};this.on("webkitbeginfullscreen",(function(){e.removeEventListener("change",r),e.removeEventListener("change",n),e.addEventListener("change",n)})),this.on("webkitendfullscreen",(function(){e.removeEventListener("change",r),e.addEventListener("change",r),e.removeEventListener("change",n)}))},n.overrideNative_=function(t,e){var r=this;if(e===this["featuresNative"+t+"Tracks"]){var n=t.toLowerCase();this[n+"TracksListeners_"]&&Object.keys(this[n+"TracksListeners_"]).forEach((function(t){r.el()[n+"Tracks"].removeEventListener(t,r[n+"TracksListeners_"][t])})),this["featuresNative"+t+"Tracks"]=!e,this[n+"TracksListeners_"]=null,this.proxyNativeTracksForType_(n)}},n.overrideNativeAudioTracks=function(t){this.overrideNative_("Audio",t)},n.overrideNativeVideoTracks=function(t){this.overrideNative_("Video",t)},n.proxyNativeTracksForType_=function(t){var e=this,r=ei[t],n=this.el()[r.getterName],i=this[r.getterName]();if(this["featuresNative"+r.capitalName+"Tracks"]&&n&&n.addEventListener){var o={change:function(r){var n={type:"change",target:i,currentTarget:i,srcElement:i};i.trigger(n),"text"===t&&e[ri.remoteText.getterName]().trigger(n)},addtrack:function(t){i.addTrack(t.track)},removetrack:function(t){i.removeTrack(t.track)}},a=function(){for(var t=[],e=0;e<i.length;e++){for(var r=!1,o=0;o<n.length;o++)if(n[o]===i[e]){r=!0;break}r||t.push(i[e])}for(;t.length;)i.removeTrack(t.shift())};this[r.getterName+"Listeners_"]=o,Object.keys(o).forEach((function(t){var r=o[t];n.addEventListener(t,r),e.on("dispose",(function(e){return n.removeEventListener(t,r)}))})),this.on("loadstart",a),this.on("dispose",(function(t){return e.off("loadstart",a)}))}},n.proxyNativeTracks_=function(){var t=this;ei.names.forEach((function(e){t.proxyNativeTracksForType_(e)}))},n.createEl=function(){var t=this.options_.tag;if(!t||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(t){var e=t.cloneNode(!0);t.parentNode&&t.parentNode.insertBefore(e,t),r.disposeMediaElement(t),t=e}else{t=o().createElement("video");var n=pn({},this.options_.tag&&ar(this.options_.tag));Fe&&!0===this.options_.nativeControlsForTouch||delete n.controls,or(t,ge(n,{id:this.options_.techId,class:"vjs-tech"}))}t.playerId=this.options_.playerId}void 0!==this.options_.preload&&ur(t,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(t.disablePictureInPicture=this.options_.disablePictureInPicture);for(var i=["loop","muted","playsinline","autoplay"],a=0;a<i.length;a++){var s=i[a],u=this.options_[s];void 0!==u&&(u?ur(t,s,s):lr(t,s),t[s]=u)}return t},n.handleLateInit_=function(t){if(0!==t.networkState&&3!==t.networkState){if(0===t.readyState){var e=!1,r=function(){e=!0};this.on("loadstart",r);var n=function(){e||this.trigger("loadstart")};return this.on("loadedmetadata",n),void this.ready((function(){this.off("loadstart",r),this.off("loadedmetadata",n),e||this.trigger("loadstart")}))}var i=["loadstart"];i.push("loadedmetadata"),t.readyState>=2&&i.push("loadeddata"),t.readyState>=3&&i.push("canplay"),t.readyState>=4&&i.push("canplaythrough"),this.ready((function(){i.forEach((function(t){this.trigger(t)}),this)}))}},n.setScrubbing=function(t){this.isScrubbing_=t},n.scrubbing=function(){return this.isScrubbing_},n.setCurrentTime=function(t){try{this.isScrubbing_&&this.el_.fastSeek&&ze?this.el_.fastSeek(t):this.el_.currentTime=t}catch(t){pe(t,"Video is not ready. (Video.js)")}},n.duration=function(){var t=this;return this.el_.duration===1/0&&je&&De&&0===this.el_.currentTime?(this.on("timeupdate",(function e(){t.el_.currentTime>0&&(t.el_.duration===1/0&&t.trigger("durationchange"),t.off("timeupdate",e))})),NaN):this.el_.duration||NaN},n.width=function(){return this.el_.offsetWidth},n.height=function(){return this.el_.offsetHeight},n.proxyWebkitFullscreen_=function(){var t=this;if("webkitDisplayingFullscreen"in this.el_){var e=function(){this.trigger("fullscreenchange",{isFullscreen:!1})},r=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",r),this.on("dispose",(function(){t.off("webkitbeginfullscreen",r),t.off("webkitendfullscreen",e)}))}},n.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var t=e().navigator&&e().navigator.userAgent||"";if(/Android/.test(t)||!/Chrome|Mac OS X 10.5/.test(t))return!0}return!1},n.enterFullScreen=function(){var t=this.el_;if(t.paused&&t.networkState<=t.HAVE_METADATA)kn(this.el_.play()),this.setTimeout((function(){t.pause();try{t.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}),0);else try{t.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},n.exitFullScreen=function(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))},n.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},n.src=function(t){if(void 0===t)return this.el_.src;this.setSrc(t)},n.reset=function(){r.resetMediaElement(this.el_)},n.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},n.setControls=function(t){this.el_.controls=!!t},n.addTextTrack=function(e,r,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,r,n):t.prototype.addTextTrack.call(this,e,r,n)},n.createRemoteTextTrack=function(e){if(!this.featuresNativeTextTracks)return t.prototype.createRemoteTextTrack.call(this,e);var r=o().createElement("track");return e.kind&&(r.kind=e.kind),e.label&&(r.label=e.label),(e.language||e.srclang)&&(r.srclang=e.language||e.srclang),e.default&&(r.default=e.default),e.id&&(r.id=e.id),e.src&&(r.src=e.src),r},n.addRemoteTextTrack=function(e,r){var n=t.prototype.addRemoteTextTrack.call(this,e,r);return this.featuresNativeTextTracks&&this.el().appendChild(n),n},n.removeRemoteTextTrack=function(e){if(t.prototype.removeRemoteTextTrack.call(this,e),this.featuresNativeTextTracks)for(var r=this.$$("track"),n=r.length;n--;)e!==r[n]&&e!==r[n].track||this.el().removeChild(r[n])},n.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var t={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(t.droppedVideoFrames=this.el().webkitDroppedFrameCount,t.totalVideoFrames=this.el().webkitDecodedFrameCount),e().performance&&"function"==typeof e().performance.now?t.creationTime=e().performance.now():e().performance&&e().performance.timing&&"number"==typeof e().performance.timing.navigationStart&&(t.creationTime=e().Date.now()-e().performance.timing.navigationStart),t},r}(ii);ea(ra,"TEST_VID",(function(){if(Ke()){var t=o().createElement("video"),e=o().createElement("track");return e.kind="captions",e.srclang="en",e.label="English",t.appendChild(e),t}})),ra.isSupported=function(){try{ra.TEST_VID.volume=.5}catch(t){return!1}return!(!ra.TEST_VID||!ra.TEST_VID.canPlayType)},ra.canPlayType=function(t){return ra.TEST_VID.canPlayType(t)},ra.canPlaySource=function(t,e){return ra.canPlayType(t.type)},ra.canControlVolume=function(){try{var t=ra.TEST_VID.volume;return ra.TEST_VID.volume=t/2+.1,t!==ra.TEST_VID.volume}catch(t){return!1}},ra.canMuteVolume=function(){try{var t=ra.TEST_VID.muted;return ra.TEST_VID.muted=!t,ra.TEST_VID.muted?ur(ra.TEST_VID,"muted","muted"):lr(ra.TEST_VID,"muted"),t!==ra.TEST_VID.muted}catch(t){return!1}},ra.canControlPlaybackRate=function(){if(je&&De&&Me<58)return!1;try{var t=ra.TEST_VID.playbackRate;return ra.TEST_VID.playbackRate=t/2+.1,t!==ra.TEST_VID.playbackRate}catch(t){return!1}},ra.canOverrideAttributes=function(){try{var t=function(){};Object.defineProperty(o().createElement("video"),"src",{get:t,set:t}),Object.defineProperty(o().createElement("audio"),"src",{get:t,set:t}),Object.defineProperty(o().createElement("video"),"innerHTML",{get:t,set:t}),Object.defineProperty(o().createElement("audio"),"innerHTML",{get:t,set:t})}catch(t){return!1}return!0},ra.supportsNativeTextTracks=function(){return ze||qe&&De},ra.supportsNativeVideoTracks=function(){return!(!ra.TEST_VID||!ra.TEST_VID.videoTracks)},ra.supportsNativeAudioTracks=function(){return!(!ra.TEST_VID||!ra.TEST_VID.audioTracks)},ra.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresVolumeControl","canControlVolume"],["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach((function(t){var e=t[0],r=t[1];ea(ra.prototype,e,(function(){return ra[r]()}),!0)})),ra.prototype.movingMediaElementInDOM=!qe,ra.prototype.featuresFullscreenResize=!0,ra.prototype.featuresProgressEvents=!0,ra.prototype.featuresTimeupdateEvents=!0,ra.patchCanPlayType=function(){Le>=4&&!Ae&&!De&&(Yo=ra.TEST_VID&&ra.TEST_VID.constructor.prototype.canPlayType,ra.TEST_VID.constructor.prototype.canPlayType=function(t){return t&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(t)?"maybe":Yo.call(this,t)})},ra.unpatchCanPlayType=function(){var t=ra.TEST_VID.constructor.prototype.canPlayType;return Yo&&(ra.TEST_VID.constructor.prototype.canPlayType=Yo),t},ra.patchCanPlayType(),ra.disposeMediaElement=function(t){if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("src"),"function"==typeof t.load&&function(){try{t.load()}catch(t){}}()}},ra.resetMediaElement=function(t){if(t){for(var e=t.querySelectorAll("source"),r=e.length;r--;)t.removeChild(e[r]);t.removeAttribute("src"),"function"==typeof t.load&&function(){try{t.load()}catch(t){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(t){ra.prototype[t]=function(){return this.el_[t]||this.el_.hasAttribute(t)}})),["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(t){ra.prototype["set"+hn(t)]=function(e){this.el_[t]=e,e?this.el_.setAttribute(t,t):this.el_.removeAttribute(t)}})),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach((function(t){ra.prototype[t]=function(){return this.el_[t]}})),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach((function(t){ra.prototype["set"+hn(t)]=function(e){this.el_[t]=e}})),["pause","load","play"].forEach((function(t){ra.prototype[t]=function(){return this.el_[t]()}})),ii.withSourceHandlers(ra),ra.nativeSourceHandler={},ra.nativeSourceHandler.canPlayType=function(t){try{return ra.TEST_VID.canPlayType(t)}catch(t){return""}},ra.nativeSourceHandler.canHandleSource=function(t,e){if(t.type)return ra.nativeSourceHandler.canPlayType(t.type);if(t.src){var r=Gn(t.src);return ra.nativeSourceHandler.canPlayType("video/"+r)}return""},ra.nativeSourceHandler.handleSource=function(t,e,r){e.setSrc(t.src)},ra.nativeSourceHandler.dispose=function(){},ra.registerSourceHandler(ra.nativeSourceHandler),ii.registerTech("Html5",ra);var na=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],ia={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},oa=["tiny","xsmall","small","medium","large","xlarge","huge"],aa={};oa.forEach((function(t){var e="x"===t.charAt(0)?"x-"+t.substring(1):t;aa[t]="vjs-layout-"+e}));var sa={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},ua=function(t){function r(e,n,i){var a;if(e.id=e.id||n.id||"vjs_video_"+Ar(),(n=ge(r.getTagSettings(e),n)).initChildren=!1,n.createEl=!1,n.evented=!1,n.reportTouchActivity=!1,!n.language)if("function"==typeof e.closest){var u=e.closest("[lang]");u&&u.getAttribute&&(n.language=u.getAttribute("lang"))}else for(var l=e;l&&1===l.nodeType;){if(ar(l).hasOwnProperty("lang")){n.language=l.getAttribute("lang");break}l=l.parentNode}if((a=t.call(this,null,n,i)||this).boundDocumentFullscreenChange_=function(t){return a.documentFullscreenChange_(t)},a.boundFullWindowOnEscKey_=function(t){return a.fullWindowOnEscKey(t)},a.boundUpdateStyleEl_=function(t){return a.updateStyleEl_(t)},a.boundApplyInitTime_=function(t){return a.applyInitTime_(t)},a.boundUpdateCurrentBreakpoint_=function(t){return a.updateCurrentBreakpoint_(t)},a.boundHandleTechClick_=function(t){return a.handleTechClick_(t)},a.boundHandleTechDoubleClick_=function(t){return a.handleTechDoubleClick_(t)},a.boundHandleTechTouchStart_=function(t){return a.handleTechTouchStart_(t)},a.boundHandleTechTouchMove_=function(t){return a.handleTechTouchMove_(t)},a.boundHandleTechTouchEnd_=function(t){return a.handleTechTouchEnd_(t)},a.boundHandleTechTap_=function(t){return a.handleTechTap_(t)},a.isFullscreen_=!1,a.log=de(a.id_),a.fsApi_=se,a.isPosterFromTech_=!1,a.queuedCallbacks_=[],a.isReady_=!1,a.hasStarted_=!1,a.userActive_=!1,a.debugEnabled_=!1,!a.options_||!a.options_.techOrder||!a.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(a.tag=e,a.tagAttributes=e&&ar(e),a.language(a.options_.language),n.languages){var c={};Object.getOwnPropertyNames(n.languages).forEach((function(t){c[t.toLowerCase()]=n.languages[t]})),a.languages_=c}else a.languages_=r.prototype.options_.languages;a.resetCache_(),a.poster_=n.poster||"",a.controls_=!!n.controls,e.controls=!1,e.removeAttribute("controls"),a.changingSrc_=!1,a.playCallbacks_=[],a.playTerminatedQueue_=[],e.hasAttribute("autoplay")?a.autoplay(!0):a.autoplay(a.options_.autoplay),n.plugins&&Object.keys(n.plugins).forEach((function(t){if("function"!=typeof a[t])throw new Error('plugin "'+t+'" does not exist')})),a.scrubbing_=!1,a.el_=a.createEl(),un(s(a),{eventBusKey:"el_"}),a.fsApi_.requestFullscreen&&(Vr(o(),a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_),a.on(a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_)),a.fluid_&&a.on(["playerreset","resize"],a.boundUpdateStyleEl_);var f=pn(a.options_);n.plugins&&Object.keys(n.plugins).forEach((function(t){a[t](n.plugins[t])})),n.debug&&a.debug(!0),a.options_.playerOptions=f,a.middleware_=[],a.initChildren(),a.isAudio("audio"===e.nodeName.toLowerCase()),a.controls()?a.addClass("vjs-controls-enabled"):a.addClass("vjs-controls-disabled"),a.el_.setAttribute("role","region"),a.isAudio()?a.el_.setAttribute("aria-label",a.localize("Audio Player")):a.el_.setAttribute("aria-label",a.localize("Video Player")),a.isAudio()&&a.addClass("vjs-audio"),a.flexNotSupported_()&&a.addClass("vjs-no-flex"),Fe&&a.addClass("vjs-touch-enabled"),qe||a.addClass("vjs-workinghover"),r.players[a.id_]=s(a);var h=ae.split(".")[0];return a.addClass("vjs-v"+h),a.userActive(!0),a.reportUserActivity(),a.one("play",(function(t){return a.listenForUserActivity_(t)})),a.on("stageclick",(function(t){return a.handleStageClick_(t)})),a.on("keydown",(function(t){return a.handleKeyDown(t)})),a.on("languagechange",(function(t){return a.handleLanguagechange(t)})),a.breakpoints(a.options_.breakpoints),a.responsive(a.options_.responsive),a}l(r,t);var n=r.prototype;return n.dispose=function(){var e=this;this.trigger("dispose"),this.off("dispose"),Hr(o(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Hr(o(),"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),r.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),ai[this.id()]=null,ni.names.forEach((function(t){var r=ni[t],n=e[r.getterName]();n&&n.off&&n.off()})),t.prototype.dispose.call(this)},n.createEl=function(){var r,n=this.tag,i=this.playerElIngest_=n.parentNode&&n.parentNode.hasAttribute&&n.parentNode.hasAttribute("data-vjs-player"),a="video-js"===this.tag.tagName.toLowerCase();i?r=this.el_=n.parentNode:a||(r=this.el_=t.prototype.createEl.call(this,"div"));var s=ar(n);if(a){for(r=this.el_=n,n=this.tag=o().createElement("video");r.children.length;)n.appendChild(r.firstChild);er(r,"video-js")||rr(r,"video-js"),r.appendChild(n),i=this.playerElIngest_=r,Object.keys(r).forEach((function(t){try{n[t]=r[t]}catch(t){}}))}if(n.setAttribute("tabindex","-1"),s.tabindex="-1",(Ne||De&&Ue)&&(n.setAttribute("role","application"),s.role="application"),n.removeAttribute("width"),n.removeAttribute("height"),"width"in s&&delete s.width,"height"in s&&delete s.height,Object.getOwnPropertyNames(s).forEach((function(t){a&&"class"===t||r.setAttribute(t,s[t]),a&&n.setAttribute(t,s[t])})),n.playerId=n.id,n.id+="_html5_api",n.className="vjs-tech",n.player=r.player=this,this.addClass("vjs-paused"),!0!==e().VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=jr("vjs-styles-dimensions");var u=Tr(".vjs-styles-defaults"),l=Tr("head");l.insertBefore(this.styleEl_,u?u.nextSibling:l.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);for(var c=n.getElementsByTagName("a"),f=0;f<c.length;f++){var h=c.item(f);rr(h,"vjs-hidden"),h.setAttribute("hidden","hidden")}return n.initNetworkState_=n.networkState,n.parentNode&&!i&&n.parentNode.insertBefore(r,n),tr(n,r),this.children_.unshift(n),this.el_.setAttribute("lang",this.language_),this.el_=r,r},n.crossOrigin=function(t){if(!t)return this.techGet_("crossOrigin");"anonymous"===t||"use-credentials"===t?this.techCall_("setCrossOrigin",t):pe.warn('crossOrigin must be "anonymous" or "use-credentials", given "'+t+'"')},n.width=function(t){return this.dimension("width",t)},n.height=function(t){return this.dimension("height",t)},n.dimension=function(t,e){var r=t+"_";if(void 0===e)return this[r]||0;if(""===e||"auto"===e)return this[r]=void 0,void this.updateStyleEl_();var n=parseFloat(e);isNaN(n)?pe.error('Improper value "'+e+'" supplied for for '+t):(this[r]=n,this.updateStyleEl_())},n.fluid=function(t){var e,r,n=this;if(void 0===t)return!!this.fluid_;this.fluid_=!!t,Zr(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),t?(this.addClass("vjs-fluid"),this.fill(!1),r=function(){n.on(["playerreset","resize"],n.boundUpdateStyleEl_)},Zr(e=this)?r():(e.eventedCallbacks||(e.eventedCallbacks=[]),e.eventedCallbacks.push(r))):this.removeClass("vjs-fluid"),this.updateStyleEl_()},n.fill=function(t){if(void 0===t)return!!this.fill_;this.fill_=!!t,t?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")},n.aspectRatio=function(t){if(void 0===t)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(t))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=t,this.fluid(!0),this.updateStyleEl_()},n.updateStyleEl_=function(){if(!0!==e().VIDEOJS_NO_DYNAMIC_STYLE){var t,r,n,i=(void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),o=i[1]/i[0];t=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/o:this.videoWidth()||300,r=void 0!==this.height_?this.height_:t*o,n=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(n),Lr(this.styleEl_,"\n ."+n+" {\n width: "+t+"px;\n height: "+r+"px;\n }\n\n ."+n+".vjs-fluid {\n padding-top: "+100*o+"%;\n }\n ")}else{var a="number"==typeof this.width_?this.width_:this.options_.width,s="number"==typeof this.height_?this.height_:this.options_.height,u=this.tech_&&this.tech_.el();u&&(a>=0&&(u.width=a),s>=0&&(u.height=s))}},n.loadTech_=function(t,e){var r=this;this.tech_&&this.unloadTech_();var n=hn(t),i=t.charAt(0).toLowerCase()+t.slice(1);"Html5"!==n&&this.tag&&(ii.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;var o={source:e,autoplay:"string"!=typeof this.autoplay()&&this.autoplay(),nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+i+"_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,Promise:this.options_.Promise};ni.names.forEach((function(t){var e=ni[t];o[e.getterName]=r[e.privateName]})),ge(o,this.options_[n]),ge(o,this.options_[i]),ge(o,this.options_[t.toLowerCase()]),this.tag&&(o.tag=this.tag),e&&e.src===this.cache_.src&&this.cache_.currentTime>0&&(o.startTime=this.cache_.currentTime);var a,s,u=ii.getTech(t);if(!u)throw new Error("No Tech named '"+n+"' exists! '"+n+"' should be registered using videojs.registerTech()'");this.tech_=new u(o),this.tech_.ready(Yr(this,this.handleTechReady_),!0),a=this.textTracksJson_||[],s=this.tech_,a.forEach((function(t){var e=s.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach((function(t){return e.addCue(t)}))})),s.textTracks(),na.forEach((function(t){r.on(r.tech_,t,(function(e){return r["handleTech"+hn(t)+"_"](e)}))})),Object.keys(ia).forEach((function(t){r.on(r.tech_,t,(function(e){0===r.tech_.playbackRate()&&r.tech_.seeking()?r.queuedCallbacks_.push({callback:r["handleTech"+ia[t]+"_"].bind(r),event:e}):r["handleTech"+ia[t]+"_"](e)}))})),this.on(this.tech_,"loadstart",(function(t){return r.handleTechLoadStart_(t)})),this.on(this.tech_,"sourceset",(function(t){return r.handleTechSourceset_(t)})),this.on(this.tech_,"waiting",(function(t){return r.handleTechWaiting_(t)})),this.on(this.tech_,"ended",(function(t){return r.handleTechEnded_(t)})),this.on(this.tech_,"seeking",(function(t){return r.handleTechSeeking_(t)})),this.on(this.tech_,"play",(function(t){return r.handleTechPlay_(t)})),this.on(this.tech_,"firstplay",(function(t){return r.handleTechFirstPlay_(t)})),this.on(this.tech_,"pause",(function(t){return r.handleTechPause_(t)})),this.on(this.tech_,"durationchange",(function(t){return r.handleTechDurationChange_(t)})),this.on(this.tech_,"fullscreenchange",(function(t,e){return r.handleTechFullscreenChange_(t,e)})),this.on(this.tech_,"fullscreenerror",(function(t,e){return r.handleTechFullscreenError_(t,e)})),this.on(this.tech_,"enterpictureinpicture",(function(t){return r.handleTechEnterPictureInPicture_(t)})),this.on(this.tech_,"leavepictureinpicture",(function(t){return r.handleTechLeavePictureInPicture_(t)})),this.on(this.tech_,"error",(function(t){return r.handleTechError_(t)})),this.on(this.tech_,"posterchange",(function(t){return r.handleTechPosterChange_(t)})),this.on(this.tech_,"textdata",(function(t){return r.handleTechTextData_(t)})),this.on(this.tech_,"ratechange",(function(t){return r.handleTechRateChange_(t)})),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"===n&&this.tag||tr(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},n.unloadTech_=function(){var t,e,r,n=this;ni.names.forEach((function(t){var e=ni[t];n[e.privateName]=n[e.getterName]()})),this.textTracksJson_=(t=this.tech_,e=t.$$("track"),r=Array.prototype.map.call(e,(function(t){return t.track})),Array.prototype.map.call(e,(function(t){var e=Cn(t.track);return t.src&&(e.src=t.src),e})).concat(Array.prototype.filter.call(t.textTracks(),(function(t){return-1===r.indexOf(t)})).map(Cn))),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},n.tech=function(t){return void 0===t&&pe.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_},n.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"mouseup",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_)},n.removeTechControlsListeners_=function(){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_,"mouseup",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)},n.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},n.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(this.autoplay())},n.manualAutoplay_=function(t){var e=this;if(this.tech_&&"string"==typeof t){var r,n=function(){var t=e.muted();e.muted(!0);var r=function(){e.muted(t)};e.playTerminatedQueue_.push(r);var n=e.play();if(On(n))return n.catch(r)};if("any"===t&&!0!==this.muted()?On(r=this.play())&&(r=r.catch(n)):r="muted"===t&&!0!==this.muted()?n():this.play(),On(r))return r.then((function(){e.trigger({type:"autoplay-success",autoplay:t})})).catch((function(r){e.trigger({type:"autoplay-failure",autoplay:t})}))}},n.updateSourceCaches_=function(t){void 0===t&&(t="");var e=t,r="";"string"!=typeof e&&(e=t.src,r=t.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],e&&!r&&(r=function(t,e){if(!e)return"";if(t.cache_.source.src===e&&t.cache_.source.type)return t.cache_.source.type;var r=t.cache_.sources.filter((function(t){return t.src===e}));if(r.length)return r[0].type;for(var n=t.$$("source"),i=0;i<n.length;i++){var o=n[i];if(o.type&&o.src&&o.src===e)return o.type}return mi(e)}(this,e)),this.cache_.source=pn({},t,{src:e,type:r});for(var n=this.cache_.sources.filter((function(t){return t.src&&t.src===e})),i=[],o=this.$$("source"),a=[],s=0;s<o.length;s++){var u=ar(o[s]);i.push(u),u.src&&u.src===e&&a.push(u.src)}a.length&&!n.length?this.cache_.sources=i:n.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=e},n.handleTechSourceset_=function(t){var e=this;if(!this.changingSrc_){var r=function(t){return e.updateSourceCaches_(t)},n=this.currentSource().src,i=t.src;n&&!/^blob:/.test(n)&&/^blob:/.test(i)&&(!this.lastSource_||this.lastSource_.tech!==i&&this.lastSource_.player!==n)&&(r=function(){}),r(i),t.src||this.tech_.any(["sourceset","loadstart"],(function(t){if("sourceset"!==t.type){var r=e.techGet("currentSrc");e.lastSource_.tech=r,e.updateSourceCaches_(r)}}))}this.lastSource_={player:this.currentSource().src,tech:t.src},this.trigger({src:t.src,type:"sourceset"})},n.hasStarted=function(t){if(void 0===t)return this.hasStarted_;t!==this.hasStarted_&&(this.hasStarted_=t,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},n.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},n.handleTechRateChange_=function(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach((function(t){return t.callback(t.event)})),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},n.handleTechWaiting_=function(){var t=this;this.addClass("vjs-waiting"),this.trigger("waiting");var e=this.currentTime();this.on("timeupdate",(function r(){e!==t.currentTime()&&(t.removeClass("vjs-waiting"),t.off("timeupdate",r))}))},n.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},n.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},n.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},n.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},n.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},n.handleTechFirstPlay_=function(){this.options_.starttime&&(pe.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")},n.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},n.handleTechEnded_=function(){this.addClass("vjs-ended"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},n.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},n.handleTechClick_=function(t){_r(t)&&this.controls_&&(this.paused()?kn(this.play()):this.pause())},n.handleTechDoubleClick_=function(t){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),(function(e){return e.contains(t.target)}))||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,t):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},n.handleTechTap_=function(){this.userActive(!this.userActive())},n.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},n.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},n.handleTechTouchEnd_=function(t){t.cancelable&&t.preventDefault()},n.handleStageClick_=function(){this.reportUserActivity()},n.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},n.documentFullscreenChange_=function(t){var e=t.target.player;if(!e||e===this){var r=this.el(),n=o()[this.fsApi_.fullscreenElement]===r;!n&&r.matches?n=r.matches(":"+this.fsApi_.fullscreen):!n&&r.msMatchesSelector&&(n=r.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(n)}},n.handleTechFullscreenChange_=function(t,e){e&&(e.nativeIOSFullscreen&&this.toggleClass("vjs-ios-native-fs"),this.isFullscreen(e.isFullscreen))},n.handleTechFullscreenError_=function(t,e){this.trigger("fullscreenerror",e)},n.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},n.handleTechEnterPictureInPicture_=function(t){this.isInPictureInPicture(!0)},n.handleTechLeavePictureInPicture_=function(t){this.isInPictureInPicture(!1)},n.handleTechError_=function(){var t=this.tech_.error();this.error(t)},n.handleTechTextData_=function(){var t=null;arguments.length>1&&(t=arguments[1]),this.trigger("textdata",t)},n.getCache=function(){return this.cache_},n.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],volume:1}},n.techCall_=function(t,e){this.ready((function(){if(t in fi)return function(t,e,r,n){return e[r](t.reduce(pi(r),n))}(this.middleware_,this.tech_,t,e);if(t in hi)return li(this.middleware_,this.tech_,t,e);try{this.tech_&&this.tech_[t](e)}catch(t){throw pe(t),t}}),!0)},n.techGet_=function(t){if(this.tech_&&this.tech_.isReady_){if(t in ci)return function(t,e,r){return t.reduceRight(pi(r),e[r]())}(this.middleware_,this.tech_,t);if(t in hi)return li(this.middleware_,this.tech_,t);try{return this.tech_[t]()}catch(e){if(void 0===this.tech_[t])throw pe("Video.js: "+t+" method not defined for "+this.techName_+" playback technology.",e),e;if("TypeError"===e.name)throw pe("Video.js: "+t+" unavailable on "+this.techName_+" playback technology element.",e),this.tech_.isReady_=!1,e;throw pe(e),e}}},n.play=function(){var t=this,r=this.options_.Promise||e().Promise;return r?new r((function(e){t.play_(e)})):this.play_()},n.play_=function(t){var e=this;void 0===t&&(t=kn),this.playCallbacks_.push(t);var r=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!r)return this.waitToPlay_=function(t){e.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(r||!ze&&!qe||this.load());var n=this.techGet_("play");null===n?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(n)},n.runPlayTerminatedQueue_=function(){var t=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],t.forEach((function(t){t()}))},n.runPlayCallbacks_=function(t){var e=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],e.forEach((function(e){e(t)}))},n.pause=function(){this.techCall_("pause")},n.paused=function(){return!1!==this.techGet_("paused")},n.played=function(){return this.techGet_("played")||wn(0,0)},n.scrubbing=function(t){if(void 0===t)return this.scrubbing_;this.scrubbing_=!!t,this.techCall_("setScrubbing",this.scrubbing_),t?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},n.currentTime=function(t){return void 0!==t?(t<0&&(t=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",t),void(this.cache_.initTime=0)):(this.cache_.initTime=t,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_))):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},n.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},n.duration=function(t){if(void 0===t)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(t=parseFloat(t))<0&&(t=1/0),t!==this.cache_.duration&&(this.cache_.duration=t,t===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(t)||this.trigger("durationchange"))},n.remainingTime=function(){return this.duration()-this.currentTime()},n.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},n.buffered=function(){var t=this.techGet_("buffered");return t&&t.length||(t=wn(0,0)),t},n.bufferedPercent=function(){return Tn(this.buffered(),this.duration())},n.bufferedEnd=function(){var t=this.buffered(),e=this.duration(),r=t.end(t.length-1);return r>e&&(r=e),r},n.volume=function(t){var e;return void 0!==t?(e=Math.max(0,Math.min(1,parseFloat(t))),this.cache_.volume=e,this.techCall_("setVolume",e),void(e>0&&this.lastVolume_(e))):(e=parseFloat(this.techGet_("volume")),isNaN(e)?1:e)},n.muted=function(t){if(void 0===t)return this.techGet_("muted")||!1;this.techCall_("setMuted",t)},n.defaultMuted=function(t){return void 0!==t?this.techCall_("setDefaultMuted",t):this.techGet_("defaultMuted")||!1},n.lastVolume_=function(t){if(void 0===t||0===t)return this.cache_.lastVolume;this.cache_.lastVolume=t},n.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},n.isFullscreen=function(t){if(void 0!==t){var e=this.isFullscreen_;return this.isFullscreen_=Boolean(t),this.isFullscreen_!==e&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_},n.requestFullscreen=function(t){var r=this.options_.Promise||e().Promise;if(r){var n=this;return new r((function(e,r){function i(){n.off("fullscreenerror",a),n.off("fullscreenchange",o)}function o(){i(),e()}function a(t,e){i(),r(e)}n.one("fullscreenchange",o),n.one("fullscreenerror",a);var s=n.requestFullscreenHelper_(t);if(s)return s.then(i,i),s}))}return this.requestFullscreenHelper_()},n.requestFullscreenHelper_=function(t){var e,r=this;if(this.fsApi_.prefixed||(e=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==t&&(e=t)),this.fsApi_.requestFullscreen){var n=this.el_[this.fsApi_.requestFullscreen](e);return n&&n.then((function(){return r.isFullscreen(!0)}),(function(){return r.isFullscreen(!1)})),n}this.tech_.supportsFullScreen()?this.techCall_("enterFullScreen"):this.enterFullWindow()},n.exitFullscreen=function(){var t=this.options_.Promise||e().Promise;if(t){var r=this;return new t((function(t,e){function n(){r.off("fullscreenerror",o),r.off("fullscreenchange",i)}function i(){n(),t()}function o(t,r){n(),e(r)}r.one("fullscreenchange",i),r.one("fullscreenerror",o);var a=r.exitFullscreenHelper_();if(a)return a.then(n,n),a}))}return this.exitFullscreenHelper_()},n.exitFullscreenHelper_=function(){var t=this;if(this.fsApi_.requestFullscreen){var e=o()[this.fsApi_.exitFullscreen]();return e&&e.then((function(){return t.isFullscreen(!1)})),e}this.tech_.supportsFullScreen()?this.techCall_("exitFullScreen"):this.exitFullWindow()},n.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=o().documentElement.style.overflow,Vr(o(),"keydown",this.boundFullWindowOnEscKey_),o().documentElement.style.overflow="hidden",rr(o().body,"vjs-full-window"),this.trigger("enterFullWindow")},n.fullWindowOnEscKey=function(t){p().isEventKey(t,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},n.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,Hr(o(),"keydown",this.boundFullWindowOnEscKey_),o().documentElement.style.overflow=this.docOrigOverflow,nr(o().body,"vjs-full-window"),this.trigger("exitFullWindow")},n.disablePictureInPicture=function(t){if(void 0===t)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",t),this.options_.disablePictureInPicture=t,this.trigger("disablepictureinpicturechanged")},n.isInPictureInPicture=function(t){return void 0!==t?(this.isInPictureInPicture_=!!t,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_},n.requestPictureInPicture=function(){if("pictureInPictureEnabled"in o()&&!1===this.disablePictureInPicture())return this.techGet_("requestPictureInPicture")},n.exitPictureInPicture=function(){if("pictureInPictureEnabled"in o())return o().exitPictureInPicture()},n.handleKeyDown=function(t){var e,r,n=this.options_.userActions;n&&n.hotkeys&&(e=this.el_.ownerDocument.activeElement,r=e.tagName.toLowerCase(),e.isContentEditable||("input"===r?-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(e.type):-1!==["textarea"].indexOf(r))||("function"==typeof n.hotkeys?n.hotkeys.call(this,t):this.handleHotkeys(t)))},n.handleHotkeys=function(t){var e=this.options_.userActions?this.options_.userActions.hotkeys:{},r=e.fullscreenKey,n=void 0===r?function(t){return p().isEventKey(t,"f")}:r,i=e.muteKey,a=void 0===i?function(t){return p().isEventKey(t,"m")}:i,s=e.playPauseKey,u=void 0===s?function(t){return p().isEventKey(t,"k")||p().isEventKey(t,"Space")}:s;if(n.call(this,t)){t.preventDefault(),t.stopPropagation();var l=gn.getComponent("FullscreenToggle");!1!==o()[this.fsApi_.fullscreenEnabled]&&l.prototype.handleClick.call(this,t)}else a.call(this,t)?(t.preventDefault(),t.stopPropagation(),gn.getComponent("MuteToggle").prototype.handleClick.call(this,t)):u.call(this,t)&&(t.preventDefault(),t.stopPropagation(),gn.getComponent("PlayToggle").prototype.handleClick.call(this,t))},n.canPlayType=function(t){for(var e,r=0,n=this.options_.techOrder;r<n.length;r++){var i=n[r],o=ii.getTech(i);if(o||(o=gn.getComponent(i)),o){if(o.isSupported()&&(e=o.canPlayType(t)))return e}else pe.error('The "'+i+'" tech is undefined. Skipped browser support check for that tech.')}return""},n.selectSource=function(t){var e,r,n=this,i=this.options_.techOrder.map((function(t){return[t,ii.getTech(t)]})).filter((function(t){var e=t[0],r=t[1];return r?r.isSupported():(pe.error('The "'+e+'" tech is undefined. Skipped browser support check for that tech.'),!1)})),o=function(t,e,r){var n;return t.some((function(t){return e.some((function(e){if(n=r(t,e))return!0}))})),n},a=function(t,e){var r=t[0];if(t[1].canPlaySource(e,n.options_[r.toLowerCase()]))return{source:e,tech:r}};return e=this.options_.sourceOrder?o(t,i,(r=a,function(t,e){return r(e,t)})):o(i,t,a),e||!1},n.handleSrc_=function(t,e){var r=this;if(void 0===t)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();var n=vi(t);if(n.length){if(this.changingSrc_=!0,e||(this.cache_.sources=n),this.updateSourceCaches_(n[0]),ui(this,n[0],(function(t,i){var o,a;if(r.middleware_=i,e||(r.cache_.sources=n),r.updateSourceCaches_(t),r.src_(t))return n.length>1?r.handleSrc_(n.slice(1)):(r.changingSrc_=!1,r.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0),void r.triggerReady());o=i,a=r.tech_,o.forEach((function(t){return t.setTech&&t.setTech(a)}))})),this.options_.retryOnError&&n.length>1){var i=function(){r.error(null),r.handleSrc_(n.slice(1),!0)},o=function(){r.off("error",i)};this.one("error",i),this.one("playing",o),this.resetRetryOnError_=function(){r.off("error",i),r.off("playing",o)}}}else this.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0)},n.src=function(t){return this.handleSrc_(t,!1)},n.src_=function(t){var e,r,n=this,i=this.selectSource([t]);return!i||(e=i.tech,r=this.techName_,hn(e)!==hn(r)?(this.changingSrc_=!0,this.loadTech_(i.tech,i.source),this.tech_.ready((function(){n.changingSrc_=!1})),!1):(this.ready((function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",t):this.techCall_("src",t.src),this.changingSrc_=!1}),!0),!1))},n.load=function(){this.techCall_("load")},n.reset=function(){var t=this,r=this.options_.Promise||e().Promise;this.paused()||!r?this.doReset_():kn(this.play().then((function(){return t.doReset_()})))},n.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),Zr(this)&&this.trigger("playerreset")},n.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},n.resetProgressBar_=function(){this.currentTime(0);var t=this.controlBar,e=t.durationDisplay,r=t.remainingTimeDisplay;e&&e.updateContent(),r&&r.updateContent()},n.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},n.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},n.currentSources=function(){var t=this.currentSource(),e=[];return 0!==Object.keys(t).length&&e.push(t),this.cache_.sources||e},n.currentSource=function(){return this.cache_.source||{}},n.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},n.currentType=function(){return this.currentSource()&&this.currentSource().type||""},n.preload=function(t){return void 0!==t?(this.techCall_("setPreload",t),void(this.options_.preload=t)):this.techGet_("preload")},n.autoplay=function(t){if(void 0===t)return this.options_.autoplay||!1;var e;"string"==typeof t&&/(any|play|muted)/.test(t)?(this.options_.autoplay=t,this.manualAutoplay_(t),e=!1):this.options_.autoplay=!!t,e=void 0===e?this.options_.autoplay:e,this.tech_&&this.techCall_("setAutoplay",e)},n.playsinline=function(t){return void 0!==t?(this.techCall_("setPlaysinline",t),this.options_.playsinline=t,this):this.techGet_("playsinline")},n.loop=function(t){return void 0!==t?(this.techCall_("setLoop",t),void(this.options_.loop=t)):this.techGet_("loop")},n.poster=function(t){if(void 0===t)return this.poster_;t||(t=""),t!==this.poster_&&(this.poster_=t,this.techCall_("setPoster",t),this.isPosterFromTech_=!1,this.trigger("posterchange"))},n.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var t=this.tech_.poster()||"";t!==this.poster_&&(this.poster_=t,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},n.controls=function(t){if(void 0===t)return!!this.controls_;t=!!t,this.controls_!==t&&(this.controls_=t,this.usingNativeControls()&&this.techCall_("setControls",t),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_()))},n.usingNativeControls=function(t){if(void 0===t)return!!this.usingNativeControls_;t=!!t,this.usingNativeControls_!==t&&(this.usingNativeControls_=t,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},n.error=function(t){if(void 0===t)return this.error_||null;if(this.options_.suppressNotSupportedError&&t&&4===t.code){var e=function(){this.error(t)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],e),void this.one("loadstart",(function(){this.off(["click","touchstart"],e)}))}if(null===t)return this.error_=t,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new Sn(t),this.addClass("vjs-error"),pe.error("(CODE:"+this.error_.code+" "+Sn.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error")},n.reportUserActivity=function(t){this.userActivity_=!0},n.userActive=function(t){if(void 0===t)return this.userActive_;if((t=!!t)!==this.userActive_){if(this.userActive_=t,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(t){t.stopPropagation(),t.preventDefault()})),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},n.listenForUserActivity_=function(){var t,e,r,n=Yr(this,this.reportUserActivity),i=function(e){n(),this.clearInterval(t)};this.on("mousedown",(function(){n(),this.clearInterval(t),t=this.setInterval(n,250)})),this.on("mousemove",(function(t){t.screenX===e&&t.screenY===r||(e=t.screenX,r=t.screenY,n())})),this.on("mouseup",i),this.on("mouseleave",i);var o,a=this.getChild("controlBar");!a||qe||je||(a.on("mouseenter",(function(t){this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout,this.player().options_.inactivityTimeout=0})),a.on("mouseleave",(function(t){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout}))),this.on("keydown",n),this.on("keyup",n),this.setInterval((function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(o);var t=this.options_.inactivityTimeout;t<=0||(o=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),t))}}),250)},n.playbackRate=function(t){if(void 0===t)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",t)},n.defaultPlaybackRate=function(t){return void 0!==t?this.techCall_("setDefaultPlaybackRate",t):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},n.isAudio=function(t){if(void 0===t)return!!this.isAudio_;this.isAudio_=!!t},n.addTextTrack=function(t,e,r){if(this.tech_)return this.tech_.addTextTrack(t,e,r)},n.addRemoteTextTrack=function(t,e){if(this.tech_)return this.tech_.addRemoteTextTrack(t,e)},n.removeRemoteTextTrack=function(t){void 0===t&&(t={});var e=t.track;if(e||(e=t),this.tech_)return this.tech_.removeRemoteTextTrack(e)},n.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},n.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},n.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},n.language=function(t){if(void 0===t)return this.language_;this.language_!==String(t).toLowerCase()&&(this.language_=String(t).toLowerCase(),Zr(this)&&this.trigger("languagechange"))},n.languages=function(){return pn(r.prototype.options_.languages,this.languages_)},n.toJSON=function(){var t=pn(this.options_),e=t.tracks;t.tracks=[];for(var r=0;r<e.length;r++){var n=e[r];(n=pn(n)).player=void 0,t.tracks[r]=n}return t},n.createModal=function(t,e){var r=this;(e=e||{}).content=t||"";var n=new xn(this,e);return this.addChild(n),n.on("dispose",(function(){r.removeChild(n)})),n.open(),n},n.updateCurrentBreakpoint_=function(){if(this.responsive())for(var t=this.currentBreakpoint(),e=this.currentWidth(),r=0;r<oa.length;r++){var n=oa[r];if(e<=this.breakpoints_[n]){if(t===n)return;t&&this.removeClass(aa[t]),this.addClass(aa[n]),this.breakpoint_=n;break}}},n.removeCurrentBreakpoint_=function(){var t=this.currentBreakpointClass();this.breakpoint_="",t&&this.removeClass(t)},n.breakpoints=function(t){return void 0===t||(this.breakpoint_="",this.breakpoints_=ge({},sa,t),this.updateCurrentBreakpoint_()),ge(this.breakpoints_)},n.responsive=function(t){return void 0===t?this.responsive_:(t=Boolean(t))!==this.responsive_?(this.responsive_=t,t?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),t):void 0},n.currentBreakpoint=function(){return this.breakpoint_},n.currentBreakpointClass=function(){return aa[this.breakpoint_]||""},n.loadMedia=function(t,e){var r=this;if(t&&"object"==typeof t){this.reset(),this.cache_.media=pn(t);var n=this.cache_.media,i=n.artwork,o=n.poster,a=n.src,s=n.textTracks;!i&&o&&(this.cache_.media.artwork=[{src:o,type:mi(o)}]),a&&this.src(a),o&&this.poster(o),Array.isArray(s)&&s.forEach((function(t){return r.addRemoteTextTrack(t,!1)})),this.ready(e)}},n.getMedia=function(){if(!this.cache_.media){var t=this.poster(),e={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),(function(t){return{kind:t.kind,label:t.label,language:t.language,src:t.src}}))};return t&&(e.poster=t,e.artwork=[{src:e.poster,type:mi(e.poster)}]),e}return pn(this.cache_.media)},r.getTagSettings=function(t){var e={sources:[],tracks:[]},r=ar(t),n=r["data-setup"];if(er(t,"vjs-fill")&&(r.fill=!0),er(t,"vjs-fluid")&&(r.fluid=!0),null!==n){var i=f()(n||"{}"),o=i[0],a=i[1];o&&pe.error(o),ge(r,a)}if(ge(e,r),t.hasChildNodes())for(var s=t.childNodes,u=0,l=s.length;u<l;u++){var c=s[u],h=c.nodeName.toLowerCase();"source"===h?e.sources.push(ar(c)):"track"===h&&e.tracks.push(ar(c))}return e},n.flexNotSupported_=function(){var t=o().createElement("i");return!("flexBasis"in t.style||"webkitFlexBasis"in t.style||"mozFlexBasis"in t.style||"msFlexBasis"in t.style||"msFlexOrder"in t.style)},n.debug=function(t){if(void 0===t)return this.debugEnabled_;t?(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)},r}(gn);ni.names.forEach((function(t){var e=ni[t];ua.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}})),ua.prototype.crossorigin=ua.prototype.crossOrigin,ua.players={};var la=e().navigator;ua.prototype.options_={techOrder:ii.defaultTechOrder_,html5:{},inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:la&&(la.languages&&la.languages[0]||la.userLanguage||la.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1},["ended","seeking","seekable","networkState","readyState"].forEach((function(t){ua.prototype[t]=function(){return this.techGet_(t)}})),na.forEach((function(t){ua.prototype["handleTech"+hn(t)+"_"]=function(){return this.trigger(t)}})),gn.registerComponent("Player",ua);var ca="plugin",fa="activePlugins_",ha={},pa=function(t){return ha.hasOwnProperty(t)},da=function(t){return pa(t)?ha[t]:void 0},ya=function(t,e){t[fa]=t[fa]||{},t[fa][e]=!0},ma=function(t,e,r){var n=(r?"before":"")+"pluginsetup";t.trigger(n,e),t.trigger(n+":"+e.name,e)},va=function(t,e){return e.prototype.name=t,function(){ma(this,{name:t,plugin:e,instance:null},!0);for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var o=function(t,e,r){if(g())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&u(i,r.prototype),i}(e,[this].concat(n));return this[t]=function(){return o},ma(this,o.getEventHash()),o}},ga=function(){function t(e){if(this.constructor===t)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),un(this),delete this.trigger,cn(this,this.constructor.defaultState),ya(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}var e=t.prototype;return e.version=function(){return this.constructor.VERSION},e.getEventHash=function(t){return void 0===t&&(t={}),t.name=this.name,t.plugin=this.constructor,t.instance=this,t},e.trigger=function(t,e){return void 0===e&&(e={}),qr(this.eventBusEl_,t,this.getEventHash(e))},e.handleStateChanged=function(t){},e.dispose=function(){var t=this.name,e=this.player;this.trigger("dispose"),this.off(),e.off("dispose",this.dispose),e[fa][t]=!1,this.player=this.state=null,e[t]=va(t,ha[t])},t.isBasic=function(e){var r="string"==typeof e?da(e):e;return"function"==typeof r&&!t.prototype.isPrototypeOf(r.prototype)},t.registerPlugin=function(e,r){if("string"!=typeof e)throw new Error('Illegal plugin name, "'+e+'", must be a string, was '+typeof e+".");if(pa(e))pe.warn('A plugin named "'+e+'" already exists. You may want to avoid re-registering plugins!');else if(ua.prototype.hasOwnProperty(e))throw new Error('Illegal plugin name, "'+e+'", cannot share a name with an existing player method!');if("function"!=typeof r)throw new Error('Illegal plugin for "'+e+'", must be a function, was '+typeof r+".");return ha[e]=r,e!==ca&&(t.isBasic(r)?ua.prototype[e]=function(t,e){var r=function(){ma(this,{name:t,plugin:e,instance:null},!0);var r=e.apply(this,arguments);return ya(this,t),ma(this,{name:t,plugin:e,instance:r}),r};return Object.keys(e).forEach((function(t){r[t]=e[t]})),r}(e,r):ua.prototype[e]=va(e,r)),r},t.deregisterPlugin=function(t){if(t===ca)throw new Error("Cannot de-register base plugin.");pa(t)&&(delete ha[t],delete ua.prototype[t])},t.getPlugins=function(t){var e;return void 0===t&&(t=Object.keys(ha)),t.forEach((function(t){var r=da(t);r&&((e=e||{})[t]=r)})),e},t.getPluginVersion=function(t){var e=da(t);return e&&e.VERSION||""},t}();ga.getPlugin=da,ga.BASE_PLUGIN_NAME=ca,ga.registerPlugin(ca,ga),ua.prototype.usingPlugin=function(t){return!!this[fa]&&!0===this[fa][t]},ua.prototype.hasPlugin=function(t){return!!pa(t)};var ba=function(t){return 0===t.indexOf("#")?t.slice(1):t};function _a(t,e,r){var n=_a.getPlayer(t);if(n)return e&&pe.warn('Player "'+t+'" is already initialised. Options will not be applied.'),r&&n.ready(r),n;var i="string"==typeof t?Tr("#"+ba(t)):t;if(!Ye(i))throw new TypeError("The element or ID supplied is not valid. (videojs)");i.ownerDocument.defaultView&&i.ownerDocument.body.contains(i)||pe.warn("The element supplied is not included in the DOM"),e=e||{},_a.hooks("beforesetup").forEach((function(t){var r=t(i,pn(e));be(r)&&!Array.isArray(r)?e=pn(e,r):pe.error("please return an object in beforesetup hooks")}));var o=gn.getComponent("Player");return n=new o(i,e,r),_a.hooks("setup").forEach((function(t){return t(n)})),n}if(_a.hooks_={},_a.hooks=function(t,e){return _a.hooks_[t]=_a.hooks_[t]||[],e&&(_a.hooks_[t]=_a.hooks_[t].concat(e)),_a.hooks_[t]},_a.hook=function(t,e){_a.hooks(t,e)},_a.hookOnce=function(t,e){_a.hooks(t,[].concat(e).map((function(e){return function r(){return _a.removeHook(t,r),e.apply(void 0,arguments)}})))},_a.removeHook=function(t,e){var r=_a.hooks(t).indexOf(e);return!(r<=-1||(_a.hooks_[t]=_a.hooks_[t].slice(),_a.hooks_[t].splice(r,1),0))},!0!==e().VIDEOJS_NO_DYNAMIC_STYLE&&Ke()){var wa=Tr(".vjs-styles-defaults");if(!wa){wa=jr("vjs-styles-defaults");var Ta=Tr("head");Ta&&Ta.insertBefore(wa,Ta.firstChild),Lr(wa,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid {\n padding-top: 56.25%\n }\n ")}}Cr(1,_a),_a.VERSION=ae,_a.options=ua.prototype.options_,_a.getPlayers=function(){return ua.players},_a.getPlayer=function(t){var e,r=ua.players;if("string"==typeof t){var n=ba(t),i=r[n];if(i)return i;e=Tr("#"+n)}else e=t;if(Ye(e)){var o=e,a=o.player,s=o.playerId;if(a||r[s])return a||r[s]}},_a.getAllPlayers=function(){return Object.keys(ua.players).map((function(t){return ua.players[t]})).filter(Boolean)},_a.players=ua.players,_a.getComponent=gn.getComponent,_a.registerComponent=function(t,e){ii.isTech(e)&&pe.warn("The "+t+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),gn.registerComponent.call(gn,t,e)},_a.getTech=ii.getTech,_a.registerTech=ii.registerTech,_a.use=function(t,e){oi[t]=oi[t]||[],oi[t].push(e)},Object.defineProperty(_a,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(_a.middleware,"TERMINATOR",{value:si,writeable:!1,enumerable:!0}),_a.browser=We,_a.TOUCH_ENABLED=Fe,_a.extend=function(t,e){void 0===e&&(e={});var r=function(){t.apply(this,arguments)},n={};for(var i in"object"==typeof e?(e.constructor!==Object.prototype.constructor&&(r=e.constructor),n=e):"function"==typeof e&&(r=e),function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&u(t,e)}(r,t),t&&(r.super_=t),n)n.hasOwnProperty(i)&&(r.prototype[i]=n[i]);return r},_a.mergeOptions=pn,_a.bind=Yr,_a.registerPlugin=ga.registerPlugin,_a.deregisterPlugin=ga.deregisterPlugin,_a.plugin=function(t,e){return pe.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),ga.registerPlugin(t,e)},_a.getPlugins=ga.getPlugins,_a.getPlugin=ga.getPlugin,_a.getPluginVersion=ga.getPluginVersion,_a.addLanguage=function(t,e){var r;return t=(""+t).toLowerCase(),_a.options.languages=pn(_a.options.languages,((r={})[t]=e,r)),_a.options.languages[t]},_a.log=pe,_a.createLogger=de,_a.createTimeRange=_a.createTimeRanges=wn,_a.formatTime=Ri,_a.setFormatTime=function(t){Ai=t},_a.resetFormatTime=function(){Ai=Ii},_a.parseUrl=zn,_a.isCrossOrigin=Xn,_a.EventTarget=$r,_a.on=Vr,_a.one=zr,_a.off=Hr,_a.trigger=qr,_a.xhr=y(),_a.TextTrack=$n,_a.AudioTrack=Jn,_a.VideoTrack=Zn,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach((function(t){_a[t]=function(){return pe.warn("videojs."+t+"() is deprecated; use videojs.dom."+t+"() instead"),Er[t].apply(null,arguments)}})),_a.computedStyle=we,_a.dom=Er,_a.url=Kn,_a.defineLazyProperty=ea,_a.addLanguage("en",{"Non-Fullscreen":"Exit Fullscreen"});var Sa=w,Ea=function(t,e,r){return t&&r&&r.responseURL&&e!==r.responseURL?r.responseURL:e},Oa=function(t){return _a.log.debug?_a.log.debug.bind(_a,"VHS:",t+" >"):function(){}},ka=_a.log,Ca=function(t,e){return t+"-"+e},Pa=function(t){var e=t.onwarn,r=t.oninfo,n=t.manifestString,i=t.customTagParsers,o=void 0===i?[]:i,a=t.customTagMappers,s=void 0===a?[]:a,u=t.experimentalLLHLS,l=new I;e&&l.on("warn",e),r&&l.on("info",r),o.forEach((function(t){return l.addParser(t)})),s.forEach((function(t){return l.addTagMapper(t)})),l.push(n),l.end();var c=l.manifest;if(u||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach((function(t){c.hasOwnProperty(t)&&delete c[t]})),c.segments&&c.segments.forEach((function(t){["parts","preloadHints"].forEach((function(e){t.hasOwnProperty(e)&&delete t[e]}))}))),!c.targetDuration){var f=10;c.segments&&c.segments.length&&(f=c.segments.reduce((function(t,e){return Math.max(t,e.duration)}),0)),e&&e("manifest has no targetDuration defaulting to "+f),c.targetDuration=f}return c},xa=function(t,e){t.mediaGroups&&["AUDIO","SUBTITLES"].forEach((function(r){if(t.mediaGroups[r])for(var n in t.mediaGroups[r])for(var i in t.mediaGroups[r][n]){var o=t.mediaGroups[r][n][i];e(o,r,n,i)}}))},ja=function(t){var e=t.playlist,r=t.uri,n=t.id;e.id=n,r&&(e.uri=r),e.attributes=e.attributes||{}},La=function(t,e){t.uri=e;for(var r=0;r<t.playlists.length;r++)if(!t.playlists[r].uri){var n="placeholder-uri-"+r;t.playlists[r].uri=n}xa(t,(function(e,r,n,i){var o="placeholder-uri-"+r+"-"+n+"-"+i;e.playlists&&e.playlists.length||(e.playlists=[a({},e)]),e.playlists.forEach((function(e,r){var n=Ca(r,o);e.uri?e.resolvedUri=e.resolvedUri||Sa(t.uri,e.uri):(e.uri=0===r?o:n,e.resolvedUri=e.uri),e.id=e.id||n,e.attributes=e.attributes||{},t.playlists[e.id]=e,t.playlists[e.uri]=e}))})),function(t){for(var e=t.playlists.length;e--;){var r=t.playlists[e];ja({playlist:r,id:Ca(e,r.uri)}),r.resolvedUri=Sa(t.uri,r.uri),t.playlists[r.id]=r,t.playlists[r.uri]=r,r.attributes.BANDWIDTH||ka.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}}(t),function(t){xa(t,(function(e){e.uri&&(e.resolvedUri=Sa(t.uri,e.uri))}))}(t)},Ia=_a.mergeOptions,Aa=_a.EventTarget,Ra=function(t,e){if(!t)return e;var r=Ia(t,e);if(t.parts&&!e.parts)delete r.parts;else if(t.parts&&e.parts)for(var n=0;n<e.parts.length;n++)t.parts&&t.parts[n]&&(r.parts[n]=Ia(t.parts[n],e.parts[n]));return r},Da=function(t,e){!t.resolvedUri&&t.uri&&(t.resolvedUri=Sa(e,t.uri)),t.key&&!t.key.resolvedUri&&(t.key.resolvedUri=Sa(e,t.key.uri)),t.map&&!t.map.resolvedUri&&(t.map.resolvedUri=Sa(e,t.map.uri)),t.parts&&t.parts.length&&t.parts.forEach((function(t){t.resolvedUri||(t.resolvedUri=Sa(e,t.uri))})),t.preloadHints&&t.preloadHints.length&&t.preloadHints.forEach((function(t){t.resolvedUri||(t.resolvedUri=Sa(e,t.uri))}))},Ma=function(t){var e=t.segments||[];return t.preloadSegment&&t.preloadSegment.parts&&e.push(t.preloadSegment),e},Na=function(t,e){return t===e||t.segments&&e.segments&&t.segments.length===e.segments.length&&t.endList===e.endList&&t.mediaSequence===e.mediaSequence},Ba=function(t,e,r){void 0===r&&(r=Na);var n=Ia(t,{}),i=n.playlists[e.id];if(!i)return null;if(r(i,e))return null;var o=Ia(i,e);e.segments=Ma(e),i.segments&&(o.segments=function(t,e,r){var n=t.slice(),i=e.slice();r=r||0;for(var o=Math.min(t.length,e.length+r),a=r;a<o;a++){var s=a-r;i[s]=Ra(n[a],i[s])}return i}(i.segments,e.segments,e.mediaSequence-i.mediaSequence)),o.segments.forEach((function(t){Da(t,o.resolvedUri)}));for(var a=0;a<n.playlists.length;a++)n.playlists[a].id===e.id&&(n.playlists[a]=o);return n.playlists[e.id]=o,n.playlists[e.uri]=o,xa(t,(function(t,r,n,i){if(t.playlists)for(var o=0;o<t.playlists.length;o++)e.id===t.playlists[o].id&&(t.playlists[o]=e)})),n},Ua=function(t,e){var r=t.segments[t.segments.length-1],n=r&&r.parts&&r.parts[r.parts.length-1],i=n&&n.duration||r&&r.duration;return e&&i?1e3*i:500*(t.partTargetDuration||t.targetDuration||10)},Fa=function(t){function r(e,r,n){var i;if(void 0===n&&(n={}),i=t.call(this)||this,!e)throw new Error("A non-empty playlist URL or object is required");i.logger_=Oa("PlaylistLoader");var o=n,a=o.withCredentials,s=void 0!==a&&a,u=o.handleManifestRedirects,l=void 0!==u&&u;i.src=e,i.vhs_=r,i.withCredentials=s,i.handleManifestRedirects=l;var c=r.options_;return i.customTagParsers=c&&c.customTagParsers||[],i.customTagMappers=c&&c.customTagMappers||[],i.experimentalLLHLS=c&&c.experimentalLLHLS||!1,i.state="HAVE_NOTHING",i.on("mediaupdatetimeout",(function(){"HAVE_METADATA"===i.state&&(i.state="HAVE_CURRENT_METADATA",i.request=i.vhs_.xhr({uri:Sa(i.master.uri,i.media().uri),withCredentials:i.withCredentials},(function(t,e){if(i.request)return t?i.playlistRequestError(i.request,i.media(),"HAVE_METADATA"):void i.haveMetadata({playlistString:i.request.responseText,url:i.media().uri,id:i.media().id})})))})),i}l(r,t);var n=r.prototype;return n.playlistRequestError=function(t,e,r){var n=e.uri,i=e.id;this.request=null,r&&(this.state=r),this.error={playlist:this.master.playlists[i],status:t.status,message:"HLS playlist request error at URL: "+n+".",responseText:t.responseText,code:t.status>=500?4:2},this.trigger("error")},n.haveMetadata=function(t){var r=this,n=t.playlistString,i=t.playlistObject,o=t.url,a=t.id;this.request=null,this.state="HAVE_METADATA";var s=i||Pa({onwarn:function(t){var e=t.message;return r.logger_("m3u8-parser warn for "+a+": "+e)},oninfo:function(t){var e=t.message;return r.logger_("m3u8-parser info for "+a+": "+e)},manifestString:n,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS});s.lastRequest=Date.now(),ja({playlist:s,uri:o,id:a});var u=Ba(this.master,s);this.targetDuration=s.partTargetDuration||s.targetDuration,u?(this.master=u,this.media_=this.master.playlists[a]):this.trigger("playlistunchanged"),this.media().endList||(e().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=e().setTimeout((function(){r.trigger("mediaupdatetimeout")}),Ua(this.media(),!!u))),this.trigger("loadedplaylist")},n.dispose=function(){this.trigger("dispose"),this.stopRequest(),e().clearTimeout(this.mediaUpdateTimeout),e().clearTimeout(this.finalRenditionTimeout),this.off()},n.stopRequest=function(){if(this.request){var t=this.request;this.request=null,t.onreadystatechange=null,t.abort()}},n.media=function(t,r){var n=this;if(!t)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"==typeof t){if(!this.master.playlists[t])throw new Error("Unknown playlist URI: "+t);t=this.master.playlists[t]}if(e().clearTimeout(this.finalRenditionTimeout),r){var i=(t.partTargetDuration||t.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=e().setTimeout(this.media.bind(this,t,!1),i)}else{var o=this.state,a=!this.media_||t.id!==this.media_.id,s=this.master.playlists[t.id];if(s&&s.endList||t.endList&&t.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=t,void(a&&(this.trigger("mediachanging"),"HAVE_MASTER"===o?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(a){if(this.state="SWITCHING_MEDIA",this.request){if(t.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.request=this.vhs_.xhr({uri:t.resolvedUri,withCredentials:this.withCredentials},(function(e,r){if(n.request){if(t.lastRequest=Date.now(),t.resolvedUri=Ea(n.handleManifestRedirects,t.resolvedUri,r),e)return n.playlistRequestError(n.request,t,o);n.haveMetadata({playlistString:r.responseText,url:t.uri,id:t.id}),"HAVE_MASTER"===o?n.trigger("loadedmetadata"):n.trigger("mediachange")}}))}}},n.pause=function(){this.stopRequest(),e().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")},n.load=function(t){var r=this;e().clearTimeout(this.mediaUpdateTimeout);var n=this.media();if(t){var i=n?(n.partTargetDuration||n.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=e().setTimeout((function(){return r.load()}),i)}else this.started?n&&!n.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()},n.start=function(){var t=this;if(this.started=!0,"object"==typeof this.src)return this.src.uri||(this.src.uri=e().location.href),this.src.resolvedUri=this.src.uri,void setTimeout((function(){t.setupInitialPlaylist(t.src)}),0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},(function(e,r){if(t.request){if(t.request=null,e)return t.error={status:r.status,message:"HLS playlist request error at URL: "+t.src+".",responseText:r.responseText,code:2},"HAVE_NOTHING"===t.state&&(t.started=!1),t.trigger("error");t.src=Ea(t.handleManifestRedirects,t.src,r);var n=Pa({manifestString:r.responseText,customTagParsers:t.customTagParsers,customTagMappers:t.customTagMappers,experimentalLLHLS:t.experimentalLLHLS});t.setupInitialPlaylist(n)}}))},n.srcUri=function(){return"string"==typeof this.src?this.src:this.src.uri},n.setupInitialPlaylist=function(t){if(this.state="HAVE_MASTER",t.playlists)return this.master=t,La(this.master,this.srcUri()),t.playlists.forEach((function(t){t.segments=Ma(t),t.segments.forEach((function(e){Da(e,t.resolvedUri)}))})),this.trigger("loadedplaylist"),void(this.request||this.media(this.master.playlists[0]));var r=this.srcUri()||e().location.href;this.master=function(t,r){var n=Ca(0,r),i={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:e().location.href,resolvedUri:e().location.href,playlists:[{uri:r,id:n,resolvedUri:r,attributes:{}}]};return i.playlists[n]=i.playlists[0],i.playlists[r]=i.playlists[0],i}(0,r),this.haveMetadata({playlistObject:t,url:r,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},r}(Aa),Va=1/30,Ha=.1,qa=function(t,e){var r,n=[];if(t&&t.length)for(r=0;r<t.length;r++)e(t.start(r),t.end(r))&&n.push([t.start(r),t.end(r)]);return _a.createTimeRanges(n)},za=function(t,e){return qa(t,(function(t,r){return t-Ha<=e&&r+Ha>=e}))},Wa=function(t,e){return qa(t,(function(t){return t-Va>=e}))},Ga=function(t){var e=[];if(!t||!t.length)return"";for(var r=0;r<t.length;r++)e.push(t.start(r)+" => "+t.end(r));return e.join(", ")},Xa=function(t){for(var e=[],r=0;r<t.length;r++)e.push({start:t.start(r),end:t.end(r)});return e},Ka=function(t){if(t&&t.length&&t.end)return t.end(t.length-1)},Ya=_a.createTimeRange,Qa=function(t,e){if(e.endList)return 0;if(t&&t.suggestedPresentationDelay)return t.suggestedPresentationDelay;var r=e.segments&&e.segments.length&&e.segments[e.segments.length-1],n=r&&r.parts&&r.parts.length;return n&&e.serverControl&&e.serverControl.partHoldBack?e.serverControl.partHoldBack:n&&e.partTargetDuration?3*e.partTargetDuration:e.serverControl&&e.serverControl.holdBack?e.serverControl.holdBack:e.targetDuration?3*e.targetDuration:0},$a=function(t,e,r){if(void 0===e&&(e=t.mediaSequence+t.segments.length),e<t.mediaSequence)return 0;var n=function(t,e){var r=0,n=e-t.mediaSequence,i=t.segments[n];if(i){if(void 0!==i.start)return{result:i.start,precise:!0};if(void 0!==i.end)return{result:i.end-i.duration,precise:!0}}for(;n--;){if(void 0!==(i=t.segments[n]).end)return{result:r+i.end,precise:!0};if(r+=i.duration,void 0!==i.start)return{result:r+i.start,precise:!0}}return{result:r,precise:!1}}(t,e);if(n.precise)return n.result;var i=function(t,e){for(var r,n=0,i=e-t.mediaSequence;i<t.segments.length;i++){if(void 0!==(r=t.segments[i]).start)return{result:r.start-n,precise:!0};if(n+=r.duration,void 0!==r.end)return{result:r.end-n,precise:!0}}return{result:-1,precise:!1}}(t,e);return i.precise?i.result:n.result+r},Ja=function(t,r,n){if(!t)return 0;if("number"!=typeof n&&(n=0),void 0===r){if(t.totalDuration)return t.totalDuration;if(!t.endList)return e()[1/0]}return $a(t,r,n)},Za=function(t,e,r){var n=0;if(e>r){var i=[r,e];e=i[0],r=i[1]}if(e<0){for(var o=e;o<Math.min(0,r);o++)n+=t.targetDuration;e=0}for(var a=e;a<r;a++)n+=t.segments[a].duration;return n},ts=function(t,e,r,n){if(!t||!t.segments)return null;if(t.endList)return Ja(t);if(null===e)return null;e=e||0;var i=$a(t,t.mediaSequence+t.segments.length,e);return r&&(i-=n="number"==typeof n?n:Qa(null,t)),Math.max(0,i)},es=function(t){return t.excludeUntil&&t.excludeUntil>Date.now()},rs=function(t){return t.excludeUntil&&t.excludeUntil===1/0},ns=function(t){var e=es(t);return!t.disabled&&!e},is=function(t,e){return e.attributes&&e.attributes[t]},os=function(t,e){if(1===t.playlists.length)return!0;var r=e.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===t.playlists.filter((function(t){return!!ns(t)&&(t.attributes.BANDWIDTH||0)<r})).length},as=function(t,e){return!(!t&&!e||!t&&e||t&&!e||t!==e&&(!t.id||!e.id||t.id!==e.id)&&(!t.resolvedUri||!e.resolvedUri||t.resolvedUri!==e.resolvedUri)&&(!t.uri||!e.uri||t.uri!==e.uri))},ss=function(t,e){var r=t&&t.mediaGroups&&t.mediaGroups.AUDIO||{},n=!1;for(var i in r){for(var o in r[i])if(n=e(r[i][o]))break;if(n)break}return!!n},us=function(t){if(!t||!t.playlists||!t.playlists.length)return ss(t,(function(t){return t.playlists&&t.playlists.length||t.uri}));for(var e=function(e){var r=t.playlists[e],n=r.attributes&&r.attributes.CODECS;return n&&n.split(",").every((function(t){return B(t)}))||ss(t,(function(t){return as(r,t)}))?"continue":{v:!1}},r=0;r<t.playlists.length;r++){var n=e(r);if("continue"!==n&&"object"==typeof n)return n.v}return!0},ls={liveEdgeDelay:Qa,duration:Ja,seekable:function(t,e,r){var n=e||0,i=ts(t,e,!0,r);return null===i?Ya():Ya(n,i)},getMediaInfoForTime:function(t,e,r,n){var i=function(t){return(t.segments||[]).reduce((function(t,e,r){return e.parts?e.parts.forEach((function(e,n){t.push({duration:e.duration,segmentIndex:r,partIndex:n})})):t.push({duration:e.duration,segmentIndex:r,partIndex:null}),t}),[])}(t),o=e-n;if(o<0){if(r>0)for(var a=r-1;a>=0;a--){var s=i[a];if((o+=s.duration+Va)>0)return{mediaIndex:s.segmentIndex,startTime:n-Za(t,r,s.segmentIndex),partIndex:s.partIndex}}return{mediaIndex:i[0]&&i[0].segmentIndex||0,partIndex:i[0]&&i[0].partIndex||null,startTime:e}}if(r<0){for(var u=r;u<0;u++)if((o-=t.targetDuration)<0)return{mediaIndex:i[0].segmentIndex,startTime:e};r=0}for(var l=r;l<i.length;l++){var c=i[l];if((o-=c.duration+Va)<0)return{mediaIndex:c.segmentIndex,startTime:n+Za(t,r,c.segmentIndex),partIndex:c.partIndex}}return{mediaIndex:i[i.length-1].segmentIndex,partIndex:i[i.length-1].partIndex,startTime:e}},isEnabled:ns,isDisabled:function(t){return t.disabled},isBlacklisted:es,isIncompatible:rs,playlistEnd:ts,isAes:function(t){for(var e=0;e<t.segments.length;e++)if(t.segments[e].key)return!0;return!1},hasAttribute:is,estimateSegmentRequestTime:function(t,e,r,n){return void 0===n&&(n=0),is("BANDWIDTH",r)?(t*r.attributes.BANDWIDTH-8*n)/e:NaN},isLowestEnabledRendition:os,isAudioOnly:us,playlistMatch:as},cs=_a.xhr,fs=_a.mergeOptions,hs=function(t,e,r,n){var i="arraybuffer"===t.responseType?t.response:t.responseText;!e&&i&&(t.responseTime=Date.now(),t.roundTripTime=t.responseTime-t.requestTime,t.bytesReceived=i.byteLength||i.length,t.bandwidth||(t.bandwidth=Math.floor(t.bytesReceived/t.roundTripTime*8*1e3))),r.headers&&(t.responseHeaders=r.headers),e&&"ETIMEDOUT"===e.code&&(t.timedout=!0),e||t.aborted||200===r.statusCode||206===r.statusCode||0===r.statusCode||(e=new Error("XHR Failed with a response of: "+(t&&(i||t.responseText)))),n(e,t)},ps=function(){var t=function t(e,r){e=fs({timeout:45e3},e);var n=t.beforeRequest||_a.Vhs.xhr.beforeRequest;if(n&&"function"==typeof n){var i=n(e);i&&(e=i)}var o=(!0===_a.Vhs.xhr.original?cs:_a.Vhs.xhr)(e,(function(t,e){return hs(o,t,e,r)})),a=o.abort;return o.abort=function(){return o.aborted=!0,a.apply(o,arguments)},o.uri=e.uri,o.requestTime=Date.now(),o};return t.original=!0,t},ds=function(t){var e,r,n={};return t.byterange&&(n.Range=(r=(e=t.byterange).offset+e.length-1,"bytes="+e.offset+"-"+r)),n},ys=function(t,e){return t.start(e)+"-"+t.end(e)},ms=function(t,e){var r=t.toString(16);return"00".substring(0,2-r.length)+r+(e%2?" ":"")},vs=function(t){return t>=32&&t<126?String.fromCharCode(t):"."},gs=function(t){var e={};return Object.keys(t).forEach((function(r){var n=t[r];ArrayBuffer.isView(n)?e[r]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:e[r]=n})),e},bs=function(t){var e=t.byterange||{length:1/0,offset:0};return[e.length,e.offset,t.resolvedUri].join(",")},_s=function(t){return t.resolvedUri},ws=function(t){for(var e=Array.prototype.slice.call(t),r=16,n="",i=0;i<e.length/r;i++)n+=e.slice(i*r,i*r+r).map(ms).join("")+" "+e.slice(i*r,i*r+r).map(vs).join("")+"\n";return n},Ts=Object.freeze({__proto__:null,createTransferableMessage:gs,initSegmentId:bs,segmentKeyId:_s,hexDump:ws,tagDump:function(t){var e=t.bytes;return ws(e)},textRanges:function(t){var e,r="";for(e=0;e<t.length;e++)r+=ys(t,e)+" ";return r}}),Ss=function t(e){var r=e.programTime,n=e.playlist,i=e.retryCount,o=void 0===i?2:i,a=e.seekTo,s=e.pauseAfterSeek,u=void 0===s||s,l=e.tech,c=e.callback;if(!c)throw new Error("seekToProgramTime: callback must be provided");if(void 0===r||!n||!a)return c({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!n.endList&&!l.hasStarted_)return c({message:"player must be playing a live stream to start buffering"});if(!function(t){if(!t.segments||0===t.segments.length)return!1;for(var e=0;e<t.segments.length;e++)if(!t.segments[e].dateTimeObject)return!1;return!0}(n))return c({message:"programDateTime tags must be provided in the manifest "+n.resolvedUri});var f=function(t,e){var r;try{r=new Date(t)}catch(t){return null}if(!e||!e.segments||0===e.segments.length)return null;var n=e.segments[0];if(r<n.dateTimeObject)return null;for(var i=0;i<e.segments.length-1&&(n=e.segments[i],!(r<e.segments[i+1].dateTimeObject));i++);var o,a=e.segments[e.segments.length-1],s=a.dateTimeObject,u=a.videoTimingInfo?(o=a.videoTimingInfo).transmuxedPresentationEnd-o.transmuxedPresentationStart-o.transmuxerPrependedSeconds:a.duration+.25*a.duration;return r>new Date(s.getTime()+1e3*u)?null:(r>s&&(n=a),{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:ls.duration(e,e.mediaSequence+e.segments.indexOf(n)),type:n.videoTimingInfo?"accurate":"estimate"})}(r,n);if(!f)return c({message:r+" was not found in the stream"});var h=f.segment,p=function(t,e){var r,n;try{r=new Date(t),n=new Date(e)}catch(t){}var i=r.getTime();return(n.getTime()-i)/1e3}(h.dateTimeObject,r);if("estimate"===f.type)return 0===o?c({message:r+" is not buffered yet. Try again"}):(a(f.estimatedStart+p),void l.one("seeked",(function(){t({programTime:r,playlist:n,retryCount:o-1,seekTo:a,pauseAfterSeek:u,tech:l,callback:c})})));var d=h.start+p;l.one("seeked",(function(){return c(null,l.currentTime())})),u&&l.pause(),a(d)},Es=function(t,e){if(4===t.readyState)return e()},Os=_a.EventTarget,ks=_a.mergeOptions,Cs=function(t,e){if(!Na(t,e))return!1;if(t.sidx&&e.sidx&&(t.sidx.offset!==e.sidx.offset||t.sidx.length!==e.sidx.length))return!1;if(!t.sidx&&e.sidx||t.sidx&&!e.sidx)return!1;if(t.segments&&!e.segments||!t.segments&&e.segments)return!1;if(!t.segments&&!e.segments)return!0;for(var r=0;r<t.segments.length;r++){var n=t.segments[r],i=e.segments[r];if(n.uri!==i.uri)return!1;if(n.byterange||i.byterange){var o=n.byterange,a=i.byterange;if(o&&!a||!o&&a)return!1;if(o.offset!==a.offset||o.length!==a.length)return!1}}return!0},Ps=function(t,e){return(Boolean(!t.map&&!e.map)||Boolean(t.map&&e.map&&t.map.byterange.offset===e.map.byterange.offset&&t.map.byterange.length===e.map.byterange.length))&&t.uri===e.uri&&t.byterange.offset===e.byterange.offset&&t.byterange.length===e.byterange.length},xs=function(t,e){var r={};for(var n in t){var i=t[n].sidx;if(i){var o=nt(i);if(!e[o])break;var a=e[o].sidxInfo;Ps(a,i)&&(r[o]=e[o])}}return r},js=function(t){function r(e,r,n,i){var o;void 0===n&&(n={}),(o=t.call(this)||this).masterPlaylistLoader_=i||s(o),i||(o.isMaster_=!0);var a=n,u=a.withCredentials,l=void 0!==u&&u,c=a.handleManifestRedirects,f=void 0!==c&&c;if(o.vhs_=r,o.withCredentials=l,o.handleManifestRedirects=f,!e)throw new Error("A non-empty playlist URL or object is required");return o.on("minimumUpdatePeriod",(function(){o.refreshXml_()})),o.on("mediaupdatetimeout",(function(){o.refreshMedia_(o.media().id)})),o.state="HAVE_NOTHING",o.loadedPlaylists_={},o.logger_=Oa("DashPlaylistLoader"),o.isMaster_?(o.masterPlaylistLoader_.srcUrl=e,o.masterPlaylistLoader_.sidxMapping_={}):o.childPlaylist_=e,o}l(r,t);var n=r.prototype;return n.requestErrored_=function(t,e,r){return!this.request||(this.request=null,t?(this.error="object"!=typeof t||t instanceof Error?{status:e.status,message:"DASH request error at URL: "+e.uri,response:e.response,code:2}:t,r&&(this.state=r),this.trigger("error"),!0):void 0)},n.addSidxSegments_=function(t,r,n){var i=this,o=t.sidx&&nt(t.sidx);if(t.sidx&&o&&!this.masterPlaylistLoader_.sidxMapping_[o]){var a=Ea(this.handleManifestRedirects,t.sidx.resolvedUri),s=function(e,a){if(!i.requestErrored_(e,a,r)){var s,u=i.masterPlaylistLoader_.sidxMapping_;try{s=jt()(Lt(a.response).subarray(8))}catch(t){return void i.requestErrored_(t,a,r)}return u[o]={sidxInfo:t.sidx,sidx:s},rt(t,s,t.sidx.resolvedUri),n(!0)}};this.request=function(t,e,r){var n,i=[],o=!1,a=function(t,e,n,i){return e.abort(),o=!0,r(t,e,n,i)},s=function(t,e){if(!o){if(t)return a(t,e,"",i);var r=e.responseText.substring(i&&i.byteLength||0,e.responseText.length);if(i=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];if((e=e.filter((function(t){return t&&(t.byteLength||t.length)&&"string"!=typeof t}))).length<=1)return Lt(e[0]);var n=e.reduce((function(t,e,r){return t+(e.byteLength||e.length)}),0),i=new Uint8Array(n),o=0;return e.forEach((function(t){t=Lt(t),i.set(t,o),o+=t.byteLength})),i}(i,Dt(r,!0)),n=n||Bt(i),i.length<10||n&&i.length<n+2)return Es(e,(function(){return a(t,e,"",i)}));var s=ie(i);return"ts"===s&&i.length<188||!s&&i.length<376?Es(e,(function(){return a(t,e,"",i)})):a(null,e,s,i)}},u={uri:t,beforeSend:function(t){t.overrideMimeType("text/plain; charset=x-user-defined"),t.addEventListener("progress",(function(e){return e.total,e.loaded,hs(t,null,{statusCode:t.status},s)}))}},l=e(u,(function(t,e){return hs(l,t,e,s)}));return l}(a,this.vhs_.xhr,(function(e,r,n,o){if(e)return s(e,r);if(!n||"mp4"!==n)return s({status:r.status,message:"Unsupported "+(n||"unknown")+" container type for sidx segment at URL: "+a,response:"",playlist:t,internal:!0,blacklistDuration:1/0,code:2},r);var u=t.sidx.byterange,l=u.offset,c=u.length;if(o.length>=c+l)return s(e,{response:o.subarray(l,l+c),status:r.status,uri:r.uri});i.request=i.vhs_.xhr({uri:a,responseType:"arraybuffer",headers:ds({byterange:t.sidx.byterange})},s)}))}else this.mediaRequest_=e().setTimeout((function(){return n(!1)}),0)},n.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},e().clearTimeout(this.minimumUpdatePeriodTimeout_),e().clearTimeout(this.mediaRequest_),e().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},n.hasPendingRequest=function(){return this.request||this.mediaRequest_},n.stopRequest=function(){if(this.request){var t=this.request;this.request=null,t.onreadystatechange=null,t.abort()}},n.media=function(t){var e=this;if(!t)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var r=this.state;if("string"==typeof t){if(!this.masterPlaylistLoader_.master.playlists[t])throw new Error("Unknown playlist URI: "+t);t=this.masterPlaylistLoader_.master.playlists[t]}var n=!this.media_||t.id!==this.media_.id;if(n&&this.loadedPlaylists_[t.id]&&this.loadedPlaylists_[t.id].endList)return this.state="HAVE_METADATA",this.media_=t,void(n&&(this.trigger("mediachanging"),this.trigger("mediachange")));n&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(t,r,(function(n){e.haveMetadata({startingState:r,playlist:t})})))},n.haveMetadata=function(t){var e=t.startingState,r=t.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[r.id]=r,this.mediaRequest_=null,this.refreshMedia_(r.id),"HAVE_MASTER"===e?this.trigger("loadedmetadata"):this.trigger("mediachange")},n.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),e().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(e().clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)},n.load=function(t){var r=this;e().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var n=this.media();if(t){var i=n?n.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=e().setTimeout((function(){return r.load()}),i)}else this.started?n&&!n.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()},n.start=function(){var t=this;this.started=!0,this.isMaster_?this.requestMaster_((function(e,r){t.haveMaster_(),t.hasPendingRequest()||t.media_||t.media(t.masterPlaylistLoader_.master.playlists[0])})):this.mediaRequest_=e().setTimeout((function(){return t.haveMaster_()}),0)},n.requestMaster_=function(t){var e=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},(function(r,n){if(!e.requestErrored_(r,n)){var i=n.responseText!==e.masterPlaylistLoader_.masterXml_;return e.masterPlaylistLoader_.masterXml_=n.responseText,n.responseHeaders&&n.responseHeaders.date?e.masterLoaded_=Date.parse(n.responseHeaders.date):e.masterLoaded_=Date.now(),e.masterPlaylistLoader_.srcUrl=Ea(e.handleManifestRedirects,e.masterPlaylistLoader_.srcUrl,n),i?(e.handleMaster_(),void e.syncClientServerClock_((function(){return t(n,i)}))):t(n,i)}"HAVE_NOTHING"===e.state&&(e.started=!1)}))},n.syncClientServerClock_=function(t){var e,r=this,n=(e=this.masterPlaylistLoader_.masterXml_,function(t){var e=gt(t,"UTCTiming")[0];if(!e)return null;var r=Tt(e);switch(r.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":r.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":r.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":r.method="DIRECT",r.value=Date.parse(r.value);break;default:throw new Error("UNSUPPORTED_UTC_TIMING_SCHEME")}return r}(Ct(e)));return null===n?(this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),t()):"DIRECT"===n.method?(this.masterPlaylistLoader_.clientOffset_=n.value-Date.now(),t()):void(this.request=this.vhs_.xhr({uri:Sa(this.masterPlaylistLoader_.srcUrl,n.value),method:n.method,withCredentials:this.withCredentials},(function(e,i){if(r.request){if(e)return r.masterPlaylistLoader_.clientOffset_=r.masterLoaded_-Date.now(),t();var o;o="HEAD"===n.method?i.responseHeaders&&i.responseHeaders.date?Date.parse(i.responseHeaders.date):r.masterLoaded_:Date.parse(i.responseText),r.masterPlaylistLoader_.clientOffset_=o-Date.now(),t()}})))},n.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},n.handleMaster_=function(){this.mediaRequest_=null;var t,e,r,n=(t={masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_},r=Pt(t.masterXml,{manifestUri:e=t.srcUrl,clientOffset:t.clientOffset,sidxMapping:t.sidxMapping}),La(r,e),r),i=this.masterPlaylistLoader_.master;i&&(n=function(t,e,r){for(var n=!0,i=ks(t,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod}),o=0;o<e.playlists.length;o++){var a=e.playlists[o];if(a.sidx){var s=nt(a.sidx);r&&r[s]&&r[s].sidx&&rt(a,r[s].sidx,a.sidx.resolvedUri)}var u=Ba(i,a,Cs);u&&(i=u,n=!1)}return xa(e,(function(t,e,r,o){if(t.playlists&&t.playlists.length){var a=t.playlists[0].id,s=Ba(i,t.playlists[0],Cs);s&&((i=s).mediaGroups[e][r][o].playlists[0]=i.playlists[a],n=!1)}})),e.minimumUpdatePeriod!==t.minimumUpdatePeriod&&(n=!1),n?null:i}(i,n,this.masterPlaylistLoader_.sidxMapping_)),this.masterPlaylistLoader_.master=n||i;var o=this.masterPlaylistLoader_.master.locations&&this.masterPlaylistLoader_.master.locations[0];return o&&o!==this.masterPlaylistLoader_.srcUrl&&(this.masterPlaylistLoader_.srcUrl=o),(!i||n&&n.minimumUpdatePeriod!==i.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),Boolean(n)},n.updateMinimumUpdatePeriodTimeout_=function(){var t=this.masterPlaylistLoader_;t.createMupOnMedia_&&(t.off("loadedmetadata",t.createMupOnMedia_),t.createMupOnMedia_=null),t.minimumUpdatePeriodTimeout_&&(e().clearTimeout(t.minimumUpdatePeriodTimeout_),t.minimumUpdatePeriodTimeout_=null);var r=t.master&&t.master.minimumUpdatePeriod;0===r&&(t.media()?r=1e3*t.media().targetDuration:(t.createMupOnMedia_=t.updateMinimumUpdatePeriodTimeout_,t.one("loadedmetadata",t.createMupOnMedia_))),"number"!=typeof r||r<=0?r<0&&this.logger_("found invalid minimumUpdatePeriod of "+r+", not setting a timeout"):this.createMUPTimeout_(r)},n.createMUPTimeout_=function(t){var r=this.masterPlaylistLoader_;r.minimumUpdatePeriodTimeout_=e().setTimeout((function(){r.minimumUpdatePeriodTimeout_=null,r.trigger("minimumUpdatePeriod"),r.createMUPTimeout_(t)}),t)},n.refreshXml_=function(){var t=this;this.requestMaster_((function(e,r){var n,i,o;r&&(t.media_&&(t.media_=t.masterPlaylistLoader_.master.playlists[t.media_.id]),t.masterPlaylistLoader_.sidxMapping_=(n=t.masterPlaylistLoader_.master,i=t.masterPlaylistLoader_.sidxMapping_,o=xs(n.playlists,i),xa(n,(function(t,e,r,n){if(t.playlists&&t.playlists.length){var a=t.playlists;o=ks(o,xs(a,i))}})),o),t.addSidxSegments_(t.media(),t.state,(function(e){t.refreshMedia_(t.media().id)})))}))},n.refreshMedia_=function(t){var r=this;if(!t)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMaster_&&this.handleMaster_();var n=this.masterPlaylistLoader_.master.playlists,i=!this.media_||this.media_!==n[t];i?this.media_=n[t]:this.trigger("playlistunchanged"),this.mediaUpdateTimeout||function t(){r.media().endList||(r.mediaUpdateTimeout=e().setTimeout((function(){r.trigger("mediaupdatetimeout"),t()}),Ua(r.media(),Boolean(i))))}(),this.trigger("loadedplaylist")},r}(Os),Ls={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},Is=function(t){return t.on=t.addEventListener,t.off=t.removeEventListener,t},As=function(t){return function(){var e=function(t){try{return URL.createObjectURL(new Blob([t],{type:"application/javascript"}))}catch(r){var e=new BlobBuilder;return e.append(t),URL.createObjectURL(e.getBlob())}}(t),r=Is(new Worker(e));r.objURL=e;var n=r.terminate;return r.on=r.addEventListener,r.off=r.removeEventListener,r.terminate=function(){return URL.revokeObjectURL(e),n.call(this)},r}},Rs=function(t){return"var browserWorkerPolyFill = "+Is.toString()+";\nbrowserWorkerPolyFill(self);\n"+t},Ds=function(t){return t.toString().replace(/^function.+?{/,"").slice(0,-1)},Ms=Rs(Ds((function(){var t=function(){this.init=function(){var t={};this.on=function(e,r){t[e]||(t[e]=[]),t[e]=t[e].concat(r)},this.off=function(e,r){var n;return!!t[e]&&(n=t[e].indexOf(r),t[e]=t[e].slice(),t[e].splice(n,1),n>-1)},this.trigger=function(e){var r,n,i,o;if(r=t[e])if(2===arguments.length)for(i=r.length,n=0;n<i;++n)r[n].call(this,arguments[1]);else{for(o=[],n=arguments.length,n=1;n<arguments.length;++n)o.push(arguments[n]);for(i=r.length,n=0;n<i;++n)r[n].apply(this,o)}},this.dispose=function(){t={}}}};t.prototype.pipe=function(t){return this.on("data",(function(e){t.push(e)})),this.on("done",(function(e){t.flush(e)})),this.on("partialdone",(function(e){t.partialFlush(e)})),this.on("endedtimeline",(function(e){t.endTimeline(e)})),this.on("reset",(function(e){t.reset(e)})),t},t.prototype.push=function(t){this.trigger("data",t)},t.prototype.flush=function(t){this.trigger("done",t)},t.prototype.partialFlush=function(t){this.trigger("partialdone",t)},t.prototype.endTimeline=function(t){this.trigger("endedtimeline",t)},t.prototype.reset=function(t){this.trigger("reset",t)};var e,r,n,i,o,a,s,u,l,c,f,h,p,d,y,m,v,g,b,_,w,T,S,E,O,k,C,P,x,j,L,I,A,R,D,M,N,B,U,F,V=t,H=Math.pow(2,32)-1;!function(){var t;if(T={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(t in T)T.hasOwnProperty(t)&&(T[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);S=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),O=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),E=new Uint8Array([0,0,0,1]),k=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]),C=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:k,audio:C},L=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),j=new Uint8Array([0,0,0,0,0,0,0,0]),I=new Uint8Array([0,0,0,0,0,0,0,0]),A=I,R=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),D=I,x=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),e=function(t){var e,r,n=[],i=0;for(e=1;e<arguments.length;e++)n.push(arguments[e]);for(e=n.length;e--;)i+=n[e].byteLength;for(r=new Uint8Array(i+8),new DataView(r.buffer,r.byteOffset,r.byteLength).setUint32(0,r.byteLength),r.set(t,4),e=0,i=8;e<n.length;e++)r.set(n[e],i),i+=n[e].byteLength;return r},r=function(){return e(T.dinf,e(T.dref,L))},n=function(t){return e(T.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,t.audioobjecttype<<3|t.samplingfrequencyindex>>>1,t.samplingfrequencyindex<<7|t.channelcount<<3,6,1,2]))},y=function(t){return e(T.hdlr,P[t])},d=function(t){var r=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,t.duration>>>24&255,t.duration>>>16&255,t.duration>>>8&255,255&t.duration,85,196,0,0]);return t.samplerate&&(r[12]=t.samplerate>>>24&255,r[13]=t.samplerate>>>16&255,r[14]=t.samplerate>>>8&255,r[15]=255&t.samplerate),e(T.mdhd,r)},p=function(t){return e(T.mdia,d(t),y(t.type),a(t))},o=function(t){return e(T.mfhd,new Uint8Array([0,0,0,0,(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t]))},a=function(t){return e(T.minf,"video"===t.type?e(T.vmhd,x):e(T.smhd,j),r(),v(t))},s=function(t,r){for(var n=[],i=r.length;i--;)n[i]=b(r[i]);return e.apply(null,[T.moof,o(t)].concat(n))},u=function(t){for(var r=t.length,n=[];r--;)n[r]=f(t[r]);return e.apply(null,[T.moov,c(4294967295)].concat(n).concat(l(t)))},l=function(t){for(var r=t.length,n=[];r--;)n[r]=_(t[r]);return e.apply(null,[T.mvex].concat(n))},c=function(t){var r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return e(T.mvhd,r)},m=function(t){var r,n,i=t.samples||[],o=new Uint8Array(4+i.length);for(n=0;n<i.length;n++)r=i[n].flags,o[n+4]=r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy;return e(T.sdtp,o)},v=function(t){return e(T.stbl,g(t),e(T.stts,D),e(T.stsc,A),e(T.stsz,R),e(T.stco,I))},g=function(t){return e(T.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===t.type?M(t):N(t))},M=function(t){var r,n,i=t.sps||[],o=t.pps||[],a=[],s=[];for(r=0;r<i.length;r++)a.push((65280&i[r].byteLength)>>>8),a.push(255&i[r].byteLength),a=a.concat(Array.prototype.slice.call(i[r]));for(r=0;r<o.length;r++)s.push((65280&o[r].byteLength)>>>8),s.push(255&o[r].byteLength),s=s.concat(Array.prototype.slice.call(o[r]));if(n=[T.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&t.width)>>8,255&t.width,(65280&t.height)>>8,255&t.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]),e(T.avcC,new Uint8Array([1,t.profileIdc,t.profileCompatibility,t.levelIdc,255].concat([i.length],a,[o.length],s))),e(T.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],t.sarRatio){var u=t.sarRatio[0],l=t.sarRatio[1];n.push(e(T.pasp,new Uint8Array([(4278190080&u)>>24,(16711680&u)>>16,(65280&u)>>8,255&u,(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l])))}return e.apply(null,n)},N=function(t){return e(T.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&t.channelcount)>>8,255&t.channelcount,(65280&t.samplesize)>>8,255&t.samplesize,0,0,0,0,(65280&t.samplerate)>>8,255&t.samplerate,0,0]),n(t))},h=function(t){var r=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,0,(4278190080&t.duration)>>24,(16711680&t.duration)>>16,(65280&t.duration)>>8,255&t.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&t.width)>>8,255&t.width,0,0,(65280&t.height)>>8,255&t.height,0,0]);return e(T.tkhd,r)},b=function(t){var r,n,i,o,a,s;return r=e(T.tfhd,new Uint8Array([0,0,0,58,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),a=Math.floor(t.baseMediaDecodeTime/(H+1)),s=Math.floor(t.baseMediaDecodeTime%(H+1)),n=e(T.tfdt,new Uint8Array([1,0,0,0,a>>>24&255,a>>>16&255,a>>>8&255,255&a,s>>>24&255,s>>>16&255,s>>>8&255,255&s])),"audio"===t.type?(i=w(t,92),e(T.traf,r,n,i)):(o=m(t),i=w(t,o.length+92),e(T.traf,r,n,i,o))},f=function(t){return t.duration=t.duration||4294967295,e(T.trak,h(t),p(t))},_=function(t){var r=new Uint8Array([0,0,0,0,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==t.type&&(r[r.length-1]=0),e(T.trex,r)},F=function(t,e){var r=0,n=0,i=0,o=0;return t.length&&(void 0!==t[0].duration&&(r=1),void 0!==t[0].size&&(n=2),void 0!==t[0].flags&&(i=4),void 0!==t[0].compositionTimeOffset&&(o=8)),[0,0,r|n|i|o,1,(4278190080&t.length)>>>24,(16711680&t.length)>>>16,(65280&t.length)>>>8,255&t.length,(4278190080&e)>>>24,(16711680&e)>>>16,(65280&e)>>>8,255&e]},U=function(t,r){var n,i,o,a,s,u;for(r+=20+16*(a=t.samples||[]).length,o=F(a,r),(i=new Uint8Array(o.length+16*a.length)).set(o),n=o.length,u=0;u<a.length;u++)s=a[u],i[n++]=(4278190080&s.duration)>>>24,i[n++]=(16711680&s.duration)>>>16,i[n++]=(65280&s.duration)>>>8,i[n++]=255&s.duration,i[n++]=(4278190080&s.size)>>>24,i[n++]=(16711680&s.size)>>>16,i[n++]=(65280&s.size)>>>8,i[n++]=255&s.size,i[n++]=s.flags.isLeading<<2|s.flags.dependsOn,i[n++]=s.flags.isDependedOn<<6|s.flags.hasRedundancy<<4|s.flags.paddingValue<<1|s.flags.isNonSyncSample,i[n++]=61440&s.flags.degradationPriority,i[n++]=15&s.flags.degradationPriority,i[n++]=(4278190080&s.compositionTimeOffset)>>>24,i[n++]=(16711680&s.compositionTimeOffset)>>>16,i[n++]=(65280&s.compositionTimeOffset)>>>8,i[n++]=255&s.compositionTimeOffset;return e(T.trun,i)},B=function(t,r){var n,i,o,a,s,u;for(r+=20+8*(a=t.samples||[]).length,o=F(a,r),(n=new Uint8Array(o.length+8*a.length)).set(o),i=o.length,u=0;u<a.length;u++)s=a[u],n[i++]=(4278190080&s.duration)>>>24,n[i++]=(16711680&s.duration)>>>16,n[i++]=(65280&s.duration)>>>8,n[i++]=255&s.duration,n[i++]=(4278190080&s.size)>>>24,n[i++]=(16711680&s.size)>>>16,n[i++]=(65280&s.size)>>>8,n[i++]=255&s.size;return e(T.trun,n)},w=function(t,e){return"audio"===t.type?B(t,e):U(t,e)},i=function(){return e(T.ftyp,S,E,S,O)};var q,z,W,G,X,K,Y,Q,$=function(t){return e(T.mdat,t)},J=s,Z=function(t,e){var r={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return r.dataOffset=e,r.compositionTimeOffset=t.pts-t.dts,r.duration=t.duration,r.size=4*t.length,r.size+=t.byteLength,t.keyFrame&&(r.flags.dependsOn=2,r.flags.isNonSyncSample=0),r},tt=[33,16,5,32,164,27],et=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],rt=function(t){for(var e=[];t--;)e.push(0);return e},nt=9e4;K=function(t,e){return z(X(t,e))},Y=function(t,e){return W(G(t),e)},Q=function(t,e,r){return G(r?t:t-e)};var it=nt,ot=z=function(t){return t*nt},at=(W=function(t,e){return t*e},G=function(t){return t/nt}),st=(X=function(t,e){return t/e},K),ut=Y,lt=Q,ct=function(t,e,r,n){var i,o,a,s,u,l=0,c=0,f=0;if(e.length&&(i=st(t.baseMediaDecodeTime,t.samplerate),o=Math.ceil(it/(t.samplerate/1024)),r&&n&&(l=i-Math.max(r,n),f=(c=Math.floor(l/o))*o),!(c<1||f>45e3))){for((a=function(){if(!q){var t={96e3:[tt,[227,64],rt(154),[56]],88200:[tt,[231],rt(170),[56]],64e3:[tt,[248,192],rt(240),[56]],48e3:[tt,[255,192],rt(268),[55,148,128],rt(54),[112]],44100:[tt,[255,192],rt(268),[55,163,128],rt(84),[112]],32e3:[tt,[255,192],rt(268),[55,234],rt(226),[112]],24e3:[tt,[255,192],rt(268),[55,255,128],rt(268),[111,112],rt(126),[224]],16e3:[tt,[255,192],rt(268),[55,255,128],rt(268),[111,255],rt(269),[223,108],rt(195),[1,192]],12e3:[et,rt(268),[3,127,248],rt(268),[6,255,240],rt(268),[13,255,224],rt(268),[27,253,128],rt(259),[56]],11025:[et,rt(268),[3,127,248],rt(268),[6,255,240],rt(268),[13,255,224],rt(268),[27,255,192],rt(268),[55,175,128],rt(108),[112]],8e3:[et,rt(268),[3,121,16],rt(47),[7]]};e=t,q=Object.keys(e).reduce((function(t,r){return t[r]=new Uint8Array(e[r].reduce((function(t,e){return t.concat(e)}),[])),t}),{})}var e;return q}()[t.samplerate])||(a=e[0].data),s=0;s<c;s++)u=e[0],e.splice(0,0,{data:a,dts:u.dts-o,pts:u.pts-o});return t.baseMediaDecodeTime-=Math.floor(ut(f,t.samplerate)),f}},ft=function(t){delete t.minSegmentDts,delete t.maxSegmentDts,delete t.minSegmentPts,delete t.maxSegmentPts},ht=function(t,e){var r,n=t.minSegmentDts;return e||(n-=t.timelineStartInfo.dts),r=t.timelineStartInfo.baseMediaDecodeTime,r+=n,r=Math.max(0,r),"audio"===t.type&&(r*=t.samplerate/9e4,r=Math.floor(r)),r},pt=function(t,e){"number"==typeof e.pts&&(void 0===t.timelineStartInfo.pts&&(t.timelineStartInfo.pts=e.pts),void 0===t.minSegmentPts?t.minSegmentPts=e.pts:t.minSegmentPts=Math.min(t.minSegmentPts,e.pts),void 0===t.maxSegmentPts?t.maxSegmentPts=e.pts:t.maxSegmentPts=Math.max(t.maxSegmentPts,e.pts)),"number"==typeof e.dts&&(void 0===t.timelineStartInfo.dts&&(t.timelineStartInfo.dts=e.dts),void 0===t.minSegmentDts?t.minSegmentDts=e.dts:t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),void 0===t.maxSegmentDts?t.maxSegmentDts=e.dts:t.maxSegmentDts=Math.max(t.maxSegmentDts,e.dts))},dt=function t(e){e=e||{},t.prototype.init.call(this),this.parse708captions_="boolean"!=typeof e.parse708captions||e.parse708captions,this.captionPackets_=[],this.ccStreams_=[new Et(0,0),new Et(0,1),new Et(1,0),new Et(1,1)],this.parse708captions_&&(this.cc708Stream_=new bt),this.reset(),this.ccStreams_.forEach((function(t){t.on("data",this.trigger.bind(this,"data")),t.on("partialdone",this.trigger.bind(this,"partialdone")),t.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")))};(dt.prototype=new V).push=function(t){var e,r,n;if("sei_rbsp"===t.nalUnitType&&(e=function(t){for(var e=0,r={payloadType:-1,payloadSize:0},n=0,i=0;e<t.byteLength&&128!==t[e];){for(;255===t[e];)n+=255,e++;for(n+=t[e++];255===t[e];)i+=255,e++;if(i+=t[e++],!r.payload&&4===n){if("GA94"===String.fromCharCode(t[e+3],t[e+4],t[e+5],t[e+6])){r.payloadType=n,r.payloadSize=i,r.payload=t.subarray(e,e+i);break}r.payload=void 0}e+=i,n=0,i=0}return r}(t.escapedRBSP)).payload&&4===e.payloadType&&(r=function(t){return 181!==t.payload[0]||49!=(t.payload[1]<<8|t.payload[2])||"GA94"!==String.fromCharCode(t.payload[3],t.payload[4],t.payload[5],t.payload[6])||3!==t.payload[7]?null:t.payload.subarray(8,t.payload.length-1)}(e)))if(t.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(t.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));n=function(t,e){var r,n,i,o,a=[];if(!(64&e[0]))return a;for(n=31&e[0],r=0;r<n;r++)o={type:3&e[2+(i=3*r)],pts:t},4&e[i+2]&&(o.ccData=e[i+3]<<8|e[i+4],a.push(o));return a}(t.pts,r),this.captionPackets_=this.captionPackets_.concat(n),this.latestDts_!==t.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=t.dts}},dt.prototype.flushCCStreams=function(t){this.ccStreams_.forEach((function(e){return"flush"===t?e.flush():e.partialFlush()}),this)},dt.prototype.flushStream=function(t){this.captionPackets_.length?(this.captionPackets_.forEach((function(t,e){t.presortIndex=e})),this.captionPackets_.sort((function(t,e){return t.pts===e.pts?t.presortIndex-e.presortIndex:t.pts-e.pts})),this.captionPackets_.forEach((function(t){t.type<2?this.dispatchCea608Packet(t):this.dispatchCea708Packet(t)}),this),this.captionPackets_.length=0,this.flushCCStreams(t)):this.flushCCStreams(t)},dt.prototype.flush=function(){return this.flushStream("flush")},dt.prototype.partialFlush=function(){return this.flushStream("partialFlush")},dt.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(t){t.reset()}))},dt.prototype.dispatchCea608Packet=function(t){this.setsTextOrXDSActive(t)?this.activeCea608Channel_[t.type]=null:this.setsChannel1Active(t)?this.activeCea608Channel_[t.type]=0:this.setsChannel2Active(t)&&(this.activeCea608Channel_[t.type]=1),null!==this.activeCea608Channel_[t.type]&&this.ccStreams_[(t.type<<1)+this.activeCea608Channel_[t.type]].push(t)},dt.prototype.setsChannel1Active=function(t){return 4096==(30720&t.ccData)},dt.prototype.setsChannel2Active=function(t){return 6144==(30720&t.ccData)},dt.prototype.setsTextOrXDSActive=function(t){return 256==(28928&t.ccData)||4138==(30974&t.ccData)||6186==(30974&t.ccData)},dt.prototype.dispatchCea708Packet=function(t){this.parse708captions_&&this.cc708Stream_.push(t)};var yt={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},mt=function(t){return 32<=t&&t<=127||160<=t&&t<=255},vt=function(t){this.windowNum=t,this.reset()};vt.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},vt.prototype.getText=function(){return this.rows.join("\n")},vt.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},vt.prototype.newLine=function(t){for(this.rows.length>=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(t),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},vt.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},vt.prototype.addText=function(t){this.rows[this.rowIdx]+=t},vt.prototype.backspace=function(){if(!this.isEmpty()){var t=this.rows[this.rowIdx];this.rows[this.rowIdx]=t.substr(0,t.length-1)}};var gt=function(t){this.serviceNum=t,this.text="",this.currentWindow=new vt(-1),this.windows=[]};gt.prototype.init=function(t,e){this.startPts=t;for(var r=0;r<8;r++)this.windows[r]=new vt(r),"function"==typeof e&&(this.windows[r].beforeRowOverflow=e)},gt.prototype.setCurrentWindow=function(t){this.currentWindow=this.windows[t]};var bt=function t(){t.prototype.init.call(this);var e=this;this.current708Packet=null,this.services={},this.push=function(t){3===t.type?(e.new708Packet(),e.add708Bytes(t)):(null===e.current708Packet&&e.new708Packet(),e.add708Bytes(t))}};bt.prototype=new V,bt.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},bt.prototype.add708Bytes=function(t){var e=t.ccData,r=e>>>8,n=255&e;this.current708Packet.ptsVals.push(t.pts),this.current708Packet.data.push(r),this.current708Packet.data.push(n)},bt.prototype.push708Packet=function(){var t=this.current708Packet,e=t.data,r=null,n=null,i=0,o=e[i++];for(t.seq=o>>6,t.sizeCode=63&o;i<e.length;i++)n=31&(o=e[i++]),7==(r=o>>5)&&n>0&&(r=o=e[i++]),this.pushServiceBlock(r,i,n),n>0&&(i+=n-1)},bt.prototype.pushServiceBlock=function(t,e,r){var n,i=e,o=this.current708Packet.data,a=this.services[t];for(a||(a=this.initService(t,i));i<e+r&&i<o.length;i++)n=o[i],mt(n)?i=this.handleText(i,a):16===n?i=this.extendedCommands(i,a):128<=n&&n<=135?i=this.setCurrentWindow(i,a):152<=n&&n<=159?i=this.defineWindow(i,a):136===n?i=this.clearWindows(i,a):140===n?i=this.deleteWindows(i,a):137===n?i=this.displayWindows(i,a):138===n?i=this.hideWindows(i,a):139===n?i=this.toggleWindows(i,a):151===n?i=this.setWindowAttributes(i,a):144===n?i=this.setPenAttributes(i,a):145===n?i=this.setPenColor(i,a):146===n?i=this.setPenLocation(i,a):143===n?a=this.reset(i,a):8===n?a.currentWindow.backspace():12===n?a.currentWindow.clearText():13===n?a.currentWindow.pendingNewLine=!0:14===n?a.currentWindow.clearText():141===n&&i++},bt.prototype.extendedCommands=function(t,e){var r=this.current708Packet.data[++t];return mt(r)&&(t=this.handleText(t,e,!0)),t},bt.prototype.getPts=function(t){return this.current708Packet.ptsVals[Math.floor(t/2)]},bt.prototype.initService=function(t,e){var r=this;return this.services[t]=new gt(t),this.services[t].init(this.getPts(e),(function(e){r.flushDisplayed(e,r.services[t])})),this.services[t]},bt.prototype.handleText=function(t,e,r){var n,i,o=this.current708Packet.data[t],a=(i=yt[n=(r?4096:0)|o]||n,4096&n&&n===i?"":String.fromCharCode(i)),s=e.currentWindow;return s.pendingNewLine&&!s.isEmpty()&&s.newLine(this.getPts(t)),s.pendingNewLine=!1,s.addText(a),t},bt.prototype.setCurrentWindow=function(t,e){var r=7&this.current708Packet.data[t];return e.setCurrentWindow(r),t},bt.prototype.defineWindow=function(t,e){var r=this.current708Packet.data,n=r[t],i=7&n;e.setCurrentWindow(i);var o=e.currentWindow;return n=r[++t],o.visible=(32&n)>>5,o.rowLock=(16&n)>>4,o.columnLock=(8&n)>>3,o.priority=7&n,n=r[++t],o.relativePositioning=(128&n)>>7,o.anchorVertical=127&n,n=r[++t],o.anchorHorizontal=n,n=r[++t],o.anchorPoint=(240&n)>>4,o.rowCount=15&n,n=r[++t],o.columnCount=63&n,n=r[++t],o.windowStyle=(56&n)>>3,o.penStyle=7&n,o.virtualRowCount=o.rowCount+1,t},bt.prototype.setWindowAttributes=function(t,e){var r=this.current708Packet.data,n=r[t],i=e.currentWindow.winAttr;return n=r[++t],i.fillOpacity=(192&n)>>6,i.fillRed=(48&n)>>4,i.fillGreen=(12&n)>>2,i.fillBlue=3&n,n=r[++t],i.borderType=(192&n)>>6,i.borderRed=(48&n)>>4,i.borderGreen=(12&n)>>2,i.borderBlue=3&n,n=r[++t],i.borderType+=(128&n)>>5,i.wordWrap=(64&n)>>6,i.printDirection=(48&n)>>4,i.scrollDirection=(12&n)>>2,i.justify=3&n,n=r[++t],i.effectSpeed=(240&n)>>4,i.effectDirection=(12&n)>>2,i.displayEffect=3&n,t},bt.prototype.flushDisplayed=function(t,e){for(var r=[],n=0;n<8;n++)e.windows[n].visible&&!e.windows[n].isEmpty()&&r.push(e.windows[n].getText());e.endPts=t,e.text=r.join("\n\n"),this.pushCaption(e),e.startPts=t},bt.prototype.pushCaption=function(t){""!==t.text&&(this.trigger("data",{startPts:t.startPts,endPts:t.endPts,text:t.text,stream:"cc708_"+t.serviceNum}),t.text="",t.startPts=t.endPts)},bt.prototype.displayWindows=function(t,e){var r=this.current708Packet.data[++t],n=this.getPts(t);this.flushDisplayed(n,e);for(var i=0;i<8;i++)r&1<<i&&(e.windows[i].visible=1);return t},bt.prototype.hideWindows=function(t,e){var r=this.current708Packet.data[++t],n=this.getPts(t);this.flushDisplayed(n,e);for(var i=0;i<8;i++)r&1<<i&&(e.windows[i].visible=0);return t},bt.prototype.toggleWindows=function(t,e){var r=this.current708Packet.data[++t],n=this.getPts(t);this.flushDisplayed(n,e);for(var i=0;i<8;i++)r&1<<i&&(e.windows[i].visible^=1);return t},bt.prototype.clearWindows=function(t,e){var r=this.current708Packet.data[++t],n=this.getPts(t);this.flushDisplayed(n,e);for(var i=0;i<8;i++)r&1<<i&&e.windows[i].clearText();return t},bt.prototype.deleteWindows=function(t,e){var r=this.current708Packet.data[++t],n=this.getPts(t);this.flushDisplayed(n,e);for(var i=0;i<8;i++)r&1<<i&&e.windows[i].reset();return t},bt.prototype.setPenAttributes=function(t,e){var r=this.current708Packet.data,n=r[t],i=e.currentWindow.penAttr;return n=r[++t],i.textTag=(240&n)>>4,i.offset=(12&n)>>2,i.penSize=3&n,n=r[++t],i.italics=(128&n)>>7,i.underline=(64&n)>>6,i.edgeType=(56&n)>>3,i.fontStyle=7&n,t},bt.prototype.setPenColor=function(t,e){var r=this.current708Packet.data,n=r[t],i=e.currentWindow.penColor;return n=r[++t],i.fgOpacity=(192&n)>>6,i.fgRed=(48&n)>>4,i.fgGreen=(12&n)>>2,i.fgBlue=3&n,n=r[++t],i.bgOpacity=(192&n)>>6,i.bgRed=(48&n)>>4,i.bgGreen=(12&n)>>2,i.bgBlue=3&n,n=r[++t],i.edgeRed=(48&n)>>4,i.edgeGreen=(12&n)>>2,i.edgeBlue=3&n,t},bt.prototype.setPenLocation=function(t,e){var r=this.current708Packet.data,n=r[t],i=e.currentWindow.penLoc;return e.currentWindow.pendingNewLine=!0,n=r[++t],i.row=15&n,n=r[++t],i.column=63&n,t},bt.prototype.reset=function(t,e){var r=this.getPts(t);return this.flushDisplayed(r,e),this.initService(e.serviceNum,t)};var _t={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},wt=function(t){return null===t?"":(t=_t[t]||t,String.fromCharCode(t))},Tt=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],St=function(){for(var t=[],e=15;e--;)t.push("");return t},Et=function t(e,r){t.prototype.init.call(this),this.field_=e||0,this.dataChannel_=r||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(t){var e,r,n,i,o;if((e=32639&t.ccData)!==this.lastControlCode_){if(4096==(61440&e)?this.lastControlCode_=e:e!==this.PADDING_&&(this.lastControlCode_=null),n=e>>>8,i=255&e,e!==this.PADDING_)if(e===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(e===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(t.pts),this.flushDisplayed(t.pts),r=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=r,this.startPts_=t.pts;else if(e===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(t.pts);else if(e===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(t.pts);else if(e===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(t.pts);else if(e===this.CARRIAGE_RETURN_)this.clearFormatting(t.pts),this.flushDisplayed(t.pts),this.shiftRowsUp_(),this.startPts_=t.pts;else if(e===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(e===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(t.pts),this.displayed_=St();else if(e===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=St();else if(e===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(t.pts),this.displayed_=St()),this.mode_="paintOn",this.startPts_=t.pts;else if(this.isSpecialCharacter(n,i))o=wt((n=(3&n)<<8)|i),this[this.mode_](t.pts,o),this.column_++;else if(this.isExtCharacter(n,i))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),o=wt((n=(3&n)<<8)|i),this[this.mode_](t.pts,o),this.column_++;else if(this.isMidRowCode(n,i))this.clearFormatting(t.pts),this[this.mode_](t.pts," "),this.column_++,14==(14&i)&&this.addFormatting(t.pts,["i"]),1==(1&i)&&this.addFormatting(t.pts,["u"]);else if(this.isOffsetControlCode(n,i))this.column_+=3&i;else if(this.isPAC(n,i)){var a=Tt.indexOf(7968&e);"rollUp"===this.mode_&&(a-this.rollUpRows_+1<0&&(a=this.rollUpRows_-1),this.setRollUp(t.pts,a)),a!==this.row_&&(this.clearFormatting(t.pts),this.row_=a),1&i&&-1===this.formatting_.indexOf("u")&&this.addFormatting(t.pts,["u"]),16==(16&e)&&(this.column_=4*((14&e)>>1)),this.isColorPAC(i)&&14==(14&i)&&this.addFormatting(t.pts,["i"])}else this.isNormalChar(n)&&(0===i&&(i=null),o=wt(n),o+=wt(i),this[this.mode_](t.pts,o),this.column_+=o.length)}else this.lastControlCode_=null}};Et.prototype=new V,Et.prototype.flushDisplayed=function(t){var e=this.displayed_.map((function(t){try{return t.trim()}catch(t){return console.error("Skipping malformed caption."),""}})).join("\n").replace(/^\n+|\n+$/g,"");e.length&&this.trigger("data",{startPts:this.startPts_,endPts:t,text:e,stream:this.name_})},Et.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=St(),this.nonDisplayed_=St(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},Et.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_},Et.prototype.isSpecialCharacter=function(t,e){return t===this.EXT_&&e>=48&&e<=63},Et.prototype.isExtCharacter=function(t,e){return(t===this.EXT_+1||t===this.EXT_+2)&&e>=32&&e<=63},Et.prototype.isMidRowCode=function(t,e){return t===this.EXT_&&e>=32&&e<=47},Et.prototype.isOffsetControlCode=function(t,e){return t===this.OFFSET_&&e>=33&&e<=35},Et.prototype.isPAC=function(t,e){return t>=this.BASE_&&t<this.BASE_+8&&e>=64&&e<=127},Et.prototype.isColorPAC=function(t){return t>=64&&t<=79||t>=96&&t<=127},Et.prototype.isNormalChar=function(t){return t>=32&&t<=127},Et.prototype.setRollUp=function(t,e){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(t),this.nonDisplayed_=St(),this.displayed_=St()),void 0!==e&&e!==this.row_)for(var r=0;r<this.rollUpRows_;r++)this.displayed_[e-r]=this.displayed_[this.row_-r],this.displayed_[this.row_-r]="";void 0===e&&(e=this.row_),this.topRow_=e-this.rollUpRows_+1},Et.prototype.addFormatting=function(t,e){this.formatting_=this.formatting_.concat(e);var r=e.reduce((function(t,e){return t+"<"+e+">"}),"");this[this.mode_](t,r)},Et.prototype.clearFormatting=function(t){if(this.formatting_.length){var e=this.formatting_.reverse().reduce((function(t,e){return t+"</"+e+">"}),"");this.formatting_=[],this[this.mode_](t,e)}},Et.prototype.popOn=function(t,e){var r=this.nonDisplayed_[this.row_];r+=e,this.nonDisplayed_[this.row_]=r},Et.prototype.rollUp=function(t,e){var r=this.displayed_[this.row_];r+=e,this.displayed_[this.row_]=r},Et.prototype.shiftRowsUp_=function(){var t;for(t=0;t<this.topRow_;t++)this.displayed_[t]="";for(t=this.row_+1;t<15;t++)this.displayed_[t]="";for(t=this.topRow_;t<this.row_;t++)this.displayed_[t]=this.displayed_[t+1];this.displayed_[this.row_]=""},Et.prototype.paintOn=function(t,e){var r=this.displayed_[this.row_];r+=e,this.displayed_[this.row_]=r};var Ot={CaptionStream:dt,Cea608Stream:Et,Cea708Stream:bt},kt={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Ct="shared",Pt=function(t,e){var r=1;for(t>e&&(r=-1);Math.abs(e-t)>4294967296;)t+=8589934592*r;return t},xt=function t(e){var r,n;t.prototype.init.call(this),this.type_=e||Ct,this.push=function(t){this.type_!==Ct&&t.type!==this.type_||(void 0===n&&(n=t.dts),t.dts=Pt(t.dts,n),t.pts=Pt(t.pts,n),r=t.dts,this.trigger("data",t))},this.flush=function(){n=r,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){n=void 0,r=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};xt.prototype=new V;var jt,Lt=xt,It=Pt,At=function(t,e,r){var n,i="";for(n=e;n<r;n++)i+="%"+("00"+t[n].toString(16)).slice(-2);return i},Rt=function(t,e,r){return decodeURIComponent(At(t,e,r))},Dt=function(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]},Mt={TXXX:function(t){var e;if(3===t.data[0]){for(e=1;e<t.data.length;e++)if(0===t.data[e]){t.description=Rt(t.data,1,e),t.value=Rt(t.data,e+1,t.data.length).replace(/\0*$/,"");break}t.data=t.value}},WXXX:function(t){var e;if(3===t.data[0])for(e=1;e<t.data.length;e++)if(0===t.data[e]){t.description=Rt(t.data,1,e),t.url=Rt(t.data,e+1,t.data.length);break}},PRIV:function(t){var e,r;for(e=0;e<t.data.length;e++)if(0===t.data[e]){t.owner=(r=t.data,unescape(At(r,0,e)));break}t.privateData=t.data.subarray(e+1),t.data=t.privateData}};jt=function(t){var e,r={debug:!(!t||!t.debug),descriptor:t&&t.descriptor},n=0,i=[],o=0;if(jt.prototype.init.call(this),this.dispatchType=kt.METADATA_STREAM_TYPE.toString(16),r.descriptor)for(e=0;e<r.descriptor.length;e++)this.dispatchType+=("00"+r.descriptor[e].toString(16)).slice(-2);this.push=function(t){var e,a,s,u,l;if("timed-metadata"===t.type)if(t.dataAlignmentIndicator&&(o=0,i.length=0),0===i.length&&(t.data.length<10||t.data[0]!=="I".charCodeAt(0)||t.data[1]!=="D".charCodeAt(0)||t.data[2]!=="3".charCodeAt(0)))r.debug&&console.log("Skipping unrecognized metadata packet");else if(i.push(t),o+=t.data.byteLength,1===i.length&&(n=Dt(t.data.subarray(6,10)),n+=10),!(o<n)){for(e={data:new Uint8Array(n),frames:[],pts:i[0].pts,dts:i[0].dts},l=0;l<n;)e.data.set(i[0].data.subarray(0,n-l),l),l+=i[0].data.byteLength,o-=i[0].data.byteLength,i.shift();a=10,64&e.data[5]&&(a+=4,a+=Dt(e.data.subarray(10,14)),n-=Dt(e.data.subarray(16,20)));do{if((s=Dt(e.data.subarray(a+4,a+8)))<1)return console.log("Malformed ID3 frame encountered. Skipping metadata parsing.");if((u={id:String.fromCharCode(e.data[a],e.data[a+1],e.data[a+2],e.data[a+3]),data:e.data.subarray(a+10,a+s+10)}).key=u.id,Mt[u.id]&&(Mt[u.id](u),"com.apple.streaming.transportStreamTimestamp"===u.owner)){var c=u.data,f=(1&c[3])<<30|c[4]<<22|c[5]<<14|c[6]<<6|c[7]>>>2;f*=4,f+=3&c[7],u.timeStamp=f,void 0===e.pts&&void 0===e.dts&&(e.pts=u.timeStamp,e.dts=u.timeStamp),this.trigger("timestamp",u)}e.frames.push(u),a+=10,a+=s}while(a<n);this.trigger("data",e)}}},jt.prototype=new V;var Nt,Bt,Ut,Ft=jt,Vt=Lt,Ht=188;(Nt=function(){var t=new Uint8Array(Ht),e=0;Nt.prototype.init.call(this),this.push=function(r){var n,i=0,o=Ht;for(e?((n=new Uint8Array(r.byteLength+e)).set(t.subarray(0,e)),n.set(r,e),e=0):n=r;o<n.byteLength;)71!==n[i]||71!==n[o]?(i++,o++):(this.trigger("data",n.subarray(i,o)),i+=Ht,o+=Ht);i<n.byteLength&&(t.set(n.subarray(i),0),e=n.byteLength-i)},this.flush=function(){e===Ht&&71===t[0]&&(this.trigger("data",t),e=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){e=0,this.trigger("reset")}}).prototype=new V,Bt=function(){var t,e,r,n;Bt.prototype.init.call(this),n=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,t=function(t,n){var i=0;n.payloadUnitStartIndicator&&(i+=t[i]+1),"pat"===n.type?e(t.subarray(i),n):r(t.subarray(i),n)},e=function(t,e){e.section_number=t[7],e.last_section_number=t[8],n.pmtPid=(31&t[10])<<8|t[11],e.pmtPid=n.pmtPid},r=function(t,e){var r,i;if(1&t[5]){for(n.programMapTable={video:null,audio:null,"timed-metadata":{}},r=3+((15&t[1])<<8|t[2])-4,i=12+((15&t[10])<<8|t[11]);i<r;){var o=t[i],a=(31&t[i+1])<<8|t[i+2];o===kt.H264_STREAM_TYPE&&null===n.programMapTable.video?n.programMapTable.video=a:o===kt.ADTS_STREAM_TYPE&&null===n.programMapTable.audio?n.programMapTable.audio=a:o===kt.METADATA_STREAM_TYPE&&(n.programMapTable["timed-metadata"][a]=o),i+=5+((15&t[i+3])<<8|t[i+4])}e.programMapTable=n.programMapTable}},this.push=function(e){var r={},n=4;if(r.payloadUnitStartIndicator=!!(64&e[1]),r.pid=31&e[1],r.pid<<=8,r.pid|=e[2],(48&e[3])>>>4>1&&(n+=e[n]+1),0===r.pid)r.type="pat",t(e.subarray(n),r),this.trigger("data",r);else if(r.pid===this.pmtPid)for(r.type="pmt",t(e.subarray(n),r),this.trigger("data",r);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([e,n,r]):this.processPes_(e,n,r)},this.processPes_=function(t,e,r){r.pid===this.programMapTable.video?r.streamType=kt.H264_STREAM_TYPE:r.pid===this.programMapTable.audio?r.streamType=kt.ADTS_STREAM_TYPE:r.streamType=this.programMapTable["timed-metadata"][r.pid],r.type="pes",r.data=t.subarray(e),this.trigger("data",r)}},Bt.prototype=new V,Bt.STREAM_TYPES={h264:27,adts:15},Ut=function(){var t,e=this,r={data:[],size:0},n={data:[],size:0},i={data:[],size:0},o=function(t,r,n){var i,o,a=new Uint8Array(t.size),s={type:r},u=0,l=0;if(t.data.length&&!(t.size<9)){for(s.trackId=t.data[0].pid,u=0;u<t.data.length;u++)o=t.data[u],a.set(o.data,l),l+=o.data.byteLength;var c,f,h,p;f=s,p=(c=a)[0]<<16|c[1]<<8|c[2],f.data=new Uint8Array,1===p&&(f.packetLength=6+(c[4]<<8|c[5]),f.dataAlignmentIndicator=0!=(4&c[6]),192&(h=c[7])&&(f.pts=(14&c[9])<<27|(255&c[10])<<20|(254&c[11])<<12|(255&c[12])<<5|(254&c[13])>>>3,f.pts*=4,f.pts+=(6&c[13])>>>1,f.dts=f.pts,64&h&&(f.dts=(14&c[14])<<27|(255&c[15])<<20|(254&c[16])<<12|(255&c[17])<<5|(254&c[18])>>>3,f.dts*=4,f.dts+=(6&c[18])>>>1)),f.data=c.subarray(9+c[8])),i="video"===r||s.packetLength<=t.size,(n||i)&&(t.size=0,t.data.length=0),i&&e.trigger("data",s)}};Ut.prototype.init.call(this),this.push=function(a){({pat:function(){},pes:function(){var t,e;switch(a.streamType){case kt.H264_STREAM_TYPE:t=r,e="video";break;case kt.ADTS_STREAM_TYPE:t=n,e="audio";break;case kt.METADATA_STREAM_TYPE:t=i,e="timed-metadata";break;default:return}a.payloadUnitStartIndicator&&o(t,e,!0),t.data.push(a),t.size+=a.data.byteLength},pmt:function(){var r={type:"metadata",tracks:[]};null!==(t=a.programMapTable).video&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+t.video,codec:"avc",type:"video"}),null!==t.audio&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+t.audio,codec:"adts",type:"audio"}),e.trigger("data",r)}})[a.type]()},this.reset=function(){r.size=0,r.data.length=0,n.size=0,n.data.length=0,this.trigger("reset")},this.flushStreams_=function(){o(r,"video"),o(n,"audio"),o(i,"timed-metadata")},this.flush=function(){this.flushStreams_(),this.trigger("done")}},Ut.prototype=new V;var qt={PAT_PID:0,MP2T_PACKET_LENGTH:Ht,TransportPacketStream:Nt,TransportParseStream:Bt,ElementaryStream:Ut,TimestampRolloverStream:Vt,CaptionStream:Ot.CaptionStream,Cea608Stream:Ot.Cea608Stream,Cea708Stream:Ot.Cea708Stream,MetadataStream:Ft};for(var zt in kt)kt.hasOwnProperty(zt)&&(qt[zt]=kt[zt]);var Wt,Gt=qt,Xt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];Wt=function(t){var e,r=0;Wt.prototype.init.call(this),this.push=function(n){var i,o,a,s,u,l,c=0;if(t||(r=0),"audio"===n.type)for(e?(s=e,(e=new Uint8Array(s.byteLength+n.data.byteLength)).set(s),e.set(n.data,s.byteLength)):e=n.data;c+5<e.length;)if(255===e[c]&&240==(246&e[c+1])){if(o=2*(1&~e[c+1]),i=(3&e[c+3])<<11|e[c+4]<<3|(224&e[c+5])>>5,l=9e4*(u=1024*(1+(3&e[c+6])))/Xt[(60&e[c+2])>>>2],a=c+i,e.byteLength<a)return;if(this.trigger("data",{pts:n.pts+r*l,dts:n.dts+r*l,sampleCount:u,audioobjecttype:1+(e[c+2]>>>6&3),channelcount:(1&e[c+2])<<2|(192&e[c+3])>>>6,samplerate:Xt[(60&e[c+2])>>>2],samplingfrequencyindex:(60&e[c+2])>>>2,samplesize:16,data:e.subarray(c+7+o,a)}),r++,e.byteLength===a)return void(e=void 0);e=e.subarray(a)}else c++},this.flush=function(){r=0,this.trigger("done")},this.reset=function(){e=void 0,this.trigger("reset")},this.endTimeline=function(){e=void 0,this.trigger("endedtimeline")}},Wt.prototype=new V;var Kt,Yt,Qt,$t=Wt,Jt=function(t){var e=t.byteLength,r=0,n=0;this.length=function(){return 8*e},this.bitsAvailable=function(){return 8*e+n},this.loadWord=function(){var i=t.byteLength-e,o=new Uint8Array(4),a=Math.min(4,e);if(0===a)throw new Error("no bytes available");o.set(t.subarray(i,i+a)),r=new DataView(o.buffer).getUint32(0),n=8*a,e-=a},this.skipBits=function(t){var i;n>t?(r<<=t,n-=t):(t-=n,t-=8*(i=Math.floor(t/8)),e-=i,this.loadWord(),r<<=t,n-=t)},this.readBits=function(t){var i=Math.min(n,t),o=r>>>32-i;return(n-=i)>0?r<<=i:e>0&&this.loadWord(),(i=t-i)>0?o<<i|this.readBits(i):o},this.skipLeadingZeros=function(){var t;for(t=0;t<n;++t)if(0!=(r&2147483648>>>t))return r<<=t,n-=t,t;return this.loadWord(),t+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var t=this.skipLeadingZeros();return this.readBits(t+1)-1},this.readExpGolomb=function(){var t=this.readUnsignedExpGolomb();return 1&t?1+t>>>1:-1*(t>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};Yt=function(){var t,e,r=0;Yt.prototype.init.call(this),this.push=function(n){var i;e?((i=new Uint8Array(e.byteLength+n.data.byteLength)).set(e),i.set(n.data,e.byteLength),e=i):e=n.data;for(var o=e.byteLength;r<o-3;r++)if(1===e[r+2]){t=r+5;break}for(;t<o;)switch(e[t]){case 0:if(0!==e[t-1]){t+=2;break}if(0!==e[t-2]){t++;break}r+3!==t-2&&this.trigger("data",e.subarray(r+3,t-2));do{t++}while(1!==e[t]&&t<o);r=t-2,t+=3;break;case 1:if(0!==e[t-1]||0!==e[t-2]){t+=3;break}this.trigger("data",e.subarray(r+3,t-2)),r=t-2,t+=3;break;default:t+=3}e=e.subarray(r),t-=r,r=0},this.reset=function(){e=null,r=0,this.trigger("reset")},this.flush=function(){e&&e.byteLength>3&&this.trigger("data",e.subarray(r+3)),e=null,r=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Yt.prototype=new V,Qt={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Kt=function(){var t,e,r,n,i,o,a,s=new Yt;Kt.prototype.init.call(this),t=this,this.push=function(t){"video"===t.type&&(e=t.trackId,r=t.pts,n=t.dts,s.push(t))},s.on("data",(function(a){var s={trackId:e,pts:r,dts:n,data:a};switch(31&a[0]){case 5:s.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:s.nalUnitType="sei_rbsp",s.escapedRBSP=i(a.subarray(1));break;case 7:s.nalUnitType="seq_parameter_set_rbsp",s.escapedRBSP=i(a.subarray(1)),s.config=o(s.escapedRBSP);break;case 8:s.nalUnitType="pic_parameter_set_rbsp";break;case 9:s.nalUnitType="access_unit_delimiter_rbsp"}t.trigger("data",s)})),s.on("done",(function(){t.trigger("done")})),s.on("partialdone",(function(){t.trigger("partialdone")})),s.on("reset",(function(){t.trigger("reset")})),s.on("endedtimeline",(function(){t.trigger("endedtimeline")})),this.flush=function(){s.flush()},this.partialFlush=function(){s.partialFlush()},this.reset=function(){s.reset()},this.endTimeline=function(){s.endTimeline()},a=function(t,e){var r,n=8,i=8;for(r=0;r<t;r++)0!==i&&(i=(n+e.readExpGolomb()+256)%256),n=0===i?n:i},i=function(t){for(var e,r,n=t.byteLength,i=[],o=1;o<n-2;)0===t[o]&&0===t[o+1]&&3===t[o+2]?(i.push(o+2),o+=2):o++;if(0===i.length)return t;e=n-i.length,r=new Uint8Array(e);var a=0;for(o=0;o<e;a++,o++)a===i[0]&&(a++,i.shift()),r[o]=t[a];return r},o=function(t){var e,r,n,i,o,s,u,l,c,f,h,p,d,y=0,m=0,v=0,g=0,b=1;if(r=(e=new Jt(t)).readUnsignedByte(),i=e.readUnsignedByte(),n=e.readUnsignedByte(),e.skipUnsignedExpGolomb(),Qt[r]&&(3===(o=e.readUnsignedExpGolomb())&&e.skipBits(1),e.skipUnsignedExpGolomb(),e.skipUnsignedExpGolomb(),e.skipBits(1),e.readBoolean()))for(h=3!==o?8:12,d=0;d<h;d++)e.readBoolean()&&a(d<6?16:64,e);if(e.skipUnsignedExpGolomb(),0===(s=e.readUnsignedExpGolomb()))e.readUnsignedExpGolomb();else if(1===s)for(e.skipBits(1),e.skipExpGolomb(),e.skipExpGolomb(),u=e.readUnsignedExpGolomb(),d=0;d<u;d++)e.skipExpGolomb();if(e.skipUnsignedExpGolomb(),e.skipBits(1),l=e.readUnsignedExpGolomb(),c=e.readUnsignedExpGolomb(),0===(f=e.readBits(1))&&e.skipBits(1),e.skipBits(1),e.readBoolean()&&(y=e.readUnsignedExpGolomb(),m=e.readUnsignedExpGolomb(),v=e.readUnsignedExpGolomb(),g=e.readUnsignedExpGolomb()),e.readBoolean()&&e.readBoolean()){switch(e.readUnsignedByte()){case 1:p=[1,1];break;case 2:p=[12,11];break;case 3:p=[10,11];break;case 4:p=[16,11];break;case 5:p=[40,33];break;case 6:p=[24,11];break;case 7:p=[20,11];break;case 8:p=[32,11];break;case 9:p=[80,33];break;case 10:p=[18,11];break;case 11:p=[15,11];break;case 12:p=[64,33];break;case 13:p=[160,99];break;case 14:p=[4,3];break;case 15:p=[3,2];break;case 16:p=[2,1];break;case 255:p=[e.readUnsignedByte()<<8|e.readUnsignedByte(),e.readUnsignedByte()<<8|e.readUnsignedByte()]}p&&(b=p[0]/p[1])}return{profileIdc:r,levelIdc:n,profileCompatibility:i,width:Math.ceil((16*(l+1)-2*y-2*m)*b),height:(2-f)*(c+1)*16-2*v-2*g,sarRatio:p}}},Kt.prototype=new V;var Zt,te={H264Stream:Kt,NalByteStream:Yt},ee=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],re=function(t,e){var r=t[e+6]<<21|t[e+7]<<14|t[e+8]<<7|t[e+9];return r=r>=0?r:0,(16&t[e+5])>>4?r+20:r+10},ne=function t(e,r){return e.length-r<10||e[r]!=="I".charCodeAt(0)||e[r+1]!=="D".charCodeAt(0)||e[r+2]!=="3".charCodeAt(0)?r:t(e,r+=re(e,r))},ie=function(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]},oe={isLikelyAacData:function(t){var e=ne(t,0);return t.length>=e+2&&255==(255&t[e])&&240==(240&t[e+1])&&16==(22&t[e+1])},parseId3TagSize:re,parseAdtsSize:function(t,e){var r=(224&t[e+5])>>5,n=t[e+4]<<3;return 6144&t[e+3]|n|r},parseType:function(t,e){return t[e]==="I".charCodeAt(0)&&t[e+1]==="D".charCodeAt(0)&&t[e+2]==="3".charCodeAt(0)?"timed-metadata":!0&t[e]&&240==(240&t[e+1])?"audio":null},parseSampleRate:function(t){for(var e=0;e+5<t.length;){if(255===t[e]&&240==(246&t[e+1]))return ee[(60&t[e+2])>>>2];e++}return null},parseAacTimestamp:function(t){var e,r,n;e=10,64&t[5]&&(e+=4,e+=ie(t.subarray(10,14)));do{if((r=ie(t.subarray(e+4,e+8)))<1)return null;if("PRIV"===String.fromCharCode(t[e],t[e+1],t[e+2],t[e+3])){n=t.subarray(e+10,e+r+10);for(var i=0;i<n.byteLength;i++)if(0===n[i]){var o=unescape(function(t,e,r){var n,i="";for(n=0;n<r;n++)i+="%"+("00"+t[n].toString(16)).slice(-2);return i}(n,0,i));if("com.apple.streaming.transportStreamTimestamp"===o){var a=n.subarray(i+1),s=(1&a[3])<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2;return(s*=4)+(3&a[7])}break}}e+=10,e+=r}while(e<t.byteLength);return null}};(Zt=function(){var t=new Uint8Array,e=0;Zt.prototype.init.call(this),this.setTimestamp=function(t){e=t},this.push=function(r){var n,i,o,a,s=0,u=0;for(t.length?(a=t.length,(t=new Uint8Array(r.byteLength+a)).set(t.subarray(0,a)),t.set(r,a)):t=r;t.length-u>=3;)if(t[u]!=="I".charCodeAt(0)||t[u+1]!=="D".charCodeAt(0)||t[u+2]!=="3".charCodeAt(0))if(255!=(255&t[u])||240!=(240&t[u+1]))u++;else{if(t.length-u<7)break;if(u+(s=oe.parseAdtsSize(t,u))>t.length)break;o={type:"audio",data:t.subarray(u,u+s),pts:e,dts:e},this.trigger("data",o),u+=s}else{if(t.length-u<10)break;if(u+(s=oe.parseId3TagSize(t,u))>t.length)break;i={type:"timed-metadata",data:t.subarray(u,u+s)},this.trigger("data",i),u+=s}n=t.length-u,t=n>0?t.subarray(u):new Uint8Array},this.reset=function(){t=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){t=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new V;var ae,se,ue,le,ce=Zt,fe=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],he=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],pe=te.H264Stream,de=oe.isLikelyAacData,ye=function(t,e){var r;if(t.length!==e.length)return!1;for(r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0},me=function(t,e,r,n,i,o){return{start:{dts:t,pts:t+(r-e)},end:{dts:t+(n-e),pts:t+(i-r)},prependedContentDuration:o,baseMediaDecodeTime:t}};se=function(t,e){var r=[],n=0,i=0,o=0,a=1/0;e=e||{},se.prototype.init.call(this),this.push=function(e){pt(t,e),t&&fe.forEach((function(r){t[r]=e[r]})),r.push(e)},this.setEarliestDts=function(t){i=t},this.setVideoBaseMediaDecodeTime=function(t){a=t},this.setAudioAppendStart=function(t){o=t},this.flush=function(){var s,u,l,c,f,h,p;0!==r.length?(s=function(t,e,r){return e.minSegmentDts>=r?t:(e.minSegmentDts=1/0,t.filter((function(t){return t.dts>=r&&(e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),e.minSegmentPts=e.minSegmentDts,!0)})))}(r,t,i),t.baseMediaDecodeTime=ht(t,e.keepOriginalTimestamps),p=ct(t,s,o,a),t.samples=function(t){var e,r,n=[];for(e=0;e<t.length;e++)r=t[e],n.push({size:r.data.byteLength,duration:1024});return n}(s),l=$(function(t){var e,r,n=0,i=new Uint8Array(function(t){var e,r=0;for(e=0;e<t.length;e++)r+=t[e].data.byteLength;return r}(t));for(e=0;e<t.length;e++)r=t[e],i.set(r.data,n),n+=r.data.byteLength;return i}(s)),r=[],u=J(n,[t]),c=new Uint8Array(u.byteLength+l.byteLength),n++,c.set(u),c.set(l,u.byteLength),ft(t),f=Math.ceil(9216e4/t.samplerate),s.length&&(h=s.length*f,this.trigger("segmentTimingInfo",me(st(t.baseMediaDecodeTime,t.samplerate),s[0].dts,s[0].pts,s[0].dts+h,s[0].pts+h,p||0)),this.trigger("timingInfo",{start:s[0].pts,end:s[0].pts+h})),this.trigger("data",{track:t,boxes:c}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")},this.reset=function(){ft(t),r=[],this.trigger("reset")}},se.prototype=new V,ae=function(t,e){var r,n,i=0,o=[],a=[];e=e||{},ae.prototype.init.call(this),delete t.minPTS,this.gopCache_=[],this.push=function(e){pt(t,e),"seq_parameter_set_rbsp"!==e.nalUnitType||r||(r=e.config,t.sps=[e.data],he.forEach((function(e){t[e]=r[e]}),this)),"pic_parameter_set_rbsp"!==e.nalUnitType||n||(n=e.data,t.pps=[e.data]),o.push(e)},this.flush=function(){for(var r,n,s,u,l,c,f,h,p=0;o.length&&"access_unit_delimiter_rbsp"!==o[0].nalUnitType;)o.shift();if(0===o.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(r=function(t){var e,r,n=[],i=[];for(i.byteLength=0,i.nalCount=0,i.duration=0,n.byteLength=0,e=0;e<t.length;e++)"access_unit_delimiter_rbsp"===(r=t[e]).nalUnitType?(n.length&&(n.duration=r.dts-n.dts,i.byteLength+=n.byteLength,i.nalCount+=n.length,i.duration+=n.duration,i.push(n)),(n=[r]).byteLength=r.data.byteLength,n.pts=r.pts,n.dts=r.dts):("slice_layer_without_partitioning_rbsp_idr"===r.nalUnitType&&(n.keyFrame=!0),n.duration=r.dts-n.dts,n.byteLength+=r.data.byteLength,n.push(r));return i.length&&(!n.duration||n.duration<=0)&&(n.duration=i[i.length-1].duration),i.byteLength+=n.byteLength,i.nalCount+=n.length,i.duration+=n.duration,i.push(n),i}(o),(s=function(t){var e,r,n=[],i=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=t[0].pts,n.dts=t[0].dts,i.byteLength=0,i.nalCount=0,i.duration=0,i.pts=t[0].pts,i.dts=t[0].dts,e=0;e<t.length;e++)(r=t[e]).keyFrame?(n.length&&(i.push(n),i.byteLength+=n.byteLength,i.nalCount+=n.nalCount,i.duration+=n.duration),(n=[r]).nalCount=r.length,n.byteLength=r.byteLength,n.pts=r.pts,n.dts=r.dts,n.duration=r.duration):(n.duration+=r.duration,n.nalCount+=r.length,n.byteLength+=r.byteLength,n.push(r));return i.length&&n.duration<=0&&(n.duration=i[i.length-1].duration),i.byteLength+=n.byteLength,i.nalCount+=n.nalCount,i.duration+=n.duration,i.push(n),i}(r))[0][0].keyFrame||((n=this.getGopForFusion_(o[0],t))?(p=n.duration,s.unshift(n),s.byteLength+=n.byteLength,s.nalCount+=n.nalCount,s.pts=n.pts,s.dts=n.dts,s.duration+=n.duration):s=function(t){var e;return!t[0][0].keyFrame&&t.length>1&&(e=t.shift(),t.byteLength-=e.byteLength,t.nalCount-=e.nalCount,t[0][0].dts=e.dts,t[0][0].pts=e.pts,t[0][0].duration+=e.duration),t}(s)),a.length){var d;if(!(d=e.alignGopsAtEnd?this.alignGopsAtEnd_(s):this.alignGopsAtStart_(s)))return this.gopCache_.unshift({gop:s.pop(),pps:t.pps,sps:t.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),o=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");ft(t),s=d}pt(t,s),t.samples=function(t,e){var r,n,i,o,a,s=e||0,u=[];for(r=0;r<t.length;r++)for(o=t[r],n=0;n<o.length;n++)a=o[n],s+=(i=Z(a,s)).size,u.push(i);return u}(s),l=$(function(t){var e,r,n,i,o,a,s=0,u=t.byteLength,l=t.nalCount,c=new Uint8Array(u+4*l),f=new DataView(c.buffer);for(e=0;e<t.length;e++)for(i=t[e],r=0;r<i.length;r++)for(o=i[r],n=0;n<o.length;n++)a=o[n],f.setUint32(s,a.data.byteLength),s+=4,c.set(a.data,s),s+=a.data.byteLength;return c}(s)),t.baseMediaDecodeTime=ht(t,e.keepOriginalTimestamps),this.trigger("processedGopsInfo",s.map((function(t){return{pts:t.pts,dts:t.dts,byteLength:t.byteLength}}))),f=s[0],h=s[s.length-1],this.trigger("segmentTimingInfo",me(t.baseMediaDecodeTime,f.dts,f.pts,h.dts+h.duration,h.pts+h.duration,p)),this.trigger("timingInfo",{start:s[0].pts,end:s[s.length-1].pts+s[s.length-1].duration}),this.gopCache_.unshift({gop:s.pop(),pps:t.pps,sps:t.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),o=[],this.trigger("baseMediaDecodeTime",t.baseMediaDecodeTime),this.trigger("timelineStartInfo",t.timelineStartInfo),u=J(i,[t]),c=new Uint8Array(u.byteLength+l.byteLength),i++,c.set(u),c.set(l,u.byteLength),this.trigger("data",{track:t,boxes:c}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),o=[],this.gopCache_.length=0,a.length=0,this.trigger("reset")},this.resetStream_=function(){ft(t),r=void 0,n=void 0},this.getGopForFusion_=function(e){var r,n,i,o,a,s=1/0;for(a=0;a<this.gopCache_.length;a++)i=(o=this.gopCache_[a]).gop,t.pps&&ye(t.pps[0],o.pps[0])&&t.sps&&ye(t.sps[0],o.sps[0])&&(i.dts<t.timelineStartInfo.dts||(r=e.dts-i.dts-i.duration)>=-1e4&&r<=45e3&&(!n||s>r)&&(n=o,s=r));return n?n.gop:null},this.alignGopsAtStart_=function(t){var e,r,n,i,o,s,u,l;for(o=t.byteLength,s=t.nalCount,u=t.duration,e=r=0;e<a.length&&r<t.length&&(n=a[e],i=t[r],n.pts!==i.pts);)i.pts>n.pts?e++:(r++,o-=i.byteLength,s-=i.nalCount,u-=i.duration);return 0===r?t:r===t.length?null:((l=t.slice(r)).byteLength=o,l.duration=u,l.nalCount=s,l.pts=l[0].pts,l.dts=l[0].dts,l)},this.alignGopsAtEnd_=function(t){var e,r,n,i,o,s,u;for(e=a.length-1,r=t.length-1,o=null,s=!1;e>=0&&r>=0;){if(n=a[e],i=t[r],n.pts===i.pts){s=!0;break}n.pts>i.pts?e--:(e===a.length-1&&(o=r),r--)}if(!s&&null===o)return null;if(0===(u=s?r:o))return t;var l=t.slice(u),c=l.reduce((function(t,e){return t.byteLength+=e.byteLength,t.duration+=e.duration,t.nalCount+=e.nalCount,t}),{byteLength:0,duration:0,nalCount:0});return l.byteLength=c.byteLength,l.duration=c.duration,l.nalCount=c.nalCount,l.pts=l[0].pts,l.dts=l[0].dts,l},this.alignGopsWith=function(t){a=t}},ae.prototype=new V,le=function(t,e){this.numberOfTracks=0,this.metadataStream=e,void 0!==(t=t||{}).remux?this.remuxTracks=!!t.remux:this.remuxTracks=!0,"boolean"==typeof t.keepOriginalTimestamps?this.keepOriginalTimestamps=t.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,le.prototype.init.call(this),this.push=function(t){return t.text?this.pendingCaptions.push(t):t.frames?this.pendingMetadata.push(t):(this.pendingTracks.push(t.track),this.pendingBytes+=t.boxes.byteLength,"video"===t.track.type&&(this.videoTrack=t.track,this.pendingBoxes.push(t.boxes)),void("audio"===t.track.type&&(this.audioTrack=t.track,this.pendingBoxes.unshift(t.boxes))))}},le.prototype=new V,le.prototype.flush=function(t){var e,r,n,o,a=0,s={captions:[],captionStreams:{},metadata:[],info:{}},l=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==t&&"AudioSegmentStream"!==t)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?(l=this.videoTrack.timelineStartInfo.pts,he.forEach((function(t){s.info[t]=this.videoTrack[t]}),this)):this.audioTrack&&(l=this.audioTrack.timelineStartInfo.pts,fe.forEach((function(t){s.info[t]=this.audioTrack[t]}),this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?s.type=this.pendingTracks[0].type:s.type="combined",this.emittedTracks+=this.pendingTracks.length,n=function(t){var e,r=i(),n=u(t);return(e=new Uint8Array(r.byteLength+n.byteLength)).set(r),e.set(n,r.byteLength),e}(this.pendingTracks),s.initSegment=new Uint8Array(n.byteLength),s.initSegment.set(n),s.data=new Uint8Array(this.pendingBytes),o=0;o<this.pendingBoxes.length;o++)s.data.set(this.pendingBoxes[o],a),a+=this.pendingBoxes[o].byteLength;for(o=0;o<this.pendingCaptions.length;o++)(e=this.pendingCaptions[o]).startTime=lt(e.startPts,l,this.keepOriginalTimestamps),e.endTime=lt(e.endPts,l,this.keepOriginalTimestamps),s.captionStreams[e.stream]=!0,s.captions.push(e);for(o=0;o<this.pendingMetadata.length;o++)(r=this.pendingMetadata[o]).cueTime=lt(r.pts,l,this.keepOriginalTimestamps),s.metadata.push(r);for(s.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",s),o=0;o<s.captions.length;o++)e=s.captions[o],this.trigger("caption",e);for(o=0;o<s.metadata.length;o++)r=s.metadata[o],this.trigger("id3Frame",r)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},le.prototype.setRemux=function(t){this.remuxTracks=t},ue=function(t){var e,r,n=this,i=!0;ue.prototype.init.call(this),t=t||{},this.baseMediaDecodeTime=t.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var i={};this.transmuxPipeline_=i,i.type="aac",i.metadataStream=new Gt.MetadataStream,i.aacStream=new ce,i.audioTimestampRolloverStream=new Gt.TimestampRolloverStream("audio"),i.timedMetadataTimestampRolloverStream=new Gt.TimestampRolloverStream("timed-metadata"),i.adtsStream=new $t,i.coalesceStream=new le(t,i.metadataStream),i.headOfPipeline=i.aacStream,i.aacStream.pipe(i.audioTimestampRolloverStream).pipe(i.adtsStream),i.aacStream.pipe(i.timedMetadataTimestampRolloverStream).pipe(i.metadataStream).pipe(i.coalesceStream),i.metadataStream.on("timestamp",(function(t){i.aacStream.setTimestamp(t.timeStamp)})),i.aacStream.on("data",(function(o){"timed-metadata"!==o.type&&"audio"!==o.type||i.audioSegmentStream||(r=r||{timelineStartInfo:{baseMediaDecodeTime:n.baseMediaDecodeTime},codec:"adts",type:"audio"},i.coalesceStream.numberOfTracks++,i.audioSegmentStream=new se(r,t),i.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream),n.trigger("trackinfo",{hasAudio:!!r,hasVideo:!!e}))})),i.coalesceStream.on("data",this.trigger.bind(this,"data")),i.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setupTsPipeline=function(){var i={};this.transmuxPipeline_=i,i.type="ts",i.metadataStream=new Gt.MetadataStream,i.packetStream=new Gt.TransportPacketStream,i.parseStream=new Gt.TransportParseStream,i.elementaryStream=new Gt.ElementaryStream,i.timestampRolloverStream=new Gt.TimestampRolloverStream,i.adtsStream=new $t,i.h264Stream=new pe,i.captionStream=new Gt.CaptionStream(t),i.coalesceStream=new le(t,i.metadataStream),i.headOfPipeline=i.packetStream,i.packetStream.pipe(i.parseStream).pipe(i.elementaryStream).pipe(i.timestampRolloverStream),i.timestampRolloverStream.pipe(i.h264Stream),i.timestampRolloverStream.pipe(i.adtsStream),i.timestampRolloverStream.pipe(i.metadataStream).pipe(i.coalesceStream),i.h264Stream.pipe(i.captionStream).pipe(i.coalesceStream),i.elementaryStream.on("data",(function(o){var a;if("metadata"===o.type){for(a=o.tracks.length;a--;)e||"video"!==o.tracks[a].type?r||"audio"!==o.tracks[a].type||((r=o.tracks[a]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime):(e=o.tracks[a]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime;e&&!i.videoSegmentStream&&(i.coalesceStream.numberOfTracks++,i.videoSegmentStream=new ae(e,t),i.videoSegmentStream.on("timelineStartInfo",(function(e){r&&!t.keepOriginalTimestamps&&(r.timelineStartInfo=e,i.audioSegmentStream.setEarliestDts(e.dts-n.baseMediaDecodeTime))})),i.videoSegmentStream.on("processedGopsInfo",n.trigger.bind(n,"gopInfo")),i.videoSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"videoSegmentTimingInfo")),i.videoSegmentStream.on("baseMediaDecodeTime",(function(t){r&&i.audioSegmentStream.setVideoBaseMediaDecodeTime(t)})),i.videoSegmentStream.on("timingInfo",n.trigger.bind(n,"videoTimingInfo")),i.h264Stream.pipe(i.videoSegmentStream).pipe(i.coalesceStream)),r&&!i.audioSegmentStream&&(i.coalesceStream.numberOfTracks++,i.audioSegmentStream=new se(r,t),i.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),i.audioSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"audioSegmentTimingInfo")),i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream)),n.trigger("trackinfo",{hasAudio:!!r,hasVideo:!!e})}})),i.coalesceStream.on("data",this.trigger.bind(this,"data")),i.coalesceStream.on("id3Frame",(function(t){t.dispatchType=i.metadataStream.dispatchType,n.trigger("id3Frame",t)})),i.coalesceStream.on("caption",this.trigger.bind(this,"caption")),i.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setBaseMediaDecodeTime=function(n){var i=this.transmuxPipeline_;t.keepOriginalTimestamps||(this.baseMediaDecodeTime=n),r&&(r.timelineStartInfo.dts=void 0,r.timelineStartInfo.pts=void 0,ft(r),i.audioTimestampRolloverStream&&i.audioTimestampRolloverStream.discontinuity()),e&&(i.videoSegmentStream&&(i.videoSegmentStream.gopCache_=[]),e.timelineStartInfo.dts=void 0,e.timelineStartInfo.pts=void 0,ft(e),i.captionStream.reset()),i.timestampRolloverStream&&i.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(t){r&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(t)},this.setRemux=function(e){var r=this.transmuxPipeline_;t.remux=e,r&&r.coalesceStream&&r.coalesceStream.setRemux(e)},this.alignGopsWith=function(t){e&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(t)},this.push=function(t){if(i){var e=de(t);e&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():e||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),i=!1}this.transmuxPipeline_.headOfPipeline.push(t)},this.flush=function(){i=!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()}},ue.prototype=new V;var ve,ge,be,_e={Transmuxer:ue,VideoSegmentStream:ae,AudioSegmentStream:se,AUDIO_PROPERTIES:fe,VIDEO_PROPERTIES:he,generateSegmentTimingInfo:me},we=function(t){return t>>>0},Te=function(t){var e="";return e+=String.fromCharCode(t[0]),e+=String.fromCharCode(t[1]),(e+=String.fromCharCode(t[2]))+String.fromCharCode(t[3])},Se=we,Ee=function t(e,r){var n,i,o,a,s,u=[];if(!r.length)return null;for(n=0;n<e.byteLength;)i=Se(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3]),o=Te(e.subarray(n+4,n+8)),a=i>1?n+i:e.byteLength,o===r[0]&&(1===r.length?u.push(e.subarray(n+8,a)):(s=t(e.subarray(n+8,a),r.slice(1))).length&&(u=u.concat(s))),n=a;return u},Oe=we,ke=function(t){return{isLeading:(12&t[0])>>>2,dependsOn:3&t[0],isDependedOn:(192&t[1])>>>6,hasRedundancy:(48&t[1])>>>4,paddingValue:(14&t[1])>>>1,isNonSyncSample:1&t[1],degradationPriority:t[2]<<8|t[3]}},Ce=function(t){for(var e,r,n=t.byteLength,i=[],o=1;o<n-2;)0===t[o]&&0===t[o+1]&&3===t[o+2]?(i.push(o+2),o+=2):o++;if(0===i.length)return t;e=n-i.length,r=new Uint8Array(e);var a=0;for(o=0;o<e;a++,o++)a===i[0]&&(a++,i.shift()),r[o]=t[a];return r},Pe=Ot.CaptionStream,xe=function(t,e){for(var r=t,n=0;n<e.length;n++){var i=e[n];if(r<i.size)return i;r-=i.size}return null},je=function(t,e){var r=Ee(t,["moof","traf"]),n=Ee(t,["mdat"]),i={},o=[];return n.forEach((function(t,e){var n=r[e];o.push({mdat:t,traf:n})})),o.forEach((function(t){var r,n,o=t.mdat,a=t.traf,s=function(t){var e,r=new DataView(t.buffer,t.byteOffset,t.byteLength),n={version:t[0],flags:new Uint8Array(t.subarray(1,4)),trackId:r.getUint32(4)},i=1&n.flags[2],o=2&n.flags[2],a=8&n.flags[2],s=16&n.flags[2],u=32&n.flags[2],l=65536&n.flags[0],c=131072&n.flags[0];return e=8,i&&(e+=4,n.baseDataOffset=r.getUint32(12),e+=4),o&&(n.sampleDescriptionIndex=r.getUint32(e),e+=4),a&&(n.defaultSampleDuration=r.getUint32(e),e+=4),s&&(n.defaultSampleSize=r.getUint32(e),e+=4),u&&(n.defaultSampleFlags=r.getUint32(e)),l&&(n.durationIsEmpty=!0),!i&&c&&(n.baseDataOffsetIsMoof=!0),n}(Ee(a,["tfhd"])[0]),u=s.trackId,l=Ee(a,["tfdt"]),c=l.length>0?function(t){var e={version:t[0],flags:new Uint8Array(t.subarray(1,4)),baseMediaDecodeTime:Oe(t[4]<<24|t[5]<<16|t[6]<<8|t[7])};return 1===e.version&&(e.baseMediaDecodeTime*=Math.pow(2,32),e.baseMediaDecodeTime+=Oe(t[8]<<24|t[9]<<16|t[10]<<8|t[11])),e}(l[0]).baseMediaDecodeTime:0,f=Ee(a,["trun"]);e===u&&f.length>0&&(r=function(t,e,r){var n=e,i=r.defaultSampleDuration||0,o=r.defaultSampleSize||0,a=r.trackId,s=[];return t.forEach((function(t){var e=function(t){var e,r={version:t[0],flags:new Uint8Array(t.subarray(1,4)),samples:[]},n=new DataView(t.buffer,t.byteOffset,t.byteLength),i=1&r.flags[2],o=4&r.flags[2],a=1&r.flags[1],s=2&r.flags[1],u=4&r.flags[1],l=8&r.flags[1],c=n.getUint32(4),f=8;for(i&&(r.dataOffset=n.getInt32(f),f+=4),o&&c&&(e={flags:ke(t.subarray(f,f+4))},f+=4,a&&(e.duration=n.getUint32(f),f+=4),s&&(e.size=n.getUint32(f),f+=4),l&&(1===r.version?e.compositionTimeOffset=n.getInt32(f):e.compositionTimeOffset=n.getUint32(f),f+=4),r.samples.push(e),c--);c--;)e={},a&&(e.duration=n.getUint32(f),f+=4),s&&(e.size=n.getUint32(f),f+=4),u&&(e.flags=ke(t.subarray(f,f+4)),f+=4),l&&(1===r.version?e.compositionTimeOffset=n.getInt32(f):e.compositionTimeOffset=n.getUint32(f),f+=4),r.samples.push(e);return r}(t).samples;e.forEach((function(t){void 0===t.duration&&(t.duration=i),void 0===t.size&&(t.size=o),t.trackId=a,t.dts=n,void 0===t.compositionTimeOffset&&(t.compositionTimeOffset=0),t.pts=n+t.compositionTimeOffset,n+=t.duration})),s=s.concat(e)})),s}(f,c,s),n=function(t,e,r){var n,i,o,a,s=new DataView(t.buffer,t.byteOffset,t.byteLength),u=[];for(i=0;i+4<t.length;i+=o)if(o=s.getUint32(i),i+=4,!(o<=0))switch(31&t[i]){case 6:var l=t.subarray(i+1,i+1+o),c=xe(i,e);if(n={nalUnitType:"sei_rbsp",size:o,data:l,escapedRBSP:Ce(l),trackId:r},c)n.pts=c.pts,n.dts=c.dts,a=c;else{if(!a){console.log("We've encountered a nal unit without data. See mux.js#233.");break}n.pts=a.pts,n.dts=a.dts}u.push(n)}return u}(o,r,u),i[u]||(i[u]=[]),i[u]=i[u].concat(n))})),i},Le=function(){var t,e,r,n,i,o,a=!1;this.isInitialized=function(){return a},this.init=function(e){t=new Pe,a=!0,o=!!e&&e.isPartial,t.on("data",(function(t){t.startTime=t.startPts/n,t.endTime=t.endPts/n,i.captions.push(t),i.captionStreams[t.stream]=!0}))},this.isNewInit=function(t,e){return!(t&&0===t.length||e&&"object"==typeof e&&0===Object.keys(e).length||r===t[0]&&n===e[r])},this.parse=function(t,o,a){var s;if(!this.isInitialized())return null;if(!o||!a)return null;if(this.isNewInit(o,a))r=o[0],n=a[r];else if(null===r||!n)return e.push(t),null;for(;e.length>0;){var u=e.shift();this.parse(u,o,a)}return s=function(t,e,r){return null===e?null:{seiNals:je(t,e)[e],timescale:r}}(t,r,n),null!==s&&s.seiNals?(this.pushNals(s.seiNals),this.flushStream(),i):null},this.pushNals=function(e){if(!this.isInitialized()||!e||0===e.length)return null;e.forEach((function(e){t.push(e)}))},this.flushStream=function(){if(!this.isInitialized())return null;o?t.partialFlush():t.flush()},this.clearParsedCaptions=function(){i.captions=[],i.captionStreams={}},this.resetCaptionStream=function(){if(!this.isInitialized())return null;t.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){e=[],r=null,n=null,i?this.clearParsedCaptions():i={captions:[],captionStreams:{}},this.resetCaptionStream()},this.reset()},Ie=we,Ae=function(t){return("00"+t.toString(16)).slice(-2)};ve=function(t,e){var r,n,i;return r=Ee(e,["moof","traf"]),n=[].concat.apply([],r.map((function(e){return Ee(e,["tfhd"]).map((function(r){var n,i,o;return n=Ie(r[4]<<24|r[5]<<16|r[6]<<8|r[7]),i=t[n]||9e4,o=Ee(e,["tfdt"]).map((function(t){var e,r;return e=t[0],r=Ie(t[4]<<24|t[5]<<16|t[6]<<8|t[7]),1===e&&(r*=Math.pow(2,32),r+=Ie(t[8]<<24|t[9]<<16|t[10]<<8|t[11])),r}))[0],(o="number"!=typeof o||isNaN(o)?1/0:o)/i}))}))),i=Math.min.apply(null,n),isFinite(i)?i:0},be=function(t){var e=0===t[0]?12:20;return Ie(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])},ge=function(t){var e=Ee(t,["moov","trak"]),r=[];return e.forEach((function(t){var e,n,i={},o=Ee(t,["tkhd"])[0];o&&(n=(e=new DataView(o.buffer,o.byteOffset,o.byteLength)).getUint8(0),i.id=0===n?e.getUint32(12):e.getUint32(20));var a=Ee(t,["mdia","hdlr"])[0];if(a){var s=Te(a.subarray(8,12));i.type="vide"===s?"video":"soun"===s?"audio":s}var u=Ee(t,["mdia","minf","stbl","stsd"])[0];if(u){var l=u.subarray(8);i.codec=Te(l.subarray(4,8));var c,f=Ee(l,[i.codec])[0];f&&(/^[a-z]vc[1-9]$/i.test(i.codec)?(c=f.subarray(78),"avcC"===Te(c.subarray(4,8))&&c.length>11?(i.codec+=".",i.codec+=Ae(c[9]),i.codec+=Ae(c[10]),i.codec+=Ae(c[11])):i.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(i.codec)?(c=f.subarray(28),"esds"===Te(c.subarray(4,8))&&c.length>20&&0!==c[19]?(i.codec+="."+Ae(c[19]),i.codec+="."+Ae(c[20]>>>2&63).replace(/^0/,"")):i.codec="mp4a.40.2"):i.codec=i.codec.toLowerCase())}var h=Ee(t,["mdia","mdhd"])[0];h&&(i.timescale=be(h)),r.push(i)})),r};var Re=ve,De=ge,Me=function(t){var e=31&t[1];return(e<<=8)|t[2]},Ne=function(t){return!!(64&t[1])},Be=function(t){var e=0;return(48&t[3])>>>4>1&&(e+=t[4]+1),e},Ue=function(t){switch(t){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}},Fe={parseType:function(t,e){var r=Me(t);return 0===r?"pat":r===e?"pmt":e?"pes":null},parsePat:function(t){var e=Ne(t),r=4+Be(t);return e&&(r+=t[r]+1),(31&t[r+10])<<8|t[r+11]},parsePmt:function(t){var e={},r=Ne(t),n=4+Be(t);if(r&&(n+=t[n]+1),1&t[n+5]){var i;i=3+((15&t[n+1])<<8|t[n+2])-4;for(var o=12+((15&t[n+10])<<8|t[n+11]);o<i;){var a=n+o;e[(31&t[a+1])<<8|t[a+2]]=t[a],o+=5+((15&t[a+3])<<8|t[a+4])}return e}},parsePayloadUnitStartIndicator:Ne,parsePesType:function(t,e){switch(e[Me(t)]){case kt.H264_STREAM_TYPE:return"video";case kt.ADTS_STREAM_TYPE:return"audio";case kt.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(t){if(!Ne(t))return null;var e=4+Be(t);if(e>=t.byteLength)return null;var r,n=null;return 192&(r=t[e+7])&&((n={}).pts=(14&t[e+9])<<27|(255&t[e+10])<<20|(254&t[e+11])<<12|(255&t[e+12])<<5|(254&t[e+13])>>>3,n.pts*=4,n.pts+=(6&t[e+13])>>>1,n.dts=n.pts,64&r&&(n.dts=(14&t[e+14])<<27|(255&t[e+15])<<20|(254&t[e+16])<<12|(255&t[e+17])<<5|(254&t[e+18])>>>3,n.dts*=4,n.dts+=(6&t[e+18])>>>1)),n},videoPacketContainsKeyFrame:function(t){for(var e=4+Be(t),r=t.subarray(e),n=0,i=0,o=!1;i<r.byteLength-3;i++)if(1===r[i+2]){n=i+5;break}for(;n<r.byteLength;)switch(r[n]){case 0:if(0!==r[n-1]){n+=2;break}if(0!==r[n-2]){n++;break}i+3!==n-2&&"slice_layer_without_partitioning_rbsp_idr"===Ue(31&r[i+3])&&(o=!0);do{n++}while(1!==r[n]&&n<r.length);i=n-2,n+=3;break;case 1:if(0!==r[n-1]||0!==r[n-2]){n+=3;break}"slice_layer_without_partitioning_rbsp_idr"===Ue(31&r[i+3])&&(o=!0),i=n-2,n+=3;break;default:n+=3}return r=r.subarray(i),n-=i,i=0,r&&r.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===Ue(31&r[i+3])&&(o=!0),o}},Ve=It,He={};He.ts=Fe,He.aac=oe;var qe=it,ze=188,We=71,Ge=function(t,e,r){for(var n,i,o,a,s=0,u=ze,l=!1;u<=t.byteLength;)if(t[s]!==We||t[u]!==We&&u!==t.byteLength)s++,u++;else{if(n=t.subarray(s,u),"pes"===He.ts.parseType(n,e.pid)&&(i=He.ts.parsePesType(n,e.table),o=He.ts.parsePayloadUnitStartIndicator(n),"audio"===i&&o&&(a=He.ts.parsePesTime(n))&&(a.type="audio",r.audio.push(a),l=!0)),l)break;s+=ze,u+=ze}for(s=(u=t.byteLength)-ze,l=!1;s>=0;)if(t[s]!==We||t[u]!==We&&u!==t.byteLength)s--,u--;else{if(n=t.subarray(s,u),"pes"===He.ts.parseType(n,e.pid)&&(i=He.ts.parsePesType(n,e.table),o=He.ts.parsePayloadUnitStartIndicator(n),"audio"===i&&o&&(a=He.ts.parsePesTime(n))&&(a.type="audio",r.audio.push(a),l=!0)),l)break;s-=ze,u-=ze}},Xe=function(t,e,r){for(var n,i,o,a,s,u,l,c=0,f=ze,h=!1,p={data:[],size:0};f<t.byteLength;)if(t[c]!==We||t[f]!==We)c++,f++;else{if(n=t.subarray(c,f),"pes"===He.ts.parseType(n,e.pid)&&(i=He.ts.parsePesType(n,e.table),o=He.ts.parsePayloadUnitStartIndicator(n),"video"===i&&(o&&!h&&(a=He.ts.parsePesTime(n))&&(a.type="video",r.video.push(a),h=!0),!r.firstKeyFrame))){if(o&&0!==p.size){for(s=new Uint8Array(p.size),u=0;p.data.length;)l=p.data.shift(),s.set(l,u),u+=l.byteLength;if(He.ts.videoPacketContainsKeyFrame(s)){var d=He.ts.parsePesTime(s);d?(r.firstKeyFrame=d,r.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.")}p.size=0}p.data.push(n),p.size+=n.byteLength}if(h&&r.firstKeyFrame)break;c+=ze,f+=ze}for(c=(f=t.byteLength)-ze,h=!1;c>=0;)if(t[c]!==We||t[f]!==We)c--,f--;else{if(n=t.subarray(c,f),"pes"===He.ts.parseType(n,e.pid)&&(i=He.ts.parsePesType(n,e.table),o=He.ts.parsePayloadUnitStartIndicator(n),"video"===i&&o&&(a=He.ts.parsePesTime(n))&&(a.type="video",r.video.push(a),h=!0)),h)break;c-=ze,f-=ze}},Ke=function(t,e){var r;return r=He.aac.isLikelyAacData(t)?function(t){for(var e,r=!1,n=0,i=null,o=null,a=0,s=0;t.length-s>=3;){switch(He.aac.parseType(t,s)){case"timed-metadata":if(t.length-s<10){r=!0;break}if((a=He.aac.parseId3TagSize(t,s))>t.length){r=!0;break}null===o&&(e=t.subarray(s,s+a),o=He.aac.parseAacTimestamp(e)),s+=a;break;case"audio":if(t.length-s<7){r=!0;break}if((a=He.aac.parseAdtsSize(t,s))>t.length){r=!0;break}null===i&&(e=t.subarray(s,s+a),i=He.aac.parseSampleRate(e)),n++,s+=a;break;default:s++}if(r)return null}if(null===i||null===o)return null;var u=qe/i;return{audio:[{type:"audio",dts:o,pts:o},{type:"audio",dts:o+1024*n*u,pts:o+1024*n*u}]}}(t):function(t){var e={pid:null,table:null},r={};for(var n in function(t,e){for(var r,n=0,i=ze;i<t.byteLength;)if(t[n]!==We||t[i]!==We)n++,i++;else{switch(r=t.subarray(n,i),He.ts.parseType(r,e.pid)){case"pat":e.pid||(e.pid=He.ts.parsePat(r));break;case"pmt":e.table||(e.table=He.ts.parsePmt(r))}if(e.pid&&e.table)return;n+=ze,i+=ze}}(t,e),e.table)if(e.table.hasOwnProperty(n))switch(e.table[n]){case kt.H264_STREAM_TYPE:r.video=[],Xe(t,e,r),0===r.video.length&&delete r.video;break;case kt.ADTS_STREAM_TYPE:r.audio=[],Ge(t,e,r),0===r.audio.length&&delete r.audio}return r}(t),r&&(r.audio||r.video)?(function(t,e){if(t.audio&&t.audio.length){var r=e;(void 0===r||isNaN(r))&&(r=t.audio[0].dts),t.audio.forEach((function(t){t.dts=Ve(t.dts,r),t.pts=Ve(t.pts,r),t.dtsTime=t.dts/qe,t.ptsTime=t.pts/qe}))}if(t.video&&t.video.length){var n=e;if((void 0===n||isNaN(n))&&(n=t.video[0].dts),t.video.forEach((function(t){t.dts=Ve(t.dts,n),t.pts=Ve(t.pts,n),t.dtsTime=t.dts/qe,t.ptsTime=t.pts/qe})),t.firstKeyFrame){var i=t.firstKeyFrame;i.dts=Ve(i.dts,n),i.pts=Ve(i.pts,n),i.dtsTime=i.dts/qe,i.ptsTime=i.pts/qe}}}(r,e),r):null},Ye=function(){function t(t,e){this.options=e||{},this.self=t,this.init()}var e=t.prototype;return e.init=function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new _e.Transmuxer(this.options),function(t,e){e.on("data",(function(e){var r=e.initSegment;e.initSegment={data:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength};var n=e.data;e.data=n.buffer,t.postMessage({action:"data",segment:e,byteOffset:n.byteOffset,byteLength:n.byteLength},[e.data])})),e.on("done",(function(e){t.postMessage({action:"done"})})),e.on("gopInfo",(function(e){t.postMessage({action:"gopInfo",gopInfo:e})})),e.on("videoSegmentTimingInfo",(function(e){var r={start:{decode:at(e.start.dts),presentation:at(e.start.pts)},end:{decode:at(e.end.dts),presentation:at(e.end.pts)},baseMediaDecodeTime:at(e.baseMediaDecodeTime)};e.prependedContentDuration&&(r.prependedContentDuration=at(e.prependedContentDuration)),t.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:r})})),e.on("audioSegmentTimingInfo",(function(e){var r={start:{decode:at(e.start.dts),presentation:at(e.start.pts)},end:{decode:at(e.end.dts),presentation:at(e.end.pts)},baseMediaDecodeTime:at(e.baseMediaDecodeTime)};e.prependedContentDuration&&(r.prependedContentDuration=at(e.prependedContentDuration)),t.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:r})})),e.on("id3Frame",(function(e){t.postMessage({action:"id3Frame",id3Frame:e})})),e.on("caption",(function(e){t.postMessage({action:"caption",caption:e})})),e.on("trackinfo",(function(e){t.postMessage({action:"trackinfo",trackInfo:e})})),e.on("audioTimingInfo",(function(e){t.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:at(e.start),end:at(e.end)}})})),e.on("videoTimingInfo",(function(e){t.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:at(e.start),end:at(e.end)}})}))}(this.self,this.transmuxer)},e.pushMp4Captions=function(t){this.captionParser||(this.captionParser=new Le,this.captionParser.init());var e=new Uint8Array(t.data,t.byteOffset,t.byteLength),r=this.captionParser.parse(e,t.trackIds,t.timescales);this.self.postMessage({action:"mp4Captions",captions:r&&r.captions||[],data:e.buffer},[e.buffer])},e.probeMp4StartTime=function(t){var e=t.timescales,r=t.data,n=Re(e,r);this.self.postMessage({action:"probeMp4StartTime",startTime:n,data:r},[r.buffer])},e.probeMp4Tracks=function(t){var e=t.data,r=De(e);this.self.postMessage({action:"probeMp4Tracks",tracks:r,data:e},[e.buffer])},e.probeTs=function(t){var e=t.data,r=t.baseStartTime,n="number"!=typeof r||isNaN(r)?void 0:r*it,i=Ke(e,n),o=null;i&&((o={hasVideo:i.video&&2===i.video.length||!1,hasAudio:i.audio&&2===i.audio.length||!1}).hasVideo&&(o.videoStart=i.video[0].ptsTime),o.hasAudio&&(o.audioStart=i.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:o,data:e},[e.buffer])},e.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},e.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},e.push=function(t){var e=new Uint8Array(t.data,t.byteOffset,t.byteLength);this.transmuxer.push(e)},e.reset=function(){this.transmuxer.reset()},e.setTimestampOffset=function(t){var e=t.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(ot(e)))},e.setAudioAppendStart=function(t){this.transmuxer.setAudioAppendStart(Math.ceil(ot(t.appendStart)))},e.setRemux=function(t){this.transmuxer.setRemux(t.remux)},e.flush=function(t){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},e.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},e.alignGopsWith=function(t){this.transmuxer.alignGopsWith(t.gopsToAlignWith.slice())},t}();self.onmessage=function(t){"init"===t.data.action&&t.data.options?this.messageHandlers=new Ye(self,t.data.options):(this.messageHandlers||(this.messageHandlers=new Ye(self)),t.data&&t.data.action&&"init"!==t.data.action&&this.messageHandlers[t.data.action]&&this.messageHandlers[t.data.action](t.data))}}))),Ns=As(Ms),Bs=function(t){var e=t.transmuxer,r=t.bytes,n=t.audioAppendStart,i=t.gopsToAlignWith,o=t.remux,a=t.onData,s=t.onTrackInfo,u=t.onAudioTimingInfo,l=t.onVideoTimingInfo,c=t.onVideoSegmentTimingInfo,f=t.onAudioSegmentTimingInfo,h=t.onId3,p=t.onCaptions,d=t.onDone,y=t.onEndedTimeline,m=t.isEndOfTimeline,v={buffer:[]},g=m;if(e.onmessage=function(r){e.currentTransmux===t&&("data"===r.data.action&&function(t,e,r){var n=t.data.segment,i=n.type,o=n.initSegment,a=n.captions,s=n.captionStreams,u=n.metadata,l=n.videoFrameDtsTime,c=n.videoFramePtsTime;e.buffer.push({captions:a,captionStreams:s,metadata:u});var f=t.data.segment.boxes||{data:t.data.segment.data},h={type:i,data:new Uint8Array(f.data,f.data.byteOffset,f.data.byteLength),initSegment:new Uint8Array(o.data,o.byteOffset,o.byteLength)};void 0!==l&&(h.videoFrameDtsTime=l),void 0!==c&&(h.videoFramePtsTime=c),r(h)}(r,v,a),"trackinfo"===r.data.action&&s(r.data.trackInfo),"gopInfo"===r.data.action&&function(t,e){e.gopInfo=t.data.gopInfo}(r,v),"audioTimingInfo"===r.data.action&&u(r.data.audioTimingInfo),"videoTimingInfo"===r.data.action&&l(r.data.videoTimingInfo),"videoSegmentTimingInfo"===r.data.action&&c(r.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===r.data.action&&f(r.data.audioSegmentTimingInfo),"id3Frame"===r.data.action&&h([r.data.id3Frame],r.data.id3Frame.dispatchType),"caption"===r.data.action&&p(r.data.caption),"endedtimeline"===r.data.action&&(g=!1,y()),"transmuxed"===r.data.type&&(g||(e.onmessage=null,function(t){var e=t.transmuxedData,r=t.callback;e.buffer=[],r(e)}({transmuxedData:v,callback:d}),Us(e))))},n&&e.postMessage({action:"setAudioAppendStart",appendStart:n}),Array.isArray(i)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:i}),void 0!==o&&e.postMessage({action:"setRemux",remux:o}),r.byteLength){var b=r instanceof ArrayBuffer?r:r.buffer,_=r instanceof ArrayBuffer?0:r.byteOffset;e.postMessage({action:"push",data:b,byteOffset:_,byteLength:r.byteLength},[b])}m&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},Us=function(t){t.currentTransmux=null,t.transmuxQueue.length&&(t.currentTransmux=t.transmuxQueue.shift(),"function"==typeof t.currentTransmux?t.currentTransmux():Bs(t.currentTransmux))},Fs=function(t,e){t.postMessage({action:e}),Us(t)},Vs=function(t){!function(t,e){if(!e.currentTransmux)return e.currentTransmux=t,void Fs(e,t);e.transmuxQueue.push(Fs.bind(null,e,t))}("reset",t)},Hs=function(t){var e=t.transmuxer,r=t.endAction||t.action,n=t.callback,i=a({},t,{endAction:null,transmuxer:null,callback:null});if(e.addEventListener("message",(function i(o){o.data.action===r&&(e.removeEventListener("message",i),o.data.data&&(o.data.data=new Uint8Array(o.data.data,t.byteOffset||0,t.byteLength||o.data.data.byteLength),t.data&&(t.data=o.data.data)),n(o.data))})),t.data){var o=t.data instanceof ArrayBuffer;i.byteOffset=o?0:t.data.byteOffset,i.byteLength=t.data.byteLength;var s=[o?t.data:t.data.buffer];e.postMessage(i,s)}else e.postMessage(i)},qs=-101,zs=-102,Ws=function(t){t.forEach((function(t){t.abort()}))},Gs=function(t,e){return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:qs,xhr:e}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:zs,xhr:e}:t?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:2,xhr:e}:null},Xs=function(t){var e=t.segment,r=t.bytes,n=t.trackInfoFn,i=t.timingInfoFn,o=t.videoSegmentTimingInfoFn,a=t.audioSegmentTimingInfoFn,s=t.id3Fn,u=t.captionsFn,l=t.isEndOfTimeline,c=t.endedTimelineFn,f=t.dataFn,h=t.doneFn,p=e.map&&e.map.tracks||{},d=Boolean(p.audio&&p.video),y=i.bind(null,e,"audio","start"),m=i.bind(null,e,"audio","end"),v=i.bind(null,e,"video","start"),g=i.bind(null,e,"video","end");Hs({action:"probeTs",transmuxer:e.transmuxer,data:r,baseStartTime:e.baseStartTime,callback:function(t){e.bytes=r=t.data;var i=t.result;i&&(n(e,{hasAudio:i.hasAudio,hasVideo:i.hasVideo,isMuxed:d}),n=null,i.hasAudio&&!d&&y(i.audioStart),i.hasVideo&&v(i.videoStart),y=null,v=null),function(t){if(!t.transmuxer.currentTransmux)return t.transmuxer.currentTransmux=t,void Bs(t);t.transmuxer.transmuxQueue.push(t)}({bytes:r,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,remux:d,onData:function(t){t.type="combined"===t.type?"video":t.type,f(e,t)},onTrackInfo:function(t){n&&(d&&(t.isMuxed=!0),n(e,t))},onAudioTimingInfo:function(t){y&&void 0!==t.start&&(y(t.start),y=null),m&&void 0!==t.end&&m(t.end)},onVideoTimingInfo:function(t){v&&void 0!==t.start&&(v(t.start),v=null),g&&void 0!==t.end&&g(t.end)},onVideoSegmentTimingInfo:function(t){o(t)},onAudioSegmentTimingInfo:function(t){a(t)},onId3:function(t,r){s(e,t,r)},onCaptions:function(t){u(e,[t])},isEndOfTimeline:l,onEndedTimeline:function(){c()},onDone:function(t){h&&(t.type="combined"===t.type?"video":t.type,h(null,e,t))}})}})},Ks=function(t){var e=t.segment,r=t.bytes,n=t.trackInfoFn,i=t.timingInfoFn,o=t.videoSegmentTimingInfoFn,a=t.audioSegmentTimingInfoFn,s=t.id3Fn,u=t.captionsFn,l=t.isEndOfTimeline,c=t.endedTimelineFn,f=t.dataFn,h=t.doneFn,p=new Uint8Array(r);if(function(t){return Vt(t,["moof"]).length>0}(p)){e.isFmp4=!0;var d=e.map.tracks,y={isFmp4:!0,hasVideo:!!d.video,hasAudio:!!d.audio};d.audio&&d.audio.codec&&"enca"!==d.audio.codec&&(y.audioCodec=d.audio.codec),d.video&&d.video.codec&&"encv"!==d.video.codec&&(y.videoCodec=d.video.codec),d.video&&d.audio&&(y.isMuxed=!0),n(e,y);var m=function(t){f(e,{data:p,type:y.hasAudio&&!y.isMuxed?"audio":"video"}),t&&t.length&&u(e,t),h(null,e,{})};Hs({action:"probeMp4StartTime",timescales:e.map.timescales,data:p,transmuxer:e.transmuxer,callback:function(t){var n=t.data,o=t.startTime;r=n.buffer,e.bytes=p=n,y.hasAudio&&!y.isMuxed&&i(e,"audio","start",o),y.hasVideo&&i(e,"video","start",o),d.video&&n.byteLength&&e.transmuxer?Hs({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:e.transmuxer,data:p,timescales:e.map.timescales,trackIds:[d.video.id],callback:function(t){r=t.data.buffer,e.bytes=p=t.data,m(t.captions)}}):m()}})}else if(e.transmuxer){if(void 0===e.container&&(e.container=ie(p)),"ts"!==e.container&&"aac"!==e.container)return n(e,{hasAudio:!1,hasVideo:!1}),void h(null,e,{});Xs({segment:e,bytes:r,trackInfoFn:n,timingInfoFn:i,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:a,id3Fn:s,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:f,doneFn:h})}else h(null,e,{})},Ys=function(t){var e=t.xhr,r=t.xhrOptions,n=t.decryptionWorker,i=t.segment,o=t.abortFn,a=t.progressFn,s=t.trackInfoFn,u=t.timingInfoFn,l=t.videoSegmentTimingInfoFn,c=t.audioSegmentTimingInfoFn,f=t.id3Fn,h=t.captionsFn,p=t.isEndOfTimeline,d=t.endedTimelineFn,y=t.dataFn,m=t.doneFn,v=[],g=function(t){var e=t.activeXhrs,r=t.decryptionWorker,n=t.trackInfoFn,i=t.timingInfoFn,o=t.videoSegmentTimingInfoFn,a=t.audioSegmentTimingInfoFn,s=t.id3Fn,u=t.captionsFn,l=t.isEndOfTimeline,c=t.endedTimelineFn,f=t.dataFn,h=t.doneFn,p=0,d=!1;return function(t,y){if(!d){if(t)return d=!0,Ws(e),h(t,y);if((p+=1)===e.length){if(y.endOfAllRequests=Date.now(),y.encryptedBytes)return function(t){var e,r=t.decryptionWorker,n=t.segment,i=t.trackInfoFn,o=t.timingInfoFn,a=t.videoSegmentTimingInfoFn,s=t.audioSegmentTimingInfoFn,u=t.id3Fn,l=t.captionsFn,c=t.isEndOfTimeline,f=t.endedTimelineFn,h=t.dataFn,p=t.doneFn;r.addEventListener("message",(function t(e){if(e.data.source===n.requestId){r.removeEventListener("message",t);var d=e.data.decrypted;n.bytes=new Uint8Array(d.bytes,d.byteOffset,d.byteLength),Ks({segment:n,bytes:n.bytes,trackInfoFn:i,timingInfoFn:o,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:u,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:f,dataFn:h,doneFn:p})}})),e=n.key.bytes.slice?n.key.bytes.slice():new Uint32Array(Array.prototype.slice.call(n.key.bytes)),r.postMessage(gs({source:n.requestId,encrypted:n.encryptedBytes,key:e,iv:n.key.iv}),[n.encryptedBytes.buffer,e.buffer])}({decryptionWorker:r,segment:y,trackInfoFn:n,timingInfoFn:i,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:a,id3Fn:s,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:f,doneFn:h});Ks({segment:y,bytes:y.bytes,trackInfoFn:n,timingInfoFn:i,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:a,id3Fn:s,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:f,doneFn:h})}}}}({activeXhrs:v,decryptionWorker:n,trackInfoFn:s,timingInfoFn:u,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:f,captionsFn:h,isEndOfTimeline:p,endedTimelineFn:d,dataFn:y,doneFn:m});if(i.key&&!i.key.bytes){var b=_a.mergeOptions(r,{uri:i.key.resolvedUri,responseType:"arraybuffer"}),_=function(t,e){return function(r,n){var i=n.response,o=Gs(r,n);if(o)return e(o,t);if(16!==i.byteLength)return e({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:2,xhr:n},t);var a=new DataView(i);return t.key.bytes=new Uint32Array([a.getUint32(0),a.getUint32(4),a.getUint32(8),a.getUint32(12)]),e(null,t)}}(i,g),w=e(b,_);v.push(w)}if(i.map&&!i.map.bytes){var T=_a.mergeOptions(r,{uri:i.map.resolvedUri,responseType:"arraybuffer",headers:ds(i.map)}),S=function(t){var e=t.segment,r=t.finishProcessingFn;return function(t,n){var i=n.response,o=Gs(t,n);if(o)return r(o,e);if(0===i.byteLength)return r({status:n.status,message:"Empty HLS segment content at URL: "+n.uri,code:2,xhr:n},e);e.map.bytes=new Uint8Array(n.response);var a=ie(e.map.bytes);if("mp4"!==a)return r({status:n.status,message:"Found unsupported "+(a||"unknown")+" container for initialization segment at URL: "+n.uri,code:2,internal:!0,xhr:n},e);Hs({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:function(t){var n=t.tracks,i=t.data;return e.map.bytes=i,n.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))})),r(null,e)}})}}({segment:i,finishProcessingFn:g}),E=e(T,S);v.push(E)}var O=_a.mergeOptions(r,{uri:i.part&&i.part.resolvedUri||i.resolvedUri,responseType:"arraybuffer",headers:ds(i)}),k=e(O,function(t){var e=t.segment,r=t.finishProcessingFn,n=t.responseType;return function(t,i){var o=i.response,a=Gs(t,i);if(a)return r(a,e);var s="arraybuffer"!==n&&i.responseText?function(t){for(var e=new Uint8Array(new ArrayBuffer(t.length)),r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e.buffer}(i.responseText.substring(e.lastReachedChar||0)):i.response;return 0===o.byteLength?r({status:i.status,message:"Empty HLS segment content at URL: "+i.uri,code:2,xhr:i},e):(e.stats=function(t){return{bandwidth:t.bandwidth,bytesReceived:t.bytesReceived||0,roundTripTime:t.roundTripTime||0}}(i),e.key?e.encryptedBytes=new Uint8Array(s):e.bytes=new Uint8Array(s),r(null,e))}}({segment:i,finishProcessingFn:g,responseType:O.responseType}));k.addEventListener("progress",function(t){var e=t.segment,r=t.progressFn;return t.trackInfoFn,t.timingInfoFn,t.videoSegmentTimingInfoFn,t.audioSegmentTimingInfoFn,t.id3Fn,t.captionsFn,t.isEndOfTimeline,t.endedTimelineFn,t.dataFn,function(t){if(!t.target.aborted)return e.stats=_a.mergeOptions(e.stats,(i=(n=t).target,(o={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-i.requestTime||0}).bytesReceived=n.loaded,o.bandwidth=Math.floor(o.bytesReceived/o.roundTripTime*8*1e3),o)),!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived&&(e.stats.firstBytesReceivedAt=Date.now()),r(t,e);var n,i,o}}({segment:i,progressFn:a,trackInfoFn:s,timingInfoFn:u,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:f,captionsFn:h,isEndOfTimeline:p,endedTimelineFn:d,dataFn:y})),v.push(k);var C={};return v.forEach((function(t){t.addEventListener("loadend",function(t){var e=t.loadendState,r=t.abortFn;return function(t){t.target.aborted&&r&&!e.calledAbortFn&&(r(),e.calledAbortFn=!0)}}({loadendState:C,abortFn:o}))})),function(){return Ws(v)}},Qs=Oa("CodecUtils"),$s=function(t,e){var r=e.attributes||{};return t&&t.mediaGroups&&t.mediaGroups.AUDIO&&r.AUDIO&&t.mediaGroups.AUDIO[r.AUDIO]},Js=function(t){var e={};return t.forEach((function(t){var r=t.mediaType,n=t.type,i=t.details;e[r]=e[r]||[],e[r].push(M(""+n+i))})),Object.keys(e).forEach((function(t){if(e[t].length>1)return Qs("multiple "+t+" codecs found as attributes: "+e[t].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),void(e[t]=null);e[t]=e[t][0]})),e},Zs=function(t){var e=0;return t.audio&&e++,t.video&&e++,e},tu=function(t,e){var r=e.attributes||{},n=Js(function(t){var e=t.attributes||{};if(e.CODECS)return N(e.CODECS)}(e)||[]);if($s(t,e)&&!n.audio&&!function(t,e){if(!$s(t,e))return!0;var r=e.attributes||{},n=t.mediaGroups.AUDIO[r.AUDIO];for(var i in n)if(!n[i].uri&&!n[i].playlists)return!0;return!1}(t,e)){var i=Js(function(t,e){if(!t.mediaGroups.AUDIO||!e)return null;var r=t.mediaGroups.AUDIO[e];if(!r)return null;for(var n in r){var i=r[n];if(i.default&&i.playlists)return N(i.playlists[0].attributes.CODECS)}return null}(t,r.AUDIO)||[]);i.audio&&(n.audio=i.audio)}return n},eu=Oa("PlaylistSelector"),ru=function(t){if(t&&t.playlist){var e=t.playlist;return JSON.stringify({id:e.id,bandwidth:t.bandwidth,width:t.width,height:t.height,codecs:e.attributes&&e.attributes.CODECS||""})}},nu=function(t,r){if(!t)return"";var n=e().getComputedStyle(t);return n?n[r]:""},iu=function(t,e){var r=t.slice();t.sort((function(t,n){var i=e(t,n);return 0===i?r.indexOf(t)-r.indexOf(n):i}))},ou=function(t,r){var n,i;return t.attributes.BANDWIDTH&&(n=t.attributes.BANDWIDTH),n=n||e().Number.MAX_VALUE,r.attributes.BANDWIDTH&&(i=r.attributes.BANDWIDTH),n-(i||e().Number.MAX_VALUE)},au=function(t,r,n,i,o,a){if(t){var s={bandwidth:r,width:n,height:i,limitRenditionByPlayerDimensions:o},u=t.playlists;ls.isAudioOnly(t)&&(u=a.getAudioTrackPlaylists_(),s.audioOnly=!0);var l=u.map((function(t){var r=t.attributes&&t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width,n=t.attributes&&t.attributes.RESOLUTION&&t.attributes.RESOLUTION.height;return{bandwidth:t.attributes&&t.attributes.BANDWIDTH||e().Number.MAX_VALUE,width:r,height:n,playlist:t}}));iu(l,(function(t,e){return t.bandwidth-e.bandwidth}));var c=(l=l.filter((function(t){return!ls.isIncompatible(t.playlist)}))).filter((function(t){return ls.isEnabled(t.playlist)}));c.length||(c=l.filter((function(t){return!ls.isDisabled(t.playlist)})));var f=c.filter((function(t){return t.bandwidth*Ls.BANDWIDTH_VARIANCE<r})),h=f[f.length-1],p=f.filter((function(t){return t.bandwidth===h.bandwidth}))[0];if(!1===o){var d=p||c[0]||l[0];if(d&&d.playlist){var y="sortedPlaylistReps";return p&&(y="bandwidthBestRep"),c[0]&&(y="enabledPlaylistReps"),eu("choosing "+ru(d)+" using "+y+" with options",s),d.playlist}return eu("could not choose a playlist with options",s),null}var m=f.filter((function(t){return t.width&&t.height}));iu(m,(function(t,e){return t.width-e.width}));var v=m.filter((function(t){return t.width===n&&t.height===i}));h=v[v.length-1];var g,b,_,w=v.filter((function(t){return t.bandwidth===h.bandwidth}))[0];w||(b=(g=m.filter((function(t){return t.width>n||t.height>i}))).filter((function(t){return t.width===g[0].width&&t.height===g[0].height})),h=b[b.length-1],_=b.filter((function(t){return t.bandwidth===h.bandwidth}))[0]);var T=_||w||p||c[0]||l[0];if(T&&T.playlist){var S="sortedPlaylistReps";return _?S="resolutionPlusOneRep":w?S="resolutionBestRep":p?S="bandwidthBestRep":c[0]&&(S="enabledPlaylistReps"),eu("choosing "+ru(T)+" using "+S+" with options",s),T.playlist}return eu("could not choose a playlist with options",s),null}},su=function(){var t=this.useDevicePixelRatio&&e().devicePixelRatio||1;return au(this.playlists.master,this.systemBandwidth,parseInt(nu(this.tech_.el(),"width"),10)*t,parseInt(nu(this.tech_.el(),"height"),10)*t,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},uu=function(t,e,r){var n,i;if(r&&r.cues)for(n=r.cues.length;n--;)(i=r.cues[n]).startTime>=t&&i.endTime<=e&&r.removeCue(i)},lu=function(t){return"number"==typeof t&&isFinite(t)},cu=1/60,fu=function(t){var e=t.startOfSegment,r=t.duration,n=t.segment,i=n.start,o=n.end,a=n.parts,s=t.playlist,u=s.mediaSequence,l=s.id,c=s.segments,f=void 0===c?[]:c,h=t.mediaIndex,p=t.partIndex,d=t.timeline,y=f.length-1,m="mediaIndex/partIndex increment";return t.getMediaInfoForTime?m="getMediaInfoForTime ("+t.getMediaInfoForTime+")":t.isSyncRequest&&(m="getSyncSegmentCandidate (isSyncRequest)"),(t.segment.uri?"segment":"pre-segment")+" ["+h+"/"+y+"]"+(p?" part ["+p+"/"+(a.length-1)+"]":"")+" mediaSequenceNumber ["+u+"/"+(u+y)+"] start/end ["+i+" => "+o+"] startOfSegment ["+e+"] duration ["+r+"] timeline ["+d+"] selected by ["+m+"] playlist ["+l+"]"},hu=function(t){return t+"TimingInfo"},pu=function(t){var e=t.timelineChangeController,r=t.currentTimeline,n=t.segmentTimeline,i=t.loaderType,o=t.audioDisabled;if(r===n)return!1;if("audio"===i){var a=e.lastTimelineChange({type:"main"});return!a||a.to!==n}if("main"===i&&o){var s=e.pendingTimelineChange({type:"audio"});return!s||s.to!==n}return!1},du=function(t){var e=t.segmentDuration,r=t.maxDuration;return!!e&&Math.round(e)>r+Va},yu=function(t){function r(e,r){var n;if(n=t.call(this)||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");return n.bandwidth=e.bandwidth,n.throughput={rate:0,count:0},n.roundTrip=NaN,n.resetStats_(),n.mediaIndex=null,n.partIndex=null,n.hasPlayed_=e.hasPlayed,n.currentTime_=e.currentTime,n.seekable_=e.seekable,n.seeking_=e.seeking,n.duration_=e.duration,n.mediaSource_=e.mediaSource,n.vhs_=e.vhs,n.loaderType_=e.loaderType,n.currentMediaInfo_=void 0,n.startingMediaInfo_=void 0,n.segmentMetadataTrack_=e.segmentMetadataTrack,n.goalBufferLength_=e.goalBufferLength,n.sourceType_=e.sourceType,n.sourceUpdater_=e.sourceUpdater,n.inbandTextTracks_=e.inbandTextTracks,n.state_="INIT",n.timelineChangeController_=e.timelineChangeController,n.shouldSaveSegmentTimingInfo_=!0,n.parse708captions_=e.parse708captions,n.checkBufferTimeout_=null,n.error_=void 0,n.currentTimeline_=-1,n.pendingSegment_=null,n.xhrOptions_=null,n.pendingSegments_=[],n.audioDisabled_=!1,n.isPendingTimestampOffset_=!1,n.gopBuffer_=[],n.timeMapping_=0,n.safeAppend_=_a.browser.IE_VERSION>=11,n.appendInitSegment_={audio:!0,video:!0},n.playlistOfLastInitSegment_={audio:null,video:null},n.callQueue_=[],n.loadQueue_=[],n.metadataQueue_={id3:[],caption:[]},n.waitingOnRemove_=!1,n.quotaExceededErrorRetryTimeout_=null,n.activeInitSegmentId_=null,n.initSegments_={},n.cacheEncryptionKeys_=e.cacheEncryptionKeys,n.keyCache_={},n.decrypter_=e.decrypter,n.syncController_=e.syncController,n.syncPoint_={segmentIndex:0,time:0},n.transmuxer_=n.createTransmuxer_(),n.triggerSyncInfoUpdate_=function(){return n.trigger("syncinfoupdate")},n.syncController_.on("syncinfoupdate",n.triggerSyncInfoUpdate_),n.mediaSource_.addEventListener("sourceopen",(function(){n.isEndOfStream_()||(n.ended_=!1)})),n.fetchAtBuffer_=!1,n.logger_=Oa("SegmentLoader["+n.loaderType_+"]"),Object.defineProperty(s(n),"state",{get:function(){return this.state_},set:function(t){t!==this.state_&&(this.logger_(this.state_+" -> "+t),this.state_=t,this.trigger("statechange"))}}),n.sourceUpdater_.on("ready",(function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_()})),"main"===n.loaderType_&&n.timelineChangeController_.on("pendingtimelinechange",(function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_()})),"audio"===n.loaderType_&&n.timelineChangeController_.on("timelinechange",(function(){n.hasEnoughInfoToLoad_()&&n.processLoadQueue_(),n.hasEnoughInfoToAppend_()&&n.processCallQueue_()})),n}l(r,t);var n=r.prototype;return n.createTransmuxer_=function(){return function(t){var e=new Ns;e.currentTransmux=null,e.transmuxQueue=[];var r=e.terminate;return e.terminate=function(){return e.currentTransmux=null,e.transmuxQueue.length=0,r.call(e)},e.postMessage({action:"init",options:t}),e}({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_})},n.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0},n.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&e().clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},n.setAudio=function(t){this.audioDisabled_=!t,t?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},n.abort=function(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)},n.abort_=function(){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,e().clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},n.checkForAbort_=function(t){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==t:(this.state="READY",!0)},n.error=function(t){return void 0!==t&&(this.logger_("error occurred:",t),this.error_=t),this.pendingSegment_=null,this.error_},n.endOfStream=function(){this.ended_=!0,this.transmuxer_&&Vs(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},n.buffered_=function(){if(!this.sourceUpdater_||!this.startingMediaInfo_)return _a.createTimeRanges();if("main"===this.loaderType_){var t=this.startingMediaInfo_,e=t.hasAudio,r=t.hasVideo,n=t.isMuxed;if(r&&e&&!this.audioDisabled_&&!n)return this.sourceUpdater_.buffered();if(r)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},n.initSegmentForMap=function(t,e){if(void 0===e&&(e=!1),!t)return null;var r=bs(t),n=this.initSegments_[r];return e&&!n&&t.bytes&&(this.initSegments_[r]=n={resolvedUri:t.resolvedUri,byterange:t.byterange,bytes:t.bytes,tracks:t.tracks,timescales:t.timescales}),n||t},n.segmentKey=function(t,e){if(void 0===e&&(e=!1),!t)return null;var r=_s(t),n=this.keyCache_[r];this.cacheEncryptionKeys_&&e&&!n&&t.bytes&&(this.keyCache_[r]=n={resolvedUri:t.resolvedUri,bytes:t.bytes});var i={resolvedUri:(n||t).resolvedUri};return n&&(i.bytes=n.bytes),i},n.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},n.load=function(){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"))},n.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},n.playlist=function(t,e){if(void 0===e&&(e={}),t){var r=this.playlist_,n=this.pendingSegment_;this.playlist_=t,this.xhrOptions_=e,"INIT"===this.state&&(t.syncInfo={mediaSequence:t.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(t));var i=null;if(r&&(r.id?i=r.id:r.uri&&(i=r.uri)),this.logger_("playlist update ["+i+" => "+(t.id||t.uri)+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!r||r.uri!==t.uri)return null!==this.mediaIndex&&this.resyncLoader(),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");var o=t.mediaSequence-r.mediaSequence;if(this.logger_("live window shift ["+o+"]"),null!==this.mediaIndex)if(this.mediaIndex-=o,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var a=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!a.parts||!a.parts.length||!a.parts[this.partIndex])){var s=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=s}}n&&(n.mediaIndex-=o,n.mediaIndex<0?(n.mediaIndex=null,n.partIndex=null):(n.mediaIndex>=0&&(n.segment=t.segments[n.mediaIndex]),n.partIndex>=0&&n.segment.parts&&(n.part=n.segment.parts[n.partIndex]))),this.syncController_.saveExpiredSegmentInfo(r,t)}},n.pause=function(){this.checkBufferTimeout_&&(e().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},n.paused=function(){return null===this.checkBufferTimeout_},n.resetEverything=function(t){this.ended_=!1,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,t),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"})},n.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},n.resyncLoader=function(){this.transmuxer_&&Vs(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},n.remove=function(t,e,r,n){if(void 0===r&&(r=function(){}),void 0===n&&(n=!1),e===1/0&&(e=this.duration_()),e<=t)this.logger_("skipping remove because end ${end} is <= start ${start}");else if(this.sourceUpdater_&&this.startingMediaInfo_){var i=1,o=function(){0==--i&&r()};for(var a in!n&&this.audioDisabled_||(i++,this.sourceUpdater_.removeAudio(t,e,o)),(n||"main"===this.loaderType_)&&(this.gopBuffer_=function(t,e,r,n){for(var i=Math.ceil((e-n)*oe.ONE_SECOND_IN_TS),o=Math.ceil((r-n)*oe.ONE_SECOND_IN_TS),a=t.slice(),s=t.length;s--&&!(t[s].pts<=o););if(-1===s)return a;for(var u=s+1;u--&&!(t[u].pts<=i););return u=Math.max(u,0),a.splice(u,s-u+1),a}(this.gopBuffer_,t,e,this.timeMapping_),i++,this.sourceUpdater_.removeVideo(t,e,o)),this.inbandTextTracks_)uu(t,e,this.inbandTextTracks_[a]);uu(t,e,this.segmentMetadataTrack_),o()}else this.logger_("skipping remove because no source updater or starting media info")},n.monitorBuffer_=function(){this.checkBufferTimeout_&&e().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=e().setTimeout(this.monitorBufferTick_.bind(this),1)},n.monitorBufferTick_=function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&e().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=e().setTimeout(this.monitorBufferTick_.bind(this),500)},n.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var t=this.chooseNextRequest_();t&&("number"==typeof t.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:t.timeline})),this.loadSegment_(t))}},n.isEndOfStream_=function(t,e,r){if(void 0===t&&(t=this.mediaIndex),void 0===e&&(e=this.playlist_),void 0===r&&(r=this.partIndex),!e||!this.mediaSource_)return!1;var n="number"==typeof t&&e.segments[t],i=t+1===e.segments.length,o=!n||!n.parts||r+1===n.parts.length;return e.endList&&"open"===this.mediaSource_.readyState&&i&&o},n.chooseNextRequest_=function(){var t=Ka(this.buffered_())||0,e=Math.max(0,t-this.currentTime_()),r=!this.hasPlayed_()&&e>=1,n=e>=this.goalBufferLength_(),i=this.playlist_.segments;if(!i.length||r||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var o={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(o.isSyncRequest)o.mediaIndex=function(t,e){var r=(void 0===e?{}:e).segments,n=void 0===r?[]:r;if(-1===t)return 0;var i=n.reduce((function(e,r,n){return r.timeline===t&&e.push(n),e}),[]);return i.length?i[Math.min(i.length-1,1)]:Math.max(n.length-1,0)}(this.currentTimeline_,this.playlist_);else if(null!==this.mediaIndex){var a=i[this.mediaIndex],s="number"==typeof this.partIndex?this.partIndex:-1;o.startOfSegment=a.end?a.end:t,a.parts&&a.parts[s+1]?(o.mediaIndex=this.mediaIndex,o.partIndex=s+1):o.mediaIndex=this.mediaIndex+1}else{var u=ls.getMediaInfoForTime(this.playlist_,this.fetchAtBuffer_?t:this.currentTime_(),this.syncPoint_.segmentIndex,this.syncPoint_.time);o.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd":"currentTime",o.mediaIndex=u.mediaIndex,o.startOfSegment=u.startTime,o.partIndex=u.partIndex}var l=i[o.mediaIndex],c=l&&"number"==typeof o.partIndex&&l.parts&&l.parts[o.partIndex];if(!l||"number"==typeof o.partIndex&&!c)return null;"number"!=typeof o.partIndex&&l.parts&&(o.partIndex=0);var f=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return o.mediaIndex>=i.length-1&&f&&!this.seeking_()?null:this.generateSegmentInfo_(o)},n.generateSegmentInfo_=function(t){var e=t.playlist,r=t.mediaIndex,n=t.startOfSegment,i=t.isSyncRequest,o=t.partIndex,a=t.forceTimestampOffset,s=t.getMediaInfoForTime,u=e.segments[r],l="number"==typeof o&&u.parts[o],c={requestId:"segment-loader-"+Math.random(),uri:l&&l.resolvedUri||u.resolvedUri,mediaIndex:r,partIndex:l?o:null,isSyncRequest:i,startOfSegment:n,playlist:e,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:u.timeline,duration:u.duration,segment:u,part:l,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:s},f=void 0!==a?a:this.isPendingTimestampOffset_;c.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:u.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:f});var h=Ka(this.sourceUpdater_.audioBuffered());return"number"==typeof h&&(c.audioAppendStart=h-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(c.gopsToAlignWith=function(t,e,r){if(null==e||!t.length)return[];var n,i=Math.ceil((e-r+3)*oe.ONE_SECOND_IN_TS);for(n=0;n<t.length&&!(t[n].pts>i);n++);return t.slice(n)}(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),c},n.timestampOffsetForSegment_=function(t){return r=(e=t).segmentTimeline,n=e.currentTimeline,i=e.startOfSegment,o=e.buffered,e.overrideCheck||r!==n?r<n?i:o.length?o.end(o.length-1):i:null;var e,r,n,i,o},n.earlyAbortWhenNeeded_=function(t){if(!this.vhs_.tech_.paused()&&this.xhrOptions_.timeout&&this.playlist_.attributes.BANDWIDTH&&!(Date.now()-(t.firstBytesReceivedAt||Date.now())<1e3)){var e=this.currentTime_(),r=t.bandwidth,n=this.pendingSegment_.duration,i=ls.estimateSegmentRequestTime(n,r,this.playlist_,t.bytesReceived),o=function(t,e,r){return void 0===r&&(r=1),((t.length?t.end(t.length-1):0)-e)/r}(this.buffered_(),e,this.vhs_.tech_.playbackRate())-1;if(!(i<=o)){var a=function(t){var e=t.currentTime,r=t.bandwidth,n=t.duration,i=t.segmentDuration,o=t.timeUntilRebuffer,a=t.currentTimeline,s=t.syncController,u=t.master.playlists.filter((function(t){return!ls.isIncompatible(t)})),l=u.filter(ls.isEnabled);l.length||(l=u.filter((function(t){return!ls.isDisabled(t)})));var c=l.filter(ls.hasAttribute.bind(null,"BANDWIDTH")).map((function(t){var u=s.getSyncPoint(t,n,a,e)?1:2;return{playlist:t,rebufferingImpact:ls.estimateSegmentRequestTime(i,r,t)*u-o}})),f=c.filter((function(t){return t.rebufferingImpact<=0}));return iu(f,(function(t,e){return ou(e.playlist,t.playlist)})),f.length?f[0]:(iu(c,(function(t,e){return t.rebufferingImpact-e.rebufferingImpact})),c[0]||null)}({master:this.vhs_.playlists.master,currentTime:e,bandwidth:r,duration:this.duration_(),segmentDuration:n,timeUntilRebuffer:o,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(a){var s=i-o-a.rebufferingImpact,u=.5;o<=Va&&(u=1),!a.playlist||a.playlist.uri===this.playlist_.uri||s<u||(this.bandwidth=a.playlist.attributes.BANDWIDTH*Ls.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}}}},n.handleAbort_=function(t){this.logger_("Aborting "+fu(t)),this.mediaRequestsAborted+=1},n.handleProgress_=function(t,e){this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||this.trigger("progress")},n.handleTrackInfo_=function(t,e){this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||this.checkForIllegalMediaSwitch(e)||(e=e||{},function(t,e){if(!t&&!e||!t&&e||t&&!e)return!1;if(t===e)return!0;var r=Object.keys(t).sort(),n=Object.keys(e).sort();if(r.length!==n.length)return!1;for(var i=0;i<r.length;i++){var o=r[i];if(o!==n[i])return!1;if(t[o]!==e[o])return!1}return!0}(this.currentMediaInfo_,e)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=e,this.currentMediaInfo_=e,this.logger_("trackinfo update",e),this.trigger("trackinfo")),this.checkForAbort_(t.requestId)||(this.pendingSegment_.trackInfo=e,this.hasEnoughInfoToAppend_()&&this.processCallQueue_()))},n.handleTimingInfo_=function(t,e,r,n){if(this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId)){var i=this.pendingSegment_,o=hu(e);i[o]=i[o]||{},i[o][r]=n,this.logger_("timinginfo: "+e+" - "+r+" - "+n),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}},n.handleCaptions_=function(t,r){var n=this;if(this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId))if(0!==r.length)if(this.pendingSegment_.hasAppendedData_){var i=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),o={};r.forEach((function(t){o[t.stream]=o[t.stream]||{startTime:1/0,captions:[],endTime:0};var e=o[t.stream];e.startTime=Math.min(e.startTime,t.startTime+i),e.endTime=Math.max(e.endTime,t.endTime+i),e.captions.push(t)})),Object.keys(o).forEach((function(t){var r=o[t],a=r.startTime,s=r.endTime,u=r.captions,l=n.inbandTextTracks_;n.logger_("adding cues from "+a+" -> "+s+" for "+t),function(t,e,r){if(!t[r]){e.trigger({type:"usage",name:"vhs-608"}),e.trigger({type:"usage",name:"hls-608"});var n=e.textTracks().getTrackById(r);t[r]=n||e.addRemoteTextTrack({kind:"captions",id:r,label:r},!1).track}}(l,n.vhs_.tech_,t),uu(a,s,l[t]),function(t){var r=t.inbandTextTracks,n=t.captionArray,i=t.timestampOffset;if(n){var o=e().WebKitDataCue||e().VTTCue;n.forEach((function(t){var e=t.stream;r[e].addCue(new o(t.startTime+i,t.endTime+i,t.text))}))}}({captionArray:u,inbandTextTracks:l,timestampOffset:i})})),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}else this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,t,r));else this.logger_("SegmentLoader received no captions from a caption event")},n.handleId3_=function(t,r,n){if(this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId))if(this.pendingSegment_.hasAppendedData_){var i=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();!function(t,e,r){t.metadataTrack_||(t.metadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,t.metadataTrack_.inBandMetadataTrackDispatchType=e)}(this.inbandTextTracks_,n,this.vhs_.tech_),function(t){var r=t.inbandTextTracks,n=t.metadataArray,i=t.timestampOffset,o=t.videoDuration;if(n){var a=e().WebKitDataCue||e().VTTCue,s=r.metadataTrack_;if(s&&(n.forEach((function(t){var r=t.cueTime+i;!("number"!=typeof r||e().isNaN(r)||r<0)&&r<1/0&&t.frames.forEach((function(t){var e=new a(r,r,t.value||t.url||t.data||"");e.frame=t,e.value=t,function(t){Object.defineProperties(t.frame,{id:{get:function(){return _a.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),t.value.key}},value:{get:function(){return _a.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),t.value.data}},privateData:{get:function(){return _a.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),t.value.data}}})}(e),s.addCue(e)}))})),s.cues&&s.cues.length)){for(var u=s.cues,l=[],c=0;c<u.length;c++)u[c]&&l.push(u[c]);var f=l.reduce((function(t,e){var r=t[e.startTime]||[];return r.push(e),t[e.startTime]=r,t}),{}),h=Object.keys(f).sort((function(t,e){return Number(t)-Number(e)}));h.forEach((function(t,e){var r=f[t],n=Number(h[e+1])||o;r.forEach((function(t){t.endTime=n}))}))}}}({inbandTextTracks:this.inbandTextTracks_,metadataArray:r,timestampOffset:i,videoDuration:this.duration_()})}else this.metadataQueue_.id3.push(this.handleId3_.bind(this,t,r,n))},n.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach((function(t){return t()})),this.metadataQueue_.caption.forEach((function(t){return t()})),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},n.processCallQueue_=function(){var t=this.callQueue_;this.callQueue_=[],t.forEach((function(t){return t()}))},n.processLoadQueue_=function(){var t=this.loadQueue_;this.loadQueue_=[],t.forEach((function(t){return t()}))},n.hasEnoughInfoToLoad_=function(){if("audio"!==this.loaderType_)return!0;var t=this.pendingSegment_;return!(!t||this.currentMediaInfo_&&pu({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:t.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},n.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var t=this.pendingSegment_;if(!t||!t.trackInfo)return!1;var e=this.currentMediaInfo_,r=e.hasAudio,n=e.hasVideo,i=e.isMuxed;return!(n&&!t.videoTimingInfo||r&&!this.audioDisabled_&&!i&&!t.audioTimingInfo||pu({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:t.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},n.handleData_=function(t,e){if(this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId))if(!this.callQueue_.length&&this.hasEnoughInfoToAppend_()){var r=this.pendingSegment_;if(this.setTimeMapping_(r.timeline),this.updateMediaSecondsLoaded_(r.segment),"closed"!==this.mediaSource_.readyState){if(t.map&&(t.map=this.initSegmentForMap(t.map,!0),r.segment.map=t.map),t.key&&this.segmentKey(t.key,!0),r.isFmp4=t.isFmp4,r.timingInfo=r.timingInfo||{},r.isFmp4)this.trigger("fmp4"),r.timingInfo.start=r[hu(e.type)].start;else{var n,i="main"===this.loaderType_&&this.currentMediaInfo_.hasVideo;i&&(n=r.videoTimingInfo.start),r.timingInfo.start=this.trueSegmentStart_({currentStart:r.timingInfo.start,playlist:r.playlist,mediaIndex:r.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:i,firstVideoFrameTimeForData:n,videoTimingInfo:r.videoTimingInfo,audioTimingInfo:r.audioTimingInfo})}this.updateAppendInitSegmentStatus(r,e.type),this.updateSourceBufferTimestampOffset_(r),r.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(r,e)}}else this.callQueue_.push(this.handleData_.bind(this,t,e))},n.updateAppendInitSegmentStatus=function(t,e){"main"!==this.loaderType_||"number"!=typeof t.timestampOffset||t.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[e]!==t.playlist&&(this.appendInitSegment_[e]=!0)},n.getInitSegmentAndUpdateState_=function(t){var e=t.type,r=t.initSegment,n=t.map,i=t.playlist;if(n){var o=bs(n);if(this.activeInitSegmentId_===o)return null;r=this.initSegmentForMap(n,!0).bytes,this.activeInitSegmentId_=o}return r&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=i,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,r):null},n.handleQuotaExceededError_=function(t,r){var n=this,i=t.segmentInfo,o=t.type,a=t.bytes,s=this.sourceUpdater_.audioBuffered(),u=this.sourceUpdater_.videoBuffered();s.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Xa(s).join(", ")),u.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Xa(u).join(", "));var l=s.length?s.start(0):0,c=s.length?s.end(s.length-1):0,f=u.length?u.start(0):0,h=u.length?u.end(u.length-1):0;if(c-l<=1&&h-f<=1)return this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: "+a.byteLength+", audio buffer: "+Xa(s).join(", ")+", video buffer: "+Xa(u).join(", ")+", "),this.error({message:"Quota exceeded error with append of a single segment of content",blacklistDuration:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:i,type:o,bytes:a}));var p=this.currentTime_()-1;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+p),this.remove(0,p,(function(){n.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),n.waitingOnRemove_=!1,n.quotaExceededErrorRetryTimeout_=e().setTimeout((function(){n.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),n.quotaExceededErrorRetryTimeout_=null,n.processCallQueue_()}),1e3)}),!0)},n.handleAppendError_=function(t,e){var r=t.segmentInfo,n=t.type,i=t.bytes;e&&(22!==e.code?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",e),this.error(n+" append of "+i.length+"b failed for segment #"+r.mediaIndex+" in playlist "+r.playlist.id),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:r,type:n,bytes:i}))},n.appendToSourceBuffer_=function(t){var e,r,n,i=t.segmentInfo,o=t.type,a=t.initSegment,s=t.data,u=t.bytes;if(!u){var l=[s],c=s.byteLength;a&&(l.unshift(a),c+=a.byteLength),n=0,(e={bytes:c,segments:l}).bytes&&(r=new Uint8Array(e.bytes),e.segments.forEach((function(t){r.set(t,n),n+=t.byteLength}))),u=r}this.sourceUpdater_.appendBuffer({segmentInfo:i,type:o,bytes:u},this.handleAppendError_.bind(this,{segmentInfo:i,type:o,bytes:u}))},n.handleSegmentTimingInfo_=function(t,e,r){if(this.pendingSegment_&&e===this.pendingSegment_.requestId){var n=this.pendingSegment_.segment,i=t+"TimingInfo";n[i]||(n[i]={}),n[i].transmuxerPrependedSeconds=r.prependedContentDuration||0,n[i].transmuxedPresentationStart=r.start.presentation,n[i].transmuxedDecodeStart=r.start.decode,n[i].transmuxedPresentationEnd=r.end.presentation,n[i].transmuxedDecodeEnd=r.end.decode,n[i].baseMediaDecodeTime=r.baseMediaDecodeTime}},n.appendData_=function(t,e){var r=e.type,n=e.data;if(n&&n.byteLength&&("audio"!==r||!this.audioDisabled_)){var i=this.getInitSegmentAndUpdateState_({type:r,initSegment:e.initSegment,playlist:t.playlist,map:t.isFmp4?t.segment.map:null});this.appendToSourceBuffer_({segmentInfo:t,type:r,initSegment:i,data:n})}},n.loadSegment_=function(t){var e=this;this.state="WAITING",this.pendingSegment_=t,this.trimBackBuffer_(t),"number"==typeof t.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(t):this.loadQueue_.push((function(){var r=a({},t,{forceTimestampOffset:!0});a(t,e.generateSegmentInfo_(r)),e.isPendingTimestampOffset_=!1,e.updateTransmuxerAndRequestSegment_(t)}))},n.updateTransmuxerAndRequestSegment_=function(t){var e=this;this.shouldUpdateTransmuxerTimestampOffset_(t.timestampOffset)&&(this.gopBuffer_.length=0,t.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:t.timestampOffset}));var r=this.createSimplifiedSegmentObj_(t),n=this.isEndOfStream_(t.mediaIndex,t.playlist,t.partIndex),i=null!==this.mediaIndex,o=t.timeline!==this.currentTimeline_&&t.timeline>0,a=n||i&&o;this.logger_("Requesting "+fu(t)),r.map&&!r.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),t.abortRequests=Ys({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:r,abortFn:this.handleAbort_.bind(this,t),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",t.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",t.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:a,endedTimelineFn:function(){e.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this)})},n.trimBackBuffer_=function(t){var e=function(t,e,r){var n=e-Ls.BACK_BUFFER_LENGTH;t.length&&(n=Math.max(n,t.start(0)));var i=e-r;return Math.min(i,n)}(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);e>0&&this.remove(0,e)},n.createSimplifiedSegmentObj_=function(t){var e=t.segment,r=t.part,n={resolvedUri:r?r.resolvedUri:e.resolvedUri,byterange:r?r.byterange:e.byterange,requestId:t.requestId,transmuxer:t.transmuxer,audioAppendStart:t.audioAppendStart,gopsToAlignWith:t.gopsToAlignWith,part:t.part},i=t.playlist.segments[t.mediaIndex-1];if(i&&i.timeline===e.timeline&&(i.videoTimingInfo?n.baseStartTime=i.videoTimingInfo.transmuxedDecodeEnd:i.audioTimingInfo&&(n.baseStartTime=i.audioTimingInfo.transmuxedDecodeEnd)),e.key){var o=e.key.iv||new Uint32Array([0,0,0,t.mediaIndex+t.playlist.mediaSequence]);n.key=this.segmentKey(e.key),n.key.iv=o}return e.map&&(n.map=this.initSegmentForMap(e.map)),n},n.saveTransferStats_=function(t){this.mediaRequests+=1,t&&(this.mediaBytesTransferred+=t.bytesReceived,this.mediaTransferDuration+=t.roundTripTime)},n.saveBandwidthRelatedStats_=function(t,e){this.pendingSegment_.byteLength=e.bytesReceived,t<cu?this.logger_("Ignoring segment's bandwidth because its duration of "+t+" is less than the min to record "+cu):(this.bandwidth=e.bandwidth,this.roundTrip=e.roundTripTime)},n.handleTimeout_=function(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate")},n.segmentRequestFinished_=function(t,e,r){if(this.callQueue_.length)this.callQueue_.push(this.segmentRequestFinished_.bind(this,t,e,r));else if(this.saveTransferStats_(e.stats),this.pendingSegment_&&e.requestId===this.pendingSegment_.requestId){if(t){if(this.pendingSegment_=null,this.state="READY",t.code===zs)return;return this.pause(),t.code===qs?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(t),void this.trigger("error"))}var n=this.pendingSegment_;this.saveBandwidthRelatedStats_(n.duration,e.stats),n.endOfAllRequests=e.endOfAllRequests,r.gopInfo&&(this.gopBuffer_=function(t,e,r){if(!e.length)return t;if(r)return e.slice();for(var n=e[0].pts,i=0;i<t.length&&!(t[i].pts>=n);i++);return t.slice(0,i).concat(e)}(this.gopBuffer_,r.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(n)}},n.setTimeMapping_=function(t){var e=this.syncController_.mappingForTimeline(t);null!==e&&(this.timeMapping_=e)},n.updateMediaSecondsLoaded_=function(t){"number"==typeof t.start&&"number"==typeof t.end?this.mediaSecondsLoaded+=t.end-t.start:this.mediaSecondsLoaded+=t.duration},n.shouldUpdateTransmuxerTimestampOffset_=function(t){return null!==t&&("main"===this.loaderType_&&t!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&t!==this.sourceUpdater_.audioTimestampOffset())},n.trueSegmentStart_=function(t){var e=t.currentStart,r=t.playlist,n=t.mediaIndex,i=t.firstVideoFrameTimeForData,o=t.currentVideoTimestampOffset,a=t.useVideoTimingInfo,s=t.videoTimingInfo,u=t.audioTimingInfo;if(void 0!==e)return e;if(!a)return u.start;var l=r.segments[n-1];return 0!==n&&l&&void 0!==l.start&&l.end===i+o?s.start:i},n.waitForAppendsToComplete_=function(t){if(!this.currentMediaInfo_)return this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),void this.trigger("error");var e=this.currentMediaInfo_,r=e.hasAudio,n=e.hasVideo,i=e.isMuxed,o="main"===this.loaderType_&&n,a=!this.audioDisabled_&&r&&!i;if(t.waitingOnAppends=0,!t.hasAppendedData_)return t.timingInfo||"number"!=typeof t.timestampOffset||(this.isPendingTimestampOffset_=!0),t.timingInfo={start:0},t.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(t),this.processMetadataQueue_()),void this.checkAppendsDone_(t);o&&t.waitingOnAppends++,a&&t.waitingOnAppends++,o&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,t)),a&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,t))},n.checkAppendsDone_=function(t){this.checkForAbort_(t.requestId)||(t.waitingOnAppends--,0===t.waitingOnAppends&&this.handleAppendsDone_())},n.checkForIllegalMediaSwitch=function(t){var e=function(t,e,r){return"main"===t&&e&&r?r.hasAudio||r.hasVideo?e.hasVideo&&!r.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!e.hasVideo&&r.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}(this.loaderType_,this.currentMediaInfo_,t);return!!e&&(this.error({message:e,blacklistDuration:1/0}),this.trigger("error"),!0)},n.updateSourceBufferTimestampOffset_=function(t){if(null!==t.timestampOffset&&"number"==typeof t.timingInfo.start&&!t.changedTimestampOffset&&"main"===this.loaderType_){var e=!1;t.timestampOffset-=t.timingInfo.start,t.changedTimestampOffset=!0,t.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(t.timestampOffset),e=!0),t.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(t.timestampOffset),e=!0),e&&this.trigger("timestampoffset")}},n.updateTimingInfoEnd_=function(t){t.timingInfo=t.timingInfo||{};var e="main"===this.loaderType_&&this.currentMediaInfo_.hasVideo&&t.videoTimingInfo?t.videoTimingInfo:t.audioTimingInfo;e&&(t.timingInfo.end="number"==typeof e.end?e.end:e.start+t.duration)},n.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var t=this.pendingSegment_;this.updateTimingInfoEnd_(t),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:t,shouldSaveTimelineMapping:"main"===this.loaderType_}),this.logger_("Appended "+fu(t));var e=function(t,e){if("hls"!==e)return null;var r,n,i,o,a=(r=t.audioTimingInfo,n=t.videoTimingInfo,i=r&&"number"==typeof r.start&&"number"==typeof r.end?r.end-r.start:0,o=n&&"number"==typeof n.start&&"number"==typeof n.end?n.end-n.start:0,Math.max(i,o));if(!a)return null;var s=t.playlist.targetDuration,u=du({segmentDuration:a,maxDuration:2*s}),l=du({segmentDuration:a,maxDuration:s}),c="Segment with index "+t.mediaIndex+" from playlist "+t.playlist.id+" has a duration of "+a+" when the reported duration is "+t.duration+" and the target duration is "+s+". For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1";return u||l?{severity:u?"warn":"info",message:c}:null}(t,this.sourceType_);if(e&&("warn"===e.severity?_a.log.warn(e.message):this.logger_(e.message)),this.recordThroughput_(t),this.pendingSegment_=null,this.state="READY",t.isSyncRequest)this.trigger("syncinfoupdate");else{this.addSegmentMetadataCue_(t),this.fetchAtBuffer_=!0,this.currentTimeline_!==t.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:t.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:t.timeline})),this.currentTimeline_=t.timeline,this.trigger("syncinfoupdate");var r=t.segment;r.end&&this.currentTime_()-r.end>3*t.playlist.targetDuration?this.resetEverything():(null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=t.mediaIndex,this.partIndex=t.partIndex,this.isEndOfStream_(t.mediaIndex,t.playlist,t.partIndex)&&this.endOfStream(),this.trigger("appended"),this.paused()||this.monitorBuffer_())}},n.recordThroughput_=function(t){if(t.duration<cu)this.logger_("Ignoring segment's throughput because its duration of "+t.duration+" is less than the min to record "+cu);else{var e=this.throughput.rate,r=Date.now()-t.endOfAllRequests+1,n=Math.floor(t.byteLength/r*8*1e3);this.throughput.rate+=(n-e)/++this.throughput.count}},n.addSegmentMetadataCue_=function(t){if(this.segmentMetadataTrack_){var r=t.segment,n=r.start,i=r.end;if(lu(n)&&lu(i)){uu(n,i,this.segmentMetadataTrack_);var o=e().WebKitDataCue||e().VTTCue,a={custom:r.custom,dateTimeObject:r.dateTimeObject,dateTimeString:r.dateTimeString,bandwidth:t.playlist.attributes.BANDWIDTH,resolution:t.playlist.attributes.RESOLUTION,codecs:t.playlist.attributes.CODECS,byteLength:t.byteLength,uri:t.uri,timeline:t.timeline,playlist:t.playlist.id,start:n,end:i},s=new o(n,i,JSON.stringify(a));s.value=a,this.segmentMetadataTrack_.addCue(s)}}},r}(_a.EventTarget);function mu(){}var vu,gu=function(t){return"string"!=typeof t?t:t.replace(/./,(function(t){return t.toUpperCase()}))},bu=["video","audio"],_u=function(t,e){var r=e[t+"Buffer"];return r&&r.updating||e.queuePending[t]},wu=function t(e,r){if(0!==r.queue.length){var n=0,i=r.queue[n];if("mediaSource"!==i.type){if("mediaSource"!==e&&r.ready()&&"closed"!==r.mediaSource.readyState&&!_u(e,r)){if(i.type!==e){if(n=function(t,e){for(var r=0;r<e.length;r++){var n=e[r];if("mediaSource"===n.type)return null;if(n.type===t)return r}return null}(e,r.queue),null===n)return;i=r.queue[n]}return r.queue.splice(n,1),r.queuePending[e]=i,i.action(e,r),i.doneFn?void 0:(r.queuePending[e]=null,void t(e,r))}}else r.updating()||"closed"===r.mediaSource.readyState||(r.queue.shift(),i.action(r),i.doneFn&&i.doneFn(),t("audio",r),t("video",r))}},Tu=function(t,e){var r=e[t+"Buffer"],n=gu(t);r&&(r.removeEventListener("updateend",e["on"+n+"UpdateEnd_"]),r.removeEventListener("error",e["on"+n+"Error_"]),e.codecs[t]=null,e[t+"Buffer"]=null)},Su=function(t,e){return t&&e&&-1!==Array.prototype.indexOf.call(t.sourceBuffers,e)},Eu=function(t,e,r){return function(n,i){var o=i[n+"Buffer"];if(Su(i.mediaSource,o)){i.logger_("Appending segment "+e.mediaIndex+"'s "+t.length+" bytes to "+n+"Buffer");try{o.appendBuffer(t)}catch(t){i.logger_("Error with code "+t.code+" "+(22===t.code?"(QUOTA_EXCEEDED_ERR) ":"")+"when appending segment "+e.mediaIndex+" to "+n+"Buffer"),i.queuePending[n]=null,r(t)}}}},Ou=function(t,e){return function(r,n){var i=n[r+"Buffer"];if(Su(n.mediaSource,i)){n.logger_("Removing "+t+" to "+e+" from "+r+"Buffer");try{i.remove(t,e)}catch(i){n.logger_("Remove "+t+" to "+e+" from "+r+"Buffer failed")}}}},ku=function(t){return function(e,r){var n=r[e+"Buffer"];Su(r.mediaSource,n)&&(r.logger_("Setting "+e+"timestampOffset to "+t),n.timestampOffset=t)}},Cu=function(t){return function(e,r){t()}},Pu=function(t){return function(e){if("open"===e.mediaSource.readyState){e.logger_("Calling mediaSource endOfStream("+(t||"")+")");try{e.mediaSource.endOfStream(t)}catch(t){_a.log.warn("Failed to call media source endOfStream",t)}}}},xu=function(t,e){return function(r){var n=gu(t),i=U(e);r.logger_("Adding "+t+"Buffer with codec "+e+" to mediaSource");var o=r.mediaSource.addSourceBuffer(i);o.addEventListener("updateend",r["on"+n+"UpdateEnd_"]),o.addEventListener("error",r["on"+n+"Error_"]),r.codecs[t]=e,r[t+"Buffer"]=o}},ju=function(t){return function(e){var r=e[t+"Buffer"];if(Tu(t,e),Su(e.mediaSource,r)){e.logger_("Removing "+t+"Buffer with codec "+e.codecs[t]+" from mediaSource");try{e.mediaSource.removeSourceBuffer(r)}catch(e){_a.log.warn("Failed to removeSourceBuffer "+t+"Buffer",e)}}}},Lu=function(t){return function(e,r){var n=r[e+"Buffer"],i=U(t);Su(r.mediaSource,n)&&r.codecs[e]!==t&&(r.logger_("changing "+e+"Buffer codec from "+r.codecs[e]+" to "+t),n.changeType(i),r.codecs[e]=t)}},Iu=function(t){var e=t.type,r=t.sourceUpdater,n=t.action,i=t.doneFn,o=t.name;r.queue.push({type:e,action:n,doneFn:i,name:o}),wu(e,r)},Au=function(t,e){return function(r){if(e.queuePending[t]){var n=e.queuePending[t].doneFn;e.queuePending[t]=null,n&&n(e[t+"Error_"])}wu(t,e)}},Ru=function(t){function r(e){var r;return(r=t.call(this)||this).mediaSource=e,r.sourceopenListener_=function(){return wu("mediaSource",s(r))},r.mediaSource.addEventListener("sourceopen",r.sourceopenListener_),r.logger_=Oa("SourceUpdater"),r.audioTimestampOffset_=0,r.videoTimestampOffset_=0,r.queue=[],r.queuePending={audio:null,video:null},r.delayedAudioAppendQueue_=[],r.videoAppendQueued_=!1,r.codecs={},r.onVideoUpdateEnd_=Au("video",s(r)),r.onAudioUpdateEnd_=Au("audio",s(r)),r.onVideoError_=function(t){r.videoError_=t},r.onAudioError_=function(t){r.audioError_=t},r.createdSourceBuffers_=!1,r.initializedEme_=!1,r.triggeredReady_=!1,r}l(r,t);var n=r.prototype;return n.initializedEme=function(){this.initializedEme_=!0,this.triggerReady()},n.hasCreatedSourceBuffers=function(){return this.createdSourceBuffers_},n.hasInitializedAnyEme=function(){return this.initializedEme_},n.ready=function(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()},n.createSourceBuffers=function(t){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(t),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())},n.triggerReady=function(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))},n.addSourceBuffer=function(t,e){Iu({type:"mediaSource",sourceUpdater:this,action:xu(t,e),name:"addSourceBuffer"})},n.abort=function(t){Iu({type:t,sourceUpdater:this,action:function(t,e){if("open"===e.mediaSource.readyState){var r=e[t+"Buffer"];if(Su(e.mediaSource,r)){e.logger_("calling abort on "+t+"Buffer");try{r.abort()}catch(e){_a.log.warn("Failed to abort on "+t+"Buffer",e)}}}},name:"abort"})},n.removeSourceBuffer=function(t){this.canRemoveSourceBuffer()?Iu({type:"mediaSource",sourceUpdater:this,action:ju(t),name:"removeSourceBuffer"}):_a.log.error("removeSourceBuffer is not supported!")},n.canRemoveSourceBuffer=function(){return!_a.browser.IE_VERSION&&!_a.browser.IS_FIREFOX&&e().MediaSource&&e().MediaSource.prototype&&"function"==typeof e().MediaSource.prototype.removeSourceBuffer},r.canChangeType=function(){return e().SourceBuffer&&e().SourceBuffer.prototype&&"function"==typeof e().SourceBuffer.prototype.changeType},n.canChangeType=function(){return this.constructor.canChangeType()},n.changeType=function(t,e){this.canChangeType()?Iu({type:t,sourceUpdater:this,action:Lu(e),name:"changeType"}):_a.log.error("changeType is not supported!")},n.addOrChangeSourceBuffers=function(t){var e=this;if(!t||"object"!=typeof t||0===Object.keys(t).length)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(t).forEach((function(r){var n=t[r];if(!e.hasCreatedSourceBuffers())return e.addSourceBuffer(r,n);e.canChangeType()&&e.changeType(r,n)}))},n.appendBuffer=function(t,e){var r=this,n=t.segmentInfo,i=t.type,o=t.bytes;if(this.processedAppend_=!0,"audio"===i&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([t,e]),void this.logger_("delayed audio append of "+o.length+" until video append");if(Iu({type:i,sourceUpdater:this,action:Eu(o,n||{mediaIndex:-1},e),doneFn:e,name:"appendBuffer"}),"video"===i){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;var a=this.delayedAudioAppendQueue_.slice();this.logger_("queuing delayed audio "+a.length+" appendBuffers"),this.delayedAudioAppendQueue_.length=0,a.forEach((function(t){r.appendBuffer.apply(r,t)}))}},n.audioBuffered=function(){return Su(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:_a.createTimeRange()},n.videoBuffered=function(){return Su(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:_a.createTimeRange()},n.buffered=function(){var t=Su(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,e=Su(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return e&&!t?this.audioBuffered():t&&!e?this.videoBuffered():function(t,e){var r=null,n=null,i=0,o=[],a=[];if(!(t&&t.length&&e&&e.length))return _a.createTimeRange();for(var s=t.length;s--;)o.push({time:t.start(s),type:"start"}),o.push({time:t.end(s),type:"end"});for(s=e.length;s--;)o.push({time:e.start(s),type:"start"}),o.push({time:e.end(s),type:"end"});for(o.sort((function(t,e){return t.time-e.time})),s=0;s<o.length;s++)"start"===o[s].type?2==++i&&(r=o[s].time):"end"===o[s].type&&1==--i&&(n=o[s].time),null!==r&&null!==n&&(a.push([r,n]),r=null,n=null);return _a.createTimeRanges(a)}(this.audioBuffered(),this.videoBuffered())},n.setDuration=function(t,e){var r;void 0===e&&(e=mu),Iu({type:"mediaSource",sourceUpdater:this,action:(r=t,function(t){t.logger_("Setting mediaSource duration to "+r);try{t.mediaSource.duration=r}catch(t){_a.log.warn("Failed to set media source duration",t)}}),name:"duration",doneFn:e})},n.endOfStream=function(t,e){void 0===t&&(t=null),void 0===e&&(e=mu),"string"!=typeof t&&(t=void 0),Iu({type:"mediaSource",sourceUpdater:this,action:Pu(t),name:"endOfStream",doneFn:e})},n.removeAudio=function(t,e,r){void 0===r&&(r=mu),this.audioBuffered().length&&0!==this.audioBuffered().end(0)?Iu({type:"audio",sourceUpdater:this,action:Ou(t,e),doneFn:r,name:"remove"}):r()},n.removeVideo=function(t,e,r){void 0===r&&(r=mu),this.videoBuffered().length&&0!==this.videoBuffered().end(0)?Iu({type:"video",sourceUpdater:this,action:Ou(t,e),doneFn:r,name:"remove"}):r()},n.updating=function(){return!(!_u("audio",this)&&!_u("video",this))},n.audioTimestampOffset=function(t){return void 0!==t&&this.audioBuffer&&this.audioTimestampOffset_!==t&&(Iu({type:"audio",sourceUpdater:this,action:ku(t),name:"timestampOffset"}),this.audioTimestampOffset_=t),this.audioTimestampOffset_},n.videoTimestampOffset=function(t){return void 0!==t&&this.videoBuffer&&this.videoTimestampOffset!==t&&(Iu({type:"video",sourceUpdater:this,action:ku(t),name:"timestampOffset"}),this.videoTimestampOffset_=t),this.videoTimestampOffset_},n.audioQueueCallback=function(t){this.audioBuffer&&Iu({type:"audio",sourceUpdater:this,action:Cu(t),name:"callback"})},n.videoQueueCallback=function(t){this.videoBuffer&&Iu({type:"video",sourceUpdater:this,action:Cu(t),name:"callback"})},n.dispose=function(){var t=this;this.trigger("dispose"),bu.forEach((function(e){t.abort(e),t.canRemoveSourceBuffer()?t.removeSourceBuffer(e):t[e+"QueueCallback"]((function(){return Tu(e,t)}))})),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()},r}(_a.EventTarget),Du=function(t){return decodeURIComponent(escape(String.fromCharCode.apply(null,t)))},Mu=new Uint8Array("\n\n".split("").map((function(t){return t.charCodeAt(0)}))),Nu=function(t){function r(e,r){var n;return void 0===r&&(r={}),(n=t.call(this,e,r)||this).mediaSource_=null,n.subtitlesTrack_=null,n.loaderType_="subtitle",n.featuresNativeTextTracks_=e.featuresNativeTextTracks,n.shouldSaveSegmentTimingInfo_=!1,n}l(r,t);var n=r.prototype;return n.createTransmuxer_=function(){return null},n.buffered_=function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return _a.createTimeRanges();var t=this.subtitlesTrack_.cues,e=t[0].startTime,r=t[t.length-1].startTime;return _a.createTimeRanges([[e,r]])},n.initSegmentForMap=function(t,e){if(void 0===e&&(e=!1),!t)return null;var r=bs(t),n=this.initSegments_[r];if(e&&!n&&t.bytes){var i=Mu.byteLength+t.bytes.byteLength,o=new Uint8Array(i);o.set(t.bytes),o.set(Mu,t.bytes.byteLength),this.initSegments_[r]=n={resolvedUri:t.resolvedUri,byterange:t.byterange,bytes:o}}return n||t},n.couldBeginLoading_=function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()},n.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},n.track=function(t){return void 0===t||(this.subtitlesTrack_=t,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_},n.remove=function(t,e){uu(t,e,this.subtitlesTrack_)},n.fillBuffer_=function(){var t=this,e=this.chooseNextRequest_();if(e){if(null===this.syncController_.timestampOffsetForTimeline(e.timeline))return this.syncController_.one("timestampoffset",(function(){t.state="READY",t.paused()||t.monitorBuffer_()})),void(this.state="WAITING_ON_TIMELINE");this.loadSegment_(e)}},n.timestampOffsetForSegment_=function(){return null},n.chooseNextRequest_=function(){return this.skipEmptySegments_(t.prototype.chooseNextRequest_.call(this))},n.skipEmptySegments_=function(t){for(;t&&t.segment.empty;){if(t.mediaIndex+1>=t.playlist.segments.length){t=null;break}t=this.generateSegmentInfo_({playlist:t.playlist,mediaIndex:t.mediaIndex+1,startOfSegment:t.startOfSegment+t.duration,isSyncRequest:t.isSyncRequest})}return t},n.stopForError=function(t){this.error(t),this.state="READY",this.pause(),this.trigger("error")},n.segmentRequestFinished_=function(t,r,n){var i=this;if(this.subtitlesTrack_){if(this.saveTransferStats_(r.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(t)return t.code===qs&&this.handleTimeout_(),t.code===zs?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(t);var o=this.pendingSegment_;this.saveBandwidthRelatedStats_(o.duration,r.stats),this.state="APPENDING",this.trigger("appending");var a=o.segment;if(a.map&&(a.map.bytes=r.map.bytes),o.bytes=r.bytes,"function"!=typeof e().WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var s,u=function(){i.subtitlesTrack_.tech_.off("vttjsloaded",s),i.stopForError({message:"Error loading vtt.js"})};return s=function(){i.subtitlesTrack_.tech_.off("vttjserror",u),i.segmentRequestFinished_(t,r,n)},this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",s),void this.subtitlesTrack_.tech_.one("vttjserror",u)}a.requested=!0;try{this.parseVTTCues_(o)}catch(t){return void this.stopForError({message:t.message})}if(this.updateTimeMapping_(o,this.syncController_.timelines[o.timeline],this.playlist_),o.cues.length?o.timingInfo={start:o.cues[0].startTime,end:o.cues[o.cues.length-1].endTime}:o.timingInfo={start:o.startOfSegment,end:o.startOfSegment+o.duration},o.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");o.byteLength=o.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,o.cues.forEach((function(t){i.subtitlesTrack_.addCue(i.featuresNativeTextTracks_?new(e().VTTCue)(t.startTime,t.endTime,t.text):t)})),function(t){var e=t.cues;if(e)for(var r=0;r<e.length;r++){for(var n=[],i=0,o=0;o<e.length;o++)e[r].startTime===e[o].startTime&&e[r].endTime===e[o].endTime&&e[r].text===e[o].text&&++i>1&&n.push(e[o]);n.length&&n.forEach((function(e){return t.removeCue(e)}))}}(this.subtitlesTrack_),this.handleAppendsDone_()}else this.state="READY"},n.handleData_=function(){},n.updateTimingInfoEnd_=function(){},n.parseVTTCues_=function(t){var r,n=!1;"function"==typeof e().TextDecoder?r=new(e().TextDecoder)("utf8"):(r=e().WebVTT.StringDecoder(),n=!0);var i=new(e().WebVTT.Parser)(e(),e().vttjs,r);if(t.cues=[],t.timestampmap={MPEGTS:0,LOCAL:0},i.oncue=t.cues.push.bind(t.cues),i.ontimestampmap=function(e){t.timestampmap=e},i.onparsingerror=function(t){_a.log.warn("Error encountered when parsing cues: "+t.message)},t.segment.map){var o=t.segment.map.bytes;n&&(o=Du(o)),i.parse(o)}var a=t.bytes;n&&(a=Du(a)),i.parse(a),i.flush()},n.updateTimeMapping_=function(t,e,r){var n=t.segment;if(e)if(t.cues.length){var i=t.timestampmap,o=i.MPEGTS/oe.ONE_SECOND_IN_TS-i.LOCAL+e.mapping;if(t.cues.forEach((function(t){t.startTime+=o,t.endTime+=o})),!r.syncInfo){var a=t.cues[0].startTime,s=t.cues[t.cues.length-1].startTime;r.syncInfo={mediaSequence:r.mediaSequence+t.mediaIndex,time:Math.min(a,s-n.duration)}}}else n.empty=!0},r}(yu),Bu=function(t,e){for(var r=t.cues,n=0;n<r.length;n++){var i=r[n];if(e>=i.adStartTime&&e<=i.adEndTime)return i}return null},Uu=function(t,e,r){void 0===r&&(r=0);var n=e.segments;return e.endList||0===r?t:n.length-(t+1)},Fu=[{name:"VOD",run:function(t,e,r,n,i){return r!==1/0?{time:0,segmentIndex:0}:null}},{name:"ProgramDateTime",run:function(t,e,r,n,i){if(!Object.keys(t.timelineToDatetimeMappings).length)return null;var o=e.segments||[],a=null,s=null;i=i||0;for(var u=0;u<o.length;u++){var l=Uu(u,e,i),c=o[l],f=t.timelineToDatetimeMappings[c.timeline];if(f&&c.dateTimeObject){var h=c.dateTimeObject.getTime()/1e3+f,p=Math.abs(i-h);if(null!==s&&(0===p||s<p))break;s=p,a={time:h,segmentIndex:l}}}return a}},{name:"Segment",run:function(t,e,r,n,i){var o=e.segments||[],a=null,s=null;i=i||0;for(var u=0;u<o.length;u++){var l=Uu(u,e,i),c=o[l];if(c.timeline===n&&void 0!==c.start){var f=Math.abs(i-c.start);if(null!==s&&s<f)break;(!a||null===s||s>=f)&&(s=f,a={time:c.start,segmentIndex:l})}}return a}},{name:"Discontinuity",run:function(t,e,r,n,i){var o=null;if(i=i||0,e.discontinuityStarts&&e.discontinuityStarts.length)for(var a=null,s=0;s<e.discontinuityStarts.length;s++){var u=e.discontinuityStarts[s],l=e.discontinuitySequence+s+1,c=t.discontinuities[l];if(c){var f=Math.abs(i-c.time);if(null!==a&&a<f)break;(!o||null===a||a>=f)&&(a=f,o={time:c.time,segmentIndex:u})}}return o}},{name:"Playlist",run:function(t,e,r,n,i){return e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence}:null}}],Vu=function(t){function e(e){var r;return(r=t.call(this)||this).timelines=[],r.discontinuities=[],r.timelineToDatetimeMappings={},r.logger_=Oa("SyncController"),r}l(e,t);var r=e.prototype;return r.getSyncPoint=function(t,e,r,n){var i=this.runStrategies_(t,e,r,n);return i.length?this.selectSyncPoint_(i,{key:"time",value:n}):null},r.getExpiredTime=function(t,e){if(!t||!t.segments)return null;var r=this.runStrategies_(t,e,t.discontinuitySequence,0);if(!r.length)return null;var n=this.selectSyncPoint_(r,{key:"segmentIndex",value:0});return n.segmentIndex>0&&(n.time*=-1),Math.abs(n.time+Za(t,n.segmentIndex,0))},r.runStrategies_=function(t,e,r,n){for(var i=[],o=0;o<Fu.length;o++){var a=Fu[o],s=a.run(this,t,e,r,n);s&&(s.strategy=a.name,i.push({strategy:a.name,syncPoint:s}))}return i},r.selectSyncPoint_=function(t,e){for(var r=t[0].syncPoint,n=Math.abs(t[0].syncPoint[e.key]-e.value),i=t[0].strategy,o=1;o<t.length;o++){var a=Math.abs(t[o].syncPoint[e.key]-e.value);a<n&&(n=a,r=t[o].syncPoint,i=t[o].strategy)}return this.logger_("syncPoint for ["+e.key+": "+e.value+"] chosen with strategy ["+i+"]: [time:"+r.time+", segmentIndex:"+r.segmentIndex+"]"),r},r.saveExpiredSegmentInfo=function(t,e){for(var r=e.mediaSequence-t.mediaSequence-1;r>=0;r--){var n=t.segments[r];if(n&&void 0!==n.start){e.syncInfo={mediaSequence:t.mediaSequence+r,time:n.start},this.logger_("playlist refresh sync: [time:"+e.syncInfo.time+", mediaSequence: "+e.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}},r.setDateTimeMappingForStart=function(t){if(this.timelineToDatetimeMappings={},t.segments&&t.segments.length&&t.segments[0].dateTimeObject){var e=t.segments[0],r=e.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[e.timeline]=-r}},r.saveSegmentTimingInfo=function(t){var e=t.segmentInfo,r=t.shouldSaveTimelineMapping,n=this.calculateSegmentTimeMapping_(e,e.timingInfo,r),i=e.segment;n&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:i.start}));var o=i.dateTimeObject;i.discontinuity&&r&&o&&(this.timelineToDatetimeMappings[i.timeline]=-o.getTime()/1e3)},r.timestampOffsetForTimeline=function(t){return void 0===this.timelines[t]?null:this.timelines[t].time},r.mappingForTimeline=function(t){return void 0===this.timelines[t]?null:this.timelines[t].mapping},r.calculateSegmentTimeMapping_=function(t,e,r){var n=t.segment,i=this.timelines[t.timeline];if("number"==typeof t.timestampOffset)i={time:t.startOfSegment,mapping:t.startOfSegment-e.start},r&&(this.timelines[t.timeline]=i,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+t.timeline+": [time: "+i.time+"] [mapping: "+i.mapping+"]")),n.start=t.startOfSegment,n.end=e.end+i.mapping;else{if(!i)return!1;n.start=e.start+i.mapping,n.end=e.end+i.mapping}return!0},r.saveDiscontinuitySyncInfo_=function(t){var e=t.playlist,r=t.segment;if(r.discontinuity)this.discontinuities[r.timeline]={time:r.start,accuracy:0};else if(e.discontinuityStarts&&e.discontinuityStarts.length)for(var n=0;n<e.discontinuityStarts.length;n++){var i=e.discontinuityStarts[n],o=e.discontinuitySequence+n+1,a=i-t.mediaIndex,s=Math.abs(a);if(!this.discontinuities[o]||this.discontinuities[o].accuracy>s){var u;u=a<0?r.start-Za(e,t.mediaIndex,i):r.end+Za(e,t.mediaIndex+1,i),this.discontinuities[o]={time:u,accuracy:s}}}},r.dispose=function(){this.trigger("dispose"),this.off()},e}(_a.EventTarget),Hu=function(t){function e(){var e;return(e=t.call(this)||this).pendingTimelineChanges_={},e.lastTimelineChanges_={},e}l(e,t);var r=e.prototype;return r.clearPendingTimelineChange=function(t){this.pendingTimelineChanges_[t]=null,this.trigger("pendingtimelinechange")},r.pendingTimelineChange=function(t){var e=t.type,r=t.from,n=t.to;return"number"==typeof r&&"number"==typeof n&&(this.pendingTimelineChanges_[e]={type:e,from:r,to:n},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]},r.lastTimelineChange=function(t){var e=t.type,r=t.from,n=t.to;return"number"==typeof r&&"number"==typeof n&&(this.lastTimelineChanges_[e]={type:e,from:r,to:n},delete this.pendingTimelineChanges_[e],this.trigger("timelinechange")),this.lastTimelineChanges_[e]},r.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},e}(_a.EventTarget),qu=Rs(Ds((function(){function t(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}var e=t((function(t){function e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t},t.exports.default=t.exports,t.exports.__esModule=!0})),r=t((function(t){function e(r,n){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},t.exports.default=t.exports,t.exports.__esModule=!0,e(r,n)}t.exports=e,t.exports.default=t.exports,t.exports.__esModule=!0})),n=t((function(t){t.exports=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,r(t,e)},t.exports.default=t.exports,t.exports.__esModule=!0})),i=function(){function t(){this.listeners={}}var e=t.prototype;return e.on=function(t,e){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e)},e.off=function(t,e){if(!this.listeners[t])return!1;var r=this.listeners[t].indexOf(e);return this.listeners[t]=this.listeners[t].slice(0),this.listeners[t].splice(r,1),r>-1},e.trigger=function(t){var e=this.listeners[t];if(e)if(2===arguments.length)for(var r=e.length,n=0;n<r;++n)e[n].call(this,arguments[1]);else for(var i=Array.prototype.slice.call(arguments,1),o=e.length,a=0;a<o;++a)e[a].apply(this,i)},e.dispose=function(){this.listeners={}},e.pipe=function(t){this.on("data",(function(e){t.push(e)}))},t}(),o=null,a=function(){function t(t){var e,r,n;o||(o=function(){var t,e,r,n,i,o,a,s,u=[[[],[],[],[],[]],[[],[],[],[],[]]],l=u[0],c=u[1],f=l[4],h=c[4],p=[],d=[];for(t=0;t<256;t++)d[(p[t]=t<<1^283*(t>>7))^t]=t;for(e=r=0;!f[e];e^=n||1,r=d[r]||1)for(o=(o=r^r<<1^r<<2^r<<3^r<<4)>>8^255&o^99,f[e]=o,h[o]=e,s=16843009*p[i=p[n=p[e]]]^65537*i^257*n^16843008*e,a=257*p[o]^16843008*o,t=0;t<4;t++)l[t][e]=a=a<<24^a>>>8,c[t][o]=s=s<<24^s>>>8;for(t=0;t<5;t++)l[t]=l[t].slice(0),c[t]=c[t].slice(0);return u}()),this._tables=[[o[0][0].slice(),o[0][1].slice(),o[0][2].slice(),o[0][3].slice(),o[0][4].slice()],[o[1][0].slice(),o[1][1].slice(),o[1][2].slice(),o[1][3].slice(),o[1][4].slice()]];var i=this._tables[0][4],a=this._tables[1],s=t.length,u=1;if(4!==s&&6!==s&&8!==s)throw new Error("Invalid aes key size");var l=t.slice(0),c=[];for(this._key=[l,c],e=s;e<4*s+28;e++)n=l[e-1],(e%s==0||8===s&&e%s==4)&&(n=i[n>>>24]<<24^i[n>>16&255]<<16^i[n>>8&255]<<8^i[255&n],e%s==0&&(n=n<<8^n>>>24^u<<24,u=u<<1^283*(u>>7))),l[e]=l[e-s]^n;for(r=0;e;r++,e--)n=l[3&r?e:e-4],c[r]=e<=4||r<4?n:a[0][i[n>>>24]]^a[1][i[n>>16&255]]^a[2][i[n>>8&255]]^a[3][i[255&n]]}return t.prototype.decrypt=function(t,e,r,n,i,o){var a,s,u,l,c=this._key[1],f=t^c[0],h=n^c[1],p=r^c[2],d=e^c[3],y=c.length/4-2,m=4,v=this._tables[1],g=v[0],b=v[1],_=v[2],w=v[3],T=v[4];for(l=0;l<y;l++)a=g[f>>>24]^b[h>>16&255]^_[p>>8&255]^w[255&d]^c[m],s=g[h>>>24]^b[p>>16&255]^_[d>>8&255]^w[255&f]^c[m+1],u=g[p>>>24]^b[d>>16&255]^_[f>>8&255]^w[255&h]^c[m+2],d=g[d>>>24]^b[f>>16&255]^_[h>>8&255]^w[255&p]^c[m+3],m+=4,f=a,h=s,p=u;for(l=0;l<4;l++)i[(3&-l)+o]=T[f>>>24]<<24^T[h>>16&255]<<16^T[p>>8&255]<<8^T[255&d]^c[m++],a=f,f=h,h=p,p=d,d=a},t}(),s=function(t){function e(){var e;return(e=t.call(this,i)||this).jobs=[],e.delay=1,e.timeout_=null,e}n(e,t);var r=e.prototype;return r.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},r.push=function(t){this.jobs.push(t),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},e}(i),u=function(t){return t<<24|(65280&t)<<8|(16711680&t)>>8|t>>>24},l=function(){function t(e,r,n,i){var o=t.STEP,a=new Int32Array(e.buffer),l=new Uint8Array(e.byteLength),c=0;for(this.asyncStream_=new s,this.asyncStream_.push(this.decryptChunk_(a.subarray(c,c+o),r,n,l)),c=o;c<a.length;c+=o)n=new Uint32Array([u(a[c-4]),u(a[c-3]),u(a[c-2]),u(a[c-1])]),this.asyncStream_.push(this.decryptChunk_(a.subarray(c,c+o),r,n,l));this.asyncStream_.push((function(){var t;i(null,(t=l).subarray(0,t.byteLength-t[t.byteLength-1]))}))}return t.prototype.decryptChunk_=function(t,e,r,n){return function(){var i=function(t,e,r){var n,i,o,s,l,c,f,h,p,d=new Int32Array(t.buffer,t.byteOffset,t.byteLength>>2),y=new a(Array.prototype.slice.call(e)),m=new Uint8Array(t.byteLength),v=new Int32Array(m.buffer);for(n=r[0],i=r[1],o=r[2],s=r[3],p=0;p<d.length;p+=4)l=u(d[p]),c=u(d[p+1]),f=u(d[p+2]),h=u(d[p+3]),y.decrypt(l,c,f,h,v,p),v[p]=u(v[p]^n),v[p+1]=u(v[p+1]^i),v[p+2]=u(v[p+2]^o),v[p+3]=u(v[p+3]^s),n=l,i=c,o=f,s=h;return m}(t,e,r);n.set(i,t.byteOffset)}},e(t,null,[{key:"STEP",get:function(){return 32e3}}]),t}();self.onmessage=function(t){var e=t.data,r=new Uint8Array(e.encrypted.bytes,e.encrypted.byteOffset,e.encrypted.byteLength),n=new Uint32Array(e.key.bytes,e.key.byteOffset,e.key.byteLength/4),i=new Uint32Array(e.iv.bytes,e.iv.byteOffset,e.iv.byteLength/4);new l(r,n,i,(function(t,r){var n,i;self.postMessage((n={source:e.source,decrypted:r},i={},Object.keys(n).forEach((function(t){var e=n[t];ArrayBuffer.isView(e)?i[t]={bytes:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength}:i[t]=e})),i),[r.buffer])}))}}))),zu=As(qu),Wu=function(t){var e=t.default?"main":"alternative";return t.characteristics&&t.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},Gu=function(t,e){t.abort(),t.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},Xu=function(t,e){e.activePlaylistLoader=t,t.load()},Ku={AUDIO:function(t,e){return function(){var r=e.segmentLoaders[t],n=e.mediaTypes[t],i=e.blacklistCurrentPlaylist;Gu(r,n);var o=n.activeTrack(),a=n.activeGroup(),s=(a.filter((function(t){return t.default}))[0]||a[0]).id,u=n.tracks[s];if(o!==u){for(var l in _a.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),n.tracks)n.tracks[l].enabled=n.tracks[l]===u;n.onTrackChanged()}else i({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(t,e){return function(){var r=e.segmentLoaders[t],n=e.mediaTypes[t];_a.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Gu(r,n);var i=n.activeTrack();i&&(i.mode="disabled"),n.onTrackChanged()}}},Yu={AUDIO:function(t,e,r){if(e){var n=r.tech,i=r.requestOptions,o=r.segmentLoaders[t];e.on("loadedmetadata",(function(){var t=e.media();o.playlist(t,i),(!n.paused()||t.endList&&"none"!==n.preload())&&o.load()})),e.on("loadedplaylist",(function(){o.playlist(e.media(),i),n.paused()||o.load()})),e.on("error",Ku[t](t,r))}},SUBTITLES:function(t,e,r){var n=r.tech,i=r.requestOptions,o=r.segmentLoaders[t],a=r.mediaTypes[t];e.on("loadedmetadata",(function(){var t=e.media();o.playlist(t,i),o.track(a.activeTrack()),(!n.paused()||t.endList&&"none"!==n.preload())&&o.load()})),e.on("loadedplaylist",(function(){o.playlist(e.media(),i),n.paused()||o.load()})),e.on("error",Ku[t](t,r))}},Qu={AUDIO:function(t,e){var r=e.vhs,n=e.sourceType,i=e.segmentLoaders[t],o=e.requestOptions,a=e.master.mediaGroups,s=e.mediaTypes[t],u=s.groups,l=s.tracks,c=s.logger_,f=e.masterPlaylistLoader,h=us(f.master);for(var p in a[t]&&0!==Object.keys(a[t]).length||(a[t]={main:{default:{default:!0}}}),a[t])for(var d in u[p]||(u[p]=[]),a[t][p]){var y=a[t][p][d],m=void 0;if(h?(c("AUDIO group '"+p+"' label '"+d+"' is a master playlist"),y.isMasterPlaylist=!0,m=null):m="vhs-json"===n&&y.playlists?new Fa(y.playlists[0],r,o):y.resolvedUri?new Fa(y.resolvedUri,r,o):y.playlists&&"dash"===n?new js(y.playlists[0],r,o,f):null,y=_a.mergeOptions({id:d,playlistLoader:m},y),Yu[t](t,y.playlistLoader,e),u[p].push(y),void 0===l[d]){var v=new _a.AudioTrack({id:d,kind:Wu(y),enabled:!1,language:y.language,default:y.default,label:d});l[d]=v}}i.on("error",Ku[t](t,e))},SUBTITLES:function(t,e){var r=e.tech,n=e.vhs,i=e.sourceType,o=e.segmentLoaders[t],a=e.requestOptions,s=e.master.mediaGroups,u=e.mediaTypes[t],l=u.groups,c=u.tracks,f=e.masterPlaylistLoader;for(var h in s[t])for(var p in l[h]||(l[h]=[]),s[t][h])if(!s[t][h][p].forced){var d=s[t][h][p],y=void 0;if("hls"===i)y=new Fa(d.resolvedUri,n,a);else if("dash"===i){if(!d.playlists.filter((function(t){return t.excludeUntil!==1/0})).length)return;y=new js(d.playlists[0],n,a,f)}else"vhs-json"===i&&(y=new Fa(d.playlists?d.playlists[0]:d.resolvedUri,n,a));if(d=_a.mergeOptions({id:p,playlistLoader:y},d),Yu[t](t,d.playlistLoader,e),l[h].push(d),void 0===c[p]){var m=r.addRemoteTextTrack({id:p,kind:"subtitles",default:d.default&&d.autoselect,language:d.language,label:p},!1).track;c[p]=m}}o.on("error",Ku[t](t,e))},"CLOSED-CAPTIONS":function(t,e){var r=e.tech,n=e.master.mediaGroups,i=e.mediaTypes[t],o=i.groups,a=i.tracks;for(var s in n[t])for(var u in o[s]||(o[s]=[]),n[t][s]){var l=n[t][s][u];if(l.instreamId.match(/CC\d/)&&(o[s].push(_a.mergeOptions({id:u},l)),void 0===a[u])){var c=r.addRemoteTextTrack({id:l.instreamId,kind:"captions",default:l.default&&l.autoselect,language:l.language,label:u},!1).track;a[u]=c}}}},$u=function t(e,r){for(var n=0;n<e.length;n++){if(as(r,e[n]))return!0;if(e[n].playlists&&t(e[n].playlists,r))return!0}return!1},Ju={AUDIO:function(t,e){return function(){var r=e.mediaTypes[t].tracks;for(var n in r)if(r[n].enabled)return r[n];return null}},SUBTITLES:function(t,e){return function(){var r=e.mediaTypes[t].tracks;for(var n in r)if("showing"===r[n].mode||"hidden"===r[n].mode)return r[n];return null}}},Zu=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred"],tl=function(t){return this.audioSegmentLoader_[t]+this.mainSegmentLoader_[t]},el=function(t){function r(r){var n;n=t.call(this)||this;var i=r.src,o=r.handleManifestRedirects,a=r.withCredentials,u=r.tech,l=r.bandwidth,c=r.externVhs,f=r.useCueTags,h=r.blacklistDuration,p=r.enableLowInitialPlaylist,d=r.sourceType,y=r.cacheEncryptionKeys,m=r.experimentalBufferBasedABR;if(!i)throw new Error("A non-empty playlist URL or JSON manifest string is required");vu=c,n.experimentalBufferBasedABR=Boolean(m),n.withCredentials=a,n.tech_=u,n.vhs_=u.vhs,n.sourceType_=d,n.useCueTags_=f,n.blacklistDuration=h,n.enableLowInitialPlaylist=p,n.useCueTags_&&(n.cueTagsTrack_=n.tech_.addTextTrack("metadata","ad-cues"),n.cueTagsTrack_.inBandMetadataTrackDispatchType=""),n.requestOptions_={withCredentials:a,handleManifestRedirects:o,timeout:null},n.on("error",n.pauseLoading),n.mediaTypes_=function(){var t={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((function(e){t[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:mu,activeTrack:mu,getActiveGroup:mu,onGroupChanged:mu,onTrackChanged:mu,lastTrack_:null,logger_:Oa("MediaGroups["+e+"]")}})),t}(),n.mediaSource=new(e().MediaSource),n.handleDurationChange_=n.handleDurationChange_.bind(s(n)),n.handleSourceOpen_=n.handleSourceOpen_.bind(s(n)),n.handleSourceEnded_=n.handleSourceEnded_.bind(s(n)),n.mediaSource.addEventListener("durationchange",n.handleDurationChange_),n.mediaSource.addEventListener("sourceopen",n.handleSourceOpen_),n.mediaSource.addEventListener("sourceended",n.handleSourceEnded_),n.seekable_=_a.createTimeRanges(),n.hasPlayed_=!1,n.syncController_=new Vu(r),n.segmentMetadataTrack_=u.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,n.decrypter_=new zu,n.sourceUpdater_=new Ru(n.mediaSource),n.inbandTextTracks_={},n.timelineChangeController_=new Hu;var v={vhs:n.vhs_,parse708captions:r.parse708captions,mediaSource:n.mediaSource,currentTime:n.tech_.currentTime.bind(n.tech_),seekable:function(){return n.seekable()},seeking:function(){return n.tech_.seeking()},duration:function(){return n.duration()},hasPlayed:function(){return n.hasPlayed_},goalBufferLength:function(){return n.goalBufferLength()},bandwidth:l,syncController:n.syncController_,decrypter:n.decrypter_,sourceType:n.sourceType_,inbandTextTracks:n.inbandTextTracks_,cacheEncryptionKeys:y,sourceUpdater:n.sourceUpdater_,timelineChangeController:n.timelineChangeController_};return n.masterPlaylistLoader_="dash"===n.sourceType_?new js(i,n.vhs_,n.requestOptions_):new Fa(i,n.vhs_,n.requestOptions_),n.setupMasterPlaylistLoaderListeners_(),n.mainSegmentLoader_=new yu(_a.mergeOptions(v,{segmentMetadataTrack:n.segmentMetadataTrack_,loaderType:"main"}),r),n.audioSegmentLoader_=new yu(_a.mergeOptions(v,{loaderType:"audio"}),r),n.subtitleSegmentLoader_=new Nu(_a.mergeOptions(v,{loaderType:"vtt",featuresNativeTextTracks:n.tech_.featuresNativeTextTracks}),r),n.setupSegmentLoaderListeners_(),n.experimentalBufferBasedABR&&(n.masterPlaylistLoader_.one("loadedplaylist",(function(){return n.startABRTimer_()})),n.tech_.on("pause",(function(){return n.stopABRTimer_()})),n.tech_.on("play",(function(){return n.startABRTimer_()}))),Zu.forEach((function(t){n[t+"_"]=tl.bind(s(n),t)})),n.logger_=Oa("MPC"),n.triggeredFmp4Usage=!1,"none"===n.tech_.preload()?(n.loadOnPlay_=function(){n.loadOnPlay_=null,n.masterPlaylistLoader_.load()},n.tech_.one("play",n.loadOnPlay_)):n.masterPlaylistLoader_.load(),n}l(r,t);var n=r.prototype;return n.checkABR_=function(){var t=this.selectPlaylist();this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,"abr")},n.switchMedia_=function(t,e,r){var n=this.media(),i=n&&(n.id||n.uri),o=t.id||t.uri;i&&i!==o&&(this.logger_("switch media "+i+" -> "+o+" from "+e),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+e})),this.masterPlaylistLoader_.media(t,r)},n.startABRTimer_=function(){var t=this;this.stopABRTimer_(),this.abrTimer_=e().setInterval((function(){return t.checkABR_()}),250)},n.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(e().clearInterval(this.abrTimer_),this.abrTimer_=null)},n.getAudioTrackPlaylists_=function(){var t=this.master();if(!t||!t.mediaGroups||!t.mediaGroups.AUDIO)return t&&t.playlists||[];var e,r=t.mediaGroups.AUDIO,n=Object.keys(r);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)e=this.mediaTypes_.AUDIO.activeTrack();else{var i=r.main||n.length&&r[n[0]];for(var o in i)if(i[o].default){e={label:o};break}}if(!e)return[];var a=[];for(var s in r)if(r[s][e.label]){var u=r[s][e.label];u.playlists?a.push.apply(a,u.playlists):a.push(u)}return a},n.setupMasterPlaylistLoaderListeners_=function(){var t=this;this.masterPlaylistLoader_.on("loadedmetadata",(function(){var e=t.masterPlaylistLoader_.media(),r=1.5*e.targetDuration*1e3;os(t.masterPlaylistLoader_.master,t.masterPlaylistLoader_.media())?t.requestOptions_.timeout=0:t.requestOptions_.timeout=r,e.endList&&"none"!==t.tech_.preload()&&(t.mainSegmentLoader_.playlist(e,t.requestOptions_),t.mainSegmentLoader_.load()),function(t){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((function(e){Qu[e](e,t)}));var e=t.mediaTypes,r=t.masterPlaylistLoader,n=t.tech,i=t.vhs,o=t.segmentLoaders,a=o.AUDIO,s=o.main;["AUDIO","SUBTITLES"].forEach((function(r){e[r].activeGroup=function(t,e){return function(r){var n=e.masterPlaylistLoader,i=e.mediaTypes[t].groups,o=n.media();if(!o)return null;var a=null;o.attributes[t]&&(a=i[o.attributes[t]]);var s=Object.keys(i);if(!a)if("AUDIO"===t&&s.length>1&&us(e.master))for(var u=0;u<s.length;u++){var l=i[s[u]];if($u(l,o)){a=l;break}}else i.main?a=i.main:1===s.length&&(a=i[s[0]]);return void 0===r?a:null!==r&&a&&a.filter((function(t){return t.id===r.id}))[0]||null}}(r,t),e[r].activeTrack=Ju[r](r,t),e[r].onGroupChanged=function(t,e){return function(){var r=e.segmentLoaders,n=r[t],i=r.main,o=e.mediaTypes[t],a=o.activeTrack(),s=o.getActiveGroup(),u=o.activePlaylistLoader,l=o.lastGroup_;s&&l&&s.id===l.id||(o.lastGroup_=s,o.lastTrack_=a,Gu(n,o),s&&!s.isMasterPlaylist&&(s.playlistLoader?(n.resyncLoader(),Xu(s.playlistLoader,o)):u&&i.resetEverything()))}}(r,t),e[r].onGroupChanging=function(t,e){return function(){var r=e.segmentLoaders[t];e.mediaTypes[t].lastGroup_=null,r.abort(),r.pause()}}(r,t),e[r].onTrackChanged=function(t,e){return function(){var r=e.masterPlaylistLoader,n=e.segmentLoaders,i=n[t],o=n.main,a=e.mediaTypes[t],s=a.activeTrack(),u=a.getActiveGroup(),l=a.activePlaylistLoader,c=a.lastTrack_;if((!c||!s||c.id!==s.id)&&(a.lastGroup_=u,a.lastTrack_=s,Gu(i,a),u)){if(u.isMasterPlaylist){if(!s||!c||s.id===c.id)return;var f=e.vhs.masterPlaylistController_,h=f.selectPlaylist();if(f.media()===h)return;return a.logger_("track change. Switching master audio from "+c.id+" to "+s.id),r.pause(),o.resetEverything(),void f.fastQualityChange_(h)}if("AUDIO"===t){if(!u.playlistLoader)return o.setAudio(!0),void o.resetEverything();i.setAudio(!0),o.setAudio(!1)}l!==u.playlistLoader?(i.track&&i.track(s),i.resetEverything(),Xu(u.playlistLoader,a)):Xu(u.playlistLoader,a)}}}(r,t),e[r].getActiveGroup=function(t,e){var r=e.mediaTypes;return function(){var e=r[t].activeTrack();return e?r[t].activeGroup(e):null}}(r,t)}));var u=e.AUDIO.activeGroup();if(u){var l=(u.filter((function(t){return t.default}))[0]||u[0]).id;e.AUDIO.tracks[l].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(s.setAudio(!1),a.setAudio(!0)):s.setAudio(!0)}r.on("mediachange",(function(){["AUDIO","SUBTITLES"].forEach((function(t){return e[t].onGroupChanged()}))})),r.on("mediachanging",(function(){["AUDIO","SUBTITLES"].forEach((function(t){return e[t].onGroupChanging()}))}));var c=function(){e.AUDIO.onTrackChanged(),n.trigger({type:"usage",name:"vhs-audio-change"}),n.trigger({type:"usage",name:"hls-audio-change"})};for(var f in n.audioTracks().addEventListener("change",c),n.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),i.on("dispose",(function(){n.audioTracks().removeEventListener("change",c),n.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)})),n.clearTracks("audio"),e.AUDIO.tracks)n.audioTracks().addTrack(e.AUDIO.tracks[f])}({sourceType:t.sourceType_,segmentLoaders:{AUDIO:t.audioSegmentLoader_,SUBTITLES:t.subtitleSegmentLoader_,main:t.mainSegmentLoader_},tech:t.tech_,requestOptions:t.requestOptions_,masterPlaylistLoader:t.masterPlaylistLoader_,vhs:t.vhs_,master:t.master(),mediaTypes:t.mediaTypes_,blacklistCurrentPlaylist:t.blacklistCurrentPlaylist.bind(t)}),t.triggerPresenceUsage_(t.master(),e),t.setupFirstPlay(),!t.mediaTypes_.AUDIO.activePlaylistLoader||t.mediaTypes_.AUDIO.activePlaylistLoader.media()?t.trigger("selectedinitialmedia"):t.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",(function(){t.trigger("selectedinitialmedia")}))})),this.masterPlaylistLoader_.on("loadedplaylist",(function(){t.loadOnPlay_&&t.tech_.off("play",t.loadOnPlay_);var e=t.masterPlaylistLoader_.media();if(!e){var r;if(t.excludeUnsupportedVariants_(),t.enableLowInitialPlaylist&&(r=t.selectInitialPlaylist()),r||(r=t.selectPlaylist()),!r||!t.shouldSwitchToMedia_(r))return;if(t.initialMedia_=r,t.switchMedia_(t.initialMedia_,"initial"),"vhs-json"!==t.sourceType_||!t.initialMedia_.segments)return;e=t.initialMedia_}t.handleUpdatedMediaPlaylist(e)})),this.masterPlaylistLoader_.on("error",(function(){t.blacklistCurrentPlaylist(t.masterPlaylistLoader_.error)})),this.masterPlaylistLoader_.on("mediachanging",(function(){t.mainSegmentLoader_.abort(),t.mainSegmentLoader_.pause()})),this.masterPlaylistLoader_.on("mediachange",(function(){var e=t.masterPlaylistLoader_.media(),r=1.5*e.targetDuration*1e3;os(t.masterPlaylistLoader_.master,t.masterPlaylistLoader_.media())?t.requestOptions_.timeout=0:t.requestOptions_.timeout=r,t.mainSegmentLoader_.playlist(e,t.requestOptions_),t.mainSegmentLoader_.load(),t.tech_.trigger({type:"mediachange",bubbles:!0})})),this.masterPlaylistLoader_.on("playlistunchanged",(function(){var e=t.masterPlaylistLoader_.media();"playlist-unchanged"!==e.lastExcludeReason_&&t.stuckAtPlaylistEnd_(e)&&(t.blacklistCurrentPlaylist({message:"Playlist no longer updating.",reason:"playlist-unchanged"}),t.tech_.trigger("playliststuck"))})),this.masterPlaylistLoader_.on("renditiondisabled",(function(){t.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"}),t.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})})),this.masterPlaylistLoader_.on("renditionenabled",(function(){t.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"}),t.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})}))},n.handleUpdatedMediaPlaylist=function(t){this.useCueTags_&&this.updateAdCues_(t),this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.updateDuration(!t.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())},n.triggerPresenceUsage_=function(t,e){var r=t.mediaGroups||{},n=!0,i=Object.keys(r.AUDIO);for(var o in r.AUDIO)for(var a in r.AUDIO[o])r.AUDIO[o][a].uri||(n=!1);n&&(this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),this.tech_.trigger({type:"usage",name:"hls-demuxed"})),Object.keys(r.SUBTITLES).length&&(this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),this.tech_.trigger({type:"usage",name:"hls-webvtt"})),vu.Playlist.isAes(e)&&(this.tech_.trigger({type:"usage",name:"vhs-aes"}),this.tech_.trigger({type:"usage",name:"hls-aes"})),i.length&&Object.keys(r.AUDIO[i[0]]).length>1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},n.shouldSwitchToMedia_=function(t){var e=this.masterPlaylistLoader_.media(),r=this.tech_.buffered();return function(t){var e=t.currentPlaylist,r=t.nextPlaylist,n=t.forwardBuffer,i=t.bufferLowWaterLine,o=t.bufferHighWaterLine,a=t.duration,s=t.experimentalBufferBasedABR,u=t.log;if(!r)return _a.log.warn("We received no playlist to switch to. Please check your stream."),!1;var l="allowing switch "+(e&&e.id||"null")+" -> "+r.id;if(!e||!e.endList)return u(l+" as current playlist "+(e?"is live":"is not set")),!0;if(r.id===e.id)return!1;var c=s?Ls.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Ls.MAX_BUFFER_LOW_WATER_LINE;if(a<c)return u(l+" as duration < max low water line ("+a+" < "+c+")"),!0;var f=r.attributes.BANDWIDTH,h=e.attributes.BANDWIDTH;if(f<h&&(!s||n<o)){var p=l+" as next bandwidth < current bandwidth ("+f+" < "+h+")";return s&&(p+=" and forwardBuffer < bufferHighWaterLine ("+n+" < "+o+")"),u(p),!0}if((!s||f>h)&&n>=i){var d=l+" as forwardBuffer >= bufferLowWaterLine ("+n+" >= "+i+")";return s&&(d+=" and next bandwidth > current bandwidth ("+f+" > "+h+")"),u(d),!0}return u("not "+l+" as no switching criteria met"),!1}({currentPlaylist:e,nextPlaylist:t,forwardBuffer:r.length?r.end(r.length-1)-this.tech_.currentTime():0,bufferLowWaterLine:this.bufferLowWaterLine(),bufferHighWaterLine:this.bufferHighWaterLine(),duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},n.setupSegmentLoaderListeners_=function(){var t=this;this.experimentalBufferBasedABR||(this.mainSegmentLoader_.on("bandwidthupdate",(function(){var e=t.selectPlaylist();t.shouldSwitchToMedia_(e)&&t.switchMedia_(e,"bandwidthupdate"),t.tech_.trigger("bandwidthupdate")})),this.mainSegmentLoader_.on("progress",(function(){t.trigger("progress")}))),this.mainSegmentLoader_.on("error",(function(){t.blacklistCurrentPlaylist(t.mainSegmentLoader_.error())})),this.mainSegmentLoader_.on("appenderror",(function(){t.error=t.mainSegmentLoader_.error_,t.trigger("error")})),this.mainSegmentLoader_.on("syncinfoupdate",(function(){t.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("timestampoffset",(function(){t.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),t.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})})),this.audioSegmentLoader_.on("syncinfoupdate",(function(){t.onSyncInfoUpdate_()})),this.audioSegmentLoader_.on("appenderror",(function(){t.error=t.audioSegmentLoader_.error_,t.trigger("error")})),this.mainSegmentLoader_.on("ended",(function(){t.logger_("main segment loader ended"),t.onEndOfStream()})),this.mainSegmentLoader_.on("earlyabort",(function(e){t.experimentalBufferBasedABR||(t.delegateLoaders_("all",["abort"]),t.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120))}));var e=function(){if(!t.sourceUpdater_.hasCreatedSourceBuffers())return t.tryToCreateSourceBuffers_();var e=t.getCodecsOrExclude_();e&&t.sourceUpdater_.addOrChangeSourceBuffers(e)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",(function(){t.triggeredFmp4Usage||(t.tech_.trigger({type:"usage",name:"vhs-fmp4"}),t.tech_.trigger({type:"usage",name:"hls-fmp4"}),t.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("fmp4",(function(){t.triggeredFmp4Usage||(t.tech_.trigger({type:"usage",name:"vhs-fmp4"}),t.tech_.trigger({type:"usage",name:"hls-fmp4"}),t.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("ended",(function(){t.logger_("audioSegmentLoader ended"),t.onEndOfStream()}))},n.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},n.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},n.smoothQualityChange_=function(t){void 0===t&&(t=this.selectPlaylist()),t!==this.masterPlaylistLoader_.media()&&(this.switchMedia_(t,"smooth-quality"),this.mainSegmentLoader_.resetLoader())},n.fastQualityChange_=function(t){var e=this;void 0===t&&(t=this.selectPlaylist()),t!==this.masterPlaylistLoader_.media()?(this.switchMedia_(t,"fast-quality"),this.mainSegmentLoader_.resetEverything((function(){_a.browser.IE_VERSION||_a.browser.IS_EDGE?e.tech_.setCurrentTime(e.tech_.currentTime()+.04):e.tech_.setCurrentTime(e.tech_.currentTime())}))):this.logger_("skipping fastQualityChange because new media is same as old")},n.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var t=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<t.start(0)?this.tech_.setCurrentTime(t.end(t.length-1)):void 0}},n.setupFirstPlay=function(){var t=this,e=this.masterPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList){var r=this.seekable();if(!r.length)return!1;if(_a.browser.IE_VERSION&&0===this.tech_.readyState())return this.tech_.one("loadedmetadata",(function(){t.trigger("firstplay"),t.tech_.setCurrentTime(r.end(0)),t.hasPlayed_=!0})),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(r.end(0))}return this.hasPlayed_=!0,this.load(),!0},n.handleSourceOpen_=function(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){var t=this.tech_.play();void 0!==t&&"function"==typeof t.then&&t.then(null,(function(t){}))}this.trigger("sourceopen")},n.handleSourceEnded_=function(){if(this.inbandTextTracks_.metadataTrack_){var t=this.inbandTextTracks_.metadataTrack_.cues;if(t&&t.length){var e=this.duration();t[t.length-1].endTime=isNaN(e)||Math.abs(e)===1/0?Number.MAX_VALUE:e}}},n.handleDurationChange_=function(){this.tech_.trigger("durationchange")},n.onEndOfStream=function(){var t=this.mainSegmentLoader_.ended_;this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=!this.mainSegmentLoader_.currentMediaInfo_||this.mainSegmentLoader_.currentMediaInfo_.hasVideo?t&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_),t&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())},n.stuckAtPlaylistEnd_=function(t){if(!this.seekable().length)return!1;var e=this.syncController_.getExpiredTime(t,this.duration());if(null===e)return!1;var r=vu.Playlist.playlistEnd(t,e),n=this.tech_.currentTime(),i=this.tech_.buffered();if(!i.length)return r-n<=Ha;var o=i.end(i.length-1);return o-n<=Ha&&r-o<=Ha},n.blacklistCurrentPlaylist=function(t,e){void 0===t&&(t={});var r=t.playlist||this.masterPlaylistLoader_.media();if(e=e||t.blacklistDuration||this.blacklistDuration,!r)return this.error=t,void("open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));var n=this.masterPlaylistLoader_.master.playlists,i=n.filter(ns),o=1===i.length&&i[0]===r;if(1===n.length&&e!==1/0)return _a.log.warn("Problem encountered with playlist "+r.id+". Trying again since it is the only playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(o);if(o){var a=!1;n.forEach((function(t){if(t!==r){var e=t.excludeUntil;void 0!==e&&e!==1/0&&(a=!0,delete t.excludeUntil)}})),a&&(_a.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}r.excludeUntil=Date.now()+1e3*e,t.reason&&(r.lastExcludeReason_=t.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var s=this.selectPlaylist();if(!s)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");var u=t.internal?this.logger_:_a.log.warn,l=t.message?" "+t.message:"";u((t.internal?"Internal problem":"Problem")+" encountered with playlist "+r.id+"."+l+" Switching to playlist "+s.id+"."),s.attributes.AUDIO!==r.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),s.attributes.SUBTITLES!==r.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var c=s.targetDuration/2*1e3||5e3,f="number"==typeof s.lastRequest&&Date.now()-s.lastRequest<=c;return this.switchMedia_(s,"exclude",o||f)},n.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},n.delegateLoaders_=function(t,e){var r=this,n=[],i="all"===t;(i||"main"===t)&&n.push(this.masterPlaylistLoader_);var o=[];(i||"audio"===t)&&o.push("AUDIO"),(i||"subtitle"===t)&&(o.push("CLOSED-CAPTIONS"),o.push("SUBTITLES")),o.forEach((function(t){var e=r.mediaTypes_[t]&&r.mediaTypes_[t].activePlaylistLoader;e&&n.push(e)})),["main","audio","subtitle"].forEach((function(e){var i=r[e+"SegmentLoader_"];!i||t!==e&&"all"!==t||n.push(i)})),n.forEach((function(t){return e.forEach((function(e){"function"==typeof t[e]&&t[e]()}))}))},n.setCurrentTime=function(t){var e=za(this.tech_.buffered(),t);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?e&&e.length?t:(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},n.duration=function(){if(!this.masterPlaylistLoader_)return 0;var t=this.masterPlaylistLoader_.media();return t?t.endList?this.mediaSource?this.mediaSource.duration:vu.Playlist.duration(t):1/0:0},n.seekable=function(){return this.seekable_},n.onSyncInfoUpdate_=function(){var t;if(this.masterPlaylistLoader_){var e=this.masterPlaylistLoader_.media();if(e){var r=this.syncController_.getExpiredTime(e,this.duration());if(null!==r){var n=this.masterPlaylistLoader_.master,i=vu.Playlist.seekable(e,r,vu.Playlist.liveEdgeDelay(n,e));if(0!==i.length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(e=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(r=this.syncController_.getExpiredTime(e,this.duration())))return;if(0===(t=vu.Playlist.seekable(e,r,vu.Playlist.liveEdgeDelay(n,e))).length)return}var o,a;this.seekable_&&this.seekable_.length&&(o=this.seekable_.end(0),a=this.seekable_.start(0)),t?t.start(0)>i.end(0)||i.start(0)>t.end(0)?this.seekable_=i:this.seekable_=_a.createTimeRanges([[t.start(0)>i.start(0)?t.start(0):i.start(0),t.end(0)<i.end(0)?t.end(0):i.end(0)]]):this.seekable_=i,this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===o&&this.seekable_.start(0)===a||(this.logger_("seekable updated ["+Ga(this.seekable_)+"]"),this.tech_.trigger("seekablechanged"))}}}}},n.updateDuration=function(t){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),"open"!==this.mediaSource.readyState)return this.updateDuration_=this.updateDuration.bind(this,t),void this.mediaSource.addEventListener("sourceopen",this.updateDuration_);if(t){var e=this.seekable();if(!e.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<e.end(e.length-1))&&this.sourceUpdater_.setDuration(e.end(e.length-1))}else{var r=this.tech_.buffered(),n=vu.Playlist.duration(this.masterPlaylistLoader_.media());r.length>0&&(n=Math.max(n,r.end(r.length-1))),this.mediaSource.duration!==n&&this.sourceUpdater_.setDuration(n)}},n.dispose=function(){var t=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach((function(e){var r=t.mediaTypes_[e].groups;for(var n in r)r[n].forEach((function(t){t.playlistLoader&&t.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()},n.master=function(){return this.masterPlaylistLoader_.master},n.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},n.areMediaTypesKnown_=function(){var t=!!this.mediaTypes_.AUDIO.activePlaylistLoader;return!(!this.mainSegmentLoader_.currentMediaInfo_||t&&!this.audioSegmentLoader_.currentMediaInfo_)},n.getCodecsOrExclude_=function(){var t=this,e={main:this.mainSegmentLoader_.currentMediaInfo_||{},audio:this.audioSegmentLoader_.currentMediaInfo_||{}};e.video=e.main;var r=tu(this.master(),this.media()),n={},i=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(n.video=r.video||e.main.videoCodec||"avc1.4d400d"),e.main.isMuxed&&(n.video+=","+(r.audio||e.main.audioCodec||H)),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||i)&&(n.audio=r.audio||e.main.audioCodec||e.audio.audioCodec||H,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),n.audio||n.video){var o,a={};if(["video","audio"].forEach((function(t){if(n.hasOwnProperty(t)&&(i=e[t].isFmp4,s=n[t],!(i?F(s):V(s)))){var r=e[t].isFmp4?"browser":"muxer";a[r]=a[r]||[],a[r].push(n[t]),"audio"===t&&(o=r)}var i,s})),i&&o&&this.media().attributes.AUDIO){var s=this.media().attributes.AUDIO;this.master().playlists.forEach((function(e){(e.attributes&&e.attributes.AUDIO)===s&&e!==t.media()&&(e.excludeUntil=1/0)})),this.logger_("excluding audio group "+s+" as "+o+' does not support codec(s): "'+n.audio+'"')}if(!Object.keys(a).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var u=[];if(["video","audio"].forEach((function(e){var r=(N(t.sourceUpdater_.codecs[e]||"")[0]||{}).type,i=(N(n[e]||"")[0]||{}).type;r&&i&&r.toLowerCase()!==i.toLowerCase()&&u.push('"'+t.sourceUpdater_.codecs[e]+'" -> "'+n[e]+'"')})),u.length)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+u.join(", ")+".",blacklistDuration:1/0,internal:!0})}return n}var l=Object.keys(a).reduce((function(t,e){return t&&(t+=", "),t+(e+' does not support codec(s): "')+a[e].join(",")+'"'}),"")+".";this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:l,blacklistDuration:1/0})}else this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0})},n.tryToCreateSourceBuffers_=function(){if("open"===this.mediaSource.readyState&&!this.sourceUpdater_.hasCreatedSourceBuffers()&&this.areMediaTypesKnown_()){var t=this.getCodecsOrExclude_();if(t){this.sourceUpdater_.createSourceBuffers(t);var e=[t.video,t.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(e)}}},n.excludeUnsupportedVariants_=function(){var t=this,e=this.master().playlists,r=[];Object.keys(e).forEach((function(n){var i=e[n];if(-1===r.indexOf(i.id)){r.push(i.id);var o=tu(t.master,i),a=[];!o.audio||V(o.audio)||F(o.audio)||a.push("audio codec "+o.audio),!o.video||V(o.video)||F(o.video)||a.push("video codec "+o.video),o.text&&"stpp.ttml.im1t"===o.text&&a.push("text codec "+o.text),a.length&&(i.excludeUntil=1/0,t.logger_("excluding "+i.id+" for unsupported: "+a.join(", ")))}}))},n.excludeIncompatibleVariants_=function(t){var e=this,r=[],n=this.master().playlists,i=Js(N(t)),o=Zs(i),a=i.video&&N(i.video)[0]||null,s=i.audio&&N(i.audio)[0]||null;Object.keys(n).forEach((function(t){var i=n[t];if(-1===r.indexOf(i.id)&&i.excludeUntil!==1/0){r.push(i.id);var u=[],l=tu(e.masterPlaylistLoader_.master,i),c=Zs(l);if(l.audio||l.video){if(c!==o&&u.push('codec count "'+c+'" !== "'+o+'"'),!e.sourceUpdater_.canChangeType()){var f=l.video&&N(l.video)[0]||null,h=l.audio&&N(l.audio)[0]||null;f&&a&&f.type.toLowerCase()!==a.type.toLowerCase()&&u.push('video codec "'+f.type+'" !== "'+a.type+'"'),h&&s&&h.type.toLowerCase()!==s.type.toLowerCase()&&u.push('audio codec "'+h.type+'" !== "'+s.type+'"')}u.length&&(i.excludeUntil=1/0,e.logger_("blacklisting "+i.id+": "+u.join(" && ")))}}}))},n.updateAdCues_=function(t){var r=0,n=this.seekable();n.length&&(r=n.start(0)),function(t,r,n){if(void 0===n&&(n=0),t.segments)for(var i,o=n,a=0;a<t.segments.length;a++){var s=t.segments[a];if(i||(i=Bu(r,o+s.duration/2)),i){if("cueIn"in s){i.endTime=o,i.adEndTime=o,o+=s.duration,i=null;continue}if(o<i.endTime){o+=s.duration;continue}i.endTime+=s.duration}else if("cueOut"in s&&((i=new(e().VTTCue)(o,o+s.duration,s.cueOut)).adStartTime=o,i.adEndTime=o+parseFloat(s.cueOut),r.addCue(i)),"cueOutCont"in s){var u=s.cueOutCont.split("/").map(parseFloat),l=u[0],c=u[1];(i=new(e().VTTCue)(o,o+s.duration,"")).adStartTime=o-l,i.adEndTime=i.adStartTime+c,r.addCue(i)}o+=s.duration}}(t,this.cueTagsTrack_,r)},n.goalBufferLength=function(){var t=this.tech_.currentTime(),e=Ls.GOAL_BUFFER_LENGTH,r=Ls.GOAL_BUFFER_LENGTH_RATE,n=Math.max(e,Ls.MAX_GOAL_BUFFER_LENGTH);return Math.min(e+t*r,n)},n.bufferLowWaterLine=function(){var t=this.tech_.currentTime(),e=Ls.BUFFER_LOW_WATER_LINE,r=Ls.BUFFER_LOW_WATER_LINE_RATE,n=Math.max(e,Ls.MAX_BUFFER_LOW_WATER_LINE),i=Math.max(e,Ls.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(e+t*r,this.experimentalBufferBasedABR?i:n)},n.bufferHighWaterLine=function(){return Ls.BUFFER_HIGH_WATER_LINE},r}(_a.EventTarget),rl=function(t,e,r){var n,i,o,a=t.masterPlaylistController_,s=a[(t.options_.smoothQualityChange?"smooth":"fast")+"QualityChange_"].bind(a);if(e.attributes){var u=e.attributes.RESOLUTION;this.width=u&&u.width,this.height=u&&u.height,this.bandwidth=e.attributes.BANDWIDTH}this.codecs=tu(a.master(),e),this.playlist=e,this.id=r,this.enabled=(n=t.playlists,i=e.id,o=s,function(t){var e=n.master.playlists[i],r=rs(e),a=ns(e);return void 0===t?a:(t?delete e.disabled:e.disabled=!0,t===a||r||(o(),t?n.trigger("renditionenabled"):n.trigger("renditiondisabled")),t)})},nl=["seeking","seeked","pause","playing","error"],il=function(){function t(t){var r=this;this.masterPlaylistController_=t.masterPlaylistController,this.tech_=t.tech,this.seekable=t.seekable,this.allowSeeksWithinUnsafeLiveWindow=t.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=t.liveRangeSafeTimeDelta,this.media=t.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=Oa("PlaybackWatcher"),this.logger_("initialize");var n=function(){return r.monitorCurrentTime_()},i=function(){return r.monitorCurrentTime_()},o=function(){return r.techWaiting_()},a=function(){return r.cancelTimer_()},s=function(){return r.fixesBadSeeks_()},u=this.masterPlaylistController_,l=["main","subtitle","audio"],c={};l.forEach((function(t){c[t]={reset:function(){return r.resetSegmentDownloads_(t)},updateend:function(){return r.checkSegmentDownloads_(t)}},u[t+"SegmentLoader_"].on("appendsdone",c[t].updateend),u[t+"SegmentLoader_"].on("playlistupdate",c[t].reset),r.tech_.on(["seeked","seeking"],c[t].reset)})),this.tech_.on("seekablechanged",s),this.tech_.on("waiting",o),this.tech_.on(nl,a),this.tech_.on("canplay",i),this.tech_.one("play",n),this.dispose=function(){r.logger_("dispose"),r.tech_.off("seekablechanged",s),r.tech_.off("waiting",o),r.tech_.off(nl,a),r.tech_.off("canplay",i),r.tech_.off("play",n),l.forEach((function(t){u[t+"SegmentLoader_"].off("appendsdone",c[t].updateend),u[t+"SegmentLoader_"].off("playlistupdate",c[t].reset),r.tech_.off(["seeked","seeking"],c[t].reset)})),r.checkCurrentTimeTimeout_&&e().clearTimeout(r.checkCurrentTimeTimeout_),r.cancelTimer_()}}var r=t.prototype;return r.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&e().clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=e().setTimeout(this.monitorCurrentTime_.bind(this),250)},r.resetSegmentDownloads_=function(t){var e=this.masterPlaylistController_[t+"SegmentLoader_"];this[t+"StalledDownloads_"]>0&&this.logger_("resetting possible stalled download count for "+t+" loader"),this[t+"StalledDownloads_"]=0,this[t+"Buffered_"]=e.buffered_()},r.checkSegmentDownloads_=function(t){var e=this.masterPlaylistController_,r=e[t+"SegmentLoader_"],n=r.buffered_(),i=function(t,e){if(t===e)return!1;if(!t&&e||!e&&t)return!0;if(t.length!==e.length)return!0;for(var r=0;r<t.length;r++)if(t.start(r)!==e.start(r)||t.end(r)!==e.end(r))return!0;return!1}(this[t+"Buffered_"],n);this[t+"Buffered_"]=n,i?this.resetSegmentDownloads_(t):(this[t+"StalledDownloads_"]++,this.logger_("found #"+this[t+"StalledDownloads_"]+" "+t+" appends that did not increase buffer (possible stalled download)",{playlistId:r.playlist_&&r.playlist_.id,buffered:Xa(n)}),this[t+"StalledDownloads_"]<10||(this.logger_(t+" loader stalled download exclusion"),this.resetSegmentDownloads_(t),this.tech_.trigger({type:"usage",name:"vhs-"+t+"-download-exclusion"}),"subtitle"!==t&&e.blacklistCurrentPlaylist({message:"Excessive "+t+" segment downloading detected."},1/0)))},r.checkCurrentTime_=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 t=this.tech_.currentTime(),e=this.tech_.buffered();if(this.lastRecordedTime===t&&(!e.length||t+Ha>=e.end(e.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&t===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):t===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=t)}},r.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},r.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var t,e=this.seekable(),r=this.tech_.currentTime();if(this.afterSeekableWindow_(e,r,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(t=e.end(e.length-1)),this.beforeSeekableWindow_(e,r)){var n=e.start(0);t=n+(n===e.end(0)?0:Ha)}if(void 0!==t)return this.logger_("Trying to seek outside of seekable at time "+r+" with seekable range "+Ga(e)+". Seeking to "+t+"."),this.tech_.setCurrentTime(t),!0;var i=this.tech_.buffered();return!!function(t){var e=t.buffered,r=t.targetDuration,n=t.currentTime;return!(!e.length||e.end(0)-e.start(0)<2*r||n>e.start(0)||!(e.start(0)-n<r))}({buffered:i,targetDuration:this.media().targetDuration,currentTime:r})&&(t=i.start(0)+Ha,this.logger_("Buffered region starts ("+i.start(0)+") just beyond seek point ("+r+"). Seeking to "+t+"."),this.tech_.setCurrentTime(t),!0)},r.waiting_=function(){if(!this.techWaiting_()){var t=this.tech_.currentTime(),e=this.tech_.buffered(),r=za(e,t);return r.length&&t+3<=r.end(0)?(this.cancelTimer_(),this.tech_.setCurrentTime(t),this.logger_("Stopped at "+t+" while inside a buffered region ["+r.start(0)+" -> "+r.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0}},r.techWaiting_=function(){var t=this.seekable(),e=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_())return!0;if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(t,e)){var r=t.end(t.length-1);return this.logger_("Fell out of live window at time "+e+". Seeking to live point (seekable end) "+r),this.cancelTimer_(),this.tech_.setCurrentTime(r),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var n=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,i=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:n.audioBuffered(),videoBuffered:n.videoBuffered(),currentTime:e}))return this.cancelTimer_(),this.tech_.setCurrentTime(e),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var o=Wa(i,e);if(o.length>0){var a=o.start(0)-e;return this.logger_("Stopped at "+e+", setting timer for "+a+", seeking to "+o.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*a,e),!0}return!1},r.afterSeekableWindow_=function(t,e,r,n){if(void 0===n&&(n=!1),!t.length)return!1;var i=t.end(t.length-1)+Ha;return!r.endList&&n&&(i=t.end(t.length-1)+3*r.targetDuration),e>i},r.beforeSeekableWindow_=function(t,e){return!!(t.length&&t.start(0)>0&&e<t.start(0)-this.liveRangeSafeTimeDelta)},r.videoUnderflow_=function(t){var e=t.videoBuffered,r=t.audioBuffered,n=t.currentTime;if(e){var i;if(e.length&&r.length){var o=za(e,n-3),a=za(e,n),s=za(r,n);s.length&&!a.length&&o.length&&(i={start:o.end(0),end:s.end(0)})}else Wa(e,n).length||(i=this.gapFromVideoUnderflow_(e,n));return!!i&&(this.logger_("Encountered a gap in video from "+i.start+" to "+i.end+". Seeking to current time "+n),!0)}},r.skipTheGap_=function(t){var e=this.tech_.buffered(),r=this.tech_.currentTime(),n=Wa(e,r);this.cancelTimer_(),0!==n.length&&r===t&&(this.logger_("skipTheGap_:","currentTime:",r,"scheduled currentTime:",t,"nextRange start:",n.start(0)),this.tech_.setCurrentTime(n.start(0)+Va),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))},r.gapFromVideoUnderflow_=function(t,e){for(var r=function(t){if(t.length<2)return _a.createTimeRanges();for(var e=[],r=1;r<t.length;r++){var n=t.end(r-1),i=t.start(r);e.push([n,i])}return _a.createTimeRanges(e)}(t),n=0;n<r.length;n++){var i=r.start(n),o=r.end(n);if(e-i<4&&e-i>2)return{start:i,end:o}}return null},t}(),ol={errorInterval:30,getSource:function(t){return t(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},al=function t(e,r){var n=0,i=0,o=_a.mergeOptions(ol,r);e.ready((function(){e.trigger({type:"usage",name:"vhs-error-reload-initialized"}),e.trigger({type:"usage",name:"hls-error-reload-initialized"})}));var a=function(){i&&e.currentTime(i)},s=function(t){null!=t&&(i=e.duration()!==1/0&&e.currentTime()||0,e.one("loadedmetadata",a),e.src(t),e.trigger({type:"usage",name:"vhs-error-reload"}),e.trigger({type:"usage",name:"hls-error-reload"}),e.play())},u=function(){return Date.now()-n<1e3*o.errorInterval?(e.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void e.trigger({type:"usage",name:"hls-error-reload-canceled"})):o.getSource&&"function"==typeof o.getSource?(n=Date.now(),o.getSource.call(e,s)):void _a.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},l=function t(){e.off("loadedmetadata",a),e.off("error",u),e.off("dispose",t)};e.on("error",u),e.on("dispose",l),e.reloadSourceOnError=function(r){l(),t(e,r)}},sl=function(t){al(this,t)},ul="2.8.2",ll={PlaylistLoader:Fa,Playlist:ls,utils:Ts,STANDARD_PLAYLIST_SELECTOR:su,INITIAL_PLAYLIST_SELECTOR:function(){var t=this,e=this.playlists.master.playlists.filter(ls.isEnabled);return iu(e,(function(t,e){return ou(t,e)})),e.filter((function(e){return!!tu(t.playlists.master,e).video}))[0]||null},lastBandwidthSelector:su,movingAverageBandwidthSelector:function(t){var r=-1;if(t<0||t>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var n=this.useDevicePixelRatio&&e().devicePixelRatio||1;return r<0&&(r=this.systemBandwidth),r=t*this.systemBandwidth+(1-t)*r,au(this.playlists.master,r,parseInt(nu(this.tech_.el(),"width"),10)*n,parseInt(nu(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},comparePlaylistBandwidth:ou,comparePlaylistResolution:function(t,r){var n,i;return t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),n=n||e().Number.MAX_VALUE,r.attributes.RESOLUTION&&r.attributes.RESOLUTION.width&&(i=r.attributes.RESOLUTION.width),n===(i=i||e().Number.MAX_VALUE)&&t.attributes.BANDWIDTH&&r.attributes.BANDWIDTH?t.attributes.BANDWIDTH-r.attributes.BANDWIDTH:n-i},xhr:ps()};Object.keys(Ls).forEach((function(t){Object.defineProperty(ll,t,{get:function(){return _a.log.warn("using Vhs."+t+" is UNSAFE be sure you know what you are doing"),Ls[t]},set:function(e){_a.log.warn("using Vhs."+t+" is UNSAFE be sure you know what you are doing"),"number"!=typeof e||e<0?_a.log.warn("value of Vhs."+t+" must be greater than or equal to 0"):Ls[t]=e}})}));var cl="videojs-vhs",fl=function(t,e){for(var r=e.media(),n=-1,i=0;i<t.length;i++)if(t[i].id===r.id){n=i;break}t.selectedIndex_=n,t.trigger({selectedIndex:n,type:"change"})};ll.canPlaySource=function(){return _a.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var hl=function(){if(!e().localStorage)return null;var t=e().localStorage.getItem(cl);if(!t)return null;try{return JSON.parse(t)}catch(t){return null}};ll.supportsNativeHls=function(){if(!o()||!o().createElement)return!1;var t=o().createElement("video");return!!_a.getTech("Html5").isSupported()&&["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some((function(e){return/maybe|probably/i.test(t.canPlayType(e))}))}(),ll.supportsNativeDash=!!(o()&&o().createElement&&_a.getTech("Html5").isSupported())&&/maybe|probably/i.test(o().createElement("video").canPlayType("application/dash+xml")),ll.supportsTypeNatively=function(t){return"hls"===t?ll.supportsNativeHls:"dash"===t&&ll.supportsNativeDash},ll.isSupported=function(){return _a.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var pl=function(t){function r(e,r,n){var i;if(i=t.call(this,r,_a.mergeOptions(n.hls,n.vhs))||this,n.hls&&Object.keys(n.hls).length&&_a.log.warn("Using hls options is deprecated. Use vhs instead."),"number"==typeof n.initialBandwidth&&(i.options_.bandwidth=n.initialBandwidth),i.logger_=Oa("VhsHandler"),r.options_&&r.options_.playerId){var a=_a(r.options_.playerId);a.hasOwnProperty("hls")||Object.defineProperty(a,"hls",{get:function(){return _a.log.warn("player.hls is deprecated. Use player.tech().vhs instead."),r.trigger({type:"usage",name:"hls-player-access"}),s(i)},configurable:!0}),a.hasOwnProperty("vhs")||Object.defineProperty(a,"vhs",{get:function(){return _a.log.warn("player.vhs is deprecated. Use player.tech().vhs instead."),r.trigger({type:"usage",name:"vhs-player-access"}),s(i)},configurable:!0}),a.hasOwnProperty("dash")||Object.defineProperty(a,"dash",{get:function(){return _a.log.warn("player.dash is deprecated. Use player.tech().vhs instead."),s(i)},configurable:!0}),i.player_=a}if(i.tech_=r,i.source_=e,i.stats={},i.ignoreNextSeekingEvent_=!1,i.setOptions_(),i.options_.overrideNative&&r.overrideNativeAudioTracks&&r.overrideNativeVideoTracks)r.overrideNativeAudioTracks(!0),r.overrideNativeVideoTracks(!0);else if(i.options_.overrideNative&&(r.featuresNativeVideoTracks||r.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return i.on(o(),["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(function(t){var e=o().fullscreenElement||o().webkitFullscreenElement||o().mozFullScreenElement||o().msFullscreenElement;e&&e.contains(i.tech_.el())&&i.masterPlaylistController_.smoothQualityChange_()})),i.on(i.tech_,"seeking",(function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())})),i.on(i.tech_,"error",(function(){this.tech_.error()&&this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()})),i.on(i.tech_,"play",i.play),i}l(r,t);var n=r.prototype;return n.setOptions_=function(){var t=this;if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.handleManifestRedirects=!1!==this.options_.handleManifestRedirects,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,"number"!=typeof this.options_.blacklistDuration&&(this.options_.blacklistDuration=300),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){var e=hl();e&&e.bandwidth&&(this.options_.bandwidth=e.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-bandwidth-from-local-storage"})),e&&e.throughput&&(this.options_.throughput=e.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"}))}"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=Ls.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Ls.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange","customTagParsers","customTagMappers","handleManifestRedirects","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","experimentalBufferBasedABR","liveRangeSafeTimeDelta","experimentalLLHLS"].forEach((function(e){void 0!==t.source_[e]&&(t.options_[e]=t.source_[e])})),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio},n.src=function(t,r){var n=this;if(t){var i;this.setOptions_(),this.options_.src=0===(i=this.source_.src).toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(i.substring(i.indexOf(",")+1)):i,this.options_.tech=this.tech_,this.options_.externVhs=ll,this.options_.sourceType=W(r),this.options_.seekTo=function(t){n.tech_.setCurrentTime(t)},this.masterPlaylistController_=new el(this.options_);var o=_a.mergeOptions({liveRangeSafeTimeDelta:Ha},this.options_,{seekable:function(){return n.seekable()},media:function(){return n.masterPlaylistController_.media()},masterPlaylistController:this.masterPlaylistController_});this.playbackWatcher_=new il(o),this.masterPlaylistController_.on("error",(function(){var t=_a.players[n.tech_.options_.playerId],e=n.masterPlaylistController_.error;"object"!=typeof e||e.code?"string"==typeof e&&(e={message:e,code:3}):e.code=3,t.error(e)}));var a=this.options_.experimentalBufferBasedABR?ll.movingAverageBandwidthSelector(.55):ll.STANDARD_PLAYLIST_SELECTOR;this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):a.bind(this),this.masterPlaylistController_.selectInitialPlaylist=ll.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(t){this.masterPlaylistController_.selectPlaylist=t.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(t){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=t,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.bandwidth},set:function(t){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=t,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var t,e=1/(this.bandwidth||1);return t=this.throughput>0?1/this.throughput:0,Math.floor(1/(e+t))},set:function(){_a.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:function(){return n.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return n.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return n.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return n.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return n.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return n.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return n.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return n.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},buffered:{get:function(){return Xa(n.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return n.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return n.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return n.tech_.name_},enumerable:!0},duration:{get:function(){return n.tech_.duration()},enumerable:!0},master:{get:function(){return n.playlists.master},enumerable:!0},playerDimensions:{get:function(){return n.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return Xa(n.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return n.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",(function(){n.options_.useBandwidthFromLocalStorage&&function(t){if(!e().localStorage)return!1;var r=hl();r=r?_a.mergeOptions(r,t):t;try{e().localStorage.setItem(cl,JSON.stringify(r))}catch(t){return!1}}({bandwidth:n.bandwidth,throughput:Math.round(n.throughput)})})),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var t;(t=n).representations=function(){var e=t.masterPlaylistController_.master(),r=us(e)?t.masterPlaylistController_.getAudioTrackPlaylists_():e.playlists;return r?r.filter((function(t){return!rs(t)})).map((function(e,r){return new rl(t,e,e.id)})):[]}})),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",(function(){n.setupEme_()})),this.on(this.masterPlaylistController_,"progress",(function(){this.tech_.trigger("progress")})),this.on(this.masterPlaylistController_,"firstplay",(function(){this.ignoreNextSeekingEvent_=!0})),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=e().URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},n.setupEme_=function(){var t,e,r,n=this,i=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,o=(t={player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:i&&i.media()},e=t.player,!(!(r=function(t,e,r){if(!t)return t;var n={};e&&e.attributes&&e.attributes.CODECS&&(n=Js(N(e.attributes.CODECS))),r&&r.attributes&&r.attributes.CODECS&&(n.audio=r.attributes.CODECS);var i=U(n.video),o=U(n.audio),a={};for(var s in t)a[s]={},o&&(a[s].audioContentType=o),i&&(a[s].videoContentType=i),e.contentProtection&&e.contentProtection[s]&&e.contentProtection[s].pssh&&(a[s].pssh=e.contentProtection[s].pssh),"string"==typeof t[s]&&(a[s].url=t[s]);return _a.mergeOptions(t,a)}(t.sourceKeySystems,t.media,t.audioMedia))||(e.currentSource().keySystems=r,r&&!e.eme&&(_a.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),1))));11!==_a.browser.IE_VERSION&&o?(this.logger_("waiting for EME key session creation"),function(t){var e=t.player,r=t.sourceKeySystems,n=t.audioMedia,i=t.mainPlaylists;if(!e.eme.initializeMediaKeys)return Promise.resolve();var o,a,s=(o=n?i.concat([n]):i,a=Object.keys(r),o.reduce((function(t,e){if(!e.contentProtection)return t;var r=a.reduce((function(t,r){var n=e.contentProtection[r];return n&&n.pssh&&(t[r]={pssh:n.pssh}),t}),{});return Object.keys(r).length&&t.push(r),t}),[])),u=[],l=[];return s.forEach((function(t){l.push(new Promise((function(t,r){e.tech_.one("keysessioncreated",t)}))),u.push(new Promise((function(r,n){e.eme.initializeMediaKeys({keySystems:t},(function(t){t?n(t):r()}))})))})),Promise.race([Promise.all(u),Promise.race(l)])}({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:i&&i.media(),mainPlaylists:this.playlists.master.playlists}).then((function(){n.logger_("created EME key session"),n.masterPlaylistController_.sourceUpdater_.initializedEme()})).catch((function(t){n.logger_("error while creating EME key session",t),n.player_.error({message:"Failed to initialize media keys for EME",code:3})}))):this.masterPlaylistController_.sourceUpdater_.initializedEme()},n.setupQualityLevels_=function(){var t=this,e=_a.players[this.tech_.options_.playerId];e&&e.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=e.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",(function(){!function(t,e){e.representations().forEach((function(e){t.addQualityLevel(e)})),fl(t,e.playlists)}(t.qualityLevels_,t)})),this.playlists.on("mediachange",(function(){fl(t.qualityLevels_,t.playlists)})))},r.version=function(){return{"@videojs/http-streaming":ul,"mux.js":"5.11.0","mpd-parser":"0.16.0","m3u8-parser":"4.7.0","aes-decrypter":"3.1.2"}},n.version=function(){return this.constructor.version()},n.canChangeType=function(){return Ru.canChangeType()},n.play=function(){this.masterPlaylistController_.play()},n.setCurrentTime=function(t){this.masterPlaylistController_.setCurrentTime(t)},n.duration=function(){return this.masterPlaylistController_.duration()},n.seekable=function(){return this.masterPlaylistController_.seekable()},n.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&e().URL.revokeObjectURL&&(e().URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),t.prototype.dispose.call(this)},n.convertToProgramTime=function(t,e){return function(t){var e=t.playlist,r=t.time,n=void 0===r?void 0:r,i=t.callback;if(!i)throw new Error("getProgramTime: callback must be provided");if(!e||void 0===n)return i({message:"getProgramTime: playlist and time must be provided"});var o=function(t,e){if(!e||!e.segments||0===e.segments.length)return null;for(var r,n=0,i=0;i<e.segments.length&&!(t<=(n=(r=e.segments[i]).videoTimingInfo?r.videoTimingInfo.transmuxedPresentationEnd:n+r.duration));i++);var o=e.segments[e.segments.length-1];if(o.videoTimingInfo&&o.videoTimingInfo.transmuxedPresentationEnd<t)return null;if(t>n){if(t>n+.25*o.duration)return null;r=o}return{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:n-r.duration,type:r.videoTimingInfo?"accurate":"estimate"}}(n,e);if(!o)return i({message:"valid programTime was not found"});if("estimate"===o.type)return i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:o.estimatedStart});var a={mediaSeconds:n},s=function(t,e){if(!e.dateTimeObject)return null;var r=e.videoTimingInfo.transmuxerPrependedSeconds,n=t-(e.videoTimingInfo.transmuxedPresentationStart+r);return new Date(e.dateTimeObject.getTime()+1e3*n)}(n,o.segment);return s&&(a.programDateTime=s.toISOString()),i(null,a)}({playlist:this.masterPlaylistController_.media(),time:t,callback:e})},n.seekToProgramTime=function(t,e,r,n){return void 0===r&&(r=!0),void 0===n&&(n=2),Ss({programTime:t,playlist:this.masterPlaylistController_.media(),retryCount:n,pauseAfterSeek:r,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:e})},r}(_a.getComponent("Component")),dl={name:"videojs-http-streaming",VERSION:ul,canHandleSource:function(t,e){void 0===e&&(e={});var r=_a.mergeOptions(_a.options,e);return dl.canPlayType(t.type,r)},handleSource:function(t,e,r){void 0===r&&(r={});var n=_a.mergeOptions(_a.options,r);return e.vhs=new pl(t,e,n),_a.hasOwnProperty("hls")||Object.defineProperty(e,"hls",{get:function(){return _a.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),e.vhs},configurable:!0}),e.vhs.xhr=ps(),e.vhs.src(t.src,t.type),e.vhs},canPlayType:function(t,e){void 0===e&&(e={});var r=_a.mergeOptions(_a.options,e).vhs.overrideNative,n=void 0===r?!_a.browser.IS_ANY_SAFARI:r,i=W(t);return!i||ll.supportsTypeNatively(i)&&!n?"":"maybe"}};F("avc1.4d400d,mp4a.40.2")&&_a.getTech("Html5").registerSourceHandler(dl,0),_a.VhsHandler=pl,Object.defineProperty(_a,"HlsHandler",{get:function(){return _a.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),pl},configurable:!0}),_a.VhsSourceHandler=dl,Object.defineProperty(_a,"HlsSourceHandler",{get:function(){return _a.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),dl},configurable:!0}),_a.Vhs=ll,Object.defineProperty(_a,"Hls",{get:function(){return _a.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),ll},configurable:!0}),_a.use||(_a.registerComponent("Hls",ll),_a.registerComponent("Vhs",ll)),_a.options.vhs=_a.options.vhs||{},_a.options.hls=_a.options.hls||{},_a.registerPlugin?_a.registerPlugin("reloadSourceOnError",sl):_a.plugin("reloadSourceOnError",sl);const yl=_a;function ml(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var vl=function t(e){var r=this;if(yl.browser.IS_IE8)for(var n in r=o().createElement("custom"),t.prototype)"constructor"!==n&&(r[n]=t.prototype[n]);return r.id=e.id,r.label=r.id,r.width=e.width,r.height=e.height,r.bitrate=e.bandwidth,r.enabled_=e.enabled,Object.defineProperty(r,"enabled",{get:function(){return r.enabled_()},set:function(t){r.enabled_(t)}}),r},gl=function(t){var e,r;function n(){var e,r=ml(ml(e=t.call(this)||this));if(yl.browser.IS_IE8)for(var i in r=o().createElement("custom"),n.prototype)"constructor"!==i&&(r[i]=n.prototype[i]);return r.levels_=[],r.selectedIndex_=-1,Object.defineProperty(r,"selectedIndex",{get:function(){return r.selectedIndex_}}),Object.defineProperty(r,"length",{get:function(){return r.levels_.length}}),r||ml(e)}r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,e.__proto__=r;var i=n.prototype;return i.addQualityLevel=function(t){var e=this.getQualityLevelById(t.id);if(e)return e;var r=this.levels_.length;return e=new vl(t),""+r in this||Object.defineProperty(this,r,{get:function(){return this.levels_[r]}}),this.levels_.push(e),this.trigger({qualityLevel:e,type:"addqualitylevel"}),e},i.removeQualityLevel=function(t){for(var e=null,r=0,n=this.length;r<n;r++)if(this[r]===t){e=this.levels_.splice(r,1)[0],this.selectedIndex_===r?this.selectedIndex_=-1:this.selectedIndex_>r&&this.selectedIndex_--;break}return e&&this.trigger({qualityLevel:t,type:"removequalitylevel"}),e},i.getQualityLevelById=function(t){for(var e=0,r=this.length;e<r;e++){var n=this[e];if(n.id===t)return n}return null},i.dispose=function(){this.selectedIndex_=-1,this.levels_.length=0},n}(yl.EventTarget);for(var bl in gl.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"},gl.prototype.allowedEvents_)gl.prototype["on"+bl]=null;var _l="2.0.9",wl=function(t){return e=this,yl.mergeOptions({},t),r=e.qualityLevels,n=new gl,e.on("dispose",(function t(){n.dispose(),e.qualityLevels=r,e.off("dispose",t)})),e.qualityLevels=function(){return n},e.qualityLevels.VERSION=_l,n;var e,r,n};(yl.registerPlugin||yl.plugin)("qualityLevels",wl),wl.VERSION=_l;function Tl(t){return Tl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tl(t)}function Sl(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,El(n.key),n)}}function El(t){var e=function(t,e){if("object"!=Tl(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Tl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Tl(e)?e:String(e)}function Ol(t,e,r){return e=xl(e),function(t,e){if(e&&("object"===Tl(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Cl(t)}(t,kl()?Reflect.construct(e,r||[],xl(t).constructor):e.apply(t,r))}function kl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(kl=function(){return!!t})()}function Cl(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Pl(){return Pl="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=xl(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},Pl.apply(this,arguments)}function xl(t){return xl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},xl(t)}function jl(t,e){return jl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},jl(t,e)}var Ll=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=Ol(this,e,[t])).options=r,n.configureMenuDimensions=n.configureMenuDimensions.bind(Cl(n)),n.initialize(),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&jl(t,e)}(e,t),r=e,(n=[{key:"initialize",value:function(){this.player.ready(this.configureMenuDimensions),this.player.one("play",this.configureMenuDimensions),this.player.on("resize",this.configureMenuDimensions),this.player.on("fullscreenchange",this.configureMenuDimensions),this.player.on("resizemenus",this.configureMenuDimensions),this.player.on("ready",this.configureMenuDimensions)}},{key:"dispose",value:function(){this.player.off("resize",this.configureMenuDimensions),this.player.off("fullscreenchange",this.configureMenuDimensions),this.player.off("resizemenus",this.configureMenuDimensions),this.player.off("ready",this.configureMenuDimensions),Pl(xl(e.prototype),"dispose",this).call(this)}},{key:"configureMenuDimensions",value:function(){var t=this,e=function(e){if(!t.options.mobile){var r=t.player.getChild("collapserator"),n=r.getChild("volumePanel"),i=r.children_.indexOf(n);r.removeChild(n),r.addChild("volumePanel",{inline:e},i),t.player.trigger("volumechange")}},r=this.player.isFullscreen();if(r&&!this.options.mobile){var n=this.player.whiteboardModePlugin().side;if(e("top"!==n),"left"===n||"right"===n||"top"===n){var i=this.player.currentWidth();return void this.player.el().querySelectorAll(".vjs-menu").forEach((function(t){t.style.paddingTop=null,t.style.marginBottom=null,t.style.width="calc(".concat(i,"px - 4em)")}))}}r||e(!0);var o=this.player.currentWidth(),a=this.player.currentHeight()/o*100,s=this.player.el().querySelector(".cv-collapsorator"),u=this.player.el().querySelectorAll(".vjs-menu"),l=s&&s.offsetHeight;l?("CreateClipSeekBar"===this.options.seekBarName&&(l+=22),u&&u.length&&u.forEach((function(e){!r&&t.options.overflowControls?e.style.paddingTop="80%":e.style.paddingTop="calc(".concat(a,"% - ").concat(l,"px)"),e.style.marginBottom="".concat(l,"px"),e.style.width=null,e.querySelector(".vjs-menu-content")&&(o<=450?t.player.addClass("cv-player-small"):t.player.removeClass("cv-player-small"))}))):this.player.one("play",this.configureMenuDimensions)}}])&&Sl(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getPlugin("plugin"));yl.registerPlugin("configureMenuDimensionsPlugin",Ll);var Il="cv-persisttest",Al=function(){try{return window.localStorage.setItem(Il,"cv-player-storage-test"),window.localStorage.removeItem(Il),!0}catch(t){return!1}},Rl=function(t){return window.localStorage.getItem(t)},Dl=function(t,e){window.localStorage.setItem(t,e)};function Ml(t){return Ml="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ml(t)}function Nl(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Bl(n.key),n)}}function Bl(t){var e=function(t,e){if("object"!=Ml(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Ml(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ml(e)?e:String(e)}function Ul(t,e,r){return e=Hl(e),function(t,e){if(e&&("object"===Ml(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Fl()?Reflect.construct(e,r||[],Hl(t).constructor):e.apply(t,r))}function Fl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Fl=function(){return!!t})()}function Vl(){return Vl="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Hl(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},Vl.apply(this,arguments)}function Hl(t){return Hl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Hl(t)}function ql(t,e){return ql=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ql(t,e)}var zl,Wl,Gl,Xl,Kl,Yl,Ql,$l,Jl,Zl,tc,ec,rc,nc,ic,oc,ac,sc,uc,lc,cc,fc,hc,pc,dc,yc,mc,vc,gc,bc,_c,wc,Tc,Sc,Ec,Oc,kc,Cc,Pc,xc=yl.getPlugin("plugin"),jc="cvplayer-volume",Lc="cvplayer-mute",Ic=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=Ul(this,e,[t])).enabled=!0,r.player.ready((function(){return r.initialize()})),r}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ql(t,e)}(e,t),r=e,(n=[{key:"initialize",value:function(){this.player.options_.mobile?this.removeVolumeControl():Al()&&(this.saveVolumeState=this.saveVolumeState.bind(this),this.player.on("volumechange",this.saveVolumeState),this.applyUserPreferences())}},{key:"applyUserPreferences",value:function(){var t=Rl(jc),e=Rl(Lc);t&&this.player.volume(+t),e&&this.player.muted("true"===e)}},{key:"saveVolumeState",value:function(){this.enabled&&(Dl(jc,this.player.volume().toString()),Dl(Lc,this.player.muted().toString()))}},{key:"removeVolumeControl",value:function(){this.player.volume(1);var t=this.player.getChild("collapserator"),e=t.getChild("volumePanel");t.removeChild(e)}},{key:"enable",value:function(){this.enabled=!0}},{key:"disable",value:function(){this.enabled=!1}},{key:"dispose",value:function(){this.player.off("volumechange",this.saveVolumeState),Vl(Hl(e.prototype),"dispose",this).call(this)}}])&&Nl(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(xc);function Ac(t){return Ac="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ac(t)}function Rc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Dc(n.key),n)}}function Dc(t){var e=function(t,e){if("object"!=Ac(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Ac(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ac(e)?e:String(e)}function Mc(t,e,r){return e=Bc(e),function(t,e){if(e&&("object"===Ac(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Nc()?Reflect.construct(e,r||[],Bc(t).constructor):e.apply(t,r))}function Nc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Nc=function(){return!!t})()}function Bc(t){return Bc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bc(t)}function Uc(t,e){return Uc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Uc(t,e)}yl.registerPlugin("persistVolumePlugin",Ic),function(t){t.Stream="cv_product_stream",t.WebPlayerStream="cv_product_webplayer_stream",t.StreamProgress="cv_product_stream_progress",t.Login="cv_product_login",t.LoginSsoRedirect="cv_product_login_sso_redirect",t.LoginFailed="cv_product_login_failed",t.Search="cv_product_search",t.InstantSearch="cv_product_instant_search",t.SearchEmptyResult="cv_product_search_empty_result",t.Filter="cv_product_search_filter",t.SearchLanding="cv_product_search_landing",t.Share="cv_product_share",t.Unshare="cv_product_unshare",t.WorkspaceAdd="cv_product_tv_add",t.Rename="cv_product_rename",t.Move="cv_product_move",t.Sort="cv_product_sort",t.Create="cv_product_create",t.Delete="cv_product_delete",t.Associate="cv_product_associate",t.Dissociate="cv_product_dissociate",t.Edit="cv_product_edit",t.Approve="cv_product_approve",t.Reject="cv_product_reject",t.Disable="cv_product_disable",t.Upload="cv_product_upload",t.Download="cv_product_download",t.Navigate="cv_product_navigate",t.Click="cv_product_click",t.Suggest="cv_product_suggest",t.EditAssoc="cv_product_edit_assoc",t.Play="cv_product_play",t.Favourite="cv_product_favourite",t.Follow="cv_product_follow",t.Prefer="cv_product_prefer",t.Print="cv_product_print",t.Copy="cv_product_copy",t.Activate="cv_product_activate",t.VerifyEmail="cv_product_verify_email",t.ChangePassword="cv_product_change_password",t.ManageGroup="cv_product_manage_group",t.Export="cv_product_export",t.SendEmail="cv_product_send_email",t.Publish="cv_product_publish",t.Submit="cv_product_submit",t.Complete="cv_product_complete",t.Archive="cv_product_archive",t.Promote="cv_product_promote",t.Demote="cv_product_demote",t.BulkAction="cv_product_bulk_action",t.Remove="cv_product_remove",t.Dismiss="cv_product_dismiss",t.Open="cv_product_open",t.Hide="cv_product_hide",t.PageView="cv_product_page_view",t.Select="cv_product_select",t.SwitchCustomer="cv_product_switch_customer",t.Focus="cv_product_focus",t.Blur="cv_product_blur",t.Hover="cv_product_hover",t.Unhover="cv_product_unhover",t.SetAccess="cv_product_set_access",t.AddToLocalCache="cv_product_add_to_lc",t.ResolveWarning="cv_product_resolve_warning",t.DismissWarning="cv_product_dismiss_warning"}(zl||(zl={})),function(t){t.Folder="folder",t.Video="video",t.Rating="rating",t.Series="series",t.Library="library",t.Resource="resource",t.Tag="tag",t.Subtitle="subtitle",t.Chapter="chapter",t.Resolution="resolution",t.PlaybackSpeed="playback_speed",t.Device="device",t.Restriction="restriction",t.Interactive="interactive",t.Interaction="interaction",t.PDF="pdf",t.CustomerSetting="customer_setting",t.UserSetting="user_setting",t.LibraryRequest="staff_request",t.Logo="logo",t.Pagination="pagination",t.Thumbnail="thumbnail",t.Banner="banner",t.Link="link",t.Playlist="playlist",t.Playlists="playlists",t.Person="person",t.Company="company",t.Classroom="classroom",t.ClassroomGroup="classroom_group",t.Classification="classification",t.ShareLink="share_link",t.DirectShare="direct_share",t.Upload="upload",t.SearchResults="search_results",t.SearchSuggestion="search_suggestion",t.Audience="audience",t.User="user",t.Clip="clip",t.UserChannel="user_channel",t.Widget="widget",t.Url="url",t.SocialShare="social_share",t.Presentation="presentation",t.BatchJob="batch_job",t.DeepLink="deep_link",t.Feedback="feedback",t.AppLink="app_link",t.SignUp="sign_up",t.FileGeneratorJob="file_generator_job",t.Product="product",t.Customer="customer",t.SpecialEvent="special_event",t.Region="region",t.ProductTip="product_tip",t.Livestream="livestream",t.DevicesCta="devices_cta",t.Integration="integration",t.Faq="faq"}(Wl||(Wl={})),function(t){t.TopNav="top_nav",t.LeftNav="left_nav",t.Footer="footer",t.Popup="popup",t.Banner="banner",t.VideoList="video_list",t.VideoListItem="video_list_item",t.VideoListHeader="video_header",t.VideoThumbnail="video_thumbnail",t.ExpandableVideoThumbnail="expandable_video_thumbnail",t.VideoItemPreview="video_item_preview",t.InteractiveItemPreview="interactive_item_preview",t.ClipItemPreview="clip_item_preview",t.VideoDetails="video_details",t.InteractiveDetails="interactive_details",t.ClipDetails="clip_details",t.VideoDetailsHeader="video_details_header",t.EditVideoDetails="edit_video_details",t.EditInteractiveVideoDetails="edit_interactive_video_details",t.EditClipDetails="edit_clip_details",t.EditVideoChapters="edit_video_chapters",t.EditVideoResources="edit_video_resources",t.VideoUpload="video_upload",t.VideoRequest="video_request",t.Pagination="pagination",t.LibraryHeader="library_header",t.LibraryTiles="library_tiles",t.LibraryRequestDetails="staff_request_details",t.Libraries="libraries",t.SubFolderList="sub_folder_list",t.AwaitingReviewVideoListHeader="awaiting_review_video_list_header",t.AwaitingReviewVideoItem="awaiting_review_video_item",t.PastReleasesHeader="past_releases_header",t.MigrationWarnings="migration_warnings",t.PlaylistListHeader="playlist_list_header",t.PlaylistListItem="playlist_list_item",t.SeriesListItem="series_list_item",t.SeriesWithVideos="series_with_videos",t.PlaylistWithVideos="playlist_with_videos",t.Dropdown="dropdown",t.SearchBar="search_bar",t.InstantSearch="instant_search",t.SearchFilters="search_filters",t.FeaturedSeriesSearchResult="featured_series_search_result",t.ExchangeSearchGroupItem="exchange_search_group_item",t.StaffManager="staff_manager",t.StaffManagerListItem="staff_manager_list_item",t.StudentManager="student_manager",t.ViewStudentVideos="view_student_videos",t.StudentManagerListItem="student_manager_list_item",t.EditUser="edit_user",t.UserAuditLog="user_audit_log",t.BulkUserActionsWizard="bulk_user_actions_wizard",t.BulkUserUploadWizard="bulk_user_upload_wizard",t.Classroom="classroom",t.ClassroomsList="classrooms_list",t.ClassroomsListItem="classrooms_list_item",t.ManageClassroomStudents="manage_classroom_students",t.ManageClassroomStudentListItem="manage_classroom_student_list_item",t.ManageClassroomGroups="manage_classroom_groups",t.ManageClassroomGroupListItem="manage_classroom_group_list_item",t.ManageClassroomTeachers="manage_classroom_teachers",t.ManageClassroomTeacherListItem="manage_classroom_teachers_list_item",t.ArchivedClassrooms="archived_classrooms",t.PreviewInteractive="preview_interactive",t.PreviewSharedInteractive="preview_shared_interactive",t.PreviewInteractiveQuestions="preview_interactive_questions",t.EditInteractive="edit_interactive",t.EditInteractiveDetails="edit_interactive_details",t.PlaySharedInteractive="play_shared_interactive",t.PlayInteractive="play_interactive",t.InteractiveListItem="interactive_list_item",t.DeleteInteractive="delete_interactive",t.NewInteractive="new_interactive",t.CopyInteractive="copy_interactive",t.UnpublishInteractive="unpublish_interactive",t.ShareInteractive="share_interactive",t.PlayPage="play_page",t.Player="player",t.FloatingPlayer="floating_player",t.InteractivePlayer="interactive_player",t.EmbeddedPlayer="embedded_player",t.CreateClipPlayer="create_clip_player",t.PlayClip="play_clip",t.PlaySharedClip="play_shared_clip",t.ClipListItem="clip_list_item",t.ContentUpdatesBanner="content_updates_banner",t.ContentUpdatesClassificationBanner="content_updates_classification_banner",t.PreferencesSettings="preferences_settings",t.TopicsOnboarding="topics_onboarding",t.MyUploads="my_uploads",t.MyVideos="my_videos",t.SlidingList="sliding_list",t.HeroBannerItem="hero_banner_item",t.SlidingListItem="sliding_list_item",t.ClassificationListItem="classification_list_item",t.ClassificationComingSoon="classification_coming_soon",t.ClassificationHero="classification_hero",t.ClassificationFooter="classification_footer",t.Classification="classification",t.Dashboard="dashboard",t.DiscoverFooter="discover_footer",t.ProductBanner="product_banner",t.UserOptions="user_options",t.MagicTabs="magic_tabs",t.Settings="settings",t.StudentFeed="student_feed",t.SharedByMe="shared_by_me",t.SharedWithMe="shared_with_me",t.ClassroomGuide="classroom_guide",t.TeachingResources="teaching_resources",t.TopVideos="top_videos",t.VideoViewsList="video_views_list",t.VideoOverview="video_overview",t.LiteUpgradeFeedbackPopup="lite_upgrade_feedback_popup",t.LiteUpgradeBanner="lite_upgrade_banner",t.LiteUpgradeOnboarding="lite_upgrade_onboarding",t.LibraryRequestSettings="library_request_settings",t.OpenInAppPrompt="open_in_app_prompt",t.UseAppButton="use_app_button",t.Launchpad="launchpad",t.EditableSubjectPreferencesWidget="editable_subject_preferences_widget",t.ThumbnailHeroMediaWidget="thumbnail_hero_media_widget",t.ThumbnailFixedListMediaLargeWidget="thumbnail_fixed_list_media_large",t.FilterSlidingPillListSmallWidget="filter_sliding_pill_list_small",t.CircleLogoSlidingListWidget="circle_logo_sliding_list_widget",t.HeroBannerSmallWidget="hero_banner_small",t.EventIconSlidingListWidget="event_icon_sliding_list_widget",t.OnboardingStepsWidget="onboarding_steps_widget",t.FaqQuestionWidget="faq_question_widget",t.FaqQuestionAccordionWidget="faq_question_accordion_widget",t.ExchangeLinksWidget="exchange_links_widget",t.TableOfContents="table_of_contents",t.SignUpPopup="sign_up_popup",t.SignUpPage="sign_up_page",t.TrialBanner="trial_banner",t.InviteColleaguePopup="invite_colleague_popup",t.AuthProspectSelect="auth_prospect_select",t.WelcomePopup="welcome_popup",t.WatchHistoryLanding="watch_history_landing",t.MyFavouritesLanding="my_favourites_landing",t.MyVideoLanding="my_videos_landing",t.PlaylistsLanding="playlists_landing",t.NotificationsDropdown="notifications_dropdown",t.CalendarNav="calendar_nav",t.CalendarDay="calendar_day",t.CalendarPopup="calendar_popup",t.RegionMap="region_map",t.OnboardingWelcomeVideoScreen="onboarding_welcome_video_screen",t.OnboardingSelectRoleScreen="onboarding_select_role_screen",t.OnboardingUsageIntentionScreen="onboarding_usage_intention_screen",t.OnboardingSchoolLevelScreen="onboarding_school_level_screen",t.OnboardingSelectCurriculumScreen="onboarding_select_curriculum_screen",t.OnboardingSubjectsScreen="onboarding_subjects_screen",t.OnboardingSelectVideosScreen="onboarding_select_videos_screen",t.OnboardingCreatePlaylistScreen="onboarding_create_playlist_screen",t.OnboardingSubjectsSummaryScreen="onboarding_subjects_summary_screen",t.ProductTips="product_tips",t.LivestreamBookingForm="booking_form",t.Global="global"}(Gl||(Gl={})),function(t){t.Start="start",t.Complete="complete",t.Save="save",t.Discard="discard",t.Next="next",t.Back="back"}(Xl||(Xl={})),function(t){t.PageLoad="page_load"}(Kl||(Kl={})),function(t){t.Single="single",t.Bulk="bulk",t.All="all"}(Yl||(Yl={})),function(t){t.Publish="publish",t.Unpublish="unpublish"}(Ql||(Ql={})),function(t){t.ActivateUser="activate_user",t.VerifyEmail="verify_email",t.ResetPasswordEmail="reset_password"}($l||($l={})),function(t){t.ProductionYear="production_year",t.Alphabetical="alphabetical"}(Jl||(Jl={})),function(t){t.Content="content",t.Quality="quality",t.Duration="duration",t.Reset="reset"}(Zl||(Zl={})),function(t){t.Submit="submit",t.ShowAll="show_all",t.Recent="recent",t.SearchIcon="search_icon"}(tc||(tc={})),function(t){t.Start="start",t.Finish="finish",t.Terminate="terminate",t.Play="play",t.Pause="pause",t.Playback="playback",t.NextChapter="next_chapter",t.PreviousChapter="previous_chapter",t.FullScreenEnter="full_screen_enter",t.FullScreenExit="full_screen_exit",t.ChangeResolution="change_resolution",t.ChangeSpeed="change_speed",t.ChangeDevice="change_device"}(ec||(ec={})),function(t){t.Embedded="embedded"}(rc||(rc={})),function(t){t.TogglePreview="toggle_preview",t.NavigateHome="navigate_home",t.OpenInStaffView="open_in_staff_view",t.Title="title",t.ToggleHideValidListings="toggle_hide_valid_listings",t.LaunchImmersiveReader="launch_immersive_reader",t.CopyEmbedHtml="copy_embed_html",t.Close="close",t.Open="open",t.Button="button",t.Link="link",t.Tile="tile",t.Thumbnail="thumbnail",t.Cover="cover",t.TallPoster="tall_poster",t.Banner="banner",t.Slide="slide",t.ExternalLink="external_link",t.ViewStudentWorkspace="view_student_workspace",t.Card="card",t.SelectAllUsers="select_all_users",t.ClickViewLogo="clickview_logo",t.Clear="clear",t.SeeMore="see_more",t.Settings="settings",t.Expand="expand",t.Collapse="collapse"}(nc||(nc={})),function(t){t.FeatureUserChannelVideo="feature_user_channel_video",t.RemoveFromUserChannelPlaylist="remove_from_user_channel_playlist",t.ShareClip="share_clip",t.ViewOriginalVideo="view_original_video",t.ShareInteractive="share_interactive",t.DeleteInteractiveVideo="delete_interactive_video",t.CopyInteractiveVideo="copy_interactive_video",t.EditInteractiveVideo="edit_interactive_video",t.PrintAsWorksheet="print_as_worksheet",t.PreviewInteractiveVideo="preview_interactive_video",t.ViewResults="view_results",t.ViewUsage="view_usage",t.MoveToAnotherFolder="move_to_another_folder",t.CreateInteractiveVideo="create_interactive_video",t.ShareVideo="share_video",t.EditVideo="edit_video",t.DownloadVideo="download_video",t.AddToExchange="add_to_exchange",t.AddToUserChannel="add_to_user_channel",t.CreateClip="create_clip",t.FlagVideo="flag_video",t.AddToLibrary="add_to_library",t.AddToWorkspace="add_to_workspace",t.AddToPlaylist="add_to_playlist",t.RemoveFromPlaylist="remove_from_playlist",t.AddCurriculumLink="add_curriculum_link",t.ViewCurriculumLinks="view_curriculum_links",t.OpenInCurator="open_in_curator",t.ManageVideoAccess="manage_video_access",t.Approve="approve",t.AddToLocalCache="add_to_local_cache",t.OpenInLibraryEditor="open_in_library_editor",t.OpenInClickView="open_in_clickview",t.PlayClip="play_clip",t.EditClip="edit_clip",t.DeleteClip="delete_clip",t.EditVideoDetails="edit_video_details",t.DeleteVideo="delete_video",t.ManageAccess="manage_access",t.SuggestEdit="suggest_edit"}(ic||(ic={})),function(t){t.Remove="remove"}(oc||(oc={})),function(t){t.LibraryReview="library_review"}(ac||(ac={})),function(t){t.FileSelect="file_select",t.DragDrop="drag_drop"}(sc||(sc={})),function(t){t.Edit="edit"}(uc||(uc={})),function(t){t.Image="image",t.User="user",t.Playlist="playlist",t.Link="link",t.Avatar="avatar",t.Clip="clip",t.Interactive="interactive",t.Classroom="classroom",t.Customer="customer"}(lc||(lc={})),function(t){t.On="on",t.Off="off"}(cc||(cc={})),function(t){t.ContinueSession="continue_session",t.NewSession="new_session"}(fc||(fc={})),function(t){t.DirectShare="direct_share",t.CopyLink="copy_link",t.CopyEmbedHtml="copy_embed_html",t.PluginEmbed="plugin_embed"}(hc||(hc={})),function(t){t.GoToOnline="go_to_online",t.Feedback="feedback",t.BookACall="book_a_call",t.RequestUpgrade="request_upgrade"}(pc||(pc={})),function(t){t.SignIn="sign_in",t.SignUp="sign_up",t.SignOut="sign_out",t.TopNavButton="top_nav_button",t.Educator="educator",t.Student="student",t.TermsAndConditions="terms_and_conditions",t.PrivacyPolicy="privacy_policy",t.EnterEmail="enter_email",t.ClosePopup="close_popup",t.Back="back",t.UseMyLocation="use_my_location",t.TrialCreated="trial_created",t.TrialRequested="trial_requested",t.DeadEnd="dead_end",t.CantFindSchool="cant_find_school",t.ResendEmail="resend_email",t.ContactUs="contact_us",t.InviteColleague="invite_colleague",t.Upgrade="upgrade",t.FindSchool="find_school",t.AddToBraze="add_to_braze",t.RequestAccess="request_access",t.AutoJoin="auto_join",t.WrongEmail="wrong_email"}(dc||(dc={})),function(t){t.RequestProgram="tv_request_program",t.AdFreeRequest="tv_ad_free_request",t.AddAdFreeVideo="tv_add_ad_free_video",t.AddFullVideo="tv_add_full_video",t.RegionSelect="tv_region_select"}(yc||(yc={})),function(t){t.AddToExchange="add_to_exchange"}(mc||(mc={})),function(t){t.ComeBackLater="come_back_later",t.Back="back",t.Next="next",t.Complete="complete",t.ReplayVideo="replay_video",t.SkipVideo="skip_video",t.PlayVideo="play_video",t.PauseVideo="pause_video",t.FinishVideo="finish_video",t.SelectPresentation="select_presentation",t.SelectCurriculum="select_curriculum",t.SelectSubject="select_subject",t.SelectAllSubjects="select_all_subjects",t.SelectVideo="select_video",t.SelectAllVideos="select_all_videos",t.DeselectAllVideos="deselect_all_videos",t.SelectOption="select_option",t.SelectJobTitle="select_job_title",t.PhoneNumber="phone_number",t.OtherInformation="other_information",t.PlaylistName="playlist_name",t.DismissWidget="dismiss_widget",t.ContactSales="contact_sales",t.FinishPersonalising="finish_personalising",t.UpdateSchoolLevel="update_school_level",t.UpdateCurriculum="update_curriculum",t.UpdateSubjects="update_subjects"}(vc||(vc={})),function(t){t.OnboardingFirstPlaylistProductTip="onboarding_first_playlist_product_tip",t.OnboardingSchoolLevelsProductTip="onboarding_school_levels_product_tip"}(gc||(gc={})),function(t){t.MyVideos="search_source_my_videos",t.School="search_source_school",t.ExchangeArchive="search_source_exchange_archive",t.ClickView="search_source_clickview"}(bc||(bc={})),function(t){t.InstallIntegration="devices_cta_install_integration",t.LearnMore="devices_cta_learn_more",t.ContactSupport="devices_cta_contact_support",t.Dismiss="devices_cta_dismiss"}(_c||(_c={})),function(t){t.Troubleshoot="troubleshoot_integration"}(wc||(wc={})),function(t){t.Popup="popup",t.FullPage="full_page"}(Tc||(Tc={})),function(t){t.Calendar="calendar",t.List="list"}(Sc||(Sc={})),function(t){t.EntityRemoved="cv_entity_removed",t.ValueUpdated="cv_value_updated"}(Ec||(Ec={})),function(t){t.FileSelect="file_select",t.DragDrop="drag_drop"}(Oc||(Oc={})),function(t){t.Video="videos",t.Clip="clips",t.Interactive="interactives",t.Folder="categories",t.Series="series",t.Tags="tags",t.Subjects="subjects"}(kc||(kc={})),function(t){t[t.V1=1]="V1",t[t.V2=2]="V2",t[t.V3=3]="V3",t[t.V4=4]="V4"}(Cc||(Cc={})),function(t){t.Staff="staff",t.Learner="learner",t.Unknown="unknown"}(Pc||(Pc={}));var Fc=yl.getPlugin("plugin"),Vc="cvplayer-playback-rate",Hc=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=Mc(this,e,[t])).options=r,n.player.ready((function(){return n.initialize()})),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Uc(t,e)}(e,t),r=e,(n=[{key:"initialize",value:function(){var t,e=this;if(Al()){this.savePlaybackRate=this.savePlaybackRate.bind(this),this.player.on("ratechange",this.savePlaybackRate),this.one("dispose",(function(){e.player.off("ratechange",e.savePlaybackRate)}));var r=+Rl(Vc);(null===(t=this.player.options_.playbackRates)||void 0===t?void 0:t.some((function(t){return t===r})))&&this.player.playbackRate(r)}}},{key:"savePlaybackRate",value:function(){var t,e=this.player.playbackRate().toString();Dl(Vc,e),null===(t=this.options.analyticsService)||void 0===t||t.logUserAction({rate:e},{actionType:zl.Select,workflowPhase:Xl.Complete,descriptor:ec.ChangeSpeed,entity:Wl.PlaybackSpeed,eventVersion:Cc.V3})}}])&&Rc(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(Fc);function qc(t){return qc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qc(t)}function zc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Wc(n.key),n)}}function Wc(t){var e=function(t,e){if("object"!=qc(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=qc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==qc(e)?e:String(e)}function Gc(t,e,r){return e=Yc(e),Xc(t,Kc()?Reflect.construct(e,r||[],Yc(t).constructor):e.apply(t,r))}function Xc(t,e){if(e&&("object"===qc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Qc(t)}function Kc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Kc=function(){return!!t})()}function Yc(t){return Yc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Yc(t)}function Qc(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $c(t,e){return $c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},$c(t,e)}yl.registerPlugin("persistPlaybackRatePlugin",Hc);var Jc=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=Gc(this,e,[t])).fullscreenBecauseOfRotate=!1,r.player.supportsFullScreen()?(r.onRotate=r.onRotate.bind(Qc(r)),r.onFullscreenChange=r.onFullscreenChange.bind(Qc(r)),r.player.ready((function(){return r.initialize()})),r):Xc(r)}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$c(t,e)}(e,t),r=e,(n=[{key:"initialize",value:function(){this.player.on("fullscreenchange",this.onFullscreenChange),window.addEventListener("orientationchange",this.onRotate)}},{key:"dispose",value:function(){this.player.off("fullscreenchange",this.onFullscreenChange),window.removeEventListener("orientationchange",this.onRotate)}},{key:"onFullscreenChange",value:function(){this.player.isFullscreen()||(this.fullscreenBecauseOfRotate=!1)}},{key:"onRotate",value:function(){var t=this.getAngle();90===t||-90===t||270===t?(this.player.requestFullscreen(),this.fullscreenBecauseOfRotate=!0):this.fullscreenBecauseOfRotate&&this.player.isFullscreen()&&this.player.exitFullscreen()}},{key:"getAngle",value:function(){var t,e;return"number"==typeof(null===(e=null===(t=window.screen)||void 0===t?void 0:t.orientation)||void 0===e?void 0:e.angle)?window.screen.orientation.angle:0}}])&&zc(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getPlugin("plugin"));yl.registerPlugin("fullscreenOnRotatePlugin",Jc);var Zc="\n <svg viewBox='0 0 434 71'>\n <g>\n <path fill='#FFFFFF' d='M114.44 56.57l3.5 3.5a32.87 32.87 0 0 1-25.16 11.26c-19.63 0-33.62-15.54-33.62-35.16C59.16 16.55 73.16 1 92.78 1a32.31 32.31 0 0 1 24.19 10.4l-3.6 3.3a27.32 27.32 0 0 0-20.59-8.74c-16.91 0-28.39 13.5-28.39 30.21s11.48 30.21 28.39 30.21a28.08 28.08 0 0 0 21.66-9.81zM126.64 1h4.55v70.22h-4.73L126.64 1zm17.3 10.6a3.7 3.7 0 1 1 0 7.4 3.7 3.7 0 0 1 0-7.4zm-2.41 15.07h4.81v44.56h-4.81V26.67zm48 33.15l3.33 3.15a21.8 21.8 0 0 1-17.31 8.61c-12.59 0-21.76-10-21.76-22.22 0-12.22 9.17-22.22 21.76-22.22a21.84 21.84 0 0 1 16.85 8l-3.43 3.06a17.15 17.15 0 0 0-13.42-6.3c-10.09 0-16.76 8.15-16.76 17.5s6.67 17.5 16.76 17.5a17.38 17.38 0 0 0 13.98-7.08zm14.99-9.33v20.74h-4.73V1.01h4.73v47.75l20.74-19.02h6.64l-21.56 19.84L234 71.23h-7.01l-22.47-20.74z'/>\n <path fill='#F8981D' d='M304.09 19.4a5.56 5.56 0 1 1 0-11.12 5.56 5.56 0 0 1 0 11.12zm-5.56 7.27h11.11v44.56h-11.11V26.67zm61.42 22.15c0 .81 0 2.42-.09 4h-31.75c.8 3.77 5.2 8.61 11.93 8.61a17.11 17.11 0 0 0 11.66-4.31l5.38 8.16a27.23 27.23 0 0 1-17 6.1c-12.92 0-22.88-9.87-22.88-22.34s9.06-22.33 21.35-22.33c11.62-.04 21.4 9.02 21.4 22.11zm-10.77-3.76c-.18-3.68-3.58-8.62-10.67-8.62-6.91 0-10.05 4.85-10.4 8.62h21.07zM385.92 71h-6.42l-19.64-44.37h13.97l9.16 23.98 9.72-23.98h8.31l9.63 23.98 9.16-23.98h13.97L414.24 71h-6.52l-10.85-23.7L385.92 71zm-120.22.35h-6L226.11 1.01h17.01l19.42 44.18 18.08-44.18h16.91L265.7 71.35zM0 1l41 35L0 71V1z'/>\n </g>\n </svg>\n",tf=function(t,e,r){var n,i=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:window,a=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];var l=!1,c=function(){n=null,c=null,t.apply(this,s)};return!n&&r&&(t.apply(i,s),l=!0),o.clearTimeout(n),n=o.setTimeout(c,e),l};return a.cancel=function(){o.clearTimeout(n),n=null},a};function ef(t){return ef="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ef(t)}function rf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,nf(n.key),n)}}function nf(t){var e=function(t,e){if("object"!=ef(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=ef(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ef(e)?e:String(e)}function of(t,e,r){return e=sf(e),function(t,e){if(e&&("object"===ef(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return uf(t)}(t,af()?Reflect.construct(e,r||[],sf(t).constructor):e.apply(t,r))}function af(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(af=function(){return!!t})()}function sf(t){return sf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},sf(t)}function uf(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function lf(t,e){return lf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},lf(t,e)}var cf=function(t){function e(t,r){var n,i,o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=of(this,e,[t,r])).update=(i=n.update.bind(uf(n)),1e3,o=window.performance.now(),function(){var t=window.performance.now();t-o>=1e3&&(i.apply(void 0,arguments),o=t)}),t.on("timeupdate",n.update),t.one("dispose",(function(){t.off("timeupdate",n.update),n.el_.removeEventListener("click",n.pause)})),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&lf(t,e)}(e,t),r=e,(n=[{key:"update",value:function(){var t=this.player_.currentTime();this.el_.href=this.options_.getExternalLink({currentTime:Math.round(t)})}},{key:"buildCSSClass",value:function(){return"cv-open-externally-button"}},{key:"createEl",value:function(){var t={innerHTML:Zc,className:this.buildCSSClass()},e={type:"button",href:this.options_.getExternalLink({currentTime:0}),target:"_blank"},r=yl.dom.createEl("a",t,e);return this.createControlTextEl(r),r.addEventListener("click",this.pause.bind(this)),r}},{key:"pause",value:function(){this.player_.pause()}}])&&rf(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("Button"));function ff(t){return ff="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ff(t)}function hf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,pf(n.key),n)}}function pf(t){var e=function(t,e){if("object"!=ff(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=ff(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ff(e)?e:String(e)}function df(t,e,r){return e=mf(e),function(t,e){if(e&&("object"===ff(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,yf()?Reflect.construct(e,r||[],mf(t).constructor):e.apply(t,r))}function yf(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(yf=function(){return!!t})()}function mf(t){return mf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},mf(t)}function vf(t,e){return vf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},vf(t,e)}cf.prototype.controlText_="Open in ClickView",yl.registerComponent("OpenExternallyButton",cf);var gf=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=df(this,e,[t,r])).options=r,t.ready((function(){return n.onReady()})),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&vf(t,e)}(e,t),r=e,(n=[{key:"onReady",value:function(){var t=this.player.getChild("collapserator"),e=t.getChild("customControlSpacer"),r=t.children_.indexOf(e);t.addChild("OpenExternallyButton",{getExternalLink:this.options.getExternalLink},r+1)}}])&&hf(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getPlugin("plugin"));function bf(t){return bf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bf(t)}function _f(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,wf(n.key),n)}}function wf(t){var e=function(t,e){if("object"!=bf(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=bf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==bf(e)?e:String(e)}function Tf(t,e,r){return e=Of(e),function(t,e){if(e&&("object"===bf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Sf()?Reflect.construct(e,r||[],Of(t).constructor):e.apply(t,r))}function Sf(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Sf=function(){return!!t})()}function Ef(){return Ef="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Of(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},Ef.apply(this,arguments)}function Of(t){return Of=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Of(t)}function kf(t,e){return kf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},kf(t,e)}yl.registerPlugin("openExternallyPlugin",gf);var Cf=function(t){function e(t,r){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Tf(this,e,[t,r])}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&kf(t,e)}(e,t),r=e,(n=[{key:"buildCSSClass",value:function(){return"cv-touch-control-ui ".concat(Ef(Of(e.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(t,r,n){return Ef(Of(e.prototype),"createEl",this).call(this,t,Object.assign(Object.assign({},r),{className:this.buildCSSClass()}),n)}},{key:"setUi",value:function(t,e){var r=this,n=t>0,i=n?"cv-touch-right":"cv-touch-left";this.el_.className=this.buildCSSClass()+" cv-ui-touch-active",this.el_.innerHTML="\n <div class='".concat(i,"'>\n <div class='cv-touch-text'>\n ").concat(n?"+":"").concat(10*t,"s\n </div>\n </div>\n "),window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout((function(){r.removeText()}),e)}},{key:"removeText",value:function(){this.el_.className=this.buildCSSClass(),this.el_.innerHTML=""}}])&&_f(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("component"));function Pf(t){return Pf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pf(t)}function xf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,jf(n.key),n)}}function jf(t){var e=function(t,e){if("object"!=Pf(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Pf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Pf(e)?e:String(e)}function Lf(t,e,r){return e=Rf(e),function(t,e){if(e&&("object"===Pf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,If()?Reflect.construct(e,r||[],Rf(t).constructor):e.apply(t,r))}function If(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(If=function(){return!!t})()}function Af(){return Af="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Rf(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},Af.apply(this,arguments)}function Rf(t){return Rf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Rf(t)}function Df(t,e){return Df=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Df(t,e)}yl.registerComponent("TouchControls",Cf);var Mf=yl.getPlugin("plugin"),Nf=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=Lf(this,e,[t])).doubleTouchCount=0,r.seekStartTime=0,r.directionModifier=0,r.bindFunctions(),r.player.ready((function(){return r.initialize()})),r}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Df(t,e)}(e,t),r=e,(n=[{key:"bindFunctions",value:function(){this.onTouchStart=this.onTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.reBindEventListeners=this.reBindEventListeners.bind(this),this.unBindEventListeners=this.unBindEventListeners.bind(this)}},{key:"initialize",value:function(){var t=this;this.player.addChild("TouchControls"),this.touchControls=this.player.getChild("TouchControls"),this.player.on("ready",this.reBindEventListeners),this.one("dispose",(function(){t.player.off("ready",t.reBindEventListeners)})),this.reBindEventListeners()}},{key:"reBindEventListeners",value:function(){this.unBindEventListeners(),this.tech=this.player.tech(!0),"Html5"===this.tech.name()&&(this.tech.on("touchstart",this.onTouchStart),this.tech.on("touchend",this.onTouchEnd))}},{key:"unBindEventListeners",value:function(){this.tech&&"Html5"===this.tech.name()&&(this.tech.off("touchstart",this.onTouchStart),this.tech.off("touchend",this.onTouchEnd))}},{key:"dispose",value:function(){Af(Rf(e.prototype),"dispose",this).call(this),this.unBindEventListeners()}},{key:"onTouchStart",value:function(t){this.touchStartTime=t.timeStamp,this.userActive=this.player.userActive()}},{key:"onTouchEnd",value:function(t){var e=this;if(t.changedTouches.length){if(t.timeStamp-this.lastTouchTime<300)return this.onDoubleTouch(t),void(this.lastTouchTime=t.timeStamp);this.resetProperties(),this.lastTouchTime=t.timeStamp,t.timeStamp-this.touchStartTime<300&&window.setTimeout((function(){e.doubleTouchCount||(e.player.paused()?e.player.play():e.userActive&&e.player.pause())}),300)}}},{key:"resetProperties",value:function(){this.doubleTouchCount=0,this.seekStartTime=0,this.directionModifier=0}},{key:"onDoubleTouch",value:function(t){var e=this.player.el().getBoundingClientRect(),r=e.left+e.width/2;if(0===this.doubleTouchCount&&(this.seekStartTime=this.player.currentTime(),t.changedTouches[0].pageX<r?this.directionModifier=-1:this.directionModifier=1),this.doubleTouchCount++,this.directionModifier<0){if(10*this.doubleTouchCount>this.seekStartTime+10)return;return this.touchControls.setUi(-this.doubleTouchCount,900),void this.player.currentTime(this.player.currentTime()-10)}var n=this.player.duration()-this.seekStartTime;10*this.doubleTouchCount>n+10||(this.touchControls.setUi(this.doubleTouchCount,900),this.player.currentTime(this.player.currentTime()+10))}}])&&xf(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(Mf);function Bf(t){return Bf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bf(t)}function Uf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ff(n.key),n)}}function Ff(t){var e=function(t,e){if("object"!=Bf(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Bf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Bf(e)?e:String(e)}yl.registerPlugin("touchControls",Nf);var Vf=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.id=r.id,this.plugin=e,this.source=r,this.enabled=this.enabled.bind(this)}var e,r;return e=t,(r=[{key:"enabled",value:function(t){return void 0===t?this.plugin.currentSource===this.source:(t&&this.plugin.setSource(this.source.id),t)}}])&&Uf(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Hf(t){return Hf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hf(t)}function qf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,zf(n.key),n)}}function zf(t){var e=function(t,e){if("object"!=Hf(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Hf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Hf(e)?e:String(e)}function Wf(t,e,r){return e=Xf(e),function(t,e){if(e&&("object"===Hf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Gf()?Reflect.construct(e,r||[],Xf(t).constructor):e.apply(t,r))}function Gf(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Gf=function(){return!!t})()}function Xf(t){return Xf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xf(t)}function Kf(t,e){return Kf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Kf(t,e)}var Yf=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=Wf(this,e,[t])).options_=r,n.player.ready((function(){return n.initialize()})),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Kf(t,e)}(e,t),r=e,n=[{key:"initialize",value:function(){var t=this;this.sources=[],this.qualityLevels=this.player.qualityLevels(),this.populateSources(this.options_.sources),this.onQualityChange=this.onQualityChange.bind(this),this.qualityLevels.on("change",this.onQualityChange),this.player.one("dispose",(function(){t.qualityLevels.off("change",t.onQualityChange)}))}},{key:"currentSource",get:function(){return this._currentSource}},{key:"onQualityChange",value:function(){var t=this.qualityLevels[this.qualityLevels.selectedIndex];this.player.trigger("cv-quality-change",t.id)}},{key:"setSource",value:function(t){var e=this,r=this.getSourceById(t);if(null===r)return this.currentSource;var n=this.player.currentTime(),i=!this.player.paused();this._currentSource=r;var o=this.player.playbackRate();return this.player.src({src:r.url,type:r.mimeType}),this.player.one("loadedmetadata",(function(){e.player.playbackRate(o),e.player.currentTime()!==n&&e.player.currentTime(n),i&&e.player.play()})),this.trigger({event:"sourcechange",source:r}),this.sourceChangeUpdateQualityLevels(r),r}},{key:"getSourceById",value:function(t){return this.sources.find((function(e){return e.id===t}))}},{key:"repopulateSources",value:function(t){for(var e=null;this.qualityLevels.length;)this.qualityLevels[0].enabled&&(e=this.qualityLevels[0].id),this.qualityLevels.removeQualityLevel(this.qualityLevels[0]);this.sources=[],this.populateSources(t,e)}},{key:"sortSources",value:function(t){return t.sort((function(t,e){return t.id===e.id?0:+t.id>+e.id?-1:1}))}},{key:"populateSources",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=null;(t=this.sortSources(t)).forEach((function(t){e.qualityLevels.addQualityLevel(new Vf(e,t)),e.sources.push(t),e.trigger({event:"addsource",source:t}),null===r?t.default&&(n=t):t.id===r&&(n=t)})),null===n&&(n=this.sources[0]),null!==n&&this.setSource(n.id)}},{key:"sourceChangeUpdateQualityLevels",value:function(t){for(var e=this.qualityLevels,r=-1,n=0;n<e.length;n++)if(e[n].id===t.id){r=n;break}e.selectedIndex_=r,e.trigger({selectedIndex:r,type:"change"})}}],n&&qf(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getPlugin("plugin"));function Qf(t){return Qf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qf(t)}function $f(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Jf(n.key),n)}}function Jf(t){var e=function(t,e){if("object"!=Qf(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Qf(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Qf(e)?e:String(e)}yl.registerPlugin("progressiveFiles",Yf);var Zf=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,r;return e=t,r=[{key:"getKnownProfiles",value:function(){return["1080","720","480","360","240"]}},{key:"enableProfileOrNextBest",value:function(t,e){var r=t.getQualityLevelById(e);if(r||(r=this.getNextBestQuality(t,e)),!r)return null;for(var n=0;n<t.length;n++){var i=t[n];i.enabled=r.id===i.id}return r}},{key:"getNextBestQuality",value:function(t,e){var r=this.getKnownProfiles(),n=r.indexOf(e);if(n>=0){for(var i=n+1;i<r.length;i++){var o=r[i],a=t.getQualityLevelById(o);if(a)return a}for(var s=n-1;s>0;s--){var u=r[s],l=t.getQualityLevelById(u);if(l)return l}}return null}}],null&&$f(e.prototype,null),r&&$f(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function th(t){return th="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},th(t)}function eh(){eh=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),s=new j(n||[]);return i(a,"_invoke",{value:k(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var _={};l(_,a,(function(){return this}));var w=Object.getPrototypeOf,T=w&&w(w(L([])));T&&T!==r&&n.call(T,a)&&(_=T);var S=b.prototype=v.prototype=Object.create(_);function E(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==th(c)&&n.call(c,"__await")?e.resolve(c.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(c).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function k(e,r,n){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(th(e)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},E(O.prototype),l(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new O(c(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(x),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function rh(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,nh(n.key),n)}}function nh(t){var e=function(t,e){if("object"!=th(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=th(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==th(e)?e:String(e)}var ih=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.name=e.name,this.playbackProfile=e.playbackProfile,this.address=new URL(e.httpsAddress)}var e,r;return e=t,(r=[{key:"getUrl",value:function(t){return t?this.address+"cache?file="+encodeURIComponent(t):null}},{key:"ping",value:function(){return t=this,e=void 0,r=void 0,n=eh().mark((function t(){var e,r,n,i;return eh().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=new AbortController,r=setTimeout((function(){return e.abort()}),1e3),t.prev=3,t.next=6,fetch(this.address+"ping",{method:"GET",mode:"cors",signal:e.signal});case 6:return n=t.sent,t.next=9,n.text();case 9:return i=t.sent,clearTimeout(r),t.abrupt("return","PONG"===i);case 14:return t.prev=14,t.t0=t.catch(3),t.abrupt("return",!1);case 17:case"end":return t.stop()}}),t,this,[[3,14]])})),new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}));var t,e,r,n}}])&&rh(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function oh(t){return oh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oh(t)}function ah(){ah=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),s=new j(n||[]);return i(a,"_invoke",{value:k(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var _={};l(_,a,(function(){return this}));var w=Object.getPrototypeOf,T=w&&w(w(L([])));T&&T!==r&&n.call(T,a)&&(_=T);var S=b.prototype=v.prototype=Object.create(_);function E(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==oh(c)&&n.call(c,"__await")?e.resolve(c.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(c).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function k(e,r,n){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(oh(e)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},E(O.prototype),l(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new O(c(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(x),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function sh(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,uh(n.key),n)}}function uh(t){var e=function(t,e){if("object"!=oh(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=oh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==oh(e)?e:String(e)}var lh=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.player=e,this.logger=yl.log.createLogger("localcache")}var e,r;return e=t,(r=[{key:"setSource",value:function(t,e){return r=this,n=void 0,i=void 0,o=ah().mark((function r(){var n;return ah().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!this.player.localCache||void 0===(null==t?void 0:t.src)){r.next=5;break}return r.next=3,this.player.localCache().getActiveLocalCache();case 3:null!==(n=r.sent)&&(this.logger.debug("Using Local Cache",n),t.src=n.getUrl(t.src));case 5:e(null,t);case 6:case"end":return r.stop()}}),r,this)})),new(i||(i=Promise))((function(t,e){function a(t){try{u(o.next(t))}catch(t){e(t)}}function s(t){try{u(o.throw(t))}catch(t){e(t)}}function u(e){var r;e.done?t(e.value):(r=e.value,r instanceof i?r:new i((function(t){t(r)}))).then(a,s)}u((o=o.apply(r,n||[])).next())}));var r,n,i,o}}])&&sh(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ch(t){return ch="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ch(t)}function fh(){fh=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),s=new j(n||[]);return i(a,"_invoke",{value:k(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var _={};l(_,a,(function(){return this}));var w=Object.getPrototypeOf,T=w&&w(w(L([])));T&&T!==r&&n.call(T,a)&&(_=T);var S=b.prototype=v.prototype=Object.create(_);function E(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==ch(c)&&n.call(c,"__await")?e.resolve(c.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(c).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function k(e,r,n){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(ch(e)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},E(O.prototype),l(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new O(c(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(x),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function hh(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ph(n.key),n)}}function ph(t){var e=function(t,e){if("object"!=ch(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=ch(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ch(e)?e:String(e)}function dh(t,e,r){return e=gh(e),function(t,e){if(e&&("object"===ch(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return mh(t)}(t,yh()?Reflect.construct(e,r||[],gh(t).constructor):e.apply(t,r))}function yh(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(yh=function(){return!!t})()}function mh(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function vh(){return vh="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=gh(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},vh.apply(this,arguments)}function gh(t){return gh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},gh(t)}function bh(t,e){return bh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},bh(t,e)}yl.use("*",(function(t){return new lh(t)}));var _h='<?xml version="1.0" encoding="UTF-8"?><svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Artboard" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.9"><g id="Local-Cache" transform="translate(2.000000, 2.000000)"><rect id="Rectangle" fill="#FFFFFF" x="0" y="2.4" width="18.8" height="15.2"></rect><ellipse id="Oval" fill="#FFFFFF" cx="9.4" cy="2.4" rx="9.4" ry="2.4"></ellipse><ellipse id="Oval-Copy" fill="#FFFFFF" cx="9.4" cy="17.6" rx="9.4" ry="2.4"></ellipse><g id="Logo/Circle" transform="translate(2.500000, 3.000000)"><circle id="Oval" fill="#FFFFFF" cx="7" cy="7" r="7"></circle><polygon id="Fill-1" fill="#F8981D" points="4.66666667 2.33333333 4.66666667 11.4245258 10.0383286 6.87866667"></polygon></g></g></g></svg>',wh=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=dh(this,e,[t,r])).hide(),n.onLocalCacheChange=n.onLocalCacheChange.bind(mh(n)),t.ready((function(){n.initialize()})),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&bh(t,e)}(e,t),r=e,(n=[{key:"createEl",value:function(){return vh(gh(e.prototype),"createEl",this).call(this,"div",{className:"vjs-local-cache-indicator",innerHTML:'<div class="vjs-local-cache-indicator-icon">'.concat(_h,"</div>"),title:"Streaming from ClickView Local Cache"})}},{key:"initialize",value:function(){var t=this;this.localCachePlugin=this.player_.localCache(),this.localCachePlugin&&(this.localCachePlugin.on("localcachechanged",this.onLocalCacheChange),this.player_.on("dispose",(function(){t.localCachePlugin.off("localcachechanged",t.onLocalCacheChange)})),this.onLocalCacheChange())}},{key:"onLocalCacheChange",value:function(){return t=this,e=void 0,r=void 0,n=fh().mark((function t(){return fh().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.localCachePlugin.getActiveLocalCache();case 2:t.sent?this.show():this.hide();case 4:case"end":return t.stop()}}),t,this)})),new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}));var t,e,r,n}}])&&hh(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("Component"));function Th(t){return Th="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Th(t)}function Sh(){Sh=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),s=new j(n||[]);return i(a,"_invoke",{value:k(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var _={};l(_,a,(function(){return this}));var w=Object.getPrototypeOf,T=w&&w(w(L([])));T&&T!==r&&n.call(T,a)&&(_=T);var S=b.prototype=v.prototype=Object.create(_);function E(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Th(c)&&n.call(c,"__await")?e.resolve(c.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(c).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function k(e,r,n){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(Th(e)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},E(O.prototype),l(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new O(c(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(x),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Eh(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Oh(n.key),n)}}function Oh(t){var e=function(t,e){if("object"!=Th(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Th(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Th(e)?e:String(e)}function kh(t,e,r){return e=xh(e),function(t,e){if(e&&("object"===Th(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ch()?Reflect.construct(e,r||[],xh(t).constructor):e.apply(t,r))}function Ch(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ch=function(){return!!t})()}function Ph(){return Ph="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=xh(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},Ph.apply(this,arguments)}function xh(t){return xh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},xh(t)}function jh(t,e){return jh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},jh(t,e)}yl.registerComponent("localCacheIndicator",wh);var Lh=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))},Ih=function(t){function e(t,r){var n;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=kh(this,e,[t])).logger_=yl.log.createLogger("localcache"),void 0===r)throw Error("no options defined");return n.localCaches_=r.localCacheAddresses.map((function(t){return new ih(t)})),n.player.ready((function(){n.initialize(),r.enabled&&n.enable()})),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&jh(t,e)}(e,t),r=e,n=[{key:"isEnabled",get:function(){return this.enabled_}},{key:"enable",value:function(){this.enabled_=!0,this.resetActiveLocalCache()}},{key:"disable",value:function(){this.enabled_=!1}},{key:"getActiveLocalCache",value:function(){return this.enabled_?this.activeLocalCache_:null}},{key:"resetActiveLocalCache",value:function(){this.clearActiveLocalCache(),this.activeLocalCache_=this.getActiveLocalCacheInternal()}},{key:"clearActiveLocalCache",value:function(){this.activeLocalCache_&&(this.activeLocalCache_=null,this.onLocalCacheChange(null))}},{key:"removeLocalCache",value:function(t){this.localCaches_=this.localCaches_.filter((function(e){return e!==t}))}},{key:"dispose",value:function(){Ph(xh(e.prototype),"dispose",this).call(this)}},{key:"initialize",value:function(){this.player.controlBar.addChild("localCacheIndicator")}},{key:"handleNetworkError",value:function(){return Lh(this,void 0,void 0,Sh().mark((function t(){var e;return Sh().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getActiveLocalCache();case 2:if(!(e=t.sent)){t.next=8;break}return t.next=6,e.ping();case 6:t.sent&&this.removeLocalCache(e);case 8:return this.resetActiveLocalCache(),t.next=11,this.getActiveLocalCache();case 11:return this.resetSource(),t.abrupt("return",!0);case 13:case"end":return t.stop()}}),t,this)})))}},{key:"resetSource",value:function(){for(var t=this.player.qualityLevels(),e=0;e<t.length;e++)t[e].enabled&&(t[e].enabled=!0)}},{key:"getActiveLocalCacheInternal",value:function(){return Lh(this,void 0,void 0,Sh().mark((function t(){var e,r,n,i=this;return Sh().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=[],r=function(t){return Lh(i,void 0,void 0,Sh().mark((function r(){return Sh().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.ping();case 2:if(!r.sent){r.next=4;break}e.push(t);case 4:case"end":return r.stop()}}),r)})))},t.next=4,Promise.all(this.localCaches_.map((function(t){return r(t)})));case 4:if(!(e.length>0)){t.next=8;break}return n=e[0],this.onLocalCacheChange(n),t.abrupt("return",n);case 8:return t.abrupt("return",null);case 9:case"end":return t.stop()}}),t,this)})))}},{key:"onLocalCacheChange",value:function(t){this.logger_.debug("Local Cache changed",t),this.trigger("localcachechanged",{localCache:t});var e=!1;t&&t.playbackProfile&&(this.logger_.debug("Changing active profile for local cache",t.playbackProfile),Zf.enableProfileOrNextBest(this.player.qualityLevels(),t.playbackProfile),e=!0),e||this.player.src(this.player.src())}}],n&&Eh(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getPlugin("plugin"));function Ah(t){return Ah="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ah(t)}function Rh(t){var e="function"==typeof Map?new Map:void 0;return Rh=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return function(t,e,r){if(Dh())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&Mh(i,r.prototype),i}(t,arguments,Nh(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Mh(r,t)},Rh(t)}function Dh(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Dh=function(){return!!t})()}function Mh(t,e){return Mh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Mh(t,e)}function Nh(t){return Nh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Nh(t)}yl.registerPlugin("localCache",Ih);var Bh=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=function(t,e,r){return e=Nh(e),function(t,e){if(e&&("object"===Ah(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Dh()?Reflect.construct(e,r||[],Nh(t).constructor):e.apply(t,r))}(this,e,[(null==r?void 0:r.title)||"Ajax error"])).url=t,n.response=r,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Mh(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(Rh(Error));function Uh(t){return Uh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uh(t)}function Fh(){Fh=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),s=new j(n||[]);return i(a,"_invoke",{value:k(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var _={};l(_,a,(function(){return this}));var w=Object.getPrototypeOf,T=w&&w(w(L([])));T&&T!==r&&n.call(T,a)&&(_=T);var S=b.prototype=v.prototype=Object.create(_);function E(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Uh(c)&&n.call(c,"__await")?e.resolve(c.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(c).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function k(e,r,n){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(Uh(e)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},E(O.prototype),l(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new O(c(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(x),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Vh(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Hh(n.key),n)}}function Hh(t){var e=function(t,e){if("object"!=Uh(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Uh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Uh(e)?e:String(e)}var qh=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))},zh=new(function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.tokens={gateway:null}}var e,r;return e=t,r=[{key:"get",value:function(t,e){return qh(this,void 0,void 0,Fh().mark((function r(){return Fh().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.t0=this,r.next=3,fetch(t,{method:"GET",mode:"cors",headers:this.getHeaders(e)});case 3:return r.t1=r.sent,r.next=6,r.t0.parseResponse.call(r.t0,r.t1);case 6:return r.abrupt("return",r.sent);case 7:case"end":return r.stop()}}),r,this)})))}},{key:"delete",value:function(t,e){return qh(this,void 0,void 0,Fh().mark((function r(){return Fh().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,fetch(t,{method:"DELETE",headers:this.getHeaders(e)});case 2:case"end":return r.stop()}}),r,this)})))}},{key:"post",value:function(t,e,r){return qh(this,void 0,void 0,Fh().mark((function n(){return Fh().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.t0=this,n.next=3,fetch(t,{method:"POST",headers:this.getHeaders(r),body:e,mode:"cors"});case 3:return n.t1=n.sent,n.next=6,n.t0.parseResponse.call(n.t0,n.t1);case 6:return n.abrupt("return",n.sent);case 7:case"end":return n.stop()}}),n,this)})))}},{key:"put",value:function(t,e,r){return qh(this,void 0,void 0,Fh().mark((function n(){return Fh().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.t0=this,n.next=3,fetch(t,{method:"PUT",headers:this.getHeaders(r),body:e,mode:"cors"});case 3:return n.t1=n.sent,n.next=6,n.t0.parseResponse.call(n.t0,n.t1);case 6:return n.abrupt("return",n.sent);case 7:case"end":return n.stop()}}),n,this)})))}},{key:"setToken",value:function(t,e){this.tokens[t]=e}},{key:"getHeaders",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={"Content-Type":"application/json"};return this.tokens[t.tokenName]&&(e.authorization="Bearer ".concat(this.tokens[t.tokenName])),e}},{key:"parseResponse",value:function(t){return qh(this,void 0,void 0,Fh().mark((function e(){var r,n;return Fh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(404!==t.status){e.next=2;break}return e.abrupt("return",null);case 2:if(t.ok){e.next=15;break}return e.prev=3,e.next=6,t.json();case 6:r=e.sent,e.next=12;break;case 9:throw e.prev=9,e.t0=e.catch(3),new Bh(t.url);case 12:throw e.prev=12,new Bh(t.url,r);case 15:return e.next=17,t.json();case 17:return n=e.sent,e.abrupt("return",n);case 19:case"end":return e.stop()}}),e,null,[[3,9,12,15]])})))}}],r&&Vh(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}());function Wh(t){return Wh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wh(t)}function Gh(){Gh=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),s=new j(n||[]);return i(a,"_invoke",{value:k(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var _={};l(_,a,(function(){return this}));var w=Object.getPrototypeOf,T=w&&w(w(L([])));T&&T!==r&&n.call(T,a)&&(_=T);var S=b.prototype=v.prototype=Object.create(_);function E(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Wh(c)&&n.call(c,"__await")?e.resolve(c.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(c).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function k(e,r,n){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(Wh(e)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},E(O.prototype),l(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new O(c(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(x),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Xh(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Kh(n.key),n)}}function Kh(t){var e=function(t,e){if("object"!=Wh(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Wh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Wh(e)?e:String(e)}function Yh(t,e,r){return e=Jh(e),function(t,e){if(e&&("object"===Wh(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Qh()?Reflect.construct(e,r||[],Jh(t).constructor):e.apply(t,r))}function Qh(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Qh=function(){return!!t})()}function $h(){return $h="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Jh(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},$h.apply(this,arguments)}function Jh(t){return Jh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Jh(t)}function Zh(t,e){return Zh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Zh(t,e)}var tp=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))},ep=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=Yh(this,e,[t])).playerApi=r.playerApi,n.fileToken=r.fileToken,n.logger=yl.log.createLogger("video-signature-expiry-plugin"),n.bindErrorHandlers(),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Zh(t,e)}(e,t),r=e,(n=[{key:"bindErrorHandlers",value:function(){this.onError=this.onError.bind(this),this.player.on("error",this.onError)}},{key:"dispose",value:function(){this.player.off("error",this.onError),$h(Jh(e.prototype),"dispose",this).call(this)}},{key:"onError",value:function(){return tp(this,void 0,void 0,Gh().mark((function t(){var e,r=this;return Gh().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((e=this.player.error().code)===MediaError.MEDIA_ERR_NETWORK||e===MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED){t.next=3;break}return t.abrupt("return");case 3:return t.next=5,this.player.localCache().getActiveLocalCache();case 5:if(!t.sent){t.next=8;break}return this.callErrorHandler((function(){return r.player.localCache().handleNetworkError()})),t.abrupt("return");case 8:this.callErrorHandler((function(){return r.handleVideoSignatureExpiry()}));case 9:case"end":return t.stop()}}),t,this)})))}},{key:"handleVideoSignatureExpiry",value:function(){return tp(this,void 0,void 0,Gh().mark((function t(){var e,r;return Gh().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.playerApi&&this.fileToken){t.next=2;break}return t.abrupt("return",!1);case 2:if(!(this.refetchedSourcesTimestamp+9e5>Date.now())){t.next=4;break}return t.abrupt("return",!1);case 4:return this.refetchedSourcesTimestamp=Date.now(),e=null,t.prev=6,this.logger.debug("Detected expired mp4 urls, attempting to refetch"),r="".concat(this.playerApi.origin,"/api/files?fileToken=").concat(this.fileToken),t.next=11,zh.get(r);case 11:e=t.sent,t.next=18;break;case 14:return t.prev=14,t.t0=t.catch(6),this.logger.error("Failed to refetch expired mp4 urls"),t.abrupt("return",!1);case 18:return this.logger.debug("Mp4 urls successfully refetched"),this.player.progressiveFiles().repopulateSources(e.progressive.map((function(t){return{id:t.profile,mimeType:t.mimeType,url:t.url}}))),this.fileToken=e.fileToken,t.abrupt("return",!0);case 22:case"end":return t.stop()}}),t,this,[[6,14]])})))}},{key:"callErrorHandler",value:function(t){return tp(this,void 0,void 0,Gh().mark((function e(){var r,n,i,o,a=this;return Gh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.player.currentTime(),n=!this.player.paused(),i=this.player.playbackRate(),o=function(){a.player.playbackRate(i),a.player.currentTime(r),n&&a.player.play(),a.player.error(null)},this.player.one("loadedmetadata",o),e.next=7,t();case 7:if(!e.sent){e.next=9;break}return e.abrupt("return");case 9:this.player.off("loadedmetadata",o);case 10:case"end":return e.stop()}}),e,this)})))}}])&&Xh(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getPlugin("plugin"));function rp(t){return rp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rp(t)}function np(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ip(n.key),n)}}function ip(t){var e=function(t,e){if("object"!=rp(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=rp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==rp(e)?e:String(e)}function op(t,e,r){return e=sp(e),function(t,e){if(e&&("object"===rp(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ap()?Reflect.construct(e,r||[],sp(t).constructor):e.apply(t,r))}function ap(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ap=function(){return!!t})()}function sp(t){return sp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},sp(t)}function up(t,e){return up=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},up(t,e)}yl.registerPlugin("handleNetworkErrors",ep);var lp=yl.getPlugin("plugin"),cp="cvplayer-show-subtitles",fp="cvplayer-selected-language",hp="cvplayer-subtitle-size",pp=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=op(this,e,[t])).options=r,n.initialize(),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&up(t,e)}(e,t),r=e,n=[{key:"initialize",value:function(){this.applyUserPreferences=this.applyUserPreferences.bind(this),this.player.textTracks().length&&(this.bindEventListeners(),this.applyUserPreferences())}},{key:"applyUserPreferences",value:function(){var t=!!this.options.showSubtitles,e=this.safeGet(cp);if("true"===e&&(t=!0),"false"===e&&(t=!1),t){var r=this.guessWhichTrack();r&&(r.mode="showing")}else this.disableSubtitles();var n=this.safeGet(hp);n||(n=this.options.subtitleSize),this.player.options_.mobile&&(n="medium"),n&&this.player.textTrackSettings.setSizeSetting(n)}},{key:"safeGet",value:function(t){if(Al())return Rl(t)}},{key:"onSelectedLanguageChange",value:function(){for(var t,e,r=this.player.textTracks(),n=0;n<r.length;n++){var i=r[n];if("showing"===i.mode)return Dl(cp,"true"),Dl(fp,i.language),void(null===(t=this.options.analyticsService)||void 0===t||t.logUserAction({language:i.language},{actionType:zl.Select,entity:Wl.Subtitle,workflowPhase:Xl.Complete,descriptor:cc.On}))}var o;Dl(cp,"false"),o=fp,window.localStorage.removeItem(o),null===(e=this.options.analyticsService)||void 0===e||e.logUserAction({language:""},{actionType:zl.Select,entity:Wl.Subtitle,workflowPhase:Xl.Complete,descriptor:cc.Off,eventVersion:Cc.V3})}},{key:"bindEventListeners",value:function(){var t=this;Al()&&(this.onSelectedLanguageChange=this.onSelectedLanguageChange.bind(this),this.onChangeSubtitleSize=this.onChangeSubtitleSize.bind(this),this.player.on("cv:languageselected",this.onSelectedLanguageChange),this.player.on("changesubtitlesize",this.onChangeSubtitleSize),this.one("dispose",(function(){t.player.off("cv:languageselected",t.onSelectedLanguageChange),t.player.off("changesubtitlesize",t.onChangeSubtitleSize)})))}},{key:"onChangeSubtitleSize",value:function(){var t=this.player.textTrackSettings.getSizeSetting();Dl(hp,t)}},{key:"guessWhichTrack",value:function(){for(var t,e,r=this.safeGet(fp)||window.navigator.language,n=this.getLanguageParts(r),i=n.language,o=n.country,a=this.player.textTracks(),s=0;s<a.length;s++){var u=a[s],l=this.getLanguageParts(u.language),c=l.language,f=l.country;if(c===i&&(t=u,f||(e=u),f===o))return t}return e||t||null}},{key:"getLanguageParts",value:function(t){var e=t.toLowerCase().split("-");return{language:e[0],country:e[1]}}},{key:"disableSubtitles",value:function(){for(var t=this.player.textTracks(),e=0;e<t.length;e++)t[e].mode="disabled"}},{key:"previewModeSubtitles",value:function(){var t=this.guessWhichTrack();t&&(t.mode="showing"),this.player.off("changesubtitlesize",this.onChangeSubtitleSize),this.player.textTrackSettings.setSizeSetting("large"),this.player.on("changesubtitlesize",this.onChangeSubtitleSize)}}],n&&np(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(lp);function dp(t){return dp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dp(t)}function yp(){yp=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),s=new j(n||[]);return i(a,"_invoke",{value:k(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var _={};l(_,a,(function(){return this}));var w=Object.getPrototypeOf,T=w&&w(w(L([])));T&&T!==r&&n.call(T,a)&&(_=T);var S=b.prototype=v.prototype=Object.create(_);function E(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==dp(c)&&n.call(c,"__await")?e.resolve(c.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(c).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function k(e,r,n){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(dp(e)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},E(O.prototype),l(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new O(c(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(x),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function mp(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,vp(n.key),n)}}function vp(t){var e=function(t,e){if("object"!=dp(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=dp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==dp(e)?e:String(e)}function gp(t,e,r){return e=_p(e),function(t,e){if(e&&("object"===dp(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,bp()?Reflect.construct(e,r||[],_p(t).constructor):e.apply(t,r))}function bp(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(bp=function(){return!!t})()}function _p(t){return _p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_p(t)}function wp(t,e){return wp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},wp(t,e)}yl.registerPlugin("persistSubtitleSettingsPlugin",pp);var Tp=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))},Sp=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=gp(this,e,[t])).options=r,n.player.ready((function(){return n.initialize()})),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wp(t,e)}(e,t),r=e,n=[{key:"initialize",value:function(){return Tp(this,void 0,void 0,yp().mark((function t(){var e,r,n,i,o=this;return yp().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getActiveLocalCache();case 2:if(e=t.sent,(r=e?this.options.playbackProfileLocalCache:this.options.playbackProfile)||(r="1080"),Al()&&(n=Rl(this.getStorageKey(!!e)))&&(r=n),i=this.player.qualityLevels(),(null==e?void 0:e.playbackProfile)||Zf.enableProfileOrNextBest(i,r),Al()){t.next=10;break}return t.abrupt("return");case 10:this.onQualityLevelsChange=this.onQualityLevelsChange.bind(this),i.on("change",this.onQualityLevelsChange),this.on("dispose",(function(){i.off("change",o.onQualityLevelsChange)}));case 13:case"end":return t.stop()}}),t,this)})))}},{key:"onQualityLevelsChange",value:function(){var t;return Tp(this,void 0,void 0,yp().mark((function e(){var r,n,i;return yp().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.isLocalCacheActive();case 2:r=e.sent,n=this.player.qualityLevels(),i=n[n.selectedIndex],Dl(this.getStorageKey(r),i.id),null===(t=this.options.analyticsService)||void 0===t||t.logUserAction({quality:i.id},{actionType:zl.Select,workflowPhase:Xl.Complete,descriptor:ec.ChangeResolution,entity:Wl.Resolution,eventVersion:Cc.V3});case 7:case"end":return e.stop()}}),e,this)})))}},{key:"isLocalCacheActive",value:function(){return Tp(this,void 0,void 0,yp().mark((function t(){return yp().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.player.localCache().getActiveLocalCache();case 2:return t.abrupt("return",!!t.sent);case 3:case"end":return t.stop()}}),t,this)})))}},{key:"getActiveLocalCache",value:function(){return this.player.localCache().getActiveLocalCache()}},{key:"getStorageKey",value:function(t){return t?"cvplayer-localcache-playback-quality":"cvplayer-playback-quality"}}],n&&mp(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getPlugin("plugin"));function Ep(t){return Ep="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ep(t)}function Op(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function kp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Cp(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,xp(n.key),n)}}function Pp(t,e,r){return e&&Cp(t.prototype,e),r&&Cp(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function xp(t){var e=function(t,e){if("object"!=Ep(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Ep(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ep(e)?e:String(e)}function jp(t,e,r){return e=Ip(e),function(t,e){if(e&&("object"===Ep(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Lp()?Reflect.construct(e,r||[],Ip(t).constructor):e.apply(t,r))}function Lp(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Lp=function(){return!!t})()}function Ip(t){return Ip=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ip(t)}function Ap(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Rp(t,e)}function Rp(t,e){return Rp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Rp(t,e)}yl.registerPlugin("persistQualitySettingsPlugin",Sp);var Dp=yl.getComponent("Component"),Mp=function(t){function e(t,r){return kp(this,e),jp(this,e,[t,r])}return Ap(e,t),Pp(e,[{key:"createEl",value:function(){return yl.dom.createEl("div",{className:"cv-progress-reporter-item"})}},{key:"update",value:function(){var t=this.options_.event,e=this.player_.duration(),r=(t.end.time-t.start.time)/e;this.el_.style.width=100*r+"%";var n=t.start.time/e;this.el_.style.left=100*n+"%"}}]),e}(Dp),Np=function(t){function e(){var t;return kp(this,e),(t=jp(this,e,arguments)).events_=[],t}return Ap(e,t),Pp(e,[{key:"update",value:function(){for(var t=this,e=this.children(),r=e.length;r>0;r--)this.removeChild(e[r]);this.events_.forEach((function(e){var r=new Mp(t.player(),{event:e});t.addChild(r),r.update()}))}},{key:"addEvents",value:function(t){var e,r;(e=this.events_).push.apply(e,function(t){if(Array.isArray(t))return Op(t)}(r=t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||function(t,e){if(t){if("string"==typeof t)return Op(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Op(t,e):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),this.update()}},{key:"createEl",value:function(){return yl.dom.createEl("div",{className:"cv-progress-reporter-display"})}}]),e}(Dp);function Bp(t){return Bp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bp(t)}function Up(t,e,r){return(e=Vp(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Fp(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Vp(n.key),n)}}function Vp(t){var e=function(t,e){if("object"!=Bp(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Bp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Bp(e)?e:String(e)}function Hp(t,e,r){return e=zp(e),function(t,e){if(e&&("object"===Bp(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,qp()?Reflect.construct(e,r||[],zp(t).constructor):e.apply(t,r))}function qp(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(qp=function(){return!!t})()}function zp(t){return zp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},zp(t)}function Wp(t,e){return Wp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Wp(t,e)}var Gp=yl.getPlugin("plugin"),Xp="play",Kp="playing",Yp="pause",Qp="seekstart",$p="ended",Jp="pausedseek",Zp=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=Hp(this,e,[t,r])).eventBuffer=[],n.latestTime=0,n.lastPlayingTime=0,n.isPlaying=!1,n.isSeeking=!1,n.hasEnded=!1,n.shouldLogPlayOnTimeUpdate=!1,n.options=r,n.player.ready((function(){return n.initialize()})),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wp(t,e)}(e,t),r=e,n=[{key:"initialize",value:function(){this.validateOptions(),this.bindListeners(),this.startInterval(),this.addEasterEgg()}},{key:"validateOptions",value:function(){if("function"!=typeof this.options.onFlush)throw new Error("Please provide the onFlush option")}},{key:"bindListeners",value:function(){var t=this,e=Up(Up(Up(Up(Up(Up({},Xp,(function(){return t.onPlay()})),Yp,(function(){return t.onPause()})),"timeupdate",(function(){return t.onTimeUpdate()})),"seeking",(function(){return t.onSeeking()})),$p,(function(){return t.onEnded()})),Kp,(function(){return t.onPlaying()})),r=Object.keys(e);r.forEach((function(r){return t.player.on(r,e[r])})),this.one("dispose",(function(){r.forEach((function(r){return t.player.off(r,e[r])}))}))}},{key:"startInterval",value:function(){var t=this,e=this.options.interval||5e3;this.interval=window.setInterval((function(){return t.flushBuffer()}),e),this.player.one("dispose",(function(){return window.clearInterval(t.interval)}))}},{key:"addEasterEgg",value:function(){var t,e,r=this,n="",i=function(e){"ArrowUpArrowUpArrowDownArrowDownArrowLeftArrowRightArrowLeftArrowRightba"===(n+=e.key)&&r.addDisplay(),window.clearTimeout(t),t=window.setTimeout((function(){n=""}),500)},o=!1,a=function(){o=!0,e=window.setTimeout((function(){o&&r.addDisplay()}),1e4)};function s(){o=!1,window.clearTimeout(e)}this.player.el().addEventListener("keyup",i);var u=this.player.getChild("Collapserator").getChild("PlayToggle");u.on("touchstart",a),u.on("touchend",s),this.player.one("dispose",(function(){var t,e;null===(e=null===(t=r.player)||void 0===t?void 0:t.el())||void 0===e||e.removeEventListener("keyup",i),u.off("touchstart",a),u.off("touchend",s)}))}},{key:"addDisplay",value:function(){var t=this;this.progressReporterDisplay||(this.progressReporterDisplay=new Np(this.player),this.player.addChild(this.progressReporterDisplay),this.player.options_.inactivityTimeout=0,this.player.one("dispose",(function(){t.progressReporterDisplay=void 0})))}},{key:"onPlay",value:function(){return this.isPlaying=!0,this.isSeeking?(this.logEvent("seekend"),void(this.isSeeking=!1)):this.hasEnded?(this.shouldLogPlayOnTimeUpdate=!0,void(this.hasEnded=!1)):void this.logEvent(Xp)}},{key:"onPause",value:function(){var t=this;this.isSeeking||(this.pauseTimeout=window.setTimeout((function(){t.isPlaying=!1,t.logEvent(Yp),delete t.pauseTimeout}),50))}},{key:"onTimeUpdate",value:function(){this.shouldLogPlayOnTimeUpdate&&(this.shouldLogPlayOnTimeUpdate=!1,this.logEvent(Xp)),this.isPlaying&&!this.isSeeking&&this.logEvent(Kp)}},{key:"onSeeking",value:function(){this.pauseTimeout&&(this.latestTime=this.previousLatestTime,window.clearTimeout(this.pauseTimeout),delete this.pauseTimeout),this.isPlaying||this.logEvent(Jp),!this.isSeeking&&this.isPlaying&&(this.isSeeking=!0,this.logEvent(Qp))}},{key:"onEnded",value:function(){this.hasEnded=!0,this.logEvent($p)}},{key:"onPlaying",value:function(){this.isSeeking=!1,this.isPlaying=!0}},{key:"logEvent",value:function(t){if(this.player){var e=this.player.currentTime();t===Qp&&(e=this.latestTime),this.previousLatestTime=this.latestTime,this.latestTime=this.player.currentTime(),this.eventBuffer.push({time:e,type:t})}}},{key:"shouldUseCarriedOverTime",value:function(t){return this.lastPlayingTime&&(t===Kp||t===Xp)}},{key:"shouldSaveCarriedOverTime",value:function(t){return t===Kp||t===Yp}},{key:"shouldClearCarriedOverTime",value:function(t){return t===$p||t===Jp}},{key:"flushBuffer",value:function(){for(var t,e,r=[],n={};this.eventBuffer.length;){var i=this.eventBuffer.shift();this.shouldClearCarriedOverTime(i.type)?delete this.lastPlayingTime:n.start?i.type===Kp&&this.eventBuffer.length>0||(this.shouldSaveCarriedOverTime(i.type)&&(this.lastPlayingTime=i.time),n.end=i,r.push(n),n={}):(this.shouldUseCarriedOverTime(i.type)&&(i.time=this.lastPlayingTime,delete this.lastPlayingTime),n.start=i)}this.eventBuffer=[],r.length&&this.validateEvents(r)&&(this.options.onFlush(r),null===(t=this.player)||void 0===t||t.trigger("progressflush"),null===(e=this.progressReporterDisplay)||void 0===e||e.addEvents(r))}},{key:"validateEvents",value:function(t){var e=0;t.forEach((function(t){e+=t.end.time-t.start.time}));var r=this.options.interval||5e3;return r/=1e3,r+=.5,r*=this.player.playbackRate(),e<r}}],n&&Fp(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(Gp);function td(t){return td="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},td(t)}function ed(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,rd(n.key),n)}}function rd(t){var e=function(t,e){if("object"!=td(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=td(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==td(e)?e:String(e)}function nd(t,e,r){return e=od(e),function(t,e){if(e&&("object"===td(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,id()?Reflect.construct(e,r||[],od(t).constructor):e.apply(t,r))}function id(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(id=function(){return!!t})()}function od(t){return od=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},od(t)}function ad(t,e){return ad=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ad(t,e)}yl.registerPlugin("progressReporterPlugin",Zp);var sd=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),nd(this,e,arguments)}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ad(t,e)}(e,t),r=e,(n=[{key:"createEl",value:function(){return yl.dom.createEl("span",{innerHTML:'<span class="vjs-icon-placeholder"></span>',className:"cv-drag-handle vjs-control vjs-button"},{})}}])&&ed(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("Component")),ud=["top","left","right","bottom"],ld={top:"Top",left:"Left",right:"Right",bottom:"Bottom"};function cd(t){return cd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cd(t)}function fd(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hd(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,dd(n.key),n)}}function pd(t,e,r){return e&&hd(t.prototype,e),r&&hd(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function dd(t){var e=function(t,e){if("object"!=cd(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=cd(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==cd(e)?e:String(e)}function yd(t,e,r){return e=gd(e),function(t,e){if(e&&("object"===cd(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,md()?Reflect.construct(e,r||[],gd(t).constructor):e.apply(t,r))}function md(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(md=function(){return!!t})()}function vd(){return vd="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=gd(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},vd.apply(this,arguments)}function gd(t){return gd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},gd(t)}function bd(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_d(t,e)}function _d(t,e){return _d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_d(t,e)}var wd=yl.getComponent("Component"),Td=function(t){function e(t,r){var n;return fd(this,e),(n=yd(this,e,[t,r])).bindEventListeners(),n}return bd(e,t),pd(e,[{key:"createEl",value:function(){return vd(gd(e.prototype),"createEl",this).call(this,"div",{},{class:"cv-drop-target cv-drop-".concat(this.options_.side)})}},{key:"bindEventListeners",value:function(){var t=this,e=this.el(),r=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move",t.addClass("cv-drag-over")},n=function(e){e.preventDefault(),t.removeClass("cv-drag-over"),t.player_.whiteboardModePlugin().setWhiteboardMode(t.options_.side)},i=function(){t.removeClass("cv-drag-over")};e.addEventListener("dragover",r),e.addEventListener("drop",n),e.addEventListener("dragleave",i),this.on("dispose",(function(){e.removeEventListener("dragover",r),e.removeEventListener("drop",n),e.removeEventListener("dragleave",i)}))}}]),e}(wd),Sd=function(t){function e(t,r){var n;return fd(this,e),(n=yd(this,e,[t,r])).addChildren(),n}return bd(e,t),pd(e,[{key:"addChildren",value:function(){var t=this;ud.forEach((function(e){t.addChild(new Td(t.player_,{side:e}))}))}}]),e}(wd);function Ed(t){return Ed="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ed(t)}function Od(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,kd(n.key),n)}}function kd(t){var e=function(t,e){if("object"!=Ed(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Ed(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ed(e)?e:String(e)}function Cd(t,e,r){return e=jd(e),function(t,e){if(e&&("object"===Ed(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Pd()?Reflect.construct(e,r||[],jd(t).constructor):e.apply(t,r))}function Pd(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Pd=function(){return!!t})()}function xd(){return xd="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=jd(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},xd.apply(this,arguments)}function jd(t){return jd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},jd(t)}function Ld(t,e){return Ld=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ld(t,e)}var Id=function(t){function e(t,r){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Cd(this,e,[t,r])}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ld(t,e)}(e,t),r=e,(n=[{key:"createEl",value:function(){return yl.dom.createEl("li",{className:"vjs-menu-item cv-collapsible-menu-heading cv-divider-after-menu-item",innerHTML:'<span class="vjs-menu-item-text">'.concat(this.localize(this.options_.label),"</span>"),tabIndex:-1})}},{key:"handleClick",value:function(t){var r=this;xd(jd(e.prototype),"handleClick",this).call(this,t),this.options_.onClickBack?this.options_.onClickBack():this.requestAnimationFrame((function(){r.player_.getChild("collapserator").getChild("cogButton").pressButton()}))}}])&&Od(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("MenuItem"));function Ad(t){return Ad="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ad(t)}function Rd(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Dd(n.key),n)}}function Dd(t){var e=function(t,e){if("object"!=Ad(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Ad(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ad(e)?e:String(e)}function Md(t,e,r){return e=Bd(e),function(t,e){if(e&&("object"===Ad(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Nd()?Reflect.construct(e,r||[],Bd(t).constructor):e.apply(t,r))}function Nd(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Nd=function(){return!!t})()}function Bd(t){return Bd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bd(t)}function Ud(t,e){return Ud=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ud(t,e)}var Fd=function(t){function e(t,r){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Md(this,e,[t,r])}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ud(t,e)}(e,t),r=e,(n=[{key:"handleClick",value:function(){this.player_.whiteboardModePlugin().setWhiteboardMode(this.options_.side)}}])&&Rd(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("MenuItem"));function Vd(t){return Vd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vd(t)}function Hd(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,qd(n.key),n)}}function qd(t){var e=function(t,e){if("object"!=Vd(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Vd(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Vd(e)?e:String(e)}function zd(t,e,r){return e=Xd(e),function(t,e){if(e&&("object"===Vd(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Wd()?Reflect.construct(e,r||[],Xd(t).constructor):e.apply(t,r))}function Wd(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Wd=function(){return!!t})()}function Gd(){return Gd="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Xd(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},Gd.apply(this,arguments)}function Xd(t){return Xd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xd(t)}function Kd(t,e){return Kd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Kd(t,e)}var Yd=yl.getComponent("MenuButton"),Qd=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=zd(this,e,arguments)).alwaysCollapsed=!0,t.isCollapsed=!1,t.isCollabsible=!0,t}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Kd(t,e)}(e,t),r=e,n=[{key:"createItems",value:function(){var t=this,e=this.player_.whiteboardModePlugin().side,r=[new Id(this.player_,{label:"Video Controls"})];return ud.forEach((function(n){r.push(new Fd(t.player_,{side:n,label:ld[n],selectable:!0,multiSelectable:!1,selected:n===e}))})),r}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-has-left-icons ".concat(Gd(Xd(e.prototype),"buildWrapperCSSClass",this).call(this))}},{key:"getCollabsibleName",value:function(){return"Video Controls"}},{key:"getCollabsibleValue",value:function(){var t=this.player_.whiteboardModePlugin().side;return ld[t]}},{key:"showInCollabsibleMenu",value:function(){return this.player_.isFullscreen()}},{key:"showCollapsibleMenu",value:function(){Yd.prototype.handleClick.apply(this)}}],n&&Hd(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(Yd);function $d(t){return $d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$d(t)}function Jd(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Zd(n.key),n)}}function Zd(t){var e=function(t,e){if("object"!=$d(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=$d(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==$d(e)?e:String(e)}function ty(t,e,r){return e=ry(e),function(t,e){if(e&&("object"===$d(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ey()?Reflect.construct(e,r||[],ry(t).constructor):e.apply(t,r))}function ey(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ey=function(){return!!t})()}function ry(t){return ry=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ry(t)}function ny(t,e){return ny=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ny(t,e)}var iy="cv-whiteboard-side",oy=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=ty(this,e,[t])).side="bottom",r.player.ready((function(){r.initialize()})),r}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ny(t,e)}(e,t),r=e,n=[{key:"initialize",value:function(){if(!this.player.options_.mobile){if(Al()){var t=Rl(iy);t&&(this.side=t)}this.initCollapserator(),this.initDragTargets(),this.initFullscreenListener()}}},{key:"initCollapserator",value:function(){var t=this,e=this.player.getChild("collapserator"),r=new sd(this.player);this.button=new Qd(this.player),e.addChild(r),e.addChild(this.button),this.player.trigger("cv-updatecog");var n=function(){t.player.isFullscreen()&&e.el().setAttribute("draggable","true")},i=function(){t.player.isFullscreen()&&e.el().setAttribute("draggable","false")},o=function(e){t.player.isFullscreen()&&(t.player.addClass("cv-dragging"),e.dataTransfer.setData("text/plain","handle"))},a=function(){t.player.isFullscreen()&&(t.player.removeClass("cv-dragging"),e.el().setAttribute("draggable","false"))};r.el().addEventListener("mousedown",n),r.el().addEventListener("mouseup",i),e.el().addEventListener("dragstart",o),e.el().addEventListener("dragend",a),this.on("dispose",(function(){r.el().removeEventListener("mousedown",n),r.el().removeEventListener("mouseup",i),e.el().removeEventListener("dragstart",o),e.el().removeEventListener("dragend",a)}))}},{key:"initDragTargets",value:function(){this.player.addChild(new Sd(this.player))}},{key:"initFullscreenListener",value:function(){var t=this;this.update=this.update.bind(this),this.player.on("fullscreenchange",this.update),this.one("dispose",(function(){t.player.off("fullscreenchange",t.update)}))}},{key:"setWhiteboardMode",value:function(t){this.side=t,this.button.update(),Al()&&Dl(iy,t),this.player.trigger("cv-whiteboard-change"),this.update()}},{key:"update",value:function(){this.player.removeClass("cv-whiteboard-top"),this.player.removeClass("cv-whiteboard-left"),this.player.removeClass("cv-whiteboard-right"),yl.dom.removeClass(window.document.documentElement,"cv-whiteboard-html-font-size"),this.player.trigger("resizemenus"),this.player.isFullscreen()&&"bottom"!==this.side&&(this.player.addClass("cv-whiteboard-".concat(this.side)),yl.dom.addClass(window.document.documentElement,"cv-whiteboard-html-font-size"))}}],n&&Jd(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getPlugin("plugin"));function ay(t){return ay="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ay(t)}function sy(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,uy(n.key),n)}}function uy(t){var e=function(t,e){if("object"!=ay(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=ay(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ay(e)?e:String(e)}function ly(t,e,r){return e=fy(e),function(t,e){if(e&&("object"===ay(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,cy()?Reflect.construct(e,r||[],fy(t).constructor):e.apply(t,r))}function cy(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(cy=function(){return!!t})()}function fy(t){return fy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fy(t)}function hy(t,e){return hy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},hy(t,e)}yl.registerPlugin("whiteboardModePlugin",oy);var py=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),ly(this,e,[t])}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&hy(t,e)}(e,t),r=e,n=[{key:"deferMenu",value:function(){var t={subtitles:this.buildSubtitles(),qualities:this.buildQualities(),playbackSpeeds:this.buildPlaybackSpeeds()};this.player.trigger("cv-defer-menus",t)}},{key:"buildSubtitles",value:function(){for(var t=[],e=!1,r=this.player.textTracks(),n=0;n<r.length;n++){var i=r[n],o="showing"===i.mode;t.unshift({id:i.label,name:i.label,selected:o}),o&&(e=!0)}return t.push({id:null,name:"Off",selected:!e}),t}},{key:"buildQualities",value:function(){for(var t=[],e=this.player.qualityLevels(),r=0;r<e.length;r++){var n=e[r];t.push({id:n.id,name:n.id+"p",selected:n.enabled})}return t}},{key:"buildPlaybackSpeeds",value:function(){var t=this.player.playbackRate();return this.player.options_.playbackRates.map((function(e){return{id:e,name:e+"x"+(1===e?" (Normal)":""),selected:t===e}}))}}],n&&sy(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getPlugin("plugin"));yl.registerPlugin("deferMenusPlugin",py);var dy="PreventScrubbingTooltip";function yy(t){return yy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yy(t)}function my(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,vy(n.key),n)}}function vy(t){var e=function(t,e){if("object"!=yy(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=yy(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==yy(e)?e:String(e)}function gy(t,e,r){return e=wy(e),function(t,e){if(e&&("object"===yy(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,by()?Reflect.construct(e,r||[],wy(t).constructor):e.apply(t,r))}function by(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(by=function(){return!!t})()}function _y(){return _y="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=wy(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},_y.apply(this,arguments)}function wy(t){return wy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},wy(t)}function Ty(t,e){return Ty=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ty(t,e)}var Sy=yl.getComponent("Component"),Ey="cv-prevent-scrubbing-tooltip-show",Oy="cv-prevent-scrubbing-tooltip-remove-transition",ky=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=gy(this,e,arguments)).isShowing=!1,t}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ty(t,e)}(e,t),r=e,n=[{key:"buildCSSClass",value:function(){return"cv-prevent-scrubbing-tooltip ".concat(_y(wy(e.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(t,r,n){return _y(wy(e.prototype),"createEl",this).call(this,t,Object.assign(Object.assign({},r),{className:this.buildCSSClass(),innerText:"No skipping ahead!"}),n)}},{key:"show",value:function(){this.isShowing||(this.player_.userActive(!0),this.addClass(Ey),this.isShowing=!0)}},{key:"hide",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isShowing&&(e&&(this.addClass(Oy),window.requestAnimationFrame((function(){t.removeClass(Oy)}))),this.player_.userActive(!1),this.removeClass(Ey),this.isShowing=!1)}}],n&&my(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(Sy);function Cy(t){return Cy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cy(t)}function Py(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,xy(n.key),n)}}function xy(t){var e=function(t,e){if("object"!=Cy(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Cy(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Cy(e)?e:String(e)}function jy(t,e,r){return e=Ry(e),function(t,e){if(e&&("object"===Cy(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Iy(t)}(t,Ly()?Reflect.construct(e,r||[],Ry(t).constructor):e.apply(t,r))}function Ly(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ly=function(){return!!t})()}function Iy(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ay(){return Ay="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ry(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},Ay.apply(this,arguments)}function Ry(t){return Ry=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ry(t)}function Dy(t,e){return Dy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Dy(t,e)}yl.registerComponent(dy,ky);var My=function(t){function e(t,r){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=jy(this,e,[t])).isEnabled=!1,n.isPreviewing=!1;var i=null!=r?r:{},o=i.furthestVisitedTime,a=void 0===o?0:o,s=i.isEnabled,u=void 0!==s&&s;return n.playerCurrentTimeFn=n.player.currentTime.bind(t),n.player.currentTime=n.currentTime.bind(Iy(n)),n.onTimeUpdate=n.onTimeUpdate.bind(Iy(n)),n.furthestVisitedTime=a,n.isEnabled=u,u&&n.enable(),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Dy(t,e)}(e,t),r=e,n=[{key:"dispose",value:function(){this.player.currentTime=this.playerCurrentTimeFn,this.isEnabled&&(this.disable(),Ay(Ry(e.prototype),"dispose",this).call(this))}},{key:"togglePreview",value:function(t){if(t){if(this.configurePreview(),this.isEnabled)return;this.enable(),this.isPreviewing=!0}else this.disable(),this.isPreviewing=!1}},{key:"configurePreview",value:function(){this.player.currentTime(0),this.furthestVisitedTime=0}},{key:"enable",value:function(){this.player.on("timeupdate",this.onTimeUpdate),this.getProgressControl().addChild(dy),this.isEnabled=!0}},{key:"disable",value:function(){this.player.off("timeupdate",this.onTimeUpdate),this.getProgressControl().removeChild(this.getPreventScrubbingTooltip()),this.isEnabled=!1}},{key:"getProgressControl",value:function(){return this.player.controlBar.getChild("progressControl")}},{key:"onTimeUpdate",value:function(){var t=this.playerCurrentTimeFn();t>this.furthestVisitedTime&&(this.furthestVisitedTime=t)}},{key:"currentTime",value:function(t){for(var e,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];if("number"!=typeof t)return this.playerCurrentTimeFn(t,n);if(this.isEnabled){var o=this.getPreventScrubbingTooltip(),a=null===(e=this.getSeekBar())||void 0===e?void 0:e.getChild("MouseTimeDisplay");if(t>this.furthestVisitedTime)return o.show(),tf(o.hide,1e3,!1,o)(),null==a||a.hide(),void this.playerCurrentTimeFn(this.furthestVisitedTime,n);null==a||a.show(),o.hide(!0),this.playerCurrentTimeFn(t,n)}else this.playerCurrentTimeFn(t,n)}},{key:"getPreventScrubbingTooltip",value:function(){return this.getProgressControl().getChild(dy)}},{key:"getSeekBar",value:function(){var t;return null===(t=this.player.controlBar.getChild("ProgressControl"))||void 0===t?void 0:t.getChild("SeekBar")}}],n&&Py(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getPlugin("plugin"));function Ny(t){return Ny="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ny(t)}function By(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Uy(n.key),n)}}function Uy(t){var e=function(t,e){if("object"!=Ny(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Ny(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ny(e)?e:String(e)}function Fy(t,e,r){return e=Hy(e),function(t,e){if(e&&("object"===Ny(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return qy(t)}(t,Vy()?Reflect.construct(e,r||[],Hy(t).constructor):e.apply(t,r))}function Vy(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Vy=function(){return!!t})()}function Hy(t){return Hy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Hy(t)}function qy(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function zy(t,e){return zy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},zy(t,e)}yl.registerPlugin("preventScrubbingPlugin",My);var Wy=yl.getComponent("Button"),Gy="cv-muted",Xy=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=Fy(this,e,[t])).update(),r.update=r.update.bind(qy(r)),t.on("volumechange",r.update),t.on("dispose",(function(){return t.off("volumechange",r.update)})),r}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&zy(t,e)}(e,t),r=e,(n=[{key:"handleClick",value:function(){this.player_.muted(!this.player_.muted()),this.update()}},{key:"update",value:function(){this.player_.muted()?this.addClass(Gy):this.removeClass(Gy)}},{key:"buildCSSClass",value:function(){return"cv-mute-button cv-muted"}}])&&By(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(Wy);function Ky(t){return Ky="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ky(t)}function Yy(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Qy(n.key),n)}}function Qy(t){var e=function(t,e){if("object"!=Ky(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Ky(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ky(e)?e:String(e)}function $y(t,e,r){return e=tm(e),function(t,e){if(e&&("object"===Ky(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Jy()?Reflect.construct(e,r||[],tm(t).constructor):e.apply(t,r))}function Jy(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Jy=function(){return!!t})()}function Zy(){return Zy="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=tm(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},Zy.apply(this,arguments)}function tm(t){return tm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},tm(t)}function em(t,e){return em=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},em(t,e)}yl.registerComponent("muteButton",Xy),Xy.prototype.controlText_="Mute";var rm,nm=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=$y(this,e,[t,r]))._onClickHandler=r.onClickHandler,n.bindEventListeners(),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&em(t,e)}(e,t),r=e,(n=[{key:"createEl",value:function(){return yl.dom.createEl("div",{className:"cv-player-overlay"})}},{key:"handleClick",value:function(t){"function"==typeof this._onClickHandler&&(t.stopImmediatePropagation(),this._onClickHandler())}},{key:"dispose",value:function(){this.off("click",this.handleClick),Zy(tm(e.prototype),"dispose",this).call(this)}},{key:"bindEventListeners",value:function(){this.on("click",this.handleClick)}}])&&Yy(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("Component"));function im(t){return im="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},im(t)}function om(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,am(n.key),n)}}function am(t){var e=function(t,e){if("object"!=im(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=im(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==im(e)?e:String(e)}function sm(t,e,r){return e=lm(e),function(t,e){if(e&&("object"===im(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,um()?Reflect.construct(e,r||[],lm(t).constructor):e.apply(t,r))}function um(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(um=function(){return!!t})()}function lm(t){return lm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},lm(t)}function cm(t,e){return cm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},cm(t,e)}yl.registerComponent("playerOverlay",nm),function(t){t.Default="play",t.Hover="hover"}(rm||(rm={}));var fm=yl.getPlugin("plugin"),hm="cv-preview-mode",pm=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=sm(this,e,[t])).buttonAdded=!1,r.mode=null,r}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&cm(t,e)}(e,t),r=e,(n=[{key:"getMode",value:function(){return this.mode}},{key:"setPlayerMode",value:function(t,e){var r=this.mode;if(this.mode=t,t===rm.Hover)return this.buttonAdded||this.addButtons(e),this.player.addClass(hm),this.enableSubtites(),this.mute(),this.removeActivityTimeout(),void this.player.trigger("resize");r===rm.Hover&&(this.player.removeClass(hm),this.disableSubtitles(),this.unmute(),this.restoreActivityTimeout(),this.player.trigger("resize"))}},{key:"addButtons",value:function(t){var e=new Xy(this.player),r=new nm(this.player,{onClickHandler:t});this.player.addChild(e),this.player.addChild(r),this.buttonAdded=!0}},{key:"enableSubtites",value:function(){var t=this;this.player.dataLoaded((function(){return t.player.persistSubtitleSettingsPlugin().previewModeSubtitles()}))}},{key:"disableSubtitles",value:function(){var t=this;this.player.dataLoaded((function(){return t.player.persistSubtitleSettingsPlugin().applyUserPreferences()}))}},{key:"mute",value:function(){var t=this;this.player.ready((function(){t.player.persistVolumePlugin().disable(),t.player.muted(!0)}))}},{key:"unmute",value:function(){var t=this;this.player.ready((function(){t.player.persistVolumePlugin().applyUserPreferences(),t.player.persistVolumePlugin().enable()}))}},{key:"removeActivityTimeout",value:function(){this.player.cache_.inactivityTimeout=this.player.options_.inactivityTimeout,this.player.options_.inactivityTimeout=0}},{key:"restoreActivityTimeout",value:function(){this.player.options_.inactivityTimeout=this.player.cache_.inactivityTimeout}}])&&om(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(fm);function dm(t){return dm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dm(t)}function ym(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mm(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,gm(n.key),n)}}function vm(t,e,r){return e&&mm(t.prototype,e),r&&mm(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function gm(t){var e=function(t,e){if("object"!=dm(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=dm(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==dm(e)?e:String(e)}function bm(t,e,r){return e=wm(e),function(t,e){if(e&&("object"===dm(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,_m()?Reflect.construct(e,r||[],wm(t).constructor):e.apply(t,r))}function _m(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_m=function(){return!!t})()}function wm(t){return wm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},wm(t)}function Tm(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Sm(t,e)}function Sm(t,e){return Sm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Sm(t,e)}yl.registerPlugin("playerModePlugin",pm);var Em=yl.getComponent("Component"),Om=yl.getComponent("ClickableComponent"),km=function(t){function e(t,r){return ym(this,e),bm(this,e,[t,r])}return Tm(e,t),vm(e,[{key:"createEl",value:function(){return Em.prototype.createEl.call(this,"span",{className:"cv-favourite-button-svg",innerHTML:this.options_.fill?'\n <svg version="1.1" viewBox="0 0 24 24">\n <path id="Heart-Filled" d="m18.833 5.9735c-0.78916-0.95022-1.8839-1.4735-3.0826-1.4735-1.6859 0-2.7532 1.0685-3.3517 1.9648-0.15528 0.2326-0.28738 0.46582-0.39828 0.68529-0.11091-0.21946-0.24297-0.45269-0.39828-0.68529-0.5985-0.89636-1.6658-1.9648-3.3517-1.9648-1.1987 0-2.2935 0.52333-3.0827 1.4735-0.75275 0.90644-1.1673 2.1204-1.1673 3.4183 0 1.4128 0.51978 2.7268 1.6358 4.1353 0.99741 1.2588 2.4323 2.5564 4.0939 4.0589 0.61916 0.5599 1.2594 1.1389 1.9411 1.7718l0.02047 0.01903c0.08837 0.08211 0.19856 0.12313 0.30875 0.12313s0.22038-0.04105 0.30875-0.12313l0.02047-0.01903c0.68166-0.63289 1.3219-1.2119 1.9412-1.7719 1.6615-1.5024 3.0964-2.8 4.0938-4.0588 1.116-1.4085 1.6358-2.7225 1.6358-4.1353 0-1.2979-0.41459-2.5119-1.1674-3.4183z"/>\n </svg>\n':'\n <svg version="1.1" viewBox="0 0 24 24">\n <path id="Shape" d="m18.959 5.9741c-0.76992-0.92705-1.9357-1.5351-3.1052-1.5351-1.6448 0-2.8808 0.74937-3.4647 1.6238-0.15149 0.22693-0.28074 0.55125-0.38894 0.76537-0.10821-0.21411-0.23718-0.53844-0.38871-0.76537-0.58391-0.87451-1.8205-1.6238-3.4653-1.6238-1.1695 0-2.2376 0.60808-3.0075 1.5351-0.7344 0.88434-1.1388 1.9712-1.1388 3.2374 0 1.3784 0.50711 3.0509 1.5959 4.4251 0.97309 1.2281 2.373 2.4941 3.9941 3.9599 0.60406 0.54625 1.2285 1.1104 1.8936 1.7278l0.01997 0.01934c0.08622 0.08011 0.38931 0.21727 0.49681 0.21727 0.1075 0 0.40992-0.13796 0.49614-0.21804l0.0201-0.0178c0.66504-0.61746 1.2897-1.1824 1.8939-1.7287 1.621-1.4658 3.0209-2.7317 3.994-3.9598 1.0888-1.3742 1.5955-3.0467 1.5955-4.4251 0-1.2663-0.30646-2.3531-1.0409-3.2374zm-5.337 10.688c-0.51948 0.47226-1.0567 0.95549-1.6218 1.4768-0.56507-0.52124-1.101-1.0059-1.6219-1.4769-3.1725-2.8689-5.2684-4.7641-5.2684-7.2556 0-1.0298 0.32333-1.9863 0.91044-2.6933 0.59385-0.71497 1.4183-1.1088 2.3213-1.1088 1.254 0 2.0645 0.81976 2.5237 1.5074 0.41187 0.61679 0.62678 1.2385 0.70006 1.4772 0.06131 0.19978 0.23683 0.33499 0.43482 0.33499s0.37351-0.1352 0.43482-0.33499c0.07329-0.23867 0.28821-0.86044 0.70006-1.4773 0.45914-0.68766 1.2698-1.5074 2.5237-1.5074 0.90309 0 1.7274 0.39377 2.3213 1.1088 0.58714 0.70695 0.91047 1.6634 0.91047 2.6933 0 2.4914-2.1035 4.3783-5.2685 7.2557z" stroke-width=".97562"/>\n </svg>\n'})}}]),e}(Em),Cm=function(t){function e(t,r){var n;return ym(this,e),(n=bm(this,e,[t,r])).isFavourited=r.isFavourited,n.update(),n.bindEventListeners(),n}return Tm(e,t),vm(e,[{key:"bindEventListeners",value:function(){this.onMouseEnter=this.onMouseEnter.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.on("mouseenter",this.onMouseEnter.bind(this)),this.on("mouseleave",this.onMouseLeave.bind(this))}},{key:"dispose",value:function(){this.off("mouseenter"),this.off("mouseleave")}},{key:"onMouseEnter",value:function(){this.isHovering=!0,this.update()}},{key:"onMouseLeave",value:function(){this.isHovering=!1,this.update()}},{key:"update",value:function(){this.icon&&this.removeChild(this.icon),this.icon=new km(this.player_,{fill:this.isFavourited||this.isHovering}),this.addChild(this.icon),this.isFavourited||this.isHovering?this.addClass("cv-favourited"):this.removeClass("cv-favourited")}},{key:"createEl",value:function(t,e,r){e=Object.assign({innerHTML:"",className:"cv-favourite-button"},e),r=Object.assign({type:"button"},r);var n=Em.prototype.createEl.call(this,"button",e,r);return this.createControlTextEl(n),n}},{key:"handleClick",value:function(){if(this.isFavourited=!this.isFavourited,this.update(),this.options_.clickHandler){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];this.options_.clickHandler.call(this,e)}}}]),e}(Om);function Pm(t){return Pm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pm(t)}function xm(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,jm(n.key),n)}}function jm(t){var e=function(t,e){if("object"!=Pm(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Pm(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Pm(e)?e:String(e)}function Lm(t,e,r){return e=Am(e),function(t,e){if(e&&("object"===Pm(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Im()?Reflect.construct(e,r||[],Am(t).constructor):e.apply(t,r))}function Im(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Im=function(){return!!t})()}function Am(t){return Am=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Am(t)}function Rm(t,e){return Rm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Rm(t,e)}Cm.prototype.controlText_="Favourite";var Dm=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Lm(this,e,arguments)}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Rm(t,e)}(e,t),r=e,(n=[{key:"setFavourite",value:function(t,e){var r=this;t!==this.isFavourite&&(this.isFavourite=t,this.onClickFavourite=e,this.player.ready((function(){r.renderFavouriteButton()})))}},{key:"renderFavouriteButton",value:function(){this.button&&this.player.removeChild(this.button),this.button=new Cm(this.player,{isFavourited:this.isFavourite,clickHandler:this.onClickFavourite}),this.player.addChild(this.button)}}])&&xm(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getPlugin("plugin"));yl.registerPlugin("favouritePlugin",Dm),r(94386),r(98457);var Mm=r(15206),Nm=r.n(Mm),Bm=(r(15296),r(48868),r(96609),r(92274),r(68268),r(81874),r(31341),r(54861),r(50200)),Um=r.n(Bm),Fm=r(40001),Vm=r.n(Fm),Hm=r(98511),qm=r.n(Hm),zm=function(){if("undefined"!=typeof Map)return Map;function t(t,e){var r=-1;return t.some((function(t,n){return t[0]===e&&(r=n,!0)})),r}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var r=t(this.__entries__,e),n=this.__entries__[r];return n&&n[1]},e.prototype.set=function(e,r){var n=t(this.__entries__,e);~n?this.__entries__[n][1]=r:this.__entries__.push([e,r])},e.prototype.delete=function(e){var r=this.__entries__,n=t(r,e);~n&&r.splice(n,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var r=0,n=this.__entries__;r<n.length;r++){var i=n[r];t.call(e,i[1],i[0])}},e}()}(),Wm="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,Gm=void 0!==r.g&&r.g.Math===Math?r.g:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),Xm="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(Gm):function(t){return setTimeout((function(){return t(Date.now())}),1e3/60)},Km=["top","right","bottom","left","width","height","size","weight"],Ym="undefined"!=typeof MutationObserver,Qm=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(t,e){var r=!1,n=!1,i=0;function o(){r&&(r=!1,t()),n&&s()}function a(){Xm(o)}function s(){var t=Date.now();if(r){if(t-i<2)return;n=!0}else r=!0,n=!1,setTimeout(a,e);i=t}return s}(this.refresh.bind(this),20)}return t.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},t.prototype.removeObserver=function(t){var e=this.observers_,r=e.indexOf(t);~r&&e.splice(r,1),!e.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},t.prototype.updateObservers_=function(){var t=this.observers_.filter((function(t){return t.gatherActive(),t.hasActive()}));return t.forEach((function(t){return t.broadcastActive()})),t.length>0},t.prototype.connect_=function(){Wm&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Ym?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){Wm&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,r=void 0===e?"":e;Km.some((function(t){return!!~r.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),$m=function(t,e){for(var r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];Object.defineProperty(t,i,{value:e[i],enumerable:!1,writable:!1,configurable:!0})}return t},Jm=function(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView||Gm},Zm=iv(0,0,0,0);function tv(t){return parseFloat(t)||0}function ev(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return e.reduce((function(e,r){return e+tv(t["border-"+r+"-width"])}),0)}var rv="undefined"!=typeof SVGGraphicsElement?function(t){return t instanceof Jm(t).SVGGraphicsElement}:function(t){return t instanceof Jm(t).SVGElement&&"function"==typeof t.getBBox};function nv(t){return Wm?rv(t)?function(t){var e=t.getBBox();return iv(0,0,e.width,e.height)}(t):function(t){var e=t.clientWidth,r=t.clientHeight;if(!e&&!r)return Zm;var n=Jm(t).getComputedStyle(t),i=function(t){for(var e={},r=0,n=["top","right","bottom","left"];r<n.length;r++){var i=n[r],o=t["padding-"+i];e[i]=tv(o)}return e}(n),o=i.left+i.right,a=i.top+i.bottom,s=tv(n.width),u=tv(n.height);if("border-box"===n.boxSizing&&(Math.round(s+o)!==e&&(s-=ev(n,"left","right")+o),Math.round(u+a)!==r&&(u-=ev(n,"top","bottom")+a)),!function(t){return t===Jm(t).document.documentElement}(t)){var l=Math.round(s+o)-e,c=Math.round(u+a)-r;1!==Math.abs(l)&&(s-=l),1!==Math.abs(c)&&(u-=c)}return iv(i.left,i.top,s,u)}(t):Zm}function iv(t,e,r,n){return{x:t,y:e,width:r,height:n}}var ov=function(){function t(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=iv(0,0,0,0),this.target=t}return t.prototype.isActive=function(){var t=nv(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},t}(),av=function(t,e){var r,n,i,o,a,s,u,l=(n=(r=e).x,i=r.y,o=r.width,a=r.height,s="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,u=Object.create(s.prototype),$m(u,{x:n,y:i,width:o,height:a,top:i,right:n+o,bottom:a+i,left:n}),u);$m(this,{target:t,contentRect:l})},sv=function(){function t(t,e,r){if(this.activeObservations_=[],this.observations_=new zm,"function"!=typeof t)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=e,this.callbackCtx_=r}return t.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof Jm(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new ov(t)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof Jm(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)&&(e.delete(t),e.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach((function(e){e.isActive()&&t.activeObservations_.push(e)}))},t.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map((function(t){return new av(t.target,t.broadcastRect())}));this.callback_.call(t,e,t),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),uv="undefined"!=typeof WeakMap?new WeakMap:new zm,lv=function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=Qm.getInstance(),n=new sv(e,r,this);uv.set(this,n)};["observe","unobserve","disconnect"].forEach((function(t){lv.prototype[t]=function(){var e;return(e=uv.get(this))[t].apply(e,arguments)}}));const cv=void 0!==Gm.ResizeObserver?Gm.ResizeObserver:lv;r(82937),r(66403),r(42295),r(52963),r(34994);var fv=null,hv=null;function pv(){if(null===fv){if("undefined"==typeof document)return fv=0;var t=document.body,e=document.createElement("div");e.classList.add("simplebar-hide-scrollbar"),t.appendChild(e);var r=e.getBoundingClientRect().right;t.removeChild(e),fv=r}return fv}Nm()&&window.addEventListener("resize",(function(){hv!==window.devicePixelRatio&&(hv=window.devicePixelRatio,fv=null)}));var dv=function(t){return Array.prototype.reduce.call(t,(function(t,e){var r=e.name.match(/data-simplebar-(.+)/);if(r){var n=r[1].replace(/\W+(.)/g,(function(t,e){return e.toUpperCase()}));switch(e.value){case"true":t[n]=!0;break;case"false":t[n]=!1;break;case void 0:t[n]=!0;break;default:t[n]=e.value}}return t}),{})};function yv(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView?t.ownerDocument.defaultView:window}function mv(t){return t&&t.ownerDocument?t.ownerDocument:document}var vv=function(){function t(e,r){var n=this;this.onScroll=function(){var t=yv(n.el);n.scrollXTicking||(t.requestAnimationFrame(n.scrollX),n.scrollXTicking=!0),n.scrollYTicking||(t.requestAnimationFrame(n.scrollY),n.scrollYTicking=!0)},this.scrollX=function(){n.axis.x.isOverflowing&&(n.showScrollbar("x"),n.positionScrollbar("x")),n.scrollXTicking=!1},this.scrollY=function(){n.axis.y.isOverflowing&&(n.showScrollbar("y"),n.positionScrollbar("y")),n.scrollYTicking=!1},this.onMouseEnter=function(){n.showScrollbar("x"),n.showScrollbar("y")},this.onMouseMove=function(t){n.mouseX=t.clientX,n.mouseY=t.clientY,(n.axis.x.isOverflowing||n.axis.x.forceVisible)&&n.onMouseMoveForAxis("x"),(n.axis.y.isOverflowing||n.axis.y.forceVisible)&&n.onMouseMoveForAxis("y")},this.onMouseLeave=function(){n.onMouseMove.cancel(),(n.axis.x.isOverflowing||n.axis.x.forceVisible)&&n.onMouseLeaveForAxis("x"),(n.axis.y.isOverflowing||n.axis.y.forceVisible)&&n.onMouseLeaveForAxis("y"),n.mouseX=-1,n.mouseY=-1},this.onWindowResize=function(){n.scrollbarWidth=n.getScrollbarWidth(),n.hideNativeScrollbar()},this.hideScrollbars=function(){n.axis.x.track.rect=n.axis.x.track.el.getBoundingClientRect(),n.axis.y.track.rect=n.axis.y.track.el.getBoundingClientRect(),n.isWithinBounds(n.axis.y.track.rect)||(n.axis.y.scrollbar.el.classList.remove(n.classNames.visible),n.axis.y.isVisible=!1),n.isWithinBounds(n.axis.x.track.rect)||(n.axis.x.scrollbar.el.classList.remove(n.classNames.visible),n.axis.x.isVisible=!1)},this.onPointerEvent=function(t){var e,r;n.axis.x.track.rect=n.axis.x.track.el.getBoundingClientRect(),n.axis.y.track.rect=n.axis.y.track.el.getBoundingClientRect(),(n.axis.x.isOverflowing||n.axis.x.forceVisible)&&(e=n.isWithinBounds(n.axis.x.track.rect)),(n.axis.y.isOverflowing||n.axis.y.forceVisible)&&(r=n.isWithinBounds(n.axis.y.track.rect)),(e||r)&&(t.preventDefault(),t.stopPropagation(),"mousedown"===t.type&&(e&&(n.axis.x.scrollbar.rect=n.axis.x.scrollbar.el.getBoundingClientRect(),n.isWithinBounds(n.axis.x.scrollbar.rect)?n.onDragStart(t,"x"):n.onTrackClick(t,"x")),r&&(n.axis.y.scrollbar.rect=n.axis.y.scrollbar.el.getBoundingClientRect(),n.isWithinBounds(n.axis.y.scrollbar.rect)?n.onDragStart(t,"y"):n.onTrackClick(t,"y"))))},this.drag=function(e){var r=n.axis[n.draggedAxis].track,i=r.rect[n.axis[n.draggedAxis].sizeAttr],o=n.axis[n.draggedAxis].scrollbar,a=n.contentWrapperEl[n.axis[n.draggedAxis].scrollSizeAttr],s=parseInt(n.elStyles[n.axis[n.draggedAxis].sizeAttr],10);e.preventDefault(),e.stopPropagation();var u=(("y"===n.draggedAxis?e.pageY:e.pageX)-r.rect[n.axis[n.draggedAxis].offsetAttr]-n.axis[n.draggedAxis].dragOffset)/(i-o.size)*(a-s);"x"===n.draggedAxis&&(u=n.isRtl&&t.getRtlHelpers().isRtlScrollbarInverted?u-(i+o.size):u,u=n.isRtl&&t.getRtlHelpers().isRtlScrollingInverted?-u:u),n.contentWrapperEl[n.axis[n.draggedAxis].scrollOffsetAttr]=u},this.onEndDrag=function(t){var e=mv(n.el),r=yv(n.el);t.preventDefault(),t.stopPropagation(),n.el.classList.remove(n.classNames.dragging),e.removeEventListener("mousemove",n.drag,!0),e.removeEventListener("mouseup",n.onEndDrag,!0),n.removePreventClickId=r.setTimeout((function(){e.removeEventListener("click",n.preventClick,!0),e.removeEventListener("dblclick",n.preventClick,!0),n.removePreventClickId=null}))},this.preventClick=function(t){t.preventDefault(),t.stopPropagation()},this.el=e,this.minScrollbarWidth=20,this.options=Object.assign({},t.defaultOptions,{},r),this.classNames=Object.assign({},t.defaultOptions.classNames,{},this.options.classNames),this.axis={x:{scrollOffsetAttr:"scrollLeft",sizeAttr:"width",scrollSizeAttr:"scrollWidth",offsetSizeAttr:"offsetWidth",offsetAttr:"left",overflowAttr:"overflowX",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}},y:{scrollOffsetAttr:"scrollTop",sizeAttr:"height",scrollSizeAttr:"scrollHeight",offsetSizeAttr:"offsetHeight",offsetAttr:"top",overflowAttr:"overflowY",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}}},this.removePreventClickId=null,t.instances.has(this.el)||(this.recalculate=Um()(this.recalculate.bind(this),64),this.onMouseMove=Um()(this.onMouseMove.bind(this),64),this.hideScrollbars=Vm()(this.hideScrollbars.bind(this),this.options.timeout),this.onWindowResize=Vm()(this.onWindowResize.bind(this),64,{leading:!0}),t.getRtlHelpers=qm()(t.getRtlHelpers),this.init())}t.getRtlHelpers=function(){var e=document.createElement("div");e.innerHTML='<div class="hs-dummy-scrollbar-size"><div style="height: 200%; width: 200%; margin: 10px 0;"></div></div>';var r=e.firstElementChild;document.body.appendChild(r);var n=r.firstElementChild;r.scrollLeft=0;var i=t.getOffset(r),o=t.getOffset(n);r.scrollLeft=999;var a=t.getOffset(n);return{isRtlScrollingInverted:i.left!==o.left&&o.left-a.left!=0,isRtlScrollbarInverted:i.left!==o.left}},t.getOffset=function(t){var e=t.getBoundingClientRect(),r=mv(t),n=yv(t);return{top:e.top+(n.pageYOffset||r.documentElement.scrollTop),left:e.left+(n.pageXOffset||r.documentElement.scrollLeft)}};var e=t.prototype;return e.init=function(){t.instances.set(this.el,this),Nm()&&(this.initDOM(),this.scrollbarWidth=this.getScrollbarWidth(),this.recalculate(),this.initListeners())},e.initDOM=function(){var t=this;if(Array.prototype.filter.call(this.el.children,(function(e){return e.classList.contains(t.classNames.wrapper)})).length)this.wrapperEl=this.el.querySelector("."+this.classNames.wrapper),this.contentWrapperEl=this.options.scrollableNode||this.el.querySelector("."+this.classNames.contentWrapper),this.contentEl=this.options.contentNode||this.el.querySelector("."+this.classNames.contentEl),this.offsetEl=this.el.querySelector("."+this.classNames.offset),this.maskEl=this.el.querySelector("."+this.classNames.mask),this.placeholderEl=this.findChild(this.wrapperEl,"."+this.classNames.placeholder),this.heightAutoObserverWrapperEl=this.el.querySelector("."+this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl=this.el.querySelector("."+this.classNames.heightAutoObserverEl),this.axis.x.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.horizontal),this.axis.y.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.vertical);else{for(this.wrapperEl=document.createElement("div"),this.contentWrapperEl=document.createElement("div"),this.offsetEl=document.createElement("div"),this.maskEl=document.createElement("div"),this.contentEl=document.createElement("div"),this.placeholderEl=document.createElement("div"),this.heightAutoObserverWrapperEl=document.createElement("div"),this.heightAutoObserverEl=document.createElement("div"),this.wrapperEl.classList.add(this.classNames.wrapper),this.contentWrapperEl.classList.add(this.classNames.contentWrapper),this.offsetEl.classList.add(this.classNames.offset),this.maskEl.classList.add(this.classNames.mask),this.contentEl.classList.add(this.classNames.contentEl),this.placeholderEl.classList.add(this.classNames.placeholder),this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl);this.el.firstChild;)this.contentEl.appendChild(this.el.firstChild);this.contentWrapperEl.appendChild(this.contentEl),this.offsetEl.appendChild(this.contentWrapperEl),this.maskEl.appendChild(this.offsetEl),this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl),this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl),this.wrapperEl.appendChild(this.maskEl),this.wrapperEl.appendChild(this.placeholderEl),this.el.appendChild(this.wrapperEl)}if(!this.axis.x.track.el||!this.axis.y.track.el){var e=document.createElement("div"),r=document.createElement("div");e.classList.add(this.classNames.track),r.classList.add(this.classNames.scrollbar),e.appendChild(r),this.axis.x.track.el=e.cloneNode(!0),this.axis.x.track.el.classList.add(this.classNames.horizontal),this.axis.y.track.el=e.cloneNode(!0),this.axis.y.track.el.classList.add(this.classNames.vertical),this.el.appendChild(this.axis.x.track.el),this.el.appendChild(this.axis.y.track.el)}this.axis.x.scrollbar.el=this.axis.x.track.el.querySelector("."+this.classNames.scrollbar),this.axis.y.scrollbar.el=this.axis.y.track.el.querySelector("."+this.classNames.scrollbar),this.options.autoHide||(this.axis.x.scrollbar.el.classList.add(this.classNames.visible),this.axis.y.scrollbar.el.classList.add(this.classNames.visible)),this.el.setAttribute("data-simplebar","init")},e.initListeners=function(){var t=this,e=yv(this.el);this.options.autoHide&&this.el.addEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach((function(e){t.el.addEventListener(e,t.onPointerEvent,!0)})),["touchstart","touchend","touchmove"].forEach((function(e){t.el.addEventListener(e,t.onPointerEvent,{capture:!0,passive:!0})})),this.el.addEventListener("mousemove",this.onMouseMove),this.el.addEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl.addEventListener("scroll",this.onScroll),e.addEventListener("resize",this.onWindowResize);var r=!1,n=e.ResizeObserver||cv;this.resizeObserver=new n((function(){r&&t.recalculate()})),this.resizeObserver.observe(this.el),this.resizeObserver.observe(this.contentEl),e.requestAnimationFrame((function(){r=!0})),this.mutationObserver=new e.MutationObserver(this.recalculate),this.mutationObserver.observe(this.contentEl,{childList:!0,subtree:!0,characterData:!0})},e.recalculate=function(){var t=yv(this.el);this.elStyles=t.getComputedStyle(this.el),this.isRtl="rtl"===this.elStyles.direction;var e=this.heightAutoObserverEl.offsetHeight<=1,r=this.heightAutoObserverEl.offsetWidth<=1,n=this.contentEl.offsetWidth,i=this.contentWrapperEl.offsetWidth,o=this.elStyles.overflowX,a=this.elStyles.overflowY;this.contentEl.style.padding=this.elStyles.paddingTop+" "+this.elStyles.paddingRight+" "+this.elStyles.paddingBottom+" "+this.elStyles.paddingLeft,this.wrapperEl.style.margin="-"+this.elStyles.paddingTop+" -"+this.elStyles.paddingRight+" -"+this.elStyles.paddingBottom+" -"+this.elStyles.paddingLeft;var s=this.contentEl.scrollHeight,u=this.contentEl.scrollWidth;this.contentWrapperEl.style.height=e?"auto":"100%",this.placeholderEl.style.width=r?n+"px":"auto",this.placeholderEl.style.height=s+"px";var l=this.contentWrapperEl.offsetHeight;this.axis.x.isOverflowing=u>n,this.axis.y.isOverflowing=s>l,this.axis.x.isOverflowing="hidden"!==o&&this.axis.x.isOverflowing,this.axis.y.isOverflowing="hidden"!==a&&this.axis.y.isOverflowing,this.axis.x.forceVisible="x"===this.options.forceVisible||!0===this.options.forceVisible,this.axis.y.forceVisible="y"===this.options.forceVisible||!0===this.options.forceVisible,this.hideNativeScrollbar();var c=this.axis.x.isOverflowing?this.scrollbarWidth:0,f=this.axis.y.isOverflowing?this.scrollbarWidth:0;this.axis.x.isOverflowing=this.axis.x.isOverflowing&&u>i-f,this.axis.y.isOverflowing=this.axis.y.isOverflowing&&s>l-c,this.axis.x.scrollbar.size=this.getScrollbarSize("x"),this.axis.y.scrollbar.size=this.getScrollbarSize("y"),this.axis.x.scrollbar.el.style.width=this.axis.x.scrollbar.size+"px",this.axis.y.scrollbar.el.style.height=this.axis.y.scrollbar.size+"px",this.positionScrollbar("x"),this.positionScrollbar("y"),this.toggleTrackVisibility("x"),this.toggleTrackVisibility("y")},e.getScrollbarSize=function(t){if(void 0===t&&(t="y"),!this.axis[t].isOverflowing)return 0;var e,r=this.contentEl[this.axis[t].scrollSizeAttr],n=this.axis[t].track.el[this.axis[t].offsetSizeAttr],i=n/r;return e=Math.max(~~(i*n),this.options.scrollbarMinSize),this.options.scrollbarMaxSize&&(e=Math.min(e,this.options.scrollbarMaxSize)),e},e.positionScrollbar=function(e){if(void 0===e&&(e="y"),this.axis[e].isOverflowing){var r=this.contentWrapperEl[this.axis[e].scrollSizeAttr],n=this.axis[e].track.el[this.axis[e].offsetSizeAttr],i=parseInt(this.elStyles[this.axis[e].sizeAttr],10),o=this.axis[e].scrollbar,a=this.contentWrapperEl[this.axis[e].scrollOffsetAttr],s=(a="x"===e&&this.isRtl&&t.getRtlHelpers().isRtlScrollingInverted?-a:a)/(r-i),u=~~((n-o.size)*s);u="x"===e&&this.isRtl&&t.getRtlHelpers().isRtlScrollbarInverted?u+(n-o.size):u,o.el.style.transform="x"===e?"translate3d("+u+"px, 0, 0)":"translate3d(0, "+u+"px, 0)"}},e.toggleTrackVisibility=function(t){void 0===t&&(t="y");var e=this.axis[t].track.el,r=this.axis[t].scrollbar.el;this.axis[t].isOverflowing||this.axis[t].forceVisible?(e.style.visibility="visible",this.contentWrapperEl.style[this.axis[t].overflowAttr]="scroll"):(e.style.visibility="hidden",this.contentWrapperEl.style[this.axis[t].overflowAttr]="hidden"),this.axis[t].isOverflowing?r.style.display="block":r.style.display="none"},e.hideNativeScrollbar=function(){this.offsetEl.style[this.isRtl?"left":"right"]=this.axis.y.isOverflowing||this.axis.y.forceVisible?"-"+this.scrollbarWidth+"px":0,this.offsetEl.style.bottom=this.axis.x.isOverflowing||this.axis.x.forceVisible?"-"+this.scrollbarWidth+"px":0},e.onMouseMoveForAxis=function(t){void 0===t&&(t="y"),this.axis[t].track.rect=this.axis[t].track.el.getBoundingClientRect(),this.axis[t].scrollbar.rect=this.axis[t].scrollbar.el.getBoundingClientRect(),this.isWithinBounds(this.axis[t].scrollbar.rect)?this.axis[t].scrollbar.el.classList.add(this.classNames.hover):this.axis[t].scrollbar.el.classList.remove(this.classNames.hover),this.isWithinBounds(this.axis[t].track.rect)?(this.showScrollbar(t),this.axis[t].track.el.classList.add(this.classNames.hover)):this.axis[t].track.el.classList.remove(this.classNames.hover)},e.onMouseLeaveForAxis=function(t){void 0===t&&(t="y"),this.axis[t].track.el.classList.remove(this.classNames.hover),this.axis[t].scrollbar.el.classList.remove(this.classNames.hover)},e.showScrollbar=function(t){void 0===t&&(t="y");var e=this.axis[t].scrollbar.el;this.axis[t].isVisible||(e.classList.add(this.classNames.visible),this.axis[t].isVisible=!0),this.options.autoHide&&this.hideScrollbars()},e.onDragStart=function(t,e){void 0===e&&(e="y");var r=mv(this.el),n=yv(this.el),i=this.axis[e].scrollbar,o="y"===e?t.pageY:t.pageX;this.axis[e].dragOffset=o-i.rect[this.axis[e].offsetAttr],this.draggedAxis=e,this.el.classList.add(this.classNames.dragging),r.addEventListener("mousemove",this.drag,!0),r.addEventListener("mouseup",this.onEndDrag,!0),null===this.removePreventClickId?(r.addEventListener("click",this.preventClick,!0),r.addEventListener("dblclick",this.preventClick,!0)):(n.clearTimeout(this.removePreventClickId),this.removePreventClickId=null)},e.onTrackClick=function(t,e){var r=this;if(void 0===e&&(e="y"),this.options.clickOnTrack){var n=yv(this.el);this.axis[e].scrollbar.rect=this.axis[e].scrollbar.el.getBoundingClientRect();var i=this.axis[e].scrollbar.rect[this.axis[e].offsetAttr],o=parseInt(this.elStyles[this.axis[e].sizeAttr],10),a=this.contentWrapperEl[this.axis[e].scrollOffsetAttr],s=("y"===e?this.mouseY-i:this.mouseX-i)<0?-1:1,u=-1===s?a-o:a+o;!function t(){var i,o;-1===s?a>u&&(a-=r.options.clickOnTrackSpeed,r.contentWrapperEl.scrollTo(((i={})[r.axis[e].offsetAttr]=a,i)),n.requestAnimationFrame(t)):a<u&&(a+=r.options.clickOnTrackSpeed,r.contentWrapperEl.scrollTo(((o={})[r.axis[e].offsetAttr]=a,o)),n.requestAnimationFrame(t))}()}},e.getContentElement=function(){return this.contentEl},e.getScrollElement=function(){return this.contentWrapperEl},e.getScrollbarWidth=function(){try{return"none"===getComputedStyle(this.contentWrapperEl,"::-webkit-scrollbar").display||"scrollbarWidth"in document.documentElement.style||"-ms-overflow-style"in document.documentElement.style?0:pv()}catch(t){return pv()}},e.removeListeners=function(){var t=this,e=yv(this.el);this.options.autoHide&&this.el.removeEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach((function(e){t.el.removeEventListener(e,t.onPointerEvent,!0)})),["touchstart","touchend","touchmove"].forEach((function(e){t.el.removeEventListener(e,t.onPointerEvent,{capture:!0,passive:!0})})),this.el.removeEventListener("mousemove",this.onMouseMove),this.el.removeEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl&&this.contentWrapperEl.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onWindowResize),this.mutationObserver&&this.mutationObserver.disconnect(),this.resizeObserver&&this.resizeObserver.disconnect(),this.recalculate.cancel(),this.onMouseMove.cancel(),this.hideScrollbars.cancel(),this.onWindowResize.cancel()},e.unMount=function(){this.removeListeners(),t.instances.delete(this.el)},e.isWithinBounds=function(t){return this.mouseX>=t.left&&this.mouseX<=t.left+t.width&&this.mouseY>=t.top&&this.mouseY<=t.top+t.height},e.findChild=function(t,e){var r=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector;return Array.prototype.filter.call(t.children,(function(t){return r.call(t,e)}))[0]},t}();vv.defaultOptions={autoHide:!0,forceVisible:!1,clickOnTrack:!0,clickOnTrackSpeed:40,classNames:{contentEl:"simplebar-content",contentWrapper:"simplebar-content-wrapper",offset:"simplebar-offset",mask:"simplebar-mask",wrapper:"simplebar-wrapper",placeholder:"simplebar-placeholder",scrollbar:"simplebar-scrollbar",track:"simplebar-track",heightAutoObserverWrapperEl:"simplebar-height-auto-observer-wrapper",heightAutoObserverEl:"simplebar-height-auto-observer",visible:"simplebar-visible",horizontal:"simplebar-horizontal",vertical:"simplebar-vertical",hover:"simplebar-hover",dragging:"simplebar-dragging"},scrollbarMinSize:25,scrollbarMaxSize:0,timeout:1e3},vv.instances=new WeakMap,vv.initDOMLoadedElements=function(){document.removeEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.removeEventListener("load",this.initDOMLoadedElements),Array.prototype.forEach.call(document.querySelectorAll("[data-simplebar]"),(function(t){"init"===t.getAttribute("data-simplebar")||vv.instances.has(t)||new vv(t,dv(t.attributes))}))},vv.removeObserver=function(){this.globalObserver.disconnect()},vv.initHtmlApi=function(){this.initDOMLoadedElements=this.initDOMLoadedElements.bind(this),"undefined"!=typeof MutationObserver&&(this.globalObserver=new MutationObserver(vv.handleMutations),this.globalObserver.observe(document,{childList:!0,subtree:!0})),"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?window.setTimeout(this.initDOMLoadedElements):(document.addEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.addEventListener("load",this.initDOMLoadedElements))},vv.handleMutations=function(t){t.forEach((function(t){Array.prototype.forEach.call(t.addedNodes,(function(t){1===t.nodeType&&(t.hasAttribute("data-simplebar")?!vv.instances.has(t)&&new vv(t,dv(t.attributes)):Array.prototype.forEach.call(t.querySelectorAll("[data-simplebar]"),(function(t){"init"===t.getAttribute("data-simplebar")||vv.instances.has(t)||new vv(t,dv(t.attributes))})))})),Array.prototype.forEach.call(t.removedNodes,(function(t){1===t.nodeType&&(t.hasAttribute('[data-simplebar="init"]')?vv.instances.has(t)&&vv.instances.get(t).unMount():Array.prototype.forEach.call(t.querySelectorAll('[data-simplebar="init"]'),(function(t){vv.instances.has(t)&&vv.instances.get(t).unMount()})))}))}))},vv.getOptions=dv,Nm()&&vv.initHtmlApi();const gv=vv;function bv(t){return bv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bv(t)}function _v(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,wv(n.key),n)}}function wv(t){var e=function(t,e){if("object"!=bv(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=bv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==bv(e)?e:String(e)}function Tv(t,e,r){return e=Ov(e),function(t,e){if(e&&("object"===bv(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Sv()?Reflect.construct(e,r||[],Ov(t).constructor):e.apply(t,r))}function Sv(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Sv=function(){return!!t})()}function Ev(){return Ev="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ov(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},Ev.apply(this,arguments)}function Ov(t){return Ov=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ov(t)}function kv(t,e){return kv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},kv(t,e)}var Cv=yl.getComponent("Menu"),Pv=Cv.prototype,xv=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Tv(this,e,arguments)}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&kv(t,e)}(e,t),r=e,(n=[{key:"createEl",value:function(){var t=Ev(Ov(e.prototype),"createEl",this).call(this);return this.simpleBar=new gv(this.contentEl(),{autoHide:!1}),t}},{key:"contentEl",value:function(){return this.simpleBar?this.simpleBar.getContentElement():Ev(Ov(e.prototype),"contentEl",this).call(this)}},{key:"dispose",value:function(){this.simpleBar&&(this.simpleBar.unMount(),delete this.simpleBar),Ev(Ov(e.prototype),"dispose",this).call(this)}},{key:"addItem",value:function(t){Ev(Ov(e.prototype),"addItem",this).call(this,t),this.simpleBar.recalculate()}},{key:"lockShowing",value:function(){Ev(Ov(e.prototype),"lockShowing",this).call(this),this.simpleBar.recalculate()}},{key:"recalculateScrollBar",value:function(){this.simpleBar.recalculate()}},{key:"handleBlur",value:function(t){var e=t.relatedTarget||document.activeElement;this.el().contains(e)||Pv.handleBlur.call(this,t)}}])&&_v(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(Cv);function jv(t){return jv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jv(t)}function Lv(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Iv(n.key),n)}}function Iv(t){var e=function(t,e){if("object"!=jv(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=jv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==jv(e)?e:String(e)}function Av(t,e,r){return e=Dv(e),function(t,e){if(e&&("object"===jv(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Rv()?Reflect.construct(e,r||[],Dv(t).constructor):e.apply(t,r))}function Rv(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Rv=function(){return!!t})()}function Dv(t){return Dv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Dv(t)}function Mv(t,e){return Mv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Mv(t,e)}xv.originalProto=Pv,Cv.prototype=xv.prototype,yl.registerComponent("Menu",xv);var Nv=yl.getComponent("Component"),Bv=yl.getComponent("MenuButton"),Uv=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Av(this,e,arguments)}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Mv(t,e)}(e,t),r=e,n=[{key:"createMenu",value:function(){var t,e=new xv(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var r=yl.dom.createEl("li",{className:"vjs-menu-title",innerHTML:(t=this.options_.title,"string"!=typeof t?t:t.replace(/./,(function(t){return t.toUpperCase()}))),tabIndex:-1});this.hideThreshold_+=1;var n=new Nv(this.player_,{el:r});e.addItem(n)}if(this.items=this.createItems(),this.items)for(var i=0;i<this.items.length;i++)e.addItem(this.items[i]);return e}}],n&&Lv(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(Bv),Fv=Bv.prototype.pressButton;Bv.prototype.pressButton=function(){Fv.call(this),this.inactivityTimeout=this.player_.cache_.inactivityTimeout,this.player_.cache_.inactivityTimeout=0,this.player_.options_.inactivityTimeout=0};var Vv=Bv.prototype.unpressButton;function Hv(t){return Hv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hv(t)}function qv(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,zv(n.key),n)}}function zv(t){var e=function(t,e){if("object"!=Hv(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Hv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Hv(e)?e:String(e)}function Wv(t,e,r){return e=Kv(e),function(t,e){if(e&&("object"===Hv(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Gv()?Reflect.construct(e,r||[],Kv(t).constructor):e.apply(t,r))}function Gv(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Gv=function(){return!!t})()}function Xv(){return Xv="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Kv(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},Xv.apply(this,arguments)}function Kv(t){return Kv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Kv(t)}function Yv(t,e){return Yv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Yv(t,e)}Bv.prototype.unpressButton=function(){Vv.call(this),this.player_.cache_.inactivityTimeout=this.inactivityTimeout,this.player_.options_.inactivityTimeout=this.inactivityTimeout,this.player_.reportUserActivity()},yl.registerComponent("MenuButton",Uv);var Qv=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Wv(this,e,arguments)}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Yv(t,e)}(e,t),r=e,(n=[{key:"buildCSSClass",value:function(){return"cv-time-wrapper ".concat(Xv(Kv(e.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(t,r,n){return Xv(Kv(e.prototype),"createEl",this).call(this,t,Object.assign(Object.assign({},r),{className:this.buildCSSClass()}),n)}}])&&qv(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("Component"));function $v(t){return $v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$v(t)}function Jv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Zv(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,eg(n.key),n)}}function tg(t,e,r){return e&&Zv(t.prototype,e),r&&Zv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function eg(t){var e=function(t,e){if("object"!=$v(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=$v(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==$v(e)?e:String(e)}function rg(t,e,r){return e=og(e),function(t,e){if(e&&("object"===$v(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ng()?Reflect.construct(e,r||[],og(t).constructor):e.apply(t,r))}function ng(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ng=function(){return!!t})()}function ig(){return ig="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=og(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},ig.apply(this,arguments)}function og(t){return og=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},og(t)}function ag(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&sg(t,e)}function sg(t,e){return sg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},sg(t,e)}Qv.prototype.options_={children:["currentTimeDisplay","remainingTimeDisplay"]},yl.registerComponent("TimeWrapper",Qv);var ug=function(t){function e(t,r){return Jv(this,e),rg(this,e,[t,r])}return ag(e,t),tg(e,[{key:"handleClick",value:function(t){var r=this;ig(og(e.prototype),"handleClick",this).call(this,t),this.requestAnimationFrame((function(){r.options_.item.showCollapsibleMenu()}))}},{key:"createEl",value:function(t,r,n){if(!this.options_.item)return ig(og(e.prototype),"createEl",this).call(this,t,r,n);var i=this.options_.item.getCollabsibleName(),o=this.options_.item.getCollabsibleValue(),a=this.options_.item.className,s='<span class="vjs-menu-item-text">'.concat(i,"</span>");this.valueHolder_=yl.dom.createEl("span",{innerHTML:o});var u=ig(og(e.prototype),"createEl",this).call(this,t,{className:"vjs-menu-item cv-cog-menu-item ".concat(o?"cv-has-cog-value":""," ").concat(a||"").trim(),innerHTML:s},n);return u.appendChild(this.valueHolder_),u}},{key:"updateCollapsibleValue",value:function(){this.valueHolder_.innerHTML=this.options_.item.getCollabsibleValue()}}]),e}(yl.getComponent("MenuItem")),lg=function(t){function e(t,r){return Jv(this,e),rg(this,e,[t,r])}return ag(e,t),tg(e,[{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-cog-menu-button ".concat(ig(og(e.prototype),"buildWrapperCSSClass",this).call(this))}},{key:"buildCSSClass",value:function(){return"cv-cog-button ".concat(ig(og(e.prototype),"buildCSSClass",this).call(this))}},{key:"pressButton",value:function(){this.player_.options_.deferMenus?this.player_.deferMenusPlugin().deferMenu():(this.menu.children_.forEach((function(t){t.updateCollapsibleValue&&t.updateCollapsibleValue()})),ig(og(e.prototype),"pressButton",this).call(this))}},{key:"createItems",value:function(){for(var t,e=this,r=[],n=0;n<this.options_.items.length;n++){var i=this.options_.items[n];i.isCollabsible&&i.showInCollabsibleMenu()&&i.isCollapsed&&r.push(new ug(this.player_,{item:i}))}return(null===(t=this.additionalItems)||void 0===t?void 0:t.length)&&this.additionalItems.forEach((function(t){var n,i=new t.ctor(e.player_,Object.assign(Object.assign({},e.options_),null!==(n=t.options)&&void 0!==n?n:{}));r.splice(t.index,0,i)})),r}},{key:"update",value:function(){ig(og(e.prototype),"update",this).call(this),this.player_.trigger("resizemenus")}},{key:"addItem",value:function(t){this.additionalItems||(this.additionalItems=[]),this.additionalItems.some((function(e){return e.name===t.name}))||(this.additionalItems.push(t),this.update())}}]),e}(yl.getComponent("MenuButton"));function cg(t){return cg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cg(t)}function fg(){return fg="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=gg(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},fg.apply(this,arguments)}function hg(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function pg(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,yg(n.key),n)}}function dg(t,e,r){return e&&pg(t.prototype,e),r&&pg(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function yg(t){var e=function(t,e){if("object"!=cg(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=cg(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==cg(e)?e:String(e)}function mg(t,e,r){return e=gg(e),function(t,e){if(e&&("object"===cg(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,vg()?Reflect.construct(e,r||[],gg(t).constructor):e.apply(t,r))}function vg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(vg=function(){return!!t})()}function gg(t){return gg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},gg(t)}function bg(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_g(t,e)}function _g(t,e){return _g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_g(t,e)}yl.registerComponent("cogButton",lg);var wg=yl.getComponent("MenuItem"),Tg=yl.getComponent("MenuButton"),Sg=["large","medium","small"],Eg=function(t){function e(t,r){return hg(this,e),mg(this,e,[t,r])}return bg(e,t),dg(e,[{key:"handleClick",value:function(){this.player_.textTrackSettings.setSizeSetting(this.options_.value)}}]),e}(wg),Og=function(t){function e(t,r){var n;return hg(this,e),(n=mg(this,e,[t,r])).alwaysCollapsed=!0,n.isCollapsed=!1,n.isCollabsible=!0,n.player_.ready((function(){n.update()})),n}return bg(e,t),dg(e,[{key:"createItems",value:function(){var t=this,e=this.player_.textTrackSettings;if(e){var r=e.getSizeSetting(),n=[new Id(this.player_,{label:"Caption Text Size",onClickBack:function(){t.requestAnimationFrame((function(){t.player_.getChild("collapserator").getChild("subsCapsButton").pressButton()}))}})];return Sg.map((function(e){n.push(new Eg(t.player_,{label:e.charAt(0).toUpperCase()+e.substring(1),selectable:!0,multiSelectable:!1,selected:e===r,value:e}))})),n}}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-has-left-icons ".concat(fg(gg(e.prototype),"buildWrapperCSSClass",this).call(this))}},{key:"getCollabsibleName",value:function(){return"Subtitle Size"}},{key:"getCollabsibleValue",value:function(){return""}},{key:"showInCollabsibleMenu",value:function(){return!1}},{key:"showCollapsibleMenu",value:function(){Tg.prototype.handleClick.apply(this)}}]),e}(Tg);yl.registerComponent("SubtitleSizeButton",Og);var kg=r(16951);function Cg(t,e,r){if(t.length)for(var n=t.length-1;n>=0;n--){var i=t[n];if(i.kind===e){if(r&&i.label!==r)continue;return i}}}function Pg(t,e,r,n){t.kind===e&&(r&&t.label!==r||(t.loaded_?n(t):t.one("loadeddata",(function(){n(t)}))))}function xg(t){if(null==t?void 0:t.cues.length)for(var e=0;e<t.cues.length;e++){var r=t.cues[e];(null==r?void 0:r.text)&&(r.text=0===(n=r.text)?"0":n?kg.sanitize(n.toString(),{ADD_ATTR:["target"]}).replace("&amp;","&"):"")}var n}var jg={getTrack:function(t,e,r){return Cg(t.textTracks(),e,r)},useTrack:function(t,e,r,n){var i=t.textTracks(),o=Cg(i,e,r);if(o)Pg(o,e,r,n);else{var a=function(t){Pg(t.track,e,r,n)};i.addEventListener("addtrack",a),t.one("dispose",(function(){i.removeEventListener("addtrack",a)}))}},getCurrentTextTrack:function(t){return this.findTrackByPredicate(t,(function(t){return"showing"===t.mode}))},findTrackByPredicate:function(t,e){if(!t)return null;for(var r=t.textTracks(),n=0;n<r.length;n++){var i=r[n];if(e(i))return i}return null},forEachTrack:function(t,e){if(t)for(var r=t.textTracks(),n=0;n<r.length;n++)e(r[n])},sanitizeTrack:function(t,e){if(t&&e)if(t.loaded)xg(t);else{var r=function(){return xg(t)};t.addEventListener("loadeddata",r),e.one("dispose",(function(){t.removeEventListener("loadeddata",r)}))}}};function Lg(t){return Lg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lg(t)}function Ig(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ag(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Dg(n.key),n)}}function Rg(t,e,r){return e&&Ag(t.prototype,e),r&&Ag(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Dg(t){var e=function(t,e){if("object"!=Lg(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Lg(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Lg(e)?e:String(e)}function Mg(t,e,r){return e=Fg(e),function(t,e){if(e&&("object"===Lg(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Bg(t)}(t,Ng()?Reflect.construct(e,r||[],Fg(t).constructor):e.apply(t,r))}function Ng(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ng=function(){return!!t})()}function Bg(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ug(){return Ug="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Fg(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},Ug.apply(this,arguments)}function Fg(t){return Fg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Fg(t)}function Vg(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Hg(t,e)}function Hg(t,e){return Hg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Hg(t,e)}var qg=yl.getComponent("MenuItem"),zg=function(t){function e(t,r){var n;return Ig(this,e),(n=Mg(this,e,[t,r])).onChange=tf(n.onChange,100,!1,Bg(n)),n.bindEventListeners(),n}return Vg(e,t),Rg(e,[{key:"createEl",value:function(){var t=this.localize("Search");return Ug(Fg(e.prototype),"createEl",this).call(this,"li",{className:"vjs-menu-item ".concat(this.options_.className||"").trim(),innerHTML:'\n <div class="cv-search-input-menu-item">\n <span class="cv-search-icon">\n <svg viewBox="0 0 24 24">\n <path d="M15.803 14.306l3.917 3.954a1 1 0 0 1-.007 1.417l-.018.018-.018.018a.997.997 0 0 1-1.41 0l-3.918-3.953-.3.214c-1.14.713-2.323 1.07-3.549 1.07-1.796 0-3.328-.642-4.597-1.925C4.634 13.836 4 12.296 4 10.5c0-1.796.634-3.328 1.903-4.597C7.172 4.634 8.704 4 10.5 4c1.796 0 3.329.634 4.597 1.903 1.27 1.269 1.904 2.801 1.904 4.597a6.447 6.447 0 0 1-1.027 3.507l-.17.3zM10.5 5.368c-1.425 0-2.637.5-3.635 1.497-.998.998-1.497 2.21-1.497 3.635 0 1.426.5 2.637 1.497 3.635.998.998 2.21 1.497 3.635 1.497 1.426 0 2.637-.499 3.635-1.497 1.027-1.026 1.54-2.238 1.54-3.635 0-1.397-.513-2.608-1.54-3.635-.998-.998-2.21-1.497-3.635-1.497z"/>\n </svg>\n </span><input placeholder="'.concat(t,'" type="text" autocomplete="off" spellcheck="false" aria-label="').concat(t,'" />\n </div>\n ')})}},{key:"focus",value:function(){this.$("input").focus()}},{key:"handleClick",value:function(t){t.stopImmediatePropagation(),this.$("input").focus()}},{key:"handleKeyDown",value:function(){this.focus()}},{key:"bindEventListeners",value:function(){var t=this,e=this.$("input");this.onChange=this.onChange.bind(this),e.addEventListener("keyup",this.onChange),e.addEventListener("blur",(function(e){t.options_.menuButton.menu.handleBlur(e)}))}},{key:"onChange",value:function(t){var e=t.target;this.options_.search(e.value)}}]),e}(qg);yl.registerComponent("SearchInputMenuItem",zg);var Wg=function(t){function e(){return Ig(this,e),Mg(this,e,arguments)}return Vg(e,t),Rg(e,[{key:"createEl",value:function(t,r,n){return Ug(Fg(e.prototype),"createEl",this).call(this,t,Object.assign(Object.assign({},r),{className:"vjs-menu-item cv-no-results"}),n)}},{key:"setLabel",value:function(t){var e=this.$(".vjs-menu-item-text");e&&(e.innerHTML=t)}}]),e}(qg);function Gg(t){return Gg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gg(t)}function Xg(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Kg(n.key),n)}}function Kg(t){var e=function(t,e){if("object"!=Gg(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Gg(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Gg(e)?e:String(e)}function Yg(t,e,r){return e=$g(e),function(t,e){if(e&&("object"===Gg(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Qg()?Reflect.construct(e,r||[],$g(t).constructor):e.apply(t,r))}function Qg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Qg=function(){return!!t})()}function $g(t){return $g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},$g(t)}function Jg(t,e){return Jg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Jg(t,e)}yl.registerComponent("NoMatchingResultsMenuItem",Wg);var Zg=function(t){function e(t,r){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Yg(this,e,[t,r])}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Jg(t,e)}(e,t),r=e,(n=[{key:"update",value:function(t,e){var r=this;if(null==t?void 0:t.length){var n=[],i=0;t.forEach((function(t){var o=r.options_.label.substr(i,t);o&&n.push(o),n.push('<span class="cv-highlight">'),n.push(r.options_.label.substr(t,e)),n.push("</span>"),i=t+e})),n.push(this.options_.label.substring(i,this.options_.label.length)),this.el().innerHTML='<span class="vjs-menu-item-text">'.concat(n.join(""),"</span>")}else this.el().innerHTML='<span class="vjs-menu-item-text">'.concat(this.options_.label,"</span>")}},{key:"handleClick",value:function(t){t.stopImmediatePropagation(),this.player_.currentTime(this.options_.cue.startTime)}}])&&Xg(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("MenuItem"));function tb(t){return tb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tb(t)}function eb(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,rb(n.key),n)}}function rb(t){var e=function(t,e){if("object"!=tb(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=tb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==tb(e)?e:String(e)}function nb(t,e,r){return e=sb(e),function(t,e){if(e&&("object"===tb(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return ob(t)}(t,ib()?Reflect.construct(e,r||[],sb(t).constructor):e.apply(t,r))}function ib(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ib=function(){return!!t})()}function ob(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ab(){return ab="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=sb(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},ab.apply(this,arguments)}function sb(t){return sb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},sb(t)}function ub(t,e){return ub=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ub(t,e)}var lb=yl.getComponent("MenuButton"),cb=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=nb(this,e,[t,r])).alwaysCollapsed=!0,n.isCollapsed=!1,n.isCollabsible=!0,n.update=n.update.bind(ob(n)),n.search=n.search.bind(ob(n)),n.player_.textTracks().addEventListener("selectedlanguagechange",n.update),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ub(t,e)}(e,t),r=e,n=[{key:"bindTrackEvents",value:function(t){var e=this;t.removeEventListener("loadeddata",this.update),t.addEventListener("loadeddata",this.update),this.player_.one("dispose",(function(){t.removeEventListener("loadeddata",e.update)}))}},{key:"createItems",value:function(){var t,e=jg.getCurrentTextTrack(this.player_);if(e){if(null===(t=e.cues)||void 0===t?void 0:t.length){for(var r=[new zg(this.player_,{menuButton:this,search:this.search})],n=0;n<e.cues.length;n++){var i=e.cues[n];r.push(new Zg(this.player_,{cue:i,label:i.text,selected:!1,multiSelectable:!1}))}var o=new Wg(this.player_,{label:"No matching results",selected:!1,selectable:!1,multiSelectable:!1});return o.hide(),r.push(o),r}this.bindTrackEvents(e)}}},{key:"search",value:function(t){var e;t=t.trim();var r=jg.getCurrentTextTrack(this.player_);if(null===(e=null==r?void 0:r.cues)||void 0===e?void 0:e.length){var n=this.findMatches(t,r);this.toggleItemVisibility(t,n),this.toggleNoResults(t,n)}}},{key:"findMatches",value:function(t,e){var r={};if(!t)return r;for(var n=new RegExp(t,"gi"),i=0;i<e.cues.length;i++){for(var o=e.cues[i].text,a=[],s=void 0;s=n.exec(o);)a.push(s.index);a.length&&(r[i]=a)}return r}},{key:"toggleItemVisibility",value:function(t,e){this.menu.children_.slice(1,this.menu.children_.length-1).forEach((function(r,n){!t||e[n]?r.show():r.hide(),r.update(e[n],t.length)}))}},{key:"toggleNoResults",value:function(t,e){var r=this.menu.children_[this.menu.children_.length-1];!t||Object.keys(e).length?r.hide():r.show()}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-big cv-subtitle-search-button ".concat(ab(sb(e.prototype),"buildWrapperCSSClass",this).call(this))}},{key:"update",value:function(){ab(sb(e.prototype),"update",this).call(this),this.player_.trigger("resizemenus")}},{key:"pressButton",value:function(){ab(sb(e.prototype),"pressButton",this).call(this);var t=this.menu.children_[0];(null==t?void 0:t.focus)&&(null==t||t.focus())}},{key:"getCollabsibleName",value:function(){return"Subtitle Size"}},{key:"getCollabsibleValue",value:function(){return""}},{key:"showInCollabsibleMenu",value:function(){return!1}},{key:"showCollapsibleMenu",value:function(){lb.prototype.handleClick.apply(this)}}],n&&eb(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(lb);function fb(t){return fb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fb(t)}function hb(){return hb="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=bb(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},hb.apply(this,arguments)}function pb(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function db(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,mb(n.key),n)}}function yb(t,e,r){return e&&db(t.prototype,e),r&&db(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function mb(t){var e=function(t,e){if("object"!=fb(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=fb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==fb(e)?e:String(e)}function vb(t,e,r){return e=bb(e),function(t,e){if(e&&("object"===fb(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,gb()?Reflect.construct(e,r||[],bb(t).constructor):e.apply(t,r))}function gb(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(gb=function(){return!!t})()}function bb(t){return bb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},bb(t)}function _b(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wb(t,e)}function wb(t,e){return wb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},wb(t,e)}yl.registerComponent("subtitleSearchButton",cb);var Tb=yl.getComponent("MenuItem"),Sb=yl.getComponent("MenuButton"),Eb=[{label:"Play / Pause",type:"play-pause"},{label:"Volume",type:"volume"},{label:"Mute",type:"mute"},{label:"Toggle fullscreen",type:"fullscreen"},{label:"Exit fullscreen",type:"exit-fullscreen"}],Ob=function(t){function e(t,r){return pb(this,e),vb(this,e,[t,r])}return _b(e,t),yb(e,[{key:"createEl",value:function(){return yl.dom.createEl("li",{className:"vjs-menu-item",tabIndex:-1,innerHTML:'\n <span class="vjs-menu-item-text">'.concat(this.options_.label,"</span>\n <span>").concat(this.getDisplayHtml(this.options_.type),"\n ")})}},{key:"getDisplayHtml",value:function(t){switch(t){case"play-pause":return'<span class="cv-keyboard-button">Spacebar</span>';case"volume":return'<span class="cv-keyboard-button">Shift</span> + \n <span class="cv-keyboard-button cv-single-key">&uArr;</span> / \n <span class="cv-keyboard-button">Shift</span> +\n <span class="cv-keyboard-button cv-single-key">&dArr;</span>';case"mute":return'<span class="cv-keyboard-button cv-single-key">m</span>';case"fullscreen":return'<span class="cv-keyboard-button cv-single-key">f</span>';case"exit-fullscreen":return'<span class="cv-keyboard-button cv-single-key">esc</span>'}return""}}]),e}(Tb),kb=function(t){function e(){var t;return pb(this,e),(t=vb(this,e,arguments)).alwaysCollapsed=!0,t.isCollapsed=!1,t.isCollabsible=!0,t}return _b(e,t),yb(e,[{key:"createItems",value:function(){var t=this,e=[];return e.push(new Id(this.player_,{label:"Keyboard Shortcuts"})),Eb.forEach((function(r){e.push(new Ob(t.player_,r))})),e}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-keyboard-shortcuts ".concat(hb(bb(e.prototype),"buildWrapperCSSClass",this).call(this))}},{key:"getCollabsibleName",value:function(){return"Keyboard Shortcuts"}},{key:"getCollabsibleValue",value:function(){return""}},{key:"showInCollabsibleMenu",value:function(){return!this.player_.options_.mobile}},{key:"showCollapsibleMenu",value:function(){Sb.prototype.handleClick.apply(this)}}]),e}(Sb);function Cb(t){return Cb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cb(t)}function Pb(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,xb(n.key),n)}}function xb(t){var e=function(t,e){if("object"!=Cb(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Cb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Cb(e)?e:String(e)}function jb(t,e,r){return e=Rb(e),function(t,e){if(e&&("object"===Cb(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ib(t)}(t,Lb()?Reflect.construct(e,r||[],Rb(t).constructor):e.apply(t,r))}function Lb(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Lb=function(){return!!t})()}function Ib(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ab(){return Ab="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Rb(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},Ab.apply(this,arguments)}function Rb(t){return Rb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Rb(t)}function Db(t,e){return Db=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Db(t,e)}yl.registerComponent("KeyboardShortcutsButton",kb);var Mb="cv-collapsed",Nb=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=jb(this,e,[t,r])).addChild("cogButton",{items:n.children_},n.children_.length-1),n.update=n.update.bind(Ib(n)),n.player_.on("cv-updatecog",n.update),n.player_.on("playerresize",n.update),n.player_.one("play",n.update),n.player_.on("dispose",(function(){n.player_.off("cv-updatecog",n.update),n.player_.off("playerresize",n.update),n.player_.off("play",n.update)})),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Db(t,e)}(e,t),r=e,n=[{key:"togglehidden",value:function(t){for(var e=0;e<this.children_.length;e++){var r=this.children_[e];r.isCollabsible&&(r.alwaysCollapsed||t?(r.isCollapsed=!0,r.addClass(Mb)):(r.isCollapsed=!1,r.removeClass(Mb)))}this.getChild("cogButton").update()}},{key:"update",value:function(){var t=this.player_.el().getBoundingClientRect();if(0!==t.width){this.addClass("cv-collapsorator-ready");var e=t.width<600;this.player_.options_.deferMenus&&(e=!0),this.togglehidden(e)}}},{key:"buildCSSClass",value:function(){return"cv-collapsorator ".concat(Ab(Rb(e.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(t,r,n){return Ab(Rb(e.prototype),"createEl",this).call(this,t,Object.assign(Object.assign({},r),{className:this.buildCSSClass()}),n)}}],n&&Pb(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("Component"));yl.registerComponent("collapserator",Nb);var Bb=["playToggle","volumePanel","customControlSpacer","playbackRateMenuButton","chaptersButton","qualityButton","keyboardShortcutsButton","subsCapsButton","whiteboardModeButton","subtitleSizeButton","subtitleSearchButton","fullscreenToggle"];function Ub(t){return Ub="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ub(t)}function Fb(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Vb(n.key),n)}}function Vb(t){var e=function(t,e){if("object"!=Ub(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Ub(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ub(e)?e:String(e)}function Hb(t,e,r){return e=zb(e),function(t,e){if(e&&("object"===Ub(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,qb()?Reflect.construct(e,r||[],zb(t).constructor):e.apply(t,r))}function qb(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(qb=function(){return!!t})()}function zb(t){return zb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},zb(t)}function Wb(t,e){return Wb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Wb(t,e)}var Gb=yl.getComponent("SeekBar"),Xb=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Hb(this,e,arguments)}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wb(t,e)}(e,t),r=e,(n=[{key:"handleMouseDown",value:function(t){var e=this.player_.preventScrubbingPlugin();e.isEnabled&&this.getMouseTime(t)>e.furthestVisitedTime||(Gb.prototype.handleMouseDown.call(this,t),this.player_.addClass("cv-disable-play-pause-feedback"))}},{key:"handleMouseMove",value:function(t){Gb.prototype.handleMouseMove.call(this,t),this.update()}},{key:"getPercent",value:function(){var t=this.player_.currentTime()/this.player_.duration();return t>=1?1:t}},{key:"handleMouseUp",value:function(t){var e=this;Gb.prototype.handleMouseUp.call(this,t),this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout((function(){e.player_.removeClass("cv-disable-play-pause-feedback")}),500)}},{key:"clamp",value:function(t,e,r){return Math.min(Math.max(t,e),r)}},{key:"getMouseTime",value:function(t){return this.clamp(Gb.prototype.calculateDistance.call(this,t).x,0,1)*this.player_.duration()}}])&&Fb(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(Gb);function Kb(t){return Kb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kb(t)}function Yb(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Qb(n.key),n)}}function Qb(t){var e=function(t,e){if("object"!=Kb(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Kb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Kb(e)?e:String(e)}function $b(t,e,r){return e=t_(e),function(t,e){if(e&&("object"===Kb(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Jb()?Reflect.construct(e,r||[],t_(t).constructor):e.apply(t,r))}function Jb(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Jb=function(){return!!t})()}function Zb(){return Zb="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=t_(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},Zb.apply(this,arguments)}function t_(t){return t_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},t_(t)}function e_(t,e){return e_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},e_(t,e)}yl.registerComponent("SeekBar",Xb);var r_=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),$b(this,e,arguments)}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&e_(t,e)}(e,t),r=e,(n=[{key:"buildCSSClass",value:function(){return"cv-chapter-bar-load-progress ".concat(Zb(t_(e.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(t,r,n){return Zb(t_(e.prototype),"createEl",this).call(this,t,Object.assign(Object.assign({},r),{className:this.buildCSSClass()}),n)}},{key:"update",value:function(t){this.el_.style.width=100*t+"%"}}])&&Yb(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("Component"));function n_(t){return n_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n_(t)}function i_(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,o_(n.key),n)}}function o_(t){var e=function(t,e){if("object"!=n_(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=n_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n_(e)?e:String(e)}function a_(t,e,r){return e=l_(e),function(t,e){if(e&&("object"===n_(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,s_()?Reflect.construct(e,r||[],l_(t).constructor):e.apply(t,r))}function s_(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(s_=function(){return!!t})()}function u_(){return u_="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=l_(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},u_.apply(this,arguments)}function l_(t){return l_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},l_(t)}function c_(t,e){return c_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},c_(t,e)}var f_=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),a_(this,e,arguments)}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c_(t,e)}(e,t),r=e,(n=[{key:"buildCSSClass",value:function(){return"cv-chapter-bar-play-progress ".concat(u_(l_(e.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(t,r,n){return u_(l_(e.prototype),"createEl",this).call(this,t,Object.assign(Object.assign({},r),{className:this.buildCSSClass()}),n)}},{key:"update",value:function(t){t>0&&t<1?this.addClass("cv-current"):this.removeClass("cv-current"),this.el_.style.width=100*t+"%"}}])&&i_(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("Component"));function h_(t){return h_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h_(t)}function p_(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,d_(n.key),n)}}function d_(t){var e=function(t,e){if("object"!=h_(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=h_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==h_(e)?e:String(e)}function y_(t,e,r){return e=g_(e),function(t,e){if(e&&("object"===h_(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,m_()?Reflect.construct(e,r||[],g_(t).constructor):e.apply(t,r))}function m_(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(m_=function(){return!!t})()}function v_(){return v_="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=g_(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},v_.apply(this,arguments)}function g_(t){return g_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},g_(t)}function b_(t,e){return b_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},b_(t,e)}var __=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=y_(this,e,[t,r])).playProgress=new f_(n.player_),n.addChild(n.playProgress),n.loadProgress=new r_(n.player_),n.addChild(n.loadProgress),n.update(),n.updateBuffered(0),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&b_(t,e)}(e,t),r=e,n=[{key:"buildCSSClass",value:function(){return"cv-chapter-bar-item ".concat(v_(g_(e.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(t,r,n){return v_(g_(e.prototype),"createEl",this).call(this,t,Object.assign(Object.assign({},r),{className:this.buildCSSClass()}),n)}},{key:"getCurrentTime",value:function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}},{key:"update",value:function(){var t=this.player_.duration()||3600,e=this.options_.endTime-this.options_.startTime;if(t!==this.duration_){var r=e/t;this.el_.style.width=100*r+"%";var n=this.options_.startTime/t;this.el_.style.left=100*n+"%",this.duration_=t}var i=this.getCurrentTime();i<this.options_.startTime?this.playProgress.update(0):i>this.options_.endTime?this.playProgress.update(1):this.playProgress.update((i-this.options_.startTime)/e)}},{key:"updateBuffered",value:function(t){var e=this.options_.endTime-this.options_.startTime;t<this.options_.startTime?this.loadProgress.update(0):t>this.options_.endTime?this.loadProgress.update(1):this.loadProgress.update((t-this.options_.startTime)/e)}}],n&&p_(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("Component"));function w_(t){for(var e=t.buffered(),r=t.currentTime(),n=0,i=0;i<e.length;i++){var o=e.start(i),a=e.end(i);if(o<=r&&a>=r){n=a;break}}return n}function T_(t){return T_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T_(t)}function S_(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,E_(n.key),n)}}function E_(t){var e=function(t,e){if("object"!=T_(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=T_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==T_(e)?e:String(e)}function O_(t,e,r){return e=P_(e),function(t,e){if(e&&("object"===T_(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,k_()?Reflect.construct(e,r||[],P_(t).constructor):e.apply(t,r))}function k_(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(k_=function(){return!!t})()}function C_(){return C_="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=P_(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},C_.apply(this,arguments)}function P_(t){return P_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},P_(t)}function x_(t,e){return x_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},x_(t,e)}var j_=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),O_(this,e,arguments)}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&x_(t,e)}(e,t),r=e,n=[{key:"buildCSSClass",value:function(){return"cv-chapter-bar-items ".concat(C_(P_(e.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(t,r,n){return C_(P_(e.prototype),"createEl",this).call(this,t,Object.assign(Object.assign({},r),{className:this.buildCSSClass()}),n)}},{key:"update",value:function(){this.children_.forEach((function(t){t.update()}))}},{key:"updateBuffered",value:function(){var t=this;this.children_.forEach((function(e){e.updateBuffered(w_(t.player_))}))}}],n&&S_(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("Component"));function L_(t){return L_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},L_(t)}function I_(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,A_(n.key),n)}}function A_(t){var e=function(t,e){if("object"!=L_(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=L_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==L_(e)?e:String(e)}function R_(t,e,r){return e=B_(e),function(t,e){if(e&&("object"===L_(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return M_(t)}(t,D_()?Reflect.construct(e,r||[],B_(t).constructor):e.apply(t,r))}function D_(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(D_=function(){return!!t})()}function M_(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function N_(){return N_="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=B_(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},N_.apply(this,arguments)}function B_(t){return B_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},B_(t)}function U_(t,e){return U_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},U_(t,e)}var F_=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=R_(this,e,[t,r])).onDurationChange=n.onDurationChange.bind(M_(n)),n.createChapterItems=n.createChapterItems.bind(M_(n)),n.updateBuffered=n.updateBuffered.bind(M_(n)),jg.useTrack(n.player_,"chapters",null,n.createChapterItems),n.player_.on("durationchange",n.onDurationChange),n.player_.on("progress",n.updateBuffered),n.createChapterItems(),n.update(),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&U_(t,e)}(e,t),r=e,n=[{key:"dispose",value:function(){this.player_.off("durationchange",this.onDurationChange),this.player_.off("progress",this.updateBuffered),N_(B_(e.prototype),"dispose",this).call(this)}},{key:"createEl",value:function(){return yl.dom.createEl("div",{className:"vjs-progress-holder cv-chapter-seek-bar"},{"aria-label":this.localize("Progress Bar")})}},{key:"onDurationChange",value:function(){this.createChapterItems(),this.update()}},{key:"update",value:function(){var t=N_(B_(e.prototype),"update",this).call(this);return this.chapterBarItems&&this.chapterBarItems.update(),t}},{key:"updateBuffered",value:function(){this.chapterBarItems.updateBuffered()}},{key:"bindUpdateListener",value:function(t){var e=this,r=function(){e.createChapterItems(),e.updateBuffered()};t.addEventListener("cv:cuechange",r),this.player_.one("dispose",(function(){return t.removeEventListener("cv:cuechange",r)}))}},{key:"createChapterItems",value:function(t){var e,r;t&&(this.track_||this.bindUpdateListener(t),this.track_=t);var n=new j_(this.player_);if((null===(r=null===(e=this.track_)||void 0===e?void 0:e.cues)||void 0===r?void 0:r.length)&&!this.options_.ignoreChapters)for(var i=0;i<this.track_.cues.length;i++){var o=this.track_.cues[i],a=o.startTime,s=o.endTime,u=this.player_.duration();u&&(i===this.track_.cues.length-1&&o.endTime<this.player_.duration()&&(s=this.player_.duration()),s>u&&(s=u));var l=new __(this.player_,{startTime:a,endTime:s});if(n.addChild(l),u&&s===u)break}else n.addChild(new __(this.player_,{startTime:0,endTime:this.player_.duration()||3600}));this.chapterBarItems&&this.removeChild(this.chapterBarItems),this.chapterBarItems=n,this.addChild(this.chapterBarItems)}}],n&&I_(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("SeekBar"));function V_(t){return V_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},V_(t)}function H_(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,q_(n.key),n)}}function q_(t){var e=function(t,e){if("object"!=V_(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=V_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==V_(e)?e:String(e)}function z_(t,e,r){return e=X_(e),function(t,e){if(e&&("object"===V_(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,W_()?Reflect.construct(e,r||[],X_(t).constructor):e.apply(t,r))}function W_(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(W_=function(){return!!t})()}function G_(){return G_="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=X_(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},G_.apply(this,arguments)}function X_(t){return X_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},X_(t)}function K_(t,e){return K_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},K_(t,e)}F_.prototype.options_={children:["playProgressBar"],barName:"playProgressBar"},yl.browser.IS_IOS||yl.browser.IS_ANDROID||F_.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),yl.registerComponent("ChapterSeekBar",F_);var Y_=yl.getComponent("ProgressControl"),Q_="seekBar",$_=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=z_(this,e,arguments)).seekBarName_=Q_,t}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&K_(t,e)}(e,t),r=e,(n=[{key:"setSeekBarName",value:function(t){this.seekBarName_=t}},{key:"getChild",value:function(t){return(null==t?void 0:t.toLowerCase())===Q_.toLowerCase()&&(t=this.seekBarName_),G_(X_(e.prototype),"getChild",this).call(this,t)}}])&&H_(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(Y_);function J_(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;t=t<0?0:t;var r=Math.floor(t%60),n=Math.floor(t/60%60),i=Math.floor(t/3600),o=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(t)||t===1/0)&&(i=n=r="-"),(i=i>0||a>0?i+":":"")+(n=((i||o>=10)&&n<10?"0"+n:n)+":")+(r<10?"0"+r:r)}function Z_(t){return Z_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Z_(t)}function tw(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ew(n.key),n)}}function ew(t){var e=function(t,e){if("object"!=Z_(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Z_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Z_(e)?e:String(e)}function rw(t,e,r){return e=ow(e),function(t,e){if(e&&("object"===Z_(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,nw()?Reflect.construct(e,r||[],ow(t).constructor):e.apply(t,r))}function nw(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(nw=function(){return!!t})()}function iw(){return iw="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ow(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},iw.apply(this,arguments)}function ow(t){return ow=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ow(t)}function aw(t,e){return aw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},aw(t,e)}$_.prototype.options_={children:[]},yl.registerComponent("ProgressControl",$_);var sw=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=rw(this,e,[t,r])).hasCustomChapterText=!1,jg.useTrack(n.player_,"chapters",!1,(function(t){n.track_=t})),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&aw(t,e)}(e,t),r=e,n=[{key:"createEl",value:function(){var t=iw(ow(e.prototype),"createEl",this).call(this);return this.chapter_=yl.dom.createEl("div"),t.appendChild(this.chapter_),this.time_=yl.dom.createEl("div"),t.appendChild(this.time_),t}},{key:"updateTime",value:function(t){var e=this.player_.duration();if(yl.dom.textContent(this.time_,J_(t,e)),this.track_&&!this.hasCustomChapterText){for(var r=0;r<this.track_.cues.length;r++){var n=this.track_.cues[r],i=n.endTime||e;if(n.startTime<=t&&i>=t)return void yl.dom.textContent(this.chapter_,n.text)}yl.dom.textContent(this.chapter_,"")}}},{key:"clearChapterContent",value:function(){yl.dom.textContent(this.chapter_,"")}},{key:"updateText",value:function(t){yl.dom.textContent(this.time_,t)}},{key:"setCustomChapterText",value:function(t){this.hasCustomChapterText=!!t,yl.dom.textContent(this.chapter_,null!=t?t:"")}}],n&&tw(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("TimeTooltip"));function uw(t){return uw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uw(t)}function lw(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,cw(n.key),n)}}function cw(t){var e=function(t,e){if("object"!=uw(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=uw(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==uw(e)?e:String(e)}function fw(t,e,r){return e=dw(e),function(t,e){if(e&&("object"===uw(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,hw()?Reflect.construct(e,r||[],dw(t).constructor):e.apply(t,r))}function hw(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(hw=function(){return!!t})()}function pw(){return pw="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=dw(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},pw.apply(this,arguments)}function dw(t){return dw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},dw(t)}function yw(t,e){return yw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},yw(t,e)}yl.registerComponent("TimeTooltip",sw);var mw=function(t){function e(t,r){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),fw(this,e,[t,r])}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&yw(t,e)}(e,t),r=e,n=[{key:"setTrack",value:function(t){this.track_=t}},{key:"createEl",value:function(){var t=pw(dw(e.prototype),"createEl",this).call(this,"div",{className:"cv-thumbnail-display"});return this.img_=yl.dom.createEl("img"),t.appendChild(this.img_),t}},{key:"enable",value:function(){this.addClass("cv-thumbnail-display-enabled")}},{key:"disable",value:function(){this.removeClass("cv-thumbnail-display-enabled")}},{key:"parseImageLink",value:function(t){var e=t.indexOf("#");if(-1===e)return{src:t,w:0,h:0,x:0,y:0};var r=t.substr(0,e),n=t.substr(e+1);if("xywh="!==n.substr(0,5))return{src:t,w:0,h:0,x:0,y:0};var i=this.getScale(),o=n.substr(5).split(",");return{src:r,w:parseInt(o[2])*i,h:parseInt(o[3])*i,x:parseInt(o[0])*i,y:parseInt(o[1])*i}}},{key:"getScale",value:function(){var t=this.options_.scaleFactor,e=this.player_.whiteboardModePlugin().side;return this.player_.isFullscreen()&&"bottom"!==e&&(t*=2),t}},{key:"update",value:function(t){var e,r;if(null===(r=null===(e=this.track_)||void 0===e?void 0:e.cues)||void 0===r?void 0:r.length){for(var n,i=t,o=0;o<this.track_.cues.length;){var a=this.track_.cues[o];if(a.startTime<=i&&a.endTime>=i){n=this.parseImageLink(a.text);break}o++}if(null==n?void 0:n.src){this.enable();var s=n,u=s.src,l=s.w,c=s.h,f=s.x,h=s.y,p=this.getScale();this.img_.src=u,this.img_.style.left=-f+"px",this.img_.style.top=-h+"px",this.img_.style.transformOrigin="0 0",this.img_.style.transform="scale(".concat(p,")"),this.el_.style.width=l+"px",this.el_.style.height=c+"px"}else this.disable()}}}],n&&lw(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("Component"));function vw(t){return vw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vw(t)}function gw(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,bw(n.key),n)}}function bw(t){var e=function(t,e){if("object"!=vw(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=vw(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==vw(e)?e:String(e)}function _w(t,e,r){return e=Tw(e),function(t,e){if(e&&("object"===vw(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Sw(t)}(t,ww()?Reflect.construct(e,r||[],Tw(t).constructor):e.apply(t,r))}function ww(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ww=function(){return!!t})()}function Tw(t){return Tw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Tw(t)}function Sw(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ew(t,e){return Ew=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ew(t,e)}mw.prototype.options_={scaleFactor:1},yl.registerComponent("ThumbnailDisplay",mw);var Ow=yl.getComponent("MouseTimeDisplay"),kw="cv-mouse-time-display-force-show",Cw=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=_w(this,e,[t,r]),jg.useTrack(n.player_,"metadata","thumbnails",(function(t){n.getChild("ThumbnailDisplay").setTrack(t)})),n.update=n.update.bind(Sw(n)),n.player_.on("durationchange",n.update),n.player_.one("dispose",(function(){n.player_.off("durationchange",n.update)})),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ew(t,e)}(e,t),r=e,(n=[{key:"update",value:function(t,e){var r=this;this.requestAnimationFrame((function(){var n=r.getChild("TimeTooltip"),i=r.getChild("ThumbnailDisplay"),o=e*r.player_.duration(),a=r.player_.preventScrubbingPlugin(),s=r.player_.controlBar.getChild("progressControl").getChild(dy),u=!1;a.isEnabled&&(u=o>a.furthestVisitedTime),u?(r.hide(),s.show(),tf(s.hide,1e3,!1,s)()):(r.show(),s&&s.hide(!0),i.update(o),n.updateTime(o));var l=r.el_.getBoundingClientRect();r.el_.style.marginLeft=-l.width/2+"px";var c=t.width*e;c<l.width/2?r.el_.style.left=l.width/2+"px":c>t.width-l.width/2?r.el_.style.left=t.width-l.width/2+"px":r.el_.style.left=t.width*e+"px"}))}},{key:"forceShow",value:function(){this.addClass(kw)}},{key:"removeForceShow",value:function(){this.removeClass(kw)}}])&&gw(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(Ow);function Pw(t){return Pw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pw(t)}function xw(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,jw(n.key),n)}}function jw(t){var e=function(t,e){if("object"!=Pw(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Pw(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Pw(e)?e:String(e)}function Lw(t,e,r){return e=Rw(e),function(t,e){if(e&&("object"===Pw(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Iw()?Reflect.construct(e,r||[],Rw(t).constructor):e.apply(t,r))}function Iw(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Iw=function(){return!!t})()}function Aw(){return Aw="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Rw(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},Aw.apply(this,arguments)}function Rw(t){return Rw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Rw(t)}function Dw(t,e){return Dw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Dw(t,e)}Cw.prototype.options_={children:["ThumbnailDisplay","TimeTooltip"]},yl.registerComponent("MouseTimeDisplay",Cw);var Mw=yl.getComponent("ChaptersTrackMenuItem"),Nw=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=Lw(this,e,[t,r])).nonIconControl=!1,n.thumbnailDisplay=new mw(n.player_,{scaleFactor:.5}),n.el().insertBefore(n.thumbnailDisplay.el(),n.el().firstChild),jg.useTrack(n.player_,"metadata","thumbnails",(function(t){n.addClass("cv-has-thumbnails"),n.thumbnailDisplay.setTrack(t),n.thumbnailDisplay.update(n.options_.cue.startTime)})),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Dw(t,e)}(e,t),r=e,n=[{key:"update",value:function(){this.player_&&Mw.prototype.update.call(this)}},{key:"buildCSSClass",value:function(){return"vjs-menu-item cv-chapter-menu-item"}},{key:"createEl",value:function(t,r,n){return this.nonIconControl=!0,Aw(Rw(e.prototype),"createEl",this).call(this,"li",Object.assign({className:this.buildCSSClass(),innerHTML:this.getInnerHTML(),tabIndex:-1},r),n)}},{key:"getInnerHTML",value:function(){var t=this.player_.duration();return'<span class="vjs-menu-item-text cv-chapter-menu-item-text">'+"<p>".concat(this.localize(this.options_.label),"</p>")+"<p>(".concat(J_(this.options_.cue.startTime,t),")</p>")+"</span>"}}],n&&xw(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(Mw);function Bw(t){return Bw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bw(t)}function Uw(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Fw(n.key),n)}}function Fw(t){var e=function(t,e){if("object"!=Bw(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Bw(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Bw(e)?e:String(e)}function Vw(t,e,r){return e=Ww(e),function(t,e){if(e&&("object"===Bw(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return qw(t)}(t,Hw()?Reflect.construct(e,r||[],Ww(t).constructor):e.apply(t,r))}function Hw(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Hw=function(){return!!t})()}function qw(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function zw(){return zw="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ww(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},zw.apply(this,arguments)}function Ww(t){return Ww=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ww(t)}function Gw(t,e){return Gw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Gw(t,e)}var Xw=function(t){function e(t,r,n){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(i=Vw(this,e,[t,r,n])).alwaysCollapsed=!1,i.isCollapsed=!1,i.isCollabsible=!0,i.update=i.update.bind(qw(i)),i.player_.on("cv-whiteboard-change",i.update),i.player_.on("fullscreenchange",i.update),i.player_.on("dispose",(function(){i.player_.off("cv-whiteboard-change",i.update),i.player_.off("fullscreenchange",i.update)})),i}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Gw(t,e)}(e,t),r=e,n=[{key:"buildCSSClass",value:function(){return"cv-chapters-button ".concat(zw(Ww(e.prototype),"buildCSSClass",this).call(this))}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-big ".concat(zw(Ww(e.prototype),"buildWrapperCSSClass",this).call(this))}},{key:"createItems",value:function(){var t=[];if(!this.track_)return t;var e=this.track_.cues;if(!e)return t;for(var r=0,n=e.length;r<n;r++){var i=e[r],o=new Nw(this.player_,{track:this.track_,cue:i});t.push(o)}return t}},{key:"setTrack",value:function(t){var r=this;if(zw(Ww(e.prototype),"setTrack",this).call(this,t),this.track_&&"chapters"===this.track_.kind){t.one("loadeddata",this.update);var n=function(){r.update(),r.player_.trigger("resizemenus")};t.on("cv:cuechange",n),this.player_.one("dispose",(function(){return t.off("cv:cueupdate",n)}))}}},{key:"update",value:function(t){zw(Ww(e.prototype),"update",this).call(this,t)}},{key:"getCollabsibleName",value:function(){return"Chapters"}},{key:"getCollabsibleValue",value:function(){var t=this.track_.activeCues[0];return(null==t?void 0:t.text)||""}},{key:"showInCollabsibleMenu",value:function(){if(!this.track_)return!1;var t=this.track_.cues;return!(!t||!t.length)}},{key:"showCollapsibleMenu",value:function(){this.handleClick(null)}}],n&&Uw(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("ChaptersButton"));function Kw(t){return Kw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kw(t)}function Yw(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Qw(n.key),n)}}function Qw(t){var e=function(t,e){if("object"!=Kw(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Kw(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Kw(e)?e:String(e)}function $w(t,e,r){return e=tT(e),function(t,e){if(e&&("object"===Kw(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Jw()?Reflect.construct(e,r||[],tT(t).constructor):e.apply(t,r))}function Jw(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Jw=function(){return!!t})()}function Zw(){return Zw="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=tT(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},Zw.apply(this,arguments)}function tT(t){return tT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},tT(t)}function eT(t,e){return eT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},eT(t,e)}yl.registerComponent("ChaptersButton",Xw);var rT=yl.getComponent("OffTextTrackMenuItem"),nT=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),$w(this,e,arguments)}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&eT(t,e)}(e,t),r=e,(n=[{key:"handleClick",value:function(t){rT.prototype.handleClick.call(this,t),this.player_.trigger("cv:languageselected")}},{key:"createEl",value:function(t,r,n){return Zw(tT(e.prototype),"createEl",this).call(this,"li",Object.assign(Object.assign({className:"vjs-menu-item",tabIndex:-1},r),{innerHTML:'<span class="vjs-menu-item-text">Off</span>'}),n)}}])&&Yw(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(rT);function iT(t){return iT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},iT(t)}function oT(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,aT(n.key),n)}}function aT(t){var e=function(t,e){if("object"!=iT(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=iT(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==iT(e)?e:String(e)}function sT(t,e,r){return e=lT(e),function(t,e){if(e&&("object"===iT(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,uT()?Reflect.construct(e,r||[],lT(t).constructor):e.apply(t,r))}function uT(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(uT=function(){return!!t})()}function lT(t){return lT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},lT(t)}function cT(t,e){return cT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},cT(t,e)}yl.registerComponent("OffTextTrackMenuItem",nT);var fT=yl.getComponent("TextTrackButton"),hT=yl.getComponent("TextTrackMenuItem"),pT=yl.getComponent("OffTextTrackMenuItem"),dT=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),sT(this,e,arguments)}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&cT(t,e)}(e,t),r=e,n=[{key:"createItems",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:hT;this.label_&&(t="".concat(this.label_," off")),e.push(new pT(this.player_,{kinds:this.kinds_,kind:this.kind_,label:t})),this.hideThreshold_+=1;var n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var i=0;i<n.length;i++){var o=n[i];if(this.kinds_.indexOf(o.kind)>-1){var a=new r(this.player_,{track:o,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});a.addClass("vjs-".concat(o.kind,"-menu-item")),e.push(a)}}return e}}],n&&oT(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(fT);function yT(t){return yT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yT(t)}function mT(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,vT(n.key),n)}}function vT(t){var e=function(t,e){if("object"!=yT(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=yT(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==yT(e)?e:String(e)}function gT(t,e,r){return e=_T(e),function(t,e){if(e&&("object"===yT(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,bT()?Reflect.construct(e,r||[],_T(t).constructor):e.apply(t,r))}function bT(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(bT=function(){return!!t})()}function _T(t){return _T=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_T(t)}function wT(t,e){return wT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},wT(t,e)}yl.registerComponent("TextTrackButton",dT);var TT=yl.getComponent("SubsCapsMenuItem"),ST=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),gT(this,e,arguments)}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wT(t,e)}(e,t),r=e,(n=[{key:"handleClick",value:function(t){TT.prototype.handleClick.call(this,t),this.player_.trigger("cv:languageselected")}}])&&mT(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(TT);function ET(t){return ET="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ET(t)}function OT(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,kT(n.key),n)}}function kT(t){var e=function(t,e){if("object"!=ET(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=ET(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ET(e)?e:String(e)}function CT(t,e,r){return e=xT(e),function(t,e){if(e&&("object"===ET(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return jT(t)}(t,PT()?Reflect.construct(e,r||[],xT(t).constructor):e.apply(t,r))}function PT(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(PT=function(){return!!t})()}function xT(t){return xT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},xT(t)}function jT(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function LT(t,e){return LT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},LT(t,e)}var IT=function(t){function e(t){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n={};n.track={player:t,kind:"subtitle",label:"Search Captions",selectable:!1,default:!1,mode:"disabled"},n.selectable=!1,n.name="SubtitleSearchMenuItem",(r=CT(this,e,[t,n])).addClass("vjs-texttrack-settings"),r.addClass("cv-subtitle-search-menu-item"),r.controlText(", opens subtitle search"),r.toggleEnabled=r.toggleEnabled.bind(jT(r));var i=r.player_.textTracks();return i.addEventListener("selectedlanguagechange",r.toggleEnabled),r.player_.one("dispose",(function(){i.removeEventListener("selectedlanguagechange",r.toggleEnabled)})),r.toggleEnabled(),r}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&LT(t,e)}(e,t),r=e,(n=[{key:"toggleEnabled",value:function(){var t;if(this.player_){var e=jg.getCurrentTextTrack(this.player_);e?(null===(t=e.cues)||void 0===t?void 0:t.length)?this.removeClass("vjs-disabled"):(this.bindTrackEvents(e),this.addClass("vjs-disabled")):this.addClass("vjs-disabled")}}},{key:"bindTrackEvents",value:function(t){var e=this;t.removeEventListener("loadeddata",this.toggleEnabled),t.addEventListener("loadeddata",this.toggleEnabled),this.player_.one("dispose",(function(){t.removeEventListener("loadeddata",e.toggleEnabled)}))}},{key:"handleClick",value:function(){var t,e=this,r=jg.getCurrentTextTrack(this.player_);(null===(t=null==r?void 0:r.cues)||void 0===t?void 0:t.length)&&this.requestAnimationFrame((function(){e.player_.getChild("collapserator").getChild("subtitleSearchButton").showCollapsibleMenu()}))}}])&&OT(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("TextTrackMenuItem"));function AT(t){return AT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},AT(t)}function RT(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,DT(n.key),n)}}function DT(t){var e=function(t,e){if("object"!=AT(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=AT(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==AT(e)?e:String(e)}function MT(t,e,r){return e=BT(e),function(t,e){if(e&&("object"===AT(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,NT()?Reflect.construct(e,r||[],BT(t).constructor):e.apply(t,r))}function NT(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(NT=function(){return!!t})()}function BT(t){return BT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},BT(t)}function UT(t,e){return UT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},UT(t,e)}var FT=function(t){function e(t){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n={};return n.track={player:t,kind:"subtitle",label:"Caption Text Size",selectable:!1,default:!1,mode:"disabled"},n.selectable=!1,n.name="SubtitleSizeMenuItem",(r=MT(this,e,[t,n])).addClass("vjs-texttrack-settings"),r.addClass("cv-divider-after-menu-item"),r.addClass("cv-subtitle-size-menu-item"),r.controlText(", opens subtitle size settings"),r}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&UT(t,e)}(e,t),r=e,(n=[{key:"handleClick",value:function(){var t=this;this.requestAnimationFrame((function(){t.player_.getChild("collapserator").getChild("subtitleSizeButton").showCollapsibleMenu()}))}}])&&RT(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("TextTrackMenuItem"));function VT(t){return VT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},VT(t)}function HT(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,qT(n.key),n)}}function qT(t){var e=function(t,e){if("object"!=VT(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=VT(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==VT(e)?e:String(e)}function zT(t,e,r){return e=XT(e),function(t,e){if(e&&("object"===VT(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,WT()?Reflect.construct(e,r||[],XT(t).constructor):e.apply(t,r))}function WT(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(WT=function(){return!!t})()}function GT(){return GT="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=XT(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},GT.apply(this,arguments)}function XT(t){return XT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},XT(t)}function KT(t,e){return KT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},KT(t,e)}var YT=yl.getComponent("TextTrackButton"),QT=yl.getComponent("SubsCapsButton"),$T=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=zT(this,e,arguments)).alwaysCollapsed=!1,t.isCollapsed=!1,t.isCollabsible=!0,t.className="cv-subs-caps-menu-button",t}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&KT(t,e)}(e,t),r=e,n=[{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-has-left-icons ".concat(GT(XT(e.prototype),"buildWrapperCSSClass",this).call(this))}},{key:"createItems",value:function(){var t=[];return this.player_.options_.mobile||(t.push(new IT(this.player_)),t.push(new FT(this.player_)),this.hideThreshold_=this.hideThreshold_+2),YT.prototype.createItems.call(this,t,ST)}},{key:"getCollabsibleName",value:function(){return"Subtitles"}},{key:"getCollabsibleValue",value:function(){for(var t=this.player_.textTracks(),e=0;e<t.length;e++){var r=t[e];if(this.kinds_.indexOf(r.kind)>-1&&"showing"===r.mode)return r.label}return"Off"}},{key:"showInCollabsibleMenu",value:function(){for(var t=this.player_.textTracks(),e=0;e<t.length;e++){var r=t[e];if(this.kinds_.indexOf(r.kind)>-1)return!0}return!1}},{key:"showCollapsibleMenu",value:function(){QT.prototype.handleClick.apply(this)}}],n&&HT(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(QT);function JT(t){return JT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},JT(t)}function ZT(){ZT=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),s=new j(n||[]);return i(a,"_invoke",{value:k(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var _={};l(_,a,(function(){return this}));var w=Object.getPrototypeOf,T=w&&w(w(L([])));T&&T!==r&&n.call(T,a)&&(_=T);var S=b.prototype=v.prototype=Object.create(_);function E(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==JT(c)&&n.call(c,"__await")?e.resolve(c.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(c).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function k(e,r,n){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(JT(e)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},E(O.prototype),l(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new O(c(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(x),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function tS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,eS(n.key),n)}}function eS(t){var e=function(t,e){if("object"!=JT(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=JT(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==JT(e)?e:String(e)}function rS(t,e,r){return e=iS(e),function(t,e){if(e&&("object"===JT(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return oS(t)}(t,nS()?Reflect.construct(e,r||[],iS(t).constructor):e.apply(t,r))}function nS(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(nS=function(){return!!t})()}function iS(t){return iS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},iS(t)}function oS(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function aS(t,e){return aS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},aS(t,e)}yl.registerComponent("SubsCapsButton",$T);var sS="<span class='vjs-local-cache-indicator-icon' title='Streaming from ClickView Local Cache'>".concat(_h,"</span>"),uS=function(t){function e(t,r){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=rS(this,e,[t,r])).qualityId=r.qualityId;var i=t.qualityLevels(),o=n.handleQualityChange.bind(oS(n));return i.on("change",o),t.one("dispose",(function(){i.off("change",o)})),n.handleLocalCacheChange=n.handleLocalCacheChange.bind(oS(n)),n.player_.ready((function(){n.player_&&(n.player_.on("localcachechanged",n.handleLocalCacheChange),n.player_.one("dispose",(function(){var t;null===(t=n.player_)||void 0===t||t.off("localcachechanged",n.handleLocalCacheChange)})),n.handleLocalCacheChange())})),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&aS(t,e)}(e,t),r=e,n=[{key:"handleLocalCacheChange",value:function(){return t=this,e=void 0,r=void 0,n=ZT().mark((function t(){var e,r;return ZT().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.player_.localCache(),t.next=3,e.getActiveLocalCache();case 3:if(null==(r=t.sent)?void 0:r.playbackProfile){t.next=9;break}return this.show(),this.enable(),this.setLabel(this.options_.label),t.abrupt("return");case 9:r.playbackProfile!==this.qualityId?this.disable():this.setLabel(this.options_.label+sS);case 10:case"end":return t.stop()}}),t,this)})),new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}));var t,e,r,n}},{key:"setLabel",value:function(t){var e=this.$(".vjs-menu-item-text");e&&(e.innerHTML=t)}},{key:"buildCSSClass",value:function(){return"vjs-menu-item cv-quality-menu-item"}},{key:"handleClick",value:function(){for(var t=this.player_.qualityLevels(),e=0;e<t.length;e++){var r=t[e];r.enabled=r.id===this.qualityId}}},{key:"handleQualityChange",value:function(){if(this.player_){var t=this.player_.qualityLevels(),e=t[t.selectedIndex],r=e&&e.id===this.qualityId;r!==this.isSelected_&&this.selected(r)}}}],n&&tS(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("MenuItem"));function lS(t){return lS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lS(t)}function cS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,fS(n.key),n)}}function fS(t){var e=function(t,e){if("object"!=lS(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=lS(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==lS(e)?e:String(e)}function hS(t,e,r){return e=mS(e),function(t,e){if(e&&("object"===lS(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return dS(t)}(t,pS()?Reflect.construct(e,r||[],mS(t).constructor):e.apply(t,r))}function pS(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(pS=function(){return!!t})()}function dS(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function yS(){return yS="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=mS(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},yS.apply(this,arguments)}function mS(t){return mS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},mS(t)}function vS(t,e){return vS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},vS(t,e)}var gS={144:"144p (Preview)",240:"240p",360:"360p",480:"480p",720:"720p",1080:"1080p"},bS=yl.getComponent("MenuButton"),_S=function(t){function e(t,r){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=hS(this,e,[t,r])).alwaysCollapsed=!0,n.isCollapsed=!1,n.isCollabsible=!0,n.className="cv-quality-menu-button";var i=n.player_.qualityLevels(),o=n.update.bind(dS(n));return i.on("addqualitylevel",o),i.on("removequalitylevel",o),t.one("dispose",(function(){i.removeEventListener("addqualitylevel",o),i.removeEventListener("removequalitylevel",o)})),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&vS(t,e)}(e,t),r=e,n=[{key:"buildCSSClass",value:function(){return"cv-quality-button ".concat(yS(mS(e.prototype),"buildCSSClass",this).call(this))}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small vjs-quality-button cv-has-left-icons ".concat(yS(mS(e.prototype),"buildWrapperCSSClass",this).call(this))}},{key:"createItems",value:function(){var t=[],e=this.player_.qualityLevels();t.push(new Id(this.player_,{label:"Quality"}));for(var r=0;r<e.length;r++){var n=e[r];if(n){var i=gS[n.id];i&&t.push(new uS(this.player_,{qualityId:n.id,label:i,selectable:!0,multiSelectable:!1}))}}return t}},{key:"getCollabsibleName",value:function(){return"Quality"}},{key:"getCollabsibleValue",value:function(){var t=this.player_.qualityLevels(),e=t[t.selectedIndex];return e?gS[e.id]:""}},{key:"showInCollabsibleMenu",value:function(){return!!this.player_.qualityLevels().length}},{key:"showCollapsibleMenu",value:function(){bS.prototype.handleClick.apply(this)}}],n&&cS(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(bS);function wS(t){return wS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wS(t)}function TS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,SS(n.key),n)}}function SS(t){var e=function(t,e){if("object"!=wS(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=wS(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==wS(e)?e:String(e)}function ES(t,e,r){return e=CS(e),function(t,e){if(e&&("object"===wS(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,OS()?Reflect.construct(e,r||[],CS(t).constructor):e.apply(t,r))}function OS(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(OS=function(){return!!t})()}function kS(){return kS="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=CS(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},kS.apply(this,arguments)}function CS(t){return CS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},CS(t)}function PS(t,e){return PS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},PS(t,e)}yl.registerComponent("QualityButton",_S);var xS=yl.getComponent("Menu"),jS=yl.getComponent("MenuButton"),LS=yl.getComponent("PlaybackRateMenuItem"),IS=yl.getComponent("PlaybackRateMenuButton"),AS=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=ES(this,e,arguments)).alwaysCollapsed=!0,t.isCollapsed=!1,t.isCollabsible=!0,t.className="cv-playback-rate-menu-button",t}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&PS(t,e)}(e,t),r=e,n=[{key:"createEl",value:function(){for(var t,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return(t=jS.prototype.createEl).apply.apply(t,[this].concat(r))}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-has-left-icons ".concat(kS(CS(e.prototype),"buildWrapperCSSClass",this).call(this))}},{key:"createMenu",value:function(){var t=new xS(this.player(),{menuButton:this});t.addItem(new Id(this.player_,{label:"Playback Speed"}));var e=this.playbackRates();if(e)for(var r=0;r<e.length;r++){var n=e[r]+"x";1===e[r]&&(n+=" (Normal)"),t.addItem(new LS(this.player(),{rate:n}))}return t}},{key:"handleClick",value:function(){for(var t,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return(t=jS.prototype.handleClick).apply.apply(t,[this].concat(r))}},{key:"updateLabel",value:function(){var t;this.setupLabelEl();for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return(t=IS.prototype.updateLabel).apply.apply(t,[this].concat(r))}},{key:"setupLabelEl",value:function(){if(!this.labelEl_){var t=this.$("button");t&&(this.labelEl_=yl.dom.createEl("div",{className:"vjs-playback-rate-value",innerHTML:"1x"}),t.appendChild(this.labelEl_))}}},{key:"getCollabsibleName",value:function(){return"Playback Speed"}},{key:"getCollabsibleValue",value:function(){return this.player().playbackRate()+"x"}},{key:"showInCollabsibleMenu",value:function(){return!!this.playbackRates()}},{key:"showCollapsibleMenu",value:function(){this.handleClick(null)}}],n&&TS(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(IS);function RS(t){return RS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},RS(t)}function DS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,MS(n.key),n)}}function MS(t){var e=function(t,e){if("object"!=RS(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=RS(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==RS(e)?e:String(e)}function NS(t,e,r){return e=US(e),function(t,e){if(e&&("object"===RS(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,BS()?Reflect.construct(e,r||[],US(t).constructor):e.apply(t,r))}function BS(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(BS=function(){return!!t})()}function US(t){return US=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},US(t)}function FS(t,e){return FS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},FS(t,e)}yl.registerComponent("PlaybackRateMenuButton",AS);var VS=yl.getComponent("TextTrackSettings"),HS={backgroundColor:"#000",backgroundOpacity:"1",color:"#FFF",edgeStyle:void 0,fontFamily:"proportionalSansSerif",fontPercent:1,textOpacity:"1",windowColor:"#000",windowOpacity:"0"},qS={small:HS,medium:Object.assign(Object.assign({},HS),{fontPercent:1.5}),large:Object.assign(Object.assign({},HS),{fontPercent:2})},zS=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),NS(this,e,arguments)}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&FS(t,e)}(e,t),r=e,(n=[{key:"setSizeSetting",value:function(t){var e=this;this.size_=t,this.player_.getChild("textTrackDisplay").updateDisplay();var r=this.player_.getChild("collapserator").getChild("subtitleSizeButton");this.player_.trigger("changesubtitlesize",this.size_),window.requestAnimationFrame((function(){r.update(),e.player_.trigger("resizemenus")}))}},{key:"getSizeSetting",value:function(){return this.size_||"small"}},{key:"getValues",value:function(){return qS[this.size_]?qS[this.size_]:HS}}])&&DS(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(VS);function WS(t){return WS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},WS(t)}function GS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,XS(n.key),n)}}function XS(t){var e=function(t,e){if("object"!=WS(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=WS(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==WS(e)?e:String(e)}function KS(t,e,r){return e=$S(e),function(t,e){if(e&&("object"===WS(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,YS()?Reflect.construct(e,r||[],$S(t).constructor):e.apply(t,r))}function YS(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(YS=function(){return!!t})()}function QS(){return QS="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=$S(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},QS.apply(this,arguments)}function $S(t){return $S=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},$S(t)}function JS(t,e){return JS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},JS(t,e)}yl.registerComponent("TextTrackSettings",zS);var ZS=window.navigator&&window.navigator.userAgent||"",tE=(/iPod/i.test(ZS),/Android/i.test(ZS),yl.getComponent("Player")),eE=function(t){function e(t,r){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=KS(this,e,[t,r]))._dataLoaded=!1,r.mobile&&n.addClass("cv-mobile-player");var i=function(){return n._dataLoaded=!0};return n.on("cv-playback-data-loaded",i),n.on("dispose",(function(){return n.off("cv-playback-data-loaded",i)})),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&JS(t,e)}(e,t),r=e,(n=[{key:"dataLoaded",value:function(t){var e=this;this._dataLoaded?t():(this.one("cv-playback-data-loaded",t),this.one("dispose",(function(){e.off("cv-playback-data-loaded",t)})))}},{key:"lock",value:function(t){this.callback_=t}},{key:"unlock",value:function(){delete this.callback_}},{key:"currentTime",value:function(t,r){var n=this;if("number"!=typeof t||!this.callback_||r)return QS($S(e.prototype),"currentTime",this).call(this,t);this.callback_((function(){n.unlock(),n.currentTime(t)}))}},{key:"play",value:function(){var t=this;if(!this.callback_)return QS($S(e.prototype),"play",this).call(this);this.callback_((function(){t.unlock(),t.play()}))}},{key:"updateStyleEl_",value:function(){if(tE.prototype.updateStyleEl_.call(this),this.options_.fluid){var t=this.el_.parentNode;if(t&&this.options_.setMaxHeight){var e=this.aspectRatio();if(void 0!==e&&"auto"!==e||(e=this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9"),this.player_.playerModePlugin().getMode()===rm.Hover)return t.style.removeProperty("maxWidth"),void t.style.removeProperty("margin");var r=e.split(":"),n=+r[1]/+r[0];t.style.maxWidth=85/n+"vh",t.style.margin="0 auto"}}}},{key:"listenForUserActivity_",value:function(){var t=this;tE.prototype.listenForUserActivity_.call(this);var e=this.getChild("collapserator");e.on("mouseenter",(function(){t.player().cache_.inactivityTimeout=t.player().options_.inactivityTimeout,t.player().options_.inactivityTimeout=0})),e.on("mouseleave",(function(){t.player().options_.inactivityTimeout=t.player().cache_.inactivityTimeout}))}}])&&GS(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(tE);function rE(t){return rE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rE(t)}function nE(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,iE(n.key),n)}}function iE(t){var e=function(t,e){if("object"!=rE(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=rE(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==rE(e)?e:String(e)}function oE(t,e,r){return e=sE(e),function(t,e){if(e&&("object"===rE(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return uE(t)}(t,aE()?Reflect.construct(e,r||[],sE(t).constructor):e.apply(t,r))}function aE(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(aE=function(){return!!t})()}function sE(t){return sE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},sE(t)}function uE(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function lE(t,e){return lE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},lE(t,e)}eE.prototype.options_=Object.assign(Object.assign({},tE.prototype.options_),{setMaxHeight:!0}),yl.registerComponent("player",eE);var cE=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=oE(this,e,[t,r])).player_.addClass("cv-disable-play-pause-feedback"),n.onFirstPlay=n.onFirstPlay.bind(uE(n)),n.player_.one("firstplay",n.onFirstPlay),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&lE(t,e)}(e,t),r=e,(n=[{key:"dispose",value:function(){this.player_.off("firstplay",this.onFirstPlay)}},{key:"onFirstPlay",value:function(){var t=this;window.setTimeout((function(){t.player_.isDisposed()||t.player_.removeClass("cv-disable-play-pause-feedback")}),500)}},{key:"createEl",value:function(){return yl.dom.createEl("div",{className:"cv-play-pause-feedback"})}}])&&nE(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("Component"));function fE(t){return fE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fE(t)}function hE(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,pE(n.key),n)}}function pE(t){var e=function(t,e){if("object"!=fE(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=fE(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==fE(e)?e:String(e)}function dE(t,e,r){return e=mE(e),function(t,e){if(e&&("object"===fE(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,yE()?Reflect.construct(e,r||[],mE(t).constructor):e.apply(t,r))}function yE(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(yE=function(){return!!t})()}function mE(t){return mE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},mE(t)}function vE(t,e){return vE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},vE(t,e)}yl.registerComponent("PlayPauseFeedback",cE);var gE=yl.getComponent("PlayToggle"),bE=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),dE(this,e,arguments)}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&vE(t,e)}(e,t),r=e,(n=[{key:"handleClick",value:function(t){var e=this;gE.prototype.handleClick.call(this,t),this.player_.addClass("cv-disable-play-pause-feedback"),this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout((function(){e.player_.removeClass("cv-disable-play-pause-feedback")}),500)}}])&&hE(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(gE);function _E(t){return _E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_E(t)}function wE(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,TE(n.key),n)}}function TE(t){var e=function(t,e){if("object"!=_E(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=_E(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==_E(e)?e:String(e)}function SE(t,e,r){return e=OE(e),function(t,e){if(e&&("object"===_E(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,EE()?Reflect.construct(e,r||[],OE(t).constructor):e.apply(t,r))}function EE(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(EE=function(){return!!t})()}function OE(t){return OE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},OE(t)}function kE(t,e){return kE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},kE(t,e)}yl.registerComponent("PlayToggle",bE);var CE=yl.getComponent("TextTrackDisplay"),PE=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),SE(this,e,arguments)}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&kE(t,e)}(e,t),r=e,n=[{key:"updateDisplayState",value:function(t){CE.prototype.updateDisplayState.call(this,t);for(var e=this.player_.textTrackSettings.getValues(),r=t.activeCues,n=r.length;n--;){var i=r[n];if(i){var o=i.displayState;if(e.fontPercent&&1!==e.fontPercent){var a=.025*this.el().getBoundingClientRect().width*100/100;o.style.fontSize=a*e.fontPercent+"px"}}}}}],n&&wE(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(CE);function xE(t){return xE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xE(t)}function jE(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,LE(n.key),n)}}function LE(t){var e=function(t,e){if("object"!=xE(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=xE(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==xE(e)?e:String(e)}function IE(t,e,r){return e=RE(e),function(t,e){if(e&&("object"===xE(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,AE()?Reflect.construct(e,r||[],RE(t).constructor):e.apply(t,r))}function AE(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(AE=function(){return!!t})()}function RE(t){return RE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},RE(t)}function DE(t,e){return DE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},DE(t,e)}yl.registerComponent("TextTrackDisplay",PE);var ME=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),IE(this,e,arguments)}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&DE(t,e)}(e,t),r=e,(n=[{key:"createEl",value:function(){return yl.dom.createEl("div",{className:"cv-control-bar-gradient-container",innerHTML:'<div class="cv-control-bar-gradient"></div>'})}}])&&jE(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("Component"));function NE(t){return NE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},NE(t)}function BE(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,UE(n.key),n)}}function UE(t){var e=function(t,e){if("object"!=NE(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=NE(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==NE(e)?e:String(e)}function FE(t,e,r){return e=qE(e),function(t,e){if(e&&("object"===NE(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,VE()?Reflect.construct(e,r||[],qE(t).constructor):e.apply(t,r))}function VE(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(VE=function(){return!!t})()}function HE(){return HE="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=qE(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},HE.apply(this,arguments)}function qE(t){return qE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},qE(t)}function zE(t,e){return zE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},zE(t,e)}yl.registerComponent("ControlBarGradient",ME);var WE=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=FE(this,e,[t,r])).options_=r,n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&zE(t,e)}(e,t),r=e,(n=[{key:"createEl",value:function(){var t=this.options_.title;if(!this.options_.seriesName)return HE(qE(e.prototype),"createEl",this).call(this,"h1",{innerHTML:t});var r=this.buildSeasonEpisodeString();return r?(t="<div class='cv-splash-series'>".concat(this.options_.seriesName.toUpperCase()," ").concat(r,"</div>")+t,HE(qE(e.prototype),"createEl",this).call(this,"h1",{innerHTML:t})):(t="<div class='cv-splash-series'>".concat(this.options_.seriesName.toUpperCase(),"</div>")+t,HE(qE(e.prototype),"createEl",this).call(this,"h1",{innerHTML:t}))}},{key:"buildSeasonEpisodeString",value:function(){if(!this.options_.seasonNumber||!this.options_.episodeNumber)return"";var t=this.padNumber(this.options_.seasonNumber,2),e=this.padNumber(this.options_.episodeNumber,2);return"S".concat(t," • E").concat(e)}},{key:"padNumber",value:function(t,e){var r=t.toString();if(r.length>=e)return r;for(e-=r.length;e>0;)r="0"+r,e--;return r}}])&&BE(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("Component"));function GE(t){return GE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},GE(t)}function XE(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,KE(n.key),n)}}function KE(t){var e=function(t,e){if("object"!=GE(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=GE(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==GE(e)?e:String(e)}function YE(t,e,r){return e=JE(e),function(t,e){if(e&&("object"===GE(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,QE()?Reflect.construct(e,r||[],JE(t).constructor):e.apply(t,r))}function QE(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(QE=function(){return!!t})()}function $E(){return $E="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=JE(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},$E.apply(this,arguments)}function JE(t){return JE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},JE(t)}function ZE(t,e){return ZE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ZE(t,e)}var tO=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=YE(this,e,[t,r])).options_=r,n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ZE(t,e)}(e,t),r=e,(n=[{key:"buildCSSClass",value:function(){return"cv-splash-rating ".concat((t=this.options_.ratingValue)?function(t){switch(!0){case t<32:return"cv-rating-purple";case t<48:return"cv-rating-green";case t<80:return"cv-rating-blue";case t<96:return"cv-rating-red";case t<128:return"cv-rating-pink";case t>=128:return"cv-rating-yellow";default:return""}}(t):"");var t}},{key:"createEl",value:function(t,r,n){return this.options_.ratingCode?$E(JE(e.prototype),"createEl",this).call(this,t,Object.assign(Object.assign({},r),{className:this.buildCSSClass(),innerHTML:this.options_.ratingCode}),n):null}}])&&XE(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("Component"));function eO(t){return eO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eO(t)}function rO(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,nO(n.key),n)}}function nO(t){var e=function(t,e){if("object"!=eO(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=eO(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==eO(e)?e:String(e)}function iO(t,e,r){return e=sO(e),oO(t,aO()?Reflect.construct(e,r||[],sO(t).constructor):e.apply(t,r))}function oO(t,e){if(e&&("object"===eO(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return uO(t)}function aO(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(aO=function(){return!!t})()}function sO(t){return sO=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},sO(t)}function uO(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function lO(t,e){return lO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},lO(t,e)}var cO=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=iO(this,e,[t,r]),r.embed?(n.addChild(new WE(t,r)),n.addChild(new tO(t,r)),n):oO(n,uO(n))}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&lO(t,e)}(e,t),r=e,(n=[{key:"createEl",value:function(){return yl.dom.createEl("div",{className:"cv-splash-metadata"})}}])&&rO(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("Component"));function fO(t){return fO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fO(t)}function hO(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,pO(n.key),n)}}function pO(t){var e=function(t,e){if("object"!=fO(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=fO(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==fO(e)?e:String(e)}function dO(t,e,r){return e=mO(e),function(t,e){if(e&&("object"===fO(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,yO()?Reflect.construct(e,r||[],mO(t).constructor):e.apply(t,r))}function yO(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(yO=function(){return!!t})()}function mO(t){return mO=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},mO(t)}function vO(t,e){return vO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},vO(t,e)}var gO=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=dO(this,e,[t,r])).addChild(new cO(t,r)),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&vO(t,e)}(e,t),r=e,(n=[{key:"createEl",value:function(){var t="<div class='cv-splash-mask'></div>";return this.options_.embed&&(t+="<div class='cv-splash-logo'>".concat(Zc,"</div>")),yl.dom.createEl("div",{className:"vjs-poster cv-embed-splash cv-embed-splash-black",tabIndex:-1,innerHTML:t})}}])&&hO(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("posterImage"));function bO(t){return bO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bO(t)}function _O(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,wO(n.key),n)}}function wO(t){var e=function(t,e){if("object"!=bO(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=bO(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==bO(e)?e:String(e)}function TO(t,e,r){return e=EO(e),function(t,e){if(e&&("object"===bO(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,SO()?Reflect.construct(e,r||[],EO(t).constructor):e.apply(t,r))}function SO(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(SO=function(){return!!t})()}function EO(t){return EO=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},EO(t)}function OO(t,e){return OO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},OO(t,e)}yl.registerComponent("posterImage",gO);var kO,CO=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=TO(this,e,[t,r])).el().prepend(n.getErrorImage()),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&OO(t,e)}(e,t),r=e,(n=[{key:"getErrorImage",value:function(){return yl.dom.createEl("div",{className:"cv-error-image",innerHTML:'\n <svg viewBox="0 0 301 185" xmlns="http://www.w3.org/2000/svg">\n <path d="M267.393 36.6514V167.906C267.393 168.182 267.169 168.406 266.893 168.406H32C31.7239 168.406 31.5 168.182 31.5 167.906V36.6514C31.5 36.3752 31.7239 36.1514 32 36.1514H80.5C80.7761 36.1514 81 36.3752 81 36.6514V57.7196C81 58.7622 82.0375 59.4868 83.0164 59.1279L95.7377 54.4634C95.9961 54.3687 96.2825 54.5006 96.3785 54.7585L102.094 70.1194C102.677 71.6866 105 71.2685 105 69.5964V48.4925C105 47.7632 104.475 47.1396 103.757 47.0146L94.2479 45.3609C93.9436 45.308 93.7596 44.9946 93.8616 44.7031L96.7376 36.4862C96.8077 36.2856 96.997 36.1514 97.2095 36.1514H266.893C267.169 36.1514 267.393 36.3752 267.393 36.6514Z" stroke="white"/>\n <path d="M163.296 101.777L149.437 90.1217C148.275 89.1441 146.5 89.9705 146.5 91.4894V113.664C146.5 115.141 148.191 115.98 149.367 115.087L163.226 104.569C164.139 103.876 164.173 102.515 163.296 101.777Z" stroke="white" stroke-linecap="round"/>\n <path d="M295.53 23.0783L277.524 26.2801L283.252 32.7192L274.855 38.9079L292.861 35.7061L287.133 29.2671L295.53 23.0783Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M268.06 2.91764L254.192 14.8403L262.401 17.4661L258.324 27.0679L272.192 15.1453L263.983 12.5194L268.06 2.91764Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>\n '})}}])&&_O(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("ErrorDisplay"));function PO(t){return PO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},PO(t)}function xO(t,e,r){return e=function(t){var e=function(t,e){if("object"!=PO(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=PO(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==PO(e)?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function jO(t){t.paused()?t.play():t.pause()}function LO(t,e){t.currentTime(t.currentTime()+e)}function IO(t,e){t.volume(t.volume()+e)}yl.registerComponent("ErrorDisplay",CO),function(t){t.CvApSoutheast1="cv-ap-southeast-1",t.CvApSoutheast2="cv-ap-southeast-2",t.CvEuWest1="cv-eu-west-1",t.CvNaWest1="cv-na-west-1"}(kO||(kO={}));var AO,RO=xO(xO(xO(xO(xO(xO(xO(xO(xO(xO({},"f",(function(t){document[t.fsApi_.fullscreenEnabled]&&(t.isFullscreen()?t.exitFullscreen():t.requestFullscreen())})),"m",(function(t){var e=t.volume(),r=t.lastVolume_();if(0===e){var n=r<.1?.1:r;t.volume(n),t.muted(!1)}else t.muted(!t.muted())})),"k",jO),"space",jO),"left",(function(t){return LO(t,-5)})),"right",(function(t){return LO(t,5)})),"j",(function(t){return LO(t,-10)})),"l",(function(t){return LO(t,10)})),"up",(function(t){return IO(t,.05)})),"down",(function(t){return IO(t,-.05)}));function DO(t,e,r){return e=NO(e),function(t,e){if(e&&("object"===FO(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,MO()?Reflect.construct(e,r||[],NO(t).constructor):e.apply(t,r))}function MO(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(MO=function(){return!!t})()}function NO(t){return NO=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},NO(t)}function BO(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&UO(t,e)}function UO(t,e){return UO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},UO(t,e)}function FO(t){return FO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},FO(t)}function VO(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function HO(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,zO(n.key),n)}}function qO(t,e,r){return e&&HO(t.prototype,e),r&&HO(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function zO(t){var e=function(t,e){if("object"!=FO(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=FO(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==FO(e)?e:String(e)}!function(t){t.LocalStorage="localStorage",t.SessionStorage="sessionStorage"}(AO||(AO={}));var WO=function(){function t(e){if(VO(this,t),this.cachePrefix="_cv:",this.expireTime=3600,this.type=e.type,this.hasSupport=this.hasBrowserSupport(),this.hasSupport)try{this.storage=window[this.type]}catch(t){}}return qO(t,[{key:"isAvailable",value:function(){return this.hasSupport}},{key:"get",value:function(t){if(this.hasSupport){var e=this.storage.getItem(t);try{return JSON.parse(e)}catch(t){return e}}}},{key:"set",value:function(t,e){if(this.hasSupport)try{return this.storage.removeItem(t),"string"!=typeof e?(this.storage.setItem(t,JSON.stringify(e)),!0):(this.storage.setItem(t,e),!0)}catch(t){return!1}}},{key:"remove",value:function(t){if(this.hasSupport)return this.storage.removeItem(t)}},{key:"length",value:function(){if(this.hasSupport)return this.storage.length}},{key:"clear",value:function(){if(this.hasSupport)return this.storage.clear()}},{key:"cacheSet",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.expireTime;this.cacheClean();var n={time:this.getCurrentTime()+1e3*r,data:null!=e&&e};return this.set("".concat(this.cachePrefix).concat(t),n)}},{key:"cacheGet",value:function(t){var e="".concat(this.cachePrefix).concat(t),r=this.get(e);return r?this.isExpired(r)?(this.remove(e),null):r.data:null}},{key:"cacheExists",value:function(t){var e="".concat(this.cachePrefix).concat(t),r=this.get(e);return!(!r||this.isExpired(r)&&(this.remove(e),1))}},{key:"cacheRemove",value:function(t){return this.remove("".concat(this.cachePrefix).concat(t))}},{key:"cacheFlush",value:function(){this.cacheClean()}},{key:"cacheClean",value:function(){if(this.hasSupport)for(var t=0;t<this.storage.length;t++){var e=this.storage.key(t);if(0===e.indexOf(this.cachePrefix)){var r=this.get(e);r&&r.time&&this.isExpired(r)&&this.remove(e)}}}},{key:"isExpired",value:function(t){return t.time<this.getCurrentTime()}},{key:"getCurrentTime",value:function(){return(new Date).getTime()}},{key:"hasBrowserSupport",value:function(){try{return this.type in window&&null!==window[this.type]}catch(t){return!1}}}]),t}(),GO=function(t){function e(){return VO(this,e),DO(this,e,arguments)}return BO(e,t),qO(e,null,[{key:"Instance",get:function(){return this.instance||(this.instance=new this({type:AO.LocalStorage}))}}]),e}(WO),XO=function(t){function e(){return VO(this,e),DO(this,e,arguments)}return BO(e,t),qO(e,null,[{key:"Instance",get:function(){return this.instance||(this.instance=new this({type:AO.SessionStorage}))}}]),e}(WO),KO=GO.Instance,YO=XO.Instance;const QO="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function $O(t,e,r,n){let i,o,a;const s=e||[0],u=(r=r||0)>>>3,l=-1===n?3:0;for(i=0;i<t.length;i+=1)a=i+u,o=a>>>2,s.length<=o&&s.push(0),s[o]|=t[i]<<8*(l+n*(a%4));return{value:s,binLen:8*t.length+r}}function JO(t,e,r){switch(e){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(t){case"HEX":return function(t,e,n){return function(t,e,r,n){let i,o,a,s;if(0!=t.length%2)throw new Error("String of HEX type must be in byte increments");const u=e||[0],l=(r=r||0)>>>3,c=-1===n?3:0;for(i=0;i<t.length;i+=2){if(o=parseInt(t.substr(i,2),16),isNaN(o))throw new Error("String of HEX type contains invalid characters");for(s=(i>>>1)+l,a=s>>>2;u.length<=a;)u.push(0);u[a]|=o<<8*(c+n*(s%4))}return{value:u,binLen:4*t.length+r}}(t,e,n,r)};case"TEXT":return function(t,n,i){return function(t,e,r,n,i){let o,a,s,u,l,c,f,h,p=0;const d=r||[0],y=(n=n||0)>>>3;if("UTF8"===e)for(f=-1===i?3:0,s=0;s<t.length;s+=1)for(o=t.charCodeAt(s),a=[],128>o?a.push(o):2048>o?(a.push(192|o>>>6),a.push(128|63&o)):55296>o||57344<=o?a.push(224|o>>>12,128|o>>>6&63,128|63&o):(s+=1,o=65536+((1023&o)<<10|1023&t.charCodeAt(s)),a.push(240|o>>>18,128|o>>>12&63,128|o>>>6&63,128|63&o)),u=0;u<a.length;u+=1){for(c=p+y,l=c>>>2;d.length<=l;)d.push(0);d[l]|=a[u]<<8*(f+i*(c%4)),p+=1}else for(f=-1===i?2:0,h="UTF16LE"===e&&1!==i||"UTF16LE"!==e&&1===i,s=0;s<t.length;s+=1){for(o=t.charCodeAt(s),!0===h&&(u=255&o,o=u<<8|o>>>8),c=p+y,l=c>>>2;d.length<=l;)d.push(0);d[l]|=o<<8*(f+i*(c%4)),p+=2}return{value:d,binLen:8*p+n}}(t,e,n,i,r)};case"B64":return function(t,e,n){return function(t,e,r,n){let i,o,a,s,u,l,c,f=0;const h=e||[0],p=(r=r||0)>>>3,d=-1===n?3:0,y=t.indexOf("=");if(-1===t.search(/^[a-zA-Z0-9=+/]+$/))throw new Error("Invalid character in base-64 string");if(t=t.replace(/=/g,""),-1!==y&&y<t.length)throw new Error("Invalid '=' found in base-64 string");for(o=0;o<t.length;o+=4){for(u=t.substr(o,4),s=0,a=0;a<u.length;a+=1)i=QO.indexOf(u.charAt(a)),s|=i<<18-6*a;for(a=0;a<u.length-1;a+=1){for(c=f+p,l=c>>>2;h.length<=l;)h.push(0);h[l]|=(s>>>16-8*a&255)<<8*(d+n*(c%4)),f+=1}}return{value:h,binLen:8*f+r}}(t,e,n,r)};case"BYTES":return function(t,e,n){return function(t,e,r,n){let i,o,a,s;const u=e||[0],l=(r=r||0)>>>3,c=-1===n?3:0;for(o=0;o<t.length;o+=1)i=t.charCodeAt(o),s=o+l,a=s>>>2,u.length<=a&&u.push(0),u[a]|=i<<8*(c+n*(s%4));return{value:u,binLen:8*t.length+r}}(t,e,n,r)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(t){throw new Error("ARRAYBUFFER not supported by this environment")}return function(t,e,n){return function(t,e,r,n){return $O(new Uint8Array(t),e,r,n)}(t,e,n,r)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(t){throw new Error("UINT8ARRAY not supported by this environment")}return function(t,e,n){return $O(t,e,n,r)};default:throw new Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function ZO(t,e,r,n){switch(t){case"HEX":return function(t){return function(t,e,r,n){let i,o,a="";const s=e/8,u=-1===r?3:0;for(i=0;i<s;i+=1)o=t[i>>>2]>>>8*(u+r*(i%4)),a+="0123456789abcdef".charAt(o>>>4&15)+"0123456789abcdef".charAt(15&o);return n.outputUpper?a.toUpperCase():a}(t,e,r,n)};case"B64":return function(t){return function(t,e,r,n){let i,o,a,s,u,l="";const c=e/8,f=-1===r?3:0;for(i=0;i<c;i+=3)for(s=i+1<c?t[i+1>>>2]:0,u=i+2<c?t[i+2>>>2]:0,a=(t[i>>>2]>>>8*(f+r*(i%4))&255)<<16|(s>>>8*(f+r*((i+1)%4))&255)<<8|u>>>8*(f+r*((i+2)%4))&255,o=0;o<4;o+=1)l+=8*i+6*o<=e?QO.charAt(a>>>6*(3-o)&63):n.b64Pad;return l}(t,e,r,n)};case"BYTES":return function(t){return function(t,e,r){let n,i,o="";const a=e/8,s=-1===r?3:0;for(n=0;n<a;n+=1)i=t[n>>>2]>>>8*(s+r*(n%4))&255,o+=String.fromCharCode(i);return o}(t,e,r)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(t){throw new Error("ARRAYBUFFER not supported by this environment")}return function(t){return function(t,e,r){let n;const i=e/8,o=new ArrayBuffer(i),a=new Uint8Array(o),s=-1===r?3:0;for(n=0;n<i;n+=1)a[n]=t[n>>>2]>>>8*(s+r*(n%4))&255;return o}(t,e,r)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(t){throw new Error("UINT8ARRAY not supported by this environment")}return function(t){return function(t,e,r){let n;const i=e/8,o=-1===r?3:0,a=new Uint8Array(i);for(n=0;n<i;n+=1)a[n]=t[n>>>2]>>>8*(o+r*(n%4))&255;return a}(t,e,r)};default:throw new Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function tk(t){const e={outputUpper:!1,b64Pad:"=",outputLen:-1},r=t||{},n="Output length must be a multiple of 8";if(e.outputUpper=r.outputUpper||!1,r.b64Pad&&(e.b64Pad=r.b64Pad),r.outputLen){if(r.outputLen%8!=0)throw new Error(n);e.outputLen=r.outputLen}else if(r.shakeLen){if(r.shakeLen%8!=0)throw new Error(n);e.outputLen=r.shakeLen}if("boolean"!=typeof e.outputUpper)throw new Error("Invalid outputUpper formatting option");if("string"!=typeof e.b64Pad)throw new Error("Invalid b64Pad formatting option");return e}function ek(t,e){return t<<e|t>>>32-e}function rk(t,e,r){return t^e^r}function nk(t,e,r){return t&e^t&r^e&r}function ik(t,e){const r=(65535&t)+(65535&e);return(65535&(t>>>16)+(e>>>16)+(r>>>16))<<16|65535&r}function ok(t,e,r,n,i){const o=(65535&t)+(65535&e)+(65535&r)+(65535&n)+(65535&i);return(65535&(t>>>16)+(e>>>16)+(r>>>16)+(n>>>16)+(i>>>16)+(o>>>16))<<16|65535&o}function ak(t){return[1732584193,4023233417,2562383102,271733878,3285377520]}function sk(t,e){let r,n,i,o,a,s,u;const l=[];for(r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],u=0;u<80;u+=1)l[u]=u<16?t[u]:ek(l[u-3]^l[u-8]^l[u-14]^l[u-16],1),s=u<20?ok(ek(r,5),(c=n)&i^~c&o,a,1518500249,l[u]):u<40?ok(ek(r,5),rk(n,i,o),a,1859775393,l[u]):u<60?ok(ek(r,5),nk(n,i,o),a,2400959708,l[u]):ok(ek(r,5),rk(n,i,o),a,3395469782,l[u]),a=o,o=i,i=ek(n,30),n=r,r=s;var c;return e[0]=ik(r,e[0]),e[1]=ik(n,e[1]),e[2]=ik(i,e[2]),e[3]=ik(o,e[3]),e[4]=ik(a,e[4]),e}function uk(t,e,r,n){let i;const o=15+(e+65>>>9<<4),a=e+r;for(;t.length<=o;)t.push(0);for(t[e>>>5]|=128<<24-e%32,t[o]=4294967295&a,t[o-1]=a/4294967296|0,i=0;i<t.length;i+=16)n=sk(t.slice(i,i+16),n);return n}const lk=class extends class{constructor(t,e,r){const n=r||{};if(this.t=e,this.i=n.encoding||"UTF8",this.numRounds=n.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw new Error("numRounds must a integer >= 1");this.s=t,this.o=[],this.h=0,this.u=!1,this.l=0,this.A=!1,this.p=[],this.R=[]}update(t){let e,r=0;const n=this.U>>>5,i=this.T(t,this.o,this.h),o=i.binLen,a=i.value,s=o>>>5;for(e=0;e<s;e+=n)r+this.U<=o&&(this.F=this.m(a.slice(e,e+n),this.F),r+=this.U);this.l+=r,this.o=a.slice(r>>>5),this.h=o%this.U,this.u=!0}getHash(t,e){let r,n,i=this.g;const o=tk(e);if(this.B){if(-1===o.outputLen)throw new Error("Output length must be specified in options");i=o.outputLen}const a=ZO(t,i,this.v,o);if(this.A&&this.Y)return a(this.Y(o));for(n=this.H(this.o.slice(),this.h,this.l,this.C(this.F),i),r=1;r<this.numRounds;r+=1)this.B&&i%32!=0&&(n[n.length-1]&=16777215>>>24-i%32),n=this.H(n,i,0,this.I(this.s),i);return a(n)}setHMACKey(t,e,r){if(!this.L)throw new Error("Variant does not support HMAC");if(this.u)throw new Error("Cannot set MAC key after calling update");const n=JO(e,(r||{}).encoding||"UTF8",this.v);this.M(n(t))}M(t){const e=this.U>>>3,r=e/4-1;let n;if(1!==this.numRounds)throw new Error("Cannot set numRounds with MAC");if(this.A)throw new Error("MAC key already set");for(e<t.binLen/8&&(t.value=this.H(t.value,t.binLen,0,this.I(this.s),this.g));t.value.length<=r;)t.value.push(0);for(n=0;n<=r;n+=1)this.p[n]=909522486^t.value[n],this.R[n]=1549556828^t.value[n];this.F=this.m(this.p,this.F),this.l=this.U,this.A=!0}getHMAC(t,e){const r=tk(e);return ZO(t,this.g,this.v,r)(this.N())}N(){let t;if(!this.A)throw new Error("Cannot call getHMAC without first setting MAC key");const e=this.H(this.o.slice(),this.h,this.l,this.C(this.F),this.g);return t=this.m(this.R,this.I(this.s)),t=this.H(e,this.g,this.U,t,this.g),t}}{constructor(t,e,r){if("SHA-1"!==t)throw new Error("Chosen SHA variant is not supported");super(t,e,r);const n=r||{};this.L=!0,this.Y=this.N,this.v=-1,this.T=JO(this.t,this.i,this.v),this.m=sk,this.C=function(t){return t.slice()},this.I=ak,this.H=uk,this.F=[1732584193,4023233417,2562383102,271733878,3285377520],this.U=512,this.g=160,this.B=!1,n.hmacKey&&this.M(function(t,e,r,n){const i="hmacKey must include a value and format";if(!e)throw new Error(i);if(void 0===e.value||!e.format)throw new Error(i);return JO(e.format,e.encoding||"UTF8",r)(e.value)}(0,n.hmacKey,this.v))}};var ck={CvApSoutheast1:{systemName:kO.CvApSoutheast1},CvApSoutheast2:{systemName:kO.CvApSoutheast2},CvEuWest1:{systemName:kO.CvEuWest1},CvNaWest1:{systemName:kO.CvNaWest1}};function fk(t){return fk="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fk(t)}var hk,pk="r",dk="cv:r",yk="referrer",mk="cv:originalReferrer",vk=["internalReferrer"],gk=function(){var t=function(){var t=YO.get(mk);if(t&&"string"==typeof t)return t;var e=document.referrer;if(window.URLSearchParams){var r=new URLSearchParams(window.location.search),n=r.has(yk)&&r.get(yk);r.has(yk)&&r.get(yk)&&(e=n)}return e&&YO.set(mk,e),e}();return bk()||{originalReferrer:t}};function bk(){var t,e=YO.get(dk);if((t=e)&&"object"===fk(t)&&!(Object.keys(t).length<vk.length)&&vk.every((function(e){return"string"==typeof t[e]})))return e;if(YO.remove(dk),window.URLSearchParams){var r=new URLSearchParams(window.location.search),n=r.has(pk)&&r.get(pk);if(r.has(pk)&&r.get(pk))try{var i=atob(n),o=JSON.parse(i);return YO.set(dk,o),bk()}catch(t){YO.remove(dk)}}}var _k=new Uint8Array(16);function wk(){if(!hk&&!(hk="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return hk(_k)}const Tk=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Sk=function(t){return"string"==typeof t&&Tk.test(t)};for(var Ek=[],Ok=0;Ok<256;++Ok)Ek.push((Ok+256).toString(16).substr(1));const kk=function(t,e,r){var n=(t=t||{}).random||(t.rng||wk)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){r=r||0;for(var i=0;i<16;++i)e[r+i]=n[i];return e}return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(Ek[t[e+0]]+Ek[t[e+1]]+Ek[t[e+2]]+Ek[t[e+3]]+"-"+Ek[t[e+4]]+Ek[t[e+5]]+"-"+Ek[t[e+6]]+Ek[t[e+7]]+"-"+Ek[t[e+8]]+Ek[t[e+9]]+"-"+Ek[t[e+10]]+Ek[t[e+11]]+Ek[t[e+12]]+Ek[t[e+13]]+Ek[t[e+14]]+Ek[t[e+15]]).toLowerCase();if(!Sk(r))throw TypeError("Stringified UUID is invalid");return r}(n)};function Ck(t){return Ck="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ck(t)}var Pk=18e5;function xk(t){return(new Date).getTime()+t}function jk(t,e,r){var n,i=(n=e)===AO.LocalStorage?KO:n===AO.SessionStorage?YO:void 0;if(!(null==i?void 0:i.isAvailable()))return null;var o,a=i.get(t);if(!function(t){return"object"===Ck(t)&&"string"==typeof(null==t?void 0:t.id)&&!(!Sk(t.id)||4!==function(t){if(!Sk(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}(t.id))&&"number"==typeof(null==t?void 0:t.ttl)&&!((null==t?void 0:t.ttl)<=0||isNaN(null==t?void 0:t.ttl))}(a)||(o=null==a?void 0:a.ttl)&&(new Date).getTime()>o){var s={id:kk(),ttl:xk(r)};return i.set(t,s),s.id}var u={id:a.id,ttl:xk(r)};return i.set(t,u),a.id}function Lk(t){return Lk="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lk(t)}var Ik=function(t){var e=Lk(t);return"function"===e||"object"===e&&!!t},Ak=function(t){return"function"==typeof t},Rk=function(t,e){if(t){var r=t;return t.endsWith("/")||(r+="/"),e?r+=e.startsWith("/")?e.slice(1):e:r}};function Dk(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Mk={mobileDevice:/Mobi/i,iphone:/iphone/i,ipad:/ipad/i,android:/android/i,blackberry:/blackberry/i,windowsPhone:/windows phone/i,iosVersion:/OS\s+([\d_.-:]+)\s/i,androidVersion:/android\s+([\d_.-\/]+)[\s;:,\)]/i,blackberryVersion:/(blackberry|version)\s?\d*\/([\d.]+)/i,windowsPhoneVersion:/windows\sphone.*?([\d_.-\/]+)[\s;:,\)]/i,mac:/Mac/i,unix:/X11/i,linux:/Linux/i,windows:/Win/i,win2000:/nt 5.0/i,winXP:/nt 5.1/i,winVista:/nt 6.0/i,win7:/nt 6.1/i,win8:/nt 6.2/i,win81:/nt 6.3/i,win10:/nt 10.0/i,osxVersion:/OS\sX\s([\d_.]+)/i,chrome:/^(?!.*Edge).*Chrome/i,safari:/^(?!.*(?:Chrome|Edge)).*Safari/i,edge:/edge/i,ie:/(msie|trident)/i,opera:/(opr|opera)/i,firefox:/firefox/i,generalVersion:/(chrome|firefox|version)\/(\d+.*?)(\s|$)/i,operaVersion:/(opr|opera)\/(\d+).*?(\s|$)/i,ieVersion:/MSIE\s+(\d+).*?/i,edgeVersion:/(edge)\/(\d+).*?(\s|$)/i},Nk="Unknown";function Bk(t,e,r){var n=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Dk(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Dk(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e.exec(r)||[],1)[0];return n||(n=Nk),{name:t,version:n}}function Uk(t,e,r){if(!e)return{name:t,version:Nk};var n=e.exec(r);return{name:t,version:n&&n.length?n[0].trim():Nk}}var Fk=function(){var t=window.navigator.userAgent;return Mk.android.test(t)?Uk("Android",Mk.androidVersion,t):Mk.iphone.test(t)||Mk.ipad.test(t)?Uk("iOS",Mk.iosVersion,t):Mk.linux.test(t)?Uk("Linux",null,t):Mk.unix.test(t)?Uk("Unix",null,t):Mk.mac.test(t)?Uk("Macintosh",Mk.osxVersion,t):Mk.windows.test(t)?function(t,e){var r={name:"Windows",version:null};return Mk.win2000.test(e)&&(r.version="2000"),Mk.winXP.test(e)&&(r.version="XP"),Mk.winVista.test(e)&&(r.version="Vista"),Mk.win7.test(e)&&(r.version="7"),Mk.win8.test(e)&&(r.version="8"),Mk.win81.test(e)&&(r.version="8.1"),Mk.win10.test(e)&&(r.version="10"),r.version||(r.version=Nk),r}(0,t):Mk.blackberry.test(t)?Uk("BlackBerry",Mk.blackberryVersion,t):Mk.windowsPhone.test(t)?Uk("Windows Phone",Mk.windowsPhoneVersion,t):{name:Nk,version:Nk}};function Vk(t){return Vk="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vk(t)}function Hk(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var qk="cv:utmparams",zk=[["source","utm_source"],["medium","utm_medium"],["campaign","utm_campaign"],["term","utm_term"],["content","utm_content"]],Wk=function(){if(!window.URLSearchParams)return null;var t=new URLSearchParams(window.location.search),e={};if(zk.forEach((function(r){var n=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Hk(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Hk(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(r,2),i=n[0],o=n[1];t.has(o)&&(e[i]=t.get(o))})),Object.keys(e).length)return YO.set(qk,e),e;var r=YO.get(qk);return r&&"object"===Vk(r)&&Object.keys(r).length?r:null};var Gk="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==Gk&&Gk,Xk="URLSearchParams"in Gk,Kk="Symbol"in Gk&&"iterator"in Symbol,Yk="FileReader"in Gk&&"Blob"in Gk&&function(){try{return new Blob,!0}catch(t){return!1}}(),Qk="FormData"in Gk,$k="ArrayBuffer"in Gk;if($k)var Jk=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Zk=ArrayBuffer.isView||function(t){return t&&Jk.indexOf(Object.prototype.toString.call(t))>-1};function tC(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function eC(t){return"string"!=typeof t&&(t=String(t)),t}function rC(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return Kk&&(e[Symbol.iterator]=function(){return e}),e}function nC(t){this.map={},t instanceof nC?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function iC(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function oC(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function aC(t){var e=new FileReader,r=oC(e);return e.readAsArrayBuffer(t),r}function sC(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function uC(){return this.bodyUsed=!1,this._initBody=function(t){var e;this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:Yk&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:Qk&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:Xk&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():$k&&Yk&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=sC(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):$k&&(ArrayBuffer.prototype.isPrototypeOf(t)||Zk(t))?this._bodyArrayBuffer=sC(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):Xk&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Yk&&(this.blob=function(){var t=iC(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?iC(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(aC)}),this.text=function(){var t,e,r,n=iC(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,r=oC(e=new FileReader),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},Qk&&(this.formData=function(){return this.text().then(fC)}),this.json=function(){return this.text().then(JSON.parse)},this}nC.prototype.append=function(t,e){t=tC(t),e=eC(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},nC.prototype.delete=function(t){delete this.map[tC(t)]},nC.prototype.get=function(t){return t=tC(t),this.has(t)?this.map[t]:null},nC.prototype.has=function(t){return this.map.hasOwnProperty(tC(t))},nC.prototype.set=function(t,e){this.map[tC(t)]=eC(e)},nC.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},nC.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),rC(t)},nC.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),rC(t)},nC.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),rC(t)},Kk&&(nC.prototype[Symbol.iterator]=nC.prototype.entries);var lC=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function cC(t,e){if(!(this instanceof cC))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r,n,i=(e=e||{}).body;if(t instanceof cC){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new nC(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,i||null==t._bodyInit||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new nC(e.headers)),this.method=(n=(r=e.method||this.method||"GET").toUpperCase(),lC.indexOf(n)>-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var o=/([?&])_=[^&]*/;o.test(this.url)?this.url=this.url.replace(o,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function fC(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}})),e}function hC(t,e){if(!(this instanceof hC))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"",this.headers=new nC(e.headers),this.url=e.url||"",this._initBody(t)}cC.prototype.clone=function(){return new cC(this,{body:this._bodyInit})},uC.call(cC.prototype),uC.call(hC.prototype),hC.prototype.clone=function(){return new hC(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new nC(this.headers),url:this.url})},hC.error=function(){var t=new hC(null,{status:0,statusText:""});return t.type="error",t};var pC=[301,302,303,307,308];hC.redirect=function(t,e){if(-1===pC.indexOf(e))throw new RangeError("Invalid status code");return new hC(null,{status:e,headers:{location:t}})};var dC=Gk.DOMException;try{new dC}catch(t){(dC=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack}).prototype=Object.create(Error.prototype),dC.prototype.constructor=dC}function yC(t,e){return new Promise((function(r,n){var i=new cC(t,e);if(i.signal&&i.signal.aborted)return n(new dC("Aborted","AbortError"));var o=new XMLHttpRequest;function a(){o.abort()}o.onload=function(){var t,e,n={status:o.status,statusText:o.statusText,headers:(t=o.getAllResponseHeaders()||"",e=new nC,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();e.append(n,i)}})),e)};n.url="responseURL"in o?o.responseURL:n.headers.get("X-Request-URL");var i="response"in o?o.response:o.responseText;setTimeout((function(){r(new hC(i,n))}),0)},o.onerror=function(){setTimeout((function(){n(new TypeError("Network request failed"))}),0)},o.ontimeout=function(){setTimeout((function(){n(new TypeError("Network request failed"))}),0)},o.onabort=function(){setTimeout((function(){n(new dC("Aborted","AbortError"))}),0)},o.open(i.method,function(t){try{return""===t&&Gk.location.href?Gk.location.href:t}catch(e){return t}}(i.url),!0),"include"===i.credentials?o.withCredentials=!0:"omit"===i.credentials&&(o.withCredentials=!1),"responseType"in o&&(Yk?o.responseType="blob":$k&&i.headers.get("Content-Type")&&-1!==i.headers.get("Content-Type").indexOf("application/octet-stream")&&(o.responseType="arraybuffer")),!e||"object"!=typeof e.headers||e.headers instanceof nC?i.headers.forEach((function(t,e){o.setRequestHeader(e,t)})):Object.getOwnPropertyNames(e.headers).forEach((function(t){o.setRequestHeader(t,eC(e.headers[t]))})),i.signal&&(i.signal.addEventListener("abort",a),o.onreadystatechange=function(){4===o.readyState&&i.signal.removeEventListener("abort",a)}),o.send(void 0===i._bodyInit?null:i._bodyInit)}))}function mC(t){return mC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mC(t)}function vC(){vC=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),s=new j(n||[]);return i(a,"_invoke",{value:k(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var _={};l(_,a,(function(){return this}));var w=Object.getPrototypeOf,T=w&&w(w(L([])));T&&T!==r&&n.call(T,a)&&(_=T);var S=b.prototype=v.prototype=Object.create(_);function E(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==mC(c)&&n.call(c,"__await")?e.resolve(c.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(c).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function k(e,r,n){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(mC(e)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},E(O.prototype),l(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new O(c(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(x),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function gC(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,bC(n.key),n)}}function bC(t){var e=function(t,e){if("object"!=mC(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=mC(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==mC(e)?e:String(e)}yC.polyfill=!0,Gk.fetch||(Gk.fetch=yC,Gk.Headers=nC,Gk.Request=cC,Gk.Response=hC);var _C,wC,TC=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))},SC="unknown",EC=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=e,this.initialize()}var e,r;return e=t,r=[{key:"initialize",value:function(){this.validateOptions(),this.options.logUtmParameters&&(this.utmParameters=Wk()),this.options.logAttributionData&&(this.attributionData=gk())}},{key:"name",get:function(){return"CollectionApiClient"}},{key:"log",value:function(t){return TC(this,void 0,void 0,vC().mark((function e(){return vC().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Array.isArray(t)){e.next=2;break}return e.abrupt("return",this.logBulk(t));case 2:if(this.shouldLog(t)){e.next=4;break}return e.abrupt("return");case 4:return this.validateEvent(t),e.t0=this,e.next=8,this.formatData(t);case 8:return e.t1=e.sent,e.next=11,e.t0.postData.call(e.t0,e.t1);case 11:case"end":return e.stop()}}),e,this)})))}},{key:"logBulk",value:function(t){return TC(this,void 0,void 0,vC().mark((function e(){var r,n,i=this;return vC().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.filter((function(t){return i.shouldLog(t)})),r.length){e.next=3;break}return e.abrupt("return");case 3:return r.forEach((function(t){return i.validateEvent(t)})),e.next=6,Promise.all(r.map((function(t){return i.formatData(t)})));case 6:return n=e.sent,e.next=9,this.postData(n);case 9:case"end":return e.stop()}}),e,this)})))}},{key:"validateOptions",value:function(){if(!Ak(this.options.getUser))throw new Error("getUser option is required.")}},{key:"shouldLog",value:function(t){return!Ak(this.options.shouldLog)||this.options.shouldLog(t)}},{key:"postData",value:function(t){return TC(this,void 0,void 0,vC().mark((function e(){var r,n,i,o,a;return vC().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getRegionalUrl(this.options.collectionApiUrls);case 2:return r=e.sent,n=JSON.stringify(t),i=Object.assign({"Content-Type":"application/json"},this.getSignatureHeader(n)),o=Rk(r,"/v1/ingest"),Array.isArray(t)&&(o=Rk(o,"/bulk")),e.prev=7,e.next=10,fetch(o,{method:"POST",mode:"cors",headers:i,body:n});case 10:(a=e.sent).ok||this.logError(new Error("CollectionApiClient failed to log event. Status: ".concat(a.status," ").concat(a.statusText))),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),this.logError(e.t0);case 17:case"end":return e.stop()}}),e,this,[[7,14]])})))}},{key:"getSignatureHeader",value:function(t){var e=new lk("SHA-1","TEXT",{hmacKey:{value:"zXJL9nOHxzDlMUDjiP41",format:"TEXT",encoding:"UTF8"}});return e.update(t),{"cv-analytics-signature":"".concat(this.options.collectionApiClientId,".").concat(e.getHash("B64"))}}},{key:"getRegionalUrl",value:function(t){return TC(this,void 0,void 0,vC().mark((function e(){var r;return vC().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getRegion();case 2:r=e.sent,e.t0=r.systemName,e.next=e.t0===kO.CvEuWest1?6:e.t0===kO.CvApSoutheast2?7:e.t0===kO.CvNaWest1?8:(e.t0,kO.CvApSoutheast1,9);break;case 6:return e.abrupt("return",t.cvEuWest1);case 7:return e.abrupt("return",t.cvApSoutheast2);case 8:return e.abrupt("return",t.cvNaWest1);case 9:return e.abrupt("return",t.cvApSoutheast1);case 10:case"end":return e.stop()}}),e,this)})))}},{key:"validateEvent",value:function(t){"string"!=typeof t.type&&this.logError(new Error("Event type is required."),!0),Ik(t.actionContext)||this.logError(new Error("Event actionContext is required."),!0),t.actionContext.entity||this.logError(new Error("Event actionContext entity is required."),!0)}},{key:"formatData",value:function(t){return TC(this,void 0,void 0,vC().mark((function e(){return vC().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=t.type,e.next=3,this.getEventData(t);case 3:return e.t1=e.sent,e.t2=this.getEventMetadata(t),e.abrupt("return",{type:e.t0,data:e.t1,metadata:e.t2});case 6:case"end":return e.stop()}}),e,this)})))}},{key:"getEventData",value:function(t){return TC(this,void 0,void 0,vC().mark((function e(){var r,n,i,o,a,s,u,l=this;return vC().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.actionContext,n=this.getPlatformMetadata(),e.next=4,this.getUserData();case 4:return i=e.sent,o={user:i,action:r,platform:n,product:{name:this.options.productName,version:this.options.productVersion},session:this.getSessionData()},this.utmParameters&&(o.utm=this.utmParameters),a=this.extractData(t),s=Object.keys(o).map((function(t){return t.toLowerCase()})),u=Object.keys(a).map((function(t){return t.toLowerCase()})),s.forEach((function(t){u.includes(t)&&l.logError(new Error("".concat(t," is a reserved key.")),!0)})),e.abrupt("return",Object.assign(Object.assign({},o),a));case 12:case"end":return e.stop()}}),e,this)})))}},{key:"extractData",value:function(t){return Ak(this.options.formatData)?this.options.formatData(t):(e={},r=t.actionContext.entity,n=t.data,(r=bC(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e);var e,r,n}},{key:"getUserData",value:function(){var t,e;return TC(this,void 0,void 0,vC().mark((function r(){var n;return vC().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,this.options.getUser();case 3:if(null==(n=r.sent)?void 0:n.id){r.next=6;break}return r.abrupt("return");case 6:return r.t0=n.id,r.t1=(null===(t=n.role)||void 0===t?void 0:t.toLowerCase())||SC,r.t2=(null===(e=n.userGroup)||void 0===e?void 0:e.toLowerCase())||Pc.Unknown,r.t3=this.normalizeYearGroup(n.yearGroup),r.t4=n.customerId,r.t5=n.customerName,r.t6=n.customerGuid,r.t7=n.crmId,r.t8=n.countryCode,r.next=17,this.getRegion();case 17:return r.t9=r.sent,r.t10=n.accessPolicy,r.t11={id:r.t4,name:r.t5,customerGuid:r.t6,crmId:r.t7,country:r.t8,region:r.t9,openCustomer:!1,accessPolicy:r.t10},r.abrupt("return",{id:r.t0,role:r.t1,userGroup:r.t2,yearGroup:r.t3,customer:r.t11});case 23:r.prev=23,r.t12=r.catch(0),this.logError(r.t12);case 26:case"end":return r.stop()}}),r,this,[[0,23]])})))}},{key:"getRegion",value:function(){return TC(this,void 0,void 0,vC().mark((function t(){var e,r;return vC().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.options.regionName,t.prev=1,t.next=4,this.options.getUser();case 4:(null==(r=t.sent)?void 0:r.instanceRegion)&&(e=r.instanceRegion),t.next=11;break;case 8:t.prev=8,t.t0=t.catch(1),this.logError(t.t0);case 11:return e||this.logError(new Error("RegionName is not set."),!0),t.abrupt("return",this.getRegionByName(e.toLowerCase()));case 13:case"end":return t.stop()}}),t,this,[[1,8]])})))}},{key:"getSessionData",value:function(){return t=jk("cv:session",AO.LocalStorage,Pk),e=jk("cv:window",AO.SessionStorage,Pk),t||e?{id:t,windowId:e}:null;var t,e}},{key:"getPlatformMetadata",value:function(){var t,e,r,n={url:window.location.href,referrer:document.referrer};return(null===(t=this.attributionData)||void 0===t?void 0:t.internalReferrer)&&(n.internalReferrer=this.attributionData.internalReferrer),(null===(e=this.attributionData)||void 0===e?void 0:e.originalReferrer)&&(n.originalReferrer=this.attributionData.originalReferrer),{browser:(r=window.navigator.userAgent,Mk.chrome.test(r)?Bk("Chrome",Mk.generalVersion,r):Mk.firefox.test(r)?Bk("Firefox",Mk.generalVersion,r):Mk.safari.test(r)?Bk("Safari",Mk.generalVersion,r):Mk.ie.test(r)?Bk("Internet Explorer",Mk.ieVersion,r):Mk.edge.test(r)?Bk("Edge",Mk.edgeVersion,r):Mk.opera.test(r)?Bk("Opera",Mk.operaVersion,r):{name:Nk,version:Nk}),os:Fk(),request:n,screenResolution:"".concat(window.screen.width,"x").concat(window.screen.height),viewportResolution:"".concat(window.innerWidth,"x").concat(window.innerHeight)}}},{key:"getEventMetadata",value:function(t){return{client:{name:"".concat(this.name,".ts"),version:"1.41.1-rc.0",region:this.getRegionByName(this.options.regionName)},timestamp:(new Date).toISOString(),eventVersion:t.eventVersion}}},{key:"getRegionByName",value:function(t){var e;return Object.values(ck).forEach((function(r){r.systemName===t&&(e=r)})),e}},{key:"normalizeYearGroup",value:function(t){return t?t.toLowerCase().split(" ").join("_"):SC}},{key:"logError",value:function(t,e){if(this.options.logError&&this.options.logError(t),e)throw t}}],r&&gC(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),OC=function(t){return t},kC=function(){return!0},CC=function(){return!1},PC={getUploadData:function(t,e){var r=e.actionContext.entity;if(r===Wl.Video)return PC.formatVideoUpload(t,e);if(r===Wl.Resource||r===Wl.Subtitle)return PC.formatResourceUpload(t);if(r===Wl.Banner||r===Wl.Thumbnail)return t;throw new Error("Upload data event not correctly formatted.")},formatVideoUpload:function(t,e){var r=e.actionContext.workflowPhase;return r===Xl.Start?PC.getStartVideoUploadData(t):r===Xl.Discard?PC.getDiscardVideoUploadData(t):r===Xl.Complete?PC.getCompleteUploadData(t):void 0},getStartVideoUploadData:function(t){return t&&t.length?(t instanceof FileList&&(t=Array.from(t)),t.map((function(e){return{fileName:e.name,size:e.size,type:e.type,count:t.length}}))):[]},getDiscardVideoUploadData:function(t){var e=function(e){var r=e.file,n=r.type,i=r.name,o=r.status,a=r.cvUpload,s={fileName:i,count:Array.isArray(t)?t.length:1,type:n,status:o};return e.progress&&(s.progress=e.progress.toFixed(2)),a&&(s.uploadId=a.uploadId),s};return Array.isArray(t)?t.map((function(t){return e(t)})):[e(t)]},getCompleteUploadData:function(t){return t&&t.length?t.map((function(e){return{fileName:e.fileName,libraryId:e.libraryId,folderId:e.folderId,autoCaption:e.autoCaption,count:t.length}})):[]},formatResourceUpload:function(t){var e={id:t.id,name:t.name};return Ik(t.metadata)&&(e.type=t.metadata.type),e}};function xC(t){return xC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xC(t)}function jC(t,e,r){return e=function(t){var e=function(t,e){if("object"!=xC(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=xC(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==xC(e)?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var LC=(jC(jC(jC(jC(jC(jC(jC(jC(jC(jC(_C={},zl.Navigate,CC),zl.Click,kC),zl.Search,kC),zl.InstantSearch,kC),zl.Play,kC),zl.Stream,kC),zl.WebPlayerStream,kC),zl.StreamProgress,kC),zl.Rename,kC),zl.Move,kC),jC(jC(jC(jC(jC(jC(jC(jC(jC(jC(_C,zl.Create,kC),zl.Delete,kC),zl.Associate,kC),zl.Dissociate,kC),zl.Filter,kC),zl.Sort,kC),zl.Approve,kC),zl.Reject,kC),zl.Disable,kC),zl.Upload,kC),jC(jC(jC(jC(jC(jC(jC(jC(jC(jC(_C,zl.Download,CC),zl.SetAccess,kC),zl.AddToLocalCache,CC),zl.Share,kC),zl.Unshare,kC),zl.Edit,kC),zl.Suggest,kC),zl.Favourite,kC),zl.WorkspaceAdd,kC),zl.ResolveWarning,kC),jC(jC(jC(jC(jC(jC(jC(jC(jC(jC(_C,zl.DismissWarning,kC),zl.EditAssoc,kC),zl.Follow,kC),zl.Print,kC),zl.Copy,kC),zl.Activate,kC),zl.VerifyEmail,kC),zl.ChangePassword,kC),zl.Export,kC),zl.SendEmail,kC),jC(jC(jC(jC(jC(jC(jC(jC(jC(jC(_C,zl.Publish,kC),zl.Submit,kC),zl.Complete,kC),zl.Archive,kC),zl.Promote,kC),zl.Demote,kC),zl.BulkAction,kC),zl.Remove,kC),zl.Dismiss,kC),zl.Open,kC),jC(jC(jC(jC(jC(jC(jC(jC(_C,zl.Hide,kC),zl.PageView,kC),zl.Select,kC),zl.SwitchCustomer,kC),zl.Focus,kC),zl.Blur,kC),zl.Hover,kC),zl.Unhover,kC)),IC=(jC(jC(jC(jC(jC(jC(jC(jC(jC(jC(wC={},zl.Search,OC),zl.InstantSearch,OC),zl.Play,OC),zl.Stream,OC),zl.StreamProgress,OC),zl.Click,OC),zl.Filter,OC),zl.Sort,OC),zl.SetAccess,OC),zl.Approve,OC),jC(jC(jC(jC(jC(jC(jC(jC(jC(jC(wC,zl.Reject,OC),zl.Create,OC),zl.Delete,OC),zl.Rename,OC),zl.Move,OC),zl.Edit,OC),zl.Share,(function(t){var e,r,n,i,o={id:t.id,search:t.search,pagePositionIndex:t.pagePositionIndex};return(null===(e=t.video)||void 0===e?void 0:e.id)&&(o.video={id:t.video.id}),(null===(r=t.clip)||void 0===r?void 0:r.id)&&(o.clip={id:t.clip.id},(null===(n=t.clip.video)||void 0===n?void 0:n.id)&&(o.video={id:null===(i=t.clip.video)||void 0===i?void 0:i.id})),void 0!==t.shareCount&&(o.shareCount=t.shareCount),t.embedDetails&&(o.embedDetails=o.embedDetails),o})),zl.Disable,OC),zl.Suggest,OC),zl.Upload,PC.getUploadData),jC(jC(jC(jC(jC(wC,zl.ResolveWarning,OC),zl.DismissWarning,OC),zl.Follow,OC),zl.Print,OC),zl.Copy,OC)),AC=jC(jC(jC(jC({},zl.Search,(function(){return"search"})),zl.InstantSearch,(function(){return"search"})),zl.Filter,(function(){return"filter"})),zl.Stream,(function(){return Wl.Video})),RC={user:"target_user",product:"target_product"},DC=jC(jC({},zl.StreamProgress,!0),zl.WebPlayerStream,!0),MC={shouldLog:function(t){return!!LC[t.type](t)},formatData:function(t){var e=IC[t.type],r=Ak(e)?e(t.data,t):t.data;if(DC[t.type])return r;var n=t.actionContext.entity;return Ak(AC[t.type])&&(n=AC[t.type](t)),RC[n]&&(n=RC[n]),jC({},n,r)}};function NC(t){return NC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},NC(t)}function BC(){BC=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),s=new j(n||[]);return i(a,"_invoke",{value:k(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var _={};l(_,a,(function(){return this}));var w=Object.getPrototypeOf,T=w&&w(w(L([])));T&&T!==r&&n.call(T,a)&&(_=T);var S=b.prototype=v.prototype=Object.create(_);function E(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==NC(c)&&n.call(c,"__await")?e.resolve(c.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(c).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function k(e,r,n){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(NC(e)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},E(O.prototype),l(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new O(c(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(x),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function UC(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,FC(n.key),n)}}function FC(t){var e=function(t,e){if("object"!=NC(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=NC(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==NC(e)?e:String(e)}var VC,HC=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=e,this.initialize()}var e,r;return e=t,(r=[{key:"logStream",value:function(){var t="v:".concat(this.options.videoId);KO.cacheExists(t)||(this.collectionApiClient.log({type:zl.WebPlayerStream,actionContext:this.getActionContext(),data:this.getAnalyticsData(),eventVersion:Cc.V3}),KO&&KO.cacheSet(t,null,300))}},{key:"logVideoProgress",value:function(t){var e=this,r=this.getAnalyticsData();this.collectionApiClient.log(t.map((function(t){return{type:zl.StreamProgress,actionContext:e.getActionContext(),data:Object.assign(Object.assign({},r),{progress:t}),eventVersion:Cc.V2}})))}},{key:"logUserAction",value:function(t,e){var r=Object.assign(Object.assign({},this.getAnalyticsData()),t),n=Object.assign(Object.assign({},this.getActionContext()),e);this.collectionApiClient.log({type:e.actionType,data:r,actionContext:n,eventVersion:e.eventVersion||Cc.V2})}},{key:"getAnalyticsData",value:function(){var t=Object.assign({video:{id:this.options.videoId},flags:{isUsingLocalCache:this.options.isUsingLocalCache}},this.options.additionalAnalyticsData||{});this.options.shareId&&(t.video.shareId=this.options.shareId);var e=this.getEntityType();return e===Wl.Interactive?t.interactive={id:+this.options.mediaId}:e===Wl.Clip&&(t.clip={id:+this.options.mediaId}),t}},{key:"initialize",value:function(){this.setupCollectionApiClient()}},{key:"setupCollectionApiClient",value:function(){var t=this;this.collectionApiClient=new EC({productName:"player.web",productVersion:this.options.productVersion,regionName:this.options.regionName,collectionApiUrls:this.options.collectionApiUrls,collectionApiClientId:this.options.collectionApiClientId,getUser:function(){return t.getCurrentUser()},shouldLog:MC.shouldLog,formatData:MC.formatData})}},{key:"getCurrentUser",value:function(){return t=this,e=void 0,r=void 0,n=BC().mark((function t(){return BC().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",{id:this.options.userId,customerId:this.options.customerId});case 1:case"end":return t.stop()}}),t,this)})),new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}));var t,e,r,n}},{key:"getActionContext",value:function(){return{entity:this.getEntityType(),location:this.getLocationContext(),productArea:void 0,descriptor:this.options.isEmbedded?rc.Embedded:void 0,workflowPhase:void 0}}},{key:"getEntityType",value:function(){switch(this.options.mediaType){case"MasterVideo":return Wl.Video;case"MasterInteractive":return Wl.Interactive;case"MasterClip":return Wl.Clip}}},{key:"getLocationContext",value:function(){switch(this.options.playerType){case"player":return Gl.Player;case"interactive-player":return Gl.InteractivePlayer;case"create-clip-player":return Gl.CreateClipPlayer}}}])&&UC(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function qC(t){return qC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qC(t)}function zC(){zC=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),s=new j(n||[]);return i(a,"_invoke",{value:k(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var _={};l(_,a,(function(){return this}));var w=Object.getPrototypeOf,T=w&&w(w(L([])));T&&T!==r&&n.call(T,a)&&(_=T);var S=b.prototype=v.prototype=Object.create(_);function E(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==qC(c)&&n.call(c,"__await")?e.resolve(c.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(c).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function k(e,r,n){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(qC(e)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},E(O.prototype),l(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new O(c(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(x),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function WC(t){return function(t){if(Array.isArray(t))return GC(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return GC(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?GC(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function GC(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function XC(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,KC(n.key),n)}}function KC(t){var e=function(t,e){if("object"!=qC(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=qC(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==qC(e)?e:String(e)}!function(t){t.PhysicallyChapteredVideo="physically-chaptered-video"}(VC||(VC={}));var YC,QC=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))},$C=yl.getComponent("Player"),JC=function(){function t(e,r){var n=this;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.streamLogged=!1,this.options=yl.mergeOptions({},t.options_,r),null===this.options.playerApi)throw new Error("PlayerApi required");this.initialize(),this.createEl(e),this.buildVideoJs(),this.options.splash&&this.setupSplash(this.options.splash),this.bindEventListeners(),this.setupSeekBar(),this.fetchConfig(),this.logStream=this.logStream.bind(this),this.player.ready((function(){n._configurePlugins(),n.options.setup&&n.options.setup(n.options,n.player),n.fetch().catch((function(t){return n.handleFetchError(t)}))}))}var e,r;return e=t,r=[{key:"initialize",value:function(){}},{key:"_configurePlugins",value:function(){this.player.configureMenuDimensionsPlugin({mobile:this.options.mobile,overflowControls:this.options.overflowControls,seekBarName:this.getSeekBarName()}),this.player.progressReporterPlugin({onFlush:this.onFlushProgress=this.onFlushProgress.bind(this)}),this.player.persistVolumePlugin(),!this.options.mobile&&this.options.allowFullscreen&&this.player.fullscreenOnRotatePlugin(),this.player.touchControls(),this.options.getExternalLink&&this.player.openExternallyPlugin({getExternalLink:this.options.getExternalLink}),this.configurePlugins()}},{key:"configurePlugins",value:function(){}},{key:"onFlushProgress",value:function(t){var e;null===(e=this.analyticsService)||void 0===e||e.logVideoProgress(t)}},{key:"buildVideoJs",value:function(){return this.player=yl(this.el,this.getPlayerOptions())}},{key:"getInactivityTimeout",value:function(){if("number"==typeof this.options.inactivityTimeout)return this.options.inactivityTimeout;var t=500;return(this.options.mobile||yl.browser.IS_IOS||yl.browser.IS_ANDROID)&&(t=3e3),t}},{key:"getPlayerOptions",value:function(){var t=this,e=$C.prototype.options_.children;return e=e.filter((function(t){return"bigPlayButton"!==t&&"posterImage"!==t})),{controls:this.options.controls,fluid:!this.options.embed&&!this.options.mobile,fill:this.options.embed||this.options.mobile,inactivityTimeout:this.getInactivityTimeout(),controlBar:{children:["timeWrapper","progressControl"]},children:[].concat(WC(e),[{name:"collapserator",children:Bb.filter((function(e){return!("fullscreenToggle"===e&&!t.options.allowFullscreen)}))},"playPauseFeedback","controlBarGradient"]),userActions:{hotkeys:function(e){return function(t,e,r){var n=p()(t);("f"!==n||r.allowFullscreen)&&RO[n]&&(["space"].includes(n)&&(t.preventDefault(),t.stopPropagation()),RO[n](e,t))}(e,t.player,t.options)}},playbackRates:this.options.playbackRates,techOrder:["html5"],html5:{nativeTextTracks:!1},playsinline:!0,aspectRatio:this.options.aspectRatio,mobile:this.options.mobile,deferMenus:this.options.deferMenus,muted:this.options.muted,devicesConfig:this.options.devicesConfig}}},{key:"getPlaybackObject",value:function(){return QC(this,void 0,void 0,zC().mark((function t(){var e,r,n=this;return zC().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.options.offlinePlaybackObject){t.next=2;break}return t.abrupt("return",this.options.offlinePlaybackObject);case 2:if(e=this.options.fetch,void 0===this.options.fetch&&(e=function(t){var e="".concat(n.options.playerApi.origin,"/api/playback?viewKey=").concat(t);return zh.get(e)}),this.options.viewKey){t.next=6;break}throw new Error("Please specify a viewKey or a fetch function");case 6:return t.next=8,e(this.options.viewKey);case 8:if(r=t.sent){t.next=11;break}throw new Error("Error fetching playback object");case 11:return t.abrupt("return",r);case 12:case"end":return t.stop()}}),t,this)})))}},{key:"setChaptersInternal",value:function(t,e){var r=jg.getTrack(this.player,"chapters",null);r||(r=this.player.addTextTrack("chapters")),WC(r.cues.cues_).forEach((function(t){return r.removeCue(t)})),t.forEach((function(t){r.addCue({startTime:t.timestamp,endTime:t.endTimestamp,text:t.name})})),e&&r.trigger({type:"cv:cuechange",target:r}),r.trigger({type:"loadeddata",target:r})}},{key:"setChapters",value:function(t){this.setChaptersInternal(t,!0)}},{key:"setPlayerMode",value:function(t,e){this.player.playerModePlugin().setPlayerMode(t,e)}},{key:"setFavourite",value:function(t,e){this.player.favouritePlugin().setFavourite(t,e)}},{key:"fetch",value:function(){var t,e,r,n,i;return QC(this,void 0,void 0,zC().mark((function o(){var a,s,u,l=this;return zC().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.getPlaybackObject();case 2:if(a=o.sent,!this.isDisposed()){o.next=5;break}return o.abrupt("return");case 5:s="MasterClip"===a.mediaType,u=null===(t=a.additionalData)||void 0===t?void 0:t.clipData,(null===(r=null===(e=a.chapters)||void 0===e?void 0:e.list)||void 0===r?void 0:r.length)>0&&!s&&!u&&this.setChaptersInternal(a.chapters.list,!1),this.player.localCache({localCacheAddresses:null!==(n=a.localCacheAddresses)&&void 0!==n?n:[],enabled:null===(i=this.options.enableLocalCache)||void 0===i||i}),this.player.progressiveFiles({sources:a.files.progressive.map((function(t){return{id:t.profile,mimeType:t.mimeType,url:t.url}}))}),this.player.handleNetworkErrors({playerApi:this.options.playerApi,fileToken:a.files.fileToken}),a.subtitles.list.length>0&&a.subtitles.list.forEach((function(t){if("text/vtt"===t.mimeType){var e=l.player.addRemoteTextTrack({kind:"subtitles",src:t.url,language:t.language,label:t.label},!0);jg.sanitizeTrack(e.track,l.player)}})),a.posterUrl&&this.player.poster(a.posterUrl),this.setupSplash({title:a.title,posterUrl:a.posterUrl,episodeNumber:a.episodeNumber,ratingCode:a.ratingCode,seasonNumber:a.seasonNumber,seriesName:a.seriesName}),this.additionalSetup(a),this.handleAutoplay(a),this.options.startTime&&this.player.ready((function(){l.player.currentTime(l.options.startTime)})),this.player.trigger("cv-playback-data-loaded",a);case 18:case"end":return o.stop()}}),o,this)})))}},{key:"handleFetchError",value:function(t){var e,r=t.message;t instanceof Bh&&(null===(e=t.response)||void 0===e?void 0:e.type)===VC.PhysicallyChapteredVideo&&(r="Video cannot be played because it is either corrupt or damaged."),this.player.error(r),this.options.onError&&this.options.onError(t)}},{key:"fetchConfig",value:function(){return QC(this,void 0,void 0,zC().mark((function t(){var e;return zC().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(YC||this.options.fetch||this.options.offlinePlaybackObject)){t.next=2;break}return t.abrupt("return");case 2:return e="".concat(this.options.playerApi.origin,"/api/config"),t.next=5,zh.get(e);case 5:if(YC=t.sent,!this.isDisposed()){t.next=8;break}return t.abrupt("return");case 8:this.trigger("config:loaded");case 9:case"end":return t.stop()}}),t,this)})))}},{key:"additionalSetup",value:function(t){var e,r=this;this.player.whiteboardModePlugin(),this.player.deferMenusPlugin();var n=this.options.enableLocalCache&&!!(null===(e=t.localCacheAddresses)||void 0===e?void 0:e.length);YC?this.setupAnalyticsService(t,n):this.one("config:loaded",(function(){return r.setupAnalyticsService(t,n)})),this.analyticsService||!this.isAnalyticsEnabled()?this.setupAnalyticsDependentPlugins(t):this.one("analytics:loaded",(function(){return r.setupAnalyticsDependentPlugins(t)}))}},{key:"setupAnalyticsService",value:function(t,e){this.options.eventLogging&&(this.analyticsService=new HC({collectionApiUrls:YC.collectionApi.urls,collectionApiClientId:YC.collectionApi.clientId,productVersion:"1.17.0-rc.0",videoId:t.videoId,mediaId:t.mediaId,userId:t.viewerId,shareId:t.shareId,customerId:t.viewerCustomerId,mediaType:t.mediaType,playerType:this.getAnalyticsPlayerType(),isEmbedded:this.options.embed,isUsingLocalCache:e,additionalAnalyticsData:this.getAdditionalAnalyticsData(t),regionName:t.instanceRegion||this.options.sharerInstanceRegion||kO.CvApSoutheast1}),this.on("timeupdate",this.logStream),this.trigger("analytics:loaded"))}},{key:"setupAnalyticsDependentPlugins",value:function(t){var e,r,n,i;this.player.persistSubtitleSettingsPlugin({showSubtitles:null===(e=t.settings)||void 0===e?void 0:e.showSubtitles,subtitleSize:null===(r=t.settings)||void 0===r?void 0:r.playbackSubtitleSizeDefault,analyticsService:this.analyticsService}),this.player.persistQualitySettingsPlugin({playbackProfile:null===(n=t.settings)||void 0===n?void 0:n.playbackProfile,playbackProfileLocalCache:null===(i=t.settings)||void 0===i?void 0:i.playbackProfileLocalCache,analyticsService:this.analyticsService}),this.player.persistPlaybackRatePlugin({analyticsService:this.analyticsService})}},{key:"getAdditionalAnalyticsData",value:function(t){return{}}},{key:"isAnalyticsEnabled",value:function(){return!this.options.fetch&&!this.options.offlinePlaybackObject&&this.options.eventLogging}},{key:"handleAutoplay",value:function(t){var e=this;this.options.autoplay&&this.player.ready((function(){e.player.play().catch((function(){e.isDisposed()||e.showSplash()}))}))}},{key:"logStream",value:function(){this.analyticsService&&(this.player.currentTime()<3||this.streamLogged||(this.analyticsService.logStream(),this.streamLogged=!0,this.off("timeupdate",this.logStream)))}},{key:"getAnalyticsPlayerType",value:function(){return"player"}},{key:"createEl",value:function(t){var e;"string"==typeof t?(t=function(t){return 0===t.indexOf("#")?t.slice(1):t}(t),e=yl.dom.$("#"+t)):e=t;var r="video-js";return this.getPlayerClassName()&&(r+=" ".concat(this.getPlayerClassName())),this.el=yl.dom.createEl("video",{},{class:r}),e.appendChild(this.el),this.el}},{key:"getPlayerClassName",value:function(){return""}},{key:"on",value:function(t,e){this.player.on(t,e)}},{key:"one",value:function(t,e){this.player.one(t,e)}},{key:"off",value:function(t,e){this.player.off(t,e)}},{key:"trigger",value:function(t,e){return this.player.trigger(t,e)}},{key:"dispose",value:function(){this.player.dispose()}},{key:"ready",value:function(t){this.player.ready(t)}},{key:"isDisposed",value:function(){return this.player.isDisposed()}},{key:"play",value:function(){this.player.play()}},{key:"pause",value:function(){this.player.pause()}},{key:"isPaused",value:function(){return this.player.paused()}},{key:"currentTime",value:function(t){return this.player.currentTime(t)}},{key:"muted",value:function(t){return this.player.muted(t)}},{key:"duration",value:function(){return this.player.duration()}},{key:"isFullscreen",value:function(){return this.player.isFullscreen()}},{key:"requestFullscreen",value:function(){this.player.requestFullscreen()}},{key:"exitFullscreen",value:function(){this.player.exitFullscreen()}},{key:"playbackRate",value:function(t){return this.player.playbackRate(t)}},{key:"quality",value:function(t){for(var e=this.player.qualityLevels(),r=0;r<e.length;r++){var n=e[r];if(t)n.enabled=n.id===t.toString();else if(n.enabled)return n.id}}},{key:"subtitles",value:function(t){for(var e=this.player.textTracks(),r=0;r<e.length;r++){var n=e[r];if(void 0===t){if("showing"===n.mode)return n.label}else n.label===t?n.mode="showing":n.mode="disabled"}}},{key:"bindEventListeners",value:function(){var t=this,e=function(t){return t.preventDefault()};if(this.showSplash=this.showSplash.bind(this),this.hideSplash=this.hideSplash.bind(this),this.player.on("ended",this.showSplash),this.player.on("play",this.hideSplash),this.player.tech(!0).on("contextmenu",e),this.player.one("dispose",(function(){t.off("ended",t.showSplash),t.off("play",t.hideSplash),t.player.tech(!0).off("contextmenu",e)})),this.options.hotkeyElQuerySelector){var r=yl.dom.$(this.options.hotkeyElQuerySelector);r&&(this.player.on(r,"keydown",this.player.handleKeyDown),this.player.one("dispose",(function(){t.player.off(r,"keydown",t.player.handleKeyDown)})))}}},{key:"setupSeekBar",value:function(){var t=this.getSeekBarName(),e=this.player.controlBar.getChild("progressControl");e.addChild(t,this.getSeekBarOptions()),e.setSeekBarName(t)}},{key:"setupSplash",value:function(t){this._splashAdded||(this._splashAdded=!0,this.player.addChild("posterImage",Object.assign({embed:this.options.embed},t)),this.player.addChild("bigPlayButton"),this.options.autoplay?this.hideSplash():this.showSplash())}},{key:"showSplash",value:function(){this.player.hasStarted(!1),this.player.getChild("posterImage").show(),this.player.getChild("bigPlayButton").show()}},{key:"hideSplash",value:function(){this.player.getChild("posterImage").hide(),this.player.getChild("bigPlayButton").hide()}},{key:"getSeekBarOptions",value:function(){return{}}},{key:"getSeekBarName",value:function(){return"ChapterSeekBar"}}],r&&XC(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ZC(t){return ZC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ZC(t)}function tP(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,eP(n.key),n)}}function eP(t){var e=function(t,e){if("object"!=ZC(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=ZC(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ZC(e)?e:String(e)}function rP(t,e,r){return e=aP(e),function(t,e){if(e&&("object"===ZC(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return iP(t)}(t,nP()?Reflect.construct(e,r||[],aP(t).constructor):e.apply(t,r))}function nP(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(nP=function(){return!!t})()}function iP(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function oP(){return oP="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=aP(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},oP.apply(this,arguments)}function aP(t){return aP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},aP(t)}function sP(t,e){return sP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},sP(t,e)}JC.options_={viewKey:null,controls:!0,playbackRates:[.25,.5,.75,1,1.25,1.5,1.75,2],playerApi:new URL("http://localhost:52000"),enableLocalCache:!0,eventLogging:!0,allowFullscreen:!0};var uP=function(t){function e(t,r){var n;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=rP(this,e,[t]),void 0===r.startTime)throw Error("Invalid clip start");if(void 0===r.endTime)throw Error("Invalid clip end");if(r.startTime>r.endTime)throw Error("Clip start cannot be greater than clip end");return n._clipStart=parseFloat(r.startTime.toPrecision(4)),n._clipEnd=parseFloat(r.endTime.toPrecision(4)),n.playerEndedFn=n.player.ended.bind(t),n.playerDurationFn=n.player.duration.bind(t),n.playerCurrentTimeFn=n.player.currentTime.bind(t),n.playerbufferedFn=n.player.buffered.bind(t),n.player.ended=n.ended.bind(iP(n)),n.player.duration=n.duration.bind(iP(n)),n.player.currentTime=n.currentTime.bind(iP(n)),n.player.buffered=n.buffered.bind(iP(n)),n.initialize(),n.player.ready((function(){n.player.trigger("durationchange")})),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&sP(t,e)}(e,t),r=e,n=[{key:"clipStart",get:function(){var t=this.playerDurationFn();return this._clipStart>t?t:this._clipStart}},{key:"clipEnd",get:function(){var t=this.playerDurationFn();return t<=0?this._clipEnd:this._clipEnd>t?t:this._clipEnd}},{key:"dispose",value:function(){this.player.off("timeupdate",this.onTimeUpdate),this.player.off("play",this.onPlay),this.player.ended=this.playerEndedFn,this.player.duration=this.playerDurationFn,this.player.currentTime=this.playerCurrentTimeFn,this.player.buffered=this.playerbufferedFn,this.player.trigger("durationchange"),oP(aP(e.prototype),"dispose",this).call(this)}},{key:"initialize",value:function(){this.onTimeUpdate=this.onTimeUpdate.bind(this),this.onPlay=this.onPlay.bind(this),this.player.on("timeupdate",this.onTimeUpdate),this.player.on("play",this.onPlay)}},{key:"onPlay",value:function(){this._isEnded&&this.player.currentTime(0)}},{key:"onTimeUpdate",value:function(){var t=this.getCurrentTime(!1);t>this.clipEnd?this._isEnded||(this.player.pause(),this.player.trigger("ended"),this._isEnded=!0):(this._isEnded=!1,t<this.clipStart-10&&this.playerCurrentTimeFn(this.clipStart,!0))}},{key:"ended",value:function(){return this.getCurrentTime(!1)>this.clipEnd}},{key:"duration",value:function(t){return t&&t>0&&(this.playerDurationFn()?console.info("The duration of the player has already been set. This is a no-op."):this.playerDurationFn(t)),this.clipEnd-this.clipStart}},{key:"currentTime",value:function(t){if("number"!=typeof t)return this.getCurrentTime(!0);for(var e=t+this.clipStart,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this.playerCurrentTimeFn(e,n)}},{key:"getCurrentTime",value:function(t){var e=this.playerCurrentTimeFn(),r=0;return e>=this.clipStart&&(r=e-this.clipStart),this.player.getCache().currentTime=r,t?r:e}},{key:"buffered",value:function(){for(var t=this.playerbufferedFn(),e=[],r=0;r<t.length;r++)e[r]=[Math.max(0,t.start(r)-this.clipStart),Math.min(Math.max(0,t.end(r)-this.clipStart),this.player.duration())];return yl.createTimeRanges(e)}}],n&&tP(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getPlugin("plugin"));function lP(t){return lP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lP(t)}function cP(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,fP(n.key),n)}}function fP(t){var e=function(t,e){if("object"!=lP(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=lP(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==lP(e)?e:String(e)}function hP(t,e,r){return e=yP(e),function(t,e){if(e&&("object"===lP(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,pP()?Reflect.construct(e,r||[],yP(t).constructor):e.apply(t,r))}function pP(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(pP=function(){return!!t})()}function dP(){return dP="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=yP(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},dP.apply(this,arguments)}function yP(t){return yP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},yP(t)}function mP(t,e){return mP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},mP(t,e)}yl.registerPlugin("clipPlugin",uP);var vP=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=hP(this,e,arguments)).alwaysCollapsed=!1,t.isCollapsed=!1,t.isCollabsible=!0,t}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&mP(t,e)}(e,t),r=e,(n=[{key:"buildCSSClass",value:function(){return"cv-create-clip-button"}},{key:"getCollabsibleName",value:function(){return this.controlText_}},{key:"getCollabsibleValue",value:function(){return""}},{key:"showInCollabsibleMenu",value:function(){return!0}},{key:"showCollapsibleMenu",value:function(){dP(yP(e.prototype),"handleClick",this).call(this,null)}}])&&cP(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("Button"));function gP(t){return gP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gP(t)}function bP(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_P(n.key),n)}}function _P(t){var e=function(t,e){if("object"!=gP(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=gP(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==gP(e)?e:String(e)}function wP(t,e,r){return e=SP(e),function(t,e){if(e&&("object"===gP(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,TP()?Reflect.construct(e,r||[],SP(t).constructor):e.apply(t,r))}function TP(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(TP=function(){return!!t})()}function SP(t){return SP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},SP(t)}function EP(t,e){return EP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},EP(t,e)}vP.prototype.controlText_="Create Clip",yl.registerComponent("CreateClipButton",vP);var OP=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=wP(this,e,[t,r])).options=r,t.ready((function(){return n.onReady()})),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&EP(t,e)}(e,t),r=e,n=[{key:"onReady",value:function(){var t,e=this.player.getChild("collapserator"),r=null===(t=null==e?void 0:e.children())||void 0===t?void 0:t.findIndex((function(t){return"CustomControlSpacer"===t.name()}));r&&-1!==r&&e.addChild("CreateClipButton",{clickHandler:this.options.onClick},r+1)}}],n&&bP(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getPlugin("plugin"));function kP(t){return kP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kP(t)}function CP(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,PP(n.key),n)}}function PP(t){var e=function(t,e){if("object"!=kP(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=kP(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==kP(e)?e:String(e)}function xP(t,e,r){return e=LP(e),function(t,e){if(e&&("object"===kP(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,jP()?Reflect.construct(e,r||[],LP(t).constructor):e.apply(t,r))}function jP(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(jP=function(){return!!t})()}function LP(t){return LP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},LP(t)}function IP(t,e){return IP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},IP(t,e)}yl.registerPlugin("createClipButtonPlugin",OP);var AP=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),xP(this,e,arguments)}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&IP(t,e)}(e,t),r=e,(n=[{key:"handlePictureInPictureEnabledChange",value:function(){this.enable()}}])&&CP(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("PictureInPictureToggle"));function RP(t){return RP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},RP(t)}function DP(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,MP(n.key),n)}}function MP(t){var e=function(t,e){if("object"!=RP(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=RP(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==RP(e)?e:String(e)}function NP(t,e,r){return e=FP(e),function(t,e){if(e&&("object"===RP(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,BP()?Reflect.construct(e,r||[],FP(t).constructor):e.apply(t,r))}function BP(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(BP=function(){return!!t})()}function UP(){return UP="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=FP(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},UP.apply(this,arguments)}function FP(t){return FP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},FP(t)}function VP(t,e){return VP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},VP(t,e)}yl.registerComponent("PictureInPictureToggle",AP);var HP=yl.getComponent("PlayToggle"),qP=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=NP(this,e,[t,r])).pictureInPictureEnabled=!1,n.options=r,n.bindFunctions(),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&VP(t,e)}(e,t),r=e,(n=[{key:"bindFunctions",value:function(){this.requestPictureInPicture=this.requestPictureInPicture.bind(this),this.exitPictureInPicture=this.exitPictureInPicture.bind(this),this.onPlayerResize=this.onPlayerResize.bind(this),this.playerRequestPictureInPictureFn=this.player.requestPictureInPicture,this.playerExitPictureInPictureFn=this.player.exitPictureInPicture,this.player.requestPictureInPicture=this.requestPictureInPicture,this.player.exitPictureInPicture=this.exitPictureInPicture}},{key:"enablePictureInPicture",value:function(){var t=this;if(this.player.options_.fluid&&!this.pictureInPictureEnabled){var e=this.getToggleParentComponent();if(e){this.pictureInPictureEnabled=!0;var r=e.children().findIndex((function(t){var e;return"fullscreentoggle"===(null===(e=t.name())||void 0===e?void 0:e.toLowerCase())}));-1===r&&(r=e.children().length-1),e.addChild("pictureInPictureToggle",{},r);var n=e.getChild("pictureInPictureToggle");null==n||n.enable(),this.player.on("playerresize",this.onPlayerResize),this.player.on("dispose",(function(){var e;null===(e=t.player)||void 0===e||e.off("playerresize",t.onPlayerResize)}))}}}},{key:"disablePictureInPicture",value:function(){if(this.pictureInPictureEnabled){this.pictureInPictureEnabled=!1;var t=this.getToggleParentComponent(),e=null==t?void 0:t.getChild("pictureInPictureToggle");e&&t.removeChild(e),this.player.off("playerresize",this.onPlayerResize)}}},{key:"togglePictureInPicture",value:function(t){if(t!==this.player.isInPictureInPicture()){var e=t?"enterpictureinpicture":"leavepictureinpicture";this.player.isInPictureInPicture(t),this.player.trigger(e),t?this.addPipStyles():this.removePipStyles()}}},{key:"onPlayerResize",value:function(){if(!this.player.isInPictureInPicture()){var t=this.player.el().getBoundingClientRect();0!==t.width&&(t.width<800?this.disablePictureInPicture():this.enablePictureInPicture())}}},{key:"addPipStyles",value:function(){this.player.addClass("cv-picture-in-picture"),this.playToggle=new HP(this.player),this.playToggle.addClass("cv-pip-play-toggle"),this.player.addChild(this.playToggle),this.player.paused()?this.playToggle.handlePause():this.playToggle.handlePlay()}},{key:"removePipStyles",value:function(){this.player.removeClass("cv-picture-in-picture"),this.player.removeChild(this.playToggle),delete this.playToggle}},{key:"requestPictureInPicture",value:function(){var t;this.pictureInPictureEnabled&&(this.togglePictureInPicture(!0),"function"==typeof(null===(t=this.options)||void 0===t?void 0:t.onRequestPictureInPicture)&&this.options.onRequestPictureInPicture(!0))}},{key:"exitPictureInPicture",value:function(){this.togglePictureInPicture(!1),this.options.onRequestPictureInPicture(!1),this.removePipStyles()}},{key:"getToggleParentComponent",value:function(){return this.player.getChild("collapserator")}},{key:"dispose",value:function(){this.player.requestPictureInPicture=this.playerRequestPictureInPictureFn,this.player.exitPictureInPicture=this.playerExitPictureInPictureFn,UP(FP(e.prototype),"dispose",this).call(this)}}])&&DP(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getPlugin("plugin"));function zP(t){return zP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zP(t)}function WP(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,GP(n.key),n)}}function GP(t){var e=function(t,e){if("object"!=zP(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=zP(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==zP(e)?e:String(e)}yl.registerPlugin("pictureInPicture",qP);var XP=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.listeners={}}var e,r;return e=t,r=[{key:"subscribe",value:function(t,e){this.registerListener(t,e)}},{key:"subscribeOnce",value:function(t,e){this.registerListener(t,e,1)}},{key:"unsubscribe",value:function(t,e){this.deregisterListener(t,e)}},{key:"trigger",value:function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];this.triggerCallbacks(t,r)}},{key:"registerListener",value:function(t,e,r){var n;if("string"!=typeof t)throw new Error("Event name must be a string");if("function"!=typeof e)throw new Error("Event callback must be a function");if(r&&"number"!=typeof r)throw new Error("Execution limit must be a number or undefined");this.listeners[t]=null!==(n=this.listeners[t])&&void 0!==n?n:[],this.listeners[t].push({callback:e,executionLimit:r})}},{key:"deregisterListener",value:function(t,e){var r;if("string"!=typeof t)throw new Error("Event name must be a string");if(e&&"function"!=typeof e)throw new Error("Event callback must be a function");if(e){var n=null===(r=this.listeners[t])||void 0===r?void 0:r.findIndex((function(t){return t.callback===e}));"number"==typeof n&&-1!==n&&(this.listeners[t].splice(n,1),0===this.listeners[t].length&&delete this.listeners[t])}else this.listeners[t]=[]}},{key:"triggerCallbacks",value:function(t){for(var e=this,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];if(this.listeners[t]){var o=[];this.listeners[t].forEach((function(t){var e,r;"number"==typeof t.executionLimit&&(t.executionCount=null!==(r=t.executionCount)&&void 0!==r?r:0,t.executionCount++,t.executionCount===t.executionLimit&&o.push(t.callback)),(e=t.callback).apply.apply(e,[null].concat(n))})),o.length&&o.forEach((function(r){return e.deregisterListener(t,r)}))}}}],r&&WP(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),KP=new XP;function YP(t){return YP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},YP(t)}function QP(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,$P(n.key),n)}}function $P(t){var e=function(t,e){if("object"!=YP(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=YP(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==YP(e)?e:String(e)}function JP(t,e,r){return e=rx(e),function(t,e){if(e&&("object"===YP(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return tx(t)}(t,ZP()?Reflect.construct(e,r||[],rx(t).constructor):e.apply(t,r))}function ZP(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ZP=function(){return!!t})()}function tx(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ex(){return ex="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=rx(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},ex.apply(this,arguments)}function rx(t){return rx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},rx(t)}function nx(t,e){return nx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},nx(t,e)}var ix=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=JP(this,e,[t,r])).hasBuffered=!1,n.hasPlayed=!1,n.eventsService=KP,n.pointOfInterest=r.pointOfInterest,n.onMouseOver=n.onMouseOver.bind(tx(n)),n.onMouseLeave=n.onMouseLeave.bind(tx(n)),n.onGlancePointOfInterestMouseEnter=n.onGlancePointOfInterestMouseEnter.bind(tx(n)),n.onGlancePointOfInterestMouseLeave=n.onGlancePointOfInterestMouseLeave.bind(tx(n)),n.initialize(),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&nx(t,e)}(e,t),r=e,n=[{key:"initialize",value:function(){this.setPosition(),this.bindListeners()}},{key:"buildCSSClass",value:function(){return"cv-point-of-interest-indicator ".concat(ex(rx(e.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(t,r,n){return ex(rx(e.prototype),"createEl",this).call(this,t,Object.assign(Object.assign({},r),{className:this.buildCSSClass()}),n)}},{key:"bindListeners",value:function(){this.on("mouseover",this.onMouseOver),this.on("mouseleave",this.onMouseLeave),this.eventsService.subscribe("glance:poi:mouseover",this.onGlancePointOfInterestMouseEnter),this.eventsService.subscribe("glance:poi:mouseleave",this.onGlancePointOfInterestMouseLeave)}},{key:"dispose",value:function(){this.eventsService.unsubscribe("glance:poi:mouseover",this.onGlancePointOfInterestMouseEnter),this.eventsService.unsubscribe("glance:poi:mouseleave",this.onGlancePointOfInterestMouseLeave)}},{key:"getPointOfInterestTime",value:function(){return this.pointOfInterest.startTime}},{key:"setPosition",value:function(){var t=this.player().duration();this.el_.style.left=this.getPointOfInterestTime()/t*100+"%"}},{key:"updateBuffered",value:function(t){var e=this.getPointOfInterestTime()<=t;if(e!==this.hasBuffered){this.hasBuffered=e;var r="cv-point-of-interest-indicator-buffered";this.hasBuffered?this.addClass(r):this.removeClass(r)}}},{key:"updatePlaybackProgress",value:function(t){var e=this.getPointOfInterestTime()<=t;if(e!==this.hasPlayed){this.hasPlayed=e;var r="cv-point-of-interest-indicator-played";e?this.addClass(r):this.removeClass(r)}}},{key:"toggleVisibility",value:function(t){var e="cv-point-of-interest-indicator-hidden";t?this.removeClass(e):this.addClass(e)}},{key:"onMouseOver",value:function(){this.setTimeTooltipText(),this.eventsService.trigger("player:poi:mouseover",this.pointOfInterest)}},{key:"onMouseLeave",value:function(){this.clearTimeTooltipText(),this.eventsService.trigger("player:poi:mouseleave")}},{key:"onGlancePointOfInterestMouseEnter",value:function(t){t.id===this.pointOfInterest.id&&(this.addClass("cv-point-of-interest-indicator-highlight"),this.setTimeTooltipTime(),this.setTimeTooltipText(),this.positionMouseTimeDisplay(),this.showMouseTimeDisplay())}},{key:"onGlancePointOfInterestMouseLeave",value:function(){this.removeClass("cv-point-of-interest-indicator-highlight"),this.hideMouseTimeDisplay()}},{key:"setTimeTooltipText",value:function(){var t;null===(t=this.getTimeTooltip())||void 0===t||t.setCustomChapterText(this.pointOfInterest.description)}},{key:"clearTimeTooltipText",value:function(){var t;null===(t=this.getTimeTooltip())||void 0===t||t.setCustomChapterText()}},{key:"setTimeTooltipTime",value:function(){var t=this.getTimeTooltip();null==t||t.updateTime(this.getPointOfInterestTime())}},{key:"positionMouseTimeDisplay",value:function(){var t,e,r=null===(t=this.getSeekBar())||void 0===t?void 0:t.el();if(r){var n=yl.dom.findPosition(r),i=this.getPointOfInterestTime()/this.player().duration();null===(e=this.getMouseTimeDisplay())||void 0===e||e.update(n,i)}}},{key:"showMouseTimeDisplay",value:function(){var t;null===(t=this.getMouseTimeDisplay())||void 0===t||t.forceShow()}},{key:"hideMouseTimeDisplay",value:function(){var t;null===(t=this.getMouseTimeDisplay())||void 0===t||t.removeForceShow()}},{key:"getSeekBar",value:function(){var t;return null===(t=this.player().controlBar.getChild("ProgressControl"))||void 0===t?void 0:t.getChild("SeekBar")}},{key:"getMouseTimeDisplay",value:function(){var t;return null===(t=this.getSeekBar())||void 0===t?void 0:t.getChild("MouseTimeDisplay")}},{key:"getTimeTooltip",value:function(){var t;return null===(t=this.getMouseTimeDisplay())||void 0===t?void 0:t.getChild("TimeTooltip")}}],n&&QP(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("Component"));function ox(t){return ox="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ox(t)}function ax(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,sx(n.key),n)}}function sx(t){var e=function(t,e){if("object"!=ox(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=ox(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ox(e)?e:String(e)}function ux(t,e,r){return e=fx(e),function(t,e){if(e&&("object"===ox(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,lx()?Reflect.construct(e,r||[],fx(t).constructor):e.apply(t,r))}function lx(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(lx=function(){return!!t})()}function cx(){return cx="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=fx(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},cx.apply(this,arguments)}function fx(t){return fx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fx(t)}function hx(t,e){return hx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},hx(t,e)}var px=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=ux(this,e,[t,r])).pointsOfInterestVisible=r.pointsOfInterestVisible,n.toggle(n.pointsOfInterestVisible),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&hx(t,e)}(e,t),r=e,(n=[{key:"handleToggle",value:function(){this.toggle(!this.pointsOfInterestVisible)}},{key:"toggle",value:function(t){t?this.toggleOn():this.toggleOff()}},{key:"toggleOn",value:function(){yl.dom.addClass(this.toggleEl,"on"),this.pointsOfInterestVisible=!0,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}},{key:"toggleOff",value:function(){yl.dom.removeClass(this.toggleEl,"on"),this.pointsOfInterestVisible=!1,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}},{key:"handleClick",value:function(t){t.stopImmediatePropagation()}},{key:"createEl",value:function(t,r,n){this.handlerBound||(this.handleToggle=this.handleToggle.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggle),this.toggleEl=yl.dom.createEl("div",{className:"custom-toggle toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),this.toggleEl.addEventListener("click",this.handleToggle);var i=cx(fx(e.prototype),"createEl",this).call(this,t,{className:"vjs-menu-item cv-cog-menu-item",innerHTML:'\n <span class="vjs-menu-item-text">Points of Interest</span>\n <span class="cv-toggle-container"></span>'},n);return i.children[1].appendChild(this.toggleEl),i}}])&&ax(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("MenuItem"));function dx(t){return dx="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dx(t)}function yx(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,mx(n.key),n)}}function mx(t){var e=function(t,e){if("object"!=dx(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=dx(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==dx(e)?e:String(e)}function vx(t,e,r){return e=bx(e),function(t,e){if(e&&("object"===dx(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _x(t)}(t,gx()?Reflect.construct(e,r||[],bx(t).constructor):e.apply(t,r))}function gx(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(gx=function(){return!!t})()}function bx(t){return bx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},bx(t)}function _x(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function wx(t,e){return wx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},wx(t,e)}yl.registerComponent("PointsOfInterestMenuItem",px);var Tx,Sx=yl.getPlugin("plugin"),Ex="cvplayer-points-of-interest",Ox=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=vx(this,e,[t])).pointOfInterestIndicators=[],n.enabled=!0,n.pointsOfInterest=null==r?void 0:r.pointsOfInterest,n.initialize=n.initialize.bind(_x(n)),n.updateBuffered=n.updateBuffered.bind(_x(n)),n.updatePlaybackProgress=n.updatePlaybackProgress.bind(_x(n)),n.player.one("loadedmetadata",(function(){return n.player.ready(n.initialize)})),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wx(t,e)}(e,t),r=e,(n=[{key:"initialize",value:function(){this.pointsOfInterest&&(Al()&&"false"===Rl(Ex)&&(this.enabled=!1),this.setupTrack(),this.createPointOfInterestIndicators(),this.addMenuItem(),this.bindListeners())}},{key:"bindListeners",value:function(){var t=this;this.player.on("progress",this.updateBuffered),this.player.on("timeupdate",this.updatePlaybackProgress),this.player.on("dispose",(function(){var e,r;null===(e=t.player)||void 0===e||e.off("progress",t.updateBuffered),null===(r=t.player)||void 0===r||r.off("timeupdate",t.updatePlaybackProgress)}))}},{key:"togglePointsOfInterest",value:function(t){Dl(Ex,t.toString()),this.pointOfInterestIndicators.forEach((function(e){return e.toggleVisibility(t)}))}},{key:"setupTrack",value:function(){var t=this.player.addTextTrack("metadata","pointsofinterest");this.pointsOfInterest.forEach((function(e){t.addCue({startTime:e.startTime,endTime:e.endTime,text:e.description})})),t.trigger({type:"loadeddata",target:t})}},{key:"createPointOfInterestIndicators",value:function(){var t,e=this,r=null===(t=this.player.controlBar.getChild("ProgressControl"))||void 0===t?void 0:t.getChild("SeekBar");this.pointsOfInterest.forEach((function(t){var n=new ix(e.player,{pointOfInterest:t});e.pointOfInterestIndicators.push(n),r.addChild(n)}))}},{key:"addMenuItem",value:function(){var t;(null===(t=this.player.getChild("collapserator"))||void 0===t?void 0:t.getChild("cogButton")).addItem({index:0,ctor:px,name:"PointsOfInterestMenuItem",options:{pointsOfInterestVisible:this.enabled}})}},{key:"updateBuffered",value:function(){var t=this;this.pointOfInterestIndicators.forEach((function(e){return e.updateBuffered(w_(t.player))}))}},{key:"updatePlaybackProgress",value:function(){var t=this;this.pointOfInterestIndicators.forEach((function(e){return e.updatePlaybackProgress(t.player.currentTime())}))}}])&&yx(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(Sx);function kx(t){return kx="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kx(t)}function Cx(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Px(n.key),n)}}function Px(t){var e=function(t,e){if("object"!=kx(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=kx(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==kx(e)?e:String(e)}function xx(t,e,r){return e=Lx(e),function(t,e){if(e&&("object"===kx(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,jx()?Reflect.construct(e,r||[],Lx(t).constructor):e.apply(t,r))}function jx(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(jx=function(){return!!t})()}function Lx(t){return Lx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Lx(t)}function Ix(t,e){return Ix=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ix(t,e)}yl.registerPlugin("pointsOfInterestPlugin",Ox),function(t){t.None="None",t.Complete="Complete",t.Incomplete="Incomplete"}(Tx||(Tx={}));var Ax=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=xx(this,e,[t,r])).update(),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ix(t,e)}(e,t),r=e,n=[{key:"update",value:function(){this.options_.activityStatus===Tx.Complete?this.addClass("cv-activity-completed"):this.removeClass("cv-activity-completed")}},{key:"handleClick",value:function(){if(this.options_.activityStatus=this.getToggledActivityStatus(),this.update(),this.options_.clickHandler){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];this.options_.clickHandler.call(this,e)}}},{key:"buildCSSClass",value:function(){return"cv-activity-status-button"}},{key:"getToggledActivityStatus",value:function(){return this.options_.activityStatus===Tx.None||this.options_.activityStatus===Tx.Incomplete?Tx.Complete:this.options_.activityStatus===Tx.Complete?Tx.Incomplete:void 0}}],n&&Cx(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("Button"));function Rx(t){return Rx="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rx(t)}function Dx(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Mx(n.key),n)}}function Mx(t){var e=function(t,e){if("object"!=Rx(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Rx(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Rx(e)?e:String(e)}function Nx(t,e,r){return e=Ux(e),function(t,e){if(e&&("object"===Rx(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Bx()?Reflect.construct(e,r||[],Ux(t).constructor):e.apply(t,r))}function Bx(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Bx=function(){return!!t})()}function Ux(t){return Ux=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ux(t)}function Fx(t,e){return Fx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Fx(t,e)}Ax.prototype.controlText_="Complete";var Vx=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Nx(this,e,arguments)}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Fx(t,e)}(e,t),r=e,(n=[{key:"setActivityStatus",value:function(t,e){var r=this;t!==this.activityStatus&&(this.activityStatus=t,this.onToggleStatus=e,this.player.ready((function(){r.renderActivityStatusButton()})))}},{key:"renderActivityStatusButton",value:function(){this.button&&this.player.removeChild(this.button),this.button=new Ax(this.player,{activityStatus:this.activityStatus,clickHandler:this.onToggleStatus}),this.player.addChild(this.button)}}])&&Dx(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getPlugin("plugin"));function Hx(t){return Hx="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hx(t)}function qx(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,zx(n.key),n)}}function zx(t){var e=function(t,e){if("object"!=Hx(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Hx(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Hx(e)?e:String(e)}function Wx(t,e,r){return e=Kx(e),function(t,e){if(e&&("object"===Hx(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Gx()?Reflect.construct(e,r||[],Kx(t).constructor):e.apply(t,r))}function Gx(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Gx=function(){return!!t})()}function Xx(){return Xx="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Kx(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},Xx.apply(this,arguments)}function Kx(t){return Kx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Kx(t)}function Yx(t,e){return Yx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Yx(t,e)}yl.registerPlugin("activityStatusPlugin",Vx);var Qx=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=Wx(this,e,[t,r])).initialize(),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Yx(t,e)}(e,t),r=e,n=[{key:"initialize",value:function(){this.setPosition()}},{key:"buildCSSClass",value:function(){return"cv-range-indicator ".concat(Xx(Kx(e.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(t,r,n){return Xx(Kx(e.prototype),"createEl",this).call(this,t,Object.assign(Object.assign({},r),{className:this.buildCSSClass()}),n)}},{key:"setPosition",value:function(){var t=this.player().duration();this.el_.style.left=this.options_.time/t*100+"%"}}],n&&qx(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("Component"));function $x(t){return $x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$x(t)}function Jx(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Zx(n.key),n)}}function Zx(t){var e=function(t,e){if("object"!=$x(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=$x(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==$x(e)?e:String(e)}function tj(t,e,r){return e=nj(e),function(t,e){if(e&&("object"===$x(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ej()?Reflect.construct(e,r||[],nj(t).constructor):e.apply(t,r))}function ej(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ej=function(){return!!t})()}function rj(){return rj="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=nj(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},rj.apply(this,arguments)}function nj(t){return nj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},nj(t)}function ij(t,e){return ij=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ij(t,e)}var oj=function(t){function e(t,r){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),tj(this,e,[t,r])}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ij(t,e)}(e,t),r=e,(n=[{key:"buildCSSClass",value:function(){return"cv-replay-view-button ".concat(rj(nj(e.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(t,r,n){return rj(nj(e.prototype),"createEl",this).call(this,t,Object.assign(Object.assign({},r),{innerHTML:'<span class="'.concat(this.options_.iconClassName,'"></span><span>').concat(this.options_.label,"</span>"),className:this.buildCSSClass()}),n)}},{key:"handleClick",value:function(){this.options_.onPress()}}])&&Jx(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("ClickableComponent"));function aj(t){return aj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},aj(t)}function sj(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,uj(n.key),n)}}function uj(t){var e=function(t,e){if("object"!=aj(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=aj(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==aj(e)?e:String(e)}function lj(t,e,r){return e=hj(e),function(t,e){if(e&&("object"===aj(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,cj()?Reflect.construct(e,r||[],hj(t).constructor):e.apply(t,r))}function cj(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(cj=function(){return!!t})()}function fj(){return fj="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=hj(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},fj.apply(this,arguments)}function hj(t){return hj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},hj(t)}function pj(t,e){return pj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pj(t,e)}var dj=function(t){function e(t,r){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),lj(this,e,[t,r])}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&pj(t,e)}(e,t),r=e,(n=[{key:"buildCSSClass",value:function(){return"cv-replay-view ".concat(fj(hj(e.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(t,r,n){var i=fj(hj(e.prototype),"createEl",this).call(this,t,Object.assign(Object.assign({},r),{className:this.buildCSSClass()}),n),o=yl.dom.createEl("h5",{innerHTML:this.localize("This clip has finished"),className:"cv-replay-heading"}),a=yl.dom.createEl("div",{className:"cv-button-container"}),s=new oj(this.player_,{label:this.localize("Replay clip"),iconClassName:"cv-replay-icon",onPress:this.options_.onReplayPress}),u=new oj(this.player_,{label:this.localize("Continue watching"),iconClassName:"cv-continue-icon",onPress:this.options_.onContinuePress});return i.appendChild(o),i.appendChild(a),a.appendChild(s.el()),a.appendChild(u.el()),i}}])&&sj(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getComponent("Component"));function yj(t){return yj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yj(t)}function mj(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,vj(n.key),n)}}function vj(t){var e=function(t,e){if("object"!=yj(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=yj(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==yj(e)?e:String(e)}function gj(t,e,r){return e=wj(e),function(t,e){if(e&&("object"===yj(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,bj()?Reflect.construct(e,r||[],wj(t).constructor):e.apply(t,r))}function bj(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(bj=function(){return!!t})()}function _j(){return _j="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=wj(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},_j.apply(this,arguments)}function wj(t){return wj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},wj(t)}function Tj(t,e){return Tj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Tj(t,e)}var Sj=function(t){function e(t,r){var n;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=gj(this,e,[t,r])).startTime=parseFloat(r.startTime.toPrecision(4)),n.endTime=parseFloat(r.endTime.toPrecision(4)),n.dismissed=!1,n.startTime>n.endTime)throw Error("Range start cannot be greater than range end");return n.bindFunctions(),n.initialize(),n}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Tj(t,e)}(e,t),r=e,n=[{key:"bindFunctions",value:function(){this.onReady=this.onReady.bind(this),this.onTimeUpdateOrSeeked=this.onTimeUpdateOrSeeked.bind(this),this.onReplayPress=this.onReplayPress.bind(this),this.onContinuePress=this.onContinuePress.bind(this)}},{key:"initialize",value:function(){var t=this;this.player.one("loadedmetadata",(function(){return t.player.ready(t.onReady)})),this.player.on("timeupdate",this.onTimeUpdateOrSeeked),this.player.on("seeked",this.onTimeUpdateOrSeeked)}},{key:"onReady",value:function(){this.addCssClasses(),this.showRangeIndicators(),this.addMaskToProgressBar()}},{key:"onTimeUpdateOrSeeked",value:function(){if(!this.dismissed){var t=this.player.currentTime();if(!(t<this.startTime))return t>this.endTime?(this.showReplayView(),this.disablePlayToggle(),this.player.pause(),void this.player.currentTime(this.endTime)):void 0;this.player.currentTime(this.startTime)}}},{key:"onReplayPress",value:function(){this.player.currentTime(this.startTime),this.player.play(),this.hideReplayView(),this.enablePlayToggle()}},{key:"onContinuePress",value:function(){this.dismissed=!0,this.player.play(),this.hideRangeIndicators(),this.removeMaskFromProgressBar(),this.hideReplayView(),this.enablePlayToggle(),this.removeCssClasses()}},{key:"showRangeIndicators",value:function(){var t,e=null===(t=this.player.controlBar.getChild("ProgressControl"))||void 0===t?void 0:t.getChild("SeekBar");this.startTimeIndicator||(this.startTimeIndicator=new Qx(this.player,{time:this.startTime}),null==e||e.addChild(this.startTimeIndicator)),this.endTimeIndicator||(this.endTimeIndicator=new Qx(this.player,{time:this.endTime}),null==e||e.addChild(this.endTimeIndicator))}},{key:"hideRangeIndicators",value:function(){var t,e;null===(t=this.startTimeIndicator)||void 0===t||t.hide(),null===(e=this.endTimeIndicator)||void 0===e||e.hide()}},{key:"addMaskToProgressBar",value:function(){var t,e=null===(t=this.player.controlBar.getChild("ProgressControl"))||void 0===t?void 0:t.getChild("SeekBar"),r=null==e?void 0:e.el().getElementsByClassName("cv-chapter-bar-items");if(r&&r.length){var n=r[0],i=this.player.duration(),o=this.startTime/i*100,a=100-this.endTime/i*100;n.style.clipPath="inset(".concat(-5,"em ").concat(a,"% ").concat(-5,"em ").concat(o,"%)")}}},{key:"removeMaskFromProgressBar",value:function(){var t,e=null===(t=this.player.controlBar.getChild("ProgressControl"))||void 0===t?void 0:t.getChild("SeekBar"),r=null==e?void 0:e.el().getElementsByClassName("cv-chapter-bar-items");r&&r.length&&(r[0].style.clipPath="")}},{key:"showReplayView",value:function(){this.replayView||(this.replayView=new dj(this.player,{onContinuePress:this.onContinuePress,onReplayPress:this.onReplayPress}),this.player.addChild(this.replayView)),this.replayView.show()}},{key:"hideReplayView",value:function(){var t;null===(t=this.replayView)||void 0===t||t.hide()}},{key:"getPlayToggle",value:function(){var t=this.player.getChild("collapserator");return null==t?void 0:t.getChild("PlayToggle")}},{key:"enablePlayToggle",value:function(){var t=this.getPlayToggle();t&&t.enable()}},{key:"disablePlayToggle",value:function(){var t=this.getPlayToggle();t&&t.disable()}},{key:"addCssClasses",value:function(){this.player.addClass("cv-range-indicator-plugin")}},{key:"removeCssClasses",value:function(){this.player.removeClass("cv-range-indicator-plugin")}},{key:"dispose",value:function(){var t,r,n;this.removeCssClasses(),this.player.off("timeupdate",this.onTimeUpdateOrSeeked),this.player.off("seeked",this.onTimeUpdateOrSeeked),null===(t=this.startTimeIndicator)||void 0===t||t.dispose(),null===(r=this.endTimeIndicator)||void 0===r||r.dispose(),null===(n=this.replayView)||void 0===n||n.dispose(),_j(wj(e.prototype),"dispose",this).call(this)}}],n&&mj(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(yl.getPlugin("plugin"));yl.registerPlugin("rangeIndicatorPlugin",Sj);var Ej=function(){var t,e,r;return null!==(r=null===(e=null===(t=window.crypto)||void 0===t?void 0:t.randomUUID)||void 0===e?void 0:e.call(t))&&void 0!==r?r:Math.random().toString()};function Oj(t){return Oj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oj(t)}function kj(){kj=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),s=new j(n||[]);return i(a,"_invoke",{value:k(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var _={};l(_,a,(function(){return this}));var w=Object.getPrototypeOf,T=w&&w(w(L([])));T&&T!==r&&n.call(T,a)&&(_=T);var S=b.prototype=v.prototype=Object.create(_);function E(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Oj(c)&&n.call(c,"__await")?e.resolve(c.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(c).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function k(e,r,n){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(Oj(e)+" is not iterable")}return g.prototype=b,i(S,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},E(O.prototype),l(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new O(c(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(x),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Cj(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Pj(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,xj(n.key),n)}}function xj(t){var e=function(t,e){if("object"!=Oj(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Oj(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Oj(e)?e:String(e)}function jj(t,e,r){return e=Aj(e),function(t,e){if(e&&("object"===Oj(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Lj()?Reflect.construct(e,r||[],Aj(t).constructor):e.apply(t,r))}function Lj(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Lj=function(){return!!t})()}function Ij(){return Ij="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Aj(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},Ij.apply(this,arguments)}function Aj(t){return Aj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Aj(t)}function Rj(t,e){return Rj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Rj(t,e)}var Dj=function(t){function e(t,r){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),jj(this,e,[t,r])}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Rj(t,e)}(e,t),r=e,(n=[{key:"getPlayerOptions",value:function(){var t,r,n=Ij(Aj(e.prototype),"getPlayerOptions",this).call(this);return(null===(t=n.devicesConfig)||void 0===t?void 0:t.canUserCastToDevices)?Object.assign(Object.assign({},n),{techOrder:["devices"].concat((r=n.techOrder,function(t){if(Array.isArray(t))return Cj(t)}(r)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||function(t,e){if(t){if("string"==typeof t)return Cj(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Cj(t,e):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())),devices:{instanceId:Ej()}}):n}},{key:"configurePlugins",value:function(){var t;try{this.options.onClickCreateClip&&this.player.createClipButtonPlugin({onClick:this.options.onClickCreateClip}),this.options.onRequestPictureInPicture&&this.player.pictureInPicture({onRequestPictureInPicture:this.options.onRequestPictureInPicture}),(null===(t=this.options.pointsOfInterest)||void 0===t?void 0:t.length)&&this.player.pointsOfInterestPlugin({pointsOfInterest:this.options.pointsOfInterest})}catch(t){console.log("failed to register plugins",t)}}},{key:"setNextVideo",value:function(t,e,r){this.player.nextVideoPlugin&&this.player.nextVideoPlugin().setNextVideo(t,e,r)}},{key:"enablePictureInPicture",value:function(){var t=this.player.pictureInPicture();t&&t.enablePictureInPicture()}},{key:"disablePictureInPicture",value:function(){var t=this.player.pictureInPicture();t&&t.disablePictureInPicture()}},{key:"togglePictureInPicture",value:function(t){var e=this.player.pictureInPicture();e&&e.togglePictureInPicture(t)}},{key:"additionalSetup",value:function(t){var r,n,i,o,a,s=this,u=Object.create(null,{additionalSetup:{get:function(){return Ij(Aj(e.prototype),"additionalSetup",s)}}});return n=this,i=void 0,o=void 0,a=kj().mark((function e(){var n;return kj().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u.additionalSetup.call(this,t),this.options.showResources&&t.resources&&this.player.resourcesPlugin&&this.player.resourcesPlugin({resources:t.resources.list,imageCdnUrl:this.options.imageCdnUrl}),"MasterClip"!==t.mediaType){e.next=7;break}if(null!==(n=t.additionalData)){e.next=6;break}throw Error("Invalid clip data");case 6:this.player.clipPlugin({startTime:n.startTime,endTime:n.endTime});case 7:if(!(null===(r=this.options.devicesConfig)||void 0===r?void 0:r.canUserCastToDevices)){e.next=11;break}if(this.player.devicesPlugin){e.next=10;break}return e.abrupt("return");case 10:this.player.devicesPlugin(Object.assign(Object.assign({},this.options.devicesConfig),{userId:parseInt(t.viewerId),title:t.title,analyticsService:this.analyticsService}));case 11:"MasterVideo"===t.mediaType&&this.options.startTime&&this.options.endTime&&this.player.rangeIndicatorPlugin({startTime:this.options.startTime,endTime:this.options.endTime});case 12:case"end":return e.stop()}}),e,this)})),new(o||(o=Promise))((function(t,e){function r(t){try{u(a.next(t))}catch(t){e(t)}}function s(t){try{u(a.throw(t))}catch(t){e(t)}}function u(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(r,s)}u((a=a.apply(n,i||[])).next())}))}},{key:"setActivityStatus",value:function(t,e){this.player.activityStatusPlugin().setActivityStatus(t,e)}}])&&Pj(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(JC)})(),n})()));